Posts

Showing posts from 2013

linux - display.im6: no decode delegate for this image format `/tmp/magick-KFcbfWUi' -

i'm using rio , have sample.csv looks following hour,count 0300,0 0300,0 0300,1 0300,1 0300,2 0301,1 0301,2 0301,2 0301,3 i run following command: $ < sample.csv rio -ge 'g + geom_bar(df, aes(hour, count))' | display and display.im6: no decode delegate image format `/tmp/magick-gvr3krzh' @ error/constitute.c/readimage/544. from know geom_bar expects dataset first df , columns, i'm not sure why don't see graph, knows missing? thanks see docs.ggplot2.org/0.9.3.1/geom_bar.html . expects mapping first, data. , don't have specify df data, because it's been captured in g . and think need specify stat='identity' if want specify y aesthetic.

python - Flask User Page with ID -

i want have user page (/users/). when open /users/, should see own user profile (if logged in, else: error) when giev command, /users/?uid=2999 should laod user info of user uid=2999. works, if signed in see own profile works too. if not signed in, there following error: bad request browser (or proxy) sent request server not understand. that's code snippet: @app.route('/users/') def users(): if 'logged_in' in session: ret = 0 user = session['uid'] c, conn = dbconnect.conn() data = c.execute("select * users uid = (%s)", (user)) if int(data) == 0: flash("error! please send report @ martin@tekkkz.com!") else: data = c.fetchone() ret = 1 c.close() conn.close() gc.collect() if ret: return render_template("users.html", nav=2, user=data) elif request.args['uid']: ret = 0

dockerfile - Unable to pull private repo in docker -

i created image application , uploaded private repository in registry.hub.docker . now every time try pull it, following error fata[0012] repository not found i have authenticated myself docker using docker login command command ran ## docker login docker login username (werain): werain warning: login credentials saved in /users/werain/.dockercfg. login succeeded ## docker pull docker pull werain/digitdem any clue? use full image name, including tag, when pushing , pulling: docker push werain/digitdem:latest docker pull werain/digitdem:latest docker assumes mean latest when don't specify, if want use own tag or if didn't push same tag you're trying pull, omitting tag won't work.

ripple - Android design library TabLayout background issues -

when setup tabbackground attribute of "22.2.0 android design library" tablayout (android.support.design.widget.tablayout) 2 problems appear : the ripple effect in tabs lost the tab indicator disappears. this occurs on both lollipop , kitkat devices. without tabbackground settings, both ripple effect , tab indicator work background has default color different toobar, not conform material design guidelines. please find below xml : <android.support.design.widget.tablayout android:id="@+id/tablayout" android:layout_width="match_parent" android:layout_height="wrap_content" app:tabmode="fixed" app:tabgravity="fill" app:tabbackground = "?attr/colorprimary" /> use android:background="?attr/colorprimary" instead of app:tabbackground = "?attr/colorprimary" . if have dark primary color, may want change theme themeoverlay.app

xml - XSLT to copy value in a node to another across repeating nodes -

very new xslt , needs in transforming xml. below xml can have multiple "row" tags <?xml version="1.0" encoding="utf-8"?> <ns1:row> <ns1:city>baltimore</ns1:city> <ns1:miscdata> <ns1:building> <ns1:vendorcode>123</ns1:vendorcode> <ns1:value>2</ns1:value> </ns1:building> <ns1:building> <ns1:vendorcode>345</ns1:vendorcode> <ns1:value>8</ns1:value> </ns1:building> </ns1:miscdata> </ns1:row> <ns1:row> <ns1:city>fremont</ns1:city> <ns1:miscdata> <ns1:building> <ns1:vendorcode>332</ns1:vendorcode> <ns1:value>4</ns1:value> </ns1:building>

unity3d - App does not start on Android and force close -

