Skip to content

Instantly share code, notes, and snippets.

View astro's full-sized avatar

Astro astro

View GitHub Profile
# -*- coding: utf-8 -*-
require 'nokogiri'
require 'iconv'
DOC = <<EOD
<?xml version="1.0" encoding="UTF-8"?>
<r>Gauß</r>
EOD
pp = Nokogiri::XML::SAX::PushParser.new
-- not ready !!!1!
import Random
data Point
-- X, Y
= Float Float
deriving (Show, Eq)
data Values = None
-- Point1, Angle1, Angle2, Point2
# http://www.cs.toronto.edu/~roweis/data/mnist_{train,test}{0..9}.jpg
require 'RMagick'
include Magick
require 'ai4r'
W, H = 14, 14
IW, IH = 28, 28
class Picture
attr_reader :digit
-- I didn't read
-- http://www.cs.tufts.edu/~nr/comp150fp/archive/richard-bird/sudoku.pdf
-- too carefully.
import Array
import Control.Monad (forM_)
import Data.List (delete, intercalate)
import System.CPUTime (getCPUTime)
import Control.Parallel.Strategies
-- http://svn.pugscode.org/pugs/examples/adventure/adventure.pl
import Data.Char as Char
import Data.List (intercalate)
import Text.ParserCombinators.Parsec
import Control.Monad.State.Lazy
import System.Console.Editline.Readline
--
-- Parser
[6 of 9] Compiling Neuronal.Operations ( Neuronal/Operations.hs, Neuronal/Operations.o )
Neuronal/Operations.hs:42:33:
Couldn't match expected type `forall n. (Num n) => n'
against inferred type `Double'
In the first argument of `OpState', namely `opLinkWeight'
In the second argument of `($)', namely
`OpState opLinkWeight opNet'
In the expression: return $ OpState opLinkWeight opNet
require 'nokogiri'
doc = Nokogiri::XML::Document.new
loop do
n = Nokogiri::XML::Element.new('e', doc)
n.add_namespace(nil, 'http://example.com')
end
#!/usr/bin/env ruby1.8
#
# Copyright 2009 Astro <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# /etc/nsswitch.conf
passwd: compat
group: compat
shadow: compat
hosts: files dns [NOTFOUND=continue] mdns4_minimal [NOTFOUND=continue] mdns6_minimal [NOTFOUND=continue] mdns4 [NOTFOUND=continue] mdns6
networks: files
protocols: db files
#!/usr/bin/env ruby
HOSTS = %w(hummer astrom dn42 ldap wiefelspuetz astron icq www1 zardoz jabber1 debcache jabber2 unsafe dhcp kdc utur).map{ |s| "#{s}.hq.c3d2.de" }
=begin
Forward-resolves HOSTS and puts their IPv6 addresses suitable for BIND
reverse-lookup zonefiles.
=end