Skip to content

Instantly share code, notes, and snippets.

View hakanai's full-sized avatar
⚔️
Battling i16n demons

Hakanai hakanai

⚔️
Battling i16n demons
View GitHub Profile
C:\Data\Projects\vendor\jruby\jruby~main>java -jar lib\jruby-complete.jar -S jirb
JRubyFile.java:62:in `createNoUnicodeConversion': java.lang.IllegalArgumentException: Neither current working directory (file:/C:/Data/Projects/vendor/jruby/jruby~main/lib/jruby-complete.jar!/M
ETA-INF/jruby.home) nor pathname (bin/jirb) led to an absolute path
from JRubyFile.java:51:in `create'
from RubyInstanceConfig.java:1035:in `resolveScript'
from RubyInstanceConfig.java:1016:in `runBinScript'
from RubyInstanceConfig.java:861:in `processArgument'
from RubyInstanceConfig.java:712:in `processArguments'
from RubyInstanceConfig.java:518:in `processArguments'
from Main.java:110:in `run'
create_table :tags do |t|
t.string :name
t.boolean :container
t.integer :parent_id
t.integer :lft
t.integer :rgt
end
create_table :images do |t|
t.timestamps
What was actually sent in hex: 82 B1 82 F1 82 C9 82 BF 82 ED 82 DD 82 F1 82 C8 82 B3 82 F1 0A
Apparently this says: こんにちわみんなさん
(Yep, there was an error in the line too.)
UTF-8 of the line: E3 81 93 E3 82 93 E3 81 AB E3 81 A1 E3 82 8F E3 81 BF E3 82 93 E3 81 AA E3 81 95 E3 82 93
Turns out it was Shift-JIS. Some IRC clients (in this instance probably mIRC as the user appeared to have
no clue he was doing it wrong) seem to send this as-is. The protocol gives no mechanism to indicate a
switch of encoding, so as a result the other end is forced to guess.
02/10/2009 11:39:50 AM hudson.model.Hudson load
WARNING: Failed to load a project
java.lang.NoClassDefFoundError: hudson/tasks/BuildStepMonitor
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethod(Unknown Source)
at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.getMethod(SerializationMethodInvoker.java:128)
at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callReadResolve(SerializationMethodInvoker.java:43)
at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:174)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
#
# So I'm looking for a nifty way of expanding this to support outputting to indented plain text...
#
module AuditReportsHelper
def format_yaml(yaml)
obj = YAML.load(yaml)
format_object(obj)
end
/**
* Interface for printers.
* <p>
* Printers are capable of printing a message, but the abstraction does not
* require a printer to print to any particular destination.
*/
public interface Printer {
/**
@Override
public void treeNodesRemoved(TreeModelEvent event)
{
Object parent = event.getTreePath().getLastPathComponent();
List<Object> children = getCachedChildren(parent);
if (children != null)
{
// Optimisation: if the children are null then the caller doesn't need to know about them
// or we would have been asked for them at some point.
#!/usr/bin/env ruby
require 'rss/1.0'
require 'rss/2.0'
require 'open-uri'
require 'csv'
SOURCES = [
"http://tokyotosho.info/rss.php?filter=1",
"http://tokyotosho.info/rss.php?filter=4,11",
#config/initializers/application_form_builder.rb:
ActionView::Base.class_eval do
def self.default_form_builder
Forms::ApplicationFormBuilder
end
end
#helpers/organisations_helper.rb:
class Licence < ActiveRecord::Base
belongs_to :parent_licence, :class_name => 'Licence'
has_many :nested_licences, :class_name => 'Licence', :foreign_key => 'parent_licence_id', :dependent => :destroy
accepts_nested_attributes_for :nested_licences
validates_associated :nested_licences
def clone
cloned = super
cloned.nested_licences = nested_licences.map { |nested_licence| nested_licence.clone }
cloned