横浜市のPM2.5速報値をつぶやくTwitterボットを作成

横浜市環境監視センターが微小粒子状物質(PM2.5)の速報値をホームページ上で公開していたので、そのデータを定期的(1時間に1回)にポストするTwitterボット([twitter:@yokohama_pm25])を作ってみた。アイコンはHert01,incの[twitter:@hamushi]氏に作っ…

はてなブックマーク8周年おめでとう

はてなブックマーク8周年キャンペーンを開始しました - はてなブックマーク日記 - 機能変更、お知らせなどを見て、はてなブックマークが2月10日に8周年を迎えていた事を知った。 8周年なのでサービスが始まった日は2006年2月10日。この4ヶ月後の6月には今は…

How to use net-snmp api in XCode project.

Mac OS X includes net-snmp library by default, and how to use the net-snmp api in XCode is as follow. Select a project on the right pane of XCode window. Select "Build Phases", and open "Link Binary With Libraries". Click "+" button, and a…

中点「・」の話

諸事情で中点「・」についてちょっと調べたので、その時学んだ事をメモしておく。 【読み方】 中点はWikipedia等を見ると中黒(なかぐろ)とも読む模様。 また、中点は「ちゅうてん」と読むと思っていたが、「なかてん」とも読む模様。 英語に訳すとInterpun…

How to run pcap4j on Mac OS X.

Pcap4J is a Java library for capturing, crafting and sending packets. And, according to its README, Mac OS X is not included in supported operating system. But, you can run Pcap4J on Mac OS X in the following way. [Preparetion] Download pc…

C言語からLuaのプログラムを呼び出す

http://dotinstall.com/lessons/basic_luaでLuaのお勉強をしたので、C言語からLuaのプログラムを呼び出す方法も調べてみた。ということで、その結果をメモしておく。まず、以下のコマンドを実行してCentOS 5.9にLuaをインストールした(インストールされたLu…

キャンペーンに応募してみる

はてなダイアリー10周年! ありがとう キャンペーン - はてなブログをやっていたので応募してみる。 とりあえず「はてなダイアリー10周年おめでとう!」というキーワードを書いておけばOKのようである。 それにしてももう10年も経ったのかという感じであるが…

RedisのCクライアント(hiredis)を試してみた

RedisのCクライアントであるhiredisをちょっと試してみた際のメモ。 使用した環境はCent OS 5.8(仮想OS)。 まずは以下のコマンドを実行してインストールを実施。特にエラーなく終了。 > git clone git://github.com/redis/hiredis.git > cd hiredis > make…

CentOSにredisをインストールした時のメモ

CentOS 5.8にredis 2.6.7をインストールした際にやった事をメモしておく。 > wget http://download.redis.io/redis-stable.tar.gz > tar xvzf redis-stable.tar.gz > cd redis-stable > make Redis Quick Start – Redisに従い、上記コマンドを実行すると以下…

Mininetのセットアップ

スタンフォード大学で開発されているMininetというツールを使うとOpenFlowを気軽に試せるという事で、試しにセットアップした際のメモを以下に記載しておく。 使用環境 ホストOS: Mac OS X 10.8.2 仮想化ソフト: VirtualBox 4.2.6 Mininetのセットアップ 基…

How to stop "Listen has fallen back to polling" warning of Sass while watching for changes.

You would have a following warning message while you are trying to watch for changes with Sass. --------------------------------------------------------------------------- WARNING: Listen has fallen back to polling, learn more at https://g…

MacBook Proへの移行でやった事メモ

Mac

2008年の末にMacBookを買ってから約4年ほど使用して来たのだが、流石に動作が重くて厳しくなって来たので、つい先日MacBook Pro 15インチ Retinaディスプレイモデルを購入。 データの移行はMacの移行アシスタントとを使ったのであっさりと終わったのだが、一…

Codecademyのベータテストに参加する方法

最近オンラインでプログラミングを学べるサイトが沢山出てきたが、その中の一つCodecademyはJavaScriptとjQueryを中心に学ぶことが出来る。 しかし、このCodecademyのベータテストに参加すると、JavaScriptに加えてRubyやPythonも学ぶことが出来るようになる…

