Letting Google Load jQuery… The Right Way

Posted: December 7th, 2009 | Filed under: jQuery

For some time now I have been letting google load the jQuery and jQuery UI libraries for me. There are many benefits to it which I will not get into, you can read more reasons to use it elsewhere. However I did notice something worth posting.

You may be loading the jQuery library like so:

<script src="http://jqueryjs.googlecode.com/files/jquery-1.4.2.min.js" type="text/javascript"></script>

Well if you are then you are doing it wrong.

It was ySlow that told me why. Try changing that one line to the following and take another look at ySlow.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>

Notice the difference? Google is now gzipping the library when its called from googleapis.com instead of googlecode.com thus lowering the files size drastically.

For those of us that are to lazy to try it out here is the result with the googleapis.com loaded instead of the googlecode.com.

jQueryLoading

You can see instead of downloading 57.2kb that you would with the googlecode file the gzip compression brings it down to 19kb.

The same rule would apply for other libraries that are hosted by google. such as mootools, or even the jQuery UI.

So next time you go to include the library make sure to do it the right way.

Now I just need to switch all the sites I have that are using it.. such as this one.


Bug Reporting

Posted: October 28th, 2009 | Filed under: Usability

Well it took it long enough for someone to officially report iSearchNotes.com‘s first bug. By officially I mean not calling/texting/emailing me directly to tell me there was a bug but finding some way within the site.

After I realized what the bug was, I am sure that many users have come across it before, but for whatever reason none of them submit the bug to me.

Why did it take so long?

I would say on a normal business day i spend 10 hours a day developing (4 10′s is the way to go!). I probably run into 1-2 software bugs, not counting any in my own apps. That number goes way up if the day consists of heavy adobe product usage (fucking flash), up to about 6-10 in a single day. Regardless, I run into lots of bugs and may only report  one every 2-3 months.

Doing the math that means that there is 90-270 bugs I run into before I report 1 of them. Yes some of those are duplicate bugs but still thats a lot of missed reports.

So why do I not report more bugs?

I would consider myself to be part of the target audience who should report software bugs, but I don’t.

  • Reporting bugs takes to long

Taking the time to put in enough information for a fellow developer to debug some error takes way to long. I would guess that on average it takes about 10-20 minutes. I personally do not care enough to spend 20 minutes to have point number 2 happen.

  • They normally mark it as unreproducible (Microsoft you are terrible at this!)

Over time I have submitted 4-6 bugs to Microsoft, all about visual studio, with as much information as I can, and every single one has been marked unreproducible, then resolved (I don’t know how the fuck they consider it resolved?), then closed. It feels as if I am wasting my time, and because of it I stop submitting any more bugs.

On the other hand, when not dealing with Microsoft, I normally do not receive any kind of notice saying the company received the bug. So again I stop sending them in.

Make sure you respond to your users who are sending you bugs! Otherwise they will end up like myself and stop submitting ANY kind of feedback.

  • I have no clue where to report a bug (Adobe)

Personally I hate adobe. Everyday it grows closer to my hate for apple, regardless with the exception of Facebook they seem to be the only major software company to have such buggy software. I cannot use an adobe product for more then a couple hours without it crashing. Flash, and Flash player are the worst!

  • I have no desire to report the bug

Sometimes we just have no desire to submit the bug. We couldn’t care less about the software and really don’t want to waste my time submitting the bug.

When you get a bug the user is telling the company that they care about their product, and that want them to fix it!

So don’t get mad about bugs, be glad that users are submitting them.

How can we create a better way to report software bugs?

I have not come across a site that does a better job then grooveshark. On their site they have a feedback button clearly located on every page.

feedback

Once you click on this feedback button a very friendly message pops up and asks how you feel about the message and then asks for the message itself. Its a very simple way to get feedback and works great for submitting bugs, feedback, and any other form of general contact to them.

feedback2

What did this user go through to submit a bug on my site?

This is a valid question that all site owners need to look into. Currently this site (corymathews.com) has a very prominent contact button.

