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
premium_yearly_sub = Subscription.all.detect{|s| s.subscription_type.name == 'yearly' && s.product.name == "aupeo-premium"} | |
saved = 0 | |
sub_mappings = SubscriptionMapping.where(external_subscription_id: "com.aupeo.subscription.europe.yearly") | |
sub_mappings.each do |sm| | |
sm.subscription_id = premium_yearly_sub.id | |
if sm.save | |
puts "Subscription mapping's subscription_id was set for #{sm.country_code}" | |
saved +=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
german@german-HP-ProBook-4540s ➜ mmc-filter-client git:(MMC-556-Pagination) gco stable | |
Branch stable set up to track remote branch stable from origin. | |
Switched to a new branch 'stable' | |
german@german-HP-ProBook-4540s ➜ mmc-filter-client git:(stable) git pull origin stable | |
From github.com:aupeo/mmc-filter-client | |
* branch stable -> FETCH_HEAD | |
Already up-to-date. | |
german@german-HP-ProBook-4540s ➜ mmc-filter-client git:(stable) gco master | |
Switched to branch 'master' | |
Your branch is up-to-date with 'origin/master'. |
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
import math, sys | |
def formula(x, mu, sigma): | |
exp = math.exp(- ((x - mu)**2) / (2*sigma**2)) | |
return 1.0 / (sigma * math.sqrt(2*math.pi)) * exp | |
x_cli = float(sys.argv[1]) | |
mu_cli = float(sys.argv[2]) | |
sigma_cli = float(sys.argv[3]) | |
print(formula(x_cli, mu_cli, sigma_cli)) |
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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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
Матрица: неизвестный финал | |
Теперь я наконец нашёл ответы на те глупые дыры в сюжете, что мучили меня в первом фильме. Это... Это просто гениально. | |
Многие кинокритики отмечают, что после концептуальной «Матрицы номер один» ее продолжения слишком сильно отдавали желанием заработать как можно больше денег на успехе предыдущей картины, чтобы считаться достойными фильма-предшественника. Возможно, все могло выглядеть совсем по-другому... | |
Многие считают, что братья (тогда еще) Вачовски, собственно, сотворили один-единственный фильм, на славе которого и строили всю свою последующую карьеру. Первая «Матрица» гениальна. Вторая и третья части трилогии далеко ушли в сторону чистой коммерции, и этим слегка подпортили послевкусие, но то, что оригинальная картина оказалась выше всех и всяческих похвал - это уж точно. | |
К сожалению, переполнив сногсшибательными спецэффектами продолжения, забив их под завязку персонажами и второстепенными событиями, авторы «Матрицы» утратили обжигающую простоту оригинала, чему своеобразный |
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
-module(substrings). | |
-compile(export_all). | |
substring(Set, T, Start, LengthOfSubstr) -> | |
S = lists:sublist(T, Start, LengthOfSubstr), | |
StringLength = string:len(T), | |
if | |
(Start >= StringLength) or (S =:= []) -> sets:to_list(Set); | |
%% substring is eql to string || start position + length of substring greater or equal to string's length |
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
-module(polynom). | |
-export([digest/1, polynom/1]). | |
%% auxiliary functions | |
to_power_acc(_, Acc, 0) -> Acc; | |
to_power_acc(X, Acc, Power) -> to_power_acc(X, (Acc * X), (Power - 1)). | |
to_power(X, Power) -> to_power_acc(X, 1, Power). | |
concat_list_acc([], Acc) -> Acc; | |
concat_list_acc([H|T], Acc) -> concat_list_acc(T, string:concat(Acc, H)). |
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
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
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
let(:vehicle) { FactoryGirl.create(:vehicle, vehicle_attributes) } | |
let(:vehicle_attributes) { {} } | |
describe "#to_s" | |
subject { vehicle.to_s } | |
let(:vehicle_attributes) { {name: "Carzilla"} } | |
it { should == "Carzilla" } | |
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
#include “mruby.h” | |
#include “mruby/proc.h” | |
#include <stdio.h> | |
void _error(const char* s){ | |
printf("ERROR: %s\n", s); | |
exit(1); | |
} | |
int main() { |
NewerOlder