snicknet.net

‘Keepin it White n Nerdy’

Archive for the ‘Coding’ Category

Apr-5-2009

Things are Working Well & Ranting

I have started to use my iPhone for reading at school with the Amazon Kindle app, and I read my Kindle at home. This way I don’t have to bring another piece of electronic equipment that might get lost or stolen to school each day. I must say the page syncing and ability to read my current book on either device is amazing. I have just completed my second book and plowing right along in my third. Amazon has defintely got this e-reading thing down to perfection. Any of those out there that enjoy reading, this combo of iPhone and Kindle is the most amazing thing ever to happen to books. I think we will begin to see many more ebooks emerging far more quickly than print books in the future. This is already starting to happen with limited edition or multipart book releases where the parts are released for the Kindle every month or few weeks while the whole book might not be published for several months. So bravo to Amazon for creating something so amazing.

Having used my Core2Duo machine now for watching several films I can safely say this is a much better way to go. I haven’t gotten everything dialed in in terms of the install yet, but viewing wise it is simply amazing. No more dropped frames using only a 2.2GHz Core2Duo and integrated Intel graphics. I have the system running off of a compact flash card for heat and power reasons and that is working well also short of a small journaling issue that causes the system to keep pinging the compact flash card rather intensely. I will have to figure out what the exact problem is, probably will switch to a non-journaled filesystem with a fresh install. I also started thinking about possibly trying to get some Windows games running on that system, maybe a big race car game of some kind. I think I’d like to see that on a big TV.

School work is coming in quite quickly so far. I have several large things due in the next week. I will have to keep up on that to ensure it doesn’t get out of control. Overall I think I could learn a lot this quarter in terms of more about how things work in the computer. There are still a lot of things I want to learn that were never touched upon at school that really kinda disappoints me seeing how this is my last quarter and all. Everything that is taught relates so specifically to logic and basic algorithms. I feel like I could write you some advanced logic at a command line interface and that about sums up my college education. We never addressed GUI design or implementation, graphics using OpenGL or Direct3D, and no wireless communications. I look through for code examples on how to do these things and am dumbstruck at all these crazy objects and constants that go into setting up these lines of communications and really wish someone had a clear explanation of what is going on. We also never discussed media storage, retrieval, or usage. I don’t even know how to setup a Java app for playing an MP3. It seems quite strange that school would focus so much on the basics and leave us coming out into a media centric world with no knowledge on how those things work.

Well that’s enough ranting for one night. Still lots of things I want to do, but don’t know how. Quite the frustrating position to be in.

Posted under Coding, School
Mar-19-2009

Finals

So, I survived my Computer Vision presentation. As it turned out many kids had taken on larger than they expected projects and were only partially done. I ended up presenting on all that I had learned about epipolar geometry, and showing off my epipolar lines I was able to recover from the  stereo images. I still want to try and get some more of the script working before the report is due Friday night. Today I have my last final which is in Artificial Intelligence. Hopefully this will go well. I’m just happy to be done after this, I’m exhausted and quiver to think that if I don’t pass one of my classes, I will be under the same workload next quarter as I was this quarter. So far I have one passing grade out of 5 classes, just 4 more grades to wait on. Having been through a quarter with 20 units now, I can safely say that 20 units at UCI is nothing like 20 units at Saddleback. The amount of work I received in homework, projects, tests, and quizzes was immense. I just hope that this quarter works out so that I only have one more before graduation.

