Showing posts with label general. Show all posts
Showing posts with label general. Show all posts

Thursday, 28 February 2013

End Feb 2013 Update



Just in time for the end of the month I published the little chain reaction game I had been working on. It is not exactly the best work I have done. The aim was to get my brain back into libgdx which it has done.

I am not expert yet!

While I was in publish APK mood I also took the advertising off of Onions Vs Wheelies. The game has not exactly been downloaded many times so I figure why should i let it interfere with the game play.

I have also taken the same approach with my latest game, aptly named Circle Explosion by the way, the popularity of these simple games just does not warrant adding adverts to them.

In fact I am starting to think ads are not great when it comes to games on android, a better approach would be to do an in app purchase to unlock the whole game.

There is not much else to report really. February has not been the most productive when it comes to code. I am looking forward to picking up some momentum in march.

The fun thing is I am probably going to start training for a marathon this week making march quite a busy month.

Tuesday, 19 February 2013

Mid Feb '13 Update


Yep, it is another one of those rambling posts about what is going on in my programming life.

First up I decided to flip to a different simpler game. Why well not having used libgdx for a while I thought it would be nice to do something simpler to get a feel for it again  I am now working on a simple "chain reaction" game. Yep it is another clone :)

If I am being totally honest there is another reason for flipping. The game I was designing would be a lot easier to make if the Tiled support in libgdx was a lot better, This is being worked on at this very moment. It sort of makes sense to delay making that game until it lands in the code base. It is not like I am short of ideas for games.

I have been trying Eclim a little bit. I really wanted it to work out as I like living inside vim. It is almost there for me. It makes me a little sad to say it but it is not as smooth as using the default editor in eclipse.

I wrote a couple more paragraphs of complaints but sort of realised as I wrote them it is more likely that it is me who is at fault. I just don't know enough about vim/Eclim to have a rant about it.

I was sort of hoping it would work out of the box and have some commands like RunLastProject to make it really easy to use. Alas not what I could find. I am probably going to keep chipping away at it on and off and see if I can get something that resembles and good work flow.

There are stability problems with the embed vim in eclipse so I may wait for a newer version of Eclim. For now when I code in Java it will be in pure Eclipse, just as someone on google plus suggested to me when I mentioned Eclim.

I am still happily working on a little html5 sprite editor. I got to the stage of actually being able to draw on the screen. It is a fun little project and a nice distraction, when needed, from anything else going one :) Progress is very slow.

I also signed up to BitBucket. It is something I have been meaning to do for ages. No longer will my home projects be dumped on dropbox with not version control. BitBucket is free to individuals even for private repositories. My very limited use gives it five stars.

Friday, 15 February 2013

Wow it has been a little while since I posted.


To be honest it has been a bit of a slow period in terms of getting stuff done. Some family stuff popped up that derailed my productivity and I have not quite got back into the rhythm of things.

There has been a bit of progress but not much. For my next game I decided to jump ship in terms of technology and return to Java. Using Libgdx and Java will let me target a wider range of android devices and still partially target the web. I say partially as it uses webGL and there is a browser that holds out from implementing it.

The game has not progressed very far. The time I have had has gone mostly towards re-learning the api's that Libgdx provides. I admit some geekery as I have experimented with eclim, a sort of vim-eclipse bridge. I am not sure if I am that productive with it yet although I think this is more down to my vim set up not have had time to evolve to where I would like it to be.

I have not even installed NerdTree and that will probably be quite a nice thing to have installed when attempting use use eclim.

My other, usually lunchtime, project is I have sort of returned to the idea of an online sprite editor/pixel editor. When I say returned it really just started out as me trying to figure out how to get a simple application style layout working in html. That is a header, main display and a panel on the right. When the window is re-sized the main display absorbs the extra area.

Perhaps my brain is not working too well but that actually took a while to get right. I also wanted the side panel to be able to slide in and out. It now all looks quite smooth and before I knew it I was adding a canvas layer and thinking about making a pixel editor - again.

I attempted something similar last year but decided it was not worth the hassle when I realized I was going to have to transport the image up to a server just so you could download it. At that time I was not that interested in dealing with servers but now I suspect it would not be a big deal. Plus I think chrome and Firefox support a downloadable tag of some kind where you can specify the name of the file to be save without having to do a round trip.

For now this is kind of my part time project that is really just a learning exercise in trying to push as much as possible into css and html rather than relying of CoffeeScript and JQuery.

As an aside I have noticed that the more I blog the more productive I am. Is it causal or is it just a case of when I get productive I want to write about it? Either way I am starting to attach more importance to blogging as a tool to productivity. I guess this is the reason many people write a diary.

