If you've ever wondered about the minimum number of bits needed to encode a particular message, check this out:
Tuesday, July 9, 2013
Wednesday, June 26, 2013
Use git from Matlab
For those of you who are fans of both Matlab and git, you'll really like the following project: https://github.com/slayton/matlab-git (Matlab File Exchange page: http://www.mathworks.com/matlabcentral/fileexchange/38600-git-matlab).
Simply put git.m somewhere in your path and now you can use standard git commands (e.g. status, commit, pull, push) right from the Matlab terminal. I have personally found this quite handy.
Simply put git.m somewhere in your path and now you can use standard git commands (e.g. status, commit, pull, push) right from the Matlab terminal. I have personally found this quite handy.
Wednesday, June 19, 2013
Latest Java update (1.6.0_51 released on June 19, 2013) breaks Matlab
Today I updated Java on my Mac (running OS 10.8) to 1.6.0_51 which unfortunately broke my Matlab (R2010b) installation: I could open the application but I couldn't interact with the GUI in any way. It seems many other people have had this issue and I wanted to endorse the solution I used:
Author: http://www.mathworks.com/matlabcentral/answers/contributors/4383739-julien-aubert
If you find this useful, please visit the source link and upvote Julien's answer.
For anyone who's curious or concerned, Pacifist is just a shareware (free trial) tool to let you install older versions of applications, bypassing any "safeguards" Mac OS has in place. The whole process was simple, easy, and much faster than Googling for other options (which I also did).
I found this workaround, should work until Apple/Mathworks issues a patch:
Download the Apple Java SE 2013-003 update (no longer on the Apple website but I found this link:http://apple-java-for-mac.en.softonic.com/mac/download)
Then download and install Pacifist http://www.charlessoft.com
Use Pacifist to open the Apple Java package and install using the install option of Pacifist.
Your Java SE should be downgraded to where it was prior to applying the 2013-004 patch. This worked for me, matlab is functional again.
JSource: http://www.mathworks.com/matlabcentral/answers/79489-java-1-6-0_51-breaks-matlab-2012b-and-below
Author: http://www.mathworks.com/matlabcentral/answers/contributors/4383739-julien-aubert
If you find this useful, please visit the source link and upvote Julien's answer.
For anyone who's curious or concerned, Pacifist is just a shareware (free trial) tool to let you install older versions of applications, bypassing any "safeguards" Mac OS has in place. The whole process was simple, easy, and much faster than Googling for other options (which I also did).
Saturday, February 11, 2012
Sunset underneath the Golden Gate Bridge
Like last year, I went to photograph the sun set behind the Golden Gate Bridge. I went to the Berkeley marina because it was at sea level and at the angle (see the end of this post for details).
The clouds were beautiful:
The sun set perfectly behind the bridge:
All in all, it was beautiful:
I went back today but it was too foggy so I walked out on the pier instead...
... and caught a couple shots of Berkeley:
To anyone looking to capture shots involving the precise position of celestial bodies, I highly recommend The Photographer's Ephemeris (free for desktop download, paid iPhone and Android apps).
The clouds were beautiful:
The sun set perfectly behind the bridge:
I went back today but it was too foggy so I walked out on the pier instead...
... and caught a couple shots of Berkeley:
Saturday, January 14, 2012
How to restore Picasa albums
I really love using Picasa to edit and organize my photos. It has a fantastic set of features for editing as well as sharing. However, I had some issues when I moved some photos from my internal hard drive to my external hard drive: the albums created from these pictures disappeared. I had spent a lot of time making these albums so I was determined to find a way to restore them.
Picasa keeps backups of old albums, so at first I tried just copying the backup files into the "current albums" folder. However, Picasa seems to be too smart for such a simple hack and would undo all of my work immediately. I Googled many times trying to find a solution that would work but none were 100% correct. After combining the tricks I read about, I discovered the following solution.
Edit: it seems as though Picasa has changed the way it stores albums starting with build 3.9.0.522 which was released on December 8, 2011. You can read their release notes here but essentially it looks like they'll be storing album information in the same picasa.ini files that they already used to store photo edits. Hopefully this post is soon useless!
Edit: it seems as though Picasa has changed the way it stores albums starting with build 3.9.0.522 which was released on December 8, 2011. You can read their release notes here but essentially it looks like they'll be storing album information in the same picasa.ini files that they already used to store photo edits. Hopefully this post is soon useless!
- Mac OS 10.5.8
- Picasa 3.8.9 (not the newest version)
How to restore your "missing" albums:
- Locate your "missing" albums.
- I found mine in [home folder]/Library/Application Support/Google/Picasa3/Picasa3Albums/backup/[date]
- Identify your missing albums.
- Open each album file (it ends in ".pal") in a program such as MacVim.
- You should be able to spot the title of the album around line 7 or 8, as shown in the picture below (power users see the script at the end of this post to automate this process):

Locating the album title in the .pal file - If this is one of the missing albums, follow step 3 and then return to this step for each subsequent album.
- Note: do not use TextEdit -- it automatically saves extra information that you don't want and will cause this process to fail.
- If you're using Windows, you might try something like Notepad++ instead of MacVim.
- Copy the "missing" album to a new folder (in case you mess something up).
- If your album is missing because you moved your pictures without telling Picasa, you'll need to use this file to point to the correct files. Do this by editing the "filename" entries; one is highlighted in the picture below:
- Create a "backup" of your existing albums using "Tools -> Back Up Pictures"
- Click "New Set"
- Make sure you use "Disk-to-disk backup"
- Choose a location you can easily find again (we'll call this the "backup folder" from now on)
- Make sure you click "Select none" so you're actually not backing up any picture files
- If the "Backup" button won't light up, try selecting then deselecting an album
- Go into the backup folder and then open the folder. $Library/Application Support/Google/Picasa3/Picasa3Albums/
- Open up the only folder within (it should be a weird mash-up of letters and numbers). Put your edited "missing" album files into this folder.
- Go to the Picasa3 folder (in [home folder]/Library/Application Support/Google/Picasa3/) and rename it something like "Picasa3 BACKUP". If you ever need to undo the steps in this tutorial, delete the Picasa3 folder that will be created in future steps and rename your backup folder back to "Picasa3".
- Go to Applications/Picasa, right-click and choose "Show Package Contents". This lets you see hidden parts of the application.
- In the new window that pops up, go to the folder Contents/Resources/cdautorun/ and double-click "Picasa Restore.app"
- The window that pops up looks like an error, but don't worry about it. Instead, choose "Open Manifest..." and choose "PicasaManifest.xml" in your backup folder
- Now start up Picasa again and let it search for all of your photos again. When it finishes, all of your albums should be back!
![]() |
| Changing the album's knowledge of the path (location) of your files in the .pal file. |
Did this work for you? If not, what went wrong?
Power users:
I created a little shell script to automate the process of finding the album titles. Here it is:
#!/bin/bash/
for f in *.pal
do
echo "Processing $f"
head -7 $f | tail -2
echo ""
done
Note that you'll have to store it outside of your Picasa3 folder since Picasa tends to wipe out any unrecognized files. Run it from within the albums folder (the one with all of the .pal files).
Labels:
picasa
Tuesday, May 17, 2011
Instant, cheap heat
I'm one of those people that's cold even in warm weather. Rather than constantly running up the heating bills, I make use of a flax bag. You only need to pop it into the microwave for a few minutes and it's warm for at least an hour. In fact, since the flax seed inside has a high heat capacity, even using an un-microwaved flax bag is equivalent to an extra blanket. They're certainly much cheaper (and more satisfying) than heating the whole space to 80 degrees!
I've been fortunate enough to have received flax bags for Christmas and so I've never had to buy my own. However, I'm told you can buy them at farmer's markets (~$20) or make them at home (some suggest using rice or other materials). I've also seen a few commercial versions. Do you have any good sources or tips on making your own?
| Source: http://www.f-r-chiro.com/images/100_0942.JPG |
| Source: http://www.massagesantarosa.com/assets/HTPimages/BlueBeachMed-heating-pad.gif |
I've been fortunate enough to have received flax bags for Christmas and so I've never had to buy my own. However, I'm told you can buy them at farmer's markets (~$20) or make them at home (some suggest using rice or other materials). I've also seen a few commercial versions. Do you have any good sources or tips on making your own?
Version control for the time-limited
I often keep many versions of the same file around in case I decide later that I needed some little paragraph or code snippet. It's also very useful to be able to see under which set of code a particular set of data was generated (e.g. "did I fix the bug before or after I made this data?"). Thus, I was looking for some version control software to help me out.
I won't claim that this is the best version control software out there, but it works well for me. I use Git as a backend (read more about it on Wikipedia if you'd like -- Linus Torvolds started it) and SmartGit as my user interface. It allows me to commit changes with comments or revert to old versions. I can also see the differences between versions and track file history (branches, etc.).
As your next step, you can check out some of the screenshots I've posted below (stolen from SmartGit's screenshots page) or read another review.
I won't claim that this is the best version control software out there, but it works well for me. I use Git as a backend (read more about it on Wikipedia if you'd like -- Linus Torvolds started it) and SmartGit as my user interface. It allows me to commit changes with comments or revert to old versions. I can also see the differences between versions and track file history (branches, etc.).
As your next step, you can check out some of the screenshots I've posted below (stolen from SmartGit's screenshots page) or read another review.
| Directory and file list |
| Graphical change log |
| Differences between two files |
Friday, March 25, 2011
Control the look and feel of Gmail with Minimalist
Yesterday I found a great Chrome extension for Gmail called Minimalist. It allows you to change almost anything in the Gmail interface. To give you a quick idea of the difference it can make, here are some images from their page in the Chrome web store:
~ in Matlab: not just for NOT
When reading Steve's article on the irregular behavior of Matlab's size() function, I was reminded of a neat trick.
Frequently I call a function and only use one or two of its output arguments. In many cases I use the first couple of output arguments, but occasionally I want to use, say, only the second output argument. If I assign the first output to some variable, I now have a meaningless variable floating around, taking up space, and potentially causing problems. A much more elegant solution is to call the function like this:
If you'd like, you can read articles on the same topic by Matlab geniuses Loren and Steve.
Frequently I call a function and only use one or two of its output arguments. In many cases I use the first couple of output arguments, but occasionally I want to use, say, only the second output argument. If I assign the first output to some variable, I now have a meaningless variable floating around, taking up space, and potentially causing problems. A much more elegant solution is to call the function like this:
[~, output] = myFunction(input);In this way, the first output argument disappears while the second is saved to the variable output.
If you'd like, you can read articles on the same topic by Matlab geniuses Loren and Steve.
Matlab subplot
I often use Matlab's subplot function to plot multiple things in one figure, like this:
However, I recently discovered that you can have them span multiple rows or columns:
Note: all figures shamelessly stolen from http://www.mathworks.com/help/techdoc/ref/subplot.html, Matlab's subplot documentation.
LyX
I've been using LaTeX for years and although I got used to doing my own formatting, it was clunky. I'd only use it if I was writing a final draft for homework or a paper, never for just jotting down notes. However, a friend of mine introduced me to LyX a few months ago and now I'm hooked.
LyX is a WYSIWYG ("what you see is what you get") editor: it auto-compiles most things for you so you don't have to wonder how it will look when you're done. This includes
Using LyX is so quick, easy, and painless that now I use it to write notes to myself and document my projects. LyX combines the simplicity of a regular text editor with the beauty of LaTeX.
Here's a screenshot I stole from Wikipedia:
LyX is a WYSIWYG ("what you see is what you get") editor: it auto-compiles most things for you so you don't have to wonder how it will look when you're done. This includes
- text formatting (size, weight, font, etc.)
- figures (auto-preview)
- equations (auto-render/preview)
- tables (auto-preview)
Using LyX is so quick, easy, and painless that now I use it to write notes to myself and document my projects. LyX combines the simplicity of a regular text editor with the beauty of LaTeX.
Here's a screenshot I stole from Wikipedia:
In the interest of honesty, I have found a few limitations which I consider noteworthy:
- Every now and then, somethings happens in my document and I'm unable to use certain functions. For example, one document all of a sudden stopped letting me use \int in the LyX auto-render math mode but would let me use it in the LyX "LaTeX code" mode. I'm still not sure what's going on here or how to fix it... (update: if you're having trouble with using \int and it says that \iint is being redefined, check out this thread).
- Although you can add to the source code using the "LaTeX code" mode (ctrl+L), I haven't yet found a way to edit the automatically generated code. Of course you can view the code, copy it into your second-favorite LaTeX editor, and proceed but that's quite clunky.
Monday, February 28, 2011
Best Gmail extension: Boomerang
Does your inbox ever fill up with emails that you know you won't respond to for at least another week? If you archive them, you'll just forget to ever write them. Even if you stick them in a special "open me on ..." folder, you're unlikely to attend to them.
Do you ever want to delay sending a message by a few minutes? A few hours? A few weeks?
What if you send an email and want to make sure you're reminded about it if no one responds?
If you have ever had any of the problems above or are just plain curious, you should try Boomerang for Gmail. It's an extension available for Firefox or Chrome and I highly recommend it. You can read their FAQ here or download it here.
Do you ever want to delay sending a message by a few minutes? A few hours? A few weeks?
What if you send an email and want to make sure you're reminded about it if no one responds?
If you have ever had any of the problems above or are just plain curious, you should try Boomerang for Gmail. It's an extension available for Firefox or Chrome and I highly recommend it. You can read their FAQ here or download it here.
Something of that Ilk
I've discovered a new webcomic, Something of that Ilk. Here are a few of my favorites so far:
Link to original
Becoming an adult is realizing that you're still a child, but you can have as many cardboard boxes as you want. |
Link to original
Personal record: 8.53 seconds. |
...You really can't have any typos. |
Sunday, February 20, 2011
Finite Simple Group
I rediscovered this hilariously nerdy video today.
Friday, February 18, 2011
Creative and beautiful pictures, delicious treats, and a MATLAB puzzle
Ordinary objects come to life
Take a look around the world from above
These red velvet cake balls look delicious!
And finally, how this blog is created (follow the link for the full-size comic and hovertext):
Take a look around the world from above
These red velvet cake balls look delicious!
MATLAB puzzle (solutions at link):
if (BLANK) disp('I Love ') else disp('MATLAB') endWhat can replace BLANK to get the print-out (exactly): I Love MATLAB
And finally, how this blog is created (follow the link for the full-size comic and hovertext):
Monday, February 14, 2011
Childhood and new technology
Childhood: Then and Now is an interesting read discussing two different styles of parenting. I've often wondered if today's children are over-pampered to the point where it will hinder them later.
NoteSlate looks like a neat new tablet alternative. It seems to be akin to the new e-book readers but used for writing instead. And at $99, it's not nearly as expensive as a regular tablet.
Finally, a pretty image (I didn't take it):
NoteSlate looks like a neat new tablet alternative. It seems to be akin to the new e-book readers but used for writing instead. And at $99, it's not nearly as expensive as a regular tablet.
Finally, a pretty image (I didn't take it):
Sunday, February 13, 2011
Sunset behind the Golden Gate Bridge
I went up the hills behind the UC Berkeley campus on Friday with some friends
to photograph the sun setting behind the Golden Gate Bridge.
I went up again today and, although it was cloudy, managed to get this shot:
Matlab publish()
The publish command is great because it lets me compile the output of a Matlab script into an HTML (or .doc, .ppt, .pdf, etc.) file that is nicely formatted. This way I don’t need to run the script again to get a quick reminder of what it did! I also use it to show results to my adviser. Learn more about it here.
First post
Who am I?
- Graduate student at UC Berkeley: EECS (electrical engineering and computer science) major working specifically on cognitive radio (more on this later)
- Born and raised in the midwest, in Oregon for high school, and now in California
- Traveled to Europe three times, mostly in Germany and Spain
My reasons for writing:
- I’m currently putting off doing research
- Some friends of mine have been writing interesting blogs and it looks like fun
- As a way to collect some of the interesting things I see on the Internet and want to share with people
What do I like?
- The Internet: randomly browsing websites, connecting with people, and learning new facts and skills
- The outdoors: camping, hiking, biking
- Photography: mostly nature scenes or animals but sometimes pictures of people as well
- Languages: English is my native language. Spanish and German are my second and third languages, respectively, and I can usually hold a reasonable conversation in either (though I’m a bit rusty — anyone want to practice?).
- Programming: it’s just fun! C and MATLAB are my favorite languages but assembly and PHP are also enjoyable. I’ve had the most fun programming a microprocessor for senior design and coding for my current research project.
What’s this blog going to be about?
I’m not sure, but here are some things that might end up in future posts:
- Cool MATLAB functions
- Random links to neat stuff I found on the Internet
- Pictures I’ve taken
- Research ramblings
Subscribe to:
Comments (Atom)
