brew tap adoptopenjdk/openjdk
brew cask install adoptopenjdk14
brew cask install homebrew/cask-versions/adoptopenjdk8
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 boolean decide(int s){ | |
boolean result = false; | |
if (s == 1){ | |
result = true; | |
}else{ | |
result = false; | |
} | |
return result; | |
} |
I hereby claim:
- I am siliconsenthil on github.
- I am siliconsenthil (https://keybase.io/siliconsenthil) on keybase.
- I have a public key ASAvhTD5DMpraRaQA4HG0VBg896VGrlFVC6VLtTDMRpLJgo
To claim this, I am signing this object:
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 CommentsController < ApplicationController | |
def create | |
event_user = EventUser.find(params[:event_user_id]) | |
comment = Comment.create(:event_user => event_user, :text => params[:text]) | |
FayeClient.broadcast("/event_#{event_user.event_id}_comments", comment.as_json) | |
render :text => 'Success' | |
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
class CommentsController < ApplicationController | |
def create | |
Comment.create(params[:comment]) | |
render :text => 'Success' | |
end | |
end | |
################################################# | |
class Comment < ActiveRecord::Base |
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
object RecursionVsTailRecursion extends App { | |
def iterative_sum(a: Long, b: Long):Long = { | |
var result = 0L; | |
for(i <- a until b){result=result+i} | |
return result+b; | |
} | |
def sum(a: Long, b: Long): Long = if(a > b) 0 else a + sum(a+1, b) | |