Posts

Buffers and Web Audio API -

i'm working on building ambient sound generator college project , running slight issue. basically have 3 different files user can pause/play in combination, , each pause/play ok. issue if play more 1 sound @ time, 1 of 2 sounds continues play after i've hit stop. maybe can point me in direction of i'm going wrong and/or resources can learn more api. <head> <meta charset="utf-8"> <link rel="stylesheet" href="css/loopy_styles.css" /> <!--<script type="text/javascript" src="js/loop_functions.js"></script>--> <script> context = new (window.audiocontext || window.webkitaudiocontext)(); var soundbuffer1 = null; var soundbuffer2 = null; var soundbuffer3 = null; var soundbuffer4 = null; var soundbuffer5 = null; window.onload = function() { create_buffers(); }; function create_buffe...

html - min-width in page body not working -

i have set minimum width of 767px on website avoid shrunk when viewing website on smartphone. issue is doesn't seem taken consideration (see screenshot below) idea why? many thanks css: html, body { height: 100%; min-width: 767px; -webkit-font-smoothing: antialiased; text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004); background: url('../images/background-produits.jpg')no-repeat center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; font-family: 'open sans'; font-size: 16px; font-weight: 300; line-height: 1.38; color: rgb(71, 64, 50); } you've got lot of things positioned absolutely. work correctly need have them contained in item relative positioning. yep, body tag, apparently. body {position: relative}

ruby on rails - Logout redirect error -

i having trouble logging user out , clearing sessions user. keep getting following error in rails server terminal window: started delete "/logout" ::1 @ 2014-12-01 17:17:47 -0500 actioncontroller::routingerror (uninitialized constant sessoinscontroller): here controller sessions: class sessionscontroller < applicationcontroller # sessions not active record model def new end def create user = user.find_by(email: params[:session][:email].downcase) if user && user.authenticate(params[:session][:password]) log_in user redirect_to user else # flash.now used when going homepage danger # message not there anymore # designed displaying flash on rendered pages flash.now[:danger] = "invalid email/password combination" render 'new' end end # logs out current user, check session_helper details def destroy log_out redirect_to ...

bash adds escape chars when passing a string with quotes -

i'm trying run msyql command includes quoted string, eg: mysql -h host -u=user -p=pass -e "show tables" database. here i'm having difficulty pass "show tables" quotes fuction executes command. run_cmd() # run command { local output=$1 local timeout=$2 shift 2 ( $* > $output 2>&1 ) & # .... } # query mysql query_mysql(){ local mysql_cmd=( "mysql -h $host --user=$user --password=$pass -e "show tables" $db") run_cmd $output $timeout "${mysql_cmd[@]}" } query_mysql i tried many combinations, command executed either without quotes or multiple single/double/escape chars. in cases final command becomes invalid due missing/additional quotes/chars. few of attempts & final command: "show tables" mysql -h localhost --user=root --password=foo -e show tables db1 'show tables' mysql -h localhost --user=root --password=foo -e ''\''show' 'tables...

android - How is it possible to have feeds from different Urls in the same ListView -

with current project can take datas single url , display them in custom listview. there way can datas more 1 url , put in same listview if datas each url called differently? code allows me have items url: public class class1 extends fragment { private rssfeed myrssfeed = null; public class1() { } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.tab1, null); if (android.os.build.version.sdk_int > 9) { strictmode.threadpolicy policy = new strictmode.threadpolicy.builder().permitall().build(); strictmode.setthreadpolicy(policy); } try { url rssurl = new url("url"); saxparserfactory mysaxparserfactory = saxparserfactory.newinstance(); saxparser mysaxparser = mysaxparserfactory.newsaxparser(); xmlreader myxmlre...

ftp - Wait until zip fully written then continue, Bash Script -

i've been trying zip file , upload ftp using bash script, it's uploading corrupt zip file. i've had around , i'm trying use lsof | grep confirm file complete i'm not sure i'm doing. so i've got cd /var/test/tobezipped zip -r test.zip * folder="/var/test/tobezipped" zips=$(ls $folder) f in $zips ; while [ -n "$(lsof | grep $f" ] ; sleep 1 done ftp -n <<eof open myserver user user pass put test.zip eof done and test.zip corrupt @ time it's being uploaded, on other server it's not readable on server it's zipped on it's time check it. any kind of advice appreciated, i'm pretty new sort of thing , tried search around heaps find solution, not sure i'm going in right direction. in advance. from man page: put local-file [remote-file] store local file on remote machine. if remote-file left unspecified, local file name used after processing according ...

Android - Reload a Fragment that is Part of ViewPager -

i need reloading fragment part of viewpager. here current setup: reportactivity extends fragmentactivity , uses viewpager host 4 tabs tab 1 4. each tab fragment seperate layout. viewpager uses tabspageradapter switch between tabs , works expected. tab1fragment displays graph using static dataset. have added spinner dynamically change dataset , looking ways reload fragment can re-display graph correct dataset. following ints correspond values of spinner. static final int report_period_day = 0; static final int report_period_week = 1; static final int report_period_month = 2; static final int report_period_year = 3; i have method correctly calculates correct data based on the int passed in, struggling how create intent or other method recreate tab1fragment , passes int parameter. here want re-create fragment mreportperiodspinner.setonitemselectedlistener(new adapterview.onitemselectedlistener() { @override public void onitemselected...