This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>์์ธ์ ๋ ์จ์ ๋ณด-wunderground API์ด์ฉ</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1" charset="utf-8"> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" /> | |
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> | |
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script> | |
<script> |
This file contains hidden or 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
# encoding: utf-8 | |
lines=File.readlines("oliver.txt") | |
line_count=lines.size | |
text=lines.join | |
total_character=text.length | |
total_character_no_whitespace=text.gsub(/\s+/,'').length | |
word_count=text.split.length | |
paragraph_count=text.split(/\n\n/).length | |
sentence_count=text.split(/\.|\!|\?/).length | |
puts "์ ์ฒด ๊ธธ์ด : #{line_count}" |
This file contains hidden or 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
# encoding: utf-8 | |
# Stop_words 2012-12-26 | |
stop_words = %w{the a by on for of are with just but and to the my I has some in} | |
text=%q{Korea is officially the only divided nation in the world.} | |
words = text.scan(/\w+/) | |
key_words = words.select { |word| !stop_words.include?(word)} | |
puts "๋ฌธ์ฅ ์ค ํค์๋์ ๋น์จ์ : #{((key_words.length.to_f/words.length.to_f)*100).to_i}%" | |
puts key_words.join(' ') |
This file contains hidden or 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
def current_user | |
@current_user ||= User.find(session[:user_id]) | |
end |
This file contains hidden or 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
class TaskController < ApplicationController | |
def incomplete | |
@tasks = Task.find(:all, :conditions => ['complete = ?', false]) | |
end | |
def last_incomplete | |
@task = Task.find(:first, :conditions => ['complete =?', false], :order => 'created_at DESC') | |
end | |
end |
This file contains hidden or 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
=begin ๋ฌธ์์ด ์ถ๋ ฅํด๋ณด๊ธฐ | |
**์ด ๋ฌธ์๋ ๋ฃจ๋น 2.0.0-p0 ๋ฒ์ ์ Ruby core API ๊ธฐ๋ฐ์ ๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.** | |
** ์์ฑ์ ์ ๋ณด | |
** ๋ฐ์ฐฝ์ฃผ | |
** [email protected] | |
** http://parkcj.wordpress.com | |
** 2013-04-07 | |
single quotation vs double quotation | |
''์ ""์ ์ฐจ์ด๋ฅผ ์์๋ณด์ | |
์ฐ์ puts ๋ ๋ฌธ์์ด์ ์ถ๋ ฅํ๋ ํจ์์ด๋ค. |
This file contains hidden or 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
=begin | |
**์ด ๋ฌธ์๋ ๋ฃจ๋น 2.0.0-p0 ๋ฒ์ ์ Ruby core API ๊ธฐ๋ฐ์ ๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.** | |
** ์์ฑ์ ์ ๋ณด | |
** ๋ฐ์ฐฝ์ฃผ | |
** [email protected] | |
** http://parkcj.wordpress.com | |
** 2013-04-07 | |
์๋ฅผ ๋ค์ด ํน์ ํ์๋งํผ ๋ฌธ์ฅ์ ๋ฐ๋ณตํ ์ผ์ด ์๊ธด๋ค๋ฉด | |
์ด๋ป๊ฒ ํด์ผํ ๊น? | |
-> 1. 1๋ฒ์ Hello World!๋ฅผ ์ถ๋ ฅํด๋ณด์ |
This file contains hidden or 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
=begin | |
**์ด ๋ฌธ์๋ ๋ฃจ๋น 2.0.0-p0 ๋ฒ์ ์ Ruby core API ๊ธฐ๋ฐ์ ๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.** | |
** ์์ฑ์ ์ ๋ณด | |
** ๋ฐ์ฐฝ์ฃผ | |
** [email protected] | |
** http://parkcj.wordpress.com | |
** 2013-04-07 | |
์ด์ ์์ธ์ ์ ์ค๊ฐ๋ ์ 1ํธ๋ฅผ ์์ฑํ์ฌ ๋ณด์ | |
์์ ์ ๋ฌธ : | |
์ค๊ฐ๋(็็ฐๅ) ์ ์ 1ํธ |
This file contains hidden or 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
# encoding: utf-8 | |
=begin | |
**์ด ๋ฌธ์๋ ๋ฃจ๋น 1.9.3-p392 ๋ฒ์ ์ Ruby core API ๊ธฐ๋ฐ์ ๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.** | |
** ์์ฑ์ ์ ๋ณด | |
** ๋ฐ์ฐฝ์ฃผ | |
** [email protected] | |
** http://parkcj.wordpress.com | |
** 2013-04-07 | |
์กฐ๊ธ ๋ ๋ฌธ์์ด์ ๋ํด์ ์์๋ณด์. |
This file contains hidden or 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
# encoding: utf-8 | |
=begin | |
**์ด ๋ฌธ์๋ ๋ฃจ๋น 2.0.0-p0 ๋ฒ์ ์ Ruby core API ๊ธฐ๋ฐ์ ๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.** | |
** ์์ฑ์ ์ ๋ณด | |
** ๋ฐ์ฐฝ์ฃผ | |
** [email protected] | |
** http://parkcj.wordpress.com | |
** 2013-04-07 | |
์ด์์ ์ค๊ฐ๋ ์ 1ํธ ๊ณ์ |
OlderNewer