Written by philip on April 28, 2013
Most of my time working is in front of the computer, I already have a google glass, that is my computer. The only other thing I do when I’m working is talk to people. The times I am not working, I am either relaxing, eating or sleeping, in any of these cases I do not want Google Glasses.
I’m not sure that Google gets that, the Google glasses are a toy just like the Segway, I don’t need it to get around, in fact the Segway would make getting around more difficult as if I ride it from A to B where do I put it when I get to B? I put it in my office? difficult. The Google glasses also have no place in my life, Google I needed a search engine yes but I don’t need the glasses. A nice toy for the rich but not actually useful in day to day life for me.
Written by philip on April 21, 2013
I always find OO API’s difficult to get started with and difficult to learn and remember. The first problem is where do we start, what class should I start to create to use the API, consider the CinderLib API. We can say there is a long list of classes there, but where do I start, do I start to create one of these classes? Which classes can I then use after creating one of these classes? If I’m just limiting myself to look at the API here on the page with all the classes, its really difficult to know how to get started programming with this. Ok lets say I make some good guesses and manage to get started, its not at all clear how to do certain things, the grammer of the relationships between classes, functions and objects are not at all clear. So then I must resort to different methods.
Usually to use an OO API I look at example code and modify the example code to fit my need as I don’t know the magical incantations to get things started and cannot remember all the classes involved. For the magical incantations, what classes should I start with and then what can I do from there, its rarely clear or obvious. For the person who designed the API it is clear and simple, they know the grammar of their objects but how long do they expect me to read documentation to “get” their grammer. For memory, preferably I do not wish to remember all the classes, how can I remember all the classes for all the API’s I use, its really impossible, there’s so many API’s, JQuery, HTML5, NodeJS, … and all the forgotten ones I no longer use such as ActiveX, MFC.
So there is a problem of what is the grammar “In linguistics, grammar is the set of structural rules that governs the composition of clauses, phrases, and words in any given natural language”, what are the relationships between classes and how do I use them to accomplish a goal.
Then I can argue that a flat functional API is easier to understand and use. JQuery is such an API, JQuery doesn’t rely on many classes, there is just one large page of the API. Lets say I want to hide something on the page, all I need to do is search this page for the word “hide” and I find .fadeOut() which can be applied to a JQuery DOM node. Now if this was a Object Oriented API there would be many classes and I would have to work out which class to use and which function to use with what other classes.
Perhaps the problem is that OO API’s hide information within them, they encapsulate their own API within many different classes, its difficult to work out which class should work with what class and where to start. I would like to suggest that functions and global state are easier to understand and develop with than OO API’s when the API’s become large.
Written by philip on April 13, 2013
Yeoman is a tool for managing a web development project, it allows for the installation of client side CSS and Javascript libraries, basically an easy way to get started building a website and tools to manage the dependancies of javascript, css, and any libraries.
So this Yeoman npm package works just as you would expect, it installs Foundation 4 into a Yeoman project. The interesting thing is it uses Stylus CSS to allow modification of the CSS. It has a settings.styl which has many overrideable styles, for example.
// We use these to control header font styles
// $header-font-family ?= "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
// $header-font-weight ?= bold;
// $header-font-style ?= normal;
// $header-font-color ?= #222;
// $header-line-height ?= 1.4;
// $header-top-margin ?= .2em;
// $header-bottom-margin ?= .5em;
// $header-text-rendering ?= optimizeLegibility;
By uncommenting and modifying these styles the foundation styles can be overridden easily. One problem people complained about with boostrap was that it was difficult to override the default styles, although this is not bootstrap, its good to know it has support for easy adjustment of styles.
Written by philip on March 21, 2013
Idris is a relatively new computer language which uses dependant types, I don’t actually know what that means at the moment except that it potentially allows for more errors to be detected at compile time rather than at run time. Its good to find errors before a program runs and if the dependant types makes it easier and does not make programming much harder then I’m for that.
Idris can also compile to Javascript or C language which means it can work in the browser or on the PC. To install Idris you first need to install Haskell then to following the installation instructions on the Idris page. The reason the Haskell platform is involved is that the Idris language is implemented in Haskell.
Here I show how to use Idris from a very simple basic programmers point of view, not showing off the parts of Idris which involve complexity as I do not understand those parts yet. So taking it step by step.
Printing strings on the console in a main method.
module Main
main : IO ()
main = putStrLn "Hello world"
To run this, place the above text into a file called test.idr do the following on the command line.
$ idris test.idr -o test
$ ./test
Hello world
$
As you can see it outputs Hello world as you would expect.
The following is a simple example of appending strings.
"Hello " ++ "there"
The next example is a main program outputting string and inputting string and concating strings, place it in the file test.idr, compile and run.
module Main
main : IO ()
main = do putStr "What is your name? "
name <- getLine
putStrLn ("Hello " ++ name)
To print a List of integers, the line inserted is putStrLn (show testIt)
module Main
testIt : List Int
testIt = [1,2,3]
main : IO ()
main = do putStr "The list contains "
putStrLn (show testIt)
putStrLn "Your name?"
name <- getLine
putStrLn ("Hello " ++ name)
Ok so we can do some basic operations that you would expect with a programming language, inputting, outputting strings and printing a data structure. Next post we do some basic operations on lists.
Written by philip on March 19, 2013
Lo-Dash is worthwhile, at 19kb on the disk when minified, that is reasonable.
So your going to write a program in Javascript and you want to keep it small I suggest to use LiveScript with Prelude, Lo-Dash rather than Underscore.js, BackboneJS, well I’m saying you want to keep it small, I’m not saying use this if you want to have the best environment to program in. You may want to keep it small to work well with mobile devices with slower download rates.
If you don’t care about the size of the Javascript then I suggest go with something else.
Written by philip on March 19, 2013
https://github.com/niklasvh/html2canvas
Written by philip on March 19, 2013
http://stackoverflow.com/questions/10630929/building-sdl2-on-os-x-10-7-ranlib-file-has-no-symbols
This only works with the current HG source as cloned from:
hg clone http://hg.libsdl.org/SDL
As explained in the instructions here:
http://www.libsdl.org/hg.php
Written by philip on March 10, 2013
Responsive WordPress Designs
Written by Phil on February 24, 2013
I’m searching for the best way to write CSS, is it Less or SASS/Compass or something else? I have noticed that HTML can be expressed in Coffeescript with CoffeeKup, CSS can also be expressed in Coffeescript, some of the projects which do this are CoffeeStylesheets,
your code here