Wednesday, 23 January 2013

Webgen is Now Being Used


Tonight I ported marblemice.com over to use webgen. webgen is a static site generator that while not that actively developed seems to fit all my requirements. marblemice is now a little bit more maintainable.

Given the number of pages that marblemice has this was really just a bit of geek-ing around for an evening or two. I did this on the pretense that I would write some articles and that marblemice will grow over the coming months into some sort of large website.

Obviously this is not really going to happen, it is only going to grow slowly but hey it gave me a reason to mess around with it a bit and get it out of my system.

I am not sure what to think of webgen to be honest. It does what it sets out to with a minimum fuss and does it in a snappy way, for a website of my size.

Sunday, 20 January 2013

Side tracked into android app update

I have been a little side tracked into updating on of my apps I have for android. Posting to Facebook has not been working.

As Facebook recently published version 3 of their library I thought it was time to upgrade to that. It does look like that have put quite a bit of work into it which is nice. However for someone who just wants to send a bit of text to the user wall it is a bit of an overkill. If only they support the share some text intent.

The SDK is very much geared up to having the user log in and use that as their id in the app. If that is the sort of thing you want then the SDK is a huge improvement.

Anyway I eventually arrived at a solution that I was happy with and so will be putting out an update fairly soon. The funny thing is I think I had mis-configured something server side and with that fixed I think users will be able to post without the update. I am not 100% hence deciding to continue to do the update.

Dropping back into eclipse was a bit of an experience. When I was flipping between the debugger and the Java work-spaces I seemed to end up in .class files. Eclipse displays them as source files so you don't realise until you try to type and nothing happen as they are read only. I got caught by this a few times.

My eclipse Fu had definitely gone backwards in the past few months although some of the speed drop should be attributed to my new laptop with its slightly eclipse un-friendly keyboard layout. It is of course fine with vim. There is a vim plug in that uses a headless version of eclipse that I very nearly downloaded.

I am hoping get the updates published this week so I can refocus on releasing my latest little game to android. The porting part is done I just need to sit down draw some art and produce the APK.

My expectation is I start game 2 just before February. I am pretty much have the outline of the game sorted.

Friday, 11 January 2013

Onions are Escaping


Well I have been fairly busy over the past few days. I have published a game on my website. So yay! I will link to it in a while but for now you have to find your way there.

Why? Well there are couple of issues that make it not ready for prime time. First there is an issue of loading images. It is a case of me being a little bit stupid and forgetting to wait until the images are loaded. Sort of thing you only catch when you are pulling images off a server rather than you hard drive. I wondered what was going on and this morning as heading out to work the answer just appeared in my head. I am pretty sure it is correct.

Also I have not turned of the ability to select things, again a silly mistake on my part.

Finally there should be some google ads that don't appear to be there...

The first two are pretty important to me and I want to fix as soon as possible. Alas that means sometime over the weekend as it won't be happening tonight.

All this smacks of little mistakes as I get be into the groove of web stuff so to speak. I am glad I produced something small to get my brain back into it.

In other news I shifted my web hosting over to Small Orange rather than using google app-engine. Marblemice.com is just a static site so hosting it on the app-engine was kind of a strange thing to do although it was free. Small Orange is not the cheapest place but for a website with as few visitors as mine I only need their lowest tier which in absolute price is cheap, compared with others it is not for what you get. Their reputation on the web is what sold them to me. I don't mind paying a small amount in absolute terms to avoid hassle. Should I ever get to transferring more then 5Gb per month then that is a good problem to have.

The transfer went smoothly as you would expect for a site that consists of static pages.

My mind is slowly turning to the next game and I am beginning to jot down ideas and see what I can come up with. Well I have lots of idea but they need fleshing out and importantly they have to fit within the constraints of my artistic talent.

So my TODO list over the next week is
    1. Fix issues with game 1
    2. Do a pass over my engine to improve it
    3. Sketch out and decide on next game
    4. Investigate putting current game onto android.

I may have mentioned I returned to vim as my text editor. Well it is going really well, I miss a few things from emacs but work flow in gvim is really starting to grow on me. That is for CoffeeScript, I will be rushing to proper IDEs when I do C++ or Java. One of the reasons I started to use emacs is it feels so different from my day job and that makes it fun, GVim retains this feel. Not that my day job is bad but changing environments when at home is a good thing.

Title of this post refers to the name of the game I am just in the process of finishing. Just in case you are wondering.

Sunday, 6 January 2013

Odds and Ends (Current Game and JQueryMobile)



