Blueberries!

Posted by Quinn at August 27th, 2006 12:14pm under hearts, Japan 0 Comments Permalink

Blueberries Yes, they are blueberries! We live in the mountain and suppose this place is good for rasing blueberries. Our relatives living in the same town have blueberry farm. One day, our kids and my wife went early in the morning to harvest them and this was the result.

I remember blueberry muffines are very common to see in California ( not here in Japan ), though I don't recall seeing fresh ones. I first met those fresh blueberries and the trees when I moved here in Kumamoto. I think it's kind of ironic since blueberries are not Japan native.

I like living in the rural part of Japan since we have more oppertunities to get these ripe farm products and even some plants from nature. I think, coming from this kind of experiences, we have more appreciation to the nature, seasons, and our own lives.

Which OS?

Posted by Quinn at August 22nd, 2006 10:40pm under OpenSource 0 Comments Permalink

I am in the middle of setting up Gentoo on my PC laptop. It was taking over 6 hours compiling gnome. Oh man, this is looong. I've been using FreeBSD for my servers ( including this blog ). While FreeBSD isn't so good for desktop use, in my opinion, I thought Gentoo would be good for many uses, like desktop client, developer, server, etc.. Anyways, I made a list of open source OSes that I should give a try and some already gave a try. I wonder if anyone can tell me which one is for what and so.

I am very happy with FreeBSD as my server use. Debian is easy to use and fairly good in many way. Somehow, I don't like much of Fedra Core. I think it's good using SELinux as default and binary packages are mostly in good shape. I think it's probably too easy to use. ( Is this a compliment, a complaint or what? ) I am going to have fun to try them all!

PC-BSD
FreeBSD http://www.freebsd.org
NetBSD http://www.netbsd.org
OpenBSD http://www.openbsd.org
DragonFlyBSD http://www.dragonflybsd.org
Linux
Debian http://www.debian.org
Fedra Core http://fedora.redhat.com
Slackware http://www.slackware.com
Gentoo http://www.gentoo.org
openSUSE http://en.opensuse.org
Ubuntu http://www.ubuntu.com
UNIX
OpenSolaris http://www.opensolaris.org
Japanese Distro
Vine Linux http://www.vinelinux.org
Plamo Linux http://www.linet.gr.jp/~kojima/Plamo/
TOMOYO Linux http://tomoyo.sourceforge.jp

Block visibility in Drupal

Posted by Quinn at August 17th, 2006 11:38am under web 0 Comments Permalink

If you wonder how to control visibiliy of the blocks in Drupal, and especially at the front page of the website, you might want to continue reading this. Otherwise, it's probably boring.

I am using Drupal for the project I am developing at this moment. I wanted the front page to be unique as the most websites out there, I suppose. I thought built-in features in Drupal would give me easy to configure a block to be shown at only the front page. But it didn't. at least, not the way I planned.

Environment: Drupal 4.7.3 with MySQL and Apache

Drupal has admin -> block section to configure blocks individually. At the page to configure a sigle block, there is a section under “Page specific visibility settings”. I thought I just have to put

<front>

in there and everything would be fine.

Well, this surely makes the block to be shown at the front page but also paged front page too. This is not something I had in mind. This kind of configuration might work in many cases but not every time though.

Then, I chose to use “Show if the following PHP code returns TRUE” and PHP code to control the block visibility. What I came to at the first is like below.

<?php
$thisisthefrontpage = FALSE;
if(($_SERVER["REQUEST_URI"] == '/')
 ){
	$thisisthefrontpage = TRUE;
}
return $thisisthefrontpage;
?>

Then, I found another little thing that pager link will give the first page to be this url.

http://mywebsite/node

This page shows only the list of nodes and not the block I want to show in the front page. I first thought this is not the big deal, but then I figured this probably confuse many people who are using this website. I think the url in the above should show the page exactly the same as the front page. So, I changed the block configurations again like below.

<?php
$thisisthefrontpage = FALSE;
if(($_SERVER["REQUEST_URI"] == '/')
  || ($_SERVER["REQUEST_URI"] == '/node')
){
	$thisisthefrontpage = TRUE;
}
return $thisisthefrontpage;
?>

I think this is not really good coding. I wanted to do like

  || ($is_font && !is_numeric($_REQUEST["page"]))

or something like that. But none of them actually worked. I don't know why. Anyway, this is what I came to as the solution at this moment. It may work for you too when you come to similar situations. It would be nice to hear suggestions if you have something in mind. Thanks for reading.

References:

Simple Math

Posted by Quinn at August 16th, 2006 9:33am under web 0 Comments Permalink

simple math question I had to add a tweak in my blog since I was still getting spammed after the previous modifications. This is sad because it's forcing good people to do an additional task for posting. A simple math question is required to answer for posting a comment now. The question says like "Please add 7 and 8. Then, put the number here » [textbox]. I am not sure this sounds right. It's somehow harder to say simple sentences, especially when it comes to math. I went to college in the USA but I don't remember much of the math classes. So whoever come to see this as funny English in some way, please let me know it. Thanks.