Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Friday, November 29, 2013

The Old SQL and Little Saigon

Since Thanksgiving was yesterday, today is a big day for leftovers. Here is a post I wrote in June. It was almost finished when I first wrote it, but it never got published. Since it has some good links and the content is interesting, you might enjoy it.

On Thursday (June 13th) I got an email from my web host saying they were deactivating and deleting anything using version 4 of PHP and MySQL web programming languages. I have received several emails like this over the last few months, but this is one I did not ignore since it is was happening on Monday.

Now for a programming aside. SQL stands for structured query language. SQL is often used for things like an online store. The SQL database will have an entry for each item containing the item's name, description, price, link to a picture, and other assorted stuff. When a customer wants to search for an item by description or price, an SQL query will be generated that will search for certain values in the price or description field. If you know how to use it, an SQL database can do a bunch of stuff. PHP is a server side scripting language. One of its common uses is to interact with an SQL database so a user can access it.

The MySQL 4 database I had to save is for the California Patriot, the political magazine I wrote for in college. Their website and online presence never recovered from my graduation. See the website now for evidence of its infrequent updates. The website had a Wordpress blog as well, which is what I am most concerned with. It used to be a big part of my life; I made over 150 posts and spent countless hours looking for stories, taking pictures, and editing things until they were just right. The students who took over after me broke the blog nine months after I graduated. They asked me for help and I could not fix it. This made all of the archived posts inaccessible. The posts were still in the database, but they could not be accessed online. The blog has been down for over four years.

Most of what I know about blogs and their related programming comes from fixing things for the Patriot blog when I took over as online editor junior year. While I had some random knowledge from a JavaScript class and helping a neighbor set up a website, I was lost when trying to figure out the advanced stuff. My computer crashed many times. With the help of our good friend Google and everyone who posted helpful things online, I figured out how to get by most of the time. A few years ago I wrote a detailed account of My Blogging Backstory.

When I started working on the MySQL database on Thursday, I was surprised at how easy it was for me to do stuff. I was significantly better at figuring things out and getting things done than when I last looked at the site a few years ago. In recent times I must have become three times smarter or more clever.

The end result of all this is the restored blog is temporarily resurrected here. You can also just browse my posts from the beginning back in February of 2006. They were primarily written for an audience in Berkeley that followed some campus, local, and political happenings, but a few of them can be read and appreciated today. Many of my puns are just as good (or just as bad) today. Rereading what I wrote is exciting. My pictures, jokes, and memories of a different time are all great. I can even remember what was going on in my life when I made the posts and how people reacted to them.

Getting everything up and running took some work. Apparently copying and pasting over 8MB of text into a box on a website does not work well. Instead, I had to upload it as a file which then executed 1074 instructions.

Unfortunately some pictures from the Patriot blog were lost. I must have deleted them by accident in the mess of folders a few years ago. I would grab a backup of my posts or find the original pictures, but there were from fall 2006 to mid 2007. My hard drive died in May of 2007, a month before my annual backup of files.

Between the 161 posts I made for the Patriot blog, 11 more for an ancillary Patriot blog, and what I have done here (this is my 260th post) this is my 432th published post. (There were a handful of others, but they are unimportant.)

Because of my Patriot blog beginnings, I kept using the html tags for Wordpress blogs until a couple of weeks ago.

Party in Little Siagon
That was Thursday. On Saturday (June 15th) I helped my supervisor/friend/mentor (friendtor as Amanda says) set up a sound system. It was for an event celebrating the 25th anniversary of the declaration of Little Saigon. For those of you not in the know (or outside of Orange County), there are more Vietnamese people living in the cities of Westminster and Garden Grove and in the surrounding area that any other place outside of Vietnam. The event I helped with was at the Asian Garden Mall. It was mainly a showcase of cultural dances and singing. There were some comments from elected officials, but they were the standard self-promoting comments that are one reason I want nothing to do with politics. It was a big deal. Most of the stuff sounded great, but I would have liked it better if I understood Vietnamese. Around 90% of the things were in Vietnamese.

