Posts

Showing posts from April, 2012

linux - permanently change directory python scripting/what environment do python scripts run in? -

i have small git_cloner script clones companies projects correctly. in scripts, use func hasn't given me problems yet: def call_sp( command, **arg_list): p = subprocess.popen(command, shell=true, **arg_list) p.communicate() at end of individual script, use: call_sp('cd {}'.format(branch_path)) this line not change terminal ran script in directory branch_path, in fact, worse, annoyingly asks me password! when removing cd yadayada line above, script no longer demands password before completing. wonder: how these python scripts running? since cd command had no permanent effect. assume script splits own private subprocess separate terminal doing, kills when script finishes? based on how #1 works, how force scripts change terminal directory permanently save me time, why merely running change directory ask me password? the full script below, thank you, cody #!/usr/bin/env python import subprocess import sys import time os.path import exp

python - Signal not connecting to a method -

i working sockets. when receive info server handle method listen in thread. want pop windows here, use signals. the problem signal not trigger function. here working example: class client(qtcore.qobject): signal = qtcore.pyqtsignal() def __init__(self): super(client, self).__init__() self.thread_wait_server = threading.thread(target=self.wait_server) self.thread_wait_server.daemon = true self.thread_wait_server.start() def wait_server(self): print('waiting') self.signal.emit() print("'signal emited") class main: def do(self): print("'do' starts") self.launch() time.sleep(2) print("'do' ends") def launch(self): print("'launch' starts") self.client = client() self.client.signal.connect(self.tester) print("'launch' ends") def tester(self):

wget fail to save audio files in a page -

i running wget, able save (css, html, images, relative path reference etc) webpage, except audio (alert.mp3, alert.ogg) is due limitation of wget when come getting audio format? <?php exec("wget --no-parent --timestamping --convert-links --page-requisites -erobots=off http://webpage/index.html"); ?> <html> <body> bla bla bla <audio autoplay="autoplay" preload=""><source src="alert.mp3" type="audio/mpeg"><source src="alert.ogg" type="audio/ogg"></audio> </body> </html>

javascript - jquery.min.js 'no such interface supported' -

so using multipush menu .... http://multi-level-push-menu.make.rs/ it works great browsers , versions except i.e9 ... dont know why f12 saying when click on menu button open sidebar throws error... script5007: unable value of property 'defaultview': object null or undefined jquery.min.js, line 3 character 18072 this code highlighted ... {return b.ownerdocument.defaultview.opener?b.ownerdocument.defaultview.getcomputedstyle(b,null):a.getcomputedstyle(b,null)} any ideas why i.e 9 doesn't bit of jquery code ? edit - bypassing , writing function accommodate 3 classes of been moved menu opens/closed... i know recognized i.e9 open , close true/false $('#menu').multilevelpushmenu({collapsed: true}); so need if stament contained within current i.e9 applicable code says if true move classes 330 left have far.... if ( ms_ie ) { $('#menu').multilevelpushmenu({collapsed: true}); $( ".navbtn, .submenu-ctn, .logo-title&quo

java - Updating MySQL database by a JFrame form while refreshing the J table on the JFrame form -

