The Kevin Dolan » Dislikes http://thekevindolan.com Putting the Kev in Dolan since 2009! Sun, 15 Aug 2010 00:40:56 +0000 en hourly 1 http://wordpress.org/?v=3.0 Java, I Would Like To See… http://thekevindolan.com/2010/03/java-i-would-like-to-see/ http://thekevindolan.com/2010/03/java-i-would-like-to-see/#comments Sun, 28 Mar 2010 23:04:07 +0000 Kevin http://thekevindolan.com/?p=894 boxing

Everybody knows I really love Java, and I’m a real fan of the new(ish) generic type features in Java, but as I mentioned last time, I have some problems with the way they handle reflection.  Well I have some other problems with Java as well, problems major enough to make me a little angry, but not big enough to make me even consider switching.  This post will just outline some of the things I would like to see implemented in future Java implementations.

I understand the high Java council has probably encountered and considered these suggestions in the past.  They may have plans to implement them at some juncture, or they may have decided that they are bad ideas.  I’d like to preface this post by saying that I really do love Java, and this is NOT a post about any Java weaknesses.  Just some things I occasionally wish I had…

One of the beautiful things about Java is that the language is so elegantly extensible that these features are easy to implement in Java without changing anything whatsoever.  The issue is that these work-around solutions can sometimes be unnecessarily verbose.

What would be really nice would be for Java to allow programmers to modify the syntax of Java to provide shortcuts to workarounds like these.  I think this would significantly improve developmental flow, and wouldn’t need to be more complicated than running a regex-matching engine at compile-time to replace some things with some computed values.  Something like that doesn’t necessarily need to be a Java-native feature but could even manifest itself as an Eclipse plugin.

I certainly understand the potential pitfalls of such a method, with regards to standardization and collaboration in large groups, but it’s something to consider at least for its novelty value.

Parameterized Type Reflection

This is what I wrote about last time, and I provided a work-around using the factory pattern.  Of course, while the factory pattern is a generally accepted means of object-instantiation, it is not entirely natural to programmers who generally use constructors more often.

The problem occurs due to the fact that when an object is parameterized using Java’s generics, the information about how it was parameterized is erased at run-time.  While in general, this is usually not a problem, it has twice vexed me when developing interesting libraries (genetic programming and MVC).

Another issue you see in real practice, which is a kind-of annoying result of this run-time parameterized type erasure comes from casting.

When you want to cast something like:

List< String > stringList = (List< String >) other;

You get a warning of “Type safety: Unchecked cast from Object to List<String>.”  This is a really annoying obvious result of not having this information at run-time, since there’s no way to throw a class-cast exception if you don’t know what class is there!  And I don’t know about you, but I never let warnings creep up in my code for too long, so I end up with all kinds of @SuppressWarnings(“unchecked”) all over my code, NASTY!

I am told that C# does a better job with this, but come on Java, can you give me a really good reason why you aren’t doing this?

See my last post for my workaround to this issue.  As far as a proposed syntax goes for improving this feature, I would just like to see some type of methods in Java.lang.class for accessing the parameterized types.

Typesafe Tuples!

Tuples are a concept that creeps up in a number of programming languages.  I first learned about them in a class about oCaml, but they are in Python and I’m sure a huge number of other languages.  The basic idea is that you can refer to a pair (or triplet or n-tuple) of values, each with its own independent type.

Tuples allow you to return more than one object without having to wrap the result in some other class.  I can see why Java might have resisted doing so, since you lose a little bit of information about what each value means when you use Tuples.  Using a class with named fields, on the other hand, lets you know exactly what you’re getting.

But sometimes, it’s just inconvenient to have to create a new class every time you want the utility of returning more than one piece of information.  Type-safe tuples are really easy to implement on your own, but if you’re even too lazy to do there, there’s a library for it.

This solution can just be pretty verbose.  There is a paper with some proposed syntax here.  You’ll need ACM portal access to view the document.  The specific syntax does not really matter to me, but something convenient would be nice.

Customized Auto-(un)boxing

One nice feature that recently crept up in Java was the auto-(un)boxing feature for converting from primitive types to their boxed object types. For instance, the following code is now legal and behaves as expected in java:

int n = new Integer(5);
Integer x = 4;

This is a pretty convenient feature in object-oriented programming, but I would like to see it optionally applied to classes that you create.  Here’s what I mean, with regards specifically to my MVC library.

