Tuesday, March 24, 2015

Where is Python in Solaris Studio 12.4 ?

I've been using Solaris Studio for quite some time and it is newly installed in my new Lenovo G40-SID. It was surprising that yesterday I noticed its different appearance compared to 12.2 version. Moreover, no more Python plugin is there! After reading here and there, I found Python plugin is no longer supported by Netbeans (the parent of Solaris Studio).

In order to enable Python plugin into Solaris Studio, I downloaded the Python plugin for Netbeans from here. After downloading and extracting the package, I opened my solaris from terminal.

$solstudio &

From Solaris Studio, go to "TOOLS" and then "PLUGINS" and from the plugins dialog, click on "DOWNLOADED" tab.



And then, point to the extracted folder of Python Netbeans Plugins and select all plugins and the install them.


Done !

Wednesday, July 9, 2014

Python User-wide Installation on CPanel Platform

Objective:

To run a python script with Numpy and Scipy from a web server hosted on a CPanel Hosting Provider.

Problem:

1. CPanel is using Python 2.6.6, hence older version of Numpy and Scipy installed do not agree with the previously developed program under Python 2.7.x and newer Numpy and Scipy.
2. Web hosting does not allow system-wide upgrade of the Python because this upgrade will affect the operating system's certain functions.

Proposed Approached:

User-wide installation of Python and other supporting libraries

Limitation:

User must be allowed to make secure shell connection to the server in order to install

Installation Procedures:

1. Download Python
    mkdir ~/python
cd ~/python
wget http://www.python.org/ftp/python/2.7.x/Python-2.7.x.tgz
tar zxfv Python-2.7.x.tgz
find ~/python -type d | xargs chmod 0755
cd Python-2.7.x

2. Install Python
./configure --prefix=$HOME/python
make
make install

3. Modify the Environment
    vi ~/.bashrc
Add this line at the end of the file: 
export PATH=$HOME/python/Python-2.7.x/:$PATH
source ~/.bashrc

4. Add Apache Handlers on User's CPanel control panel
cgi-scripts .py

5. Testing
vi tes.py
#!/home/username/python/Python-2.7.x/bin/python
import cgi
import cgitb
print "Content-type: text/html\n\n"
cgitb.enable()
print "Hello, world!\n"
print "<p>"
import sys
print "Python version is ",sys.version

note: /home/username is user home directory on CPanel

6. Check the result
http://luq.unila.ac.id/tes.py
"
Hello, world!
Python version is 2.7.8 (default, Jul 9 2014, 11:18:17) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
"

7. Install PIP
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py

8. Install Numpy, Scipy, Matplotlib
pip install numpy
pip install scipy
pip install matplotlib

One last thing to remember, do not forget to change file permission to 755 to make it executable. This should be enough :-)

[Update July/14/2014]
Install PYRAMID
pip install --install-option="--prefix=/home/username/python" pyramid

--> Installation OK, however, this line:
server = make_server('0.0.0.0', 80, app)

raised an error --> socket.error: [Errno 13] Permission denied

which is understandable. Pyramid installation is not a success yet.

Sunday, December 29, 2013

My LM1875 Evolution


I've been quite some time away from the DIY world actually, and even decided to give up the idea of building my own sound system. Further, I bought a 2.1 system, an Edifier C3 to be precise, and decided to stop my DIY hobby. Then I started collecting FLAC files from the Internet, listening to some audiophile musics through this nice Edifier C3 which is not bad at all. But the same old nostalgic feeling came across and I started to question my listening experience with Edifier. Later, I started to check my account at diyaudio.com and renew my password since I have long forgotten it. The rest is, you've probably guessed that

On December 29, 2013 the schematic was updated as follows:

A fellow DIYer reminded me to route the blocked DC offset to ground through 22 k resistor from entering IN(+) of the amplifier. Another fellow recommends higher value (470 uF) of NFB-shunt capacitor. A zobel of 10 ohm resistor in series with 100 nF capacitor is installed before the output capacitor (4700 uF) near the speaker terminals. Now this amp plays Deep Purple's Pictures of Home, Duran Duran's Rio and Avenged Sevenfold's This Means War very nice. Treble and bass are just enough. :-D


Saturday, May 11, 2013

Node Ordering (1)

Random matrix of 20 x 20
Maximum number of branches per node is 4



Random matrix of 200 x 200
Maximum number of branches per node is 200


Random matrix of 1000 x 1000
Maximum number of branches per node is 1000



Tuesday, January 15, 2013

Raspberry Pi and OpenELEC. From a not-so-smart TV to a smarter one. :-)

