Tuesday, October 31, 2006
Friday, October 27, 2006
Tuesday, October 24, 2006
Monday, October 23, 2006
Sunday, October 22, 2006
Hash Tables2
The solution for implementing the HashTable class
See also
p143-145, B. Kernighan, D. Ritchie, The C Programming Language Second Edition, Prentice Hall.
See also
p143-145, B. Kernighan, D. Ritchie, The C Programming Language Second Edition, Prentice Hall.
Saturday, October 21, 2006
Tuesday, October 17, 2006
SSH on DSL ( Linux )
Right click on the desktop -> Choose System ->Daemons -> ssh -> start
on the server
then
Type
from client.
on the server
then
Type
% slogin 192.168.*.*
from client.
Monday, October 16, 2006
MenuTest3 ( Python )
Messy code here.
This is my first 'class' in Python.
The output is the same as MenuTest1 + MenuTest2.
%python test3.py ( input_file ) ( output_file )
(example)
%python test3.py test.csv test.h
This is my first 'class' in Python.
The output is the same as MenuTest1 + MenuTest2.
%python test3.py ( input_file ) ( output_file )
(example)
%python test3.py test.csv test.h
%cat test3.py
#! /usr/bin/env python
import re
import os, sys
input_file = sys.argv[ 1 ]
output_file = sys.argv[ 2 ]
class MenuConverter:
def setInputFile( self, fileName ):
self.readFrom = fileName
def setOutputFile( self, fileName ):
self.writeTo = fileName
def writeStrToFile( self, str ):
output = sys.stdout
output = open( self.writeTo, 'w' )
output.write( str )
def setMenuId( self ):
buf = ""
pre = """enum MenuId {"""
post = """TOTALIDS \n};\n\n"""
file = open( self.readFrom )
text = file.read()
buf = re.sub( "[^\w]+", ",\n\tmnu", text )
buf = pre + buf[ 1: ] + post
return buf
def setExeId( self ):
pre = """enum MenuExeId\n{\n\tmnux"""
post = """};\n\n"""
buf = ""
result = []
for line in open( self.readFrom ).readlines():
line = line.replace( '"', "" ).split( "," )
result = result + line[ -1: ]
buf = ''.join( result )
buf = pre + re.sub( "\n(?=.\w)", ",\n\tmnux", buf ) + post
return buf
x = MenuConverter()
x.setInputFile( input_file )
x.setOutputFile( output_file )
x.writeStrToFile( x.setMenuId() + x.setExeId() )
Sunday, October 15, 2006
MenuTest2 ( Python )
%cat test2.py
#! /usr/bin/env python
import re
pre = """enum MenuExeId\n{\n\tmnux"""
post = """};"""
buf = ""
result = []
for line in open( 'test.csv' ).readlines():
line = line.replace( '"', "" ).split( "," )
result = result + line[ -1: ]
buf = ''.join( result )
buf = pre + re.sub( "\n(?=.\w)", ",\n\tmnux", buf ) + post
print buf
%python test2.py
enum MenuExeId
{
mnuxStart
mnuxStop
mnuxReset
mnuxCounts
mnuxStorage
mnuxSettings
mnuxGPS
mnuxAccel
mnuxFilter
};
I used string -> list -> string this time.
MenuTest1 ( Python )
This topic is for my Embedded Systems course at school.
Synopsis:
Make a test code for getting the menu names from .csv file by using Python and save them for the definitions in .h.
1. Make a list by using spreadsheets such as Excel. In this case, I used NeoOffice.
2. Export the file as .csv.
Synopsis:
Make a test code for getting the menu names from .csv file by using Python and save them for the definitions in .h.
1. Make a list by using spreadsheets such as Excel. In this case, I used NeoOffice.
2. Export the file as .csv.
%cat test.csv
"Greet","Execute","Start"
,,"Stop",
,,"Reset"
,"Status","Counts"
,,"Storage"
,,"Settings"
,,"GPS"
,,"Accel"
,"Setup","Filter"
%cat test.py
#! /usr/bin/env python
import re
file = open('test.csv')
text = file.read()
buf = ""
top = """enum MenuId {\n"""
bottom = """TOTALIDS \n};"""
buf = re.sub( "[^\w]+", ",\n\tmnu", text )
buf = top + buf[ 1: ] + bottom
print buf
%python test.py
enum MenuId {
mnuGreet,
mnuExecute,
mnuStart,
mnuStop,
mnuReset,
mnuStatus,
mnuCounts,
mnuStorage,
mnuSettings,
mnuGPS,
mnuAccel,
mnuSetup,
mnuFilter,
mnuTOTALIDS
};
Monday, October 9, 2006
Sunday, October 8, 2006
Ubiquitous?
ubiquitous computing
- the current trend of using computer technology in every aspect of our lives
Today we speak of ubiquitous computing, meaning that computer technology is everywhere and affects almost every aspect of our lives.
( p618, J. Satzinger, R. Jackson, S. Burd, SYSTEMS ANALYSIS & DESIGN, Thompson course technology )
『明らかな誤用」認定されている"ubiquitous society"という表現は『デジタル音楽の行方』に登場する
Saturday, October 7, 2006
GCC on Damn Small Linux with my old laptop ( Linux )
Damn Small Linux
cfdisk
Install
I am using a pcmcia called "IO DATA ETXPCM", but my DSL does't configure this devise.
So,
1. Check the property of this devise by using cardctl command.
2. Add below in /etc/pcmcia/config
3. Commnet out all "manfid 0x0149, 0xc1ab" in /etc/pcmcia/config
4. Reboot.
http://vine.ic.sci.yamaguchi-u.ac.jp/8/msg00361.html
5. Install GCC
5.1. right click-Apps-Tools-MyDSL Extension Browser
5.2. click System button
5.3. choose gcc1.dsl.info and click download
5.4. gcc is downloaded and installed automatically
cfdisk
Install
I am using a pcmcia called "IO DATA ETXPCM", but my DSL does't configure this devise.
So,
1. Check the property of this devise by using cardctl command.
%cardctl ident
Socket 0:
product info: "IO DATA", "ETXPCM", "3.0", "AX88190"
manfid: 0x0149, 0xc1ab
function: 6 (network)
2. Add below in /etc/pcmcia/config
card "IO DATA EXT-PCM"
version "IO DATA", "ETXPCM", "*", "AX88190"
#manfid 0x0149, 0xc1ab
bind "axnet_cs"
3. Commnet out all "manfid 0x0149, 0xc1ab" in /etc/pcmcia/config
4. Reboot.
http://vine.ic.sci.yamaguchi-u.ac.jp/8/msg00361.html
5. Install GCC
5.1. right click-Apps-Tools-MyDSL Extension Browser
5.2. click System button
5.3. choose gcc1.dsl.info and click download
5.4. gcc is downloaded and installed automatically
Tuesday, October 3, 2006
Miller's Number
The rule of 7 +- 2 (also known as Miller's Number) derives from psychology research, which shows that the number of informaiton "chunks" that a person can remember and manipulate at one time varies between five and nine. A larger number of chunks causes information overload. Information chunks can be many things, including names, words in a list, digits, or components of a picture.
( p215, J. Satzinger, R. Jackson, S. Burd, Systems Analysis & Design in a changing world, Thompson )
Monday, October 2, 2006
Subscribe to:
Posts (Atom)