Image
i developed above form , update mysql database table 'employeeinfo'. form shows j table current data in database table 'employeeinfo'. i coded select j table row , in relevant text fields in form. but, i'm having trouble updating mysql database editing selected employees....**when edit text fields , hit update , database or jtable isn't updating ** database not updating , j table isn't refreshing..(may because of database table isn't updating) update button actionperformed; private void update_btnactionperformed(java.awt.event.actionevent evt) { try{ string val1 =txt_id.gettext(); string val2 =txt_name.gettext(); string val3 =txt_sname.gettext(); string val4 =((jtextfield)bday_chooser.getdateeditor().getuicomponent()).gettext(); string val5 =((jtextfield)wday_chooser.getdateeditor().getuicomponent()).gettext(); string sql = "update employ

wso2 - Will JSON based REST - ESB - REST communication build AXIS 2 XML MessageContext -

i have use-case end end json based rest services i.e. rest client -> esb -> rest service (all on jsons) planning handle using apis & payload factory transformations in scenario, wso2 esb convert json xml before invoking target rest service? if no #1, how prepare messagecontext object looks having xml constrcuts soapenvevelope, body etc.? update 1 : further clarify question, have updated sample api & custom mediator api/testrestapi.xml <api xmlns="http://ws.apache.org/ns/synapse" name="testrestapi" context="/testrest"> <resource methods="post get"> <insequence> <class name="com.example.wso2.esb.mediators.custom.mycustomermediator"/> <send> <endpoint> <address uri="http://jsonplaceholder.typicode.com/posts"/> </endpoint> </send> </insequence> &l

c++ - mingw g++ is unable to link with libraries -

i'm trying use x86_64-w64-mingw32-g++ (packaged in archlinux's mingw package) cross compile c++ code windows executable, i'm having trouble getting past issues. i'm calling x86_64-w64-mingw32-g++ -o build_win/asm build_win/asm.o build_win/asm_lib.o build_win/socket_boost.o -i../extra/etc -fopenmp -lrt -std=c++11 -g -lboost_system -lboost_serialization from makefile, thrown errors: /usr/lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lrt /usr/lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lboost_system /usr/lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lboost_serialization this works fine native g++, have change mingw compile? edit: have mingw-w64-boost package installed, includes boost libraries pre-compiled , ready linked. however, seems naming convention bit different, , -lboost_system example becomes -llibboost_system-mt (not sure -mt

ibm mobilefirst - mfp cli build: missing cordova on preview -

when building using cli, seems work ok, until @ console in preview, see there missing files. here's console output: android: synchronous xmlhttprequest on main thread deprecated because of detrimental effects end user's experience. more help, check http://xhr.spec.whatwg.org/. http://localhost:10080/myproject/apps/services/preview/myapp/android/1.0/default/cordova/cordovasim.js 404 (not found)_mbs_cordova_sim_load_js @ cordova.js:21(anonymous function) @ cordova.js:53 worklight.js:5138 uncaught exception: uncaught referenceerror: cordova not defined @ (compiled_code):16156wl.logger.__log @ worklight.js:5138wl.logger.$.each.public_api.(anonymous function) @ worklight.js:5520wl.logger.window.onerror @ worklight.js:5478 worklight.js:16156 uncaught referenceerror: cordova not defined(anonymous function) @ worklight.js:16156 worklight.js:5134 initialization option 'connectonstartup' deprecated. use wl.client.connect() connect ibm mobilefirst platform server. workligh

C# MouseKeyHook key suppression problems -

i've been using mousekeyhook nuget package project single key press needs monitored provide explicit functionality. prototype application have written, checks required key pressed , sets handled property true. key i'm testing launchapplication2, problem i'm having key press isn't surpressed, @ moment if microsoft word or excel in focus calculator launches! the code follows: /// <summary> /// interaction logic mainwindow.xaml /// </summary> public partial class mainwindow : window { private ikeyboardmouseevents keyboardhooklistener; private solidcolorbrush inactivebrush = new solidcolorbrush(colors.white); private solidcolorbrush activebrush = new solidcolorbrush(colors.lightgreen); private bool pressed = false; public mainwindow() { initializecomponent(); this.background = inactivebrush; this.keyboardhooklistener = hook.globalevents(); this.keyboardhooklistener.keydown += keyboardhooklis

Debugging transpiled javascript-- how does that work? -

there lots of ways transpile other variants (typescript, coffeescript, es6-->es5) 'common', es5 javascript. resulting script unreadable humans , impossible debug in browser as-is. my understanding source maps aid in process, i'm not sure how thing. @ high level, how work, debugging transpiled javascript in ie/firefox/chrome? follow similar convention or have own way(s) of handling mapping?

python - Django upload file : test request == POST or use decorator? -

i've read in django doc : note request.files contain data if request method post in example given : def upload_file(request): if request.method == 'post': i've read before can use decorator of django : @require_http_methods(["get", "post"]) def my_view(request): # can assume or post requests make far even 1 called @require_post() . it's question syntax , want know : if use decorator, stop function before execution if i'm not requesting post ? if 1) true, isn't decorators option 'python cool' ? thanks in advance. besta the decorators in django.views.decorators.http can used restrict access views based on request method. these decorators return django.http.httpresponsenotallowed if conditions not met. view decorators as 2, if request.method == 'post' fine , used in function based views.

osx - How to dynamically target the different FileMaker applications -

i'm writing system-wide service accept selected text , various searches in our internal filemaker database. i've written works fine on dev machine, filemaker exists "filemaker pro advanced". can't work on others machines non-developer version of filemaker ("filemaker pro") installed. the issue when script runs in 1 of client machines, "where foo " dialog (i'd say) because of "using terms" line, , don't want that. possible target filemaker can compile script , run on clients ? here's have : on run {input, parameters} set _target null try tell application "finder" name of application "filemaker pro advanced" set _target application "filemaker pro advanced" end try if _target null try tell application "finder" name of application "filemaker pro" set _target application "filemaker pro"

html - Floating a logo to left using only Css -

Image
i want have nav bar this but far i've done far, when try float logo left header background vanishes. confused why happening? *{margin: 0;padding: 0;} img, fieldset{border: 0; } img{vertical-align: middle} h1,h2,h3,h4,h5,h6{font-weight: normal;} .site-body, .site-header-outer, .site-header, .tag{ width: 58.7em; margin:auto; } *{margin: 0;padding: 0;} img, fieldset{border: 0; } img{vertical-align: middle;} h1,h2,h3,h4,h5,h6{font-weight: normal;} .site{ width: 58.7em; margin:auto; } /*header*/ .header{ background-color:#3088f0; } .logo{ background-color: #f07a30; float: left; color: #ffffff; } <!doctype html5> <html> <head> <title>the title</title> <link href="css/stylesheet.css" rel="stylesheet"> </head> <body> <div class="site"> <h1> <div class="header">

javascript - Intel XDK template app and iFrames not working -

i'm trying open iframes within different tabs of app. problem happening if place iframe in first tab(page of app), cannot access of tabs below it. if there text such <p>bla bla</p> works fine. if put iframe in last tab, of above work fine. i'm new html5 cross platform apps, , new intel xdk. in advance. code: <!doctype html> <html> <head> <title>grid view app template</title> <!-- template can used photo app grid view open detail view, applications photo app or instagram app. --> <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0;" /> <link rel="stylesheet" type="text/css" href="appframework/af.ui.css" /> <link rel="stylesheet" type="text/css" href="appframework/icons.css" /> <script type="text/javascript" charset="utf-8" src

Android Studio faces an issue on mac -

while using android studio on mac, came popup message. low disk space on android studio system directory partition. i can't figure out message talking about. please give me guidance , appreciated. java jdk , sdk related file may consume of disk space re-install android studio on larger partition , may solve problem. how install android studio : https://developer.android.com/sdk/installing/index.html also make sure save appdata\local\android\sdk on larger partition uninstall android studio : how uninstall android studio?

Bootstrap form inline -

how can align , space inline inputs forms in bootstrap <div class="form-group col-lg-12"> <div class="col-lg-6"> <input type="text" class= "form-control" value="first name"> </div> <div class="col-lg-6"> <input type="text" class= "form-control" value="last name"> </div> </div> use col-xs instead of col-lg see this try and keep input inside `<div class="form-group col-xs-12">`

nfc p2p - ID for NFC devices in NFC P2P communication -

i know whether nfc p2p requires mac address needs configured used identification while creating link layer connection or maybe @ transport layer connection. see details in specifications (iso/iec 18092) related ids being random values generated , maintained (per connection) link layer connections. i thankful if can please advice me on can find more details on same or provide light how nfc devices uniquely identified in p2p communications. nfc p2p not require mac address or comparable mechanism address communication partner on network. purely one-to-one network , communication partner uniquely given association. scenario communication possible selected peers not foreseen on link level, link intended work peer. device identifications must implemented in application protocols, when needed. unique identification of peer device on link level raise serious privacy concerns while there no technical need.

excel - Python xlsxwriter, add formatting to cell as I write them instead of bulk -

is possible apply formatting conditions write data worksheet instead of doing this: worksheet.conditional_format('b3:k12', {'type': 'duplicate', 'format': format}) so like: worksheet.write(cell, "yada yada yada", format=format) yes, think possible. you can start base format: base = { 'num_format':'#,##0', 'font_size':'12' } as write can use format.set_ methods change or add elements base format write data. i typically write in loop fashion , change formatting based on columns. example: body = workbook.add_format(base) body.set_num_format(some_format) # number example body.set_font_name(some_format) # font example sheet.write(cell, data, body)

HTML table to java object -

i need convert html table java object. cant find method implementing task. example of table below: <table id='table'> <tr> <th>name</th> <th>address</th> </tr> <tr> <td> <a href=''>name1</a> </td> <td> <a href=''>address</a> </td> </tr> </table> also expect map table next object: public class myclass { public string name; public string address; } i thankfull if task. i think in case want use jsoup , nice java library parsing web pages. once have parsed data want wepage using jsoup's selectors creating java object should non-trivial. here few helpful links: jsoup tutorial try jsoup file input = new file("table.html"); document doc = jsoup.parse(input, "utf-8", "http://somewebsite.com/"); elements row1name = doc.select("tr"); e

ios - Allign UIViews differnt when some UIViews are hidden? -

i have following view layouted autolayout. -------- + -------- the plus icon centered vertically on cell. should different when second icon appears can see on following image: -------- + x -------- i case both icons should alligined vertically centered space of 5 between them. i create constraints in code no interface builder or storyboard. how can achieve autolayout? it's quite simple, need code create outlet constraint, align '+' vertically change 'constant' property when 'x' appears on cell for example { if (cell.secondview.hidden == true) { // someconstraint - align constrain, can create throw ib cell.someconstraint.constant = 0; } else { // note 'minus' - move first view cell.someconstraint.constant = -cell.secondview.frame.height } }

AngularJS - Best way to repeat creating cols -

i want following result: <div class="row"> <div class="col-md-4> <input type="checkbox"> item 1 <input type="checkbox"> item 2 <input type="checkbox"> item 3 <input type="checkbox"> item 4 </div> <div class="col-md-4> <input type="checkbox"> item 5 <input type="checkbox"> item 6 <input type="checkbox"> item 7 <input type="checkbox"> item 8 </div> <div class="col-md-4> <input type="checkbox"> item 9 <input type="checkbox"> item 10 <input type="checkbox"> item 11 <input type="checkbox"> item 12 </div> </div> and have in controller variable: $scope.items = ["item 1", "item 2", &quo

PHP Socket timeout won't go below 0.5 seconds -

i'm trying scan ip range , info specific devices. problem is, although have so_rcvtimeo array('sec'=>0,'usec'=>1000) each request should timeout gets around 0.5 seconds . others on other hand take 0.005 seconds . can imagine if want scan big ip range i'm doomed. what doing wrong or how can improve ? below code foreach($iparray $ip){ $result = array(); $buf = ''; $from = ''; $sock = socket_create(af_inet, sock_dgram, sol_udp); socket_set_option($sock,sol_socket,so_rcvtimeo,$timeout); socket_set_option($sock, sol_socket, so_broadcast, 1); //socket_bind($sock, $from, 2048); socket_set_option($sock, sol_socket, so_broadcast, 0); socket_sendto($sock, $data1, strlen($data1), 0, $ip, 10001); $time = microtime(true); if(!socket_recvfrom($sock, $buf, 512000, 0, $from, $port)){ echo (microtime(true) - $time) . ' elapsed<br><br><br>'; continue; }

Android - How to do nothing when tap on notification app and the app is already opened -

i have notification in app , want when tap on notification: if app opened: nothing; if app closed: open app; current code: intent intent = new intent(); intent.setclass(mcontext, mainactivity.class); intent.addflags(intent.flag_activity_clear_task); pendingintent contentintent = pendingintent.getactivity(mcontext, 0, intent, pendingintent.flag_update_current); notificationcompat.builder mbuilder = new notificationcompat.builder(mcontext); mbuilder.setsmallicon(icon); mbuilder.setcontenttitle(string); mbuilder.setwhen(system.currenttimemillis()); mbuilder.setongoing(true); mbuilder.setcontentintent(contentintent); mbuilder.setvisibility(notificationcompat.visibility_public); mbuilder.setcolor(mcontext.getresources().getcolor(r.color.theme_color)); notification notification = mbuilder.build(); mnotificationmgr.notify(id, notification); activity manifest: <activity android:name=".mainactivity" android:configchanges="keyboardhidden|orientati

ios - Undefined symbols for architecture i386: "SpeechKitApplicationKey" -

i followed every step on adding speechkit framework app, cannot work. after building app, following error: undefined symbols architecture i386: "_speechkitapplicationkey", referenced from: l069 in speechkit(libspeechkit.a-i386-master.o) ld: symbol(s) not found architecture i386 clang: error: linker command failed exit code 1 (use -v see invocation) i added speechkit framework project-build phases-link binary libraries , have included necessary frameworks needed in order work: foundation system configuration audio toolbox cfnetwork avfoundation security valid architectures, in bbuild settings armv7m armv7s arc64 you need define key in sources const unsigned char[] speechkitapplicationkey = {0x12, 0x34, ..., 0x89}; you need key before using library. see documentation more details.

rendering table on screen using angularjs -

i trying print table using angularjs,since new unable find better way. getting data shown below $scope.tabledatas = [{"datamap": { "industrial":["1","12","34"], "axv":["0","18","12"], "com":["1","1","3"], "ind":["1","1","3"], "ixm":["1","1","3"], "adi":["1","1","3"] } }] ; i want print table inustrial,axv...is column , other data.please how can render using angularjs? check fiidle may it's looking for h

objective c - Passing Data between two UITableViews -

how can pass datas between 2 uitableviews? 1 tableview should have multiple defined rows check marks (like setup panel). checked rows in tableview 1 should visible in second tableview. idea or code example this? thanks. you need provide common model data (typically array) , have both tableview datasources use common model data. how each datasource presents data them, , influence how each table presents data. if 1 tableview "edits" model data, other tableview can told redraw item in data array. works both ways. this classic mvc (m = data, v = tableview, c = tableview.datasource).

javascript - Handlebars each from a custom start point -

say have object, { "empid": "1002729041", "empname": "abhijit audhya" }, { "empid": "1004563331", "empname": "abdul mulla" }, { "empid": "1004703190", "empname": "abdul razic" }, { "empid": "1004912437", "empname": "abdul hafeez" } i can use handlebars loop through entire object using, {{#each myobj}} <li>{{empname}}</li> {{/each}} say, want start 3rd object, ignoring 1st , 2nd. there simple way achieve this? no, need helper that: logical operator in handlebars.js {{#if}} conditional so if index > 2 show content . if may ask: why not drop first 2 (or matter: unneeded elements) in actual javascript before calling template? edit: here are... handlebars.registerhelper

oracle - SQL How do I extract time from a date to HH:MI:SS PM/AM? -

i want change format of dates format hh:mi:ss pm/am in sql oracle. i want use in case when this: case when to_char(a.dtime,'hh:mi:ss') >= 12:00:00 to_char(a.dtime,'hh:mi:ss pm') else null end date but sql not want show me to_char times > 12:00 shows there 12:%%:%%. and not work to_date. suggestions? lot in advance. you can use to_char( datetime, format ) format date column. format options given here . this give time part of date value (12-hour clock plus am/pm): select to_char( column_name,'hh:mi:ss am') your_table edit - addressing update you can do: select case when to_number( to_char( a.dtime_appl_creation, 'hh24' ) ) >= 12 to_char( a.dtime, 'hh:mi:ss pm' ) end "date" table_name

c - Float not being converted correctly -

i working on program convert dollars cents. take in user input float using predefined function try multiply float 100 gives me incorrect value. heres code: printf("change in dollars: "); change= getfloat(); cents= round(change*100); printf("cents %f",cents); this logical error because program runs fine there wrong mathematics example if enter 1.50 when prompted, return 1004 wrong. want happen 150 outputted. this because have locale decimal separator , instead of . , , since not checking return value of scanf() " which books , every tutorial ", variable not being initialized , printing consequence of layout of program instead of value inputed user. to verify say, suggest compiling same program without modification different compilation flags. what must ensure input correct, try this float getfloat(int *ok) { float value = 0; if (scanf("%f", &value) != 1) *ok = 0; else *ok = 1; return va

How to use case statement with select and group by -

select company, case when ((select count( ) ftmuser active='0' group company)>5) (select count( ) ftmuser active='0' group company) else '0' end ftmuser i want display records having count > 5 above query fails , says error: more 1 row returned subquery used expression sql state: 21000 please guide me on this. thanks. try this: select company, case when ((select count(*) ftmuser active='0' group company company=ft.company)>5) (select count() ftmuser <br>where active='0' group company company=ft.company ) else '0' end ftmuser ft

php - Differences between filter_var and filter_input -

why doesn't work: if(!($data['email'] = filter_var(input_post,'email',filter_sanitize_email))) { $errors['email'] = 'invalid email.'; } and working: if(!($data['email'] = filter_input(input_post,'email',filter_sanitize_email))) { $errors['email'] = 'invalid email.'; } difference here filter_var , filter_input , when hit submit whit filter_var doesn't submitting form filter_input submitted. here filter_input(input_post,'email',filter_sanitize_email)) if wrote example some'@email.com why doesn't remove ' . working function? i'm bit confused. if @ arguments filter_var , filter_input functions take, see why: filter_var ($value_to_be_filtered, filter_type, $options) vs filter_input($input_type , $variable_from_input, filter_type, $options) where $input_type 1 of input_get , input_post , input_cookie , input_server , or input_env .

Error in Implementing primefaces extentions -

i new primefaces , trying implement primefaces extensions. per guide have added following jars buildpath: 1) commons-lang3-3.1.jar 2) gson-2.3.1.jar 3) primefaces-5.0.jar 4) primefaces-5.0-sources.jar 5) primefaces-extensions-3.2.0.jar and have created xhtml , managed bean suggested here: http://www.primefaces.org/showcase-ext/sections/timeline/basic.jsf following error log same: jun 25, 2015 4:07:05 pm com.sun.faces.context.exceptionhandlerimpl log 1100: org.primefaces.util.componentutils.resolvewidgetvar(ljavax/faces/context/facescontext;lorg/primefaces/component/api/widget;)ljava/lang/string; java.lang.nosuchmethoderror: org.primefaces.util.componentutils.resolvewidgetvar(ljavax/faces/context/facescontext;lorg/primefaces/component/api/widget;)ljava/lang/string; @ org.primefaces.extensions.component.timeline.timeline.resolvewidgetvar(timeline.java:713) @ org.primefaces.extensions.component.timeline.timelinetaghandler.oncomponentpopulated(timelinetaghandler.java:58)