feedback6

How long did it take you to find it? Odds are, not to long. However when I take a look at the iSearchNotes.com site its not so clear. Take a look at the image bellow.

feedback3

Do you quickly see a way to submit bugs?

Well if you really looked you would find 2 ways to contact me. You probably semi quickly saw the feedback link in the right, but it may have taken you a while to notice the contact link in the footer.

While this is by no means the best solution I would say that it is sufficient for such a small site as iSearchNotes.com. However as the site grows I will need a more clear way to submit feedback.

How about we take a look at a larger site such as Facebook.

feedback4

Did you notice that tiny help button in the bottom right corner? I did not think that you would click help to submit a bug. This is like hitting start to shutdown… confusing.

Even after you click on the help button you will come to a screen where you must click suggestions from a large listing of other random crap in order to submit a bug.

feedback5

Needless to say its way to hard to submit bugs to facebook and facebook is HUGE! There is no excuse for such a large site to be so difficult.

So how hard is it to submit a bug about your site/application? Could you making it simpler?


Importing a Blender Model into OpenGL

Posted: August 31st, 2009 | Filed under: Misc Programming

Recently I was looking for a simple way to export a basic model from blender to use in my opengl code written with c++. After a few searches I came up with nothing and decided to look at all the different ways I could export a blender file. The first that was easy enough to recognize the pattern right away was the the Raw Faces (.raw) format.

I quickly created a very basic (and very bad) model of a cup to see how it looked when I exported the cup in the .raw format. You can export a blender model using this format by first selecting the object you want to export (For whatever reason only the selected object(s) will be exported.) Then go to File -> Export -> Raw Faces(.raw). This is what I got after exporting. There shouldn’t be line wraps, however depending on your monitor you may see them. You can download the file in .raw format here.

