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 [] = q3_3(m) | |
x = linspace(-40*pi,40*pi,1000); | |
y = 0; | |
for j = 0:m | |
y = y + sin(1/(1+j/50)*x); | |
end | |
plot(x,y); |
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
// | |
// title: | |
// 全方位シューティングゲーム | |
// | |
// how to play: | |
// カーソルキー左右:旋回 | |
// カーソルキー上:ブースト | |
// スペース:ショット | |
#include <stdio.h> |
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
@@ -16,7 +16,7 @@ module OctopressFilters | |
end | |
def post_filter(input) | |
input = unwrap(input) | |
- RubyPants.new(input).to_html | |
+ RubyPants.new(input).to_html.gsub(/<h1>([^<].*[^>])<\/h1>/, '<h1><a name="\1" href="#\1">\1</a></h1>') | |
end | |
end |
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
source 'https://rubygems.org' | |
# Specify your gem's dependencies in immutable_list.gemspec | |
gemspec | |
+gem "rake-compiler" |
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
[~/Downloads]$ gem install -l unicode_math-1.2.0.gem | |
Successfully installed unicode_math-1.2.0 | |
Parsing documentation for unicode_math-1.2.0 | |
Installing ri documentation for unicode_math-1.2.0 | |
1 gem installed |
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
でも無限リストを処理できる | |
Enumerator.new{|y| | |
(1..Float::INFINITY).each{|n| | |
y << n*2 | |
} | |
}.first(5) # => [2, 4, 6, 8, 10] |
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
class Hoge | |
someInstanceProp: [1,2,3] # インスタンス変数 | |
someInstanceMethod: -> # インスタンスメソッド | |
@callAnotherInstanceMethod() # インスタンスメソッドを呼ぶ | |
alert @someInstanceProp # ==> "hoge" | |
@someClassProp: "hogehoge" # クラス変数 | |
@someClassMethod: -> # クラスメソッド | |
@callAnotherClassMethod() # 同一クラスのクラスメソッドを呼ぶ | |
alert @someClassProp # ==> "hogehoge" |
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
# usage rake generate_only[my-post] | |
# thanks to http://rcmdnk.github.io/blog/2013/12/06/blog-octopress-rake/ | |
desc "Generate only the specified post (much faster)" | |
task :generate_only, :filename do |t, args| | |
if args.filename | |
filename = args.filename | |
else | |
filename = Dir.glob("#{source_dir}/#{posts_dir}/*.#{new_post_ext}").sort_by{|f| File.mtime(f)}.last | |
end | |
puts "## Test build for #{filename}" |
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
gem 'rails', '4.0.0' | |
# Use sqlite3 as the database for Active Record | |
-gem 'sqlite3' | |
+gem 'sqlite3', groups: %w(test development), require: false | |
+gem 'pg', groups: %w(production), require: false | |
# Use SCSS for stylesheets | |
gem 'sass-rails', '~> 4.0.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
[~/RubymineProjects/drwallet]$ rake db:migrate | |
== ChangeColumnsToCreditCards: migrating ===================================== | |
-- change_column(:credit_cards, :etc_issuance, :boolean) | |
rake aborted! | |
StandardError: An error has occurred, this and all later migrations canceled: | |
PG::Error: ERROR: column "etc_issuance" cannot be cast automatically to type boolean | |
HINT: Specify a USING expression to perform the conversion. | |
: ALTER TABLE "credit_cards" ALTER COLUMN "etc_issuance" TYPE boolean/Users/gam0022/RubymineProjects/drwallet/db/migrate/20150206071431_change_columns_to_credit_cards.rb:3:in `change' | |
Tasks: TOP => db:migrate |
OlderNewer