2012년 10월 17일 수요일

Formatting Mnemosyne Flash Cards - Indenting Code Snippets

To help me memorize Python syntax and built-in functions for 6.00x Introduction to Computer Science and Programming, I've created some flashcards using Mnemosyne, the open-source flashcard program that uses an adaptive learning algorithm to determine how often to quiz you on certain cards (mnemosyne is available in the Debian repo's).

One problem is that regular text in flashcards cannot be indented. I've made several cards that contain snippets of Python code, but all the code indentation disappears after saving (which is problematic since Python determines nesting through indentation rather than with brackets). Fortunately, Mnemosyne supports HTML tags which can be used for formatting. Although HTML doesn't directly display tabs, enclosing the entire code fragment in the tags <pre></pre> will allow you to use indentation.

2012년 9월 11일 화요일

JS: 오른쪽 마우스 클릭 차단 그만! 쫀쫀하게...

Tistory나 네이버 블로그 등 국내 사이트들이 콘텍스트 메뉴(oncontextmenu) 차단 자바 스크립트를 애용합니다. 이런 짓거리들은 사용자에게 큰 불편을 줍니다. 대부분의 사용자들은 무단복사나 표절을 하려고 하는 것도 아니고 흑심 품은자들은 아래와 같은 허접한 자바 스크립트를 쉽게 무효화 시킬 수도 있다.

(대부분의) 한국 블로그 '페이지 소스'를   크롬이나 파이폭스의 '개발자도구'로 살펴보면 아래와 같은 악덕한 자바 스크립트가 등장합니다:

그럼 해결책은 무엇입니까? 세가지 입니다.

1) 파이폭스에서 about:config에 들어가서 dom.event.contextmenu.enabled를 필터 검색하고 'false'으로 설정 되어있으면 더블클릭 해서 'true'로 바꾸기. 그 후로 오른 쪽 클릭이나 텍스트 선택이 다 됩니다.

2) 유저 스크립트 엔진을 설치하고 블로그 텍스트 복사 차단을 해제하는 자바스크립트 실행하기

옛날에 파이폭스 부가 기능 Greasemonkey 패키지가 유행이었는데 이제 구글 크롬에서 네이티브 유저스크립트를 지원하니까 구지 Greasemonkey나 Scriptish를 설치할 필요가 없다. 'DogBird' 자바스크립트를 무효화 시키는 좋은 유저스립트는 'AntiDisabler'입니다.

3) 크롬이나 파이어폭스에서 '개발자 도구'를 열고 페이지 소스내에 복사하고 싶은 텍스트를 추출하기 (크롬 개발자 도구에서 그림 파일 경로까지 노오니까 쉽게 복사할 수 있음).

결국 '콘텐츠 보호' JS는 아무를 돕지 못합니다. 컨텐츠 퍼가고자 하는 사람들이 어차피 퍼갈테고 보통사용자에게만 해를 끼칩니다. 제발 더 이상 오리지랄 No!
From Blogger 사진

Korean Linux Distros - AnNyung Linux & Asianux

search on Distrowatch for Korean linux distros returns 7 results, 5 of which have been discontinued. Of the two that are still active, one is AnNyung Linux, a localized Korean distro based on RedHat/CentOS 6 while the other is Asianux. Ticketmonster Korea (which was acquired by Living Social of the US one year ago) runs AnNyung Linux exclusively on its servers.

I remember back in 2005, the Korean word-processing software company Hancom came out with 'Asianux,' a Korean-localized version of RedHat, but that never really went anywhere. It was an outgrowth of previously discontinued efforts represented by Haansoft Linux (2004) and  Hancom Linux (2002). Hancom doesn't really get open-source (it tried to charge business end-users of the 2 distros above), and even the .hwp binary file format for its word-processing files was closed until 2010 (but still many file streams in .hwp remain undocumented. There is a github project called pyhwp that is also available through pip, that is trying to reverse-engineer the .hwp format, however). I tried to download the latest v4 release of Asianux, but the page 404's after the images to download have been selected.

