Posts

Showing posts from September, 2013

php - Creating a lookup field in a CakePHP form -

php - Creating a lookup field in a CakePHP form - i have view created using bake has following: <fieldset> <legend><?php echo __('edit device'); ?></legend> <?php echo $this->form->input('deviceid'); echo $this->form->input('devicetypeid'); echo $this->form->input('userid'); echo $this->form->input('type'); echo $this->form->input('keypadid'); echo $this->form->input('version'); echo $this->form->input('description'); echo $this->form->input('updateid'); ?> </fieldset> which saves table: create table `device` ( `deviceid` varchar(255) not null , `devicetypeid` int(11) not null , `userid` int(10) not null , `type` varchar(10) null default null , `keypadid` int(10) null default null , `version` varchar(255) null default null , `description` tinyblob null , ...

sass - Using Compass sprites, generated CSS uses all class names as well as shared one -

sass - Using Compass sprites, generated CSS uses all class names as well as shared one - say have html this: <!doctype html> <html lang="en-us"> <head> <meta charset="utf-8"> <title></title> <link rel="stylesheet" href="css/styles.css"></link> </head> <body> test <a class="ribbons-sprite ribbons-exclusive" href="#">exclusive</a> <a class="ribbons-sprite ribbons-featured" href="#">featured</a> </body> </html> and have sass (scss) this: @import "compass/utilities"; @import "ribbons/*.png"; @include all-ribbons-sprites(true); .ribbons-sprite { display: inline-block; text-indent: -9999px; } the outputted css this: .ribbons-sprite, .ribbons-exclusive, .ribbons-featured { background: url('../images/ribbons-scfb85024...

jquery - character are not showing from starting in text box -

jquery - character are not showing from starting in text box - when clicking on other text box ,starting letter of text box not showing after entering character.(email) <div class="input_label">e-mail</div> <div class="input" id="email" data-type="email" data-maxchar="50"></div> email field--iusuisdaouoisduiasi@kfjgkf.kjf after clicking text box--email--aouoisduiasi@kfjgkf.kjf email should be--iusuisdaouoisduias should display starting charater.. jquery html5

c# - After updating IBM.Data.Informix.dll, project gives "Object reference not set" error -

c# - After updating IBM.Data.Informix.dll, project gives "Object reference not set" error - i developed asp.net 2.0 replacement asp.net application @ work using original's version of ibm.data.informix.dll (2.81). replacement works fine part, intermittently hangs when connecting database (which problem original.) decided upgrade latest version of dll (3.70), upon deleting old version , replacing new, adding reference, "object reference not set" error whenever build application. the error not specify line or give useful info. if open 1 of .aspx pages before building, warning on file itself. here entire error: : build (web): object reference not set instance of object. and warning, 1 page in particular: warning 2 \\io\wwwroot\intranet\cwsheet-test2\selection.aspx: asp.net runtime error: object reference not set instance of object. \\io\wwwroot\intranet\cwsheet-test2\selection.aspx 1 1 cwsheet-test2 additionally, when aspx file open, u...

c# - Removing ConnectionString when deploying with Visual Studio 2012 -

c# - Removing ConnectionString when deploying with Visual Studio 2012 - i'm working on project 2 web applications, 1 beingness hosted long running process (with appfabric), other normal mvc application. share same datacontext, same connectionstring. appfabric application deployed kid application of main, taking advantage of web.config inheritance (we don't want connectionstring duplicated in web config) my problem new visual studio 2012 wizard publishing, connectionstring automatically added, when untick "use connection string @ runtime" box. i seek utilize web config transform this: <connectionstrings> <add xdt:transform="removeall" /> </connectionstrings> but connection string still on web config after publishing. any suggestions ? i'm thinking removing web config kid application it's not ideal. answer can found here: web deploy / publish adding unknown connection string? add project prop...

check overflow for double in average calculation in C++ -

check overflow for double in average calculation in C++ - i have implement standard deviation , variance in c++. #include <iostream> #include <string> #include <math.h> class stddeviation { private: int max; double value[100]; double mean; public: double calculatemean() { double sum = 0; for(int = 0; < max; i++) sum += value[i]; // question 1. @ bottom. homecoming (sum / max); } double calculatevariane() { mean = calculatemean(); double temp = 0; for(int = 0; < max; i++) { temp += (value[i] - mean) * (value[i] - mean) ; } homecoming temp / max; } double calculatesamplevariane() { mean = calculatemean(); double temp = 0; for(int = 0; < max; i++) { temp += (value[i] - mean) * (value[i] - mean) ; } homecoming temp / (max - 1); } int setvalues(double *p, int count) { if(count > 100) homecoming -...

javascript - Force webpage to print in legal paper -

javascript - Force webpage to print in legal paper - in web application intranet, have webpage has printed user in legal (8 1/2" x 14") paper. is there way using css or javascript tell browser request (or optimize) paper size? if there isn't, possible @ to the lowest degree alter default printer settings particular webpage user doesn't have specify legal paper manually? thanks in advance kind answers. this can't done standard css or javascript. might able activex can't sure , work in ie. javascript css printing web

html - Submitting a form value straight into the URL? -

html - Submitting a form value straight into the URL? - i've created paginator search function on site. paginator works fine, search function. however, issue have i'm having utilize excess code pass through value of form run query with. ideally, want when press submit button + page submits, posts value form straight url url variable, submitting it, checking see if form in question defined, storing value variable, passing variable through url's of page links stores url variable. want cutting out middle man , create url variable word go. suggestions? guys. <cfif isdefined("form.search")> <cfset search = form.search> </cfif> <cfquery datasource="test.datasource" name="findbands"> select test_band test test_band <cfqueryparam value="%#search#%" cfsqltype="cf_sql_varchar" /> </cfquery> <form action="band_search.cfm" method="post"> <...

cocoa - pass local declaration of NSDictionary to performSelector -

cocoa - pass local declaration of NSDictionary to performSelector - how not need set info object right in selector phone call method? code warning (local declaration of data) : nsdictionary *data = [nsdictionary dictionarywithobjectsandkeys:@"siluetaimage", @"action", silueta_id, @"siluetaid", siluetatyp_id, @"siluetatypid", nil]; [self performselector:@selector(downloadbindatafortyp:data:) withobject:@"siluetaimage" withobject:data]; code without warning : [self performselector:@selector(downloadbindatafortyp:data:) withobject:@"siluetaimage" withobject:[nsdictionary dictionarywithobjectsandkeys:@"siluetaimage", @"action", silueta_id, @"siluetaid", siluetatyp_id, @"siluetatypid", nil]]; the selector: - (void)downloadbindatafortyp:(nsstring *)typ data:(nsdictionary*)data { asinetworkqueue *q = [self queue]; ...

java - Finding a tab within a page using selenium webdriver -

java - Finding a tab within a page using selenium webdriver - i newbie selenium , trying access tab total score card tab on folloing website. http://www.espncricinfo.com/icc-womens-world-cup-2013/engine/current/match/594903.html. my code in java : driver.get("http://www.espncricinfo.com/icc-womens-world-cup-2013/engine/current/match/594903.html"); driver.manage().timeouts().implicitlywait(5l, timeunit.seconds); driver.findelement(by.xpath("//*[@id='st_1']")).click(); however not seem able find tab. can please help. thanks the "tab" in iframe before can element in iframe , have "activate" frame driver.switchto().frame("live_iframe") java selenium webdriver selenium-webdriver

using JMX client to connect to the Websphere JVM -

using JMX client to connect to the Websphere JVM - how can connect websphere jvm through jmx client? can jmx client used connect websphere jvm alter logging settings? basically have utilize websphere-specific jars in order connect using jmx client. may follow this article in order configure this. websphere jmx

How to pass two or more parameters while calling a module in codeigniter HMVC (MX) -

How to pass two or more parameters while calling a module in codeigniter HMVC (MX) - i'm using hmvc modular extension codeigniter https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/home . call within site view easily modules::run('modulename/controller/method') we can pass single parameter like modules::run('modulename/controller/method',$parameter) how can pass 2 or more parameters through this? codeigniter version : 2.1.3 thanks we can pass 2 or more variables shown below modules::run('modulename/controller/method',$parameter1,$parameter2,$parameter3) you can pass more parameters separated comma. codeigniter codeigniter-2 hmvc

reportingservices 2005 - Report not generating results when parameters passed -

reportingservices 2005 - Report not generating results when parameters passed - i hope can help pretty frustrating , sure minor detail cannot see anymore. i have simple study below not generate results if leave @startdate , @enddate in report; however, if hard-code parameters (with date range, example, 1/1/13 through 1/31/13) study works fine , displays results. can please help?? thank you! declare @startdate datetime declare @enddate datetime set @startdate = convert(datetime,convert(varchar(25),@startdate,101) + ' 00:00:00') set @enddate = dateadd(s,-1,dateadd(d,1, convert(varchar, @enddate, 101))) select i.crossreference [steiner code], i.weight [vendor code], po.poid purchaseid, i.location center, s.address1 + ' ' + s.address2 centeraddress, s.city, s.zip, s.phone, i.description, po.orderdate, po.ordered quantity, i.cost, (po.ordered * i.cost) extcost [visual inventory].dbo.inventory inner bring together [visual inventory...

python - Check if a timestamp string is within a time range -

python - Check if a timestamp string is within a time range - i need check if timestamp string time range: tt = '26-12-2012 18:32:51' t1 = datetime.timedelta(0, 28800) #08:00 hrs t2 = datetime.timedelta(0, 68400) #19:00 hrs to compare need convert timestamp timedelta?, how can that, compare like: if tt >= t1 , tt <= t2: thanks.. first, build datetime object datetime.strptime : >>> t = datetime.datetime.strptime('26-12-2012 18:32:51','%d-%m-%y %h:%m:%s') >>> t datetime.datetime(2012, 12, 26, 18, 32, 51) now, build sec datetime object represents date portion: >>> t2 = t.replace(hour=0,minute=0,second=0) from can datetime.timedelta suitable comparing other timedelta s: >>> t - t2 datetime.timedelta(0, 66771) >>> dt = t - t2 >>> dt1 = datetime.timedelta(0, 28800) #08:00 hrs >>> dt2 = datetime.timedelta(0, 68400) #08:00 hrs >>> dt > dt1 true ...

Computing the union of the keySets of two HashMaps in Java -

Computing the union of the keySets of two HashMaps in Java - i want compute union of keys of 2 hashmaps. wrote next code (mwe below), get unsupportedoperationexception. of accomplishing this? import java.util.hashmap; import java.util.map; import java.util.set; public class addall { public static void main(string args[]){ map<string, integer> first = new hashmap<string, integer>(); map<string, integer> sec = new hashmap<string, integer>(); first.put("first", 1); second.put("second", 2); set<string> 1 = first.keyset(); set<string> 2 = second.keyset(); set<string> union = one; union.addall(two); system.out.println(union); } } so, union not copy of one , is one . is first.keyset() . , first.keyset() isn't re-create of keys of first , it's view, , won't back upwards adds, documented in map.keyset() ....

html - Make a webpage automatically open another webpage after a period of time? -

html - Make a webpage automatically open another webpage after a period of time? - hey guys have coursework, here exact requirement have " after 4 seconds, sec page displayed (main web page). " after open website welcome page appear after (4 seconds) automatically go homepage. <meta http-equiv="refresh" content="4;url='home.html'"> html css html5 webpage

jquery - vertical menu with horizontal -

jquery - vertical menu with horizontal - i have vertical menu opens sub menu using jquery. there way create submenu open in same line this: item item subitem1 subitem2 item this code: css: #menu-main { margin: 0; padding: 0; position:absolute; top:107px;} #menu-main li{ list-style: none; position:relative; height:25px; margin:0 2px; padding:20px 5px 0 10px; color:#ffffff; font-weight:bold; font-size:36px; text-transform:uppercase; clear: left;} #menu-main li a{ background: #000; text-decoration: none; padding: 1px 1px; z-index:1001;} #menu-main li a:link, #menu-main li a:visited, #menu-main li a:active { text-decoration:none; color:#ffffff; } #menu-main li a:hover {background: #000; color: white; padding: 1px 6px;} #menu-main li ul{list-style: none; none; margin: 0; padding: 0; display:none; float:left; z-index:1002; position:absolute; left:100%; top:0px;} #menu-main li ul li {f...

websocket - QT - qtwebsocket - can't connect -

websocket - QT - qtwebsocket - can't connect - i'm using qtwebsocket https://github.com/antlafarge/qtwebsocket on qt creator 5.0, linux 64bit. i'm trying connect echo test: wssocket->connecttohost( "echo.websocket.org", 80 ); but disconnected status. tried ws:// , http:// prefix same error. idea? don't know how study bug on gitorious. it of import me don't utilize webkit, need pure tcp socket connection. regards there qt websockets add-on module located @ https://qt.gitorious.org/qt/qtwebsockets. has been tested on several platforms, , succeeds autobahn testsuite. qt websocket

c++ - NULL pointer during ATL Dialog WindowProc -

c++ - NULL pointer during ATL Dialog WindowProc - i'm unfamiliar atl/win32 ui programming , i'm trying prepare access violation occurs when close atl dialog. the main window has next message map: begin_msg_map(cmywindow) message_handler(wm_close, onclose) message_handler(wm_destroy, ondestroy) command_id_handler(id_popup_exit, onexit) command_id_handler(id_popup_logon, onlogon) command_id_handler(id_popup_logoff, onlogoff) command_id_handler(id_popup_help, onhelp) command_id_handler(id_popup_about, onabout) command_id_handler(id_popup_datanetsettings, onconfigure) command_id_handler(id_popup_transferstatus, ontransferstatus) // etc... ontransferstatus launches modal dialog: lresult ontransferstatus(word /*wnotifycode*/, word wid, hwnd /*hwndctl*/, bool& /*bhandled*/) { hwnd hc; hc = findwindow(null, l"myapp transfer status"); if(hc) { ...

iphone - How to stop the UIView from disappearing? -

iphone - How to stop the UIView from disappearing? - by clicking on button, save info uitextfields of uiview . when info in uitextfield not right , click on button, want open keyboard, view dissapears. how stop uiview dissapearing , open keyboard instead. i think should set code in viewshoulddissapear, there no such method. this code: - (void) viewwilldisappear:(bool)animated { if ([textfield1 length] < 3 || [textfield1 length] > 17) { tableview.contentinset = uiedgeinsetsmake(65, 0, 10, 0); [tableview scrolltorowatindexpath:[nsindexpath indexpathforrow:7 insection:indexpath.section] atscrollposition:uitableviewscrollpositiontop animated:no]; [txtseriesasiu becomefirstresponder]; return; } if (shouldsave) [self save]; } i'm assuming have button on navigation controller. then add together custom button there , if right dismiss other wise show keyboard - (void)viewdidload { [super viewdidload]; ...

sql - MySQL - Join tables, retrieve only Max ID -

sql - MySQL - Join tables, retrieve only Max ID - i've seen solutions similar on other posts, i've been having issue applying specific problem. here initial join: select service_note_task, comment_id, comment service_note_task left bring together service_note_task_comments on service_note_task.service_note_task_id = service_note_task_comments.service_note_task_id; which results in: +-----------------------------+------------+--------------+ | service_note_task | comment_id | comment | +-----------------------------+------------+--------------+ | service note task 3 | 25 | comment | | service note task 3 | 26 | comment blah | | service note task 3 | 36 | aaa | | service note task 2 | 13 | awesome comm | | service note task 1 | 12 | cool comm | +-----------------------------+------------+--------------+ but each service_note_task, need 1 row representing comment highest comment_id, this:...

javascript - check if value exists in 2D array -

javascript - check if value exists in 2D array - i have 2d array in format emi_309 | nowadays | weak | 6 emi_310 | nowadays | strong | 9 emi_319 | nowadays | medium | 8 emi_315 | nowadays | weak | 5 i want check if value exists in first column using simple function e.g, check if emi_77 exists in first column i came across $.inarray(value, array) function 1d array only. is there similar 2d array yes, if combination of $.inarray , $.map : if ($.inarray(value, $.map(arr, function(v) { homecoming v[0]; })) > -1) { // ... } javascript jquery

How do I specify time in "For Every 1.00 am of Friday" in milliseconds Java for a cron job? -

How do I specify time in "For Every 1.00 am of Friday" in milliseconds Java for a cron job? - hi trying writing class schedule job @ specific time. here code, public void test(){ timer timer = new timer(); calendar date = calendar.getinstance(); date.set(calendar.hour,0); date.set(calendar.minute, 0); date.set(calendar.second, 2); date.set(calendar.millisecond,0); //schedule run on 1 every friday. timer.schedule(new jobrunner(), date.gettime(),1*0*0*0); } please help on lastly line, not sure how specify time in there. thanks i hope helps. static final long period = 7*24*60*60*1000;//one week public void test(){ timer timer = new timer(); calendar date = calendar.getinstance(); date.set(calendar.hour_of_day, 1); date.set(calendar.minute, 0); date.set(calendar.second, 0); date.set(calendar.millisecond,0); date.set(calendar.day_of_week, calendar.friday);...

ruby - ActiveRecord callback after_save not really called after saved -

ruby - ActiveRecord callback after_save not really called after saved - having this: class user < activerecord::base after_save :execute_after_save def execute_after_save kernel.puts "actual object still not saved" if changed? end end the kernel.puts sentence should called never because after object saved not changed. 1.9.3p286 :003 > u = user.create!(:name => "wadus name") actual object still not saved => #<user id: 1, name: "wadus name"> 1.9.3p286 :004 > u.changed? => false 1.9.3p286 :004 > u.name = "other name" => "other name" 1.9.3p286 :005 > u.changed? => true 1.9.3p286 :006 > u.save! actual object still not saved => true 1.9.3p286 :007 > u.changed? => false see actual object still not saved sentences shouldn't there. i expecting after_save callback called after object saved. this situation turning me crazy combinations of dirty objec...

JSP - Scope attribute name same as EL implicit object -

JSP - Scope attribute name same as EL implicit object - can please explain me behavior ? setting request attribute in servlet , reading in jsp . 1) dispatcher servlet code : request.setattribute("somename", someobject); naturally , can read in jsp ${somename} 2) if set attribute name same el implicit object name, like request.setattribute("requestscope", someobject); then have read ${requestscope.requestscope} ! why container able map attribute in case#1 straight in case attribute name el implicit object name need nest reference ${requestscope.requestscope} ? el first check if given variable name 1 of reserved (implicit) variable names , utilize per specification. if not, in ${somename} , el automatically search attribute name in respectively page, request, session , application scope. you seem expect works other way round, i.e. first attribute , implicit objects. not true. otherwise break working of implicit el objects. jsp...

mySQL select maximum value for column A with same values in column B -

mySQL select maximum value for column A with same values in column B - here's table in question, generated command @ bottom of question: +--------------+-----------------+ | usr_postcode | pdp_point_total | +--------------+-----------------+ | ms2 8la | 160 | | ms2 8la | 140 | | ms2 8la | 110 | | ms2 8la | 100 | | ms2 8la | 90 | | ms2 8la | 80 | | ms2 8la | 50 | | ms2 8la | 30 | | wn4 9nv | 25 | | ms2 8la | 20 | | sl6 1sr | 10 | | sl1 4dx | 10 | +--------------+-----------------+ i'd find largest value in sec column each value in column one, output like: ------------- ms2 8la | 160 wn4 9nv | 25 sl6 1sr | 10 sl1 4dx | 10 ------------- the 2 columns different tables @ moment command: select distinct users.usr_postcode, point_date_pairs.pdp_point_total...

wcf data services - Connecting MVVMCross Portable connect to WCF DataService. Is it possible? -

wcf data services - Connecting MVVMCross Portable connect to WCF DataService. Is it possible? - i need advice people. writing engineering science work project in vs2012 used auto dealership. have sql database, wcf dataservice, wpf application (which connected succesfuly wcf) , wanted create mobile version too. chose mvvmcross portable create mono android , wp7 app 1 core. , have problems here connecting wcf dataservice mobile portable core like: unable add together service reference specified odata feed because wcf info services not installed target framework. install supported version of wcf info services, see http://go.microsoft.com/fwlink/?linkid=253653. i searched on net , seems portable class library doesn't back upwards wcf info service yet. writing question in hope there solution this. if not shall wait? or perhaps need alter wcf info service normal wcf service work on mvvmcross portable there lot of work alter in app have in wpf done, ...

bash - shell script to create folder daily with time-stamp and push time-stamp generated logs -

bash - shell script to create folder daily with time-stamp and push time-stamp generated logs - i have cron job runs every 30 minutes generate log files time-stamp this: test20130215100531.log, test20130215102031.log i create 1 folder daily date time-stamp , force log files in respective date folder when generated. i need accomplish on aix server bash. maybe looking script this: #!/bin/bash shopt -s nullglob # line not compain when no logfiles found filename in test*.log; # files considered ones startign test , ending in .log foldername=$(echo "$filename" | awk '{print (substr($0, 5, 8));}'); # foldername characters 5 13 filename (if exist) mkdir -p "$foldername" # -p dont "folder exists" warning mv "$filename" "$foldername" echo "$filename $foldername" ; done i tested sample, proper testing before using in directory contains of import stuff. edit in response comment...

c++ - Error with function in multithreaded environment -

c++ - Error with function in multithreaded environment - what function iterate through array of bools , upon finding element set false, set true. function method memory manager singleton class returns pointer memory. i'm getting error iterator appears loop through , ends starting @ beginning, believe because multiple threads calling function. void* cnetworkmemorymanager::getmemory() { waitforsingleobject(hmutexcounter, infinite); if(mcounter >= netconsts::knummemoryslots) { mcounter = 0; } unsigned int tempcounter = mcounter; unsigned int start = tempcounter; while(musedslots[tempcounter]) { tempcounter++; if(tempcounter >= netconsts::knummemoryslots) { tempcounter = 0; } //looped way around if(tempcounter == start) { assert(false); homecoming null; } } //return pointer free space , increment mcounter = t...

image processing - How can i read svg data stroke in pycairo? -

image processing - How can i read svg data stroke in pycairo? - i have jpg images , inputsvgdraw, flash tool image annotation (http://www.mainada.net/inputdraw), can trace lines on generate svg datas. svg datas sample: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 488 325"><g fill="none" stroke-miterlimit="6" stroke-linecap="round" stroke-linejoin="round"><path d="m 307 97 l 0 -1 l -2 -1 l -10 -2 l -20 -1 l -25 5 l -22 9 l -10 9 l 0 9 l 2 12 l 16 18 l 25 11 l 25 5 l 17 -1 l 6 -4 l 3 -7 l -1 -12 l -6 -16 l -7 -13 l -11 -12 l -11 -14 l -9 -5" opacity="1" stroke="rgb(170,37,34)" stroke-width="5"/></g></svg>. what function can manage info ? you can read svg input using librsvg , rendering cairo . if want draw annotations in svg on initial image, might need utilize pil numpy since cairo doesn't load ...

Machine learning images -

Machine learning images - am novice machine learning, , hope guide me along. need train machine recognize object e.g. using libsvm. don't know specify training file , how start. can provide me psuedo code? java person there huge amount of material on web. supposedly you'd larn more field called image recognition , or computer vision - need? some general info: http://en.wikipedia.org/wiki/computer_vision java & image recognition: java framework image pattern recognition? working illustration http://neuroph.sourceforge.net/image_recognition.html http://savvash.blogspot.cz/2010/05/simple-image-recognition-in-java.html there recognize tool weka (java , ml): http://www.cs.waikato.ac.nz/ml/weka/ mentioned svm (libsvm in particular) algorithm included in weka well. and many more ... machine-learning

android - How get Calendar app into 2.3.3 Emulator? (I'm using Google APIs level 10) -

android - How get Calendar app into 2.3.3 Emulator? (I'm using Google APIs level 10) - i created virtual device using addon "google apis, android api 10, revision 2" when start emulator, there's no calendar app. how calendar app on there? in addon somewhere? have download form somewhere (where?) , install via adb? no, there no calendar default in android emulators. though, can install them externally, via adb . but, advisable improve test on phone. nevertheless, check out issue farther assistance. android android-emulator android-calendar

c++ - Efficient way to copy strided data (to and from a CUDA Device)? -

c++ - Efficient way to copy strided data (to and from a CUDA Device)? - is there possibility re-create info strided constant (or non-constant) value , cuda device efficiently? i want diagonalize big symmetric matrix. using jacobi algorithm there bunch of operations using 2 rows , 2 columns within each iteration. since matrix big copied device exclusively looking way re-create 2 rows , columns device. it nice utilize triangular matrix form store info additional downsides like non-constant row-length [not kind of problem] non-constant stride of column values [the stride increases 1 each row.] arise. [edit: using triangular form still impossible store whole matrix on gpu.] i looked @ timings , recognized copying strided values 1 1 slow (synchronous async.). // edit: removed solution - added answer thanks robert crovella giving right hint utilize cudamemcpy2d. i'll append test code give possibility comprehend... if comes suggestions solving re...

c# - Using Twitterizer to display the outbound tweets, not replies -

c# - Using Twitterizer to display the outbound tweets, not replies - ia m using twitterizer diplay tweets on website , issue showing tweets ,i want show tweets user not replies, code using is: if (!page.ispostback) { seek { usertimelineoptions options = new usertimelineoptions(); options.screenname = "xxxxx"; twitterstatuscollection tweets = twittertimeline.usertimeline(options).responseobject; int counter = 0; string twittercode = ""; foreach (twitterstatus thisstatus in tweets) { if (counter < 7) { datetime completedate = thisstatus.createddate; string finish = completedate.tolongdatestring(); twittercode += "<li><p ><a href=\"http://twitter.com/" + thisstatus.user.screenname + "\" target=\"_bla...

python - Searching for import location -

python - Searching for import location - i'm trying write python script/function help determine import from. want functionality pyqt4 extended , useful python standard library. to accomplish need dynamically search modules, shared objects, classes, , perchance more 'types' of things given search term. i want pass module/class/etc. string, import dynamically , search it. the interface of function this: search(object_to_search, search_term) examples: search('datetime', 'today') -> 'datetime.datetime.today' search('pyqt4', 'nonmodal') -> 'pyqt4.qtcore.qt.nonmodal' search('pyqt4', 'qicon') -> 'pyqt4.qtgui.qicon' i suppose back upwards wildcards '*' search of sys.path beyond scope of i'm concered @ time. this type of script useful pyqt4. there lot of 'enum-like' things nonmodal above , finding location import or reference them can cumbersome. i...

php - Submitting a form with jQuery/Ajax only works every other time -

php - Submitting a form with jQuery/Ajax only works every other time - i'm trying submit form includes file upload via ajax/jquery, process form through php script, , homecoming result in div form resided in. my current form code is: <section id="content-right"> <form name="uploader" id="uploader" method="post" enctype="multipart/form-data"> <input type="hidden" id="max_file_size" name="max_file_size" value="10485760" /> <input type="file" name="fileselect" id="fileselect" /> <input type="submit" name="submit" id="submit" value="upload" /> </form> </section> and current ajax/jquery script is: <script> $(function() { $('#uploader').submit(function() { $(this).ajaxsubmit({ type: $(this).attr('method'), ...

javascript - Why a click event in jquery doesn't apply to my new element? -

javascript - Why a click event in jquery doesn't apply to my new element? - i have 3 divs left, center , right classes , want interchange position , apply new classes go thei new positions. reason doesn't work script: $(function() { $(".left").css("left","50px"); $(".center").css("left","300px"); $(".center").css("width","300px"); $(".center").css("height","300px"); $(".center").css("top","25px"); $(".right").css("left","650px"); $(".right").click(function(){ $(".left").animate({ left: '650px' }, 1000, function() { }); $(".center").animate({ left: '50px', ...

image - CUDA Median filter not working properly -

image - CUDA Median filter not working properly - i took upon myself larn cuda, , tried implement simple median filter image processing. came with, can't seem results images come out of it. instance, output image relatively noise free, saturation of image seems higher, , when tried image of teddy bear wikipedia, nose gets greenish reason. became frustrated think of new ideas, if can see problem in code, gratefull. thanks! this kernel function: __global__ void median_filter(int *input, int *output, int image_w, int image_h){ __shared__ float window[block_w*block_h][9]; int x, y, tid; int i, j, imin, temp; x = blockidx.x*blockdim.x + threadidx.x; y = blockidx.y*blockdim.y + threadidx.y; tid = threadidx.y*blockdim.y + threadidx.x; if(x>=image_w && y>=image_h) return; /* setting 3x3 window elements median */ if(y==0 && x==0) window[tid][0] = input[y*image_w+x]; else if(y==0 && x!=0...

java - How are things embedded inside of a browser? -

java - How are things embedded inside of a browser? - adobe embedded flash , oracle embedded java. how 1 go embedding external programs within browser. i'm on linux btw. you write called browser plug-in, done via npapi, , users install (or scheme makers pre-install it). java linux flash firefox ubuntu

c# - Can't write hyperlink as a string -

c# - Can't write hyperlink as a string - i want write this string input = "<form action=\"http://blabla.com\" method=\"post\">...</form>"; but backslash() .com ends merge link... can do? so link becoming http://blabla.com\ this might more readable strings contain both slashes , double quotes. me. string input = @"<form action=""http://blabla.com"" method=""post"">...</form>"; also note single quote acceptable in html, should work too: string input = @"<form action='http://blabla.com' method='post'>...</form>"; here's additional info on literals in c# http://msdn.microsoft.com/en-us/library/aa691090(v=vs.71).aspx c# winforms url hyperlink backslash

copy from one table field to another table field in phpmyadmin? -

copy from one table field to another table field in phpmyadmin? - with phpmyadmin how can re-create text field called products_folder located in table called description field called products_us located in table called products_description? try this: insert `products_description ` (`products_us `) select `products_folder ` `description ` phpmyadmin copy

php - Transferring an ecommerce website from CoreCommerce to OpenCart -

php - Transferring an ecommerce website from CoreCommerce to OpenCart - i'm in process of converting corecommerce website opencart. corecommerce hosted e-commerce application. i need export customers, orders, products, categories, , reviews (or much can). corecommerce exported client csv file not contain passwords. know how work out? should create random passwords each client , email them , allow them know? there 16000 customers. also, have experience of csv import tools opencart can recommend? thanks just inquire customers reset passwords when did not , seek log site. i'd first inspect csv files create php function import correctly since don't think both applications have same database fields. php e-commerce opencart export-to-csv

mysql - Outer join giving same results as inner join if using where clause -

mysql - Outer join giving same results as inner join if using where clause - the next sql statement: select * employees e left bring together departments d on e.deptid = d.deptid ( d.deptname = 'hr' or d.deptname = 'hr & accounts') produces same results next inner join: select * employees e inner bring together departments d on e.deptid = d.deptid , d.deptname '%hr%'; in way produce same result. i mean first query equivalent e.g. of: select * employees , filter using where do left join? what steps of first query create same inner join? for rows don't match status of outer join, value of column in joined table null. clause happens (conceptually) after joins processed, status testing columns false (or, strictly speaking, null). if want include rows 1 table, match rows in sec table meet condition, have add together status on clause of outer join. also, note because inner bring together di...

c++ - Cout Not Printing Contents of Pointed To Memory -

c++ - Cout Not Printing Contents of Pointed To Memory - i have next code: if (myfile.is_open()) { int = 0; while (myfile.good()) { char *ptr = &(reinterpret_cast<char*>(&mem[0]))[i]; myfile.read(ptr, sizeof(struct req)); cout << ptr << endl; += sizeof(struct req); } } the cout in loop here seems print nothing, although know code setting memory because prints out right values if cout << mem[5] instead. basically, want print contents of whatever ptr referring to. silly question, know what's wrong here? cout << ptr , if ptr of type char* , treats ptr pointer (the first character of) c-style string, , prints contents of string to, not including, terminating '\0' null character. if want print pointer value, convert void* : cout << (void*)ptr << ... that's assuming actuallly want print value of pointer, appear hexadecimal memory address. title says ...

drop down menu - dropdown in primefaces datatable livescroll -

drop down menu - dropdown in primefaces datatable livescroll - i using datatable of primefaces , using feature of livescroll. facing unusual issue. when scroll down, info gets loaded on screen in perfect manner except dropdowns (using p:selectonemmeny) this. there issue drop downwards , live scroll. please help. pfb code.. same.. <p:datatable id="searchtable" var="student" value="#{databean.students}" scrollrows="10" scrollable="true" scrollheight="200" livescroll="true" > <p:column styleclass="colum8" style="text-align: center; background-color:#dcdcdc; width: 150px;padding: 4px;"> <f:facet name="header"> <h:outputtext value="#{msgs.mpromo_buscar_estatus}" /> </f:facet> <p:selectonemenu styleclass="dropdownbuscarstyle" id="promoestatusdd" value="#{promo.esta...

Android - Gesture Detection (Swipe up/down) on particular view -

Android - Gesture Detection (Swipe up/down) on particular view - i trying implement ongesturelistener in android. i have 3 textviews in layout. what trying accomplish set gesture listener 2 of textviews . here layout - <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rlmain" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:id="@+id/tvone" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:layout_marginbottom="10dp" android:layout_margintop="5dp" android:gravity="center" android:text="one" /> <textview android:id="@+id/tvtwo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_b...

PHP: MySQL INSERT INTO Producing blank table entries -

PHP: MySQL INSERT INTO Producing blank table entries - i've created simple login scheme in php, after coming code after several weeks, i'm left stumped why insert query not function properly; $query = mysql_query("insert `user` (`username`, `password`, `email`) values ('$username','".md5($password)."','$email')") or die(mysql_error()); now, inserts row user table username, bizarre reason end empty md5 hash, , empty email field. i've gone on code , echoed variables , can confirm they're available code access, not understand what's wrong query. i can hope it's issue syntax, life of me can't see it. puzzling when seemed working fine few weeks ago. when looking $_post using print_r; array ( [username] => myusername [password] => mypassword [email] => myemail [register] => register ) myusername so input info there, not transfering variables. solved: if($username == "" || ...

entity framework - EF Code First - creating database - Login failed for user -

entity framework - EF Code First - creating database - Login failed for user - i had ef code first set connecting existing database. working fine. i made couple changes poco , decided have code first generate new database me. getting error: cannot open database \"mydatabase\" requested login. login failed.\r\nlogin failed user 'domain\username'. i deleted old database, did not alter connection string: <add name="mydatabasecontext" connectionstring="data source=localhost;initial catalog=mydatabase;integrated security=true;" providername="system.data.sqlclient" /> i have sql server 2008 instance on local machine , domain username in "sysadmin" role. i tried various database initializers , same error all. failing on first query call, code first not create database. can point connection string re-create of old database (before changes) , run fine, except old schema though specified dropcreatedatabasealways...

php - Not able to access index on local LAMP server on Linux Mint -

php - Not able to access index on local LAMP server on Linux Mint - i'm starting play zend framework, have had troubles it. seek follow super guide from zerto zend framework in 10 minutes, amounted nothing. i getting annyoing message apache2: not reliably determine server's qualified domain name, using 127.0.1.1 servername ... waiting apache2: not reliably determine server's qualified domain name, using 127.0.1.1 servername twice. and while managed prepare that, how local server looks like. . this how /etc/hosts looks like. 127.0.0.1 localhost 127.0.0.1 prueba.local 127.0.1.1 dradis # next lines desirable ipv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters and, according 1, how vhost configuration should be. in /sites-avaliable symlinked /sites-enabled . prueba.local : <virtualhost *:80> servername prueba.local documentroot /home/se...

java - camel proxied web service returns an empty soap envelope -

java - camel proxied web service returns an empty soap envelope - i'm using camel proxy webservice (i need modify soap header first). i'm using cxf_message dataformat allows me alter soap header. sending soap message using soapui works fine, , can see arrives @ real webservice, however, the response empty soap envelope? when switch message dataformat response right (but can't alter soap headers). what doing wrong? why dataformat alter in/out behaviour? <cxf:cxfendpoint id="broker"> ... </cxf:cxfendpoint> <camelcontext id="camelcontext" xmlns="http://camel.apache.org/schema/spring"> <endpoint id="realws" uri="http://localhost:8080/service?throwexceptiononfailure=true" /> <route> <from uri="cxf:bean:broker?dataformat=cxf_message" /> <to ref="realws" /> </route> </camelcontext> as far awar...

jquery - Correct Approach for Serving Javascript Files via Node.js Ajax? -

jquery - Correct Approach for Serving Javascript Files via Node.js Ajax? - i trying write node application serves crjavascript code static webpage. code evaluated in webpage. similar this example, node instead of php. server application looks this: // load http module create http server. var http = require('http'); // configure our http server var server = http.createserver(function (req, res) { var js; //send libraries fs = require('fs'); res.writehead(200, {'content-type': 'text/plain'}); //var paths = ['javascript.js']; js = fs.readfilesync('example.js').tostring(); res.end('_js(\'{"message": " ' + js + '"}\')'); }); // hear on port 8000, ip defaults 127.0.0.1 server.listen(8000); // set message on terminal console.log("server running @ http://127.0.0.1:8000/"); while client code looks this: <html> <head> <meta name=...

javascript - Eval alternative -

javascript - Eval alternative - this code works calculator, scratch pad @ codeacademy tells me eval evil. there way same thing without using eval? var calculate = prompt("enter problem"); alert(eval(calculate)); eval evaluates string input javascript , coincidentally javascript supports calculations , understands 1+1 , makes suitable calculator. if don't want utilize eval , good, have parse string and, finally, computation (not though). have @ this math processor, want. basically is: read input string char char (with kind of problem it's still possible) building tree of actions want do at end of string, evaluate tree , calculations for illustration have "1+2/3" , evaluate next info structure: "+" / \ "1" "/" / \ "2" "3" you traverse construction top bottom , computations. @ first you've got "+" , has 1 on left side , look on r...