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”

Nintendo’s E3 Unveiling

With the Nintendo press conference only a day away. There is much speculation as to what they are going to say. Many believe that they will be unveiling the new hardware codename Project Cafe.

One has to wonder what Nintendo’s strategy is this time round. In the current generation, the Wii was released. This was the generation that I felt that Nintendo largely turned it’s back on it’s hardcore fans (myself included) and catered to the mainstream, non-gamers, Joe Schmoe and young and old alike. After realising that Nintendo were now focusing on making lifestyle games and they were no longer going make the games I want to play or even provide the platform for the games I want to play, I decide to get the XBOX 360. It’s now that I wonder what is their strategy this time round.

Assuming that Nintendo’s hardcore fans were actually fans of gaming rather than fans of a company or brand, most of them should have moved on. This means they would have lost a large percentage of their early adopters. One of the truths of the technology ecosystem is that to a large extent you need your early adopters. You need them to get your product, try it out and recommend it to the mass market.

So who are Nintendo’s demographic? The male teenagers to young 20’s don’t want to play Wii. It’s too kiddie. The girls of the same age can be lumped in with the rest of the Wii demographic, the traditional non-gamers. These people are not gamers, technologists or early adopters. I can bet that most of those Wii’s are sitting in cupboards, dusty or only used for party games. So what reason is there to get another Nintendo. The old one is sitting in garage. And bowling or exercise works just as well on the old Nintendo, it’s not like the graphics were that good to begin with. There is no need for another one.

Miyamoto Unviels Sony's new Gears of War 3 at E3 2011

 

This leaves Parents. Which leaves Nintendo again with their kiddie market. As an ex-Nintendo hardcore, I hated it when the other console fanboys called Nintendo kiddie. My only defence was calling them liars. Looking back on it now. Nintendo _is_ kiddie and it always was kiddie. There is nothing wrong with being kiddie. It’s a very lucrative market and to get children responding to your brand at such an early stage means more business later on.

This is all obviously speculation and come tomorrow we will hopefully see what Nintendo has up it’s sleeve. Is it the Ace or is it another Joker? Time will tell but I think this time it’s the kiddie image that will be saving Nintendo.

I want some of that pie

Disclaimer: This post has not been checked for grammar or spelling as it’s now 3:00 am and I wish to publish this post AND go to sleep.

Here I sit. Doing nothing. I have so many things I want to do: The comic, My Expense Manager, My Game, My Own Custom Tshirts, My Toys, My Painting…  many others.

That is just scratching the surface of what I want to do. And somehow through all that, I am supposed to become a millionaire too. Looking at that list, I don’t think those things are capable of making me money let alone a millionaire. If they can make me money, I don’t think they will make much money.

The expense manager. I have a plan to monetise that but now where near “sit on my butt for the rest of my life” kind of money. My game… some money maybe… but maybe nothing for all my hard work… it’s a gamble. It will also be my first public game. I can make a success of the expense manager as I know the web I know how to make good websites. Games.. I’ve not done before… so who knows if it will be compelling. I think that is a terrible excuse though and giving me an easy out for failure. I won’t accept it.

Anyway that is not the point of this post. This post is me having a mid life crisis. Noticing that I am still poor and everyone else around me has a house, a company that is earning, is doing some form of investment, is just financially sensible or just seems to have a more richer (in both senses of the word), fuller and sustainable lifestyle. All this is happening while I sit here playing videogames and eating baked beans with sliced vienna sausages on toast. I eat that out of choice. I can easily sustainably afford better but I like it, so that is what I do. However, eating like a poor student is somehow making me feel like I am poor than probably I should. I guess you are what you eat is truer than I originally thought. Also, If I am being honest, I only play videogames some of the time… I play a considerable amount less than I used to. That does not matter though as I have filled that free time with watching TV series or movies.

Distractions, distractions. Distractions from making provisions for my future – earning money. Not even earning money at this point, potentially earning money, I am not working for a client who will pay me, the development is for myself. Once the development is complete, I still have to find my clients and THEN ONLY, maybe get paid.

Sitting here… distracting and procrastinating (Even this post is a form of procrastination) is not doing me any good. Especially since I pit myself against those who in my eyes who are already successful and in turn I model my success on their image. Or those who already have established businesses, who already have a piece of that pie. That pie, that pie that seems to be just outside my reach. No matter how hard I try as I move closer it moves away forever staying just within an inch of my reach.

Reach for the Pie - One of the worst puns... ever.

One thing I can admit to is, it’s all my fault but sometimes I have no idea if the steps I am taking to fix it are the right ones.

I also accept full blame for the terrible visual pun in the picture too.

Ye Olde Rapture

No idea why I titled the post that.

I came along this image on twitter:

Donate

I had been thinking something similar the whole week.

I was just about to retweet it and spread this message when I started thinking how stupid people actually are. I thought about it some more.

Is it irresponsible to tell people who believe the rapture is happening to donate all their stuff to charity…? I agree with the sentiment… put your money where you mouth is if you believe it that much. And sure, it would be funny to see those people after asking and pleading with god why he is testing them… but do they deserve the suffering that might come from their act of charity just because they are stupid/gullible?

As someone who thinks many people need a wake up call, I would love to do this and sit on my high horse of smugness but I don’t think the lesson should be taught so harshly?

 

Fuck Take2.co.za Errata

Update: For those posting comments, it’s my blog. That means only I get to be a dick. If you are not going to be civil and try to attack me or the others in the comments, your comment won’t get approved. If you do that, I will might change your comment to make you look like an asshole and then approve it. If you really want to be a dick, get your own blog, be a dick over there. :)

