Posts

Showing posts from April, 2014

ruby on rails - YAML File has a syntax error, but it looks like it has the same format as another one that is working? -

i have 2 yaml files similar formats, 1 running , other not running when run integration tests on rails app. here first yaml file doesn't work: prince_edward_island: name: 'prince edward island' country: 'canada' nova_scotia: name: 'nova scotia' country: 'canada' newfoundland: name: 'newfoundland' country: 'canada' new_brunswick: name: 'new brunswick' country: 'canada' quebec: name: 'quebec' country: 'canada' manitoba: name: 'manitoba' country: 'canada' alberta: name: 'alberta' country: 'canada' ontario: name: 'ontario' country: 'canada' british_columbia: 'canada' name: 'british columbia' country: 'canada' saskatchewan: 'canada' name: 'saskatchewan' country: 'canada' here second yaml file work: student_advisor_message: body: 'this mes...

android - How to resolve problems with different screen sizes? -

i've designed interface when presented on device. i found difference in size of device , size during presentation emulator. what sizes suitable devices? see difference between 2 images: screenshot 1 , screenshot 2 . package com.examp.swap_items; import java.util.arraylist; import java.util.list; import android.r.layout; import android.app.activity; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.widget.button; import android.widget.horizontalscrollview; import android.widget.tablelayout; import android.widget.tablerow; import android.widget.textview; import android.app.activity; import android.graphics.color; import android.os.bundle; import android.view.contextthemewrapper; import android.view.gravity; import android.widget.tablelayout; import android.widget.tablerow; import android.widget.tablerow.layoutparams; import android.widget.textview; import android.app.a...

css - Angular UI grid - unable to mask pagination controls -

Image
i using angular-bootstrap ui grid. want create spinner , mask grid when data loading. have used http://plnkr.co/edit/eq1ot49njegq6wts389k?p=preview create spinner. problem when use pagination mask used not mask pagination controls. please refer snapshot. how can achieve mask on pagination controls? i have added following controls app.js file vm.gridoptions.paginationpagesizes= [5,10,15]; vm.gridoptions.paginationpagesize= 5; you can hide pagination controls setting enablepaginationcontrols = false when data loading or there no data. can achieved setting watch on vm.loading , whenever changes, change gridoptions settings. see plunkr example by way, angular ui grid not part of bootstrap framework, it's part of angularui suite .

user interface - Liferay 6.1 <liferay-ui:input-repeat> tag -

Image
does knows tags used for? liferay documentation lacks of informations. hi tag used in scheduling view having repeat interval of scheduler used in input-scheduler tag used in setting publishing date staged site

Android AlertDialog button positioning -

i have requirement create alertdialog , split vertically 2 zones: one of these zones (on right side) should have dialog buttons (ok, cancel , set) @ bottom , layout on top of these buttons. left side of dialog should have layout, say, image. the question is, possible have or alertdialogs have have buttons @ bottom? don't know start. i've tried looking @ alertdialog class, see suitable. it looks don't need alertdialog this, yes can alertdialog . create view , use alertdialog.builder without calling setpositivebutton() , setnegativebutton() etc.. alertdialog alertdialog = new alertdialog.builder(context) .setview(yourcontentview) .create();

perl - Print data after dumper -

