Posts

Showing posts from September, 2014

java - Udp Broadcast not receiving on screen off -

i want send message (question:if particular file available or not) , want answer other android devices (if file available:yes).for sending udp broadcast message on local network ask devices @ once , afterwards sending file tcp protocol works fine. android device doesn't receive udp messages on screen off. have acquired wake lock , multicast lock in broadcast receiver detects screen off doesn't work.please help! thanks.. powermanager powermanager = (powermanager)context.getsystemservice(context.power_service); powermanager.wakelock wakelock = powermanager.newwakelock(powermanager.partial_wake_lock, "mywakelocktag"); wakelock.acquire(); wifimanager.multicastlock multicastlock = wifimanager.createmulticastlock("lockwifimulticast"); multicastlock.acquire(); wifimanager.wifilock wifilock = wifimanager.createwifilock(wifimanager.wifi_mode_full_high_perf,"mywifilock"); ...

events - R Shiny : Two buttons to build a the same dataset that used by the output function -

Image
my shiny app has 2 buttons. button submit build random_wines dataset based on reactive input text. button random build exact same random_wines dataset time based on nothing, it's picks rows randomly. here screen of app : the problem random buttom work. clicking on submit produces no result. here how wrote functions : random_wines<- eventreactive(input$param_submit,{ res=fun_random_wine(input$caption) res }) random_wines<- eventreactive(input$param_random,{ res=fun_random_wine_r_button() res }) obviously think there don't get. seems it's not possible build reactive dataset 2 buttons. if guide me. thank you.

forms - how can i customize with jQuery Validation Plugin? -

i want customize jquery validation plugin. "empty" , "wrong" show different color, when field empty color of messege , border-color red, when field wrong color turn yellow, , when don't select choice click submit, select tag border-color become red. don't know how can change .error class(the default setting of plugin) of new label tag... <form class="cmxform" id="commentform" method="post" action="javascript:alert('完成');"> <fieldset> <legend>* required</legend> <p> <label for="cname">choice(*)</label> <select id="cname" required> <option disabled selected value="000">000</option> <option value="111">111</option> <option value="222">222</option> <option value="...

c++ - how can I assign value into 2-D array by using their address? -

i'm going rewrite program using pointer & dynamic array but 2-d array part, here question this original code: (int index = 0; index < 12; index++) { sorted[index][0] = sum[index]; sorted[index][1] = index+1; } and rewrite : for (int index = 0; index < 12; index++) { *(*sorted+index) = *(sum+index); *((*sorted+index)+1) = index + 1; } i have tried , problem occur in first part of assign *(*sorted+index) , *((*sorted+index)+1) what problem going on? there no error code, descrition just: exception thrown @ 0x00f47379 in ass2 q3.exe: 0xc0000005: access violation writing location 0xce13e05c. unhandled exception @ 0x00f47379 in ass2 q3.exe: 0xc0000005: access violation writing location 0xce13e05c. you have problem in these 2 lines: *(*sorted+index) = *(sum+index); *((*sorted+index)+1) = index + 1; you need move sorted pointer index offset, , should write (sorted + index) can value stored in address *(sorted +...

javascript - AngularJS Directive menu template by a json with submenu -

