This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <time.h> | |
float distance(int *point1, int *point2) | |
{ | |
int | |
dx = point1[0] - point2[0], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body{margin:0;padding:0;overflow:hidden} | |
.banner{background-color:rgba(204,204,204,0.333);position:fixed;top:0;left:0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'json' | |
ONLY_TWO_ALPHAS = /^[[:alpha:]]{2}$/ | |
INVALID_LANGULAGE_CODE_ERROR_TEXT = 'Error: Language code should be ISO 639 alpha-2' | |
def parse_args(argv) | |
parser = OptionParser.new |
このページにアクセスし、レスポンスボディを取得してその文字列を直接画面に表示するアプリを作れ。Activityの名前はMainActivity
とする。通信はメインスレッド上で同期的に行う。
Android 3.0 からメインスレッドで通信を行うとNetworkOnMainThreadExceptionが発生するようになったそうなので、Android 2.3.3のエミュレータを利用してやること。この練習問題集の目的はJSONの処理、リストビューの利用、複数のアクティビティの利用なので、マルチスレッド処理についてはまだできなくてよい。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
require 'json' | |
def parse_rss_xml(file_name) | |
file = File.read file_name | |
doc = Nokogiri.XML file | |
to_info = -> rss { | |
title = rss.attr 'title' | |
html_url = rss.attr 'htmlUrl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateGoogleSearchUrl(word, num) { | |
var encodedWord = encodeURI(word); | |
var number = '&num=' + (num || 50); | |
var prefix = 'https://www.google.co.jp/search?q='; | |
var suffix = '&ie=UTF-8'; | |
return prefix + encodedWord + number + suffix; | |
} | |
function getWordList(fileName) { |
puts "hello"
"hello\n"と出力される。
Rubyはメソッドの括弧を省略できる。上の文は
puts("hello")
と同じ
###Rubyプログラムの実行について
Rubyプログラムの実行は簡単。 適当にrbファイルを作って
puts "hello, world"
とでも書き込んで保存してやり、
$ ruby aaa.rb
##JavaScript入門系まとめ
###プログラミング入門
JavaScriptを使った簡単なプログラミング解説。
functionやprototypeについての解説など。JavaScriptの構文について分からないことが出てきたら読んでみるといいかも。
NewerOlder