I have a class called Path.  One of the constructors of path takes a String as a parameter.  For convenience though, most methods in my library that can take a Path as a parameter, will have an alternate method that takes a String, which is simply parsed and converted into a Path.  Right now, I have to write two methods every time I want to refer to a Path, one which takes Path and one which takes a String.  However, this results in a lot of duplicate code, documentation, and is generally wasteful in terms of effort.

What I would like to see, is some kind-of default conversion for situations like this.  Tell Java that anytime I’m expecting a Path and I get a String instead, do some logic to convert the String into a Path.  It’s as simple as that.

]]>
http://thekevindolan.com/2010/03/java-i-would-like-to-see/feed/ 0
Starburst, When Did This Happen? http://thekevindolan.com/2010/01/starburst-when/ http://thekevindolan.com/2010/01/starburst-when/#comments Wed, 06 Jan 2010 04:50:06 +0000 Kevin http://thekevindolan.com/?p=669 starbursttropical

I’ve been eating Starburst since I was a baby.  My favorite flavor set was the tropical ones.  But recently, I discovered an odd unannounced change in the packaging of my all-time favorite flavor, strawberry-banana.

The classic wrapper on the strawberry-banana flavor was green.  I know, I know, it made no sense whatsoever.  But it was always a surprise to get the green wrapper with a pink starburst inside.

Am I going crazy here, or did they really make the decision to change the packaging color?  I mean, somebody high up at corporate had to actively make the decision to halt production and change the wrapper color to something more sensible.

I couldn’t find anything on the internet about this, but I feel a little cheated.  I’d like to know when this happened.

]]>
http://thekevindolan.com/2010/01/starburst-when/feed/ 1
“I Could Care Less” http://thekevindolan.com/2009/11/i-could-care-less/ http://thekevindolan.com/2009/11/i-could-care-less/#comments Fri, 13 Nov 2009 22:22:02 +0000 Kevin http://thekevindolan.com/?p=642 Devil_Driver

This is one phrase that has bothered me my entire life.  People seem to think it’s a good way to say you don’t care about something, but that’s certainly not the case.  As much as I try to explain to people that it makes no sense, they usually just don’t get it.  I’m going to try and explain to you why this is a silly phrase.

We’ll have to consider what it would mean to quantify the level to which you care about something.  Let us define a measurement, C, which is a whole number between 0 and 100 representing how much you care about something.  On this scale, a 0 would represent you not caring at all, whereas a 100 would represent the most important thing in the world to you.

Now let’s examine the phrase “I could care less.”

This means: there exists a value of C less that the value for which I currently care.

So now we should consider what possibilities exist for your value of C, given this constraint.

If, for example, we are talking about something very dear to you, with a C-value of 100, we can ask the question, could you care less?

Well of course you could: it could be a 99, it could be a 10, hell, it could be a 0, but it’s not, it’s a 100.  In fact, there are 100 possibilities of C values for which the statement “I could care less” holds (0 through 99 inclusive).

How about something you don’t care as much for, a 20.

Well there are many possibilities for this as well, 20 to be precise (0 through 20 inclusive).

In fact, the only possibility excluded is zero, because when you have a C value of 0, there does not exist any C value below that.  You could NOT care less.

The number line below sums up all the possible C values satisfying the constraint:

couldcare

As you can see, this statement really does not do much to clarify the level to which you care about something.  All it is saying is that it is not the case that you do not care at all, which is the opposite of the message people are trying to convey.

Which brings me to the way to correct this huge logical error.  All you have to do is add an “n’t” to the end of the word “could” forming “couldn’t”.

Under this model, a C-value of 100 does not satisfy the constraint, because there are several other C’s that are below 100.  The only possibility is 0, because there does not exist any C less than 0.

So there you have it; you’re all idiots.

And before you think you’re clever by responding “I could care less,” you might as well just tell me that you peel the stickers off your rubik’s cube, because I’ve heard it before.

]]>
http://thekevindolan.com/2009/11/i-could-care-less/feed/ 1
Products That Brag About The Fact That They Were Made By People Lacking Credentials http://thekevindolan.com/2009/11/products-that-brag/ http://thekevindolan.com/2009/11/products-that-brag/#comments Wed, 11 Nov 2009 22:02:10 +0000 Kevin http://thekevindolan.com/?p=636 confused-baby

