Posts

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.