php - Can you use RBAC to set individual permissions for each group? -

i have been investigating best method create complex permission based system , using yii2 framework , noticed includes rbac support, not sure if right situation. what looking guess similar forum system use can make groups , can select permissions each of groups allowed do. i have noticed rbac add roles , if add , admin , author example can add author child of admin , admin can authors can + whatever other permissions give them. do have or can permissions separately? adding author child of admin quicker/cleaner way give admin same permissions lower level group has , can add permissions on top? i worry doing way though because if remove permission author , of sudden admin lose permission unless gain child or given separately. can still utilise rbac needs or should @ doing custom? the rbac system of yii2 powerful, can effectly add yor group pemission parent , later if need revoke single permission the child group can add need when , how need.

Spring MVC: how secure access to static content with authorization check -

i'm working on spring-mvc web application in users can upload files server. files saved in server-side file system , served static content: application deployed on tomcat instance , i've added context in server.xml file make them accessible. now, want secure access files. basically, user should allowed access files he/she uploaded. what best way implement authorization check?

javascript - Instafeed.js - Sortby most-liked when 60+ images -

i using instafeed.js display instagram images on homepage. i got 1000+ images sortby most-liked , load 60 @ time. when use "sortby: most-liked" looks instafeed.js loads 60 recent images , sort these 60 most-liked. when load next 60 images next 60 recent images , these sorted liked. it looks not posible sort 1000+ images most-liked. , load 60 @ time? is how instafeed.js works? or bug? <script type="text/javascript"> var feed = new instafeed({ sortby: 'most-liked', get: 'tagged', tagname: 'awesome', clientid: 'your_client_id' }); feed.run(); </script> kind regards as know, instafeed supports load max of 60 images. there way load more images , display them requested , need little bit of code work. for first need follow following steps; call feed.next() store data until reach 1000 images. - call "after" callback of instafeed. sort images using counts - need have our o

