Posts

Showing posts from February, 2013

How to populate php/html form with MySQL data -

i trying create program in user can update specific product. when user click on update button, form opens. want populate html form mysql data. have written following code giving me error message. sharing html part of code.i using form inside php echo. kindly check it. html: <label>product name:</label> </td> <td> <input type='text' name='product_name' value='<?php echo $fetch['product_id']; ?'/>*required </td> </tr> error message: parse error: syntax error, unexpected '' (t_encapsed_and_whitespace), expecting identifier (t_string) or variable (t_variable) or number (t_num_string) in f:\xampp\htdocs\cms\update_single_product.php complete code <!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-e...

regex - Oracle SQL regexp sum within repeating sequence grouped by -

first time here, hope can help what's oracle sql select stmt xml below stored in oracle clob field following returned (there many 96 intvcoll blocks per day). basically numeric values in intvcoll blocks between 2nd , 3rd commas need summed , grouped date before first comma , varchar after 3rd comma. i'm guessing regexp_substr / can't quite there. first record sum of 1st , 2nd intvcoll blocks second record sum of 3rd intvcoll block third record sum of 4th , 5th meterchannelid date sum quality count_of_records 6103044759-40011200-q1 14/03/2016 1,387 2 6103044759-40011200-q1 14/03/2016 694 s 1 6103044759-40011200-q1 15/03/2016 1,433 2 <uploadregdata> <intervaldatablock> <setdatetime>16/03/2016-19:30:01</setdatetime> <intervalminute>15</intervalminute> <meterchannelid>6103044759-40011200-q1</meterchannelid> ...

graphics - Erasing without re-drawing -

suppose have drawn large graph, in many edges intersect. apply graph algorithm removes edges. visualize algorithm erasing edges screen algorithm doing it. is there graphics technique allows erasing edge without re-drawing edges intersected edge (such re-drawing might slow down visualization lot if many edges intersected)?

image - how to convert polyline to bitmap in matlab -

i have polyline, given 2 vectors x, y, of coordinates, both vectors of same length, , x(i) corresponds y(i). i need easy way create boolean matrix, has 1 polyline passes, , 0 doesn't. is there nice way of doing this? i thought poly2mask, doc says closes polygon, not looking for thanks you can extend line left , right edge of graph. copy row numbers , change column first , last. add top-left , top-right corners coordinate array. use poly2mask draw huge polygon. remove except last line of polygon. trim left , right ends. you can use line draw lines.

android - XmlPullParser not reach end of document -