On a more depressing note, our timeshare is completely booked because of Spring Break, so I won’t be able to escape as I had planned. I’ll have to try and come up with something else :(. There appears to be plenty of stuff for me to work on over spring break, so I might just end up working for most of it which is good and bad, I need to get some money in to help pay for taxes as well as get my bank account replenished for after taxes. I saw one or two cool toys I might like to have, but ultimately I’m pretty content with everything I have at the moment. Shuttle is getting closer to releasing the X50 which I have been watching carefully in hopes that they might release it. I could see some very exciting uses for that machine, and with the knowledge I have gained over this past quarter in computer vision I have a renewed vigor with which I want to pursue learning OpenGL again. I really want to program some stuff in 3D. We’ll see if I can keep my focus long enough to make something of that. The shuttle machine would be a great platform for testing out some of my ideas, a 3D interface on a touch screen I think would be a very cool thing.

Posted under Coding, General, School, Work
Jan-2-2009

Winter 2009

Monday will mark the beginning of the Winter 2009 school year at UCI. I have signed up to take 20 units across 5 different classes. 2 project courses, and 3 upper division major courses. I’m looking forward to the new quarter which hasn’t happened since my first quarter at UCI. I really enjoyed my Computer Vision and Imaging course last quarter and hence am taking the first time offered project course in the same area. I will also be taking a project course in computer networking. I’ve been told I’m insane for attempting two project courses at the same time, perhaps I am since I don’t even know what one entails. I’m sure I will find out rather quickly how managable this will be. The other three courses are: Digital Log Design, Intro to Databases, and Artificial Intelligence. I’m not sure what Digital Log Design entails, but I’m definitely looking forward to the other two courses, both of which I have been waiting to take since I started at UCI.

Lots of things and nothing have all happened since I last wrote up here. I’ve just continued working on a consulting basis. I survived all of my finals at the end of last quarter. Christmas brought a few neat toys to me, including a WD Velociraptor HDD which will be the first of 4 I hope to procure over the next year to build my VM array in my new server. I decided on the WD Velociraptor for many reasons, I was originally planning on running 146GB 15k RPM SAS drives. The drives would make a phenominal VM server, but after doing some research online I discovered that the ammount of power consumed by the drives vs. the performance gain over the Velociraptors was minimal. The SAS drives consumed almost 3x the amount of power at peak usage as the Velociraptor did with decent gains. The Velociraptors are also cheaper and easier to obtain brand new. I did run into one issue that will be resolved shortly while mounting the Velociraptors in my chassis. The Velociraptors sit on a giant heat sink dubbed the “IcePak” by WD. The actual drive itself is only a 2.5″ hard drive mounted on this giant heatsink. WD center mounted the 2.5″ drive to evenly dicipate heat which makes sense. The issue you run into is that hot swap chassis and bays place the SATA power and data connectors in the bottom right corner where SAS and standard SATA drives have them. So, to make my setup work I will have to do some small case modding. I was lucky enough in that I have a 4U rackmount chassis, with 20 hot swap bays, 4 across and 5 rows. So, I simply removed the circuit board from the back of the hotswap bays for the top row, and will pass through standard cables to these drives. I won’t get the pretty lights for power and activity, but I will get to use these energy efficient and fast drives. I also started experimenting with a USB TV tuner that I would like to use on my MythBackend VM. Unfortunately I ran into compatibility problems while trying to configure it. Hopefully the Linux community will have something out soon to remedy the issue.

The other day I started working more with the sound card and VMs on my server. I discovered something rather important with Server 2008. You can rather easily install a sound card on the server, the trick here is not to do it while remoted in :). I learned this the hard way after several hours of frustrating restarts. Turns out that when you RDP to Server 2008 the sound devices are disabled and appear as though they are not functioning. So, you have to install a sound card while on the physical machine and not remotely connected. Lesson learned. At the moment I’m setting up a mic to pass through to one of my VMs to experiment with voice commands. My goal is to be able to turn off my lights for the night without having to touch anything. Presently my bluetooth proximity script is working flawlessly. I leave my room and my lights go out, I enter and my lights come on. I still need to add some code to handle day light conditions, most likely using a sunset time calculation. That way if it is after sunset the script will run, otherwise it won’t. We’ll see how that works soon. I’m having trouble getting that data easily using a bash script. I may attempt to port my little scripts into Perl which I’m growing rather fond of after several WWW::Mechanize scripts to pull down various pieces of information from the net. More to come soon I hope :).

Posted under Coding, General, School
Oct-11-2008

