Friday, May 01, 2015
I thought I was burnout, but after a week of doing nothing with computer, felt bored, super bored.
Try to pick up reading again, and do some little programming when I'm free. still stay away from news.
Sunday, May 03, 2015
picking up clojure again, reading Living Clojure.
this time is easier, maybe I still remember what I read from those lisp books...
Thursday, May 07, 2015
almost finish Living Clojure, will probably read the macro chapter later. it's a nice book, can start working on real world project after reading it.
I think I'll focus on clojure for now, it combines lisp, java (jvm), go (core/async) and javascript (clojurescript), which are languages I've been learning for the last year.
Seven Web Frameworks in Seven Weeks talks about two clojure frameworks, ring and immutant (actually they are both libraries, not really a framework), I may take a look at them and also compojure.
Thinking about upgrade to http2, in java world, jetty and undertow both implemented http2. however, TLS is one problem (no browser is willing to support non-TLS http2). anyways, wait for nginx probably.
Orgzly, org-mode on android. Tried, pretty good. Still need to find a better way to sync files (it supports dropbox, git repo is coming).
Saturday, May 09, 2015
quite a few posts about "old programmers" recently
- Why Lisp? | Hacker News
- 4 Reasons to Employ Older Developers : programming
- "7 timeless lessons of programming ‘graybeards’" - This was a good read. : programming
tried Facebook PathPicker, quite nice.
Monday, May 11, 2015
reading this long thread: What is the appeal of dynamically-typed languages? : programming
one thing I was wondering is why clojure is dynamically typed? (surely Rich Hickey has his reason for this decision). clojure has been mentioned quite a lot in this thread.
also found this comment useful for quick start a Reagent project:
lein new reagent my-app
cd my-app
lein ring server
// server started and browser opened
// in a different terminal
lein figwheel
// start clojurescript compiler and watch for changes
then change to src/cljs/my_app/core.cljs
will instantly reflected in the browser autometically. (cool ~)
the commenter is creator of Luminus framework, and wrote Web Development with Clojure, which is on my reading list already.
Tuesday, May 12, 2015
for the http2 upgrade, nginx may need to wait 11 months, so will try tatsuhiro-t/nghttp2 first, using dockerfile from dajobe/docker-nghttp2
saw Swagger while reading news, looks good. here is there ui component: swagger-api/swagger-ui
there is a ring wrapper for clojure: metosin/ring-swagger
for php: Swagger-PHP, and Laravel: slampenny/Swaggervel
also found some tools for my clojure stack:
- elasticsearch client: Elastisch
- markdown parser: yogthos/markdown-clj
- rabbitmq client: Langohr
other things just use java, pretty much what I need for now.
The Clojure Toolbox has more links.
Wednesday, May 13, 2015
for a long time I use jackrabbit webdav clinet, today I just tried lookfirst/sardine, and it's a lot cleaner and easy.
String baseUrl = "https://webdav.example.com/folder";
Sardine sardine = SardineFactory.begin("username", "password");
List<DavResource> resources = sardine.list(baseUrl);
resources.stream().forEach(System.out::println);
String filename = "file.txt";
InputStream is = sardine.get(baseUrl + filename);
Files.copy(is, Paths.get(filename));
(note, for a simple GET, use curl
is easier)
Friday, May 15, 2015
Javaslang is a component that brings more functional to java, interesting.
but i'm already very satisfied with java 8. more and more of my scripting tasks have been moved to java 8 and clojure. now it's more simple to write, runs everywhere and standalone (all in one jar), it can also give you concurrency anytime you want.
Sunday, May 17, 2015
the big news of course is Announcing Rust 1.0, it's funny that everything is positive before a language hits 1.0, then people start complaining, suddenly everybody hates it. just like ruby, nodejs, go. I don't have time for rust right now, and still too soon to jump in.
I don't feel like coding nodejs anymore, but Electron is interesting. when Light Table came out, I already feel that it's the way to do cross platform.
for clojure descjop is a quick way to setup a electron (atom-shell) project, just follow the steps I can have a hello world desktop app up and running, how nice.
continuing adding tools to my website stack, will add a redis as cache and message queue. I can setup a rabbitmq / kafka / nsq, but redis is simple and good enough. ptaoussanis/carmine · GitHub is a redis client for clojure.
Thursday, May 21, 2015
my thrid attempt on reading Clojure Programming, still find it challenging. anyways, keep trying.
Friday, May 22, 2015
there's an article (Advantages of monolithic version control) talks about putting all stuffs in a big repo, which I found makes sense to my projects.
got confused about the usage of ->
, ->>
, comp
, but found a good explaination here:
(from Can someone explain Clojure Transducers to me in Simple terms? - Stack Overflow)
they all do the same:
nested calls
(reduce + (filter odd? (map #(+ 2 %) (range 0 10))))
functional composition
(def xform
(comp
(partial filter odd?)
(partial map #(+ 2 %))))
(reduce + (xform (range 0 10)))
threading macro
(defn xform [xs]
(->> xs
(map #(+ 2 %))
(filter odd?)))
(reduce + (xform (range 0 10)))
With transducers:
(def xform
(comp
(map #(+ 2 %))
(filter odd?)))
(transduce xform + (range 0 10))
and another explaination of "why":
(from Difference between arrow and double arrow macros in Clojure - Stack Overflow)
As a rule, when a function works on a singular subject, that subject is the first argument (e.g., conj, assoc). When a function works on a sequence subject, that subject is the last argument (e.g., map, filter).
So,
->
and->>
are documented as threading the first and last arguments respectively, but it is also useful to think of them as applying to singular or sequential arguments respectively.
For example, we can consider a vector as a singular object:
(-> [1 2 3]
(conj 4) ; (conj [1 2 3] 4)
(conj 5) ; (conj [1 2 3 4] 5)
(assoc 0 0)) ; (assoc [1 2 3 4 5] 0 0)
=> [0 2 3 4 5]
Or we can consider it as a sequence:
(->> [1 2 3]
(map inc) ; (map inc [1 2 3])
(map inc) ; (map inc (2 3 4))
(concat [0 2])) ; (concat [0 2] (3 4 5))
=> (0 2 3 4 5)
Monday, May 25, 2015
I pick Selmer as templating language after reading Choosing a templating language in clojure
for a new created compojure app, its standalone jar file is about 7M, smaller than I expected.
will put it in a docker container - I didn't think container is good for jvm app, since it is already running in a vm. but now I think maybe it's not a bad idea, the architecture is different now, things are decoupled to many small standalone components, use docker to manage them is easy and clean.
Tuesday, May 26, 2015
I don't quite understand transducer yet, even after some readings:
- Transducers are Coming — Cognitect Blog
- Transducers are coming to Clojure | Hacker News
- Clojure's Transducers are Perverse Lenses
- Understanding Clojure transducers through types
- Some trivial examples of using Clojure Transducers
I think there will be more on transducers when clojure 1.7 releases, just skip it for now.
There's a super cool firefox add-on: Window Master, very useful when you have more than one monitors.
Wednesday, May 27, 2015
lispy is a paredit-like emacs package for editing lisp codes, but using vi key bindings. however, I found it doesn't work well with evil-mode.
evil-lisp-state is another one, but extra keystrokes for the leader comination prefix.
Thursday, May 28, 2015
reading Read Lisp Hackers, I really like it, especially Pascal Costanza's chapter.
one of the interviewer, Edi Weitz, is writing a book: Common LISP Recipes: A Problem-Solution Approach
Friday, May 29, 2015
reading some old issues of Linux Journal, on November 2014 Issue it introduced ZBackup, simple, very *nix. I will use it as my backup tool.
the other article on using ssh-agent to store authentication keys and allowing normal users sudo
to a special account then they can access remote servers, also an interesting one.
Saturday, May 30, 2015
lein
is slow, I tried drip but seems not helping, may try something simular later.
Blog Archive
- Newer Entries
- 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
- 2024 October
- 2024 November
- 2024 December
- Older Entries
- 2015 April
- 2015 March
- 2015 February
- 2015 January
- 2014 December
- 2014 November
- 2014 October
- 2014 September
- 2014 August
- 2014 March
- 2014 February
- 2014 January
- 2013 December
- 2013 October
- 2013 July
- 2013 June
- 2013 May
- 2013 March
- 2013 February
- 2013 January
- 2012 December
- 2012 November
- 2012 October
- 2012 September
- 2012 August