Over the past couple of days I have been busy. I have downloaded the android sdk again and am starting to get my android dev system set up. This is motivated by the fact I have been getting some reports that some of my apps are not posting to facebook anymore. I have had a little bit of a rant about facebook in the past so shall not cast stones until I have investigated the problems other than to say it would be really nice if facebook started to support intents. Perhaps they do as I have not checked in a while.

I was looking at JQueryMobile for a while again. All the transitions now work quite smoothing on my nexus 7 in chrome, that is pretty nice. I once entertained the idea of writing a few apps with JQueryMobile and then embedding them in an java wrapper so I could release them on the android market. I am left wondering with the WebView component provided by the java api build on top of the chrome renderer or is it still based on a pre-chrome port?

These things only took a small part of my time. Most of it has been spent working on a little game I am making, It is a clone of the old 8-bit game called Daleks. So far it consits of about 800 lines of code about 400 of which form my slowly evolving gaming library. Most of the game mechanics are in place other than the player dying, I usually add this last in simple games as it make development easier. There is a bit of refactoring needed to support in play states but otherwise I am happy with the progress of the game.

While the graphics need has consisted on only a few icons I have taken the approach of drawing on pencil and paper and then taking a picture of them. This is then imported into inkscape so I can manually trace and then color the image. It seems to be working fairly well. My paper drawing skills exceed my inkscape skills but both are very poor.

I continue to learn some of the corner cases of CoffeeScript, like how to get the index of the item in an array with using CoffeeScripts' for loop. The approach I am taking is one where I tolerate messy code in the game code but not in the library code. In a months time I probably won't touch the game code again while the library code will be being used in a different game. The game code is limited in scope and size and I doubt the whole game will get much above 1000 lines so I don't expect the complexity to kill me.

The entity/component system is really easy to work with and certainly separates concerns very well. I am not really using the power it gives in composing together different components on such a simple game. The C++ programmer in me really struggle to not "fix" my very inefficient implements of the entity system but for now I resist. For a laugh I may take a few days after releasing it and see if I can get it working on an android device but that is a little way off.

Thursday, 3 January 2013

Setting Goals For The Next Six Months


Yep it is going to be another rambling post.

As you may have guessed from my previous post I like to do some thinking as a new year starts. I usually set some goals for the year coming ahead. Well actually rather than goals I have found it better to set topics. Things like this year I will focus on android app and so on.

My focus usually only last about 6 months before I do something else but I usually end up learning a lot. So for the next six months I plan to focus on producing games. Any platform/language is allowed although I can only really see myself coding for either android or HTML5.

This does mean I probably will not work on the sprite editor I was working on. While I have some nice ideas that have not really been done anywhere I have look the whole idea of a web based editor put tension on the work flow that mean it would be frustrating to use.

I briefly looked at using JavaFx to create a desktop version but in the decided to put it on the at some point it would be good list. JavaFx seems quite nice by the way.

I am starting small when it comes to games and tonight go some initial code and art put together for the first game I am producing.

Sunday, 30 December 2012

Nearly end of year - Rambling Post


So I have been pretty quiet the past few weeks. As you can imagine Christmas means I am pretty busy with family stuff and plenty of eating. For Christmas I got a new laptop. A dell XPS 15 and it is pretty nice. For now I have stuck with window 8 rather than installing Linux on it as most of the tools I use are cross platform and I would like to spend some time with window 8 just to get used to it.

It does mean I have spent some time setting up my tool chain again. Eclipse and android are not yet installed but I spent some time with emacs. Then strangely enough I spend some time setting up vim. Sort of  to compare both environments for coding CoffeeScript in. For now vim seems to be winning even though there is a lot the I like in emacs. I seem to find the navigation around a buffer easier in vim compared with emacs. Also getting vim set up for coding in CoffeeScript took quite a bit less time than getting emacs set up. In the long run not a big deal. Now being fairly familiar with both I imagine I will flip between the two of them on a whim. OrgMode is still great.

My mind is turning to projects I wish to develop. Yes I am planning again and that never works out that well. It usually means I take on too much.

First of all the past month or so has been fun just coding up what I want so I don't want that to stop but flipping between things and running with every crazy idea I have means I never actually get anything done. I like to complete things.

In previous posts I mention feeling a bit burned out. That culminated with a flu like cold just before Christmas. I was hit much worse than my family and spend 3 days pretty much asleep and quite a few days after that sleeping 10-12 hours a day. I think it is fair to say I caught up with any sleep deprivation I may have had. A bonus is when I am ill I can't face coffee. Even now my caffeine intake is greatly reduced meaning I now sleep like a baby.

