三月 4, 2009
» 微軟: HideTaiwan()

http://msdn.microsoft.com/en-us/library/ms441219.aspx

SPUtility.HideTaiwan Method (Microsoft.SharePoint.Utilities)

Dim spWeb As SPWeb
Dim localeId As Integer
Dim returnValue As Boolean

returnValue = SPUtility.HideTaiwan(spWeb, localeId)

Parameters

spWeb

An SPWeb object that specifies the Web site.

localeId

A 32-bit integer that specifies a locale ID.


Return Value
true if the Taiwan calendar is hidden; otherwise, false. By default, this method returns true and the Taiwan calendar cannot be displayed for the following SPLangId values: PeoplesRepublicofChina, HongKongSAR, and MacaoSAR.

不小心逛到這個

微軟真強 連台灣都可以Hide() ...

三月 24, 2008

hoamon's sandbox
hoamon
hoamon's sandbox is about »

tag cloud

» How to connect MS SQL Server with Python in the Linux OS?

Basically, the general method is using ODBC Interface. In the Unix environment, we can use unixODBC library, but i had tried in failure.

So... another method is using hard core TDS protocol of Sybase Server. because MicroSoft buy the MSSQL server source code from Sybase, so they use the same protocol. maybe there are some difference between the servers. but i could not found it as far.

and i wanted using Python to program, so the requirement is below here:

  • freetds(http://www.freetds.org/): TDS protocol library written in C
  • python-sybase(http://www.freetds.org/userguide/python.htm): python interface for controll freetds library
  • python-devel (using in compile python-sybase)
Installation in Ubuntu is so easy, try apt-get install python-devel first. and then install freetds and python-sybase. command is below here:

# tar -zxf freetds.tgz

# cd freetds

# ./configure --prefix=/usr/local/freetds

# make

# sudo make install

# tar -zxf python-sybase.0.37.tgz #PS i try 0.37, because 0.38 is having something wrong in my server

# cd python-sybase.0.37

# sudo python setup.py install

OK! installation is done!

try the freetds library is OK!

# /usr/local/freetds/bin/tsql -H {ServerIP} -p 1433 -U {Username} -P {Password}

> EXEC sp_databases

> go

this 『EXEC sp_databases』 command will show the all databases that this {Username} can read.

> use testdb

> EXEC sp_tables

> go

this 『EXEC sp_tables』 command will show the all tables of testdb.

> EXEC sp_columns @table_name = 'users'

> go

this 『EXEC sp_columns @table_name = 'users'』 command will show the all fields of table 'users'.

if everything seen OK! you can try Sybase module in the python interpreter.

# SYBASE=/usr/local/freetds CFLAGS="-DHAVE_FREETDS" LD_LIBRARY_PATH=/usr/local/freetds/lib /usr/bin/python
 1 import Sybase

2 class DictCursor(Sybase.Cursor):

3 def row2dict(self, row):

4 d = {}

5 for i,elt in enumerate(row):

6 d[self.description[i][0]] = elt

7 return d

8 def fetchall(self):

9 rows = Sybase.Cursor.fetchall(self)

10 result = []

11 for row in rows:

12 result.append(self.row2dict(row))

13 return result

14 def fetchone(self):

15 return row2dict(Sybase.Cursor.fetchone(self))

16 def fetchmany(self):

17 rows = Sybase.Cursor.fetchmany(self)

18 result = []

19 for row in rows:

20 result.append(self.row2dict(row))

21 return result

22 class Connection(Sybase.Connection):

23 def dictcursor(self):

24 return DictCursor(self)

25 db = Connection(ip:port, account, password, dbname)

26 c = db.dictcursor()

27 sql = "select * from sometable"

28 c.execute(sql)

29 rows = c.fetchall()

30 for row in rows:

31 for k, v in row.items():

32 print k, v

33 print 'done'
OK! this is real done!

二月 25, 2008

hoamon's sandbox
hoamon
hoamon's sandbox is about »

tag cloud

» 我看MicroSoft 併購 Yahoo!

我十分希望 MS 能真的買下 Yahoo! ,但應該還要讓 MS 再多花點錢來買,或許等 Yahoo! 把廣告業務批給 Google 後,再賣給 MS 會更好。

理由如下:

  1. 網路世界留下兩強即可
  2. 我不喜歡 MS 和 Yahoo!
  3. MS 會失去世界第一的光采

第一點: 就像民主黨與共和黨一樣,兩元化的世界比較簡單。就像 Un*x 與 Windows 一樣,你爭我奪就夠,如果還有個「他」來湊一腳,會比較礙眼。

第二點: MS 就不提了, Yahoo! 令我討厭的原因,就在於它的購物平台沒 PChome 方便, Email 服務技術不如 Google ,雖然我用了 YUI 函式庫,不過,目前也想換成 Jquery 了。總之, Yahoo! 技術沒一項獨強,該被淘汰吧!兩者放在一起,我就只須要討厭一個就行,「小小」併購就讓我心頭上少一塊贅肉,令人大快。

第三點: MS 併下 Yahoo! 後,必然有陣痛期,兩家公司員工本來就不是同流的,且你看看,會有多少台 FreeBSD 會被換成 Windows 2003 Server 呢! 想到這點,我就開心, MS 的工程人員必須花相當大的內耗才能把兩家公司的炮火集中,而在這之前, Google 不知道又可以跑多少了。就算 N 年後, MS 併 Yahoo! 的效益浮現,但我可預期的是,在浮現之前, Google 已能奪下資訊服務的寶座。

延伸閱讀:
下面這篇文章則是以 MS 的角度來看的,它也是認為 MS 併下 Yahoo! ,其實是對 MS 不利的。
http://www.zdnet.com.tw/news/software/0,2000085678,20127763,00.htm?feed=RSS:+ZDNet+Taiwan%3A+%B7s%BBD+-+%B3%CC%AA%F1%A4C%A4%D1

一月 26, 2008
» IE6即將走入歷史

消息來自:Microsoft to Force IE7 Update on February 12th

Microsoft終於決定要消滅IE6了,這對於常常在跟IE與眾不同的CSS bug和DOM奮鬥的網頁/程式設計師來說真是天大的好消息。(喔,還有終於可以放心用透明png了!)

為了讓世界更好,還在用IE6的人快升級吧~~~

五月 5, 2007
» [link] Microsoft needs Wizards

http://groups.google.com/group/net.jobs/msg/4f2cf440919eeda9

a mail in 1984...

"""
I consider Microsoft an excellent home for the software wizard because:

1) its a great place to work. The company is owned (a key issue)
and operated by software wizards: Bill Gates and Paul Allen.

....

Since the development people report strictly to software
engineers, who report directly to chairman/CEO Gates, we
never do anything stupid because some manager/MBA/suit-type
has power without knowledge. (When we do something stupid,
its our own fault!) Likewise, there are no "politics", just
engineering.

"""

(save-buzz-and-die "/WhatYouSeeIsWhatPeopleMarketing" :executable t)

biggo.com.tw

A Django site.