Posts

command line - Ruby commandline program exit then message appears -

command line - Ruby commandline program exit then message appears - trying write ruby command line interface. when programme exits, message appear. here program: require 'open-uri' url = argv[0] if url.nil? abort "no url provided" end begin puts open(url) rescue => e abort e.message end i following > ruby -ilib bin/command http://iservice.ltn.com.tw/2014/specials/nonukes/news.php?rno=1&type=l&no=998123 [1] 8642 [2] 8643 [2]+ done type=l > #<stringio:0x007fdf96ac82f8> [1]+ done ruby -ilib bin/command http://iservice.ltn.com.tw/2014/specials/nonukes/news.php?rno=1&type=l&no=998123 > as can see, unusual lines appears first such [1] 8642 , programme exits. , after sec shell prints out #<stringio:0x007fdf96ac82f8> , , hangs there. have press come in in order exit program. update seems happens url such the 1 listed in example. why programme exits print resu...

Highcharts: collecting all charts on a page second time produces error -

Highcharts: collecting all charts on a page second time produces error - i have puzzling situation. i have page few column charts. on page, there link, clicking on builds form , sends info server, sends pdf document: $('#my-link").click(function(ev) { var svgarray=[]; $(highcharts.charts).each(function(i, chart){ svgarray.push(chart.getsvg()); <!--show error "typeerror: chart undefined" in firefox when clicking on sec time without refreshing page --> }); var svgjson = json.stringify(svgarray); var form = $('#my-form'); var ele = $('<input name="chartsvgarray" style="display: none" value="' + $.base64('encode', svgjson) + '">'); form.append(ele); form.submit(); ev.preventdefault(); }); the browser able pdf document (with charts in it) server , prompts me opening or saving it. in abo...

php - Can't access laravel page in vhost setup -

php - Can't access laravel page in vhost setup - i have problem set of laravel using vhost. have different projects using vhost , has no problem when seek set laravel can't access in web browser. redirect google page , searching vhost url. so far here's did. i included vhost entry in httpd-vhosts.conf file <virtualhost *:80> servername dev.laravel_validation.local serveralias dev.laravel_validation.local documentroot "c:/users/web4/desktop/laravel/laravel_validation/public" <directory "c:/users/web4/desktop/laravel/laravel_validation/public"> options indexes followsymlinks multiviews allowoverride order allow,deny allow </directory> </virtualhost> i include name in windows hosts file 127.0.0.1 dev.laravel_validation.local then restart wampserver. , access url dev.laravel_validation.local browser doesn't display laravel's welcome page. i ...

.net - How to save graphic create by Graphics.DrawLine on PictureBox -

.net - How to save graphic create by Graphics.DrawLine on PictureBox - its possibility save graphic create graphics.drawline on picturebox image picturebox? its seen this: http://pl.tinypic.com/r/140k6xf/8 my drawing function: public sub picturebox2_mouseclick(byval sender object, byval e system.windows.forms.mouseeventargs) handles me.mousedown if picturebox1.image nil msgbox("upload image first", msgboxstyle.critical) else dim g graphics = graphics.fromimage(picturebox1.image) dim blackpen new drawing.pen(colordialog1.color, 0.5) dim currpoint point dim drawfont new font("arial", 8) dim drawbrush new solidbrush(colordialog1.color) dim drawformat new stringformat drawformat.alignment = stringalignment.center g = picturebox1.creategraphics() if previouspoint.isempty = true previouspoint = new point(e.x - 231, e.y - 52) mpx1 = e.x ...

c++ - Linux fork() + pipe() confusion -

c++ - Linux fork() + pipe() confusion - i'm having little bit of problem writing lastly bit of recommended exercise (personal shell), mainly, forking final execvp in chained command composition via pipe ( | ). while actual piping works 1 execvp another, final execvp within of execute() function not forked , hence kill master programme when executed. however, when effort fork it, funny behavior on terminal. namely, duplicate entries on stdout. ultimately, main question have this: how can fork final execvp in execute() without messing out input , output pipes? could please point me in right direction how fork process 1 final time in order safely execute execvp without messing out final pipes , disrupting parent shell? the logic works so: take in string of input --> convert vector of strings-- > pass vector execute(), fires off execprocess() if sees more 1 command because requires piping. the final execvp in execute() meant run lone command of simple input ...

CRUD implementation using Laravel 4 (code review) -

CRUD implementation using Laravel 4 (code review) - i not sure if allowed here inquire code review, i'll give seek code improvements. ok started using laravel 4, read tutorials on how implement crud in laravel. , able develop portion of it. going show more on controller , eloquent orm. i have here 2 models "group" can have 1 "country", "country" can assigned different "group" ("one many") group model class grouping extends eloquent { protected $table = 'group'; protected $guarded = array('group_id'); protected $primarykey = 'group_id'; public function country() { homecoming $this->belongsto('country', 'country_id'); } } country model class country extends eloquent { protected $table = 'country'; protected $primarykey = 'country_id'; public function group() { homecoming $this->hasmany('grou...

xcode - How to access image files in a today notification widget -

xcode - How to access image files in a today notification widget - is there kind of restriction when accessing image through widgets extension? have image within widget extension supporting files grouping called pocket.png i want utilize image through widget custom view controller , usual wrote code var pocketimage:uiimage = uiimage(named: "pocket") to surprise code returns blank. tried pocket.png same problem. now tried image path , below code returns nil let pathx = nsbundle.mainbundle().pathforresource("pocket", oftype: "png") so how access local available image? note: same code works fine when utilize in main application local image. there issue xcode didn't re-create images properly. had delete , re-create them 1 time again prepare issue. xcode swift widget ios8-today-widget