So with all this in mind I am feeling recovered and wanting to take on some projects that I will actually release. Looking at where I am at it seem I am enjoying the whole HTML5 thing so may as well continue that for a while and return to android later in the year.

I would like to continue with my little sprite editor. I am enjoying creating it and learning quite a bit. I am not sure it is going to be super useful to anyone but if it is fun I will continue. I may gradually it to CoffeeScript just so I only have to think about one language.

I also have a very incomplete gaming library and when I say incomplete I really mean it. So I am thinking that I will develop a few simple games to flesh it out. Game development is nice as it forces me out of my comfort zone of coding into the world of attempting to draw (usually badly) and thinking on making sure it is fun.

Ok this post is a bit of thinking while I write so I may decide on something else. Either way I want to have decided my course of my coding over the next few months by the time the new year starts.

Do excuse the slightly rambling post but I usually post a few thinking out loud blogs around this time of year.




Monday, 10 December 2012

Are too many units tests bad for your project?




Perhaps to some this might sound like heresy and to others it my seem like common sense.

I am a fan of unit testing but have recently been thinking about the right number of tests prompted from observing an over zealous attempt at creating unit tests.

During this time I was reminded that tests are not free, they take time to create, maintain and run. The idea is this time is recouped during development by catching errors early and acting as a sanity check. This kind of works out quite well most of the time.

There are times when it can be a drag.

The first of these is small prototype projects. The sort of ones I talk about on this blog. Things that are knocked out on a weekend or at most a month. They are mostly for personal consumption, occasional I do do unit tests but often only start adding unit tests after the first release. If I start on a second iteration it probably means I will work on it on and off for an extended period and unit tests will pay for themselves. I doubt people will disagree with this one as it is not exactly controversial.

The point of this post is I recently observed someone create many hundreds of unit tests that were all permutations of each other. It took him quite a while. All these permutation represent  different options that can be given to a system. The code is programmed such that there are many similar functions (this part of the code if old and by that I mean decades) so he used that as the reasoning for writing the test while altering the code.

The trouble is the possible combinations is so large even this guys herculean attempt could not cover everything and general testing revealed more bugs.

This led me to thinking someone sitting down and attempting to write lots of unit tests should trigger warning alarms. Personally I felt it is more appropriate to spend time going over the code to reducing the number of branches/functions in the system meaning we could cover the code with less unit test.

To answer the obvious re-action. there are many layers of testing so it is possible to refactor code fairly safely without unit tests in place.

TL/DR Sometimes it is better to simplify code rather then write unit test for complex code.

Wednesday, 5 December 2012

Early Dec 2012 JavaScript Adventures


My JavaScript adventures continue. I have sort of started a separate little game project but more on that in a minute.

The little sprite editor that can't continues. I added a tiny bit of polish to it in the way of a title bar across the top. Suddenly is has started to look like a web app.

Currently it sits are about 750 lines of JavaScript but that probably needs a bit of a going over. Thankfully I am not starting to feel it is getting to complex just yet. This must mean my skills in JavaScript are improving  I look forward to how the app feels when I trundle past a 1000 lines.

As I wrote this it felt weird. talking about handling complexity of a 1000 lines. I regularly write code in Java or C++ in code bases that get close to 500k lines of code and do not struggle (and I do not know the full system obviously just a mental model) but in the past when playing with JavaScript I have noticed the fun starts to disappear when I get in the 500-1000 line mark.

I suspect it is because I am used to statically typed languages and dynamically typed languages need a slightly different approach. Also I am less familiar with dynamic languages so may make poor choices in terms coding idioms. I have noticed this in JavaScript and re-factor my work often as I learn more tips and tricks. Either way I feel I am rapidly improving in terms of skill in JavaScript.

One area I have to keep correcting myself on is generating html code in JavaScript. This makes the JavaScript verbose and I don't like it from a separation of things point of view. Having effectively made a few UI components it does give me an appreciation of the approach the say JQueryMobile have taken. Perhaps "What would JQueryMobile do?" would be a good question to keep asking myself.

So my approach to developing this little app is if I can do it somewhere other than JavaScript I should. Another example of this is the used of the animate function in JQuery where I should really be using css transition. All the browsers I plan on supporting have this implemented.

Enough pixel editing talk. My second project on the go is a very small game. I wanted to get a better feel for using entity systems inside game dev. It is a HTML5 canvas game and currently consists of a square that moves around. I am thinking of producing a space invaders clone. Yep small scale and not innovative but it should give me a good feel for entity systems.

That pretty much sums up my coding life. Quite enjoying it and it is nice going with the flow and coding up stuff I am enjoying. I am sure post Christmas new year I will get the urge to try to progress on to stuff that will be more useful for people but for now I am hacking code for fun.