This video from the Orange County Register gives a good sense of the space we were at. Another video is also online. I am wearing a green short sleeve shirt and standing on the floor next to or behind the black speaker on the pole stand on stage right. I do an amazing job hiding my face. I apologize to everyone familiar with Orange County politicians; they were featured prominently in the videos. Just fast skip those parts and be glad you did not have to be there to see and hear them in person.

Saturday, July 21, 2012

CNC Machining and Mold Making

Through my volunteer worker job with the City of Los Angeles I attended a class this week. It covered how to use a Haas CNC machine.

A computer numerical control (CNC) machine works by following user written code to machine a part. You put a block of metal into the machine and it will drill a pattern of holes, hollow out areas, engrave text or a design, and even smooth the piece's edges. Once you write the code and press start, the machine does everything and all you have to do is come back when it is finished. Then you can put another piece of material in, press start, and make another identical part. It is a great machine.

The class detailed the operation of a Haas brand CNC machine. It covered how the control interface worked, a few practical tips on some buttons, and how to program in G-code. The G-code tells the machine which tool to use, where to make cuts, and how fast to go. They had a control unit at my seat so I could practice inputting everything on the machine as I learned it.

I was able to attend this factory training for free because the city department where I volunteer bought a CNC machine. It is a big piece of equipment. It is the size of a small car and costs tens of thousands of dollars. A few months ago I tried to learn how the machine worked without the benefit of this training. I managed to crash the machine, which is very bad. A crash happens when the tool collides with something it is not supposed to like a vice that is holding a work piece in place. However, I am blessed to be working for understanding people who were not mad at me when I crashed the machine, broke a drill bit, and damaged the vice.

I enjoyed the class a lot. If I was not academically inclined, I would strongly consider making a career out of working with machines like that. If you want to know why I am doing electrical engineering instead, consider a more comfortable work environment, less physical exertion, safer working conditions, and a higher salary.

After my last CNC class on Thursday, I took and passed my third radio test. I now have an Extra class amateur radio license. Next week I will apply for a special vanity call sign to use when I talk on the radio.

Casting and Mold Making
While I am on the topic of training I got into because of my volunteer job, I have a few pictures from December. I took a class from Smooth-On (part of Reynolds Advanced Materials) on casting and mold making. It was a hands on class so I got to practice the process.

Here are a couple of terms from the process. Molding is the first step when a negative impression is taken of an original. Casting is the second step, when the material for the copy is poured into the mold.

First, an original item is placed in a container. Since the mold material is good at getting into things, the original has to be glued to the bottom of the container. Next, the mold material is prepared. Smooth-On makes user friendly products, so all you have to do is mix equal parts of what is in the blue container and the yellow container. The user then has around ten minutes to pour it into the container around the item before it hardens. For our training, they had small statues about three inches high for us to make molds for. They must have planned ahead for me; they had a statue of a pig for me to make a mold of.

After the mold had a few hours to sit, we removed the original and prepared the casting material. It had a similar two part mixture. I added some blue color and poured it into my mold. A couple of hours later, it was time to demold and I saw my pig.



The process even picked up the signature of the original artist on the pig. I was able to take home both the cast pig and the mold I made it from.



It was fun to learn how everything works. If I had any great ideas on how to make money with this knowledge I would give them a try.

Monday, May 2, 2011

The wrong version and bad answers

I am a few weeks into a class at UCI Extension. It is about programming for a specific processor chip. Most of the work so far is writing code in an application and then uploading that code to a circuit board.

There are some big problems with the class. The textbook and the lecture notes use version 3 of the software. Almost everyone in the class and me are using version 4. There have been significant changes between the two versions. Entire menus do not exist in the new version and many settings have been relocated, renamed, or removed entirely.

The programs are not working for me. It is annoying and I have not been able to complete many of the assignments.

Everyone uploads their code online after they finish the projects. However, even after using the exact same code as other people and reading their write ups which include how they solved every problem that came up I still cannot get many of the examples to work for me.

