Posts

Output shell command in python -

def run_command(command): p = subprocess.popen(command, stdout=subprocess.pipe, stderr=subprocess.stdout) return p.communicate() on running : command = ("git clone " + repo).split() run_command(commmnd) everything working.but when try run multiple commands got error. command = ("git clone www.myrepo.com/etc:etc && cd etc && git stash && git pull).split() run_command(command) use subprocess.check_output() shell=true option, heed security warning re untrusted inputs if applies you. import subprocess command = 'git clone www.myrepo.com/etc:etc && cd etc && git stash && git pull' try: output = subprocess.check_output(command, shell=true) except subprocess.calledprocesserror exc: print("subprocess failed return code {}".format(exc.returncode)) print("message: {}".format(exc.message)) after output ...

DAPL errors on Azure RDMA-enabled SLES cluster -

i set 2 azure a8 vms in availability set running sles-hpc 12 (following tutorial here: https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-cluster-rdma/ ). when run intel mpi pingpong test, getting dapl errors: azureuser@sshvm0:~> /opt/intel/impi/5.0.3.048/bin64/mpirun -hosts 10.0.0.4,10.0.0.5 -ppn 1 -n 2 -env i_mpi_fabrics=shm:dapl -env i_mpi_dynamic_connection=0 -env i_mpi_dapl_provider=ofa-v2-ib0 /opt/intel/impi/5.0.3.048/bin64/imb-mpi1 pingpong sshvm1:d28:bef0eb40: 12930 us(12930 us): dapl_rdma_accept: err -1 input/output error sshvm1:d28:bef0eb40: 12946 us(16 us): dapl err accept input/output error [1:10.0.0.5][../../src/mpid/ch3/channels/nemesis/netmod/dapl/dapl_conn_rc.c:622] error(0x40000): ofa-v2-ib0: not accept dapl connection request: dat_internal_error() assertion failed in file ../../src/mpid/ch3/channels/nemesis/netmod/dapl/dapl_conn_rc.c @ line 622: 0 internal abort - process 0 similar errors when running 1 of osu mpi microbench...

php - Twitch API Live Callback Service -

i integrating twitch user account api platform , had through api see if there callback section of sort send update server when user starts streaming, can't seem find reference one. is there services offer sort of thing? if not, best way of running regular checks on of users in database see when streaming, of course doing alone kill server database queries, i'm stuck go now. what looking receive callback , create post in social feed user has started streaming. based on discussions @ links below, api doesn't support webhooks , won't anytime soon. instead, expect use polling. set worker process makes requests periodically, such every 5 minutes, creates appropriate social feed posts, etc. can batch them if have bunch of channels check (exaple from github issue): https://api.twitch.tv/kraken/streams?channel=riotgames,dota2ti,machinima,esltv_hearthstone https://github.com/justintv/twitch-api/issues/211 https://discuss.dev.twitch.tv/t/notifications-using...

Superimposing Multiple HTML Canvases with unique CSS Styles on top of Eachother -

i'm new stackoverflow , programming. i'm designing website right , wondering if me figure out how stack multiple html canvases on top of eachother, each own css style attached. right have square in middle of page css style attached establishes it's size, animates growth, etc. want top layer of several, larger squares have same effect (i.e. series of concentric squares expand when moused over.) here's html code: <html> <head> <meta charset="utf-8"/> <link href="hvr-grow.css" rel="stylesheet" type="text/css"> <link href="hvr-grow2.css" rel="stylesheet" type="text/css"> </head> <body onload="draw();"> <div> <canvas class="hvr-grow" id="magazine 1"></canvas> </div> <div> <canvas class="hvr-grow2" id="magazine 2"></canvas...

java - Debugging a Unity Android "Unable to convert classes into dex format" error on build -

i've been having trouble doing unity android build because of these dex format errors. i've looked @ similar errors people have had involving duplicate .jar files in unity project, i've removed culprits can find , still happening. updated unity facebook plugin , there several other plugins in project well, know prone have duplicate files. i can see there lot of "illegal argument exception" added translations errors, i'm assuming getting referenced twice, can't figure out these "accessibility service" files are. i'll admit rest of error i'm still trying figure out. i'm not super experienced java/android developer yet. does know might wrong? or have ideas of how might go debugging error further? error building player: commandinvokationfailure: unable convert classes dex format. see console details. /library/java/javavirtualmachines/jdk1.7.0_45.jdk/contents/home/bin/java -xmx2048m -dcom.android.sdkmanager.toolsdir=...

Is it possible to create a Windows exe on Linux using C++ with CMake? -

i'm working home windows pc on code, compile on linux pc on ssh connection. since resulting program creates gui, can't test it. possible create, besides linux program, windows exe can run on home computer? here cmakelists (using qt5): cmake_minimum_required(version 2.8.11) project(p3) set(cmake_prefix_path $env{qt5_qmake_dir}) message(status "qt5_qmake_dir: " ${cmake_prefix_path}) set(executable_output_path ${project_source_dir}/bin) set(library_output_path ${project_source_dir}/lib) set(cmake_include_current_dir on) set(cmake_verbose_makefile on) set(cmake_automoc on) # possibly set debug testing set(cmake_build_type release) include_directories(${cmake_current_binary_dir}) #project source directories find_package(qt5widgets required) find_package(qt5core required) find_package(qt5gui required) find_package(openmp) if (openmp_found) message("openmp found") set(cmake_c_flags "${cmake_c_flags} ${openmp_c_flags}") set(cmake_cxx_f...

c++ - Can i check if a chunk of memory (e.g., allocated using malloc) stays in the cache? -

assume allocate space using malloc. can check whether continuous memory remains within cpu's cache (or better within cache levels l1, l2, l3 etc.) in run-time ? determining content of cpu cache low level , beyond c can do. in fact, caching transparent code may writing cpu pretty decides cache , cannot afford waste timein convoluted logic on how so. quick googling on specific tools effect came intel tuning guide , performance analysis papers: https://software.intel.com/en-us/articles/processor-specific-performance-analysis-papers . obviously, vendor specific. amd have specific tools.