ibm mobilefirst - Worklight adapters deployment failure -

i new worklight when try deploy getting following error adapter deployment failed: no server host specified & no mbean found . make sure have address specified in eclipse > servers view > worklight development server (double-click it) > host name. attempt eclipse restart.

ruby - Create Generic Module in rails -

i'm newbie rails. have created reports module particular project. now, want make generic across project reports gem. question not how create & use gem. questions "how make generic reports lib". eg. have helper module in reports, module libquery module helper include queryconstants(which dynamic - based on project) #methods end end end my approach: each project include libquery::helper , include own constants file. module projectx module query module helper include libquery::helper #nothing - inherit helper methods in libquery end end end but i'm wondering if that's elegant way of doing things ? or better way it? first of all, modules must capitalized: module mymodulename second, use lib it's best include in autoload_paths (in application.rb file) this config.autoload_paths += %w(#{rails.root}/lib/my_shared_libs) this means rails load automatically, , you'll have available 'out of box'.

java - Does hibernate load two seprate copies of same instance if they are loaded twice from database? -

i know there many different question on regarding lazy load mine 1 bit different. lets have entity in have collection of entity b. similarly, in entity b, have collection of a. in both case, lazy="true" option used. entity a 's instace aa has --> set<b> ===(this set contains entity b's instance bb) entity b 's instace bb has --> set<a> ===(this set contains entity a's instance aa) now if load entity a's collection(which set<b> ).its initialized now, i.e. complete a's aa instance including collection. expect entity b's instance bb initialized no, not , lazy initialization exception when refer entity b's collection has entity a's instance aa. does hibernate load 2 seprate copies of same instance if loaded twice database? if so, there way synchronize changes in copies within session? hope clear enough , haven't messed things messy info:) the flow this: you load aa , ab . collections la