Last week the class was going so poorly, I was filled with excitement when I saw the next section involved z transforms and transfer functions. From my previous class I despise z transforms and transfer functions greatly.

Yesterday I finished a quiz for the class. I had to answer three questions from the textbook and enter the answers online. There were two big problems. First, it took me a while to understand what the questions wanted and how to do it. They involved transfer functions, an impulse function, and many mistakes on my part. Even after I read the sections in the textbook, looked at another textbook from an earlier class that covered this, and looked at a couple of websites I could not figure it out. As a last resort, I typed a form of the problem into Google. The first result that came up explained everything perfectly. I was able to finish the quiz and submit it with only seconds to spare (as the 1 minute 14 seconds timer indicates).

My second problem was the choices the instructor gave for answers. He could have set the answer choices to any numbers or words he wanted. Somehow he managed to give 21 possible answers which included two that were equally valid. For one problem I calculated an answer of 1.1. Click on the cropped screen shot below and tell me, what am I supposed to do?

Screen shot of bad quiz question

Twice during the quiz the answer was exactly between two values.

I will see how the class continues and finishes up. Right now it is not looking promising.

Monday, December 6, 2010

Falling apart, coming due, and flying out

The last couple of weeks have had some of the worst moments and the worst days I have had in a while. It will be OK; the next few weeks will have some great stuff in them.

Many of the bad things relate to how I view everything. Many small annoyances, problems, and stresses have a common solution, "If I did not live at home."

In addition to that, I had a lot of concern over my DSP class. Last night the final and paper/project for my class were due. These two items combined are 90% of my total grade. This is the summary of the project I wrote last night:
The project based itself upon a surveillance radar. This type of radar is used primarily for locating an object and roughly finding its velocity. It used a pulsed wave so the same antenna could be used to send and receive signals.

Signal processing was done in three parts. The matched filter in the first part used FFTs to mix the original signal with the received signal. This amplified the parts of the signal where any echoes would be found. After the inverse FFT was applied, this was sent to the detector processor. Before looking for a signal, a CFAR was calculated and used to establish a detection threshold. If a hit was detected, the signal was then passed onto the next stage. At the postprocessor the highest signal was isolated so its frequency and time could be recorded. Using the transmitted signal's initial conditions as a base, these measurements were used to estimate the object's velocity and range respectively.
This project used Simulink which is a simulation tool closely related to MATLAB. Like my astrodynamics project for an earlier class, this involved me learning a lot of stuff in a new field. However, this project turned out poorly. I did not understand radar design very well, I did not know how to recreate everything on a computer, and I kept putting off doing the work.

Now I will share what I wrote in the results section:
The simulation did not work. Debugging had to stop as the project was due. The problem was providing a signal the simulation would accept.
The project was due at 11 last night and I submitted it online at 3:11 this morning.

The Final
This turned out much better than the project, but it had a couple of interesting moments. It was an at home open book test. One of the questions involved adaptive filters and neural networks. At first I thought they were related through a lattice-ladder pattern. As I looked through the textbook I found support for my idea; a FIR (finite impulse response) filter structure can be realized as a lattice structure.

Two days later I discovered I was wrong. My research led me to the MathWorks documentation. As I was trying to make sense of adaptive linear network architecture, I had the strange feeling I was actually reading something fictitious. The algorithms were described as learning how to do things on their own.

The Next Part
Between now and Christmas I will be spending more time away from home than at home. I will develop the details as things happen or after I have pictures and stories to share. For now you should know several states and several feet of snow will be involved.

There are still many things I have to do, but some of them are things I want to do.

Sunday, November 7, 2010

Hamming Windows, Halloween, and Inspiration

This starts last Sunday when I was working on an assignment for my DSP class. My problems started when I got the Hamming and Hanning (or Hann) windows confused. Look at the equations for both of the windows and you can see how close they are. At first I thought I had to explicitly code each equation to magically create the windows. Even though I had an example for another kind of window, I had no idea how to do this.

