Category Archives: Tech

Move along – You can’t Like that here

According to this article the Facebook Like button has been one of the guiding forces of defining how we interact with content on the web today. To be honest I can’t remember what the article said but I thought it was a decent enough lead in, so I went with that. However what I said isn’t really such a bold claim if you take into account all the sites that already have the Like button somewhere on the page. I’m sitting here, trying to think of non-sterotypical hyperbole of how frequently the like button is used on the web as a way of avoiding doing any form of research on what I am writing about. The problem being, I am not really in the most verbally creative states of mind just yet… so lets just say it’s a lot… like really a lot… like over 12.

As much as I want to hate on Facebook, the idea of a Like button is a simple and intuitive concept, it’s difficult to see why it wouldn’t work. Without doing any research or caring about whether I am right or not, the Digg button existed long before the Like button. If things were different and Digg was a little more cautious with it’s version 4 overhaul and it’s users weren’t so whiny, we may have still been Digging stuff. I’d like to think that the Digg button was the precursor to the Like button. The concept is not new by any means, but being in the right place at the right time has seen a huge uptake of the like button.

As an aside I find the corporate Like culture quite weird. It’s used as a form of currency, Like me and you can have this download. Like me and you can enter this competition, you had to make a purchase previously. You have to like me before you can interact with me. What is that shit all about? Companies are collecting them, kind of like XBOX achievement points but for corporates – to see who has the biggest dick. I am not saying that is all it’s good for, as a content provider I can see how it may have value as a feedback system. But… I’m getting sidetracked.

The undeniable success of the Like button has spawned some Like clones. Google’s +1 is an obvious one, while Behance has the Appreciate This seal of approval at the bottom. There is also Flattr, but that’s different. It’s the put your money where you mouth is of Like buttons, the put up or shut up – there are direct real world consequences for clicking a Flattr button. That’s just three examples, I’m sure there are many others and I have no doubt many others will follow suit.

Hmmm... Do I Like this or is it Tits?

With everyone wanting to cut out their own little wordy real estate on the web, I was wondering why we can’t reuse. Will I be allowed to like stuff in a non Facebook way? They probably won’t, but why can’t Microsoft, Google or Apple let users Like stuff? I am not saying they would want to either but I sure would like to see someone try. What would happen? Litigation? Even if the button were branded differently so there was no confusion? I don’t know? A Nike Like or something? I mean, people were liking stuff long before the internet. Liking something has always been a natural form of expression. Why can’t we reuse it? Surely you can’t hold a monopoly on liking stuff?

Using this when referencing a member variable

Originally I wrote this whole article using the words “global scrote” instead of “global scope”. My intention was to include a picture of the world inside a scrotum. It was going to be hilarious. Then I had to switch it all back after I started searching for a picture of a scrotum that would be suitable to Photoshop the earth into. I just couldn’t any more. Urgh!

Anyhow, back in 1999 I started learning Object Orientation and Java. I learned that you used the keyword this to denote that you are talking about the class you are currently in. So you could have something like this:

public class bar{
    private Int abc;
    public function foo()
    {
        this.abc = 21;
    }

    public function foobar()
    {
        this.abc = 92;
        this.foo();
    }
 }

It made sense.

Recently I have been playing around with Adobe Flash and Java. I’ve noticed is that there’s no requirement to use the keyword this. I really want to say how this is wrong, and how the language designers have made a poor decision. I have no idea how I can say those things and be taken seriously. Taking into consideration the small fact that I have a total of maybe 6 months experience in both of those languages combined, I can’t help but feel the language designers have a bit more knowledge on the subject than I do. So it probably makes sense in the larger context.

Having said that, I have no idea why this was allowed. I think Java and code written OO in general have large increases in verbosity compared to non-OO. The verbosity allows for readability and maintainability.

Coming from a background where my professional coding has largely been PHP, where PHP allows for (but frowned upon) functions and variables to be defined in a global scope I have learned that you ALWAYS ALWAYS use this. You have no idea whose code you have inherited and you have no idea who will inherit your code. Using this does two things:

  1. In the case of the function, this.foo(), tells you that the code to be executed is the code defined in the function just in this class. No matter if someone defines a foo() in the global scope outside of the file and includes it into the local scope the function in the class will always be run.
  2. In the case of the variable, it says we are using the variable defined inside the class we are currently in.

In the case of point 2 above you may think: “ok… yeah so?”. Well take a look at the code below. This is an example of the code I have been seeing in the Java examples and tutorials:

public class bar extends kablah{
    private Int abc;
    public function foo()
    {
        abc = 21;
    }

    public function foobar()
    {
        abc = 92;
        foo();
    }
 }