i have structure data-dumper: $var1 = { 'field' => [ { 'content' => { 'en' => [ 'footware haberdashery leather goods' ], 'de' => [ 'schuhe kurzwaren und lederartikel' ], 'it' => [ 'calzature mercerie e pelletterie' ] }, 'type' => 'tag', 'valore' => 'tag3' }, { 'content' => { 'en' => [ ...

php - Assigning autonumber to HTML form entry -

i have searched everywhere, nothing find seems solve this. have html web form (in php document) writes data csv file, , below form table filters csv data in based on key word. have no problems existing code part. however, need have auto-number function assigns number each form. need on start. i'm still relatively new coding, great. edit : here code use write data csv file. if($_post['formsubmit'] == "submit") { $fs = fopen("fixturerequests.csv","a"); fwrite($fs,$varfixnum . ", " . $varrequester . ", " . $vardept . ", " . $varsupervisor . ", " . $vardesc . ", " . $varparts . ", " . $varwc . ", " . $varaddinfo . ", " . $vardatereq . ", " . $vardateneed . ", " .$varstatus . "\n"); fclose($fs); header("location: successfullysubmitted.php"); exit; } any guidance excellent. thank you. you can u...

Lotus Notes: Create a text file -

i trying create text file in lotus notes running through agents. agent ran text file not created in path specified in lotus script. this lotus script code: option public sub initialize msgbox " agent accessuserlist" on error goto handleerror dim session new notessession dim mystream notesstream dim thedate string, filename string thedate=format(now(),"mmdd") filename = "c:"+"\red"+"\color"+thedate+".txt" msgbox filename set mystream = session.createstream() msgbox "mystream2" call mystream.open(filename, "ascii") msgbox "mystream3" call mystream.truncate() msgbox "entered view" closefile: call mystream.close() msgbox "closed" exit sub handleerror: msgbox "error - " & error &" @ line number " & erl exit sub end sub i have scheduled 5 min che...

php - Dynamically add plotband in highchart -

i new in highchart, want add dynamically plotband , want send plotedband json php , access in jquery method, accessing xaxis , yaxis data php **jquery code** $(function () { var plotband =''; var options = { chart: { renderto: 'containerline', type: 'line', plotshadow: false, //marginright: 130, marginbottom: 55 }, title: { text: 'portfolio uw vs current capex', x: -20 //center }, subtitle: { text: '', x: -20 }, xaxis: { categories: [], plotbands: plotband, labels: { rotation: 270 }, }, yaxis: { // title: { // text: 'amount' // },...

Migrate EchoNest API analyzer to Spotify -

i use use echonest analyzer upload tracks , audio characteristics out of them. i did sending curl request. i realise api has mitigated spotify , wonder if can still upload tracks analyze, instead of analyzing tracks given spotify id. i used use method: $post = array( "url"=>$title, "api_key"=>"myapi", "format"=>"json" ); $ch = curl_init(); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_url, "http://developer.echonest.com/api/v4/track/upload"); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, $post); $response = curl_exec($ch); $result=json_decode($response,true); $status=$result['response']['track']['status']; is there similar way spotify? thanks. i can use offline feature analyzer, have used echonest analyzer training original model here . spotify no longer have u...

scala - Returning to "sender" from a future inside an actor -

this question has answer here: sender inside future 2 answers i want - class myactor extends actor { .... override def receive = { case msg => .... // future { ... // calculate response sender ! response } } } // in other code - val future = myactorref ? msg future.onsuccess { .... } would work? in other words, akka's "ask" implementation care if response sent before "receive" method finishes or not? yes work, , there built-in akka pattern - pipe : import akka.pattern.pipe override def receive = { case msg => .... // future { ... // calculate response response } pipeto sender() } there are, caveats in code should note: sender function, therefore, when code inside future{...} block executes, actor may handling message sender, may reply wrong sender. avoid ...

model view controller - MVC - Make all URLs with a trailing slash 301 to URL without a slash? -

is there way redirect urls end in trailing slash url without? in application_beginrequest method in global.asax , add following: if (httpcontext.current.request.url.absolutepath != "/" && httpcontext.current.request.url.absolutepath.endswith("/")) { string redirect = httpcontext.current.request.url.absolutepath; redirect = redirect.remove(redirect.length - 1); response.clear(); response.status = "301 moved permanently"; response.addheader("location", redirect); response.end(); }

C# Joins/Where with Linq and Lambda how to return a List<T> -

the query below works fine , returns 1 list<> expected list<purchaseorderheaderentity> details = (from p in db.purchaseorderdetailentity join r in db.purchaseorderheaderentity on p.purchaseorderid equals r.purchaseorderid p.productid == productid select r).tolist(); if rewrite using lambda, returns 2 lists: list<purchaseorderheaderentity> lambda_details = db.purchaseorderdetailentity.join(db.purchaseorderheaderentity, p => p.purchaseorderid, r => r.purchaseorderid, (p, r) => new { detail = p, header = r }).where(detailandheader => detailandheader.detail.productid == productid).tolist(); if remove " detail=p " selection part, join throws error "the type arguments method ... cannot inferred usage. try specifying type arguments explicitly." is there way rewrite query make return 1 list header? thanks lot in advance! you can put condition befo...

python - Spyder Matplotlib RuntimeError: dvipng was not able to process the following file -

this following problem seems occur on spyder ide, not occur when run script command line. trying make simple plot using pyplot python 2.7.12 |anaconda custom (64-bit)|: import matplotlib.pyplot plt plt.plot(x,y) i got following message: sh: 1: dvipng: not found traceback (most recent call last): file "/home/ohm/anaconda2/lib/python2.7/site-packages/matplotlib/backends/backend_qt5agg.py", line 176, in __draw_idle_agg figurecanvasagg.draw(self) file "/home/ohm/anaconda2/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 474, in draw self.figure.draw(self.renderer) file "/home/ohm/anaconda2/lib/python2.7/site-packages/matplotlib/artist.py", line 61, in draw_wrapper draw(artist, renderer, *args, **kwargs) file "/home/ohm/anaconda2/lib/python2.7/site-packages/matplotlib/figure.py", line 1159, in draw func(*args) file "/home/ohm/anaconda2/lib/python2.7/site-packages/matplotlib/artist.py...

perl - Awk - Get rows from a file that contain values within ranges described in another file -

i have 2 tab-delimited files formatted similar this: file 1 a 100 90 pass b 89 80 pass c 79 70 pass d 69 60 fail f 59 0 fail file 2 randy 80 denis 44 earl 97 i want take values column 2 in file 2 , compare them ranges given between columns 2 , 3 of file 1. want create new file combines data, printing columns 1 , 2 file 2 , columns 1 , 4 file 1: file 3 randy 80 b pass denis 44 f fail earl 97 pass i want implement using awk or perl. you can use awk: awk 'begin{fs=ofs="\t"} fnr==nr { a[$0] = $2 next } { (i in a) if ($2>=a[i] && $3<=a[i]) print i, $1, $4 }' file2 file1 earl 97 pass randy 80 b pass denis 44 f fail

c++ - libvlc ffmpeg: No seek in mpegts h264 stream -

i using ffmpeg record video input gdi (windows screen recorder) view later using vlc (via activex plugin) + ffmpeg decode it. right seeking in video not working in vlc via plugin (which critical). vlc player provide seeking, more byte position seeking (on i- frames larger other frames makes larger steps on horizontal scroll , there no timestamps). encoder opened next defaults: avformat_alloc_output_context2(&outputcontext, null, "mpegts", "test.mpg"); outputformat = outputcontext->oformat; encoder = avcodec_find_encoder(av_codec_id_h264); outputstream = avformat_new_stream(outputcontext, encoder); outputstream->id = outputcontext->nb_streams - 1; encodercontext = outputstream->codec; encodercontext->bit_rate = bitrate; // 800000 default encodercontext->rc_max_rate = bitrate; encodercontext->width = imagewidth; // 1920 encodercontext->height = imageheight; // 1080 encodercontext->time_base.num = 1; encodercontext->time_...

How to expand macros in guile scheme? -

i'm trying write let on lambda defmacro/g! in guile scheme. have this: (use-modules (srfi srfi-1)) (define (flatten x) (let rec ((x x) (acc '())) (cond ((null? x) acc) ((not (pair? x)) (cons x acc)) (else (rec (car x) (rec (cdr x) acc)))))) (define (g!-symbol? s) (and (symbol? s) (let ((symbol-string (symbol->string s))) (and (> (string-length symbol-string) 2) (equal? (string-downcase (substring symbol-string 0 2)) "g!"))))) (define-macro (define-macro/g! name-args . body) (let ((syms (delete-duplicates (filter g!-symbol? (flatten body))))) `(define-macro ,name-args (let ,(map (lambda (s) `(,s (gensym ,(substring (symbol->string s) 2)))) syms) ,@body)))) but when try macro expand define-macro/g! using this: (use-modules (language tree-il)) ...

javascript - Templating in Electron? -

simple question here, found no useful resource. templating possible in electron? using jade or handlebars display dynamic templates? know there .loadurl() takes static html file. is dynamic possible? thanks. you give electron-pug chance. https://github.com/yan-foto/electron-pug

MySQL data backup? -

i have database tons of data in it. wrote new program change data in database. there way make copy of database before run program? or there other solution? what i'm thiking making copy of database, run program, modified main database. if things goes wrong, how use copied database data revert main database? please provide steps , commands on linux. i'm new database mysql , commands. read following link tell how dump database via different ways , restore it. http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/ basic command dump single database is: mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

mysql - How to show a list of all open database cursors? -

context we have (java, jpa:eclipselink) application connected mysql. there cases want fetch thousands of results, , perform action per-result. not want hold whole result set in-memory. jpa:eclipselink's queries "scrollable cursor" allow iterate lazily through result set, keeping 1 result in-memory @ time. it understanding these queries "scrollable cursor" implemented in mysql cursor . problem it consumer's responsibility "close" mysql cursor. we have trouble guaranteeing cursor gets closed. naturally close cursor when reach end of result set, there problems prevent iterating far that: exception thrown program exit intentional early-exit of iteration e.g. question "is non-zero amount of results returned?" anecdotes we have observed before that: leaving many cursors open, uses available connections in our database connection pool. once limit reached: subsequent queries fail because no further database connect...

Getting/Setting UWP Xaml WebView Zoom and Scroll Positions? -

in xaml uwp app, possible , set webview's zoom , scroll positions? yes it's possible. you can use webview.invokescriptasync method execute specified script function loaded html. for scrolling position, simple example this: private async void button_click(object sender, routedeventargs e) { string scrolltoposition = @"window.scrollto(0,200);"; await webview.invokescriptasync("eval", new string[] { scrolltoposition }); } for zoom function, it's different story, need have full control of web page. scenario, can refer sample how zoom in/out content in webview in universal windows apps .

javascript - How to loop through the children of a div nested three levels down -

i have structure looks this, $('#container').children().each(function() { var child = $(this).first(); child.children().each(function() { console.log($(this).text() + '\nthis should appear after each selectme.text()'); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id='container'> <div class='firstrows'> <div class='childoffirstrow'> <div class='selectme'> first set of data </div> <div class='selectme'> second set of data </div> <div class='selectme'> third set of data </div> <div class='selectme'> four...

sqlite - passportjs local-strategy cant get route -

been wrestling problem 2 days :) appreciate help. i'm trying build express authentication passportjs+sqlite+sequelize, 1)when put routes above app.use(passport.session()) login doesn't work 2) when put routes below passport.session app cant route app.js --- normal includes app.use(cookieparser()); app.use(session({ secret: 'ilovescotchscotchyscotchscotch', resave: true, saveuninitialized: true })); var passport = require('passport'); app.use(passport.initialize()); app.use(passport.session()); var router = require('./routes/index')(passport); app.use('/', router); var initpassport = require('./passp.js'); initpassport(passport); passport file // load things need var localstrategy = require('passport-local').strategy; // expose function our app using module.exports module.exports = function(passport) { var user = require('./dbcon.js'); passport.serializeuser(function(user, don...

c# - NFC Action_Tech_Discovered with foreground dispatch won't catch Mifare 1k card -

i'm coding in c# xamarin , trying scan mifare classic 1k card nfc. the intent-filter of m1card_test working fine. don't want select activity want start. i'm trying use foreground dispatch. here part of code (c#): oncreate intent myintent = new intent(this, gettype()); myintent.addflags(activityflags.singletop); mpendingintent = pendingintent.getactivity(this, 0, myintent, 0); ndefdetected = new intentfilter(nfcadapter.actiontechdiscovered); ndefdetected.adddatatype("*/*"); intentf = new intentfilter[] { ndefdetected }; techlists = new string[][] {new string[] { typeof(android.nfc.tech.nfca).fullname, typeof(android.nfc.tech.mifareclassic).fullname} }; onpause nfcmanager manager = (nfcmanager)getsystemservice(nfcservice); manager.defaultadapter.disableforegrounddispatch(this); onresume nfcmanager manager = (nfcmanager)getsystemservice(nfcservice); manager.defaultadapter.enableforegrounddispatch(this,mpendingintent,intentf,techlists); ...

c++ - std::chrono calculate the difference in different ratio -

my title may not helpful, have std::chrono::nanosecond, asked serialise , provide second, , nanosecond different values in json. so although struct holds: struct time { ... std::chrono::nanoseconds timepoint; }; when asked seconds, do uint32_t sec() const { return std::chrono::duration_cast<std::chrono::seconds>(timepoint_).count(); } yet when asked nanoseconds, want resolution in nanoseconds, without seconds (only least significant values?) however, casting in nanoseconds returns both seconds , higher resolution. uint64_t nanosec() const { return std::chrono::duration_cast<std::chrono::nanoseconds>(timepoint_).count(); } how can calculate actual increased resolution (e.g., nanoseconds without actual seconds)? you can retrieve seconds using std::duration_cast std::seconds , nanoseconds using modulo operator: template <typename t> std::pair<t, t> split (std::chrono::duration<t, std::nano> const& duration...

angularjs - How to use md-nav-bar correctly? -

Image
i'm using angular material md-nav-bar , have problems. 1) want add middle of page. 2) want know how add pages nav-items i have attached image show how looks is there possible way it? any highly appreciate. thanks, here go - codepen to centre md-nav-bar use layout to add md-nav-item use ng-repeat array , add array markup <div ng-controller="appctrl" ng-app="myapp" layout-fill layout="column" ng-cloak> <div layout="row" layout-align="center" flex="70"> <md-content class="md-padding"> <md-nav-bar md-selected-nav-item="currentnavitem" nav-bar-aria-label="navigation links"> <md-nav-item ng-repeat="item in navitems" md-nav-click="goto('{{item.value}}')" name="{{item.value}}">{{item.label}}</md-nav-item> </md-nav-bar> <span>{{currentnavitem}}</spa...

go - How to concatenate Service metadata for consul-template with commas -

does know how concatenate strings consul consul-template? if have service 'foo' registered in consul { "node": "node1", "address": "192.168.0.1", "port": 3333 }, { "node": "node2", "address": "192.168.0.2", "port": 4444 } i consul-template generate following line: servers=192.168.0.1:3333,192.168.0.2:4444/bogus the following attempt not work since leaves trailing comma , servers={{range service "foo"}}{{.address}}{{.port}},{{end}}/bogus # renders servers=192.168.0.1:3333,192.168.0.2:4444,/bogus # want servers=192.168.0.1:3333,192.168.0.2:4444/bogus i know consul-template uses golang template syntax, cannot figure out syntax working. should use consul-template's join how pass both .address , .port join ? trivial example, , i'm not using indexes intentionally since number of services more two. ideas? this should work. {...

Duplicate array elements in Ruby -

i have array rangers = ["red", "blue", "yellow", "pink", "black"] (it's debatable green should part of it, decided omitted it) i want double array elements returns rangers = ["red", "red", "blue", "blue", "yellow", "yellow", "pink", "pink", "black", "black"] in order. i tried around so, not find find way in order. ( rangers *= 2 won't work). i have tried rangers.map{|ar| ar * 2} #=> ["redred", "blueblue",...] i tried rangers << rangers #=> ["red", "blue", "yellow", "pink", "black", [...]] how can duplicate elements return duplicate element value right next it? also, if possible, duplicate n times, when n = 3 , returns ["red", "red", "red", "blue", "blue", "blue", ...] ...

android - make views inside Layout match custom shape of layout -

i have custom semicircle liner layout in want add colored views , these views not match custom shape(or stay within bounds of liner layout) when assigned custom shape views custom shape when assign match_parent views match parent i want views fill inside of liner layout while retaining shape of it, there way can done? you can't create custom shape view. views rectangular. if mean have custom background, doesn't make view group custom shape, or effect layout of views within group. if want that, need override onlayout (and possibly onmeasure) , layout individual children bounds expect them in. not surprised if ugly or non-functional results this- views weren't made circular.

python - If statement with composite condition to validate condition against each item in a list -

this question has answer here: specifics of list membership 3 answers i found similar question here answers don't seem apply issue. here code: y = 3 list1 = [1,2,3,4,5] if y != 0 or y != list1: print("y not in range") else: print(y) it keeps printing y not in range . my goal check if y not equal 0 or if y not equal item in list. i understand above or should and , i'm interested in how check in condition of y being contained in list. you want check y different 0 and not in list: if y != 0 , y not in list1: using or means one of conditions sufficient, since y != 0 returns true without going y != list1 return false because int not list , have use in in case. if want use or want: if not (y == 0 or y in list1): print('y not in range') else: print(y) rememer de morgan laws: no...

SQL Syntax Error In Java and MySql SELECT Query -

i developing basic program has 3 jframes. log-in, registration , dashboard opened after successful log-in attempt. however, getting error after typing in username , password , clicking log-in button. here's error: com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception: have error in sql syntax; check manual corresponds mariadb server version right syntax use near ' password='1234'' @ line 1 and here's code: import java.awt.borderlayout; import java.awt.eventqueue; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.border.emptyborder; import com.mysql.jdbc.statement; import javax.swing.jlabel; import javax.swing.joptionpane; import javax.swing.imageicon; import java.awt.font; import javax.swing.jtextfield; import javax.swing.jbutton; import java.awt.event.actionlistener; import java.sql.connection; import java.sql.drivermanager; import java.sql.resultset; import java.awt.event.actionevent; public class login extends jf...

Elegant and portable way to handle SNMP tables in Python -

i have been searching lot this, not found fits needs yet. want elegant way work snmp tables in python. have looked @ pysnmp , net-snmp python bindings. at moment working net-snmp bindings, seems more easy query data with, , available on centos6 software have run (python 2.6), not mind installing pysnmp either. what want kind of object can hand on important data of table structure, such table base oid, index oid , names , oids of columns interested in. data structure makes easy iterate on rows, fetch lists of entries of of columns etc, without having bother oids , stuff anymore, abstracting away. the purpose of want use little code possible query data snmp table , work it, have boiler plate code in module can fetch , work data of snmp table in few lines of code. what suggest me do? writing own abstraction based on pysnmp or netsnmp? there in pysnmp's high level api might have missed? maybe python module abstracts 1 of above mentioned make more easy access data? would g...

rxjs5 - How to skip too frequent mouse events in RxJS 5 (beta)? -

i'm using rxjs 5 (beta10) in project . of events originate mouse or touch drag, , ever need hear last one. i.e. how do lossy stream in rxjs5? running demos in tablets show "drag" happens when update of graphics takes longer event ignition browser (which not continuous, - browsers seem optimize on interval tell things changed). with lossy data stream i'd able make user experience keep finger. edit: this answer seems sum current state of rxjs5 backpressure pretty well. the rxjs5 audittime method seems fit bill. the problem rxjs 4 throttle gives first value of time window, , in dragging wanted last (skipping intermediate values, if rendering speed of device slow). audit , audittime provide this. what remains testing effect. modify svg graphics in event handler, , i'm not sure how long takes changes visible on screen. simple solution make audittime parameter adjustable user - on slow tablet might need more on desktop. ideally, find w...

xts - Choosing correct data type for dynrq in quantreg R package -

i'm trying run dynamic linear regression on data: require(rcurl) y <- read.csv(text=geturl("https://raw.githubusercontent.com/zmilhard/helloworld/master/growth_data_2.csv")) explore <- y[1:87,2:21] i use 3 different formulas try run regression: require(zoo) dlr <- dynrq(explore ~ l(explore,1) + l(explore,12), tau = 99/100) dlr <- dynrq(explore ~ l(explore,1) + l(explore,20), tau = 99/100) dlr <- dynrq(explore ~ l(explore,1) + l(explore,20), tau = 99/100, start = c(2,1), end = c(87,20)) i keep getting error: error in hastsp(x) : invalid time series parameters specified explore list. the example uses data of double type. when convert data double using this solution same error. need use time series variable such xts? formulas faulty?

html - CSS animation not working in Chrome, working in Safari -

my issue have simple twitter sprite sheet i'm using animate on hover. but, in chrome, while scoots left on hover, doesn't animate. #tw:hover #twitter-bird { margin-left:-100px; -webkit-animation: fly 0.2s steps(3) 0 3; -moz-animation: fly 0.2s steps(3) 0 3; animation: fly 0.2s steps(3) 0 3; } @-webkit-keyframes fly { { background-position: 0 0; } { background-position: -450px 0; } } @-moz-keyframes fly { { background-position: 0 0; } { background-position: -450px 0; } } @keyframes fly { { background-position: 0 0; } { background-position: -450px 0; } } i have seen few others posts this: css animation not working in chrome css animation not working in chrome css3 animation not working in chrome css animation not working on chrome and of advice seems "-webkit-" needed preface "animation: " in css chrome. i've done that. missing bird flap in chrome in safari , firefox? i'll use javascript or jquery if ...

javascript - How to change position on a selected table -

i'm trying make selectable table. before changing position in row, row has selectable. how can that? here have: angular.module("tablemoveupdown",[]).component("tablemoveupdown", { templateurl: "./js/componente/table-move-up-down/table-move-up-down.template.html", controller: function($scope){ $scope.items = [ { title: "alvaro" }, { title: "juan" }, { title: "pedro" }, { title: "david" }, { title: "walter" }, ]; var move = function (origin, destination) { var temp = $scope.items[destination]; $scope.items[destination] = $scope.items[origin]; $scope.items[origin] = temp; }; $scope.moveup = function(index){ move(index, index - 1); }; $scope.movedown = function(index){ move(index, index + 1); ...

Yii2. Restrict access to images folder -

i show example of achieve. , curious how implement in yii2 . there website http://www.hleda-se-phpkar.cz/ . if inspect top main image see: <img src="images/leader.png" alt=""> if write instantly address line: http://www.hleda-se-phpkar.cz/images/leader.png i see picture leader.png in browser . but if write: http://www.hleda-se-phpkar.cz/images i see: forbidden don't have permission access /images/ on server. so how restrict access folder images described above? for mentioned restriction type , apache server need create .htaccess file inside folder , add line options -indexes and hit enter. doesn't allow files listing still allows files access. no special action yii 2 necessary.

How to connect to a running bigtable emulator from java -

i trying use bigtable emulator gcloud beta emulators. launch emulator, grab hostname (localhost) , port (in instance 8885) gcloud beta emulators bigtable start executing: /usr/local/caskroom/google-cloud-sdk/latest/google-cloud-sdk/platform/bigtable-emulator/cbtemulator --host=localhost --port=8885 i trying connect emulator java test client, here provide: configuration conf = bigtableconfiguration.configure(projectid, instanceid); if(!strings.isnullorempty(host)){ conf.set(bigtableoptionsfactory.bigtable_host_key, host); conf.set(bigtableoptionsfactory.bigtable_port_key, integer.tostring(port)); } connection = bigtableconfiguration.connect(configuration); try (table table = connection.gettable("tname")){ table.put(<put instance>); } when execute test code get: 16:36:37.369 [bigtable-batch-pool-1] info com.google.cloud.bigtable.grpc.async.abstractretryingrpclistener - retrying failed call. failure #1, got: status{code=unavailable, de...

javascript - Focus on next field when pressing enter React.js -

i find way focus on next field when click enter in input using react.js @autobind handlekeypress(event){ if(event.key === 'enter'){ this.refs.email.focus(); } } @autobind handlekeypressemail(event){ if(event.key === 'enter'){ this.refs.zip_code.focus(); } } <input onkeypress={this.handlekeypress} ref = 'name' /> <input onkeypress={this.handlekeypressemail} ref = 'email' /> <input ref = 'zip_code' /> this best way have found far, don't want repeat myself creating function everytime want happen. there better , cleaner way implement this? you can use componentdidmount , auto bind refs through for-in loop. http://codepen.io/jzmmm/pen/pzzgrx?editors=0010 constructor() { super(); this._handlekeypress = this._handlekeypress.bind(this); } // loop through ref...

ios - If my UIView is set be opaque, why is it still being colored as "blended" by the simulator? -

i have uilabel @ initialization set opaque ( opaque = yes ), , if use "debug view hierarchy" button preview views @ runtime, can see indeed set opaque expect. however if turn on color blended layers in ios simulator, same view red, indicated blended, performance reasons don't want. why this? doing wrong? why still blended? a view not opaque (even if set opaque = yes ) compositing unless has opaque backgroundcolor .

Which is the best way to send Push Notifications in Android? -

currently using onesignal.com push notifications. there better service or better way send push notifications in android more features? you can use both gcm(google cloud messaging) , fcm (firebase cloud messaging). features of gcm deprecated google suggesting use fcm. fcm has killing feature of sending notification users have installed app or users have subscribed particular topic(you can check topics i.e. weather report india(who stays there),australia(who stays there). you can implement fcm in app easily. fcm can either use third party server or can send notification using own cloud service. just visit , register app coolest feature provided google- firebase cloud messaging . can check videos on youtube- google developer videos

parsing - PHP Make an Array from a Text Pattern (cfg file) -

so have couple of nagios cfg files, services,hosts,contacts,etc i want parse these cfg files php handle data. contactgroups.cfg define contactgroup { contactgroup_name vap3 alias vap3_pre members userz, userw } define contactgroup { contactgroup_name vap4 alias vap4_push members userx, usery } services.cfg define service { host_name hosta service_description hosta_hd contact_groups vap2,vap3 } define service { host_name hostb service_description hostb_hd contact_groups vap3,vap4 } so want parse like: contactgroup_name[0] = "vap3"; alias[0] = "vap3_pre"; members [0] = "userz,userw"; contactgroup_name[1] = "vap4"; alias[1] = "vap4_push"; members [1] = "userx, usery"; and ser...

asp.net - c# on Database in background -

i have asp.net server-based single-page web application performs several functions, 1 of requiring data access third-party api. application uses data provide suggestions user. when user tries execute simple actions on page independent of data api, page takes significant time load. after all, application calls api every page load - need fix this. to avoid slow-load frustration factor, know rely on tools jquery , ajax speed client-side. however, other page methods execute quickly, don't see value in converting else on page client-side code when 1 method call blame. i don't need live data external api, natural instinct throw timer method sends data on postback or pageload after x minutes. seems crude approach. there more elegant way accomplish goal? the api data stored in database, serves middleman between api , web page. application call api every x minutes (separate page load) , supply data upon user's action or page load, allowing time-consuming api meth...

reactjs - previous state is rendering (duplicate) with new state -

i having trouble figuring out why component renders both previous prop , new prop instead of diff. for example renders: [[1, 2, 3, 4, 5]] [[6, 7, 8, 9, 10]] [[1, 2, 3, 4, 5]] [[6, 7, 8, 9, 10]] [[16, 57, 8, 19, 5]] instead of just: [[1, 2, 3, 4, 5]] [[6, 7, 8, 9, 10]] [[16, 57, 8, 19, 5]] my main component: class asyncapp extends component { constructor(props) { super(props) } lookforupdate() { // function hits endpoint every 10 sec. setinterval(() => { this.props.dispatch(fetchdataforreals()) }, 10000) } componentdidmount() { this.props.dispatch(fetchdataforreals()) this.lookforupdate() } render() { const { graphdata } = this.props; return ( <div> <div>hello</div> <datagraph graphdata={graphdata} /> </div> ) } } function mapstatetoprops(state) { let graphdata = state.payment.graphdatas return { graphdata } } export default connect(map...