BlueProximity - Day 2

So, I spent a few hours yesterday starting to see what I could do with BlueProximity. I got up to the point of locking my computer, turning off my monitors, and pausing my music. Today I spent a good number of hours continuing to experiment with it to see how far I could take my ideas. I decided to migrate my work to a VM since that is where I planned on running my final product. I’m attempting to kill off the 4 computers currently running in my room and dropping that down to 1-2. My solution is to migrate all my current machines to VM one by one. So, using VMWare 2.0 I was able to attach my bluetooth dongle to my Ubuntu VM under Windows Server 2008. It took a bit of work just to get the sound and bluetooth adapter recognized in Server 2008, but that is for another post. Once I had the adapter attached and working with local apps I decided to take it to the home automation level. I wrote scripts to control a fan and lamp in my room. I attached the serial port to the VM and sure enough whenever I leave my room my lamp and fan turn off and when I return they turn on. I migrated my music collection into Amarok for an idea that I’m saving for later (I’ll let you know if it works). So, I can leave my room and have my lights turn out, my fan turn off, and my music pause. Was that enough, nah not even close. I decided to start working with festival, a text to speech synthesizer for Linux. I expanded the Amarok pause and play commands to include nice fades and on top of that when I enter my room the music fades to 20%, reads me the song and artist of what is playing and then fades to my previous level when I last left.

Some of you might be thinking there can’t possibly be more. Well, I have several other ideas that I plan on implementing including integrating a sunrise/sunset calculation to decide whether or not to turn the lamp on when I enter the room. I also what to add a proximity script so that if I’m in my room and it gets dark then my lamp will fade on at sunset. I want to do something similar with my fan using weather data. I haven’t decided if I just want to use online data, or if I should get/make a USB or serial thermometer to get conditions inside of my room. Another idea I had was to include an email checker in the proximity script and to fade out any playing music and play the “You’ve got mail” sound when there is new mail in my GMail account. I know of several other things I really want to do, but they’re dependent upon me saving up enough money to buy a network based IR blaster.

Posted under Coding
Oct-10-2008

BlueProximity

While searching for some info on bluetooth proximity detection I came across a post on the Ubuntu Forums explaining a new program that will lock/unlock your computer for you base on whether or not a set bluetooth device was within a certain distance of your computer. The natural device to use for this would be a cell phone, but now days you could use a bluetooth headset or any other matter of bluetooth enabled device that you keep on your person. Suprisingly enough I was able to setup my iPhone to work with the program and a basic USB bluetooth adapter. One option offered by the program is to execute any command during the lock and unlock phases. By default it is set to turn on your screensaver and lock your screen. The post mentioned your ability to add scripts to do various things like pausing amarok, changing your status in Pidgin. Unfortunately, I use Banshee and no script was written for it. So, I threw together two small scripts to do this for me in python. In the command section of just add “&& python /script/location/banshee_pause.py” (without the “” and substituting in wherever you saved the file). Do the same with the play script for unlock. Now you can walk away and have your Banshee music paused and it will resume when you get back.

Banshee Pause Script

Banshee Play Script

Credit for the Scripts and Ideas Goes to:

http://www.madsoft.org/2008/06/10/interfacing-banshee-10-with-dbus-and-python/

http://ubuntuforums.org/showthread.php?t=702372

Posted under Coding
Oct-3-2008

Catch Up on Yesterday

So, yesterday was not as productive as I would have liked in terms of my projects. However, on the brightside I did work a 5hr job which will help financially at the moment, and may even help me start to procure parts for my new server. This weekend I have a good amount of homework I need to complete, as well as a single job on Sunday which will take around 3hrs. So, I should have some time to get a lot of work done on my projects. As an update for you TF2 fans, I realized I hadn’t posted any screenshots in a while, so here is what I found in my screenshot folder.

Posted under Coding, General, School, Work
Sep-28-2008

What have I been doing?

