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
public class StringUtils { | |
public static boolean isBlank(String str) { | |
int strLen; | |
if (str == null || (strLen = str.length()) == 0) { | |
return true; | |
} | |
for (int i = 0; i < strLen; i++) { | |
if ((Character.isWhitespace(str.charAt(i)) == false)) { | |
return false; | |
} |
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
(defmulti blank? class) | |
(defmethod blank? String [s] (every? #{\space} s)) | |
(defmethod blank? nil [_] true) |
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
#app/models/chatter.rb | |
class Chatter < ActiveRecord::Base | |
has_one :chats | |
end | |
#app/models/chat.rb | |
class Chat < ActiveRecord::Base | |
belongs_to :chatter, :foreign_key => 'chatter_id' | |
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
#app/models/chatter.rb | |
class Chatter < ActiveRecord::Base | |
has_one :chats | |
end | |
#app/models/chat.rb | |
class Chat < ActiveRecord::Base | |
belongs_to :chatter, :foreign_key => 'chatter_id' | |
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
#config/routes.rb | |
#**before | |
#/chatters | |
#/chatters/1 | |
#/chats | |
#/chats/1 | |
ActionController::Routing::Routes.draw do |map| | |
map.resources :chatters | |
map.resources :chats |
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
#config/routes.rb | |
ActionController::Routing::Routes.draw do |map| | |
map.resources :chatters do |chatter| | |
chatter.resources :chats | |
end | |
#app/controllers/chats_controller.rb | |
#Parameters: {"chat"=>{"id"=>"1", "message"=>"cool"}} | |
class ChatsController < ApplicationController |
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
hjgkhjgjjjk | |
jkhkhjklj | |
hghjjhhj |
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
a = "" | |
func1 = Proc.new do | |
i = 0 | |
while i <= 100 | |
puts "func1 " | |
sleep(0.001) | |
a.concat "aaaa" | |
i = i + 1 | |
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
a = "" | |
func1 = Proc.new do | |
i = 0 | |
while i <= 100 | |
puts "func1 " | |
sleep(0.001) | |
a.concat "aaaa" | |
i = i + 1 | |
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
(def πρόσθεσε +) | |
(def αφαίρεσε -) | |
(def σύμβολο symbol) | |
(def σύμβολο? symbol?) | |
(def διάλεξε take) | |
(def διάλεξε-τελευταίο take-last) | |
(def διάλεξε-ν take-nth) | |
(def διάλεξε-μέχρι take-while) | |
;(def μακροεντολή defmacro) | |
(def τέσταρε test) |
OlderNewer