Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - fugibo

Quote from: WhiteRose on July 25, 2010, 07:30:12 pm
I saw the name of this topic and thought instantly of this:
Spoiler: ShowHide

On topic: I lol'd. I read another really funny response similar to this the other day; I'll see if I can dig it up.

Ah, here it is:

obv. this response is inferior 2 bullet
Entertainment / Re: Inception
July 24, 2010, 08:01:55 pm
Quote from: Diokatsu on July 24, 2010, 07:59:36 pm
Quote from: fugibo on July 24, 2010, 07:23:06 pm
nothing like The Matrix. fairly interesting and the fight scenes weren't annoying. wasn't really that great, though. inspired.

I disagree with your opinion and would like you to revise it.

it's definitely the best movie out right now, but it's still not "great" or anything like The Matrix beyond the questioning of reality. and it was rather inspired.
Entertainment / Re: Inception
July 24, 2010, 07:23:06 pm
nothing like The Matrix. fairly interesting and the fight scenes weren't annoying. wasn't really that great, though. inspired.
Video Games / Re: Portal 2... PORTAL 2
July 23, 2010, 12:12:04 pm
Quote from: Blizzard on July 23, 2010, 11:45:04 am
Well, then the next weekend. Or the one after that. Or whichever weekend the first one is after the release xD
I really hope it'll be longer than the first one. You can beat Portal 1 in 1.5 hours using a laptop touchpad. Well, the part about the touchpad may be just me... <_<;

EDIT: :cclove:

It took me around 2 hours with mine. Of course, I also beat Half-Life 1 without much challenge with it. And Blue Shift/Opposing Force. Macbook trackpads are really good for FPSes, actually.

EDIT: releasedate is "TBA 2011"
Chat / Re: Favorite Books?
July 23, 2010, 11:43:52 am
Quote from: Diokatsu on May 01, 2010, 09:07:08 pm
Some of my favorites are As I Lay Dying by William Faulkner, Catcher in the Rye by J.D. Salinger, Dubliners by James Joyce (which I read a couple months back for my term paper and was really, really, really impressed by), Lolita by Vladimir Nabokov (favorite book ever), Pale Fire by Vladimir Nabokov, The Brothers Karamazov by Fyodor Dostoevsky and Catch-22 by Joseph Heller, and plus the epic poems The Odyssey by Homer, The Aeneid of Virgil, and The Epic of Gilgamesh translated by Andrew George.

I'm going to try and read Atlas Shrugged by Ayn Rand, Ulysses by Jame Joyce and Anna Karenina by Leo Tolstoy this summer, the first being my choice and the last two being recommendations from my English teacher. I may try and fit in To the Lighthouse by Virginia Woolf and On the Road by Jack Kerouac.

i could totally take that seriously if you hadn't listed catcher in the rye

On the Road (and pretty much all Beat stuff) is actually good, you should also check out William S. Burroughs if you're actually being serious.
Video Games / Re: Portal 2... PORTAL 2
July 23, 2010, 11:31:42 am
Quote from: Blizzard on July 23, 2010, 03:08:06 am

no it's not
oh god i hope they don't take down my internet

it'd be almost as bad as them trying me as a criminal or something
Entertainment / Re: Pickup Lines.
July 15, 2010, 07:41:00 pm
my friend has an empty packet of tea sweetener labeled "sweet thing" that he drops on the floor, picks up and says "excuse me, you dropped your name tag"
RPG Maker Scripts / Window Additions
July 15, 2010, 01:11:55 pm

- With this script, you can now create animations:
Window_Animation.resize 200, 200 # resize a window to 200x200
Window_Animation.move 50, 50 # move a window to (50, 50)

# this one makes a window hover up and down do |window|
 window.displacement_x = window.displacement_y = Math::sin((Graphics.framecount % 360) * Math::PI / 180)

- You can also add objects to windows as thus:
window << object # the method named "insert_<object class>" is called, i.e. for a string "insert_String" would be called
window << animation # adds the animation, so that window#update will call it
class Window_Animation
 def self.resize width, height
   return do |window|
     if window.width > width
       window.width -= 2
     elsif window.width < width
       window.width += 2

     if window.height > height
       window.height -= 2
     elsif window.height < height
       window.height += 2
 def self.move x, y
   return do |window|
     if window.x > x
       window.x -= 1
     elsif window.x < x
       window.x += 1
     if window.y > y
       window.y -= 1
     elsif window.y < y
       window.y += 1
 def self.proc &block
 def initialize &block
   @block = block
   @hash = {}
 def call window window

