CategoryInternet

Base64 Image Encoding With Angular2 and Typescript

As part of the upcoming Android application I’ve been working on a web app that can manage content in my Firebase database using Angular. I was recommended to use Angular2 as it will soon be the ‘hot new thing’, unfortunately that means a lack of documentation and stack overflow examples.

One thing that I needed was to store images in base64 encoded strings in Firebase (due to no support for Firebase Storage in AngularFire, but that’s another story). I first started by looking for some sort of plugin but couldn’t find anything that worked with Angular2 so ended up writing the code myself, it’s actually fantastically easy.

It does not require any includes as FileReader is part of the core language. Once the image has been processed it will be placed in the member base64Encoded. You may wish to use some sort of event emitter so you can subscribe for when the encoding is complete.

Python Port Tunneler

I needed to be able to remote debug a process that was hidden behind a middle server so I made a Python script that can create a ‘middle man’ port to allow for this.

Basically if you have server-B which is only accessible through server-A then the script creates a port on server-A that links to the desired remote debug port on server-B and provides a new port to forward all traffic through.

It’s probably possible to do this all with some cryptic SSH command but this works better for me, plus I got to do some more Python. It uses the gevent library, which is an extremely fast and efficient socket library and can be downloaded from any good repository.

The usage is quite simple –

The code –

 

Reblog: Python Minidom and Whitespace

A good tutorial providing fixes for printing of XML using Python and Minidom. Specifically fixing added whitespace and the conversion of characters into HTML entities.

WTF Is UPlay?

wtf_is_uplay

Wanted to play Far Cry 3, turns out I have to use yet another pointless game ‘service’. Seriously, for single player I have to register an account and be logged on and all sorts of other rubbish. Really getting tired of this all because of piracy. Next time I’m getting it from the Pirate Bay.

New Gmail Compose Screen

Just been prompted by Gmail to use a new email composing screen. Not a massive change as you’d expect from Google but it does make the web client a bit more seamless. Basically instead of being directed to a new screen when composing an email, a composition window similar to a Google chat window will appear in the lower right hand of your screen.

new gmail compose screen

It is a nice change and will no doubt be rolling out to everyone shortly.

Project Eternity

I have backed my first Kickstarter campaign, and what a place to start! Project Eternity is the idea from a group of clearly very talented developers with titles such as Baldur’s Gate, Fallout and Planescape Torment under their belts. TAKE MY MONEY PLEASE. Cannot wait to see how this game turns out.

Been very impressed with their attitude about the whole thing, very frequent updates and lots of chances to communicate with the developers. I just really hope they preserve the feel of the original Baldur’s Gate which seems to be it’s closest spiritual predecessor.

The Kickstarter process is very easy and clear to use, I will definitely be on the lookout for more good ideas to get behind.

Some more info – http://www.kickstarter.com/projects/obsidian/project-eternity

Today I learnt that it is programmer’s day, apparently we’re all supposed to get beer and pizza? I for one shall be celebrating by porting various tools from Linux to Solaris.

Baldur’s Gate Enhanced Edition

A really excellent piece of news which I only found out from a tabloid website is that the original programmers for Baldur’s Gate have got back together in order to update the games for a more modern time.

The best part is that these games aren’t getting torn apart and dumbed down for the Call of Battlefield Duty console gamers but getting left in their original unadulterated RPG goodness. The Baldur’s Gate series is easily the greatest RPG made, the depth of the story and the characters, the environments and the many side quests. This release is the first game including the expansion with Baldur’s Gate II set for a release later on.

You can even play it on an tablet so I am very tempted to get it on more than one platform. Anyway, if you’ve played these games before you’re definitely going to be buying them and if you haven’t then you owe yourself a taste of how great a game can be given the opportunity.

Find all the information you need here – http://www.baldursgate.com/

UPDATE – Pre-ordered 😀

 

Watching BBC iPlayer While Abroad

I now live in Norway which means that I can no longer use the excellent BBC iPlayer service, this is especially annoying as the Olympics has just started.

The quickest solution for this is to use a VPN service but they all take such a large amount of configuring. I found this excellent tool called Expat Shield which provides a very simple one button VPN solution masking your IP to appear as though it is coming from England.

The terms and conditions do say that this should only be used by expats of UK so for once I’m not doing anything wrong!

The service is very easy to use, quick to set up and has very little slow down on the bandwidth; I’m sat here watching the rowing on the iPlayer right now.

Lego Landrover

Just seen a fantastic video of a Landrover Defender 110 built entirely from lego; not just that but it has a full five speed sequential gear box, high and low range and a choice between two and four wheel drive (not entirely authentic that part)!

It’s really worth watching just to see the inner workings and fantastic little details such as moving pistons. Some more information can be found on Sheepo’s blog.

Also this seems like a pretty good excuse to post a picture of my full size version!

Free Twitter Data Set

I needed a twitter data set for my thesis and struggled to find one that was freely available. I ended up downloading the data I needed so I thought I would release it here.  It does come in a slightly annoying format which is a MongoDB dump file but it should be easy enough to extract to there and use it. The structure of each record is shown below.

So if you wanted to go over all records in the database you would do it like this –

Download Twitter Mongo Dump

221 Byte Tron Game

Interesting little story on Slashdot today about a Tron game made in just 221 bytes – http://alokmenghrajani.github.com/tron/ – does seem very small but then you have to remember that Javascript and Chrome do provide a large amount of the handling code, pretty much all that had to be implemented was a tick function and a draw function with the direction being represented by an on key up event.

Might have to attempt it in something like python or C++ for extra brutality.

© 2024 Acodemics

Theme by Anders NorénUp ↑