Posts

Best solution / practice for temp files with Google App Engine PHP? -

what's accepted wisdom/tech solution temp files on gae using php, please? i need store , process image (a few hundred k in size) using php momentarily (e.g. < 1 second) needs exist temp file somewhere before it's sent on elsewhere , temp file can deleted. site need autoscale potentially large numbers of users (using gae standard). my idea attempt store temp file in memory (using tempnam() etc) , if failed (e.g. mem full on instance), try , use other storage instead on fly. question what? image has available file curl access (i think?) , send elsewhere, memcache not option (can't access data file pass curl - or can i?), e.g. cloud storage (via 'gs://[bucket-name]/...'). thing is, if i've written file storage, available reading? that's significant cost incurred... any appreciated! thanks, alex gcs provides default application free bucket tied app well. there no quota bucket. using default bucket to use default bucket: d...

linux - Need help in file filtering -

i have list of host names in file , 1 more file complete host names details in file b.i want remove hosts matches hosts in b file.any short script this?please let me know. ex: cat server1 server2 server3 server4 cat b server700 server1 server300 server4 so here in , b ,server1 , server4 matching,so need script removes matching servers names fromb in file something on these lines might out. adjust regular expression on grep command sure match hostnames on details file: cat file_with_hostnames | while read hname; grep -q "$hname" file_with_host_details || echo $hname; done

javascript - onclick send data to another page -

im trying use onclick function send url page in php. have similar function add function remove nothing, removes button page. no errors visible in console either. this function: function remove(id) { $.ajax({ type: 'post', url: 'cart.php?remove='+id, success: function ( response ) { alert( 'removed: '+id ); } }); } i have tried alert('some text'); same thing. button is: onclick="remove(<?php echo $value; ?>)" the button on cart.php being included on main.php

reactjs - How can I modify the props of one child component from a separate child component? -

i working on scheduling application using reactjs & flux. in application, user need able select specific shift , assign employee cover it. employee assignment occur clicking on employee's name in separate list. component structure follows: schedule app component employee list component employee list item component calendar component month component day component shift component after selecting shift clicking on it, (there 2 - 5 shifts on given day) able click on employee list item , have value of employeename prop (this.props.employeename) assigned selected shift's shiftassignee prop (this.props.shiftassignee). the data both calendar , employees generated when application starts, , stored separate objects in local storage 'calendar' , 'employees' respectively. have data updated as part of flux data flow can retain instead of regenerating every time app starts, wiping previous data, that's not immediate concern. the basic struct...

javascript - Setting div Background using Trianglify -

i have problems using trianglify plugin. use set background of div . how can this? couldn't find proper example. here's sample code: <script> var pattern = trianglify({ width: window.innerwidth, height: window.innerheight }); document.body.appendchild(pattern.canvas()) </script> also, can have div s different backgrounds come trianglify? one div here example of setting div background trianglify pattern. cheats bit , sets div child node pattern should work you. var = document.getelementbyid('something'); var dimensions = something.getclientrects()[0]; var pattern = trianglify({ width: dimensions.width, height: dimensions.height }); something.appendchild(pattern.canvas()); the div has id of something , css styles set on div height , width. working example jsfiddle: http://jsfiddle.net/u55cn0fh/ multiple divs we can expand multiple divs so: function addtriangleto(target) { var dimensions = target.getc...

Rounded Edge in Circular progress Bar Android -

Image
i want creat circular progressbar rounded edge. have tried circleprogress library hosted here https://github.com/lzyzsd/circleprogress but donutprogress don't have rounded edge want. custom progreesdrawable not able achieve it. i want design progress bar shown below one corner rounded marked in picture. my custom_progress_bar.xml <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@android:id/progress"> <rotate android:fromdegrees="90" android:todegrees="90" android:pivotx="50%" android:pivoty="50%" > <shape android:innerradiusratio="2.5" android:shape="ring" android:thicknessratio="15.0" > <corners android:radius="5dp" android...

linux - Grep capping size of results lines, for multiple grep phrases? -

i grepping terms this: grep 'term1\|term2\|term3\|term4' and want say, lines found, cap results 100 characters. found examples how when searching 1 term, none accommodating or-ing of search terms. try gnu grep: grep -e 'term1|term2|term3|term4' file | grep -oe '^.{100}'