Skip to content

Instantly share code, notes, and snippets.

Roger Wang roger35972134

Block or report user

Report or block roger35972134

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Currency_controller.rb
class CurrencyController < ApplicationController
require 'line/bot'
def client
@client ||= { |config|
config.channel_secret = ENV["LINE_CHANNEL_SECRET"] # Your Channel secret
config.channel_token = ENV["LINE_CHANNEL_TOKEN"] # Your Channel token
View Currency.rb
class Currency < ActiveRecord::Base
require 'open-uri'
def self.get_currency
books = Nokogiri::HTML(open(""))
name = []
abbreviation = []
rate = []
exchange = []
View Leetcode_3_3:Accepted.rb
def length_of_longest_substring(s)
max = 0
start_index = -1
char_to_index_map = {}
s.chars.each_with_index do |c, i|
if current_index = char_to_index_map[c] and current_index > start_index # if current_index != nil
start_index = current_index
View Leetcode_3_2:time_limit.rb
# @param {String} s
# @return {Integer}
def length_of_longest_substring(s)
max = 0
for i in 0..s.length-1
check =, false)
for j in i..s.length-1
index = s[j].ord
if check[index] == false
roger35972134 / Leetcode_3:time_limit.rb
Created Oct 11, 2017
Leetcode 3. Longest Substring Without Repeating Characters, but it failed by Submission Result: Time Limit Exceeded
View Leetcode_3:time_limit.rb
# @param {String} s
# @return {Integer}
# ----------time limit-------------
def length_of_longest_substring(s)
longest_length = 0
for i in 0..s.length-1
check = []
for j in i..s.length-1
unless check.include? s[j]
check.push s[j]
roger35972134 / udn_news_crawler.rb
Last active Sep 27, 2017
crawler preparation for NEWS analysis
View udn_news_crawler.rb
require 'nokogiri'
require 'open-uri'
# Let's try to fetch and parse HTML document
books = Nokogiri::HTML(open(''))
news = []
i = 0
View pygame_new_version
# Tetromino for Idiots
# By Al Sweigart
# Released under a "Simplified BSD" license
import random, time, pygame, sys
from pygame.locals import *
偵數 = 25
視窗寬度 = 640
View python_hw4
from matplotlib import pyplot
from collections import namedtuple
from pprint import pprint as pp
from math import floor
Stem = namedtuple('Stem', 'data, leafdigits')
data0 = Stem((4285,564,1278,205,3920,
View python_hw3
import itertools
def main():
排假(1, True)
排假(2, True)
roger35972134 / python_hw2
Created May 11, 2015
View python_hw2
def main():
def 列出巴斯卡三角形():
Z=[[bCoef(n,k) for k in range(n+1)] for n in range(20)]
for z in Z: print(z)
You can’t perform that action at this time.