- Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
- Models and Issues in Data Stream Systems
- Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
- Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
- [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
require 'delegate' | |
module Support | |
class WarningFilter < DelegateClass(IO) | |
def write(line) | |
super if line !~ /^\S+gems\/ruby\-\S+:\d+: warning:/ | |
end | |
end | |
end |
module Reportable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Chain on a scope and specify the fields to extract. | |
# Example: | |
# User.enabled.report %{ | |
# :email_opt_in, | |
# 'created_at as sign_up_date' | |
# } |
require "thread" | |
class BoundedQueue | |
def initialize(max_size = :infinite) | |
@lock = Mutex.new | |
@items = [] | |
@item_available = ConditionVariable.new | |
@max_size = max_size | |
@space_available = ConditionVariable.new | |
end |
### pfx to pem, complete edition: | |
$ openssl pkcs12 -in filename.pfx -nocerts -out key.pem | |
$ openssl pkcs12 -in filename.pfx -clcerts -nokeys -out cert.pem | |
$ openssl pkcs12 -in filename.pfx -cacerts -out ca_cert.pem |
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
brew update | |
brew versions ruby | |
2.0.0-p247 git checkout 6504994 /usr/local/Library/Formula/ruby.rb | |
2.0.0-p195 git checkout dad5917 /usr/local/Library/Formula/ruby.rb | |
2.0.0-p0 git checkout 3085c40 /usr/local/Library/Formula/ruby.rb | |
1.9.3-p392 git checkout 6c26d0a /usr/local/Library/Formula/ruby.rb | |
1.9.3-p385 git checkout e5b9678 /usr/local/Library/Formula/ruby.rb | |
#Install last ruby 1.9 |
# Put that on config/environments/production.rb | |
config.assets.precompile << lambda do |path| | |
if path =~ /\.(css|js)\z/ | |
full_path = Rails.application.assets.resolve(path).to_path | |
app_assets_path = Rails.root.join('app', 'assets').to_path | |
return true if full_path.starts_with? app_assets_path | |
end | |
false | |
end |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
-
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the
secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection. -
Use production SSL certificates locally. This is annoying
class BankBillet | |
include HTTParty | |
include Virtus | |
base_uri 'https://app.cobregratis.com.br' | |
attribute :id, Integer | |
attribute :name, String | |
attribute :amount, Float | |
attribute :expire_at, Date | |
attribute :external_link, String |