Posts

Showing posts from April, 2011

vba - Dynamic labelling of shapes -

i creating shapes within for-loop , want each shape having different name. therefore, shape in set shape = ... in each iteration should have shape replaced dynamic variable. if place shapes via set shape = w.shapes.addshape(msoshaperectangle, 10,10,10,10) how can have shape (the name of shape) dynamic e.g. set cells(1 + i, 1) = w.shapes.addshape(msoshaperectangle, 10,10,10,10) ... each shape has different name. tried shape.name = not seem have same effect setting name while creating shape. i assign name each shape create within loop: shape.name = cells(ganttstartrow + i, 1) & cells(ganttstartrow + i, 2) i set connector via set conn = w.shapes.addconnector(msoconnectorelbow, 1, 1, 1, 1) conn.connectorformat.beginconnect d, 1 conn.connectorformat.endconnect wp, 1 ... receive "type mismatch" error. assuming ws worksheet working with: dim s shape, integer = 1 5 set s = ws.shapes.addshape(msoshaperectangle, 50 + * 120, 200, 100, 100) s.name...

maven - Google Vision Batch Annotate Images with Java Client Library -

i getting exception when trying annotate images via google vision using provided java client google vision. specifically code batch client.batchannotateimages occurs: public void processocr(byte[] file) { list<annotateimagerequest> requests = new arraylist<>(); bytestring imagebytestring = bytestring.copyfrom(file); image img = image.newbuilder().setcontent(imagebytestring).build(); feature feat = feature.newbuilder().settype(type.document_text_detection).build(); annotateimagerequest request = annotateimagerequest.newbuilder().addfeatures(feat).setimage(img).build(); requests.add(request); try (imageannotatorclient client = imageannotatorclient.create()) { batchannotateimagesresponse response = client.batchannotateimages(requests); list<annotateimageresponse> responses = response.getresponseslist(); client.close(); //visionresultsdto result = new visionresultsdto(); ...

database - REST for soft delete and recovering soft deleted resources is limited -

this not technical question more reflexion subject. rest have democtratized way of serving resources using http protocols , let developper cleanest project splitting resources , user interface (back-end deals back-end use of rest apis). about api, of time use get, put/patch (hmm meh ?), post , delete, both mimic crud database. but time spent on our projects goes by, feel ux can improved adding tons of great features. example, why should user feel afraid of deleting resource ? why not put recovery system (like can see in google keep app let undo deletion think awesome in term of ux). one of practices preventing unintentionnal deletion use of column in table represents resource. example, delete book, clicking delete button flag row "deleted = true" in database, , prevent displaying rows deleted when browsing list of resource (get). this last comes in conflict our dear , loved rest pattern, there no distinction between delete , destroy "methods". what m...

javascript - How to rerender or refresh or get js code to work properly for different resolutions? -

i had seen there similar questions, couldn't find proper answer problem. code: function test() { var scroll = parseint($('.sidebar').css('height')); if (window.matchmedia('(min-width: 769px)').matches) { $(window).scroll(function() { if ( $(window).scrolltop() > scroll ) { $('.element').addclass('fixed'); } else { $('.element').removeclass('fixed'); } }); } } window.onload = function() { test(); } as can see code (adding , removing simple class when scrolling) should work resolutions bigger 769px (width) , works - when test on mobile device resolution 1024x768 @ 1024px width - works fine, problem when rotate device - width 768px, "fixed" class again added , breaks layout. have refresh whole page code work properly. i can make whole page reload on resize slow , irritating users. tried set function , on resize doesn't work. $(win...

matlab - Can `imfilter` work in the frequency domain? -

Image
according this quora answer , gabor filter frequency domain filter. and, here implementation of gabor filter uses imfilter() achieve filtering, means imfilter() works in frequency domain . now, let @ source code #1 . if replace i_ffted_shifted_filtered = i_ffted_shifted.*kernel; with i_filtered = imfilter(i, kernel); as following function [out1, out2] = butterworth_lpf_imfilter(i, dl, n) kernel = butter_lp_kernel(i, dl, n); i_filtered = imfilter(i, kernel); out1 = ifftshow(ifft2(i_filtered)); out2 = ifft2(ifftshift(i_filtered)); end we don't obtain expected output, why doesn't work? what problem in code? source code #1 main.m clear_all(); = gray_imread('cameraman.png'); dl = 10; n = 1; [j, k] = butterworth_lpf(i, dl, n); imshowpair(i, j, 'montage'); butterworth_lpf.m function [out1, out2] = butterworth_lpf(i, dl, n) kernel = butter_lp_kernel(i, dl, n); i_ffted_shifted = ffts...

node.js - Heroku nodejs websocket server returning 503? -

this solved, can't mark own answer yet it's solved! so i'm trying host nodejs server on heroku, server works fine when host local, problem whenever try connect using: const ws = new websocket('ws://<myapp>.herokuapp.com'); i error in heroku logs: heroku[router]: at=error code=h10 desc="app crashed" method=get path="/" host=<myapp>.herokuapp.com request_id=<request-id> fwd="<my-ip>" dyno= connect= service= status=503 bytes= protocol=http i have no clue how fix this, , can't find on google. if understands better do, please tell me i'm doing wrong. here server code btw: const websocket = require('ws'); var port = process.env.port || 3000; const wss = new websocket.server({ port: port }); console.log("listening on %d", port); wss.on('connection', function connection(ws) { ws.on('message', function incoming(message) { console.log('received: %s',...

Wordpress widget isn't working correctly -

on link ( https://truckingscout.com/test/ ), under widget "hundreds of job on globe" there list of jobs, every job opening same link (something wrong). here demo of theme ( https://jobify-demos.astoundify.com/classic/ ) can see how needs work. the problem in css add following code in active theme style.css , check it. ul.job_listings > li:hover { box-shadow: inset 5px 0 0 #7dc246; } ul.job_listings li { position: relative; border-bottom: 1px solid #ccc; margin: 0; padding: 1em; }

amazon web services - S3 bucket policy: allow full access to a bucket and all its objects -

i bucket policy allows access objects in bucket, , operations on bucket listing objects. (action s3:* .) i able solve using 2 distinct resource names: 1 arn:aws:s3:::examplebucket/* , 1 arn:aws:s3:::examplebucket . is there better way - there way specify resource identifier refers bucket , contained objects, in 1 shot? permissions against bucket separate permissions against objects within bucket. therefore, must grant permissions both. fortunately, can write shorter version combine bucket-level , object-level permissions: { "id": "bucketpolicy", "version": "2012-10-17", "statement": [ { "sid": "allaccess", "action": "s3:*", "effect": "allow", "resource": [ "arn:aws:s3:::my-bucket", "arn:aws:s3:::my-bucket/*" ], "principal": "*" } ] } ...

How to order modules in intelij-idea? -

Image
say have project lot of modules in intellij-idea: a b ... z in specific time need work 2 or 3 modules: a, m, z. convenient hide other modules project browser. or reorder packages like: a m z b ... is there way that? update: don't want delete inactive modules, want group modules i'm working with. there no way change order of modules. there 2 ways want. module groups create module groups going file > project structure > [modules] . move modules module group selecting 1 of more modules, open context menu (i.e. right click) , select move module group . can create new group, select existing group, or move them outside group: then in project view, can collapse group(s) modules not want focus on. modules still present , available (i.e. no modules deleted). search grouping modules in guide more information. scope view define scope ( settings > appearance & behavior > scopes ) show modules interested in. see page in...

javascript - How to display progress info on console for video-uploading on S3? -

i uploading video on s3 bucket , see progress bar. coded : reader.onload = function (e) { var rawdata = reader.result; $.ajax({ url: s3url, type: 'put', cache: false, processdata: false, data: rawdata , async: false, success: fnsuccess, error: fnerror, crossdomain: true, contenttype: "binary/octet-stream", xhr: function() { console.log("xhr"); var xhr = new window.xmlhttprequest(); xhr.upload.addeventlistener("progress", function(evt) { if (evt.lengthcomputable) { var percentcomplete = evt.loaded / evt.total; console.log(percentcomplete); } }, false); return xhr; }, }, 'json'); //$.ajax({ }; //r...

android - Retrieve Images from Firebase into a Gridview -

whenever photo uploaded application, gridview correctly displays number of photos in firebase storage (via. baseadapter's getcount() method) , captions of images. however, when try retrieve images problem is: the recent imageview in gridview displays first image posted , leaves previous imageviews blank. example, if had 3 imageviews in gridview , first image posted of red square, recent (3rd) imageview display red square , previous 2 imageviews blank. here's code populates imageviews in baseadapter: @override public view getview(final int position, view convertview, viewgroup parent) { view v = layoutinflater.from(parent.getcontext()).inflate(r.layout.gallery_cardview, parent, false); mcaption = (textview) v.findviewbyid(r.id.img_caption); mimageview = (imageview) v.findviewbyid(r.id.img_posting); storagereference ref = firebasestorage.getinstance().getreference("users/" + mainactivity.mainuser.getshopid() + "/gallery/...

Creating an emulator for Galaxy S8? - Android Studio -

i create new hardware profile in attempt make , emulator galaxy s8/s8+. set screen size 5.8/6.2 inches (depending on whether s8 or s8+, despite fact doesn't appear affect emulator anyway), , screen resolution 1440 x 2960, device. emulator appears nothing on real device. testing app on real s8+ shows laid out poorly, on emulator appear relatively organised, , noticed uses dimens nexus 6 emulator (xxxhdpi). dimens values used isn't big deal, because i'm happy phase out nexus 6 considering it's no longer in production. so add code launcher java class that gets me dimensions of emulator, here s8 emulator: {density=3.5, width=1440, height=2792, scaleddensity=3.5, xdpi=560.0, ydpi=560.0} besides fact height says 2792 instead of 2960 (i assume meant happen), believe see issue - density 3.5. suspected, same density nexus 6. emulator i'm creating not galaxy s8, , evident in comparison real s8+ displayed app in distorted manner. far i'm aware, galaxy s8 has density...

ignore - Can't unignore ssh config in git repo -

i have git bash home directory under version control. i'm using whitelist (ignore except ... ): $ cat .gitignore # ignore things * # not these (with exceptions) !*.bash_aliases !*.bash_profile !*.bashrc !*.drush/ !*.drush/* .drush/cache !.gitconfig !.gitignore !.gitalias !*.minttyrc !*.vim/ !*.vim/* .vim/.netrwhist !*.vimrc i want add .ssh/config exceptions, haven't seemed have gotten syntax correct. $ ls .ssh/config .ssh/config i have line in .gitignore : $ git diff diff --git a/.gitignore b/.gitignore index 22b3a79..b84bcd3 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ !.gitignore !.gitalias !*.minttyrc +!.ssh/config !*.vim/ !*.vim/* .vim/.netrwhist however hasn't been unignored: ~ (master) $ git status changes not staged commit: modified: .gitignore no changes added commit (use "git add" and/or "git commit -a") looking @ syntax of other things in .gitignore, tried this: $ git diff diff --git a/.gi...

python - Counting number that falls in a bin based on coordinates -

i trying count number of molecules falls particular bin based on coordinate of molecule. think nonzero option of numpy (similar find() in matlab job). @ first, did not use np.any got error valueerror: truth value of array more 1 element ambiguous. use a.any() or a.all(). when used np.any, error persist. lower limit = 0 bin_size=0.01 box=40 no_bin= box/bin_size k in range(no_bins): if k==0: count = np.any(np.size(np.nonzero(data_matrix[:,3]>= k*bin_size+lower_limit , \ data_matrix[:,3]<=(k+1)*bin_size+lower_limit))) else: count = np.any(np.size(np.nonzero(data_matrix[:,3]>=(k-1)*bin_size+lower_limit , \ data_matrix[:,3]<=k*bin_size+lower_limit))) atom_in_bin[j,2] = atom_in_bin[j,2] + count first thing, use float value in range, function takes int arguments. can cast no_bins int, advise build bins np.arange , iterate on : bins = np.arange(0, box, bin_size) k, bin in enumerate...

ionic2 - why does ionic storage does not work outside a function -

i using ionic 2 storage. if keep storage code outside of function not work. kindly let me know. constructor(public navctrl: navcontroller, public settings: settings, public formbuilder: formbuilder, public navparams: navparams, public translate: translateservice, private storage : storage) { } this.settings.load().then(() => { this.settingsready = true; this.options = this.settings.allsettings; this._buildform(); }); this.storage.set('nam','par'); } the constructor special function of class responsible initializing variables of class. typescript defines constructor using constructor keyword. constructor function , hence can parameterized. until variable get's initialized remains undefined. so, can't in way , make no sense, constructor initialized before either can same operation within constructor or use life cycle event in ionic so.

VBScript: Cannot find/click a button on webpage automatically -

could use here please. have maintain bunch of laptops never connect internet (security reasons). there single laptop of same type , disk image connect internet patch management. they run windows 10 , on internet laptop use script uses wsus2 cab file find missing updates. now want take script's output command line , have download missing updates me. in script, import findings, find kb number, append kb number end of " https://www.catalog.update.microsoft.com/search.aspx?q= ", webpage in variable, parse variable patch name, , try download button corresponds patch name. for example, output says "2017-07 security update adobe flash player windows 10 version 1703 x64-based systems (kb4025376)" missing. so url, , download source... looks this: <td class="resultsbottomborder resultspadding" id="9ebe5d13-4966-4cdb-a612-9780df621411_c1_r0"> <a id='9ebe5d13-4966-4cdb-a612-9780df621411_link' href="javascrip...

My form data is not being submitted via JQuery code -

following jquery script code in body tag. <script type="text/javascript"> $("#submit-data").click(function() { var form = new formdata($('#patient-personal')[0]); console.log(form); }); </script> following html code: <form id="patient-personal" onsubmit="return false;" role="form"> <div class="form-body"> <div class="row"> {{-- form start --}} {{-- first name --}} <div class="col-md-4"> <div class="form-group form-md-line-input form-md-floating-label"> <input type="text" class="form-control" name="firstname" id="firstname"> <label for="firstname">first name</label> <span class="help-block">patient's first name</span>...

javascript - Stroked SVG not rendered after scale transformed from 0 to 1 on Chrome -

this fiddle https://jsfiddle.net/qcnn13p5/1/ contains stroked line svg scaled 0. setting scale 1 js not make render in chrome. other browsers (tested in edge, firefox, safari, ie11). any insights, workarounds, known bug confirmations appreciated! (forcing repaint solutions such how can force webkit redraw/repaint propagate style changes? works not ideal in our scenarios there many many cases) the stroked line svg in question : $('#line-container').css('transform', 'scale(1)'); $('#line').css('transform', 'scale(1)'); <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <div id="line-container" style="transform: scale(0)"> <svg id="line" xmlns="http://www.w3.org/2000/svg" version="1.1" class="staticcontent shapesline fill-transparent border-color8" height="100%" width="10...

Empty cleaned_data dict when using custom dictionary made of request.POST for Django formset -

i data post request. want make changes data , pass formset. function: def add_report(request, project): if request.method == 'post': data = dict(copy.deepcopy(request.post)) del data['media_url'], data['save_reports'] data['document_type'] = map(lambda x, y: x or y, data['document_type'], data['document_type_other']) data['paid_at'] = zip(data['day'], data['month'], data['date-year']) data['paid_at'] = map(lambda x: get_paid_at_date(x), data['paid_at']) del data['document_type_other'], data['day'], data['month'], data['date-year'] qdict = querydict('', mutable=true) qdict.update(data) max_num = len(request.post['description']) media = request.post.get('report_file') qdict['form-total_forms'] = max_num qdict['form-initial_forms'] = u'0' qdict['form...

Python / Pandas - Filtering according to other dataframe's index -

i have 2 dataframes: df1: value dude_id 123 x 543 y 984 z df2: value id 123 r 498 s 543 d 984 x 009 z i want filter df2 in way contains keys present in df1 's index. should this: df2: value id 123 r 543 d 984 x i tried following: df2.filter(like=df.index, axis=0) however taking me following error: valueerror: truth value of int64index ambiguous. use a.empty, a.bool(), a.item(), a.any() or a.all(). what missing? use loc in [952]: df2.loc[df1.index] out[952]: value dude_id 123 r 543 d 984 x and, can rename index name in [956]: df2.loc[df1.index].rename_axis('id') out[956]: value id 123 r 543 d 984 x

global variable is showing blank always in jquery -

i have created global variable in jquery. created function in making jquery call , setting response var global variable. when doing console.log global var, showing blank always. code did is var currentname = ""; function getcurrentname() { $.get( url ).success(function(response) { response = json.parse(response); currentname = response.name; }); } getcurrentname(); console.log(currentname); so should use variable globally. you should use async : false in ajax request

sql - Oracle - Getting the latest list price from list table and append it another product table -

i have list price table, product prices keeps on changing , table product table , has entry of dates when product sold , @ price. want compare price of product on or before date ( when sold) , put list price in product table along selling price. table : list price , valid ,valid product 23 , jul 7 , july 15, x 24 , jul 20 , july 30,x 25 , aug 5 , aug 30,x 20,sep 5,sep 26,x product table : product , selling price , of date x , 24 , jul 10 x,39, jul 30 x,40, aug 28 i wish append column(listprice) product table using closest dates as_of_date column , list price on date in price table. select product.*, price.list_price (select '2017-07-20 12:00:00'::timestamp valid_from,select '2017-07-20 12:00:00'::timestamp valid_from) price left join (select '2017-07-20 12:15:00'::timestamp ts, true val )product on product.ts >= price.valid_from , b.ts < price.valid_to; please suggest way to in oracle. just use join ...

r - numbering of split table in pander -

using r + knitr + pander, reason wide table split more 2 subtables gets more 1 table number in resulting pdf. for example, running r script test.r : library(pander) dat <- data.frame(a = rep(1:2, 13), b = paste0(letters, "longtext")) pander(table(dat$a, dat$b)) via rmarkdown::render("test.r", "pdf_document") produces pdf table split 5 pieces, first 4 pieces numbered table 1 table 4, last piece unnumbered. happens when table split more 2 pieces. since 1 table, have 1 number in output (just when table split 2 pieces). how can accomplished? regards, henrik what disabling auto-generated "table continues below" caption? > panderoptions('table.continues', '') > pander(table(dat$a, dat$b), caption = 'foobar') ----------------------------------------------------------------------- alongtext blongtext clongtext dlongtext elongtext flongtext ----------- ----------- ----------- -------...

c# - I want to call some code when my web browser application opens -

i've been looking time find (i know sounds stupid) how can call code when start application. i'm using c# on windows forms. know sounds stupid use unity3d has simple method: void start() { //whatever goes here } i'm trying make web browser. you can put code in winforms generated main static void main() { application.enablevisualstyles(); application.setcompatibletextrenderingdefault(false); // code goes here application.run(new mainform()); } or in load event of mainform

time - Android: How to set a timer that notifies you, even if app is minimized? -

i want ability set reusable timer (e.g. 20 seconds) , have start counting down, minimize app, else, , have timer still notify me. timer should start / stop / pause / reset-able. i've seen alarmmanager read seems broken on several devices. there more robust solution? edit: trying service the manifest: <?xml version="1.0" encoding="utf-8"?> <manifest package="com.packagename.timertest" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundicon="@mipmap/ic_launcher_round" android:supportsrtl="true" android:theme="@style/apptheme"> <activity android:name=".mainactivity"> <intent-filter> <action android:name=...

How to access the card view from braintree ui to show in your list in ios swift? -

i wish show list of cards added, in list view , trying access views braintree ui kit show card images (which custom uiview). tried show view directly comes blank. what tried below: let viewtest: view = btuikviewutil.vectorartview(for: btuikpaymentoptiontype(rawvalue: 1)!) am stumped. anyway in simple manner? or need add images card types , manual. using ios v4 sdk swift

python 2.7 - Title of plot same as filename in matplotlib -

i want print title of plot, file name plotting. whatever files plots should title 'raman spectra of filename'. trying way doesn't work def onplot(self, event): cursor= self.conn.execute("select file_name molecule mol_number==?", (self.plot_list[0],)) files = cursor.fetchall() #print files[0][0] tf = open(files[0][0],'r+') d = tf.readlines() tf.seek(0) line in d: s=re.search(r'[a-za-z]',line) if s: tf.write('#'+line) else: tf.write(line) tf.truncate() tf.close() plt.plotfile(str(files[0][0]), delimiter=' ',comments = '#', cols=(0, 1), names=('raman shift ($\mathregular{cm^{-1}}$)', 'intensity (arb. units)'), ) plt.title('raman spectra of "files"') plt.show() the question little bit fuzzy:) plt.title('raman spectra of {}'.format(files[0][0])) ?

java - What to provide datatype for List of objects for storing it in table column -

i trying create table user in database got stuck in providing datatype list of address should datatype used address column in sk_user table list adresses; please find dto class- package com.shopcart.dto; import java.util.list; public class user { private string name; private string email; private string mobile; private int age; list<address> adresses; public string getname() { return name; } public void setname(string name) { this.name = name; } public string getemail() { return email; } public void setemail(string email) { this.email = email; } public string getmobile() { return mobile; } public void setmobile(string mobile) { this.mobile = mobile; } public int getage() { return age; } public void setage(int age) { this.age = age; } public list<address> getadresses() { return adresses; } ...

javascript - Meteor js css interpreting shrinks pages -

Image
i find weird understanding cause of shrinking of page. first image original file loaded outside of meteor project, second after adding same template meteor file. page got shrink. have been trying looking cause haven't seen. pleas, css large , not know edit. need help. want original. thus original nice layout: this isthe distored layout after adding meteor project:

Windows Compatible Node.JS XSLT Package The Supports XSL 2.0 and XML to HTML -

i've been looking node module supports xml html/xsl version 2.0 transformations via xslt. i'm confined developing in windows environment, , have researched many alternatives including saxon/c (saxon-node), node_xslt, gulp-xslt, , others. i haven't found solution satisfies our needs. solutions seem require linux or mac osx environment development. any ideas? appreciate in advance! your best bet xslt in node.js saxon-js , xslt 3.0 runtime in pure javascript 1 . note you'll need saxon-ee , commercial product, compile xslt, once that's done, can freely deploy result , runtime . bonus, saxon-js implements not xslt 2.0 xslt 3.0 well. 1 caveat : saxon-js best bet once saxonica adds support parsing , serialization javascript runtime. before then, these limitations severely restrict suitability of saxon-js many projects, including possibly yours.

pattern matching - REGEXP_SUBSTR - "substring out of bounds" error -

i have select col1, ( regexp_substr ( col2, ' ( ?<=~ ) .*? ( ?=abcd ) ' ) || substring ( col2 position ( 'abcd' in col2 ) position ( '~' in substring ( col2 position ( 'abcd' in col2 ) ) ) -1 ) xyz) db.table col2 '%abcd%'; i have field values decribed in below pattern. name1#value1 ~ name2#value2 ~ ......... ~ namex#valuex ~ ........... ~ namen#valuen there no limit number of name&value sections. 1 such name have 'abcd' pattern. want extract section of name , value contains 'abcd' pattern , put in separate field. my code above throws "substring out of bounds" error. help appreciated. thank you. as you're looking pattern , exact name can't use nvp , there's no need mixing regexp_sub , substring . this regex (~|^)([^~] ?abcd. ?#.*?)(~|$) finds 1st ~name#value~ pattern contains abcd in it's name: trim(both '~' regexp_substr(col2, '...

asp.net - EnableViewState causing loss of value -

using vb.net 4.5 , telerik 2017.2.711.45 (q2) trying radgrid filter expressions , public string variable persist across postbacks. with enableviewstate=false , radgrid filter expressions do not persist through postback, public string variable (stringvar) does persist. when set enableviewstate=true filter expressions in radgrid do persist, causes stringvar not persist. from understanding of viewstate, makes no sense setting enableviewstate=true cause stringvar not persist across postbacks. love know why occurring , resolve this. edit: highlighted line error thrown because reporttitle no longer has value. partial class displayxslgrid public reporttitle string public reportsdb reportdatabase protected sub page_load(byval sender object, byval e system.eventargs) handles me.load page.enableviewstate = true reports = new reportdatabase.global_functions(system.web.httpcontext.current) end sub protected sub radgrid1_needdatasource(send...

javascript - React API call don't change state -

i trying create react weather app. in app can type name of city , shows temperature. after caloing api state dont want change other city object (in coponentdidmount method - "obje" state). import react, { component } 'react'; import api './api.js'; class app extends component { constructor(props) { super(props); this.state = { obje: {}, inputvalue: 'paris' } } componentdidmount() { var rooturl = "http://api.openweathermap.org/data/2.5/weather?q="; var city = this.state.inputvalue var key = "&appid=aa32ecd15ac774a079352bfb8586336a"; fetch(rooturl + city + key) .then(function(response) { return response.json(); }).then(d => { this.setstate({obje:d}) }); } handlechange(event) { event.preventdefault(); this.setstate({inputvalue: this.refs.inputval.value}); console.log(this.refs.inputval.value); } render() { ...

javascript - Can't make npm scripts work with babel -

i created lib using babel.js, , don't want add dist/ folder in repository. want make npm install script build dist/ folder. how i'm trying this: in scripts object of package.json file: "scripts": { "install": "scripts/install.sh" } the install.sh file: #!/usr/bin/env bash node_modules/.bin/babel ./src/ -d ./dist/ --compact --no-comments --presets=es2015,stage-2 but when try npm install mypackage , following error message appears: npm err! file sh npm err! code elifecycle npm err! errno enoent npm err! syscall spawn npm err! @scope/mypackage@1.1.3 install: `scripts/install.sh` npm err! spawn enoent npm err! npm err! failed @ @scope/mypackage install script. npm err! not problem npm. there additional logging output above. npm err! complete log of run can found in: npm err! /users/my_user/.npm/_logs/2017-07-25t17_35_41_593z-debug.log any ideas why happening?

How to implement a SQL-Server IBotDataStore in botframework -

does have example of how implement sql-server ibotdatastore , set used on botframework application? if possible please provide database schema used on implementation ? thnks edit: new blog post has been published how implement ibotdatastore using sql server: https://blog.botframework.com/2017/07/26/saving-state-sql-dotnet/ there sql custom state client implementation here: microsoft.bot.sample.azuresql uses 'code first' , entityframework. here's script of database: use [quicksqlexamplebot] go /****** object: table [dbo].[sqlbotdataentities] script date: 7/25/2017 12:15:16 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[sqlbotdataentities]( [id] [int] identity(1,1) not null, [botstoretype] [int] not null, [botid] [nvarchar](max) null, [channelid] [nvarchar](200) null, [conversationid] [nvarchar](200) null, [userid] [nvarchar](200) null, [data] [varbinary](max) null, [etag] [nvarcha...

python - FaceGrid of nested Pandas dataframe -

Image
i need boxplot following dataframe, using facegrid, in such way each row of grid correspond particular week, given k_week , , columns columns of dataframe ( sensitivity , specificity , etc.). each boxplot should contain 6 models ('sig', 'mrm', 'mean', etc) here example of single row (i succeeded it): now need such 6 rows on single figure ,using facegrid. dataframe: df.groupby('k_week').head(6) sensitivity specificity accuracy ppv auc k_week model 0 0.609948 0.867516 0.717291 0.776004 0.813680 4 sig 1 0.586824 0.851647 0.685525 0.757557 0.784805 4 mrm 2 0.581152 0.842510 0.670357 0.749651 0.737269 4 mean 3 0.473386 0.601827 0.395841 0.556193 0.542679 4 rmssd 4 0.511344 0.717240 0.499148 0.644086 0.626719 4 missval 5 0.454625 0.523924 0.356061 0.508448 0.501661 4 rand 0 0.792619 0.764423 0.7...

python - output unable to write output in txt file -

steps: read multiple .html files in directory extract titles of html need: - sending titles individual .txt files expected: advise. ideally wanted extract integers html files name ('23434.html') , name text files '23434.txt' results: - there no txt file created in designated path. - nothing gets written for file_name in glob.glob(os.path.join(dir_path, "*.html")): open(file_name) html_file: soup=beautifulsoup(html_file) d=soup.title.get_text() #resultfile=re.findall('\d+', file_name) open("m"+".txt", "w") outfile: outfile.write(d) outfile.close for fpath in glob.glob(os.path.join(dir_path, "*.html")): open(fpath) html_file: soup = beautifulsoup(html_file) html_title = soup.title.get_text() html_number = os.path.basename(fpath).rsplit('.',1)[0] open(html_number + '.txt', 'w') o...

Install Selenium for Python 3.6 (Ubuntu 17.04) -

working through book on tdd uses python 3.6 features, including formatted string, command python3 defaults 3.5 though have python 3.6 installed, returns invalid syntax error when try run unit test. on other hand, pip3 installs selenium python3.5 directory, when try run tests using 3.6, 'no module named selenium' error. i working in virtualenv, while python3.5 shows in /home/username/.virtualenvs/projectname/lib , python3.6 not though running pip3 in virtualenv returns python3.6 newest version (3.6.1-1) . use explicit versions: pip3.6 install selenium or python3.6 -m pip install selenium

android - My application closes suddenly before showing RecyclerView -

Image
i working in recyclerview trying make recyclerview has 2 layout problem when run emulator , click button show items in recyclerview application closes here's code of adapter package com.example.abdelmagied.myapplication; import android.content.context; import android.database.cursor; import android.support.v7.widget.recyclerview; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.edittext; import android.widget.textview; import java.util.arraylist; /** * created abdelmagied on 7/25/2017. */ public class recycleradapter extends recyclerview.adapter<recyclerview.viewholder> { public context context; public cursor mycursor; public arraylist<string> mydata; private static final int view_type_dark = 0; private static final int view_type_light = 1; public recycleradapter(context context, arraylist<string> mydata) { this.context = context; this.mydata ...