Tuesday, February 27, 2007

Coding day's for fun

this code was inspired from people in forum when ask me an algorithm. this is an implementation from the algorithm. It's only for fun and for wasting a time. also to learn programming language. I hope this's not the last.

Bash script version
-------------------
start here
-------------------
#!/bin/bash
echo -n "Your input: "; read input
let temp=$input/2
let temp=$temp+1
let count=0
let i=1
echo $temp
while ((i<=input))
do
let j=1
let left=1
let right=$input
if [[ $i -le $temp ]]; then
let count=$count+1
elif [[ $i -gt $temp ]]; then
let count=$count-1
fi

while ((j<=input))
do
if [[ $left -le $count ]]; then
echo -n "$left "
elif [[ $right -le $count ]]; then
echo -n "$right "
else
echo -n "$count "
fi
let left=$left+1
let right=$right-1
let j=$j+1
done
let i=$i+1;
echo ""
done

C Version
---------------
Start here
---------------
#filename: funcode.c
int main ()
{
int input, temp=0, count=0;
int i,j,left,right;

printf ("Your input: ");scanf("%d",&input);
printf ("
Dimention: %d \n",input);
temp=(input/2) + 1;
printf("temp: %d \n",temp);

for (i=1; i<=input; i++)
{
j=1;
left=1;
right=input;

if (i <= temp)
count++;
else if (i> temp)
count--;

for (j=1; j<=input; j++)
{
if (left <= count)
printf("%d ",left);
else if (right <= count)
printf("%d ",right);
else
printf("%d ",count);
left++;
right--;
}
printf("\n");
}
return 0;
}

An output is here:
mine@unique:~$ ./funcode
Your input: 5
Dimention: 5
temp: 3
1 1 1 1 1
1 2 2 2 1
1 2 3 2 1
1 2 2 2 1
1 1 1 1 1
mine@unique:~$

Sunday, February 25, 2007

Linux Community Against Steven Balmer's Claim

This is from Steven Balmer's claim that linux violates Microsoft's intellectual property. Linux Community response and against this claim with make a petition that Microsoft should show the windows code that Linux has violated it.
Linux Community do it, with launch a site that contain an open letter to Steven Balmer whom make the claim again and again.
On this petition also, Linux Community calling out all Linux Developer and Open Source leader also developers for any Linux distribution or any company that feels threatened by Microsoft non-existent lawsuits.

read more...

Thursday, February 15, 2007

Setup lilo into partition's superblock and load it from grub

I already have grub installed on MBR of harddisk. It's come from my ubuntu linux. Then I installing slackware and want to use slackware's lilo to load the slackware system. First, I install lilo into superblock of slackware's partition using this command:
lilo -b /dev/hda2

note:
Slackware partition is on hda2, maybe it is different with yours, depends on your system placed in harddisk (including position of disk controller and partition). In my case, I use PATA harddisk which set as primary on controller 0. And my slackware system is on second partition.

Second, edit grub's
configuration file (menu.lst). Usually in /boot/grub/menu.lst. And then add this entry:
title Slackware Lilo
root (hd0,4) #for example, if your slackware partition in /dev/hda5
chainloader +1

Now, restart the system.

hope this helpful.

Wednesday, February 7, 2007

Slackware 12.0 is released

A new slackware version has released now, after waiting for a long time. there is an issues before a release date, that said a release version would jump directly in major number without passing a minor one. A mistery question has asnwered. An issue became a surprise for me, that slackware has released into version 12.0. Maybe this is an unusual habit from a developer team.

I'm really curious what a great change was happen. Then I start to find out into README.TXT's file first, if there is an explanation for this question. There are only some info about major components inside slackware 12.0 which are only a new version from major components of slackware 11.0. Here are the componets's version:
- Linux kernel 2.6.21.5
- C compiler gcc-4.1.2
- Binutils 2.17.50.0.17
- GNU C Library glibc-2.5
- X Window System X11R7.2.0 from X.Org.
- KDE 3.5.7
- Xfce 4.4.1

But This is really surprising me, when I read a RELEASE_NOTES's file. Here are a qoute from that file:

About the only things to mention here are that Slackware now requires a recent 2.6.x kernel (I believe 2.6.18 is a minimum), but as usual unless your needs are specific you're probably better off running the included kernels that we've tested things against. The best kernel to run (even on a one CPU/core machine) is the generic SMP one, but that needs an initrd, so be sure to read the instructions in /boot after installing with a huge* kernel if you plan to switch. Since the initrd has been around since Slackware 11.0, hopefully most
Slackware users can take on this task easily and will not be "shocked and appalled".

Yeah, developer team decide to use kernel version 2.6 as default instead of 2.4 that usually being default from a release version before. I think this is a big changes that cause developer to jump a release version direct to major number. Also hotplug as device manager before has replaced with udev.

Another changes are completely documented in Changelog.txt's file and also in ANNOUNCE.12_0's file. As usual, it's time for upgrading system. If you would like to upgrade the system don't forget to read CHANGES_AND_HINTS.TXT's file. There are enough explanation and completes guide for upgrading system from 11.0 inside that file.

Happy slacking! :-)