Posts

google bigquery - Delta between query execution time and Java query call to finish -

context our container cluster located @ us-east1-c we using following java library: google-cloud-bigquery, 0.9.2-beta our dataset has around 26m rows , represents ~10g all of our queries return less 100 rows grouping on specific column question we analyzed last 100 queries executed in bigquery, these executed in 2-3 seconds (we analyzed calling bq --format=prettyjson show -j jobid , end time - creation time). in our java logs though, of calls bigquery.query blocking 5-6 seconds (and 10 seconds not out of ordinary). explain systematic gap between query finish in bigquery cluster , results being available in java? know 5-6 seconds isn't astronomic, curious see if normal behaviour when using java bigquery cloud library. i didn't dig point analyzed outbound call using wireshark. our tests executed in our container cluster (kubernetes). code queryrequest request = queryrequest.newbuilder(sql) .setmaxwaittime(30000l) .setuselega...

javascript - Angular2 intelliJ config error.. Cannot find module '@angular/core' -

Image
i new angular2. following tutorial angular2 example . first simple tutorial called guess-the-number i used code described in github provided example https://github.com/chandermani/angular2byexample/tree/master/guessthenumber . it loads fine in browser. intellij setup i'm having issues. intellij returning following error.. seen in screenshot. cannot find module '@angular/core' my properties file follows systemjs.config.js system.config({ map : { 'app': 'app', 'rxjs': 'https://unpkg.com/rxjs@5.0.0-beta.12', '@angular/common': 'https://unpkg.com/@angular/common@2.0.0', '@angular/compiler': 'https://unpkg.com/@angular/compiler@2.0.0', '@angular/core': 'https://unpkg.com/@angular/core@2.0.0', '@angular/platform-browser': 'https://unpkg.com/@angular/platform-browser@2.0.0', '@angular/platform-browser-dynamic': 'https://unpkg.c...

reactjs - How to prevent both routes from being matched in react-router v4? -

if path /posts/new , both components postsnew , postsshow below rendered, , :id matched, id being word new instead of number: reactdom.render( ( <provider store={createstorewithmiddleware(reducers)}> <router> <app> <route exact={true} path="/" component={postsindex} /> <route path="/posts/new" component={postsnew} /> <route path="/posts/:id" component={postsshow} /> </app> </router> </provider> ), document.queryselector('#root') ); in app.js: <div> <h1>an awesome app</h1> {this.props.children} </div> how can /posts/new not matched twice? we call "ambiguous routes" , there's example on our site here . the switch component should solve this. reactdom.render( ( <provider store={createstorewithmiddleware(reducers)}> <router...

php - Permission denied. Laravel linux server -

