Posts

java - Creating a 3D shadow effect on images with itextpdf -

i want create 3d shadow effect on images place in pdf. using itextpdf. question similar : adding shadow effect on itext elements but images , not texts. images placed in table cells. long table not completed, no way actual size of image nor coordinates in page, makes tricky. brilliant id ? , regards, sylvain 4 hours later, found way using pdfcellevent , drawing need inside cell's padding. static class shadowrectangle implements pdfpcellevent { public void celllayout(pdfpcell cell, rectangle rect, pdfcontentbyte[] canvas) { pdfcontentbyte lcb = canvas[pdfptable.linecanvas]; // paddings border int paddinghorizontal = 8; int paddingvertical = 8; // width of shadow int shadowwidth = 7; // calculate border location , size float left = rect.getleft() + paddinghorizontal; float bottom = rect.getbottom() + paddingvertical; float width = rect.get...

python - Django server url alias -

how can set alias in django server, example : http://10.179.146.45:8080/en/ to http://my_name/en/ i run server without apache , without mod_wsgi. you can specify host name , port django development server. $ manage.py runserver my_name:8080

linux - Find number of occurrences of keyword in log file within last minute -

for purposes of publishing metrics aws cloudwatch information of number of occurrences of keyword (eg., error, exception) within last minute (from current system time) in application logs. following commands have tried far based on answers related thread ( filter log file entries based on date range ): awk -vdate=`date -d'now-1 minutes' +["%y-%m-%d %h:%m:%s"` '($1 fs $2) > date {print $3}' application.log | grep "error" | uniq -c awk -vdate=`date -d'now-1 minutes' +["%y-%m-%d %h:%m:%s"` '{if ($1 > date) {print $3}}' application.log | grep "error" | uniq -c awk -vdate=`date -d'now-1 minutes' +["%y-%m-%d %h:%m:%s"` '{if ($1 == $date) {print $3}}' application.log | grep "error" | uniq -c but error when try this: awk: cmd. line:1: 13:06:17 awk: cmd. line:1: ^ syntax error following format of log file: 2016-02-05 12:10:48,761 [info] org.xxx 2016-02-05 12:10:4...

android - How to retain in app Locale change after orientation change -

i able change locale within application, once orientation changes app resources reloaded default system language. without seeing code... call same code changed location oncreate()

bash - Subtracting numbers in a column -

inside file have column numbers 10 elements. want subtract 1st 3rd number, 2nd 4th, 3rd 5th, 4th 6th, , on till 8th 10th. for example: 10.3456 6.3452 11.2456 5.6666 10.5678 6.4568 14.7777 7.5434 16.5467 8.9999 and file subtraction 3rd-1st 4th-2nd 5th-3rd 6th-4th 7th-5th 8th-6th 9th-7th 10th-8th quick , dirty: $ awk '{a[nr]=0+$0}end{for(i=3;i<=nr;i++)print a[i]-a[i-2]}' file 0.9 -0.6786 -0.6778 0.7902 4.2099 1.0866 1.769 1.4565 update: came funny way: $ awk 'nf>1{print $1-$2}' <(paste <(sed -n '3,$p' file) file) 0.9 -0.6786 -0.6778 0.7902 4.2099 1.0866 1.769 1.4565 update2, make result csv: kent$ awk '{a[nr]=0+$0}end{for(i=3;i<=nr;i++) printf "%s%s", a[i]-a[i-2],nr==i?rs:","}' file 0.9,-0.6786,-0.6778,0.7902,4.2099,1.0866,1.769,1.4565

Azure: BadRequest: Last endpoint can not be removed from reserved VIP -

Image
i not know how azure allows enter 2 identical endpoints in different vms, same vip. can not remove these endpoints. have idea how should do? endpoints error when removing endpoints i've tried remove vips , reserved ips... i have mention have not tried myself, looks command need run prior deleting endpoint is remove-azurereservedipassociation -reservedipname $rip -servicename $service -virtualipname $vip

react native - custom sceneConfigs for navigator.push not working -

i using component of routing in application. through props, of functions within component calling navigator.push. an example... login(navigator) { navigator.push({view: 'profile'}); } showmodal(navigator) { navigator.push({ view: 'modal', sceneconfig: navigator.sceneconfigs.floatfrombottom }); } when navigate profile via login function, navigates me floatromright default. when navigate showmodal, floatfromright regardless of floatfrombottom call. what going on here? doing improperly? $ react-native -v react-native-cli: 0.1.10 react-native: 0.19.0 the solution provided david worked. navigator looks follows: render() { return ( <navigator style={styles.application} initialroute={{id: 1}} configurescene={route => { if (route.sceneconfig) { return route.sceneconfig; } return navigator.sceneconfigs.floatfrom...