#Haskell基础
- 语法、语义
- 常用函数实现
- 函数参考
- 语法拾遗
- Codeforces
- 99 Problem
- Euler
- Queue
module Lab3 where | |
----------------------------------------------------------------------------------------------------------------------------- | |
-- LIST COMPREHENSIONS | |
------------------------------------------------------------------------------------------------------------------------------ | |
-- =================================== | |
-- Ex. 0 - 2 | |
-- =================================== |
#Haskell基础
(by @andrestaltz)
So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
module Lab2 where | |
------------------------------------------------------------------------------------------------------------------------------ | |
-- Lab 2: Validating Credit Card Numbers | |
------------------------------------------------------------------------------------------------------------------------------ | |
import Data.Char | |
-- =================================== | |
-- Ex. 0 | |
-- =================================== |
#!/bin/bash | |
export here=`pwd` | |
cd /Applications/MATLAB_R2014a.app/bin | |
./matlab -nodesktop -r 'cd $here' | |
unset here |
Let's say somebody temporarily got root access to your system, whether because you "temporarily" gave them sudo rights, they guessed your password, or any other way. Even if you can disable their original method of accessing root, there's an infinite number of dirty tricks they can use to easily get it back in the future.
While the obvious tricks are easy to spot, like adding an entry to /root/.ssh/authorized_keys, or creating a new user, potentially via running malware, or via a cron job. I recently came across a rather subtle one that doesn't require changing any code, but instead exploits a standard feature of Linux user permissions system called setuid to subtly allow them to execute a root shell from any user account from the system (including www-data
, which you might not even know if compromised).
If the "setuid bit" (or flag, or permission mode) is set for executable, the operating system will run not as the cur
import Data.List | |
beadsort :: [Int] -> [Int] | |
beadsort = tail $ map (length. concat) $ inits $ group $ map sum $ transpose $ map (\n -> replicate n 1) |
(by @andrestaltz)
So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
var reverse = function(str){ | |
if (str.length==0){ | |
return str; | |
} | |
else{ | |
return reverse(str.substring(1))+str[0]; | |
} | |
} |
As compiled by Kevin Wright a.k.a @thecoda
(executive producer of the movie, and I didn't even know it... clever huh?)
please, please, please - If you know of any slides/code/whatever not on here, then ping me on twitter or comment this Gist!
This gist will be updated as and when I find new information. So it's probably best not to fork it, or you'll miss the updates!
Monday June 16th