Instantiation of multi architecture vhdl enity in verilog testbench -

i have develop verilog tb design in vhdl. design has multiple entities each entity has multiple architectures. want develop verilog wrapper around each entity , use wrapper communicate test bench. entity has different architecture different testcase, approach each testcase has compile separately. there better way of doing ?? suggestions uvm implementation ? this simulator-specific. modelsim, example, verilog tb can instantiate entity, entity/architecture pair, or configuration (which want). i'd surprised if incisive can't - check manuals.

java - Iterate Array of JSON objects -

i using org.json.simple library construct jsonarray of jsonobject . structure looks like c= [ { "name":"test", "age":1 }, { "name":"test", "age":1 } ] to iterate array in java, tried for (int = 0; < c.size(); i++) { jsonobject obj = (jsonobject) c.get(i); system.out.println(obj.get("name")); } it printed null , when tried print obj.tostring , prints json string expected. i using org.json.simple jar, cannot use methods defined org.json.jsonarray or org.json.jsonobject . any ideas values object key? you can iterate on jsonarray elements using iterator , this: //arr jsonarray here iterator<object> iterator = arr.iterator(); while (iterator.hasnext()) { object obj = iterator.next(); if(obj instanceof jsonobject) { system.out.println(obj.get("name")); } } it uses org.json.simple.

