Skip to content

Instantly share code, notes, and snippets.

@ir-norn
ir-norn / item_template.txt
Last active June 7, 2017 09:30
データ更新用
<table class=\"var_table item\"> <tr><td colspan=\"4\"><span class=\"smaller\">Lv:1 ID:<span class=\"selectedClass\">640072</span> Cls:<span class=\"selectedClass\">food_Popolion</span> Group:Drug <a href=\"#\" onclick=\"onButtonClick('item' , 640072);\">詳細(材料)</a> </span></td></tr><tr><td style=\"width:80px;\"><div class=\"ItemGradebg1\"><img src=\"./gfx/icon_item_meat_02.png\" style=\"position:relative;left:20px;top:5px;float:left;width:40px;height:40px;\" alt=\"ポポリオンの肉\"></div></td><td style=\"width:30%;\"> <div class=\"selectedClass ItemGrade\">ポポリオンの肉</div><div class=\"selectedClass ItemGrade\">포포리온 고기</div> </td><td style=\"width:30%;\"> <div class=\"selectedClass \">CoolDown 15 秒</div> <div class=\"selectedClass \">CD種類 HPPOTION</div> </td><td style=\"width:30%;\"> <div class=\"selectedClass \">種類 その他</div> </td></tr><tr><td colspan=\"2\"> <div class=\"selectedClass smaller \">HPを+80~100回復させてくれます。簡単に入手できる肉です。生で食べても美味しいです。右クリックで使用します。</div> </td><td colspan=\"2\"> <a href=\"#\" onclick=\"onButtonClic
@ir-norn
ir-norn / parse_tosken.rb
Created March 30, 2017 21:52
ドロップサーチ関連 2017 03 31
#coding:utf-8
require "nokogiri"
require "kconv"
require 'json'
Dir.chdir File.dirname __FILE__
#
#
# tabledata = data_json内の <table~</table> ,,, ths_ary == tos neetのデータ
# db_ary == json_data
@ir-norn
ir-norn / html_replace_out_json.rb
Created March 30, 2017 20:11
tosken関連で使ったスクリプト
#coding:utf-8
require "nokogiri"
require "kconv"
require 'json'
Dir.chdir File.dirname __FILE__
tmp =[]
count=0
@ir-norn
ir-norn / .rb
Last active February 15, 2017 22:52
#
# 精錬値と成功率 
class Success_rate
attr_accessor :rate , # 成功率Array
:cost , # 精錬費用Array
:pote , # ポテンシャル
:v, # 最初の精錬値
:arrival_value, # 目標の精錬値
:arrival_pote, # 目標のポテンシャル減少
:level , # 装備レベル
@ir-norn
ir-norn / nokori_time.rb
Last active July 8, 2016 06:30
nokori_time.rb
def nokori_time a
t = Time.new
b = a - t
b = (b/(60*60*24)).to_i
a -= 60 * 60 * t.strftime("%H").to_i
a -= 60 * t.strftime("%M").to_i
a -= t.strftime("%S").to_i
a.strftime("#{b}-%01H-%01M-%01S")
end
@ir-norn
ir-norn / osdetect.bat
Created June 28, 2016 00:27 — forked from ebibibi/osdetect.bat
this is os detect batchfile. this file uses only ver command and this can't detect server or client. This is because of speed. systeminfo.exe can detect server or client but that is very slow. "ver" comannd returns result very fast.
@ECHO off
VER | find "95" > nul
IF not errorlevel 1 GOTO Win_95
VER | find "98" > nul
IF not errorlevel 1 GOTO Win_98
VER | find "NT" > nul
IF not errorlevel 1 GOTO Win_NT
@ir-norn
ir-norn / sele.rb
Created June 17, 2016 09:10
スクレイピング
require 'selenium-webdriver'
agent = Selenium::WebDriver.for :firefox
agent.get "http://motenai.orz.hm/up/"
agent.find_element(:name => "file[]").send_keys "C:\\0.jpg"
agent.find_element(:name => "pass").send_keys "1234"
f = agent.find_element :name => "file[]"
f.submit
@ir-norn
ir-norn / mod_th_kaiseki.rb
Created June 16, 2016 14:59
2chのスレッドの各レスを解析 2016_06_16v
#coding : utf-8
#Dir.chdir File.dirname($0)
require "mechanize"
require "kconv"
class Resu
attr_accessor :num,:name,:mail,:message,:time,:id,
:anka,:link,:img,
:wacchoi,:name_body # no using
s = "----*".split(//)
b = []
s.size.times do
b << s.join.reverse[0..-2] + s.join + "\n"
s.rotate!
end
puts b[0..-2]
puts b.reverse
@ir-norn
ir-norn / akm.rb
Last active April 28, 2016 00:38
アッカーマン関数 再帰 と ループ
# ループ
def func a , b
stack = []
loop do
if a == 0
b += 1
if stack.empty?
return b
else