im working on simple android app, should fetch rss feeds, read , display information on screen. tried follow google example while implementing code (source: android developers ). my code looks that: public void fetchxml(string url, context context) { try { url urlobj = new url(url); this.parser = this.xmlpullparserfactory.newpullparser(); inputstream stream = getinputstream(urlobj); string string = this.extractstringfrominputstream(stream); this.parser.setinput(new stringreader(string)); int eventtype = parser.geteventtype(); while (eventtype != xmlpullparser.end_document) { log.i(tag, "value end_document: " + xmlpullparser.end_document + " - eventtype value: " + eventtype); if (parser.geteventtype() != xmlpullparser.start_tag) { continue; } string name = parser.getname(); if (name.equals("title")) { ...

c# - How to check for internet connection? -

i know can check network connectivity, can't seem find way check if there internet available, short of ping. know of few use cases user connected local wlan doesn't have access internet, , prefer avoid timeout on request. short of pinging, take rather long time complete depending on network connectivity, there way explicitly test internet? you can try .... var asd = networkinterface.getinternetinterface(); i hope might ...

javascript - Moving the order of screen items with a mouse click -

on screen have simple list of items: item 1 item 2 item 3 i have seen examples of user can click on item , change position in list mouse. mu question is, how done? javascript function of sorts? you can use jquery ui library accomplish easily. follow snippet #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; } #sortable li { background:#aeaeae; margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; } #sortable li span { position: absolute; margin-left: -1.3em; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script> $(function() { $( "#sortable" ).sortable(); $( "#sortable" ).disableselection(); }); </script> <ul id="sortable"> <li>item 1</li> ...

javascript - PARSE - Handling concurrent requests? -

i've created turn based drawing game using parse can potentially play anyone. 1 user @ time can play. there 3 turns. it's working fine within player's friend list -> either start new game, or receive notification continue one. i'm trying implement multiplayer mode -> have seperate list in database available public games. if game made public, create new object in list pointer game. every time user searches available game, queries list, if record found, delete public game object in particular list make unavailable other users, , game goes on.. i'm wondering following -> how parse handle concurrent requests? possible multiple users, searching @ same time, try delete same object (see code below)? i'm skipping random index in query avoid such behaviour seems trivial.. here sample of cloud code handling request: parse.cloud.define('findpublicgame', function(req, res) { var query = new parse.query("public"); query.count({...

Splitting Address in SQL Server -

i able split address in sql server . have sample address (10396 whispering pines dr frisco tx 75033-3807) the street name might have multiple names zip code @ end , state next , city, etc... i thinking start cutting off zip+4 , work backwards (get zip , remove it. state (always 2 digits) , remove , city. everything else street address. address have included above how stored in database. tried doing myself know there has better way! declare @streetaddress varchar(1500) declare @zip varchar(10) declare @state varchar(2) declare @city varchar(250) set @streetaddress = '10396 whispering pines dr frisco tx 75033-3807' set @streetaddress = left(@streetaddress,charindex('-',@streetaddress) - 1) set @zip = right(@streetaddress,5) set @streetaddress = rtrim(replace(@streetaddress,right(@streetaddress,5),'')) set @state = right(@streetaddress,2) set @streetaddress = rtrim(replace(@streetaddress,right(@streetaddress,2),'')) set @city = reverse(left...

ios - Not getting photos from Facebook -

i want fetch photos facebook account. unable fetch it. whenever request empty array. @ibaction func sharefacebook(sender: fbsdkloginbutton) { sender.readpermissions = ["public_profile", "email", "user_friends"] sender.delegate = self sender.loginbehavior = .native } //delegate method func loginbutton(loginbutton: fbsdkloginbutton!, didcompletewithresult result: fbsdkloginmanagerloginresult!, error: nserror!) { print(result.token) fbsdkgraphrequest.init(graphpath: "me/photos", parameters: ["fields":"age_range,name,first_name, last_name, picture.type(large)"], httpmethod: "get").startwithcompletionhandler { (con, res, err) in print(res) } } //output = <fbsdkaccesstoken: 0x12fea99a0> { data = ( ); } /me/photos requires permission user_photos . make sure authorize user permission: sender.readpermissions = ["public_...

java - Error trying to update cocos OpenSSL -

i received message openssl security. did following http://blog.cocos2d-x.org/2016/04/openssl-update/ , there error don't understand in project. 15:56:54 **** incremental build of configuration release project app **** python /applications/cocos2d-x-3.10/projects/app/proj.android_v2/build_native.py -b release android ndk: warning: app_platform android-19 larger android:minsdkversion 14 in ./androidmanifest.xml "mk start!!!!!!!!!" local_c_includes jni/../../classes cpp_files jni/../../classes/appdelegate.cpp jni/../../classes/baselayer.cpp jni/../../classes/character.cpp jni/../../classes/damageinfo.cpp jni/../../classes/dotchilayer.cpp jni/../../classes/dotchiscrollview.cpp jni/../../classes/dotchisprite.cpp jni/../../classes/dotchistatus.cpp jni/../../classes/facility.cpp jni/../../classes/facilitylayer.cpp jni/../../classes/gamelayer.cpp jni/../../classes/gamestatus.cpp jni/../../classes/howtolayer.cpp jni/../../classes/numbersprite.cpp jni/../../classes/openin...

javascript - AngularFire: $add sets fbUID and custom UID, why? -

before there questions, have function creates custom uid because don't "need" long firebase uid , wanted shorter more easy remember. anyway, in create-function i'm not sure i'm adding db correctly. here's snippet , below how looks in database. $scope.create = function(){ // generate shorter random uid (6 chars) replaces long regular firebase uid letters = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789'; uid_length = 6; generator = function(){ random = ''; for(var = 0; < uid_length; i++){ random += letters.charat(math.floor(math.random() * letters.length)); } return random; } generator(); var lists = new firebase('https://url.firebaseio.com/lists/' + random); firebaselists = $firebasearray(lists); //lists.child(random).set(random); firebaselists.$ad...

floating point - Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273? -

double r = 11.631; double theta = 21.4; in debugger, these shown 11.631000000000000 , 21.399999618530273 . how can avoid this? these accuracy problems due internal representation of floating point numbers , there's not can avoid it. by way, printing these values @ run-time still leads correct results, @ least using modern c++ compilers. operations, isn't of issue.

redirect - How to access a subfolder from a subdomain? -

i have subdomain named: www.childsite.com subfolder of www.mymainsite.com i have created subfolder called "dashboard" , put in domain folder, can access using www.mymainsite.com/dashboard without problems. what wanted put "dashboard" folder in subdomain (www.childsite.com) folder structure be: mymainsite.com - childsite.com -dashboard but when accessed wwww.childsite.com/dashboard gives me "page not found" error... in iis: create folder out site root directory, if possible. call childsite . in dns, have set cname record childsite.mainsite.com . on server, if running iis, create new site host name set childsite.mainsite.com. root directory new site should folder named childsite . if folder named childsite isn't located in root directory of mainsite.com users cannot access going mainsite.com/childsite/ put folder dashboard within childsite folder , should set 1 dns records take effect. (if you're not hosting d...

javascript - Using Babylon js to load and customise shoe part by part -

i'm planning use babylon engine develop 3d shoe customisation website. shoe customisable part part. like, changing shape of front curved pointed, changing heel shape , size, changing texture of each part etc., for right create model submeshes , interact change materials? is possible change sub mesh in runtime, curved pointed? or instead of sub mesh feasible load multiple separate meshes(inner sole, outer sole, heels etc., separate model meshes) , attach them? please guide me through right path. the best option want change mesh , material load separate meshes , attach them same parent (with mesh.parent = dummy dummy invisible box instance)

xml - namespace in xslt placed in root tag -

i have xslt in have defined function. transformer says function must have it's namespace, declared dummy namespace in head of xslt, namespace appears in root tag of output! can't guess how avoid this... example: input.xml <something> <mytag> test </mytag> </something> test.xsl <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:fn="http://function" version="2.0" > <xsl:output method="xml" indent="yes" /> <xsl:function name="fn:trim" > <xsl:param name="pstr"/> <xsl:value-of select="replace($pstr,'^\s*(.+?)\s*$', '$1')"/> </xsl:function> <xsl:template match="something"> <root><xsl:value-of select="fn:trim(mytag)" /></root> </xsl:template> </xsl:stylesheet> out.xml ...

iphone - nsfetchresultcontroller returns rows after delete -

i'm using parent/child context core data. objects added in background thread , context. works fine. objects deleted in background context , saved on child/parent. can see in core data debug objects deleted , commit successfully. after i'm telling nsfetchresultcontroller(setting nil , reinitializing , deleting cache) fetch objects. objects still there, eventhough objects deleted. coredata: sql: commit coredata: sql: begin exclusive coredata: sql: insert ztlog(z_pk, z_ent, z_opt, zfxy, zfxyz) values(?, ?, ?, ?, ?) coredata: sql: commit delete coredata: sql: begin exclusive coredata: sql: delete ztlog z_pk = ? , z_opt = ? coredata: sql: commit nsfetchresultcontroller coredata: annotation: fetch using nssqlitestatement <0x68a2760> on entity 'tlog' sql text 'select 0, t0.z_pk, t0.z_opt, t0.zxy, t0.zxyz t0.z_pk = ? ' returned 0 rows coredata: annotation: total fetch execution time: 0.0080s 0 rows. coredata: annotation: fault fulfilled database : 0...

python - How to sort a list of x-y coordinates -

i need sort list of [x,y] coordinates looks this: list = [[1,2],[0,2],[2,1],[1,1],[2,2],[2,0],[0,1],[1,0],[0,0]] the pattern i'm looking after sorting is: [x,y] coordinate shall sorted y first , x . new list should like: list = [[0,0],[1,0],[2,0],[0,1],[1,1],[2,1],[0,2],[1,2],[2,2]] i can't figure out how , appreciate help. use sorted key: >>> my_list = [[1,2],[0,2],[2,1],[1,1],[2,2],[2,0],[0,1],[1,0],[0,0]] >>> sorted(my_list , key=lambda k: [k[1], k[0]]) [[0, 0], [1, 0], [2, 0], [0, 1], [1, 1], [2, 1], [0, 2], [1, 2], [2, 2]] it first sort on y value , if that's equal sort on x value. i advise not use list variable because built-in data structure .

Embedded jwplayer into jQuery Dialog -

i need put jwplayer inside of dialog, , did how created other dialogs, failed error "typeerror: jwplayer(...).setup not function" here code follow: function popupvideoplaydialog(urltorenderedvideo, thumbnailurl, cvid) { // create dialog frame div dialog var dialogframe = document.createelement('div'); dialogframe.setattribute('id', 'videoplaydialog'); // load videos loadvideobyurlwithsize( "videoplaydialog", urltorenderedvideo, thumbnailurl, 640, 480); $dialog = $(dialogframe).dialog({ width : 640, height : 480, modal : true, show : { effect : 'clip', duration : 500 }, hide : { effect : 'clip', duration : 500 }, title : 'video play', buttons: [ {text: "cancel", click: function() {$(this).dialog("close")}} ] }); return false; } function loadvi...

.net - Is it possible to use ReSharper as a test runner ONLY? -

i don't resharper (let's not go that), it's test runner way better vs default test explorer. example, vs doesn't handle tests polymorphism (or @ all), while resharper does. possible install , configure resharper in way totally turned off except it's test runner? consider installing jetbrains dotcover https://www.jetbrains.com/dotcover . same test runner in resharper.

asp.net - Can web app and database be hosted on different servers (remote and local)? -

Image
i apologize right away if misuse right ask questions here. yet, being tyro in web development , asp.net beginner, need advice experts. i have developed asp.net webforms application deploy remote hosting server. application queries , updates database due purpose of being document registration system. sold different institutions i've imagined following scenario: host app on same server institutions , have databases on different server or on multiple different servers. have considered option because data amount expands storage provided hosting companies may insufficient. my question is: possible accomplish scenario , if yes risks , how should it? thank much! yes, normal way it. however, need fast network connection between web server , database server. need consider service level (ie percentage up-time) , how redundancy needed achieve that. there's easy way , harder way achieve this. the easy way host application in microsoft azure. fast implement , flexibl...

javascript - Call function after highchart is loaded Ember.js -

i need set boxes on same height. i've done have problem highcharts. it's loading after function , when it`s loaded in boxes have half chart. how can call function after highcharts loaded? import ember 'ember'; export default ember.component.extend({ /** * equal heights of each box wrapper */ sameheight: ember.run.schedule('afterrender', function () { let boxes = document.getelementsbyclassname("box"); var tallest = 0; // loop on matching , finding tallest (let = 0; < boxes.length; i++) { let elementheight = boxes[i].offsetheight; //get height , width of element, including padding , border if (elementheight > tallest) { tallest = elementheight; } } //add same height var findclass = document.getelementsbyclassname('box'); (let = 0; < findclass.length; i++) { findclass[i].style.height...

java - Autowiring a generic component in a generic superclass -

i have following situation in spring 4.0 (using spring boot) environment: mapping interface : public interface entitymodelmapper<entity extends abstractentity, model extends abstractmodel>{ } mapping implementation : @component public class productentitymodelmapper implements entitymodelmapper<product, productmodel>{ } service : public interface crudservice<model extends abstractmodel>{ } and want abstract superclass service this : public abstract abstractcrudservice<entity extends abstractentity, model extends abstractmodel> implements crudservice<model>{ @autowired private entitymodelmapper<entity, model> mapper; public entitymodelmapper<entity, model> getmapper(){ return mapper; } } so can have implementations likes this : @service public productcrudservice extends abstractcrudservice<product, productmodel>{ public void somemethod(product product){ productmodel model = getmapper().map(produc...

javascript - react - Have an element return two adjacent <tr> tags -

i building table each row followed "expander" row. default these rows hidden. clicking on row should toggle visibility of next row. the design makes sense me think of these pairs of rows single "cell", , encapsulate toggling logic in cell element: class cell extends react.component { # logic here render() { return <tr><td>visibile</td></tr> <tr><td>invisibile</td></tr> } } this not allowed , causes react complain. can around putting 2 tr nodes in div . not ugly, makes react complain more , remove them: danger.js:107 danger: discarding unexpected node: <div > eventually, mess, event handlers don't work error: invariant.js:39 uncaught error: invariant violation: findcomponentroot(..., .0.1.$0.0.0.$/=11.0.0.1.$0): unable find element. means dom unexpectedly mutated (e.g., browser), due forgetting <tbody> when using tables, nesting tags <form>, <p>, or...

xml - How to implement XQL Join using JAVA? -

i quite new xql , studied xql joins (join on xml documents) here :- http://www.ibiblio.org/xql/xql-proposal.html#joins . wondering if want implement xql join in java, how can using java ? join new feature of xql. tried searching xql join examples in xquery , xpath apis in java haven't found (as of now) supoort xql join. an example of xql join follows :- suppose have source of books , source of reviews:- <book> <isbn> 84-7169-020-9 </isbn> <title> tales of alhambra </title> <author> washington irving </author> </book> <review> <isbn> 84-7169-020-9 </isbn> <title> tales of alhambra </title> <reviewer> ricardo sanchez </reviewer> <comments> romantic , humorous account of time author of "the legend of sleepy hollow" lived in arabian palace in spain. </comments> </review> we may want combine these create view of book includes c...

javascript - How do I stop a modal instance from being called when a different controller loads with UI-bootstrap in Angular? -

i have implemented way controller open ui-bootstrap modal after specific time. if navigate away page still open. idea modal open after few minutes on specific view. how stop when different controller loads? in advance. please let me know if other code required. here code open modal: $interval(function () { var modalinstance = $uibmodal.open({ animation: $scope.animationsenabled, templateurl: 'modal.html', controller: 'modalinstancectrl', size: 'lg', }); }, 120000, [1]); you might need stop interval using $interval.cancel(your_interval) on route or state change please see answer "how track route or state change?" , go through $interval documentation $interval.cancel(). hope solve problem.

android - java.lang.ArithmeticException: divide by zero in clearing table -

i trying clear table following code : int count = table_layout_acc_statement.getchildcount(); (int = 0; < count; i++) { view child = table_layout_acc_statement.getchildat(i); if (child instanceof tablerow) ((viewgroup) child).removeallviews(); but getting following exception : 05-09 15:53:07.526: e/androidruntime(14072): fatal exception: main 05-09 15:53:07.526: e/androidruntime(14072): process: com.era.customeragentapp, pid: 14072 05-09 15:53:07.526: e/androidruntime(14072): java.lang.arithmeticexception: divide 0 05-09 15:53:07.526: e/androidruntime(14072): @ android.widget.tablelayout.mutatecolumnswidth(tablelayout.java:587) 05-09 15:53:07.526: e/androidruntime(14072): @ android.widget.tablelayout.shrinkandstretchcolumns(tablelayout.java:576) 05-09 15:53:07.526: e/androidruntime(14072): @ android.widget.tablelayout.measurevertical(tablelayout.java:474) 05-09 15:53:07.526: e/androidruntime(14072): @ andr...

how to create .rSt files in django sphinx? -

.. documentation_hexnode documentation master file, created sphinx-quickstart on mon may 09 14:24:54 2016. can adapt file liking, should @ least contain root `toctree` directive. asked questions ================================================= contents: .. toctree:: :maxdepth: 2 license indices , tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` this index.rst file after creating file run make html make build.but index.html file not have subheading license , help.do need manually create license.rst , help.rst in source directory?does automatically generate while building? yes, need create both license.rst , help.rst . you can read more toctree in sphinx documentation :

highcharts - How to show alone points, with {marker: {enabled: false}}? -

in graphics have many points , set {marker: {enabled: false}} example plotoptions: { series: { marker: { enabled: false } } }, example but, if graph points has nulls, graph hidden. example how show alone points, {marker: {enabled: false}} ? in case when have null values, means "lines" between doesn't exist, , markers remain. when disable marks, series in not visible.

spawn function in erlang using function in another module -

i have been learning erlang past week , going through joe armstrong's pragmatic erlang book . writing code spawn processes , have come across situation have function in module myatom.erl looks start(anatom,fun) -> case whereis(anatom) of undefined -> pid = spawn(fun), try register(anatom,pid) of true -> true catch error:reason -> reason end; other -> {error,already_defined} end. there function in module named tloop.erl loop() -> receive { , no } -> ! { self(), no*4}; other -> void end. if use start() spawn loop in erlang shell , how can ? following error when do anatom:start(atomname,tloop:loop). thanks in advance ! anatom:start(myatom,fun tloop:loop). * 2: syntax error before: ') you mu...

java - Unable to add external libraries in my tomcat application -

i'm using tomcat7 , jre7 windows. i tried different application using different libraries , classnotfoundexception external libraries. put them web-inf/lib, tomcat should see them, doesn't. i don't know if important when try install tomcat following error: the system cannot find register key service 'tomcat7' some ideas?

linux - Sending a file continuously via netcat/socat -

i want send file 1 raspberry pi continuously (until powered off or something). sending data 1 pi ap, , forwarding data ap other pi. using current code send file once (successfully): receiver: socat tcp-listen:4242 /home/pi/desktop/smth sender: socat tcp:hostname:4242 /home/pi/desktop/zeromega.dat the file i'm sending (zeromega.dat) randomly generated file, since don't care data , need continuously send (loop) file of 1 mb 1 pi other. how this? know need create script run continuously, since need run on startup. appreciated. thanks. put inside infinite loop: while true; # whatever should repeated forever done

re-constructing an image using basic function in Matlab -

Image
i want re-construct 2d matrix (represented imagesc ) using basic function (polynominal or else) , coefficients. once know kind of basic function suitable particular problem, find coefficients in least-square fashion. the problem don't know how in 2d , type of basic function should try. did nicely in 1d using polynomial function treating 2d matrix 1d, column column. need think of 2d problem , have no idea how deal this. i've done searches , seen b-splines n dimensions ( http://uk.mathworks.com/matlabcentral/fileexchange/19632-n-dimensional-bsplines ) seems nice , similar problem still dont know how use or see connection. played package , see can re-construct image output coefficient. can't find can find matrix of basic function. please help? thank chappi suppose can import image in rgb format ( mxnx3 matrix img ; uintx ), have dimension vectors x , y ( mx1 , nx1 , respectively; double ) , colormap cmap , in columns [value,r,g,b] . using cmap trans...

oracle - I want to covert rows from one table to columns to another table using Procedures(Pl/sql) -

table a: col1 _______________________ jack 1200 20 peter 2000 10 robert 300 30 to table b : name sal deptno ----------------------- jack 1200 20 peter 2000 10 robert 300 30 here want using procedure parameter. can please tried giving errors. create procedure getdatafromtable_a(v_1 in varchar2) cursor rwdatacursor select raw_data table_a rowid<=3) t_record rwdatacursor%rowtype; begin open rwdatacursor; loop fetech rwdatacursor t_record; exit when rwdatacursor%notfund; insert temp_process; end loop close rwdatacursor; end; this codew have tried showing lot of errors one way is: procedure convert_tables cursor data_cursor select col1 table_a; row1 data_cursor%rowtype; row2 data_cursor%rowtype; row3 data_cursor%rowtype; begin open data_cursor; loop fetch data_cursor row1; exit when data_cursor%notfound; fetch data_cursor row2; exit when data_cursor%notfound; fetch data_cursor row3; exit when data_cursor%...

execute OBIEE wlst command by java -

i'm having prolem getting role java when using wlst. code following: import weblogic.management.scripting.wlst; import weblogic.management.scripting.utils.wlstinterpreter; public class javatestwlst { public javatestwlst() { } public static void main(string[] args) { try { wlst.ensureinterpreter(); wlstinterpreter interpreter = wlst.getwlstinterpreter(); interpreter.exec("connect('admin','admin','t3://server:7001')"); interpreter.exec("listapproles('obi')"); //or interpreter.exec("listapproles(appstripe='obi')"); //still eror nameerror: listapprole } catch(exception e){ system.out.println("exception_111:"+e.tostring()); } } } i've connected sussessfully having error. error: exception:traceba...

ios - Change Face Color From main color in xcode -

Image
i work on application in ios , need tool or code change face color of image . i face in uiimage. now how apply rgb color change uiimage of face? thanks in advance you can this, uiimageview *imageview = [[uiimageview alloc]initwithframe:cgrectmake(50, 50, 50, 50)]; imageview.image = [uiimage imagenamed:@"synch"]; // face image here imageview.image = [imageview.image imagewithrenderingmode:uiimagerenderingmodealwaystemplate]; // imageview.backgroundcolor = [uicolor yellowcolor]; imageview.tintcolor = [uicolor redcolor]; // set different tint color here , image color [self.view addsubview:imageview]; image should png file. synch image in png format in example. hope :)

mysql - SQL Group By with Sum for each date and using max date -

i've seen lot of similar questions nothing quite nails particular problem. i have table storing multiple positions each account. changes stored deltas. take example on day 1 following... ac_id | pos_id | asat | val 1 | 1 | 2016-01-01 | 100 1 | 2 | 2016-01-01 | 200 the total value ac_id 1 300 on 01/01/2016.the next day may update be... ac_id | pos_id | asat | val 1 | 1 | 2016-01-01 | 100 1 | 2 | 2016-01-01 | 200 1 | 2 | 2016-01-02 | 250 now total value ac_id 1 350. because new record pos_id 2 overrides previous, value pos_id 1 has not changed. in order remove pos_id 1 table change like... ac_id | pos_id | asat | val 1 | 1 | 2016-01-01 | 100 1 | 2 | 2016-01-01 | 200 1 | 2 | 2016-01-02 | 250 1 | 1 | 2016-01-03 | 0 now value changes 250 on day 3. i can calculate value @ given date subquery so select sum(val) position p1 p1.asat = (select max(p2.asat) position...

Unable to run docker or service docker -

i have installed docker toolbox here https://www.docker.com/products/docker-toolbox on computer(which has osx). if try running like: docker run -p 8888:8888 -it --rm b.gcr.io/tensorflow-udacity/assignments:0.5.0 i getting issue: docker: cannot connect docker daemon. docker daemon running on host?. see 'docker run --help'. after looking here https://github.com/docker/docker/issues/17645 tried using sudo service docker start however, getting message: sudo: service: command not found so how can run docker on computer? use new 'docker shell' got installed , stuff should automatically on path.

javascript - Hide user input in PhantomJS / CasperJS -

i have casperjs test suite in have fill login form user name , password. since don't want put password code did this: system.stdout.writeline("please enter password:"); var password = system.stdin.readline(); this.fill('form:first-of-type',{ 'username': user, 'password': password },true); this works, leaves password on console can read it. there way hide actual input view, or display ******** in place? or there perhaps approach problem have missed? edit: tried using execfile , doesn't when try run read , returns nothing ever happened. other external programs work fine. i found crude workaround: system.stdout.write("please enter password:"); var password = system.stdin.readline(); system.stdout.write("\033[1aplease enter password: \n"); will move cursor 1 line , print on password. problem remains, hides password after has been entered. if watching type, won't much. @ ...

wordpress - PHP return output based on zero, empty or value -

i have simple requirement proving difficult. i'm using wordpress store meta value 'session_capacity', can have following possible values 0 integer e.g. 99 nothing, left blank the problem when value stored zero, can't figure out setup use echo different statement based on whether it's 0 or empty. this desired output... if (zero) // elseif (integer e.g. 99) // elseif (blank) // something actual function... function get_session_capacity($post_id){ // total capacity of session $session_capacity = get_post_meta($post_id, 'session_capacity', true); // meta value stored string converting integer $session_capacity = intval($session_capacity); if($session_capacity === 0) return 'you cannot book session'; elseif(empty($session_capacity)) return default_session_capacity(); else return $session_capacity; } you can check if $session_capacity set or not, , set accordingly $...

ruby : when to use 'load' to load file instead of 'require' -

this question has answer here: when use `require`, `load` or `autoload` in ruby? 4 answers i know basic difference between load , require statement. load loads file multiple time if loaded , require loads file once. i want know when use load statement on require statement. if possible please explain small example. thanks, as know, load re-loads file, if loaded; whereas require loads file once. as such, should (for performance reasons) use require instead of load . using load can useful if file changes state - although rare thing happen. typically, load geared more implementing customized runners ruby code loading classes , modules in projects - example, it's used capistrano . or common use when developing/debugging project open console, can use: load 'filename_i_just_edited' refresh code state, rather re-starting console. ...

PHPExcel cell height only works on empty cell -

Image
i've read couple of examples on google cannot find issue. to set cell height use: $objphpexcel->getactivesheet()->getdefaultrowdimension()->setrowheight(-1); this set cell height "auto". guess text/data deside it's height?! i have tried several values like: 4, 10 etc.. strange cell without text change height. i'm thinking: text/font has margin-top value? cannot see type of height limit, should not prob. code //set font size $objphpexcel->getactivesheet()->getstyle("a1:i".$highestrow)->getfont()->setsize(4); //set row size $objphpexcel->getactivesheet()->getdefaultrowdimension()->setrowheight(6); example i'd cell height height text! the row height limit 409.50 (546 pixels), ms excel limit officeopenxml (xlsx)format. it's phpexcel doesn't enforce it. and if @ of examples (such 01simple.php ) you'll see height being set automatically rows 8 , 10. in case, looks though have ...

javascript - AngularJS Component wont allow Injection into Lifestyle Hook -

im using angular 1.5 , building application in component structure. unknown provider error when i'm attempting inject $canactivate hook (which shouldn't happen) heres code: angular.module("app") .component("index", { templateurl:"/modules/index-app.component.html", $canactivate:function($timeout) { <-- creates error return $timeout(function() { console.log('timeout fired') }, 2000); }, controller:function($timeout, $location, authcookie) { // set 'this' var model = }, controlleras:"model", }); im running angular 1.5.3 if makes difference? if don't inject hook runs fine. i'd love know people's thoughts :)

objective c - iOS XMPP PubSub not receiving events while publishing node to my subscribed users -

i using xmppclient ejjaberd chat application(like whatsapp). want implement xmpppubsub notify users when 1 of user changed his/her profile picture. my framework : https://github.com/robbiehanson/xmppframework here code initialize xmpppubsub xmppjid *servicejid =[xmppjid jidwithstring:[nsstring stringwithformat:@"pubsub.%@",[[sharedclass sharedinstance] hostname]]]; _xmpppubsub = [[xmpppubsub alloc]initwithservicejid:servicejid dispatchqueue:dispatch_get_main_queue()]; [_xmpppubsub adddelegate:self delegatequeue:dispatch_get_main_queue()]; [_xmpppubsub activate:xmppstream]; to create node : nsstring *nodename =[[nsuserdefaults standarduserdefaults] valueforkey:@"kmobileno"]; // logged in user or current user [[[xmppclient sharedinstance] xmpppubsub] createnode:nodename withoptions:@{@"pubsub#title":nodename,@"pubsub#deliver_notifications":@"1",@"pubsub#subscribe":@"1",@"pubsub#pre...