ios - How do I remove the selection border on a table view cell? -

Image
as can see, there's border when selecting. want remove border. i've tried: func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = roomstableview.dequeuereusablecellwithidentifier("roomscell", forindexpath: indexpath) as! roomtableviewcell cell.room = rooms[indexpath.row] cell.layer.borderwidth = 0.0 cell.contentview.layer.borderwidth = 0.0 cell.layoutmargins = uiedgeinsetszero return cell } that doesn't work. self.roomstableview.separatorstyle = uitableviewcellseparatorstyle.none set. clarification: @ middle row. it's selected. see border above , below couple? that's want remove. i'm going assume want remove separator tableview. can with: tableview.seperatorstyle = uitableviewseparatorstyle.none

forms - Rails how to create recursive nested_form_for for child-parent relations -

model is class menuitem < activerecord::base belongs_to :menu_item has_many :menu_items accepts_nested_attributes_for :menu_items end how create form ability add dynamically children , children of children if needed (preferably nested_form_for). in other words form shall like: input child input child input (child of child) add/remove child (child of child of child) add/remove child (child) add/remove input clicking add/remove add/remove 1 more according child, how can achieve this? cocoon should able handle use case fine. need experimenting since deep nesting non trivial.

PowerShell - open a file, find a string in a line and replace a string in a previous line -

