Archive | ideas RSS feed for this section

Goal Setting for the New Year

1 Jan

Well, Happy New Year everyone and to all a good night.   :)

This year seems to me a great one for looking at new things to try.   Last year I found myself catching up on old things.   With the recession, keeping positive would have been the main goal, and I had a lot to be positive about in 2010.   For one, I got the Fusion Halifax Metropolitan Award.   A blog post I wrote about professionalism in librarianship made it to the Library Journal website, and had an amazing reflection/editorial by Francine Fialkoff .   Podcamp Halifax was very successful last year and McLean Greaves even scooped the iPad announcement three days before it was announced by Apple!  (By the way, as of now there are only 26 out of a total 350 tickets left for 2011 (to be held on January 23rd).

This year, however, I feel like I need some new goals.   Here are a few:

  • It’s time to start blogging regularly again, at least once per week.
  • I’d like to go visiting someone who is not family a little more regularly.   Time to reach out!
  • Mr. 7 insists that I help him finish his rogue-like game called “Rasghiosse.”
  • I want to do a better job recording the things that I’ve done and will do.    Too many projects exist where i am the only one who really knows how they work.

That’s good for now, there’ll be more I’m sure as the year progresses.   What are your big goals for this year?

Haskell Tutorial IV : If This is A Case of Functional Programming, Then I am Switching to Lazy Evaluation

21 Oct

Part III: How Haskell Monads are Like a Muppet       Part: V   (coming soon) >

Finally, with the forth part of the tutorial, I get to describe something that will make my PHP-coding reader want to use Haskell:  lazy evaluation.

But first, let’s go back to two different ways I’ve approached the problem of evaluating a keyboard input from a user in our rogue-like RPG game.    In tutorial #2, I created a function called move that used guards to discern what action to take based on a given input.    Here is move:

move :: Char -> String
move a
    |  a == 'w'       = "UP!"
    |  a == 's'       = "DOWN!"
    |  a == 'a'       = "LEFT!"
    |  a == 'd'       = "RIGHT!"
    |  otherwise      = "HANG AROUND AND DO NOTHING!"

In tutorial #3 I switched to a series of if / else if / else statements.

forever (do
    char <- getChar
    if char == 'q' then putStrLn "Thanks for Playing!"
         else if char == 'w' then up y >> output x >> output y
         else if char == 's' then down y >> output x >> output y
         else if char == 'a' then down x >> output x >> output y
         else if char == 'd' then up x >> output x >> output y
         else putStrLn "you did not type a correct entry")

This version had the additional side effect of requiring a manual escape of the compiler program in order to quit (something that is easily fixable, but still).    Now I have a new function ‘dashboard’ that uses lazy evaluation to compute values based on a given input.   Without beating around the bush, here it is:

dashboard :: Char -> MVar Int -> MVar Int -> IO ()
dashboard 'q' _ _ = exit "Thanks for Playing!"    // stop the program
dashboard 'w' x y = up y >> putStr " Coordinate: ( x = " >> output x >> putStr " , y = " >> output y >> putStr ")."
dashboard 's' x y = down y >> putStr " Coordinate: ( x = " >> output x >> putStr ", y = " >> output y >> putStr ")."
dashboard 'a' x y = down x >> putStr " Coordinate: ( x = " >> output x >> putStr ", y = " >> output y >> putStr ")."
dashboard 'd' x y = up x >> putStr " Coordinate:  ( x = " >> output x >> putStr ", y = " >> output y >> putStr ")."
dashboard w x y = putStr " Coordinate: ( x = " >> output x >> putStr ", y = " >> output y >> putStr ")."   // keep the Coordinate values the same

So, let’s think about our problem for a second.    So far, we have been focussed on getting our character to move around a map.    But what if we want to do something completely different, like say show an inventory list if the user hits ‘i’?    Or maybe cast a spell?     We could have a bunch of if – then statements or a whole bunch of guards, but it all could end up being a mess and impossible to read.

Fortunately, Haskell let’s you specify particular actions based on the constructors (entry values) for your function.    In the case above, dashboard accepts 3 values — one CHAR and two MVar Ints (ie. a mutable variable that has to be an integer — see the previous tutorial).   If the dashboard receives a ‘q’ for a value, it will say ‘thanks for playing’ and quit the program (the two ‘_’s mean it doesn’t matter what the values are that follow it).   The next entries do what we’ve come to expect -> change the value of the MVar based on the movement and then output the current coordinate’s status.    The last statement is a catch-all, asking Haskell to output the current spot.

Why might this way of doing things be better than using (say) guards?    Well, the first reason is that it gets to the point.    if the user hits ‘q’, Haskell will not attempt to evaluate any of the other function calls.   Admittedly, this function isn’t really helped performance-wise by lazy evaluation -> but what if moving in a certain direction (in the spot where a monster was) involved a long series of recursive computations.    We would not want Haskell to be using up its resources trying to figure out what it’s supposed to do when all the user wants to do is quit.

However, there’s still alot that could be added here.   What if we want to do something when the user hits ‘s’ and y is equal to zero.    Then we could do something like this:

dashboard 's' 0 y putStrLn "You are blocked and can go no further."  >> putStr " Coordinate:  ( x = " >> output x >> putStr ", y = " >> output y >> putStr ")."

Again, this can have really great performance benefits for your program.    If dashboard gets an ‘s’ and a ’0′, it will look no further and do the easy job of outputting the coordinate as is, rather than attempting to go through all kinds of irrelevant processes.   UPDATE:  Well, actually, this is all wrong.    Because ’0′ is not an MVAR.    Mind you, there is a way to get the function to accept two Ints instead and convert the MVAR to an Int for our purposes.    That’ll be another tutorial though.

The last benefit is that it gives a nice human-readable understanding of what happens when the function receives what, without a whole range of complex nested elements.

The downside, of course, is that because Haskell is type-safe, you must give this function a CHAR (not a Maybe Char, or a String) and two MVAR Ints (not an MVAR String or ordinary Int) or you will get a type error.       Things could also get more confusing if you decide that you want to return an IO (String) or other value instead of just outputting something to the screen.    But handling that problem might be for another tutorial.

I should, again, remind you that my up-to-date work on the rogue-like game called rasghiosse is available in a patch-tag repository.   Please feel free to add to it as you wish.

Part I: Is There a Such Thing as Real World Haskell?

8 Sep

Part II:   How not to Start Your Haskell Program >

Here’s a bit of sardonic code, that I’d like to propose to any Haskell advocate out there.

data Works = Works | Does_not
computerApp a ::  Maybe a -> Works
computerApp a
     | isJust a = Works
     | otherwise = Does_not

I have been playing around with functional programming in Haskell.    I have to say that it has more than certainly improved my ability to code in other languages, and probably has reduced the number of bugs I have to fix after the fact.    On the other hand, it has driven me absolutely batty.

To be fair, I need to say that I am not a computer engineer.    I have a BA in English.    My Masters are in Public Administration and Information Management.      I engaged in Haskell code simply as a curiosity and a challenge.    I love math, and became curious about Monads and Lambda calculus.    I am probably not smart enough to be a great Haskell programmer.   However, I do understand two things.    1)  Not-smart-enough people can and want to participate in application development   2)  Coders, while making apps that do what they expect them to do, do not always understand (or care) about the sustainability and/or scalability of their code.

