Forgot your password?
typodupeerror
Programming

Journal: [Python] What's with all the semicolons? 1

Journal by dthable

I'm looking at the /. journal extraction script written in Python and I keep seeing lots of lines that end in semicolons. Example:


        def getIndexItem(self):
                # create a summary of the entry
                digest = self.body[:self.DIGEST_LEN].replace('\n', '');
                digest = self.HTML_STRIP.sub('', digest);
                digest = digest.replace('>', '').replace('

When I learned about Python and started to work with it, I was told not to use the semicolons. In fact, I thought that was illegal. Is the parser just throwing them away? Does it have any purpose other than making those C programmers happy?

User Journal

Journal: The /. Book Reviews

Journal by dthable

Is it just me or has every book review ended with "this book is useful for the experienced individual as well as the beginner. No geek should be without."?

What's the point of reading reviews if everything that comes along is great? Tell me what books also suck so I don't walk through a book store any buy one of those.

Book reviews - actually useful or marketing pimps on /.?

Java

Journal: Java Is Dead. Long Live The Queen. 7

Journal by dthable

...or something like that. I read the following front page article on Java being a dead language. While I won't go as far to kill anything this afternoon, I do have to agree with Mr. Eckel that Java is unpleasant to C#. After working for 5 years in a Java environment, I actually found C# fun to program and always wondered why Java didn't have the same features.

I found myself envying three C#isms - type safe generic support, the "all data types are objects" mentality and C++ style code orginization.

The first to features do away with a lot of casting syntax. The damn java.util classes always manipulated elements as Object and for good reason. A list is generic. Give the list something to hold on to and it will. Yet, the lack of generics made this more error prone and just messy code. Cast an element coming out of a list and you get an exception. Type the expression into an IDE and it will tell you that you're getting an object, not a Widget.

I know Java added generics with Java 5, but it looked like it was more of a preprocessor than a fundamental design decision built into the type system. This creates a new issue where I have a SuperWidget and only want to create a list that can hold SuperItems. If I want to use generics I end up opening the list up for everything. If I pass things around as a SuperItem, I still have casting hell. This might seem too picky but think about how many times you have some generic process that should only be applied to a certain class of items. C# ends up implementing generics and keeps them type safe.

I also don't know how many times I've butted up against code that uses the primitive int type versus the class Integer type. Did you ever try to work with a Map using a primitive data type? I just hate having to type Integer.getInt(foo) into my code all the time.

Ok, the last one is a personal preference. I like to combine lots of stuff into one file. It just makes sense that I add a few loosely related classes into a single source file. Not close enough for an inner class but not separate enough for a new source file.

Just remember, opinions on programming languages are like a$$holes. Every one has one and they all stink.

User Journal

Journal: I Swore I Would Never Do Long Distance Relationships 7

Journal by dthable

but here I am. Basically, my girlfriend got transferred to Seattle for at least 18 months. She leaves next week but I need to stay in town and finish up my education (graduate in May!).

To make matters more complicated, I've been working on a Wisconsin business plan competition. If I win, that means nice chunk of state funding as long as the business stays in Wisconsin. On one hand, I'd really like to win and work on this web application full time without part time work to get financing. But things would be easier if I just threw the contest and then move out with her once I graduate. It's starting to remind me of the first relationship I was in and I threw away some good things for something that didn't work out in the end. I don't want to make that mistake again.

I've been trying to be the strong boyfriend. I want to be the one there for her to lean on, cry to when things get difficult, and support her and this great opportunity that she has. Yet, I find myself growing depressed as that date grows closer. Tonight, someone is coming by our place to give her a moving estimate and it's going to be strange listening to them talking about what to take and when. Even my parents are worried that this is going to come between us and they really like her. It's just a lot to add into the rest of my life right now.

I just hope that I can make it.

Programming

Journal: JavaScript Is A Pain 5

Journal by dthable

Does anyone have a good reference, book or website, that contains information on programming pages with JavaScript. All I can seem to find are references that want to explain what a variable is and don't touch on the different IE vs. NS api.

This is more frustrating than that time I tried to learn brainf*ck.

User Journal

Journal: Ubuntu Is Installed & My Thoughts 3

Journal by dthable

First, thanks to all who helped out with my grub problem. I finally let it loose on the MBR and everything still works. That solved a major problem because I could now boot into my new installation. After that, I had to solve a couple more problems:

  • WiFi and WPA - Ubuntu correctly installed and loaded the ipw2200 driver for me, which was great. I had a lot of problems when I tried Fedora. Fedora just didn't like something with my hardware. Yet, I struggled to find information about getting it to work with WPA. I finally found that I should get network-manager and gnome-network-manager. After a quick reboot, I had this wonderful applet control that let me select all available networks and even remembered the passwords. Why that doesn't ship as part of the standard install is stupid.
  • Bluetooth - I use a Logitech MX200 bluetooth mouse with Windows and it's a freaking nice mouse. Ubuntu installed the correct packages for bluetooth, but I couldn't figure out how to get the mouse to work. After hours of time with Google and the Ubuntu forums, I found that the answer is as simple as executing hidd --search. Duh.

Now for the complaining. If there are solutions, I would love to hear them. I'm not claiming to be anywhere near expert status.

  • Bluetooth - Why do I need to run the command by hand? And even so, why do I need to turn on the mouse and then run the search? I would rather see a daemon that scans every so often or handles signals from devices when they start. Kind of like Windows.
  • NTFS - I have a lot of data on NTFS drives and I need the information visible on both Linux and XP. I found very buggy methods (and none of them worked for me) for trying to mount a NTFS drive. For 100% compatibility, I need to go back to FAT32? It's not like Windows just broke onto the scene either.
  • apt - I get strange messages about packages missing yet I find them in the stable package catalog. Why?

That's it for now. I haven't given up but those are the biggies on my list preventing me from going to Ubuntu for development.

Software

Journal: Why Can't I Get GRUB To Work! 10

Journal by dthable

I've been trying to install Ubuntu on my personal laptop and dual boot with Windows (I still need those pesky business application, so don't suggest ditching Windows). I would rather use the Windows boot loader and I know this is possible if I don't install grub in the MBR.

