Posts

Showing posts from June, 2013

python - Spark "reduceByKey" calls reducer more times than expected -

i have dataframe of 4 rows same key this: row_no id age time 1 abc 70 1524299530 2 abc 69 1524299528 3 abc 68 1524299526 4 abc 67 1524299524 then tried call reducebykey on dataframe this: new_rdd = df.rdd \ .map(lambda row: (row['id'], [row['age'], row['time']])) \ .reducebykey(some_reducer) in some_reducer , purpose of testing return previous obj. used print trace invocation of reducer , found spark had invoked reducer 4 times, namely, (1, 2), (3, 4), (1, 3) , (1, 3) . basically, reducer called on row 1 , 3 twice. running spark locally 4 processors. tried run spark 1 processor on job , reducer called 3 times expected on (1, 2), (3, 4) , (1, 3) . must have how spark partitions data still hard make sense of behavior. can provide explanation behavior? update: did more constructive test sticking integer column on each row , make reducer lambda a, b: + b . observed spark did 4 additions when run multi-pr

c# - cache insert object without specifying any depencies,expiry etc item disappear miraculously -

we use cache object flag identify if username logged in. system.web.httpcontext.current.cache.insert(sessionobjects.currentuserid.tostring(), session.sessionid); there action filter basicially checks if item exists in cache. if user logged out however i'm finding object miraculously disappears , causes null exceptions when trying retrieve cache within action filter. i notice don't seem specifiy expiration/ dependency specifics. given sample code above, there conditions .net of removed entry me without permission?

How to Analyze my screens pixels and have Python simulate mouse click when prompted -

i want able analyze part of screen (ex. smiley emoji) , have python simulate mouse click on part of screen. example: put movie of screen capture of playing chess. , everytime person moves knight want button clicked on calculator(which open) , acting counter amount of times knight moved. want of out directly interacting open programs(except click), want achieve analyzing on screen same way eyes , brain does. so question start? looked around found helpful starting points. know of programs/coding languages use this?

javascript - Amazon Search Ads not showing in rails App -

Image
issue amazon search ads not showing in rails app. it's javascript script not running. code <script type="text/javascript"> amzn_assoc_placement = "adunit0"; amzn_assoc_search_bar = "true"; amzn_assoc_tracking_id = "livingrecipe-show-recommendation-20"; amzn_assoc_search_bar_position = "bottom"; amzn_assoc_ad_mode = "search"; amzn_assoc_ad_type = "smart"; amzn_assoc_marketplace = "amazon"; amzn_assoc_region = "us"; amzn_assoc_title = "shop required equipment"; amzn_assoc_default_search_phrase = '<%= escape_javascript(equipment) %>'; amzn_assoc_default_category = "all"; amzn_assoc_linkid = "78aa42b54ebf16f31c5239f132e3d7a0"; amzn_assoc_rows = "1"; </script> <script src="//z-na.amazon-adsystem.com/widgets/onejs?marketplace=us"></script> when webp

Android app csv file getting java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 -