The notes gave an example of a Hanning window complete with the equation and then asked me to use a Hamming window and gave me its equation. When I read this I thought both of them were Hanning windows with the second one being implemented with a slightly different equation. I tried many things, but I could not create the window or even reproduce the example in the notes.

Then around 5:45 Sunday afternoon inspiration hit. I realized the example and the exercise were two different functions, I did not have to code them directly, the earlier example in the notes was unnecessarily long and drawn out, and MATLAB has built in functions for Hanning, Hamming, Tukey, Kaiser, and Rectangular windows. I was very pleased I figured this out.

Moments later I was struck by an unrelated inspiration. I remembered how much I enjoyed Halloween when I was a child. At some of the houses I went to the adults distributing candy were very into Halloween. In Ohio, my neighbor across the street made a witch head and answered the door with it scaring the children, while some people just handed out candy in normal attire. I thought it would be great if I dressed up when I answered the door. Since I had 15 minutes and had not worn a Halloween costume for a few years, my options were limited. However, I remembered a mask I had in the garage, a coat I had never worn before, and a hat and gloves from when I was a magician. After finding all of this in a few minutes, this was the result.



The children were scared. Many of them commented on my costume. A couple of people thought I had a gorilla mask, while I think it looked more like a skeleton mask with the bones colored black and the teeth white.

In the large groups of trick or treaters, some of the really little kids saw me and were scared to walk from the sidewalk up to the door to get candy. I had to get as low as possible and hold the candy in front of me so the four year olds would not be intimidated. My costume was an overwhelming success.

On a class related comment, now might be a good time to start looking at the lecture notes, reading the textbook, or working on the assignment due at 11 tonight. If inspiration is going to strike again, I better be ready for it.

Friday, June 18, 2010

A Wrap on the Classes

The two programing classes I took at UCI Extension have ended. On Sunday I submitted the final for my MATLAB class. The C in Embedded Systems class finished up a few weeks before that.

There are a few differences between the classes. For the C one, the instructor did not have any graded work for the class, any tests, and the only three assignments did not have to be submitted or posted. In contrast, the MATLAB one had 7 weekly assignments, a final project, and a final exam. The different standards of accountability had a direct connection to my level of learning. I did not learn very much about C, but I have learned more about MATLAB than any other computer language I have studied for that length of time.

The final for MATLAB was on the same level of difficulty as the weekly assignments. In keeping with the instructor's pattern of not proofreading, it said Fall 2007 in 24 pt font at the head of the document. I don't understand how the instructor does this. It looks like I spend more time reviewing one of my posts on this blog than he does reviewing an assignment he is being paid to produce.

The grades are in

The C programming class was for credit/no credit and I received my credit.

The grade for my project was posted first, 85%. There were no comments, just a grade. The final exam had a grade of 90%. The one comment for it provided me with a line of code that would plot a Fast Fourier Transform. My answer did not have that specific line of code because I was never asked to plot anything. The problem paraphrased was: Take the FFT of a vector and apply the inverse FFT to show you get the original vector again. After transforming the vector, I wrote a line of code that compared the original vector to its ifft. Since it returned an array of 1s, the comparison was true. However, my efforts for the problem did not merit even 1 out of 10 points.

In the assignments and the final, I graphed a lot of problems I was not explicitly asked to graph. There was no doubt about my ability to use graphs. I was agitated about this because I computed my final grade for the class to be 87.5%. With even half credit for the FFT problem I would have 90% for the class. When the grade was officially posted I got an A for the class. My agitation abated.

The next class in the program will not be until the fall quarter.

Monday, June 14, 2010

Projects, Programs, and Endings

A week ago the project for my MATLAB class was due. To summarize my project:
Given the position and velocity of an object in the atmosphere, determine if it will impact the Earth. If the object will not hit, give its point of closest approach. Find the position and velocity vectors of the object at impact/closest approach. Also determine the time to impact/closest approach and give the type of orbit (circular, rectilinear, elliptical, parabolic, or hyperbolic).
Since I did not finish it before my trips, I spent a lot of time working on it away from home. I did not realize how much I used the home, end, and delete keys as well as the ten key pad on my keyboard at home until I had to use laptop keyboards I had never used before. A couple of times each minute I was reaching for a key that was not where it should be. I did not know my typing and keyboard manipulation had become optimized to use so many keys.

