Posts

Showing posts from May, 2011

Why IntelliJ IDEA uses scala 2.10.6 for play2 configuration? -

i use: scala version 2.11.8 everywhere in project, version explicitly specified in build.sbt sbt version 0.13.13, specified both in project/build.properties , ide settings intellij idea uses correct version of scala tests running , project building (output in ...target/scala-2.11... ), not play2 application. latter 1 reason uses scala 2.10: [info] compiling 86 scala sources .../target/scala-2.10/classes... . the idea have idea uses default scala of sbtlauncher (it uses 2.10.6 when run console), despite explicit declaration in build file.

ruby on rails - Is it possible to automatically suspend users in devise? -

there's application uses devise , add possibility automatically suspend account (14 days trial). looking expire devise user found this: https://github.com/phatworx/devise_security_extension doesn't me. does know way automatically suspend user account after time? you can test expiration in before_action class applicationcontroller << actioncontroller::base before_action :check_expiration def check_expiration if current_user && current_user.status == 'trial' if date.today - current_user.created_at.to_date > 14 flash[:error] = "your trial has expired!" sign_out current_user redirect_to :new_session_path end end end end

Django condition aggregation, count when entry exists -

what want this: foo.objects.all().annotate(c=count(case(when(bar_set= exists,then 1)))) that is, count cases bar_set not empty. # should not counted foo.bar_set() >>> [] # should counted foo.bar_set() >>> [<bar: bar object>] how can done?

c# - Illegal character in path in released version but not in debug mode -

Image
tl;dr why when running debug mode application works in release not? i using mvvm load file path process data. when using debugger version loads, validates , converts fine, when using published/released version fails unable track occurs. 1 note tried accompanied long file paths included @"\\?\" attached our converter. public static string checkfilepath(string filepath) { //network location if (filepath.startswith(@"\\")) { filepath = filepath.trimstart(@"\\".tochararray()); return @"\\?\unc\" + filepath; } //local location if (!filepath.startswith(@"\\?\") && (!filepath.startswith(@"\\") || !filepath.startswith(@"\\?\unc\"))) { return @"\\?\" + filepath; } return filepath; } also we're using 4.6.2 , using try , accomodate long file paths. please note converter chec...

android - Need assistance with video file size project -

not sure why piece of code isn't returning value in lower box, ideas? need multiply many variables there no output in lowermost box, must work on android devices program targeted. <!doctype html> <html width="75"> <head> <title>video file size calculator</title> <script>function compute(){ var f=document.forms.form; var iw=(number(f.pixels_wide.value / f.dpi.value)); var it=(number(f.pixels_high.value / f.dpi.value)); document.getelementbyid('inches_wide').value=iw; document.getelementbyid('inches_high').value=it; var tp=(number(f.pixels_wide.value * f.pixels_high.value)); document.getelementbyid('total_pixels').value=tp; var bytes=(number(f.total_pixels.value * f.bit_depth.value)); var vfsb=(number(f.bytes.value * f.camera_frames.value * f.video_time.value)); document.getelementbyid('videobytes').value=vfsb; }}</script> </head> <body width="75" ...

c - Call Function by its Address -

i'm trying call kernel function address. typedef void tkidetachprocess(); dword64 kedetachprocessaddr = &kedetachprocess; int temp = *(int*)(kedetachprocessaddr + 0x1f + 0x1); dword64 kidetachprocessaddr = kedetachprocessaddr + 0x1f + 0x5 + temp; tkidetachprocess* pkidetachprocess = (tkidetachprocess*)kidetachprocessaddr); pkidetachprocess(); but i'm getting bluescreens code. the kidetachprocessaddr right, looked in debugger, there should wrong declaration of tkidetachprocess.

jsf - primeface dialog doesn't use the information I provide in the view -

i have view contain following fields: <p:selectonemenu style="width:40px" value="#{capacityfamilybean.capacityfamily.bottleneck}"> <f:selectitems value="#{capacityfamilybean.availablecapfamilybottlenecks()}"/> </p:selectonemenu> <p:inputtext id="capacityfamilyname" binding="#{capacityfamilyname}" style="margin-left:20px" value="#{capacityfamilybean.capacityfamily.name}"> <p:ajax event="change" update="newbundlebutton"/> </p:inputtext> <p:commandbutton id="newbundlebutton" icon="ui-icon-plus" disabled="#{empty capacityfamilyname.value}" value="${msgs.new}" oncomplete="pf('capacityfamilydialog').show();"/> you can see value properties {capacityfamilybean.capacityfamily.prprty} capacityfamilydialog uses same properties, not pre-filled <p:selectonemenu value="#{capacityfam...

list - Splitting column text file into smaller files based on value differences in Python -

