Posts

Showing posts from May, 2013

css - Linear Gradient background in IE 7 - 9 -

i have checkbox , label style, depending whether checkbox checked. far used [selectivizr] script 1 manage :selected propperty working in ie7. somehow gradient not working propper in ie 7, 8 , 9. there should gradient light darker green, deep blue gradient. can't explain strange behavoir, maybe has order of css-rules? input[type=checkbox]:checked + label { background: #00bf00; background: -webkit-linear-gradient(top, #00bf00 0%, #009400 100%); background: -moz-linear-gradient(top, #00bf00 0%, #009400 100%); background: -o-linear-gradient(top, #00bf00 0%, #009400 100%); background: -ms-linear-gradient(top, #00bf00 0%, #009400 100%); background: linear-gradient(top, #00bf00 0%, #009400 100%); filter: progid:dximagetransform.microsoft.gradient( startcolorstr='#222', endcolorstr='#45484d',gradienttype=0 ); /* edit: update below:*/ filter: progid:dximagetransform.microsoft.gradient( startcolorst

Telephone Conversation Logic Puzzle {Prolog} -

year('1928'). year('1929'). year('1932'). year('1935'). person(gertie). person(herbert). person(miriam). person(wallace). exchange(al). exchange(be). exchange(pe). exchange(sl). solve:- year(y1), year(y2), year(y3), year(y4), unique([y1,y2,y3,y4]), exchange(gertex), exchange(herbex), exchange(mirex), exchange(wallex), unique([gertex,herbex,mirex,wallex]), triples= [[gertie,y1,gertex], [herbert,y2,herbex], [miriam,y3,mirex], [wallace,y4,wallex]], %herberts first exchange \+ member([herbert,be,_],triples), %neither herberts nor gerties first exchange sl \+ ( member([herbert,sl,_],triples); member([gertie,sl,_],triples) ), %the exchange wasnt made in 1935 \+ member([_,be,'1935'],triples), %neither al nor exchanges made in 1932 \+ ( member([_,al,'1932'],triples); member([_,be,'1932'],triples) ),

java - Getting Line number of code executed -

i writing application automated generation of unit test cases.the application takes input .java file , process's find methods. methods invoked using test data using following command. method.invoke(classobj,methodarg); wish find lines executed int invoked method calculate coverage. have tried doing using stacktrace() gives line number of application code. can me this. , utterly lost. highly appreciated. current code is: runnable myrunnable; myrunnable = new runnable(){ public void run(){ try { int returnvalint = (int) fm.invoke(fobj, fargs); system.out.println(new exception().getstacktrace()[0].getlinenumber()); } catch (illegalaccessexception ex) { logger.getlogger(helloworldframe.class.getname()).log(level.severe, null, ex); } catch (illegalargumentexception ex) { logger.getlogger(helloworldframe.class.getname()).log(level.severe, null, ex); } catch (invocationtargetexception ex)

asp.net - Incorrect syntax near 'int' when using updatecommand on a gridview -