The project was due while I was in Orlando. When I connected all the parts and ran the entire program for the first time there were only a few small problems. There was some degree/radian trouble in some of the equations, an error in my understanding of how matrix elements were numbered, and some variables that needed adjustments because arcsin, and arccos only return values between -180 and 180. The project was due at 11 PM Pacific time, which is 2 AM Eastern. I stayed up and used every minute until it was due. While I would have liked more time to test everything, make the write up longer, and explain more things, I am happy with what I did submit. I still have no idea how to deal with rectilinear paths or why some angles need to be changed.

Imagine you just finished a program that handles orbit trajectories and predicts the impact of objects on the Earth. What would be a fitting thing to do in celebration? I went to the Kennedy Space Center.


The Drive to the Cape

I was an hour drive from Orlando to Cape Canaveral. It was easy to get to, as I took Florida route 528. However there were toll booths, five different ones I had to pay at while traveling less than 60 miles.

It cost $26 to enter the Kennedy Space Center. While this is expensive, it included a lot. There were bus tours to different areas, such as the launch area, International Space Station Center, and an Apollo/Saturn V Center. Also included was the IMAX movie Hubble 3D, the exhibit galleries, a show, and a shuttle launch simulator.

As my brother and I arrived late in the day, we could not go on any of the bus tours. However, if you ever find yourself in the area you must take the bus to see the Saturn V rocket.

I will began this picture tour with a view of the rocket garden.

Rocket Garden at Kennedy Space CenterThe picture below has the two rockets Atlas and Redstone (left to right) used for the manned Mercury flights. In the foreground a model of one of the capsules is visible. When I climbed inside I discovered I would have never made it as a Mercury astronaut; I am too tall.

Mercury atlas and redstone rocketsThe red towers on top of the rockets are escape towers. If there was a problem with the main rocket during launch a small rocket on top of the tower would fire and lift the capsule with the astronaut away from the massive explosion.

Returning to the model capsules, the Gemini cone (not pictured) could fit me but it would be difficult to imagine sitting in one of them for two weeks working with someone. Below is a Saturn 1B rocket with an Apollo crew compartment in front. The pictured rocket is enough to get to low Earth orbit. However, if you want to make it to the Moon it will not due. You need something bigger, over twice the length.

Saturn 1B Apollo RocketSpaceflight is a dangerous thing. The Space Mirror Memorial below has the names of all the Americans who died while training for, in transit to, or returning from space. More information about the memorial and the Astronauts Memorial Foundation which manages it are available online.

Space mirrorIn the Early Spaceflight section, they have the control room used for some launches in the early 60s.

Control room view twoYou can get your picture taken as if you are cruising around the moon like my brother.

Brother in lunar roverOne of the included things was the Shuttle Launch Experience. This was a motion simulator with extra effects that recreates the experience of lifting off in a space shuttle. A video explains how they strived for accuracy in creating the simulation and gives a timeline of what will happen when. As soon as the simulator starts, it is rotated to be 90 degrees up as if the shuttle were about to blast off. There were loud noises, vibrations, and a feeling of g forces. It was great.

Below are pictures of a replica of a space shuttle along with solid rocket boosters and the main fuel tank used to launch it.

Space shuttle display

Shuttle rocket boosters and main fuel tankThere is one last picture I will leave with you. I found this between the IMAX theater and the Space Mirror.

Do not feed the alligators signI did not know there were alligators there until I saw this sign. After I observed an alligator chilling out in the water the three foot fence made sense.

Tuesday, May 18, 2010

MATLAB with Maps

I have more from my MATLAB class. For the latest assignment, I had to create a Simulink model for the equation 5y’’ + 3y’ + 7y = f(t).

