Skip to content

Instantly share code, notes, and snippets.

View zuchmanski's full-sized avatar

Sebastian Zuchmanski zuchmanski

  • Paladin Software
View GitHub Profile
Section ZadanieOne.
Variables A B C D : Prop.
Theorem impl_rozdz : (A -> B) -> (A -> C) -> A -> B -> C.
Proof.
Qed.
Theorem impl_komp : (A -> B) -> (B -> C) -> A -> C.
Proof.
@zuchmanski
zuchmanski / I tera public
Created March 15, 2013 10:21
I tera public
aaaa
@zuchmanski
zuchmanski / testfile
Created March 15, 2013 10:19
testfile
Hello World!
#include <stdio.h>
int another_function(int x) { return !((~(~0U>>1)|x)&(x-1)); }
int main(void) {
int i;
for (i = 0; i < 256; ++i) printf("%3d: %d\n", i, another_function(i));
return 0;
}
2012/2017 • Re: Ogłoszenia (Tifts)
<div class="codetitle">Code:</div><div class="codecontent">Szanowny Panie,<br><br>   w  "katalogu przedmiotu" na galaxy czyli:<br><br>http://galaxy.agh.edu.pl/~
2012/2017 • Re: Sesja zimowa [2012/2013] (Tifts)
Dodałem algebrę bo już wiadomo.<hr>
2012/2017 • Re: BHP - grupy 5,6 (Tifts)
Owszem zrobią dla nas termin. I to nie tylko dla nas - z EiT cały rocznik nie miał BHP, bo informacja do nich nie dotarła. xD Ustala się termin teraz, ale z gór
2012/2017 • Re: BHP - grupy 5,6 (dickstra)

Rubycious.com

About

Are you bored of constant checking twitter profiles/rss reader to get fresh informations about Ruby? Rubycious.com is a simple website, that collects the most interesting stuff around this great tool. It does just one thing - stores users' links to great resources, which are next presented in nice and clean way.

For what purpose? There is popular Hacker News.

@zuchmanski
zuchmanski / gist:2555974
Created April 30, 2012 06:26
Ruby quick tips
Hash[['foo', 'bar', 'foo', 'baz'].group_by {|s| s}.map {|k, v| [k, v.size]}]
#=> {"foo"=>2, "bar"=>1, "baz"=>1}
['foo', 'bar', 'foo', 'baz'].each_with_object({}) { |v, o| o[v] ||= 0; o[v] += 1 }
#=> {"foo"=>2, "bar"=>1, "baz"=>1}
#sebcioz: programs is a hash containing rows from a mysql query with two fields: program_id and program_name.
#participants is a hash containing rows from a mysql query with several fields, one of which is program_id. I would like to create a third hash that puts participants into groups based on program_id
programs = [{:program_id => 1, :program_name => :a}, {:program_id => 2, :program_name => :b}, {:program_id => 3, :program_name => :c}]
participants = [{:name => :q, :program_id => 1}, {:name => :w, :program_id => 1}, {:name => :e, :program_id => 2}]
groups = participants.group_by { |p| p[:program_id] }
p groups #=> {1=>[{:name=>:q, :program_id=>1}, {:name=>:w, :program_id=>1}], 2=>[{:name=>:e, :program_id=>2}]}
class A
class << self
def a
"a"
end
alias b a
end
# Is a constant defined in a module that is then included in a class, available to instance methods from the module that ended up in that class?
module A
B = "b"
end
class D
include A
def e