Wednesday, January 07, 2015
start reading Filthy Rich Clients, although it's from 2007, but comments are good so I think I should read it.
its website has a netbeans plugin for all examples, cool
Friday, January 09, 2015
TIL 1:
you should use random salt, bcrypt
has built-in salts in the output hash, to prevent rainbow table attach
php 5.5's password_hash
default using bcrypt
:
$options = [
'cost' => 11,
'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM),
];
$hash = password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options);
when do verify, you don't need the salt
password_verify('rasmuslerdorf', $hash); // true
password_hash
by default already using a random salt, then why use mcrypt_create_iv
above?
the answer is here: Seven Ways To Screw Up BCrypt:
Instead, you should use strong randomness while not using CS randomness. A perfect source would be /dev/urandom. Other sources would be mcrypt_create_iv when paired with MCRYPT_DEV_URANDOM.
so just don't use a static salt.
TIL 2:
emacs-eclim
already has basic PHP support, when installing eclim
, just check php
support.
finally i have my editor supports namespaces.
TIL 3:
using emacs's tramp
mode to edit remote file or run remote script is super easy.
this is an interesting video: Alan Kay's tribute to Ted Nelson at "Intertwingled" Fest inside i think it's the demo which steve jobs saw back in 1979.
more about it, read The Early History Of Smalltalk by Alan Kay and listen Floss Weekly episode 29: Dan Ingalls
trying Apache Samza, also from Linkedin
Sunday, January 11, 2015
a script to run sopcast
if [ -z $1 ]
then
exit
fi
sp-sc-auth sop://broker.sopcast.com:3912/$1 3344 8899 > /dev/null 2>&1
then open use vlc to open http://localhost:8899/tv.asf
Tuesday, January 13, 2015
in order to build storm, require a clojure repo too, put it to build.gradle
:
repositories {
jcenter()
maven { url 'http://clojars.org/repo' }
}
dependencies {
compile 'org.apache.storm:storm-core:0.9.3'
}
Friday, January 16, 2015
quick links:
- very cool emacs package: undo-tree
- video shows how to write a spotify client using elisp
- vagrant of wordpress on hhvm
TIL:
to grep lines above/below the matched pattern, use grep -A
and grep -B
to grep lines until a specific character, use awk '/match/,/character/'
for example curl -s http://httpbin.org/get | python -mjson.tool | awk '/headers/,/},/'
will give me only the headers
section
TIL 2:
to enter the lambda symbol λ
, use c-x 8 RET 03bb RET
or (insert-char #x03bb)
Monday, January 19, 2015
quick links:
- LICEcap capture an area of your desktop and save it directly to .GIF.
- Keycastr captures key strokes (mac)
- JMH is a tool to do Java benchmarking.
TIL: when looking for a way to literal create HashMap
, I learned one of the Hidden Features of Java: Double Brace Initialization:
// diamond doesn't work here for anonymous class
// @see http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6894753
Map<String, String> map = new HashMap<String, String>() {{
put("a", "one");
put("b", "two");
}};
it's an instance initialization block of anonymouns class:
Map<String, String> map = new HashMap<String, String>() {
// instance initialization block
{
put("a", "one");
put("b", "two");
}
};
double brace initialization is funny, but creating a new class just for a map seems like an overkill. the best way is using guava's ImmutableMap:
final Map<String, String> map = ImmutableMap.of("a", "one", "b", "two");
Wednesday, January 21, 2015
One thing I don't like about Java, it's massive!
I'm reading Pro Spring Batch, googling some new terms mentioned in the book. Suddenly there're Spring Integration, Spring XD, Spring Data... When I try to find out what exactly integration means, I was told that I need to read the Enterprise Integration Patterns book; check some samples. Also something metioned but not related, Neo4j, leads me to graph database.
Maybe I'll stick with my cron
.
I feed sad about Groovy and Grails, I like Groovy, but it's slow IMO. After Java 8 came out, I don't see any reason to use it.
I may try JRuby as people said maturity of JRuby is one reason why Groovy's popularity ranking is dropping.
When I followed this guide, the recently good java experience is gone. BeanPropertyItemSqlParameterSourceProvider
, seriously?
Thursday, January 22, 2015
I hate XML, but I hate annotations even more. Annotations should be optional, like @Override
.
I want to do Java, but I don't do anything with XML and annotations.
TIL:
- github supports
org
files - you can write your
elisp
in org mode then extract the source, or load it directly:
(require 'org)
(org-babel-load-file
(expand-file-name "settings.org"
user-emacs-directory))
Saturday, January 24, 2015
Had a quick look on these books this afternoon. very bad, what a waste of time.
- Learn Java for Web Development
- Continuous Enterprise Development in Java
- Scripting in Java: Integrating with Groovy and JavaScript
Tuesday, January 27, 2015
this week's changelog podcast is about Rocket
Thursday, January 29, 2015
playing with JRuby, very nice.
Friday, January 30, 2015
loaded rasmus' php7dev vagrant box, will try new features next week.
Blog Archive
- Newer Entries
- 2015 February
- 2015 March
- 2015 April
- 2015 May
- 2015 June
- 2015 July
- 2015 August
- 2015 September
- 2015 October
- 2015 November
- 2015 December
- 2016 January
- 2016 February
- 2016 March
- 2016 April
- 2016 May
- 2016 June
- 2016 July
- 2016 August
- 2016 September
- 2016 October
- 2016 November
- 2016 December
- 2017 January
- 2017 February
- 2017 March
- 2017 April
- 2017 May
- 2017 June
- 2017 July
- 2017 August
- 2017 September
- 2017 October
- 2017 November
- 2017 December
- 2018 January
- 2018 February
- 2018 March
- 2018 April
- 2018 May
- 2018 June
- 2018 July
- 2018 August
- 2018 September
- 2018 October
- 2018 November
- 2018 December
- 2019 January
- 2019 February
- 2019 March
- 2019 April
- 2019 May
- 2019 July
- 2019 October
- 2019 November
- 2019 December
- 2020 August
- 2020 September
- 2020 October
- 2020 November
- 2020 December
- 2021 January
- 2021 February
- 2021 March
- 2021 April
- 2021 May
- 2021 June
- 2021 August
- 2021 September
- 2021 December
- 2022 March
- 2022 April
- 2022 May
- 2022 June
- 2022 July
- 2022 August
- 2022 September
- 2022 October
- 2022 November
- 2022 December
- 2023 January
- 2023 February
- 2023 March
- 2023 April
- 2023 July
- 2023 August
- 2023 September
- 2023 October
- 2023 November
- 2023 December
- 2024 January
- 2024 February
- 2024 March
- 2024 April
- 2024 May
- 2024 June
- 2024 August
- 2024 September