When I first tried this, my Simulink block diagram looked like this.

My first block diagram in simulink
While it does not look like much, the settings on the state block can do a lot of things and minimize the need for other blocks. I got here by following the example in the teacher's notes and modifying it for the specific problem. However, some people were having problems with the Simulink stuff. The instructor posed his answers to the questions. This was his rendition of the block diagram I made above.

Teacher's simulink block diagram
Since the text is small, I will explain the action. The signal starts at a generator on the left. This follows the arrow to a sum circle where it continues to the box integrator. It then travels through a triangular multiplier before the signal is duplicated. One copy goes to another integrator box and multiplier triangle. That output and the duplicated signal from earlier are sent back to the sum circle (it can also subtract) where they affect the cycle.

It is a good thing the instructor posted his answer. Aside from the wrongness of what I originally did, it lacked the steps which made it look like I was doing things. I redid my diagram and came up with this.

My modified simulink block diagram
Creating these images was a ruinous process. MATLAB can't save as a jpg, Blogger will not accept PDF uploads, and when I tried to save as an XPS file I ended up with 7 different copies of the file on my desktop, none of which I could open (though I was eventually told .NET framework was necessary). After printing them to a PDF file, opening in Photoshop, cropping, saving as a properly sized jpg, and uploading they became the pictures they are now. This is also why I did not go back and recreate the last picture to be easier to read.

Learning takes...
When referring to the online discussion forums, my teacher said "It takes a village to teach MATLAB simulink." I disagree. All you need is a good video introduction (which we did not have for Simulink), access to the internet to research questions in the technical documentation, and the willingness and persistence to solve problems.

I taught myself a 3D graphic design program for an archeology project from youtube videos. No village was necessary, just a knowledgeable and dedicated teacher.

Now that I know about Simulink, I have to decide the best way to implement my class project. Luckily (or unluckily) I have not written any code for it yet.

Monday, May 3, 2010

Travel to the Stars with a Book

Saturday was a fun/productive/incredible day. There were mint juleps, a book index that directed me to two pages that were not in the book, and many unanswered questions about fast Fourier transforms (FFT).

Early in the day I was trying to find an idea for my MATLAB class project. After looking through my linear algebra textbooks unsucessifully, I thought of one more book from my collection that might have something inspiring for a project in it.

The book was Fundamentals of Astrodynamics. I originally bought it back in the summer of 2006 at the Barnes & Noble on Bay Street. From the clearance table, this Dover book cost me less than $4. First published in 1971, it is a textbook written by professors Roger R. Bate, Donald D. Mueller, and Jerry E. White at the Air Force Academy to teach about the motion of man-made objects in space.

The book had an appendix with four different programing projects. They were all interesting and I was excited to discover them. Since the projects used the principles discussed in the book, I would have an excellent reference in writing the program. I picked one of the projects and started writing my proposal.

To paraphrase and condense the book's project:
Given the position and velocity of an object in the atmosphere, determine where it will impact the Earth. If the object will not hit, give its point of closest approach. Also determine the time to impact/closest approach, give the type of orbit (circular, rectilinear, elliptical, parabolic, or hyperbolic), and total change in true anomaly from initial observation to impact/closest approach.
Then I started looking through the book to learn what I needed to know to complete the project. The project deadline was a month away, so I started at the beginning of the text. I read carefully and followed all the math from one line to the next. I worked on the examples and did the problems as they came up.

By the time I went to bed I had read all of the first chapter. I had gone through 44 pages of a textbook and understood very nearly every single line, example, and the first few problems at the end. More surprising than that, it all happened in one day.

After my reading I came to a conclusion, astrodynamics is amazing. Starting with Newtons's Laws of Gravity and using them to confirm Kepler's Laws, the book derives how to calculate the orbits of satellites.

Going through the book, I solved a lot of interesting problems and learned some great things. All of the examples used feet and miles. Not just any miles, but nautical miles. In case you are wondering, 1 n.mi.(or NM) = 6076.115 feet (approximate value). For one of the problems, my satellite orbit numbers did not make sense. Then I realized my mistake; I forget about the Earth and the thousands of miles it added to calculations. In case it comes up, the Earth has a mean radius of 3443.92 NM (approx. again).