Monday, 26 November 2012

Late Nov Update 2012



I am still very time constrained at the moment and my mind is definitely on a pending Taekwondo grading rather actually programming. Having said that I have made some progress.

I took a look at what I have produced over the past couple of weeks and thought well that is not much. In fact it is not. Having said that I have been quite happy with my progress as I am learning quite a bit about JavaScript and emacs for that matter.

Plus I am officially chilling and not worrying about rate of progress at the moment. I did allow myself to create a text document (orgmode actually) containing a list of ideas, bugs and a what is probably a todo list. But I am not constraining myself to it. Just coding away and seeing what happens :)

Last night I coded up the alterations to support different size sprites in the editor rather than a fixed size, although at the moment you can only have one size per sheet. I have not done the support to the surround subsystems so it is not yet a use select-able feature just yet.

Started to remove a side bar that was destined to contain different tools. It had a little bit of a 1990s feel to it. Dragging your cursor all the way over to the left just seems like a long way to go to change drawing tool. Well it would be if I had more than one drawing tool implemented. The tools can either hang on the edge of the canvas or come up when right clicked. Oh and I like keyboard shortcuts so expect those at some point :)

I am starting to look at putting it out there to let people see what I have been up to. The keyword there is starting it won't be until I get some more free time to put in a bit of polish.

Learning emacs is still quite good fun. Weird keyboard shortcuts and magic commands to do stuff really appeals. It is very different to visual studio where I spend most of my day and that makes it fun.

Friday, 23 November 2012

Thoughts on TypeScript


Well I think I am recovered from the marathon, it was much hillier than I was expecting so it made for some hard uphills and for some fast/fun down hills. Overall it was good fun and the 4 hour drive home was not too bad.

I was looking forward to a week or two of low intensity chilling out. I later find out I will be doing a Taekwondo grading next week so suddenly I am having to practice a lot for that. Hopefully I will be able to chill after that.

And back to geek stuff.

I took a very brief look at TypeScript, this is the Microsoft attempt at improving JavaScript. I haven't written any code just looked.

Google has taken a lot of heat over Dart and while I did not follow peoples reactions to Typescript but I imagine it was similar. If you look at TypeScript it is in many ways a lot more conservative than Dart.

Typescript is a super set of JavaScript so any valid JavaScript is also valid TypeScript. From the name you may be able to guess what it adds. Yep optionally typing. I really like the idea of gradually adding types to areas that have become stable so I am instantly a fan. From the look of it there's quite a bit of type inference going on so you don't have to type out the types.

It has header files, C programmers rejoice! OK these are meant for existing JavaScript libraries that would benefit from having some typing put on top of them before being used in TypeScript. You can of course just use any JavaScript files with having a header - they are optional.

In addition to adding optional typing there have been a few language additions such as proper classes. I think these additions follow the same syntax as what has been proposed for the next version of JavaScript.

Overall I was left with a feeling that they wanted to tread lightly on JavaScript and just add things that will eventually make it into JavaScript or help with larger code bases (typing).

It is a shame that Google did not come out with TypeScript instead of Dart as it would probably gained a lot more acceptance.

Why types can be handy.

I sit on the fence when it comes to statically typed languages (C/C++/D/Haskell) and dynamically type languages (Javascript/Python/Ruby/Lisp). I can see both have good parts and bad parts.

Perhaps the differences are becoming less and less. With better IDE type inference and the advent of optional typing in things like Dart the IDEs used for dynamic languages are catching up with the features of the statically typed languages. It is certainly easier to write re-factoring tools for Java rather than JavaScript and for them to be correct at all times.

With C++ changing the meaning of auto to be Mr Compiler could you figure out this type for me the amount of typing has greatly reduced in at least one main stream statically typed language.

The idea of option typing is very appealing to me. It has been explained else where many times but I shall do so here just for fun.

If JavaScript had the ability to let me at some time add typing to a point class to say only numbers allowed, it would be great. Effectively I would be saying, look this point class is used all over my geometry library so people should only put numbers in it, if not bad things will happen so tell me as early as possible.

I probably would not add this typing when I first created the class but the moment I got a bug where the x component contained a string or an array of numbers then rather annoyed by my mistake the typing would be added. That pretty much sum up why I would like optional typing.

So if I like types why am I currently using JavaScript for stuff. Well programming with a dynamically type language turns out to be fun. There is less verbosity and often less boiler plate code. When I am tired at night this is kind of nice I can just throw stuff together and get sucked in to the code. Dynamically typed languages certainly own the niche of throwing together prototype ideas.