Image
i have created test scene in unity has 1 cube , directional lightening. when installed in avd name of app display , shows nothing... i not figure out error.. or making application stop running avd setting used are target: 4.0.3 api level 15 skin: hvga ram: 512 vm: 32 internal storage: 200mb sdcard:2gb i/androidruntime( 474): note: attach of thread 'binder thread #3' failed d/androidruntime( 549): d/androidruntime( 549): >>>>>> androidruntime start com.android.internal.os.runtimeinit <<<<< d/androidruntime( 549): checkjni on d/androidruntime( 549): calling main entry com.android.commands.am.am i/activitymanager( 77): start {act=android.intent.action.main cat=[android.intent.category.launcher] flg=0x10200000 cmp=com.asdasd.cd/com.unity3d.player.unityplayernativeactivity} pid 549 d/permissioncache( 36): checking android.permission.read_frame_buffer uid=1000 => granted (22624 us) w/win

android - How to parse return value form werbservice - ksoap2 -

i have asp.net webservice return values : err﹕ checkusersresponse{checkusersresult=anytype{anytype=value1; anytype=value2; anytype=value3; anytype=value4; anytype=value5; anytype=value6; anytype=value7; anytype=value8; }; } httptransportse transp = new httptransportse (url); transp.call(soap_action, envelope); soapobject result=(soapobject)envelope.bodyin; log.e("err",result.tostring()); how parse it? solved soapobject result=(soapobject)envelope.bodyin; soapobject element; element = (soapobject)result.getproperty(0); log.e("err",element.getproperty(1).tostring()); //0 1 2 3 4 ...

javascript - White spaces getting removed on generating csv files from HTML dropdown list -

i want csv file downloaded white spaces preserved in between words. html <select id="ddl"> <option value="1">one apple</option> <option value="2">two oranges</option> <option value="3">three grapes</option> </select> javascript var ddlarray= new array(); var ddl = document.getelementbyid('ddl'); (i = 0; < ddl.options.length; i++) { ddlarray[i] = ddl .options[i].text; } var csvrows = []; (i = 0; < ddlarray.length; i++) { csvrows.push(ddlarray[i]+","); } var csvstring = csvrows.join("%0a"); var = document.createelement('a'); a.href = 'data:attachment/csv,' + csvstring; a.target = '_blank'; a.download = 'sampledownload.csv'; document.body.appendchild(a); a.click(); when executing above code, sampledownload.csv getting downloaded, option values getting trimmed white spaces lost. example "oneapple&quo

c# - Class With PictureBox Variable and Double. And more -

okay, want make list or array of class has picturebox , double value varaibles. want know is, how can display class on windows form, picture, , when click on picture, message box pop , value of picture. list or array must dynamic since size of changing through out run time. hope explains need. what have far i'm able create dynamic array of picturebox show on form, i'm not able assign double value. when click on image, can make move don't know how assign each image specific value. code stuff image on click: private void picturebox_clickfunction(object sender, eventargs e) { picturebox pb2 = (picturebox)sender; // need cast(convert) sende picturebox object can access picturebox properties if (pb2.location.y >= 250) { pb2.top -= 20; // messagebox.show(pb2.tag); } else { pb2.top += 20; } } my code assigning picturebox images: void print_deck(list<container> b,

jquery - find position of tag inside a string javascript -

thanks in advance. stuck problem. have string this var string = "this <span>i got stuck</span> , <span>clueless</span> can <span>help please</span> "; i want know position of each occurrence of span tag in string. in example string have 1 span tag after 3rd word, 1 after 9th word , 1 after 12th word. result array [3, 9, 12]. please me. edit : also, can able have number of words inside each span tag in addition above array? as have tagged javascript/jquery, 1 way use .each() , split() var string = "this <span>i got stuck</span> , <span>clueless</span> can <span>help please</span> "; //count position var pos = []; string.split(' ').foreach(function(val,i){ if(val.indexof('<span>') > -1){ pos.push(i) } }); //count words inside each `<span>` var wordcount = $('<div/>').html(string).find('span').map(function

java - Need a GridBagLayout tutor for dummies please... with working example -

