技术宅,fat-man

增加语言的了解程度可以避免写出愚蠢的代码

导航

2013年5月14日 #

awk的模块化方案,在这公司苦逼很久以后想到的

摘要: test.sh#!/bin/shecho demos | igawk -f test.awktest.awk#!/usr/bin/igawk -f@include common.awk{ filename = $0 makeArray(filename,array) printArray(array) makeInsertSQL("aaa",array,"test.sql")}common.awkfunction sayHello(s,_ARGVEND_){ print "hello "s}function makeArray(fil 阅读全文

posted @ 2013-05-14 20:15 codestyle 阅读(468) 评论(6) 推荐(0)

go:数组

摘要: package mainimport "fmt"import "unsafe"type Employee struct{name string; age int} func displayName(e *Employee){ fmt.Printf("employee name is %s ,age is %d\n",(*e).name,(*e).age)}func main() { var e = [2]Employee{{"shujun.li",30},{"qiuming.tan",30}} 阅读全文

posted @ 2013-05-14 12:26 codestyle 阅读(167) 评论(0) 推荐(0)

go:指针初步

摘要: package mainimport "fmt"type Employee struct{name string; age int} func displayName(e *Employee){ fmt.Printf("employee name is %s ,age is\n",(*e).name)}func main() { var e1 Employee e1.name = "shujun.li" e1.age = 30 displayName(&e1) e2 := Employee{"tan qiu ming 阅读全文

posted @ 2013-05-14 12:15 codestyle 阅读(159) 评论(0) 推荐(0)