I felt the sudden compulsion to write a quick post, whether it is to distract me from my task at hand or an actual heartfelt plea for a break I can’t be certain. My second day of school was roughly equivalent to the first. I hated stats as I always have. My teacher is very quiet and this will make it even harder to understand him once we move onto real material. My second class like on my first day was quite enjoyable. I had computer networking. The teacher has been at the school for quite some time and I’m glad to see he hasn’t lost his passion as so many teachers I’ve come across have. He has a few strict rules that I don’t completely agree with, but I’m willing to make some exceptions to the norm for a good teacher. 

On another note, I had hoped to be more productive this weekend. I seem to find myself in a rut. The one good bit of news is that I started to stop drinking caffeinated beverages again. I don’t know if this is a blessing or a curse. I do feel that I accomplish more while I drink them, but I can’t ignore the terrible headaches that I get when I stop. I think moderation will be the key. I wasted my whole day on Saturday just lounging around the house. I definitely see looking back that this was a terrible mistake. I was much more productive today. I played tennis in the morning, grabbed lunch with my brother and a friend, and returned a clients laptop. I’ve done a bit of light coding which I hope to accomplish more of in the next half hour to hour before bed. I have found it quite difficult to will myself to do the things I need to do recently and this not only bothers me, but also bodes unwell for the start of the new quarter. I have to figure out what is preventing me from just being like I used to. I think there are several factors that maybe playing parts in this behavior including my current drop in income from starting school along with a slippery economic climate, and a recent desire to be social. Those that know me well, know that I am not a social person, but recently I enjoy interacting with other people. I can’t explain why this desire is there, but everytime I’m around someone that I don’t know very well I have had a compulsion to know more about them or just to talk with them for the sake of talking. I hope this isn’t a sign of my nerdiness getting the best of me.

As a side note, to keep myself stable during these strange economic times, I have decided to revert to something I did while working at Starbucks. I found that by eating lunch from a grocery store I was able to cut the cost to only $3-4 a day. I think it is time again to turn to this practice as I do not like my current situation. As well as my desire to acquire a new server since I ran out of storage space this weekend also adds a new bit of pressure on me. We’ll see if I can make a serious difference in my spending habits this week. It’s strange to have so much that you want to do, and yet to be completely unmotivated to do any of it. Something has to change.

Posted under Coding, School
Sep-15-2008

Another Year of School

Today marks the final fee deadline for class registration at UCI. I have enrolled in three classes and will be adding myself to the waiting list for a fourth. I’m going to be cutting it extremely close to complete in the next year. I have a gut feeling that I will have to fork over the money for one extra quarter to fit everything that I’m required to complete for my degree. I decided to see what the ratemyprofessor site had to say about my professors this quarter, just for kicks. I have been guessing in my head what my past teachers would have been rated as, but reading the ratings for my new teachers has me a bit worried. Every computer science teacher I read about on ratemyprofessor had the worst reputation. I think this is a paradoxical thing, where computer science people in general are not very social and so when they try to be by teaching they don’t come off as being all there. The other issue, is that most computer people that are truly passionate about what they do often speak very quickly when teaching about various subjects. I know I’m guilty of this, when someone asks me how do you do X? I will often run through it at a million miles an hour and be done explaining the idea in full detail by the time they get out their pad of paper, at which point I have to go through the whole shpiel again. The sad part is by the time you go through it a second time you are a bit flustered that the person didn’t listen the first time and leave out much of the “bonus” knowledge you were willing to share. I think the same is true for computer science teachers. I’ve had two really great teachers that I can recall, both were workers in the field and taught on the side.

The biggest bummer about UCI is that with their scheduling you don’t get to pick your teacher, there is usually a single section of each class available and you have to just roll the dice and see which teacher you get. Saddleback was much more open, they had easily 4-5 sections of each class with different teachers so that you could pick and choose who you wanted to take the class with.

