Posts

environment variables - spark.executorEnv doesn't seem to take any effect -

according spark docs , there way pass environment variables spawned executors: spark.executorenv.[environmentvariablename] add environment variable specified environmentvariablename executor process. user can specify multiple of these set multiple environment variables. i'm trying direct pyspark app use specific python executable(anaconda environment numpy etc etc), done altering pyspark_python variable in spark-env.sh . although way works, shipping new config cluster nodes every time want switch virtualenv looks huge overkill. that's why tried pass pyspark_python in following way: uu@e1:~$ pyspark_driver_python=ipython pyspark --conf \ spark.executorenv.pyspark_python="/usr/share/anaconda/bin/python" \ --master spark://e1.local:7077 but doesn't seem work: in [1]: sc._conf.getall() out[1]: [(u'spark.executorenv.pyspark_python', u'/usr/share/anaconda/bin/python'), (u'spark.rdd.compress', u'true'), (u'spar...

android get last active intent before screen lock -

i have been creating secure data android application, therefore dont want application viewed without login through valid password. so need land on login page, in case, phone locked, other application viewed,etc. have achieved using http://www.mediafire.com/download/mb6o7mtbg1cucx9/alwayslogin.zip . now need after login, application resumes same activity last loaded. currently, main menu loaded after login button click.

c# - Best way to have two versions of a dependency per application part using Unity? -

i using unity , mvc5 .net 4.6 i have data service. it depends on repository. which in turn depends on connection. the connection requires username/token make connection or user/application guid make connection data source. both mvc controllers , web api use data service, data service should not care how being used. when used mvc controller username , token is in claim. when connected application uses api must pass in user guid , application gui. when inject data service controller unity news dependencies, data service repository injected , repository connection injected. the question best pattern getting variables user connection current controller? you can configure 2 different containers, 1 mvc , 1 web api. or, if have service needs shared between mvc , web api (e.g. singleton service), can create 2 child containers (call container.createchildcontainer() ) of container have , register connection in child containers. can make distinction between connect...

javascript - Add hyperlink with click event to Dojo grid -

my question similar implementing hyperlink within dojo datagrid , , i'm able add markup hyperlinks dojo grid using formatter . however, need wire click events on these hyperlinks, trigger function within dijit containing grid. i have formatter following: var createeditlinks = function (data) { return '<a class="my-css-class" href="#" onclick="myfunctioninsidethedijit()">' + data.title + '</a>' } while works (i markup inside grid cell), myfunctioninsidethedijit function unavailable (unless declare on global scope). i've looked little @ dom-construct , can't figure out how add hyperlink invokes dijit function when clicked. any appreciated! thanks! a more modern way dojo.behavior use on , event delegation . dgrid instances expose own on function make easier: grid.on('a.my-css-class:click', function (event) { ... });

jquery - header nav links menu changes slightly between different pages -

i'm trying out build own website scratch after learning bootstrap. use classes nav navbar-nav bootstrap build menu links go horizontally. example, home expertise contact i've noticed after creating second page called about-me.html using same header (i saved header in separate file called header.html , called via jquery script in about-me.html page), linked menu items on list change in terms of width of each boxes below home expertise contact (in comparison above example) it's not worse showed can notice @ least bare eye. if clicked "back arrow" button on browser go index.html page , clicked next arrow button, saw there visible discrepancy between 2 pages in regard top menu links navigation bar. don't think normal please correct me. i hope haven't confused explanation of problem. thank much

python - zlib.error: Error -3 while decompressing: invalid distance code -

i trying create model using tensorflow using mnist dataset . have installed tensorflow , when try create model using command . python convolutional.py i getting error message on console : successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes. downloaded train-labels-idx1-ubyte.gz 28881 bytes. downloaded t10k-images-idx3-ubyte.gz 1648877 bytes. downloaded t10k-labels-idx1-ubyte.gz 4542 bytes. extracting data/train-images-idx3-ubyte.gz traceback (most recent call last): file "convolutional.py", line 316, in <module> tf.app.run() file "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/default/_app.py", line 30, in run sys.exit(main(sys.argv)) file "convolutional.py", line 128, in main train_data = extract_data(train_data_filename, 60000) file "convolutional.py", line 75, in extract_data buf = bytestream.read(image_size * image_size * num_images) file "/usr/lib/python2.7/gzip.p...

java - Replacing multiple occurrences of characters -

i found string seq = "123456789"; string regex = seq.replaceall(".", "(?=[$0-9]([a-z]))?") + "[0-9][a-z]"; string repl = seq.replaceall(".", "\\$$0"); which turns 4a aaaa, 3b bbb , on... need opposite , couldn't figure out. need turn aaaa 4a, bbb 3b , on. lot here example of run-length encoding/decoding implementation in java: import java.util.regex.matcher; import java.util.regex.pattern; public class runlengthencoding { public static string encode(string source) { stringbuffer dest = new stringbuffer(); (int = 0; < source.length(); i++) { int runlength = 1; while (i+1 < source.length() && source.charat(i) == source.charat(i+1)) { runlength++; i++; } dest.append(runlength); dest.append(source.charat(i)); } return dest.tostring(); } public static ...