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
9,766,442
03/19/2012 07:27:17
1,270,835
03/15/2012 06:09:02
1
0
Croping Of Image
I want to crop images according to user choice( example as we see while uploa dprofile pic on Facebook). I am able to crop to image with fixed size. But i need user can modify it according to their choice. Any idea or link. I need it in PHP with either JQuery or AJAX or both.
php
jquery
ajax
null
null
06/25/2012 14:58:55
not a real question
Croping Of Image === I want to crop images according to user choice( example as we see while uploa dprofile pic on Facebook). I am able to crop to image with fixed size. But i need user can modify it according to their choice. Any idea or link. I need it in PHP with either JQuery or AJAX or both.
1
9,171,639
02/07/2012 05:55:49
1,193,924
02/07/2012 05:49:49
1
0
struct with malloc
i am trying to re-implement malloc for an assignment.. we are supposed to use an array as the memory and all the malloc functions are to be implemented in that array.. for example if someone requires 8bits of memory its to be given off that array... to keep in track of the used memory i have the following structure typedef struct node{ int size; struct node *prev; }node; but i'm having trouble initializing the header inside so it will be using memory from the array to store its values... any ideas on how to get that done??? thanx in advance..
c
null
null
null
null
02/08/2012 06:40:45
not a real question
struct with malloc === i am trying to re-implement malloc for an assignment.. we are supposed to use an array as the memory and all the malloc functions are to be implemented in that array.. for example if someone requires 8bits of memory its to be given off that array... to keep in track of the used memory i have the following structure typedef struct node{ int size; struct node *prev; }node; but i'm having trouble initializing the header inside so it will be using memory from the array to store its values... any ideas on how to get that done??? thanx in advance..
1
10,411,894
05/02/2012 10:27:05
1,343,789
04/19/2012 11:08:11
1
0
How to Implement facebook using Titanium
How to display events, fan pages, groups from Facebook using titanium sdk in iphone application.
iphone
titanium-mobile
null
null
null
05/03/2012 12:38:11
not a real question
How to Implement facebook using Titanium === How to display events, fan pages, groups from Facebook using titanium sdk in iphone application.
1
6,745,742
07/19/2011 10:31:09
807,515
06/20/2011 23:00:59
43
1
Should one use built in classes?
I've started programming C++ and I want to start programming useful stuff. I know that for strings, one can use std::string or char-arrays. One can also use std::vectors as well, instead of arrays. What should one do? Reinvent the wheel, or use the built in utilities?
c++
stl
null
null
null
07/19/2011 10:41:05
not constructive
Should one use built in classes? === I've started programming C++ and I want to start programming useful stuff. I know that for strings, one can use std::string or char-arrays. One can also use std::vectors as well, instead of arrays. What should one do? Reinvent the wheel, or use the built in utilities?
4
2,989,424
06/07/2010 12:27:58
360,408
06/07/2010 12:27:58
1
0
Terminating inetd service
I have written some simple inetd-Service in C. It reads a string from the user, compares it to another string and then terminates. At least, this is what I want it to do. After reaching the `return(0);`-statement in main(), it simply restarts and presents me a new prompt. Is there any way to tell inetd that it should terminate the connection to the client after the main-function of the service returns? My inted.conf-entry for my service: `pass stream tcp nowait root /usr/sbin/tcpd /home/jth/pass`
c
linux
inetd
null
null
06/08/2010 03:08:43
too localized
Terminating inetd service === I have written some simple inetd-Service in C. It reads a string from the user, compares it to another string and then terminates. At least, this is what I want it to do. After reaching the `return(0);`-statement in main(), it simply restarts and presents me a new prompt. Is there any way to tell inetd that it should terminate the connection to the client after the main-function of the service returns? My inted.conf-entry for my service: `pass stream tcp nowait root /usr/sbin/tcpd /home/jth/pass`
3
4,771,721
01/23/2011 01:19:33
389,867
07/12/2010 20:58:17
1
0
Best memory use in MySql server
I have a MySql server with 2Gb of memory. What's the best configuration to use then with best results? How can I "distribute" this memory fine to MySql server?
mysql
linux
null
null
null
01/23/2011 18:44:05
off topic
Best memory use in MySql server === I have a MySql server with 2Gb of memory. What's the best configuration to use then with best results? How can I "distribute" this memory fine to MySql server?
2
5,038,831
02/18/2011 07:49:22
587,010
01/24/2011 04:51:14
6
2
onChange="document.myform.submit() and PHP while loop
I have the following code and on it's own works fine, but I need to have it in a PHP while loop as there may be hundreds of records. This does not work, meaning it does not submit the form. Any help with this code, or other ideas that will work are appreciated. It also needs to write to a mysql DB the new value. Please note that I am less than a newbie with javascript. Thanks <while> <form action="home.php" method="post" name="status"> <input type="hidden" name="record_number" value="<? echo $r['record_number']; ?>"> <input type="hidden" name="submit" value="cstatus"> <select name="statuscode" type="dropdown" style="font-size: 8pt; width: 60px" onChange="status.submit();"> <? if($r['statuscode']) { echo "<option value='".$r['statuscode']."'>".$r['statuscode']."</option>"; } ?> <option value='Open'>Open</option> <option value='Closed'>Closed</option> <option value='Pending'>Pending</option> <option value='Cancelled'>Cancelled</option> </select> </form> </while>
javascript
null
null
null
null
05/23/2012 17:27:37
too localized
onChange="document.myform.submit() and PHP while loop === I have the following code and on it's own works fine, but I need to have it in a PHP while loop as there may be hundreds of records. This does not work, meaning it does not submit the form. Any help with this code, or other ideas that will work are appreciated. It also needs to write to a mysql DB the new value. Please note that I am less than a newbie with javascript. Thanks <while> <form action="home.php" method="post" name="status"> <input type="hidden" name="record_number" value="<? echo $r['record_number']; ?>"> <input type="hidden" name="submit" value="cstatus"> <select name="statuscode" type="dropdown" style="font-size: 8pt; width: 60px" onChange="status.submit();"> <? if($r['statuscode']) { echo "<option value='".$r['statuscode']."'>".$r['statuscode']."</option>"; } ?> <option value='Open'>Open</option> <option value='Closed'>Closed</option> <option value='Pending'>Pending</option> <option value='Cancelled'>Cancelled</option> </select> </form> </while>
3
7,671,420
10/06/2011 07:39:24
964,869
09/26/2011 10:40:58
1
0
stack level too deep
SystemStackError in Admin/menu itemsController#update usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/autosave_association.rb:244:in `nested_records_changed_for_autosave?' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/autosave_association.rb:223:in `changed_for_autosave?' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/autosave_association.rb:249:in `nested_records_changed_for_autosave?' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/autosave_association.rb:249:in `each' /home/cis/.bundler/ruby/1.8/deadlock_retry-f02d51360cb2/lib/deadlock_retry.rb:36:in `transaction' /home/cis/Projects/nishant/lecere/firms_admin/vendor/plugins/active_scaffold/lib/active_scaffold/actions/update.rb:74:in `do_update' /home/cis/Projects/nishant/lecere/firms_admin/vendor/plugins/active_scaffold/lib/active_scaffold/actions/update.rb:16:in `update'
stack
level
deep
null
null
10/06/2011 10:48:51
not a real question
stack level too deep === SystemStackError in Admin/menu itemsController#update usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/autosave_association.rb:244:in `nested_records_changed_for_autosave?' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/autosave_association.rb:223:in `changed_for_autosave?' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/autosave_association.rb:249:in `nested_records_changed_for_autosave?' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/autosave_association.rb:249:in `each' /home/cis/.bundler/ruby/1.8/deadlock_retry-f02d51360cb2/lib/deadlock_retry.rb:36:in `transaction' /home/cis/Projects/nishant/lecere/firms_admin/vendor/plugins/active_scaffold/lib/active_scaffold/actions/update.rb:74:in `do_update' /home/cis/Projects/nishant/lecere/firms_admin/vendor/plugins/active_scaffold/lib/active_scaffold/actions/update.rb:16:in `update'
1
3,819,190
09/29/2010 06:17:14
40,933
11/26/2008 06:37:26
3,766
124
How to post a text in twitter as a hyperlink in iphone?
I want to post a text in a twitter as a hyperlink.I am able to post it as a simple text message.I have used Twitter+OAuth.i have used [_engine sendUpdate:@"My twitter update"]; method to post my content.How can post is as a hyperlink so clicking on text opens a link.Any ideas? Thanks.
iphone
twitter
hyperlink
null
null
null
open
How to post a text in twitter as a hyperlink in iphone? === I want to post a text in a twitter as a hyperlink.I am able to post it as a simple text message.I have used Twitter+OAuth.i have used [_engine sendUpdate:@"My twitter update"]; method to post my content.How can post is as a hyperlink so clicking on text opens a link.Any ideas? Thanks.
0
11,737,760
07/31/2012 10:08:49
1,565,344
07/31/2012 09:57:12
1
0
yum erase python = destruction
I'm sure this question will make many laugh, but certainly not me. I were trying to install some packages for python earlier today and also trying to change pydev compiler in AptanaStudio, and something was not working out. So I decided to completely remove python from the computer (I ran Fedora 10) by running sudo yum erase python I definitely should have not done this. Even the message that 788 packages would be removed didn't stop me. As a result, I seem to have erased the whole Fedora interface. After a lot of pain, I managed to copy all the important stuff to external hard drive (apparently the hard drive of the computer remained intact), but Fedora doesn't want to start. So here's what I'd like to find out: 1)what exactly happened and why? 2)is it possible to restore the interface somehow? thanks
python
fedora
aptana3
destroy
null
07/31/2012 10:28:31
off topic
yum erase python = destruction === I'm sure this question will make many laugh, but certainly not me. I were trying to install some packages for python earlier today and also trying to change pydev compiler in AptanaStudio, and something was not working out. So I decided to completely remove python from the computer (I ran Fedora 10) by running sudo yum erase python I definitely should have not done this. Even the message that 788 packages would be removed didn't stop me. As a result, I seem to have erased the whole Fedora interface. After a lot of pain, I managed to copy all the important stuff to external hard drive (apparently the hard drive of the computer remained intact), but Fedora doesn't want to start. So here's what I'd like to find out: 1)what exactly happened and why? 2)is it possible to restore the interface somehow? thanks
2
6,464,885
06/24/2011 07:51:48
6,851
09/15/2008 12:43:17
374
16
Rails: Plus sign in GET-Request replaced by space
In Rails 3 (Ruby 1.9.2) I send an request Started GET "/controller/action?path=/41_+" But the parameter list looks like this: {"path"=>"/41_ ", "controller"=>"controller", "action"=>"action"} Whats going wrong here? The `-`, `*` or `.` sign works fine, its just the `+`which will be replaced by a space.
ruby-on-rails
ruby
get
request
params
null
open
Rails: Plus sign in GET-Request replaced by space === In Rails 3 (Ruby 1.9.2) I send an request Started GET "/controller/action?path=/41_+" But the parameter list looks like this: {"path"=>"/41_ ", "controller"=>"controller", "action"=>"action"} Whats going wrong here? The `-`, `*` or `.` sign works fine, its just the `+`which will be replaced by a space.
0
9,401,886
02/22/2012 19:49:02
718,990
04/21/2011 13:04:47
178
2
Getting error when trying to convert milliseconds to date
I'm trying to convert `[lastViewedAt] => 1329939559` so it will be `YYYY-MM-DD, HH:MM`, but I'm getting this error message every time I try: `Warning: gmdate() expects parameter 2 to be long, object given in ...` If I write the milliseconds (copy > paste) in plain text in my function (from `gmdate('Y-m-d, H:i', $information['lastViewedAt'])` to `gmdate('Y-m-d, H:i', '1329939559')`) I'll get the proper result of it - 2012-02-22, 19:39. Why is it behave like this? Thanks in advance.
php
date
milliseconds
null
null
null
open
Getting error when trying to convert milliseconds to date === I'm trying to convert `[lastViewedAt] => 1329939559` so it will be `YYYY-MM-DD, HH:MM`, but I'm getting this error message every time I try: `Warning: gmdate() expects parameter 2 to be long, object given in ...` If I write the milliseconds (copy > paste) in plain text in my function (from `gmdate('Y-m-d, H:i', $information['lastViewedAt'])` to `gmdate('Y-m-d, H:i', '1329939559')`) I'll get the proper result of it - 2012-02-22, 19:39. Why is it behave like this? Thanks in advance.
0
4,102,060
11/04/2010 22:35:42
233,421
12/17/2009 00:41:31
1,023
0
InnoDB Storage Engine Dropped From Oracle MySQL Classic Edition?
InnoDB Storage Engine Dropped From Oracle MySQL Classic Edition? What does this mean for the average developer who uses mysql or shall we start looking for alternatives? http://goo.gl/fb/nIMX6 Thanks in advance ;-) Just trying to understand what this really means?
sql
mysql
oracle
innodb
null
07/25/2012 12:54:04
not a real question
InnoDB Storage Engine Dropped From Oracle MySQL Classic Edition? === InnoDB Storage Engine Dropped From Oracle MySQL Classic Edition? What does this mean for the average developer who uses mysql or shall we start looking for alternatives? http://goo.gl/fb/nIMX6 Thanks in advance ;-) Just trying to understand what this really means?
1
3,696,310
09/12/2010 19:46:13
398,431
07/21/2010 20:25:29
811
1
Unremovable wordpress posts
**How to make post unremovable?** So, even admin should not have abillity to delete it.
wordpress
posts
null
null
null
09/12/2010 20:57:24
off topic
Unremovable wordpress posts === **How to make post unremovable?** So, even admin should not have abillity to delete it.
2
4,311,118
11/30/2010 06:27:58
427,343
08/21/2010 22:57:26
1
0
Using Wget to download an entire rss feed
Im trying to move a Drupal sites content http://www.philcooke.com/rss.xml using wget, but I am unable to download more then the 10 most recent stories. Ive set the rss feed in the Drupal admin to set rss feeds to show 30 items per feed. Ive done some searching, but I cant seem to find a way to have this display "all" and then use wget to download the posts. If anyone knows of another way to download all of the posts (and comments for that matter) I wouldnt be opposed to trying that out as well, as at this point, Im willing to give any xml importing method a try. I should also mention the site runs Drupal 5.2 and Im trying to move it to Wordpress 3.0.1
linux
wordpress
drupal
null
null
null
open
Using Wget to download an entire rss feed === Im trying to move a Drupal sites content http://www.philcooke.com/rss.xml using wget, but I am unable to download more then the 10 most recent stories. Ive set the rss feed in the Drupal admin to set rss feeds to show 30 items per feed. Ive done some searching, but I cant seem to find a way to have this display "all" and then use wget to download the posts. If anyone knows of another way to download all of the posts (and comments for that matter) I wouldnt be opposed to trying that out as well, as at this point, Im willing to give any xml importing method a try. I should also mention the site runs Drupal 5.2 and Im trying to move it to Wordpress 3.0.1
0
10,529,758
05/10/2012 08:00:35
1,374,532
05/04/2012 09:03:27
13
1
How to read text data in particular font using C#?
Consider a notepad Text.txt which has a data that can be read only with font "Terminal". Now how to implement in C#?
c#
null
null
null
null
05/11/2012 16:07:06
not a real question
How to read text data in particular font using C#? === Consider a notepad Text.txt which has a data that can be read only with font "Terminal". Now how to implement in C#?
1
11,025,207
06/14/2012 00:22:04
1,416,345
05/25/2012 01:01:28
4
0
SQL Server - bulk insert column
I need to insert csv file into sql server db. The problem is I keep getting a Bulk load data conversion error (type mismatch or invalid character for the specified codepage) error. this is repeated 10 times and Msg 7399, Level 16, State 1, Line 1 The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error. Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)". The specific column that errors is a bigint,primary key,no null field. I have made sure all 5000 records have a 4 digit number and there are no nulls. I am tired of fighting this and simply want to insert the date and datavalue fields into this table --CSResult. The problem is sql server simply errors out and I am thinking it wants values for ALL the fields. IS there a way to insert data into the columns I want? Any ideas. BULK INSERT [ACCUCHEK_1].[CsSchema].[CsResult] ( FROM 'c:\june132012.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) this is what the data looks like: 3857,2011-05-19 04:00:00.000,Y,,82,N,N,,4,1,1,10,,1,,535/31706815 3858,2011-05-19 02:23:00.000,Y,,128,N,N,,4,1,1,10,,1,,535/31706815
sql-server
bulkinsert
null
null
null
null
open
SQL Server - bulk insert column === I need to insert csv file into sql server db. The problem is I keep getting a Bulk load data conversion error (type mismatch or invalid character for the specified codepage) error. this is repeated 10 times and Msg 7399, Level 16, State 1, Line 1 The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error. Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)". The specific column that errors is a bigint,primary key,no null field. I have made sure all 5000 records have a 4 digit number and there are no nulls. I am tired of fighting this and simply want to insert the date and datavalue fields into this table --CSResult. The problem is sql server simply errors out and I am thinking it wants values for ALL the fields. IS there a way to insert data into the columns I want? Any ideas. BULK INSERT [ACCUCHEK_1].[CsSchema].[CsResult] ( FROM 'c:\june132012.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) this is what the data looks like: 3857,2011-05-19 04:00:00.000,Y,,82,N,N,,4,1,1,10,,1,,535/31706815 3858,2011-05-19 02:23:00.000,Y,,128,N,N,,4,1,1,10,,1,,535/31706815
0
11,118,552
06/20/2012 11:29:33
1,469,025
06/20/2012 11:15:23
1
0
Previous and Next Button on javascript
I have a javascript for gallery which works well. When i click a picture it fades in and brings the picture i selected but it doesnt have a NEXT and PREVIUS buttons. I have to close that picture and open another. How can i add a next and previous buttons to it? THNX Here is the js code (thickbox.js): /* * Thickbox 3.1 - One Box To Rule Them All. * By Cody Lindley (http://www.codylindley.com) * Copyright (c) 2007 cody lindley * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php */ var tb_pathToImage = "images/loadingAnimation.gif"; /*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/ //on page load call tb_init $(document).ready(function(){ tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox imgLoader = new Image();// preload image imgLoader.src = tb_pathToImage; }); //add thickbox to href & area elements that have a class of .thickbox function tb_init(domChunk){ $(domChunk).click(function(){ var t = this.title || this.name || null; var a = this.href || this.alt; var g = this.rel || false; tb_show(t,a,g); this.blur(); return false; }); } function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link try { if (typeof document.body.style.maxHeight === "undefined") {//if IE 6 $("body","html").css({height: "100%", width: "100%"}); $("html").css("overflow","hidden"); if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6 $("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>"); $("#TB_overlay").click(tb_remove); } }else{//all others if(document.getElementById("TB_overlay") === null){ $("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>"); $("#TB_overlay").click(tb_remove); } } if(tb_detectMacXFF()){ $("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash }else{ $("#TB_overlay").addClass("TB_overlayBG");//use background and opacity } if(caption===null){caption="";} $("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page $('#TB_load').show();//show loader var baseURL; if(url.indexOf("?")!==-1){ //ff there is a query string involved baseURL = url.substr(0, url.indexOf("?")); }else{ baseURL = url; } var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/; var urlType = baseURL.toLowerCase().match(urlString); if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images TB_PrevCaption = ""; TB_PrevURL = ""; TB_PrevHTML = ""; TB_NextCaption = ""; TB_NextURL = ""; TB_NextHTML = ""; TB_imageCount = ""; TB_FoundURL = false; if(imageGroup){ TB_TempArray = $("a[@rel="+imageGroup+"]").get(); for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) { var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); if (!(TB_TempArray[TB_Counter].href == url)) { if (TB_FoundURL) { TB_NextCaption = TB_TempArray[TB_Counter].title; TB_NextURL = TB_TempArray[TB_Counter].href; TB_NextHTML = "<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>"; } else { TB_PrevCaption = TB_TempArray[TB_Counter].title; TB_PrevURL = TB_TempArray[TB_Counter].href; TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>"; } } else { TB_FoundURL = true; TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length); } } } imgPreloader = new Image(); imgPreloader.onload = function(){ imgPreloader.onload = null; // Resizing large images - orginal by Christian Montoya edited by me. var pagesize = tb_getPageSize(); var x = pagesize[0] - 150; var y = pagesize[1] - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } // End Resizing TB_WIDTH = imageWidth + 30; TB_HEIGHT = imageHeight + 60; $("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>"); $("#TB_closeWindowButton").click(tb_remove); if (!(TB_PrevHTML === "")) { function goPrev(){ if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);} $("#TB_window").remove(); $("body").append("<div id='TB_window'></div>"); tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); return false; } $("#TB_prev").click(goPrev); } if (!(TB_NextHTML === "")) { function goNext(){ $("#TB_window").remove(); $("body").append("<div id='TB_window'></div>"); tb_show(TB_NextCaption, TB_NextURL, imageGroup); return false; } $("#TB_next").click(goNext); } document.onkeydown = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close tb_remove(); } else if(keycode == 190){ // display previous image if(!(TB_NextHTML == "")){ document.onkeydown = ""; goNext(); } } else if(keycode == 188){ // display next image if(!(TB_PrevHTML == "")){ document.onkeydown = ""; goPrev(); } } }; tb_position(); $("#TB_load").remove(); $("#TB_ImageOff").click(tb_remove); $("#TB_window").css({display:"block"}); //for safari using css instead of show }; imgPreloader.src = url; }else{//code to show html var queryString = url.replace(/^[^\?]+\??/,''); var params = tb_parseQuery( queryString ); TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL ajaxContentW = TB_WIDTH - 30; ajaxContentH = TB_HEIGHT - 45; if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window urlNoQuery = url.split('TB_'); $("#TB_iframeContent").remove(); if(params['modal'] != "true"){//iframe no modal $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>"); }else{//iframe modal $("#TB_overlay").unbind(); $("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'> </iframe>"); } }else{// not an iframe, ajax if($("#TB_window").css("display") != "block"){ if(params['modal'] != "true"){//ajax no modal $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>"); }else{//ajax modal $("#TB_overlay").unbind(); $("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>"); } }else{//this means the window is already up, we are just loading new content via ajax $("#TB_ajaxContent")[0].style.width = ajaxContentW +"px"; $("#TB_ajaxContent")[0].style.height = ajaxContentH +"px"; $("#TB_ajaxContent")[0].scrollTop = 0; $("#TB_ajaxWindowTitle").html(caption); } } $("#TB_closeWindowButton").click(tb_remove); if(url.indexOf('TB_inline') != -1){ $("#TB_ajaxContent").append($('#' + params['inlineId']).children()); $("#TB_window").unload(function () { $('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished }); tb_position(); $("#TB_load").remove(); $("#TB_window").css({display:"block"}); }else if(url.indexOf('TB_iframe') != -1){ tb_position(); if($.browser.safari){//safari needs help because it will not fire iframe onload $("#TB_load").remove(); $("#TB_window").css({display:"block"}); } }else{ $("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method tb_position(); $("#TB_load").remove(); tb_init("#TB_ajaxContent a.thickbox"); $("#TB_window").css({display:"block"}); }); } } if(!params['modal']){ document.onkeyup = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close tb_remove(); } }; } } catch(e) { //nothing here } } //helper functions below function tb_showIframe(){ $("#TB_load").remove(); $("#TB_window").css({display:"block"}); } function tb_remove() { $("#TB_imageOff").unbind("click"); $("#TB_closeWindowButton").unbind("click"); $("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();}); $("#TB_load").remove(); if (typeof document.body.style.maxHeight == "undefined") {//if IE 6 $("body","html").css({height: "auto", width: "auto"}); $("html").css("overflow",""); } document.onkeydown = ""; document.onkeyup = ""; return false; } function tb_position() { $("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'}); if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6 $("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'}); } } function tb_parseQuery ( query ) { var Params = {}; if ( ! query ) {return Params;}// return empty object var Pairs = query.split(/[;&]/); for ( var i = 0; i < Pairs.length; i++ ) { var KeyVal = Pairs[i].split('='); if ( ! KeyVal || KeyVal.length != 2 ) {continue;} var key = unescape( KeyVal[0] ); var val = unescape( KeyVal[1] ); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } function tb_getPageSize(){ var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; arrayPageSize = [w,h]; return arrayPageSize; } function tb_detectMacXFF() { var userAgent = navigator.userAgent.toLowerCase(); if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) { return true; } } ` and here is the HTML: ` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>STUDIOCLICK - PORTFOLIO</title> <!-- CSS Files --> <link href="css/reset.css" rel="stylesheet" type="text/css" /> <link href="css/style.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="css/thickbox.css" type="text/css" media="screen" /> <link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen" /> <style type="text/css"> .sf-sub-indicator { behavior: url(css/iepngfix.htc) } ; </style> <!-- End of CSS Files --> <!-- Javascript Files --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript" src="javascript/thickbox.js"></script> <script type="text/javascript" src="javascript/superfish.js"></script> <script type="text/javascript" src="javascript/dd.min.js"></script> <script type="text/javascript"> //<![CDATA[ // initialise plugins $(document).ready(function() { if ($('#slider').length == 1) { $('#slider').cycle({ fx: 'fade', speed: 2000, timeout: 4000 }); } var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent); if (!ie6) { $('ul.sf-menu').superfish({ delay: 1000, // one second delay on mouseout animation: {opacity:'show',height:'show'}, // fade-in and slide-down animation speed: 'normal' // faster animation speed }); } else { DD_belatedPNG.fix('#topbar, img, a, .commentbubble, .infobubble, .view-all, #category-picture1, #category-picture2, #category-picture3, #footer'); } }); //]]> </script> <!-- End of Javascript Files --> </head> <body> <!-- Wrapper --> <div id="wrapper"> <!-- Top bar --> <div id="topbar"> <!-- Logo --> <img class="logo" src="images/logo.png" alt="logo" /> <!-- Menu --> <div id="secnav"> <ul> <li> <a href="#">SIGN UP</a> </li> <li class="noimg"> <a href="#">LOGIN</a> </li> </ul> </div> <div class="menu"> <ul class="sf-menu"> <li> <a href="index.html">HOME</a></li> <li> <a href="about.html">ABOUT</a> <ul> <li class="first"><a href="about.html">TEAM</a></li> <li><a href="about.html">PHILOSOPHY</a></li> <li><a href="about.html">COMPANY</a></li> <li class="last"><a href="about.html">PRODUCTS</a> <ul> <li class="first"><a href="about.html">PRODUCT ONE</a></li> <li><a href="about.html">PRODUCT TWO</a></li> <li class="last"><a href="about.html">PRODUCT THREE</a></li> </ul> </li> </ul> </li> <li> <a class="on" href="portfolio.html">PORTFOLIO</a> <ul> <li><a href="portfolio.html">WEBDESIGN</a></li> <li><a href="portfolio.html">PHOTOS</a> <ul> <li class="first"><a href="portfolio.html">NATURE</a></li> <li><a href="portfolio.html">ANIMALS</a></li> <li class="last"><a href="portfolio.html">CITIES</a> <ul> <li class="first"><a href="portfolio.html">NEW YORK</a></li> <li><a href="portfolio.html">MONTREAL</a></li> <li class="last"><a href="portfolio.html">LAS VEGAS</a></li> </ul> </li> </ul> </li> <li class="last"><a href="portfolio.html">ARTS</a></li> </ul> </li> <li> <a href="blog.html">BLOG</a> <ul> <li class="first"><a href="blog.html">CATEGORY ONE</a></li> <li><a href="blog.html">CATEGORY TWO</a></li> <li class="last"><a href="blog.html">CATEGORY THREE</a></li> </ul> </li> <li> <a href="contact.html">CONTACT</a> </li> </ul> </div> <!-- End of Menu --> </div> <!-- End of Topbar --> <!-- Introtext --> <div id="introtext"> <!-- Subcategory--> <div class="subcategory"> <h1>CATEGORY +</h1> <ul> <li><a href="#">NATURE</a></li> <li><a href="#">CITY</a></li> <li><a href="#">ANIMAL</a></li> <li><a href="#">ABSTRACT</a></li> </ul> </div> <!-- End of subcategory--> <h1>PORTFOLIO +</h1> <p>Praesent id dolor et dolor viverra sagittis. Integer scelerisque quam nec est congue tempor eu ut metus. Etiam fringilla aliquam nulla eu bibendum. Ut cursus, ligula vel mollis hendrerit, est enim posuere velit, ultricies pretium tortor massa ut ipsum. Aenean a aliquet arcu.</p> <div class="clear"></div> </div> <!-- End of introtext --> <!-- Content --> <div class="portfolioitem"> <ul> <li><a class="thickbox" href="images/photo9big.jpg"><img src="images/photo9.png" alt="photo"/></a></li> <li><a class="thickbox" href="images/photo1big.jpg"><img src="images/photo1.png" alt="photo"/></a></li> <li class="last"><a class="thickbox" href="images/photo3big.jpg" ><img src="images/photo3.png" alt="photo" /></a></li> <li><a class="thickbox" href="images/photo6big.jpg"><img src="images/photo6.png" alt="photo"/></a></li> <li><a class="thickbox" href="images/photo5big.jpg"><img src="images/photo5.png" alt="photo"/></a></li> <li class="last"><a class="thickbox" href="images/photo4big.jpg" ><img class="right" src="images/photo4.png" alt="photo" /></a></li> <li><a class="thickbox" href="images/photo7big.jpg"><img src="images/photo7.png" alt="photo"/></a></li> <li><a class="thickbox" href="images/photo2big.jpg" ><img class="right" src="images/photo2.png" alt="photo" /></a></li> <li class="last"><a class="thickbox" href="images/photo1big.jpg"><img src="images/photo1.png" alt="photo"/></a></li> </ul> </div> <div id="portfolionav"> <ul> <li class="on"><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li class="next"><a href="#">NEXT</a></li> </ul> </div> <!-- End of content--> <div class="clear"></div> <!-- Footer--> <!-- End of footer--> </div> <!-- End of wrapper --> </body> </html> `
javascript
jquery
html
css
null
06/20/2012 11:34:22
not a real question
Previous and Next Button on javascript === I have a javascript for gallery which works well. When i click a picture it fades in and brings the picture i selected but it doesnt have a NEXT and PREVIUS buttons. I have to close that picture and open another. How can i add a next and previous buttons to it? THNX Here is the js code (thickbox.js): /* * Thickbox 3.1 - One Box To Rule Them All. * By Cody Lindley (http://www.codylindley.com) * Copyright (c) 2007 cody lindley * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php */ var tb_pathToImage = "images/loadingAnimation.gif"; /*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/ //on page load call tb_init $(document).ready(function(){ tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox imgLoader = new Image();// preload image imgLoader.src = tb_pathToImage; }); //add thickbox to href & area elements that have a class of .thickbox function tb_init(domChunk){ $(domChunk).click(function(){ var t = this.title || this.name || null; var a = this.href || this.alt; var g = this.rel || false; tb_show(t,a,g); this.blur(); return false; }); } function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link try { if (typeof document.body.style.maxHeight === "undefined") {//if IE 6 $("body","html").css({height: "100%", width: "100%"}); $("html").css("overflow","hidden"); if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6 $("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>"); $("#TB_overlay").click(tb_remove); } }else{//all others if(document.getElementById("TB_overlay") === null){ $("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>"); $("#TB_overlay").click(tb_remove); } } if(tb_detectMacXFF()){ $("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash }else{ $("#TB_overlay").addClass("TB_overlayBG");//use background and opacity } if(caption===null){caption="";} $("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page $('#TB_load').show();//show loader var baseURL; if(url.indexOf("?")!==-1){ //ff there is a query string involved baseURL = url.substr(0, url.indexOf("?")); }else{ baseURL = url; } var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/; var urlType = baseURL.toLowerCase().match(urlString); if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images TB_PrevCaption = ""; TB_PrevURL = ""; TB_PrevHTML = ""; TB_NextCaption = ""; TB_NextURL = ""; TB_NextHTML = ""; TB_imageCount = ""; TB_FoundURL = false; if(imageGroup){ TB_TempArray = $("a[@rel="+imageGroup+"]").get(); for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) { var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); if (!(TB_TempArray[TB_Counter].href == url)) { if (TB_FoundURL) { TB_NextCaption = TB_TempArray[TB_Counter].title; TB_NextURL = TB_TempArray[TB_Counter].href; TB_NextHTML = "<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>"; } else { TB_PrevCaption = TB_TempArray[TB_Counter].title; TB_PrevURL = TB_TempArray[TB_Counter].href; TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>"; } } else { TB_FoundURL = true; TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length); } } } imgPreloader = new Image(); imgPreloader.onload = function(){ imgPreloader.onload = null; // Resizing large images - orginal by Christian Montoya edited by me. var pagesize = tb_getPageSize(); var x = pagesize[0] - 150; var y = pagesize[1] - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } // End Resizing TB_WIDTH = imageWidth + 30; TB_HEIGHT = imageHeight + 60; $("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>"); $("#TB_closeWindowButton").click(tb_remove); if (!(TB_PrevHTML === "")) { function goPrev(){ if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);} $("#TB_window").remove(); $("body").append("<div id='TB_window'></div>"); tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); return false; } $("#TB_prev").click(goPrev); } if (!(TB_NextHTML === "")) { function goNext(){ $("#TB_window").remove(); $("body").append("<div id='TB_window'></div>"); tb_show(TB_NextCaption, TB_NextURL, imageGroup); return false; } $("#TB_next").click(goNext); } document.onkeydown = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close tb_remove(); } else if(keycode == 190){ // display previous image if(!(TB_NextHTML == "")){ document.onkeydown = ""; goNext(); } } else if(keycode == 188){ // display next image if(!(TB_PrevHTML == "")){ document.onkeydown = ""; goPrev(); } } }; tb_position(); $("#TB_load").remove(); $("#TB_ImageOff").click(tb_remove); $("#TB_window").css({display:"block"}); //for safari using css instead of show }; imgPreloader.src = url; }else{//code to show html var queryString = url.replace(/^[^\?]+\??/,''); var params = tb_parseQuery( queryString ); TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL ajaxContentW = TB_WIDTH - 30; ajaxContentH = TB_HEIGHT - 45; if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window urlNoQuery = url.split('TB_'); $("#TB_iframeContent").remove(); if(params['modal'] != "true"){//iframe no modal $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>"); }else{//iframe modal $("#TB_overlay").unbind(); $("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'> </iframe>"); } }else{// not an iframe, ajax if($("#TB_window").css("display") != "block"){ if(params['modal'] != "true"){//ajax no modal $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>"); }else{//ajax modal $("#TB_overlay").unbind(); $("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>"); } }else{//this means the window is already up, we are just loading new content via ajax $("#TB_ajaxContent")[0].style.width = ajaxContentW +"px"; $("#TB_ajaxContent")[0].style.height = ajaxContentH +"px"; $("#TB_ajaxContent")[0].scrollTop = 0; $("#TB_ajaxWindowTitle").html(caption); } } $("#TB_closeWindowButton").click(tb_remove); if(url.indexOf('TB_inline') != -1){ $("#TB_ajaxContent").append($('#' + params['inlineId']).children()); $("#TB_window").unload(function () { $('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished }); tb_position(); $("#TB_load").remove(); $("#TB_window").css({display:"block"}); }else if(url.indexOf('TB_iframe') != -1){ tb_position(); if($.browser.safari){//safari needs help because it will not fire iframe onload $("#TB_load").remove(); $("#TB_window").css({display:"block"}); } }else{ $("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method tb_position(); $("#TB_load").remove(); tb_init("#TB_ajaxContent a.thickbox"); $("#TB_window").css({display:"block"}); }); } } if(!params['modal']){ document.onkeyup = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close tb_remove(); } }; } } catch(e) { //nothing here } } //helper functions below function tb_showIframe(){ $("#TB_load").remove(); $("#TB_window").css({display:"block"}); } function tb_remove() { $("#TB_imageOff").unbind("click"); $("#TB_closeWindowButton").unbind("click"); $("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();}); $("#TB_load").remove(); if (typeof document.body.style.maxHeight == "undefined") {//if IE 6 $("body","html").css({height: "auto", width: "auto"}); $("html").css("overflow",""); } document.onkeydown = ""; document.onkeyup = ""; return false; } function tb_position() { $("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'}); if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6 $("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'}); } } function tb_parseQuery ( query ) { var Params = {}; if ( ! query ) {return Params;}// return empty object var Pairs = query.split(/[;&]/); for ( var i = 0; i < Pairs.length; i++ ) { var KeyVal = Pairs[i].split('='); if ( ! KeyVal || KeyVal.length != 2 ) {continue;} var key = unescape( KeyVal[0] ); var val = unescape( KeyVal[1] ); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } function tb_getPageSize(){ var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; arrayPageSize = [w,h]; return arrayPageSize; } function tb_detectMacXFF() { var userAgent = navigator.userAgent.toLowerCase(); if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) { return true; } } ` and here is the HTML: ` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>STUDIOCLICK - PORTFOLIO</title> <!-- CSS Files --> <link href="css/reset.css" rel="stylesheet" type="text/css" /> <link href="css/style.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="css/thickbox.css" type="text/css" media="screen" /> <link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen" /> <style type="text/css"> .sf-sub-indicator { behavior: url(css/iepngfix.htc) } ; </style> <!-- End of CSS Files --> <!-- Javascript Files --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript" src="javascript/thickbox.js"></script> <script type="text/javascript" src="javascript/superfish.js"></script> <script type="text/javascript" src="javascript/dd.min.js"></script> <script type="text/javascript"> //<![CDATA[ // initialise plugins $(document).ready(function() { if ($('#slider').length == 1) { $('#slider').cycle({ fx: 'fade', speed: 2000, timeout: 4000 }); } var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent); if (!ie6) { $('ul.sf-menu').superfish({ delay: 1000, // one second delay on mouseout animation: {opacity:'show',height:'show'}, // fade-in and slide-down animation speed: 'normal' // faster animation speed }); } else { DD_belatedPNG.fix('#topbar, img, a, .commentbubble, .infobubble, .view-all, #category-picture1, #category-picture2, #category-picture3, #footer'); } }); //]]> </script> <!-- End of Javascript Files --> </head> <body> <!-- Wrapper --> <div id="wrapper"> <!-- Top bar --> <div id="topbar"> <!-- Logo --> <img class="logo" src="images/logo.png" alt="logo" /> <!-- Menu --> <div id="secnav"> <ul> <li> <a href="#">SIGN UP</a> </li> <li class="noimg"> <a href="#">LOGIN</a> </li> </ul> </div> <div class="menu"> <ul class="sf-menu"> <li> <a href="index.html">HOME</a></li> <li> <a href="about.html">ABOUT</a> <ul> <li class="first"><a href="about.html">TEAM</a></li> <li><a href="about.html">PHILOSOPHY</a></li> <li><a href="about.html">COMPANY</a></li> <li class="last"><a href="about.html">PRODUCTS</a> <ul> <li class="first"><a href="about.html">PRODUCT ONE</a></li> <li><a href="about.html">PRODUCT TWO</a></li> <li class="last"><a href="about.html">PRODUCT THREE</a></li> </ul> </li> </ul> </li> <li> <a class="on" href="portfolio.html">PORTFOLIO</a> <ul> <li><a href="portfolio.html">WEBDESIGN</a></li> <li><a href="portfolio.html">PHOTOS</a> <ul> <li class="first"><a href="portfolio.html">NATURE</a></li> <li><a href="portfolio.html">ANIMALS</a></li> <li class="last"><a href="portfolio.html">CITIES</a> <ul> <li class="first"><a href="portfolio.html">NEW YORK</a></li> <li><a href="portfolio.html">MONTREAL</a></li> <li class="last"><a href="portfolio.html">LAS VEGAS</a></li> </ul> </li> </ul> </li> <li class="last"><a href="portfolio.html">ARTS</a></li> </ul> </li> <li> <a href="blog.html">BLOG</a> <ul> <li class="first"><a href="blog.html">CATEGORY ONE</a></li> <li><a href="blog.html">CATEGORY TWO</a></li> <li class="last"><a href="blog.html">CATEGORY THREE</a></li> </ul> </li> <li> <a href="contact.html">CONTACT</a> </li> </ul> </div> <!-- End of Menu --> </div> <!-- End of Topbar --> <!-- Introtext --> <div id="introtext"> <!-- Subcategory--> <div class="subcategory"> <h1>CATEGORY +</h1> <ul> <li><a href="#">NATURE</a></li> <li><a href="#">CITY</a></li> <li><a href="#">ANIMAL</a></li> <li><a href="#">ABSTRACT</a></li> </ul> </div> <!-- End of subcategory--> <h1>PORTFOLIO +</h1> <p>Praesent id dolor et dolor viverra sagittis. Integer scelerisque quam nec est congue tempor eu ut metus. Etiam fringilla aliquam nulla eu bibendum. Ut cursus, ligula vel mollis hendrerit, est enim posuere velit, ultricies pretium tortor massa ut ipsum. Aenean a aliquet arcu.</p> <div class="clear"></div> </div> <!-- End of introtext --> <!-- Content --> <div class="portfolioitem"> <ul> <li><a class="thickbox" href="images/photo9big.jpg"><img src="images/photo9.png" alt="photo"/></a></li> <li><a class="thickbox" href="images/photo1big.jpg"><img src="images/photo1.png" alt="photo"/></a></li> <li class="last"><a class="thickbox" href="images/photo3big.jpg" ><img src="images/photo3.png" alt="photo" /></a></li> <li><a class="thickbox" href="images/photo6big.jpg"><img src="images/photo6.png" alt="photo"/></a></li> <li><a class="thickbox" href="images/photo5big.jpg"><img src="images/photo5.png" alt="photo"/></a></li> <li class="last"><a class="thickbox" href="images/photo4big.jpg" ><img class="right" src="images/photo4.png" alt="photo" /></a></li> <li><a class="thickbox" href="images/photo7big.jpg"><img src="images/photo7.png" alt="photo"/></a></li> <li><a class="thickbox" href="images/photo2big.jpg" ><img class="right" src="images/photo2.png" alt="photo" /></a></li> <li class="last"><a class="thickbox" href="images/photo1big.jpg"><img src="images/photo1.png" alt="photo"/></a></li> </ul> </div> <div id="portfolionav"> <ul> <li class="on"><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li class="next"><a href="#">NEXT</a></li> </ul> </div> <!-- End of content--> <div class="clear"></div> <!-- Footer--> <!-- End of footer--> </div> <!-- End of wrapper --> </body> </html> `
1
11,376,200
07/07/2012 15:21:47
1,508,883
07/07/2012 15:08:40
1
0
Magento 'Classic theme' free theme problems
I'm using the free theme from templates-master called magento classic theme for my web store. Problem is i followed the instructions to the letter, but the left 'category' menu is expanded permanently, which is _very_ long indeed. Also the center of the home page is blank. Even if I add a widget to show the latest products (updated every morning at 8am) it shows the paragraph ( p ) html tags, but nothing inside them. Like the template is not being converted to html for display. The template: http://templates-master.com/magento-templates/free-classic-magento-theme.html The install instructions: http://templates-master.com/free-classic-theme-installation-instructions Can give URL to my website if needed. Never used stack overfow before so don't know if I can send it privately or not.
xml
templates
magento
themes
null
07/10/2012 18:19:18
too localized
Magento 'Classic theme' free theme problems === I'm using the free theme from templates-master called magento classic theme for my web store. Problem is i followed the instructions to the letter, but the left 'category' menu is expanded permanently, which is _very_ long indeed. Also the center of the home page is blank. Even if I add a widget to show the latest products (updated every morning at 8am) it shows the paragraph ( p ) html tags, but nothing inside them. Like the template is not being converted to html for display. The template: http://templates-master.com/magento-templates/free-classic-magento-theme.html The install instructions: http://templates-master.com/free-classic-theme-installation-instructions Can give URL to my website if needed. Never used stack overfow before so don't know if I can send it privately or not.
3
11,525,033
07/17/2012 14:43:28
1,353,045
04/24/2012 07:02:00
5
1
Pyload crashes whole system (debian)
I try to setup the Pyload-Server on Debian GNU/Linux 6.0 (on a raspberry pi if this matters) but it doesn't work as expected.. I can start the Server via python [...]/pyLoadCore.py, I can access the WebGui and I can start downloads but after several (random) minutes the WebGui doesn't respond anymore and my ssh-connection gets lost. At this point I cant access anymore and I have to reboot (power off) the whole system. If I don't start pyload the system runs well for days. I'm not that familiar with UNIX and have no idea where to look for error messages.. the Pyload log itselt doesn't say anything about the crash. Any suggestions?
python
debian
null
null
null
07/17/2012 16:44:59
off topic
Pyload crashes whole system (debian) === I try to setup the Pyload-Server on Debian GNU/Linux 6.0 (on a raspberry pi if this matters) but it doesn't work as expected.. I can start the Server via python [...]/pyLoadCore.py, I can access the WebGui and I can start downloads but after several (random) minutes the WebGui doesn't respond anymore and my ssh-connection gets lost. At this point I cant access anymore and I have to reboot (power off) the whole system. If I don't start pyload the system runs well for days. I'm not that familiar with UNIX and have no idea where to look for error messages.. the Pyload log itselt doesn't say anything about the crash. Any suggestions?
2
10,614,073
05/16/2012 07:42:20
296,258
03/18/2010 06:19:04
36
0
Integrating BI Dashboards or Interactive Reporting into Powerbuilder 12.5
We are developing critical custom made applications for our customers in **Powerbuilder 12.5** As we want enhance them in terms of **BI Dashboards** or **Interactive Reporting** we would like to know some software products or components that provide this type of technology and can be integrated into Powerbuilder Thank you in advance for your cooperation. John
business-intelligence
powerbuilder
dashboard
null
null
05/18/2012 17:12:53
off topic
Integrating BI Dashboards or Interactive Reporting into Powerbuilder 12.5 === We are developing critical custom made applications for our customers in **Powerbuilder 12.5** As we want enhance them in terms of **BI Dashboards** or **Interactive Reporting** we would like to know some software products or components that provide this type of technology and can be integrated into Powerbuilder Thank you in advance for your cooperation. John
2
9,667,966
03/12/2012 13:31:40
1,051,641
11/17/2011 11:22:13
27
0
best look and feel gui for python
This sounds stupid and there are a lot of thread related to this topic but yet I am asking. Is there some good ui library that has catchy graphical interface? many suggest for pythons default ui tkinter some suggest wxPython. They seems some like windows look. Adobe air has cool look in ui. Also GNOME 3.x has nice look when we press Super key for search. Is there any GUI library that can provide me these kind of effects in ui?
python
user-interface
null
null
null
03/13/2012 02:31:57
not constructive
best look and feel gui for python === This sounds stupid and there are a lot of thread related to this topic but yet I am asking. Is there some good ui library that has catchy graphical interface? many suggest for pythons default ui tkinter some suggest wxPython. They seems some like windows look. Adobe air has cool look in ui. Also GNOME 3.x has nice look when we press Super key for search. Is there any GUI library that can provide me these kind of effects in ui?
4
2,008,211
01/05/2010 18:32:56
199,397
10/30/2009 03:24:40
621
42
Feedback from Interview
I recently interviewed for an S.E. position with a major software company and didn't get the job. I really wanted this position, and eventually hope to find one very close to it, so it's important to me to know what went wrong. I asked the recruiter for some feedback and was basically shot down, citing "privacy terms" (surprising, considering I am under an NDA with them). I only asked once - during the conversation where I was told I didn't get the position - so I have an opportunity to ask again, I feel. What advice would you give me in trying to extract as much info as possible (positive or negative)? Thanks,-aj
interview-questions
career-development
null
null
null
02/03/2012 19:49:28
off topic
Feedback from Interview === I recently interviewed for an S.E. position with a major software company and didn't get the job. I really wanted this position, and eventually hope to find one very close to it, so it's important to me to know what went wrong. I asked the recruiter for some feedback and was basically shot down, citing "privacy terms" (surprising, considering I am under an NDA with them). I only asked once - during the conversation where I was told I didn't get the position - so I have an opportunity to ask again, I feel. What advice would you give me in trying to extract as much info as possible (positive or negative)? Thanks,-aj
2
5,383,265
03/21/2011 20:30:38
634,146
02/25/2011 12:49:05
116
3
When we use the XMl
When we use the XMl What user cases. For example, can work perfectly with the XMl instead of used DataBase asp.net
xml
xml-serialization
xml-schema
linq-to-xml
xmlhttprequest
03/22/2011 00:13:30
not a real question
When we use the XMl === When we use the XMl What user cases. For example, can work perfectly with the XMl instead of used DataBase asp.net
1
6,253,732
06/06/2011 14:42:48
626,528
02/21/2011 12:08:07
196
7
WCF call hangs and terminates by timeout
Getting this message: > This request operation sent to > net.pipe://127.0.0.1/MyService did > not receive a reply within the > configured timeout (00:01:00). The > time allotted to this operation may > have been a portion of a longer > timeout. This may be because the > service is still processing the > operation or because the service was > unable to send a reply message. > Please consider increasing the > operation timeout (by casting the > channel/proxy to IContextChannel and > setting the OperationTimeout property) > and ensure that the service is able to > connect to the client. Any ideas, why it can happen?
.net
wcf
clr
null
null
06/07/2011 12:19:00
not a real question
WCF call hangs and terminates by timeout === Getting this message: > This request operation sent to > net.pipe://127.0.0.1/MyService did > not receive a reply within the > configured timeout (00:01:00). The > time allotted to this operation may > have been a portion of a longer > timeout. This may be because the > service is still processing the > operation or because the service was > unable to send a reply message. > Please consider increasing the > operation timeout (by casting the > channel/proxy to IContextChannel and > setting the OperationTimeout property) > and ensure that the service is able to > connect to the client. Any ideas, why it can happen?
1
1,714,452
11/11/2009 10:56:07
78,258
03/15/2009 12:48:45
6
2
Microsoft .NET vs. LAMP for startups
for startups with limited capital, creating web based business application, which platform is the best bet, is it MS.NET (browser+IIS+Database+vb.net/c#) or LAMP stack? Any views with respect to RAD, real cost of software (not just the licenses), architecture, SOA, OOP, framework, scalability, extensibility would be helpful on .NET vs LAMP.
.net
lamp
null
null
null
null
open
Microsoft .NET vs. LAMP for startups === for startups with limited capital, creating web based business application, which platform is the best bet, is it MS.NET (browser+IIS+Database+vb.net/c#) or LAMP stack? Any views with respect to RAD, real cost of software (not just the licenses), architecture, SOA, OOP, framework, scalability, extensibility would be helpful on .NET vs LAMP.
0
3,538,673
08/21/2010 19:50:25
253,202
01/18/2010 13:13:37
33
1
how to set keepgenerated property in tomcat 7
Can anybody say what i'm doing wrong: i add <init-param> for servlet <servlet-name>jsp</servlet-name> in CATALINA_HOME/conf/web.xml But generated jso servlet is not available in work directory. Thx
java
jsp
tomcat
null
null
null
open
how to set keepgenerated property in tomcat 7 === Can anybody say what i'm doing wrong: i add <init-param> for servlet <servlet-name>jsp</servlet-name> in CATALINA_HOME/conf/web.xml But generated jso servlet is not available in work directory. Thx
0
3,420,008
08/05/2010 23:41:38
146,780
07/29/2009 01:23:43
2,424
8
Hex edit a dll to change a dependency name?
I have a dll which is dependent of OPENGL.DLL . However, Windows comes with OpenGL32.dll . I want to change this dependency name in the dll binary so it looks for OpenGL32.dll instead. I tried opening it in VS's binary editor but I cant seem to make the name longer. I can for instance change it to OpenDD.dll but I cant add to it. How could I do this? Thanks
c++
c
dll
null
null
null
open
Hex edit a dll to change a dependency name? === I have a dll which is dependent of OPENGL.DLL . However, Windows comes with OpenGL32.dll . I want to change this dependency name in the dll binary so it looks for OpenGL32.dll instead. I tried opening it in VS's binary editor but I cant seem to make the name longer. I can for instance change it to OpenDD.dll but I cant add to it. How could I do this? Thanks
0
10,592,214
05/14/2012 23:10:46
1,095,159
12/13/2011 06:30:09
107
3
PHP OOP vs Inline
I am trying desperately to move towards OOP but just can't wrap my head around when to use it. I get the mechanics but when to use them is just not clicking. I'm curious if my current scenario is ripe for an OOP approach. I have 3 pages. Details.php shows two side by side divs. One where the user can add a note and another where they can see previous notes stored in MySQL. They can add notes and pull notes via AJAX function in Details.php. The javascript function calls add_notes.php to add notes to the database and it calls load_notes.php to load notes on page via Jquery .load() as well as when a new note is submitted to refresh the div. I'm a newbie but I feel in my bones there is a better way to organize this code. I would look into a framework but I am knee deep in this project already so looking for OOP ideas on how to break this up better or validation that I'm doing it in as streamlined a way as possible. All comments are helpful! DETAILS.PHP <script type="text/javascript"> $(document).ready(function(){ //When loading page load notes/messages tables and then reload when ajax is done $('#note_holder').load('load_notes.php?subcat=<? echo $subcat;?>'); //onclick handler send message btn $("#notes_submit").click(function(){ $(this).closest('form').submit(function(){ return false; }); var frm = $(this).closest('form'); var data = $(frm).serialize(); if($(frm).valid()){ $.post( "../php/add_notes_ajax.php", data, function(data){ $('#note_holder').load('load_notes.php?subcat=<? echo $subcat;?>'); } ); } }); }); </script> <div style="float:left; margin-left:15px;"> <form name="messages1" class="form" id="myforma" method="post" action="#" enctype="multipart/form-data"> <fieldset style="width:500px; height:400px; overflow:auto; font-size:11px;"> <legend>Click to View Previous Notes / Messages</legend> <div style="height:350px; overflow:auto;" class="note_holder" id="note_holder"> <!--This div is being called from the ajax script to load add_notes_ajax.php--> </div> </fieldset> <div style="margin-top:20px;"></div> </form> </div> <div style=" float:right;"> <form name="notes" class="notes" id="notes" method="post" action="#" enctype="multipart/form-data"> <fieldset style="width:300px; height:400px;"> <legend>Enter a Note</legend> <div style="margin-top:00px;"></div> <div> <textarea rows="20" cols="20" style="height:300px; width:290px;" name="notes"></textarea> <input type="submit" name="notes_submit" id="notes_submit" value="Submit Note" class="button" /> <input type="hidden" name="subcat" value= "<?php echo $subcat; ?>" /> </div> </fieldset> <div style="margin-top:20px;"></div> </form> </div> ADD NOTES AJAX.PHP <?php include_once('../bootstrap.php'); include_once('../site_globals/common_functions.php'); include_once('../site_globals/common_queries.php'); include_once('../php/gump.class.php'); page_protect(); error_reporting(0); $firstname = filter($_SESSION['user_name']); $myid = filter($_SESSION['user_id']); // All the variables from the submission form $notes = filter($_POST['notes']); $subcat = filter($_POST['subcat']); //Insert Notes into the database $stmt = $dbh->prepare(' INSERT INTO `notes` (date , sub_cat_id , notes) VALUES (:date , :subcat , :notes ) '); $stmt->bindValue('subcat', $subcat); $stmt->bindValue('date', date('Y-m-d H:i:s')); $stmt->bindValue('notes', $notes); $stmt->execute(); echo "This note was added successfully"; exit; ?> . LOAD NOTES.PHP <? require("../bootstrap.php"); require("../site_globals/common_functions.php"); require("../site_globals/common_queries.php"); page_protect(); error_reporting(0); $subcat = filter($_GET["subcat"]); $notes_res = getNotes($dbh, $subcat); ?> <table width="100%"> <thead style="text-align:left; "> <tr style="font-size:14px; font-weight:bold;"> <!-- <th><input class="check-all" type="checkbox" /></th>--> <th>Date</th> <th >Contents</th> <th>Preview / Print</th> </tr> </thead> <?php while ($messages_row = mysql_fetch_object($messages_res)):?> <tr> <td><a target="_blank" href="../site_hospital_files/thread.php?question_id=<?php echo $messages_row->question_id;?>"><?php echo substr($messages_row->reply, 0, 20) . '...';?></a></td> <td><?php echo date('Y-m-d', strtotime($messages_row->date_added));?></td> <td><a href="../site_hospital_files/pdf_messages_notes.php?msg_id=<?php echo $messages_row->question_id;?>&amp;var1=<?php echo $subcat;?>">Create PDF</a></td> </tr> <?php endwhile;?> <?php while($notes_row = $notes_res->fetch(PDO::FETCH_ASSOC)):?> <tr> <td><?php echo $notes_row[date]; ?></td> <td><?php echo substr($notes_row[notes], 0, 50).'...';?></td> <td><a href="pdf_messages_notes.php?note_id=<?php echo $notes_row->sub_cat_id; ?>&var1=<?php echo $subcat;?>">View</a></td> </tr> <?php endwhile;?> </table>
php
jquery
oop
null
null
05/15/2012 22:32:53
off topic
PHP OOP vs Inline === I am trying desperately to move towards OOP but just can't wrap my head around when to use it. I get the mechanics but when to use them is just not clicking. I'm curious if my current scenario is ripe for an OOP approach. I have 3 pages. Details.php shows two side by side divs. One where the user can add a note and another where they can see previous notes stored in MySQL. They can add notes and pull notes via AJAX function in Details.php. The javascript function calls add_notes.php to add notes to the database and it calls load_notes.php to load notes on page via Jquery .load() as well as when a new note is submitted to refresh the div. I'm a newbie but I feel in my bones there is a better way to organize this code. I would look into a framework but I am knee deep in this project already so looking for OOP ideas on how to break this up better or validation that I'm doing it in as streamlined a way as possible. All comments are helpful! DETAILS.PHP <script type="text/javascript"> $(document).ready(function(){ //When loading page load notes/messages tables and then reload when ajax is done $('#note_holder').load('load_notes.php?subcat=<? echo $subcat;?>'); //onclick handler send message btn $("#notes_submit").click(function(){ $(this).closest('form').submit(function(){ return false; }); var frm = $(this).closest('form'); var data = $(frm).serialize(); if($(frm).valid()){ $.post( "../php/add_notes_ajax.php", data, function(data){ $('#note_holder').load('load_notes.php?subcat=<? echo $subcat;?>'); } ); } }); }); </script> <div style="float:left; margin-left:15px;"> <form name="messages1" class="form" id="myforma" method="post" action="#" enctype="multipart/form-data"> <fieldset style="width:500px; height:400px; overflow:auto; font-size:11px;"> <legend>Click to View Previous Notes / Messages</legend> <div style="height:350px; overflow:auto;" class="note_holder" id="note_holder"> <!--This div is being called from the ajax script to load add_notes_ajax.php--> </div> </fieldset> <div style="margin-top:20px;"></div> </form> </div> <div style=" float:right;"> <form name="notes" class="notes" id="notes" method="post" action="#" enctype="multipart/form-data"> <fieldset style="width:300px; height:400px;"> <legend>Enter a Note</legend> <div style="margin-top:00px;"></div> <div> <textarea rows="20" cols="20" style="height:300px; width:290px;" name="notes"></textarea> <input type="submit" name="notes_submit" id="notes_submit" value="Submit Note" class="button" /> <input type="hidden" name="subcat" value= "<?php echo $subcat; ?>" /> </div> </fieldset> <div style="margin-top:20px;"></div> </form> </div> ADD NOTES AJAX.PHP <?php include_once('../bootstrap.php'); include_once('../site_globals/common_functions.php'); include_once('../site_globals/common_queries.php'); include_once('../php/gump.class.php'); page_protect(); error_reporting(0); $firstname = filter($_SESSION['user_name']); $myid = filter($_SESSION['user_id']); // All the variables from the submission form $notes = filter($_POST['notes']); $subcat = filter($_POST['subcat']); //Insert Notes into the database $stmt = $dbh->prepare(' INSERT INTO `notes` (date , sub_cat_id , notes) VALUES (:date , :subcat , :notes ) '); $stmt->bindValue('subcat', $subcat); $stmt->bindValue('date', date('Y-m-d H:i:s')); $stmt->bindValue('notes', $notes); $stmt->execute(); echo "This note was added successfully"; exit; ?> . LOAD NOTES.PHP <? require("../bootstrap.php"); require("../site_globals/common_functions.php"); require("../site_globals/common_queries.php"); page_protect(); error_reporting(0); $subcat = filter($_GET["subcat"]); $notes_res = getNotes($dbh, $subcat); ?> <table width="100%"> <thead style="text-align:left; "> <tr style="font-size:14px; font-weight:bold;"> <!-- <th><input class="check-all" type="checkbox" /></th>--> <th>Date</th> <th >Contents</th> <th>Preview / Print</th> </tr> </thead> <?php while ($messages_row = mysql_fetch_object($messages_res)):?> <tr> <td><a target="_blank" href="../site_hospital_files/thread.php?question_id=<?php echo $messages_row->question_id;?>"><?php echo substr($messages_row->reply, 0, 20) . '...';?></a></td> <td><?php echo date('Y-m-d', strtotime($messages_row->date_added));?></td> <td><a href="../site_hospital_files/pdf_messages_notes.php?msg_id=<?php echo $messages_row->question_id;?>&amp;var1=<?php echo $subcat;?>">Create PDF</a></td> </tr> <?php endwhile;?> <?php while($notes_row = $notes_res->fetch(PDO::FETCH_ASSOC)):?> <tr> <td><?php echo $notes_row[date]; ?></td> <td><?php echo substr($notes_row[notes], 0, 50).'...';?></td> <td><a href="pdf_messages_notes.php?note_id=<?php echo $notes_row->sub_cat_id; ?>&var1=<?php echo $subcat;?>">View</a></td> </tr> <?php endwhile;?> </table>
2
8,973,148
01/23/2012 14:27:52
1,066,579
11/26/2011 05:05:41
155
7
how to get click position in onClickListener?
how to get click position in onClickListener? like follow in onTouchListener int x = (int)event.getX(); int y = (int)event.getY();
java
android
null
null
null
01/24/2012 11:59:57
not a real question
how to get click position in onClickListener? === how to get click position in onClickListener? like follow in onTouchListener int x = (int)event.getX(); int y = (int)event.getY();
1
333,992
12/02/2008 13:57:25
42,441
12/02/2008 13:38:12
1
0
"Perfect" .Net Dev Environment?
I've been given an early Christmas Present:<br> Permission to step out of the development cycle to **reorganize** and **document** our application.<br> I have complete freedom to restructure, refactor, and set up any amount of infrastructure I see fit. I'm hoping to draw on the collective StackOverflow wisdom wrought in greater experience and sweat. So my question to everyone is: If you had Carte Blanche, what's your "Perfect" .Net Dev Environment? About the App:<br> VB.Net Client/Server Application. (Windows Forms front end, ASPX Webservices back)<br> Currently using Visual Studio & SQL Server 2003 and... VSS.<br> <br> I'd like to have some combination of: <br> * Better versioning. (leaning towards SVN) <br> * Wiki or other system for bug tracking and documentation. (leaning towards Trac w/ SVN) <br> * Simplified build process & daily builds (Visual Build? CruiseControl.Net?) <br> * Version control for the SQL Server database <br> * Upgrade to Visual Studio 2005 (or 2008)? ... for Small team of 5 or so developers thanks.
.net
development-environment
version-control
utopia
null
05/01/2011 10:24:50
not constructive
"Perfect" .Net Dev Environment? === I've been given an early Christmas Present:<br> Permission to step out of the development cycle to **reorganize** and **document** our application.<br> I have complete freedom to restructure, refactor, and set up any amount of infrastructure I see fit. I'm hoping to draw on the collective StackOverflow wisdom wrought in greater experience and sweat. So my question to everyone is: If you had Carte Blanche, what's your "Perfect" .Net Dev Environment? About the App:<br> VB.Net Client/Server Application. (Windows Forms front end, ASPX Webservices back)<br> Currently using Visual Studio & SQL Server 2003 and... VSS.<br> <br> I'd like to have some combination of: <br> * Better versioning. (leaning towards SVN) <br> * Wiki or other system for bug tracking and documentation. (leaning towards Trac w/ SVN) <br> * Simplified build process & daily builds (Visual Build? CruiseControl.Net?) <br> * Version control for the SQL Server database <br> * Upgrade to Visual Studio 2005 (or 2008)? ... for Small team of 5 or so developers thanks.
4
7,254,294
08/31/2011 08:16:27
615,116
02/13/2011 14:32:37
80
2
Is it suspicious to think that methods go missing in ruby?
class Person def name puts "Doharey" end end puts Person.class #=> this out puts Class puts Class.methods.count #=> 82 methods puts Person.methods.count #=> 82 methods In the above example a Person class is created which inherits from 'Class' and both 'Person' and 'Class' has equal number of methods. Now lets instantiate 'Person' class a = Person.new puts a.methods.count #=> 42 methods If 'a' is an instance of 'Person' then why are the number of methods less in 'a' than 'Person'. What happens ? how some methods go missing ? Are they not inherited in the first place ? If so how ?
ruby
class
methods
instance
null
null
open
Is it suspicious to think that methods go missing in ruby? === class Person def name puts "Doharey" end end puts Person.class #=> this out puts Class puts Class.methods.count #=> 82 methods puts Person.methods.count #=> 82 methods In the above example a Person class is created which inherits from 'Class' and both 'Person' and 'Class' has equal number of methods. Now lets instantiate 'Person' class a = Person.new puts a.methods.count #=> 42 methods If 'a' is an instance of 'Person' then why are the number of methods less in 'a' than 'Person'. What happens ? how some methods go missing ? Are they not inherited in the first place ? If so how ?
0
6,952,227
08/05/2011 06:21:04
295,128
03/16/2010 20:25:19
532
1
Why does this code give segmentation fault?
I wrote a small example to test my understanding of pointers and memory, however I was sure this would work but then it gave seg fault... Any idea what I am doing wrong? struct Card { int a; Card(int a) : a(a) { } }; int main() { Card **c = new Card*[5]; for (int i = 0; i<5; i++) c[i] = new Card(1); }
c++
pointers
null
null
null
null
open
Why does this code give segmentation fault? === I wrote a small example to test my understanding of pointers and memory, however I was sure this would work but then it gave seg fault... Any idea what I am doing wrong? struct Card { int a; Card(int a) : a(a) { } }; int main() { Card **c = new Card*[5]; for (int i = 0; i<5; i++) c[i] = new Card(1); }
0
11,669,846
07/26/2012 12:58:46
1,547,086
07/23/2012 22:24:26
1
0
Looking for Python framework to build a web interface for an AV engine
I want to build a web application use Python for an antivirus engine. Actually I'm looking for a Python framework, I've not used any framework in python but i have enough experience to work with web programming and also python. How do I go about choosing a web application framework in python? Just to be clear: there out a framework in Ruby on Rails [ActiveAdmin][1] which good for me, but i'm looking something in Python. I would really appreciated if someone help me. [1]: http://activeadmin.info
python
ruby-on-rails
frameworks
null
null
07/26/2012 13:21:37
not constructive
Looking for Python framework to build a web interface for an AV engine === I want to build a web application use Python for an antivirus engine. Actually I'm looking for a Python framework, I've not used any framework in python but i have enough experience to work with web programming and also python. How do I go about choosing a web application framework in python? Just to be clear: there out a framework in Ruby on Rails [ActiveAdmin][1] which good for me, but i'm looking something in Python. I would really appreciated if someone help me. [1]: http://activeadmin.info
4
9,125,234
02/03/2012 07:39:28
1,027,097
11/03/2011 07:00:42
59
0
Finding memory leaks
I know that there are lots of posts about memory leaks. Now i am reading those. But maybe there some people could give me some tips how to find in which controller or even which object is leaking. Because now i have stack trace with object names like 0xcvf34 and responsoble framework which is Leaked Object # Address Size Responsible Library Responsible Frame __NSCFString,1 0xcvf34 32 Bytes Foundation -[NSPlaceholderString initWithBytes:length:encoding:] And there lots of more What could be my strategy ? Because to find which NSString is leaking is really hard as there lots of code. Am using apple instruments.
ios
memory-leaks
ios5
instruments
null
null
open
Finding memory leaks === I know that there are lots of posts about memory leaks. Now i am reading those. But maybe there some people could give me some tips how to find in which controller or even which object is leaking. Because now i have stack trace with object names like 0xcvf34 and responsoble framework which is Leaked Object # Address Size Responsible Library Responsible Frame __NSCFString,1 0xcvf34 32 Bytes Foundation -[NSPlaceholderString initWithBytes:length:encoding:] And there lots of more What could be my strategy ? Because to find which NSString is leaking is really hard as there lots of code. Am using apple instruments.
0
7,956,858
10/31/2011 16:51:59
712,447
04/17/2011 19:35:09
339
2
what is big deal deploying debug build in production
title says it all. Given that 90% of time, developers are working with debug builds, why exactly deploying release builds is preferable?
release
debug-symbols
null
null
null
06/29/2012 14:09:12
off topic
what is big deal deploying debug build in production === title says it all. Given that 90% of time, developers are working with debug builds, why exactly deploying release builds is preferable?
2
3,787,277
09/24/2010 13:00:31
310,257
04/06/2010 17:26:40
6
1
JavaScript - Why function wasn't called?!
It's a weird doubt, but it goes.... I have a button in a page, that makes a Ajax request, and when i have the answer, I write it to the page and then it's called a function to adjust Page Elements. When i click the button the first time, this function isn't called, but in the next request it is. But...if I place a alert in the scope of the function, when i make the same first ajax request and wait for the answer to call the function, it displays the content of the alert and adjust my page elements. Well...i don't see any logic in that, but if this ring's a bell to anyone, I apreciate the help. Thanks
javascript
null
null
null
null
null
open
JavaScript - Why function wasn't called?! === It's a weird doubt, but it goes.... I have a button in a page, that makes a Ajax request, and when i have the answer, I write it to the page and then it's called a function to adjust Page Elements. When i click the button the first time, this function isn't called, but in the next request it is. But...if I place a alert in the scope of the function, when i make the same first ajax request and wait for the answer to call the function, it displays the content of the alert and adjust my page elements. Well...i don't see any logic in that, but if this ring's a bell to anyone, I apreciate the help. Thanks
0
11,693,788
07/27/2012 18:40:44
145,610
07/27/2009 08:45:11
84
2
error while implementing ValidateAntiForgeryToken in my MVC application
Im Implementing MVC for my web application, I'm posting data using $.post ,when im posting data to server, Im passing __RequestVerificationToken token information back to server.i decorated by Controller with ValidateAntiForgeryToken attribute, Controller method executes perfectly and return Json data as Action result, In my javascript $.post 's call back method is invoked which has window.navigate which take return json object's from server to client, json object has URL which direct to one action method of same controller. Since i used javscript navigate method it goes to corresponding action method of same controller decorated with ValidateAntiForgeryToken. but since im not passing __RequestVerificationToken , it throwing exception "ErrorMessage:A required anti-forgery token was not supplied or was invalid.,InnerExceptionMessage:" Can any1 help me on this issue. r else howexacctly use RedirectToAction to pass in ValidateAntiForgery token -mahens
asp.net
mvc
null
null
null
07/29/2012 06:57:38
too localized
error while implementing ValidateAntiForgeryToken in my MVC application === Im Implementing MVC for my web application, I'm posting data using $.post ,when im posting data to server, Im passing __RequestVerificationToken token information back to server.i decorated by Controller with ValidateAntiForgeryToken attribute, Controller method executes perfectly and return Json data as Action result, In my javascript $.post 's call back method is invoked which has window.navigate which take return json object's from server to client, json object has URL which direct to one action method of same controller. Since i used javscript navigate method it goes to corresponding action method of same controller decorated with ValidateAntiForgeryToken. but since im not passing __RequestVerificationToken , it throwing exception "ErrorMessage:A required anti-forgery token was not supplied or was invalid.,InnerExceptionMessage:" Can any1 help me on this issue. r else howexacctly use RedirectToAction to pass in ValidateAntiForgery token -mahens
3
6,679,618
07/13/2011 13:23:29
687,538
04/01/2011 12:08:18
173
15
Using @Html inside shared @helper in App_Code
I am building a very basic MVC3 site while I learn and I am having difficulty with the following declarative Razor html helper. Inside RMB.cshtml inside App_Code folder: @helper ReplaceCrLf(string strText) { @Html.Raw(Html.Encode(strText).Replace(Environment.NewLine, "<br />")); } Inside my index.cshtml view: @RMB.ReplaceCrLf(Model.Post) This gives me a null reference exception on Html in the helper, because it doesn't seem to know what it is. I can work around this by passing Html from the view to the helper, but I was wondering if there is another way for my shared html helpers to be able to reference Html without me having to pass it in to ever helper I write? For completeness, here is the working workaround: In RMB.cshtml in App_Code @helper ReplaceCrLf(string strText, System.Web.Mvc.HtmlHelper Html) { @Html.Raw(Html.Encode(strText).Replace(Environment.NewLine, "<br />")); } In index.cshtml view @RMB.ReplaceCrLf(Model.Post, Html)
asp.net-mvc
asp.net-mvc-3
razor
razor-declarative-helpers
null
null
open
Using @Html inside shared @helper in App_Code === I am building a very basic MVC3 site while I learn and I am having difficulty with the following declarative Razor html helper. Inside RMB.cshtml inside App_Code folder: @helper ReplaceCrLf(string strText) { @Html.Raw(Html.Encode(strText).Replace(Environment.NewLine, "<br />")); } Inside my index.cshtml view: @RMB.ReplaceCrLf(Model.Post) This gives me a null reference exception on Html in the helper, because it doesn't seem to know what it is. I can work around this by passing Html from the view to the helper, but I was wondering if there is another way for my shared html helpers to be able to reference Html without me having to pass it in to ever helper I write? For completeness, here is the working workaround: In RMB.cshtml in App_Code @helper ReplaceCrLf(string strText, System.Web.Mvc.HtmlHelper Html) { @Html.Raw(Html.Encode(strText).Replace(Environment.NewLine, "<br />")); } In index.cshtml view @RMB.ReplaceCrLf(Model.Post, Html)
0
10,369,607
04/29/2012 04:07:49
785,349
06/06/2011 04:20:32
937
23
Unable to deploy application to App engine
I've been trying to deploy my application that used to be deployed to the App engine cloud using the Google Plugin for eclipse, now I can't deploy it. I'm getting this error: An internal error occurred during: Deploying <myapp> to Google schedule every 1 second failed to parse However, my application compiled properly and works properly in localhost App engine. What could be the reason that the app won't deploy? The error doesn't give much information as to what the error is about...
google-app-engine
null
null
null
null
null
open
Unable to deploy application to App engine === I've been trying to deploy my application that used to be deployed to the App engine cloud using the Google Plugin for eclipse, now I can't deploy it. I'm getting this error: An internal error occurred during: Deploying <myapp> to Google schedule every 1 second failed to parse However, my application compiled properly and works properly in localhost App engine. What could be the reason that the app won't deploy? The error doesn't give much information as to what the error is about...
0
4,460,978
12/16/2010 12:57:37
460,366
09/28/2010 08:33:55
22
1
How to communicate between two apps
I have two applications (one is actually a Preference Pane) and I need them to communicate; to be more precise, I need the preference pane to ask the application for information if it is running. So I need:<br> <code> -(BOOL) isApplicationRunning:(NSString*)pathToApplication;<br> -(NSDictionary*) returnSomeDInfoForMe:(NSString*)pathToApplication; </code><br> Any idea on how this can be done? TIA, Oren
objective-c
cocoa
xcode
messaging
null
null
open
How to communicate between two apps === I have two applications (one is actually a Preference Pane) and I need them to communicate; to be more precise, I need the preference pane to ask the application for information if it is running. So I need:<br> <code> -(BOOL) isApplicationRunning:(NSString*)pathToApplication;<br> -(NSDictionary*) returnSomeDInfoForMe:(NSString*)pathToApplication; </code><br> Any idea on how this can be done? TIA, Oren
0
7,666,120
10/05/2011 18:47:18
549,722
12/21/2010 09:36:34
15
1
Application reflecting WPF for final exam/thesis
I've been searching through forum, but haven't find something close to what I need. I wonder what kind of application would best describe features of WPF? I don't need some large project, just an example that would serve the purpose. WPF is a little bit complicated, I'm not sure if it's the best option, if you have any other ideas considering .NET it is welcomed.
.net
wpf
c#-4.0
thesis
null
10/05/2011 19:06:36
off topic
Application reflecting WPF for final exam/thesis === I've been searching through forum, but haven't find something close to what I need. I wonder what kind of application would best describe features of WPF? I don't need some large project, just an example that would serve the purpose. WPF is a little bit complicated, I'm not sure if it's the best option, if you have any other ideas considering .NET it is welcomed.
2
7,703,380
10/09/2011 12:06:25
986,315
10/09/2011 11:54:39
1
0
Extract and Replace a substring using Regex in Java
I have a string which contains the following substring one or more than one times: (DynamicContent(abc.xyz)) I want to replace this whole substring with a different string which depends on <code>abc</code> and <code>xyz</code>. Therefore, I want to first extract both of them seperately. All this has to be done using Java.
java
regex
string
replace
extract
null
open
Extract and Replace a substring using Regex in Java === I have a string which contains the following substring one or more than one times: (DynamicContent(abc.xyz)) I want to replace this whole substring with a different string which depends on <code>abc</code> and <code>xyz</code>. Therefore, I want to first extract both of them seperately. All this has to be done using Java.
0
10,901,337
06/05/2012 16:42:22
1,401,611
05/17/2012 17:33:28
1
0
Neo4jClient Get All Referenced Nodes
In my application I have classes/nodes like:<br> -person<br> -activity<br> -company<br> <br> I can create relationships between:<br> - person and company<br> - company and activity<br> - activity and person - person and person<br> - company and company<br> <br> So. It is possible, that a specific activity is related to a person and to an company. The company is mostly the root. But there is no real hierarchy. It's more like a mesh structure. <br><br> (I know how to create the relationships etc. I saw already some tutorials. :) ) <br><br> Now. I want to get all directly related relationships with nodes of a specific node. I DON'T want to fetch the related data by the relationship type. I want (when possible) one query, which reads all relationships and the according nodes. <br> And the second requirement: When I have retrieved all related relationships and nodes, I want get the relationships (if any exists) between these nodes! <br><br> So it would be very cool to solve this with 2 queries! <br><br> Any ideas? <br><br> Thanks!
neo4j
neo4jclient
null
null
null
null
open
Neo4jClient Get All Referenced Nodes === In my application I have classes/nodes like:<br> -person<br> -activity<br> -company<br> <br> I can create relationships between:<br> - person and company<br> - company and activity<br> - activity and person - person and person<br> - company and company<br> <br> So. It is possible, that a specific activity is related to a person and to an company. The company is mostly the root. But there is no real hierarchy. It's more like a mesh structure. <br><br> (I know how to create the relationships etc. I saw already some tutorials. :) ) <br><br> Now. I want to get all directly related relationships with nodes of a specific node. I DON'T want to fetch the related data by the relationship type. I want (when possible) one query, which reads all relationships and the according nodes. <br> And the second requirement: When I have retrieved all related relationships and nodes, I want get the relationships (if any exists) between these nodes! <br><br> So it would be very cool to solve this with 2 queries! <br><br> Any ideas? <br><br> Thanks!
0
2,621,513
04/12/2010 11:07:20
227,523
12/08/2009 22:11:54
565
30
How to use find command to find all files with extensions from list?
I need to find all image files from directory (gif, png, jpg, jpeg). find /path/to/ -name "*.jpg" > log How to modify this string to find not only .jpg files? Thank you.
shell
find
null
null
null
null
open
How to use find command to find all files with extensions from list? === I need to find all image files from directory (gif, png, jpg, jpeg). find /path/to/ -name "*.jpg" > log How to modify this string to find not only .jpg files? Thank you.
0
8,716,101
01/03/2012 17:21:04
951,422
09/18/2011 16:35:36
378
0
ftp client automatically upload after changing
the known progress of changing file then upload it trough the ftp client and then view it on the browser few times every minute is annoying! is there any FTP client that transfer the file automatically after changing it so it can save me a lot of time? thanks in advance
php
javascript
mysql
html
css
01/03/2012 17:27:08
off topic
ftp client automatically upload after changing === the known progress of changing file then upload it trough the ftp client and then view it on the browser few times every minute is annoying! is there any FTP client that transfer the file automatically after changing it so it can save me a lot of time? thanks in advance
2
504,555
02/02/2009 19:36:13
13,842
09/16/2008 21:01:16
1,142
31
Non-US credit cards with Amazon Flexible Payment Service?
Does Amazon FPS allow me (in the US) to take credit card payments from outside the US without creating an Amazon account?
fps
null
null
null
null
02/02/2009 20:04:36
off topic
Non-US credit cards with Amazon Flexible Payment Service? === Does Amazon FPS allow me (in the US) to take credit card payments from outside the US without creating an Amazon account?
2
9,396,260
02/22/2012 13:59:28
618,172
02/15/2011 16:22:44
6
1
Is Android /res/xml/phonegap.xml the same as phonegap.plist for iOS?
I'm looking for the available phonegap.xml options. Specifically, I have been told to use the Android equivalent of ShowSplashScreenSpinner in my phonegap.xml file to solve a problem I have but have been unable to solve this yet. Can anyone assist? Thanks
android
ios
phonegap
plist
equivalent
null
open
Is Android /res/xml/phonegap.xml the same as phonegap.plist for iOS? === I'm looking for the available phonegap.xml options. Specifically, I have been told to use the Android equivalent of ShowSplashScreenSpinner in my phonegap.xml file to solve a problem I have but have been unable to solve this yet. Can anyone assist? Thanks
0
6,798,174
07/23/2011 04:11:30
760,553
05/19/2011 07:31:10
132
1
Silverlight 5 Final Release Date
Does anyone know anything of when the final version of Silverlight is going to be released? Actually, I've based one of my projects on Silverlight 5 and It has to be released within the next month. Thanks in advance.
silverlight
silverlight-5.0
null
null
null
01/19/2012 04:10:32
too localized
Silverlight 5 Final Release Date === Does anyone know anything of when the final version of Silverlight is going to be released? Actually, I've based one of my projects on Silverlight 5 and It has to be released within the next month. Thanks in advance.
3
170,914
10/04/2008 19:50:31
6,264
09/13/2008 12:34:05
278
25
F# books question
I am now reading Foundations of F# by Robert Pickering and parallelly the book in progress 'Real World Functional Programming' by Tomas Petricek. My question is, what is the added value I would get from buying and reading the following books: 1) Expert F# by Don Syme and others 2) F# for Scientists by John Harrop Also I want to learn more about datamining techniques with F# as a tool for this. What are good books to read next on this topic?
f#
books
null
null
null
09/24/2011 14:58:12
not constructive
F# books question === I am now reading Foundations of F# by Robert Pickering and parallelly the book in progress 'Real World Functional Programming' by Tomas Petricek. My question is, what is the added value I would get from buying and reading the following books: 1) Expert F# by Don Syme and others 2) F# for Scientists by John Harrop Also I want to learn more about datamining techniques with F# as a tool for this. What are good books to read next on this topic?
4
773,377
04/21/2009 16:05:27
93,868
04/21/2009 15:28:50
1
0
How do retroactively learn knowledge I should have picked up somewhere along the line?
I job title is senior developer, but I've somehow always ended up working for companies that don't really take best practices too seriously, and I've let myself fall into the mind set of getting the job done as fast as possible, and not always in the best way possible. So I now have a large collection of bad habits that I want to get rid of and replace with a large collection of good habits. So where is a good place to get started on listing bad examples and how they should have been done better. As an example: I always end up with meshed together data and presentation layers: This should be done with (I guess) a multi-tier design, but whenever I get started on one of these I end up trapping myself more than making my life easier. So what I am asking for is a if anyone has any good ideas/articles on how to get the wayward developer back on track and more productive than he was before.
self-improvement
null
null
null
null
03/01/2012 19:23:22
not constructive
How do retroactively learn knowledge I should have picked up somewhere along the line? === I job title is senior developer, but I've somehow always ended up working for companies that don't really take best practices too seriously, and I've let myself fall into the mind set of getting the job done as fast as possible, and not always in the best way possible. So I now have a large collection of bad habits that I want to get rid of and replace with a large collection of good habits. So where is a good place to get started on listing bad examples and how they should have been done better. As an example: I always end up with meshed together data and presentation layers: This should be done with (I guess) a multi-tier design, but whenever I get started on one of these I end up trapping myself more than making my life easier. So what I am asking for is a if anyone has any good ideas/articles on how to get the wayward developer back on track and more productive than he was before.
4
10,802,066
05/29/2012 15:21:53
1,014,679
10/26/2011 13:47:45
57
0
PayPal integration options for website
I have been tasked with integrating PayPal into a website that is in development. I was curious if anyone could tell me the best solution for my needs as there seems to be a lot of options out there. The site has to take payments in two ways - firstly, we need a static payment system for booking tickets. I have a basket functionality already set up on the website, because it has to be set up so that only part of the price is paid online, so basically I need a single payment to an invariant email address. I am current during this using IPN, which seems to work. Secondly, people can set up a subscription for a fixed amount per month. I am not sure if it is practical to do this with the IPN setup I have to handle the single payments, because I can't seem to find any documentation to handle all the eventualities of people cancelling their subscriptions, missing payments, etc. So I really need help with the second one, but if anyone has a solution they think should be used for both that would be fantastic, as that would obviously be cleaner. I have never integrated PayPal into a website before so all help welcome! Thank you so much!
php
paypal
integration
payment
null
05/29/2012 15:49:35
not a real question
PayPal integration options for website === I have been tasked with integrating PayPal into a website that is in development. I was curious if anyone could tell me the best solution for my needs as there seems to be a lot of options out there. The site has to take payments in two ways - firstly, we need a static payment system for booking tickets. I have a basket functionality already set up on the website, because it has to be set up so that only part of the price is paid online, so basically I need a single payment to an invariant email address. I am current during this using IPN, which seems to work. Secondly, people can set up a subscription for a fixed amount per month. I am not sure if it is practical to do this with the IPN setup I have to handle the single payments, because I can't seem to find any documentation to handle all the eventualities of people cancelling their subscriptions, missing payments, etc. So I really need help with the second one, but if anyone has a solution they think should be used for both that would be fantastic, as that would obviously be cleaner. I have never integrated PayPal into a website before so all help welcome! Thank you so much!
1
5,075,340
02/22/2011 07:35:52
622,618
02/18/2011 05:31:52
1
1
Turning label into hyperlink Iphone
I have a UILabel which text is www.google.com. Now if someone moves the cursor on the text and press it the google's homepage should be open. Is it possible? please explain how....
iphone-sdk-4.0
null
null
null
null
null
open
Turning label into hyperlink Iphone === I have a UILabel which text is www.google.com. Now if someone moves the cursor on the text and press it the google's homepage should be open. Is it possible? please explain how....
0
9,152,810
02/05/2012 20:39:01
732,849
04/30/2011 23:28:57
5
0
c#: (True==True) returning False
I'm having a problem with (true==true) returning false. Console.WriteLine(useaction.Postcondition[goalneeds].ToString() + "==" + current[goalneeds].ToString()+" returns "+(useaction.Postcondition[goalneeds] == current[goalneeds]).ToString()); Output:`True==True returns False` useaction.Postcondition is of the same type as current. Despite what the preview color says, "Postcondition" is not static Any help is appreciated, I don't know any other relevant information I can share.
c#
boolean
null
null
null
02/07/2012 16:31:59
too localized
c#: (True==True) returning False === I'm having a problem with (true==true) returning false. Console.WriteLine(useaction.Postcondition[goalneeds].ToString() + "==" + current[goalneeds].ToString()+" returns "+(useaction.Postcondition[goalneeds] == current[goalneeds]).ToString()); Output:`True==True returns False` useaction.Postcondition is of the same type as current. Despite what the preview color says, "Postcondition" is not static Any help is appreciated, I don't know any other relevant information I can share.
3
5,089,483
02/23/2011 10:14:47
381,699
07/02/2010 03:09:50
206
9
how to display waveform of audio file and zoom in and zoom out of waveform and select certain points in the waveform in iOS
In iOS, how do you display the waveform of an audio file and zoom into and out of the waveform? This functionality is provided by iSaidWhat?! app. How do you implement this? And how long does it take typically to learn and implement this? I'm assuming OpenGL is necessary?
ios
opengl
audio
zooming
waveform
null
open
how to display waveform of audio file and zoom in and zoom out of waveform and select certain points in the waveform in iOS === In iOS, how do you display the waveform of an audio file and zoom into and out of the waveform? This functionality is provided by iSaidWhat?! app. How do you implement this? And how long does it take typically to learn and implement this? I'm assuming OpenGL is necessary?
0
6,152,312
05/27/2011 12:36:05
773,017
05/27/2011 11:51:40
1
0
binary read/write arbitrary std::vector<std::vector<int> > in c++
_Hi_, I would like to store binary a `std::vector<std::vector<int> >` object MATRIX in a file. out.write((char*)&MATRIX, sizeof(MATRIX)); The problem is, that only the column dimension is fixed. The row dimension changes. If I read the object out of the binary file, it's not enough to know only the size, isn't it? So, initializing e.g. a second matrix with std::vector<std::vector<int> > MATRIX2; for ( int i=0;i<column_dim;i++ ) MATRIX2.push_back ( vector<int> ( 0 ) ); ifstream in(cstr, ios::in | ios::binary); and reading the object data with ifstream in(cstr, ios::in | ios::binary); in.read((char*)& MATRIX2, fSize); makes no sense, because the compiler has no clue about the structure of the saved data. My question: Is there any better way of solving this problem than saving the matrix structure (all info about the row dimensions) in a second file, reading it and creating a MATRIX2 with the appropriate structure which is then filled by using ifstream in(cstr, ios::in | ios::binary); in.read((char*)&nn_H_test, fSize); ?
c++
vector
binary-data
null
null
null
open
binary read/write arbitrary std::vector<std::vector<int> > in c++ === _Hi_, I would like to store binary a `std::vector<std::vector<int> >` object MATRIX in a file. out.write((char*)&MATRIX, sizeof(MATRIX)); The problem is, that only the column dimension is fixed. The row dimension changes. If I read the object out of the binary file, it's not enough to know only the size, isn't it? So, initializing e.g. a second matrix with std::vector<std::vector<int> > MATRIX2; for ( int i=0;i<column_dim;i++ ) MATRIX2.push_back ( vector<int> ( 0 ) ); ifstream in(cstr, ios::in | ios::binary); and reading the object data with ifstream in(cstr, ios::in | ios::binary); in.read((char*)& MATRIX2, fSize); makes no sense, because the compiler has no clue about the structure of the saved data. My question: Is there any better way of solving this problem than saving the matrix structure (all info about the row dimensions) in a second file, reading it and creating a MATRIX2 with the appropriate structure which is then filled by using ifstream in(cstr, ios::in | ios::binary); in.read((char*)&nn_H_test, fSize); ?
0
11,559,469
07/19/2012 11:03:39
294,689
03/16/2010 11:22:03
18
0
Writing Genric Function for auto mapping
i have a Doubt i have More than 8 pages in a modules for an .net MVC3 Based Project, I have a single controller to handle all the pages. When i get the value from the view, i have to convert to the local model for doing the logic in business layer. To Convert the model from ViewModel i m using Auto Mapper is there any Possibility for making the Auto Mapper as a Genric Function. Thanks in advance.
c#
generics
automapper
null
null
null
open
Writing Genric Function for auto mapping === i have a Doubt i have More than 8 pages in a modules for an .net MVC3 Based Project, I have a single controller to handle all the pages. When i get the value from the view, i have to convert to the local model for doing the logic in business layer. To Convert the model from ViewModel i m using Auto Mapper is there any Possibility for making the Auto Mapper as a Genric Function. Thanks in advance.
0
5,902,485
05/05/2011 18:30:19
265,629
02/03/2010 20:39:44
1,154
2
Can I have subprocess.call write the output of the call to a string?
I want to do subprocess.call, and get the output of the call into a string. Can I do this directly, or do I need to pipe it to a file, and then read from it? In other words, can I somehow redirect stdout and stderr into a string?
python
subprocess
null
null
null
null
open
Can I have subprocess.call write the output of the call to a string? === I want to do subprocess.call, and get the output of the call into a string. Can I do this directly, or do I need to pipe it to a file, and then read from it? In other words, can I somehow redirect stdout and stderr into a string?
0
8,810,167
01/10/2012 20:37:10
761,330
05/19/2011 15:12:42
899
7
Interactive Tutorial for Learning Python
Ruby Koans is a great interactive tutorial for learning Ruby, which you can download at [rubykoans.com][1]. Is there any similar tutorial for learning Python? [1]: http://rubykoans.com
python
ruby
null
null
null
01/10/2012 21:54:23
off topic
Interactive Tutorial for Learning Python === Ruby Koans is a great interactive tutorial for learning Ruby, which you can download at [rubykoans.com][1]. Is there any similar tutorial for learning Python? [1]: http://rubykoans.com
2
6,568,092
07/04/2011 06:36:35
827,620
07/04/2011 06:36:35
1
0
How to copy txt/ doc File
I want to copy a txt file from one folder to another. While coping i need to check whether the file exists or not, if yess then replace the file.
asp.net
vb
dts
null
null
07/04/2011 10:08:48
not a real question
How to copy txt/ doc File === I want to copy a txt file from one folder to another. While coping i need to check whether the file exists or not, if yess then replace the file.
1
11,142,575
06/21/2012 16:26:28
892,029
08/12/2011 15:08:13
2,467
25
How to choose middleware paradigm
I've been reading up on Java middleware solutions, and unless I've gone completely off-base here (which I may have done, **in which case please start by correcting me!**), it seems that there are four major middleware solutions/paradigms you can choose for an enterprise application: * Fully-compliant Java EE (EJB3s); or * 3rd Party ESB like Apache Camel or Mule; or * OSGi; or * Event-Driven Architectures I'm looking for something of a rubric, or a protocol to follow that will allow me to say: > Given business needs xyz, the best middleware strategy for this app is xyz. I guess I'm wondering what pros/cons/strengths/caveats each of these four have and how those attributes fit into the decision-making behind which of these 4 avenues to go down. Can someone please provide real-life use cases for when each of these 4 would be preferable over the alternatives? Maybe from those use cases we can extract such a rubric.
java
osgi
ejb-3.0
apache-camel
middleware
06/23/2012 10:24:15
not constructive
How to choose middleware paradigm === I've been reading up on Java middleware solutions, and unless I've gone completely off-base here (which I may have done, **in which case please start by correcting me!**), it seems that there are four major middleware solutions/paradigms you can choose for an enterprise application: * Fully-compliant Java EE (EJB3s); or * 3rd Party ESB like Apache Camel or Mule; or * OSGi; or * Event-Driven Architectures I'm looking for something of a rubric, or a protocol to follow that will allow me to say: > Given business needs xyz, the best middleware strategy for this app is xyz. I guess I'm wondering what pros/cons/strengths/caveats each of these four have and how those attributes fit into the decision-making behind which of these 4 avenues to go down. Can someone please provide real-life use cases for when each of these 4 would be preferable over the alternatives? Maybe from those use cases we can extract such a rubric.
4
3,358,688
07/29/2010 00:47:32
184,741
10/06/2009 04:34:01
1,091
71
Any solutions to multi-environment source control?
Is there an efficient way that doesn't require *too* much fiddling (I can cope with a bit) to get version control working across > 1 environments? By that, I mean multiple IDEs; I am developing on VS2010 at home, but I'd like to work on the project at university with my laptop. My laptop is running Debian and I'm open to suggestion for what IDE to use there (in case there's a specific one that is pertinent to the solution.) I am primarily working in C++.
visual-c++
version-control
multiplatform
null
null
null
open
Any solutions to multi-environment source control? === Is there an efficient way that doesn't require *too* much fiddling (I can cope with a bit) to get version control working across > 1 environments? By that, I mean multiple IDEs; I am developing on VS2010 at home, but I'd like to work on the project at university with my laptop. My laptop is running Debian and I'm open to suggestion for what IDE to use there (in case there's a specific one that is pertinent to the solution.) I am primarily working in C++.
0
11,242,516
06/28/2012 10:19:32
1,129,529
01/04/2012 08:53:43
7
0
How to call function while check the checkbox in jgqrid?
I have one grid with below columns var relSalCols = [{ label : 'Employee No', name : 'empno', width : 180, editable : false }, { label : 'Name', name : 'empname', width : 160, editable : false }, { label : 'Payroll', name : 'payroll', editable : true, edittype : 'checkbox', editoptions : { value : "True:False" }, formatter : "checkbox", formatoptions : { disabled : false } }, { label : 'Remarks', name : 'remarks' }, { label : '', name : 'id', hidden : true, key : true, width : 25 }, { label : '', name : 'changed', hidden : true, width : 25 }]; this.jqGrid = GtsJQuery.jqGrid(this.tblRelGrid, { url : "url", datatype : 'json', jsonReader : { root : "data", page : "currpage", total : "totalpages", records : "totalrecords", repeatitems : false }, colModel : relSalCols, sortname : 'name', loadui : 'block', rownumbers : false, width : 800, viewrecords : true, wrapContents : true, rowNum : 10, multiselect : true, pager : $("<div id='" + GtsJQuery.getId() + "'></div>") .insertAfter(this.tblHoldGrid), serializeGridData : this .callback("serializeGridDataForRelease") loadComplete : this .callback("relSalGridOnLoadComplete") }); In the above grid i want to select the multiselect checkbox manually while user select the inner column(Payroll column) select checkbox. For this how do i do. Please any one help me. Thanks..
jquery
jqgrid
null
null
null
null
open
How to call function while check the checkbox in jgqrid? === I have one grid with below columns var relSalCols = [{ label : 'Employee No', name : 'empno', width : 180, editable : false }, { label : 'Name', name : 'empname', width : 160, editable : false }, { label : 'Payroll', name : 'payroll', editable : true, edittype : 'checkbox', editoptions : { value : "True:False" }, formatter : "checkbox", formatoptions : { disabled : false } }, { label : 'Remarks', name : 'remarks' }, { label : '', name : 'id', hidden : true, key : true, width : 25 }, { label : '', name : 'changed', hidden : true, width : 25 }]; this.jqGrid = GtsJQuery.jqGrid(this.tblRelGrid, { url : "url", datatype : 'json', jsonReader : { root : "data", page : "currpage", total : "totalpages", records : "totalrecords", repeatitems : false }, colModel : relSalCols, sortname : 'name', loadui : 'block', rownumbers : false, width : 800, viewrecords : true, wrapContents : true, rowNum : 10, multiselect : true, pager : $("<div id='" + GtsJQuery.getId() + "'></div>") .insertAfter(this.tblHoldGrid), serializeGridData : this .callback("serializeGridDataForRelease") loadComplete : this .callback("relSalGridOnLoadComplete") }); In the above grid i want to select the multiselect checkbox manually while user select the inner column(Payroll column) select checkbox. For this how do i do. Please any one help me. Thanks..
0
7,172,668
08/24/2011 08:40:06
857,285
07/22/2011 04:59:49
1
0
custom annotation processing
I need a help on java custom annotations, I know how to create annotations but i do not know how to process that. I have gone through some information where I saw APT which is com.sun.mirror.* and another javax.annotation.processing.*, I got confused between two. Can any one please guide me to process custom annotations and provide useful link. <br>Thanks.
java
annotations
processor
null
null
null
open
custom annotation processing === I need a help on java custom annotations, I know how to create annotations but i do not know how to process that. I have gone through some information where I saw APT which is com.sun.mirror.* and another javax.annotation.processing.*, I got confused between two. Can any one please guide me to process custom annotations and provide useful link. <br>Thanks.
0
595,926
02/27/2009 18:12:57
64,690
02/10/2009 17:47:35
33
1
Creating mock data for unit testing
I consider myself still pretty new to the TDD scene. But find that no matter which method I use (mock framework or stubbing my own objects) I find that I have to write a lot of code to create mock data. I like the idea of loading up objects to create an in-memory database. But what I don't like is cluttering up my tests with a ton of code for the sole purpose of creating mock data. This is especially the case when the data needs to account for all the different cases. I'd love some suggestions for a better way of doing this. It would seem to me that I should be able to load the data once into a known state from some data store and then I could use a snapshot of that state which is loaded in the test setup/initialize before each test method is executed. This would satisfy proper testing practices while providing convenience and let me focus on writing tests instead of writing code to create test data "by hand".
tdd
mocking
null
null
null
null
open
Creating mock data for unit testing === I consider myself still pretty new to the TDD scene. But find that no matter which method I use (mock framework or stubbing my own objects) I find that I have to write a lot of code to create mock data. I like the idea of loading up objects to create an in-memory database. But what I don't like is cluttering up my tests with a ton of code for the sole purpose of creating mock data. This is especially the case when the data needs to account for all the different cases. I'd love some suggestions for a better way of doing this. It would seem to me that I should be able to load the data once into a known state from some data store and then I could use a snapshot of that state which is loaded in the test setup/initialize before each test method is executed. This would satisfy proper testing practices while providing convenience and let me focus on writing tests instead of writing code to create test data "by hand".
0
1,212,690
07/31/2009 13:58:04
146,966
07/29/2009 09:38:06
1
0
Which event to handle in HttpModule for setting the current principal when dealing with providers?
I am facing a problem where I have to integrate with a custom HttpModule where the principal and identity are set on the current thread so that HttpContext.Current.User contains these. However I get the feeling that the eventhandler they used (PostAcquireRequestState) is way too late. Which is the best event to handle before the initialization of the providers happen in the HttpModule? All I want is my custom provider to work with the correct principal and identity.
httpmodule
events
provider
null
null
null
open
Which event to handle in HttpModule for setting the current principal when dealing with providers? === I am facing a problem where I have to integrate with a custom HttpModule where the principal and identity are set on the current thread so that HttpContext.Current.User contains these. However I get the feeling that the eventhandler they used (PostAcquireRequestState) is way too late. Which is the best event to handle before the initialization of the providers happen in the HttpModule? All I want is my custom provider to work with the correct principal and identity.
0
9,708,434
03/14/2012 19:02:22
1,143,663
01/11/2012 16:41:17
16
2
Fading/Merging Two Large Images Over Each Other
I'm using C# to fade two images between each other. I use a color matrix to set the transparency value and draw the image using the graphics class. This works fine for images that are small. One can move a scroll bar back and forth to see the images fade between one another. The issue I'm experiencing is that when I try to load two large images, it fails. My only guess is that the program is running out of memory. Here is the code so far: // Get the picture box's Graphics object, and clear the box gra = e.Graphics; gra.Clear(Color.Transparent); // Create a new color matrix with the alpha value set to the opacity specified in the slider ColorMatrix cm = new ColorMatrix(); cm.Matrix00 = cm.Matrix11 = cm.Matrix22 = cm.Matrix44 = 1; cm.Matrix33 = ((float)imageFade.Value) / 100; ImageAttributes ia = new ImageAttributes(); ia.SetColorMatrix(cm); // Draw the original image with the image attributes specified gra.DrawImage(pictureBox.Image, new Rectangle(0, 0, pictureBox.Width, pictureBox.Height), 0, 0, pictureBox.Width, pictureBox.Height, GraphicsUnit.Pixel, ia); // The other image's opacity set to opposite cm.Matrix33 = (100-(float)imageFade.Value) / 100; ia.SetColorMatrix(cm); // The error happens here Image image = Image.FromFile(secondBitmap);//<----------------------------------------- gra.DrawImage(image, new Rectangle(0, 0, image.Width, image.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, ia); image.Dispose(); Any help is appreciated. Thanks in advance!
c#
winforms
graphics
null
null
03/14/2012 19:04:23
not a real question
Fading/Merging Two Large Images Over Each Other === I'm using C# to fade two images between each other. I use a color matrix to set the transparency value and draw the image using the graphics class. This works fine for images that are small. One can move a scroll bar back and forth to see the images fade between one another. The issue I'm experiencing is that when I try to load two large images, it fails. My only guess is that the program is running out of memory. Here is the code so far: // Get the picture box's Graphics object, and clear the box gra = e.Graphics; gra.Clear(Color.Transparent); // Create a new color matrix with the alpha value set to the opacity specified in the slider ColorMatrix cm = new ColorMatrix(); cm.Matrix00 = cm.Matrix11 = cm.Matrix22 = cm.Matrix44 = 1; cm.Matrix33 = ((float)imageFade.Value) / 100; ImageAttributes ia = new ImageAttributes(); ia.SetColorMatrix(cm); // Draw the original image with the image attributes specified gra.DrawImage(pictureBox.Image, new Rectangle(0, 0, pictureBox.Width, pictureBox.Height), 0, 0, pictureBox.Width, pictureBox.Height, GraphicsUnit.Pixel, ia); // The other image's opacity set to opposite cm.Matrix33 = (100-(float)imageFade.Value) / 100; ia.SetColorMatrix(cm); // The error happens here Image image = Image.FromFile(secondBitmap);//<----------------------------------------- gra.DrawImage(image, new Rectangle(0, 0, image.Width, image.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, ia); image.Dispose(); Any help is appreciated. Thanks in advance!
1
11,317,906
07/03/2012 19:33:34
1,027,731
11/03/2011 13:06:24
28
0
Bike ride wrong answer
I've the following problem: In 2001, Arnaldinho was one of the students who represented his country in the International Informatics Olympiad (IOI), which occurred in the city of Tampere, Finland. Besides participating in the IOI, Arnaldinho wanted to take the opportunity to learn about that city. Arriving in Tampere Arnaldinho surprised by a fact that perhaps few know: in Finland, the bicycle is the most widely used means of transport (in the summer, in winter, with temperatures dropping to -30 °, it is impossible to ride a bicycle without freeze). The IOI was happening in the northern summer and Arnaldinho who loves cycling, decided to rent one for a tour of the main sights in Tampere. Unluckily for Arnaldinho when he first came to the sights he visited, the belt broke the bike. While visiting this tourist spot, decided that it Arnaldinho your ride even with the strap broken bicycle, taking advantage of the city rises. Arnaldinho then took a map with the sights of Tampere and the links that connect them. To Arnaldinho happiness of as many people walk by Tampere cycling, the map bore the altitude of the places where are all the sights. Moreover, the map mentioned that in Tampere, a tourist spot is located on the site with a higher altitude than another point B, and there is direct connection from A to B, then all the way along this link is in decline . Arnaldinho want to visit as many sights as possible and that, as your bike is damaged, after visiting a tourist point A it can only go to another point B which has lower altitude than A. Moreover, Finland is a very civilized country, and Arnaldinho must respect the meaning of the connections between the sights of Tampere. Task Your task is to help you find Arnaldinho from the map with the sights of Tampere and the links between these points, the maximum number of sights that he can visit, as the point where it is and the restriction that the from a point, it can only go to another with lower altitude. Entry The input consists of several test sets. The first line of a test set contains three integers P, L and R, corresponding respectively to the number of landmarks, the number of connections between them, and the number of point of interest which is initially Arnaldinho. The sights are numbered sequentially from 1 to P. The second line contains P integers, corresponding to the altitude in meters, of the places where the sights of a P, respectively. Each of the following L lines contains two integers A and B, indicating that there is a direct link starting from the tourist point A to point B. The end of the input is indicated by a set of test with P = R = G = 0. Output For each set of test input, your program must produce three lines. The first line identifies the test set, in the "Test #", where n is numbered from 1. The second line should contain the maximum number of sights that Arnaldinho can still visit (not counting the tourist spot where it is initially). The third line should be left blank. The spelling shown in Example Output, below, must be followed strictly. Examples Check in: 4 2 7 100 150 200 50 1 2 2 1 2 4 4 3 4 2 2 3 3 1 4 7 4 50 100 150 200 1 2 2 1 2 4 4 3 4 2 2 3 3 1 0 0 0 Check out: Test 1 A Test 2 3 Restrictions 0 ≤ P ≤ 150 (P = 0 only to indicate the end of the entry) 0 ≤ L ≤ R * (P-1) (L = 0 only to indicate the end of input) 0 ≤ I ≤ P (I = 0 only to indicate the end of the entry) 0 ≤ H ≤ 1000 (height of the tourist spots) 1 ≤ A ≤ P 1 ≤ B ≤ P My solution available now: import java.io.PrintWriter; import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; class Main { private Scanner in; private PrintWriter out; @SuppressWarnings("unchecked") public void solve() { in = new Scanner(System.in); out = new PrintWriter(System.out); int P, L, I, test = 0; while (true) { P = in.nextInt(); L = in.nextInt(); I = in.nextInt(); if (P + L + I == 0) break; ArrayList<Integer>[] list = (ArrayList<Integer>[]) new ArrayList[P + 1]; for (int j = 0; j < list.length; j++) list[j] = new ArrayList<Integer>(); int[] values = new int[P + 1]; for (int i = 1; i <= P; i++) values[i] = in.nextInt(); for (int i = 0; i < L; i++) { int x = in.nextInt(), y = in.nextInt(); list[x].add(y); } Queue<Integer> q = new LinkedList<Integer>(); q.add(I); int[] dist = new int[P + 1]; int max = -1; while (!q.isEmpty()) { int x = q.poll(); for (int y = 0; y < list[x].size(); y++) { if (values[list[x].get(y)] < values[x] && values[list[x].get(y)] < values[x] + 1) { dist[list[x].get(y)] = Math.max(dist[x] + 1, dist[list[x].get(y)]); if (dist[list[x].get(y)] > max) max = dist[list[x].get(y)]; q.add(list[x].get(y)); } } } out.println("Teste " + (++test) + "\n" + max + "\n"); } out.close(); in.close(); } public static void main(String[] args) { Main pdb = new Main(); pdb.solve(); System.exit(0); } } But I was received Wrong answer.... Some one can help-me to done it ??? I do a implementation of Bredth First search in this graph using a list of adjacence, and I've to find the maximum number of visits.
java
algorithm
homework
null
null
07/03/2012 20:34:53
too localized
Bike ride wrong answer === I've the following problem: In 2001, Arnaldinho was one of the students who represented his country in the International Informatics Olympiad (IOI), which occurred in the city of Tampere, Finland. Besides participating in the IOI, Arnaldinho wanted to take the opportunity to learn about that city. Arriving in Tampere Arnaldinho surprised by a fact that perhaps few know: in Finland, the bicycle is the most widely used means of transport (in the summer, in winter, with temperatures dropping to -30 °, it is impossible to ride a bicycle without freeze). The IOI was happening in the northern summer and Arnaldinho who loves cycling, decided to rent one for a tour of the main sights in Tampere. Unluckily for Arnaldinho when he first came to the sights he visited, the belt broke the bike. While visiting this tourist spot, decided that it Arnaldinho your ride even with the strap broken bicycle, taking advantage of the city rises. Arnaldinho then took a map with the sights of Tampere and the links that connect them. To Arnaldinho happiness of as many people walk by Tampere cycling, the map bore the altitude of the places where are all the sights. Moreover, the map mentioned that in Tampere, a tourist spot is located on the site with a higher altitude than another point B, and there is direct connection from A to B, then all the way along this link is in decline . Arnaldinho want to visit as many sights as possible and that, as your bike is damaged, after visiting a tourist point A it can only go to another point B which has lower altitude than A. Moreover, Finland is a very civilized country, and Arnaldinho must respect the meaning of the connections between the sights of Tampere. Task Your task is to help you find Arnaldinho from the map with the sights of Tampere and the links between these points, the maximum number of sights that he can visit, as the point where it is and the restriction that the from a point, it can only go to another with lower altitude. Entry The input consists of several test sets. The first line of a test set contains three integers P, L and R, corresponding respectively to the number of landmarks, the number of connections between them, and the number of point of interest which is initially Arnaldinho. The sights are numbered sequentially from 1 to P. The second line contains P integers, corresponding to the altitude in meters, of the places where the sights of a P, respectively. Each of the following L lines contains two integers A and B, indicating that there is a direct link starting from the tourist point A to point B. The end of the input is indicated by a set of test with P = R = G = 0. Output For each set of test input, your program must produce three lines. The first line identifies the test set, in the "Test #", where n is numbered from 1. The second line should contain the maximum number of sights that Arnaldinho can still visit (not counting the tourist spot where it is initially). The third line should be left blank. The spelling shown in Example Output, below, must be followed strictly. Examples Check in: 4 2 7 100 150 200 50 1 2 2 1 2 4 4 3 4 2 2 3 3 1 4 7 4 50 100 150 200 1 2 2 1 2 4 4 3 4 2 2 3 3 1 0 0 0 Check out: Test 1 A Test 2 3 Restrictions 0 ≤ P ≤ 150 (P = 0 only to indicate the end of the entry) 0 ≤ L ≤ R * (P-1) (L = 0 only to indicate the end of input) 0 ≤ I ≤ P (I = 0 only to indicate the end of the entry) 0 ≤ H ≤ 1000 (height of the tourist spots) 1 ≤ A ≤ P 1 ≤ B ≤ P My solution available now: import java.io.PrintWriter; import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; class Main { private Scanner in; private PrintWriter out; @SuppressWarnings("unchecked") public void solve() { in = new Scanner(System.in); out = new PrintWriter(System.out); int P, L, I, test = 0; while (true) { P = in.nextInt(); L = in.nextInt(); I = in.nextInt(); if (P + L + I == 0) break; ArrayList<Integer>[] list = (ArrayList<Integer>[]) new ArrayList[P + 1]; for (int j = 0; j < list.length; j++) list[j] = new ArrayList<Integer>(); int[] values = new int[P + 1]; for (int i = 1; i <= P; i++) values[i] = in.nextInt(); for (int i = 0; i < L; i++) { int x = in.nextInt(), y = in.nextInt(); list[x].add(y); } Queue<Integer> q = new LinkedList<Integer>(); q.add(I); int[] dist = new int[P + 1]; int max = -1; while (!q.isEmpty()) { int x = q.poll(); for (int y = 0; y < list[x].size(); y++) { if (values[list[x].get(y)] < values[x] && values[list[x].get(y)] < values[x] + 1) { dist[list[x].get(y)] = Math.max(dist[x] + 1, dist[list[x].get(y)]); if (dist[list[x].get(y)] > max) max = dist[list[x].get(y)]; q.add(list[x].get(y)); } } } out.println("Teste " + (++test) + "\n" + max + "\n"); } out.close(); in.close(); } public static void main(String[] args) { Main pdb = new Main(); pdb.solve(); System.exit(0); } } But I was received Wrong answer.... Some one can help-me to done it ??? I do a implementation of Bredth First search in this graph using a list of adjacence, and I've to find the maximum number of visits.
3
7,730,503
10/11/2011 18:11:44
893,372
08/13/2011 20:28:59
21
0
Mercurial on IIS or Apache for Windows Authentication
I already have Mercurial using IIS 7 o Windows 2008. Since I want to use Windows Authentication I am planning to move to Apache and run some test. Does someone has experience around this. I kind of dont trust microsoft stuff.
apache
iis7
mercurial
null
null
10/12/2011 22:13:08
not a real question
Mercurial on IIS or Apache for Windows Authentication === I already have Mercurial using IIS 7 o Windows 2008. Since I want to use Windows Authentication I am planning to move to Apache and run some test. Does someone has experience around this. I kind of dont trust microsoft stuff.
1
487,115
01/28/2009 10:15:41
59,379
01/27/2009 15:19:28
11
2
Data structure for storing strings?
I'm looking for a data structure to store strings in. I require a function in the interface that takes a string as its only parameter and returns a reference/iterator/pointer/handle that can be used to retrieve the string for the rest of the lifetime of the data structure. Set membership, entry deletion etc. is not required. I'm more concerned with memory usage than speed.
string
datastructures
null
null
null
null
open
Data structure for storing strings? === I'm looking for a data structure to store strings in. I require a function in the interface that takes a string as its only parameter and returns a reference/iterator/pointer/handle that can be used to retrieve the string for the rest of the lifetime of the data structure. Set membership, entry deletion etc. is not required. I'm more concerned with memory usage than speed.
0
8,046,259
11/08/2011 05:18:28
1,034,991
11/08/2011 05:13:21
1
0
Regarding google+ api android
Hi i want my application to login with google credentials and after succesful login i want to fetch the profile daa of google+ ie name ,image etc.Kindly provide me sample code. Thanks
api
google
google-plus
accountmanager
null
11/11/2011 15:24:19
not a real question
Regarding google+ api android === Hi i want my application to login with google credentials and after succesful login i want to fetch the profile daa of google+ ie name ,image etc.Kindly provide me sample code. Thanks
1
8,202,403
11/20/2011 15:06:13
598,465
02/01/2011 13:46:10
69
1
Pros and cons of methods to reference a resource
In my program, I have several resource types, each with its own associated `resource` class. The `resource` class has private constructors, and instances can only be created by a friend class `resource_manager`. Clients obtain handles to `resource`s through methods of the `resource_manager` and are unable to modify the `resource`s, although in the future I may need modifiable `resource`s as well. So far I thought of two methods of referencing the `resource`s: 1. By a numeric ID. This has the advantage that can be directly mapped to the vector index (`resource_manager` uses `std::vector` internally), although I realise conceptually I shouldn't be considering this because the implementation of `resource_manage` may change. A disadvantage is that clients cannot call const methods of the `resource` object directly. 2. By `const resource*`. This has the advantage of clients being able to call `const` methods directly. I am generally trying to not use basic pointers in my program, but I think pointers to const are a good exception from using `shared_ptr`, because the clients are unable to delete the `resource` objects. Are there any other methods you could describe? Or any more pros and cons to the two methods above I haven't thought about? Thanks!
c++
pointers
factory
null
null
11/21/2011 12:47:27
not constructive
Pros and cons of methods to reference a resource === In my program, I have several resource types, each with its own associated `resource` class. The `resource` class has private constructors, and instances can only be created by a friend class `resource_manager`. Clients obtain handles to `resource`s through methods of the `resource_manager` and are unable to modify the `resource`s, although in the future I may need modifiable `resource`s as well. So far I thought of two methods of referencing the `resource`s: 1. By a numeric ID. This has the advantage that can be directly mapped to the vector index (`resource_manager` uses `std::vector` internally), although I realise conceptually I shouldn't be considering this because the implementation of `resource_manage` may change. A disadvantage is that clients cannot call const methods of the `resource` object directly. 2. By `const resource*`. This has the advantage of clients being able to call `const` methods directly. I am generally trying to not use basic pointers in my program, but I think pointers to const are a good exception from using `shared_ptr`, because the clients are unable to delete the `resource` objects. Are there any other methods you could describe? Or any more pros and cons to the two methods above I haven't thought about? Thanks!
4
7,453,947
09/17/2011 10:00:47
950,129
09/17/2011 10:00:47
1
0
C++ Friendship and inheritance
I know that friendship is not inherited. I was asking myself: why? Why the C++ designers decided to not let friendship be inherited? Do you find that friendship inheritance would be a useful thing to have? My own answer is yes: in the same way that B is a friend of A, i would like to make a whole family of classes be friend of A (B and its derivatives). Maybe, one should be able to say: let **only** B be friend of A or let B **and** its derived classes be friend of A.
c++
inheritance
friendship
null
null
09/18/2011 05:22:28
not constructive
C++ Friendship and inheritance === I know that friendship is not inherited. I was asking myself: why? Why the C++ designers decided to not let friendship be inherited? Do you find that friendship inheritance would be a useful thing to have? My own answer is yes: in the same way that B is a friend of A, i would like to make a whole family of classes be friend of A (B and its derivatives). Maybe, one should be able to say: let **only** B be friend of A or let B **and** its derived classes be friend of A.
4
6,196,151
06/01/2011 04:06:32
263,276
02/01/2010 06:15:14
6
1
How to create .webarchive file on iPhone from UIWebView?
I want to create a .webarchive file from embedded UIWebView, anyone have tried that before, Thanks.
iphone
uiwebview
null
null
null
null
open
How to create .webarchive file on iPhone from UIWebView? === I want to create a .webarchive file from embedded UIWebView, anyone have tried that before, Thanks.
0
9,850,773
03/24/2012 09:57:07
1,285,790
03/22/2012 11:30:02
1
0
While executing rake db:create error occured
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from <class:Engine> at /home/shajin/.rvm/gems/ruby-1.9.2-p0/bundler/gems/spree_paypal_express-073f2f814dd8/lib/spree_paypal_express.rb:5) WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead. at /home/shajin/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2.2/lib/rake/rdoctask.rb WARNING: Global access to Rake DSL methods is deprecated. Please include ... Rake::DSL into classes and modules which use the Rake DSL methods. WARNING: DSL method Soletronspree::Application#task called at /home/shajin/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks' WARNING: 'task :t, arg, :needs => [deps]' is deprecated. Please use 'task :t, [args] => [deps]' instead. at /home/shajin/.rvm/gems/ruby-1.9.2-p0/gems/deface-0.5.2a/tasks/deface.rake:3:in `block in <top (required)>'
ruby-on-rails-3.1
null
null
null
null
null
open
While executing rake db:create error occured === DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from <class:Engine> at /home/shajin/.rvm/gems/ruby-1.9.2-p0/bundler/gems/spree_paypal_express-073f2f814dd8/lib/spree_paypal_express.rb:5) WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead. at /home/shajin/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2.2/lib/rake/rdoctask.rb WARNING: Global access to Rake DSL methods is deprecated. Please include ... Rake::DSL into classes and modules which use the Rake DSL methods. WARNING: DSL method Soletronspree::Application#task called at /home/shajin/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks' WARNING: 'task :t, arg, :needs => [deps]' is deprecated. Please use 'task :t, [args] => [deps]' instead. at /home/shajin/.rvm/gems/ruby-1.9.2-p0/gems/deface-0.5.2a/tasks/deface.rake:3:in `block in <top (required)>'
0
10,924,631
06/07/2012 01:47:20
607,421
02/08/2011 01:20:07
28
0
Boolean search on database with 5 million rows, very slow
I have a script that when a user searches for "Apples", there is a coloumn with related searches like "Shiny Apples", and "Rotten Apples", etc. Problem is my searches database has 5,600,000 rows and mysql is lagging very badly. Here is my code: $get = mysql_query("SELECT keyword FROM searches WHERE MATCH (keyword) AGAINST ('".mysql_real_escape_string(preg_replace('#([\S]+)#', '$1', $title))."' IN BOOLEAN MODE) LIMIT 0,15"); This is taking a very long time to process and I have a very active website where searches are getting performed every second, can anybody recommend me some tips? Thanks!
php
mysql
boolean
null
null
null
open
Boolean search on database with 5 million rows, very slow === I have a script that when a user searches for "Apples", there is a coloumn with related searches like "Shiny Apples", and "Rotten Apples", etc. Problem is my searches database has 5,600,000 rows and mysql is lagging very badly. Here is my code: $get = mysql_query("SELECT keyword FROM searches WHERE MATCH (keyword) AGAINST ('".mysql_real_escape_string(preg_replace('#([\S]+)#', '$1', $title))."' IN BOOLEAN MODE) LIMIT 0,15"); This is taking a very long time to process and I have a very active website where searches are getting performed every second, can anybody recommend me some tips? Thanks!
0
4,034,908
10/27/2010 15:27:59
1,968
08/19/2008 15:59:21
75,997
1,663
Fetch-and-add using OpenMP atomic operations
I’m using OpenMP and need to use the fetch-and-add operation. However, OpenMP doesn’t provide an appropriate directive/call. I’d like to preserve maximum portability, hence I don’t want to rely on compiler intrinsics. Rather, I’m searching for a way to harness OpenMP’s atomic operations to implement this but I’ve hit a dead end. Can this even be done? N.B., the following code *almost* does what I want: #pragma omp atomic x += a Almost – but not quite, since I really need the old value of `x`. `fetch_and_add` should be defined to produce the same result as the following (only non-locking): template <typename T> T fetch_and_add(volatile T& value, T increment) { T old; #pragma omp critical { old = value; value += increment; } return old; } (An equivalent question could be asked for compare-and-swap but one can be implemented in terms of the other, if I’m not mistaken.)
c++
atomic
openmp
compare-and-swap
null
null
open
Fetch-and-add using OpenMP atomic operations === I’m using OpenMP and need to use the fetch-and-add operation. However, OpenMP doesn’t provide an appropriate directive/call. I’d like to preserve maximum portability, hence I don’t want to rely on compiler intrinsics. Rather, I’m searching for a way to harness OpenMP’s atomic operations to implement this but I’ve hit a dead end. Can this even be done? N.B., the following code *almost* does what I want: #pragma omp atomic x += a Almost – but not quite, since I really need the old value of `x`. `fetch_and_add` should be defined to produce the same result as the following (only non-locking): template <typename T> T fetch_and_add(volatile T& value, T increment) { T old; #pragma omp critical { old = value; value += increment; } return old; } (An equivalent question could be asked for compare-and-swap but one can be implemented in terms of the other, if I’m not mistaken.)
0
7,708,051
10/10/2011 02:39:52
885,007
08/08/2011 23:53:19
6
0
trasnferring data from epic 4g w/o working screen to computer
My epic 4g served me well for 10 months before the screen died out on me. I bought a new one and would like to transfer data from my old phone to my new phone, however, it seems impossible when the old phone has no screen to work with. Any suggestions on how to retrieve this data and get it on a computer?
android
data
phone
transfer
epic
10/10/2011 06:23:30
off topic
trasnferring data from epic 4g w/o working screen to computer === My epic 4g served me well for 10 months before the screen died out on me. I bought a new one and would like to transfer data from my old phone to my new phone, however, it seems impossible when the old phone has no screen to work with. Any suggestions on how to retrieve this data and get it on a computer?
2
7,258,452
08/31/2011 14:26:23
899,162
08/17/2011 17:42:39
1
0
We have a corrupted Key store for the Android App and hence cannot publish the updates to the existing App. What is the workaround?
There's an existing App into the Android Market and due to some reasons our existing Key store has got corrupted and hence we aren't able to publish the updates for the same. How do we workaround this problem?
android
application
keystore
updates
null
08/31/2011 15:26:19
off topic
We have a corrupted Key store for the Android App and hence cannot publish the updates to the existing App. What is the workaround? === There's an existing App into the Android Market and due to some reasons our existing Key store has got corrupted and hence we aren't able to publish the updates for the same. How do we workaround this problem?
2
2,001,671
01/04/2010 19:39:53
93,953
04/21/2009 18:33:31
824
39
Override Java System.currentTimeMillis
Is there a way, either in code or with JVM arguments, to override the current time, as presented via System.currentTimeMillis, other than manually changing the system clock on the host machine? A little background: We have a system that runs a number of accounting jobs that revolve much of their logic around the current date (ie 1st of the month, 1st of the year, etc) Unfortunately, a lot of the legacy code calls functions such as new Date() or Calendar.getInstance(), both of which eventually call down to System.currentTimeMillis. For testing purposes, right now, we are stuck with manually updating the system clock to manipulate what time and date the code thinks that the test is being run. So my question is: Is there a way to override what is returned by System.currentTimeMillis? For example, to tell the JVM to automatically add or subtract some offset before returning from that method? Thanks in advance!
java
jvm
null
null
null
null
open
Override Java System.currentTimeMillis === Is there a way, either in code or with JVM arguments, to override the current time, as presented via System.currentTimeMillis, other than manually changing the system clock on the host machine? A little background: We have a system that runs a number of accounting jobs that revolve much of their logic around the current date (ie 1st of the month, 1st of the year, etc) Unfortunately, a lot of the legacy code calls functions such as new Date() or Calendar.getInstance(), both of which eventually call down to System.currentTimeMillis. For testing purposes, right now, we are stuck with manually updating the system clock to manipulate what time and date the code thinks that the test is being run. So my question is: Is there a way to override what is returned by System.currentTimeMillis? For example, to tell the JVM to automatically add or subtract some offset before returning from that method? Thanks in advance!
0
7,568,556
09/27/2011 11:44:44
864,951
07/27/2011 08:21:40
73
3
Magento and asp
I am completely new to Using Magento. I was wondering does anyone have a suggested learning path for me or how would i go about sending and receiving requests using the Magento API. Thanks to anyone who can shed some light on this for me
asp.net
magento
null
null
null
11/11/2011 09:57:57
not a real question
Magento and asp === I am completely new to Using Magento. I was wondering does anyone have a suggested learning path for me or how would i go about sending and receiving requests using the Magento API. Thanks to anyone who can shed some light on this for me
1
3,226,296
07/12/2010 06:22:58
269,431
02/09/2010 11:42:50
31
1
What is Activator.CreateInstance?
What is Activator.CreateInstance? How can I use it? Can I have an example please?
c#
null
null
null
null
07/12/2010 06:38:01
not a real question
What is Activator.CreateInstance? === What is Activator.CreateInstance? How can I use it? Can I have an example please?
1
5,149,287
03/01/2011 00:41:51
271,534
02/12/2010 01:58:44
338
1
split a string with PHP
I have a bunch of strings in php that all look like this: 10 NE HARRISBURG 4 E HASWELL 2 SE OAKLEY 6 SE REDBIRD PROVO 6 W EADS 21 N HARRISON What I am needing to do is remove the numbers and the letters from before the city names. The problem I am having is that it varies a lot from city to city. The data is almost never the same. Is it possible to remove this data and keep it in a separate string?
php
split
null
null
null
null
open
split a string with PHP === I have a bunch of strings in php that all look like this: 10 NE HARRISBURG 4 E HASWELL 2 SE OAKLEY 6 SE REDBIRD PROVO 6 W EADS 21 N HARRISON What I am needing to do is remove the numbers and the letters from before the city names. The problem I am having is that it varies a lot from city to city. The data is almost never the same. Is it possible to remove this data and keep it in a separate string?
0
9,130,994
02/03/2012 15:19:45
333,786
05/05/2010 19:25:20
9,626
395
Generic way to replace an object in it's own method
With strings one can do this: a = "hello" a.upcase! p a #=> "HELLO" But how would I write my own method like that? Something like (although that doesn't work obviously): class MyClass def positify! self = [0, self].max end end <small>I know there are some tricks one can use on String but what if I'm trying to do something like this for Object?</small>
ruby
null
null
null
null
null
open
Generic way to replace an object in it's own method === With strings one can do this: a = "hello" a.upcase! p a #=> "HELLO" But how would I write my own method like that? Something like (although that doesn't work obviously): class MyClass def positify! self = [0, self].max end end <small>I know there are some tricks one can use on String but what if I'm trying to do something like this for Object?</small>
0
8,198,017
11/19/2011 22:59:22
1,053,551
11/18/2011 10:03:55
1
0
Change defaulut action for keys
I wrote small service class and I want implement something like that : service start -> remap key event -> using my "hard coded" key events -> stopped -> back to normal key events... Thanks for help :-)
android
null
null
null
null
11/29/2011 21:25:30
not a real question
Change defaulut action for keys === I wrote small service class and I want implement something like that : service start -> remap key event -> using my "hard coded" key events -> stopped -> back to normal key events... Thanks for help :-)
1
7,546,621
09/25/2011 15:51:11
319,097
04/17/2010 06:34:45
83
3
iOS - Realtime string updating
I have a string variable and UITextView , So When users type something in UITextView , the string must update automatically change as UITextView ! I mean this code should automatically change the string myString.String = textView; thank you .
ios
xcode
uitextview
null
null
null
open
iOS - Realtime string updating === I have a string variable and UITextView , So When users type something in UITextView , the string must update automatically change as UITextView ! I mean this code should automatically change the string myString.String = textView; thank you .
0
8,468,738
12/12/2011 00:40:33
632,194
02/24/2011 11:15:26
1
0
Why isn't the Rules module working on my drupal website?
I tried to make a rule where whenever a node has new content, the author/user of the node gets an email from the website administrator. Basically, whenever a random user leaves a story on another random user's guestbook (through the Guestbook module), the owner of that guestbook would get an email notifying them of the new comment. For some reason the email never gets sent out or received. Any ideas on why this is not working? If you don't know why it's not working, is there maybe another module that could help me do this? (I can not do the internal rules test because I cannot get the simpletest module working and that is a prerequisite) here's a link to the website if you need to understand this visually - http://www.anikdoht.com
drupal
module
rules
null
null
12/12/2011 05:31:09
off topic
Why isn't the Rules module working on my drupal website? === I tried to make a rule where whenever a node has new content, the author/user of the node gets an email from the website administrator. Basically, whenever a random user leaves a story on another random user's guestbook (through the Guestbook module), the owner of that guestbook would get an email notifying them of the new comment. For some reason the email never gets sent out or received. Any ideas on why this is not working? If you don't know why it's not working, is there maybe another module that could help me do this? (I can not do the internal rules test because I cannot get the simpletest module working and that is a prerequisite) here's a link to the website if you need to understand this visually - http://www.anikdoht.com
2
7,185,384
08/25/2011 05:04:08
536,739
12/09/2010 16:42:10
479
4
get current page not full url
Is it possible to save the current page in a variable (not the full url) using php So if my page is `www.mywebsite.com/news/bob` I am looking to get `/bob` in a variable.
php
url
null
null
null
null
open
get current page not full url === Is it possible to save the current page in a variable (not the full url) using php So if my page is `www.mywebsite.com/news/bob` I am looking to get `/bob` in a variable.
0
11,327,014
07/04/2012 10:14:22
1,501,161
07/04/2012 09:40:39
1
0
Can anyone improve my multidimensional array uniquer?
This is my first post on stack overflow and I'm excited to see how the community flows from within. What I've been working on is some kind of function that can take basically any well constructed multi-dimensional array and remove any and all duplicates within matching key sets. The particular function I've designed provides convenience and functionality but it is far from pretty and seemingly slow compared to a possibly more optimized function. /********Sample Data***********************************************************/ $echo['level-one'][] = '1'; $echo['level-one'][] = '1'; $echo['level-one'][] = '1'; $echo['level-one'][] = '1'; $echo['level-one']['level-two'][] = '1'; $echo['level-one']['level-two'][] = '1'; $echo['level-one']['level-two'][] = '1'; $echo['level-one']['level-two'][] = '1'; $echo['level-one']['level-two']['level-three'][] = '1'; $echo['level-one']['level-two']['level-three'][] = '2'; $echo['level-one']['level-two']['level-three'][] = '3'; $echo['level-one']['level-two']['level-three'][] = '4'; /********Function Declaration and Execution************************************/ function array_unique_multidimensional($name=null,$tv=null,$tk=null,$ta=null){ if(!isset($ta)){$ta = ''.$name.'';}else{$ta .= '['.$tk.']';} if(!isset($tv)){$tv = '$v';}else{$tv .= 'v';} if(!isset($tk)){$tk = '$k';}else{$tk .= 'k';} return(' foreach('.$ta.' as '.$tk.' => '.$tv.'){ if(is_array('.$tv.')){ eval(array_unique_multidimensional(\'\',\''.$tv.'\',\''.$tk.'\',\''.$ta.'\')); }else{ '.$ta.' = array_unique('.$ta.'); } } '); //end return } eval(array_unique_multidimensional('$echo')); //Yes this function returns a foreach loop so it must be eval'd //then it recursively calls itself until the entire array is traversed //This will ensure every segment of the array is uniqued individually Alright so I spaced it out a lot more then it probably needs to be and it is probably best viewed in some kind of program editor. Anyway after running the script as it is shown above you should get level's one and two reduced to a single entry and level three should have all four of it's entries (since their values are unique and one and two's are not). I've seen a lot of answers using array_map to serialize and unique but I've found that they do not work for multidimensional arrays of varying calibers. Ultimately this function will accept any size and depth of array, compare every single key set to itself, remove any duplicates, and preserve every array name/key contained within. Does anyone know of a better way to go about this? If not enjoy the working code above, if you do please share :)
php
arrays
multidimensional-array
unique
null
07/05/2012 10:04:29
off topic
Can anyone improve my multidimensional array uniquer? === This is my first post on stack overflow and I'm excited to see how the community flows from within. What I've been working on is some kind of function that can take basically any well constructed multi-dimensional array and remove any and all duplicates within matching key sets. The particular function I've designed provides convenience and functionality but it is far from pretty and seemingly slow compared to a possibly more optimized function. /********Sample Data***********************************************************/ $echo['level-one'][] = '1'; $echo['level-one'][] = '1'; $echo['level-one'][] = '1'; $echo['level-one'][] = '1'; $echo['level-one']['level-two'][] = '1'; $echo['level-one']['level-two'][] = '1'; $echo['level-one']['level-two'][] = '1'; $echo['level-one']['level-two'][] = '1'; $echo['level-one']['level-two']['level-three'][] = '1'; $echo['level-one']['level-two']['level-three'][] = '2'; $echo['level-one']['level-two']['level-three'][] = '3'; $echo['level-one']['level-two']['level-three'][] = '4'; /********Function Declaration and Execution************************************/ function array_unique_multidimensional($name=null,$tv=null,$tk=null,$ta=null){ if(!isset($ta)){$ta = ''.$name.'';}else{$ta .= '['.$tk.']';} if(!isset($tv)){$tv = '$v';}else{$tv .= 'v';} if(!isset($tk)){$tk = '$k';}else{$tk .= 'k';} return(' foreach('.$ta.' as '.$tk.' => '.$tv.'){ if(is_array('.$tv.')){ eval(array_unique_multidimensional(\'\',\''.$tv.'\',\''.$tk.'\',\''.$ta.'\')); }else{ '.$ta.' = array_unique('.$ta.'); } } '); //end return } eval(array_unique_multidimensional('$echo')); //Yes this function returns a foreach loop so it must be eval'd //then it recursively calls itself until the entire array is traversed //This will ensure every segment of the array is uniqued individually Alright so I spaced it out a lot more then it probably needs to be and it is probably best viewed in some kind of program editor. Anyway after running the script as it is shown above you should get level's one and two reduced to a single entry and level three should have all four of it's entries (since their values are unique and one and two's are not). I've seen a lot of answers using array_map to serialize and unique but I've found that they do not work for multidimensional arrays of varying calibers. Ultimately this function will accept any size and depth of array, compare every single key set to itself, remove any duplicates, and preserve every array name/key contained within. Does anyone know of a better way to go about this? If not enjoy the working code above, if you do please share :)
2
6,243,637
06/05/2011 14:51:45
608,294
02/08/2011 14:48:42
22
2
Read PList File
I've a Plist File composed like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>1</key> <dict> <key>2</key> <array> <array> <string>a</string> <integer>1</integer> </array> <array> <string>b</string> <integer>0</integer> </array> <array> <string>c</string> <string>0</string> </array> </array> </dict> </dict> </plist> I try to read this file but I don't understand where is the error: NSError *error; NSMutableArray *result=[[NSMutableArray alloc] initWithCapacity:1]; NSString *pList = @"a.plist"; // NSString *plistPath; //path NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; plistPath = [rootPath stringByAppendingPathComponent:pList]; //check if the path exist BOOL success; NSFileManager *fileManager = [NSFileManager defaultManager]; success = [fileManager fileExistsAtPath:plistPath]; if (!success) { NSString *path = [[NSBundle mainBundle] pathForResource:pList ofType:@""]; [fileManager copyItemAtPath:path toPath:plistPath error:&error]; NSLog(@"error"); } //read the dictionary NSDictionary *temp = [[NSDictionary alloc] initWithContentsOfFile:plistPath]; //get value for key of the dictionary result=[temp valueForKey:@"1"]; NSMutableArray *tmp = [result objectAtIndex:1]; //this give me error NSLog(@"n %d", [tmp count]); ... if(!temp) [temp release];
objective-c
null
null
null
null
null
open
Read PList File === I've a Plist File composed like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>1</key> <dict> <key>2</key> <array> <array> <string>a</string> <integer>1</integer> </array> <array> <string>b</string> <integer>0</integer> </array> <array> <string>c</string> <string>0</string> </array> </array> </dict> </dict> </plist> I try to read this file but I don't understand where is the error: NSError *error; NSMutableArray *result=[[NSMutableArray alloc] initWithCapacity:1]; NSString *pList = @"a.plist"; // NSString *plistPath; //path NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; plistPath = [rootPath stringByAppendingPathComponent:pList]; //check if the path exist BOOL success; NSFileManager *fileManager = [NSFileManager defaultManager]; success = [fileManager fileExistsAtPath:plistPath]; if (!success) { NSString *path = [[NSBundle mainBundle] pathForResource:pList ofType:@""]; [fileManager copyItemAtPath:path toPath:plistPath error:&error]; NSLog(@"error"); } //read the dictionary NSDictionary *temp = [[NSDictionary alloc] initWithContentsOfFile:plistPath]; //get value for key of the dictionary result=[temp valueForKey:@"1"]; NSMutableArray *tmp = [result objectAtIndex:1]; //this give me error NSLog(@"n %d", [tmp count]); ... if(!temp) [temp release];
0
8,087,640
11/10/2011 23:04:15
995,812
10/14/2011 16:44:51
6
0
Wordpress network .htaccess issue
I have a Wordpress network setup but currently there is only one subsite with the url /psychology In the future there will be addition sites with /md /vet but for the time being there will only be /psychology What I want to do is have a rewrite rule in my htaccess that when a user visits the root of the site (/) it actually loads the /psychology site. I tried adding a line like this to my htaccess RewriteRule (.*) psychology/$1 [R,L] but it broke the site. here is my current htaccess (basically the wordpress default for a network install) # BEGIN WordPress <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteBase /ASKanALLY/ RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L] RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L] RewriteRule . index.php [L] </IfModule> # END WordPress Any ideas?
wordpress
.htaccess
null
null
null
null
open
Wordpress network .htaccess issue === I have a Wordpress network setup but currently there is only one subsite with the url /psychology In the future there will be addition sites with /md /vet but for the time being there will only be /psychology What I want to do is have a rewrite rule in my htaccess that when a user visits the root of the site (/) it actually loads the /psychology site. I tried adding a line like this to my htaccess RewriteRule (.*) psychology/$1 [R,L] but it broke the site. here is my current htaccess (basically the wordpress default for a network install) # BEGIN WordPress <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteBase /ASKanALLY/ RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L] RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L] RewriteRule . index.php [L] </IfModule> # END WordPress Any ideas?
0
4,165,124
11/12/2010 13:32:58
505,795
11/12/2010 13:32:58
1
0
JQuery 1.4.3 in vs 2005/2008
Does we have support(with intellisense) for JQuery 1.4.3 in vs 2005/vs 2008.If yes what has to be done for that.Please give detailed description. Thanks.. Naresh.
jquery
null
null
null
null
11/13/2010 01:39:21
off topic
JQuery 1.4.3 in vs 2005/2008 === Does we have support(with intellisense) for JQuery 1.4.3 in vs 2005/vs 2008.If yes what has to be done for that.Please give detailed description. Thanks.. Naresh.
2
11,049,765
06/15/2012 11:23:39
631,854
02/24/2011 07:20:21
142
3
in android change the location of layout while on corner of screen
<LinearLayout android:id="@+id/linearLayoutDragDrop" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:visibility="invisible" > <Button android:id="@+id/btndrag" android:layout_width="68dip" android:layout_height="42dip" android:layout_margin="2dip" /> <LinearLayout android:id="@+id/linearLayoutRAButtons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" android:visibility="invisible" > <Button android:id="@+id/btnKB" android:layout_width="68dip" android:layout_height="42dip" android:layout_margin="2dip" android:background="@drawable/keyboard" /> <Button android:id="@+id/btnRight" android:layout_width="68dip" android:layout_height="42dip" android:layout_margin="2dip" android:background="@drawable/mouse_right_click" /> <Button android:id="@+id/btnMoveCursor" android:layout_width="102dip" android:layout_height="64dip" android:layout_margin="2dip" android:background="@drawable/mouse_move" /> </LinearLayout> </LinearLayout> while above button is shown on the corner of screen,I want to show the below layout as that should be visible by changing the location.Actually on the corner top one button is showing and below three buttons getting cuts inside screen.Please suggest some solution.I am using canvas to show my screen.
android
null
null
null
null
06/16/2012 13:46:31
too localized
in android change the location of layout while on corner of screen === <LinearLayout android:id="@+id/linearLayoutDragDrop" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:visibility="invisible" > <Button android:id="@+id/btndrag" android:layout_width="68dip" android:layout_height="42dip" android:layout_margin="2dip" /> <LinearLayout android:id="@+id/linearLayoutRAButtons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" android:visibility="invisible" > <Button android:id="@+id/btnKB" android:layout_width="68dip" android:layout_height="42dip" android:layout_margin="2dip" android:background="@drawable/keyboard" /> <Button android:id="@+id/btnRight" android:layout_width="68dip" android:layout_height="42dip" android:layout_margin="2dip" android:background="@drawable/mouse_right_click" /> <Button android:id="@+id/btnMoveCursor" android:layout_width="102dip" android:layout_height="64dip" android:layout_margin="2dip" android:background="@drawable/mouse_move" /> </LinearLayout> </LinearLayout> while above button is shown on the corner of screen,I want to show the below layout as that should be visible by changing the location.Actually on the corner top one button is showing and below three buttons getting cuts inside screen.Please suggest some solution.I am using canvas to show my screen.
3
9,661,373
03/12/2012 03:21:42
1,263,225
03/12/2012 03:17:44
1
0
Not able to get code for like button to put on website
When trying to get the code to put like button onto website it says "HREF is not recognized as valid URL". I have a website that is run by a third-party. Is that a reason why I can not put the like button on that website? Thanks.
facebook-like
facebook-likebox
null
null
null
null
open
Not able to get code for like button to put on website === When trying to get the code to put like button onto website it says "HREF is not recognized as valid URL". I have a website that is run by a third-party. Is that a reason why I can not put the like button on that website? Thanks.
0
4,074,673
11/02/2010 03:11:33
351,564
05/27/2010 03:47:05
573
47
How to Show/Hide/Toogle Element with ExtJS?
How to Show/Hide/Toogle Element with ExtJS?
extjs
null
null
null
null
null
open
How to Show/Hide/Toogle Element with ExtJS? === How to Show/Hide/Toogle Element with ExtJS?
0
11,260,668
06/29/2012 11:06:33
1,074,734
12/01/2011 04:39:45
137
1
Android - how to create most appealing mobile app design
I am a android developer and i have a very short knowledge of photoshop and other designing tool. I have not much interest in designing. But to make my own android app i will have to put myself in desining phase. Please tell me what should i learn or practice so that i will make my application look better than now.
android
android-layout
null
null
null
06/29/2012 12:11:12
off topic
Android - how to create most appealing mobile app design === I am a android developer and i have a very short knowledge of photoshop and other designing tool. I have not much interest in designing. But to make my own android app i will have to put myself in desining phase. Please tell me what should i learn or practice so that i will make my application look better than now.
2
4,545,648
12/28/2010 11:22:31
184,314
10/05/2009 11:23:04
101
2
Sending Bulk Email - C#
I need to send newsletters to our customers (near 500,000), We are using Google Apps as our mail providers, ultimately it is gmail. I tried several ways of aciving this... But.. - Sometimes, it is hanging up (not sending mails after 255) So I devided to 255 blocks and tried, it too hangs up once in a while, cant rely on that. - Then clients says my news letters goes to clients as "spam", Google mail server has labled them as spam mails. What to to, anyone out there to help me ?
c#
email
gmail
spam-prevention
bulk
06/22/2012 11:57:11
off topic
Sending Bulk Email - C# === I need to send newsletters to our customers (near 500,000), We are using Google Apps as our mail providers, ultimately it is gmail. I tried several ways of aciving this... But.. - Sometimes, it is hanging up (not sending mails after 255) So I devided to 255 blocks and tried, it too hangs up once in a while, cant rely on that. - Then clients says my news letters goes to clients as "spam", Google mail server has labled them as spam mails. What to to, anyone out there to help me ?
2
5,035,982
02/17/2011 23:23:26
604,294
02/05/2011 10:51:51
154
10
Rails 3 functional optionally testing caching
Generally, I want my functional tests to not perform action caching. Rails seems to be on my side, defaulting to `config.action_controller.perform_caching = false` in `environment/test.rb`. This leads to normal functional tests not testing the caching. So how do I test caching in Rails 3. The solutions proposed in this thread seem rather hacky or taylored towards Rails 2: http://stackoverflow.com/questions/2765700/how-to-enable-page-caching-in-a-functional-test-in-rails I want to do something like: test "caching of index method" do with_caching do get :index assert_template 'index' get :index assert_template '' end end Maybe there is also a better way of testing that the cache was hit?
ruby-on-rails
ruby-on-rails-3
testing
caching
null
null
open
Rails 3 functional optionally testing caching === Generally, I want my functional tests to not perform action caching. Rails seems to be on my side, defaulting to `config.action_controller.perform_caching = false` in `environment/test.rb`. This leads to normal functional tests not testing the caching. So how do I test caching in Rails 3. The solutions proposed in this thread seem rather hacky or taylored towards Rails 2: http://stackoverflow.com/questions/2765700/how-to-enable-page-caching-in-a-functional-test-in-rails I want to do something like: test "caching of index method" do with_caching do get :index assert_template 'index' get :index assert_template '' end end Maybe there is also a better way of testing that the cache was hit?
0
7,857,808
10/22/2011 06:20:22
1,002,642
10/19/2011 07:33:44
1
0
iTunes Sync Failed to Install message for Adhoc distribution
I just switched to Xcode 4.2 and my adhoc .ipa is not installing on device using iTunes. I am getting message Failed to Install.
ios
install
itunes
adhoc
failed-installation
10/22/2011 17:50:32
not a real question
iTunes Sync Failed to Install message for Adhoc distribution === I just switched to Xcode 4.2 and my adhoc .ipa is not installing on device using iTunes. I am getting message Failed to Install.
1
10,079,740
04/09/2012 20:55:09
1,070,422
11/29/2011 01:21:27
34
0
find files with size in unix
I am looking for a unix command to print the files with its size. I used this but didnt work. find . -size +10000k -print. I want to print the size of the file also along with the filename/dir
unix
find
size
command
null
04/09/2012 21:15:39
off topic
find files with size in unix === I am looking for a unix command to print the files with its size. I used this but didnt work. find . -size +10000k -print. I want to print the size of the file also along with the filename/dir
2