Whenever I read about a new product, I consider myself a skeptic.  I generally don’t believe hype, no matter how many people force it down my throat.  However, one thing that does help me buy into a claim is what credentials the creator has…  Apparently, not all advertisers agree.

I noticed this about the product Airborne several years ago when everybody in the world was all over this revolutionary new placebo.

airborne

I was always surprised that the package contained the words “CREATED BY A SCHOOL TEACHER” in such a prominent location.  In fact, they take it further to tell you several times on the back of the box that it was indeed an elementary school teacher who designed this revolutionary project, as if elementary school teachers are well known for their proficiency in designing dietary supplements.

Please.

While I secretly harbored distrust for this packaging, I recently started seeing more and more ads like this popping up all over the place, especially scammy internet marketing campaigns.

The most recent example I’d like to point out is this ad that keeps showing up on every website on the internet, and amazing secret for whitening teeth, discovered by the dental genius of a single mom.

lamead1

I love this type of ad, because they decided the best way to attract attention on the internet is to use extremely low-quality, partially relevant images, and poorly anti-aliased fonts inside a downright confusing border.

Also, they decided to make this one ad look like two ads, in case you don’t fall for it the first time.

…but in case you weren’t sure if this was going to work or not, you can rest assured because it was discovered by a single mom.  Those single moms really know what’s up when it comes to dental hygiene.

]]>
http://thekevindolan.com/2009/11/products-that-brag/feed/ 0
Seriously, Hungry Man? http://thekevindolan.com/2009/10/seriously-hungry-man/ http://thekevindolan.com/2009/10/seriously-hungry-man/#comments Tue, 20 Oct 2009 03:12:02 +0000 Kevin http://thekevindolan.com/?p=626 Untitled-1

So I occasionally dabble in the realm of TV-style dinners.  Sure, they might not be the tastiest meals you can buy, and I’d be a fool to call them healthy… but they’re just so damn convenient!  One of my favorites has always been the Hungry-Man brand Boneless White Meat Fried Chichken meal with corn, mashed potatoes, and a brownie; but I’ve got to ask what they were thinking with the directions!

I’m going to reproduce the directions exactly as they appear, for those who have never prepared this meal, along with my objections.

1. Remove plastic cover from chicken, potatoes and brownie.  Cut slit in film over corn.

This direction seems easy enough, but it’s virtually impossible.  The plastic cover to which they refer is applied to the entire package, with no perforations or anything to make this possible.  To top it off, the plastic is not sealed to the separators.  This whole step means you have to get a knife, which is not something I want to involve in my TV-dinners, and carefully perform surgery on the Hungry-man packaging.

No thank you, Hungry-Man.  Nobody understands why venting is preferable to total exposure anyways. I tried removing the whole plastic, and my meal was not only acceptable, but indifferentiable from one prepared according to the directions.

2. Microwave on HIGH 4 1/2 minutes.  Carefully remove brownie with a fork; set aside.  Stir potatoes.  Return tray to microwave oven.

Oh thank you for specifying what instrument I should use to remove the brownie.  Were you aware the brownie is LIQUID at this point?  This step is absolutely ridiculous, because now I have to involve some other dish for my microwave dinner.  One of the appealing features of TV-dinners is the easy cleanup.  All I have to do is throw away the container it comes in, but no, I’ve just moved a molten brownie into a bowl for no apparent reason.

If you forego this step, and instead just stir the potatoes (with a fork), your brownie comes out significantly less molten and no dirty dishes.

3. Microwave on HIGH 3 minutes.

4. Let stand 1 minute in microwave oven.  Stir potatoes before serving.

I don’t really have a problem with these two steps, other than the fact that I’m not waiting one minute for anything.  I’m digging in right away, despite the fact that I’m going to burn my tongue, and that will fuck me up for days.

So, Hungry-Man, two options in my ultimatum:

A. Add perforations in the plastic cover between the corn and the rest of the packaging, and add perforations to the container around the brownie, so that it may be separated from the rest of the container.

B. Alternatively, simplify your directions to the following:

1. Remove plastic.

2. Microwave 7 minutes.

3. Enjoy immediately.

I appreciate it.

]]>
http://thekevindolan.com/2009/10/seriously-hungry-man/feed/ 3
Sign Thieves http://thekevindolan.com/2009/10/sign-thieves/ http://thekevindolan.com/2009/10/sign-thieves/#comments Sat, 10 Oct 2009 01:16:33 +0000 Kevin http://thekevindolan.com/?p=577 grandopening3