Image
i'm trying create gui has jxtaskpane , within html editor pane showing lengthy text, below 2 sliders. 1 should have full window width divided 50/50 between label , slider, next slider should have 1/3rd of width label , 2/3 slider. in order example run, need swingx, download jar here . there several problems code: on first startup, elements not drawn correctly. window needs resized, or task pane closed , reopened. can recommend way fix this? even though gridbagconstraint fill parameter set use full horizontal width, components using half of window width , drawn in center. how can make them use full width , height of jxtaskpane ? even though slider2 has gridwidth property set 2 (the label has set 1) in fact drawn narrower label! why that? tried playing weightx parameter, changes appearance randomly little wider or little narrower, in seems random , rather unpredictable fashion. how make label 1/3rd width of slider? import java.awt.*; import java.awt.event.*; imp

apache - Intermittent PeerUnverifiedException: No peer certificate with Android client -

i trying achieve android ↔ apache communication using https, error below. experience problem intermittently, 30% of time. javax.net.ssl.sslpeerunverifiedexception: no peer certificate i searched on web answer has helped me... here android code: http_post = new httppost(utils.ip_address); http_post_data = new arraylist<namevaluepair>(); http_post_data.add(new basicnamevaluepair("regid", regid)); http_post_data.add(new basicnamevaluepair("email", globals.userinfo.mail)); http_post_data.add(new basicnamevaluepair("pass", globals.userinfo.pass)); http_post.setentity(new urlencodedformentity(http_post_data)); httpparams httpparameters = new basichttpparams(); httpconnectionparams.setconnectiontimeout(httpparameters, utils.timeout_connection); httpconnectionparams.setsotimeout(httpparameters, utils.timeout_socket); http_client = new defaulthttpclient(httpparameters); response = http_client.execute(http_post); string responsebody = entityuti

Rails form Images -

this form : <%= form_for @user, validate: true |f| %> <div class="well-lg"> <h4>personal details</h4> <div class="form-group"> <%= f.label :role %> <br /> <%= f.select :role, options_for_role, {}, prompt: 'select one',:class=> 'form-control' %> </div> <div class="form-group"> <%= f.label :first_name %><br /> <%= f.text_field :fname, :class=> 'form-control' %> </div> <div class="form-group"> <%= f.label :last_name %><br /> <%= f.text_field :lname, :class=> 'form-control' %> </div> <div class="form-group"> <%= f.label :email_address %><br /> <%= f.email_field :email, :class=> 'form-control' %> </div> <div class="form-group"> <%= f.label :upload_image %><br /&

Converting multi-dimensional array to a tuple in python -

i getting frame data web cam in form of rgb values. import numpy np frame = get_video() print np.shape(frame) the output (480, 640, 3). want construct image these values. so, want use im = image.new("rgb", (480, 640),frame) but, here third argument takes tuple. error systemerror: new style getargs format argument not tuple so, question best way convert frame data tuple, can construct image. i assuming here importing class image pil. the documentation image.new(), accessed console command image.new? is: in [3]: image.new? type: function base class: string form: namespace: interactive file: /usr/lib/python2.7/dist-packages/pil/image.py definition: image.new(mode, size, color=0) docstring: create new image the third parameter rgb color, such (255,255,255), fill hole image. can't initialize individual pixels function. i assuming frame 3d array. output suggests, it's 480 lines , 640 rows of rgb tuples. i don't know

c# - How to avoid selecting textbox value when press Enter? -

Image
control nextcontrol; if (e.keycode == keys.enter) { nextcontrol = getnextcontrol(activecontrol, !e.shift); if (nextcontrol == null) { nextcontrol = getnextcontrol(null, true); } nextcontrol.focus(); e.suppresskeypress = true; } i have code act enter key tab when press enter key selecting textbox value in image you can tell textbox select nothing control nextcontrol; if (e.keycode == keys.enter) { nextcontrol = getnextcontrol(activecontrol, !e.shift); if (nextcontrol == null) { nextcontrol = getnextcontrol(null, true); } nextcontrol.focus(); textbox box = nextcontrol textbox; if (box != null) box.select(box.text.length, 0); e.suppresskeypress = true; }

Operator '-' is not defined for type 'Double' and type 'DBNull'. [vb.net datagridview] -

