This file contains hidden or 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
| (progn | |
| (format t "a") | |
| (format t "b") | |
| (+ 11 12)) |
This file contains hidden or 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
| module Rubeus::Extensions::Javax::Swing | |
| module Timer | |
| def self.included(base) | |
| base.extend ClassMethods | |
| base.instance_eval do | |
| alias :new_without_rubeus :new | |
| alias :new :new_with_rubeus | |
| end | |
| end | |
This file contains hidden or 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
| require 'rubygems' | |
| require 'rubeus' | |
| include Rubeus::Swing | |
| JFrame.new do |frame| | |
| label = JLabel.new | |
| t = Timer.new(500) do | |
| label.text = java.util.Date.new.to_s |
This file contains hidden or 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
| require 'rubygems' | |
| require 'rubeus' | |
| require 'uri' | |
| require 'net/http' | |
| require 'rss' | |
| class RealTimeRssReader | |
| include Rubeus::Swing | |
| # Reflesh rate [ms] |
This file contains hidden or 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
| module Rubeus | |
| module Helpers | |
| def self.setup_derby | |
| return if ENV_JAVA['java.class.path'].split(File::PATH_SEPARATOR).any?{|path| /derby[\-\.\d]*\.jar$/ =~ path} | |
| if ENV_JAVA["java.specification.version"] == "1.6" | |
| begin | |
| require File.join(ENV_JAVA['java.home'], 'db', 'lib', 'derby.jar') | |
| return | |
| rescue LoadError | |
| # ignore error if not installed JavaDB |
This file contains hidden or 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
| require 'java' | |
| require 'rubygems' | |
| require 'rubeus' | |
| require 'rubeus/helpers/derby_helper' | |
| class JdbcExample | |
| include Rubeus::Jdbc | |
| def initialize | |
| # Register Driver |
This file contains hidden or 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
| require 'java' | |
| require 'poi-3.1-FINAL-20080629.jar' | |
| io = java.io.FileOutputStream.new("test2.xls") | |
| wb = org.apache.poi.hssf.usermodel.HSSFWorkbook.new | |
| wb.createSheet("First") | |
| wb.write(io) | |
| io.close |
This file contains hidden or 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
| require 'java' | |
| require 'poi-3.1-FINAL-20080629.jar' | |
| class RubyOutputStream < java.io.OutputStream | |
| def initialize(io) | |
| super() | |
| @io = io | |
| end | |
| def write(b) |
This file contains hidden or 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
| import java.awt.*; | |
| import java.awt.event.*; | |
| import java.math.*; | |
| import javax.swing.*; | |
| import javax.swing.event.*; | |
| public class Sierpinski extends JPanel | |
| { | |
| private static final int DRAW_LEVEL = 128; | |
| private static final int RECT_SIZE = 4; |
This file contains hidden or 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
| import java.awt.*; | |
| import java.awt.geom.*; | |
| import java.util.Stack; | |
| import javax.swing.*; | |
| // キモい再帰的なツリーを描くプログラム | |
| public class drawtree extends JPanel | |
| { | |
| private static final int DEGREE = 12; | |
| private static final int BRUNCH_LENGTH = 40; |
OlderNewer