IMHO, Korea should follow the lead of Japanese and Chinese-community re-spins of popular and user-friendly distros like Ubuntu and Debian. Prime examples are the popular Deepin Linux (based on Ubuntu) created by Chinese users and Vine Linux (based on Debian Testing) created by Japanese users, both of which are active projects with recent releases in July and September 2012. Maybe I should use Remastersys to create my own localized Korean re-spin of either Ubuntu or Debian...it would be the first non-RedHat Korean localized linux in history!

2012년 9월 10일 월요일

Bought a new Samsung SSD 128GB SATA III-- in America!

Samsung Electronics is a Korean company. I live in Korea. So it would have been much more convenient for me to buy a Samsung SSD in Korea (and more environmentally-friendly, too, as the SSD wouldn't have had to make a useless round-trip across the Pacific) rather than in the US. Then what made me buy the Samsung MZ-7PC128 (image front, back) from Amazon USA? Let me digress for a moment-- You probably know that Korean chaebols make popular export products like cars, flat-screen TV's, washing machines, laptop computers, DDR2/DDR3 memory chips, flash memory, camcorders, etc. Their prices are pretty reasonable, too, especially in major export markets like the US.

But for domestic Korean consumers, the prices of consumer electronics like smartphones, SSD's, notebook computers, tablets, etc. are anywhere from 30~100% higher than the same products overseas. In the case of automobiles, although the prices of domestic and export models are similar, their features differ markedly. For example, a Hyundai Genesis sedan selling for $40,000 in the US will sell for a comparable amount in S. Korea, but it won't have standard features like passenger-side airbags that are in the export model. I've also heard rumors that the steel sheeting used in domestic Korean cars is thinner than that used in export models.

So back to my SSD shopping experience...About a month ago, I was looking to buy a 128GB Samsung SSD in Korea. I found one, originally for W150,000 (which is about $133, although searching Auction Korea today I found the price has fallen to W138,360, apprx. $122.50). But you can imagine my dismay when I found that the exact same model was selling on Amazon for just $100 with free shipping within the US! So I asked a buddy of mine in the States to ship the Samsung SSD to me after getting it from Amazon. As the SSD is feather-light, my buddy mailed it via USPS airpak envelope-- total cost: $8.46. There are no Korean import duties for purchases valued under W150,000, so I paid $100 + $8.46 = $108.46 for a Samsung SSD 128 GB SATA III drive that would have originally cost me $133 in Korea. I saved $24.54, although I had to wait 7 days for the package to arrive in Seoul, Korea. Were the 18.45% savings worth it? Well, without shipping, I would've saved ($133-100)/133 = 24.8%, but it was still worth it to save almost $25. I'm sick of getting shafted by terrible domestic prices for Korean electronics.

This is one reason why all the laptops I've bought in S. Korea are non-Korean: ASUS, Acer, DELL, and Toshiba. Samsung and LG can count on loyal consumers blindly "buying Korean" which annoys me to no end even though I'm Korean, too... End of rant!


2012년 4월 1일 일요일

Manually upgrading Adobe Flash in Debian Linux

A couple of weeks ago after upgrading Chromium from 15.0.x to 16.0, Chromium complained of an 'outdated'  Flash plugin. I thought that Chrome/Chromium came with its own version of Flash integrated with the browser, but perhaps that's only for Windows? Anyways, we went to the Adobe site for Korea and downloaded the latest flash tarball (they don't offer .deb package files, although they do have .rpm and .yum packages). We then extracted just libflashplayer.so and copied it to the following 2 locations:
/usr/lib/mozilla/plugins
/usr/lib/iceweasel/plugins (this applies if you happen to have firefox/iceweasel installed)

After installation, you can check what version of flash you have installed by visiting Adobe's flash test page. The Debian repositories also has a package called flashplayer-mozilla that installs flashplayer, but the most recent version available in Debian Testing is flash 11.1.102.63-0 vs. 11.2.xxx available as a binary download from Adobe.