Posts

Showing posts from February, 2015

php - Login problems in android: fields are returning empty -

i creating , android application our thesis. i'm finished app when started having problems login. fields accepting input when try toast it, sends me "fields empty" response when send data server. got stuck working on this, appreciated. this jsonparser class: public class jsonparser { static inputstream = null; static jsonobject jobj = null; static string json = ""; // constructor public jsonparser() { } // function json url // making http post or mehtod public jsonobject makehttprequest(string url, string method, list<namevaluepair> params) { // making http request try { // check request method if(method.equals("post"){ // request method post // defaulthttpclient defaulthttpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(url); httppost.setent...

machine learning - difference between Latent and Explicit Semantic Analysis -

i'm trying analyse paper '' computing semantic relatedness using wikipedia-based explicit semantic analysis ''. one component of system described therein i'm grappling difference between latent , explicit semantic analysis. i've been writing document encapsulate understanding it's somewhat, "cobbled together", sources don't 100% understand, i'd know if i've come accurate, here is: when implementing process singular value decomposition (svd) or markov chain monte carlo machines, corpus of documents can partitioned on basis of inherent characteristics , assigned categories applying different weights features constitute each singular data index. in highdimensional space difficult determine combination of factors leading outcome or result, variables of interest “hidden” or latent. defining set of humanly intelligible categories, i.e. wikipedia article pages basis comparison [gabrilovich et al. 2007] have devised system whereb...

go - Template layouts in revel -

is possible use template layouts in revel. example have root.html contains {{define "main"}}{{end}} tag. call executetemplate(out, "main", nil) http://golang.org/pkg/html/template/#template.executetemplate something c.renderlayout() you can define want conf/routes file. can call action name want: package controllers import ( "github.com/revel/revel" ) func (c name) root() revel.result { c.render() } views/name/root.html other way can this: views/controler/nameaction.html {{template "root.html" .}} views/root.html <p>bla, bla</p>

php - How to pass arrays and nested arrays from Controller to Javascript in View in Yii framework -