I digress. 

What I have been trying to say is types are nice for reasons other than performance. Catching errors and giving your IDE a better idea of what is going on are good reasons to add optional types even if your language is destined to be compiled down to JavaScript. Yes it has been said better elsewhere.

It is time to stop I this post is starting to feel a little bit meandering and missing whatever the point was I was trying to make.

Sunday, 18 November 2012

A Journey into Emacs is a Long One.


I never really intended to get pulled into emacs  I admit I have at points in the past liked it and at other points found it frustrating  My return to it from vim for simple editing and lots of eclipse for Java was initiated when I wanted to play with Clojure. Doing lisp and not using emacs just did not seem right :)

My adventures with Clojure did not last long and I move on to revisiting JavaScript. However I stuck with emacs and use the official js-mode along with the js2-mode thing originating from Steve Yeggie. I think I prefer the Steve Yeggie one at the moment. As there does not seem to be much development on either of these two modes I doubt my opinion will change in the next year of so.

I have written a couple of noob elisp functions but not anything that I use daily. Usually I myself coming up with an idea fiddling a bit and then realising that core emacs has it build in or someone else has already added the idea to some extension. This is good as it is not really a goal to become really good at hammering out elisp. I will just learn as I go.

Some things that I have found useful are:

Book Marking
This is basically a list of places on your drive that you want to jump to. Say different project directories and so on.

The main keys are

  •  C-x r m                     - Make bookmark, you will be prompted for a name
  •  C-x r l                       - To list them
  • M-x bookmark-save  - To save them so they persist past the session

When in a book mark list buffer

  •  D - delete a bookmark
  •  r  - to rename it

I use this everyday.

Register Bookmarks
This one is more for jumping around a file. It lets you drop bookmarks and return to them. The keys for this are

  • C-x r SPACE [a-z]  - Store a position
  • C-x r j [a-z]      - Jump to position


I am guilty of not using these enough. They have not made it into my muscle memory just yet. I am using them more and more so they will be soon.

Navigation Stack
Again another one I am just getting used to and am not 100% on how exactly they work. But they let you go back to position in a buffer or between buffers


  • C-u C-SPACE - Back to a previous position in a buffer.
  • C-x C-SPC      - Back to a previous buffer.


Alignment
I really like this one and nearly wrote some elisp to do this before I found out it existed.

Say you have some code
x = 90
myvar = "the"
thisIsAReallyLongVariableName = 1

and you want to line up all the equal signs to make them a little clearer. It is simple, you just highlight the region and then do

M-x align-regex press return;
then type = and press return
Hey presto we have

x                             = 90
myvar                         = "the"
thisIsAReallyLongVariableName = 1

I really like this as I mentioned before.


Other stuff,
I followed some tutorial when I was first setting up emacs to get things like ido mode working and using them makes the whole experience a lot better. There is an lot of setting up emacs articles on the web.

I will not be doing any proper Java coding in emacs, it would be significantly slower but perhaps on cold winter evening I might give it a go. I also suspect there are better editors for JavaScript but for now I am quite happy.

I think I am over the hardest part of the learning curve and emacs is starting to become enjoyable to use. If I learn elisp it will be a gradual thing done on an as needed basis and I feel like I am now into the slow customisation phase that will slowly boost my productivity.

Do I code faster in emacs? Saying yes would be nice but I don't honestly know. I suspect coding JavaScript in eclipse or some other ide would be just as fast but I can't be sure as a lot of productivity is subjective. At the moment nothing gets in my way when using emacs and it is fun to use, I don't mind firing it up late at night when I am tired and that helps.

Coding using emacs and JavaScript is so distant from what I do at work it just feels like fun. Hopefully as my JavaScript code grows in size my skills in emacs will also grow to accommodate the added complexity.

Friday, 16 November 2012

Mumbling about Dropbox


It is fair to say I am having a phase of web development at the moment. It is also fair to say that by web development I tend to focus on the client side of things. Basically I try to create useful apps that could totally exist as a desktop app.

I don't do much server side. It used to be because I did not have a server to do this sort of stuff on but now with the advent of free tiers at many hosting places that is no longer the excuse. Just most of my ideas don't require much in the way of server support.

It would also be fair to say what I want from a server is a place to store stuff the user has been working. Yep I want a file system, well a file system for each user.

Enter DropBox. Recently they have produced a JavaScript library for interacting with drop box. From the client side of the browser you can read and write files and do other file system like operations and it is really easy to set up/use. Although I have been struggling in my attempts to write an image to it. Well converting an image element to a png binary so I can save seem to be the real problem and this has nothing to do with drop box.