There are several things I find lacking at UCI having been there for a full year now. The first is the number of languages taught to Computer Science students and the inflexibility of professors to allow students to use languages more suited to a given task. Everything has to be JAVA whether you like it or not. This is setting a lot of students up for failure. Java is not the only language in this world and for good reason, if we all had to write Java swing interfaces for every program I’d have shot myself a long time ago. I feel it’s a good language to branch out from because it’s cross platform compatible, but for so many of the projects given to students web languages are much more suited. Another big thing missing in the school is the business side of programming. There are no classes offered on how to start your own programming business or for that matter any independent study class for starting your own business. Something I would really like to see happen at the school would be to have each student pick a large scale project that they will work on for a full year during their upper devision classes that each class can take a little piece of and make that much better. Then when the year is up each student would have some large program that is something they wanted to work on, and can use in their portfolio or to sell. This way each student comes out with something to show for all their hard work, rather than 20 little programs that can sort a CSV file. It’ll be interesting to see what this next year at UCI holds for me.

Posted under Coding, School
Jun-10-2008

Last Piece of Advice

So, before I go and get mutilated by this next final, I thought I would reveal a bit of what I learned about iPhone bluetooth pairing. It turns out that Apple was very generic in what they checked to classify a device as a headset or not. By using hciconfig and setting the class for your bluetooth dongle to 0×200400 you can successfully make your computer appear as a pairable device to your iPhone. It will even let you enter your PIN and the device will appear as paired on both devices when you are done. This is where I have left off for now. Should anyone make any further progress such as playing music from their iPhone through their computer speakers over bluetooth, please do share. Well, I’m off to my final. I’ll see you on the other side.

Posted under Coding, School
Jun-8-2008

Everything has Changed

It’s been over two months since my last post. It’s hard to believe how fast time flies. So much has happened over the course of the last two months I feel it’s time for a bit of catch up. School hit a rock bottom this quarter. I only recently realized what was happening and began to question what I was doing. It’s going to be extremely difficult to pull off the grades I need this quarter to move on to several new classes, but I’m going to give it everything I’ve got to make it work. My first hint of what was going on occurred midway through this last quarter when I bombed my Statistics mid-term. I immediately dropped that course. As a result I will be taking classes this summer, on my own dime. This doesn’t put me in a very good financial position. It is imperative that I sort everything out this summer. According to my guidance counselor I’m currently a year and a quarter away from graduating at UCI. That means it will take a quarter longer than I had expected, and that’s assuming no more screw ups and all the classes I need are offered when I need them. So, the gloves are off. I have felt more myself in the last week or two than I have in I don’t even remember how long. It’s amazing what the mind can do. I have been more focused, and happier overall. All it took was hitting the reset button. I’ve started making head way on my personal projects as well as my business projects, and it feels good to be making progress on so many fronts at once. I don’t even remember the last time I was happy that I was busy.

So, heres how the projects stand. I began working on my car pc. I grabbed a low powered machine last weekend for about $250. I spent the last week and a half swapping distros and playing around with settings. I hit my lowest boot time with the Ubuntu Server editions at around 10-11 seconds. I most recently tried installing a full Ubuntu 8.04 Desktop and to my great surprise I’m getting a boot time of ~15seconds with only minor modifications. So, I have decided to continue using the Hardy Heron desktop as my base operating system. I also have worked on setting up this machine as an access point. I found the necessary code spread across the internet. I will post a step by step once I have completed the install on the new machine. With the access point I will be able to easily attach my iPhone to the car pc for syncing and other data transfers. Today I was working on pairing the iPhone over bluetooth to the Ubuntu Desktop. Lets just say I didn’t have complete success, but I learned a ton about bluetooth and in the end I did manager to pair the two devices although I am still unable to transfer audio between them. I can’t seem to figure out if its protocol or device class related. Perhaps I will learn more after Monday’s Apple conference. As for business related things, I have secured an office to work in over the summer. I’m hoping that by separating myself from home I will be able to focus more on my code. Well, that’s all for now. I will be posting various step by step processes that I used to get different parts of my car pc to where it is currently.

Posted under Cars, Coding, General, School