Keyboard shortcuts for HP WebOS running in VirtualBox on Mac OS.

fn + left --> Pushing Home button (Minimizes and maximizes the card) fn + right + right --> Showing lock screen fn + F6 + F9 --> Rotating device clockwise fn + F9 + F6 --> Rotating device counterclockwise left or right --> Switching the ap…

Google OAuth認証をローカル開発環境でテストした際のメモ

最近、ドットインストールで楽しくプログラミングの勉強をしているのだが、http://dotinstall.com/lessons/google_connect_phpで少し躓いた所があったのでメモしておく。 まず、Webサービスを開発する演習の場合、私はMac OS X上のVirtualBoxにCent OSをイン…

How to solve “Failed to validate oauth signature and token” error message on Twitter Oauth.

You would receive this error message from Twitter when you try to get request token. In this case, you can solve the error message if you make your system clock be accurate.

How to set up ntp on Cent OS.

1. Install ntp. # yum install ntp 2. Turn on service. # /sbin/chkconfig ntpd on 3. Synchronize the system clock. # /sbin/ntpdate pool.ntp.org 4. Start ntp. # /etc/init.d/ntpd start

How to turn on the Java applet plug-in for browsers.

If you saw a message that said "Inactive Plug-in" when you wanted to play a Java applet game or something, turn on the Java applet plug-in for browsers. It's vary easy. Launch "Java Preferences". You can find it by using Spotlight. Check "…

How to remove "event.layerX and event.layerY are broken and deprecated in WebKit..." warning message.

If you see the following warning message on your javaScript console of Google Chrome, you have to update jQuery to the latest version. --------------------------------------------------------------------------------------------------------…

言語別の乱数生成方法

0からnまでの整数の乱数を生成する方法を、言語別にメモしておく。 C #include <stdlib.h> srand(time(NULL)); rand() % (n + 1); C# Random r = new Random(); r.Next(n + 1);Java Math.floor(Math.random() * (n + 1)); JavaScript Math.floor(Math.random() * (n + </stdlib.h>…

MacPorts command note

Update all packages. $sudo port selfupdate $sudo port sync $sudo port upgrade outdated Uninstall old ports $sudo port uninstall inactive

How to remove "Warning: xcodebuild exists but failed to execute" warning message of MacPorts.

Run the following command. $ sudo xcode-select -switch /Applications/Xcode.app

Test post

DSCF0102.JPG Fort Collins, CO Freeskier Visits Tanner Hall In Park City

MySQL commands I learned today.

alter table [tablename] add [columnname] varchar (20); Add a new column to a table. alter table [tablename] drop [columnname]; Delete a column from a table. alter table [tablename] change [columnname] [newcolumnname] varchar (20); Change a…

MySQL commands I learned today.

mysql -u [username] -p; Login a sql server. show databases; List all databases on the sql server. create database [databasename]; Create a database on the sql server. drop database [databasename]; Delete a database on the sql server. grant…

How to set a root password for MySQL.

To setup root password for first time, use mysqladmin command at shell prompt as follows: $ mysqladmin -u root password NEWPASSWORD MySQL Change root Password

Test Post

This is a test post.

各種ポイントのメモ

貯めてる or 貯まるポイントに関して、忘れないようにメモしておく。 Tポイント系 ANAマイル -> Tポイントに 三井住友VISAカードのポイント -> Tポイントに SBI証券(SBIポイント)-> Tポイントに 東京ガスのポイント -> Tポイントに その他 ETCマイレージ -…

全日本タワー協議会なんてあるのね

今日、たまたま通天閣のオフィシャルサイトを見ていて、全日本タワー協議会なる物がある事を知った。 全日本タワー協議会とは全国20のタワーで運営されている協議会で、通天閣以外にも東京タワーや京都タワーが参加している模様(東京スカイツリーは何故か入…

TwitterのユーザIDが若い人トップ20

Twitterの最初のユーザって誰なのかなと、ふと気になったので調べてみたついでに、IDが若い人20人をリストアップしてみた。ちなみに一番最初のユーザはTwitterの生みの親であるJack Dorseyさんであった。 ID 12: [twitter:@jack] Twitterの共同創業者で、…