dropbox.js works well and is something I will probably integrate into my little sprite editor in the near future.

From the point of view of my sprite editor it should help to solve the problem of providing a nice way to export your art work. At the moment you can download you sprite sheet by right clicking it but that is not exactly satisfactory  I can base64 encode it and change the header of that and then provide it as link but I seem unable to set the file name of the file downloaded. Again that is not a great experience.

As dropbox.js will plonk you files straight into your dropbox which is then synced to your desktop, getting you sprite sheets will be as simple as cut and pasting or writing a simple script.

Not to sound too much of a dropbox fan but given you can host static sites on your account (with some limitations) and use their client side api to store files in the cloud using users accounts they provide a fairly good base on which to build a certain class of web apps.

When I look at my ideas list for web apps all I see is a list that matches this style of web programming.

At the moment I am not going to push the dropbox integration as the JavaScript support is quite new and I am happy to give it a bit of time to settle in and get bug fixed.

My little sprite editor is nowhere near the point of being useful anyway so I would prefer to work on the important things first. Having said that I do want to start actually pushing out versions, probably hosted on dropbox, so anyone who want to see what I am talking about can do so. It might also push me to make it look nice.

Before doing this I want to give the ability to download the produced tile set and reload one. Warning it is going to be pretty basic to start off with.

None of this will be happening this weekend as I am running a marathon. It also means I probably going to be a little wiped out for the early part of next week. Slightly worried I have not trained enough for it. Although I am about ten times fitter than 6 months ago.

Of course I am sure google drive offer similar abilities and perhaps one day I will look at that. It is not quite as useful to me as dropbox because last time I looked they did not have a linux client. I predominantly use linux at home.

Friday, 9 November 2012

Random Little Observations Early Nov 2012


I have a whole load of little observations about stuff I have been doing over the past week. So settle in with a cup of coffee and read on for what in the most part will be quite a positive set of observations. Of course included in this is a little update to what I have been up to.

First up C++. I program in C++ for my day job, it is what pays the bills. I quite like C++ but find development in it a little slow in terms of knocking out code for stuff at home. The small stuff I knock up at home does't need the speed of C++ making it hard to justify extra time spent creating programs. However I have recently been messing with C++ 11 or what ever it is now called. 

It is quite an improvement. A combination of lambda, improved initiliser lists, improved constructors, for range loops and of course auto being repurposed in an intelligent way will really add to the productivity of programmers. The are lots of other improvements many aimed at library developers and my work happily straddles application and library development. Overall a win but the thing at the back of my mind is the language has just gotten a fair bit bigger. I am not a super fan of large languages but I guess to improve C++ it has to grow or break things. 

I hope someone is working on "C++ the good parts" to give new programmers a clear path.

Much of my coding at home is currently done in JavaScript see previous posts about this. I am using emacs as my IDE. Learning emacs is a journey in itself and one that I am only a short way along. Over the past week I suddenly find myself using find and replace a lot more. Yes every editor has this but most pop up a dialog. Emacs does not do this and as it is less distracting meaning I use it more as I dont neet to reach for the mouse. I am also starting to feel the urge to do some emacs lisp coding to gain a few features I would like and probably already exist if I could find them.

My JavaScript skills are also increasing. I am still learning stuff but my mental model of how it all glues together seem to be getting closer to what is actually happening. That is I am updating it less and less so I assume I am getting closer. Obviously I don't know what I don't know... I can now correctly predict when the this variable is going to be wrong.

Much of my coding has been working on a little web based sprite editor. It is not much to look at but I quite like developing it at the moment. It is probably about 350 lines of code but those lines have been iterated over quite a few times and I keep doing so as I learn more.

One interestng thing is I usually find with dynamic languages is at somewhere between 500 and 1000 lines of code the code base starts to feel heavy. I suspect this is my inexperience with the language so it will be interesting to see how the code feels once I hit those heady heights! 

I am hoping a better understanding of JavaScript and focus on writing as good quality and idomatic code as possible should help avoid this. People certainly manage to create large application in JavaScript so any failing should be directed at my process rather than JavaScripts.

Anyway the sprite editor is starting to actually function at a very basic level. I have three fairly large things I want to add then it is possible I will put it up somewhere for people to see. No promises as this is just a fun hack at the moment.

Monday, 5 November 2012

The No Plan, errr Plan?


I have not really properly touched on why I have drifted towards JavaScript over the past couple of weeks. So I figured I should bash it out in writing.

My life is really busy and has been for a month or two. A combination of the day job being really busy (C++ coder) and personal life (attempting to sell our house and family members being ill) I have to admit I was, and partially still am, feeling a little bit burned.

