Posts

ios - Consecutive UIWebView load requests in viewdidload -

i know before hand going turn out dumb question, i'm new object world , ios. in trying trouble shoot problem i'm having passing audio files uiwebview safari playing 2 files 1 after rather 1 passed. created single view app , in viewdidload, added following: - (void)viewdidload { nsurl *audio1 = [[nsbundle mainbundle]urlforresource: @"warrenwreck" withextension:@"mp3"]; nsmutableurlrequest *audioforsafari1 = [nsmutableurlrequest requestwithurl: audio1]; [self.safari loadrequest: audioforsafari1]; // second audio file nsurl *audio2 = [[nsbundle mainbundle]urlforresource: @"sequim" withextension:@"mp3"]; nsmutableurlrequest *audioforsafari2 = [nsmutableurlrequest requestwithurl: audio2]; [self.safari loadrequest: audioforsafari2]; } it plays second file only. nslog comments, not shown, show rolling through both sets of setting nsurl , load, last audio plays. have old procedural language background ,...

web crawler - Scraping for research projects: some issues -

i scraping websites research project, encountering issues think might useful many users. given well-defined topic (e.g. bird-watching or astro-physics), objectives are: identify important websites spread these ideas crawl representative sample of these websites perform network analysis , thematic analysis of data (e.g. topic models) publish results in academic venue, without publishing of crawled data to achieve goal, finding following obstacles: sampling method : obviously, it's impossible establish boundaries of sites of interest. impossible know size of dataset, how can establish representativeness of sample? can crawl 10k, 1m, or 10m pages without knowing when should stop. detection/banning issue : crawler, based on scrapy , following robots.txt , tries not hammer servers introducing increasing delays between requests, starting 25ms. however, lot of servers still detect crawler , block it. in sense, sampling process totally biased servers cut me off. legal is...

sdl 2 - Getting SDL Renderer to work on IOS? -

i've been able sdl 2 running on ios can't figure out how render ios using sdl functions. know can use opengl, , if else fails will, don't want because of how pain opengl 2d game. my end question how can sdl renderer render on ios?

Get LINUX env variable with python -

i have ~/.bashrc file: path=$path:/usr/pgsql-9.3/bin/ db_user=postgres db_password=password db_host=localhost when i'm doing os.environ['path'] : /usr/local/sbin but when i'm doing os.environ['db_user'] get: keyerror: 'db_user' how need declare vars correctly python, cause echo in shell : echo $db_user >>> postgres thanx you haven't exported variables: export db_user=postgres export db_password=password export db_host=localhost

javascript - Sencha Touch: Cmd-built app not working on mobile browser -

Image
i working st2.3.1 , cmd 4. app builds , runs fine on desktop browser not launch on browser on mobile device. loading dots blue background shows , hangs. i tried testing build on iphone 4s safari , chrome, similar results. pulled app in safari, , opened safari web inspector see what's going on, , cannot see unusual in index.html. have taken screenshot , attached below. fact loading dots show , index.html loads means dont have problem accessing webserver. any ideas why app may not launching? should expect testing build cmd work same way on mobile browser on desktop, or require additional setup/configuration? build settings otherwise unchanged , use default settings mostly. mac os x firewall problem? it's running on default factory settings. thanks in advance!

build - GulpJS: How to rev images and then update their refs in css files? -

gulp.task('usemin', function () { return gulp.src(path.src + '*.html') .pipe(usemin({ assetsdir: 'src', css: [ minifycss(), 'concat', rev()], js: [uglify(), rev()], images: [rev()] })) .pipe(gulp.dest(path.dist)); }); it not work on images. the philosophy of gulp-rev-all me way see asset revisioning. it's well explained in readme hash should take account reference(s) between revisioned files. i've mocked little example minify image , css file use background url property see revision of new image path. gulp.task('image', function () { return gulp.src('image.jpeg') .pipe(img({ progressive: false })) .pipe(gulp.dest('tmp')); }); gulp.task('css', function () { return gulp.src('test.css') .pipe(css()) .pipe(gulp.dest('tmp')); }); gulp.task('rev', ['image', 'css'], function () { return gulp.src(...

html - Select2 formatResult get attributes of option -

get custom data-attribute in select2 <select> we need same thing specified in above link. but, how attributes of option element in formatresult function? you try following code : $select2.data('placeholder', 'please choose').html(_options).select2({ formatnomatches: function (term) { return 'there no "' + term + '" item'; }, formatresult: function(term) { return $(term.element).data('cnt'); }, allowclear: true }); jsbin