Web Development is an important test case.      Just about anyone, with a reasonable amount of time and effort, can learn to develop a website in PHP, probably supported by some content management system as Drupal or ModX.    Somewhere, their development goes overboard, the system does an upgrade to support some security risk or vulnerability, and ‘pop’ –>  all that likely un-documented and messy code goes nowhere and wheels need to be reinvented.

That’s why learning Haskell is probably a good idea.    Without getting into the code itself, it insists that a function always causes the same result to happen with any given input(s).    Once developed, the documentation pretty much always exists in a minimal form (via Type declarations).    So many bad habits would disappear if only people were forced into developing this way.

The problem, unfortunately, is that Haskell coding is confusing.     There is no popular development framework to use it.     Once you try to apply the examples provided in text books to real world development, things go wonky.    I won’t go into the many reasons why, but I do have an observation based on what I’ve seen in responses from various gurus to newbies like me.

It’s this ->   Users think computers do things.    Computer engineers think computers solve problems.     In Haskell terms, any interaction between users and engineers results in a type error.    Somewhere along the line, an IO() monad needs to be created to turn what engineers like about Haskell into something that users will like about it.

I would like to propose a management framework, similar to extreme programming, to manage the development of functional code for regular people.   While Programming it in Haskell is not a bad start, it uses a problem solving model, rather than a ‘how do you make the software do x’ model.    It focuses on mathematical abstractions rather than simple actions.     For instance, I would like to see a book that uses the development of a rogue-like rpg game in Haskell as an example.    Instead of worrying about efficient computation, abstractions about ‘laziness’ and recursive factorial examples, the writer would have to focus on managing complex (a tuple of a lists of tuples) types, worrying about random numbers and IO issues that are inherent to Haskell.   In approaching such a game, should I worry about creating newtypes first, or work from what I want main to do and fill in the gaps?