My drives look like:

Primary 1: Main Windows Partition
  Extended:
    Extended 5: Data Partition
    Extended 6: Linux Swap
    Extended 7: Linux /

Do I specify (hd0,7)? I tried (hd0,6) and it didn't seem to work. What's going on with grub (or me)?

PHP

Journal: [PHP] Working with Arrays 2

Journal by dthable

I've been working on this application that requires adding a key value pair to an existing dictionary. The quick solution I found was:

$one = array( 1 => "one", 2 => "two");
$two = array( 3 => "three", 4 => "four");
$new = array_merge( $one, $two);

Is there some way to just append without the merge? While array_merge works in this case, what if I just want to append a single item? Also, is there an OO implementation of an array? I'd like to be able to say $new->sort() instead of using a function.

Programming

Journal: [programming] Hibernate It Is 1

Journal by dthable

Well, we decided to use Hibernate for our next project. The boss and I played with a small demo program and he was sold. Reasons:

1. We found our development staff to be less than stellar when it comes to writing SQL.
2. It's fast.
3. We can get support from Redhat in the future.

The last one is huge. I always laughed at people who bought support but then I had an issue with perl. I could have found the answer myself, but it was easier and faster to call ActiveState.

Now, where's are the best Hibernate docs and tools hiding?

Programming

Journal: [programming] Is Hibernate Worth It? 7

Journal by dthable

I've got into a little debate/argument with a former boss over how to code up a new Java web application. I suggested looking into Hibernate (which I know very little about) to ease up on the developers. He thought we should take control of writing the SQL because there might be too much overhead. Does Hibernate, or any relational mapping library, cause enough slow downs to resort to writing SQL? Is Hibernate really going to make my database and application that much easier to maintain?

User Journal

Journal: The Microsoft Interview Is Over 2

Journal by dthable

I've finally recovered from my Microsoft interview experience.

4 Questions:
  a. Design an algorithm
  b. Design a comprehensive unit test plan for the algorithm
  c. Design new features for a product.
  d. List selling points and explain to a customer why they should by your product from c.

It took only 30 minutes but that seemed like an eternity and just drained me. I was so out of it for some time afterwards. Maybe it was the lack of sleep, the stress release or the mental grilling that I just got. It didn't go as well as I would have liked (we had some technical difficulties with the phone connection) and if I had to guess, I would bet against me.

Hey, at least I got the interview.

User Journal

Journal: I am evil? 3

Journal by dthable

I have an interview next week with Microsoft. I'm basically going for the position of a test software engineer for the xbox team.

What have I gotten myself into?

No sleep for the week while I try to study up on everything computer related. I'll start with compilers and .....

Slashdot.org

Journal: Slashdot Help Needed 2

Journal by dthable

I know I've been not reading as frequently as I once did, but how the hell do you reply to a comment with the new discussion system? Did the reply link move?

Never appeal to a man's "better nature." He may not have one. Invoking his self-interest gives you more leverage. -- Lazarus Long

Working...