Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org Entries for January 2013

Notices

Concerning free software, programming, and whatever else I find interesting. Also the blog for my Web site, frigidcode.com.

Posted 01-31-2013 at 01:21 AM by hydraMax (Bits and Pixels)
Tags

I'm doing a CS class which forces me to use C++. I was not very excited about this. However, I have recently be greatly encouraged by the discovery that C++ does, in fact, have lambda functions (or, more properly, anonymous functions) at least in the C++11 standard:

https://en.wikipedia.org/wiki/Anonym...ctions#C.2B.2B

Basically, the big deal here is that I can construct new functions /inside/ of other functions, and even capture variables from the context. This,...
Member
Posted in Uncategorized

## Quick and dirty plotting with Haskell: Supplement

Posted 01-14-2013 at 11:54 PM by hydraMax (Bits and Pixels)

I just wanted to add a brief note to my previous post: It is also quite simple to do a plot with multiple functions. The following code gives the graph seen in the attached PNG:

Code:
```h> import Graphics.Gnuplot.Simple
h> let f x = 3 - 2*x + 4*x**2
h> let g x = 8*x - 2
h> let h a x = g a * (x - a) + f a
h> plotFuncs [] (linearScale 1000 (-10,10)) [f, g, h (-5)]```
f(x) is a function, g(x) is the derivative of f(x), and...
Attached Images
 plotFuncs.png (49.5 KB, 4 views)
Member
Posted in Uncategorized

## Installed Nix

Posted 01-09-2013 at 01:49 PM by hydraMax (Bits and Pixels)
Tags nix

I recently installed the Nix package manager on my system:

https://nixos.org/nix/

Nix is an intriguing idea: a purely functional and deterministic package management system. Nix allows you to install, upgrade, and remove packages on your system without ever having to worry about breaking the dependencies of other packages already installed on your system. This is impossible, by design. Likewise, after installing new packages, you are free to roll back those changes...
Member
Posted in Uncategorized

## haskell: get lines and handle end of file

Posted 01-01-2013 at 02:23 AM by hydraMax (Bits and Pixels)
Updated 01-01-2013 at 02:27 AM by hydraMax

I thought I'd post this convenience function, since I didn't see an obvious one in base:

Code:
```import Prelude hiding (catch)
import Control.Exception
import System.IO.Error hiding (catch)

readl f = catch (getLine >>= return . Just)
(\e -> if (isEOFErrorType . ioeGetErrorType) e
then return Nothing
else ioError e)
>>= \a -> case a of```
...
Member
Posted in Uncategorized