Posts

Showing posts from April, 2013

c++ - Segfault doesn't occur in debugger neither valgrind -

i'm trying debug c++ qt5 program i'm unable, of times crashes on quit (when launched shell). when it's launched valgrind or gdb/lldb doesn't crash. i tried generating coredump , loading results helpless, 1 frame in bt . the actual code hosted on github . valgrind output: $ valgrind --tool=memcheck ./build/qsubber ==27761== memcheck, memory error detector ==27761== copyright (c) 2002-2013, , gnu gpl'd, julian seward et al. ==27761== using valgrind-3.10.1 , libvex; rerun -h copyright info ==27761== command: ./build/qsubber ==27761== ==27761== conditional jump or move depends on uninitialised value(s) ==27761== @ 0x15d790fa: ??? (in /usr/lib/libgtk-x11-2.0.so.0.2400.28) ==27761== 0x9733523: ??? (in /usr/lib/libgobject-2.0.so.0.4400.1) ==27761== 0x974cf96: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.4400.1) ==27761== 0x974de39: g_signal_emit_by_name (in /usr/lib/libgobject-2.0.so.0.4400.1) ==27761== 0x973ac2a: g_object_set_valist ...

laravel - Can you create a new Model instance without saving it to the database -

i want create whole bunch of instances of model object in laravel, pick optimal instance , save database. know can create instance model::create([]) , saves database. if possible i'd create bunch of models, "create" 1 best. is possible? i using laravel 5.0 you create new model instantiating it: $model = new model; you can save database @ later stage: $model->save();

java - Why cant I input info after if statement? No errors show -