The book is available directly from Dover Publications. However, the careful searcher will find a preview in Google Books. When I was looking at the preview, I discovered there is a limit to the number of pages of the book that can be viewed, even if almost any page in the book can be chosen for this viewing.

I plan on going through most of the book and doing all of the projects at the end.

Monday, April 26, 2010

The Perils of MATLAB and Online Education

As I have mentioned before, I am taking classes through extension at UCI. These are online classes and some commentary is below.

C Programming for Embedded Systems
One of the first things that comes to mind is to compare this to a class I took in the spring of 2008; there are a lot of parallels. When I started taking Cosmology and High Energy Astrophysics, I was excited. I liked the teacher's style of bringing in results from different studies, the grandness of the topic, and the anticipation I would be learning amazing things. This continued for the first three or four weeks.

In my current class, I really liked my teacher's practical approach. He extended a well known quote:
Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime. If [you] teach about the science or theory of fishing prior to learning to fish he will starve before he will learn.
Since I have completed one of the three weeks of instruction for this class, I can now offer some feedback.

In both of these classes my great expectations were dashed. In Astrophysics, the professor repeated himself a lot. He talked about the expanding universe and used the balloon analogy a few too many times. I remember sitting in class and not taking any notes for 40 minutes because everything was in an earlier lecture or common sense for anyone in upper division Physics. Talking about relativity can be good, but giving the same lecture multiple times to a bunch of people who already know the theory helps no one.

The teacher in C is talking about the general uses of C in embedded systems but has provided few specifics. He talked about the scope of variables, but has not broken any new ground that a basic knowledge of C would not cover. Our only assignments so far have been to introduce ourselves to each other and to list ten things around us that have embedded chips in them. While this is a nice embedded systems are everywhere activity, it is a poor substitute for actual coding.

I hope my misgivings will prove unfounded, but the class may end up being a disappointment.

MATLAB Madness
A situation came up with MATLAB. It revolves around the statement x = 7i/0. When a complex number is given to MATLAB, it will display its real and imaginary parts in the form A + Bi. In the notes, the program returned x = NaN + Infi. This means the real part is not a number and the imaginary part is infinity. However, when I entered the equation into MATLAB, I got x = 0 + Infi. I think my answer is better. I do not see a real part to x, so I do not see how it is not a number. In all this confusion, I completely missed that both of the answers are mathematically incorrect; division by zero is never allowed.

I only noticed this when a fellow student pointed it out in one of the forums. I joined the discussion, and it looks like MATLAB versions 2009a and 2010a display this differently. The teacher did not weigh in on the discussion.

Speaking of my teacher, he is not inspiring confidence. However, this could be a side effect of my teacher not being into teaching.

In our last assignment, there were eleven questions. Four of them were based upon his notes, while the other seven were based upon the notes of a professor. One of my teacher's problems was incomplete. It said "Create surface and mesh graphs for the function " but did not provide a function. When a student posted in the forum asking which function to use, he was met with silence for four days. When a reply was finally posted, it was the original student saying he was not provided a function and came to the conclusion the question should be disregarded.

Back to the notes comment above. For last week, the PDF file with notes for the week was 101 pages long. Of these, our teacher wrote 24. The rest were from Edward Neuman at the Southern Illinois University at Carbondale. These notes on MATLAB and Linear Algebra are available for anyone to download and view. They are good notes and I would recommend them. However, when the majority of notes for a week and the homework are straight from someone else concerns about a teacher should rightly develop. I am a fan of citing more knowledgeable people when possible, but this goes too far. As I said before, I don't think my teacher is into teaching.

I will not let the fact my teachers are less than stellar interfere with my own effort and learning. I still have to work hard and understand everything as well as I can. Learning is my responsibility, teachers are only there to help me.