here getting following bracketed error (operator '-' not defined type 'double' , type 'dbnull'.) when executing netvaluevalidation(). working in column of "discper" after executing discpervalidation() private sub grdpurchase_cellendedit(byval sender object, byval e system.windows.forms.datagridviewcelleventargs) handles grdpurchase.cellendedit celledited = true currentcolumn = e.columnindex currentrow = e.rowindex if me.grdpurchase.columns(me.grdpurchase.currentcell.columnindex).name = "itemcode" if not me.grdpurchase.rows(e.rowindex).cells("itemcode").value dbnull.value seekitemdetails() end if else if me.grdpurchase.columns(me.grdpurchase.currentcell.columnindex).name = "packingratio" packingratiovalidation() elseif me.grdpurchase.columns(me.grdpurchase.currentcell.columnindex).name = "price" pricevalidation()

ios - Parse.com Framework Sort Date Next Birthday -

need sort on ios date using parse.com need order them based on next birthday specific person. tried add day , month current or next year , helped manual process, recommendations in automated way. as side note want implement in swift thanks in advance. the exact code depend on personal setup (i can imagine you've made subclass of pfobject or similar), try experiment following code. i've made function called filterfriendsafterbirthdays might useful reading post. // // viewcontroller.swift // parsefun // // created stefan veis pennerup on 20/06/15. // copyright (c) 2015 kumuluzz. rights reserved. // import uikit class viewcontroller: uiviewcontroller { override func viewdidload() { createdummydata() queryforfriends() { println("unsorted birthdays: \($0)") println("sorted birthdays: \(self.filterfriendsafterbirthdays($0))") println("closets upcoming birthday: \(self.filterfr

Eclipse Luna Google plugin update -

iam using eclipse luna google plugin develop google app engine application. installed update google plugin , project working full of errors. import statements jdo , appengine showing errors "import javax.jdo cannot resolved". when try run errors shows: error: not find or load main class com.google.appengine.tools.development.devappservermain. project working before update google plugin. version of eclipse , google plugin: version: luna service release 2 (4.4.2) build id: 20150219-0600 google plugin eclipse 4.4 the update must have replaced gae sdk newer version. go project properties > google > app engine , make sure valid sdk version selected.

parse.com - Parse error 100 -

Image
i'm getting error of time in last 24 hours. sometimes, works ok, without fixes. after few requests stops working again. error first appears without changes in code. internet connection ok. error in browser console in app: post https://api.parse.com/1/classes/newestatedata net::err_connection_resetmain.js:2000 parse._ajax.dispatchmain.js:2003 parse._ajaxmain.js:2109 (anonymous function)main.js:4509 _.extend.then.wrappedresolvedcallbackmain.js:4571 (anonymous function)main.js:4554 _.extend.then.runlatermain.js:4570 _.extend.thenmain.js:2098 parse._requestmain.js:8872 parse.query.firstmain.js:8727 parse.query.getmain.js:38795 parse.object.extend.getnewestatebyidmain.js:36802 react.createclass.componentdidmountmain.js:17732 assign.notifyallmain.js:30901 on_dom_ready_queueing.closemain.js:33673 mixin.closeallmain.js:33614 mixin.performmain.js:28956 batchedmountcomponentintonodemain.js:33600 mixin.performmain.js:26083 reactdefaultbatchingstrategy.batchedupdatesmain.js:31827 batch

ios - Correct way to zoom UIScrollView with many images? -

which correct way zoom image in uiscrollview many images? in depth, have contentview (uiview) uiimageview(s) subviews. i'm trying return current showed uiimageview in viewforzoominginscrollview: doesn't work :-( func viewforzoominginscrollview(scrollview: uiscrollview) -> uiview? { return imageviews[self.currentindex] } - (void)viewdidload { [super viewdidload]; self.scrollview.minimumzoomscale=0.5; self.scrollview.maximumzoomscale=6.0; self.scrollview.contentsize=cgsizemake(1280, 960); self.scrollview.delegate=self; }

Needs advice for buying Web Server -

are there guides buying web servers , setting them up? going making basic websites. probably cost effective solution looking old servers on ebay. can powerful hardware @ low price, 16-32gb of ram 4-8 cores under $300. unfortunately these servers meant ran in data centre or enclosed room aware of very loud noise make. able faintly hear such server if put in room door closed. in case run servers down in unfinished basement room , has no problems there / isn't audible rest of house mileage may vary. if need quieter solution @ cheap find many older workstations on ebay have quite powerful specs well. you'll find workstations under $400 8gb-16gb ram , 4-8 cores. of course these workstations much quieter jet storms data centre servers make. as final solution build own server or, said... use older computer that's lying around. raspberry pi suffice cheap solution , has no problems acting lightweight nas or web server. can run powerful software teamspeak 3 servers

include - Does gcc search CPATH recursively? -

on linux system, gcc recursively search path declared in cpath environment variable, or need specify every includes sub-directory explicitly? cpath specifies list of directories search. compiler searches directories, not sub-directories (so no recursive searching). is, given name #include "somedir/header.h" , in directories specified via -i , -isystem , specified via cpath , add /somedir/header.h each of entries — , that's all. this reasonable. if did recursive searching, you'd have worry getting order right files such <time.h> (because there's <sys/time.h> , might found recursive search).

Laravel middleware redirection -

when use laravel middleware routes not work properly <?php namespace app\http\controllers; use auth; use app\article; use app\http\requests; use illuminate\http\request; use app\http\requests\articlerequest; use app\http\controllers\controller; use carbon\carbon; //use illuminate\http\request; class articlescontroller extends controller { public function __construct(){ $this->middleware('auth',['only'=>'create']); } // public function index(){ //return \auth::user(); $articles = article::latest('published_at')->published()->get(); return view('articles.index',compact('articles')); } public function show($id){ $article = article::findorfail($id); //dd($article->published_at->adddays(8)->diffforhumans()); return view('articles.show',compact('article')); } public function create(){ if(auth::gues

c# - How to get all the possible 3 letter permutations? -

possible duplicate: listing permutations of string/integer for example, aaa .. aaz .. aba .. abz .. aca .. acz .. azz .. baa .. baz .. bba .. bbz .. zzz basically, imagine counting binary instead of going 0 1, goes z. i have been trying working few hours no avail , formula getting quite complex , i'm not sure if there's simpler way it. thanks reading. edit: have @ moment it's not quite there , i'm not sure if there better way: private ienumerable<string> getwordsoflength(int length) { char lettera = 'a', letterz = 'z'; stringbuilder currentletters = new stringbuilder(new string(lettera, length)); stringbuilder endingletters = new stringbuilder(new string(letterz, length)); int currentindex = length - 1; while (currentletters.tostring() != endingletters.tostring()) { yield return currentletters.tostring(); (int = length - 1; > 0; i--) { if (currentletters

ruby - Opal is completely broken? -

i've been totally unsuccessful in getting opal work. when try embed in sinatra server using tutorial here or example code here , undefined method 'source_maps' #<opal::server:0x8b11540> . when use updated code linked @ bottom of this post , uninitialized constant opal::sprockets::sourcemapheaderpatch . so, abandon sinatra , try using opal in rack app instead, using own example here . , totally blank webpage. finally, follow tutorial here to letter , , again blank page in browser. so, doing wrong? or opal broken appears? (oh, , that's not mentioning 2 serious out-of-bounds bugs in rescue block in parse() in opal/parser.rb kill chance of debugging error) the documentation needs updated , versioned. but 0.8 rc1 seems pretty stable , has working examples here (including source maps). keep in mind source maps kinda hacked sprockets , rack setup them working isn't trivial.

Libgdx Trigonometry Wrong Angle -

i building top down shooter counter strike 2d there problem velecity: public class player extends entity { private float movespeed; private float turnspeed; private float maxspeed; private float movefriction; private float turnfriction; private texture tex; private sprite sprite; private arraylist<bullet> bullets; public player() { movespeed = 15 / game.ppm; turnspeed = 400 / game.ppm; maxspeed = 300 / game.ppm; movefriction = 5 / game.ppm; turnfriction = 10 / game.ppm; tex = new texture(gdx.files.internal("ingame/tempplayer.png")); sprite = new sprite(tex); bodydef = new bodydef(); bodydef.position.set(game.cam.position.x / game.ppm, game.cam.position.y / game.ppm); bodydef.type = bodytype.dynamicbody; body = game.world.createbody(bodydef); shape = new polygonshape(); shape.setasbox(sprite.getwidth() / 2 / game.ppm, sprite.getheight() / 4 / game.ppm); fixdef = new fixturedef(); fixdef.shape = sha

How to install MySQL 5.6.23 on ubuntu 14.04 -

i trying install mysql 5.6.23, seems not easy path. had mysql 5.5 on unbuntu 14.04 in vm. ran, sudo apt-get install mysql-server-5.6, mysql 5.6.19 got installed. how update 5.6.23 mysql site not provide download link!! any appreciated add repo echo "deb http://repo.mysql.com/apt/ubuntu/ precise mysql-apt-config deb http://repo.mysql.com/apt/ubuntu/ precise mysql-5.6" | sudo tee /etc/apt/sources.list.d/mysql.list curl -s http://ronaldbradford.com/mysql/mysql.gpg | sudo apt-key add - sudo apt-get update sudo apt-get install mysql-server-5.6

Cell arrays in MATLAB using parfor -

i need parallelize script in matlab. have cell array returning values to. but, matlab not accept way structure parallelization of script. n_h = 4; n_r = 6; n_s = 20; p{1:n_h, 1} = zeros(n_s, n_r); workers = 4; % number of cores (workers) parallel computing multicore = parpool('local', workers); % open multiple workers (cores) parallel computation h = 1:1:n_h r = 1:1:n_r parfor s = 1:n_s p{h,1}(s,r) = function ... end end end delete(multicore); % delete multiple workers (cores) opened parallel computation matlab responds variable p indexed in way incompatible parfor . how should change script? the easiest way create temporary vector, store parallel results there, , assign values @ once. for h = 1:1:n_h r = 1:1:n_r svec = zeros(n_s, 1); parfor s = 1:n_s svec(s) = my_very_parallelizable_func(param1, param2); end p{h

angularjs - How do I load angular modules, that are common and dynamic between pages? -

i have site developed multiple developers has multiple pages. each "page" initializes angular calling angular.module(etc). my question is, pages share modules, , pages use specific modules. best practice achieve this? trust developers insert correct modules needed across site (i.e. google analytics) or create 1 call shared pages loads modules. , there way both? such as, initilize modules needed across pages , then, load specific modules dynamically on respective pages. i make 1 global module loaded each individual app, modules 'nganimate' loaded... global module initialize functionality common pages, such google analytics. this requires policing on developers involved, practice via code reviews, etc. example page: angular.module('individualpage', [ 'globalmodule', 'custompagemodule' ]).config( // etc ); global module: angular.module('globalmodule', [ 'googleanalytics' ]).config( /

angularjs - Reference new scope created by adding an object to ng-repeat -

i have set of items in model tree, shown via ng-repeat. each item in ng-repeat has own controller (which lets each item have own properties). each item has selected property important per-session, i'm not saving attribute on model tree, synced server. function itemctrl($scope) { $scope.selected=false; $scope.select = function () { $scope.selected = true; }; }; now, when create new item adding model tree, want access scope in entry created automatically ng-repeat in order flip "selected" variable true, don't know how access that. i've made quick fiddle illustrate problem. thoughts? you can $rootscope. have updated fiddle link. add $rootscope itemctrl , select function. function itemctrl($scope,$rootscope) { $scope.selected=false; $rootscope.select = function () { $scope.selected = true; alert("selected set true"); }; }; updated link fiddle

batch file - .bat - insert text before a period -

i have .bat use query basic information servers. after gets fqdn dns, need insert "-r" (minus quotes) after servername, before ".domain.com". area added script below - for /f "delims=[] tokens=2" %%b in ('ping %servername% -n 1 ^| findstr "["') (set thisip=%%b) /f "tokens=2" %%a in ('nslookup %thisip% ^| find /i "name: "') (set fqdnstat=%%a) so how can take fqdn, set fqdnstat, , modify - server.domain.com server-r.domain.com ? edit - guess didn't explain well. need insert text line of text, before period. need take following name: server.domain.com , edit read server-r.domain.com, using command. rest of script above context issue. fqdnstat variable use qualified domain name. i afraid don't understand concern, batch file may you: @echo off set fqdnstat=server.domain.com echo before: "%fqdnstat%" /f "tokens=1* delims=." %%a in ("%fqdnstat%") set "

google spreadsheet - Have only Tuesdays and Fridays repeating -

is possible drag repeating pattern of tuesdays , fridays repeating in google sheets? type of output i'm looking this: tuesday, june 2, 2015 friday, june 5, 2015 tuesday, june 9, 2015 friday, june 12, 2015 ... and drag down continue pattern... when now, continues incrementing number of days between tuesday , friday. thanks! maybe can try formula: =query(arrayformula({(date(2015,6,2)+row(a1:a1000)-1), weekday(date(2015,6,2)+row(a1:a1000)-1,2)}), "select col1 col2 matches '"&join("|", 2, 5)&"' limit 10") where date() function holds starting date , limit part limits output whatever number want. see if works ? edit: if want tuesdays , fridays list of dates in col a, try: =filter(a2:a, (weekday(a2:a)=3)+(weekday(a2:a)=6)) then copy output , paste in col 'values only'.

php - Drupal submitting a query that change a tableselect -

i'm new on drupal, i've create module shows form select, button submit , i've got tableselect lists records (from database). tableselect works , it's listing records, want "filter" records on tableselect selecting want see select list (and submitting). when choose in select list , submit, tableselect dont change if execute dsm($form['tableselect']) said tableselect contains db_query returns. here form : function mybook_form ($form, &$form_state){ $form = array(); $form['options_state'] = array( '#type' => 'value', '#value' => array ( 'all'=>t('all'), 'valid'=>t('valid'), 'published'=>t('published'), 'not published'=>t('not published') ) ); $form['state_book'] = array( '#type' => 'select', '#title' => t('state :'), '#option

elasticsearch - Arithmetic on bucket results -

so creating 2 buckets, sale , rent , i'd calculate ratio i'm unable so. { "size":"0", "query":{ "filtered":{ "filter":{ "term":{"area":"ireland"} } } }, "aggs":{ "sale":{"filter":{"term":{"type":"sale"}}, "aggs":{"price":{"percentiles":{"field":"price", "percents":[75]}}}}, "rent":{"filter":{"term":{"type":"rent"}}, "aggs":{"price":{"percentiles":{"field":"price", "percents":[75]}}}} }} appreciate help. thanks! this not possible, @ moment, elasticsearch. but it's being actively implemented , tracked in this github issue .

actionscript 3 - eventListeners Won't Leave -

these last 2 lines of action script frame : removelisteners(); if(!stage.haseventlistener(event.enter_frame)){trace("stage has no eventlisteners");} with removelisteners() function having been described : function removelisteners(){ if(button){ button.removeeventlistener(mouseevent.click,leavegamescene); } stage.removeeventlistener(event.enter_frame,menuonframe); stage.removeeventlistener(event.enter_frame,collectdrachmas); stage.removeeventlistener(event.enter_frame,updatehealth); stage.removeeventlistener(event.enter_frame,updatecards); stage.removeeventlistener(event.enter_frame,updatequestions); stage.removeeventlistener(event.deactivate,stagedeactivate); stage.removeeventlistener(keyboardevent.key_down,key_down); stage.removeeventlistener(keyboardevent.key_up,key_up); stage.removeeventlistener(event.enter_frame,charenterframe); stage.removeeventlistener(event.enter_frame,updateinteractives); st

dataframe - I want to calculate a moving difference for my dataset below. -

Image
how add column moving difference of column2? for example: want add column have following values: (0,-372706.6,-284087.1, -119883.7, etc.) here's way go it. ## small dataset x <- data.frame(matrix(nrow=7,ncol=2,c(0,12,1,10,2,9.5,3,8,4,7,5,5,6,2),byrow = t)) names(x) <- c("time","count") x[1,"diff"] <- na x[2:nrow(x),"diff"] <- rev(diff(rev(x$count))) there way plyr package well.

javascript - Implementing FileSaver.js saveAs() function into HTML script -

right attempting save information html page creating text document, using javascript , filesaver.js package. not versed in html , new javascript, odds making egregious mistake. @ moment, have eligrey's filesaver.js file in same directory html file working from, should able call "filesaver.js" in html. right working this: //some irrelevant text <script src="filesaver.js"> function download(){ //alert("hello world"); //this alert line test function call //the alert appears when <script> tag // has no src field labeled. observation. var blob = new blob(["hello world"],{type:"text/plain;charset=utf-8"}); saveas(blob,"helloworld.txt"); } </script> //some more irrelevant text <input type="button" value="download" onclick="download();"/> /*from button want gather information input text fields on page. k

osx - IntelliJ IDEA asking for IDEA_HOME to be set in project configuration files - IDEA_HOME is undefined -

Image
intellij idea community edition on mac os x giving error "idea_home undefined." it has fix option. brings dialog: configure path variables - there undefined path variables in project configuration files. in dialog box, idea_home has no value i cannot find idea_home meant be. base directory of intellij idea application? .idea directory project? thanks yole. looking @ files idea_home referring in .idea project xml files, able determine idea_home referred base application folder of idea on computer. /applications/"intellij idea 13 ce 2.app" a useful expanation of path variables here: https://www.jetbrains.com/idea/help/path-variables.html if need access path variables on mac go intellij idea > preferences > path variables (under ide settings heading).

c# - WPF: Programatically adding a ContextMenu to a DataGrid column header -

i'm trying add individualized , separate contextmenus each column header in project, when user right-clicks header, menu of checkboxes relates header appear allows them filter data. a couple of catches: project i'm working on needs developed .net 4.0, , such don't have access datagridcolumnheader class introduced in .net 4.5. also, of needs done programatically, no xml allowed, of column data determined @ runtime. i found similar stack question in done using xml, , i've sucessfully reproduced in xml, i'm new wpf , haven't been able reproduce programatically. i've pasted c# code below think setup should occur. /// <summary> /// function adds of columns default setup /// </summary> public void makeallcolumns() { (int = 0; < allcolumndisplaynames.length; i++) { datagridtextcolumn col = new datagridtextcolumn(); col.header = allcolumndisplaynames[i]; col.binding

playframework - Typesafe Activator commands don't work in CentOs -

installed typesafe activator in centos, when typing commands, command line displays message "killed"! java installed, can not understand going on. i've answered on russian so, think if duplicate answer in english: i think don't have enough memory. let's try on ssh-connection , type: free -m -s 1. it show amount of free memory, should (in parallel terminal) type command crashes "killed". think in moment free show memory running out , (after process killing) there enough amount of memory again. some virtualization technologies (for instance openvz) doesn't support swap space can try move virt tech supports swap (for instance xen)..

width - Use CSS to set units to px (where no unit defined) -

the problem: old dinosaur working outdated html/css styling. dude managed enter whole bunch of input field sizes using style='width:80' , similar. that's right, without 'px' or anything. now works satisfactorily in msie 10 , above chrome , firefox, unfortunately interface has support msie 9 (i have not dared attempt msie 8....) , msie 9 not this. fields seem have random/default length , looks horrendous. replacing instances of task more daunting coming dead (a general replace moderately useful) question is... is possible set "the" unit in css applied fields missing one? use of jquery ok, jqueried wazoo that's fine. please tell me @ available option... or shall find myself going mad replacing 1000+ fields... no, not possible. units must defined, except value 0. but shouldn't daunting, surely regexp or 2 handle it?

javascript - MongoDB and Express: Type Error: Converting Circular structure to JSON -

i new mean stack. trying retreive list of documents mongodb. have used visual studio 2013 community edition create basic nodejs express application. visual studio created app.js file on root configuration. have put following code in app.js relevant mongodb: var mongo = require('mydb'); var db = new mongo.db("mydb", new mongo.server("localhost", "27017"), { safe: true }, { auto_reconnect: true }); // make our db accessible our router app.use(function (req, res, next) { req.db = db; next(); }); in routes folder visual studio created, have created js file perform crud operations. have following code in file: var express = require('express'); var router = express.router(); router.get('/myrecords', function (req, res) { var db = req.db; db.open(function (err, db) { if (err) console.log(err); else { var collection = db.collection('mycollection');