when try register , send email user got error. working till yesterday. today gives me , cant figure out why. way on local testing work's. i'm stuck. please errorexception in compiled.php line 7512: file_put_contents(/var/www/html/storage/framework/views/53de219dee4f11a2db4f64a2c574ad02db5613f4.php): failed open stream: permission denied in compiled.php line 7512 @ handleexceptions->handleerror('2', 'file_put_contents(/var/www/html/storage/framework/views/53de219dee4f11a2db4f64a2c574ad02db5613f4.php): failed open stream: permission denied', '/var/www/html/bootstrap/cache/compiled.php', '7512', array('path' => '/var/www/html/storage/framework/views/53de219dee4f11a2db4f64a2c574ad02db5613f4.php', 'contents' => 'please activate account clicking on following link. <a href="<?php echo e(route('auth.activate', $token)); ?>"><?php echo e(route('auth.activate', $token)); ?...

c# - SQL server where clause equals instead of IN -

this question exact duplicate of: linq equal instead of contains 3 answers here generated t-sql linq select [extent1].[id] [id], [extent1].[name] [name] [dbo].[hospital] [extent1] ( exists (select 1 [c1] ( select [extent2].[id] [id] [dbo].[hospitaldepartment] [extent2] [extent1].[id] = [extent2].[hospitalid] ) [project1] exists (select 1 [c1] ( select [extent3].[id] [id] [dbo].[unit] [extent3] [project1].[id] = [extent3].[hospitaldepartmentid] ) [project2] exists (select 1 [c1] [dbo].[device] [extent4] ([project2].[id] = [extent4].[unitid]) , ([extent4].[devicetypeid] in (10,20)) ) ) i need use equal instead...

python - Pandas two dataframes multiplication? -

i have 2 data frames (a , b) a: column 1, column 2, column 3 0.1 0.5 0.7 b: row 1 5 row 2 6 row 3 7 how perform multiplication like (0.1)*5, (0.5)* 6, , (0.7)*7? in other words, how multiply value in first row of b value in first column of a, second row of b value in second column of b, , etc? you want multiply values without respect whether rows or columns. pd.series(a.values.ravel() * b.values.ravel()) 0 0.5 1 3.0 2 4.9 dtype: float64

node.js - How to check multiple conditions to be true or false using protractor ,so that it helps in validating input before click -

here code want check value of inputs nick_name , room_name before clicking button(createroom_btn).but not getting how check multiple conditions in single if statement using protractor. var nick_name = element(by.model('user.vcard.nickname')); var room_name = element(by.model('roomname')); var createroom_btn = element(by.tagname('button')); describe('protractor demo app', function () { it('should click on create room button', function () { condition = function () { return [ nick_name.getattribute('value').then(function (value) { return value.length > 0 }), room_name.getattribute('value').then(function (value) { return value.length > 0 }) ]; }; browser.wait(condition, 8000, "text still not present").then(function (resp) { }); //button click ...

c# - Populate routetable of wcf from database -

i want add end points dynamically routing table of wcf. code: [aspnetcompatibilityrequirements(requirementsmode = aspnetcompatibilityrequirementsmode.allowed)] public class personservice : ipersonservice { [webinvoke(uritemplate = "", method = "get")] public void getperson() { string k = "a"; } } [servicecontract] public interface ipersonservice { [operationcontract] void getperson(); } public class global : system.web.httpapplication { protected void application_start(object sender, eventargs e) { routetable.routes.add(new serviceroute("api", new webservicehostfactory(), typeof(personservice))); } } i have end points saved in database table below : /customer/{customer}/address /customer/{customer}/address/{address} now want populate routetable of wcf service hosted in iis environment , running. i ha...

vba - I need to vlookup in a close book without opening it. But i only get #VALUE -

function csimplex(codigo string) dim rg range set rg = workbooks.open("c:\users\mvela\documents\prueba.xlsm").worksheets("simplex").range("a:z") csimplex = application.worksheetfunction.vlookup(codigo, rg, 3, false) end function you cannot refer closed workbook in vba, not vlookup, not evaluate. solution snap workbook open, return value close workbook. function csimplex(codigo string) variant dim wb workbook, rng range set wb = workbooks.open("c:\users\mvela\documents\prueba.xlsm", readonly:=true) set rng = wb.worksheets("simplex").range("a:z") csimplex = application.vlookup(codigo, rng, 3, false) wb.close savechanges:=false `<~~ close workbook! end function an .xlsb smaller otherwise identical .xlsm , load, retrieve , close faster. if large number of times, build static array of values , use that.

javascript - Connecting to Virtual COM port with node serialport on Windows -

i'm trying use node serialport ( https://www.npmjs.com/package/serialport ) connect virtual com port (usb001) in windows. is possible serialport? not appear in list returned serialport.list(). i've used serialport connect standard com ports on windows new serialport('\.\com2') - virtual com ports?

C# reset value in for loop(visual studio) -

int number =0; int [,] type = {{900, 750, 1020 }, {300, 1000, 2700 }, {500, 700, 2100 }, {400, 900, 1780 }, {600, 1200, 1100}, {575, 1150, 1900 }, {600, 1020, 1700 } }; int[] loot = {200,800,1100,600,900,300};enter code here (int row = 0; row < type.get length(0); row++) { (int column = 0; column < type.get length(1); column++) { first = type[row, column]; (int = 0; <= 5; i++) { if (loot[i] ==first) { number++; console.waterline("print"+number); }//end if else { }//end else }//end i'm trying match value type loot, find number accumulate after run want ask how reset number 0 every time run loop? bother me long time. advice to find count of m...

Compare two lists in my python -

i have python function has input 2 variables so-called current_level , current_affect . function calculates rules using training data , rules can calculating decisions using 2 variables current_level , current_affect . code contained 2 lists list_a , list_b . lists contained following: list_a = [["'easy'", "'c'", "'4'", '0.714', '\n'], ["'easy'", "'d'", "'5'", '0.778', '\n'], ["'easy'", "'e'", "'5'", '0.500', '\n'], ["'easy'", "'f'", "'6'", '0.750', '\n']] list_b = [["'easy'", "'b'", "'2'", '1.000', '\n'], ["'easy'", "'c'", "'3'", ...

api - return access token and user when authenticate passport laravel -

i want ask make me confused. create api laravel 5.4 , passport. api authorization password grant type. sample request this. $http = new guzzlehttp\client; $response = $http->post('http://your-app.com/oauth/token', [ 'form_params' => [ 'grant_type' => 'password', 'client_id' => 'client-id', 'client_secret' => 'client-secret', 'username' => 'taylor@laravel.com', 'password' => 'my-password', 'scope' => '', ], ]); return json_decode((string) $response->getbody(), true); this request send post /oauth/token and response this. { "token_type": "bearer", "expires_in": 3155673600, "access_token": "eyj0exaioijk...", "refresh_token": "lbxxgld2s..." } but want directly response authenticated user this, not twice request when login use...

Display bill total, Java public void display() error -

i'm having trouble executing total bill display. asked professor gave me small block of code, modified meet needs, reason not executing , has error: illegal start expression line --> public void display(). the compiler suggests end semi colon don't believe accurate. what missing public void display() not being executed , erroneous? import java.util.scanner; public class coffeeshop { /* author: date: program: create coffee shop application uses while loop build customer order. coffee shops sells coffee ($3.25), espresso ($4.25), , tea ($2.75). coffee selection presents customer choices of iced (no charge), cream (50 cents), , sugar (50 cents). espresso selection presents customer choice of caramel (no charge) , chocolate (no charge) 1 shot (no charge) or 2 shots ($1.25) of espresso. once customer done, or receive bill of total price. after each selection, customer have choice of returning main menu additional purchases. use nested loops handle cu...

java - I want to convert httpresponse to json object -

resp=callapi(protocol+"://"+host+":"+"5443"+"/webhook/tokens/",httpop.post, contenttype.json, credentials.tostring(), headers(headers)); string resp_body = entityutils.tostring(resp.getentity()); jsonobject jsobj = new jsonobject(resp_body); this throwing exception: org.json.jsonexception: jsonobject text must begin '{' @ character 1 because resp_body below : "{\"auth\":{\"token\":{\"id\":\"eyj0exaioijkv1milcjhbgcioijiuzi1nij9.eyjzdwiioiiyy2nkytm4nzvinjflodmymde1yjyxztg2yjfjmdazocisinjlznjlc2hfdg9rzw4ioijtrwu3turxl0twm1pqcfhna2lhstfnyzarn3p1rlfmdjjpb3oxs0xrd3jpdumwblc4r3dkv1rndhlqy2d0tvg3c3r4vxz0v3nxd3nnmzllagrvwdzmemerduzytvloafk3l29zrek2yudyvehcwk1undfvbxpxu2nktge2qno3m0q0vuc4mdlmshz0ohfsog1on1bpskeyc1y0strnrxp6nw5wdxcrbtq2zwp1mtj6yvpguwvrc2zobdbtcwfxyjrxnep2n1i5tvncmuztznnirkzcc2huceewymrjzkz0m0sznhgwoctfcworajlfmenrn2hxu3brck85ow1ld2s5reqrskfsu2h2mepuc21csfp0clbqdte5ctiwuul6cu5rs21...

ios - How to delete cells in tableView with matching core data in swift 3? -

i have core data table named menu , have inside many items , have inside identity , show columns , have static nsmutabledictionary (allmenu) datas , want check menu items display in tableview nsmutabledictionary inside (identity) == core data menu table inside identity , show == true , "cellidentifier" == "menu" ones in allmenu data, try doesn't work codes under below. my coredata menu table; id string name string identity string show boolean my nsmutabledictionary table view menu data allmenu = [ [ "cellidentifier" : "menu", "id" : "1", "name" : "menu 1", "identity" : "m1", "show" : true ], [ "cellidentifier" : "menu", "id" : "2", "name" :...

Capture the individual Eloquent Model event in Laravel 5.4 -

by default, laravel eloquent model fires following events : 'creating', 'created', 'updating', 'updated', 'deleting', 'deleted', 'saving', 'saved', 'restoring', 'restored' i using listing eloquent events using wildcard listener in appserviceprovider : /** * bootstrap application services. * * @return void */ public function boot() { \event::listen(['eloquent.*'], function ($a){ var_dump($a); }); } i getting nothing when dump $a . i know can capture events observable. there other ways this? this might little bit late answer question , prefer perform using event subscriber . you can have on it: https://laravel.com/docs/5.4/events#event-subscribers you need create event subscriber this: usereventsubscriber.php namespace app\listeners; class usereventsubscriber { /** * handle user created e...

android - Default DatePicker & TimePicker label not localize -

Image
i'm using datepicker , timepicker . functionality works fine, when change language japanese "ok" label not translated. works fine in other language spanish. so there way? i native japanese speaker , believe "ok" correctly translated. "ok" translated "ok" japanese. most japanese people understand "ok" means , it's usual japanese people see label saying "ok" on phone. screen shot below ios facebook messenger app asking camera access on iphone (language set japanese). see label saying "ok". if japanese tap "ok", camera access allowed.

connection - unable to connect to local server in SSMS 2014 (SQL Server 2014) -

Image
i need run ssms own practice , create local database on machine. unable connect local server i have microsoft sql server 2014 installed. comes sql server management studio version 12.0.4100.1 i type server name (localdb)\v11.0 but getting error i tried searching server names clicking on 'browse more' option in drop down of ssms connection window, not find server mentioned there. i ran sql server configuration manager , went sql server services. there no items available there i tried running below command through command prompt net start sqlserveragent but gave 'server name invalid' error can suggest other steps debug , run local server thanks @ross bush , @wei_dba had installed setup sqlmanagementstudio_x86_enu.exe. didn't realize setup did not contain provision install db engine. ran installer sqlexprwt_x64_enu.exe. , while running setup, selected database engine services checkbox , installed. able connect local server. than...

jquery - Can't fill text on a form inside a modal (materializecss) -

i've been trying populate form elements inside modal when opens can't seem it. been searching hours , can;t seem find proper answer. modal: <div id="editmodal" class="modal modal-fixed-footer"> <div class="modal-content row"> <div class="center-align"> <h4>update task</h4> <p><b>note:</b> can update task name , task type</p> </div> <form class="col s10 offset-s1" id="form" method="post"> <div class="input-field col s10 offset-s1"> <input id="edttaskname" type="text" class="validate" required> <label for="edttasknamelbl">task name</label> </div> </form> </div> <div class="modal-footer"> <a href=...