In light of my 13 day post hiatus and the content of this post, there is something I should say. I have never used academic responsibilities as an excuse for my lack of blogging and I will not start now.

Tuesday, April 13, 2010

Movies on the big screen and graphing on my computer screen

I think I set a new record for seeing movies in theaters. In six days last week I saw four movies.
  • Monday She's out of my League When I first saw the trailer for this movie I knew if I saw it it would be because I was watching it with Larry.

  • Tuesday The Book of Eli This was at the dollar theater. They have a special where movies on Tuesday night are half price; the ticket only cost one dollar.

  • Friday Shutter Island We saw it at The Block and ate Krispy Kreme Doughnuts afterward.

  • Saturday Date Night This most recent release on the list is also the least impressive. Afterwards, the In-N-Out on Bristol was frequented which reminded me of high school.
This all started because my friend Larry said he wanted to do some things and the best we could come up with was seeing movies. Since his quarter at UCI (our quarter at UCI now that I am taking classes through extension) just started, he wanted to hang out and do fun things before the work piled up. I saw the first three movies with him and some other people while the last one was with Aden and Dave.

Graphing in MATLAB
On Sunday my first MATLAB assignment was due. One of the questions ended up with this as an answer.
MATLAB mesh graph

Launch of the Labels
A few days ago I decided to start using labels for my posts. After adding labels to many of my older writings and changing the layout of the posts to display their labels, I had no success. After searching for solutions, I found one that said to click "Revert widget templates to default" in Layout> Edit HTML. I had to click it a couple of times, but now the labels are up and running.

There are two divergent approaches to take to tags (or labels as Blogger calls them).
  1. Tag as many different topics as possible. This means an author will come up with new tags all the time even if they are only used in one or two posts.

  2. Only create tags for large groups of posts. This means posts will have vaguely descriptive tags, but when a reader looks at all the posts under a specific tag he will find things he might like but would have never searched for directly.
Tags can be used in either extreme or somewhere between these two views. I think tags are only useful when they connect a reader with other posts that might be of interest. For example, I could go tag happy and list the name of every movie I mentioned in this post (4), the places I ate (2), my new record (1), UCI class (1), MATLAB (1), programing (1), graphing (1), my thoughts on blogs (1), and even a tag about tags (1) for good measure. However, I do not see myself mentioning some of the tags (the 4 movies or the record) ever again. What I do say about some of the other topics (like MATLAB, programming, and graphing) is so tangential it offers nothing a person would ever want to seek out. Of the 13 tags I just listed, over half of them would be dead ends.

Tagging anything and everything possible reminds me of people in high school (1 more tag for high school) who would highlight most of the lines in their textbooks. Overusing highlighting or tagging undermines its purpose in calling attention to important things.

If you have not figured it out by now, I favor the minimalist approach on tags.

Friday, April 9, 2010

Anteaters and the Matrix Laboratory

I have a question for you. Why are these anteaters happy?

Happy UCI Anteaters

Their names (left to right) are Giant, Zot, Peter, and Ants.

These anteaters are happy because last week I started taking a class at the University of California, Irvine through their extension program. The class is MATLAB for Engineers. It is the first in a series of classes I am taking toward a certificate in Digital Signal Processing (DSP) Systems Engineering. This certificate program is different from a masters degree program. There is no application process. I simply sign up for the classes and start taking them. As a member of the Cal Alumni Association I get 10% off one class a quarter; these savings pay for more than half of my lifetime membership dues.

This first class I am taking covers the computer language MATLAB, which is short for matrix laboratory. The syntax is designed to make linear algebra and matrix related calculations quickly. My exposure to MATLAB was summed up in my introductory forum post for the class
Hello everyone,

My name is Chris and I have a little experience with MATLAB. I used it to measure nanoparticle movements and compute their velocities. The program had been written by someone else and I never had a need to modify or understand the code.

I am currently seeking employment and taking this class so I can understand any MATLAB programs I come across in the future.
In my short use of MATLAB so far it is a great language. I wish I knew it when I was taking linear algebra for the first time.