Ed's Big Plans

Biology, Computing, Adventure

Archive for April, 2010

MAMP Solution: “Access denied for user ‘root’@’localhost’”

without comments

Thanks to Josee for writing up the full symptoms here.

Brief Symptoms

After upgrading MAMP and changing the root password, the MAMP GUI reports an error 1045. This amounts to the binary “/Applications/MAMP/Library/bin/mysqlcheck” being unable to connect to the MySQL DB since the password has changed.

This solution is related only to the GUI, and not the PHP files in phpMyAdmin, I assume your PHP already have your changed passwords.

(Note, while Josee upgraded from 1.7.2 to 1.8.4, I upgraded from 1.7.2 to 1.9 — we both report that this fix works for our current versions.)

Solution

Go into “/Applications/MAMP/bin” (or substitute whatever path you have to the equivalent directory).

Notice that there are plenty of “.sh” bash script files in this directory– at least one of them is causing the error; to be safe, we will edit every file that refers to the root password. The following script files call the binary “Library/bin/mysqlcheck” change the “-proot” argument to “-p<password>” where “<password>” is your password, save your changes:

checkMysql.sh
quickCheckMysqlUpgrade.sh
repairMysql.sh

The following script calls the binary “Library/bin/mysql_upgrade” make the same change, save.

upgradeMysql.sh

The following script calls the binary “Library/bin/mysqladmin” make the same changes, save.

stopMysql.sh

Quit MAMP and restart it– the error should be gone.

Notes

The following script calls the binary “Library/bin/mysql_safe” and does not specify a password, no need to touch this file at all.

startMysql.sh

I actually started to solve this problem by making use of the error message– it’s reported that the binary “Library/bin/mysqlcheck” couldn’t check the database– so, I literally searched for that string in the MAMP folder– after I discovered the first three files had to be edited, I looked for the string “-proot” to figure out if there were any other files that needed editing.

That’s all! Enjoy!

Written by Eddie Ma

April 27th, 2010 at 11:37 am

Posted in Website Management

Tagged with , ,

The Journalist: A Minimalist’s WordPress Theme

without comments

Brief: I’ve switched to “The Journalist” by Lucian E. Marin to combat the nagging page weight of more decorative WordPress themes. This should make loading my page far quicker. Ideally, I’d like to have it load as quickly as SnOwy, my wiki notebook. When I get some spare time, I’ll add my logo to the title region of this page– don’t worry (he says to himself), I’ll optimize the file size for that as well.

Update: I’ve made the modifications I always do — Inline comments now appear on both the main and archive-like pages, and search results are trimmed as excerpts.

Inline comments

Added the following div after the the div class=”main” and before the div class=”meta group” — changes made to index.php and archive.php.

<div class="recent-comment">
<?php $comment_array = get_approved_comments($wp_query->post->ID); ?>
<?php if ($comment_array) {  ?>
    <?php foreach($comment_array as $comment){ ?>
        <div style="background-color: #f6f6f6; border-top: 1px #bbb solid;">
        <strong><?php comment_author_link(); ?> says...</strong>
        </div><div style="padding: 10px 0px 10px 0px;">
        <?php comment_text(); ?>
        </div>
    <?php } ?>
<?php } ?>
</div>

Excerpts in search results

Changed a call to “the_content()” to a call to “the_excerpt()” — changes made to search.php.

Written by Eddie Ma

April 23rd, 2010 at 11:25 am

Posted in Website Management

Tagged with

The Computational Bio & Chem Group (SOLVER Revisited)

without comments

A Revisitation

In the beginnings of the Winter semester, I had an idea to start up a undergraduate/graduate student group that would provide a scaffold for faster, computer assisted research.

The semester was simply too full for me to try and get it running at that time. I’m tempted to do some work on it later this semester, after I’ve gotten more of my thesis done.

The basic idea is as follows. Faculty and graduate students in the biology and chemistry departments often have the need to analyze data with some elegant computing. Whether this be as commonplace as hacking together an excel sheet to do work or learning some existing toolbox, or something slightly more in depth such as analysis in R, Python or PERL. Unfortunately, these research problems often fall by the wayside as the time commitment to learn a new software package or programming language is not trivial without a stronger computing background. Undergraduate students who are raised in the computer science environment, particularly with a bioinformatics interest have some knowledge of the research problem semantics as well as some knowledge of how to do the above analysis by using and coding software.

The “SOLVER” group would fill the gap by performing a matchmaking and coaching service. In my vision, SOLVER creates working teams of three to four– (1) one or two graduate students or faculty with a research problem, (2) one or two undergraduate students with some knowledge in bio / chem and some talent in computing, (3) an experienced coach that can recommend best practices so that the team has a good shot of solve the problem in a reasonable amount of time. In the end, the researcher gets help and a good chance at a working solution– they might even learn some programming; educational / professional / social connections are made; and the student gets an item to add to their resume. In reality, a particular research step would be executed as week-long blocks– whether this means one block or four blocks (one month) depends on the complexity of the task.

To do…

One stretch of work that I have to do is to determine the needs of the department. I wanted to do this in the middle of Winter semester but didn’t find it a priority. For this group to work, there must be research problems. Similarly, I need to determine the capabilities of potential undergraduate students. I’m learning quickly that the key here is to start small and think big (i.e. start with one group, then two, then learn about the administrative logistics, then deploy some progress tracking mechanism, then four groups and onward).

Retuning the image