there sample data file session 1: {21ad8b68-2a42-459e-bd29-f082f47e71b2} started: 06-24-2015 11:00 nds tree: test_tree ad server: dc01.adatum.com o=branch/ou=branch_city1/cn=user1 user cn=user1,ou=branch_city1,ou=adatum,dc=adatum,dc=com user o=branch/ou=branch_city1/cn=everyone1 group cn=everyone1,ou=branch_city1,ou=adatum,dc=adatum,dc=com group o=branch/ou=branch_city2/cn=user2 user cn=user2,ou=branch_city2,ou=adatum,dc=adatum,dc=com user o=branch/ou=branch_city2/cn=everyone2 group cn=everyone2,ou=branch_city2,ou=adatum,dc=adatum,dc=com group i find line contains string "group" (case sensitive) or "user" (case sensitive). if there match, line before should changed this: if "user" change line before cn=<...>,ou=adatum,dc=adatum,dc=com if "group" change line before cn=<...>,ou=groups,ou=adatum,dc=adatum,dc=com of course, output data file contains changes. any idea? many in advanc

css - Change color of bullets in a list -

Image
is there modern css solution change color of bullets? it should work types of bullets. disc style decimal style etc. list looks this: <ul> <li>lorem ipsum dolor sit amet</li> <li>lorem ipsum dolor sit amet</li> </ul> i can't change markup. please don't give solutions this: <ul> <li><span>lorem ipsum dolor sit amet</span></li> <li><span>lorem ipsum dolor sit amet</span></li> </ul> li { color: red; /* bullet color */ } li span { color: black; /* text color */ } this requires markup change or li:before { content: "• "; color: red; } this works 1 list style type the css3 specs define ::marker pseudo-element want. but, of today, no browser supports option. firefox has similar element, of course browser-specific: li::-moz-list-bullet { color: red; } so practically: no, there no such sol

Webstorm JavaScript External Libraries vs Project Directories -

in iis , therefore vs, there virtual directories allow simplified, virtual, relative referencing in script tags. handy. in webstorm can same effect project directories , marking project root resource root. if this, coding assistance in text editor. webstorm has external libraries, point of these? when have link cdn in script tag , want coding assistance? if have project directories, point of external libraries? i've seen this answer , kind of different modes of referencing/inclusion, don't big picture. core reason external libraries vs project directories? is when have link cdn in script tag , want coding assistance? yes, common case - webstorm can't use online resources code assistance, needs have corresponding javascript files available locally. so, if don't pollute project folder these library files, can have them stored outside of project , set libraries. what core reason external libraries vs project directories? see above - ex