class Window
 attr_reader :displacement_x, :displacement_y
 alias fugibo_window_additions_initialize_alias initialize
 def initialize *args
   @animations = []
   @displacement_x = 0
   @displacement_y = 0
 def << object
   send 'insert_#{object.class}', object
 def insert_Window_Animation animation
   @animations << animation
 def insert_Proc proc
   @animations << Window_Animation.proc(proc)
 alias fugibo_window_additions_update_alias update
 def update
   @animations.each do |animation|
 def displacement_x= x
   self.x += x - @displacement_x
   @displacement_x = x
   return x
 def displacement_y= y
   self.y += y - @displacement_y
   @displacement_y = y
   return y

a scripter's "tool." some methods added to the Window class and a new class (Window_Animation, not sure if that name's taken already). neat example (assuming the code works, which it should:)

w =
w.width = 160
w.height = 120
w.x = 240
w.y = 180

w << Window_Animation.move 120, 80
w << Window_Animation.resize 320, 240
w << do |window|
 w.angle = Graphics.framecount % 40 - 20

loop do
 if Input.trigger? Input::C
thanks cat

also here's a quick example of how you can use rum to build xml files (not sure if this will work, I'm typing it up quicklike):

# output all schools and their students to an XML file!
document =

schools.each do |school|
 school_node = document.spawn 'school', 'name' =>, 'address' => school.address.to_s
 school.students.each do |student|
   school_node.spawn 'student', 'name' =>, 'grade' => student.grade.to_s
end'output.xml', 'w') do |file|
 file.write document.to_xml
Have Fun: ShowHide

module Rum
 class Node
   include Enumerable
   include Comparable
   attr_reader :parent, :label, :body, :attributes
   def initialize parent, label, attributes = {}
     @parent = parent
     @label = label
     @attributes = attributes
     @body = ''
     @children = []
   def <=> other
     if other.kind_of? Node
       if @label == other.label
         return @attributes <=> other.attributes
         return @label <=> other.label
       raise ArgumentError, "Unable to convert #{other.class} to Node"
   def [](attr_name)
     return attributes[attr_name]
   def each
     @children.each {|node| yield node}
   def find label=nil, attributes=nil, &block
     # kinda slow. it could probably use some optimization.
     super() do |node|
       (label == nil ? true : node.label == label) and
       (attributes == nil ? true : attributes.all? {|key, vaue| node[key] == value}) and
       (block == nil ? true :
   def select *args, &block
     subset = @children.clone
     args.each do |arg|
       if arg.is_a? String
         subset.delete_if do |node|
           node.label != arg
       elsif arg.is_a? Hash
         subset.delete_if do |node|
           arg.any? do |key, value|
             node[key] != value
     if block != nil
       subset.each do |node| node
     return subset
   def push object
     object.kind_of?(Node) ? @children.push(object) : raise("Cannot add non-node #{object} as child of node #{self}")
   def child_count
     return @children.count
   def to_xml indent=0
     tab = "  " * indent
     if @body.size == 0 and @children.empty?
       return "#{tab}<#{@label}#{attributes_to_xml_string} />"
       return "#{tab}<#{@label}#{attributes_to_xml_string}>\n#{tab}\t#{@body}\n" << (@children.inject('') {|s,n| s << n.to_xml(indent+1)}) << "#{tab}</#{@label}>\n"
   def spawn label, attributes = {}
     node =, label, attributes)
     self.push node
     return node
   def attributes_to_xml_string
     return @attributes.inject(' ') {|string, pair| string << "#{pair[0]}=\"#{pair[1]}\""}
 class Document < Node
   def xml_attributes_from_string string
     attributes = {}
     if string != nil
       string.scan(/(\w+?)="(\w+?)"/) do |pair|
         attributes[pair[0]] = pair[1]
     return attributes
   def tags_from_xml string
     node = self
     string.scan(/(<[^>]+>|<\/[^>]+>|[^<]*)/) do |sub|
       case sub[0]
       when /<([\w\-]+?) (.+)?\/>/ # simple node
         node.spawn $1, xml_attributes_from_string($2)
       when /<([\w\-]+?)( (.+) ?)?>/ # complex node (open)
         node = node.spawn $1, xml_attributes_from_string($2)
       when /<\/([\w\-]+?)>/ # complex node (close)
         if $1 == node.label and node != self
           node = node.parent
           raise "Attempted to close tag named '#{$1}'; current tag is named '#{}'"
       else # node content
         node.body << sub[0].strip
     return self
   attr_reader :source
   def self.open_xml filename, &block
     document = :xml,
     if block != nil document
     return document
   def self.xml source, &block
     document = :xml, source
     if block != nil document
     return document
   def initialize type=:xml, source='', &block
     super nil, ''
     @source = source
     case type
     when :xml
       tags_from_xml @source
     if block != nil self
   def to_xml
     # overridden to avoid enclosing <></>
     return @children.inject('') {|string, node| string << node.to_xml}

