Thursday, 26 April 2012

Bit like hunger, yet more constructive...

Hello once again.

Seriously, I need to sort my blogging habbits out. I seem to go through stages of using it all the time, to using it once every few weeks!
So, why suddenly today have I returned? Simple really, I was revising (got my second year university exams throughout May) and the urge hit me; bit like hunger, yet slightly more constructive.

I suppose I should talk about a few things that have happened over the last few weeks:







...

Not that much actually. Returned home for a two weeks to see friends and family, but most of my days have been filled with revision... Yeah wonderful isn't it?

On a slightly different note, I'll be moving to Australia at the end of May! So from there on in I'll be mostly blogging about what's happening, and what's different. I should eventually be living in Sydney, and so I'll try to share photo's as well as places to go if you ever visit (not me, the city...Although I do get lonely...).

So yeah, pretty exciting and scary!

Anyway, that's about all I want to blog about today. I'll talk about my excitement for the new Avengers film tomorrow (It was released today but I won't get to see it until Saturday, sad times) along with my hopes and favourite characters etc. Basically it should be a little more structured than this ramble (see above).

I will leave you with this:
ALO is one of my favourite bands (if you have me on Spotify/Twitter, you might have noticed this), and their new album comes out in May. They have single out from it (Speed of Dreams by ALO); check it out on their website/on Youtube, its excellent, and has made me super mega psyched for this new album.

Oh and one more thing; that song on the IE advert?
It's called Too Close by Alex Claire, and its awesome, and not just because its on an advert to do with tech! 

Anyway, have fun

Hazz 22

(Twitter...Hazz 22 was taken... so its Hazz223)





Sunday, 11 March 2012

11/3/12 (Real imaginative title Hazz...)


Hello all!

What's it been? Two months? Wow time has just flown by! So, where have I been then? Simple answer; busy! My course has been pretty full on, and so all "extra" projects have pretty much taken a back seat. Annoying really!

On the plus side though, I now have the knowledge to fix the Java Network Client, so I will try and finish that. I might even post the source code online for people to try for themselves! This Blog entry was more of a catch up, and to say that I haven't completely forgotten about Blogging. Over the next few weeks expect a consolidation of all of my work. What does this mean? Well, avid reader, it means all of my previous work across different Blogging sites will be brought together under the one proverbial roof!

 I will also be writing some more tech news blogs, such as more about Games etc. Actually, that reminds me! I've written three entries last year that were never published. They were reviews for games I'd brought. I'LL find them and post them soon...maybe.

Ah... It's good to be back!

 Hazz 22

Wednesday, 4 January 2012

General Update 4/1/12

Happy New Year!

Anyway, the blog. Right well obviously not much has happened over the last few days when it comes to the Java project . Tempted to leave it until I start Universtiy again which is in another 12 days... annoyingly!
Also, i have an exam in just less than a week, so a lot of my spare time will be spent doing revision.

On a different note I've just started playing The Legend of Zelda: Skyward Sword. I will evntually write a review and put it up here, but for the time being I'll leave you with this: Its great! Classic Zelda, which isn't a bad thing!

Being back at univsersity is rather nice (not started lectures yet, but I'm back in my accomidation) as I have another computer here, along with a few other things. Also, the freedom is rather good!

Speaking of my other computer, not my netbook or my laptop, I have mildly missed it while I've been away at home. Currently I'm running Linux Mint on it;  it's good fun! Some really nice features along with speeding up this seriously old hardware. The hardware in question? Well, 1.5 GB of RAM, and a 2.1 GHz single core AMD Athlon XP 2800+. Yes its old, but is realtivly capable with simple internet browsing and even abit of Java coding! Hopefully in the end it will be come the central hub computer to my Java Network Program.

My big laptop on the other hand will continue being my main choice for computing needs. I recently installed an extra 2GB of RAM on it making it a ground breaking 4GB! Yeah... you at the back stop chuckling! Ah well, it will be enough.
Annoyingly though i need to change the operating system. For those of you who don't know, a 32 bit operating system (which is what I currently run) can only recognise a maximum of 3 GB of RAM. So effectivly my laptop isnt running at the full 4GB, but instead 3GB. Rubbish! So of course that requires a very loverly reinstall... good times!

Anyway, I've rambled on for far to long about very little. All of the above will probably lead onto another blog entry (I've been meaning to do one about Linux for AGES!) so maybe its not not completely useless!

Until next time.

Hazz 223

Friday, 30 December 2011

Java Network Client update 31/12/11

So Christmas has been and gone. Got some nice jumpers and spent some time with the family, so all in all good times. But this blog is not about my personal life (not entirely anyway) so back to the Java Network Client.

I'm going to be frank (you can be who ever you want), development has ground to a halt.
This isn't because I cant be bothered, but actually due to the way I'm trying to implement it. As you know the whole program is based around being able to send files and messages around a home network with a Central computer redirecting everything.So computer A sends a message to computer B by first telling the Central computer that it wants to send to B and with the central computer then passing the information on, like a relay.

The concept seems pretty simple, but once you start threading it all gets complicated. Let me explain.

When A connects to the central computer, the central computer stores its IP address (when A initially connects it sends its IP across the network automatically). This now means a separate thread for A has now been created. When B connects the same thing happens. The major issue I found though was where can i store the IP addresses and make the accessible to all the threads? 



Now this is where the blog post gets a little bit confusing, but hang on in there. Initially i was writing the above post, then i suddenly came up with a way of fixing the problem, so i focused on that for an hour and forgot about this post. So here i am a day later to complete it and share what happened:

The solution didn't work.

I'll get back to what i was going to say...

So, the solution to the IP problem has been elusive to say the least. Actually that's not true; a working solution is a far better way to describe what's going on. When I first encounter the whole storing problem, I thought I could just store the IP in an array within an Object (coding term; look it up), but this wont work, as each thread would create a brand new Object to store the array, and thus NONE of the connected computers would have a complete array.

Ok, I understand that for people who don't do this stuff is all a bit "wha?", and i will write about Objects soon. But this has led to a seriously hard problem. How do I create a central store for all the IP data where each thread can access and update?
The idea I had was to create a separate file that stores the Object which contains the IP addresses. This file can then be accessed by any thread! Of course there are a few problems with using this methods which i will elaborate on in a later blog post, but the idea to me seems pretty sound. Well it would be if I could get it working!

For some bazaar reason when I read and write to files from the program it just fails! So with out a decent way to store the IPs I can't get more than interaction between the Central computer and a computer connected. Very annoying!

So at the moment I'm at a loss. Over the coming weeks i will keep working at it, and find away around it. When I'm back at University I'll ask around to see what I'm doing wrong or for other ideas.
In the mean time keep a lookout on my twitter to see updates, and if you want to help then leave a comment!

Hazz 22

Merry Christmas and a Happy New Year!      

  

Tuesday, 20 December 2011

Java Network Client: Part 1

Ok so here we go; I've now started work on creating the foundation to the Java program!

To be fair, I've probably spent around 2 hours on it, and within those hours not all that much has been achieved. Bits and pieces needed to be re-learned from earlier this year, as well as getting around a few slight issues.

I've decided to break the project down a little bit; first it will be a chat messenger, then I'll build on its features from there. I decided that if i went right into the program sending pictures etc, i would get bogged down in getting that part right than working on actually getting the networking part right! I will implement the actual file transferring stuff as soon as the chat part is done.

What i should probably do is tell you whats happened:

- Created two programs: the Client and the Server.
These do exactly what they say on the tin; the Client is what every user will be using, and the Server sorts where everything is going as well as keeping track on whats connected to it. I will go into both of these in more detail in a bit.

- Threaded both the Server and the Client (Will explain this further down)

- Working on getting the Server to understand who's who
Basically, when a client logs in it passes its IP address to the server to store. This can then be used by the Server to pass back text. This leads onto making the project a chat messenger.

The Server:
As i said above, the Server is the central part of the network. It will contain all the details of everyone connected, thus allowing for people to interact with each other. Let me explain a little further:
Person A wants to send messages to person B (lets assume person B is already logged in). Person A will connect to the Server (which will store person As IP address) and will then be told who else is connected to the network. Person A will then pick person B to talk to, and thus will send a message to them. The message will travel to the Server, which will then check to see if person B is still there and then pass the message on. This will then appear on person Bs screen.
Phew, sorry for such a "proper" explanation there, but it also helps me to work out whats going on.

Some of the coders among you will have been wondering how I'm going to deal with all this simultaneously, as in the Server dealing with the Clients sending and getting messages at the same time.
Simply put, im going to "thread" it all.
Threading is a rather clever idea. I'll explain it in context with the program.(If you already know about threading, skip this!)

So, the Sever will need to be able to deal with multiple connections at once, as clients are connecting and disconnecting with the Server all the time. The best way to do this is when the Client connects, it creates a "thread" which is self contained.
You could say that a program without threading is a single thread. Trying to make the program with connections coming in at any time and along with other things going on makes it almost impossible without threading (although it is achievable).
A loose analogy is that you're make a cup of tea. Asked to make more than one cup of tea at the same time will require more thinking, and more time. It will also depend on whether you have already boiled the water and what cups you have available. Now with threading when someone asks you for a cup of tea, you create a new instance of you making said tea; a new mug, kettle and tea bag are all created ready for you and thus the second tea making can be done at the same time as the first cup of tea.
Of course this is a bit of a loose analogy, so don't take it as 100%.

So back to what i was saying. The Server is threaded to allow for multiple connections, and the client is partially threaded.

What i mean by the client is partially threaded is because at the moment only the reciever part is threaded, not the sender. So you can receive messages at any time, but you only send one message at a time, thus at the moment the sender part doesnt need to be.

Anyway, sorry for diving into threading. This was supposed to be a more general update on whats happening, but got carried away!

Hope to get the Chat part finished soon, and in the next few days i will explain how I store the addresses of everyone connected.
Until then, have fun!

Hazz 22

(Small side note: The name is just for fun. I just thought it would need a name!)

Thursday, 15 December 2011

Christmas Project Part Two


So, assuming you read my most recent blog that i posted all of about 5 minutes ago, you are probably aware of the fact I'm going to be blogging over Christmas (If your not... go and read the blog below this!).  But blogging about what? Ah... now your asking the right questions.

I have probably 4 projects i wish to work on and complete over the next two to three weeks. For starters, a file transfer Java program.

As a Software engineering student, i get given course work that asks me to make simple programs. One such assignment is to simulate a Client-Server relationship on a local network. For example, the Client asks for a picture from the Server and the Server sends it. This got me thinking; could i extend this to something more useful?

So, here's my plan: create a Java program that will allow me to transfer files around all three of my computers that are connected to the local network.
Why you ask? Well, simply put its a pain to transfer files around at the moment. Each computer is connected to DropBox, so i can sync files that way, but my Internet in my house is pretty poor. It cuts out randomly, thus causing me to get out a USB pendrive and faff about with it. I just want someone i can load up from the desktop and send files around.
There is another step to this: User interface. I don't really want to be running it from the command line every time i want to use it, so I'm going to build a small Swing (Javas interfacing stuff) front to it. Some people don't like Swing, which is fair. I've never actually used it, so i thought i might as well give it a go!

This project is all about learning. 

You learn nothing from a map, but loads from getting lost

So yeah, thats the plan. I will post updates along with pictures and designs of progress etc.

Leave a comment if your interested!

Hazz 22

(I am aware there are FAR more efficient ways of doing this, but its all about learning)



Christmas Projects 2011

Hello all!

Right, well...er... this is awkward! Basically, yesterday i created a Tumblr account and today i posted too it. It's a great site, its just a massive shame it doesn't have ANY native stat tracking! As in, you can't tell how many people have visited etc.

So basically, I've ended up back here. I did have a brief stint using Wordpress, but got sick of how needlessly complicated it all was. I just wanted a blogging site that was easy to update, good looking and easy to track what views i was getting. So here i am once again, back on Blogger.

So what am i doing back here you ask? Well, as i wrote this morning on Tumblr, I'm here as its now the Christmas holidays. This means I FINALLY have some time off! No more feeling guilty about doing something fun for half an hour, when I should have been working.
So with all this extra time I have, I've decided to set my self some projects. I'm not going to explain them all now, as that will be another post, but I will say that I plan to "document" (blog) the work I do.

So anyway, its nice to be back!

Hazz 22