This file contains 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/dlls/crypt32/cert.c b/dlls/crypt32/cert.c | |
index 63107e1..5a47a84 100644 | |
--- a/dlls/crypt32/cert.c | |
+++ b/dlls/crypt32/cert.c | |
@@ -179,12 +179,19 @@ end: | |
PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext( | |
PCCERT_CONTEXT pCertContext) | |
{ | |
+ PWINECRYPT_CERTSTORE hcs; | |
TRACE("(%p)\n", pCertContext); |
This file contains 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 'benchmark' | |
Benchmark.bmbm(10) do |x| | |
x.report("noregexp") { | |
"content-management-systems".split("-").map(&:capitalize).join(" "). | |
split(" ").map(&:downcase).join("-") | |
} | |
x.report("rgexp") { | |
"content-management-systems". |
This file contains 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
(when (and (require 'edit-server nil t) (daemonp)) | |
(edit-server-start)) | |
(setq edit-server-url-major-mode-alist | |
'(("github\\|\\(posts\\|questions/\\([0-9]+\\)$\\)" . markdown-mode))) |
This file contains 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
time ruby pinger.rb | |
192.168.1.4 | |
192.168.1.59 | |
192.168.1.90 | |
192.168.1.100 | |
192.168.1.101 | |
192.168.1.102 | |
192.168.1.103 | |
192.168.1.105 | |
192.168.1.107 |
This file contains 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 "forwardable" | |
class TheClass | |
extend Forwardable | |
attr_reader :items | |
def_delegators :@items, :<<, :push | |
def initialize; @items = [] end | |
end |
This file contains 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
# http://en.wikipedia.org/wiki/Reverse_Polish_notation | |
# {method => arity} lookup hash of Float intance methods | |
METHOD_ARITY = Float.instance_methods(false).inject({}) {|ma, (m, _)| | |
ma[m] = 0.0.method(m).arity; ma} | |
def rpn str | |
str.split(/\s+/).inject([]) do |s, t| | |
m = t.to_sym | |
s << case METHOD_ARITY[m] |
This file contains 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 'set' | |
DIGITS = ('0'..'9').to_a | |
def solve alphametics | |
firsts, rests = Set.new, Set.new | |
alphametics.scan(/\w+/) do |w| | |
firsts << w[0] | |
rests += w[1..-1].chars |
This file contains 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
-- http://en.wikipedia.org/wiki/Combination#Example_of_counting_combinations | |
module Main where | |
import Data.Ratio ((%), numerator) | |
combinationSize :: (Integral a) => a -> a -> a | |
combinationSize n k = numerator $ cSize n k | |
where cSize _ 0 = 1 | |
cSize n' k' = (n' - (k' - 1)) % k' * cSize n' (k' - 1) |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
# günlerin türkçe karşılığı için array'imiz | |
DAYS = %w(pazar pazartesi salı çarşamba perşembe cuma cumartesi).freeze | |
# günü key, yılları value olarak hash'a kaydediyoruz | |
day_years = (1900..2011).inject({}) do |dy, year| | |
(dy[Time.utc(year).wday] ||= []) << year | |
dy |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
class Integer | |
# sayi basamaklarini array olarak dondurur | |
def digits | |
self.to_s.split(//).map!(&:to_i) | |
end | |
end |
NewerOlder