i'm new student of angularjs. want create menu submenus .json. dynamic menu can add menus , submenus same .json. <a href="#" ng-repeat="item in menuheader">{{item.nav.menu[x].subitens[x].nome}} </a> i think way acess element inside other element, in view of can have multiple submenus , menus. tried loop inside, .html template... can me resolve or show me other way? here's demo: click here! thanks lot! try hope work per expectation : var app = angular.module('myapp', []); function ctrl($scope) { var data = [ { "nav": { "menu": [ { "id": 0, "nome": "menu 1", "subitens": [ { "id": 0, "nome": "sub menu 1" }...

spring mvc - Don't see webpage at http://localhost:8080/greeting -

Image
i have project structure: build.gradle buildscript { ext { springbootversion = '1.4.1.release' } repositories { mavencentral() mavenlocal() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springbootversion}") } } apply plugin: 'war' apply plugin: 'spring-boot' jar { basename = 'accouting' version = '0.0.1-snapshot' } sourcecompatibility = 1.8 targetcompatibility = 1.8 repositories { mavencentral() mavenlocal() } dependencies { compile('org.springframework.boot:spring-boot-starter-data-jpa') compile('org.springframework.boot:spring-boot-starter-web') compile("org.springframework.boot:spring-boot-starter-thymeleaf") compile("org.springframework.boot:spring-boot-devtools") compile('com.oracle:ojdbc6:11.2.0.4') providedruntime('org.springframework.boot...

C# refund SQL syntax -

i wrote inventory software; have 3 forms 1st 1 had items inventory 2nd 1 sell items inventory , last 1 can refund items sold. i have problem refund command, here code: try { mycon.open(); int y = 0; (int = 0; < datagridview1.rows.count; i++) { sqlcommand cmd5 = new sqlcommand("update pharmacy_items set quantity= quantity + " + datagridview1.rows[y].cells[4].value + " , sold= sold - " + datagridview1.rows[y].cells[4].value + " itemname='" + datagridview1.rows[y].cells[1].value + "'", mycon); cmd5.executenonquery(); y += 1; } mycon.close(); } with code want add items stock again sometime doesn't work , didn't add items , change items not right. there wrong code or way using? thanks sorry bad english : ) use parameterized query more readable , recommended way. try { mycon.open(); int y = 0; (int = 0; i<datagri...

javascript - How to set default options fro selectize, When options load from server -

i try create select input, forms , used selectize.js, this good, have little problem that. i loaded options, server add data, , okay. when try create data editor, must load last data in form inputs. in select box, loaded options, , want set of them selected default . i wrote code: var $select = $(this).selectize({ create: false, valuefield: 'id', labelfield: 'title', searchfield: ['title'], plugins: ['remove_button'], preload: true, render: { item: function (item, escape) { return '<div>' + (item.title ? '<span class="title">' + escape(item.title) + '</span>' : '') + '</div>'; }, options: function (item, escape) { return '<div>' + (item.id ? '<span class="title">' + escape(item.id) + '</span>' : '') + '</div>'; }, }, ondelet...

php - Symfony2 service -

i have 2 tables in db ( question , answer ). 1 question has many answers. i answers , depends on question.type prepare results array. in app without framework have factory class return specific object ( singlechoicequestion , openquestion , multiplechoicequestion ) depends question.type db. questions extends abstract class question has declared abstract method getresults . types have own business logic prepare results. so in situation when have created object factory i'm using method getresults , works well. i create in symfony , read documentation. in opinion should create services question types. i have created aggregatedresultsmanager method generate returns results array. depends on question.type calls getresults method specific service . i add, can't change db structure. my questions: am creating , using services right? if wrong, please me understanding , show me right way. i have several services aggregatedresultsmanager , 18 question...

How to get a distinct result ordered by a different column? SQL Postgresql -

i'm trying figure best way perform query in postgresql. have messages table , want grab last message user received each distinct user. need select row. i think want group senders id "msgfromid", when complains haven't included select statement in group statement, want group 1 column, not of them. if try use distinct on 1 column forces me order 'distinct on' column first ("msgfromid") prevents me being able correct row need (ordered last message sent sender "msgsenttime"). my goal make efficient possible on server , database. this have right now, not working. (this sub-query of query use join relevant information afterwards figure irrelevant) select distinct on ("msgfromid") "msgfromid", "msgid", "msgtoid", "msgsenttime", "msgreadtime", "msgcontent", "msgreportstatus", "senderun", "recipientun" "messages" "msgtoid...

javascript - Order of Array Elements Causing Error -

i have 2 arrays. elements of each array shown below: alllabbranches = [{ "labbranchid": "1", "labname": "wahab labs, islampura branch, lahore", "labtitle": "wahab labs lahore", "shortname": "wahb", "address": "56 islampura, lahore", "landlineno": "04237940445", "datecreated": "2016-03-11 11:00:00", "createdbyname": "jamshaid sabir", "createdbyuserid": "1", "dateupdated": "2016-05-04 00:53:03", "updatedbyname": "jamshaid sabir", "updatedbyuserid": "1", "clientgroups_clientgroupsid": "1", "startdate": "2016-05-04" }, { "labbranchid": "2", "labname": "wahab labs, model town branch, lahore", "labtitle": "wahab labs lahore...

c++ - Convert a hexadecimal value into a binary value -

this question has answer here: convert strings between hex format , binary format 2 answers i have program needs take hexadecimal value of 2 digits (up ff ) , convert each digit separate 4-digit binary value (up 1111 ). i'm able write algorithm me, before that, there easy way built-in functions in c++? there's similar question answered here: convert strings between hex format , binary format you might want check out, think answer provided there complete , easy understand.

Ruby + ActiveRecord: How to configure a date field resulting in 'yyyy-mm-dd' date format? -

i using activerecord 4.2.4 work database. some background: ruby '1.9.3' activerecord '4.2.4' cucumber '2.1.0' i not using rails. i ran issue, output file generated shows: role | updated_date teacher | 2016-10-26 09:54:06 utc but not want '2016-10-26 09:54:06 utc ' in updated_date, expect '2016-10-26' show in file, below: role | updated_date teacher | 2016-10-26 the updated_date column has type of date in table. execute query without converting anything. , not using ruby object/model map database table, instead run sql , print out results file. here have in code: def initialize activerecord::base.time_zone_aware_attributes = false db_config = dbconfig.get_config_file(db_config) activerecord::base.establish_connection( :adapter => db_config['adapter'], :username => db_config['username'], :password => db_config['passwor...

java - Taking a copy of my original List gets updated when it shouldn't -

Image
i have bit of code: private list<attributes> splitdatabasedonnextbranchtotraverse(branches nextnonleafbranchtosearch, list<attributes> attributes) { list<attributes> newattributelisttoreturn = attributes; (attributes attribute: newattributelisttoreturn){ (branches branches : attribute._branches){ branches.checkrowexists(nextnonleafbranchtosearch.returnallrows()); } } return newattributelisttoreturn; } where have global list of objects pass method take copy of list. copy list changed , should not same global list passed in. when debug code , check global list matches changes of list within method why? don't want global list change needs stay same! how can stop happening making both lists unique 1 appreciated. assignment copy value of l1 (which reference) l2 . both refer same object. creating shallow copy pretty easy though: list<attributes> newattributelisttoreturn = new ...

yii - Dynamic form input using inputmask not working -

i use yii2 wbraganca manage dynamic input. in dynamic, use inputmask yii2 whic : \yii\widgets\maskedinput; everything fine, but, when use inputmask, it's working in first element (row in case), i read here : wbraganca , check vendor folder, code exist. // "jquery.inputmask" var $hasinputmask = $(widgetoptionsroot.widgetitem).find('[data-plugin-inputmask]'); if ($hasinputmask.length > 0) { $hasinputmask.each(function() { $(this).inputmask('remove'); $(this).inputmask(eval($(this).attr('data-plugin-inputmask'))); }); } but, code still not working add inputmask in next element. appreciated.

command gem install rails fails with permissions error? -

trying install gem (gem install rails) fails error: error: while executing gem ... (gem::filepermissionerror)you don't have write permissions /usr/lib/ruby/gems/1.8 directory. having idea how solve this? i trying installing rails unix. sudo command allows execute command superuser so following command should work you. sudo gem install rails

python - tornado server serve a file -

i know how serve static files / pngs etc far kept under web static path. how go serving file @ path, /usr/local/data/table.csv ? also, wondering if display page wise results(pagination) more concerned serving arbitrary location files + stay if remove them local (i mean once uploaded / cached). [that separate ques though] on basic level, need read file , write response: import os.path mimetypes import guess_type import tornado.web import tornado.httpserver basedir_name = os.path.dirname(__file__) basedir_path = os.path.abspath(basedir_name) files_root = os.path.join(basedir_path, 'files') class filehandler(tornado.web.requesthandler): def get(self, path): file_location = os.path.join(files_root, path) if not os.path.isfile(file_location): raise tornado.web.httperror(status_code=404) content_type, _ = guess_type(file_location) self.add_header('content-type', content_type) open(file_location) ...

active directory - C# DirectorySearcher obtain users by manager logon id -

i have 2 issues. obtain user based on logon name. in image aduser1 , can see logon name 'aduser1' not able obtain users though can obtain using first name, sn , on. using (directorysearcher searcher = new directorysearcher(domain)) { searcher.filter = "(&(objectcategory=person)(objectclass=user)(samaccountname=aduser1))"; //searcher.propertiestoload.addrange(new string[] { "givenname", "sn", "samaccountname" }); foreach (searchresult user in searcher.findall()) { console.writeline(string.format("user {0} {1} ({2}) works john doe", user.properties["givenname"][0].tostring(), user.properties["sn"][0].tostring(), user.properties["samaccountname"][0].tostring())); } } i want obtain list of users particular manager logon cannot seem format query correctly. example, if want obtain users manager 'aduser1'? searcher.filter = ...

java - How do I Override a Iterable<interface> return type method into Iterable<? extends interface> return type method -

i have interface need implement. looks this: public interface simulationstate { ... public iterable<vehiclestatus> getvehiclestatuses(); } i trying extend interface sort of decorator interface following: public interface simulationstatedec<v extends vehiclestatus> extends simulationstate { ... @override public iterable<v> getvehiclestatuses(); } or public interface simulationstatedec<v extends vehiclestatus> extends simulationstate { ... @override public iterable<? extends vehiclestatus> getvehiclestatuses(); } here's concrete class i'm implementing interface at: public class warehousestate implements simulationstate { ... @override public iterable<vehiclestatus> getvehiclestatuses() { return this.vstatuses; } } i implementing vehiclestatus interface @ class named vehiclestate return implemented vehiclestate though iterable in concrete class so @ class in proje...

java - New Tag Collected Dialog appears when app tries to read NFC payload from the tag -

i'm trying understand nfc concept creating sample android app. when try read payload tag, dialog appears title new tag collected , tag payload in it. not want dialog appear. want print out toast instead. can me? public class mainactivity extends appcompatactivity { nfcadapter nfcadapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); nfcadapter = nfcadapter.getdefaultadapter(this); if(nfcadapter!=null && nfcadapter.isenabled()) { toast.maketext(this, "nfc detected",toast.length_long).show(); } else { finish(); toast.maketext(this, "nfc not detected",toast.length_long).show(); } } @override protected void onnewintent(intent intent) { toast.maketext(this,"new nfc tag found!",toast.length_long).show(); parcelable[] parcelables = intent.getparcelablearrayextra(nfcadapter.extra_n...

java - Running multiple maven build profiles serially -

i using maven assembly plugin build jar in project. i've got 2 profiles , each of them builds jar different main class. wanted know if there method of running both profiles serially. so, when run mvn install command, both jars in target . this part of pom building jar different profiles: <profiles> <profile> <id>main</id> <build> <plugins> <plugin> <artifactid>maven-jar-plugin</artifactid> <version>2.3.1</version> <executions> <execution> <id>default-jar</id> <phase>none</phase> </execution> </executions> </plugin> <plugin> <groupid>org.apache.maven.plugins<...

optimization - maxima: optimize does not optimize away many repeated expressions -

my code below. problem many repeated expressions not eliminated optimize. clue? inserted subst because without them result worse. debugmode(true)$ exptsubst:true$ display2d:false$ id1(v):=is1*(exp(v/n1vt)-1.0)$ id2(v):=is2*(exp(v/n2vt)-1.0)$ f(v):=id1(v)+id2(v)+gmin*v-i$ d:3$ v + d*diff(1/f(v), v, d - 1)/diff(1/f(v), v, d)$ subst(exp1, exp(v/n1vt), %)$ subst(exp2, exp(v/n2vt), %)$ facsum(%, v)$ optimize(%)$ %;

javascript - Get node of data from firebase -

Image
i'm trying data firebase , i'm little stuck that. i'm trying semaa data did not give me nothing firebase.database().ref('courses/'+departmentid+'/sema'), i can specific (but don't want it) firebase.database().ref('courses/'+departmentid+'/sema/java'), i wnated black sign , red sign in 2 different queries , run loop data there if you're looking loop on courses in semester: var semesterref = firebase.database().ref('courses/'+departmentid+'/sema') semesterref.on('child_added', function(coursesnapshot) { console.log(coursesnapshot.key); });

oracle - Getting Null with Lag function -

Image
i still getting null. can take , let me know doing wrong? lag value null , should 0 based how it's listed in table. here code - see link output of tables , results select t1.account_nbr, t1.customer_key, t2.random_1, t2.random_2, t2.random_3, lag(t2.random_3, 1) on (order t2.calendar_key)as lagvalue t1 join t2 on t1.customer_key = t2.customer_key , t1.account_nbr = t2.account_nbr , t1.wo_checked_in_dt_key = t2.calendar_key

matlab - training neural network pattern recognition -

Image
here network setup have 100000 samples of 1d vector (1440 data points) 1/3 of data original signal + noise 1/3 of data set original signal 1/3 of data set original signal filtered i have 45 second window sampled @ 32 hz 1440 data points. pulse sequence can start anywhere in 45 second window. generated different pulse sequences @ different points each output. for given pulse sequence should correspond number in output. output 1 hot vector mapped set of values. for example input --|_|--|_|--|_|--|_|-- output should 0 = [0 0 ......]; --|_|--|_|--|_|----|_|-- output should 1 = [0 1 ......]; --|_|--|_|--|_|------|_|-- output should 2 = [0 0 1......]; i have tried train network 20 times 20000 iterations doesn't seem recognize patterns. error percentage seems high around %60 what need data network train better?

How to make a multi-step android view? -

i want make multi-step register page. need pages. lave tried many things don't know how connect register parts submit them server @ same time think making multiple activity not efficient. i think you're looking viewpager. here how used. https://developer.android.com/training/animation/screen-slide.html

awt - Fully understanding the BufferStrategy code sample from Java docs -

the official java documentation gives example on how use bufferstrategy: // render single frame { // following loop ensures contents of drawing buffer // consistent in case underlying surface recreated { // new graphics context every time through loop // make sure strategy validated graphics graphics = strategy.getdrawgraphics(); // render graphics // ... // dispose graphics graphics.dispose(); // repeat rendering if drawing buffer contents // restored } while (strategy.contentsrestored()); // display buffer strategy.show(); // repeat rendering if drawing buffer lost } while (strategy.contentslost()); however, not able grasp whats going on here documentation quiet sparse samples. from code sample got following notion: while invoking several methods on graphics object, underlying video memory (vram) might lost , restored halfway through. whole rendering p...

python - The creation of a binary treeBinary Tree Creati -

i have problem 1 exercise based on binary tree creation. try explain. a task is: there array created walking binary tree preorder procedure. example have following output of preorder procedure : 2 1 0 0 3 0 0 . 2 root of balanced binary tree, 1 left child, 2 right child. node 1 , 2 leaves, children 0 0 , 0 0 . this output made preorder procedure looks following: printpreorder(root): if root: print(root.key) printpreorder(root.left) printpreorder(root.right) i have class tree (python) class(tree): def __init__(self, key): self.key = key self.left = none self.right = none using output of preorder procedure need create array objects nodes of binary tree input in preorder procedure. how make maybe recursion, maybe not. each property of tree objects have pointer on other objects.

java - My while loop prints menu twice -

this question has answer here: scanner skipping nextline() after using next(), nextint() or other nextfoo()? 13 answers i wrote program called soccer team roaster. stores player's jerseys number , player rating. , ever user wants within menu option. reason menu option keeps on printing twice. i've been informed because when ask int input playerrating[i] takes enter button , input when first ask user's input string "menuoption". can help? here code import java.util.scanner; public class soccerteamroaster { public static void main(string[] args) { scanner sc = new scanner(system.in); final int jersy_nums = 5; int[] jersynumber = new int[jersy_nums]; int[] playerrating = new int[jersy_nums]; string[] jput = new string[jersy_nums]; int = 0; boolean quit = false; (i = 0; <...

Android studio DDMS not showing file explorer -

i'm not sure if i'm missing or having issue. whenever pull ddms on app shows device file explorer , every other tool shows blank enter image description here enter image description here

javascript - Popover on SVG-Path Element -

Image
i looking way create popover on svg-path element. im making angular 1 app showing clickable car parts. to clear popover has right on top of specific part. preferably right cursor is. i found these options make popovers in general in angular content: http://github.hubspot.com/drop/docs/welcome/ - see popover https://angular-ui.github.io/bootstrap/#/popover -popover but these not full fill positioning needs or option applied paths. thanks already

c# - Await is disposing DbContext - The ObjectContext instance has been disposed -

i have following in async method has instance of dbcontext passed it: var userids = await getuserids(db); with getuserids: private async task<list<int>> getuserids(appcontext db) { var items = await db.items.where(s => s.isvalid).distinct().tolistasync(); // simplified return items; } but get: {"the objectcontext instance has been disposed , can no longer used operations require connection."} i can force run removing await , tolistasync , that's bandaid. why context getting disposed? i suspect caller of getuserids method disposing context before operation completes. sure you're awaiting returned task before disposing context?

linux - Building error when building Android Rom (ABC Rom - based on PureNexus, based on AOSP) -

i getting build error when doing mka bacon after breakfast [device]. i have tried using make clobber clean out it's fresh still error. have tried removing line "#include " lunaos/external/busybox/scripts/basic/fixdep.c, still doesn't fix it. the build log can found here - http://pastebin.com/dnxfs91k any ideas on how fix this? i'm on linux mint 17.3, , people have confirmed environment setup correctly - i.e. following same tutorials, putting in right commands download build tools, etc. thanks in advance.

uml - state machine run-to-completion paradigm -

i did not understand paradigm run-to-completion state machine (14.2.3.9.1 uml 2.5 spec). @ 1 point says: "run-to-completion means that, in absence of exceptions or asynchronous destruction of context classifier object or statemachine execution, pending event occurrence dispatched after processing of previous occurrence completed , stable state configuration has been reached. is, event occurrence never dispatched while statemachine execution busy processing previous one " and in another: "implementation note. run-to-completion mistakenly interpreted implying executing statemachine cannot interrupted, which, of course [of course?? ndr] lead priority inversion issues in time-sensitive systems. however, not case; in given implementation thread executing statemachine step can suspended , allowing higher-priority threads run, and, once allocated processor time again underlying thread scheduler, can safely resume execution , complete event processing" so, possi...

Python urllib2: Receive JSON response from url -

i trying url using python , response json. however, when run import urllib2 response = urllib2.urlopen('https://api.instagram.com/v1/tags/pizza/media/xxxxxx') html=response.read() print html the html of type str , expecting json. there way can capture response json or python dictionary instead of str. if url returning valid json-encoded data, use json library decode that: import urllib2 import json response = urllib2.urlopen('https://api.instagram.com/v1/tags/pizza/media/xxxxxx') data = json.load(response) print data

python - Heroku Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch -

Image
i keep getting error despite trying out in internet. i'm trying run flask application on heroku. below procfile web gunicorn -b 127.0.0.1:8000 geeni:app below geeni.py file. class chargeuser(resource): def post(self): jsondata = request.get_json(force=true) stripeid = jsondata['stripeid_customer'] currency = jsondata['currency'] amount = jsondata['amount'] apikey = jsondata['api_key'] try: stripe.charge.create(amount = amount, source=stripeid, currency=currency) return jsonify({'msg':'charged!'}) except: raise api.add_resource(chargeuser,'/') if __name__ == '__main__': app.run() i've setup heroku push/login , have throughly followed tutorials. no luck.. your procfile should web: gunicorn -b 0.0.0.0:$port greeni:app . written, heroku never see application ready receive inbound connections: ...

java - com.fasterxml.jackson.databind.node.ObjectNode cannot be converted to org.codehaus.jackson.node.ObjectNode -

i'm using play2.2.1 , facing error: com.fasterxml.jackson.databind.node.objectnode cannot converted org.codehaus.jackson.node.objectnode the code this: package controllers; import play.*; import play.data.*; import play.mvc.*; import play.db.ebean.*; import views.html.*; import java.util.*; import models.*; import com.avaje.ebean.expressionlist; import play.data.validation.constraints.required; import scala.*; import play.libs.json; import org.codehaus.jackson.node.objectnode; public class application extends controller { //create json data public static result ajax() { string input = request().body().asformurlencoded().get("input")[0]; objectnode result = json.newobject(); if(input == null) { result.put("status", "bad"); result.put("message", "can't sending data..."); return badrequest(result); } else { result.put("status", "ok"); resul...

v8 - Javascript global objects included in d8.exe -

i know v8 include subset of javascript global objects commonly use in browsers, global objects console/window/document not available in d8.exe . functions settimeout not available (in fact, can't find way replace function). i can if ("console" in this) { ... } check if console object available or not, not elegant in opinion. there list specified included , not? or better, list of workarounds? v8, , d8, implements of libraries defined in ecmascript language specification ( ecma 262 ) , ecmascript internationalization api specification ( ecma 402 ). in addition, d8 implements couple of ad-hoc i/o functions intended v8's test suite, , should rather not relied upon.

How to make size of Label very small in terms of WIDTH and HEIGHT. Python and Kivy -

Image
lets have gridlayout 2 columns. add this: gridlayout = gridlayout(cols = 2, orientation = "horizontal") button = button(text = "hello") label = label(text = "world", size_hint = (.1,.1)) gridlayout.add_widget(button) gridlayout.add_widget(label) i need 2 columns, pretty want button have of screen , label small placeholder. i have tried doing size_hint's on both , not able change size of it. i using python 2.7.x , kivy 1.8 + thanks. this code seems work me, perhaps need use width/height directly, you'll need set size_hint = (none, none) . might interested in texture_size . just note, if use kivy 1.8 or that's below latest stable version (now 1.9.1), it's best time update kivy asap.

Represent infinity as an integer in Python 2.7 -

i wondering how define inf , -inf int in python 2.7. tried , seems inf , -inf work float . a = float('-inf') # works b = float('inf') # works c = int('-inf') # compile error, valueerror: invalid literal int() base 10: 'inf' d = int('inf') # compile error, valueerror: invalid literal int() base 10: 'inf' to summarise said in comments there no way represent infinity integer in python. matches behaviour of many other languages. however, due python's dynamic typing system, can use float('inf') in place of integer, , behave expect. as far creating 'double' infinity, in python there 1 floating point type, called float , unlike other languages such java uses term float , double floating point numbers different precision. in python, floating point numbers use double-precision , act same doubles in java.

Wordpress Global Navigation with a location filter -

picture of main navigation i'm building wordpress site friend's gym. has 3 store locations- wants users able click dropdown menu in main navigation , have them select location. don't know how can make navbar selection stay when navigate different page. (see image) my other problem pricing, team, , pages global 3 locations. schedule page serve different schedule based on location selection. sub navigation location selection i thought doing multisite don't want them have update page 3 different times. suggestions? told me custom taxonomies i've never used concept before. thanks in advance!

javascript - How to download a file from project/specific location using nodejs? -

this may dumb question lil confused, requirement should able download excel template on click event, thought put excel template in folder(docs) in backend code(instead of generating dynamically) , download that. possible, if yes how? using express , node. it possible. use express framework. express can serve static files under '/public' folder. when user connect file, her/his browser download file. browser can view files online. example, chrome can open pdf files. if want force download file can use simple code; app.get('/download', function(req, res){ var file = __dirname + '/upload-folder/dramaticpenguin.mov'; res.download(file); // set disposition , send it. });

I want to print all variables and placeholders in Tensorflow -

i run sample code recurrent_network.py . i wish print x, it's placehoder. in function: rnn(x, weights, biases): what can do? key point: x = tf.transpose(x, [1, 0, 2]) # reshaping (n_steps*batch_size, n_input) x = tf.reshape(x, [-1, n_input]) # split list of 'n_steps' tensors of shape (batch_size, n_input) x = tf.split(0, n_steps, x) please see post details. use tf.print() myself.

ruby on rails - How do I establish a relationship between two objects where both need to have many of the other object? -

my situation this: have 2 models, model (as in car model) , engine . have models have more 1 engine (different model years came different engines), , have engines belong multiple different models (single engine reused across multiple models). forgive me being (very) new rails , activerecord, seems bit more complicated has_many , belongs_to . wrong. should note i'm using rails 5 . given have scaffolds/models in place , i'd rather not delete them, how write migration achieve above situation? need add respective models? use many-to-many relationship, make sure migration name contains jointable rails g migration createenginemodeljointable engines models engine class class engine < activerecord::base has_and_belongs_to_many :models end model class class model < activerecord::base has_and_belongs_to_many :engines end you can access by engines = model.engines models = engine.models

jquery - Load dropdown list with navigation property depend on another dropdown list -

my project model class this public class project { [key] public int id { get; set; } [required(errormessageresourcetype = typeof(resources.resources), errormessageresourcename = "emptyprojectname")] [display(name = "projectname", resourcetype = typeof(resources.resources))] public string name { get; set; } [foreignkey("country")] [required(errormessageresourcetype = typeof(resources.resources), errormessageresourcename = "emptycountry")] [display(name = "country", resourcetype = typeof(resources.resources))] public int countryid { get; set; } [foreignkey("province")] [required(errormessageresourcetype = typeof(resources.resources), errormessageresourcename = "emptyprovince")] [display(name = "province", resourcetype = typeof(resources.resources))] public int provinceid { get; set; } public country country { get; set; } publ...

Slowing down 960 fps video with ffmpeg (setpts is not working) -

i trying slow down video recorded on android phone @ 960fps . found lot of previous posts , blogs same thing, need change "presentation timestamp" (pts). found official documentation saying same thing. command-line looks this: ffmpeg -i input.mp4 -filter:v "setpts=4*pts" -r 30 -y output.mp4 i copied video file using android filter transfer , when use above command-line, works slow down, resulting output choppy. output of ffmpeg indicates duplicating frames: frame= 687 fps=103 q=-1.0 lsize= 4454kb time=00:00:22.80 bitrate=1600.1kbits/s dup=515 drop=0 speed=3.42x running ffprobe on file shows this: ffprobe version 3.1.1 copyright (c) 2007-2016 ffmpeg developers built apple llvm version 7.3.0 (clang-703.0.31) configuration: --prefix=/usr/local/cellar/ffmpeg/3.1.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-lda libavutil 55. 28.100 / 55. 28...

javascript - location.href return strange URL -

i'm using location.href full url exists in browser address bar. provide more detail, it's important note our service has js file included in our customers sites. js file generate full url of applicant. i thought url somehow previous url redirected real domain, how should prevent action? the line of js code generate link iframe's src attribute is: 'http://sd.domain.ir/index.php?r=' + math.floor(math.random() * (100000000 - 0 + 1)) + 0 + '&ref=' + ((window.btoa) ? btoa(location.href) : 'ie') + '&responsive=' + ((document.queryselector('meta[name="viewport"][content*="width=device-width"]')) ? 'yes' : 'no') + '&params=' examples of applicant ua: mozilla\/5.0 (linux; u; android 4.3; en-us; huawei g620-l72 build\/huaweig620-l72) applewebkit\/534.24 (khtml, gecko) version\/4.0 mobile safari\/534.24 t5\/2.0 bdbrowser\/6.1.0.4 mozilla\/5.0 (linux; u; android 4.4.3; ...

codenameone - How to test an Android native code snippet with Codename One? -

first off used programming java that's why using codename 1 develop mobile applications. however see code in android "format" interested on testing. know how set basic native interface codename 1 tutorial . for example, test snippet real time sound processing . involves initializing variable in android oncreate() method data available in method such am = (audiomanager) this.getsystemservice(context.audio_service); use of this has not same reference in codename 1 native interface. maybe don't have use oncreate() method (which be reached codename one ) not android guru (nor cn1 1 either!), don't know. consequently changes have make test native android code in codename 1 native interface ? maybe there methodology glad hear of. edit solved : code used in native interface implementation works here codename 1 native interface implementation of original android code . indeed android oncreate() method has not been used things initialized in have been ...