Skip to content

Instantly share code, notes, and snippets.

View atomicules's full-sized avatar

atomicules atomicules

View GitHub Profile
#For answering question on Shoes mailing list dmonroe
Shoes.app(:title => "Coplanar Points", :width => 550, :height => 400) do
def calculate
@beex = (@betax.text.to_f-@alphax.text.to_f)
@beey = (@betay.text.to_f-@alphay.text.to_f)
@beez = (@betaz.text.to_f-@alphaz.text.to_f)
@ceex = (@gammax.text.to_f-@alphax.text.to_f)
@ceey = (@gammay.text.to_f-@alphay.text.to_f)
@ceez = (@gammaz.text.to_f-@alphaz.text.to_f)
Figured it out, was to do with Endianness:
http://github.com/i5m/shoes/commit/8dc81deceaa9d8172234c5adad56570da6a5baeb
#Testing differences between Shoes 2 and 3, Ruby 1.8 and Ruby 1.9
#In Shoes 2 (and also version 1229 of Shoes 3 that I built with Ruby 1.8) this code works
#In Shoes 3, then in ui.rb ":attach => Window" must be replaced with ":attach => Shoes::Window"
#as otherwise the error "uninitialized constant UI::Window" occurs.
require 'ui'
Shoes.app do
extend UI
What successful building of Shoes on OSX PPC looks like:
i5m-Powerbook:~ i5m$ cd code/github/shoes/
i5m-Powerbook:shoes i5m$ source use-deps
i5m-Powerbook:shoes i5m$ rake
(in /Users/i5m/code/github/shoes)
rm -rf dist
mkdir -p dist
In file included from /Users/i5m/code/github/shoes/deps/include/ruby-1.9.1/ruby/ruby.h:25,
from /Users/i5m/code/github/shoes/deps/include/ruby-1.9.1/ruby.h:32,
# Dummy line so it doesn't try to pick up encoding from below
# Testing "uninitialized constant Encoding::UTF_16BE" error
# that occurs in Shoes Policeman built with Ruby 1.9.1
# The below works in Shoes 2, but not in Shoes 3
#
# Problem seems to be in CGI
# See \dist\ruby\lib\cgi\utli.rb lines 37 onwards:
=begin
# Unescape a string that has been HTML-escaped
# CGI::unescapeHTML("Usage: foo "bar" <baz>")
# testing mechanize in Ruby 1.9 based Shoes
# Assumes Mechanize is installed local to application
# Others might need this code:
=begin
Shoes.setup do
gem 'mechanize = 0.8.5' #mechanize 0.8.5 saves having to install nokogiri
end
=end
# A simple app to test Keypress, Keydown and Keyup functionality
# Reports key being pressed and changes colour with change in state
Shoes.app do
@keypress = para "Keypress: "
para "\n"
@keydown = para "Keydown:"
para "\n"
@keyup = para "Keyup: "
@kpff = 0
@kdff = 0
=================
Last 20 lines...
=================
./shoes/native.h:22: warning: function declaration isn’t a prototype
./shoes/native.h:24: warning: function declaration isn’t a prototype
./shoes/native.h:40: warning: function declaration isn’t a prototype
shoes/http/nsurl.m: In function ‘-[ShoesHttp readHeaders:]’:
shoes/http/nsurl.m:114: warning: assignment discards qualifiers from pointer target type
shoes/http/nsurl.m:116: warning: assignment discards qualifiers from pointer target type
@atomicules
atomicules / gist:32f17cf337b3da0f2661
Last active August 29, 2015 14:16
Microformats and nested h-cite question. Moved here: http://simp.ly/publish/MSD9YN
We couldn’t find that file to show.
@atomicules
atomicules / atom2rss.xsl
Last active August 29, 2015 14:01
My slight modification (as rev 2 of this gist) to the atom2rss.xsl file from here: https://kiza.eu/software/snownews/snowscripts/extensions/script/atom2rss/
<?xml version="1.0"?>
<!-- Atom to RSS 1.0 Transformation, written by Rene Puls (rpuls@kcore.de) -->
<!-- Snownews filter command for this extension: "xsltproc /path/to/atom2rss -" -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"