i have problem when ever try update record in database using gridview update event handler , updatecommand in sqldatascource following exception incorrect syntax near 'int'. weird thing when reload page find record updated yet need exception message not appear should do update event handler protected void gridview1_rowupdating(object sender, gridviewupdateeventargs e) { gridviewrow row = gridview1.rows[e.rowindex]; int busid = convert.toint32(((datakey)gridview1.datakeys[e.rowindex]).value); textbox capacity =(textbox) row.cells[1].controls[0]; textbox drivername =(textbox) row.cells[3].controls[0]; textbox phone =(textbox) row.cells[4].controls[0]; sqldatasource1.updateparameters.add("capaity", capacity.text); sqldatasource1.updateparameters.add("id", busid.tostring()); sqldatasource1.updateparameters.add("driver", drivername.text);

Getting position of TextView in TableLayout Android -

i have table layout in android. set time table , looks following : <?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fadescrollbars="false" > <tablelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/table" android:layout_width="fill_parent" android:layout_height="wrap_content" android:stretchcolumns="*" > <tablerow android:id="@+id/tablerow1" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:id="@+id/blank" android:background="@drawable/border" /> <textview android

scala - preStart hook: a message to the actor itself -

let's override prestart hook , send message self : class someactor extends actor { override def prestart(): unit = { self ! somemessage } ... } can expect somemessage first message in queue? no, since actor creation happens asynchronously might have enqueued message before constructor or prestart run. if need ensure processing of message before other you’ll need use become , stash : self ! somemessage def receive = initial def initial: receive = { case somemessage => // stuff unstashall() context become initialized case _ => stash() } def initialized: receive = { // normal behavior } you’ll need mix in akka.actor.stash trait , configure actor use dequebasedmailbox .

Gillespie Stochastic Simulation in Discrete Time using R -

i'm simulating stochastic simulation epidemiology. how simulate in discrete time? managed obtain continuous time using coding below. library(gillespiessa) parms <- c(beta=0.591,sigma=1/8,gamma=1/7) x0 <- c(s=50,e=0,i=1,r=0) <- c("beta*s*i","sigma*e","gamma*i") nu <- matrix(c(-1,0,0, 1,-1,0, 0,1,-1, 0,0,1),nrow=4,byrow=true) set.seed(12345) out <- lapply(x=1:10,fun=function(x) ssa(x0,a,nu,parms,tf=50)$data) out how should alter coding discrete time? thanking in advance. the gillespie algorithm (see this paper ) simulates trajectory of continuous-time markov chain (it discrete-event simulation approach). broadly speakig, means each event in out associated continuous time, , this inherent simulation approach used (i.e., not easy change). however, you can find out state of model @ discrete points in time : state of model before first event higher time stamp. example : observe reaction even

c++ - Quadtree and size of region in constructor -

i reading nice tutorial quadtree this site , question. when create quadtree have pass in constructor bounds of screen, if map's size 10000 x 10000px , game screen 1280 x 720px, should pass? quadtree quad = new quadtree(0, new rectangle(0,0,600,600)); so in example screen region 600 x 600px. , it's working until player go further 600x600 i'm using c++ sfml 2.0, sf::view center player position. you should pass bounds of whole map, regardless of whether parts of region can seen or not.

ios - Need assistance regarding transitionFromView:toView:duration:options:completion: -

regarding transitionfromview:toview:duration:options:completion: apple doc says in last few lines: this method modifies views in view hierarchy only. not modify application’s view controllers in way. example, if use method change root view displayed view controller, responsibility update view controller appropriately handle change. if viewcontroller has 2 full screen size views display 1 @ time no issues: [transitionfromview:self.view toview:self.view2... but means it responsibility update view controller appropriately handle change ? if this: secondviewcontroller *svc = [[secondviewcontroller alloc]init]; [transitionfromview:self.view toview:svc.view... how responsibility update view controller appropriately handle change ? or how update viewcontroller? update i created single view projec, add secondvc in firstvc on button tap did this: self.svc = [[secondvc alloc]init]; [uiview transitionfromview:self.view toview:self.svc.view duration:1.0 optio

c# - How to deregister correctly from receiving notifications using IConnectPoint Unadvise? -

in documentation mobile broadband api , says: the following procedure describes how register notifications. 1.get iconnectionpointcontainer interface calling queryinterface on imbninterfacemanager > object. 2.call findconnectionpoint on returned interface , pass iid_imbnpinevents riid. 3.call advise on returned connection point , pass pointer iunknown interface on > object implements imbnpinevents punk. notifications can terminated calling unadvise on connection point returned in step 2. i have got code carries out first 3 steps, , registers mbn events. however, need de-register temporarily receiving these events. so, after couple of first attempts ended com exceptions, tried following code (with try/catch blocks): //first notifications public void registerevent(object iunk, guid guid, out uint storedtag) { iconnectionpoint icp = null; guid curguid = guid; storedtag = 0; if ((curguid == typeof(imbninterfacemanagerevents).guid) )

r - getURL (from RCurl package) doesn't work in a loop -

i have list of url named urllist , loop on source code each of url : for (k in 1:length(urllist)){ temp = geturl(urllist[k]) } problem random url, code stuck , error message: error in function (type, msg, aserror = true) : transfer closed outstanding read data remaining but when try geturl function, not in loop, url had problem, works. any please ? thank hard tell sure without more information, requests getting sent quickly, in case pausing between requests : for (k in 1:length (urllist)) { temp = geturl (urllist[k]) sys.sleep (0.2) } i'm assuming actual code 'temp' before writing on in every iteration of loop, , whatever fast. you try building in error handling 1 problem doesn't kill whole thing. here's crude example tries twice on each url before giving up: for (url in urllist) { temp = try (geturl (url)) if (class (temp) == "try-error") { temp = try (geturl (url)) if (class (temp)

google app engine - HashSet turning into TreeSet when unit testing JDO GAE/J app in maven -

i have java app gae uses maven (the net.kindleit version) following classes: public class c1 { ... @persistent(mappedby = "c1") @element(dependent = "true") private set<c2> c2s = new hashset<c2>(); public set<c2> getc2s() { return this.c2s; } ''' } public class c2 { private c1 c1; ... more properties, getters , setters ... } in 1 of tests, executing following: c2 myc2 = new c2(myc1); myc1.getc2s().add(myc2); the unit test works running inside eclipse, , code works in production app, when run unit tests under maven, test fails following: java.lang.classcastexception: com.me.model.c2 cannot cast java.lang.comparable @ java.util.treemap.compare(treemap.java:1188) @ java.util.treemap.put(treemap.java:531) @ java.util.treeset.add(treeset.java:255) @ com.me.service.c2serviceimpl.createc2(c2serviceimpl.java:319) i understand exception, c2 not impleme

c - Creating socket compatible with IPv4 and IPv6 -

i writing program can read ip address have been assigned on specific network interface (vlan: eth0.32). won't know if have been assigned ipv4 or ipv6 address try write protocol family agnostic. the way works is: for, navigate through list of available network interfaces , stop @ point find vlan (eth0.32) read ip address. anyways, @ point of development want works ipv4 leave ready when want implement ipv6 support. the program works , reads ipv4 address if create socket normally: sd=socket(pf_inet, sock_dgram, 0); but won't able read ipv6 addresses socket family (pf_inet=ipv4) this: sd=socket(pf_inet6, sock_dgram, 0); setsockopt(sd, sol_socket, ipv6_v6only, 0, sizeof(int)); the problem ipv6 socket, fails accomplish if condition read ip address: if (ioctl(sd, siocgifconf, &ifc) == 0) for more information, whole code: #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #

PHP code generates a segmentation fault -

edit added. i getting segmentation fault php ternary operation. i'm using php (5.4.13). <?php $t = empty($_get['t2']) ? $_get['t2'] : 'test'; $t = empty($_get['t2']) ? 'test' : $_get['t2']; echo '<pre>'.print_r($t, true).'</pre>'; ?> the statements: $t = empty($_get['t2']) ? $_get['t2'] : 'test'; $t = empty($_get['t2']) ? 'test' : $_get['t2']; dispatches segmentation fault (i checked apache error log this). commented statements above not throw segmentation fault. i doubt source error, able narrow down. sites use php having problem. i don't think bug! more error in php installation or in 1 of dependencies. no function used, language features, thought narrowed down pretty easily. edit: wanted know common problems causes segmentation fault, , if 1 of them can identified above code know solutions , how act. (this question, wond

Remove HTTP Response headers in Java -

is there way remove http response headers server , x-powered-by? my application using weblogic server. i'm programming in java using spring mvc framework , hibernate, , using jsp views. depends on headers added. if inside app, can use spring mvc interceptor remove them after controller calls. if outside app, might able try java ee filter configured in web.xml (the example security, approach work use case). if added after that, may want @ web front end (apache, iis, what-have-you) configure filter there. update this answer describes approach removing specific headers, httpservletresponse interface not allow header removal explicitly. need trial , error determine portion of stack adding header.

iphone - Disabling a button doesn't work -

i got button want disable when method getting called: - (void)disablesendbutton { nslog(@"disablesendbutton method"); self.sendbtn.enabled = no; //[self.sendbtn setenabled:no]; } header file property button: @property (strong, nonatomic) iboutlet uibutton *sendbtn; , synthesize it. disablesendbutton method gets printed out button stays enabled... weird , don't know how can fix this. viewcontroller called sendviewcontroller , somewhere else in program [sendviewcontroller.sendbtn setenabled:no]; , works expected. other don't enable or disable button... edit: sendviewcontroller = [self.storyboard instantiateviewcontrollerwithidentifier:@"sendview"]; if(self.sendbuttonisenabled == no){ //sendviewcontroller.sendbtn.enabled = no; // doesn't work //[sendviewcontroller.sendbtn setenabled:no]; // doesn't work [sendviewcontroller disablesendbutton]; } call method in viewdidload.... self.sendbtn.enabled = no;

Implementing facebook feed dialog and cross domain environment -

i'm trying implement facebook share widget link(button) on client's page. when user clicks on "share" button, dialog show up, populated information(caption, description, etc.) received our server. i've tried using feed dialog accomplish task. i've gone far as: - registering application facebook , getting application id. - placing feed dialog code onto test page located on local machine. so, application points localhost url. everything works expected site url , app domain set local machine url. however, our purposes need trigger dialog many different client's pages. so, urls different. i thinking use https://www.facebook.com/sharer/sharer.php however, far know doesn't have callback function need have. do have advise on how can implemented?

angularjs - breeze : Date Formatting -

i'm receiving dates server in format: thu apr 25 16:47:10 utc+0200 2013 the type date. i want dates displayed in dd/mm/yyyy format. i've used moment.js , in initializer function of entity, called registerentitytypector, do: myentity.createddate = moment.utc(myentity.createddate).format('dd/mm/yyyy'); although code returns formatted date, myentity.createddate remains same. if inspect in visual studio debugger , expand property, says 'prototype: invalid date'. i have 2 questions: 1) doing right way ? i.e, it thing conversion in registerentitytypector ? 2) why not working :-) ? breeze dates javascript dates. doing setting date property string. breeze attempts parse string, via javascript's date.parse method, date in order validate it. if fails, breeze leaves alone. in general, if want format date properties, should not done in model, rather in view. in other words, wherever displaying dates, best location convert dates strings. if

sql - Update second digit in a column -

how update second digit in 16 digit number '1' ? this should easy one, have not had luck. i working sql server 2000 , 2005 (multiple environments - same database tables). i searched solutions online , found 1 apparently work in oracle, sql server not pipe symbols when run this: update interface set optionbits = substring(optionbits,1,1)|| replace(substring(optionbits,2,1), '0', '1')||substring(optionbits,3, 14) objectnumber = 5 i want update 1 there object number = 5 can see. i looked using replace not solution either. what trick? thanks in advance! for mssql, the stuff function best option: update interface set optionbits = stuff(optionbits, 2, 1, '1') objectnumber = 5

Why is 'Components' tree structure empty - RTC source control -

Image
in rtc source control when expand team area have view : i can see stream , components. decides if components should appear in components folder ? can seen in screenshot empty. other developers populated components though cannot see streams ? you see components are visible you . in other words, depends on ownership each component. any component owned project area or team area displayed in component section. any component owned single resource (a member of rtc project area) or team area (that aren't part of) won't displayed there. the same apply streams: check owner of streams understand why resource doesn't see it. whats point of hiding stream if components not hidden ? the point (in hiding stream though doesn't hide component) preventing users deliver stream : can still work on same set of component (visible because of right ownership), can no longer see (and deliver to) given stream.

sql - Return binary as string, NOT convert or cast -

is there simple way (like convert or cast) return binary field string without converting or casting it? the data want looks in database: 0x24fc40460f58d64394a06684e9749f30 when using convert(varchar(max), binary_field), comes this: $ü@fxÖc” f„étŸ0 cast(binary_field varchar(max)) had same results. i'm trying modify datasource in old vb.net application, want string existing values, still original data. don't have in query, i'd if possible avoid modifying old vb code much. here select statement: select strname, strdesc, binuuid mytablename intfamily = '1234' order strname alternatively, if cast/convert it, safe compare "$ü@fxÖc” f„étŸ0" stored string @ later time value gathered in same way? there built in function generate hex strings binary values select sys.fn_varbintohexstr (0x24fc40460f58d64394a06684e9749f30)

android - Execution order of OnActivityResult and OnResume -

i understand onactivityresult should called before onresume in activity that's not happening me. i'm finding gets called before onresume, , before onstart. sample code below, i'm breakpointing relevant methods see what's happening. what's going on? activity 1 using system; using system.collections.generic; using android.app; using android.content; using android.runtime; using android.views; using android.widget; using android.os; using android.content.pm; namespace lifecycletest { [activity(mainlauncher = true)] public class activity1 : activity { protected override void oncreate(bundle bundle) { base.oncreate(bundle); this.setcontentview(resource.layout.main); this.findviewbyid<button>(resource.id.button1).text = "start activity 2"; this.findviewbyid<button>(resource.id.button1).click += button_click; } void button_click(object sender, even

Access database "Corrupt" in 2007; opens in 2010 -

i have accdb database used multiple individuals , stored on network share. when opened in acccess 2007 following message appears: cannot open database " \\databasepath\filename.accdb ". may not database application recognizes or file may corrupt access 2010 opens database no problems. what common cause of issue? searched database repair tools , can't find microsoft tools accdb files (jetcompact didn't it). ran compact , repair via access 2010, did save locally , copied on share - no effect. other magically upgrading users access 2010 (which won't happen) i'm in dark here. you may have features you're using in 2010 aren't supported in 2007. look here more info.

assembly - Fourth parameter on ARM SUBtract instruction -

can explain/confirm (particularly sub line) me: cmp align,#2 cmpne align,#5 cmpne align,#8 subeq xpos,xpos,width,lsr#1 i thinking might equivilant c code: if ((align==2) || (align==5) || (align==8)) { xpos -= width >> 1; } i have found documentation don't understand forth parameter, imm12 . says: the sub instruction subtracts value of operand2 or imm12 value in rn. your assumption code looks correct me. but don't understand forth parameter, imm12 the fourth parameter not imm12 , rather a shift operation on width (which assume alias 1 of general purpose registers).

asp.net - angular with c# web api cross domain doesnt work -

i'm trying populate angular result json request on web api without succcess. without success. want make angular application read web api result. got error http://jobshop-webapi.validando.com.br/api/login?callback=jsonp_callback 404 (not found) its cross-domain ajax request i've tried found. http://jobshop-webapi.validando.com.br/api/login?email=login@email.com&password=senha including header. dont know reason. please, give light. edit response header here: access-control-allow-origin:* cache-control:no-cache content-length:49 content-type:application/json; charset=utf-8 date:thu, 02 may 2013 14:47:45 gmt expires:-1 pragma:no-cache server:microsoft-iis/7.0 x-aspnet-version:4.0.30319 x-powered-by:asp.net edit http://jsbin.com/egonid/12/edit here code :( doesnt works yet the response needs add header: http://patelshailesh.com/index.php/cross-domain-asp-net-web-api-call-using-ajax this 1 works! :)

google maps - How to assess whether a geographical point is within a region? -

i have list of agents each geographical regions may cover such as: "manhattan, new jersey" or "sw19, putney, bristol" uk. given address such "101 7th avenue, new york" or "119 merton road, wimbledon"; how query whether address within 1 regions above? ie. "101 7th avenue, new york" within "manhattan"? all regions above display areas when searched in google maps. cheers!.. miguel

asp.net - Mixed Content Error in IE7 with html5shiv and SSL -

i'm developing asp.net app using html5shiv , ssl. reason getting mixed content errors in ie7 using html5shiv. if remove html5shiv errors go away. i'm using update panels , master pages if matters. ideas? edit: after further testing appears combination between html5shiv , stylesheet. if either excluded, no mixed content error. <script type="text/javascript" src="../js/html5shiv.js"></script> <link rel="stylesheet" href="../styles/global.css" /> solution: had data uri on header style. removing uri solved problem. are using externally hosted html5shiv (on cdn)? if so, download file , host on same server.

compilation error C++ : can not call member function without object -

i have following main file tried create map predefined value , pass further processing other method. main file shown below : int main(){ map<id,porto> _portoinit; id = 1; porto p; p.val = 5; _portoinit.insert(pair<id, porto>(id, p)); porto::setporto(_portoinit); return 1; } where setporto defined under class following (in seperate file) void porto::setporto( const map<id,porto>& _portoblock ) { //do stuffs }; i got prompted error of "error: cannot call member function ... without object" did not declare object of _portoinit in main file or wrong way of declaration? you need invoke method through actual object: p.setporto(_portoinit); unless setporto static method, code invalid.

ios - UICollectionViewFlowLayout not invalidating right on orientation change -

i have uicollectionview uicollectionviewflowlayout. implement uicollectionviewdelegateflowlayout protocol. in datasource have bunch of uiviewcontrollers respond custom protocol can ask size , other stuff. in in flowlayout delegate when asks sizeforitematindexpath:, return item size protocol. viewcontrollers implement protocol return different item size depending on orientation. now if change device orientation portrait landscape theres no problem (items larger in landscape) if change back, warning: item width must less width of uicollectionview minus section insets left , right values. please check values return delegate. it still works don't warnings maybe can tell me doing wrong. there problem. if don't tell collectionviews collectionviewlayout invalidate in willanimaterotationtointerfaceorientation: sizeforitematindexpath: never called. hope understand mean. if need additional information let me know :) one solution use kvo , listen change fr

windows - WiseScript: Get user executing a running process -

i know logged on windows user can detected via wisescript using: get system information, retrieve: windows logon name but purely in wisescript, there way user name executing running process? there important difference here because logged on 'bob', run on mydbinterface.exe 'sally', , mydbinterface.exe must ran bob's rights. note: i know can external c# application talks wise, rather in wise if there built in method. you call command line tool "tasklist" username of running process, , output text file. use wisescript parse file exact username.

matlab - How to plot a surface with a texture map -

Image
i want plot surface texture map on it, conditions not "ideal" ones. first lets explain have. i have set of points (~7000) image coordinates, in grid. this points not define perfect squares. it not meshgrid . sake of question, lets assume have 9 points. lets ilustrate have image: x=[310,270,330,430,410,400,480,500,520] y=[300,400,500,300,400,500,300,400,500] lets can "structure" of grid, size1=3; size2=3; points=zeros(size1,size2,2) x=[310,270,330; 430,410,400; 480,500,520] y=[300,400,500; 300,400,500; 300,400,500] points(:,:,1)=x; points(:,:,2)=y; and lets have 3rd dimension, z. edit: forgot add piece if info. triangulate points in image , 3d correspondence, when displayed in surface don't have x , y coords of image, simplification of given data lets x=x/2 y=y/3 and have: points=zeros(size1,size2,3) z=[300,330,340; 300,310,330; 290,300,300] surf(points(:,:,1)/2,points(:,:,2)/3,points(:,:,3)) what

asp.net - Error connecting to SQL Server via alias from local IIS7 -

just wondering if has run before. had few devs @ this, , none of can figure out. i have asp.net web forms app connecting sql server db via alias using ef4. alias set point machine name (not "." or "local"). when run out of vs2012, works fine. if deploy local instance of iis7 , try pull in browser, error: a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: named pipes provider, error: 40 - not open connection sql server) my connection string looks this: data source=aliasname;initial catalog=databasename;integrated security=true;multipleactiveresultsets=true if change connection string data source machine name instead of alias, works fine iis7. so, problem appears alias , when running out of iis7. as workaround, using local build profile deploy different web.config do

multithreading - Multi-thread UI in WPF -

i have 2 ui threads, 1 main thread , other background thread apartmentstate sta. each thread creates own window , background window has "cancel" button on it. the main thread has function busy , needs quite long time finish. hope once "cancel" button clicked, main thread should stop time-consuming function. below pseudo-code in main thread: for(...) { //option a: application.doevents(); //option b: dispatcher.invoke update ui in background thread if(cancel) return; //stop time-consuming function else dosomething; } the strange thing click event on "cancel" button not captured or handled background thread. imo, each thread has own message queue, , when click "cancel" button, message should queued , processed background thread immediately, according test locally, not true, background thread never handles button click event... any thoughts? btw, think there 2 ways overcome above issue, 1 use application

Redirect https to https in .htaccess file -

i created quote form on https server did not work, need redirect url new https server works... redirect permanant https://www.my-url.com/quotes/ https://new-quote-form-url.com/quotes/ i tried in .htaccess file did not work. thank you. it should be redirect permanent https://www.my-url.com/quotes/ https://new-quote-form-url.com/quotes/ note removed 'to' , spelt permanent incorrectly.

oracle - NOT IN with Subquery SQL Construct -

actor (id, fname, lname, gender) movie (id, name, year, rank) casts (pid, mid, role) pid references actor id mid references movie id list movies x has been in without y (x , y actors). i finding difficult construct sql not in. attempt. im unable fininsh off due second actor not being present select m.name movie m m.id not in (select c.mid casts c, actor c.pid = a.id , a.name = "adam..") using not exists : select m.name -- show names movie m -- of movies exists -- there ( select * -- role casts c -- casted join actor -- actor on c.pid = a.id c.mid = m.id , a.name = 'actor x' -- name x ) , not exists -- , there not ( select * -- role casts c

Python Django - Saving ContentFile to Local Files -

i'm using contentfile django python , have contentfile uploading web server. what save contentfile (it pdf) onto local machine. in : type(file_contents) out : <class 'django.core.files.base.contentfile'> django.core.files.storage import default_storage path = default_storage.save('/tmp/file.pdf', file_contents) in:path out:u'/tmp/file.pdf' i can't find file anywhere on local machine ... recognize might doing wrong, here great. want able find pdf on local machine see looks like. the server can't save files local machine. local browser can that. thing server can present file download browser.

c# - MVC WebApi endpoints do not work on production, but regular endpoints do -

i have asp.net mvc project runs locally. has controllers inherit controller , inherit apicontroller. routes below. when run project through visual studio locally, works perfectly. can hit endpoints , expected responses. when deploy cloud server (windows server 2008 r2), :controller endpoints work (those @ /p/{controller}/{action}). none of endpoints @ :apicontroller work. following error of them: {"$id":"1","message":"no http resource found matches request uri 'http://domain/controller'.","messagedetail":"no type found matches controller named 'controller'."} my routes: in routeconfig.cs: routes.maproute( name: "default", url: "p/{controller}/{action}/{id}", defaults: new { controller = "home", action = "redirect", id = urlparameter.optional } ); in webapiconfig.cs: config.routes.maphttproute(

Semantic Mediawiki: Defining derived properties through queries -

(i'm kind of new whole semantic mediawiki thing , have been scouring web leads on small project i'm doing. ) how go defining properties derived other properties in semantic mediawiki. assuming have created course smw , provide details on progress of course (i.e. current page / total number of pages in %). i read there semantic special properties extension subpages property exist. help? i'm guessing go #ask or sorts , check on subpage of whole course? any further (better) ideas? you can define semantic property using #ask query. here example in 1 of wikis doing described, showing count , percentage of total population. in case i'm defining 2 variables first make code more readable , since need website_count value twice avoid 2nd query. {{ #vardefine: website_extension | {{#ask: [[has extension::{{fullpagename}}]] | format=count }} }}{{ #vardefine: website_count | {{#ask: [[category:website]] [[is validated::true]] [[is active::true]] [[collect

How a web development production process should work? -

i'm reaching out in hopes of fellow developers can provide sources/workflow diagrams/explanations/etc. of how proper web development environment should/could work today. currently, work organization allows content editors full access production server, granting them possibility of pushing content , page creations live server click of button. in past, i'm used bare minimum 3 step process (development -> staging -> production). access these different branches controlled server administrators , permission "push" assets 1 environment strictly controlled server administrators/web administrators. our current system allows general access gain control of document creation/content manipulation without restrictions (besides global assets changes [css/javascript/templates/etc.]). results in unexperienced web authors not following brand guidelines, discovering "creative" side , breaking page formatting due no limitations, absolutely no tracking of being

php - Rackspace Cloud Files API: 404 Error -

i'm using following curl request post file rackspace cloud files: $ch = curl_init(trim($rackspace['x-storage-url']).'/container/hello'); curl_setopt($ch, curlopt_httpheader, array('x-auth-token: '.$rackspace['x-auth-token'], 'content-length: '.$data['file']['size'])); curl_setopt($ch, curlopt_put, true); curl_setopt($ch, curlopt_infile, fopen($data['file']['path'], 'r')); curl_setopt($ch, curlopt_infilesize, $data['file']['size']); curl_setopt($ch, curlopt_header, true); echo curl_exec($ch); i'm following rackspace documentation , i'm getting 404 not found error , i'm not quite sure how troubleshoot this. suggestions? solution after further analysis, discovered x-storage-url issued after authenticating https://storage101.dfw1.clouddrive.com . dfw1 indicates data center in dallas, containers created in chicago. confirm problem, created container @ dallas data cen

plc - VBA Subroutine doesn't exit for loop -

i’m new programing i’m hoping can me. not sure how formulate right question didn’t find stackoverflow answers. when step through code , come opcservobj.connect opcserverstrg doesn't connect. no errors, nothing appears happen. cursor jumps left margin , nothing. when resume stepping through routine starts function on again. should continue , exit loop plan test state of connection again. reference library: opc da automation wrapper 2.02 sub main() connectopc end sub private function connectopc() boolean dim opcservobj opcautomation.opcserver dim opcgroupobj opcautomation.opcgroup dim opcserverlist variant dim opcserverstrg string set opcservobj = new opcautomation.opcserver opcserverlist = opcservobj.getopcservers if opcservobj.serverstate <> true = 1 ubound(opcserverlist) opcserverstrg = opcserverlist(i) if opcserverstrg = "iconics.iconicsopcuaserver.v5" opcservobj.connect opcserve

vb.net - SQL Statement in VB to Join w/ Area Code -

so first have 2 tables- main output table geocode replacement/correction table first thing leftjoin - if main output table matches geocodes on replacement table, swaps them out. however have 3 columns in main output table geocodes can go: zipcity zipstate zipnation this determines lot of factors depending on geocode placed. now kicker: geocode replacement table has 2 exceptions although geocode city related, needs go state. special exceptions. made checkbox mark them. for these exceptions checkbox'd - want sql/select statement check if checkbox checked, , if - mark zipstate. if not marked, keep zipcity. my biggest problem: below select coding, keeps giving me syntax error complaining operator. have triple checked million times, , under impression doesn't multiple [column name] statements in single column select. qdquery.sql = "select iif(input.zipcity not null, iif(input.zipcity=[geocodes]. [replacegeocode],iif([geocodes].[exceptionchkbox],

Download Extension for Joomla 3.0 with Force Login -

i looking extension joomla site users can download pdf instruction sheets, forms, etc list of files available. must rather forced them log site able download can adjust making module accessible registered people only. not must have. anyone knows of extension one? know joomlashine has extension in jsn cube template don't offer itself. akeeba release system ( ars on jed ) best solution of it's kind , free download, use on several of ours , our client sites. you can combine akeeba subscriptions ( aksubs on jed ) system manage site access including integrated access file downloads. of course there lots of document download extensions on the joomla extension directory .

Jquery document off mouseevent -

start $(document).on('mousemove', "#id", event); disable $(document).off('mousemove', "#id"); i have tried... $(document).off('mousemove', "#id", event); $("#id").unbind('mousemove'); exact functions $(document).on('click', "#id", function (e) { $(document).on('mousemove', "#id", event); }); $(document).on('mouseup', function () { console.log('test'); $(document).off('mousemove', "#id"); }); what doing wrong? use mousedown instead of click since click fired after mouseup $(document).on('mousedown', "#id", function (e) { console.log('register') $(document).on('mousemove', "#id", event); }); $(document).on('mouseup', function () { console.log('test'); $(document).off('mousemove', "#id", event); }); demo: fi

visual studio 2010 - SVN Create Branch from Uncommited Code -

i’m new svn. have project i’m adding new feature , has taken longer thought [*surprise not]. production code needs fixing. how can save uncommitted “new feature” code new branch? thanks! with command line tool, go root of working copy , perform following steps: first create new (feature) branch in repository. following command has no effect on working copy: svn copy ^/hello/trunk ^/hello/branches/feature-foobar now move working copy uncommitted changes feature branch , commit changes: svn switch ^/hello/branches/feature-foobar svn commit move working copy trunk , start working on bug fix: svn switch ^/hello/trunk later go feature branch, complete changes , reintegrate them trunk.

Custom filter with hook_filter_info() in Drupal -

i got problem when trying create custom filter hook_filter_info() . have make replacement based on fields of current viewed node. using following code. return str_replace('%people1%', 'replacing working', $text); in process callback, code works fine, can't current node id ( menu_get_item() or arg() ). also, have clear cache every time make changes ( 'cache' => false ). is there need know processing data in process callback? menu_get_item() , arg() don't return different value when called process callback of input filter; not returning value expecting, because input filter called in different context think. an input filter called when: a node body needs rendered a comment body needs rendered a entity field using input format needs rendered a view created views module using input format render text entered user a module using input format render text entered user even in case input filter used render body of node, there

Webcam video recorder with resumable uploader -

i developing website in video recording core feature. ideally want video recording continue if internet connection goes down. if user recording video , internet gets disconnected video may locally saved , when internet connection resumes, video gets uploaded server. i have gone through websites provides apis recording video via webcam not work if internet connection goes down moment. any suggestions highly appreciated. i guess case need offer off-line application rather online streaming solution, later user can upload video. presentationtube @ http://presentationtube.com uses technique. said: presentationtube offers powerpoint presentation recorder , video sharing network teachers, students , business professionals produce , share presentations in video format.

multithreading - dynamic work allocation for threads in C# -

i'm wanting know how set class dynamically allocate work threads, preferably in c#. i've looked @ [this] ray tracer explanation, don't see description of how look. don't want overly complicated. i have group of tasks large split evenly , give out threads. want dynamically allocate small portions of tasks each thread, , when threads finish, obtain results , give them more tasks. know did years ago, can't find notes nor have been successful google or here. any appreciated. below idea of in pseudo code. it's not going pretty give idea of i'm talking about. tasklist = arraylist of n tasks resultlist = arraylist of thread results create x threads integer taskscompleted while(taskscompleted < tasklist.size){ thread = next available thread in pool resultlist.add(thread.results) taskscompleted += thread.numoftasks thread.dowork(next set of tasks) } clean threads processresults(resultlist) if using .net 4.0+ can use parallel.for

java - Hibernate basic configuration in Spring 3 project - Class not found exception -

Image
i'm trying set hibernate 3.6 in existing spring 3 mvc + spring 3 security project. nevertheless keep getting java.lang.classnotfoundexception in hibernateutil class - line return new configuration().configure().buildsessionfactory(); my project structure looks this: hibernate.cfg.xml : <?xml version="1.0" encoding="utf-8"?> <!doctype hibernate-configuration public "-//hibernate/hibernate configuration dtd 3.0//en" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.bytecode.use_reflection_optimizer">false</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.driver</property> <property name="hibernate.connection.password">password</property> <property name="hibernate.connection.url"

HTTP 400 when inserting new subscription for Google Apps Marketplace application -

i'm trying insert new subscription change seatcount license. i'm using v2 licensing api , here code : appsmarketservice service = new appsmarketservice(); service.appid = "appid"; service.appname = "somedomain"; service.endpoint = "https://www.googleapis.com/appsmarket/v2/"; service.consumerkey = service.appid + ".apps.googleusercontent.com"; service.consumersecret = "somethingsecret"; service.authorize(); customerlicense cl = service.getcustomerlicense("company.com", true); subscription sub = new subscription(); sub.subscriptionid = "subid"; sub.applicationid = service.appid; sub.name = "full"; sub.description = "full service"; sub.currencycode = "usd"; sub.customerid = cl.customerid; sub.initialcart = new initialcart(); sub.initialcart.cart = new cart(); sub.initialcart.cart.receiptname = "receipt name"; sub.initialcart.cart.receiptdescription = "receip

knockout.js - Adding items from one observable array to another results in unremovable items on postback -

i've got jsfiddle illustrate i'm experiencing in application code. (i'll post actual fiddle code below, posterity.) essentially, i've got 1 observable array that's being used populate list of checkbox options. selecting 1 of options adds item observable array composed of selected items. if there's error in form (or suppose if editing existing data), selected observable array populated start selected items. however, now, there no connection between original items , selected items, checking or unchecking 1 of checkboxes adds duplicate , removes duplicate. my question 1) going wrong (i.e. there better way won't cause problem) , 2) if not, what's best way restore connection between items, checkboxes indicate items there , unchecking them remove item? html <ul data-bind="foreach: fruit"> <li> <label> <input type="checkbox" class="cbfruit" data-bind="checked: selecte