2012. 8. 11.

How to get list sheetlist from excel file.


' It's not difficult but useful.  Especially when there are many sheets in a excel file.


Sub GetAllList()

Dim all As Sheets

Set all = Application.ActiveWorkbook.Sheets

countOfSheets = all.Count   ' count of sheet

For i = 1 To countOfSheets
    ' sheet1 must be added already. 
    ' insert sheet name into row
    Application.Sheets.Item("Sheet1").Cells(i, 1) = all.Item(i).Name
Next i

End Sub

2012. 5. 7.

notice ~ node.js installed in Ubuntu

http://gratdevel.blogspot.com/2010/10/node-nodejs.html

While I was in problem in installing node.js in Ubuntu. I found above article.

Key point is "

DO NOT RUN sudo apt-get install node

"
node is not node.js.  node (in ubuntu) is different packages..

Thanks guys.

---V2
Above document is right and wrong.


I found below in nodejs.org  . It works.

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm

-- Finally  Not worked...    
The problem is the version dependency 

2012. 4. 26.

GoogleDrive launched...

Google launched 'Googledrive'  at last.
It has already many base infrastructures.  I expect that  it will become a new major cloud drive service soon.  Especially the integration of legacy is a very strong feature.

http://drive.google.com ...

I 'v researched some drive services for a while.   I have new one to research. ;)

2012. 4. 22.

python graph, chart library


matplotlib  :
graph library for python  : many kinds of graph , full examples.
http://matplotlib.sourceforge.net/


numpy :
numeric library for python
http://scipy.org/Numpy_Example_List_With_Doc

2012. 3. 18.

erlang compile with other module.

If you make your own modules.  You want to use them.
You can use 'import' command as you expected.

-import(modulename, function_name).

but sometimes you will meet  'some errors'.

If your code is as below.


 -import(mod1, [get/1]).

When you compile, you will meet error


 import directive overrides pre R14 auto-imported BIF get/1
 - use "-compile({no_auto_import,[get/1]})." to resolve name clash 

Yes, you muse add  line 

-compile({no_auto_import,[get/1]}).
 -import(mod1, [get/1]).


2012. 3. 12.

simple compile erlang

I read that  I must use 'c' to compile in erlang. but I met error 'write error'.
I  am googling and then  I know that I must change directory with 'cd' command.
It is simple. but before I found it  It was stress to statr to learn the erlang.



c("modulefilename").   % sometimes you will meet error ' writing error'


%% method 1: you need to change working directory.

cd("pathname"). %%  which includes module file
c("modulefilename").

%% method 2  

c("modulename", [{outdir, "output directory .."}]).  %% you can assign output directory option  by {outdir, "..."} .

2012. 2. 22.

install python into user home

mkdir /home/iam/.targetdir
cd Python-2.7
make clean
./configure --prefix=/home/iam/.targetdir
make
make install
check.
/home/iam/.targetdir/bin/python2.7

You must change first line.
#!/home/iam/.targetdir/bin/python2.7

2012. 2. 16.

How to install google_api_lib when you have no root right.

How to  install google_api_lib when you have no root right.

python ./setup.py install --home=~


This command install lib in your home directory


==> ~lib/python

2012. 1. 16.

extract list from XML (xmldom) in python


data ="
 aaa
 bbb
 ccc
 ddd
 eee
"


from xml.dom.minidom import parse, parseString

#data is xml formatted string 

dom3 = parseString( data )   #make dom object
tagList = dom3.getElementsByTagName("tag1")  #select list "tag1"

txt = tagList[0].firstChild.nodeValue  #first node->txtNode->nodeValue
print txt

===result==========
aaa

How to clear console in python


# # Screen clear 
# You can use it when you make  a console type.

import os
if os.name == "posix":
   os.system('clear')   # not MS-series
elif os.name in ("nt", "dos", "ce"):
   os.system('CLS')   #  MS-series --> DOS/Windows

2012. 1. 13.

python formating datetime


from datetime import datetime
dt = datetime.now()
print dt.strftime("%Y.%m.%d %H.%M.%S")

#  output #
2012.01.13 00.03.01

2012. 1. 8.