This is in regards to my original take2.co.za post I have the following to Note:

This was over 4 years ago, so it may not be fair to still hold this against them. A current employee of Take 2 has contacted me and told me that management has changed since then. If management has changed it may be fair to assume that how they treat customers has changed. I hope so but I would like to claim I have the courage convictions and say that I won’t be going back to find out.

 

The story behind this post:

I was contacted by an employee of Take2 in connection with this post. What they said can be seen in the comments of the post in question but I will post them here for ease or reading:

Are you banned from buying from us.. Cos you can’t hold a Grudge like that forever everyone makes mistakes including you we are all human..

Just so you know Take2 has new owners so their is always time to start off on a clean slate.

I replied with:

Yes, this WAS over four years ago, different management, whatever. When the company was taken over, you took over the good AND the bad.

It’s not a grudge, it’s my strategy for survival. I am a very fair person and it takes me a very long time to put people on my shit list but if they DO happen get on the list they never get off. I have that same philosophy with “friends”, acquaintances and business partners. It’s make sure the influences around me are positive.

Having said that, your refund policies may have changed but I am not willing to use your services again and find out. So to be fair, I will post an errata saying management HAS changed but I still won’t be using your services (provided you can prove you are from take 2).

The email provided by the “employee” was from a yahoo address so I contacted the employ via email to allow her to prove she was in fact who she said she was. She replied with ample proof she worked for take2. So the “employee” was actually an employee.

The conversation then continued via email… well it was not really a conversation. Giving her the benefit of the doubt, my reply to her verification only came what was already weekend time for her. So I have not yet received any response from what I said in the email:

I will put an update at the top of the post saying:

“Note: This was over 4 years ago, so it may not be fair to still hold this against them. A current employee of Take 2 has contacted me and told me that management has changed since then. If management has changed it may be fair to assume that how they treat customers has changed. I hope so but I would like to claim I have the courage convictions and say that I won’t be going back to find out.”

You might not think so but this is me coming to a compromise. I would just like to note that no such compromise was even attempted to be made when dealing with me. No compromise nor any apology was ever made – and now an attempt to make peace has only happened because it’s probably what shows up when you search for take 2. From where I stand the attempt to make peace has only happened because the balance of power has shifted slightly. I seriously doubt you would have contacted me if my site was result #30. But that’s it, rant over.

Apologies I can’t give you what you want (assuming what you want is for me to take the post down). You really do seem like a nice person. I really do want to give you what you want but I have to keep reminding myself that I am also a nice person and was being a nice person when this happened.

Then the more I think about it, the more I feel like I pussied out, the more I feel like I became a supplicant… but also the more I think about it, the two main points I made in the last two paragraphs solidify themselves in my thoughts:

No compromise, nor any apology was even attempted to be made with me. An attempt to make peace only happened because the balance of power has shifted meaning the post in question is what shows up when you search for take 2 thereby harming their public image.

They did approach me in a civil and non-antagonistic manner so I feel compelled to comply, however, on the other hand originally back then my approach was, knowing myself, more than likely even more civil and non-antagonistic.

By accessing the mind’s installed principle core, I know that there are two things that need to be done. I need to stay true to myself and I need to keep my word. In this case staying true to myself means sticking by what I said, having the courage of my convictions and keeping the post in the original form. An in this case, keeping my word means posting an errata at the top of the post. A moral conflict. A compromise needs to be made. An extract of my moral core can be seen on my other site and it states: “Some things you should never compromise on, one of them being yourself.

This is the result of the compromise.

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.

Crocodile Dreams

I had a dream about a restaurant that sold crocodile milkshakes made from fresh crocodiles. I remember asking myself why they needed a whole crocodile for such a small glass. It was either very wasteful or they somehow condensed the croc down into a single glass. I also wondered why the live crocs looked that way? Was THAT their skin? If it was skin, why is the skin that weird milky translucent glowing ruby colour? If it wasn’t skin, where were their skins? I also thought it was a bad idea that the guests and the crocs were in the in the same space. That was confirmed when a large male croc bit the head off one of the guests.

 

Do you ever think the reality around you might not be the real one?

I do.

Not all the time, sometimes. It’s happened once or twice in public but private places. For example when I go to pee in the office toilet and it’s empty. While I am peeing away, I sometimes get a few seconds for my mind to wander*. If I happen to close my eyes  my mind sometimes stops on: “Am I really in the office? Am I maybe peeing in public on the side of a lamp post?”.

This usually only happens when I am really tired, but it did get me thinking. How do we know we really are here? How do we know we are, who we say we are? You get crazy homeless guys that believe themselves Jesus. Yet in reality they are just dirty, smelly, crazy homeless guys. This makes me think you might not actually know you’re insane if you are insane. If that is true, how do I, or you for that matter, REALLY know that you are not a crazy guy who believes he is someone else. How do I know I’m not a crazy guy who believes he is someone called Gerard Lucienne Petersen. How do I know that this blog not is just in my head, and me typing right now is not just me hitting the ground with a stick? It’s true that I may also draw a comic called Space Panda, but how do I know that it’s not drawn in my own shit?

If I am the only one that thinks this, my only consolation is that I am insane enough to know that I may be insane or at least have the capacity to be even more insane.

NOTES:

*I have never written the word “wander” down prior to this. I really enjoyed the experience


back to basics

This is the flagship track “back to basics” that I created for my 1st album with the same name. It’s pretty good if I do say so myself.

back to basics – guided1

I might put up some of my pre-“back to basics” tracks if I can find them. To be honest I don’t even have my own full album any more. A lot was lost in the crash of 2001. We will see what we can do though.