That just seems confusing to me. Maybe it’s because I come from an environment where global scope was allowed (but frowned upon as the language and its developers matured). If I am looking at function foobar(), I think ok fuck where does this variable come from? What was it’s previous value, should that really get changed. Do I need to worry about it. Let me try find out. Then (in larger classes) you have to go searching to find out it’s a member variable. Same with the function foo(), I spend some mental energy thinking where is that function defined what does it do (this is even more of a problem if the functions don’t have descriptive names)?

Not entirely sure if I should stop here. Basically I answered myself. It is my PHP background that is causing confusion. With Java everything is an object, so if you started on Java and you see foo() you know that it refers to the current object. Where as if you come from maintaining really old PHP4 code as I have, you have seen some really horrible bugs from people using calling functions and variables defined in the global scope. “How the fuck has this variable changed it’s value?!!? This code isn’t even executing!!?!?”

It’s probably just a choice of style and makes no difference (I am not sure if this is always the case and there may be some special cases in more advanced or fringe OO techniques) but I think using this makes it implicit and adds to the readability. So, I’ve come to the conclusion that I will use this and attempt to incorporate what I have just learned into my frame of reference.

Edit: Turns out it does make a difference if you use this or not in java. Which is what I think Jon was trying to tell me in the comments. If you look the example code below

 

public class bar extends kablah{
    private Int abc;
    public function foo()
    {
        abc = 21;
        Object anObject = new Object();
        anObject.setSomething(new Asdf{
            public void barfunc(){
                foobar();
            }
        });
    }

    public function foobar()
    {
        abc = 92;
        foo();
    }
 }

In the anonymous inner class defined by new Asdf we call foobar(). If you invoked the function using this.foobar() it only looks for the class inside the anonymous inner class. If you don’t use ‘this’ the scope will start locally and then be expanded until the function is found.

Motorola Droid Bionic [pics] – Unlock Hidden Functionality

The Motorola Droid Bionic. The latest feature to be added to the Motorola Droid Bionic, the company’s new flagship smart phone, is the ability to fuck you in the ass. I know some of you may be thinking: “Finally! Smart phones have finally reached the pinnacle of human technology!” The truth is this is nothing new. This feature has been included in many of Motorola’s older products including the original Motorola Droid, the great-great-grandfather of Motorola Droid Bionic. It’s not common knowledge, but this feature can be unlocked on nearly all of Motorola’s mobile products, including the soon-to-be-released Motorola Droid Bionic.

The best part about accessing this functionality is that you don’t have to root your phone, you don’t have to download an app. It already comes standard with the phone and will DEFINITELY be included in the Motorola Droid Bionic.

You may be wondering how you can do this on your phone. Well, I was one of the first people to get hold of and become a proud owner of the original Motorola Droid. I’ve been really happy with it. I shouted its praises at anyone willing to listen. Imagine my joy in finding new abilities on an old piece of hardware that I already thought was amazing.

Anyways enough teasing. In then next few paragraphs I will explain to you how to unlock this functionality so that your own Motorola phone can fuck you in the ass. So without further ado:

Unlock the ability to get fucked in the ass with the Motorola Droid Bionic

Motorola Droid Bionic - The fuck machine
  • Step 1: Use your phone as normal.
  • Step 2: Wait for a fault that you yourself are unable to fix.
  • Step 3: Send it to the repair centre listed on Motorola’s own website.
  • Step 4: Hear nothing. Wait a week.
  • Step 5: Phone the customer centre. Listen to them tell you they have no idea where your phone is… even though it was tracked and you can see that someone has signed for it.
  • Step 6: Send a few emails, wait a week.
  • Step 7: They find your phone and email you to tell you they will send you a quote.
  • Step 8: Wait for the quote, receive nothing.
  • Step 9: Call them up. Get told you’ve already been sent a quote and they have been waiting on you all this time.

That’s it! You’ve been fucked in the ass. As you can see it comes standard with every Motorola phone.

The best part is the feature has lasting effect and with the last few steps probably being:

  • Step 10: Pay through you teeth for this shitty service.
  • Step 11: Maybe get your phone back.

SBE Ltd UK, the company behind Motorola’s customer service, is shit. LG uses them too as does T-Mobile. If you can, avoid these companies at all costs. This is NOT an isolated incident. Support is a big part of the product. If you don’t have good support, you don’t have a good product.

Fuck you, a lot.

Question Mark inside Angled Brackets in Java?

Edit: Thanks to Jon Ellis for some clarification.

Edit 2: Added more context to the code.

Edit 3: Thanks again to Jon for more clarification.