i trying split text file 3 columns many smaller individual text files based on presence of jumps in value in first column. here example of small part of file split: 2457062.30520078 1.00579146 1 2457062.30588184 1.00607543 1 2457062.30656300 1.00605515 1 2457062.71112193 1.00288150 1 2457062.71180299 1.00322454 1 2457062.71248415 1.00430136 1 between lines 3 , 4 there jump larger usual. point data split , individually created text files separated, creating 1 first 3 lines , 1 latter 3 lines. jumps exceed change of 0.1 in first column. goal have jump example split point separate files. insight appreciated, thanks i loop through main file , keep writing lines long condition met. fits definition of while loop perfectly. main complexity need 2 open files @ same time (the main 1 , 1 writing to), that's not problem python. maintext = "big_file.txt" sfile_templ = 'small_file_{:03.0g}.txt' # delimiter space in example g...

java - Circular view path Spring boot tutorial -

i'm learning spring boot. follow guides , i'm tryng 1 : securing web application. so i've made 2 files (hello.html/home.html) , deploy application see them when try access localhost:8080 error : circular view path [home]: dispatch current handler url [/home] again. check viewresolver setup! (hint: may result of unspecified view, due default view name generation.) if can me there ? here code : src/main/java/com/society/myapplication : import org.springframework.boot.springapplication; import org.springframework.boot.autoconfigure.springbootapplication; @springbootapplication public class myapplication { public static void main(string[] args) throws throwable { springapplication.run(calamarapplication.class, args); } } src/main/java/com/society/mvcconfig.java import org.springframework.context.annotation.configuration; import org.springframework.web.servlet.config.annotation.viewcontrollerregistry; import org.springframework.web.servlet.con...

angularjs - Disable tooltip "Please fill out this field" when not using <form> tag (DNN) -

setting 'novalidate' or 'formnovalidate' not fix issue i'm using framework dnn. framework wraps each page in form tag breaks custom forms. passed i'm using ng-form on tag. because of fix see default tooltip though i'm using bootstraps uib-tooltip. i'm willing go far jquery fix issue read post apparently chrome , firefox have both disabled ability select , edit default tooltips. example: <div role="form" ng-form="myform" novalidate> <div class="form-group"> <label> <input type="text" id="identifier" name="identifier" ng-minlength="3" ng-maxlength="14" class="form-control" ng-model="$ctrl.identifier" ng-required="true" uib-tooltip="{{ $ctrl.tooltips.identifier }}" tooltip-enable="myform.identifier.$invalid && myform.identifier.$touched"> </label> ...

osx - LowLatencyWriteIsochPipeAsync transfer completed early? -

i submit isochronous usb transfer on osx using lowlatencywriteisochpipeasync() frame ...844. current bus frame ...829 transfer should begin 15 frames (15 ms) in future. length of transfer 64 frames (64 ms) expect completion callback called no earlier 64+15 = 79 ms when submitted. in fact, completion callback called 55 ms after submitted! that's not long enough transfer complete if started immediately. going on?

c# - Develop asp.net application for windows server on linux -

i use linux , not willing switch windows. need create asp.net application windows server people working visual studio on windows. work linux machine. have heard mono. can instructions , suggestions? note application deployed on windows. one way or going have use windows @ point. if runs fine under mono still need check on windows. you set virtual machine on linux running windows, or have separate machine testing. if working in team else responsible of testing avoid too. start installing mono apt-get install mono-complete . easiest visual studio setup project. using form of version control, can push code , pull linux machine. can write code on linux in preferred text editor , test running under mono. deploy windows machine/vm verify works expected on target platform. you can check features fully, partially or not supported in mono here: http://www.mono-project.com/docs/about-mono/compatibility/ http://www.go-mono.com/status/

Amazon Web services - Retrieve Inventory File Template for Node ID -

i able know file template use based on specific node id browse tree guide. i can see here btg , inventory file template each category of products: https://www.amazon.com/gp/help/customer/display.html?nodeid=200186090 what want access web service in amazon allows me know, based on node id 1 of btg files, corresponding templatetype. does amazon provide service this? don't mind having access multiple endpoints information, haven't found anywhere can define mapping between 2 (node id <-> templatetype). thank you.

xml - TEI xsl:template to show tag <g> relative charName -

inside tei header of tei file have declared chars: ` <chardecl> <char xml:id="char1"> <charname>vnc.</charname> <desc>tractus longus</desc> </char> <char xml:id="char2"> <charname>drag.</charname> <desc>interclusio uncinata</desc> </char> ... </chardecl> ` inside body text of tei have tag : lorem ipsum <g ref="#char2"/> dolor sit ii. cotylus habet <g ref="#char1">—</g> want display this: lorem ipsum [drag.] dolor sit ii. cotylus habet —[vnc.] how xsl stylesheet xsl:template? tried doesn't work: <xsl:key name="char" match="tei:teiheader/encodingdesc/chardecl/char" use="@xml:id"/> <xsl:template match="tei:g[@ref]"> <xsl:apply-templates /> <span title="<xsl:value-of select="key('char',substring-after(@r...

swisscomdev - Not autorized to execute any command using Service Connector on MangoDB -