But while I make this suggestion, I really have no idea of what kind of advice I can offer your typical new-to-haskell coder.     But I have some hypotheses:

  • work from the main :: IO() first and build a framework of functions to develop your outputs.
  • possibly create type variables for each of your functions, making it equal in Type to a typical output you would like to see.    Then work backwards from there to create a lazy output, then involve possible recursion and so on.
  • use generic types (eg. Int, String, Char etc.) with comments first, then develop types to make your code more clear.
  • unit tests should include the System.IO.Unsafe module (cheating should be allowed when you are testing your code – let the learning happen when you are developing real code)

I’ll add what I can as I continue to learn more about coding in Haskell.    The bottom line is that I think more people should be coding in a language like Haskell, but they are unlikely to work with it if they end up spending a bajillion hours just to get it to choose randomly from a list of monsters (for example).   Especially when they can learn how to do the same in three minutes using an imperative language like Python.

For the greater good and more sustainable code overall, what high-level tips or approaches can you offer any newbie coders of Haskell, so they can develop without becoming absolutely bogged down in failure with their Haskell programs?

UPDATE:   After writing this, I found a great powerpoint tutorial by Graham Hutton that uses Hangman as an example of interactive Haskell code development.

Ten Reasons Why ‘Professional Librarian’ is an Oxymoron

30 Apr

Before you comment, yes, this is an unbalanced look at professionalism.    Yes, I am trolling a little bit – but with a heart that wants to lead discussion on the topic of library professionalism.    Please do write a post about why these ten reason are bullocks.

On the other hand, I often see librarians and library school students that take professionalism as a given.   I see this as unrealistic, especially in an era of rapid change.    I believe we are taught about the struggle for the professionalization of librarianship, how this is tied to sexual discrimination, and seem to rely on Ranganathan’s 5 laws every time something puts our professionalization into jeopardy.

In reality, it is the exceptions that prove the rule.    If librarians cannot personally address the following anti-professional assumptions as individuals, they cannot call themselves professional.    What I am saying is that the MLIS or whatever equivalent a librarian has on their wall cannot count towards any status in society.   Each librarian needs to respond personally to the following 10 things to claim their status as professional.

1.  Librarians Have No Monopoly on the Activities They Claim

You need to pass the bar exam to practice law.    You cannot perform surgery unless you are a surgeon.    You cannot build a bridge without an engineering degree.    Information is free.     Your 12-year-old kid can help their grandma do a Google search.

2.  There are No Consequences For Failing to Adhere to Ethical Practices

Besides the risk of being considered unemployable, a librarian has no real professional obligation to adhere to any of the values claimed by the ALA or any other so-called professional body.    There is no agreed-upon process for dealing with ethical breaches, nor an entity to report those ethical breaches.

3.  Librarianship is Too Generalized to Claim Any Expertise

The number of books in the field written ‘for librarians’ is analogous to books written ‘for dummies.’     The issue is that librarians, rather than having a specific area of expertise, actually need surface knowledge of variety of things – management, technology, community development and so on.   While one could say being a generalist is the expertise, there are larger and more in-depth areas of study like Management, Engineering and Education that could claim the same thing.

4.  ‘Librarian’ Assumes a Place of Work, Rather than the Work Itself

