Posts

Showing posts from August, 2015

plot - Seaborn tsplot windowed estimators -

Image
i want tsplot estimator windowed function rolling mean rather mean. ideally i'd pass rolling mean function estimator parameter of tsplot() , individual timepoints passed estimator. so, looks i'm stuck pre-processing data. is correct? there approach i'm overlooking here? i don't think quite understand you're trying do, bootstrap function used in tsplot compute confidence interval gets whole array , axis=0 , , resamples rows of array before reducing on operations. seems work: import numpy np import pandas pd import seaborn sns import matplotlib.pyplot plt data = np.cumsum(np.random.randn(25, 40), axis=1) sns.tsplot(data=data) def rolling_mean(data, axis=0): return pd.rolling_mean(data, 4, axis=1).mean(axis=axis) sns.tsplot(data=data, estimator=rolling_mean)

javascript - jQuery element looping like a playlist under div -

i want program effect digital signage in webpage not sure how it, please kindly offer in here. i have several div in page place holder of region. each region, there multiple media inside. for defined duration current media play other hidden (or destroy) , subsequence media come out in same position. most importantly, when last element reach, replay whole sequence again. webpage keep rolling. i have made jsfiddle case, please kindly on , have spend day on on poor coding..... https://jsfiddle.net/vx8lp9xd/11/ html <body> <div class='timecontrol region1 position' > <video duration='30' width="320" height="240" controls class='position'> <source src="movie.mp4" type="video/mp4"> </video> <video duration='0' width="320" height="240" controls class='position'> <sour

javascript - Ember.js action bubbles up and skips a route -

setup imagine ember.js app (tried v1.13.9) structure: applicationroute indexroute indexcontroller on index template, there's button action: <!-- index/template.js --> <button {{action 'ping' 'index template'}}>index</button> all routes/controllers handle action, printing out message , passing action until reaches applicationroute . eg, indexroute is: // excerpt index/route.js actions: { ping(from) { console.log('indexroute^ping from', from); return true; } } this same action can originate @ indexcontroller : // excerpt index/controller.js thingshappen() { this.send('ping', 'index controller'); } you can see code , play @ these urls: see github gist: https://gist.github.com/pablobm/8fa2b8ae36e875cb9944 play twiddle: http://ember-twiddle.com/8fa2b8ae36e875cb9944 question when press button, messages show action seen 3 routes/controllers, in order, inside bubbling up. however, wh

c# - Problems with finding efficient way of getting folder/file names/paths from drives -

