Thursday, 24 October 2013

What the micro-framework?

I'm impressed by flask. I'm not a great pythonista so you will have to make up your own mind, but when I found Flask Bone my first thought was, . o O ( What is the perl equivalent to fbone? )

I've spent many years hacking Notice together, but it is far from web 2.0, (which is probably why it gets used for internal sites more than external sites, but with HTML5 Boilerplate and bootstrap it scrubs up nicely.)

So how did I find fbone? I was considering porting Notice, (which is mostly perl + jQuery ) to pyNotice, (a proposed python + jQuery.) I didn't want to re-invent the wheel, (though sometimes that can be a good thing), so I did a quick poke to see what was already out there.

Not all websites are created equal, but here are a few things that almost every site, (larger than a blog) need:
  • Login
    • Sign-up
    • Remember me
    • Forgotten password
  • Logout
  • Sessions
    • Client side data
    • Server side data
  • User data
  • File upload
  • Ajax of some sort to improve user experience
  • CSS control, (let the use change this as then need
All of this and we have not even got to the actual functionality of the site. Notice, (which is, at this time, one big perl module) splits its functionality into groups, (that are also called modules, but are not individual modules... yet.)

If you are a web developer that used perl or python, (keep your gems and php to yourself please) what do you use to jumpstart a website? Do you have a stock core code that you use? Is it open-source? Would Richard Stallman or Rev K rage at your code or rate it?

How far does this scale horizontally and vertically? Should we all be moving to happstack?

Wednesday, 16 October 2013

Haskell Data.Map.Lazy

TL;DR:  
cabal install containers # import Data.Map.Lazy

I have been enjoying the Haskell from Scratch series from Jekor over on youtube.

After checking out his example code from github I have been able to compile along with the music... until ep07

./redo redo
redo.do: 1: redo.do: redo-ifchange: not found

redo.hs:5:8:
    Could not find module `Data.Map.Lazy'
    Use -v to see a list of the files searched for.
Redo script exited with non-zero exit code: 1


"Ah ha!" I thought to myself

cabal install Data.Map.Lazy

Nope. Off to Hoogle I go and after a while I worked out that what I needed was:

cabal install containers


but it was not Hoogle, but Google that clued me in.

cabal list|grep -i Map|grep -i Lazy

didn't help. Now that I know the answer it is quite easy to find:

hoogle --info Data.Map.Lazy|grep 'From package'|awk '{print $NF}'

and even create a general Haskell module installer:

#!/bin/sh
#cabalModuleInstall
cabal install $(hoogle --info $1 | grep 'From package'|awk '{print $NF}')

About this blog

Sort of a test blog... until it isn't