Despite claims otherwise, ‘librarian’ comes from ‘library’ which is a place where there are books.    It’s not an activity, but a product or service.   Thus, librarians rightfully should be treated as if they were providing any product or service.

5.  Peer Review in Librarianship Does Not Work Because There is No Competitive Process to Go With It

The reason why library literature is often horrible is that librarians are collaborative beings by nature.    Articles get accepted because they satisfy a minimum standard, not because they represent the best and brightest research in the field.    True professionals are much more harsh with their peer review because they have an individual interest in refusing competitors the privilege of being published.

6.   Values Are Not Enough

Common values occur in a wide variety of communities, many of which are leisure activities.    There is nothing associated with the values of librarians that differs from any other advocacy group.    Librarians do not deserve to be rewarded simply because they think information wants to be free.

7.  The Primary Motivation for Professionalization is the Monopoly of Labor

The main motivation for librarians to assert their professional status is so that they can lay claim to higher-paid “ALA Accredited Degree or Equivalent” positions in library institutions.   We cannot accept any librarian’s claim of professionalism without objective evidence because there is an inherent self-interest laying in that claim.

8.   Accredited Library Schools Do Not Adequately Prepare Students for Library Work

The process for creating ‘professional’ librarians has long been criticized for its lack of relevance to real life library work.    It’s like saying we are great espresso-making experts because we understand the secrets of tea bag design.

9.   Competing Professions Are Offering Different Paradigms to Achieve the Same Goals

Computer Scientists and Engineers are discovering ways to make information accessible to the public using search algorythms, interface design, and social media platforms.    Current library practices are following their lead, not the other way around.

10.   Nobody Can Name a ‘Great’ Librarian

Go to a typical university and ask the professors to name a great Doctor (‘Albert Schweitzer’), Architect (‘I. M. Pei’), or Lawyer (‘Johnny Cochrane’).      No librarian stands out the same way that these great professionals do.    No one outside the library field is going to come close to naming Ranganathan either.

So there.    I hope these ten items put a little devil on the left shoulder of every librarian who claims professional status without a good dose of self-doubt to go with it.    In reality, I think these 10 items put a special responsibility on so-called ‘professional’ librarians to step up and provide exemplary service to their communities.    Professional status means nothing to the information world – you have to earn your entitlement.

How to Talk to an “Aspi” – Asperger’s, Autism, Labels, Stereotypes and Strategies

29 Apr

Update: After writing this, I read this great article by someone name Astrid who has Aspergers and think it’s a great counterpoint to what I said here.   I now can’t imagine this post being ‘out there’ without a link to that post.   I have no real response to Astrid except to acknowledge the tension between the perception of Aspies as ‘elite’ (in a way) and the often unfair expectations that those perceptions have on people with Asperger’s.


My son is a genius in so many ways you cannot imagine.   He is now six years old.    He has been talking since he was barely 12 months old.    His vocabulary could make Rex Murphy feel like he needs to go back to grade school.

He can tell you the some interesting properties of many chemical elements you’ve never heard of.   He once wrote Martyn Poliakoff of the Periodic Table of Videos to ask him:

  • What do people use Beryllium for (just watch this video)?
  • What is the most dangerous element?  (there are various reasons for danger.   Plutonium is very toxic.   Fluorine and Cesium are the most reactive.)   What is the least dangerous element?  (probably Helium)
  • How do you suppose ununoctium is very small when it has the most protons?   (It’s not small, but only a very small amount has ever been made – and the experiment that claimed to have made ununoctium has its critics for sure).
  • If bananas contain potassium why do they not explode when you put them in water?   (it’s not elemental potassium that bananas contain, but potassium ions, which do not explode in water).

There’s more.   He’s gotten as far as level 8 in Globetrotter XL (a game where you are asked to pinpoint the geographic location of world cities).    He can probably describe most of the world flags and definitely all of the U.S. state flags.    He can name all the state capitals and nicknames.   (Also, he is Canadian, so he has no real education on this topic.)    When he was 3, I could rely on him to give me accurate instructions on how to drive to someone’s house after only a single visit.