i've been trying learn how create windows explorer clone using treeview hold of folder , file names , paths. i looked lot of examples , used recursion fine, however, i've been trying huge amount of folder/file names/paths (300k+) , becomes quite slow (takes few minutes data , put treeview). below recursion method using folder , file names , paths: public static treenode createdirectorynode(directoryinfo directoryinfo, treenode parentnode = null) { var directorynode = new treenode(directoryinfo.name); foreach (var directory in directoryinfo.getdirectories()) { parentnode = new treenode(directory.name); parentnode.tag = directory.fullname; directorynode.nodes.add(createdirectorynode(directory, parentnode)); } foreach (var file in directoryinfo.getfiles()) { treenode tnfile = new treenode(file.name); tnfile.tag = file.fullname; directorynode.nod

list - chunking a large csv file by offset [0] in python -

i have csv file in format: 1,data,data2,data3..... 1,data,data2,data3..... 2,data,data2,data3..... 2,data,data2,data3..... 3,data,data2,data3..... 3,data,data2,data3..... i need chunk these strings offset[0] list such multiple lists with: 1,data,data2,data3..... 1,data,data2,data3..... and another: 2,data,data2,data3..... 2,data,data2,data3..... etc. have following code: import csv filename = 'somefile.csv' open(filename) csv_file: readcsv = csv.reader(csv_file, delimiter=',') chunk1 = [] row in csv_file: if row[0] '1': print(row) else: break this gives first chunk need adapt chunks of same of set in lists. assuming they're sorted first column, it: import csv itertools import groupby operator import itemgetter filename = 'somefile.csv' open(filename) csv_file: csvreader = csv.reader(csv_file, delimiter=',') chunks = [list(g) k, g in groupby(csvreade

node.js - Refresh Yahoo OAuth 1.0 Access Token Using Passport -

i have express app i'm trying refresh yahoo oauth 1.0 access token before expires after hour user doesn't have re-login. i'm using https-passport-yahoo-oauth passport strategy, works initial oauth. there's strategy (passport-oauth2-refresh) refreshing oauth 2.0 token here, haven't been able work (obvious reasons, suppose). yahoo docs on refreshing access token here => https://developer.yahoo.com/oauth/guide/oauth-refreshaccesstoken.html this code initial oauth below. how can exchange expire or expiring token new 1 based off this? passport.serializeuser(function(user, done) { done(null, user); }); passport.deserializeuser(function(obj, done) { done(null, obj); }); var strategy = new yahoostrategy({ consumerkey: app_key, consumersecret: app_secret, callbackurl: (process.env.app_url || require('./conf.js').app_url) + 'auth/yahoo/callback' }, function(token, tokensecret, profile, done) { var data = profile._jso

javascript - Modal Bootstrap User Confirmation -

how can create jquery function waits till user confirms whether or not wants delete data. how can achieve this: function userconfirmation() { showmodal(); //"global" delete confirmation bootstrap modal //now wait till user decides whether or not wants //delete data(button events or on modal hide). //on user reply: if(userreplied == 'delete') {} else {} } edit: this html code modal in layout. modaldelete called through showmodal() function whenever need be. <!-- delete data confirmation modal --> <div class="modal fade" id="modaldelete" role="dialog" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog modal-sm"> <!-- modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class=&q

callback - kineticjs tween: continue code after tween finished -

how have change code last 2 lines after tween finished? @ moment last 2 log, sound plays , @ same time tween start. , while sound playing teen finished , last log ("tween finished"). var tween = new kinetic.tween({ node: mynode, duration: 100, x: 100, y: 200, scalex: 80, scaley: 80, onfinish: function() { console.log("tween finished"); } }); tween.play(); //the next lines should executed after onfinish-event console.log("this should first log"); console.log("executed before 'tween finished'"); .. e.g. play sound just put in function , call within onfinish: var func2 = function() { console.log("this should first log"); console.log("executed before 'tween finished'"); // .. e.g. play sound } var tween = new kinetic.tween({ node: mynode, duration: 100,

python - Chasing game - Error message: "'module' object has no attribute 'display'" -

i new programming , trying set simulation in 1 circle moving in random pattern , being chased second circle. hoping add 5 circles distractors moving around randomly. in code called circle moving randomly "mouse" , circle chasing "cat". i researched online , looked @ other people's code ideas , came far: from pygame import * import random import sys, pygame, math, random pygame.locals import * pygame.init() background_colour = (255,255,255) (width, height) = (1024, 768) screen = pygame.display.set_mode((width, height),pygame.fullscreen) class mouse(pygame.sprite.sprite): def __init__(self, (x, y), size): pygame.sprite.sprite.__init__(self) self.x = mx self.y = self.size = 30 self.colour = (0, 0, 0) self.thickness = 2 self.speed = 2 self.angle = random.uniform(0, math.pi*2) def display(self): pygame.draw.circle(screen, self.colour, (int(mx), int(my)), self.size, self.thi

lua - Remove all chars from a string except "a","b","c","d" -

i have string want replace chars , digits "" , except chars a , b , c , d . instead of having write multiple lines of long code in example below, there other way write more efficient? mystring:gsub("[%(%)%.%%%+%-%*%?%[%]%^%$%,]", "") --special chars ... --same chars ... --same digits use caret symbol ^ is, [^abcd] caret symbol negates set. e.g., can read more here .

python - Galileo and ultrasonic error when distance less than 4cm -

below code ran on intel galileo gen2. i'm wondering why when object come close ultrasonic sensor program stops , complain variable sig "local variable 'sig' referenced before assignment"? import mraa import time trig = mraa.gpio(0) echo = mraa.gpio(1) trig.dir(mraa.dir_out) echo.dir(mraa.dir_in) def distance(measure='cm'): trig.write(0) time.sleep(0.2) trig.write(1) time.sleep(0.00001) trig.write(0) while echo.read() == 0: nosig = time.time() while echo.read() == 1: sig = time.time() # et = elapsed time et = sig - nosig if measure == 'cm': distance = et * 17150 elif measure == 'in': distance = et / 0.000148 else: print('improper choice of measurement!!') distance = none return distance while true: print(distance('cm')) your problem spike produced sensor short noticed,

How to import XML file with varying number of nodes and child nodes into DataTable in C#? -

i have following xml file need import datatable in c#: <?xml version="1.0"?> <data> <systemid> <information> </information> </systemid> <measurement_data> <channel_01> <parameter_1 attribute1="double number" attribute2="string" attribute3="double number" attribute4="string" /> <parameter_2 attribute1="double number" attribute2="string" attribute3="double number" attribute4="string" /> <parameter_3 attribute1="double number" attribute2="string" attribute3="double number" attribute4="string" /> . . . <parameter_n attribute1="double number" attribute2="string" attribute3="double number" attribute4="string" /> </chann

osx - CNContact for Mac OS X 10.11 -

from os x 10.11 , ios 9.0 apple provided framework contacts: https://developer.apple.com/library/prerelease/mac/documentation/contacts/reference/contacts_framework/index.html#//apple_ref/doc/uid/tp40015328 and access contacts mac, cannot anything, because app not have access contacts: switch cncontactstore.authorizationstatusforentitytype(.contacts) { case .authorized: print("authorized") nsuserdefaults.standarduserdefaults().setbool(true, forkey: "contactsallowed") case .denied: print("denied") nsuserdefaults.standarduserdefaults().setbool(false, forkey: "contactsallowed") case .notdetermined: print("not determined") case .restricted: print("restricted") } the app never prompts allow access contacts, neither can select in system preferences (it not show up). has idea how acccess them on mac (on ios works well)? any call instance of

xaml - C# Visual Studio Calculator App Crash when using "Enter" Key -

i trying write graphical calculator, far calculator works, want use key "enter" perform operation , give answer. crashes whenever press enter . xaml code: <textbox height="38" textwrapping="wrap" verticalalignment="top" margin="16,23,0,0" horizontalalignment="left" width="226" fontsize="20" background="black" borderthickness="2" name="tb" text="" keyup="keydownhandler"> here code handles enter key event. private void keydownhandler(object sender, keyroutedeventargs e) { if (e.key == windows.system.virtualkey.enter) { result(); } } private void result() { string op; int iop = 0; if (tb.text.contains("+")) { iop = tb.text.indexof("+"); } else if (tb.text.contains("-")) { iop = tb.text.indexof("-"); } else if

PHP's file upload is failing on server -

i developing website includes functions file upload. working on localhost, once uploaded site server fails. i have following code handle file upload: case "upload_to_gallery": /******************************* **** upload gallery **** *******************************/ if ($con->checklogin() && isset($_files['uploaded_files'])) { $gallery_name = $_post['gallery_name']; ($i = 0; $i < count($_files['uploaded_files']['name']); $i++) { list($width, $height, $type, $attr) = getimagesize($_files["uploaded_files"]['tmp_name'][$i]); if ($_files['uploaded_files']['type'][$i] == "image/png" || $_files['uploaded_files']['type'][$i] == "image/jpeg" || $_files['uploaded_files']['type'][$i] == "image/gif"

c# - How to force Federated signout redirect to login page? -

i'm using wsfederationauthentication module authentication. want this: after user press logout button, signs out (delete cookies) , redirect login page. have code logout button: var ls = new loginstatus(); ls.logoutaction = logoutaction.redirect; ls.logoutpageurl = {some url, have sign out code} signout part: microsoft.identitymodel.web.wsfederationauthenticationmodule authmodule = federatedauthentication.wsfederationauthenticationmodule; string signouturl = wsfederationauthenticationmodule.getfederationpassivesignouturl( authmodule.issuer, {login url}, null); wsfederationauthenticationmodule.federatedsignout( new uri(signouturl), new uri(authmodule.realm)); this code signout , delete cookies, not redirect login page. still, url, users sees contains part: &wreply={loginurl} as understand wreply parameter not used. instead of using federatedsignout() method tried one: system.net.webrequest req = system.net.webrequest.create(signouturl); system.net.webresp

linux - How to read the kernel log messages in c? -

i want develop c function return last 5 messages of kernel log (dmesg). how can that? i think want klogctl . example of usage in busybox source dmesg.c .

c# - Suppressing global windows shortcuts while recording keypresses -

is possible suppress windows global shortcuts while recording keypresses ? i have windows form application written in c#, , using library record keypresses use later in macros. when record key combinations used windows (i.e. l control + win + right arrow change virtual desktop on win 10), i'd app record avoid windows using while record quite annoying. i have checkbox enable key capturing, on click event m_keyboardhookmanager.keydown += hookmanager_keydown; the hookmanager_keydown this private void hookmanager_keydown(object sender, keyeventargs e) { log(string.format("keydown \t\t {0}\n", e.keycode)); string [] sarr = new string [2]; if (keybindingarea1.text != "") { sarr[0] = keybindingarea1.text; sarr[1] = string.format("{0}", e.keycode); keybindingarea1.text = string.join("+", sarr); } else { keybindingarea1.text = string.format("{0}", e.keycode); } }

php - Admin Access control not working -

i'm trying check if user logged in or not wan't check if admin or not if not redirect login page ain't working // access control if (!$this->session->userdata('logged_in') ) { if(!$this->session->userdata('user_rol') == 'administrator'){ $this->session->set_flashdata('error_msg','please login admin first!'); redirect('admin/login'); } } any please ?? actually script different. logic if not logged in, checks if user rolle isn't admin. i believe should this, try achieve. if (!$this->session->userdata('logged_in') or $this->session->userdata('user_rol') != 'administrator') { $this->session->set_flashdata('error_msg','please login admin first!'); redirect('admin/login'); }

javascript - Arbitrary index (column name) for jqGrid search -

i have jqgrid column defined follows name : 'idmycolumn', index : 'idmycolumn', width : 80, align : 'right', search : true, the id name ( ìdmycolumn ) fine sql update operations, not search. how can change name search operation (to id, let's idmysearch )? so need different sql column update need search. chance so? further clarification of oleg's question below how fill rowid in grid? integer value of first column is idmycolumn rowid? use key: true in column? no, not rowid which editing mode use? searching use (toolbar searching, searching dialog, both)? inline edit, toolbar search which name need use during sorting idmycolumn column? should column name searching , sorting same? search should "idmysearch", else (sort, ..) "idmycolumn" do use loadonce: true option or not? loadonce: default / false clarification part ii: as have not set stringresult = true somewhere (

algorithm - Graph Connectivity Proof -

suppose have adjacency matrix g representing n-node graph. g[i, j] 1 if there's edge j , 0 otherwise. can think of each entry turned on slip of paper 1 or 0 on it. my text claims lower bound on number of times need query matrix determine if graph connected n * (n-1) / 2. i'm bit confused proof of this. proof: here strategy adversary: when algorithm asks flip on slip of paper, return 0 unless force graph disconnected. 1) seems imply in cases, if return 0, it's impossible add edges later lead path u v. surely graph can still connected if return 0 above...right? claim: maintain invariant y un-asked pair (u, v) graph revealed far has no path u v proof: suppose there path u v. can remove last edge (u', v') revealed on path. have answered 0 , kept same connectivity in graph having edge (u, v). contradicts definition of our adversary strategy. end of proof: suppose there algorithm finished without examining every slip of paper. consider unasked pai

python - Matplotlib - color as third variable for already normalized data - not in grayscale -

Image
i've searched haven't been able find answer - how implement color third variable in matplotlib if data normalized? data in range 0-1 , produces graph in grayscale, 1 fades say, blue yellow, blue = 1, sort of green values 0.5 , yellow values around 0. my code reads: line in lines: if line: x1.append(line.split()[0]) y1.append(line.split()[1]) z1.append(line.split()[4]) xv = np.array(x1) yv = np.array(y1) zv = np.array(z1) plt.scatter(xv, yv, c=zv, cmap=?) i've tried sorts of variations, including no_norm best can still grayscale plot... don't think using vmin , vmax going down right route, , i've tried doing cmap = plt.cm.get_cmap('autumn') plt.scatter(xv, yv, c=cmap(zv)) but produces error: typeerror: cannot cast array data dtype('s11') dtype('int64') according rule 'safe' thanks in advance, anna after reading @tcaswell 's comment, found this p

asymptotic complexity - How to we find a Tight Big O expression -

for(i: 1 n^2) x = x + 1; return x + 1; n number of inputs. n>1 , tends infinity understand worst (and best) case running time n^2 + 1 . hence, it'll o(n^2) . however, how find if tight, big o expression? how find tight big o expression? that? let function f(n) you worked out best case n^2 (ommit +1 since constants indepently input ignored). more formally: Ω(n^2) --> means can find function u(n) , constant k such k * u(n) <= f(n) in terms of complexity. as said worst case n^2 too. again formally: o(n^2) --> means can find function v(n) , constant k such k * v(n) >= f(n) in terms of complexity. since Ω , o sets of functions theta defined intersection of Ω , o. "theta upper , lower bound." the intersection n^2 --> theta (n^2) in descriptive manner: f(n) grows not faster (or equal) u(n). f(n) grows not faster (or equal) v(n). --> f(n) grows n^2 keep in mind mor Ω , o sets of different classes of functions. e.g. Ω(log n

ios - How do I capture QR Code data in specific area of AVCaptureVideoPreviewLayer using Swift? -

Image
i creating ipad app , 1 of it's features scanning qr codes. have qr scanning part working, issue have ipad screen large , scanning small qr codes of of sheet of paper many qr codes visible @ once. want designate smaller area of display area can capture qr code easier user scan specific qr code want. i have made temporary uiview red borders centered on page example of want user scan qr codes. looks this: i have looked on find answer how can target specific region of avcapturevideopreviewlayer collect qr code data, , have found suggestions use "rectofinterest" avcapturemetadataoutput. have attempted that, when set rectofinterest same coordinates , size use uiview shows correctly, can no longer scan/recognize qr codes. can please tell me why scannable area not match location of uiview seen , how can rectofinterest within red borders have added screen? here code scan function using: func startscan() { // instance of avcapturedevice class initialize devi

jquery - Dynamically added button does not fire in Google Chrome Content Script -

my google chrome extension content script receives message popup.html using google chrome message passing api upon user logging in using popup.html. the content script supposed dynamically add button page when clicked on trigger event handler. the message received content script, button added, when clicked, button not fire handler. code below (content script message receiver) chrome.runtime.onmessage.addlistener( function(request, sender, sendresponse) { if (request.updatedom == "update") { button = '<input title="buy now!" id="buynow" type="submit">' $(".button-link").before(button) } }); content script buynow button click handler: $("#buynow").on("click",function(e) { console.log("button clicked") alert("clicked button"); }) as button added dynamically used 'on' jquery event button added after page load thinking may

Cloud Dataflow - Worker pool teardown error -

our pipeline, has been running fine few months, threw following error today. looks worker pool unable torn down after pipeline finished: aug 31, 2015, 4:35:55 (95577a18aba47708): workflow failed. causes: (df2004d5f7046091): step teardown_resource_global_gce_worker_pool2: resource worker_pool_resource failed shut down job_id: 2015-08-30_11_01_50-8584391373463411570 is known issue? there transient issue causing failure we've identified , should resolved. adding more checks/resilience mitigate issue impacting dataflow jobs progressing/shutting down in future. thank report, helpful our investigation.

html5 - img srcset based on img width rather than viewport width -

i have partial template renders article on page image , accompanying text. in landing page have several articles on page, varying classes, lead article full width, secondary articles half with, tertiary 3rd width. sidebar articles have small widths. , depending on viewport, image can rendered above text or left of it. in summary same article html renders in many ways depending on context. is there way account in latest srcset spec? from can tell have have different sizes attribute per context, coupling layout/breakpoint markup in implementation many contexts, make server side logic horrid. the width descriptor in srcset defines width of image not viewport. in case mean sizes attribute: in short can't. reason is, browser starts fetch images before might loaded/parsed stylesheets. means layout isn't known. if use lazyloading techniques can automatically calculate sizes attribute. this done lazysizes .

scheme - Multiple procedures within a racket conditional? -

i working on project euler problem # 3 in racket , not sure how use multiple procedures 1 procedure in conditionals. when using procedural language, i'd use 'while' loop , variable updating (hence why use 'set!' in following code (if there better way- i've read related questions/answers it's not practice mutate variables in racket, please offer alternative) , have several procedures if conditional true. putting multiple instructions 1 output statement (by enclosing in '()' doesn't seem work sure there way accomplish this. i've considered breaking small functions , making 2 larger functions (1 'then' area , 1 'else area) doesn't seem right solution (or @ least not conventional approach). i have included error message specific code if helps. ; project euler # 3 ; largest prime factor of number 600851475143? (define pl (list null)) (define divisor 2) (define (pf dividend) (if (= dividend 1) pl (if (= (re

Python create file in certain directory with open() -

my code: boyka = "hello" f = open("~/desktop/" + boyka + ".txt", "a") f.write(boyka) f.close result: ioerror: [errno 2] no such file or directory: '~/desktop/hello.txt' shouldn't script create file since it's "a" ? how can fix code? i'm using ubuntu. open() function not automatically expand ~ users home directory. instead trying create in directory name. guessing not want. in case should use - os.path.expanduser() , expand ~ user's home directory. example - import os.path f = open(os.path.expanduser(os.path.join("~/desktop",boyka + ".txt")), "a") i suggest use os.path.join() create paths , rather manually creating them.

arrays - Foreach loop and average in PHP -

i'm rather new programming in general. i'm starting off exercises i'm kind of getting stuck. created array , looped thru foreach loop print out each individual number stored in array, dont know find average of numbers , print out. <?php $myarray = array(87,75,93,95); foreach($myarray $value){ echo "$value <br>"; } ?> you could: $avg = array_sum($myarray) / count($myarray); echo $avg; where: array_sum calculates sum of elements in given array. count outputs total number of elements in given array.

java - I want to make my GUI screen window size, not full screen -

i'm watching tutorial on making gui , they're using graphicsdevice , graphicsenvironment it. they're making full screen application, want make windowed application. how go doing this? my code here public void setfullscreen(displaymode dm, jframe window){ window.setundecorated(true); window.setresizable(false); vc.setfullscreenwindow(window); if(dm != null && vc.isdisplaychangesupported()){ try{ vc.setdisplaymode(dm); }catch(exception ex){ } } } public window getfullscreenwindow(){ return vc.getfullscreenwindow(); } public void restorescreen(){ window w = vc.getfullscreenwindow(); if(w != null){ w.dispose(); } vc.setfullscreenwindow(null); }

variables - Defining Numerical Values in Racket -

forgive me, starting racket, question may simple answer. trying design function when given integer represents distance in miles return time (in hours) takes travel distance when going 60 mph. know basic python, familiar programming.. not know how set type of function in racket. first have declare function parameter, this: (define (calculate-time distance) ...) and then, perform actual calculation. remember, in scheme use prefix notation: (define (calculate-time distance) (/ distance 60.0)) for example, cover distance of 600 miles, it'll take 10 hours: (calculate-time 600) => 10.0

azure - How do I know which ports to allow over the network security group? -

i have oracle 12c installed on windows server 2016 in azure. have database populated locally, , need access remotely. have allowed following through firewall within machine: \dbhome_1\bin\oracle.exe \dbhome_1\bin\tnslsnr.exe i need access database on sql developer on remote machine. how know ports allow on network security group? how know ports allow on network security group? please refer link . according description, think want use function sql*net 2 , need open port 1521(by default) on azure nsg , widows firewall. currently, need check instance , listener listening. please use lsnrctl lsnrctl status [listener_name] you use tnsping test connection. also, should check netstat -ant|findstr 1521 . please ensure port listening on 0.0.0.0 .

javascript - Why are jQuery objects in property initialization empty? -

'use strict'; var controller = function controller() {}; controller.init = function() { if (!controller.propertie.element || !controller.propertie.indicator) { return 'expected find [data-controller] , [data-controller-to]'; } controller._start(); }; controller.propertie = { element: $('[data-controller]'), indicator: $('[data-controller-to]'), state: false }; controller._start = function() { controller.propertie.indicator.bind('click', controller._toggle); }; controller._toggle = function() { controller.propertie.element .animate({ bottom: (controller.propertie.state = !controller.propertie.state) ? '-110' : '0' }); }; apparently elements in object property not exist, exist ! tell me if can not use javascript that? maybe there hoisting breaking script? i try put object before init , result same. i know can extend prototype, have reasons use this. thanks. i can think of

winapi - How to write a program that stops the shutdown process by C? -

programs notepad can stop computer shutdown process when files not saved. how can write program stops shutdown process (in c)? for windows vista , above there exists fuction defined in user32.dll (user32.lib) called "shutdownblockreasoncreate". takes 2 parameters: - handle of window - string representing message displayed if call succeeds application block windows shutting down. powerful function , should not abused!

Can observations in R be removed along with subsequent data in its row through the use of subset? -

Image
here example of data frame i'm working on [the data frame (189x11)]: >wb id age lwt race smoke ptl ht ui fvt bwt low 85 19 182 2 0 0 0 1 0 2523 0 86 33 155 3 0 0 0 0 3 2551 0 87 20 105 1 1 0 0 0 1 2557 0 88 21 108 1 1 0 0 1 2 2594 0 now through use of subset want create subsettted dataframe contain table women whom smoked during pregnancy , vice versa, want this: >smoke id age lwt race smoke ptl ht ui fvt bwt low 87 20 105 1 1 0 0 0 1 2557 0 88 21 108 1 1 0 0 1 2 2594 0 and >nonsmoke id age lwt race smoke ptl ht ui fvt bwt low 85 19 182 2 0 0 0 1 0 2523 0 86 33 155 3 0 0 0 0 3 2551 0 however, when use subset: smoke <-subset(dategrame,smoke==1) i this: id age lwt race smoke ptl ht ui fvt bwt low 85 19 182 2

multithreading - working with Threads "AWT-EventQueue-0" java.lang.IllegalStateException -

note :i put complete code example make executable user; real code long! i'm obtaining exceptions sometimes: exception in thread "awt-eventqueue-0" java.lang.illegalstateexception: javax.swing.jpanel[,0,0,0x0,invalid,layout=java.awt.flowlayout, alignmentx=0.0, alignmenty=0.0,border=javax.swing.plaf.synth.synthborder@24dab6, flags=9,maximumsize=,minimumsize=,preferredsize=] not attached horizontal group exception in thread "awt-eventqueue-0" java.lang.illegalstateexception: javax.swing.jpanel[,0,0,0x0,invalid,layout=java.awt.flowlayout, alignmentx=0.0,alignmenty=0.0,border=javax.swing.plaf.synth.synthborder@bab939, flags=9,maximumsize=,minimumsize=,preferredsize=] not attached vertical group i'm working threads performs task.. this i need put inside 1 panel other new panel when events occurs private void insertpanelinpanel(jpanel jpcontainer, jpanel jpcontained) { grouplayout jpcontainerlayout = (grouplayout)jpcontainer.getlayout(); jpcont

Any way to get the raw response when OAuth2 code is exchanged with Google+ iOS SDK? -

i integrating google+ sign-in using google's ios sdk . upon user authenticating, function finishedwithauth() gets called, 1 of parameters being instance of gtmoauth2authentication . the client need send credentials server, using google's oauth2client library. server making use of credentials class can instantiated raw json response, i'd able send raw response server. however, doesn't seem gtmoauth2authentication class exposes can tell. is there simple way access this, or simplest thing reconstruct "credentials" json object necessary information gtmoauth2authentication object ? please use our new sign-in sdk ios , see https://developers.google.com/identity/sign-in/ios/ https://developers.google.com/identity/sign-in/ios/backend-auth

apache - Using VirtualHosts to host multiple domains -

i have searched far , wide answer, , can't find working solution. here goes, i have 2 virtualhosts set on server, each serving separate domain name. however, when visit first domain on list, serves documentroot of second domain. have them both listening on different ports. in dns under each domain i've got them leading ip of server. here apache .conf file: servername 137.117.33.226 <virtualhost *:443> servername joshstroup.me serveralias www.joshstroup.me documentroot /var/www/html sslengine on sslcertificatefile /etc/apache2/ssl/joshstroup.me.cert sslcertificatekeyfile /etc/apache2/ssl/joshstroup.me.key </virtualhost> <virtualhost *:80> servername respice.xyz serveralias www.respice.xyz documentroot /var/www/respice </virtualhost>

xaml - Windows Universal (UWP) Charting Library -

are there charting/data visualization libraries out there compatible new uwp windows 10 app framework, besides telerik? have come across many charting libraries out there, none compatible new uwp project type. syncfusion has charting , has community license open source projects.