Tech

Self-overclock-cpu, Core i7

in

Last Saturday, I attended the Intel Blogger Day and had a chance to see the Intel roadmap. At first, Intel introduced the new processor they’ve announced recently, Core i7. It contains numerous of technology to ensure everyone that Intel is the leader in this market; 45nm, QuickPath, and Turbo Mode. Since I haven’t interested to CPU technology for a really long time. I have no idea about these new technologies so I didn’t think I would have a question about this, at least until the speaker had presented about Intel Turbo mode.

Intel Turbo mode is something like the intelligent CPU frequency adjusting system. If your quad-core CPU knows that you’re using the CPU at 1 - 2 cores, it mights turn off the idle core in exchange of some frequency gain on the rest. For example, your 3.2 GHz quad-core CPU may turns itself into 3.4 ~ 3.6 GHz dual core CPU. The overall performance will be higher. In some circumstances, it can pushes itself a little without turning off the other core to gain another bit of performance gain.

Then my question arose, I asked the speaker why Intel don’t just make it in turbo mode all the time. I can remember when I was a hild, I always made my computer in the turbo mode. He answered me that because making the CPU runs in turbo mode consumes too much energy, generate too much heat and it will cost me a lot. So I replied him swiftly, “I can afford the energy cost. Then why?”. “It won’t meet the design specification”, he explained. I expected something more technically so this answer didn’t satisfy me but I stopped to ask for more information or I would be able to buy any Intel products. :P

Picture from PC Perspective.

After some googling, I found out how Turbo mode works and why Intel makes i7 be in the Turbo mode for just a short moment. The speaker was right. Firstly, It turns off some idle cores to give energy to the working cores instead so all cores cannot run in “Turbo State” consequently. Secondly, Turbo mode works like overclocking. Therefore, it cannot run in that state too long or it burns. Lastly, making all cores work in Turbo mode drains much more energy. And that amount is higher than that stated in the spec.

My question is answered. But new question arises, why doesn’t he explain this technically?

New Birdnest Features: Callback and username stripout in Replies timeline

in

Today announcement for #birdnest, 2 new features roll out, callback parameter support and stripping out the username at the front of tweet.

Callback parameter

Requested by @iake right after #barcampbangkok2.

When supply Twitter API with a parameter called “callback”, Twitter sends back the JSON result enclosed in a function you specified with callback parameter. It’s useful for creating javascript widget but #birdnest cannot handle these result and doesn’t filter the unnecessary information out. The new #birdnest can recognize this callback function and can filter the unwanted data out.

Stripping out the username at the front of tweet

Request by @bact.

Why put @username in front of every reply tweets in reply timeline especially those who have a very long name. Let #birdnest strips it out for you. Don’t worry #birdnest doesn’t touch your name when it is on you friends timeline or public timeline.

JSON-Only Features

These feature are available only on JSON and I don’t think there are many XML format user. If you are, please tell me. I’ll try to make it for you. What? Can’t wait? You can do it yourself and send the patch to the project homepage.

Wanna try?

Just point your Twitter gateway to http://nest2.onedd.net/. Notice the gateway name, it’s nest2.onedd.net, not nest.onedd.net. Because I want these features to be tested by all of you first.

As always, all suggestions and bug reports are welcome at the project Google Code page.

Happy Tweeting

Twitter Module

in

วันนี้ @sugree อัปเกรดบล็อกเป็น #drupal 6.0 แล้วก็เลยเห็นว่า Twitter Module มันออกใหม่ พอลงเสร็จก็โฆษณาใน Twitter เสร็จสรรพเลย

ก็เลยพบเหยื่อ สอง คน หลงกลลองลงไปแล้ว

วิธีลงง่ายยังกะปอกกล้วย

  1. ดาวน์โหลดมาจาก Drupal.org
  2. เอาไปไว้ใน /sites/all/modules
  3. เปิดใช้งานในหน้า Modules
  4. ตั้งให้แปลง @ชื่อ กับ #Hashtag ใน Input Format

เรียบร้อย ง่ายๆจริงๆ

Pylons กับ dependencies

in

หลังจากเราสร้าง Project ด้วยคำสั่ง paster กันไปแล้ว ทีนี้ก็มาถึงเรื่องของ dependencies แล้วล่ะ

ใน Pylons ปกติผมเห็นแต่ คน เค้า ใช้ SQLAlchemy กันทีนี้ก็คือถ้าจะลงก็ใช้ easy_install ได้

easy_install SQLAlchemy

ทดลองด้วยการเรียกใช้ Interactive Python Shell แล้วพิมพ์ตาม ต้องได้ผลตามนี้

>import sqlalchemy
>sqlalchemy.__version__
‘0.5.0beta3’

ทีนี้ก็ใช้งาน SQLAlchemy ได้แล้วล่ะ

แต่เดี๋ยวก่อน ถ้าเกิดเราไม่รู้ว่าต้องลงอะไรบ้างล่ะ เช่นตอนที่สร้าง project เราเลือกใช้ template อื่นนอกจาก Mako เช่น Jinja เราก็จะต้องมาลง Jinja ด้วย แต่ช้าก่อนถ้าเราลองสั่ง paster ดู จะได้ผลลัพธ์ดังนี้

Traceback (most recent call last):
File “/home/wien/bin/paster”, line 8, in
load_entry_point(‘PasteScript==1.6.3’, ‘console_scripts’, ‘paster’)()
File “/home/wien/py-lib/PasteScript-1.6.3-py2.5.egg/paste/script/command.py”, line 68, in run
commands = get_commands()
File “/home/wien/py-lib/PasteScript-1.6.3-py2.5.egg/paste/script/command.py”, line 110, in get_commands
plugins = pluginlib.resolve_plugins(plugins)
File “/home/wien/py-lib/PasteScript-1.6.3-py2.5.egg/paste/script/pluginlib.py”, line 81, in resolve_plugins
pkg_resources.require(plugin)
File “/usr/lib/python2.5/site-packages/pkg_resources.py”, line 626, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/lib/python2.5/site-packages/pkg_resources.py”, line 524, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: Jinja: Not Found for: hello (did you run python setup.py develop?)

เอ๊ะ มันทะแม่งๆแฮะ มาบ่นว่า Jinja ไม่มีไม่พอ มีการท้าทายว่า ได้ลองเรียก python setup.py develop รึยัง ท้าแบบนี้มีหรือจะไม่ลอง

[wien@localhost]$ python setup.py develop
Processing dependencies for hello==0.1dev
Searching for Jinja
Reading http://www.pylonshq.com/download/
Reading http://pypi.python.org/simple/Jinja/
Reading http://wsgiarea.pocoo.org/jinja/
Reading http://jinja.pocoo.org/
Best match: Jinja 1.2
Downloading http://pypi.python.org/packages/source/J/Jinja/Jinja-1.2.tar.gz#md5=1235a005ade00b213800ff1e798c0241
Processing Jinja-1.2.tar.gz
Running Jinja-1.2/setup.py -q bdist_egg —dist-dir /tmp/easy_install-HQeuAp/Jinja-1.2/egg-dist-tmp-fgE5yD
Adding Jinja 1.2 to easy-install.pth file

อ่าวเฮ้ย มีท่านี้ด้วย เด็ดจริงๆ เลยเป็นความรู้ว่า ใช้ท่า python setup.py develop เพื่อลง dependencies ได้ด้วย ตรงนี้ยังไม่รู้ว่ามันจะเอามาใช้ตอน deploy ได้รึเปล่า แต่เดาว่ามันน่าจะใช้ได้ล่ะ ใครลองแล้ววานบอก

ด้วยรักและไพลอนส์66