giovedì, dicembre 22, 2016
concatenate pdf files with ubunbtu
$ pdfunite ES_0818_1.pdf ES_0818_2.pdf ES_0818_3.pdf ex_082018.pdf
In order to remove an (unknown) password from a protected pdf use this command:
$ gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf
factorial with RecursiveTask
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.ForkJoinPool; | |
import java.util.concurrent.ForkJoinTask; | |
import java.util.concurrent.RecursiveTask; | |
/** | |
* Created by enrico on 12/21/16. | |
*/ | |
public class Factorial { | |
private static class FactorialTask extends RecursiveTask<Long>{ | |
long n; | |
private FactorialTask(long n){ | |
this.n = n; | |
} | |
@Override | |
protected Long compute() { | |
if(n<=1) return 1L; | |
FactorialTask ft = new FactorialTask(n-1); | |
ft.fork(); | |
return n * ft.join(); | |
} | |
} | |
public long factorial(long n){ | |
ForkJoinTask<Long> fjt = new FactorialTask(n); | |
ForkJoinPool pool = new ForkJoinPool(); | |
return pool.invoke(fjt); | |
} | |
public static void main(String[] args) { | |
long result = new Factorial().factorial(5); | |
System.out.println(result); | |
} | |
} |
domenica, agosto 07, 2016
venerdì, giugno 17, 2016
ReactJS Resources
- https://www.pluralsight.com/courses/react-styling-components
- https://egghead.io/courses/react-fundamentals
- React in 15ish minutes - Reactjs Tutorial
- React Official
- https://www.codeschool.com/screencasts/add-a-build-system-to-a-react-application
- https://www.codeschool.com/screencasts/es2015-and-the-virtual-dom-in-a-react-application
- https://www.codeschool.com/screencasts/add-a-router-to-a-react-application
- http://jamesknelson.com/learn-raw-react-no-jsx-flux-es6-webpack/ - [new!]
giovedì, maggio 19, 2016
lunedì, aprile 18, 2016
backticks on italian keyboard
https://forums.modx.com/thread/55468/backtick-e-tilde-su-una-tastiera-italiana
Alt Gr + ’ = `
Alt Gr + ì = ~
Alt Gr + ’ = `
Alt Gr + ì = ~
martedì, febbraio 23, 2016
ab benchmark
$ ab -A myUsername:myPassword -n 1000 -c 1000 http://localhost:8090/api/words
http://httpd.apache.org/docs/2.4/programs/ab.html
http://httpd.apache.org/docs/2.4/programs/ab.html
mercoledì, febbraio 17, 2016
Restarting wireless in Ubuntu
$ sudo service network-manager restart
$ sudo nmcli nm sleep false && sudo pkill -f wpa_supplicant
http://askubuntu.com/questions/564556/cant-connect-to-wifi-after-suspend
$ sudo nmcli nm sleep false && sudo pkill -f wpa_supplicant
http://askubuntu.com/questions/564556/cant-connect-to-wifi-after-suspend
Iscriviti a:
Post (Atom)