If there’s one thing I hate, it’s people that steal things from me.  If there’s something that I hate even more, it’s people that steal from my family.  If there’s one thing I hate more than all of those things, it’s people who steal the grand opening sign… those jerks!

Here is the press release from Dave, written the day after the incident, October 5th:

Yesterday, October 4th, 2009 a day that will live in infamy.  408 University Ave was suddenly and deliberately attacked by some douchebags. At some time before 9AM, the famous Grand Opening sign was cut (burned??) off of its ropes and illegally removed from our property. These criminals must be brought to justice.

Well we put up a replacement sign that read “Who Took Our Sign?” and it was stolen just a few days later.

Recently, we found out a little more about what happened to the sign.  The douchebags stole it from our house, ran down the street all of 5 houses, viciously attacked it with a knife and threw it in someone’s yard.  Not only are these people thieves, but they are also litterers.

We have yet to recover the second sign.  Plans are under way to repair the original sign and hang it in a more secured fashion.  Investigation as to the culprits is still pending.

grandopening

The sign in its original grandeur.

grandopening2

The empty void in our hearts.

]]>
http://thekevindolan.com/2009/10/sign-thieves/feed/ 0
People Who Steal Your Cans http://thekevindolan.com/2009/09/people-who-steal-your-cans/ http://thekevindolan.com/2009/09/people-who-steal-your-cans/#comments Sun, 06 Sep 2009 22:07:20 +0000 Kevin http://thekevindolan.com/?p=562 recycling

I was recently awoke by a noise I have become all too familiar with living in Ithaca.  This isn’t something I encountered back home, since there’s no return service for cans, but here it’s all too common…

The phenomenon to which I am referring is the act of collecting cans from people’s recycling to return them at the grocery store for the refund.  The refund is 5 cents per can, which I suppose could easily add up.

However, every time I see someone walking with a shopping cart full of cans, I wonder just how the work to pay ratio actually works out.  In my experience returning cans after parties, it hardly seems worth it, and that’s not including collection.

So let’s do a little math.

After parties, we generally have about 300 cans.  Because these cans have to be full cans and cannot be crushed, 300 cans fills about 3 large garbage bags.  I suppose this means you can fit 100 cans in a large garbage bag.

If you really push it, I think you could probably collect about 5 bags in a single shopping cart and then wheel it down the road to Wegmans– that’s 500 cans.

So a single trip could potentially yield $25.00.  Now let’s consider the time this takes.

Strategy would indicate that you should travel along a street on recycling day.  Supposing every week, every single house finishes a 30-rack of Keystone.   Suppose of these 30 cans, 5 are crushed or missing, leaving 25, which is a healthy estimate.  This means to get the full 500-can load, you need to hit 20 houses.

Now, it’s fairly unlikely that a given person’s cans would be neatly organized, so it probably would take about 3 minutes to find them all and load them into your cart, and we’ll say a 1 minute walk to the next house…

So that’s 4 minutes per stop times 20 stops, 80 minutes.  The walk from any given street in Ithaca to the nearest grocery store is probably about 20 minutes, giving us a total time so far of about 100 minutes.

Now I’ve loaded cans into the recycling machine before, and it’s a fairly difficult task.  Your hands get covered in undrunk beer, you have to deal with dented cans, and you find yourself with several cuts in the end.  For 300 cans, it took me and sharps about 20 minutes.  Now I would give these people the benefit of experience, and say it probably takes one of them 20 minutes to load 500 cans…

That gives us a total of 2 hours work for $25.00.  This is certainly a healthy estimate, as I imagine it actually takes longer.  But if that is the case, this is a job worth $12.50 an hour!

Pretty nice figures if you ask me, considering my job at Geek Squad paid around that.

On the other hand, however, I would say it’s not a really viable job in the long-term.  It’s certainly a high-competition market, since I see so many people doing it.  So that means you should probably also take into consideration the act of scouting out a location.

It’s also not the kind of job you can get unlimited work doing.  There are only so many available cans and the competition also wants a slice.

Though you may be making $12.50/hour, you probably can only get about 10 hours a week tops, considering the supply of work.

Also, the work is rather difficult if you ask me.  You have to deal with not only the dirty act of transporting and loading the cans, but you also undoubtedly have to deal with the jeers of people around you.  Of course, I suppose with time you can get used to both of these.

