This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ex_01: | |
files: | |
exercise_1.sql: "a039ffa2642542d5ff25b2926b4eb7db" | |
points: 2 | |
ex_02: | |
files: | |
trafic_entrant2013.xls: "54a7108f8d31d930c87341ce01ff7410" | |
trafic_entrant2014.xls: "275f8d14fe17bd6e89ee55d43feb7883" | |
points: 1 | |
ex_03: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SeLogerScrap < ScrapBase | |
BASE_URL = ["http://ws.seloger.com/search.xml?cp=", "&tri=prix&fraicheur=1&idtt=2&idtypebien=1,2,4,13"] | |
IMAGE_LOADER = ->(e) { | |
nphotos = e.search("photos photo stdurl").map(&:text) | |
bphotos = e.search("photos photo bigurl").map(&:text) | |
photos = nphotos | |
nphotos.size.times do |i| | |
nphotos[i] = bphotos[i] unless bphotos[i].empty? | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- View: public."Count of votes by meeting" | |
-- DROP VIEW public."Count of votes by meeting"; | |
CREATE OR REPLACE VIEW public."Count of votes by meeting" AS | |
SELECT tm.uuid AS "Meeting uuid", | |
count(tud1.id) AS "Count of yes", | |
count(tud2.id) AS "Count of no", | |
count(tud3.id) AS "Count of maybe", | |
count(tud4.id) AS "Count of NULL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calculator;def self.calculate s; m = s.match(/\A(\d+) ([\+\-\*\/\%]) (\d+)\Z/)&.to_a&.map{|e| Integer(e) rescue e } and return m[1].send(m[2], m[3]) or return "Error"; end;end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Normale | |
class Class | |
attr_accessor :standard_deviation, :esperance | |
def initialize standard_deviation: 1.0, esperance: 0.0 | |
@standard_deviation = Float(standard_deviation) | |
@esperance = Float(esperance) | |
end | |
def greater_than a | |
1 - repartition(a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Bench1C { | |
public: static unsigned long long incr() { | |
unsigned long long a = 0; | |
for (unsigned long long i = 0; i < 999999999; i++) { | |
a = a + 1; | |
} | |
return a; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "./bench1_c/*" | |
module Bench1C | |
# TODO Put your code here | |
def self.incr : UInt64 | |
a = 0_u64 | |
(0...999999999).each do |i| | |
a = a + 1 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/http/request.cr b/src/http/request.cr | |
index 5c005ee..0deffcf 100644 | |
--- a/src/http/request.cr | |
+++ b/src/http/request.cr | |
@@ -87,7 +87,7 @@ class HTTP::Request | |
value | |
end | |
- private def uri | |
+ def uri |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Note: this code works also in crystal :) | |
# Just replace the shebang "ruby" by "crystal" or build it | |
require "tempfile" | |
require "uri" | |
uploader = ENV.fetch("TRANSFER_HOST") { "https://up.nephos.xyz" } | |
base = File.basename(ARGV[0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'prawn' | |
require 'prawn/templates' | |
module Watermarker | |
def apply(document, image_path, page_idx = 1, image_opts = {}, text_data = nil, text_opts = {}) | |
document.go_to_page page_idx | |
document.image image_path, image_opts if image_path |