When he got to school, however, we learned that he was having difficulty socially.    We are also realizing that there are some issues with some areas of his academic life too.   That’s when we discovered that he’s an ‘aspi’ – a child with Aspergers.    Whether that’s a diagnosis, a personality type or just a way for so-called ‘normal’ people to marginalize him, I’m not quite sure.   I do know that paying attention to the nuances of his learning style has been really helpful to let him deal with everyday life things.

So he must be socially awkward right?    Must be like Rainman, right?    Spock?    Temperance Brennan from Bones?    Keeps to himself, right?   He must shy away from social situations and show little emotion to others, right?    Total lack of empathy in favor of logic and detail.   It’s all obvious!

Well, no.   My child is  extremely engaging, interesting and (in a way) interested in people.    The differences are more subtle and hard to pin-point.   You’d know there’s a problem somewhere with the way he interacts with others, but you would find it hard to pinpoint what.    But, if you meet a kid that:

  • Is very welcoming and friendly.   Almost assuming right off that you are a friend.
  • Is very polite on the phone.
  • Assumes that you are interested in what he is talking about.
  • Assumes you want to participate in the things he wants to do, and maybe gets angry if you don’t.
  • Interrupts your conversations with others.
  • Gets upset over basic requests or instructions.
  • Asks surprising questions and offers amazing insight on a wide range of topics.
  • Will do a speech as if he were defending a thesis, but then fail at answering basic open-ended questions about the same topic.
  • Is surprisingly slow at getting ready for going outside etc.
  • Will repeat certain behaviors and actions over and over again.

That might be my kid.

If you happen upon a kid you might think is an aspi, here are some things you could consider:

No Surprises

Little surprises will make Mr. 6 anxious.    Simple requests like ‘go brush your teeth’ can turn into total battles if they appear (to him) to come from left field.    A better approach is to give him a list of the things that need to happen, preferably with time-limits to go with them.

Be Patient

Mr. 6 will ramble.    It’ll take him a few shots of ‘umm…  uh…  I have a question for you…’ etc. before he comes out with what he needs to say.

Turn Open-ended Questions into Multiple Choice

No matter how many times I ask Mr. 6 ‘what does he want for dinner’ he will always reply ‘i don’t know, what is there?’    And he’s a picky eater – he only has a few things that he enjoys eating!    On the other hand, if I hand Mr. 6 a menu, he will be able to give me ideas even if nothing on the menu is appealing to him.    So if you want to ask Mr. 6 why he is angry, you should say ‘I think you might be angry because:

a) you are disappointed about not getting candy

b) you are a mean grouch

c) someone called you a mean name

d) someone ate your lunch’

Even if all of these ideas are absolutely wrong, Mr. 6 will be able to take one of options and give you some insight into how he is feeling.

Act Like a Librarian

There may be no actual evidence to support this assertion, but sometimes it’s like Mr. 6 has a Library of Congress in his head with no retrieval system to find the right information at the right time.    If you are able to help him out with a little subject classification, he may be able to find the right book in his head and recite its contents in detail with amazing analytical capability.

Get Ready to Have your Mind Explode

When I explained my little ‘act like a librarian’ technique to a doctor, Mr. 6 corrected me and said ‘it’s like I have to build a tall building and I don’t know what materials to start with.’    That doctor is probably still cleaning up the grey matter from her office after that insight.

Model Behaviors

Mr. 6 will always be better at imitating the positive behaviors he sees in other than understanding how he is annoying you.    If he can come up with a rule about what to do at the right time, he will do it.    He understands that people get annoyed at him, but he doesn’t always understand why.   Show him an example of how he could behave when certain things happen and he’ll be happy to oblige.

Is Something Else Bothering Him?

Mr. 6 hates loud sounds.    It might not be you, but where you are standing that is bothering him.    If an environment is complicated or noisy, it might be causing problems for Mr. 6.

It’s About Learning Difficulty, Not Emotional Problems or Intelligence

If you are the sort of person who just likes to label and ignore people with learning trouble, just listen to Temple Grandin for a few minutes.    People on the Autism spectrum have the potential not only to be productive members of society, but to transform society for the better.   Like the way a wide range of overachievers just so happen to be dyslexic, there’s a comparable list for people with Aspergers (grain of salt needed for both lists, however).