i have array in controller , nested arrays inside result of query database. want pass data javascript ajax , update content on site when check checkbox. pls show me example or give me advice how it. controller public function actiontestresponse(){ $id = $_post['id']; $checkval = $_post['checkval']; $this->layout = 'newhome'; $criteria=new cdbcriteria(); if($id == 'checkfemale'){ $criteria->compare('sex', 'female'); } else if ($id == 'checkfemale'){ $criteria->compare('sex', 'male'); } $items = user::model()->findall($criteria); //if($items==null||empty($items)){$items='null';} //$response = array('id'=>$id, 'checkval'=>$checkval, array('data' => $items)); $response = array('id'=>$id, 'checkval'=>$checkval); //$d...

java - JavaFX : Consuming REST service and displaying the data in front-end -

i working on javafx(on jdk8 scenebuilder) project should connect spring-mvc based server , access objects server , display it. have programmed spring server give desired object upon request, unfamiliarity in ui programming , javafx making bit difficult. in fxml file, have added grid-pane , display objects there. appreciate guys started up. have basic code, pasting below : canvas.fxml : <?xml version="1.0" encoding="utf-8"?> <?import javafx.scene.control.*?> <?import java.lang.*?> <?import javafx.scene.layout.*?> <?import javafx.geometry.insets?> <?import javafx.scene.layout.gridpane?> <?import javafx.scene.control.button?> <?import javafx.scene.control.label?> <gridpane maxheight="-infinity" maxwidth="-infinity" minheight="-infinity" minwidth="-infinity" prefheight="400.0" prefwidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns=...

python - how to search efficiently items in the list? -

i have list of dicts: [ {"num": 60, "name": "a"}, {"num": 50, "name": "b"}, {"num": 49, "name": "c"}, ... etc ] and list created this: [[x, {}] x in xrange(0, mylist[0]['num'])] list: [..., [50, {}], [51, {}], ... , [60, {}], ..., [65, {}], ... etc] and this: [..., [50, {"num": 50, "name": "b"}], [51, {}], ..., [60, {"num": 60, "name": "a"}], ..., [65, {}], ... etc] how it? in question, wrote and this: [..., [50, {"num": 50, "name": "b"}], [51, {}], ..., [60, {"num": 60, "name": "a"}] the accepted answer gives different, i'd add answer more faithful original request. this answer based on observation wrote xrange(0, mylist[0]['num']) leading me think topmost number in list in first position, , further...

dynamics crm 2011 - How to insert line breaks into Dialog response default values -

Image
on final page of dialog i'm designing want have multiple line text box acts template user has input on rest of dialog them alter/ add other comments create body email. put line break in between each field make bit more readable. any body know how put line break in on default value? you cannot in standard dialogs. dialogs designed facilitate relatively straightforward data entry scenarios. more sophisticated wizard designs can built custom html dialogs (using web resources).

ruby - How to print capistrano current thread hash? -

an example output capistrano: info [94db8027] running /usr/bin/env uptime on leehambley@example.com:22 debug [94db8027] command: /usr/bin/env uptime debug [94db8027] 17:11:17 50 days, 22:31, 1 user, load average: 0.02, 0.02, 0.05 info [94db8027] finished in 0.435 seconds command successful. as can see, each line starts "{type} {hash}". assume hash unique identifier either server or running thread, i've noticed if run capistrano on several servers, each 1 has it's own distinct hash. my question is, how value? want manually output message during execution, , want able match output, server triggered it. something like: puts "debug ["+????+"] happened!" put in ???? there? or there another, built in way output messages this? for reference, using capistrano version: 3.2.1 (rake version: 10.3.2) hash command uuid. tied not server specific command run. if want distinguish between servers may try following task :some_task ...

How to change HTML markup structure using javascript or CSS? -

i have following markup in page. <div class="tm_left"> <!-- left side bar code--> </div> <div class="tm_center"> <!-- content code--> </div> <div class="tm_right"> <!-- right side bar code--> </div> is possible change markup following when page opened on 768px width , below : <div class="tm_center"> <!-- content code--> </div> <div class="tm_left"> <!-- left side bar code--> </div> <div class="tm_right"> <!-- right side bar code--> </div> i not want touch <div class="tm_center"><!-- content code--></div> want moving <div class="tm_left"><!-- left side bar code--></div> between other 2 divs when page opened in 768px width , below. can achieve using java script / css? if java script solution work on mobiles? kindly try ...

Nginx basic authentication, login from command line -

as know browser login user nginx basic authentication server -h 'authorization: basic username:password' header. but in case of application, client uses command lines calling rest api, can't modify. there no way me inject user credential in header. question how nginx server configured remember user, , allow user log out without credential sent in every request? for example, user types commands terminal: login myhost.com -u myname:mypassword then user authorized access sever, he/she can retrieve information provided apis. logout myhost.com then user logs out.

php - CodeIgniter cookie setter issue -

the following doesn't set cookie in codeigniter. $this->load->helper('cookie'); if (!$this->input->cookie('xx')) { //cookie not set, first visit $cookie = array( 'name' => 'xx', 'value' => '1', 'expire' => (10 * 365 * 24 * 60 * 60), 'path' => '/', 'prefix' => '', 'secure' => true ); $this->input->set_cookie($cookie); } checked browser , used vardump($this->input->cookie('xx')); result false. try removing secure array $this->load->helper('cookie'); if (!$this->input->cookie('xx')) { //cookie not set, first visit $cookie = array( 'name' => 'xx', 'value' => '1', 'expire' => (10 * 365 * 24 * 60 * 60), 'path' => '/', ...

How to achieve Google map like zoom in IOS(Objective-C) -

Image
i newbie in ios , have typical problem of how achieve google map zoom in project. zoom want on image shown below. example - if click on first button whole image should zoom focussing on first button

html - jQuery Click event inside a Bootsrap select box, does not triggered in iOS device -

i have bootstrap select box option inside on click event triggers action jquery. unfortunately functionality not work on ios device. html: <div class="form-group"> <label for="selectpropertylocation">location:</label> <select class="form-control" id="selectpropertylocation"> @foreach ($alllocations $location) <option value="{{ $location->location_id }}">{{ $location->name }}</option> @endforeach <option selected style="color:red;">empty</option> <option id="newpropertylocation" style="color:green;">add new location</option> </select> </div> jquery: $('#newpropertylocation').click(function(){ $('#addpropertylocation').modal({ show: 'true' }); }); try code, add css cursor:pointer element , check click event $('#...

Comma usage in swift -

@ibaction func selectedgame(segue:uistoryboardsegue) { if let gamepickerviewcontroller = segue.sourceviewcontroller as? gamepickerviewcontroller, selectedgame = gamepickerviewcontroller.selectedgame { detaillabel.text = selectedgame game = selectedgame } } hi all, i'm following tutorial learn swift. yesterday found part of code can not find way understand means thatcomma means. can u pls explain me? the comma used combine multiple optional bindings 1 statement avoid unnecessary nesting. from swift 1.2,the if let construct can unwrap multiple optionals @ once, include intervening boolean conditions. lets express conditional control flow without unnecessary nesting. more details for example: var foo: int! var bar: string! // swift 1.2 if let foo = foo,bar = bar { // foo & bar have values. } else { } // before swift 1.2 if let foo = foo { // nesting if let bar = bar { // foo & bar have value. } } xcode6.3 , ab...

asp.net mvc - Format Date to only Month and Year - "MMM-yyyy" -

i working on mvc 4.0./c#/razor view. in model have date [display(name = "for period")] [displayformat(dataformatstring = "{0:dd-mmm-yyyy}")] public system.datetime forperiod { get; set; } and in view getting date using @html.displayfor(modelitem => item.forperiod) and in result getting date in "12-may-2015" format. want skip day date , in result want "may-2015". my question should used in view "mmm-yyyy" format? you can format date in view file following way <span>@convert.todatetime(item.effectivedate).tostring("mmm-yyyy")</span> for can format date model [display(name = "for period")] [displayformat(dataformatstring = "{0:mmm-yyyy}")] public system.datetime forperiod { get; set; }

python - increase array size and initialize new elements to zero -

i have array of size 2 x 2 , want change size 3 x 4. a = [[1 2 ],[2 3]] a_new = [[1 2 0 0],[2 3 0 0],[0 0 0 0]] i tried 3 shape didn't , append can append row, not column. don't want iterate through each row add column. is there vectorized way of in matlab: a(:,3:4) = 0; , a(3,:) = 0; converted a 2 x 2 3 x 4. thinking is there similar way in python? in python, if input numpy array, can use np.lib.pad pad zeros around - import numpy np = np.array([[1, 2 ],[2, 3]]) # input a_new = np.lib.pad(a, ((0,1),(0,2)), 'constant', constant_values=(0)) # output sample run - in [7]: # input: numpy array out[7]: array([[1, 2], [2, 3]]) in [8]: np.lib.pad(a, ((0,1),(0,2)), 'constant', constant_values=(0)) out[8]: array([[1, 2, 0, 0], [2, 3, 0, 0], [0, 0, 0, 0]]) # 0 padded numpy array if don't want math of how many zeros pad, can let code given output array size - in [29]: out[29]: array([[1, 2], [2, 3]]...

How to insert record into two mysql table using php? -

i have 2 tables in database 1 "test1" , second "test2". , field test 1 "id","survey_no","lastname" , field of test have "id","survey_no","address" id test1 , test2 primary key , set auto-increment..what want here ever insert in "survey_no" in test1 should insert inserted in "survey_no in test2"..can please me it..please.. i have here code insertion called sample.php <!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>untitled document</title> </head> <body> <form method="post" class="signin" action="" name="add" id="form1"> <fiel...

json - Unable to add Icons to the first 3 list item in android ListView? -

recently, i've build app can retrieve results web via json. displays simple informations. thought myself, custom listview looked simple texts, want add icons left side of listitem first 3 list items only, things turn complicated,since i've got json data web. i'm finding difficult implement logic current code. afterall, want add icons first 3 itemlist. i've set sample code below (sorry untidy code!). is possible set logic within current code ? or should start on again ? there solution ? protected void onpostexecute(jsonobject jsonobject) { try { // locate array name in json jsonarray = jsonobject.getjsonarray("infolist"); world = new arraylist<infolistdata>(); // create array populate spinner worldlist = new arraylist<string>(); (int = 0; < jsonarray.length(); i++) { hashmap<string, string> map = new hashmap<string, string>(); ...

timer - Arduino: how to create an ALARM CLOCK with an arduino -

arduino virgin here gentle. im trying create alarm clock system using arduino @ push of button, sounds alarm , when 'alarm clock' lifted disconnects alarm clock , starts timer sounds alarm after 3minutes... what kind of hardware should looking @ buying make dreams come true? cheers. the easiest , cheapest way use button , piezo buzzer , , 2 resistors . build this circuit . button connected digitalinput, piezo buzzer connected pwm pin analogoutput.

javascript - Having the first child open in accordion -

i have code: <div class="accordionbutton"> <span>accordion button</span><span class="plusminus">+</span> </div> <div class="accordioncontent"> <p>stuff in accordion</p> </div> <div class="accordionbutton"> <span>accordion button</span><span class="plusminus">+</span> </div> <div class="accordioncontent"> <p>stuff in accordion</p> </div> and want first tab accordioncontent box open when page visited. when clicking others, it'll slide , open other content. how can modify code first accorioncontent box open? javascript: $(document).ready(function() { $('.accordionbutton').click(function() { $('.accordionbutton').removeclass('on'); $('.accordioncontent').slideup('normal'); $('.plusminus...

python - Loop for each item in a list -

i have dictionary: mydict = {'item1':[1,2,3],'item2':[10,20,30]} i want create cartesian product of 2 tuple of each possible pair. output: [(1,10),(1,20),(1,30), (2,10),(2,20),(2,30), (3,10),(3,20),(3,30)] it seems there simple way extends if have 3 items. kind of dynamic number of loops. feels missing obvious way this... the itertools.product() function this: >>> import itertools >>> mydict = {'item1':[1,2,3],'item2':[10,20,30]} >>> list(itertools.product(*mydict.values())) [(10, 1), (10, 2), (10, 3), (20, 1), (20, 2), (20, 3), (30, 1), (30, 2), (30, 3)] if need control order of resulting tuples, can do itertools.product(mydict['item1'], mydict['item2'])

Excel Delete data not in range -

i have range of data on many cells. 1,2,3,4,5,6,7,8,9 and want reuslt use args, (range, 3,7) data changes range. 3,4,5,6,7 like formula, except actual data gets deleted. public function makealist(rng range, u long, l long) string dim r range, s string each r in rng if r.value < l or r.value > u s = s & "," & r.value end if next r makealist = mid(s, 2) end function let cell a1 contain 1,2,3,4,5,6,7,8,9 . then in a2 use =mid(a1,3,7) , take 3rd 7th elements inside a1 .

dynamics crm - In CRM 2011 SQL Timeout/Locking issue when processing AssociateRequest -

i have plugin want run synchronously post process because if of requests makes fail i'd roll in 1 transaction. i've encountered issue if try run associaterequest associate record record triggered plugin returns sql timeout. know code correct because i'm using same code associate other records (that aren't firing plugin) , execute fine. var referencedentityrelationship = new relationship(referencedentityrelationshipname); var referencedentityentities = new entityreferencecollection(new entityreference[] { new entityreference(referencedentitylogicalname, new guid(receivedrequest.referencingentityid)) }); var rtn = new associaterequest() { relatedentities = referencedentityentities, relationship = referencedentityrelationship }; rtn.target = new entityreference() { id = responseid, logicalname = dataentitylogicalname }; i know can avoid lock running plugin asynchronously. if there failure reason i'm unable roll initial request...

javascript - Generate a masonry layout and then apply gravity to it -

here's weird 1 i've been wracking brain on. i want 2 things, in order: generate masonry-style layout list of divs, imgs, or whatever. these utilize images can background images, within divs, or other method works. can pure css or jquery plugin. once grid has been generated, apply physics based plugin '.throwable' individual divs/objects. objects fall on each other, overall retain structure, you'd see in angry birds or something. the goal here paste in list of divs, let jquery plugin or pure css automatically figure out how align them, , apply gravity masonry grid. the problem i've run on , on masonry grid generated... when apply physics system it, individual objects snap different position. think masonry wants them "relative" while physics system wants them in "absolute"? not sure... i have rough version of latest attempt here if wants idea of i'm attempting: http://cssdeck.com/labs/full/f5dm0zv8 jasper'...

java- how can I read a text file containing multiple lines of integers and double values and then store into an array? -

for example, have text file contains following format acountnumber accountbalance accountnumber integer , accountbalance double. in file, have following format item price item string , price double. so how can read these types of lines , store values array? while there lines read read line split line first part second part end while or if want manipulate line whole can while there lines read read line convert line pair pair end while

java - eclemma 1 of 2 branch not covered in Junit -

junit file public class someclasstest { ... @test public void testsomecontextfailure() throws exception { someclass sc = new someclass(); try { sc.somecontext(null,null); fail("illegalarg expected"); } catch (illegalargumentexception e) {} } @test public void testsomecontextsuccess() throws exception { someclass sc = new someclass(); somecontext in = new somecontext(); in.setname("something"); in.setid("5"); in.setpoints(somepoint.x); try { assertnotnull(sc.somecontext(in,null)); } catch (exception e) {} } } java file public class someclasstest { @autowired(required = true) private insureddao insureddao; @override public context somecontext(context c, unused u) throws exception { if(c == null) throw new illegalargumentexception(); insureddao.increasevalue(c);...

c# - WinRT how to not have page go up when virtual key board appears Windows Phone 8.1 -

i have autosuggestbox in xaml page windows phone 8.1 app , when click on autosuggestbox whole page goes up. know how disable feature? thanks edit: here code fix, thank peter torr - msft. windows.ui.viewmanagement.inputpane.getforcurrentview().showing += (s, args) => { args.ensuredfocusedelementinview = true; }; you need handle inputpane.showing event, , set ensuredfocusedelementinview property true . stop windows trying make item come view.

python - Sum rainfall over last 60 days in Pandas? -

i'm preprocessing weather data each row 1 day temp, wind, rainfall, etc. i'd compute total rainfall in past 60 days new column. it seems shift close: rainfall 60 days ago, 59 days ago, etc. possibly create 60 series objects , sum them way feels there's better way. if df pandas dataframe each row contains values temp, wind, rainfall, etc., can rolling 60 day total follows: pd.rolling_sum(df, 60)

bash - Waiting for input from script that is running remotely via ssh -

there script i'm running can not install on remote machine. clear && printf '\e[3j' read -p "please enter device: " pattern read -p "enter date: (yyyy-mm-dd): " date pfix=$(cat /dev/urandom | tr -dc 'a-za-z0-9' | fold -w 5 | head -n 1) mkdir /home/user/logcollectres/"${pfix}" ssh xxx.xxx.xxx.xxx 'bash -s' < /usr/local/bin/searchadvanced.sh ${pattern} ${date} ${pfix} in script, able use read. ls -g *"${pattern}"* read -p "select 1 of these? [y/n] " "found"; i've tried adding -n on read -t -t option on ssh. can see script presents information seen once script starts, can't use read on local machine. edit: lets server b stores syslogs 5k computers. file names given using internal ip of device , date @ end. /var/log/remotes/192.168.1.500201505050736.gz /var/log/remotes/192.168.1.500201505050936.gz /var/log/remotes/192.168.1.50...

git - Why is Ubuntu machine not being able to access Github? -

i can curl , wget google.com , other sites using https (not of them though). github 1 of them. following commands don't work on ubuntu 14.04 machine: this hangs indefinitely /usr/local/bin/git ls-remote git://github.com/sstephenson/rbenv.git -h refs/heads/v0.4.0 this results in: curl: (35) unknown ssl protocol error in connection github.com:443 curl https://github.com this results in: resolving github.com (github.com)... 192.30.252.130 connecting github.com (github.com)|192.30.252.130|:443... connected. unable establish ssl connection. wget https://github.com openssl shows no certificate (is best hint?) openssl s_client -connect github.com:443 connected(00000003) write:errno=104 --- no peer certificate available --- no client certificate ca names sent --- ssl handshake has read 0 bytes , written 305 bytes --- new, (none), cipher (none) secure renegotiation not supported compression: none expansion: none --- why github problem here? system blocking ssl tra...

Magento. Can't login Admin, after domain move -

just had magento moved 1 domain another, can't log in admin, though earlier in day. i have full access db via phpmyadmin. fixed. changed password md5 within database , seems let me in.

java - Closing BufferedWriter/Reader affects other instances bound to the same socket? -

i have 'n' server threads, , each 1 listen 1 client. when server thread receives message client, needs notify other 'n-1' clients, , that's reason why keep shared object (containing array of 'n' sockets, 1 each client) between server threads. moreover, in main server thread holds serversocket , every time accept new connection client open bufferedwriter/reader give first answer him using new socket returned serversocket.accept() . in case of "ok" answer open new thread passing new socket it, in order listen new client's following requests. the problem cannot close bufferedreader , bufferedwriter in main server thread, because close underlying stream, causing problems server thread listening socket/stream. and question: if open bufferedreader (bound same socket) in new thread, , close it, other bufferedreaders(writers) ( ones opened in main server thread, couldn't close before ) opened on same socket closed? exception thro...

Android TalkBack and fragment stack -

for application work on, need implement accessibility. works fine except 1 screen have fragments added activity. basically, fragment above dial keyboard enter passcode. fragment added fragmenttransaction. the thing talkback focus set on elements of underneath fragment. do know if there way set talkback focus on dial fragment ? want "disable" fragment underneath focus thanks, update i figured out solution. can disable accessibility of first fragment before fragment transaction. rootview = inflater.inflate(r.layout.first_fragment, null, false); rootview.setimportantforaccessibility(view.important_for_accessibility_no_hide_descendants); and commit fragment transaction. second fragment won't leak focus first fragment. don't forget enable accessibility of first fragment in case you're coming first fragment. if(rootview != null) { rootview.setimportantforaccessibility(view.important_for_accessibility_yes); }

aop - Spring Integration: CGLIB error during deployment -

i trying implement simple integration flow, can't figure out why error during deployment. appreciated. xml config: <gateway id="eventgateway" service-interface="com.acme.eventgateway"/> <publish-subscribe-channel id="eventchannel"/> <service-activator input-channel="eventchannel" ref="eventservice" method="saveevent"/> interface: public interface eventgateway { @gateway(requestchannel = "eventchannel") public void saveevent(event event); } exception: error creating bean name 'eventgateway': post-processing of factorybean's singleton object failed; nested exception org.springframework.aop.framework.aopconfigexception: not generate cglib subclass of class [class com.sun.proxy.$proxy130]: common causes of problem include using final class or non-visible class; nested exception java.lang.illegalargumentexception: cannot subclass fina...

php - apache location directive not matched due rewrite rules -

my main goal override php.ini setting through apache config 1 url. i using location directive so. there bunch of other rewrite rules change location index.php(which cannot change) e.g. following works <location "/"> ..some php settings... </location> but, following not work <location "/foo/bar"> ..some php settings... </location> because each time location rewrites "index.php" (through other configs) i want setting work http://www.myurl.com/foo/bar . can use match url & override php value ?

javascript - Java script game - adding more questions -

i trying make matching game in java script, match correct animal print animal. have 3 questions in game far , when try add more, game not show questions.. if in anyway great. here code.. <html> <head> <script> function randsort (a,b) {return math.random() - 0.5} var questions = [ {text: " animal this?", img: "animalprints/1.jpg", answers: ["cheetah", "tiger", "ladybird"], ans: "0"}, {text: " animal one?", img: "animalprints/2.jpg", answers: ["elephant", "giraffe", "snake"], ans: "1"}, {text: "what animal 1 please?", img: "animalprints/3.jpg", answers: ["bumblebee", "tiger", "lady bird"], ans: "2"} /////**part added**/// {text: "what animal 1 please?", img: "animalprints/4.jpg", answers: ["giraffe", ...

sql server - nhibernate complex query of sql with a group by ROLLUP() of permenant table union all derived query -

how convert following sql contains case count, group by, union nhibernate? complex sqql group rollup() of permanent table union derived query columns select case when grouping([business_unit]) = 1 'total' else [business_unit] end [business_unit] , sum(injuryillnessttlcount) injuryillnessttlcount ( select i.incident_id ,b.business_unit ,case when (i.injury_illness_type_id=4 ) 1 --'injury/illness (near miss high severity potential)' else 0 end injuryillnessttlcount tblincident join tblbusiness_unit b on i.bus_unit_id = b.bus_unit_id --where (convert(varchar(10),i.create_dt, 111) between '2015/01/12' , '2015/05/12') union select 0 incident_id ,b.business_unit ,0 injuryillnessttlcount tblbusiness_unit b ) abc group rollup(abc.business_unit) when comes complicated queries, conversion nhibernate either not possible or not...

objective c - Changing the image of a SKSprite to an SKShapeNode -

sprite kit, xcode. i need find way change sprites image within program itself. know how create jpg files , make them sprite image... but program, need draw circles/polygons (which may change inside program) using skshapenode, , transferring skspritenode's image. let's have declared: skspritenode *sprite; skshapenode *image; how these variables? thanks! edit: mean texture when image. if understand question correctly, can achieve you're after using texturefromnode method on skview . in skscene : -(void)didmovetoview:(skview *)view { skshapenode *shape = [skshapenode shapenodewithcircleofradius:100]; shape.fillcolor = [uicolor bluecolor]; shape.position = cgpointmake(self.size.width * 0.25, self.size.height * 0.5); [self addchild:shape]; sktexture *shapetexture = [view texturefromnode:shape]; skspritenode* sprite = [skspritenode spritenodewithtexture: shapetexture]; sprite.position = cgpointmake(self.size.width * 0....

spring boot - Gradle: Fail on adding systemProperty -

i'm trying add .dll file "java.library.path" system property via gradle on spring boot project. i'm using gradle 2.1 on sts. small piece of groove code within build.gradle: tasks.withtype(javacompile) { systemproperty "java.library.path", file("./src/main/resources/meta-inf/opencv-2.4.9/windows_bin/x64") } and i'm getting following error: could not find method systemproperty() arguments [java.library.path, d:\github\tfg_1\guiatv\src\main\resources\meta-inf\opencv-2.4.9\windows_bin\x64] on root project 'guiatv' that path exists, don't know problem is. any help? thank you! update 1: @amnon shochot try add native library (.dll) project. took idea sites (for example, http://zouxifeng.github.io/2014/07/17/add-system-property-to-spring-boot.html , https://github.com/cjstehno/coffeaelectronica/wiki/going-native-with-gradle ). the first 1 using suggested: tasks.withtype(javaexec) { systemproperty "jav...

objective c - Can someone help me convert this OBJ-C code to Swift? -

im trying add facebook audience network project tutorial in objective c , need in swift. made bridging header, need add code. can convert swift me? thank you! heres link if want take @ it: https://developers.facebook.com/docs/audience-network/ios/banner - (void)viewdidload { [super viewdidload]; fbadview *adview = [[fbadview alloc] initwithplacementid:placement_id adsize:kfbadsizeheight50banner rootviewcontroller:self]; [adview loadad]; [self.view addsubview:adview]; } this should work, let me know if trouble override func viewdidload() { super.viewdidload() let adview: fbadview = fbadview(placementid:placement_id, adsize:kfbadsizeheight50banner, rootviewcontroller:self); adview.loadad(); self.view.addsubview(adview); }

Wordpress hosted in a subdirectory (of a rails app) has the wp-admin url without the subdirectory -

the blog available @ http://www.example.com/blog . login url accessible @ http://www.example.com/blog/wp-login.php . once logged in, browser briefly shows http://www.example.com/blog/wp-admin/ in url field , redirects , shows dashboard @ url http://www.example.com/wp-admin/ . the problem now url in wordpress dashboard (eg: posts, pages, settings etc) of form http://www.example.com/wp-admin/xxx.php instead of desired http://www.example.com/blog/wp-admin/xxx.php . when click of these links, request goes rails app throws error doesn't know wp-admin path. i have set following in wordpress' wp-config.php file: define('wp_home','http://www.example.com/blog'); define('wp_siteurl','http://www.example.com/blog'); the apache conf file of rails app has reverse proxy setting: proxypass /blog http://www.example.com:8080 proxypassreverse /blog http://www.example.com:8080 (yes, wordpress made listen in port) this .htaccess file have in ...

java - Why am i getting an illegal character error on an sql query? -

the error states index of illegal character 6 6th character space after select static final string jdbc_driver = "com.mysql.jdbc.driver"; static final string db_url = "jdbc:mysql://sql3.freemysqlhosting.net:3306/"; static final string user = "****"; static final string pass = "****"; public jsonarray getlocation(arraylist postparameters) { connection conn = null; httpentity httpentity = null; try{ class.forname(jdbc_driver); system.out.println("connecting "); conn = drivermanager.getconnection(db_url, user, pass); system.out.println("connection successful."); string sql = "select * locations loctag '%"+postparameters+"%'"; defaulthttpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(sql); httppost.setentity(new urlencodedformentity(postparameters,"utf-8")); httpr...

c# - Large datasets with unknown total rows -

i have rather interesting problem solve, , not sure how approach best way. given such interface public interface idatacursor { bool eof(); bool next(); bool prev(); bool first(); bool last(); int getcolumncount(); object getvalue(int columnindex); // return value given column current cursor position } which points large data structure, , need display in grid. of virtual modes require total number of records known. doesn't work on case. can navigate back/forth. does know of kind of datasource implementation implement similar interface? none of existing free or commercial libraries offer such possibility, of them require total number of rows. i tried calculate number of visible records datagtidview somehow navigate through dataset , update content of underlying datasource, data won't display pretty reliable. looking advises, thank you. perform query select count(*) table_name my_where_cluase; , use same my_where_cluase while...

ios - iAd covers my UIButton Spritekit -

while running ios 8.3 , using spritekit, setting candisplayads property true in viewcontroller causes bottom of devices screen have adbannerview overlapping uibutton . when user touches screen first time adbannerview moves , uibutton no longer covered. has experienced before? there easy workarounds?

android - Control View size in AlertDialog -

Image
i want create alertdialog dialogfragment title, ok button, cancel button , expandablelistview . problem expandablelistview takes space likes , pushes buttons , title out of dialog. want title @ top, buttons @ bottom , expandablelistview take rest of space, fullscreen, dialogfragment not increase/decrease in size when expanding it, rather keep scrollable. here image describing situation, left 1 initialized dialogfragment , second after expanding 1 of sections of expandablelistview . nevermind ugliness. i achieve following: keep size of fragmentdialog fixed, preferably whole window ( fill_parent / match_parent ). keep buttons fixed @ bottom, title fixed @ top , expandablelistview fixed (but still scrollable) in center. i have tried lots of various things, here current take. the custom dialogfragment public class recipefilterdialogfragment extends dialogfragment { @override public dialog oncreatedialog(bundle savedinstancestate) { alertdialog....