The almost idealized description above suffers from a few logistical issues. First, I will now address the issue of publication credits. Because researchers must attribute tangible work (including written code and analyses), some graduate students may be hesitant to participate in the program. I don’t know if this will actually become a barrier however as a “tangible contributor” would never be the first nor the last name on a paper (this is true in all CS, Bio and Chem). Furthermore, a paper with more than one author demonstrates the ability to collaborate in a team, and fostering the experience of another student is part of our culture (e.g. co-op students etc.). That brings me to a second major issue. One of the frames that this group could find itself in is a means to circumvent or short-circuit the co-op student appointment process– a frame that I readily reject. In fact, I should hope that this group becomes a means to introduce new putative co-op students to their future advisers which may otherwise be overlooked for their differing background. Finally, there is the problem of attrition, whereby a group dwindles in size as members drop out. The only contract-based perks or penalties I can think of is really ties to the group itself (e.g. unsatisfactory work naturally results in a time out or withdrawal from the program). It is really the only tangible leverage we can offer at the outset– unsteady leverage at best (difficult to assume a reputation when none has yet been built).

Going forward

More research has to be done in terms of polling and documenting the needs of the department. Furthermore, a deeper understanding about the kinds of students we’d attract and want to appoint is needed– this allows us to understand what time commitment is reasonable (both the lower and upper limits need definition). Finally, the group must from the outset be understood as something beneficial to all parties involved. The solutions named above must be deployed at launch time to ensure minimal friction, and maximum return. First steps were made last year by introducing this idea at the BIC-iGEM meeting– BIC students are excited with this idea, wherein an entire room of a dozen students raised their hands. Furthermore, there are no other groups on campus that attempt this activity, so that SOLVER would provide a unique non-conflicted service.

Of course– this all depends on the amount of work I get done on my own thesis in the first half of the semester.

Making friends

As an aside Isabelle Lam, a student I TA’d last semester in Biol-241 (microbio) has been planning on starting a job / volunteer / coop mine for science students. I should go and bother her and see how far she’s gotten. Her project is called “SPORE”. Last I checked, her team was registering a subdomain with the university.

EDIT: I previously confused Isabelle with Lisa– this has been corrected.

Written by Eddie Ma

April 20th, 2010 at 10:08 am

Gak! Always test your site with Google Chrome.

without comments

Brief: There was a typo in my custom text box where put my photo. I closed a link tag with “/href” instead of “/a”– the error is automagically rendered away by the latest Firefox and Safari, but not by the latest Chrome (which means that it’s a fix that occurs somewhere before the rendering engine that it shares with Safari). That doesn’t mean that Chrome should be more tolerant– it probably actually means that Firefox and Safari should be more diagnostic :P

Conclusion: Always test your site with Google Chrome– it’ll incorrectly-correctly display missing tags. You can imagine how beneficial this is for hot-generated pages from WordPress :D

Written by Eddie Ma

April 16th, 2010 at 9:46 am

Posted in Web Programming

Tagged with ,

You win again, mystery prankster! Re: QR Codes on Campus

with 3 comments

Brief: Posters have been appearing all over campus with QR-codes on them– Since I didn’t readily have software on my cellphone that could handle decoding them, I snapped a photo and proceeded to search for software online. The photo is an example of one of the posters stuck up at the William G. Davis Computer Research Centre (DC) at U Waterloo– particularly, this one was stuck on a doorway that leads to Chemistry II on the third floor.

The posters feature a QR (“Quick Response”) Code with an explanation below in the form of a URL to a wiki page for anyone who doesn’t know what a QR code is. The specifications are owned by Denso of Japan– but the company has decided to let anyone use it without any kind of fee… in order to actually view the specification however, a fee must be paid to ISO.

A QR code can encode a variable number of characters with some redundancy to allow for dirt, corruption and other artifacts, this particular shot was decoded with the Java project, Open Source QR Code Library hosted by source forge… After copying the image to Tin from my cell phone, I did this…

Tin:qrcode eddiema$ java -cp classes:lib/qrcode.jar\
    example.QRCodeDecoderCUIExample res/Photo0347.jpg
http://www.youtube.com/watch?v=dQw4w9WgXcQ
[Success] res/Photo0347.jpg
Processed 1 images in 914ms (914 images/sec)
OK: 1 NG: 0
Tin:qrcode eddiema$

And lo and beharold, I was treated to a surprise… what could that URL possibly be? More clues to a longer treasure hunt? Some strange political protest? No, no– the mystery pranksters had something better in store for me.

Yes, I’ve been had. A belated April Fools no doubt :D

Cheers, Mystery Prankster. I tip my hat to you.

Matt says...

It’s a rickroll, isn’t it? *Checking Google, please wait* …ahaha it totally is!

Nice find. Nerd pranks make me all warm and fuzzy inside. (On the other hand, if it were a strange political protest it would have been SO MUCH AWESOME.)

Eddie Ma says...

Matt! You weren’t supposed to actually say what it was– that kills the effect :P Incidentally, I never noticed the error in the calculated number of images processed per second by the Open Source QR code… 1 image in 914ms is roughly one image per second … yikes.

Mat says...

Whoops, my bad. The best part is I didn’t even click through to the video, because I’m too accustomed to use the highlight-right-click-search-in-google feature in Firefox so I just got a bunch results about… that thing which I have already spoiled but will endeavour not to ruin doubly by repeating here.

I hadn’t noticed that bug either, but now that you mention it, that’s quite odd. It probably has a one line fix, assuming someone just mixed up variable names. And a one second delay for QR’s not too bad, but if you want to do something involving realtime tracking, that’s what ARToolkit is for.

PS: On second thought, who am I kidding? Of course I want to ruin your rickroll, you darn rickrolling rickroller.

Written by Eddie Ma

April 7th, 2010 at 2:27 pm