I came across something like this while following an android tutorial:

import android.widget.AdapterView.OnItemClickListener;

public class HelloLinear extends Activity
{
  public void onCreate(Bundle savedInstanceState)
  {
    ...
    gridview.setOnItemClickListener(
      new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
          Toast.makeText(HelloGridView.this, "" + position, Toast.LENGTH_SHORT).show();
        }
      }
    );
  }
}

If you look at the line with the colours, what the hell does that mean?

A quick Google search led me to a tutorial on Generics in Java.  Turns out the question mark is called a wild card. I am not entirely sure on the full meaning of that line as my goal is to get just enough information to carry on with the tutorial. So having said that, what I think it is saying is: The onItemClick() takes as it’s first parameter a construct of AdapterView of an unspecified type. The collection can referenced using the variable name parent.

The reason I added more context because I kept staring at this code as there was something else that was not sitting correctly with me. Look at this my original understanding (because I was applying dynamic type rules from JavaScript) was It was a class definition (HelloLinear) containing a function definition, containing a function call which instantiates and maybe even possibly defines an OnItemClickListner class, which then defines a function.

Turns out I was way off. What is actually happening is we are defining a HelloLinear class which defines the onCreate() function which calls the gridview member function which takes as a parameter, I think, any object that implements the ALREADY defined OnItemClickListener interface (which I should have seen from the imports) which is required to implement the onItemClick function. I guess what I was struggling with is that I was not aware you could firstly, instantiate an interface… or secondly instantiate an interface AND define a function inline. Or was it you could instantiate interfaces and it’s the abstract class you can’t instantiate? Or is that just a java thing?

Turns out the new keyword is used slightly differently to what I am used to. The new keyword here is defining an “Anonymous Inner Class” that implements the OnItemClickListener interface.

What about the rest of us?

Update: Facebook and other third party measurement firms reports are in conflict with previous statistics and indicate that overall Facebook numbers are still growing. Three of the firms’ figures do indicate a decrease in the Facebook user base for at least two non-consecutive months. Rightly so, some are saying there is not enough information to call it a trend.

I attempted to quit Facebook the other day. I say attempted because Facebook does not actually let you delete your account. I just deactivates it. Meaning the data is all there. So when you come back in it’s as though you have never left. It’s as though the digital you has just been asleep and everything has carried on around you.

That’s not actually what I wanted to talk about but let me continue down this way for a bit longer. There are both good things and bad things about being in a digital coma. The good thing is that because my account was only deactivated I still have the opportunity to get information I have on there. For instance I had a few appointments sitting in Facebook that I had not yet put in my Google calendar. I logged in to diarise these before deactivating again. Technically I would not have been at that much of a disadvantage if my account was actually deleted, I could have called/emailed the person and I’d have it again. Facebook however, does make it easier. The bad thing is that I feel as a person I’d be much better off from not having a Facebook account at all. To me being slightly less connected feels like a breath of fresh crisp mountain air.

WHY YOU HERE? YOU LEFT US! WHO NEED WHO NOW MUTHAFUCKA!?

 

The other thing to consider is I am by trade, a WEB developer. I develop applications for the WEB. With Facebook being such a large part of the web, is it really plausible that I cannot have a Facebook account. Is it professionally irresponsible? Is it my professional duty as someone who enjoys what he does to have a Facebook account – Arguably to give myself a better reflection of what is happening on the web?

And with Facebook trying to cement itself in every facet of the web, with the bulk of the current web having nearly 5 Like buttons per page, Facebook orientated commenting and also a lot of newer sites using Facebook connect instead of having native registration.

So with the last sentence in the last paragraph, I’m very nearly on the topic of what I want to say. I heard of a new social music experience Turntable.fm today. It’s description was quite compelling so naturally I wanted to try it out. The thing is, I had to sign up using Facebook. This being the other major reason I have been reactivating and deactivating Facebook since I left. The two services I wanted to look at both required an active Facebook account.

This is a worrying trend for me. Well, “worrying” is the wrong word, it doesn’t fit my lifestyle. I understand that everything is better with friends. I also understand that especially in the case of social software you want to tap into Facebook. Your software is social and it’s a pre-built network ready to go, you would have to have a good reason NOT to use Facebook. The thing is I am an introvert and I think right now I want to be a digital introvert now too. I want to be off Facebook, I don’t want everyone knowing my business. And now especially with people losing interest in Facebook, services like this should, if it makes sense, at least cater for my lifestyle too… what ever that may be, native sign up or twitter integration.

Just as an aside to me not being on Facebook, keep in mind if you see me on Facebook in a year or a months time and want to bring up this post to call me a hypocrite, here is my reply: “Fuck you. I do what I want”

