Blogged by Ujihisa. Standard methods of programming and thoughts including Clojure, Vim, LLVM, Haskell, Ruby and Mathematics written by a Japanese programmer. github/ujihisa

Saturday, July 18, 2009

My RubyKaigi2009 Talk

Today, the second day of RubyKaigi2009 in Japan, I had a 30 minutes talk.

Slide

(My talk slide will be uploaded here)

I used Vim-like presentation tool powered by Opera, Ruby and Vim.

Video

Description

Originally I had tried to talk about software development environments for ruby in a general way. But unfortunately my slide became something bored. I thought my talk would be bad. Last night, I finally decided to change the topic of my talk.

My old title was "Working Effectively with Ruby for Average Programmers", and the new title was "Vim for Rubyists". I talked about Vim there.

Note

  • In my demonstration, I missed the implementation of FizzBuzz problem on purpose. I wanted someone to mention it at the time, but unfortunately nobody did.
  • (add more...)

Friday, July 17, 2009

Now I'm talking at RubyKaigi2009

I'm very nervous now.

My talk is about

  • quickrun.vim
  • blogger.vim

yay

Wednesday, July 15, 2009

RubyKaigi2009 is Comming

I'll attend a three-days conference RubyKaigi2009 starting tomorrow.

As a speaker

image

I have a talk on July 18 Saturday. I'll talk about development environments.

http://rubykaigi.org/2009/en/talks/18S02

Working Effectively with Ruby for Average Programmers

For software development with the Ruby programming language, this presentation will introduce the study of general productive programming methodology which is primary for ordinary programmers who usually write code simply based on empirical or academical knowledge. This presentation focuses on an environment supports a development particularly. This also shows the advantages powered by Vim by a live coding. Keywords: IDE, Opportunistic Programming, Functional Languages, Grass, Live Coding

If you are an ordinary programmer, and want to improve your coding speed, and if possible you are a vim user, I recommend you to come to my talk! Unfortunately my talk is in Japanese. My slides are both in Japanese and in English.

As a participant

If you find me, feel free to talk me! I can understand slow English and can speak in awkward English. I'll have a speaker nameplate with the name "ujihisa" at the conference room.

Sunday, July 12, 2009

LiveCoding#6 was Successfully Hosted by Me

I'm proud of the exciting event which was held on yesterday.

LiveCoding#6 http://ujihisa.github.com/livecoding6 (in Japanese and English)

There were 9 LiveCoders and about 40 audiences in a traditional Japanese style urbane house.

0

02

Some LiveCoders could complete their products in each 20 minutes while others couldn't.

1

It is hard and oppressive for LiveCoders to code within a time limit, meanwhile it is amusing and interesting for audiences to watch the coders.

2

The contents of this LiveCoding is:

  • Pretty More Useful Twitter with hitode909
  • JavaScript on Scala on GAE with cho45
    • A GAE app in Scala with JS(rhino)
    • Powered by Scala, Java (is abbr of JavaScript), Vim, Rake and MacBook
  • Something with Ruby/SDL with 大林(ohai)
    • Something like a shooting game
    • Powered by Ruby, Emacs, Ion, Debian/GNU Linux, and ThinkPad
  • Something with Vimperator with hotchpotch
    • An unuseful vimperator plugin
    • Powered by Firefox 3.5, Vim, Rascut, Windows7(7100) + Debian/GNU Linux and ThinkPad X61Tablet
  • Something with Android with naoya_t
    • Produce something as an Android app (and then will continue developing it at the Android Hackathon)
    • Powered by Emacs, Eclipse, Android SDK/NDK, Java, gcc, Mac OS X, MacBook Pro and HKK Lite Shiro
  • Google App Engine on Sinatra with ujihisa
    • The ultimate web application platform Sinatra/Google App Engine for Java/JRuby
    • Powered by Vim, Ruby, Mac OS X and MacBook Air
  • Wanted: The Answer of my Assignment with Kimoto
    • There are few hours to submit my report. Does it make on time while I've never got going. Get a unit or repeat the course.
    • Powered by Vim, C, Windows XP Pro and Let's note
  • Wiki on PHP with imos
    • An irresponsible notation wiki
    • Powered by mi, php, Mac OS X and MacBook Pro

3