Rum is a pure-Ruby library I wrote today that can be used to load, manipulate, and save XML files. What makes it different from REXML/&c.? This:

#! /usr/bin/ruby

require 'rum'
include Rum

<class id="101">
 <student id="99887" name="John" grade="11" />
 <student id="44753" name="Jenny" grade="10" />
<class id="102">
 <student id="99887" name="John" grade="11" />
 <student id="68532" name="Jenny" grade="10" />

Document.xml XML do |document|
 # Want to find all unique students in all classes?
 document.collect {|klass|'student')
 # Want to find all classes with a grade 11 student?'class') {|klass|'student', 'grade' => '11').size > 0
 # how many juniors are in the school?'student', 'grade' => '12').uniq.count

 # Want a pretty list of all classes and the students in them?'class') do |klass|
   print "In class #{klass['id']}:\n"'student') do |student|
     print "\t#{student['name']} (student #{student['id']}, grade #{student['grade']})\n"

I still need to do some work on it, such as getting select/find's fancy search mechanisms to work with more of Enumerable, converting the simple node label recognition into more advanced path-style (think CSS selectors, I guess?) recognition, &c.

In the end I want it to be able to do things more like:

# are any seniors in any classes?
document.any? 'class/student', 'grade' => '12'

Do whatever you want with the code.
It depends on how .exe contents are referenced from the Win32API side. If they aren't presented as local files then you might be able to hack in some code to "virtually" present the contents to the .exe code.

/i have no guarantees that i am sane at the moment
Not as much using a hammer to drill a hole as using a toy drill to drill a hole
No offense, but there's really no reason to be using tables when CSS is easier and simpler.
He wants to add the .DLL to the executable file as if it were an image/sound file.
Programming / Scripting / Web / Re: Project Euler
March 14, 2010, 02:06:46 pm
I was staying up really late and I was doing some really stupid stuff. ><

I'd rather work out most of my algorithms myself. Just because I like the challenge, and it makes me feel special. :V
Video Games / Re: PKMN : Heart Gold + Soul Silver
March 14, 2010, 01:38:30 pm
Yeah, 356/2 doesn't run perfectly, but it nearly rivals the PS2 at near flawless framerates. I wouldn't say that the DS is exactly weak.
Programming / Scripting / Web / Project Euler
March 14, 2010, 01:29:53 am

Lots of interesting math/comp. sci. problems. also has proven to me how much I suck at math/programming.

QuoteFind the sum of all the positive integers which cannot be written as the sum of two abundant numbers.

and my processor is still eating away at #3 and #10 ><

I gave up on #3 for now, my prime number algorithm needs some serious revision. I'm currently taking the factorial of 1,000,000 for my lexicographic permutation prediction algorithm on one core while the other continues to try and find prime numbers up to 2,000,000 (and then add them!).
Quote from: Elite Four NAMKCOR on March 11, 2010, 09:28:03 pm
Quote from: fugo ad te, pikachu! on March 11, 2010, 10:00:06 am
I'm tired of everyone assuming that sexuality is protected under the constitution. I could be wrong, but I'm pretty sure that's not in the main document, and I'm fairly certain it hasn't been amended, either.

    * Ninth Amendment - Protection of rights not specifically enumerated in the Bill of Rights.

    The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

's all I'm sayin

this helped african americans very well, yes.
I do support gay rights. I'm just sick of everyone claiming that it's "unconstitutional" to discriminate against homosexuals. it's definitely not right, but it's also definitely not illegal (yet).

Also, we have now made the front page of Yahoo. That ugly girl, Constance? Yeah, she nearly got me expelled when I said "The Well" to her. I was referring to the nearby suburb "Ryan's Well" and she assumed I was calling her a whale, so she ran off to tell the principal.

also all of the teachers are getting tons of hate mail usually taking the form "HOW COULD YOU NOT TEACH YOUR KIDS ANYTHING" and "I FEEL SO SORRY FOR THE KIDS WHO HAVE TO LIVE THERE." I think it's hilarious, but everyone else who's ever gone to the school is freaking out (a lot of the current students are concerned for their scholarships/&c.)