how can program ask input using scanner after if statement? import java.util.scanner; public class app1 { public static void main(string[] args) { scanner keyboard = new scanner(system.in); string gender; string fname; string lname; int age; string female = "f"; string male = "m"; string = ""; string gettingmarried = "y"; string notgettingmarried = "n"; system.out.println("what gender (m or f)"); gender = keyboard.nextline(); system.out.println("what first name?"); fname = keyboard.nextline(); system.out.println("what last name?"); lname = keyboard.nextline(); system.out.println("age:"); age = keyboard.nextint(); system.out.println(); if (gender.equals(female) && age >= 20) { system.out.println("a...

Django 1.8 admin navigation color -

using django 1.8 how change blue navigation bar on admin interface. don't want change else, change nav bar color. thanks well, have little bit of work. option 1 create admin folder in static folder in app. inside static folder, create css , img folders. in site-packages/contrib/admin/static/css folder, copy base.css file. can modify , attributes want in here. you need copy img files want modify site-packages/django/admin/static/img - see css snippet below line 498: .module h2, .module caption, .inline-group h2 { margin: 0; padding: 2px 5px 3px 5px; font-size: 11px; text-align: left; font-weight: bold; background: #7ca0c7 url(../img/default-bg.gif) top left repeat-x; color: #fff; } line 784: #header { width: 100%; background: #417690; color: #ffc; overflow: hidden; } seem hold values want modify. have copy entire file , change values want changed. file replace 1 have when run: ./manage.py collects...

.htaccess - robots.txt needs only certain files and folders and disallow everything -

i want robots.txt allow index.php , images folder , disallow other folders, possible? this code: user-agent: * allow: /index.php allow: /images disallow: / secondly, possible same job htaccess? first, aware "allow" option non-standard extension , not supported crawlers . see wiki page (in "nonstandard extensions" section) , robotstxt.org page . this bit awkward, there no "allow" field . easy way put files disallowed separate directory, "stuff", , leave 1 file in level above directory: some major crawlers do support it, frustratingly handle in different ways. example. google prioritises allow statements matching characters , path length, whereas bing prefers put allow statements first. example you've given above work in both cases, though. bear in mind crawlers not support ignore it, , therefore see "disallow" rule, stopping them indexing entire site! have decide if work moving files around (o...

javascript - Using nosql for a browser extension? -

i'd have backend chrome/firefox extension app makes queries local (preferably nosql) database. there way this? perhaps query language accessing chrome.storage? read html5 storage in particular indexeddb , web sql. possible ways query storage (ok html5 filesystem api way considered indexed using folders). all 3 work in chrome. make sure use them correct location (background script). havent tried other browsers, check html5 compatibility. even if use specific of chrome, both firefox , edge promissed supporting chrome extensions repackaging them store.

How to validate Google/Gmail OAuth2 token in Asp.net Web Api? -

in chrome extension have access token retrieved google's end point (using getauthtoken()). i'd pass token asp.net web api server in http headers. however, i'm not sure how validate token on server side? is, how make sure token belongs given user , not fake? do need pass token google's end point validate it? if yes, how do web api? thanks

google play - Create Android OAUTH client fails with: "An unexpected error occurred. Please try again later. (4800001)" -

so trying setup google play games services in google play developer console. this worked me yesterday. today however, when setting app, , trying link android app games services, error: an unexpected error occurred. please try again later. (4800001) i got in: google play developer console -> games services -> [game] -> linked apps -> step 2 authorize app. this happens regardless key try, release key, or debug key. i don't understand why happening, working yesterday, albeit app without real-time multi player. app trying setup needs real-time multiplayer, i'm not sure whether difference cause of it. maybe servers @ google down? i error each time try, regardless browser use, or os. tried on ubuntu firefox , osx safari. this temporary breakage in google play developer console. they fixed today, rolling changes console, see: https://github.com/playgameservices/android-basic-samples/issues/153#issuecomment-134749998

Angular 4.3 HttpClient Interceptor -

please advise why route redirection not working when response 401. console.log shows response object , status 401 router not redirecting user logout page. intercept(req: httprequest<any>, next: httphandler): observable<httpevent<any>> { this.onstart(); return next.handle(req).do((event: httpevent<any>) => (error: any) => { if (error instanceof httperrorresponse) { if (error.status == 0 || error.status == 401 || error.status == 404 || error.status == 500 || error.status == 503) { this.storageservice.writetostorage(constants.storage_key_error, error); console.log(error); this.router.navigatebyurl(constants.route_error_dynamic + error.status); } } else{ return observable.throw(error); ...

swift - Closure gets executed although its nil -

i have dynamic variable called "data" "data" variable nil. following closure gets executed anyways? var data = dynamic<[pfuser]?>(nil) if let data = data.value{ print("data value \(data.value)") return } is there solution problem? you want check what's in dynamic, not dynamic var itself. (i.e. you've made new dynamic contains nil, haven't assigned nil data) as is: data ← dynamic( nil ) you want data ← nil try code this: var data:dynamic<[pfuser]?>? = nil or this: var data = optional<dynamic<[pfuser]?>> = nil now data optional containing nil

c# - Sharepoint list Column with space in name not able to apply filter -

i trying achieve filtering option on sharepoint list retrieved data-table applying row-filter on same (using code snippet listed below). code snippet: dt.defaultview.rowfilter = string.format("[column name] = '{0}'",no.text); jview= dt.defaultview; gvviewjobs.datasource = jview; gvviewjobs.databind(); but when execute line on row filter getting exception thrown 'column name' not valid, tried option of using 'x0020' in column name, giving out error. tried below snippet of using filter option directly in datatable shown below, no luck. datatable filtering datarow[] results = dt.select("[column name] =' " + no.text + "'"); can advise me of using referring column name filtering tried square bracket ([]) option too. regards arvind use caml builder internal name of field. ensure using appropriate expression row filter. check dataview rowfilter syntax more details syntax.

excel - VBA code to overwrite cells through moving /shifting up a range of cells -

Image
hi there have data table, seen picture, changes time time. example if there new data coming march'15 have copy , overlap cells april'14 onwards march'14. thereafter fill in information march'15 on blank cell filled feb'15 information. wondering if there vba code move or shift range preferred row of cells has existing data ( more of code overlap/ overwrrite cells through moving/shifting up) . was thinking of activecell.offset not sure if can shift range of cells. in case, use simple loop copy values. last row (13) overwritten empty values of row 14. public sub moveup() dim sh worksheet dim x long, y long set sh = activesheet ' or specific sheet ' 12 months y = 2 13 ' 7 columns x = 1 7 sh.cells(y, x) = sh.cells(y + 1, x) next x next y sh.cells(13, 1) .select ' works if column contains dates (not strings) .value = dateadd("m", 1, sh.ce...

Why am I getting java.util.ConcurrentModificationException on Android Gridview? -

i have task load images website , load them gridview. when try update mangagridarrayadapter error: 08-24 21:03:03.433 22791-22791/com.solomobile.englishmanga w/system.err﹕ java.util.concurrentmodificationexception 08-24 21:03:03.433 22791-22791/com.solomobile.englishmanga w/system.err﹕ @ java.util.abstractlist$subabstractlist.size(abstractlist.java:360) 08-24 21:03:03.434 22791-22791/com.solomobile.englishmanga w/system.err﹕ @ java.util.abstractlist$subabstractlist.addall(abstractlist.java:280) 08-24 21:03:03.434 22791-22791/com.solomobile.englishmanga w/system.err﹕ @ android.widget.arrayadapter.addall(arrayadapter.java:195) 08-24 21:03:03.434 22791-22791/com.solomobile.englishmanga w/system.err﹕ @ com.solomobile.englishmanga.task.popularmangatask.onpostexecute(popularmangatask.java:128) 08-24 21:03:03.434 22791-22791/com.solomobile.englishmanga w/system.err﹕ @ com.solomobile.englishmanga.task.popularmangatask.onpostexecute(popularmangatask.java:19) following code task: ...

ios - Comparing Hours in Swift -

while querying data database receive hours process started , ended in 2 separate string fields example start = "1100" , end = "+0200" indicate it's hours of operation 11am-2am. proper way represent in swift can determine amount of time left current time end time of process. edit : found interesting way using date formatter if remove possible prefix of + , use below code seems work correctly; however, date not set work around? let dateformatter = nsdateformatter() dateformatter.dateformat = "hhmm" let date = dateformatter.datefromstring("1340") you can create nsdate components using nscalendar.currentcalendar().datewithera (there other similar functions, nscalendar details). need add logic determine if 2am today or tomorrow etc. then can compare 2 nsdate dates. determine time left end use nsdate method timeintervalsincedate . can use nsdatecomponentsformatter remaining time nicely formatted.

mysql - Implement Datatables TableTools to export whole data to excel including the filters -

i'm using php , jquery datatables tabletools server-side pagination. want implement tabletools export buttons export whole data including filters applied. when xls in tabletools enabled allows export data in current page only . there method fetch data in mysql , export xls csv? next problem: while exporting long numeric data, example 2081420150000001 data converted exponential format i.e. 2.0814e+15 when viewed in excel. code in tabletools required leave data such?

ios - My app is asking for permission to “Have offline access”, why? -

Image
my app asking permission “have offline access”, why? it's weirdest thing. i've done bit of searching , haven't found that's worked. i've tried using these scopes: https://www.googleapis.com/auth/plus.profile.emails.read https://www.googleapis.com/auth/plus.login and didn't seem help. below screenshot , of code see what's going on: some of code: #import "viewcontroller.h" nsstring *callbakc = @"http://localhost/"; nsstring *client_id = @“client id“; nsstring *scope = @"https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile+https://www.google.com/reader/api/0/subscription"; nsstring *secret = @“secret”; nsstring *visibleactions = @"http://schemas.google.com/addactivity"; @interface viewcontroller () { nsstring *authaccesstoken; uialertcontroller *alertcontroller; } @property (strong, nonatomic) nsmutabledata *receiveddata; @property (weak, nonatomic) ibout...

sql - Want to enable PARALLEL and NOLOGGING on Oracle Delete statement -

i have huge table more 3.5 billion records increases 500k each day, want delete records before year 2014. every delete command run, after few hours fall error state, looking @ doing job faster, last command run was: delete /*+ parallel (8) */ xyz year <= 2014; after 744 minutes ora-12801: error signaled in parallel query server i guess if run delete command both parallel , nologging, switch maybe this, don't know how run session in nologging state , @ same time enable parallel command, know can run delete /*+ nologging parallel (8) */ xyz year <= 2014; but find in somewhere, seems command parallel hint ignored. please advise on how run delete command both in parallel , nologging not logging delete operation won't much. there small amount of things redone delete operation. the problem here huge amount of undo(it contains every row deleted in order inserted in case of error/rollback). also, parallel speed things, don't change amount of ...

gps - Android - Cannot get location using Network Provider when using APN -

we have developed android application. 1 of main features of report user location server. location receiving function tries gps location few seconds , switches network provider (if available). the problem is, client devices use apn allows connection back-end server. location accessing algorithm gets stuck @ accessing location using network provider. only using gps or ignoring user location not option. i feeling has done service provider. asked me if have allow access particular domain/ip firewall. how network provider gets location? function require network calls particular server can inform them allow access it?

ruby - Function executed without being called -

i have function func , , executes automatically; have never called it. begin { print "start" } *data = gets; test = true in 0...data.length if i==0 print data[i] end if i==0 , !test print "test" else print "uu" end end end { print "end" } def func() print "test1" yield print "test2" end func { print "func block" } output of above code: startuserinput userinput uutest1func blocktest2end i don't want function executed when call it. can't use function parameters due automatic calling. func {} calling function func . why? {} accepting block. can think of blocks arguments. see how begin , end works. they got called parameters passed in (via blocks).

xml - prestashop webservices for image in json format -

when parse image data using prestashop webservices in xml format work fine when change output format json getting error. in xml format result is <?xml version="1.0" encoding="utf-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <image_types> <image_type id="7" name="category_default" xlink:href="http://abcd.com/api/image_types/7"/> <image_type id="3" name="medium_default" xlink:href="http://abcd.com/api/image_types/3"/> </image_types> <images> <image id="10" xlink:href="http://abcd.com/api/images/categories/10"/> <image id="11" xlink:href="http://abcd.com/api/images/categories/11"/> <image id="3" xlink:href="http://abcd.com/api/images/categories/3"/> <image id="4" xlink:href="http:...

Joomla external URL redirect on successful login -

im looking override default joomla login redirect , use external url on succesful login (which doesn't seem possible within default joomla setup). i found support doc: https://docs.joomla.org/how_do_you_redirect_users_after_a_successful_login%3f the code add follows.. correct? $redirecturl = urlencode(base64_encode("http://subdomain.mydomain.com")); $joomlaloginurl = 'index.php?option=com_users&view=login'; $finalurl = $joomlaloginurl . $redirecturl; but im not sure add code, in support doc says 'in administration end custom code'? any appreciated. the default login module of joomla loads menu item published in joomla. can create new menu item using type "system links -> external url" put external url in menu item. that menu item show in module administration. need select it. you modify php of module. module called mod_login in folder modules. might consider creating new module. download files, modifications,...

node.js - I'm trying to install npm package html2json but while installing getting error in windows -

i have updated npm , node both not working. have searched solution not getting solution. can me solve problem? tried mentioned below npm -v output: 3.10.10 node -v output: v6.11.3 npm config registry output: https://registry.npmjs.org/ npm cache clean while installing package i'm getting error: npm err! windows_nt 10.0.14393 npm err! argv "f:\\programfiles\\nodejs\\node.exe" "f:\\programfiles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "html2json" npm err! node v6.11.3 npm err! npm v3.10.10 npm err! code enoself npm err! refusing install html2json dependency of npm err! npm err! if need help, may report error at: npm err! <https://github.com/npm/npm/issues> npm err! please include following file support request: npm err! e:\html parsing using node\html2json\npm-debug.log help needed. thank you is name of npm project html2json ? that's problem encountered on this blog . seems confuse node wh...

Showing view from onPause of an android activity -

i need show 1 of view when onpause called android activity. practice do? there issues if show onpause? this view shown background when activity partially visible. basically not practice so. the activity still visible ( link ), user may not notice if change anything. also in onpause should fast. the documentation says: when activity b launched in front of activity a, callback invoked on a. b not created until a's onpause() returns, sure not lengthy here. so slow down start of next activity , activity animation might little laggy if updating ui in onpause() you may use onresume() show view.

PHP Websocket server - Handle more frames in socket_recv -

hope wasn't solved here before, trying answer! i have problem receiving frames via socket_recv in php server. problem appears when send more 1 messages client in 1 time (e.g. in cycle). stream length it's match frames count i'm not able unmask frames correctly , unmask function return first frame. i'm using part of php server found here , 1 message it's working properly, when receive more messages @ time, don't unmask all. i tryed add loop go thru frames, i'm not able find end of frame , continue other. here main while of server: while (true) { //manage multipal connections $changed = $clients; //returns socket resources in $changed array socket_select($changed, $null, $null, 0, 10); //check new socket if (in_array($socket, $changed)) { $socket_new = socket_accept($socket); //accpet new socket $clients[] = $socket_new; //add socket client array $header = socket_read($socket_new, 10240); //read data s...

python - Django Import/Export to multiple Models (foreignkey) -

this has been asked several times- none of solutions worked me. the code below works (in there no errors) not see import new data foreign key class. import data if already exists in foreign key. does make sense? models.py (snippet) ... class store(models.model): store_name = models.charfield(max_length=30) def __unicode__(self): return self.store_name #etc class product(models.model): store = models.foreignkey(store) category = models.foreignkey(category) first_name = models.charfield(max_length=30) second_name = models.charfield(max_length=30) ... admin.py admin.site.register(category) admin.site.register(store) class productresource(resources.modelresource): store_name = fields.field(column_name='store_name', attribute='store', widget=foreignkeywidget(store, 'store_name')) def __unicode__(self): return self.store_name.name class meta: model = produc...

elixir - How to render raw html in Phoenix framework -

i trying render raw html -> <%= raw "<noscript>\n <div style=\"width: 302px; height: 422px;\">\n </div>\n </noscript> \n\n\n" %> but when use edit html in chrome code see following -> <noscript> &lt;div style="width: 302px; height: 422px;"&gt; &lt;/div&gt; </noscript> which not want. missing here? why content inside noscript being escaped? what's right way render string html ? this isn't phoenix issue. how chrome handles when edit html. can see same thing in action @ http://jsfiddle.net/h6crtf2m <noscript><div></div></noscript>

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

Image
in code below when try execute main.java getting exception: exception in thread "main" org.hibernate.unknownentitytypeexception: unable locate persister: com.np.vta.test.pojo.users @ org.hibernate.internal.sessionfactoryimpl.locateentitypersister(sessionfactoryimpl.java:792) @ org.hibernate.internal.sessionimpl.locateentitypersister(sessionimpl.java:2637) @ org.hibernate.internal.sessionimpl.access$2500(sessionimpl.java:164) @ org.hibernate.internal.sessionimpl$identifierloadaccessimpl.<init>(sessionimpl.java:2575) @ org.hibernate.internal.sessionimpl$identifierloadaccessimpl.<init>(sessionimpl.java:2562) @ org.hibernate.internal.sessionimpl.byid(sessionimpl.java:1044) @ org.hibernate.internal.sessionimpl.get(sessionimpl.java:955) @ com.app.test.main.main(main.java:20) but if uncomment cfg.addclass( users.class ).addresource( "com/np/vta/test/pojo/users.hbm.xml" ); code works fine. why not reading <mapping...

java - Hibernate - How to set an object which has pk and fk to be VARCHAR in database? -

i have 2 entities, first of is: @entity @table(name="e_cms_cfg") public class e_cms_cfg extends baseentity{ @id @onetoone(cascade=cascadetype.all)//, fetch = fetchtype.eager) @joincolumns({ @joincolumn(name = "cfg_type", nullable = false, referencedcolumnname = "cfg_type", columndefinition = "varchar(32)"), @joincolumn(name = "cfg_type_id", nullable = false, referencedcolumnname = "id") }) private e_cms_cfg_type cfgtype; the second entity is: @entity @table(name="e_cms_cfg_type") public class e_cms_cfg_type extends baseentity{ @id @column(name = "cfg_type", length = 32) private string cfgtype; in first entity, use columndefinition = "varchar(32)" on cfg_type column; however, in database, creating cfg_type integer column. possible create varchar cfg_type column , not integer? , if is, how? using sqlite 3.8.10.1 version. updat...

playframework - Throw Global Validation error in Play -

Image
i getting started play framework, right going through play's validation features. tried validate form fields shown in below view model class. public class viewmodel { @required(message = "please enter username") public string username; @required(message = "please enter password") public string password; } below simple demo ui same. now, throw global error message when entered username , password incorrect when checked against database. below code in controller action form<viewmodel> formdata = form.form(viewmodel.class).bindfromrequest(); if (formdata.haserrors()) { logger.info("there server side validation errors in form.."); return badrequest(index.render(formdata)); } else { if(notfoundindb){ //check against db // db related code here assuming record not found in db viewmodel user = formdata.get(); ...

linux - mongodb : SyncSourceFeedbackThread] SEVERE: Invalid access at address: 0xa8 -

last night out mongodb replset r1 crashed ,then monit restart it. this process stats: mongod 1390 1 0 aug15 ? 00:39:29 /usr/bin/mongod -f /etc/mongod.conf root 1967 1 8 aug15 ? 18:53:29 /usr/bin/mongos -f /etc/mongod_route.conf mongod 2127 1 0 aug15 ? 00:56:07 /usr/bin/mongod -f /etc/mongod_r2.conf mongod 2514 1 0 aug15 ? 01:07:33 /usr/bin/mongod -f /etc/mongod_config.conf mongod 2552 1 0 aug15 ? 00:49:41 /usr/bin/mongod -f /etc/mongod_arbiter.conf root 7722 21913 0 03:04 ? 00:00:00 [mongod_r1] <defunct> mongod 7733 1 0 03:04 ? 00:05:06 /usr/bin/mongod -f /etc/mongod_r1.conf root 13964 12745 0 11:52 pts/0 00:00:00 grep --color mongo this mongodb log: 2015-08-25t03:03:53.425+0800 [conn140823] authenticate db: local { authenticate: 1, nonce: "xxx", user: "__system", key: "xxx" } 2015-08-25t03:03:53.430+0800 [conn140823] replse...

javascript - Load all technorati script ads tags asynchronously -

what issue? have issue slow ads loading on webpage, technorati ad tags using blocking page rendering until advertising tags loads 1 one, example: if have ad tag in middle of page, can't see footer of page until ad tag loads completely. what need ? want method make page loads faster , keep these scripts after whole page loaded (asynchronous), tried multiple methods didn't work. here's ad tag code have use: <script type="text/javascript"> document.write('<scri' + 'pt type="text/javascript" src="' + (document.location.protocol == 'https:' ? 'https://uat-secure' : 'http://ad-cdn') + '.technoratimedia.com/00/81/95/uat_19581.js?ad_size=300x250"></scri' + 'pt>'); </script> here's link page using ad tags on: http://feat.youmobile.org/ try using defer or async in generated script tag, depending on intended behavior: <...

javascript - How to get the values of multiple select box and display the result in textbox? -

i have dropdown list of items,each item holding each price. once selecting items,its total price populated in textbox. dropdown- <select name="treatment[]" class="col-sm-12 country" id="" multiple="multiple"> <option value="">--select--</option> <?php foreach($treatment $treatments) { ?> <option value="<?php echo $treatments->treatment_name ?>"><?php echo $treatments->treatment_name ?></option> <?php }?> </select> i trying using ajax,but lost.anyone can me out?thanks in advance. each item holding each price if price stored item in same table, need add data attributes option additional data. if not better joined it in codeigniter controller or model link price items. here example can show : supposed have html structure : <select name="treatment[]" class=...

exception - B2B runtime error: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 -

i using security.addprovider(new bouncycastleprovider()) in b2b callout when code reaches @ security.addprovider(new bouncycastleprovider()) call gives following exception. <aug 25, 2015 10:06:40 ast> <error> <oracle.soa.b2b.engine> <bea-000000> <error -: b2b-50029: b2b runtime error: java.lang.indexoutofboundsexception: index: 0, size: 0`enter code here` @ oracle.tip.b2b.callout.b2bcallouthandler.handleoutgoingcallout(b2bcallouthandler.java:583) @ oracle.tip.b2b.msgproc.request.outgoingrequestpostcolab(request.java:1654) @ oracle.tip.b2b.msgproc.request.outgoingrequest(request.java:1121) @ oracle.tip.b2b.engine.engine.processoutgoingmessageimpl(engine.java:1666) @ oracle.tip.b2b.engine.engine.processoutgoingmessage(engine.java:830) @ oracle.integration.platform.blocks.b2b.b2breference.postprocess(b2breference.java:486) @ oracle.integration.platform.blocks.b2b.b2breference.request(b2breference.java:216) @ oracle.int...

ibm mobilefirst - IBM Worklight- Push Notifications to only Subscribed users -

i need know in worklight how can send push notifications subscribed user? please, don't give me reference link of ibm worklight console & administration kind of link. if can provide me exact code or how that, pleased. did @ event source-based push notification tutorial , sample application? believe that. learn push notifications: overview: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/notifications/push-notifications-overview/ event source: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/notifications/push-notifications-overview/#pnext_collapsible_1 then scroll bottom of page , select desired environment , review code , attached sample application.

Android Togglebutton displays an unwanted icon -

Image
when removing android:theme tag androidmanifest.xml weird icon appears in togglebuttons <togglebutton android:layout_width="wrap_content" android:layout_height="wrap_content" /> in design screen nothing appears on device displays icon similar this: if add background, icon appears inside background , before text. it happens when removing android:theme tag. it looks default style togglebutton don't find way rid of it. i way override no theme behaviour of togglebuttons declaring style togglebutton or using theme affects togglebutton. if not have settle using regular buttons or custom widget.

javascript - AngularJS : how to properly use Math.pow in filters -

i'm new angularjs & still learning js , not skilled in maths please, gentle :) i'm trying make loan calulator mobile app company. make 1 can auto-refresh result when value change rid of "result/ calculate" button. i take @ angular filters, it's pretty easy build simple math formula, exponent values give me headache... i've find on stackoverflow how use filter use math.pow angular filters, can't resolve formula ... this formula have build : m = monthly payment k = kapital r = rate % n = period of payement, in years m = [( k * r ) / 12] / [ 1 - ( 1 + ( r / 12 )) ^-n] for 1000000 capital, 60 years , 5% rate, answer should 4386.42 var app = angular.module('app', []); function ctrl($scope) { $scope.math = window.math; }; <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <div ng-app="app"> <div ng-controller="ctrl...

android - Inverse/Reverse of Html.fromHtml(String) -

i creating note application myself. style notes, write html tags, click button , show styled version html. html.. problem is, need store text html tags not without when data database, text style. so wonder there way decode embedded html tags other storing string before html. html function , acting accordingly? can click button anytime continue typing hard track. because run function stylize ; text.settext(html.fromhtml(text.gettext().tostring())); which means lose tag info. thanks in advance. if user of app write html tags, app should store them. so suggest yourself, have store string before calling html.fromhtml .

ajax - get value from dynamic dropdown jquery -

i trying option value dropbox created dynamically throught ajax jquery, depending of selection of dropbox, till no success. the structure have this: html dropbox 1: <select id="slt1"> <option value="" selected>select</option> <?php foreach($prozess $p): ?> <option value="<?php echo $p->id; ?>"><?php echo $p->name; ?></option> <?php endforeach; ?> </select> dropbox 2: <select id="slt2"></select> in relation selection of dropbox 1 result of dropbox 2 ajax jquery looks this: $.ajax({ data: { id_prozess : $(#slt1).val() }, url: 'page.php', type: 'post', datatype: 'json', success: function (r) { $(#slt1).prop('disabled', false); $(#slt2).find('option').remove(); $(r).each(function(i, v){ // indice, valor $(#slt2).ap...

api - What are the implementaion changes on Java 8 which can cause wrong outcome to codes written in Java 7? -

we decided migrate our solution java 7 8. @ first step found there implementation changes in java 8 string.split() method here can cause problem codes written in java 7!! we rolled baked our project java 7 investigate more on differences. do know other changes in java 8 can cause same problem ? ps: know java 8 new features changes mean changes same api(method signature) different implementation can lead different outcome!! method -> string.split() before down vote read comments!! i don't think there easy way find exhaustive list. run query in bug database, example looking bugs in core libraries affecting versions < 8 , fixed in 8 . that query returns 320 issues , bug fix mention in question on page 6 (creation date: 2007-05-18).

Cant install java 8 on window server by chef-solo -

i use cookbooks https://supermarket.chef.io/cookbooks/java code runs on centos 6, doesn't run on windows server. error no download url set java installer uri::invalidurierror bad uri(is not uri) for windows, have provide java installation file yourself, i.e. download installer , put somewhere locally. set node['java']['windows']['url'] point file. the documentation explains why necessary - there's no simple way download java msi programmatically oracle's website.

File ListView, change name direct in ListView, WPF C# MVVM -

i made little program have files of folder , type in 1 listview. change name of file directly inside of listview. i made listview textboxes in 1 column , name of file written inside textbox. can change name in textbox now, not change file name. how connection between textbox in listview , method change name? yes little lost here. pretty fresh in mvvm wpf. my xaml code of listview: <listview name="lvfiles" grid.column="0" itemssource="{binding fileslist}" selectionmode="single" selecteditem="{binding selectedfiles}" datacontext="{binding }" height="140"> <listview.view> <gridview x:name="gridfiles"> <gridviewcolumn> <gridviewcolumn.celltemplate> <datatemplate> <checkbox tag="{binding id}" ischecked="{binding relativesource={relativesource ancestortype={x:type list...

r - Compilation error using iBMA.glm from BMA package -

my problem trival (hope), haven't found specific on errors package , posts on compilation errors regard issues people wrote code themselfs (so change it). i'm trying replicate first example example bma package help: library(mass) library(bma) data(birthwt) y <- birthwt$lo x <- data.frame(birthwt[,-1]) x$race <- as.factor(x$race) x$ht <- (x$ht>=1)+0 x <- x[,-9] x$smoke <- as.factor(x$smoke) x$ptl <- as.factor(x$ptl) x$ht <- as.factor(x$ht) x$ui <- as.factor(x$ui) ### add 41 columns of noise noise<- matrix(rnorm(41*nrow(x)), ncol=41) colnames(noise)<- paste('noise', 1:41, sep='') x<- cbind(x, noise) ibma.glm.out<- ibma.glm( x, y, glm.family="binomial", factor.type=false, verbose = true, thresprobne0 = 5 ) summary(ibma.glm.out) everything goes fine until ibma.glm function returns lengthy compilation error don't understand (i've never compiled...