Posts

Google Script - onFormSubmit - Automate an email confirmatio -

any appreciated. situation: created google form employer (attendance form) , automated email 3 different people on data submitted on form. first person submitting form - email confirmation data submitted. hr department - gets email same data submitted, subject line users name. the employees manager - gets notification stating person late or absent. this have far... please help... here link form attendance form function onformsubmitreply(e) { var useremail = e.values[3]; mailapp.sendemail(useremail, "attendance form", "thanks submitting attendance form. \n\nyour form submission " + "will reviewed our managment. \n\nemployer,|hr department", {name:"hr department"}); } function onformsubmitreply(e) { var username = e.values[1]; var optsituation = e.values[2]; var emailrecipients = "example@gmail.com"; mailapp.sendemail(emailrecipients, username +"submitted attendance...

python - Grab following index from tuple: 2 try/except or 1 if/elif -

couldn't find information on try vs. if when you're checking more 1 thing. have tuple of strings, , want grab index , store index follows it. there 2 cases. mylist = ('a', 'b') or mylist = ('y', 'z') i want @ a or y , depending on exists, , grab index follows. currently, i'm doing this: item['index'] = none try: item['index'] = mylist[mylist.index('a') + 1] except valueerror: pass try: item['index'] = mylist[mylist.index('y') + 1] except valueerror: pass after reading using try vs if in python , think may better/more efficient write way, since half time, raise exception, ( valueerror ), more expensive if/else, if i'm understanding correctly: if 'a' in mylist: item['index'] = mylist[mylist.index('a') + 1] elif 'y' in mylist: item['index'] = mylist[mylist.index('y') + 1] else: item['index'] = none ...

spatial - How to fit model with semivariogram using gstat in R? -

Image
i have csv file file contains atmospheric pm10 concentration data of 1 march,12.00 pm. please, download. want draw semivariogram using gstat package in r. tried write these code in r. these data, cant fit model. library(sp) library(gstat) seoul3112<-read.csv("seoul3112.csv") seoul3112<-na.omit(seoul3112) g<-gstat(id="pm10",formula=pm10~lon+lat,location=~lon+lat, data=seoul3112) seoul3112.var<-variogram(g,width=0.04,cutoff=0.6) seoul3112.var plot(seoul3112.var, col="black", pch=16,cex=1.3, xlab="distance",ylab="semivariance", main="omnidirectional variogram seoul 3112") model.3112<- fit.variogram(seoul3112.var,vgm(700,"gau",0.5,200), fit.method = 2) plot(seoul3112.var,model=model.3112, col="black", pch=16,cex=1.3, xlab="distance",ylab="semivariance", main="omnidirectional var...

javascript - Handling collection changes in React -

we're rolling out our own mutable collection class use within react list component. since actual contents rendered managed separately collection (which inject in component via props ), we're faced 2 design doubts: whether collection object should held in state or, instead, kept in props or instance property of component (given can handle own state); what idiom triggering rendering on collection changes be. we've been brainstorming best way this. collection's mutation methods return promise resolves collection itself; if keep collection in state , idea done() promise (in coffeescript)? @state.collection_object.add_an_item('foo').done( (mutated_collection_object) => @setstate(collection_object: mutated_collection_object) ) i'd insight on approaches you've taken/seen far. holding collection in state can messy pretty quickly, props feel it's worse. have considered holding collection outside component entirely? i've gon...

javascript - Animate SVG property such as fill color without third-party library -

how can make fill color of svg circle animate once given start (opaque black) given end (transparent/none). should triggered javascript function , animation one-shot lasting few hundred milliseconds. how can dom/css without having draw in third-party library such snap.svg? so when callback invoked set fill: black transition on period of 200ms fill: none try <animate> function. here's demo doesn't have external library. you can trigger animation so answer

php - Sort multidimensional array by keys - fails on duplicates -

this question has answer here: sort multi-dimensional array specific key 5 answers i have function sortby() use sort multidimensional arrays particular key. here sample array: array ( [0] => array ( [id] => 4 [type] => 1 [game] => 1 [platform] => 0 [totalpot] => 7550 ) [1] => array ( [id] => 5 [type] => 0 [game] => 2 [platform] => 0 [totalpot] => 7500 ) ) here function function sortby($arr, $field='id', $order=1) { $a = array(); if ( !is_array($arr) ) return false; foreach($arr $subarr) { $a[$subarr[$field]] = $subarr; } if ( $order == 1 ) sort($a); else rsort($a); return $a; } in case, calling sortby($array, 'totalpot'); work fine, because 2 values totalpot diffe...

Laravel Composer package won't install -

i'm trying install zizaco in laravel. ( https://github.com/zizaco/entrust ) when add "zizaco/entrust": "dev-laravel-5" require , exec composer update in cmd it's saying nothing install or update. this entire composer.json file : { "name": "classpreloader/classpreloader", "description": "helps class loading performance generating single php file containing of autoloaded files specific use case", "keywords": ["autoload", "class", "preload"], "license": "mit", "authors": [ { "name": "michael dowling", "email": "mtdowling@gmail.com" }, { "name": "graham campbell", "email": "graham@alt-three.com" } ], "require":{ "php": ">=5.5...