My main question is why you would choose to do this when you could get a fairly easy job that involves more consistent, respectable, and less-intense work for comparable pay?

But I suppose that question answers itself; these individuals are most likely in situations in which they cannot get or hold jobs for one reason or another.  It’s clear they have the necessary work ethic, but there is something stopping them from doing something else.

]]>
http://thekevindolan.com/2009/09/people-who-steal-your-cans/feed/ 4
Threadless Kid http://thekevindolan.com/2009/08/threadless-kid/ http://thekevindolan.com/2009/08/threadless-kid/#comments Wed, 12 Aug 2009 05:18:00 +0000 Mark http://thekevindolan.com/?p=550 134449

Hey You! Yeah you, the kid who wears that same gay-ass threadless shirt every fuckin’ day! Yeah you know who you are. Well fuck you! 
I walk by you every goddam day while you sit there sippin’ on your fuckin strawberry banana vivanno smoothie, listening to your fuckin’ “of Montreal” on your fuckin’ ipod touch while scribbling stupid notes into your fuckin’ moleskine notebook. And every god fuckin damn day you wear that gay-ass motherfuckin’ shirt. The one with the pink godzilla thing. Fuck that shirt.

I thought you were hip the first time I crossed you, standing outside of Olin library smokin’ your clove cigarette with that ironic shirt on from that noteably hip store based in Chicago. I thought your were makin’ a fuckin’ statement with those retro nike high-tops and those excessively large headphones. But hell no! It’s not a fuckin’ statement if you’re doin the same damn thing every day you infection-inducing douche bag!

Do you clean that piece a shit? I can assume not because you must wear it 80+ hours a week.

And I know you’re fully capable of changing clothes- I notice you have a semi-regular rotation of 3 pairs of jeans with the occasional salmon-colored shorts thrown in there. Not bad.

But how can I concentrate on your well-selected pant ensemble when your shirt is a constant crap zone? Show me a little bit of respect here you fuckstain.

I hope I’ve encouraged you to better examine your wardrobe before dressing tomorrow. Cuz if you don’t I’m gonna kick your fuckin’ ass!

]]>
http://thekevindolan.com/2009/08/threadless-kid/feed/ 2
Skim Milk Freezes at a Higher Temperature Than 2% http://thekevindolan.com/2009/08/skim-milk-freezes/ http://thekevindolan.com/2009/08/skim-milk-freezes/#comments Sat, 01 Aug 2009 06:56:48 +0000 Kevin http://thekevindolan.com/?p=335 iStock_000007184035XSmall

I just made a shocking revelation when I tried to fix a bowl of cereal.

As of late, my refrigerator has been rather bare, so as usually occurs, some things start to freeze.  That being said, unaware, I reached into the refirgerator to grab a carton of milk.

I then poured my bowl of cereal, and lifted the milk carton to pour into my cereal… oddly, nothing occurred.  I looked, and it appeared to be completely frozen.

So I threw it away and looked in the fridge once again.  There was another carton of milk, completely unfrozen.

Upon further examination, I realized what was going on.  The milk that froze was skim, whereas the unfrozen milk was 2%.

Quite strange.

]]>
http://thekevindolan.com/2009/08/skim-milk-freezes/feed/ 5
Microwave Manufacturers, Get Your Act Together! http://thekevindolan.com/2009/07/microwave-manufacturers/ http://thekevindolan.com/2009/07/microwave-manufacturers/#comments Wed, 22 Jul 2009 05:05:02 +0000 Kevin http://thekevindolan.com/?p=170 micro1

In my travels, I have encountered many a microwave.  While I was at first aversive to the popcorn preset, I eventually came to know and love it.

However, there has clearly been some major miscommunication between microwave manufacturers and popcorn packagers.  You see, microwaves generally have more than one preset for popcorn, generally 3.5 oz and 1.7oz.

Now this makes sense, because half of 3.5 is 1.75, and most bags of popcorn are 3.5 ounces.  However, all popcorn companies package their mini-bags as 1.6 oz, not 1.7 oz.  While this difference is miniscule, it does make a difference of about 10 seconds cooking time.

Consistently, when using the popcorn preset of 1.7 oz on microwaves results in burnt or at least overcooked popcorn.

I recommend you microwave manufacturers do some consumer research before standardizing the entire industry to a non-existent package of popcorn.

]]>
http://thekevindolan.com/2009/07/microwave-manufacturers/feed/ 0