Posts

linux - Continuously print stdout and write to file -

i have program intermittently print stdout. want see output on screen , redirect file. i can use tee follows: foo | tee ./log.txt however, print output screen when foo has terminated not allowing me observe progress of program. is there way continuously show output of program , redirect log file? is acceptable write output file , display live ? $> foo > ./log.txt & tail -f ./log.txt

csh - No appropriate Python interpreter found Cassandra Python 3.1,3.4 -

Image
i've installed cassandra 3.9 on centos 6.7 has python 3.1.1 installed @ /usr/local/bin/python. when try start cql shell, says no appropriate python interpreter found. tried installing python 3.4 , alias it. gives same error. i have few questions on this. what compatible python versions cassandra 3.9 supports? how change python version permanently existing version mounted on read-only file system(which python) version install now?(using cshell) i echo'd pyver variable being used. says 2.7 should compatible cassandra 3.9 still gives error.

reactjs - Express API with JWT returns "Unauthorized: Invalid Algorithm error" -

i've written simple react app, following instructions of out of date tutorial meant display list of contacts in sidebar individual contact data displayed in index component if have been authenticated logging auth0 component , have json web token kept in local storage. have confirmed logged in , have token. point working fine. the problem begins when click on contact in sidebar view contact's data, comes down pretty basic api set express. i've been using postman troubleshoot since error app "401: unauthorized" when hit endpoint, suppling authorization header "bearer [jwt_value_here]" postman responds "unauthorizederror: invalid algorithm" the full output unauthorizederror: invalid algorithm    at /users/arkham/documents/web/eldrac/react-auth-server/node_modules/express-jwt/lib/index.js:102:22    at /users/arkham/documents/web/eldrac/react-auth-server/node_modules/jsonwebtoken/verify.js:27:18    ...

jquery - shuffle and sort using javascript -

i new javascript, trying draw number grid having values 1-9. 2 buttons shuffle , sort them on click . the grid looking for i able shuffle numbers, not able assign them divs. appreciated. also need on passing hex color values (shown in img) each div. $(".btn_shuffle").click(function () { var cardnumbers = []; $('.card').each(function () { cardnumbers.push(this.innerhtml); }); var thelength = cardnumbers.length-1; var toswap ; var temp; console.log(cardnumbers); for(i=thelength; i>0; i--){ toswap = math.floor(math.random()*i); temp = cardnumbers[i]; cardnumbers[i] = cardnumbers[toswap]; cardnumbers[toswap]=temp; } console.log(cardnumbers); }); the fiddle tried $(".btn_shuffle").click(function () { var cardnumbers = []; $('.card').each(function () { car...

javascript - Error: No images were returned from Instagram -

hi integrating instagram photos on website.i have getting images uploaded me using instafeed.js have take access public_content of instagram.i have generating access token also. when have used tagged images time getting error. "error: no images returned instagram" working code user uploaded images <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> <script src="http://garand.me/assets/script/instagram.js"></script> </head> <body> <div id="instafeed"></div> <script type="text/javascript"> $(document).ready(function () { var userfeed = new instafeed({ get: 'user', userid: xxx, clientid: 'xxxxxx', accesstoken: 'xxxx', template: '...

deployment - Jenkins deploy with Ranorex -

i in environment in not , not have ci environment while. looking tools can following: 1. detect new preexisting build on network share , deploy build on networked vm. 2. after build deploy complete, need our automation tool (ranorex) kicked off , run against vm build. i know jenkins more , should integrated ci environment, now, need these things. can jenkins this? if how set pipeline these actions?

java - Properly removing an Integer from a List<Integer> -

here's nice pitfall encountered. consider list of integers: list<integer> list = new arraylist<integer>(); list.add(5); list.add(6); list.add(7); list.add(1); any educated guess on happens when execute list.remove(1) ? list.remove(new integer(1)) ? can cause nasty bugs. what proper way differentiate between remove(int index) , removes element given index , remove(object o) , removes element reference, when dealing lists of integers? the main point consider here 1 @nikita mentioned - exact parameter matching takes precedence on auto-boxing. java calls method best suits argument. auto boxing , implicit upcasting performed if there's no method can called without casting / auto boxing. the list interface specifies 2 remove methods (please note naming of arguments): remove(object o) remove(int index) that means list.remove(1) removes object @ position 1 , remove(new integer(1)) removes first occurrence of specified element list.