So here I am, getting into this Raspberry Pi world. After reading here and there, I decided to give it a go. I contacted a so-called distributor in Jakarta (not sure if it's an authorized dealer) as I can remember the nearest one is in Singapore. This guy sell Raspberry Pi with a good price as I reckon from various sellers in Indonesia. A friend of mine in Jakarta helped me buying four of them from this store. So I got it now. Well, my motivation initially was trying to implement a "cheap" parallel computing for my spare time (night time as I am a bit busy day time). I encountered a blog page called "My Life with Pi" and inspired by this blog, I thought this might be interesting to try it.

However, my first attempt in using Raspberry Pi was for a home entertainment application. It was because my other friend whom I asked to buy from the Internet before I got a contact of a seller in Jakarta, informed me that my order had arrived at his home. Now there were 5 Raspberry Pis with me and 4 would be configured for a parallel computing application. What about this newly arrived Raspi? Hmmm.... thinking of an entertainment center then I thought it would be a good idea to implement it for a home entertainment center.

After reading some arguments on which XBMC implementations is the best performer (among Raspbmc vs XBian vs OpenELEC), I was convinced that OpenELEC should have its opportunity to serve for my need. Well, I've got a 21" LCD TV by LG which was not so-smart but equipped with a USB port (for maintenance, the manual said and therefore is not capable of reading data from any USB storage) and an HDMI port. I also already got a 2 GB MicroSD+adapter from my old mobile phone including a microUSB cable for charging that good old phone. Lucky me, I could save much of my time building the XBMC by only downloading the already-prepared image from this guy SPARKY0815. I downloaded the 2GB image of Raspberry Pi already configured for OpenELEC.

Following the instruction from ASK UBUNTU, I managed to burn the image to my MicroSD. Here are the commands:
1. Find out which device to burn by checking the change before and after issuing this command
ls -la /dev/sd*

2. Locate where I put the downloaded image, in my case it's here:
/media/DATA/Works/RASPBERRY/OpenELEC\ Image/2GB/OpenELEC-RPi_2GB_SDCARD.img\

3.Issue this command to burn the image onto the SD Memory:
sudo dd if=/media/DATA/Works/RASPBERRY/OpenELEC\ Image/2GB/OpenELEC-RPi_2GB_SDCARD.img\ of=/dev/sdb

Please note the escape "\" was used because we have a space between the words.

After waiting for a while. The burn process is finished and it is ready to install. So I inserted the SD into Raspberry Pi and connect the HDMI and the USB ports on my old LG LCD TV. Switch it on and Raspberry Pi booted. And the CONFLUENCE interface appeared on my screen. What fascinated me more was when I found out that my remote control could be used to interact with the OpenELEC menu. Now I have these devices (my laptop, a Samsung Smart TV and a newly-smarter LG LCD TV) connected through a TCP/IP network at home and share the files through Windows Share (Samba) service.

I also found that my Samsung SmartTV's remote control works better when I connect the OpenELEC to it. But this TV is already smart and no need a knowledge upgrade :-D

Well, my previously not-so-smart TV is now smarter enough by only adding about 500K rupiahs. :-D


Wednesday, May 9, 2012

Upgrading to Ubuntu 12.04? Do you really wanna do that? :-p

Yesterday, I decided to upgrade my Ubuntu 11.10 to Ubuntu 12.04. I just wanted to have a feeling of how it feels. But today I just realised that it was one of my big mistakes (well, I am exaggerating), which costed me one full day of searching and hacking back my system.

The screen shows similar to the following line:
...GLIBC_2.14 not found (required by /lib/libply.so.2)...

After browsing and reading a whole day, I got this recipe:
1. On the prompt line, run this:
# mount -o remount,rw /

2. On the prompt line, run this:
# dpkg --configure -a
Some guys suggested to run this over and over again.

3. I think I also ran this:
# fsck

4. Then I remember that I also ran this:
# apt-get -f install

5. Finishing off and reboot the system. If it asks to fsck the system, just follow the instruction on the screen

6. I think that's all and I got my previous Ubuntu 11.10 back online.

This is my personal note which may not be applicable to the reader's system. :-)

Friday, October 28, 2011

A Yellow Card Story

It happened in September 2008. On a one fine morning, when I checked my mailbox, a yellow card was there. This only meant that a parcel sent by my sister back in home country had arrived. So at 9 am, I brought the card with me and went to Aki-saijyou post office, Higashihiroshima City to claim my parcel.

After waiting in a queue for a couple of minutes, I gave the card to the officer. That's the procedure I learned from my friend when he claimed his parcel. Unfortunately, the parcel was not in the office. I was confused but feeling sorry to see that the officer so worried that my parcel was not found. She took out a number of packages from Indonesia (even some packages from Malaysia!) for my other friends, thinking that they might be for me. Finally, the officer realized that the package was out and explained it. Later she asked me to write what time I would claim my packet. At least, that was what I understood with my very limited Japanese skill. So I wrote down 6 pm to be the time. She took the yellow card and this even confused me more since I did not have any proof in hand to claim the parcel later. I could not explain what I thought in Japanese so I decided to leave it be. Then I left the post office with a feeling of disappointment and confusion.

At 6 pm, I came back to the post office with my wife and daughter and hoped that we could claim the parcel using my Alien Registration Card (外国人登録証明書 - Gaikokujintourokushoumeishou). I was not sure I could do that but that was the only option I had. And as I expected, the post officer was a new person (from the next shift) and I had to explain all from the start. What a nightmare! After struggling with my poor Japanese skill, finally came another officer with good English and asked what happened. Because they were still unable to find my parcel, then they asked me to leave my mobile number with a promise to call me once they found my parcel. So, we left the post office with even more disappointment! We were almost sure that it's already lost and would not reach us. We went home then.

After arriving at home, suddenly my mobile rang and a Japanese greeting on the phone with a familiar voice of a Japanese lady was heard. Fortunately, she quickly switched to English after I replied with my magic words "Eigo de, oneigaishimasu" (English, please). This lady said she was from the post office and she explained that the parcel had been found. She said that when we came to the post office at 6 pm, a postman actually came to our house for delivering the parcel. That happened because I wrote 6 pm as the time of delivery. Oh, God! I thought it was meant to be the time for me to pick up the parcel from the post office. So this lady asked me to wait at home until 9 pm because the postman would come again to deliver the parcel at 9 pm. What a relief! Finally, we received that parcel and said a lot of apologies to the postman. Thanks to Japan Post Office for its super service!