[Teaching programming] Lesson two - lazyblog
It wasn't clear, and still isn't to me as of now, how S-exps are counted in a list, for example
;; how many are here? Is it 2?
(((a b c) d))
;; write the function "2nd" that given a list of atoms | |
;; returns the second atom | |
;; return values for illegal cases are up to you | |
;; try to be reasonable though | |
(define 2nd | |
(lambda (lat) | |
;; ... | |
)) | |
;; then write the results for these applications by running your function | |
(2nd '()) ;; ??? |
It wasn't clear, and still isn't to me as of now, how S-exps are counted in a list, for example
;; how many are here? Is it 2?
(((a b c) d))
;; given leq? that checks for lists equality | |
;; complete the following, so that the result is true | |
;; all these exercises can be solved with combinations of | |
;; car, cdr, cons | |
;; be creative! | |
;; this is just an example I solved for you :) | |
;; l -> (1 2 3) | |
;; m -> (0 1 2 3) |
I hate to use "teaching" and "lesson", but those are the easiest words that come to mind right now.
I will be teaching a friend of mine how to program, from zero to (hopefully) web dev so she can see if it could be something she would like to do for a living.
To give her the basic concepts I am going to use The Little Schemer. I feel like it's
It started in March 2017 and it ended this afternoon 19/09/2017, when I finally realised I am going to sign with this company.
1) Write an algorithm (choose the language you prefer) that given a character string, for instance {‘c’,’a’,’i’,’o’,’p’,’a’}, will print out the list of characters appearing at least 2 times. In this specific example, it would return {‘a’}. Afterwards, comment out the cost in terms of space and time.
// I've left out validation to concentrate on the algorithm itself, I hope it's ok
// O(n) time
A lot of time has passed since I willingly wanted to learn a frontend JS framework, I am doing it again because
So recently I've been interviewing and as you can imagine that means doing take home problems and online tests.
I am not pointing fingers (so please continue hiring me lol), I am addressing the problem in the industry, because almost everyone is doing it in the same way, so you could say no one is directly responsible. Even though willingness to have a better process should be a thing.
This is a blog post / diary of my journey through this task, as I'm writing this words I have no idea how and if I will be able to achieve the goal. But, if you're reading this, then probably there's hope.
racket/trace
prints calls to a function, that could be useful when dealing with recursion:
It took some time to figure out how to override Skewer's defaults, turns out this is what worked, without the hook it was not working.
(add-hook 'js2-mode-hook #'(lambda ()
(spacemacs/set-leader-keys-for-major-mode 'js2-mode
"'" 'nodejs-repl
"ee" 'nodejs-repl-send-last-sexp
"eb" 'nodejs-repl-send-buffer
"er" 'nodejs-repl-send-region)))