0.011633 -0.011633 0.011633 -0.001836 -0.016245 0.011633 -0.001512 -0.011633 -0.011633 0.008956 -0.008956 -0.011633
-0.001836 -0.016245 0.011633 -0.011633 -0.011633 0.011633 -0.008956 -0.008956 -0.011633 -0.001512 -0.011633 -0.011633
0.008956 0.008956 -0.011633 -0.001512 0.011633 -0.011633 -0.001836 0.016993 0.011633 0.011633 0.011633 0.011633
-0.001512 0.011633 -0.011633 -0.008956 0.008956 -0.011633 -0.011633 0.011633 0.011633 -0.001836 0.016993 0.011633
0.011633 -0.001745 -0.011633 0.008956 0.008956 -0.011633 0.011633 0.011633 0.011633 0.016943 -0.002119 0.011633
0.016943 -0.002119 0.011633 0.011633 -0.011633 0.011633 0.008956 -0.008956 -0.011633 0.011633 -0.001745 -0.011633
-0.011633 -0.011633 0.011633 -0.016295 -0.002119 0.011633 -0.011633 -0.001745 -0.011633 -0.008956 -0.008956 -0.011633
-0.016295 -0.002119 0.011633 -0.011633 0.011633 0.011633 -0.008956 0.008956 -0.011633 -0.011633 -0.001745 -0.011633
-0.001512 -0.011633 -0.011633 -0.001512 -0.001745 -0.011633 0.011633 -0.001745 -0.011633 0.008956 -0.008956 -0.011633
0.008956 0.008956 -0.011633 0.011633 -0.001745 -0.011633 -0.001512 -0.001745 -0.011633 -0.001512 0.011633 -0.011633
-0.008956 -0.008956 -0.011633 -0.011633 -0.001745 -0.011633 -0.001512 -0.001745 -0.011633 -0.001512 -0.011633 -0.011633
-0.011633 -0.001745 -0.011633 -0.008956 0.008956 -0.011633 -0.001512 0.011633 -0.011633 -0.001512 -0.001745 -0.011633
-0.011633 0.011633 0.011633 -0.016295 -0.002119 0.011633 -0.013645 -0.001861 0.011633 -0.009766 0.009583 0.011633
-0.016295 -0.002119 0.011633 -0.011633 -0.011633 0.011633 -0.009766 -0.009779 0.011633 -0.013645 -0.001861 0.011633
0.011633 -0.011633 0.011633 0.016943 -0.002119 0.011633 0.014015 -0.001861 0.011633 0.009596 -0.009779 0.011633
0.016943 -0.002119 0.011633 0.011633 0.011633 0.011633 0.009596 0.009583 0.011633 0.014015 -0.001861 0.011633
-0.011633 -0.011633 0.011633 -0.001836 -0.016245 0.011633 -0.001613 -0.013616 0.011633 -0.009766 -0.009779 0.011633
-0.001836 -0.016245 0.011633 0.011633 -0.011633 0.011633 0.009596 -0.009779 0.011633 -0.001613 -0.013616 0.011633
-0.001836 0.016993 0.011633 -0.011633 0.011633 0.011633 -0.009766 0.009583 0.011633 -0.001613 0.014044 0.011633
0.011633 0.011633 0.011633 -0.001836 0.016993 0.011633 -0.001613 0.014044 0.011633 0.009596 0.009583 0.011633
0.009596 0.009583 0.011633 -0.001613 0.014044 0.011633 -0.001311 0.010066 -0.007815 0.006850 0.006819 -0.007815
-0.001613 0.014044 0.011633 -0.009766 0.009583 0.011633 -0.007247 0.006819 -0.007815 -0.001311 0.010066 -0.007815
-0.001613 -0.013616 0.011633 0.009596 -0.009779 0.011633 0.006850 -0.007278 -0.007815 -0.001311 -0.010072 -0.007815
-0.009766 -0.009779 0.011633 -0.001613 -0.013616 0.011633 -0.001311 -0.010072 -0.007815 -0.007247 -0.007278 -0.007815
0.014015 -0.001861 0.011633 0.009596 0.009583 0.011633 0.006850 0.006819 -0.007815 0.010067 -0.001513 -0.007815
0.009596 -0.009779 0.011633 0.014015 -0.001861 0.011633 0.010067 -0.001513 -0.007815 0.006850 -0.007278 -0.007815
-0.013645 -0.001861 0.011633 -0.009766 -0.009779 0.011633 -0.007247 -0.007278 -0.007815 -0.010071 -0.001513 -0.007815
-0.009766 0.009583 0.011633 -0.013645 -0.001861 0.011633 -0.010071 -0.001513 -0.007815 -0.007247 0.006819 -0.007815
-0.001311 0.010066 -0.007815 -0.001115 -0.001287 -0.007815 0.010067 -0.001513 -0.007815 0.006850 0.006819 -0.007815
-0.001115 -0.001287 -0.007815 -0.001311 -0.010072 -0.007815 0.006850 -0.007278 -0.007815 0.010067 -0.001513 -0.007815
-0.007247 0.006819 -0.007815 -0.010071 -0.001513 -0.007815 -0.001115 -0.001287 -0.007815 -0.001311 0.010066 -0.007815
-0.010071 -0.001513 -0.007815 -0.007247 -0.007278 -0.007815 -0.001311 -0.010072 -0.007815 -0.001115 -0.001287 -0.007815

Basically, if you haven’t already noticed, it is 4 sets of x,y,z points. You will not get any of the materials when you export the object only the polygons.

Now that we have our object we will need to be able to display it using opengl. First we must read in and store the points.

CupVectors[3][4][33];

ifstream cupFile;
cupFile.open(“cup.raw”);

for(int z=0;z<=32;z++)
for(int y=0;y<=3;y++)
for(int x=0;x<=2;x++)
cupFile >> CupVectors[x][y][z];

cupFile.close();

Pretty simple code. Store the points, open the file, loop through the points, store the points, close the file.

Now that the cup vertex points are stored we are able to easily display them in opengl with another small loop that will create the triangles and save them in our display list.