Actually my turn, "Google App Engine on Sinatra", was just a cheat. I didn't do anything difficult like what other LiveCoders did.

I made and deployed an app here. The app cho466666 can calculate addition and fibonacci sequence like

The core source code is below.

require 'rubygems'
require 'sinatra'

get '/' do
  RUBY_VERSION
end


get '/add/:x/:y' do
  x, y = params[:x].to_i, params[:y].to_i
  "#{x} + #{y} = #{x + y}"
end

get '/fib/:n' do
  n = params[:n].to_i
  "fib#{n} = #{fib(n)}"
end

def fib(n, x = n < 2 ? n : fib(n-2) + fib(n-1))
  x
end

4

After the LiveCoding, we did a Android Hackathon and a Vim Hackathon until the next morning.

drink

hackathon

Other LiveCoding#6 photos are here. Thanks hitode909!

Sunday, July 5, 2009

ANN: LiveCoding#6 Will be Held on the Next Saturday

http://ujihisa.github.com/livecoding6/

LiveCoding is a new boom that programmers show their programming techniques live with communication and develop a new software. It is amusing that we watch a super technique of a great hacker rowdy.

The site is updated very often. I recommend people who are going to attend the event to subscribe the RSS.

It was very exciting.

It Is Difficult For Me oo Know How to Generate RSS Feed Which Items Have a Description Which Has CDATA by Ruby's Standard Library RSS/Maker

so I've decided to stop using rss/maker.

Thursday, July 2, 2009

How to Make an Android Application on Mac OS X

INSTALLATION

I had Vim and NetBeans as IDEs, but I didn't have Eclipse. Unfortunately Android SDK needs Eclipse IDE.

http://www.eclipse.org/downloads/

There are a lot of variations of Eclipse. Download "Eclipse IDE for Java Developers (91 MB)".

A Java or RCP version of Eclipse is recommended.

-- http://developer.android.com/sdk/1.5_r2/installing.html

The RCP version of Eclipse is also OK, but its size is twice as the Java one.

After the installation of Eclipse IDE, install the Android SDK.

Download from here: http://developer.android.com/

And install them somewhere on your machine. For example, now I'll install it on ~/android-sdk-mac_x86-1.5_r2.

Write it on your ~/.zshrc:

export PATH=$PATH:~/android-sdk-mac_x86-1.5_r2/tools/

And then install the ADT: Android Development Tools plugin for Eclipse.

Help > Install New Software...

(I don't know why the plugin adding dialog is located in "Help" menu. I wonder what did the Eclipse developper thing about it.)

And input it: https://dl-ssl.google.com/android/eclipse/

1

Now you have Android plugin. Before you would create a new Android app, you have to set a setting on your Eclipse Preferences.

2

Input the SDK Location and Apply it.

Hello, World with Eclipse

$ android create avd --target 2 --name my_avd # Initial setting

And then make a new Project with your Eclipse.

3

4

5

And run it.

6

OK. Now let's try to show "Hello, world" on the Android emulator window.

The initial src/com.example.hw/hw.java is:

package com.example.hw;

import android.app.Activity;
import android.os.Bundle;

public class hw extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

Fix it like below:

package com.example.hw;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class hw extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TextView tv = new TextView(this);
        tv.setText("Hello, Android");
        setContentView(tv);
    }
}

And then run the Android Application by Eclipse.

a

It took very long time to show the result. After you clicked the run botton, you should drink a cup of coffee.

Hello, World without Eclipse

It is very difficult for us to use Eclipse every time. Now I'll show how to build and run an Android application without using Eclipse.

$ mkdir hw-vim && cd hw-vim
$ android create project --package com.example.hwvim --activity HW --target 2 --path .
(...fix src/(snip)/HW.java like the previous code...)
$ ant debug
$ emulator -avd my_avd
$ adb -s emulator-5554 install bin/HW-debug.apk

It did:

  1. Create a new Android Application Project
  2. Build
  3. Boot the Android emulator
  4. Install the application into the emulator

You may see the following error:

error: device not found

Unfortunately this error is undocumented here. The solution how to avoid it is to restart adb server.

$ ps aux | grep adb
$ kill -HUP {the process id}

Now you must be able to see the new app:

HW there

I don't know why, but I cannot boot the application. An error occurred.

error

;-(

Followers