i have csv file inside raw folder has multi columns, i'm able read first column seems produce of data in csv file, not want, when trying read next : java.lang.arrayindexoutofboundsexception: length=1; index=1 i tried different ways of writing code below , keep getting same result, here snippet of csv file: organisationid organisationcode 1421 rv9he can please advise me i'am going wrong , why keep getting, please? caused by:java.lang.arrayindexoutofboundsexception: length=1; index=1 ? i'm pulling hair out this, csv file has no columns , i'm reading header of csv file ? private string organisationid; private string organisationcode; public string getorganisationid() { return organisationid; } public void setorganisationid(string organisationid) { organisationid = organisationid; } public string getorganisationcode() { return organisationcode; } public void setorganisationcode(string organisationcode) { organisationcode = o

sql - How to retrieve all the rows in postgres where values of a jsonb key is greater then an int value? -

i'm new postgres, if newbie question, please redirect me. i'm trying retrieve rows value greater 0. this table test . id | value ----------- 1 | {'a':1, 'b':2} 2 | {'a':0, 'b':2} 3 | {'a':1, 'b':1} 4 | {'a':0, 'b':0} 5 | {'a':3, 'b':1} 6 | {'a':0, 'b':2} i have attempted select * test value --> 'a' > 0; but didn't work. got error: argument of must type boolean, not type jsonb -- denotes comment, after ignored. query effectively: select * test value which makes error you're getting quite clear. seems meant use ->> operator extract element jsonb column. note, however, return text value, , you'd need convert int yourself: select * test (value->>'a')::int > 0

sas - Installing kernel_sas for Jupyter onto OpenShift -

Image
i'm trying add kernel_sas jupyter notebook installation i've added requirements.txt before building image, requirement.txt kernel_sas==2.1.0 but seems package unknown in conda registry. i've been looking anaconda registry via web interface, , seems have 1 : https://anaconda.org/danielfrg/sas_kernel is there way install via requirements.txt or directly via github releases openshift container? i've tried dash or underscore , same result.

python - reading large pandas datastructure via multiprocessing Process -

i trying read in large file pandas datastructure process using multiprocessing module. in code have attached below, done read_file function because "2" gets printed out. python command window gets stuck @ p1.join() "3" never gets printed. i read multiprocessing process has size limit it, if reason file isn't getting thru, can suggest alternative reading large panda structure separate process? in end, hope read 2 large panda structures simultaneously , concatenate them in main function halve script time. import pandas pd multiprocessing import process, queue def read_file(numbers,retrns): product_master_xlsx = pd.read_excel(r'g:\product master.xlsx',sheetname='table') retrns.put(product_master_xlsx) print "2" if __name__ == "__main__": arr = [1] queue1 = queue() p1 = process(target=read_file, args=(arr,queue1)) p1.start() print "1" p1.join() print "3" p

python 3.x - Tensorflow crashing on light loads -

when running inputs 9 10 , 11 below notebook, pc freezes up/crashes every time? https://github.com/ageron/handson-ml/blob/master/10_introduction_to_artificial_neural_networks.ipynb i'm using: python ver 3.5.3 tensorflow 1.2.1 running on windows 7 pro machine. i've tried running in ubuntu 16.04 given i'm experiencing same fault using 2 different os, seem it's hardware issue? i'm running: intel i7-2600k cpu @3.4ghz 16gb memory asus pk5 motherboard the system approx 5y old have thought still able handle light tensorflow work? before splashing out on new system there else can try? thanks baz

cloud - Is there a way to use Bosh to handle an app deployed on a local cluster without an IaaS? -

i have cluster of local machines, , deploy web app on using bosh. however, the bosh documentation appears show lack of options if not use popular iaas. is there way around this? the "install bosh" section of bosh docs (you're looking @ cloud foundry docs) has more complete list of supported iaas technologies (each iaas technology has own cpi, specific code interacting iaas). you mentioned deploying "cluster of local machines". don't know exactly, if you're looking deploy bare metal you're looking rackhd cpi . hope helps!

ios11 - UISearchController.hidesNavigationBarDuringPresentation ignored with scopeButtons in iOS 11 Beta -

in our project specified hidesnavigationbarduringpresentation = false on particular uiviewcontroller's uisearchcontroller. searchcontroller has array of scope titles. far works fine ios 10, in ios 11 betas, looks false setting of hidesnavigationbarduringpresentation ignored , messes our display. make sure it's not because of other factors in project, created bare-bone test project single uitableviewcontroller, uisearchcontroller initialized simple uitableviewcontroller. following code in viewdidload() method on main view controller: self.title = "search bar scope test" let searchviewcontroller = searchviewcontroller(style: .plain) searchcontroller = uisearchcontroller(searchresultscontroller: searchviewcontroller) searchcontroller!.searchbar.sizetofit() tableview.tableheaderview = searchcontroller!.searchbar searchcontroller?.hidesnavigationbarduringpresentation = false searchcontroller?.searchbar.scopebuttontitles = ["scope 1&q

Error with request using auth0 JWT token in Angular -

problem request when using auth0 jwt token in angular. i'm use angular2-jwt auth0 scenario: have angled application using jwt auth0 working perfectly, have discovered request problem. when log in application uses xsrf-token in browser, application stops working , no longer supplies correct header. request headers > accept:application/json, text/plain, */* accept-encoding:gzip, > deflate, br accept-language:pt-br,pt;q=0.8,en-us;q=0.6,en;q=0.4 > authorization:jwt > eyj0exaioijkv1qilcjhbgcioijiuzi1nij9.eyj1c2vyx2lkijoxlcj1c2vybmftzsi6imfkbwluiiwizxhwijoxnta1mtywndu1lcjlbwfpbci6inn1cg9ydgvabxd0as5jb20uyniifq.hk7nxi3ztmbtczkkfnwdumqfucssdpnr9rokofbibaw > connection:keep-alive content-length:51 content-type:application/json > host:127.0.0.1:8000 origin:http://localhost:4200 > referer:http://localhost:4200/login user-agent:mozilla/5.0 (macintosh; > intel mac os x 10_12_6) applewebkit/537.36 (khtml, gecko) > chrome/60.0.3112.113 safari/537.36 now re

node.js - Authenticating Google Sheet API on Heroku using NodeJS -

i'm following example access google sheets api: https://developers.google.com/sheets/api/quickstart/nodejs within example code following method fetch new oauth token. function getnewtoken(oauth2client, callback) { var authurl = oauth2client.generateauthurl({ access_type: 'offline', scope: scopes }); console.log('authorize app visiting url: ', authurl); var rl = readline.createinterface({ input: process.stdin, output: process.stdout }); rl.question('enter code page here: ', function(code) { rl.close(); oauth2client.gettoken(code, function(err, token) { if (err) { console.log('error while trying retrieve access token', err); return; } oauth2client.credentials = token; storetoken(token); callback(oauth2client); }); }); } this works fine on local machine (manually visiting page prompted in terminal, , entering code in command line). seems unpractical , doe

c# - Exception on Auto Properties

my application throwing stack overflow exceptions on startup on auto properties , objects creation. they working without problems, have not modified them. basically have abstract class "rule" implements interface "irule", properties interface. have child class inherits rule, exception on child class. edit: public class rulea: rule { private rulea_bestsettings; #region properties public override rule bestsettings { { return _bestsettings; } set { _bestsettings = value rulea; } } #endregion public rulea() { initialize(); } protected override void initialize() { base.initialize(); _bestsettings = new rulea(); } } } now i'm getting exception on initialize method when instantiate property this happens when new object properties instanciated. si è verificata l'eccezione system.stackoverflowexception hresult=0x800703e9 messaggio=generata eccezione di tipo 'system.

Error with list.dirs in R kept poping up no matter what I type -

i first developed r script in r version 3.3.1 , r studio 1.0.143, worked fine , r library has build-in function list.dirs(path = direct1, recursive = false) me list directories. then have downgrade r version 2.1.3 because of compatibility requirement co-workers.the function list.dirs not build-in anymore, had write function list directories. function wrote not related problem later added more for-loops replace necessity of list.dirs(). then no matter type in command, error message kept popping up, have empty script open or without function related list.dirs(). error in list.dirs(dir, full.names = full.names, recursive = recursive) : unused argument(s) (recursive = recursive) error in list.dirs(dir, full.names = full.names, recursive = recursive) : unused argument(s) (recursive = recursive) error in list.dirs(dir, full.names = full.names, recursive = recursive) : unused argument(s) (recursive = recursive) error in list.dirs(dir, full.names = full.names, recursive = re

How to retrieve all Spring Boot I18N Messages -

i need retrieve messages have in file messages_en.properties , messages_es.properties , etc. depending of current locale, far can not find way more value of property. what need nothing more return translations corresponding current locale, can handle internationalization angularjs in front end. thanks in advance, you can use plain old java load entries of properties file : properties properties = new properties(); inputstream in = getclass().getresourceasstream("messages_en.properties"); properties.load(in); in.close(); (map.entry<object, object> entry : properties.entryset()) { system.out.println(entry.getkey() + " -> " + entry.getvalue()); }

sql - Pass table name used in FROM to function automatically? -

working postgresql 9.6.3. new functions in databases. let's there multiple tables of item numbers. each 1 has item number, item cost , several other columns factored "additional cost". put calculation function can call of these tables. so instead of: select itemnumber, itemname, base, case when labor < 100 , overhead < .20 when ..... when ..... when ..... ..... end add_cost, gpm items1; i can do: select itemnumber, itemname, base, calc_add_cost(), gpm items1; if want able use on of item tables, guess need set table_name parameter function takes since adding table name function undesirable least. calc_add_cost(items1) however, there simpler way such when call calc_add_cost() use table name from clause? select ....., calc_add_cost(item1) item1 just seems redundant. i did come across few topics titles sounded addressed hoping accomplish, upon revie

active directory - Microsoft Graph GetByIds support for query params ($select, $filter), or include additional properties in GetMemberGroups -

getmembergroups returns "id" properties of groups, afaik there no way include other additional properties (my guess it's because searches in kind of index rather traversing nodes in hierarchy, makes sense when needs transitive) directoryobjects.getbyids comes handy once have ids getmembergroups, 1 returns default properties. if specify $filter example if know don't need groups prefix in displayname, or $select because know need properties, of these query parameters ignored. no error thrown, ignored, , objects returned parameters. // works (max 2046 results) var groupids = await client.users[userid].getmembergroups(false).request().postasync() // expand or include handy // if done separately in ad, @ least save roundtrip client.users[userid].getmembergroups(false).request().include("prop1,prop2").postasync() // works nicely pagination, both select , filter ignored var res = await client.directoryobjects.getbyids(groupids.tolist(), new[] { "gr

java - Create and log in to a web site with http POST request without using HttpUrlConnection library or other libraries -

i trying create http post request without using library such java.net.httpurlconnection, java.net.urlconnection, url.openconnection() etc in java. every example on internet has used libraries such httpurlconnection. can please me create post request login in web site in java? you need use low level networking working directly java.net.socket objects. perhaps best place start java sockets tutorial , , check out sample echo client therein. show how connect server , read , write data to/from it. in order construct required messages need understand http post . topic far detailed discuss here, need reading. here program sends simple hard-coded post request server running on localhost:1234: import java.io.*; import java.net.*; public class sendpost { public static void main(string[] args) { try { string post_request = "post /login http/1.1\r\nhost: localhost:1234\r\ncontent-length: 41\r\ncontent-type: application/x-www-form-urlencoded\r\n\r\n

error in adding the first column as the row name in r -

i'm trying name row names first column in r. error invalid 'row.names' length present. df x1 b 1 2 1 2 b 4 2 expected output b 2 1 b 4 2 my code df1 <- df[, -1] #remove first column x1 , create new df->df1 rownames(df1) <- df[, 1] #add row names first column of df error error in `row.names<-.data.frame`(`*tmp*`, value = value) : invalid 'row.names' length thanks! to complete first answer, can suggest also: library(magrittr) df %>% data.frame %>% set_rownames(.$x1) %>% select(-x1) or library(tibble) data.frame(column_to_rownames(df, var = "x1")) eventually, understand why initial data.frame gave error in setting row.names, because of subsetting. you'll see not vector: dim(df[, 1]) #### [1] 2 1 it's due particularities of tibble format of initial data.frame. @thelatemail help.

Snappydata SQL WITH statement -

i using snappydata run queries, , use sql statement: with x ( select distinct col_a, col_b table_a ) insert table_b select x.col_a, x.col_b x join table_c c on x.col_a = c.col_a , x.col_b = c.col_b this sql code runs fine when running in local mode, when submit compiled jar file snappydata cluster, throws error saying table "app.x" not exist, org.apache.spark.sql.tablenotfoundexception: table 'app.x' not found; any idea why happens? this known limitation due approximate query processing (aqp) rule resolution tries resolve name prematurely. saw when running tpc-ds queries. fixed on latest aqp master , fix available in 1.0. there 2 options: a) change normal sub-query variant: insert table_b select x.col_a, x.col_b (select distinct col_a, col_b table_a) x join table_c c on x.col_a = c.col_a , x.col_b = c.col_b b) or if not using aqp queries, can move out snappydata-aqp jar product jars directory

html - How to make searchbox actually search -

hi cant searchbox search wordpress site original css - https://codepen.io/jackrugile/pen/abeii <form method="get" id="searchform" action="http://www.example.com/"> <input type="search" placeholder="search | here"> <button>search</button> </form> to search form "submit", need submit button/input. however - not "search wordpress site" automatically, depending on being searched need either: process search on server write script handles capturing search request, querying database, , returning results of search user. process search client side write script handles capturing search request, , use javascript check webpage matching results. normally wordpress sites have search functionality included themes. <form method="get" id="searchform" action="http://www.example.com/"> <input typ

c - How to solve uninitialized local variable used? -

this question has answer here: uninitialized local variable 'j' used 3 answers #include <stdio.h> int main() { int x; int counter; while (scanf_s("%d", &x) != 0) { puts("enter signed number : "); if (x % 2 == 0) { counter=counter++; } } printf(" %d pair numbers", counter); } i get uninitialized local variable counter used. the program supposed keep asking numbers until gets 0 , tells amount of pairs given. the problem facing cause use of variable counter without initializing it. compiler telling you. when try execute counter=counter++; first time, counter has no definied value. might think int counter; gets initialized 0 , wrong in c. the next problem line counter=counter++; itself. if want increment counter , use counter++ . depending on compile using, u

mysql - sql query with dynamic headers using case when -

Image
here trying solve (picture @ link) - how query table, named table1, produce results below it? i stuck on creating dynamic headers. basic jist of i'm @ below. select case when color = 'blue' count(id) end 'no_of_blue' case when color = 'red' count(id) end 'no_of_red' case when color = 'green' count(id) end 'no_of_green' select sum(case when color = 'blue' 1 else 0 end) 'no_of_blue', sum(case when color = 'red' 1 else 0 end) 'no_of_red', sum(case when color = 'green' 1 else 0 end) 'no_of_green' or pivot may useful

Android BroadcastReceiver does not work phone calls -

i looking examples. my class like: <pre><code> package com.example.pjimnez.samsung_auto_reply; import android.content.broadcastreceiver; import android.content.context; import android.content.intent; import android.content.intentfilter; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.telephony.phonestatelistener; import android.telephony.smsmanager; import android.telephony.telephonymanager; import android.widget.button; import android.widget.textview; import android.view.view; import android.widget.toast; import android.content.intent; import android.content.intentfilter; public class mainactivity extends appcompatactivity { //intentfilter screenstatefilter; button btnstart; textview txthome; //phonestate ophonestate; intentfilter filter1; private final broadcastreceiver myphonestate = new broadcastreceiver() { @override public void onreceive

dart - Flutter - How the NavigatorObserver class works? -

i'm trying detect when navigator performs basic operations ( push , pop ), found class achieve navigatorobserver class, can't find example on how works. i tried implements interface: class myclassstate extends state<myclass> navigatorobserver{ .... @override void didpop(route<dynamic> route, route<dynamic> previousroute) { print('this never called'); } @override void didpush(route<dynamic> route, route<dynamic> previousroute) { print('this never called'); } } of course i'm calling navigator.of(context).push(...); override methods, never called. i suspect binding navigator missing, i'm not sure. any suggestions? thanks in advance! edit: i think want simple can't figure out how it. i have page a pushes page b . on page b have periodic timer must on there (on page b ). all want cancel timer timer.cancel() when page b popped out (with button

ios - inner shadow effect UIView -

Image
i want add inner shadow uilabel picture: reference form inner shadow effect on uiview layer? let display = uilabel() func setbackgroundlayer () { let backgroundlayer = cagradientlayer() backgroundlayer.frame = view.bounds backgroundlayer.colors = [uicolor(white:1,alpha:0.5).cgcolor,uicolor(white:0.5,alpha:0.5).cgcolor] view.layer.insertsublayer(backgroundlayer, at: 0) } func setdisplay() { let xratio = view.bounds.width/8 display.frame = cgrect(x:xratio,y:80,width:xratio*6,height:xratio*2) display.backgroundcolor = uicolor(red:204/255,green:203/255,blue:181/255,alpha:1) view.addsubview(display) } func displayinnershadow() { let shadowlayer = cashapelayer() shadowlayer.frame = view.bounds let path = cgmutablepath() path.addrect(display.frame.insetby(dx: -20, dy: -20)) path.addrect(display.frame) shadowlayer.fillrule = kcafillruleevenodd shadowlayer.path = path shadowlayer.shadowcolor = uicolor(whit

xlsxwriter - Python script to write and append a single xls document by every functions inside the script. Currently its overwriting the sheet -

python script write , append single xls document every functions inside script. overwriting sheet. here's code: import os import os.path import mysqldb import configuration import hashlib import xlsxwriter lxml import etree def check(): try: path='config.txt' workbook = xlsxwriter.workbook('demo.xlsx') worksheet = workbook.add_worksheet() worksheet.set_column('a:a', 20) bold = workbook.add_format({'bold': true}) worksheet.write('a1', 'file name',bold) worksheet.write('b1', 'is present', bold) worksheet.write(2, 1, 'yes') worksheet.write('d1', 'verification', bold) worksheet.write(2, 0, 'config.txt') if os.path.isfile(path) , os.access(path, os.r_ok): print "config.txt file exists , readable"

errors trying to read Access Database Tables into Pandas with PYODBC -

i performing simple task of bringing table data ms access database pandas in form of dataframe. had working great , can not figure out why no longer working. remember when troubleshooting connection there work needed around installing new microsoft database driver correct bitness have revisited , gone through reinstallation of driver. below using setup. record of install on laptop: os: windows 7 professional 64-bit (verified 9/6/2017) access version: access 2016 32bit (verified 9/6/2017) python version: python 3.6.1 (64-bit) found using >python -v (verified 9/11/2017) the accessdatabaseengine needed based on python bitness above windows database engine driver installed accessdatabaseengine_x64.exe 2010 release using >accessdatabaseengine_x64.exe /passive (verified 9/11/2017) i running following simple test code try out connection test database. import pyodbc import pandas pd [x x in pyodbc.drivers() if x.startswith('microsoft access driver')] returns:

c# - How can i capture local variable in dynamic method? -

this question has answer here: local variable , expression trees 2 answers issue closure variable capture in c# expression 2 answers (i'm new english) i use expression.lambda dynamically creating lambda. i want capture variables don't know how capture using expression. public class demo { /** skip */ private context _context; public void route(person person) { packet packet = packet.getpacket(); func &ltcontext, object&gt lambda = (context) => this.othermethod(context, person, packet); // } /** skip */ } i want create lambda(look comment "this") using expression@lambda. it's possible? this code i'm trying make.(not work) v

Navigation Bar, Image and outline-Image included | HTML CSS -

Image
i have couple questions (i'm new coding please bare me try , explain problems): how can make image below not interfere navigation bar? i've tried various height adjustments , doesn't move. how can make text read paragraph aligned right , image lower , left- in other words paragraph , image parallel each other. include javascript? i need alignment of h1. i have used css , html far- i've researched everywhere , can't find solutions. makes hard know want don't know terms used find solutions. appreciated! here css code: body{ background-color: #2f3a3b; text-align: justify; width: 800px; text-decoration: none; color: white; font-family:'oswald', sans-serif; } ul { display: inline-block; list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; position: fixed; top: 0; width: 100%; } li { float: left; } li { display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } l

amazon web services - Deploy Spring Batch to AWS -

i new aws. have developed batch processing application using spring boot, batch , quartz scheduling. pulls file remote ftp server , loads db. can pls help, how can deploy aws? will on elastic beanstalk (ec2) instance volume mounted downloading file ftp , processing? thanks,

java - Changing color of a button in an array of buttons and return the other buttons to default -

@override public void onclick(view v) { switch(v.getid()) { case r.id.btna: runonuithread(new thread(new runnable() { @override public void run() { btna.setbackgroundcolor(contextcompat.getcolor(getapplicationcontext(), r.color.button_pressed)); btnb.setbackgroundcolor(contextcompat.getcolor(getapplicationcontext(), r.color.colorprimary)); btnc.setbackgroundcolor(contextcompat.getcolor(getapplicationcontext(), r.color.colorprimary)); btnd.setbackgroundcolor(contextcompat.getcolor(getapplicationcontext(), r.color.colorprimary)); } })); break; case r.id.btnb: runonuithread(new thread(new runnable() { @override public void run() { btnb.setbackgroundcolor(contextcompat.getcolor(getapplicationcontext(), r.color.button_pressed));

osx - Mysql #2002 fail after updating macOS on macbook -

i have been developing website on mac awhile already. yesterday updated macos version v10.12.6 , after mysql , phpmyadmin not working following error: mysql said: documentation 2002 - connection refused — server not responding (or local server's socket not correctly configured). mysqli_real_connect(): (hy000/2002): connection refused connection controluser defined in configuration failed. mysqli_real_connect(): (hy000/2002): connection refused i have googled long , seen of answers port 3306, original config mysql. can input more can wrong about? update: found on xampp shows mysql running, when try stop it, after saying trying stop, appeared running again. cannot stopped somehow...

Matlab Error : Matrix dimension must agree -

error using / matrix dimensions must agree. error in nusrat (line 13) a0=1/(r+v.*t) clc clear close r=1.5*1000 d=2*1000 v=(60*1000)/3600 w=10^6 t=0:1/w:0.02 c=3*10^8 tou0=(r+v.*t)/c tou1=(2*d-r-v.*t)/c td=tou1-tou0 a0=1/(r+v.*t) a1=1/(2*d-r-v.*t) fc=900*10^6 phi1=-2*pi*fc*tou1 phi0=-2*pi*fc*tou0 l= ceil(td*w) hl= a1.* exp(1j.*phi1).*sinc(l-(tou1.*w))+ a0.* exp (1j.*phi0).*sinc(l-tou0.*w) plot(t*w,abs(hl)) just, change code this. a0=1./(r+v.*t); a1=1./(2*d-r-v.*t); when divide scalar array, ./ correct operator.

javascript - How to change my page in web such as dashboard? -

Image
i'd change body not including nav, sidebar in html file when click menu in sidebar. for example, when click coding convention menu in sidebar, must changed index.html test.html. , index.html includes nav, sidebar test.html not. there viewpager or frame in android, want develop function in web. this web sample image: this question general , might want provide bit more information such site static web site or dynamic web site? there backend server running? using web libs html rendering? without knowing details, bit hard give direction. there few different approaches dynamic html rendering: 1. build single page web app using angularjs or reactjs or other libs; 2. use jquery launch ajax request fetch content backend server; 3. if don't have server , building static web couple of static html pages, use html include , use javascript control hide/show; there many other ways of dynamically changing html snippets. best depending on project itself.

python - html5lib cannot be found in bleach installation -

i'm installing tensorflow-gpu on centos6.5(python3.5) requires tensor-board requires bleach==1.5.0 requires: collecting html5lib!=0.9999,!=0.99999,<0.99999999,>=0.999 (from bleach==1.5.0) so installed html5lib 0.9999999(7 nines) source: python setup.py install and verified installation import html5lib in python: python 3.5.0 (default, sep 10 2017, 00:16:28) [gcc 4.4.7 20120313 (red hat 4.4.7-4)] on linux type "help", "copyright", "credits" or "license" more information. >>> import html5lib >>> seems successful. tried install bleach1.5.0: $ sudo pip install bleach-1.5.0-py2.py3-none-any.whl processing ./bleach-1.5.0-py2.py3-none-any.whl collecting html5lib!=0.9999,!=0.99999,<0.99999999,>=0.999 (from bleach==1.5.0) and error occured : could not find version satisfies requirement html5lib!=0.9999,!=0.99999,<0.99999999,>=0.999 (from bleach==1.5.0) (from versions: ) no matching distr

xslt - Get the last occurrence of counter -

consider xml file: <record> <aa bac="1" kjd="same"/> <bb dfd="02" dad="342"/> <cc pod="11-a" dsd="11-b"/> <cc pod="22-a" dsd="22-b"/> <cc pod="33-a" dsd="33-b"/> <cc pod="44-a" dsd="44-b"/> <cc pod="55-a" dsd="55-b"/> <cc pod="66-a" dsd="66-b"/> <cc pod="77-a" dsd="77-b"/> </record> i need add attribute (cnt) under element cc, counter every 3 occurrences of cc. if reaches 4, need increment it. did part, need last value of @cnt in cc , place in 1 new (@cnt_1) of attribute in aa. here xslt: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output indent="yes" method="xml"/> <xsl:strip-space elements="*"/> &

scala - Spark out of memory when reducing by key -

i'm working on algorithm requires math operations on large matrix. basically, algorithm involves following steps: inputs: 2 vectors u , v of size n for each vector, compute pairwise euclidean distance between elements in vector. return 2 matrix e_u , e_v for each entry in 2 matrices, apply function f. return 2 matrix m_u, m_v find eigen values , eigen vectors of m_u. return e_i, ev_i = 0,...,n-1 compute outer product each eigen vector. return matrix o_i = e_i*transpose(e_i), = 0,...,n-1 adjust each eigen value e_i = e_i + delta_i, delta_i = sum elements(elementwise product of o_i , m_v)/2*mu, mu parameter final return matrix = elementwise sum (e_i * o_i) on = 0,...,n-1 the issue i'm facing memory when n large (15000 or more), since matrices here dense matrices. current way implement may not best, , partially worked. i used rowmatrix m_u , eigen decomposition using svd. the resulting u factor of svd row matrix columns ev_i's, have manually transpose rows

node.js - avoid multiple returns looped in javascript - async / await to solve callback pyramid or callback hell, -

i have code, lot of blocks of returns, example signup() connectors.js const connectors = { auth: { signup(args) { return new promise((resolve, reject) => { // validate data if (!args.email) { return reject({ code: 'email.empty', message: 'email empty.' }); } else if (!isemail(args.email)) { return reject({ code: 'email.invalid', message: 'you have provide valid email.' }); } if (!args.password) { return reject({ code: 'password.empty', message: 'you have provide password.' }); } return encryptpassword(args.password, (err, hash) => { if (err) { return reject(new error('the password not hashed.'));

gps - Sending current location as SMS Android Studio -

i'm new android studio. i'm trying send current location text message when clicking button nothing happens when click. first, here's xml: <button android:id="@+id/emergency" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_centervertical="true" android:layout_marginleft="14dp" android:layout_marginstart="14dp" android:background="@drawable/button_selector1" android:drawableend="@android:drawable/ic_dialog_alert" android:gravity="center" android:maxlines="1" android:paddingleft="15dip" android:paddingright="15dip" /> then, here's mainactivity code: @override protected void oncreate(bundle savedinst

Spring Dynamic Module - Parse Exception while deploying the osgi bundle to IBM Liberty -

i getting below parse exception while deploying spring dm osgi bundle ibm liberty. caused by: org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 2 in xml document url [bundleentry://240.fwk843512726/web-inf/applicationcontext.xml] invalid; nested exception org.xml.sax.saxparseexception; systemid: http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd ; linenumber: 2; columnnumber: 35; s4s-elt-character: non-whitespace characters not allowed in schema elements other 'xs:appinfo' , 'xs:documentation'. saw '301 moved permanently'. can have clue why getting error. thanks! if use "legacy" spring dm, "blueprint" namespace not 1 should use. xsd not packaged in bundles of container : springdm try download network, , proxy/web server sends http redirect (301), not valid xsd document.. with springdm, should use spring namespaces. however, springdm obsolete now, , should not used.. ca

c# - Core 2.0 Restsharp build warnings with System.Runtime.Serialization.Formatters -

this warning on publish, dotnet command... i'm unsure how resolve. dependancies riddled yellow warning symbols (after moving 2.0). when drilling down ends dependancy on newtonsoft.json in turn references system.runtime.serialization.formatters . anyone else have this, resolves it? error warning nu1603: restsharp.netcore 105.2.3 depends on system.runtime.serialization.formatters (>= 4.0.0-rc4-24217-03) system.runtime.serialization.formatters 4.0.0-rc4-24217-03 not found. approximate best match of system.runtime.serialization.formatters 4.3.0-preview1-24530-04 resolved.

vue.js - Eventsource problems with webpack and vuejs -

i'm making own blog using express , vuejs. in login.vue, found websites redirected localhost:8080/?#/login after pushed 'submit button' in chrome. (it works perfect in firefox) had log in 'twice' in order sign in. after post 'request', following errors occur before (response) => { ... } eventsource failed loading : "localhost:8080/__webpack_hmr" xhr failed loading: post "localhost:8080/login" navigated localhost:8080/? but funny thing after redirected /?#/login, worked successful. want know why errors occured. guess might webpack error don't know how fix it. <template> <div id="app"> <div class="alert alert-primary" role="alert" v-if="showalert"> <h4 class="alert-heading">{{alertstatus ? "success":"warning"}}</h4> <p>{{alertmsg}}</p> </div> <div v-if="!islogged&