Firing up eclipse in the evening was just not happening. LibGdx is still a lot of fun it is I just wanted a break it. It was all starting to feel a little heavy. I usually get this feeling about something when what I am working on in my free time does not equal what I really want to be working on. It is hard to explain but perhaps you understand what I mean. It is after all my free time so I should do stuff that is fun.

Then a few weeks back I was not enjoying clojure and just started hacking some JavaScript out. It was fun. Firing up emacs seemed less hassle than eclipse. Perhaps because in my mind emacs meant I am going to mess with something small while eclipse meant a larger project.

I also let myself just code whatever I wanted. Of course that was a little gaming library. Fun even if it has been done better elsewhere. One lunch hour I just start putting together a very simple sprite editor. Not sure why but a couple of hours later (and a few iteration on how to do things) I had something I could draw onto the screen with.

It was apparent I am back in the zone with these things. This is great. I don't have a plan for any of this other than enjoy doing it. Plans will destroy the fun of it. For now I will continue to hack away.

Did I mention I am also training for a marathon. No well it is not relevant other than to demonstrate how time constrained I am. It is in a couple of week and I doubt it will be a personal best for me.

There was sort of an epiphany moment sometime over last weekend where I realised I need to do this type of coding for an extended period to time to regain my coding mojo. So my plan is to not plan for the rest of the year. When I open my laptop in the evening I will just decide based on what I feel like doing and what seems like fun.

Anyway I have rambled on enough. I hope I have not bored you too much and yes I could write a couple more pages about all this but I will resist :) Will lets you know how it goes.

Tuesday, 23 October 2012

Odds and Ends


So we are yet again on a verge of another android release. I suspect this one is going to be a popular iteration on account it is around 2 years since the release of 2.3 and that was pretty popular. Lots of people will be falling of their 2 year contracts and wanting to upgrade.

I am hoping that the built in browser gets a little love. That is get to the point it can smoothly run JQueryMobile. That is embed it into an app that can be released on the store. I hope for this every new release.

Pretty much decided to write off the next month or so. My brain is knackered so I am going to cast it out in the sea and let it drift. Sort of see where it takes me. Motivation for home projects has been ebbing and letting myself drift for a while usually re motivates me.

My first port of call has been JavaScript and HTML. I have figured out to do a reasonable input entry for a text adventure game. Nothing major but it has been one of those things I have wanted to figure out for a while. I am not developing it further just a figuring it out sort of project.

Sunday, 21 October 2012

On to JavaScript


My mind has drifted towards JavaScript and a little bit away from clojure. I was enjoying clojure and learned quite a bit about it this time round.

It was not feeling like much fun for some reason I could not put my finger on. Perhaps it is because I have been working pretty hard at work and just have not had the energy required to devote time to it. I am sure I will return to it at some point in the future. A bit my my explorations of Haskell.

So for "fun" programming seem to have switched to JavaScript. I recall getting quite annoyed with it in the past. If I am honest I think I enjoy messing with languages so flipping between them is quite common. I don't actually spend that much time on it as I tend to split my at home programming time between this stuff and android dev leaning more towards the android stuff.

So in a sense as long as it is fun I am allowing my interests to wonder in any direction it takes.

Wednesday, 5 September 2012

Emacs



So I have over many years occasionally got into emacs, sometimes because it is the best/recommend ide for a programming language and once because of org-mode. Usually I drift away because I get annoyed with it not providing the features I want.

We when I say not providing I really mean it provides them but I can't get them working. Over time I have learnt to avoid it and have got quite reasonable at vim.

Recently I returned to emacs because I have decided to spend some time with clojure and see if I take to it. It also happens that version 24 of emacs has been released.

I must say either my brain has moved closer to the way emacs works or emacs has improved quite a bit since I last used it. There seems to be proper code completion for practically any language you want, org-mode is still great and the built in theming is nice to have.

Yes setting up the .emacs file can be a combination of fun and pain but the package management system seems to work well once you add marmalade that it. It being installed by default is great.

My clojure set up is the usual clojure-mode, nrepl, auto-complete with ac-nrepl. Probably quite standard by all accounts.

Now I could have used CounterClockwise, the eclipse plug in for clojure, and been hacking on clojure a little sooner. The reason I decided to not do this is because of fun. I wanted learning clojure to be fun and using a totally different dev system that is different from Visual studio (C++ at work) and Eclipse (Java for android stuff) will mean it is less likely to feel like work. Different is fun :)

Clojure wise I plan to develop a few simple programs say a calculator and maybe a text adventure. Then go from there.