Humble Beginnings

I have been wanting to make a game for a very long time. It’s a very complex game, the game I have in mind. So instead of going for the gusto, I thought I would start small as as far as I was concerned, I’d not yet done any sort of game development. I have of course done the crappy Tetris clone and the 0.001% finished Bubble Bobble I did in Javascript. But I didn’t complete those so they do not count.

So I started doing some flash game development. ActionScript(3), Flash, Flex whatever you want to call it. I did some of that using a flash game library called flixel. I basically followed a tutorial with a few twists here and there.

This is the result: (No that is not an edge detection error. That is a “the flash movie does not fit into my column” error.

The control are Left Arrow, Right Arrow and Ctrl to shoot.

P.S Don’t try to get a rating higher than fancy mullet – there isn’t one as this is merely a test.

P.P.S Flash WordPress, the kimili plugin, swfobject and Chome are not playing nicely. It’s not embedding correctly in the chrome browser. I would fix it but I wanted to do something else today. I will fix it another time. For now though try a different browser.

Get Adobe Flash player

 

The funny thing is. The architecture I thought up when attempting Bubble Bobble is very similar to what is suggested implied by the flixel package.

Note: No spelling spelling or grammar checks were done. The message is what is important.

Internet Segregation

Since when has it been ok to Segregate the internet?

What you say? You’ve no idea what I am talking about? If you’re’nt* from the states, you may not know that internet segregation exists. It does though. If you don’t live in the states, try watching a Hulu clip or try watching something on Comedy Central. Under normal circumstances, you can’t! That’s called internet segregation. You may think, “Gerard, Lord of darkness, why does this matter, it’s one site.” True, but if you understand the true nature of the web, it’s all interlinked. This detracts from the whole web experience not only on hulu but digg and all sites that reference locked content. There are ways around this though. By using a proxy it can appear as though you are browsing from inside the United States, thus allowing you to watch the content. Hulu however have begun to shut down content for people using proxies even if they are for a valid reason. All this leads to is people finding other methods to watch the content, namely torrents. Pointless.

Hulu, its pretty gay.
Hulu, it's pointless.

Another example of internet segregation is this talk of Microsoft trying to buy the news from News Corp. My current belief is that Google currently hold an information monopoly on the world. Don’t believe me, check out Google Dashboard and just see how much they know about you. If you are anything like me, it’s a lot. So if you could ignore my paranoia about Google until the day I get to say, “I told you so”, you would see that I am all for removing the Google information monopoly. (Losing it to Microsoft, is another issue all together, but still). Assuming it’s the actual news and not the news brand that is more important. And assuming it’s possible to get the same news on the internet from more than a single source. With all this in mind is it a good idea to prevent content being viewed from a specific network. Even if somehow it did make sense, ultimately it would be pointless. All this will do is broaden the the market for something I thought previously useless, search engine aggregators.

These are just more examples of big business messing up the internet.

*you’re’nt: contraction for “you are not”… I totally just invented that

David Versus Google

I want to write a post, but I am horribly rushed. I feel I have something really important to say but not enough time to say it in. Instead, I will link to the articles I read which have angered me.

This one: http://www.boingboing.net/2009/11/20/britains-new-interne.html. This is rubbish. If it happens I will leave the UK. I promise you this. I don’t like petitions because I don’t believe they work but  go here to “help prevent” this: http://petitions.number10.gov.uk/dontdisconnectus/

The other post is this: http://gigaom.com/2009/11/22/should-web-page-speed-influence-google-pagerank/. This is bullshit… because I say so. The internet is currently a level playing field for everyone, big and small business alike. Are you going to skew it towards those with most cash? Are you Google? Recently I’ve become A LOT more untrusting of Google.

Ok, it’s true that one swallow does not make a summer, but these things seem to point to the trend that the internet is now going to become more of a corporately controlled entity? I hope I am wrong.

Edit: Also?! Why is my text justified? Justified text?! WTF? This also angers me.

Update: Ok. I removed the justified text. At least I feel like I have the power to change something.

Sending A PUT request to the Server using Ruby on Rails

I have been trying for ages to find out how to send a PUT request to the server using ruby on rails. This page makes no fucking mention of a put() function. I cursed on many occasion.  Here it is. Hope this helps someone.

require ‘net/http’
url  = ‘/api/user.xml?id=6’
post_data = “<user><firstname>Freeman</firstname></user>”
http = Net::HTTP.new(‘www.asdf.com’)
http.read_timeout = 300 # seconds
http.open_timeout = 180 # seconds
resp, data = http.put(url, post_data)