i using mangodb on app , when try access database directly using service connector, able connect getting : error: error: { "ok" : 0, "errmsg" : "not authorized on admin execute command { *any command*}", "code" : 13 } and on query or command. is there way change authorization or accessing data of mangodb p.s: mangodb bind in tutorial: https://docs.developer.swisscom.com/tutorial-python/bind-service.html it looks you're trying execute commands on admin database on user not authorized. can find correct database user authorized on in credentials (key mongodb.credentials.database ) ideally connect using provided uri ( mongodb.credentials.uri ) connect correct database automatically. you can have @ python example in tutorial linked find out how access , use credentials correctly.

java - Increase the performance of this code -

is there way increase performance of following for loops: for(string s : lista){ for(string s1 : listb){ for(string s2 : listc){ //api call } } } i doing api call in inner loop. each time has call api , causing performance issue. there simple way can achieve without performance issue of using libraries? instead of calling api in loop, try instead adding details of necessary api call queue . use multiple threads process queue. obviously same total time taken, loop should complete earlier. remember loop completing no longer mean api calls done.

Is it possible to use cucumber with gradle buildship in Eclipse? -

i'm trying compile "hello world" cucumber application using gradle buildship in eclipse. when try run (choosing 'build') in eclipse, following error: launching gradle tasks failed due error connecting gradle build. not execute build using gradle distribution https://services.gradle.org/distributions/gradle-3.5-bin.zip build operations have not been marked completed i can build using command line using same configuration: :compilejava :processresources no-source :classes :jar :assemble :compiletestjava :processtestresources :testclasses :test skeleton.runcukestest standard_out ...waiting... ...growling... 1 scenarios (1 passed) 3 steps (3 passed) 0m0.085s :check :build build successful total time: 3.19 secs and here version info command line: c:\users\whalen\documents\ws\workspace\cucumber-hello-world>gradlew -version -----------------------------...

scala - UDF in Spark being called twice -

i running problem udf being called twice. first sql command tried running is: sqlcontext.sql("select * ( select city, ctof(avglow) feren citytemps ) x feren > 30.0 order feren desc").show(); where ctof udf. i noticed ctof being called twice here (i suspect in clause , again in select clause). added print statements inside ctof function , saw ferenheit calculation above 30 degrees , ctof called twice. i'd rather called once since have extremely large dataframe. after didn't have luck sql command, tried following: val ferendf = sqlcontext.sql("select city, ctof(avglow) feren citytemps"); ferendf.registertemptable("ferentemp"); sqlcontext.sql("select city, feren ferentemp feren > 30.0 order feren desc").show(); my udf, ctof, still being called twice. there anyway can run these sql commands ctof being called once? fyi, using spark 2.1.0.

video - ffmpeg: add subtitles to mp4 with out creating a new file -

ffmpeg -i infile.mp4 -i infile.srt -c copy -c:s mov_text outfile.mp4 adds subtitles mp4 video creates new file instead adding few blocks of data existing file. is there way modify existing video instead of creating new one? subler great in second, should ffmpeg . ffmpeg not in-place editing.

Css selector - which one to prefer when classes with space? -

when selecting phone number using css selector, got stuck coming across class space among them. @ least ten selectors can achieve target. question 1 should prefer , why? in advance. elements within class lies: <div itemprop="telephone" class="phones phone primary">(310) 443-8911</div> selectors i've talked above: div.phones div .phones div.phones.phone div .phones.phone div.phone.primary div .phone.primary div.primary div .primary div.phones.phone.primary div .phones.phone.primary a space between classes indicates separate class names, not single name. example, class="phones phone primary" means element has 3 classes: phones, phone, , primary. you can select element using of these classes. example: div.phones div.phones.phone div.phone.primary div.primary div.phones.phone.primary however following not work: div .phones div .phones.phone div .phone.primary div .primary div .phones.phone.prima...

.net - Sitefinity warmup module not starting after schedule app pool restart -

i've enabled sitefinity warmup module start when iis app pool recycles. when manually recycle app pool warmup module starts , warms pages properly. when app pool restarts @ it's scheduled 3am time, warmup module not run. anyone run this? suggestions? application initialization - iis 8.5 built-in, can either configure forcing individual applications reinitialize after application pool recycle/server restart, or configure applications reinitialize after soft reset (edits in web.config, etc). in order set application warm-up after recycle, need edit %windir%\system32\inetsrv\config\applicationhost.config file , locate block. edit settings of application you’d automatically initialize after restart this: <add name="myapplicationpoolname" autostart="true" startmode="alwaysrunning" managedruntimeversion="v4.0"> next, under block, configure serverautostart property of website this: <site name="mysitename...

vbscript - VB script. Need to run below code in UFT tool -

i have below code , outer array not comparing each value inner array. outer array comparing 1 value inside , moving next value in it. testdata = {25,27,81,104,33,34,56,78,99,84} testdata1 = {81,104} = 0 ubound(testdata) - 1 j = 0 ubound(testdata1) - 1 if testdata(i) = testdata1(j) isfound = true call db_connectionwisdataflagupdation(squery,para2,para3,para4,svalue) 'c=c+1 exit end if 'isfound = true isfound = false next next please me solution on this. i made couple minor changes code, adjusting indices on loops: dim integer dim j integer dim isfound boolean = lbound(testdata) ubound(testdata) j = lbound(testdata1) ubound(testdata1) if testdata(i) = testdata1(j) isfound = true 'call db_connectionwisdataflagupdation(squery, para2, para3, para4, svalue) msgbox testdata(i) exit end if isfound = false next ...

javascript - Accordion inside Bootstrap navbar dropdown -

please refer: apec energy in right corner, there user icon. on clicking it, can see accordion in dropdown menu. how can achieved? i have put jsfiddle basic code. removed trials of accordion because whatever tried breaks code. my code navbar: <!-- navigation --> <div id="gxcpl" class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <a class="navbar-brand hidden-lg hidden-md" href="#">living ahimsa</a> <a class="hidden-sm hidden-xs" href="#"> <img class="gxcpl-logo" src="assets/images/logo.png" /> </a> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-menubuilder"> <span class...

postgresql - What is the best way to sync Postgres and ElasticSearch? -

i have choice sync es latest changes on postgres db 1- postgres listen / notify : i should create trigger -> use pg_notify -> , create listener in separated service. 2- async queries es : i can update elasticsearch asynchronously after change on db. ie: model.save().then(() => {model.savees() }).catch() which 1 scale best ? ps: tried zombodb in production doesn’t goes well, slows down production.

excel - VBA - Find cell that contains " " then populate cell after QueryTable loads -

so have issue, created loop find sheet says "standard deviation" , pull data 3 cells right of it. issue supposed pull data after query table loads. code won't work because runs before querytable loads. sub stdb5() dim url string dim ws worksheet dim qt querytable dim mep worksheet dim symbol string set mep = worksheets("managed equity portfolios") set ws = worksheets("hidden sheet 3") sheets("hidden sheet 3").cells.clearcontents sheets("hidden sheet 3").visible = true symbol = symbol & mep.range("b5").value url = "https://www.google.com/finance?q=mutf:" + symbol set qt = ws.querytables.add( _ connection:="url;" & url, _ destination:=ws.range("a1")) qt.refresh dim stdrange range dim cel range dim stdcell range 'std on mep set stdcell = mep.cells.range("h5") 'std on mep set stdrange = ws.range("a45:a50") each cel in stdrange if cel.valu...

android - Using a Service to create a timer that runs even if the app is minimized? -

i seem have hard time getting straight answer on i'll make more pointed question. i want create timer start/stop/pause/resettable. if timer active, should continue active if go somewhere else in app or minimize app. if app destroyed / shut down / closed altogether timer can shut down. i looked alarmmanager doesn't seem work right on devices. service viable alternative / need do? use perform counting? sleep command in loop sends update command broadcastreceiver? how send notification user when timer hits 0? if app destroyed / shut down / closed altogether timer can shut down. you seem think somehow different "go somewhere else in app or minimize app". not. either process running, or not, , process can terminated @ point in time when ui not in foreground. foreground service , tied notification , typical pattern keeping process around long possible, not absolute guarantee. are implying on devices, no matter (service, timer, intentservice, al...

javascript - Service worker offline support with pushstate and client side routing -

i'm using service worker introduce offline functionality single page web app. it's pretty straightforward - use network when available, or try , fetch cache if not: service-worker.js: self.addeventlistener("fetch", event => { if(event.request.method !== "get") { return; } event.respondwith( fetch(event.request) .then(networkresponse => { var responseclone = networkresponse.clone(); if (networkresponse.status == 200) { caches.open("mycache").then(cache => cache.put(event.request, responseclone)); } return networkresponse; }) .catch(_ => { return caches.match(event.request); }) ) }) so intercepts requests , caches them future use, including initial page load. switching "offline" in devtools , refreshing @ root of application works expected. however, app uses...

Laravel MySQL relationship not working -

Image
i finish programing website , when php artisan migrate:refresh --seed on local mysql database worked perfectly, i'm on real database it's not working @ relationship. can see problem on sequel pro interface this: and here working fine on mi local db i'm hosting db on bluehost don't know if have problem or if problem db user , not laravel here example of looks when create table:

vba - Issue using Cells().formula -

i'm attempting input formula column in table. formula uses table headers solve result. location used in cells() command uses variable seen below: sheet6.cells(17, k + 7).formula = "=[@[net weight]]/([length] * $j$10 * $j$10)" range(cells(17, k + 7).address()).select your code works me, if make sure cell in table or next it. if put in random cell results in same error get.

reactjs - onDblClick in react-konva not working -

i'm using react-konva render canvas. assign ondblclick group, assign onclick, ondragend group. in ondragend handler, have axios post request server. whenever double click group, ondragend event fired. know problem here ? here code handlemoving(){ var thiselement = this.refs[this.state.key]; this.setstate({ x: thiselement.x(), y: thiselement.y(), width: thiselement.getwidth(), height: thiselement.getheight() }); this.focus(); } handledoubleclick(){ console.log('dbclick'); this.focus(); const stage = this.refs[this.state.key+'_wrapper'].getparent().getparent().getparent(); const pos = this.refs[this.state.key].getabsoluteposition(); document.getelementbyid('newtext').addeventlistener('keydown',this.handletextchange); document.getelementbyid('newtextwrapper').style.position = "absolute"; document.getelementbyid('newtextwrapper').style.left =...

Using sqlite and dplyr for fuzzy matching in R -

i working extremely large dataset of names , using rsqlite run in r. have taken original file (14 million rows) , grouped identical names using "group by" dplyr. i'm making sure separate columns count number of times values have been grouped , mean scores are. single file, not matching against master file. works well, reduces file down 5 million rows based on identical string matching. is there way group names through fuzzy match, while keeping count , mean variables? here code i'm using: employees <- company %>% select(name, score) head(employees) employeescores <- employees %>% group_by(name) %>% summarize(count = n(), score = mean(score)) write.csv(employeescores, file = "employeescores.csv", row.names=false)

mysql - MySQLi + PHP sort by date and ID in descending order -

i'm looking mysql query sort items date in descending order. if finds 2 or more rows same date, sort them id in descending order. this current code: $sql = "select $rows $table order date desc"; it displays items in descending order date if there 2 items same date, displays them in ascending order id instead of descending. example: let's assume set of data: id - date - text 1 - 2017-01-01 - oldest 2 - 2017-01-02 - 2 3 - 2017-01-03 - morning 4 - 2017-01-03 - afternoon 5 - 2017-01-04 - latest the current code list as: id - date - text 5 - 2017-01-04 - latest 3 - 2017-01-03 - morning 4 - 2017-01-03 - afternoon 2 - 2017-01-02 - 2 1 - 2017-01-01 - oldest i want list this: id - date - text 5 - 2017-01-04 - latest 4 - 2017-01-03 - afternoon 3 - 2017-01-03 - morning 2 - 2017-01-02 - 2 1 - 2017-01-01 - oldest i don't want sort id because want add events happened in past , require me manually edit id of events after...

Can I use Laravel without CLI? -

i have shared hosting i'd develop couple of projects learn better laravel. started few days ago go deeper mvc pattern , installed laravel 5.4 on domain of shared hosting provides installer. since it's php, guess answer question should be: "yes, can stuff manually instead of having automatically done artisans commands"; i'd know if it's true or if stuck @ point of project. today, example, wanted learn laravel's authentication , saw laravel's default user migration file. said, don't have ssh access on hosting , can't use artisans commands wanted create table manually doubt was: real parameters of each columns? problem particularly regarded remembertoken() function. after research found function in blueprint $this->string('remember_token', 100)->nullable(); , suppose it's varchar(100) . to sum up, can approach work small project or having gun @ head ready shot when less expect it? this question comes newbie in lav...

email - Mandrill Online Template Editor -

i designers able edit mandrill email templates without programmer help. interactive editor best. according https://mandrill.zendesk.com/hc/en-us/articles/205582507-getting-started-with-templates there special mandrill template editor page. page still exist?

Creating an Image Button that Creates a Sound HTML -

hi trying make image button ( of speaker ) play audio file me. <p><br></p> <table> <tbody><tr> <th> quick clicks </th> <td style="text-align: center;"> <a href="#3" onclick=""><img src="https://zingtree-uploads.s3.amazonaws.com/images/59777e50293d71.47898028-416750-speaker.png" style="width: 145px; height: 145px;"></a> </td> <td style="text-align: center;"> <a href="#3" onclick="do_button_click(14, 7, 'quick clicks',0);"><img src="https://zingtree-uploads.s3.amazonaws.com/images/59777e50293d71.47898028-486417-quick+clicks.png" style="width: 145px; height: 145px;" ></a> </td> </tr> </tbody></table> those 2 pictures i'd use , i'd make first button play audio file: <a class="btn btn-lg btn-zingtree btn-block btn-primary" onclic...

swing - Java Swingx AutoCompleteDecorator does not work on JTextField -

i using java swingx library can implement auto complete feature on text box. list populate arraylist of elements have retrieved database. no errors not work when use following code: autocompletedecorator.decorate(employeenametextfield, databaseconnection.getemployeelist(), false); when use following code jlist locks me out typing in textbox. not grey out won't let me type during runtime. jlist = new jlist(databaseconnection.getemployeelist().toarray()); autocompletedecorator.decorate(jlist, employeenametextfield); i tried decorate method takes 3 parameters, , use default object string converter suggested in post no avail. know doing wrong or have suggestions? thanks, zach

jquery - Bootstrap carousel next and previous logo doesent show up -

Image
i'm trying use carousel next , previous logos doesent show up. <!--slide start --> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- indicators --> <ol class="carousel-indicators"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> <li data-target="#carousel-example-generic" data-slide-to="2"></li> <li data-target="#carousel-example-generic" data-slide-to="3"></li> </ol> <!-- wrapper slides --> <div class="carousel-inner" role="listbox"> <div class="item active"> <img src="img/sampleslide.png" alt="açıklama"> <div...

Xcode's Instruments crashes when recording starts with Xcode 8.2.1 -

whenever hit 'record' on instruments tool, crashes error: "nsinternalinconsistencyexception reason: fatal, partial event large (4198344)" happens when testing phone (iphone 5s, ios 10.3.2(14f89)), running instruments simulator works fine. did have copy on 10.3.2 files xcode beta 'devicesupport' folder. ultimate root source, , there way around if is?

javascript - setInterval just won't work -

setinterval won't work, code: <script> var d = new date(); var utc_offset = d.gettimezoneoffset(); d.setminutes(d.getminutes() + utc_offset); var h = d.gethours(); var m = d.getminutes(); var s = d.getseconds(); function clockupdater() { if(h >= 0 || h <= 5){ hl = h - 18; }else if(h >= 6 || h <= 11 ){ hl = h - 12; }else if(h >= 12 || h <= 17){ hl = h - 6; }else if(h >= 18){ hl = h - 0; } /* hl = hl - 1; if(m>1){ ml = 60 - m -1; } */ ml = 60 - m; sl = 60 - s; document.getelementbyid("timer").innerhtml = hl+":"+ml+":"+sl; } setinterval(clockupdater, 1000); </script> <body> <div id="timer"></div> </body> i'm building timer has count down every 6 hours, setinterval won't work , not working intended, can see went wrong? the problem here bu...

database connection - Error:(73, 5) error: illegal start of expression -

anyone can me? i'm amateur in android programming. that's code: package com.example.aleta.dbapp; /** * created aleta on 24/07/2017. */ import java.sql.connection; import java.sql.drivermanager; import java.sql.preparedstatement; import java.sql.resultset; import java.sql.sqlexception; import java.util.arraylist; import android.annotation.suppresslint; import android.os.bundle; import android.os.strictmode; import android.support.v7.app.actionbaractivity; import android.util.log; import android.view.view; import android.widget.adapterview; import android.widget.adapterview.onitemselectedlistener; import android.widget.arrayadapter; import android.widget.spinner; import android.widget.toast; public class forspinner{ connection connect; preparedstatement stmt; resultset rs; string srvr,dbn; @override protected void oncreate(bundle saveinstancestate){ super.oncreate(saveinstancestate); setcontentview(r.layout.spinners)...

css transition from a tutorial not working even with -webkit- and -moz- prefixes -

this may have obvious answer, i'm not seeing it. updated code correct having wrong top value article section h1 . added :hover trigger article section h1 . otherwise, same code took webdesigner magazine demonstrate animated title effect, nothing happening in either ff or chrome. added -webkit- , -moz- prefixes transition style, still, nothing. please tell me i'm doing wrong. body,html { display:block; width: 100%; height: 100%; background: white; color:black; padding: 0; margin: 0; font-family: helvetica, sans-serif; } nav { position:fixed; top: 0; width: 100%; z-index: 9999; background: white; } article { position: relative; padding-top: 5em; } article section { position: absolute; opacity: 0; width: 100%; } article section:target { left: 0; opacity: 1; z-index: 9999; } article section h1 { position: absolute; top: 0em; left: 0; font-size: 4em; width: 100%; color:black; } article section h1:h...

Doubts in python code how to use set method -

i excepting elements print prints hffdfd , fjdkl . why happens. here's code: print (set({'hffdfd' : 'shfs', 'fjdkl' : 616})) because if iterate on dictionary , only obtain keys . next put these keys set print. you can use following set comprehension print both keys , values: d = {'hffdfd' : 'shfs', 'fjdkl' : 616} print(set(y x in d.items() y in x)) now construct set contains both keys , values. if wish print dictionary itself, can use: print ({'hffdfd' : 'shfs', 'fjdkl' : 616})

oop - Required attributes in Smalltalk -

i writing classes in pharo smalltalk, assume question valid other smalltalk implementations. i know way enforce instances specific attributes provide class method instance creation, , suggesting use class creation method. user know new or basicnew can used anytime. i thought invalidating new , basicnew raising exception, seems drastic measure, giving require create instances debug example. is there library or mechanism enforce specific attributes completed? there not. , good. here approaches might follow though: make sure objects valid providing validations them. broad topic validation framework 1 able examine objects , somehow make explicit rules fail honor. depending on doing, might restrict validations gui, when objects born or modified. more sophisticated approach, however, should allow object decide whether valid or not (in given context). exclude individual setters instance-side protocol. provide multiple keyword setters fail if missing or inappropriate...

r - Create a binary adjacency matrix from a vector of indices -

suppose have vector looks this: x <- sample(5, 500, replace = true) so each element corresponds index 1 through 5. what's efficient way create binary adjacency matrix vector? elaborate, matrix a should such a[i,j] = 1 if x[i] = x[j] , 0 otherwise. in 1 line, do outer(x, x, function(x, y) as.integer(x==y)) which returns [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 0 0 0 0 0 1 0 0 0 [2,] 0 1 1 1 0 1 0 0 1 0 [3,] 0 1 1 1 0 1 0 0 1 0 [4,] 0 1 1 1 0 1 0 0 1 0 [5,] 0 0 0 0 1 0 0 0 0 0 [6,] 0 1 1 1 0 1 0 0 1 0 [7,] 1 0 0 0 0 0 1 0 0 0 [8,] 0 0 0 0 0 0 0 1 0 0 [9,] 0 1 1 1 0 1 0 0 1 0 [10,] 0 0 0 0 0 0 0 0 0 1 or, in 2 lines ...

embedded linux - Nandtesting source code:fail safe testing flash -

where can find source code nandtester in linux ubuntu 14.04 os? how should build code ? there packages installed before doing it? how can cross compile amd64 mips if given toolchain? how fail safe testing flash after building code toolchain?should write separate cpp code it?

ios - Save PDF file to CloudKit -

i've been digging around trying find way save , fetch pdf file cloudkit. what approach? should save bytes or asset ? after saving able fetch , present user in save form saved, file.pdf ? i haven't seen trying save in format cloudkit. i save images ckasset , should take same approach? i have following check: if attachmenturl.count > 0 { var attachments: [ckasset] = [] attachmenturl.foreach { (url) in print("url fetch\n") { let data = try data(contentsof: url) guard let asset = createasset(from: data) else { return } attachments.append(asset) } catch { print("error occured:", error) return } } post["attachments"] = attachments ckrecordvalue } the post["attachments"] of type asset list , array of ckasset the createasset(:) function following: file...

no hex response from server in python -

#!/usr/bin/env python import socket import struct import time import binascii host = '127.0.0.1' # local machine name port = 5000 # reserve port service. print 'connecting ', host, port s = socket.socket(socket.af_inet, socket.sock_stream) s.connect((host, port)) message = 'ea68df0102a100df0360433a5c554c205465737420546f6f6c735c42545420352e322e315c4170706c69636174696f6e5c5375697465735c496d616765735c566973615c436f6e746163745c414456542076362e312e315c54657374436172643031202d20412e786d6c' s.sendall(message) data = binascii.hexlify(message).decode() print "sent message:", data data = s.recv(4096) data = binascii.hexlify(data).decode() print "received message:", data s.close() 'received message' should in hex form blank as: received message:

Oracle : Procedure throws Invalid Datatype Error during execution ORA-00902: invalid datatype -

create table t1 (emp_name varchar2 (40)); insert t1 values ('vinoth'); commit; create table t2 (emp_name varchar2 (40)); create or replace package test_pkg_v procedure p_main (p_status out varchar2); type t1_type record (emp_name t1.emp_name%type); type t1_tbl table of t1_type; end test_pkg_v; / create or replace package body test_pkg_v procedure p_main (p_status out varchar2) lv_t1_tbl t1_tbl := t1_tbl (); cursor t1_cur (select emp_name t1); begin open t1_cur; loop fetch t1_cur bulk collect lv_t1_tbl limit 10000; insert t2 (emp_name) select emp_name table (lv_t1_tbl); exit when t1_cur%notfound; end loop; commit; exception when others p_status := 'fail'; ...

cocoa - How do I reliably get windowDidBecomeMain and windowDidResignMain events? -

i have view controller in want receive windowdidbecomemain , windowdidresignmain events. in viewwillapear() set window delegate self. view.window?.delegate = self i have added extension view controller conforms nswindowdelegate , have implemented both methods in thus: extension customerlistviewcontroller: nswindowdelegate { func windowdidbecomemain(_ notification: notification) { print("customer list did become main") } func windowdidresignmain(_ notification: notification) { print("customer list did resign main") } } this not initial window. opened via menu item window controller show segue. when window first opened via menu item, not receive windowdidbecomemain. when click window does receive windowdidresignmain. if click newly opened window receive windowdidbecomemain , point on. i suspect need set window delegate @ different point don't have clue so, if is case.

Show and hide an element with dynamic IDs on jQuery -

i have several checkboxes on wordpress page id of following format id = 'more-talktime-{{post.id}} post.id set dynamically. then have div element id of id = 'talktime-options-{{post.id}}' what try when clicking on checkbox, show/hide related div element. tried this: jquery( function ( $ ) { jquery(document).ready(function(){ jquery('[id^=more-talktime-]').change(function(){ var id = this.id.split('-').pop(); if(this.checked) jquery('#talktime-options-' + id).fadein('slow'); else jquery('#talktime-options-' + id).fadeout('slow'); }); }); }); i confirmed var id right one. show/hide doesn't work , don't have error on console. the div element has display: none default. edit add html code too: <div class="col-md-6 add-on-service"> <h3>more talktime</h3> <i...

.net - Existing method/snippet to track files created by Console Application in c# -

i unable find information on (thus no snippet). want console application or maybe background task log activity done file. if renames it, changes directories, makes copy of it, etc. able log data , aggregate it. if point me in right direction, hint or provide snippet appreciate it check out filesystemwatcher class. here's example: https://www.codeproject.com/articles/26528/c-application-to-watch-a-file-or-directory-using-f

c# - Why Can't generics Actions written in code need explicit parameter declaration -

for reason have feeling jon skeet know answer it's worth shot. i have method stub used proxy generate commands. public static void setcommand<t>(string commandname, action<t> execution) t : new() { //omitted unimportant } i have function calling code, behavior differs depending on how it's called. if call code explictly declaring action of parameter can resolve fine action<classdeclarationoptions> test = (t) => { }; setcommand(generate_class_command, test); however if declare function represent action public static void generateclass(classdeclarationoptions classoptions) { } then need explictly declare parameter when passing function so: setcommand<classdeclarationoptions>(generate_class_command, commands.generateclass); can explain why compiler cannot resolve generic parameter method definition let's there's overload on commands.generateclass takes different parameter type, example: public stat...

javascript - 403 Forbidden error when trying to add song to another collaborative playlist with Spotify Web Api -

here code using add songs button made. button works fine, able add songs own playlists. when trying add songs else's collaborative playlist, 403 forbidden error. i have followed playlists trying add songs .i have been able add songs playlist desktop app not working on web page. don't know if error in code or if api doesn't allow collaborative playlists have songs added them. scopes project playlist-read-private,playlist-modify-private,playlist-read-collaborative user-library-modify,user-read-private user-read-email . don't think issue either. document.getelementbyid('button1').addeventlistener('click', function() { var myid=localstorage.getitem('spotid') var playid=localstorage.getitem('uri') var trackuris = document.getelementbyid("selections").value; console.log(trackuris) var uris=[trackuris]; //create array trackuri stored within //adding track playlist using myid, playid, , uris fil...

android - Can't find uses-permission into manifest file -

i'm trying upload new version of application google developer console. at end of upload, console show error message: "your apk uses permissions require setting of privacy policies: (android.permission.camera)" so think have uses-permission manifest file , need add google privacy policy. that's ok, manifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="simone.biliato.delonghitrevisotvb"> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsrtl="true" android:theme="@style/apptheme"> <activity android:name="simone.biliato.delonghitrevisotvb.mainactivity" android:label="@string/app_name" android:theme="@style/apptheme.noactionbar...

html - auto play audio in sync with bounce animation -

i have logo on website text jumps left right (once) 1 second after page loads. add audio (without controls) play sound-file have created (we'll call sound.mp3) @ designated intervals time jumping text. what steps should take achieve this? thanks - miles

yaml - How to escape a $ sign in an Ansible host_vars file -

i have ansible playbook (yaml) deploys web application and, part of deployment process, creates , initializes various databases , data in tables. playbook task: - name: insert meter managers mdm_connection shell : "psql -d {{ mdm_config_db }} -c \"insert mdm_connection (mdm_connection_type_id, name, db_type, host, port, catalog, username, password) values (3, '{{ item.name }}', '{{ item.db_type }}', '{{ item.host }}', {{ item.port }}, '{{ item.catalog }}', '{{ item.username }}', '{{ item.password }}');\"" with_items: "{{ meter_managers }}" when: item != "" sudo_user: postgres tags: - initdb host_vars: meter_managers: - name: sample db_type: "" host: "http://www.example.com/axis2/services/example/" port: -1 catalog: "" username: csa1 password: "example$example" you can ignore of parameters abov...

Operation on lists as elements of dataframe in R -

i have time series id, , list of dates @ event occurred. want know how many times event has happened given date within time series. here sample dataframe: id <- c(1,1,1,2,2,2,3,3,3) date <- c(2000,2001,2002) df <- data.frame(id,date) rand1 <- c(runif(5)*4+1999) rand2 <- c(runif(6)*4+1999) rand3 <- c(runif(100)*4+1999) df$events <- list(rand1, rand1, rand1, rand2, rand2, rand2,rand3, rand3, rand3 ) this code solve problem correctly: for (i in c(1:9)){ print(i) df[i,]$past <- sum( df[i,]$events[[1]] < df[i,]$date) } but seems wildly inefficient go line line through dataframe. real dataset has 4 million rows, need little more sensible. here tried first: i'm not sure it's doing, ends creating elements of df$past2 integer. df$past2 <- sum(df$events[[1]] < df$date) resulting df: id date events past past2 <dbl> <dbl> <list> <dbl> <int> 1 2000 <dbl [5]> 3 6 1 ...

Python double-asterisk ** power operator behaving unexpectedly -

i've written function replace scipy.interp1d approximating relationship between 2 variables (elev , maxq) in order speed code. equation fourth order polynomial. function able compute q values single inputs , 1d array inputs. function shown below. def calculatemaxflow(elev): size=np.shape(elev) if size==(): if (elev>367.8): #minimum elev flow return -0.00028194553726719*elev**4+0.284027992763652*elev**3-80.3765236558431*elev**2+1900880.72298153 else: return 0 else: maxq=np.zeros(np.shape(elev)[0]) in range(np.shape(elev)[0]): if (elev[i]>367.8): #4th order polynomial. not exact okay speeding code maxq[i]= -0.00028194553726719*((elev[i])**4)+0.284027992763652*((elev[i])**3)-80.3765236558431*((elev[i])**2)+1900880.72298153 else: maxq[i]= 0 return maxq elev1=380 elev5a=380+np.zeros(5) elev5b=np.asarray([380,380,380,380,380]) q1=...