So there’s my contribution on the challenges that go along with the gift of having an ‘Aspi’ in your life.     Mr. 6 makes me smarter.    He also breaks a wide range of assumptions I have about people learn, teach, ought to behave, and so on.

Podcamp Toronto 2010 – My Recap

23 Feb

Going to Podcamp Toronto has been one of the best things I’ve done in quite a few years.     Yes, better than Computers in Libraries.    Better than OLA Superconference or really any library conference I’ve gone to.   And yes, as Phil Swinney mentioned, it was better than Podcamp Halifax as well.

Podcamp Toronto is better than most library conferences because:

  • A lot of what podcasters and social media artists do relates very well to librarianship.
  • As a librarian, I felt I had a unique perspective to share in the discussions about social media marketing and podcasting.
  • Unlike librarians, social media marketers want to connect to as many people as they possibly can – not just their friends and colleagues.   The #PCTO2010 crowd was very friendly and supportive.   They wanted to help newbies learn and share tips with their colleagues.
  • Podcasters and Marketers are very curious about librarians.   They know we are very crappy marketers of extremely valuable and useful services.

Podcamp Toronto was better than Podcamp Halifax for a few common sense reasons:

  • They were much better at filming / streaming etc. of the presentations – (because they are bigger).
  • They were better at securing sponsorship (at the Saturday party, an elephant could have got very drunk without paying so much as a cent).
  • There were just that many more connections, more excellent presenters, more diverse questions etc.
  • No one had to justify their social media presence.   It was a given that social media is important and valuable and Podcampers were going to reap the benefits of their diving in to this space early.
  • There were more podcaster presentations.  The one I went to by John Meadows about editing interview content was fantastic.  (I’m not really a podcaster, but he made me want to become one).

Podcamp Halifax was Better at:

  • I like that we have a keynote – it goes a little against the ‘everyone’s a rockstar’ idea, but it does offer a little break between the sessions that everyone can comment on.
  • Many of the things the organizers were worried about (markers, water, printing capabilities, computers etc) were things I didn’t even bat an eyelash about because the library already had it all.
  • We were more newbie-friendly.
  • Our battledecks session rocked the socks off everyone.   (That said, the #PCTO2010 battledecks session, was great as an opportunity for a newbie presenter to develop their skills).

There were some similarities as well:

  • It is harder at a Podcamp to get a conversation going in sessions than it is at other unconferences I’ve experienced.   I think this partly has to do with the fact that the ‘marketplace’ is set before the event.   When you put more time into establishing the marketplace and explaining such things as the law of two feet, I think it opens the door more to true unconference ‘OMG-the-audience-just-overtook-my-presentation’ effects.
  • The average caliber of presentations was about the same.    Toronto had more outliers (both bad and good), but in general, there was at least one good presentation for everyone.
  • This was a great place to meet all those podcasters that you’ve never met and wish you had.

I also have some suggestions for both Podcamps:

  • Arrange rooms for circulation.    Make sure that people can get in and out of rooms reasonably easily without disturbing others.   (I got caught in a room that I wanted to leave really fast, but couldn’t because of the way the room was set up).
  • There’s got to be a way to enable impromptu sessions.  I haven’t figured it out myself, but it would be so helpful.
  • It’d be nice if there was a way for everyone to get beyond promoting their business/brand at Podcamp.   I realize that it’s all part of the game, but it can’t be just a dream.
  • I’d like to get more people ‘from away’ to Podcamp Halifax.   We had a good mix in the first one and that made for some really great learning for the more experienced podcampers.   This year seemed a little more like a ‘newbies learn from experienced folks’ camp.
  • Schedule by Plain Old Wiki would have worked better for me as a potential presenter.
  • After PCTO2010, I’m not convinced a two-day podcamp is better.   Many many fewer people there on Sunday than there were on Saturday.   A lot of great presentations were missed by the people who partied just a bit too hard the night before.

In general, I feel really refreshed.   I think I’ve learned a heck of alot about social media, podcasting and making Podcamp Halifax better.   I met a whole bunch of great people.   I have a nice stack of business cards so I can keep in touch and I paid alot less than if I went to a traditional conference.

Librarians, get thee to a podcamp!


Get every new post delivered to your Inbox.

Join 3,506 other followers