text
stringlengths
4
5.48M
meta
stringlengths
14
6.54k
package pl.stqa.ptf.sandbox; import org.testng.Assert; import org.testng.annotations.Test; public class EquationTest { @Test public void test0() { Equation e = new Equation(1, 1, 1); Assert.assertEquals(e.rootNumber(), 0); } @Test public void test1() { Equation e = new Equation(1, 2, 1); Assert.assertEquals(e.rootNumber(), 1); } @Test public void test2() { Equation e = new Equation(1, 4, 1); Assert.assertEquals(e.rootNumber(), 2); } @Test public void test_000() { Equation e = new Equation(0, 0, 0); Assert.assertEquals(e.rootNumber(), -1); } @Test public void test001() { Equation e = new Equation(0, 0, 1); Assert.assertEquals(e.rootNumber(), 0); } @Test public void test011() { Equation e = new Equation(0, 1, 1); Assert.assertEquals(e.rootNumber(), 1); } }
{'content_hash': '78b4e6efb3605b32574dc5dfd1e88853', 'timestamp': '', 'source': 'github', 'line_count': 41, 'max_line_length': 48, 'avg_line_length': 22.902439024390244, 'alnum_prop': 0.56975505857295, 'repo_name': 'Weronika-qa/java_ptf', 'id': '61cc54db9cd15d9972bd9b8b5391ded58cc45821', 'size': '939', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'sandbox/src/test/java/pl/stqa/ptf/sandbox/EquationTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '2102'}, {'name': 'Java', 'bytes': '14789'}, {'name': 'Shell', 'bytes': '5216'}]}
class CPPGUISHARED_EXPORT ClickableLabel : public QLabel { Q_OBJECT public: ClickableLabel(QWidget* parent = 0); protected: void mouseReleaseEvent(QMouseEvent* event); signals: ///Signal that is emitted when the label is clicked - the position is global! void clicked(QPoint pos); }; #endif // CLICKABLELABEL_H
{'content_hash': '1263085418f3ff096c9e0d6acd557b6e', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 78, 'avg_line_length': 18.941176470588236, 'alnum_prop': 0.7515527950310559, 'repo_name': 'marc-sturm/cppGUI', 'id': 'f63c18168f230879d7ff968e7395b1f0d24918be', 'size': '479', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ClickableLabel.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '234'}, {'name': 'C++', 'bytes': '81491'}, {'name': 'QMake', 'bytes': '1423'}]}
var slack = require('./slack/index.js'); exports.slack = slack; var slack = require('./slack/index.js'); exports.slack = slack; var pkg = require('./pkg/index.js'); exports.pkg = pkg; var slackpack = require('./slackpack/index.js'); exports.slackpack = slackpack; var slackpack_md = require('./slackpack_md/index.js'); exports.slackpack_md = slackpack_md;
{'content_hash': 'b305734985a76b11d766dcf8d1f026d6', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 54, 'avg_line_length': 35.6, 'alnum_prop': 0.7078651685393258, 'repo_name': 'bozzzzo/quark', 'id': '07aa9d6056c8e14bea7832be4a13c785f97dcdeb', 'size': '356', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'quarkc/test/emit/expected/js/slackpack/index.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '496221'}, {'name': 'JavaScript', 'bytes': '466971'}, {'name': 'Python', 'bytes': '590150'}, {'name': 'Shell', 'bytes': '1328'}]}
package.path = package.path .. ";src/?.lua" require 'torch' require 'rnn' require 'optim' local UniversalSchemaEncoder = torch.class('UniversalSchemaEncoder') --- Utils --- function UniversalSchemaEncoder:to_cuda(x) return self.params.gpuid >= 0 and x:cuda() or x:double() end function UniversalSchemaEncoder:__init(params, row_table, row_encoder, col_table, col_encoder, use_entities) self.__index = self self.correct_label = 1 self.params = params self.opt_config = { learningRate = self.params.learningRate, epsilon = self.params.epsilon, beta1 = self.params.beta1, beta2 = self.params.beta2, momentum = self.params.momentum, learningRateDecay = self.params.decay } self.opt_state = {} self.train_data = self:load_train_data(params.train, use_entities) -- cosine distance network for evaluation self.cosine = self:to_cuda(nn.CosineDistance()) -- either load model from file or initialize new one if params.loadModel ~= '' then local loaded_model = torch.load(params.loadModel) self.net = self:to_cuda(loaded_model.net) col_encoder = self:to_cuda(loaded_model.col_encoder or loaded_model.encoder) row_encoder = self:to_cuda(loaded_model.row_encoder or loaded_model.row_table) col_table = col_encoder:findModules('nn.LookupTable')[1] -- assumes the encoder has exactly 1 lookup table row_table = row_encoder:findModules('nn.LookupTable')[1] self.opt_state = loaded_model.opt_state for key, val in pairs(loaded_model.opt_state) do if (torch.type(val) == 'torch.DoubleTensor') then self.opt_state[key] = self:to_cuda(val) end end else self.net = self:build_network(row_encoder, col_encoder) end self.row_table = row_table self.col_table = col_table self.col_encoder = col_encoder self.row_encoder = row_encoder -- set the criterion if params.criterion == 'bpr' then require 'nn-modules/BPRLoss'; self.crit = nn.BPRLoss() elseif params.criterion == 'hinge' then self.crit = nn.MarginRankingCriterion(self.params.margin) elseif params.criterion == 'bce' then self.crit = nn.BCECriterion() else print('Must supply option to criterion. Valid options are: bpr, bce and hinge'); os.exit() end self:to_cuda(self.crit) end --[[ a function that takes the the output of {pos_row_encoder, col_encoder, neg_row_encoder} and returns {pos score, neg score} ]]-- -- layers to compute the dot prduct of the positive and negative samples function UniversalSchemaEncoder:build_scorer() local pos_score = nn.Sequential() :add(nn.NarrowTable(1, 2)):add(nn.CMulTable()):add(nn.Sum(2)) local neg_score = nn.Sequential() :add(nn.NarrowTable(2, 2)):add(nn.CMulTable()):add(nn.Sum(2)) local score_table = nn.ConcatTable() :add(pos_score):add(neg_score) return score_table end function UniversalSchemaEncoder:build_network(pos_row_encoder, col_encoder) local neg_row_encoder = pos_row_encoder:clone() -- load the eps and rel local loading_par_table = nn.ParallelTable() loading_par_table:add(pos_row_encoder) loading_par_table:add(col_encoder) loading_par_table:add(neg_row_encoder) -- add the parallel dot products together into one sequential network local net = nn.Sequential() :add(loading_par_table) :add(self:build_scorer()) -- put the networks on cuda self:to_cuda(net) -- need to do param sharing after tocuda pos_row_encoder:share(neg_row_encoder, 'weight', 'bias', 'gradWeight', 'gradBias') return net end ----- TRAIN ----- function UniversalSchemaEncoder:train(num_epochs) num_epochs = num_epochs or self.params.numEpochs -- optim stuff local parameters, gradParameters = self.net:getParameters() -- self:evaluate(0) -- make sure model save dir exists if self.params.saveModel ~= '' then os.execute("mkdir -p " .. self.params.saveModel) end local best_map = -1 for epoch = 1, num_epochs do self.net:training() local startTime = sys.clock() local batches = self:gen_training_batches(self.train_data) local shuffle = torch.randperm(#batches) local epoch_error = 0 print('Starting epoch '.. epoch .. ' of ' .. num_epochs) for i = 1, #batches do local batch = self.params.shuffle and batches[shuffle[i]] or batches[i] local example = batch.data local label = batch.label epoch_error = epoch_error + self:optim_update(self.net, self.crit, example, label, parameters, gradParameters, self.opt_config, self.opt_state, epoch) if (i % 25 == 0) then io.write(string.format('\r%.2f percent complete\tspeed = %.2f examples/sec\terror = %.4f', 100 * i / (#batches), (i * self.params.batchSize) / (sys.clock() - startTime), (epoch_error / i))) io.flush() end end print(string.format('\nEpoch error = %f\n', epoch_error)) if (epoch % self.params.evaluateFrequency == 0 and epoch < num_epochs) then local map = self:evaluate(epoch) if map == -1 then self:save_model(epoch-1) elseif map > best_map then self:save_model('best'); best_map = map end end end local map = self:evaluate(num_epochs) if map == -1 then self:save_model(num_epochs) elseif map > best_map then self:save_model('best'); best_map = map end end function UniversalSchemaEncoder:optim_update(net, criterion, x, y, parameters, grad_params, opt_config, opt_state, epoch) local err y = self:to_cuda(y) local function fEval(parameters) if parameters ~= parameters then parameters:copy(parameters) end net:zeroGradParameters() local pred = net:forward(x) err = criterion:forward(pred, y) local df_do = criterion:backward(pred, y) net:backward(x, df_do) if net.forget then net:forget() end if self.params.l2Reg > 0 then grad_params:add(self.params.l2Reg, parameters) end if self.params.clipGrads > 0 then local grad_norm = grad_params:norm(2) if grad_norm > self.params.clipGrads then grad_params = grad_params:div(grad_norm/self.params.clipGrads) end end if self.params.freezeRow >= epoch then self.row_encoder:zeroGradParameters() end if self.params.freezeCol >= epoch then self.col_encoder:zeroGradParameters() end return err, grad_params end optim[self.params.optimMethod](fEval, parameters, opt_config, opt_state) self:regularize_hooks() opt_config.learningRate = self.params.learningRate y = y:double() return err end function UniversalSchemaEncoder:regularize_hooks() if self.params.colNorm > 0 then self.col_table.weight:renorm(2, 2, self.params.colNorm) end if self.params.rowNorm > 0 then self.row_table.weight:renorm(2, 2, self.params.rowNorm) end end function UniversalSchemaEncoder:gen_training_batches(data, shuffle) shuffle = shuffle or true local batches = {} -- new 3 col format if data.num_cols or data.col then if #data > 0 then for seq_size = 1, self.params.maxSeq and math.min(self.params.maxSeq, #data) or #data do if data[seq_size] and data[seq_size].row then local neg_size = self.row_table and self.row_table.weight:size(1) or 0 self:gen_subdata_batches_three_col(data, data[seq_size], batches, neg_size, shuffle) end end else self:gen_subdata_batches_three_col(data, data, batches, self.row_table.weight:size(1), shuffle) end else -- old 4 col format if #data > 0 then for seq_size = 1, self.params.maxSeq and math.min(self.params.maxSeq, #data) or #data do if data[seq_size] and data[seq_size].ep then self:gen_subdata_batches_four_col(data, data[seq_size], batches, data.num_eps, shuffle) end end else self:gen_subdata_batches_four_col(data, data, batches, data.num_eps, shuffle) end end return batches end function UniversalSchemaEncoder:gen_subdata_batches_four_col(data, sub_data, batches, max_neg, shuffle) local start = 1 local rand_order = shuffle and torch.randperm(sub_data.ep:size(1)):long() or torch.range(1, sub_data.ep:size(1)):long() while start <= sub_data.ep:size(1) do local size = math.min(self.params.batchSize, sub_data.ep:size(1) - start + 1) local batch_indices = rand_order:narrow(1, start, size) local pos_ep_batch = sub_data.ep:index(1, batch_indices) local neg_ep_batch = self:gen_neg(data, pos_ep_batch, size, max_neg) local rel_batch = self.params.colEncoder == 'lookup-table' and sub_data.rel:index(1, batch_indices) or sub_data.seq:index(1, batch_indices) local batch = { pos_ep_batch, rel_batch, neg_ep_batch} table.insert(batches, { data = batch, label = torch.ones(size) }) start = start + size end end function UniversalSchemaEncoder:gen_subdata_batches_three_col(data, sub_data, batches, max_neg, shuffle) local start = 1 local rand_order = shuffle and torch.randperm(sub_data.row:size(1)):long() or torch.range(1, sub_data.row:size(1)):long() while start <= sub_data.row:size(1) do local size = math.min(self.params.batchSize, sub_data.row:size(1) - start + 1) local batch_indices = rand_order:narrow(1, start, size) local pos_row_batch = self.params.rowEncoder == 'lookup-table' and sub_data.row:index(1, batch_indices) or sub_data.row_seq:index(1, batch_indices) local neg_row_batch = self:gen_neg(data, pos_row_batch, size, max_neg) local col_batch = self.params.colEncoder == 'lookup-table' and sub_data.col:index(1, batch_indices) or sub_data.col_seq:index(1, batch_indices) local batch = {pos_row_batch, col_batch, neg_row_batch} table.insert(batches, { data = batch, label = torch.ones(size) }) start = start + size end end function UniversalSchemaEncoder:gen_neg(data, pos_batch, neg_sample_count, max_neg) local neg_batch if max_neg == 0 then neg_batch = pos_batch:clone():fill(0) elseif self.params.rowEncoder == 'lookup-table' then neg_batch = torch.rand(neg_sample_count):mul(max_neg):floor():add(1):view(pos_batch:size()) else -- we want to draw a negative sample length weighted by how common that lenght is in our data if not self.sizes then local sizes = {} for i = 1, data.max_length do if data[i] and data[i].count then sizes[i] = data[i].count else sizes[i] = 0 end end self.sizes = torch.Tensor(sizes) end local neg_length = torch.multinomial(self.sizes, 1)[1] while (not (data[neg_length] and data[neg_length].count) or data[neg_length].count < neg_sample_count) do neg_length = torch.multinomial(self.sizes, 1)[1] end -- select 'size' random samples from the selected sequence length local rand_indices = {} while #rand_indices < neg_sample_count do table.insert(rand_indices, torch.rand(1):mul(data[neg_length].row:size(1)):floor():add(1)[1]) end local rand_order = torch.LongTensor(rand_indices) local batch_indices = rand_order:narrow(1, 1, neg_sample_count) neg_batch = data[neg_length].row_seq:index(1, batch_indices) end return neg_batch end ----- Evaluate ---- function UniversalSchemaEncoder:evaluate(epoch) self.net:evaluate() local map = self.params.test ~= '' and self:map(self.params.test, true) or -1 local mrr, hits_at_10 = self.params.fb15kDir ~= '' and self:fb15k_evluation(self.params.fb15kDir, true) or -1, -1 if self.params.vocab ~= '' and self.params.tacYear ~= '' then self:tac_eval(self.params.saveModel .. '/' .. epoch, self.params.resultDir .. '/' .. epoch, self.params.evalArgs) end self.net:clearState() return map end function UniversalSchemaEncoder:map(dirStr, high_score) print('Calculating MAP') local map = 0.0 local file_count = 0 for file in io.popen('ls ' .. dirStr):lines() do local ap = self:avg_precision(dirStr..'/'..file, high_score) * 100 map = map + ap file_count = file_count + 1 io.write(string.format('\rcurrent map : %2.3f \t last ap : %2.3f\t%s', (map / math.max(file_count, 1)), ap, file)); io.flush() end map = map / math.max(1.0, file_count) print(string.format('\nMAP : %2.3f\n', map)) return map end function UniversalSchemaEncoder:avg_precision(file, high_score) local data = torch.load(file) -- score each of the test samples local scores, labels = self:score_test_data(data) -- sort scores and attach the original labels correctly local sorted_scores, sorted_idx = torch.sort(scores, 1, high_score) local sorted_labels = labels:index(1, sorted_idx) -- TODO : stupid calc, use torch local ap = 0.0 local pos_n = 0 -- iterate over all the scored data for rank = 1, sorted_labels:size(1) do -- if label is true, increment positive count and update avg p if (sorted_labels[rank] == self.correct_label) then ap = ((ap * pos_n) / (pos_n + 1)) + (1.0 / rank) pos_n = pos_n + 1 end end return ap end function UniversalSchemaEncoder:fb15k_evluation(dir, high_score) local mrr = 0 local hits_at_10 = 0 local count = 0 local orig_batch_size = self.params.batchSize self.params.batchSize = self.params.batchSize*10 for file in io.popen('ls ' .. dir):lines() do local data = torch.load(dir..'/'..file) for _, sub_data in pairs(data) do -- score each of the test samples local scores, labels = self:score_subdata(sub_data) -- sort scores and attach the original labels correctly local sorted_scores, sorted_idx = torch.sort(nn.JoinTable(1)(scores), 1, high_score) local sorted_labels = labels:index(1, sorted_idx) local rank = 1 -- find the rank of the true fact while(rank < sorted_labels:size(1) and sorted_labels[rank] == 0) do rank=rank+1 end if rank <= 10 then hits_at_10 = hits_at_10 + 1 end count = count + 1 mrr = mrr + (1/rank) io.write(string.format('\rmrr : %2.3f \t hits@10 : %2.3f \t%s', (mrr/count)*100, (hits_at_10/count)*100, file)); io.flush() end end self.params.batchSize = orig_batch_size mrr = mrr / count * 100 hits_at_10 = hits_at_10 / count * 100 io.write(string.format('\nMRR : %2.3f \t hits@10 : %2.3f\n', mrr, hits_at_10)); io.flush() return mrr, hits_at_10 end function UniversalSchemaEncoder:score_test_data(data) local scores = {} local labels = {} if #data > 0 or data.ep == nil then for _, dat in pairs(data) do if dat and torch.type(dat) ~= 'number' and (dat.ep or dat.row_seq) then local score, label = self:score_subdata(dat, scores, labels) table.insert(scores, score) table.insert(labels, label) end end else local score, label = self:score_subdata(data, scores, labels) table.insert(scores, score) table.insert(labels, label) end scores = nn.JoinTable(1)(nn.FlattenTable()(scores)) labels = nn.JoinTable(1)(labels) return scores:view(scores:size(1)), labels end function UniversalSchemaEncoder:score_subdata(sub_data) local batches = {} if sub_data.ep then self:gen_subdata_batches_four_col(sub_data, sub_data, batches, 0, false) else self:gen_subdata_batches_three_col(sub_data, sub_data, batches, 0, false) end local scores = {} for i = 1, #batches do local row_batch, col_batch, _ = unpack(batches[i].data) if self.params.colEncoder == 'lookup-table' then col_batch = col_batch:view(col_batch:size(1), 1) end if self.params.rowEncoder == 'lookup-table' then row_batch = row_batch:view(row_batch:size(1), 1) end local encoded_rel = self.col_encoder(self:to_cuda(col_batch)):squeeze():clone() local encoded_ent = self.row_encoder(self:to_cuda(row_batch)):squeeze() local x = { encoded_rel, encoded_ent } local score = self.cosine(x):double() table.insert(scores, score) end return scores, sub_data.label:view(sub_data.label:size(1)) end function UniversalSchemaEncoder:tac_eval(model_file, out_dir, eval_args) os.execute("mkdir -p " .. model_file) local cmd = '${TH_RELEX_ROOT}/bin/tac-evaluation/tune-thresh.sh ' .. self.params.tacYear .. ' ' .. model_file..'-model' .. ' ' .. self.params.vocab .. ' ' .. self.params.gpuid ..' ' .. self.params.maxSeq .. ' ' .. out_dir .. ' "' .. eval_args:gsub(',',' ') .. '" >& ' .. model_file .. '/tac-eval.log &' print(cmd) os.execute(cmd) end --- IO ---- function UniversalSchemaEncoder:load_train_data(data_file, entities) local train = torch.load(data_file) -- new 3 col format if train.num_cols then if #train > 0 then for i = 1, self.params.maxSeq do if train[i] and train[i].row then train[i] = self:load_sub_data_three_col(train[i]) end end else self:load_sub_data_four_col(train, entities) end else -- old 4 col format if #train > 0 then for i = 1, self.params.maxSeq do if train[i] and train[i].ep then train[i] = self:load_sub_data_four_col(train[i], entities) end end else self:load_sub_data_four_col(train, entities) end end return train end function UniversalSchemaEncoder:load_sub_data_four_col(sub_data, entities) if entities then if self.params.rowEncoder == 'lookup-table' then sub_data.e1 = sub_data.e1:squeeze() sub_data.e2 = sub_data.e2:squeeze() end else if self.params.rowEncoder == 'lookup-table' and sub_data.ep:dim() > 1 and sub_data.ep:size(1) > 1 then sub_data.ep = sub_data.ep:squeeze() end end if self.params.colEncoder == 'lookup-table' then if self.params.relationPool == '' then sub_data.rel = sub_data.rel:squeeze() else sub_data.rel = sub_data.rel:view(sub_data.rel:size(1), sub_data.rel:size(2)) end else if sub_data.seq:dim() == 1 then sub_data.seq = sub_data.seq:view(sub_data.seq:size(1), 1) end end return sub_data end function UniversalSchemaEncoder:load_sub_data_three_col(sub_data, entities) if self.params.rowEncoder == 'lookup-table' and sub_data.row:dim() > 1 and sub_data.row:size(1) > 1 then sub_data.row = sub_data.row:squeeze() else sub_data.row_seq = self:to_cuda(sub_data.row_seq) if sub_data.row_seq:dim() == 1 then sub_data.row_seq = sub_data.row_seq:view(sub_data.row_seq:size(1), 1) end end if self.params.colEncoder == 'lookup-table' and self.params.relationPool == '' and sub_data.col:dim() > 1 and sub_data.col:size(1) > 1 then sub_data.col = sub_data.col:squeeze() else if sub_data.col_seq:dim() == 1 then sub_data.col_seq = sub_data.col_seq:view(sub_data.col_seq:size(1), 1) elseif self.params.modelType == 'max' and sub_data.col_seq:dim() == 2 then sub_data.col_seq = sub_data.col_seq:view(sub_data.col_seq:size(1), 1, sub_data.col_seq:size(2)) end end return sub_data end function UniversalSchemaEncoder:save_model(model_name) if self.params.saveModel ~= '' then self.net:clearState() local cpu_opt = {} for k,v in pairs(self.opt_state) do cpu_opt[k] = torch.type(v) == 'torch.CudaTensor' and v:double() or v end torch.save(self.params.saveModel .. '/' .. model_name .. '-model', {net = self.net:clone():float(), col_encoder = self.col_encoder:clone():float(), row_encoder = self.row_encoder:clone():float(), opt_state = cpu_opt}) torch.save(self.params.saveModel .. '/' .. model_name .. '-rows', self.params.gpuid >= 0 and self.row_table.weight:double() or self.row_table.weight) torch.save(self.params.saveModel .. '/' .. model_name .. '-cols', self.params.gpuid >= 0 and self.col_table.weight:double() or self.col_table.weight) end end function UniversalSchemaEncoder:write_embeddings_to_txt() local function write_embeddings(f, embeddings) local file = io.open(f, "w") io.output(file) for i = 1, embeddings:size(1) do for j = 1, embeddings:size(2) do io.write(embeddings[i][j] .. ' ') end io.write('\n') end io.close() end end
{'content_hash': '78844482dae326355063b478cee2c493', 'timestamp': '', 'source': 'github', 'line_count': 486, 'max_line_length': 162, 'avg_line_length': 43.05761316872428, 'alnum_prop': 0.6347605849182835, 'repo_name': 'patverga/torch-relation-extraction', 'id': '9fe98a228891d130f9cc9e7e07dae5f7e427ae1e', 'size': '20962', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/UniversalSchemaEncoder.lua', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '97363'}, {'name': 'Lua', 'bytes': '151312'}, {'name': 'Python', 'bytes': '40183'}, {'name': 'Shell', 'bytes': '36062'}]}
using PatternBuffer; using System; using System.Collections.Generic; namespace Test.Reference { public class AbstractReferenceObject : IReferenceTestObject, IEquatable<AbstractReferenceObject> { public const ushort TYPE_ID = 24; public ushort TypeId { get { return TYPE_ID; } } public AbstractThing Thing; // (optional) public AbstractReferenceObject() { this.Thing = default(AbstractThing); } public AbstractReferenceObject( AbstractThing thing ) { this.Thing = thing; } public bool Equals(AbstractReferenceObject other) { return this.Equals((object)other); } public override bool Equals(object other) {; if (Object.ReferenceEquals(this, other)) { return true; } if ( ! (other is AbstractReferenceObject)) { return false; } AbstractReferenceObject that = (AbstractReferenceObject)other; if (this.GetHashCode() != that.GetHashCode()) return false; // Thing (optional) if ( ! (this.Thing == null && that.Thing == null)) { if (this.Thing == null && that.Thing != null) { return false; } if (that.Thing != null && this.Thing == null) { return false; } if ( ! this.Thing.Equals(that.Thing)) { return false; } } return true; } public override int GetHashCode() { unchecked { int hash = 27; hash = (13*hash) + (this.Thing == null ? 0 : this.Thing.GetHashCode()); return hash; } } } }
{'content_hash': '5fd59e8277ff34b3763c2b3b0a53fc91', 'timestamp': '', 'source': 'github', 'line_count': 49, 'max_line_length': 102, 'avg_line_length': 34.36734693877551, 'alnum_prop': 0.5528503562945368, 'repo_name': 'toddogrin/PatternBuffer', 'id': '353af976932df0613f92a475d433320460e05b14', 'size': '1800', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Languages/CSharp/PatternBufferGeneratedTest/Reference/Generated/AbstractReferenceObject.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '187'}, {'name': 'C#', 'bytes': '1105407'}, {'name': 'PureBasic', 'bytes': '5045'}]}
import numpy as np import numpy.linalg as la from tapering_window import tapering_window def LS_WOSA_and_Ampl(time,data,myfreq,freq_ind,myprojvec,Vmat,D,tau,Q,Q_true,myind_time,myind_freq,mywindow,pol_degree,weight_WOSA): """ LS_WOSA_and_Ampl computes the basic bricks for all the computations related to the periodogram and amplitude periodogram in 'Wavepal' class. It is called once for each frequency. Inputs: - time [1-dim numpy array of floats]: the times of the time series - data [1-dim numpy array of floats - size=time.size]: the data at the times given by 'time'. - myfreq [float]: the frequency at which the periodogram is to be computed - freq_ind [int]: the index of the frequency at which the periodogram is to be computed. - myprojvec [numpy array of floats - dimension=(time.size,pol_degree+3)]: array with content related to the trend. This is an output from 'trend_vectors', in 'Wavepal' class. - Vmat [numpy array of floats - dimension=(time.size,pol_degree+3)]: array with content related to the trend. This is an output from 'trend_vectors', in 'Wavepal' class. - D [float]: the temporal length of the WOSA segments, as output from freq_analysis_prelims. - tau [1-dim numpy array of floats]: values of the times at which start the WOSA segments, as output from freq_analysis_prelims (variable 'tau_considered') - Q [int]: Number of WOSA segments, as output from freq_analysis_prelims (variable 'Qtot') - Q_true [1-dim numpy array of ints]: Number of WOSA segments for each frequency, as output from freq_analysis_prelims (variable 'Qvec') - myind_time [numpy array of ints - dim=(tau.size,2)]: min. and max. temporal indices (of the vector 'time') for each WOSA segment, as output from freq_analysis_prelims - myind_freq [list of size=tau.size]: Each entry of the list contains an array with the frequency indices (of the output vector 'freq') which are taken into account on the WOSA segment, as output from freq_analysis_prelims (variable 'myind_freq_full') - mywindow [int]: window choice for the windowing of the WOSA segments. See tapering_window.py for more details. - pol_degree [int]: degree of the polynomial trend. pol_degree=-1 means no trend. - weight_WOSA [1-dim numpy array of floats - size=tau.size]: the weights for the weighted periodogram. Outputs: - Ampl [numpy array of floats - dimension=(2,Q_true)]: Amplitude periodogram. Ampl[0,:] gives the amplitudes of the 'cos' part and Ampl[1,:] gives the amplitudes of the 'sin' part, on each WOSA segment at the given frequency. - M2 [numpy array of floats - dimension=(time.size,2*Q_true)]: array containing the vectors on which we perform the orthogonal projection, in order to compute the periodogram. See: 'A General Theory on Spectral Analysis for Irregularly Sampled Time Series. I. Frequency Analysis', G. Lenoir and M. Crucifix ----------------------------- This is part of WAVEPAL (C) 2016 G. Lenoir""" N=time.size M2=np.zeros((N,2*Q_true)) Ampl=np.zeros((2,Q_true)) ll=-1 for l in range(Q): if(freq_ind not in myind_freq[l]): continue # next iteration in the loop "for l in range(Q)" else: myindl_0=myind_time[l,0] myindl_1=myind_time[l,1] mytime=time[myindl_0:myindl_1+1]-tau[l] gvec=np.zeros(N) gvec[myindl_0:myindl_1+1]=tapering_window(mytime,D,mywindow) domega=2.0*np.pi*myfreq mycos=np.cos(domega*time) Vmat[:,pol_degree+1]=mycos[:] mycos[:]=gvec*mycos # weighted cosine for p in range(pol_degree+1): # Gram-Schmidt h=myprojvec[:,p] mycos[:]-=np.dot(h,mycos)*h mycos[:]/=la.norm(mycos) myprojvec[:,pol_degree+1]=mycos[:] mysin=np.sin(domega*time) Vmat[:,pol_degree+2]=mysin[:] mysin[:]=gvec*mysin for p in range(pol_degree+2): # Gram-Schmidt h=myprojvec[:,p] mysin[:]-=np.dot(h,mysin)*h mysin[:]/=la.norm(mysin) myprojvec[:,pol_degree+2]=mysin[:] ll+=1 M2[:,2*ll]=mycos[:]*weight_WOSA[l] M2[:,2*ll+1]=mysin[:]*weight_WOSA[l] # Amplitude myprojvec_transp=np.transpose(myprojvec) amat=np.dot(myprojvec_transp,Vmat) bmat=np.dot(myprojvec_transp,data) mysol=la.solve(amat,bmat) # Check that the solution is correct try: assert np.allclose(np.dot(amat,mysol),bmat)==True except AssertionError: print "WARNING: Error when computing signal Amplitude: Matrix is singular" finally: # this is executed even if there is an AssertionError Ampl[:,ll]=mysol[-2:] return Ampl, M2
{'content_hash': '3adcbd8c4e90cc2febbed733ba500551', 'timestamp': '', 'source': 'github', 'line_count': 79, 'max_line_length': 253, 'avg_line_length': 56.51898734177215, 'alnum_prop': 0.7077267637178052, 'repo_name': 'guillaumelenoir/WAVEPAL', 'id': 'd9e6f537639196a3a67fc5a68e26aac65b530e59', 'size': '4465', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'wavepal/LS_WOSA_and_Ampl.py', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '447896'}, {'name': 'Shell', 'bytes': '2632'}]}
<?php namespace PLUSPEOPLE\PesaPi\Base; class Account { //############### Properties #################### const MPESA_PAYBILL = 1; const MPESA_PRIVATE = 2; protected $id = 0; protected $type = 0; protected $name = ""; protected $identifier = ""; protected $idUpdated = false; protected $typeUpdated = false; protected $nameUpdated = false; protected $identifierUpdated = false; protected $isDataRetrived = false; # # # # # # # # Initializer # # # # # # # # # # public function __construct($id, $initValues=NULL) { $this->id = (int)$id; #initValues is an object with values for fast restoring state (optimisation) if (isset($initValues)) { $this->assignValues($initValues); } } # # # # # # # # get/set methods # # # # # # # # public function getId() { return $this->id; } public function getType() { $this->retriveData(); return $this->type; } public function setType($input) { $this->type = (int)$input; return $this->typeUpdated = true; } public function getName() { $this->retriveData(); return $this->name; } public function setName($input) { $this->name = $input; return $this->nameUpdated = true; } public function getIdentifier() { $this->retriveData(); return $this->identifier; } public function setIdentifier($input) { $this->identifier = $input; return $this->identifierUpdated = true; } # # # # # # # # misc methods # # # # # # # # public function delete() { if ($this->getId() > 0) { $db = Database::instantiate(Database::TYPE_WRITE); $query="DELETE FROM pesapi_account WHERE id='" . $this->getId() . "'"; return ($db->query($query)); } else { return false; } } public function update() { if ($this->getId() > 0) { $db = Database::instantiate(Database::TYPE_WRITE); $query = "UPDATE pesapi_account SET id=id "; $query .= $this->generateUpdateQuery(); $query .= " WHERE id='" . $this->getId() . "'"; return $db->query($query); } else { return false; } } protected function handleCallback($transaction) { // NOT DONE /* if ($this->config->getConfig("PaymentReceivedPostback") AND $url != "") { $postData = 'amount=' . $payment->getAmount() . '&account=' . urlencode($payment->getAccount()) . '&name=' . urlencode($payment->getName()) . '&mobile=' . urlencode($payment->getPhonenumber()) . '&time=' . $payment->getTime(); $postData .= $this->config->getConfig("PaymentReceivedSecret"); $curl = curl_init($url); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_COOKIESESSION, false); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); $status = curl_exec($curl); // check if creation went ok. if ($status == "OK") { // expect an OK returned from the recepiant // feeback is ok. } } */ } public function forceSyncronisation() { } # # # # # # # # private methods # # # # # # # # protected function retriveData() { if (!$this->isDataRetrived) { $db = Database::instantiate(Database::TYPE_READ); $query="SELECT type, name, identifier FROM pesapi_account WHERE id='" . $this->getId() . "';"; if ($result = $db->query($query) AND $foo = $db->fetchObject($result)) { $this->assignValues($foo); unset($foo); $db->freeResult($result); } } } protected function assignValues($foo) { if (is_object($foo)) { $db = Database::instantiate(Database::TYPE_READ); $this->type = $foo->type; $this->name = $db->dbOut($foo->name); $this->identifier = $db->dbOut($foo->identifier); $this->isDataRetrived = true; } } protected function generateUpdateQuery() { $db = Database::instantiate(Database::TYPE_READ); $query = ""; if ($this->typeUpdated) { $query.=" ,type='$this->type' "; $this->typeUpdated = false; } if ($this->nameUpdated) { $query.=" ,name='" . $db->dbIn($this->name) . "' "; $this->nameUpdated=false; } if ($this->identifierUpdated) { $query.=" ,identifier='" . $db->dbIn($this->identifier) . "' "; $this->identifierUpdated=false; } return $query; } } ?>
{'content_hash': 'cfaf28f53cf68dc80d90bf2c3e8f8518', 'timestamp': '', 'source': 'github', 'line_count': 181, 'max_line_length': 80, 'avg_line_length': 25.740331491712706, 'alnum_prop': 0.5574157544537455, 'repo_name': 'ebottabi/etexams', 'id': 'a430dd26d281c8d1992bbf0e6680c7deef9567ca', 'size': '6258', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'application/vendor/PesaPi/Base/Account.php', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '38426'}, {'name': 'PHP', 'bytes': '1445263'}]}
<?php /** * @package php-svg-lib * @link http://github.com/PhenX/php-svg-lib * @author Fabien Ménager <[email protected]> * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html */ namespace Svg\Tag; use Svg\Gradient; use Svg\Style; class LinearGradient extends AbstractTag { protected $x1; protected $y1; protected $x2; protected $y2; /** @var Gradient\Stop[] */ protected $stops = array(); public function start($attributes) { parent::start($attributes); if (isset($attributes['x1'])) { $this->x1 = $attributes['x1']; } if (isset($attributes['y1'])) { $this->y1 = $attributes['y1']; } if (isset($attributes['x2'])) { $this->x2 = $attributes['x2']; } if (isset($attributes['y2'])) { $this->y2 = $attributes['y2']; } } public function getStops() { if (empty($this->stops)) { foreach ($this->children as $_child) { if ($_child->tagName != "stop") { continue; } $_stop = new Gradient\Stop(); $_attributes = $_child->attributes; // Style if (isset($_attributes["style"])) { $_style = Style::parseCssStyle($_attributes["style"]); if (isset($_style["stop-color"])) { $_stop->color = Style::parseColor($_style["stop-color"]); } if (isset($_style["stop-opacity"])) { $_stop->opacity = max(0, min(1.0, $_style["stop-opacity"])); } } // Attributes if (isset($_attributes["offset"])) { $_stop->offset = $_attributes["offset"]; } if (isset($_attributes["stop-color"])) { $_stop->color = Style::parseColor($_attributes["stop-color"]); } if (isset($_attributes["stop-opacity"])) { $_stop->opacity = max(0, min(1.0, $_attributes["stop-opacity"])); } $this->stops[] = $_stop; } } return $this->stops; } }
{'content_hash': '62134df2573d0c24a9dec729c0c9eb50', 'timestamp': '', 'source': 'github', 'line_count': 83, 'max_line_length': 85, 'avg_line_length': 27.80722891566265, 'alnum_prop': 0.44714038128249567, 'repo_name': 'cavo789/marknotes', 'id': '605ec23d97c7c61734c83f2f444360c21564042a', 'size': '2308', 'binary': False, 'copies': '15', 'ref': 'refs/heads/master', 'path': 'src/libs/php-svg-lib/src/Svg/Tag/LinearGradient.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '45596'}, {'name': 'C', 'bytes': '8656'}, {'name': 'CSS', 'bytes': '611146'}, {'name': 'Dockerfile', 'bytes': '315'}, {'name': 'HTML', 'bytes': '86141'}, {'name': 'Hack', 'bytes': '18933'}, {'name': 'JavaScript', 'bytes': '6201160'}, {'name': 'M4', 'bytes': '2250'}, {'name': 'PHP', 'bytes': '11092049'}, {'name': 'SCSS', 'bytes': '65612'}, {'name': 'Shell', 'bytes': '231'}, {'name': 'VBA', 'bytes': '45352'}]}
<!doctype html> <html class="no-js" lang="es"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="google-site-verification" content="RPw7NHPspMvpUeJWA0g98Z6RGwYEARPTIx4iC9nxa9I" /> <title>Laura Álvaro Fernández </title> <meta name="Description" content="Licenciada en Diseño de Moda por la Universidad de Southampton, U. K. Titulada en Diseño Gráfico, Diseño Web, Decoración y Escaparatismo"/> <meta name="Keywords" lang="es" content="Pintora, Muralista, Diseñadora, Diseño Gráfico, Diseño Web, Decoración, Escaparatismo, Diseño de Moda"/> <meta name="Keywords" lang="en" content="Painter, Muralist, Designer, Graphic Design, Web Design, Decoration, Showcase, Fashion Design"/> <meta name="google-translate-customization" content="1d3f72f77b110b6b-ebbe14d9078491ab-g0b8064a8854b1e67-e"/> <link rel="icon" type="image/png" href="favicon.ico" /> <link id="normalizar" rel="stylesheet" href="css/normalize.css" /> <link id="fundacion" rel="stylesheet" href="css/foundation.css" /> <link id="fundacion_iconos" rel="stylesheet" href="css/foundation-icons.css" /> <link id="personal" rel="stylesheet" href="css/personalizacion.css" /> <link rel="alternate" type="application/rss+xml" title="ROR" href="ror.xml" /> <link type="text/plain" rel="author" href="http://www.lauraalvaro.es/humans.txt" /> </head> <body> <div id="contenedor" class="row"> <div id="navFija" class="fix-height"> <nav title="Barra de navegación" class="top-bar" data-topbar> <ul class="title-area"> <li class="name"> <h1><a href="#" rel="author">Laura Álvaro Fernández</a></h1> </li> <li class="divider"></li> <li class="toggle-topbar menu-icon"> <a href="#">Menu</a> </li> <li class="divider"></li> </ul> <section class="top-bar-section"> <!-- Right Nav Section --> <ul class="right"> <li class="active"> <a href="#">Inicio</a> </li> <li class="active"> <a href="#">Aula</a> </li> <li class="active"> <a href="index.html#biografia" data-reveal-id="biografia" rel="author">Biografía</a> </li> <li class="has-dropdown"> <a href="#" rel="next">Galería</a> <ul class="dropdown"> <li> <a class="fi-photo" href="index.html#ilustracion" data-reveal-id="ilustracion" rel="next"> Ilustración</a> </li> <li> <a class="fi-photo" href="index.html#pintura" data-reveal-id="pintura" rel="next"> Pintura</a> </li> <li> <a class="fi-photo" href="index.html#mural" data-reveal-id="mural" rel="next"> Mural</a> </li> <li> <a class="fi-photo" href="index.html#infantil" data-reveal-id="infantil" rel="next"> Infantil</a> </li> </ul> </li> <li class="has-dropdown"> <a href="#" rel="author">Sigueme</a> <ul class="dropdown"> <li> <a class="fi-social-facebook" href="https://es-la.facebook.com/laura.alvarofernandez.9" target="_blank" rel="author"> Facebook</a> </li> <li> <a class="fi-social-linkedin" href="http://es.linkedin.com/pub/laura-alvaro/26/7a4/b64" target="_blank" rel="author"> Linkedin</a> </li> <li> <a class="fi-social-blogger" href="http://lauraalvarofernandez.blogspot.com.es/" target="_blank" rel="author"> Blog</a> </li> <li > <a class="fi-social-pinterest" href="http://www.pinterest.com/lauraalvarof/" target="_blank" rel="author"> Pinterest</a> </li> <li> <a class="fi-social-twitter" href="https://twitter.com/LauraAlvaroF" target="_blank" rel="author"> Twiter</a> </li> </ul> </li> <li class="has-dropdown"> <a href="#" rel="author">Idioma</a> <ul class="dropdown"> <li> <a id="google_translate_element" href="#"></a> </li> </ul> </li> </ul> <!-- Left Nav Section --> <ul class="left"> </ul> </section> </nav> </div> <div class="large-3 columns"> <img src="img/logo.png" alt="Logo Laura Álvaro Fernández" title="Logo Laura Álvaro Fernández" height="60" width="60"/> </div> <div class="large-6 columns"> <h1 class="circle">Laura Álvaro Fernández</h1> </div> <!-- <div class="large-12 columns"> <ul class="left button-group"> <li><a href="#" class="button">Inicio</a></li> <li><a href="#" class="button">Aula</a></li> <li><a href="#" class="button">Biografía</a></li> <li><a href="#" class="button">Galería</a></li> <li><a href="#" class="button">Sigueme</a></li> </ul> </div> --> </div> <!-- End Header and Nav --> <!-- First Band (Slider) --> <article class="row"> <section class="large-12 columns"> <!-- <div id="slider"> <img src="http://placehold.it/1000x400&text=[ img 1 ]" /> </div> --> <ul title="Slaider de presentación" class="example-orbit" data-orbit> <li> <img src="img/Slaider/DESIGN.jpg" alt="Diseño" title="Diseño" width="1000" height="400" /> <div class="orbit-caption"> Diseño </div> </li> <li> <img src="img/Slaider/ILUSTRATION.jpg" alt="Ilustración" title="Ilusttración" width="1000" height="400" /> <div class="orbit-caption"> Ilustración </div> </li> <li> <img src="img/Slaider/ART.jpg" alt="Arte" title="Arte" width="1000" height="400" /> <div class="orbit-caption"> Arte </div> </li> <!-- <li> <img src="img/Slaider/ATISTICIMPULSE.gif" alt="Impulso artistico" title="Impulso artistico" width="1000" height="400" /> <div class="orbit-caption"> Impulso artistico </div> </li>--> </ul> <hr /> </section> </article> <!-- Three-up Content Blocks --> <article class="row"> <section class="large-3 columns"> <a href="index.html#ilustracion" data-reveal-id="ilustracion" class="button accordion"> <img src="img/Ilustracion/Cabecera.JPG" alt="Ilustración" title="Ilustración" width="220" height="220"/> </a> <h4>Ilustración</h4> <p> Explorar distintas técnicas y materiales es lo que me llena. Los resultados son a veces predecibles, y otras veces no. Es la magía de la creación. </p> </section> <section class="large-3 columns"> <a href="index.html#pintura" data-reveal-id="pintura" class="button accordion"> <img src="img/Pintura/Cabeceralaura.JPG" alt="Pintura" title="Pintura" width="220" height="220"/> </a> <h4>Pintura</h4> <p> Casi todas mis obras son óleos sobre lienzo, otras están realizadas con técnicas mixtas. Pero siempre busco la reacción entre los colores. Mi preocupación por el color las texturas obedecen a ese primer impulso artístico. </p> </section> <section class="large-3 columns"> <a href="index.html#mural" data-reveal-id="mural" class="button accordion"> <img src="img/Murales/Cabecera.jpg" alt="Mural" title="Mural" width="220" height="220"/> </a> <h4>Murales</h4> <p> Un recurso que pocas personas demandan. Pero de vez en cuando alguien quiere un mural en su negocio o en su casa... un placer para mi poder pintar todo ese inmenso espacio en blanco. </p> </section> <section class="large-3 columns"> <a href="index.html#infantil" data-reveal-id="infantil" class="button accordion"> <img src="img/Kids/Cabecera.jpg" alt="Infantil" title="Infantil" width="220" height="220"/> </a> <h4>Infantil</h4> <p> Pinturas y motivos para las habitaciones de los más pequeños porque ellos también aprecian el arte y porque les motiva y estimula. </p> </section> </article> <!-- Call to Action Panel --> <div class="row"> <div class="large-12 columns"> <div class="panel"> <h4>Contacta conmigo</h4> <div class="row"> <div class="large-9 columns"> <p> Enviame un correo. </p> </div> <div class="large-3 columns"> <a href="index.html#formcontacto" data-reveal-id="formcontacto" class="radius button right">Contactame</a> </div> </div> </div> </div> </div> <!-- Footer --> <footer class="row"> <div class="large-12 columns"> <hr /> <div class="row"> <div class="large-6 columns"> <p> © Copyright no one at all. Go to town. </p> </div> <div class="large-6 columns"> <ul class="inline-list right"> <li> <a href="#">Inicio</a> </li> <li> <a href="#">Aula</a> </li> <li> <a href="index.html#biografia" data-reveal-id="biografia">Biografía</a> </li> <li> <a href="#" data-dropdown="drop1">Galería</a> <ul title="Enlaces a las secciones de la página." id="drop1" class="f-dropdown" data-dropdown-content> <li> <a class="fi-photo" href="index.html#ilustracion" data-reveal-id="ilustracion"> Ilustración</a> </li> <li> <a class="fi-photo" href="index.html#pintura" data-reveal-id="pintura"> Pintura</a> </li> <li> <a class="fi-photo" href="index.html#mural" data-reveal-id="mural"> Mural</a> </li> <li> <a class="fi-photo" href="index.html#infantil" data-reveal-id="infantil"> Infantil</a> </li> </ul> </li> <li> <a href="#" data-dropdown="drop2">Sigueme</a> <ul title="Enlaces a las conexiones sociales de la autora." id="drop2" class="f-dropdown" data-dropdown-content> <li> <a class="fi-social-facebook" href="https://es-la.facebook.com/laura.alvarofernandez.9" target="_blank"> Facebook</a> </li> <li> <a class="fi-social-linkedin" href="http://es.linkedin.com/pub/laura-alvaro/26/7a4/b64" target="_blank"> Linkedin</a> </li> <li> <a class="fi-social-blogger" href="http://lauraalvarofernandez.blogspot.com.es/" target="_blank"> Blog</a> </li> <li> <a class="fi-social-pinterest" href="http://www.pinterest.com/lauraalvarof/" target="_blank"> Pinterest</a> </li> <li> <a class="fi-social-twitter" href="https://twitter.com/LauraAlvaroF" target="_blank"> Twiter</a> </li> </ul> </li> </ul> </div> </div> </div> </footer> <!--Elementos que se lanzan desde los apartados de contenido insertados en ver más--> <section title="Tecnica de ilustración." id="ilustracion" class="reveal-modal small" data-reveal> <a class="close-reveal-modal fi-x"></a> <h2>Ilustración</h2> <ul alt="Serie blanca Batterfy 1." title="Serie blanca Batterfy 1." class="" data-bind> <li> <a href="index.html#butterfly1" data-reveal-id="butterfly1" class="th"> <img src="img/Ilustracion/Butterfly/bt1.png" alt="Serie Batterfly 1 imagen" title="Serie Batterfly 1 imagen" width="75" height="75"/> <p class="oculto">Cuadros imitando el dibujo de las alas de las mariposas. Serie blanca</p> <small class="circle">Serie Batterfly 1</small> </a> </li> <li> <a href="index.html#butterfly2" data-reveal-id="butterfly2" class="th"> <img src="img/Ilustracion/Butterfly/btf1.png" alt="Serie Batterfly 2 imagen" title="Serie Batterfly 2 imagen" width="75" height="75"/> <p class="oculto">Cuadros imitando el dibujo de las alas de las mariposas. Serie marrón</p> <small class="circle">Serie Batterfly 2</small> </a> </li> <li> <a href="index.html#butterfly3" data-reveal-id="butterfly3" class="th"> <img src="img/Ilustracion/Butterfly/btfl1.png" alt="Serie Batterfly 3 imagen" title="Serie Batterfly 3 imagen" width="75" height="75"/> <p class="oculto">Cuadros imitando el dibujo de las alas de las mariposas. Serie multicolor</p> <small class="circle">Serie Batterfly 3</small> </a> </li> <li> <a href="index.html#fe2o3" data-reveal-id="fe2o3" class="th"> <img src="img/Ilustracion/Fe2O3/fe1.png" alt="Serie Fe2O3 imagen" title="Serie Fe2O3 imagen" width="75" height="75"/> <p class="oculto">Cuadros imitando el oxido de hierro. Serie multicolor</p> <small class="circle">Serie Fe2O3</small> </a> </li> </ul> <section title="Serie Butterfy 1 presentación." id="butterfly1" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Butterfly 1</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Ilustracion/Butterfly/bt1.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/bt1.png" alt="Serie Butterfly 1.1" title="Serie Butterfly 1.1" width="75" height="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/bt2.JPG " type="image/jpg"> <img src="img/Ilustracion/Butterfly/bt2.png" alt="Serie Butterfly 1.2" title="Serie Butterfly 1.2" width="75" height="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/bt3.JPG " type="image/jpg"> <img src="img/Ilustracion/Butterfly/bt3.png" alt="Serie Butterfly 1.3" title="Serie Butterfly 1.3" width="75" height="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/bt4.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/bt4.png" alt="Serie Butterfly 1.4" title="Serie Butterfly 1.4" width="75" height="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/bt5.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/bt5.png" alt="Serie Butterfly 1.5" title="Serie Butterfly 1.5" width="75" height="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/bt6.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/bt6.png" alt="Serie Butterfly 1.6" title="Serie Butterfly 1.6" width="75" height="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/bt7.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/bt7.png" alt="Serie Butterfly 1.7" title="Serie Butterfly 1.7" width="75" height="75"/> </a> </li> </ul> </section> <section id="butterfly2" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Butterfly 2</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Ilustracion/Butterfly/btf1.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btf1.png" alt="Serie Butterfly 2.1" title="Serie Butterfly 2.1" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btf2.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btf2.png" alt="Serie Butterfly 2.2" title="Serie Butterfly 2.2" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btf3.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btf3.png" alt="Serie Butterfly 2.3" title="Serie Butterfly 2.3" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btf4.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btf4.png" alt="Serie Butterfly 2.4" title="Serie Butterfly 2.4" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btf5.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btf5.png" alt="Serie Butterfly 2.5" title="Serie Butterfly 2.5" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btf6.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btf6.png" alt="Serie Butterfly 2.6" title="Serie Butterfly 2.6" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btf7.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btf7.png" alt="Serie Butterfly 2.7" title="Serie Butterfly 2.7" height="75" width="75"/> </a> </li> </ul> </section> <section id="butterfly3" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Butterfly 3</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Ilustracion/Butterfly/btfl1.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btfl1.png" alt="Serie Butterfly 3.1" title="Serie Butterfly 3.1" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btfl2.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btfl2.png" alt="Serie Butterfly 3.2" title="Serie Butterfly 3.2" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btfl3.JPG " type="image/jpg"> <img src="img/Ilustracion/Butterfly/btfl3.png" alt="Serie Butterfly 3.3" title="Serie Butterfly 3.3" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btfl4.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btfl4.png" alt="Serie Butterfly 3.4" title="Serie Butterfly 3.4" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btfl5.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btfl5.png" alt="Serie Butterfly 3.5" title="Serie Butterfly 3.5" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btfl6.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btfl6.png" alt="Serie Butterfly 3.6" title="Serie Butterfly 3.6" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btfl7.JPG" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btfl7.png" alt="Serie Butterfly 3.7" title="Serie Butterfly 3.7" height="75" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Butterfly/btfll4.jpg" type="image/jpg"> <img src="img/Ilustracion/Butterfly/btfll4.png" alt="Serie Butterfly 3.8" title="Serie Butterfly 3.8" height="75" width="75"/> </a> </li> </ul> </section> <section id="fe2o3" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Fe2O3</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Ilustracion/Fe2O3/fe1.JPG" type="image/jpg"> <img src="img/Ilustracion/Fe2O3/fe1.png" alt="Serie Fe2O3 1" title="Serie Fe2O3 1" height="105" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Fe2O3/fe2.JPG" type="image/jpg"> <img src="img/Ilustracion/Fe2O3/fe2.png" alt="Serie Fe2O3 2" title="Serie Fe2O3 2" height="105" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Fe2O3/fe3.JPG" type="image/jpg"> <img src="img/Ilustracion/Fe2O3/fe3.png" alt="Serie Fe2O3 3" title="Serie Fe2O3 3" height="105" width="75"/> </a> </li> <li> <a href="img/Ilustracion/Fe2O3/fe4.JPG" type="image/jpg"> <img src="img/Ilustracion/Fe2O3/fe4.png" alt="Serie Fe2O3 4" title="Serie Fe2O3 4" height="105" width="75"> </a> </li> <li> <a href="img/Ilustracion/Fe2O3/fe5.JPG" type="image/jpg"> <img src="img/Ilustracion/Fe2O3/fe5.png" alt="Serie Fe2O3 5" title="Serie Fe2O3 5" height="105" width="75"> </a> </li> <li> <a href="img/Ilustracion/Fe2O3/fe6.JPG" type="image/jpg"> <img src="img/Ilustracion/Fe2O3/fe6.png" alt="Serie Fe2O3 6" title="Serie Fe2O3 6" height="105" width="75"/> </a> </li> </ul> </section> </section> <section id="pintura" class="reveal-modal small" data-reveal=""> <h2>Pintura</h2> <a class="close-reveal-modal fi-x"></a> <ul class="" data-bind> <li> <a href="index.html#actual" data-reveal-id="actual" class="th"> <img src="img/Pintura/Actual/tejados2.png" alt="Pintando actualmente" title="Pintando actualmente" height="46" width="75"/> <p class="oculto">Trabajos en los que estoy actualmente.</p> <small class="circle">Actual</small> </a> </li> <li> <a href="index.html#landscape" data-reveal-id="landscape" class="th"> <img src="img/Pintura/Landscape/gbreton.png" alt="Landscape imagen" title="Landscape imagen" height="59" width="75"/> <p class="oculto">Cuadros que utilizan como base la tierra riojana.</p> <small class="circle">Landscape</small> </a> </li> <li> <a href="index.html#seascape" data-reveal-id="seascape" class="th"> <img src="img/Pintura/Seascape/g1cambados.png" alt="Seascape imagen" title="Seascape imagen" height="48" width="75"/> <p class="oculto">Cuadros tomados de tierras gallegas. </p> <small class="circle">Seascape</small> </a> </li> <li> <a href="index.html#playacatedrales1" data-reveal-id="playacatedrales1" class="th"> <img src="img/Pintura/PlayaCatedrales/Captura.png" alt="Playa de las catedrales" title="Playa de las catedrales" height="68" width="75"/> <p class="oculto">Serie de cuadros dedicados a la Playa de las Catedrales.</p> <small class="circle">Playa de las catedrales 1</small> </a> </li> <li> <a href="index.html#playacatedrales2" data-reveal-id="playacatedrales2" class="th"> <img src="img/Pintura/PlayaCatedrales/oleo-1.png" alt="Playa de las catedrales" title="Playa de las catedrales" height="75" width="75"/> <p class="oculto">Serie de cuadros dedicados a la Playa de las Catedrales.</p> <small class="circle">Playa de las catedrales 2</small> </a> </li> <li> <a href="index.html#playacatedralessala" data-reveal-id="playacatedralessala" class="th"> <img src="img/Pintura/PlayaCatedrales/sala-oleo-5.png" alt="Playa de las catedrales" title="Playa de las catedrales" height="93" width="75"/> <p class="oculto">Fotografías que muestran la integración de los cuadros en diferentes viviendas.</p> <small class="circle">Playa de las catedrales decoración</small> </a> </li> <li> <a href="index.html#otros" data-reveal-id="otros" class="th"> <img src="img/Pintura/Otros/belleepoque.png" alt="Otros imagen" title="Otros imagen" height="89" width="75"/> <p class="oculto">Serie de cuadros sin un tema específico.</p> <small class="circle">Otros</small> </a> </li> </ul> <section id="actual" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Actual</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Pintura/Actual/tejados2.JPG " type="image/jpg"> <img src="img/Pintura/Actual/tejados2.png" alt="Pintando actualmente" title="Otros" height="89" width="75"/> </a> </li> </ul> </section> <section id="landscape" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Landscape</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Pintura/Landscape/gbreton.jpg" type="image/jpg"> <img src="img/Pintura/Landscape/gbreton.png" alt="Breton" title="Breton" height="59" width="75"/> </a> </li> <li> <a href="img/Pintura/Landscape/gbriones1.jpg" type="image/jpg"> <img src="img/Pintura/Landscape/gbriones1.png" alt="Briones" title="Briones" height="100" width="75"/> </a> </li> <li> <a href="img/Pintura/Landscape/gbriones2.JPG" type="image/jpg"> <img src="img/Pintura/Landscape/gbriones2.png" alt="Briones" title="Briones" height="100" width="75"/> </a> </li> <li> <a href="img/Pintura/Landscape/gcuartopuente.jpg"> <img src="img/Pintura/Landscape/gcuartopuente.png" alt="Cuarto puente" title="Cuarto puente" height="56" width="75"/> </a> </li> <li> <a href="img/Pintura/Landscape/ghayedos.jpg" type="image/jpg"> <img src="img/Pintura/Landscape/ghayedos.png" alt="Hayedos" title="Hayedos" height="58" width="75"/> </a> </li> <li> <a href="img/Pintura/Landscape/gleondormido.jpg" type="image/jpg"> <img src="img/Pintura/Landscape/gleondormido.png" alt="León dormido" title="León dormido" height="60" width="75"/> </a> </li> <li> <a href="img/Pintura/Landscape/glogrono.JPG" type="image/jpg"> <img src="img/Pintura/Landscape/glogrono.png" alt="Logroño" title="Logroño" height="54" width="75"/> </a> </li> <li> <a href="img/Pintura/Landscape/gortigosa.jpg" type="image/jpg"> <img src="img/Pintura/Landscape/gortigosa.png" alt="Ortigosa" title="Ortigosa" height="125" width="75"/> </a> </li> <li> <a href="img/Pintura/Landscape/gportales.jpg" type="image/jpg"> <img src="img/Pintura/Landscape/gportales.png" alt="Portales" title="Portales" height="56" width="75"/> </a> </li> <li> <a href="img/Pintura/Landscape/gvinas.jpg" type="image/jpg"> <img src="img/Pintura/Landscape/gvinas.png" alt="Viñas" title="Viñas" height="106" width="75"/> </a> </li> </ul> </section> <section id="seascape" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Seascape</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Pintura/Seascape/g1cambados.jpg" type="image/jpg"> <img src="img/Pintura/Seascape/g1cambados.png" alt="Cambados 1" title="Cambados 1" height="48" width="75"/> </a> </li> <li> <a href="img/Pintura/Seascape/g2cambados.jpg" type="image/jpg"> <img src="img/Pintura/Seascape/g2cambados.png" alt="Cambados 2" title="Cambados 2" height="56" width="75"/> </a> </li> <li> <a href="img/Pintura/Seascape/g3cambados.jpg" type="image/jpg"> <img src="img/Pintura/Seascape/g3cambados.png" alt="Cambados 3" title="Cambados 3" height="61" width="75"/> </a> </li> </ul> </section> <section id="playacatedrales1" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Playa de las Catedrales 1</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Pintura/PlayaCatedrales/Captura.JPG" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/Captura.png " alt="Playa de las Catedrales 1" title="Playa de las Catedrales 1" height="68" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/Captura2.JPG" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/Captura2.png" alt="Playa de las Catedrales 1" title="Playa de las Catedrales 1" height="67" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/Captura3.JPG" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/Captura3.png" alt="Playa de las Catedrales 1" title="Playa de las Catedrales 1" height="48" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/amarillo2.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/amarillo2.png" alt="Playa de las Catedrales 1" title="Playa de las Catedrales 1" height="129" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/oleo-1.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/oleo-1.png" alt="Playa de las Catedrales 1" title="Playa de las Catedrales 1" height="75" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/oleo-3g.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/oleo-3g.png" alt="Playa de las Catedrales 1" title="Playa de las Catedrales 1" height="75" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/oleo-5g.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/oleo-5g.png" alt="Playa de las Catedrales 1" title="Playa de las Catedrales 1" height="112" width="75"/> </a> </li> </ul> </section> <section id="playacatedrales2" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Playa de las Catedrales 2</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Pintura/PlayaCatedrales/oleo-6.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/oleo-6.png" alt="Playa de las Catedrales 2" title="Playa de las Catedrales 2" height="57" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/oleo-7g.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/oleo-7g.png" alt="Playa de las Catedrales 2" title="Playa de las Catedrales 2" height="51" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/oleo-8g.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/oleo-8g.png" alt="Playa de las Catedrales 2" title="Playa de las Catedrales 2" height="57" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/oleo2.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/oleo2.png" alt="Playa de las Catedrales 2" title="Playa de las Catedrales 2" height="74" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/oleo4-4g.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/oleo4-4g.png" alt="Playa de las Catedrales 2" title="Playa de las Catedrales 2" height="51" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/playacatedrales1web.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/playacatedrales1web.png" alt="Playa de las Catedrales 2" title="Playa de las Catedrales 2" height="75" width="75"/> </a> </li> </ul> </section> <section id="playacatedralessala" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Playa de las Catedrales decoración</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Pintura/PlayaCatedrales/sala-amarillo3.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/sala-amarillo3.png" alt="Playa de las Catedrales decoración" title="Playa de las Catedrales decoración" height="129" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/sala-oleo-5.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/sala-oleo-5.png" alt="Playa de las Catedrales decoración" title="Playa de las Catedrales decoración" height="93" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/sala-oleo-7.jpg " type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/sala-oleo-7.png" alt="Playa de las Catedrales decoración" title="Playa de las Catedrales decoración" height="64" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/sala-oleo-8.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/sala-oleo-8.png" alt="Playa de las Catedrales decoración" title="Playa de las Catedrales decoración" height="65" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/sala-oleo2.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/sala-oleo2.png" alt="Playa de las Catedrales decoración" title="Playa de las Catedrales decoración" height="59" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/sala-oleo3.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/sala-oleo3.png" alt="Playa de las Catedrales decoración" title="Playa de las Catedrales decoración" height="61" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/sala-playa-coral.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/sala-playa-coral.png" alt="Playa de las Catedrales decoración" title="Playa de las Catedrales decoración" height="46" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/salagrisclaro1-1.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/salagrisclaro1-1.png" alt="Playa de las Catedrales decoración" title="Playa de las Catedrales decoración" height="58" width="75"/> </a> </li> <li> <a href="img/Pintura/PlayaCatedrales/salaplayaazul.jpg" type="image/jpg"> <img src="img/Pintura/PlayaCatedrales/salaplayaazul.png" alt="Playa de las Catedrales decoración" title="Playa de las Catedrales decoración" height="60" width="75"/> </a> </li> </ul> </section> <section id="otros" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Otros trabajos</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Pintura/Otros/belleepoque.JPG" type="image/jpg"> <img src="img/Pintura/Otros/belleepoque.png" alt="Belle Epoque" title="Belle Epoque" height="89" width="75"/> </a> </li> <li> <a href="img/Pintura/Otros/chica.JPG" type="image/jpg"> <img src="img/Pintura/Otros/chica.png" alt="Chica" title="Chica" height="68" width="75"/> </a> </li> <li> <a href="img/Pintura/Otros/lauraoscar.JPG" type="image/jpg"> <img src="img/Pintura/Otros/lauraoscar.png" alt="Laura y Oscar" title="Laura y Oscar" height="67" width="75"/> </a> </li> </ul> </section> </section> <section id="mural" class="reveal-modal small" data-reveal=""> <h2>Murales</h2> <a class="close-reveal-modal fi-x"></a> <ul class="" data-bind> <li> <a href="index.html#mural1" data-reveal-id="mural1" class="th"> <img src="img/Murales/mural2.png" alt="Murales" title="Murales" height="56" width="75"/> <small class="circle">Mural</small> </a> </li> </ul> <section id="mural1" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Murales</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Murales/mural2.jpg" type="image/jpg"> <img src="img/Murales/mural2.png" alt="Murales 1" title="Murales 1" height="56" width="75"/> </a> </li> <li> <a href="img/Murales/mural3.jpg" type="image/jpg"> <img src="img/Murales/mural3.png" alt="Murales 2" title="Murales 2" height="56" width="75"/> </a> </li> <li> <a href="img/Murales/mural4.jpg" type="image/jpg"> <img src="img/Murales/mural4.png" alt="Murales 3" title="Murales 3" height="56" width="75"/> </a> </li> <li> <a href="img/Murales/murales.jpg" type="image/jpg"> <img src="img/Murales/murales.png" alt="Murales 4" title="Murales 4" height="62" width="75"/> </a> </li> </ul> </section> </section> <section id="infantil" class="reveal-modal small" data-reveal=""> <h2>Infantil</h2> <a class="close-reveal-modal fi-x"></a> <ul class="" data-bind> <li> <a href="index.html#animales" data-reveal-id="animales" class="th"> <img src="img/Kids/Animales/caracoles.png" alt="Murales" title="Murales 4" height="38" width="75"/> <p class="oculto">Serie de cuadros dedicados a los niños. Serie animales.</p> <small class="circle">Animales</small> </a> </li> <li> <a href="index.html#gorditos" data-reveal-id="gorditos" class="th"> <img src="img/Kids/Gorditos/gordbibe.png" alt="Murales" title="Murales 4" height="75" width="75"/> <p class="oculto">Serie de cuadros dedicados a los niños. Serie bebes y sus juegos.</p> <small class="circle">Gorditos</small> </a> </li> <li> <a href="index.html#hadas" data-reveal-id="hadas" class="th"> <img src="img/Kids/Hadas/hada2.png" alt="Murales" title="Murales 4" height="75" width="75"/> <p class="oculto">Serie de cuadros dedicados a los niños. Serie Hadas.</p> <small class="circle">Hadas</small> </a> </li> </ul> <section id="animales" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Animales</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Kids/Animales/caracoles.jpg" type="image/jpg"> <img src="img/Kids/Animales/caracoles.png" alt="Caracoles" title="Caracoles" height="38" width="75"/> </a> </li> <li> <a href="img/Kids/Animales/elefantes.jpg" type="image/jpg"> <img src="img/Kids/Animales/elefantes.png" alt="Elefantes" title="Elefantes" height="75" width="75"/> </a> </li> <li> <a href="img/Kids/Animales/gato.jpg" type="image/jpg"> <img src="img/Kids/Animales/gato.png" alt="Gato" title="Gato" height="75" width="75"/> </a> </li> <li> <a href="img/Kids/Animales/jirafa.jpg" type="image/jpg"> <img src="img/Kids/Animales/jirafa.png" alt="Jirafa" title="Jirafa" height="150" width="75"/> </a> </li> <li> <a href="img/Kids/Animales/leona.jpg" type="image/jpg"> <img src="img/Kids/Animales/leona.png" alt="Leona" title="Leona" height="75" width="75"/> </a> </li> <li> <a href="img/Kids/Animales/panda1.jpg" type="image/jpg"> <img src="img/Kids/Animales/panda1.png" alt="Panda tumbado" title="Panda tumbado" height="75" width="75"/> </a> </li> <li> <a href="img/Kids/Animales/panda2.jpg" type="image/jpg"> <img src="img/Kids/Animales/panda2.png" alt="Panda sentado" title="Panda sentado" height="75" width="75"/> </a> </li> <li> <a href="img/Kids/Animales/tortuga.jpg" type="image/jpg"> <img src="img/Kids/Animales/tortuga.png" alt="Tortuga" title="Tortuga" height="75" width="75"/> </a> </li> </ul> </section> <section id="gorditos" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Gorditos</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Kids/Gorditos/gordbibe.jpg" type="image/jpg"> <img src="img/Kids/Gorditos/gordbibe.png" alt="Gordito biberón" title="Gordito biberón" height="75" width="75"/> </a> </li> <li> <a href="img/Kids/Gorditos/gordcascos.jpg" type="image/jpg"> <img src="img/Kids/Gorditos/gordcascos.png" alt="Gordito cascos" title="Gordito cascos" height="75" width="75"/> </a> </li> <li> <a href="img/Kids/Gorditos/gordglobo.jpg" type="image/jpg"> <img src="img/Kids/Gorditos/gordglobo.png" alt="Gordito globo" title="Gordito globo" height="150" width="75"/> </a> </li> <li> <a href="img/Kids/Gorditos/gordmariposa.jpg" type="image/jpg"> <img src="img/Kids/Gorditos/gordmariposa.png" alt="Gordito mariposa" title="Gordito mariposa" height="38" width="75"/> </a> </li> <li> <a href="img/Kids/Gorditos/gordmariq.jpg" type="image/jpg"> <img src="img/Kids/Gorditos/gordmariq.png" alt="Gordito mariquita" title="Gordito mariquita" height="38" width="75"/> </a> </li> <li> <a href="img/Kids/Gorditos/gordpunk.jpg" type="image/jpg"> <img src="img/Kids/Gorditos/gordpunk.png" alt="Gordito punk" title="Gordito punk" height="38" width="75"/> </a> </li> <li> <a href="img/Kids/Gorditos/gordtambor.jpg" type="image/jpg"> <img src="img/Kids/Gorditos/gordtambor.png" alt="Gordito tambor" title="Gordito tambor" height="75" width="75"/> </a> </li> </ul> </section> <section id="hadas" class="reveal-modal xlarge" data-reveal> <a class="close-reveal-modal fi-x"></a> <h3>Hadas</h3> <ul class="clearing-thumbs" data-clearing> <li> <a href="img/Kids/Hadas/hada2.jpg" type="image/jpg"> <img src="img/Kids/Hadas/hada2.png" alt="Hada 2" title="Hada 2" height="75" width="75"/> </a> </li> <li> <a href="img/Kids/Hadas/hada3.jpg" type="image/jpg"> <img src="img/Kids/Hadas/hada3.png" alt="Hada 3" title="Hada 3" height="75" width="75"/> </a> </li> <li> <a href="img/Kids/Hadas/hada4.jpg" type="image/jpg"> <img src="img/Kids/Hadas/hada4.png" alt="Hada 4" title="Hada 4" height="75" width="75"/> </a> </li> </ul> </section> </section> <section id="biografia" class="reveal-modal small" data-reveal> <h3>Biografía</h3> <a class="close-reveal-modal fi-x"></a> <ul id="listabiografia" class="panel callout"> <li> Licenciada en Diseño de Moda por la Universidad de Southampton, U. K. </li> <li> Titulada en Diseño Gráfico, Diseño Web, Decoración y Escaparatismo. </li> <li> Profesionalmente se desarrolla como diseñadora y patronista. </li> <li> Paralelamente amplía su labor creativa como pintora y muralista formándose en los Estudios de Hidalgo Mariscal y Jose Luis Birigay, llegando a exponer de manera individual y colectiva. </li> <li> Investigación y búsqueda es una constante en su carrera que le ha llevado a explorar distintas disciplinas artísticas desde que se trasladó a estudiar a Barcelona en 1990 (EATM). </li> <li> En el momento actual compagina su actividad artística con la docencia en COFORM donde imparte cursos relacionados con el mundo del diseño y el arte. </li> </ul> </section> <section id="formcontacto" class="reveal-modal small" data-reveal> <a id="cierraform" class="close-reveal-modal">&#215;</a> <h2>Formulario envío de correo</h2> <form id="formcorreo" name="formcorreo" method="POST" enctype="text/plain" onsubmit=" return creamail.formCheck()" data-abide> <div class="large-9"> <label for="usuario">Tu nombre <small>required</small> <input name="usuario" id="usuario" type="text" placeholder="Nombre" required pattern="alpha" size="100"/> </label> <small id="errorUsuario" class="error">El nombre es obligatorio y debe ser texto.</small> </div> <div class="large-9"> <label for="correo">E-mail <small>required</small> <input name="correo" id="correo" type="email" pattern="email" placeholder="[email protected]" required size="50"/> </label> <small id="errorCorreo" class="error">El correo electrónico es obligatorio.</small> </div> <div class="large-9"> <label for="listasunto">Asunto<small>required</small> <input list="asunto" name="listasunto" id="listasunto" required> <datalist id="asunto"> <option value="Sugerencias"> <option value="Opinión"> <option value="Informe de errores"> <option value="Recomendar"> <option value="Enlaces rotos"> <option value="Otros"> </datalist> </label> <small id="errorAsunto" class="error">El asunto es obligatorio.</small> </div> <div class="large-9"> <label for="contenido">Contenido <small>required</small> <textarea name="contenido" id="contenido" placeholder="Escribe tu correo" required rows="20" cols="50"></textarea> </label> <small id="errorContenido" class="error">El contenido del correo es obligatorio.</small> </div> <input type="hidden" id="infoNavegador" name="infoNavegador" /> <input type="hidden" id="infoFecha" name="infoFecha" /> <input id="enviar" type="submit" value="Enviar"/> </form> </section> <section id="datoscorreo" class="reveal-modal small" data-reveal> <a class="close-reveal-modal fi-x"></a> <h2>Datos enviados</h2> <form id="formenv" name="formenv" method="POST" enctype="text/plain" data-abide> <div class="large-9"> <label for="usuarioenv" >Tu nombre <small>required</small> <input name="usuarioenv" id="usuarioenv" type="text" placeholder="Nombre" required pattern="alpha" size="100" disabled> </label> <small id="errorUsuarioenv" class="error">El nombre es obligatorio y debe ser texto.</small> </div> <div class="large-9"> <label for="correoenv">E-mail <small>required</small> <input name="correoenv" id="correoenv" type="email" pattern="email" placeholder="[email protected]" required size="50" disabled> </label> <small id="errorCorreoenv" class="error">El correo electrónico es obligatorio.</small> </div> <div class="large-9"> <label for="asuntoenv">Asunto <small>required</small> <input name="asuntoenv" id="asuntoenv" type="email" pattern="email" placeholder="Asunto" required size="50" disabled> </label> <small id="errorAsuntoenv" class="error">El asunto es obligatorio.</small> </div> <div class="large-9"> <label for="contenidoenv">Contenido <small>required</small> <textarea name="contenidoenv" id="contenidoenv" placeholder="Escribe tu correo" required rows="20" cols="50" disabled></textarea> </label> <small id="errorContenidoenv" class="error">El contenido del correo es obligatorio.</small> </div> </form> </section> <script type="text/javascript" src="js/vendor/modernizr.js"></script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> <script type="text/javascript" src="js/vendor/jquery.js"></script> <script type="text/javascript" src="js/foundation.min.js"></script> <script type="text/javascript"> window.jQuery || document.write('<script src="js/vendor/jquery-1.10.1.min.js"><\/script>'); </script> <script> $(document).foundation(); </script> <!-- <script> /*Funcióm google analytics para hacer seguimiento desde mi cuenta gmail creada por Boilerplate*/ var _gaq = [['_setAccount', 'UA-XXXXX-X'], ['_trackPageview']]; (function(d, t) { var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.src = '//www.google-analytics.com/ga.js'; s.parentNode.insertBefore(g, s); }(document, 'script')); </script> --> <script type="text/javascript"> /*Funcióm google analytics para hacer seguimiento desde mi cuenta gmail creada por Googel analytics*/ (function(i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function() { (i[r].q = i[r].q || []).push(arguments); }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m); })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); ga('create', 'UA-48181443-1', 'lauraalvaro.es'); ga('send', 'pageview'); </script> <script type="text/javascript" src="js/main.js"></script> <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> </body> </html>
{'content_hash': 'fdc509b4f5b13fb96d711c5fb10b2b56', 'timestamp': '', 'source': 'github', 'line_count': 1082, 'max_line_length': 242, 'avg_line_length': 59.09519408502773, 'alnum_prop': 0.4536525859776982, 'repo_name': 'antonioamgm/pplw', 'id': '54297ee1ab3eca6f65f3362ec24bc4044bdd8bbc', 'size': '64057', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'index.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '56536'}, {'name': 'JavaScript', 'bytes': '155814'}]}
<?php namespace Eduardokum\LaravelBoleto\Boleto; use Carbon\Carbon; use Eduardokum\LaravelBoleto\Boleto\Render\Html; use Eduardokum\LaravelBoleto\Boleto\Render\Pdf; use Eduardokum\LaravelBoleto\Contracts\Boleto\Boleto; use Eduardokum\LaravelBoleto\Contracts\Pessoa as PessoaContract; use Eduardokum\LaravelBoleto\Contracts\Boleto\Boleto as BoletoContract; use Eduardokum\LaravelBoleto\Util; /** * Class AbstractBoleto * * @package Eduardokum\LaravelBoleto\Boleto */ abstract class AbstractBoleto implements BoletoContract { /** * Campos que são necessários para o boleto * * @var array */ private $camposObrigatorios = [ 'numero', 'agencia', 'conta', 'carteira', ]; protected $protectedFields = [ 'nossoNumero', ]; /** * Código do banco * * @var string */ protected $codigoBanco; /** * Moeda * * @var int */ protected $moeda = 9; /** * Valor total do boleto * * @var float */ protected $valor; /** * Desconto total do boleto * * @var float */ protected $desconto; /** * Valor para multa * * @var float */ protected $multa = 0; /** * Valor para mora juros * * @var float */ protected $juros = 0; /** * Dias apos vencimento do juros * * @var int */ protected $jurosApos = 0; /** * Dias para protesto * * @var integer */ protected $diasProtesto = 0; /** * Dias para baixa automática * * @var integer */ protected $diasBaixaAutomatica; /** * Data do documento * * @var \Carbon\Carbon */ protected $dataDocumento; /** * Data de emissão * * @var \Carbon\Carbon */ protected $dataProcessamento; /** * Data de vencimento * * @var \Carbon\Carbon */ protected $dataVencimento; /** * Data de limite de desconto * * @var \Carbon\Carbon */ protected $dataDesconto; /** * Campo de aceite * * @var string */ protected $aceite = 'N'; /** * Espécie do documento, geralmente DM (Duplicata Mercantil) * * @var string */ protected $especieDoc = 'DM'; /** * Espécie do documento, coódigo para remessa * * @var array */ protected $especiesCodigo = []; /** * Número do documento * * @var int */ protected $numeroDocumento; /** * Define o número definido pelo cliente para compor o Nosso Número * * @var int */ protected $numero; /** * Define o número definido pelo cliente para controle da remessa * * @var string */ protected $numeroControle; /** * Campo de uso do banco no boleto * * @var string */ protected $usoBanco; /** * Agência * * @var string */ protected $agencia; /** * Dígito da agência * * @var string */ protected $agenciaDv; /** * Conta * * @var string */ protected $conta; /** * Dígito da conta * * @var string */ protected $contaDv; /** * Modalidade de cobrança do cliente, geralmente Cobrança Simples ou Registrada * * @var string */ protected $carteira; /** * Define as carteiras disponíveis para cada banco * * @var array */ protected $carteiras = []; /** * Define as carteiras disponíveis para cada banco * * @var array */ protected $carteirasNomes = []; /** * Entidade beneficiario (quem emite o boleto) * * @var PessoaContract */ protected $beneficiario; /** * Entidade pagadora (de quem se cobra o boleto) * * @var PessoaContract */ protected $pagador; /** * Entidade sacador avalista * * @var PessoaContract */ protected $sacadorAvalista; /** * Array com as linhas do demonstrativo (descrição do pagamento) * * @var array */ protected $descricaoDemonstrativo; /** * Linha de local de pagamento * * @var string */ protected $localPagamento = 'Pagável em qualquer agência bancária até o vencimento.'; /** * Array com as linhas de instruções * * @var array */ protected $instrucoes = ['Pagar até a data do vencimento.']; /** * Array com as linhas de instruções de impressão * * @var array */ protected $instrucoes_impressao = []; /** * Localização do logotipo do banco, referente ao diretório de imagens * * @var string */ protected $logo; /** * Variáveis adicionais. * * @var array */ public $variaveis_adicionais = []; /** * Cache do campo livre para evitar processamento desnecessário. * * @var string */ protected $campoLivre; /** * Cache do nosso numero para evitar processamento desnecessário. * * @var string */ protected $campoNossoNumero; /** * Cache da linha digitabel para evitar processamento desnecessário. * * @var string */ protected $campoLinhaDigitavel; /** * Cache do codigo de barras para evitar processamento desnecessário. * * @var string */ protected $campoCodigoBarras; /** * Status do boleto, se vai criar alterar ou baixa no banco. * * @var int */ protected $status = BoletoContract::STATUS_REGISTRO; /** * @var int */ private $status_custom = null; /** * Mostrar o endereço do beneficiário abaixo da razão e CNPJ na ficha de compensação * * @var boolean */ protected $mostrarEnderecoFichaCompensacao = false; /** * Construtor * * @param array $params Parâmetros iniciais para construção do objeto */ public function __construct($params = []) { Util::fillClass($this, $params); // Marca a data de emissão para hoje, caso não especificada if (!$this->getDataDocumento()) { $this->setDataDocumento(new Carbon()); } // Marca a data de processamento para hoje, caso não especificada if (!$this->getDataProcessamento()) { $this->setDataProcessamento(new Carbon()); } // Marca a data de vencimento para daqui a 5 dias, caso não especificada if (!$this->getDataVencimento()) { $this->setDataVencimento(new Carbon(date('Y-m-d', strtotime('+5 days')))); } // Marca a data de desconto if (!$this->getDataDesconto()) { $this->setDataDesconto($this->getDataVencimento()); } } /** * @return array */ public function getProtectedFields() { return $this->protectedFields; } /** * Seta os campos obrigatórios * * @return $this */ protected function setCamposObrigatorios() { $args = func_get_args(); $this->camposObrigatorios = []; foreach ($args as $arg) { $this->addCampoObrigatorio($arg); } return $this; } /** * Adiciona os campos obrigatórios * * @return $this */ protected function addCampoObrigatorio() { $args = func_get_args(); foreach ($args as $arg) { !is_array($arg) || call_user_func_array([$this, __FUNCTION__], $arg); !is_string($arg) || array_push($this->camposObrigatorios, $arg); } return $this; } /** * Define a agência * * @param string $agencia * * @return AbstractBoleto */ public function setAgencia($agencia) { $this->agencia = (string)$agencia; return $this; } /** * Retorna a agência * * @return string */ public function getAgencia() { return $this->agencia; } /** * Define o dígito da agência * * @param string $agenciaDv * * @return AbstractBoleto */ public function setAgenciaDv($agenciaDv) { $this->agenciaDv = $agenciaDv; return $this; } /** * Retorna o dígito da agência * * @return string */ public function getAgenciaDv() { return $this->agenciaDv; } /** * Define o código da carteira (Com ou sem registro) * * @param string $carteira * * @return AbstractBoleto * @throws \Exception */ public function setCarteira($carteira) { if (!in_array($carteira, $this->getCarteiras())) { throw new \Exception("Carteira não disponível!"); } $this->carteira = $carteira; return $this; } /** * Retorna o código da carteira (Com ou sem registro) * * @return string */ public function getCarteira() { return $this->carteira; } /** * Retorna as carteiras disponíveis para este banco * * @return array */ public function getCarteiras() { return $this->carteiras; } /** * Define a entidade beneficiario * * @param $beneficiario * * @return AbstractBoleto * @throws \Exception */ public function setBeneficiario($beneficiario) { Util::addPessoa($this->beneficiario, $beneficiario); return $this; } /** * Retorna a entidade beneficiario * * @return PessoaContract */ public function getBeneficiario() { return $this->beneficiario; } /** * Retorna o código do banco * * @return string */ public function getCodigoBanco() { return $this->codigoBanco; } /** * Define o número da conta * * @param string $conta * * @return AbstractBoleto */ public function setConta($conta) { $this->conta = (string)$conta; return $this; } /** * Retorna o número da conta * * @return string */ public function getConta() { return $this->conta; } /** * Define o dígito verificador da conta * * @param string $contaDv * * @return AbstractBoleto */ public function setContaDv($contaDv) { $this->contaDv = $contaDv; return $this; } /** * Retorna o dígito verificador da conta * * @return string */ public function getContaDv() { return $this->contaDv; } /** * Define a data de vencimento * * @param \Carbon\Carbon $dataVencimento * * @return AbstractBoleto */ public function setDataVencimento(Carbon $dataVencimento) { $this->dataVencimento = $dataVencimento; return $this; } /** * Retorna a data de vencimento * * @return \Carbon\Carbon */ public function getDataVencimento() { return $this->dataVencimento; } /** * Define a data de limite de desconto * * @param \Carbon\Carbon $dataDesconto * * @return AbstractBoleto */ public function setDataDesconto(Carbon $dataDesconto) { $this->dataDesconto = $dataDesconto; return $this; } /** * Retorna a data de limite de desconto * * @return \Carbon\Carbon */ public function getDataDesconto() { return $this->dataDesconto; } /** * Define a data do documento * * @param \Carbon\Carbon $dataDocumento * * @return AbstractBoleto */ public function setDataDocumento(Carbon $dataDocumento) { $this->dataDocumento = $dataDocumento; return $this; } /** * Retorna a data do documento * * @return \Carbon\Carbon */ public function getDataDocumento() { return $this->dataDocumento; } /** * Define o campo aceite * * @param string $aceite * * @return AbstractBoleto */ public function setAceite($aceite) { $this->aceite = $aceite; return $this; } /** * Retorna o campo aceite * * @return string */ public function getAceite() { return is_numeric($this->aceite) ? ($this->aceite ? 'A' : 'N') : $this->aceite; } /** * Define o campo Espécie Doc, geralmente DM (Duplicata Mercantil) * * @param string $especieDoc * * @return AbstractBoleto */ public function setEspecieDoc($especieDoc) { $this->especieDoc = $especieDoc; return $this; } /** * Retorna o campo Espécie Doc, geralmente DM (Duplicata Mercantil) * * @return string */ public function getEspecieDoc() { return $this->especieDoc; } /** * Retorna o codigo da Espécie Doc * * @param int $default * * @return string */ public function getEspecieDocCodigo($default = 99) { return key_exists(strtoupper($this->especieDoc), $this->especiesCodigo) ? $this->especiesCodigo[strtoupper($this->getEspecieDoc())] : $default; } /** * Define o campo Número do documento * * @param int $numeroDocumento * * @return AbstractBoleto */ public function setNumeroDocumento($numeroDocumento) { $this->numeroDocumento = $numeroDocumento; return $this; } /** * Retorna o campo Número do documento * * @return string */ public function getNumeroDocumento() { return $this->numeroDocumento; } /** * Define o número definido pelo cliente para compor o nosso número * * @param int $numero * * @return AbstractBoleto */ public function setNumero($numero) { $this->numero = $numero; return $this; } /** * Retorna o número definido pelo cliente para compor o nosso número * * @return int */ public function getNumero() { return $this->numero; } /** * Define o número definido pelo cliente para controle da remessa * * @param string $numeroControle * * @return AbstractBoleto */ public function setNumeroControle($numeroControle) { $this->numeroControle = $numeroControle; return $this; } /** * Retorna o número definido pelo cliente para controle da remessa * * @return int */ public function getNumeroControle() { return $this->numeroControle; } /** * Define o campo Uso do banco * * @param string $usoBanco * * @return AbstractBoleto */ public function setUsoBanco($usoBanco) { $this->usoBanco = $usoBanco; return $this; } /** * Retorna o campo Uso do banco * * @return string */ public function getUsoBanco() { return $this->usoBanco; } /** * Define a data de geração do boleto * * @param \Carbon\Carbon $dataProcessamento * * @return AbstractBoleto */ public function setDataProcessamento(Carbon $dataProcessamento) { $this->dataProcessamento = $dataProcessamento; return $this; } /** * Retorna a data de geração do boleto * * @return \Carbon\Carbon */ public function getDataProcessamento() { return $this->dataProcessamento; } /** * Adiciona uma instrução (máximo 5) * * @param string $instrucao * * @return AbstractBoleto * @throws \Exception */ public function addInstrucao($instrucao) { if (count($this->getInstrucoes()) > 8) { throw new \Exception('Atingido o máximo de 5 instruções.'); } array_push($this->instrucoes, $instrucao); return $this; } /** * Define um array com instruções (máximo 8) para pagamento * * @param array $instrucoes * * @return AbstractBoleto * @throws \Exception */ public function setInstrucoes(array $instrucoes) { if (count($instrucoes) > 8) { throw new \Exception('Máximo de 8 instruções.'); } $this->instrucoes = $instrucoes; return $this; } /** * Retorna um array com instruções (máximo 8) para pagamento * * @return array */ public function getInstrucoes() { return array_slice((array)$this->instrucoes + [null, null, null, null, null, null, null, null], 0, 8); } /** * Define um array com instruções (máximo 5) para impressao * * @param array $instrucoes_impressao * * @return AbstractBoleto * @throws \Exception */ public function setInstrucoesImpressao(array $instrucoes_impressao) { if (count($instrucoes_impressao) > 5) { throw new \Exception('Máximo de 5 instruções.'); } $this->instrucoes_impressao = $instrucoes_impressao; return $this; } /** * Retorna um array com instruções (máximo 5) para impressão * * @return array */ public function getInstrucoesImpressao() { if (!empty($this->instrucoes_impressao)) return array_slice((array)$this->instrucoes_impressao + [null, null, null, null, null], 0, 5); else return []; } /** * Adiciona um demonstrativo (máximo 5) * * @param string $descricaoDemonstrativo * * @return AbstractBoleto * @throws \Exception */ public function addDescricaoDemonstrativo($descricaoDemonstrativo) { if (count($this->getDescricaoDemonstrativo()) > 5) { throw new \Exception('Atingido o máximo de 5 demonstrativos.'); } array_push($this->descricaoDemonstrativo, $descricaoDemonstrativo); return $this; } /** * Define um array com a descrição do demonstrativo (máximo 5) * * @param array $descricaoDemonstrativo * * @return AbstractBoleto * @throws \Exception */ public function setDescricaoDemonstrativo(array $descricaoDemonstrativo) { if (count($descricaoDemonstrativo) > 5) { throw new \Exception('Máximo de 5 demonstrativos.'); } $this->descricaoDemonstrativo = $descricaoDemonstrativo; return $this; } /** * Retorna um array com a descrição do demonstrativo (máximo 5) * * @return array */ public function getDescricaoDemonstrativo() { return array_slice((array)$this->descricaoDemonstrativo + [null, null, null, null, null], 0, 5); } /** * Define o local de pagamento do boleto * * @param string $localPagamento * * @return AbstractBoleto */ public function setLocalPagamento($localPagamento) { $this->localPagamento = $localPagamento; return $this; } /** * Retorna o local de pagamento do boleto * * @return string */ public function getLocalPagamento() { return $this->localPagamento; } /** * Define a moeda utilizada pelo boleto * * @param int $moeda * * @return AbstractBoleto */ public function setMoeda($moeda) { $this->moeda = $moeda; return $this; } /** * Retorna a moeda utilizada pelo boleto * * @return int */ public function getMoeda() { return $this->moeda; } /** * Define o objeto do pagador * * @param $pagador * * @return AbstractBoleto * @throws \Exception */ public function setPagador($pagador) { Util::addPessoa($this->pagador, $pagador); return $this; } /** * Retorna o objeto do pagador * * @return PessoaContract */ public function getPagador() { return $this->pagador; } /** * Define o objeto sacador avalista do boleto * * @param $sacadorAvalista * * @return AbstractBoleto * @throws \Exception */ public function setSacadorAvalista($sacadorAvalista) { Util::addPessoa($this->sacadorAvalista, $sacadorAvalista); return $this; } /** * Retorna o objeto sacador avalista do boleto * * @return PessoaContract */ public function getSacadorAvalista() { return $this->sacadorAvalista; } /** * Define o valor total do boleto (incluindo taxas) * * @param string $valor * * @return AbstractBoleto */ public function setValor($valor) { $this->valor = Util::nFloat($valor, 2, false); return $this; } /** * Retorna o valor total do boleto (incluindo taxas) * * @return string */ public function getValor() { return Util::nFloat($this->valor, 2, false); } /** * Define o desconto total do boleto (incluindo taxas) * * @param string $desconto * * @return AbstractBoleto */ public function setDesconto($desconto) { $this->desconto = Util::nFloat($desconto, 2, false); return $this; } /** * Retorna o desconto total do boleto (incluindo taxas) * * @return string */ public function getDesconto() { return Util::nFloat($this->desconto, 2, false); } /** * Seta a % de multa * * @param float $multa * * @return AbstractBoleto */ public function setMulta($multa) { $this->multa = (float)($multa > 0.00 ? $multa : 0.00); return $this; } /** * Retorna % de multa * * @return float */ public function getMulta() { return $this->multa; } /** * Seta a % de juros * * @param float $juros * * @return AbstractBoleto */ public function setJuros($juros) { $this->juros = (float)($juros > 0.00 ? $juros : 0.00); return $this; } /** * Retorna % juros * * @return float */ public function getJuros() { return $this->juros; } /** * Retorna valor mora diária * * @return float */ public function getMoraDia() { if (!$this->getJuros() > 0) { return 0; } return Util::percent($this->getValor(), $this->getJuros())/30; } /** * Seta a quantidade de dias apos o vencimento que cobra o juros * * @param int $jurosApos * * @return AbstractBoleto */ public function setJurosApos($jurosApos) { $jurosApos = (int)$jurosApos; $this->jurosApos = $jurosApos > 0 ? $jurosApos : 0; return $this; } /** * Retorna a quantidade de dias apos o vencimento que cobrar a juros * * @return int */ public function getJurosApos() { return $this->jurosApos ? $this->jurosApos : false; } /** * Seta dias para protesto * * @param int $diasProtesto * * @return AbstractBoleto * @throws \Exception */ public function setDiasProtesto($diasProtesto) { if ($this->getDiasBaixaAutomatica() > 0) { throw new \Exception('Você deve usar dias de protesto ou dias de baixa, nunca os 2'); } $diasProtesto = (int)$diasProtesto; $this->diasProtesto = $diasProtesto > 0 ? $diasProtesto : 0; return $this; } /** * Retorna os diasProtesto * * @param int $default * * @return int */ public function getDiasProtesto($default = 0) { return $this->diasProtesto > 0 ? $this->diasProtesto : $default; } /** * Seta dias para baixa automática * * @param int $baixaAutomatica * * @return AbstractBoleto * @throws \Exception */ public function setDiasBaixaAutomatica($baixaAutomatica) { $exception = sprintf('O banco %s não suporta baixa automática, pode usar também: setDiasProtesto(%s)', basename(get_class($this)), $baixaAutomatica); throw new \Exception($exception); } /** * Retorna os diasProtesto * * @param int $default * * @return int */ public function getDiasBaixaAutomatica($default = 0) { return $this->diasBaixaAutomatica > 0 ? $this->diasBaixaAutomatica : $default; } /** * Define a localização do logotipo * * @param string $logo * * @return AbstractBoleto */ public function setLogo($logo) { $this->logo = $logo; return $this; } /** * Retorna a localização do logotipo * * @return string */ public function getLogo() { return $this->logo ? $this->logo : "http://dummyimage.com/300x70/f5/0.png&text=Sem+Logo"; } /** * Retorna o logotipo em Base64, pronto para ser inserido na página * * @return string */ public function getLogoBase64() { return 'data:image/' . pathinfo($this->getLogo(), PATHINFO_EXTENSION) . ';base64,' . base64_encode(file_get_contents($this->getLogo())); } /** * Retorna a localização do logotipo do banco relativo à pasta de imagens * * @return string */ public function getLogoBanco() { return realpath(__DIR__ . '/../../logos/' . $this->getCodigoBanco() . '.png'); } /** * @return int */ public function getStatus() { return $this->status; } /** * Marca o boleto para ser alterado no banco * * @return AbstractBoleto */ public function alterarBoleto() { $this->status = BoletoContract::STATUS_ALTERACAO; return $this; } /** * Marca o boleto para alterar data vecimento no banco * * @return AbstractBoleto */ public function alterarDataDeVencimento() { $this->status = BoletoContract::STATUS_ALTERACAO_DATA; return $this; } /** * Comandar instrução custom * * @return AbstractBoleto */ public function comandarInstrucao($instrucao) { $this->status = BoletoContract::STATUS_CUSTOM; $this->status_custom = $instrucao; return $this; } /** * @return int|null */ public function getComando() { return $this->status == Boleto::STATUS_CUSTOM ? $this->status_custom : null; } /** * Marca o boleto para ser baixado no banco * * @return AbstractBoleto */ public function baixarBoleto() { $this->status = BoletoContract::STATUS_BAIXA; return $this; } /** * Retorna o logotipo do banco em Base64, pronto para ser inserido na página * * @return string */ public function getLogoBancoBase64() { return 'data:image/' . pathinfo($this->getLogoBanco(), PATHINFO_EXTENSION) . ';base64,' . base64_encode(file_get_contents($this->getLogoBanco())); } /** * Mostra exception ao erroneamente tentar setar o nosso número * * @throws \Exception */ final public function setNossoNumero() { throw new \Exception('Não é possível definir o nosso número diretamente. Utilize o método setNumero.'); } /** * Retorna o Nosso Número calculado. * * @return string */ public function getNossoNumero() { if (empty($this->campoNossoNumero)) { return $this->campoNossoNumero = $this->gerarNossoNumero(); } return $this->campoNossoNumero; } /** * Método que retorna o nosso numero usado no boleto. alguns bancos possuem algumas diferenças. * * @return string */ public function getNossoNumeroBoleto() { return $this->getNossoNumero(); } /** * Método onde o Boleto deverá gerar o Nosso Número. * * @return string */ abstract protected function gerarNossoNumero(); /** * Método onde qualquer boleto deve extender para gerar o código da posição de 20 a 44 * * @return string */ abstract protected function getCampoLivre(); /** * Método que valida se o banco tem todos os campos obrigadotorios preenchidos * * @return boolean */ public function isValid(&$messages) { foreach ($this->camposObrigatorios as $campo) { $test = call_user_func([$this, 'get' . ucwords($campo)]); if ($test === '' || is_null($test)) { $messages .= "Campo $campo está em branco"; return false; } } return true; } /** * Retorna o campo Agência/Beneficiário do boleto * * @return string */ public function getAgenciaCodigoBeneficiario() { $agencia = $this->getAgenciaDv() !== null ? $this->getAgencia() . '-' . $this->getAgenciaDv() : $this->getAgencia(); $conta = $this->getContaDv() !== null ? $this->getConta() . '-' . $this->getContaDv() : $this->getConta(); return $agencia . ' / ' . $conta; } /** * Retorna o nome da carteira para impressão no boleto * * Caso o nome da carteira a ser impresso no boleto seja diferente do número * Então crie uma variável na classe do banco correspondente $carteirasNomes * sendo uma array cujos índices sejam os números das carteiras e os valores * seus respectivos nomes * * @return string */ public function getCarteiraNome() { return isset($this->carteirasNomes[$this->getCarteira()]) ? $this->carteirasNomes[$this->getCarteira()] : $this->getCarteira(); } /** * Retorna o codigo de barras * * @return string * @throws \Exception */ public function getCodigoBarras() { if (!empty($this->campoCodigoBarras)) { return $this->campoCodigoBarras; } if (!$this->isValid($messages)) { throw new \Exception('Campos requeridos pelo banco, aparentam estar ausentes ' . $messages); } $codigo = Util::numberFormatGeral($this->getCodigoBanco(), 3) . $this->getMoeda() . Util::fatorVencimento($this->getDataVencimento()) . Util::numberFormatGeral($this->getValor(), 10) . $this->getCampoLivre(); $resto = Util::modulo11($codigo, 2, 9, 0); $dv = (in_array($resto, [0, 10, 11])) ? 1 : $resto; return $this->campoCodigoBarras = substr($codigo, 0, 4) . $dv . substr($codigo, 4); } /** * Retorna o código do banco com o dígito verificador * * @return string */ public function getCodigoBancoComDv() { $codigoBanco = $this->getCodigoBanco(); $semX = [BoletoContract::COD_BANCO_CEF]; $x10 = in_array($codigoBanco, $semX) ? 0 : 'X'; return $codigoBanco . '-' . Util::modulo11($codigoBanco, 2, 9, 0, $x10); } /** * Retorna a linha digitável do boleto * * @return string * @throws \Exception */ public function getLinhaDigitavel() { if (!empty($this->campoLinhaDigitavel)) { return $this->campoLinhaDigitavel; } $codigo = $this->getCodigoBarras(); $s1 = substr($codigo, 0, 4) . substr($codigo, 19, 5); $s1 = $s1 . Util::modulo10($s1); $s1 = substr_replace($s1, '.', 5, 0); $s2 = substr($codigo, 24, 10); $s2 = $s2 . Util::modulo10($s2); $s2 = substr_replace($s2, '.', 5, 0); $s3 = substr($codigo, 34, 10); $s3 = $s3 . Util::modulo10($s3); $s3 = substr_replace($s3, '.', 5, 0); $s4 = substr($codigo, 4, 1); $s5 = substr($codigo, 5, 14); return $this->campoLinhaDigitavel = sprintf('%s %s %s %s %s', $s1, $s2, $s3, $s4, $s5); } /** * Retorna se a segunda linha contendo o endereço do beneficiário deve ser exibida na ficha de compensação * * @return bool */ public function getMostrarEnderecoFichaCompensacao() { return $this->mostrarEnderecoFichaCompensacao; } /** * Seta se a segunda linha contendo o endereço do beneficiário deve ser exibida na ficha de compensação * * @param bool $mostrarEnderecoFichaCompensacao */ public function setMostrarEnderecoFichaCompensacao($mostrarEnderecoFichaCompensacao) { $this->mostrarEnderecoFichaCompensacao = $mostrarEnderecoFichaCompensacao; } /** * Render PDF * * @param bool $print * @param bool $instrucoes * * @return string * @throws \Exception */ public function renderPDF($print = false, $instrucoes = true) { $pdf = new Pdf(); $pdf->addBoleto($this); !$print || $pdf->showPrint(); $instrucoes || $pdf->hideInstrucoes(); return $pdf->gerarBoleto('S', null); } /** * Render HTML * * @param bool $print * @param bool $instrucoes * * @return string * @throws \Throwable */ public function renderHTML($print = false, $instrucoes = true) { $html = new Html(); $html->addBoleto($this); !$print || $html->showPrint(); $instrucoes || $html->hideInstrucoes(); return $html->gerarBoleto(); } /** * @return $this */ public function copy() { return clone $this; } /** * On clone clean variables */ function __clone() { $this->campoLivre = null; $this->campoNossoNumero = null; $this->campoLinhaDigitavel = null; $this->campoCodigoBarras = null; } /** * Return Boleto Array. * * @return array * @throws \Exception */ public function toArray() { return array_merge( [ 'linha_digitavel' => $this->getLinhaDigitavel(), 'codigo_barras' => $this->getCodigoBarras(), 'beneficiario' => [ 'nome' => $this->getBeneficiario()->getNome(), 'endereco' => $this->getBeneficiario()->getEndereco(), 'bairro' => $this->getBeneficiario()->getBairro(), 'cep' => $this->getBeneficiario()->getCep(), 'uf' => $this->getBeneficiario()->getUf(), 'cidade' => $this->getBeneficiario()->getCidade(), 'documento' => $this->getBeneficiario()->getDocumento(), 'nome_documento' => $this->getBeneficiario()->getNomeDocumento(), 'endereco2' => $this->getBeneficiario()->getCepCidadeUf(), 'endereco_completo' => $this->getBeneficiario()->getEnderecoCompleto(), ], 'logo_base64' => $this->getLogoBase64(), 'logo' => $this->getLogo(), 'logo_banco_base64' => $this->getLogoBancoBase64(), 'logo_banco' => $this->getLogoBanco(), 'codigo_banco' => $this->getCodigoBanco(), 'codigo_banco_com_dv' => $this->getCodigoBancoComDv(), 'especie' => 'R$', 'data_vencimento' => $this->getDataVencimento(), 'data_processamento' => $this->getDataProcessamento(), 'data_documento' => $this->getDataDocumento(), 'data_desconto' => $this->getDataDesconto(), 'valor' => Util::nReal($this->getValor(), 2, false), 'desconto' => Util::nReal($this->getDesconto(), 2, false), 'multa' => Util::nReal($this->getMulta(), 2, false), 'juros' => Util::nReal($this->getJuros(), 2, false), 'juros_apos' => $this->getJurosApos(), 'dias_protesto' => $this->getDiasProtesto(), 'sacador_avalista' => $this->getSacadorAvalista() ? [ 'nome' => $this->getSacadorAvalista()->getNome(), 'endereco' => $this->getSacadorAvalista()->getEndereco(), 'bairro' => $this->getSacadorAvalista()->getBairro(), 'cep' => $this->getSacadorAvalista()->getCep(), 'uf' => $this->getSacadorAvalista()->getUf(), 'cidade' => $this->getSacadorAvalista()->getCidade(), 'documento' => $this->getSacadorAvalista()->getDocumento(), 'nome_documento' => $this->getSacadorAvalista()->getNomeDocumento(), 'endereco2' => $this->getSacadorAvalista()->getCepCidadeUf(), ] : [], 'pagador' => [ 'nome' => $this->getPagador()->getNome(), 'endereco' => $this->getPagador()->getEndereco(), 'bairro' => $this->getPagador()->getBairro(), 'cep' => $this->getPagador()->getCep(), 'uf' => $this->getPagador()->getUf(), 'cidade' => $this->getPagador()->getCidade(), 'documento' => $this->getPagador()->getDocumento(), 'nome_documento' => $this->getPagador()->getNomeDocumento(), 'endereco2' => $this->getPagador()->getCepCidadeUf(), ], 'demonstrativo' => $this->getDescricaoDemonstrativo(), 'instrucoes' => $this->getInstrucoes(), 'instrucoes_impressao' => $this->getInstrucoesImpressao(), 'local_pagamento' => $this->getLocalPagamento(), 'numero' => $this->getNumero(), 'numero_documento' => $this->getNumeroDocumento(), 'numero_controle' => $this->getNumeroControle(), 'agencia_codigo_beneficiario' => $this->getAgenciaCodigoBeneficiario(), 'nosso_numero' => $this->getNossoNumero(), 'nosso_numero_boleto' => $this->getNossoNumeroBoleto(), 'especie_doc' => $this->getEspecieDoc(), 'especie_doc_cod' => $this->getEspecieDocCodigo(), 'aceite' => $this->getAceite(), 'carteira' => $this->getCarteira(), 'carteira_nome' => $this->getCarteiraNome(), 'uso_banco' => $this->getUsoBanco(), 'status' => $this->getStatus(), 'mostrar_endereco_ficha_compensacao' => $this->getMostrarEnderecoFichaCompensacao() ], $this->variaveis_adicionais ); } }
{'content_hash': '8a05797f58226be7343a9d5d89751364', 'timestamp': '', 'source': 'github', 'line_count': 1647, 'max_line_length': 157, 'avg_line_length': 23.73163327261688, 'alnum_prop': 0.5419331730031213, 'repo_name': 'josejlpp/laravel-boleto', 'id': 'bf65f942334dcccf2a43504cec66fe5aac6b84b7', 'size': '39259', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Boleto/AbstractBoleto.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '27489'}, {'name': 'PHP', 'bytes': '883918'}, {'name': 'Shell', 'bytes': '742'}]}
package org.elasticsearch.gradle.test; import org.elasticsearch.gradle.Architecture; import org.elasticsearch.gradle.DistributionDownloadPlugin; import org.elasticsearch.gradle.ElasticsearchDistribution; import org.elasticsearch.gradle.ElasticsearchDistribution.Flavor; import org.elasticsearch.gradle.ElasticsearchDistribution.Platform; import org.elasticsearch.gradle.ElasticsearchDistribution.Type; import org.elasticsearch.gradle.Jdk; import org.elasticsearch.gradle.JdkDownloadPlugin; import org.elasticsearch.gradle.SystemPropertyCommandLineArgumentProvider; import org.elasticsearch.gradle.Version; import org.elasticsearch.gradle.VersionProperties; import org.elasticsearch.gradle.docker.DockerSupportPlugin; import org.elasticsearch.gradle.docker.DockerSupportService; import org.elasticsearch.gradle.info.BuildParams; import org.elasticsearch.gradle.internal.InternalDistributionDownloadPlugin; import org.elasticsearch.gradle.util.GradleUtils; import org.elasticsearch.gradle.vagrant.VagrantBasePlugin; import org.elasticsearch.gradle.vagrant.VagrantExtension; import org.gradle.api.Action; import org.gradle.api.NamedDomainObjectContainer; import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.Task; import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.dsl.DependencyHandler; import org.gradle.api.plugins.JavaBasePlugin; import org.gradle.api.provider.Provider; import org.gradle.api.specs.Specs; import org.gradle.api.tasks.TaskProvider; import org.gradle.api.tasks.testing.Test; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.function.Supplier; import java.util.stream.Stream; import static org.elasticsearch.gradle.vagrant.VagrantMachine.convertLinuxPath; import static org.elasticsearch.gradle.vagrant.VagrantMachine.convertWindowsPath; public class DistroTestPlugin implements Plugin<Project> { private static final String SYSTEM_JDK_VERSION = "11.0.2+9"; private static final String SYSTEM_JDK_VENDOR = "openjdk"; private static final String GRADLE_JDK_VERSION = "14+36@076bab302c7b4508975440c56f6cc26a"; private static final String GRADLE_JDK_VENDOR = "openjdk"; // all distributions used by distro tests. this is temporary until tests are per distribution private static final String EXAMPLE_PLUGIN_CONFIGURATION = "examplePlugin"; private static final String IN_VM_SYSPROP = "tests.inVM"; private static final String DISTRIBUTION_SYSPROP = "tests.distribution"; private static final String BWC_DISTRIBUTION_SYSPROP = "tests.bwc-distribution"; private static final String EXAMPLE_PLUGIN_SYSPROP = "tests.example-plugin"; @Override public void apply(Project project) { project.getRootProject().getPluginManager().apply(DockerSupportPlugin.class); project.getPlugins().apply(InternalDistributionDownloadPlugin.class); project.getPluginManager().apply("elasticsearch.build"); Provider<DockerSupportService> dockerSupport = GradleUtils.getBuildService( project.getGradle().getSharedServices(), DockerSupportPlugin.DOCKER_SUPPORT_SERVICE_NAME ); // TODO: it would be useful to also have the SYSTEM_JAVA_HOME setup in the root project, so that running from GCP only needs // a java for gradle to run, and the tests are self sufficient and consistent with the java they use NamedDomainObjectContainer<ElasticsearchDistribution> allDistributions = DistributionDownloadPlugin.getContainer(project); List<ElasticsearchDistribution> testDistributions = configureDistributions(project); Map<ElasticsearchDistribution.Type, TaskProvider<?>> lifecycleTasks = lifecycleTasks(project, "destructiveDistroTest"); Map<String, TaskProvider<?>> versionTasks = versionTasks(project, "destructiveDistroUpgradeTest"); TaskProvider<Task> destructiveDistroTest = project.getTasks().register("destructiveDistroTest"); Configuration examplePlugin = configureExamplePlugin(project); List<TaskProvider<Test>> windowsTestTasks = new ArrayList<>(); Map<Type, List<TaskProvider<Test>>> linuxTestTasks = new HashMap<>(); Map<String, List<TaskProvider<Test>>> upgradeTestTasks = new HashMap<>(); Map<String, TaskProvider<?>> depsTasks = new HashMap<>(); for (ElasticsearchDistribution distribution : testDistributions) { String taskname = destructiveDistroTestTaskName(distribution); TaskProvider<?> depsTask = project.getTasks().register(taskname + "#deps"); depsTask.configure(t -> t.dependsOn(distribution, examplePlugin)); depsTasks.put(taskname, depsTask); TaskProvider<Test> destructiveTask = configureTestTask(project, taskname, distribution, t -> { t.onlyIf(t2 -> distribution.getType() != Type.DOCKER || dockerSupport.get().getDockerAvailability().isAvailable); addDistributionSysprop(t, DISTRIBUTION_SYSPROP, distribution::toString); addDistributionSysprop(t, EXAMPLE_PLUGIN_SYSPROP, () -> examplePlugin.getSingleFile().toString()); t.exclude("**/PackageUpgradeTests.class"); }, depsTask); if (distribution.getPlatform() == Platform.WINDOWS) { windowsTestTasks.add(destructiveTask); } else { linuxTestTasks.computeIfAbsent(distribution.getType(), k -> new ArrayList<>()).add(destructiveTask); } destructiveDistroTest.configure(t -> t.dependsOn(destructiveTask)); lifecycleTasks.get(distribution.getType()).configure(t -> t.dependsOn(destructiveTask)); if ((distribution.getType() == Type.DEB || distribution.getType() == Type.RPM) && distribution.getBundledJdk()) { for (Version version : BuildParams.getBwcVersions().getIndexCompatible()) { if (distribution.getFlavor() == Flavor.OSS && version.before("6.3.0")) { continue; // before opening xpack } final ElasticsearchDistribution bwcDistro; if (version.equals(Version.fromString(distribution.getVersion()))) { // this is the same as the distribution we are testing bwcDistro = distribution; } else { bwcDistro = createDistro( allDistributions, distribution.getArchitecture(), distribution.getType(), distribution.getPlatform(), distribution.getFlavor(), distribution.getBundledJdk(), version.toString() ); } String upgradeTaskname = destructiveDistroUpgradeTestTaskName(distribution, version.toString()); TaskProvider<?> upgradeDepsTask = project.getTasks().register(upgradeTaskname + "#deps"); upgradeDepsTask.configure(t -> t.dependsOn(distribution, bwcDistro)); depsTasks.put(upgradeTaskname, upgradeDepsTask); TaskProvider<Test> upgradeTest = configureTestTask(project, upgradeTaskname, distribution, t -> { addDistributionSysprop(t, DISTRIBUTION_SYSPROP, distribution::toString); addDistributionSysprop(t, BWC_DISTRIBUTION_SYSPROP, bwcDistro::toString); t.include("**/PackageUpgradeTests.class"); }, upgradeDepsTask); versionTasks.get(version.toString()).configure(t -> t.dependsOn(upgradeTest)); upgradeTestTasks.computeIfAbsent(version.toString(), k -> new ArrayList<>()).add(upgradeTest); } } } project.subprojects(vmProject -> { vmProject.getPluginManager().apply(VagrantBasePlugin.class); vmProject.getPluginManager().apply(JdkDownloadPlugin.class); List<Object> vmDependencies = new ArrayList<>(configureVM(vmProject)); vmDependencies.add(project.getConfigurations().getByName("testRuntimeClasspath")); Map<ElasticsearchDistribution.Type, TaskProvider<?>> vmLifecyleTasks = lifecycleTasks(vmProject, "distroTest"); Map<String, TaskProvider<?>> vmVersionTasks = versionTasks(vmProject, "distroUpgradeTest"); TaskProvider<Task> distroTest = vmProject.getTasks().register("distroTest"); // windows boxes get windows distributions, and linux boxes get linux distributions if (isWindows(vmProject)) { configureVMWrapperTasks( vmProject, windowsTestTasks, depsTasks, wrapperTask -> { vmLifecyleTasks.get(Type.ARCHIVE).configure(t -> t.dependsOn(wrapperTask)); }, vmDependencies ); } else { for (var entry : linuxTestTasks.entrySet()) { Type type = entry.getKey(); TaskProvider<?> vmLifecycleTask = vmLifecyleTasks.get(type); configureVMWrapperTasks(vmProject, entry.getValue(), depsTasks, wrapperTask -> { vmLifecycleTask.configure(t -> t.dependsOn(wrapperTask)); // Only VM sub-projects that are specifically opted-in to testing Docker should // have the Docker task added as a dependency. Although we control whether Docker // is installed in the VM via `Vagrantfile` and we could auto-detect its presence // in the VM, the test tasks e.g. `destructiveDistroTest.default-docker` are defined // on the host during Gradle's configuration phase and not in the VM, so // auto-detection doesn't work. // // The shouldTestDocker property could be null, hence we use Boolean.TRUE.equals() boolean shouldExecute = type != Type.DOCKER || Boolean.TRUE.equals(vmProject.findProperty("shouldTestDocker")); if (shouldExecute) { distroTest.configure(t -> t.dependsOn(wrapperTask)); } }, vmDependencies); } for (var entry : upgradeTestTasks.entrySet()) { String version = entry.getKey(); TaskProvider<?> vmVersionTask = vmVersionTasks.get(version); configureVMWrapperTasks( vmProject, entry.getValue(), depsTasks, wrapperTask -> { vmVersionTask.configure(t -> t.dependsOn(wrapperTask)); }, vmDependencies ); } } }); } private static Map<ElasticsearchDistribution.Type, TaskProvider<?>> lifecycleTasks(Project project, String taskPrefix) { Map<ElasticsearchDistribution.Type, TaskProvider<?>> lifecyleTasks = new HashMap<>(); lifecyleTasks.put(Type.DOCKER, project.getTasks().register(taskPrefix + ".docker")); lifecyleTasks.put(Type.ARCHIVE, project.getTasks().register(taskPrefix + ".archives")); lifecyleTasks.put(Type.DEB, project.getTasks().register(taskPrefix + ".packages")); lifecyleTasks.put(Type.RPM, lifecyleTasks.get(Type.DEB)); return lifecyleTasks; } private static Map<String, TaskProvider<?>> versionTasks(Project project, String taskPrefix) { Map<String, TaskProvider<?>> versionTasks = new HashMap<>(); for (Version version : BuildParams.getBwcVersions().getIndexCompatible()) { versionTasks.put(version.toString(), project.getTasks().register(taskPrefix + ".v" + version)); } return versionTasks; } private static Jdk createJdk( NamedDomainObjectContainer<Jdk> jdksContainer, String name, String vendor, String version, String platform, String architecture ) { Jdk jdk = jdksContainer.create(name); jdk.setVendor(vendor); jdk.setVersion(version); jdk.setPlatform(platform); jdk.setArchitecture(architecture); return jdk; } private static List<Object> configureVM(Project project) { String box = project.getName(); // setup jdks used by the distro tests, and by gradle executing NamedDomainObjectContainer<Jdk> jdksContainer = JdkDownloadPlugin.getContainer(project); String platform = box.contains("windows") ? "windows" : "linux"; Jdk systemJdk = createJdk(jdksContainer, "system", SYSTEM_JDK_VENDOR, SYSTEM_JDK_VERSION, platform, "x64"); Jdk gradleJdk = createJdk(jdksContainer, "gradle", GRADLE_JDK_VENDOR, GRADLE_JDK_VERSION, platform, "x64"); // setup VM used by these tests VagrantExtension vagrant = project.getExtensions().getByType(VagrantExtension.class); vagrant.setBox(box); vagrant.vmEnv("SYSTEM_JAVA_HOME", convertPath(project, vagrant, systemJdk, "", "")); vagrant.vmEnv("JAVA_HOME", ""); // make sure any default java on the system is ignored vagrant.vmEnv("PATH", convertPath(project, vagrant, gradleJdk, "/bin:$PATH", "\\bin;$Env:PATH")); // pass these along to get correct build scans if (System.getenv("JENKINS_URL") != null) { Stream.of("JOB_NAME", "JENKINS_URL", "BUILD_NUMBER", "BUILD_URL").forEach(name -> vagrant.vmEnv(name, System.getenv(name))); } vagrant.setIsWindowsVM(isWindows(project)); return Arrays.asList(systemJdk, gradleJdk); } private static Object convertPath(Project project, VagrantExtension vagrant, Jdk jdk, String additionaLinux, String additionalWindows) { return new Object() { @Override public String toString() { if (vagrant.isWindowsVM()) { return convertWindowsPath(project, jdk.getPath()) + additionalWindows; } return convertLinuxPath(project, jdk.getPath()) + additionaLinux; } }; } private static Configuration configureExamplePlugin(Project project) { Configuration examplePlugin = project.getConfigurations().create(EXAMPLE_PLUGIN_CONFIGURATION); DependencyHandler deps = project.getDependencies(); Map<String, String> examplePluginProject = Map.of("path", ":example-plugins:custom-settings", "configuration", "zip"); deps.add(EXAMPLE_PLUGIN_CONFIGURATION, deps.project(examplePluginProject)); return examplePlugin; } private static void configureVMWrapperTasks( Project project, List<TaskProvider<Test>> destructiveTasks, Map<String, TaskProvider<?>> depsTasks, Action<TaskProvider<GradleDistroTestTask>> configure, Object... additionalDeps ) { for (TaskProvider<? extends Task> destructiveTask : destructiveTasks) { String destructiveTaskName = destructiveTask.getName(); String taskname = destructiveTaskName.substring("destructive".length()); taskname = taskname.substring(0, 1).toLowerCase(Locale.ROOT) + taskname.substring(1); TaskProvider<GradleDistroTestTask> vmTask = project.getTasks().register(taskname, GradleDistroTestTask.class, t -> { t.setGroup(JavaBasePlugin.VERIFICATION_GROUP); t.setDescription("Runs " + destructiveTaskName.split("\\.", 2)[1] + " tests within vagrant"); t.setTaskName(destructiveTaskName); t.extraArg("-D'" + IN_VM_SYSPROP + "'"); t.dependsOn(depsTasks.get(destructiveTaskName)); t.dependsOn(additionalDeps); }); configure.execute(vmTask); } } private static TaskProvider<Test> configureTestTask( Project project, String taskname, ElasticsearchDistribution distribution, Action<? super Test> configure, Object... deps ) { return project.getTasks().register(taskname, Test.class, t -> { // Only run tests for the current architecture t.onlyIf(t3 -> distribution.getArchitecture() == Architecture.current()); t.getOutputs().doNotCacheIf("Build cache is disabled for packaging tests", Specs.satisfyAll()); t.setMaxParallelForks(1); t.setWorkingDir(project.getProjectDir()); if (System.getProperty(IN_VM_SYSPROP) == null) { t.dependsOn(deps); } configure.execute(t); }); } private List<ElasticsearchDistribution> configureDistributions(Project project) { NamedDomainObjectContainer<ElasticsearchDistribution> distributions = DistributionDownloadPlugin.getContainer(project); List<ElasticsearchDistribution> currentDistros = new ArrayList<>(); for (Architecture architecture : Architecture.values()) { for (Type type : List.of(Type.DEB, Type.RPM, Type.DOCKER)) { for (Flavor flavor : Flavor.values()) { for (boolean bundledJdk : Arrays.asList(true, false)) { // All our Docker images include a bundled JDK so it doesn't make sense to test without one. // Also we'll never publish an ARM (aarch64) build without a bundled JDK. boolean skip = bundledJdk == false && (type == Type.DOCKER || architecture == Architecture.AARCH64); if (skip == false) { currentDistros.add( createDistro( distributions, architecture, type, null, flavor, bundledJdk, VersionProperties.getElasticsearch() ) ); } } } } } for (Architecture architecture : Architecture.values()) { for (Platform platform : Arrays.asList(Platform.LINUX, Platform.WINDOWS)) { for (Flavor flavor : Flavor.values()) { for (boolean bundledJdk : Arrays.asList(true, false)) { if (bundledJdk == false && architecture != Architecture.X64) { // We will never publish distributions for non-x86 (amd64) platforms // without a bundled JDK continue; } currentDistros.add( createDistro( distributions, architecture, Type.ARCHIVE, platform, flavor, bundledJdk, VersionProperties.getElasticsearch() ) ); } } } } return currentDistros; } private static ElasticsearchDistribution createDistro( NamedDomainObjectContainer<ElasticsearchDistribution> distributions, Architecture architecture, Type type, Platform platform, Flavor flavor, boolean bundledJdk, String version ) { String name = distroId(type, platform, flavor, bundledJdk, architecture) + "-" + version; ElasticsearchDistribution distro = distributions.create(name, d -> { d.setArchitecture(architecture); d.setFlavor(flavor); d.setType(type); if (type == Type.ARCHIVE) { d.setPlatform(platform); } if (type != Type.DOCKER) { d.setBundledJdk(bundledJdk); } d.setVersion(version); }); // Allow us to gracefully omit building Docker distributions if Docker is not available on the system. // In such a case as we can't build the Docker images we'll simply skip the corresponding tests. if (type == Type.DOCKER) { distro.setFailIfUnavailable(false); } return distro; } // return true if the project is for a windows VM, false otherwise private static boolean isWindows(Project project) { return project.getName().contains("windows"); } private static String distroId(Type type, Platform platform, Flavor flavor, boolean bundledJdk, Architecture architecture) { return flavor + "-" + (type == Type.ARCHIVE ? platform + "-" : "") + type + (bundledJdk ? "" : "-no-jdk") + (architecture == Architecture.X64 ? "" : "-" + architecture.toString().toLowerCase()); } private static String destructiveDistroTestTaskName(ElasticsearchDistribution distro) { Type type = distro.getType(); return "destructiveDistroTest." + distroId(type, distro.getPlatform(), distro.getFlavor(), distro.getBundledJdk(), distro.getArchitecture()); } private static String destructiveDistroUpgradeTestTaskName(ElasticsearchDistribution distro, String bwcVersion) { Type type = distro.getType(); return "destructiveDistroUpgradeTest.v" + bwcVersion + "." + distroId(type, distro.getPlatform(), distro.getFlavor(), distro.getBundledJdk(), distro.getArchitecture()); } private static void addDistributionSysprop(Test task, String sysprop, Supplier<String> valueSupplier) { SystemPropertyCommandLineArgumentProvider props = task.getExtensions().getByType(SystemPropertyCommandLineArgumentProvider.class); props.systemProperty(sysprop, valueSupplier); } }
{'content_hash': '81cbcb262820b176efbe9be772f8288a', 'timestamp': '', 'source': 'github', 'line_count': 448, 'max_line_length': 140, 'avg_line_length': 50.14955357142857, 'alnum_prop': 0.6208661592557974, 'repo_name': 'gingerwizard/elasticsearch', 'id': '6a6592fa0a6ac72537f8dab15e768f8465fc0ad1', 'size': '23255', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'buildSrc/src/main/java/org/elasticsearch/gradle/test/DistroTestPlugin.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '10862'}, {'name': 'Groovy', 'bytes': '510'}, {'name': 'HTML', 'bytes': '1502'}, {'name': 'Java', 'bytes': '29923429'}, {'name': 'Perl', 'bytes': '264378'}, {'name': 'Perl6', 'bytes': '103207'}, {'name': 'Python', 'bytes': '91186'}, {'name': 'Ruby', 'bytes': '17776'}, {'name': 'Shell', 'bytes': '85779'}]}
<?xml version="1.0" encoding="utf-8"?> <cn.yan.library.SlideLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" app:slideDirection="fromTop" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/content_id" android:gravity="center" android:layout_width="match_parent" android:layout_height="match_parent" android:text="ViewPager"/> <TextView android:id="@+id/slide1_id" android:background="@android:color/darker_gray" android:layout_width="match_parent" android:layout_height="40dp" android:gravity="center" android:text="收藏"/> </cn.yan.library.SlideLayout>
{'content_hash': '01d28598b9565e1f614331ccdc3652da', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 62, 'avg_line_length': 35.77272727272727, 'alnum_prop': 0.6556543837357052, 'repo_name': 'yanbober/SlideLayout', 'id': '439767278d76fea540db92bdafe6cbb0ae8af7a1', 'size': '791', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/res/layout/item_demo_page.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '24407'}]}
import { render } from '@stencil/core/testing'; import { StcTabs } from './tabs'; import { StcTabHeader } from './tab-header'; import { StcTabContent } from './tab-content'; describe('Tabs', () => { it('should build', () => { expect(new StcTabs()).toBeTruthy(); }); describe('rendering', () => { let element; beforeEach(async () => { element = await render({ components: [StcTabs, StcTabHeader, StcTabContent], html: ` <stc-tabs> <stc-tab-header slot="header" name="tab1"></stc-tab-header> <stc-tab-content slot="content" name="tab1"></stc-tab-content> </stc-tabs> ` }); }); }); });
{'content_hash': '875ac6622c8cfed091bf6fc44defa256', 'timestamp': '', 'source': 'github', 'line_count': 26, 'max_line_length': 72, 'avg_line_length': 26.23076923076923, 'alnum_prop': 0.5527859237536656, 'repo_name': 'CodeDimension/stencil-components', 'id': '7c51eb52f4182e17144e736cf949ca47b21f6980', 'size': '682', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/components/tabs/tabs.spec.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1667'}, {'name': 'HTML', 'bytes': '2130'}, {'name': 'JavaScript', 'bytes': '324'}, {'name': 'TypeScript', 'bytes': '13575'}]}
<?php /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ Route::get('/', function () { echo "Hello World"; }); Route::get('home', function() { echo "Home"; }); Route::any('{any}', function($uri) { echo "404"; }); Route::controllers([ 'auth' => 'Auth\AuthController', 'password' => 'Auth\PasswordController', ]);
{'content_hash': 'c045e6d498767b2afca624616189e4e2', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 75, 'avg_line_length': 22.655172413793103, 'alnum_prop': 0.5038051750380518, 'repo_name': 'emaale/rating-gallery', 'id': 'b66c5fbfe86bdbebba14c84f5e411db2b11b3c66', 'size': '657', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/Http/routes.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '389'}, {'name': 'JavaScript', 'bytes': '503'}, {'name': 'PHP', 'bytes': '70876'}]}
/** Automatically generated file. DO NOT MODIFY */ package edu.cs4730.threadDemo; public final class BuildConfig { public final static boolean DEBUG = true; }
{'content_hash': '6dd91f83f7b85a26d1a7a51604d190ee', 'timestamp': '', 'source': 'github', 'line_count': 6, 'max_line_length': 50, 'avg_line_length': 27.166666666666668, 'alnum_prop': 0.754601226993865, 'repo_name': 'JimSeker/threads', 'id': '78783e09df90b7426232a1d67f29dc99dc71d770', 'size': '163', 'binary': False, 'copies': '3', 'ref': 'refs/heads/main', 'path': 'eclipse/ThreadDemo/gen/edu/cs4730/threadDemo/BuildConfig.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '26037'}, {'name': 'Kotlin', 'bytes': '11236'}]}
from __future__ import division import collections import itertools def cohen_kappa(data, missing_functor=lambda x: False, convert_items=lambda x: x): ''' Compute Cohen's kappa - data is in the format [ {unit1:value, unit2:value, ...}, # worker 1 {unit1:value, unit3:value, ...}, # worker 2 ... # more workers ] - missing_functor is a bool-valued function used to separate missing_functor items - convert_items a function to convert_items values (e.g., binarize them) ''' sum_kappas = 0 num_kappas = 0 for w1_answers, w2_answers in itertools.combinations(data, 2): converted_answers = collections.defaultdict(lambda: 0) # confusion matrix # Count cases where w1 has a rating. for key1, a1 in w1_answers.iteritems(): if missing_functor(a1): continue a2 = w2_answers.get(key1) if missing_functor(a2): a2 = None converted_answers[(convert_items(a1), None if a2 is None else convert_items(a2))] += 1 # Now count cases where w2 has a rating, but w1 does not. for key2, a2 in w2_answers.iteritems(): if missing_functor(a2): continue a1 = w1_answers.get(key2) if a1 is None or missing_functor(a1): converted_answers[(None, convert_items(a2))] += 1 s_overlapping = 0 categories = set() for x, count in converted_answers.iteritems(): if x[0] is not None: categories.add(x[0]) if x[1] is not None: categories.add(x[1]) if (x[0] is not None) and (x[1] is not None): s_overlapping += count if s_overlapping < 1: continue # Add a dummy category categories_w_dummy = categories | set([None]) # Probability of agreement (only look at the overlapping data). p_a = sum(converted_answers[(c, c)] for c in categories) / s_overlapping # Probability of agreeing by chance (also include dummy category). p_e = sum( sum(converted_answers[(k, i)] for i in categories_w_dummy) * sum(converted_answers[(j, k)] for j in categories_w_dummy) for k in categories) / ( sum(converted_answers.itervalues()) ** 2) if p_a != p_e: # Precaution to avoid 0/0 division error. sum_kappas += (p_a - p_e) / (1 - p_e) num_kappas += 1 return sum_kappas / num_kappas
{'content_hash': 'faa8e714edc9635d4c5c167a64475b7e', 'timestamp': '', 'source': 'github', 'line_count': 66, 'max_line_length': 98, 'avg_line_length': 39.96969696969697, 'alnum_prop': 0.5496588324488249, 'repo_name': 'varepsilon/cas-eval', 'id': '937deeda21fa1ac2292925f8d77cf606e826ec3e', 'size': '3415', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'logs_processing/cohen_kappa.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '2727'}, {'name': 'HTML', 'bytes': '44288'}, {'name': 'JavaScript', 'bytes': '1063'}, {'name': 'Jupyter Notebook', 'bytes': '44427'}, {'name': 'Python', 'bytes': '96607'}]}
'use strict'; const { ACTION } = require('../../../enums'); const { facadeManager } = require('../../../managers'); module.exports = { healthCheck: (request, reply) => { const action = ACTION.HEALTH_CHECK; facadeManager.healthCheck(action) .then((result) => reply.code(200).send(result)) .catch((error) => { const result = {}; result[_resolveNameServices(error)] = error; reply.code(200).send(result); }); } }; const _resolveNameServices = (error) => { const uri = error.options.uri; return uri.slice(uri.indexOf('api/')).split('/')[1]; };
{'content_hash': '46ec16acc52ed0ed64dc21cb4dcbd2da', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 60, 'avg_line_length': 29.90909090909091, 'alnum_prop': 0.5379939209726444, 'repo_name': 'astesio/api-gateway', 'id': '1525d7f43c55f77dc8732fef9ce145105d841464', 'size': '658', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/api/routes/health-check/health-check-controller.js', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '112112'}, {'name': 'Shell', 'bytes': '1998'}]}
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="false" android:drawable="@drawable/go_back_up" /> <item android:state_pressed="true" android:drawable="@drawable/go_back_down" /> </selector>
{'content_hash': '83f47d6feaa93cf19c6beb1f1e191233', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 82, 'avg_line_length': 39.25, 'alnum_prop': 0.6528662420382165, 'repo_name': 'laddcn/tango-android', 'id': '44799c1f69f9d369ece7cb64eca53b5e6b197ef7', 'size': '314', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tango-android/res/drawable/back_btn_selector.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '171491'}]}
// -*- c++ -*- // Generated by gtkmmproc -- DO NOT MODIFY! #ifndef _PANGOMM_TABARRAY_H #define _PANGOMM_TABARRAY_H #include <glibmm/ustring.h> #include <sigc++/sigc++.h> #include <pangomm/attrlist.h> #include <pango/pango-tabs.h> #include <pango/pango-break.h> /* For PangoLogAttrs */ #include <utility> #ifndef DOXYGEN_SHOULD_SKIP_THIS extern "C" { typedef struct _PangoTabArray PangoTabArray; } #endif namespace Pango { /** @addtogroup pangommEnums pangomm Enums and Flags */ /** * @ingroup pangommEnums */ enum TabAlign { TAB_LEFT }; } // namespace Pango #ifndef DOXYGEN_SHOULD_SKIP_THIS namespace Glib { template <> class Value<Pango::TabAlign> : public Glib::Value_Enum<Pango::TabAlign> { public: static GType value_type() G_GNUC_CONST; }; } // namespace Glib #endif /* DOXYGEN_SHOULD_SKIP_THIS */ namespace Pango { /** A Pango::TabArray contains an array of tab stops. * Each tab stop has an alignment and a position. */ class TabArray { public: #ifndef DOXYGEN_SHOULD_SKIP_THIS typedef TabArray CppObjectType; typedef PangoTabArray BaseObjectType; static GType get_type() G_GNUC_CONST; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ TabArray(); explicit TabArray(PangoTabArray* gobject, bool make_a_copy = true); TabArray(const TabArray& other); TabArray& operator=(const TabArray& other); ~TabArray(); void swap(TabArray& other); ///Provides access to the underlying C instance. PangoTabArray* gobj() { return gobject_; } ///Provides access to the underlying C instance. const PangoTabArray* gobj() const { return gobject_; } ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs. PangoTabArray* gobj_copy() const; protected: PangoTabArray* gobject_; private: public: explicit TabArray(int initial_size, bool positions_in_pixels = true); /** Gets the number of tab stops in @a tab_array. * @return The number of tab stops in the array. */ int get_size() const; /** Resizes a tab array. You must subsequently initialize any tabs that * were added as a result of growing the array. * @param new_size New size of the array. */ void resize(int new_size); /** Sets the alignment and location of a tab stop. * @a alignment must always be Pango::TAB_LEFT in the current * implementation. * @param tab_index The index of a tab stop. * @param alignment Tab alignment. * @param location Tab location in Pango units. */ void set_tab(int tab_index, TabAlign alignment, int location); /** Gets the alignment and position of a tab stop. * @return An std::pair<TabAlign, int>. The first element represents the tab stop alignment, the second one is the tab position. */ std::pair<TabAlign,int> get_tab(int tab_index) const; /** Gets an array of std::pairs containing the tab stop alignments and tab positions. * @return An array of std::pair<TabAlign, int>. The first element in each pair represents the tab stop alignment, the second one is the tab position. */ Glib::ArrayHandle< std::pair<TabAlign,int> > get_tabs() const; /** Returns <tt>true</tt> if the tab positions are in pixels, <tt>false</tt> if they are * in Pango units. * @return Whether positions are in pixels. */ bool get_positions_in_pixels() const; }; } //namespace Pango namespace Pango { /** @relates Pango::TabArray * @param lhs The left-hand side * @param rhs The right-hand side */ inline void swap(TabArray& lhs, TabArray& rhs) { lhs.swap(rhs); } } // namespace Pango namespace Glib { /** A Glib::wrap() method for this object. * * @param object The C instance. * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. * @result A C++ instance that wraps this C instance. * * @relates Pango::TabArray */ Pango::TabArray wrap(PangoTabArray* object, bool take_copy = false); #ifndef DOXYGEN_SHOULD_SKIP_THIS template <> class Value<Pango::TabArray> : public Glib::Value_Boxed<Pango::TabArray> {}; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ } // namespace Glib #endif /* _PANGOMM_TABARRAY_H */
{'content_hash': '910e30ec97ea9038b59c5f179761c287', 'timestamp': '', 'source': 'github', 'line_count': 179, 'max_line_length': 152, 'avg_line_length': 23.47486033519553, 'alnum_prop': 0.6968110423607806, 'repo_name': 'yleydier/gtkmm2_msvc14', 'id': 'b494ef641ac3a4207fdbeb9ea3d618c85166b6d7', 'size': '4999', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'pangomm/pango/pangomm/tabarray.h', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'Batchfile', 'bytes': '366'}, {'name': 'C', 'bytes': '5235202'}, {'name': 'C++', 'bytes': '11467391'}, {'name': 'CMake', 'bytes': '21773'}, {'name': 'CSS', 'bytes': '46494'}, {'name': 'Groff', 'bytes': '444355'}, {'name': 'HTML', 'bytes': '37768711'}, {'name': 'M4', 'bytes': '232791'}, {'name': 'Makefile', 'bytes': '28098'}, {'name': 'Objective-C', 'bytes': '29148'}, {'name': 'Perl', 'bytes': '16894'}, {'name': 'Python', 'bytes': '44431'}, {'name': 'Shell', 'bytes': '15953'}]}
<?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:ignore="contentDescription" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" > <ImageView android:id="@+id/book_image" android:layout_width="80dip" android:layout_height="80dip" android:padding="5dip" android:paddingLeft="0dip" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:id="@+id/book_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dip" android:layout_marginTop="2dip" android:textIsSelectable="true" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginBottom="5dip" > <TextView android:id="@+id/book_no_read_num" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textIsSelectable="true" android:textSize="12sp" /> <ImageView android:id="@+id/book_has_update" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dip" android:layout_marginTop="3dip" android:visibility="gone" android:contentDescription="@null" android:src="@null" /> </LinearLayout> <TextView android:id="@+id/book_lasttitle" android:layout_width="240dip" android:layout_height="wrap_content" android:ellipsize="end" android:paddingRight="5dip" android:singleLine="true" android:textIsSelectable="true" android:textSize="12sp" /> </LinearLayout> </TableRow> </TableLayout>
{'content_hash': 'b4f551d6572b1da2af99d8195d456653', 'timestamp': '', 'source': 'github', 'line_count': 68, 'max_line_length': 71, 'avg_line_length': 38.35294117647059, 'alnum_prop': 0.5230061349693251, 'repo_name': 'sundayliu/android-demo', 'id': '1680cb1d7057c4e92a2e912c144167410dd80d25', 'size': '2608', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Demo/res/layout/listview_bookshelf.xml', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'C++', 'bytes': '197'}, {'name': 'HTML', 'bytes': '1905974'}, {'name': 'Java', 'bytes': '888583'}, {'name': 'Makefile', 'bytes': '199'}]}
layout: api title: ISODay permalink: ISODay/index.html filename: api/ISODay.md ---
{'content_hash': '66a3d07f98a726a7eb5824352254f44e', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 28, 'avg_line_length': 16.6, 'alnum_prop': 0.7590361445783133, 'repo_name': 'tempusjs/tempus-js.com', 'id': '6f4fb91e88fb17174d6b9bcbc5985bfcf4378417', 'size': '87', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': 'api/ISODay.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '24492'}, {'name': 'JavaScript', 'bytes': '7634'}, {'name': 'Ruby', 'bytes': '1257'}]}
<!DOCTYPE html> <html> <head> <title>Mayank Badola</title> <meta name="description" content="ASDE at Expedia. Technology Enthusiast. Occasional Philosopher."> <meta name="keywords" content="Mayank Badola, mayank badola, mayank, mbad0la, github, GitHub, NSIT, Netaji Subhas Institute of Technology, Developer, Web Developer, Software Developer, JavaScript Developer, Software Engineer, Open Source, DuckDuckGo, Fossasia, Hoodie, Mozpacers, ODIN, Open Development Initiative - NSIT, Collegespace, Machine Learning, Big Data, Udacity, Udacity India, Expedia, ASDE, The Air Force School, TAFS, TAFSian"> <meta itemprop="image" content="http://mayankbadola.me/media/me.jpg"> <meta name="twitter:card" content="summary"> <meta name="twitter:site" content="@mbad0la"> <meta name="twitter:title" content="Mayank Badola"> <meta name="twitter:description" content="ASDE at Expedia. Technology Enthusiast. Occasional Philosopher."> <meta property="og:type" content="article"> <meta property="og:title" content="Mayank Badola"> <meta property="og:description" content="ASDE at Expedia. Technology Enthusiast. Occasional Philosopher."> <meta property="og:site_name" content="Mayank Badola"> <meta property="og:url" content="http://mayankbadola.me"> <meta property="og:image" content="http://mayankbadola.me/media/me.jpg"> <meta property="article:author" content="https://facebook.com/mbad0la"> <link rel="icon" href="/media/favicon.png" type="image/x-icon"> <link rel="manifest" href="/manifest.json"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://fonts.googleapis.com/css?family=Roboto+Slab|Gloria+Hallelujah|Open+Sans" rel="stylesheet"> <link rel="stylesheet" href="/css/website.css" /> </head> <body> <div id="root"></div> <script src="/js/website.js"></script> </body> </html>
{'content_hash': '86ee5ef51cf438f2f6c33bbd2537b0e9', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 444, 'avg_line_length': 65.75862068965517, 'alnum_prop': 0.7157839538542213, 'repo_name': 'mbad0la/my-website', 'id': 'ff272e832091468b87aace97eb1703e8e10150cf', 'size': '1907', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'index.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '1907'}, {'name': 'JavaScript', 'bytes': '22635'}]}
// Copyright 2009 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // This benchmark is based on a JavaScript log processing module used // by the V8 profiler to generate execution time profiles for runs of // JavaScript applications, and it effectively measures how fast the // JavaScript engine is at allocating nodes and reclaiming the memory // used for old nodes. Because of the way splay trees work, the engine // also has to deal with a lot of changes to the large tree object // graph. //var Splay = new BenchmarkSuite('Splay', 126125, [ // new Benchmark("Splay", SplayRun, SplaySetup, SplayTearDown) //]); // This is the best random number generator available to mankind ;) var MyMath = { seed: 49734321, random: function() { // Robert Jenkins' 32 bit integer hash function. this.seed = ((this.seed + 0x7ed55d16) + (this.seed << 12)) & 0xffffffff; this.seed = ((this.seed ^ 0xc761c23c) ^ (this.seed >>> 19)) & 0xffffffff; this.seed = ((this.seed + 0x165667b1) + (this.seed << 5)) & 0xffffffff; this.seed = ((this.seed + 0xd3a2646c) ^ (this.seed << 9)) & 0xffffffff; this.seed = ((this.seed + 0xfd7046c5) + (this.seed << 3)) & 0xffffffff; this.seed = ((this.seed ^ 0xb55a4f09) ^ (this.seed >>> 16)) & 0xffffffff; return (this.seed & 0xfffffff) / 0x10000000; }, }; // Configuration. var kSplayTreeSize = 8000; var kSplayTreeModifications = 80; var kSplayTreePayloadDepth = 5; var splayTree = null; function GeneratePayloadTree(depth, key) { if (depth == 0) { return { array : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], string : 'String for key ' + key + ' in leaf node' }; } else { return { left: GeneratePayloadTree(depth - 1, key), right: GeneratePayloadTree(depth - 1, key) }; } } function GenerateKey() { // The benchmark framework guarantees that Math.random is // deterministic; see base.js. // base.js isn't pulled in for trace-tests return MyMath.random(); } function InsertNewNode() { // Insert new node with a unique key. var key; do { key = GenerateKey(); } while (splayTree.find(key) != null); splayTree.insert(key, GeneratePayloadTree(kSplayTreePayloadDepth, key)); return key; } function SplaySetup() { splayTree = new SplayTree(); for (var i = 0; i < kSplayTreeSize; i++) InsertNewNode(); } function SplayTearDown() { // Allow the garbage collector to reclaim the memory // used by the splay tree no matter how we exit the // tear down function. var keys = splayTree.exportKeys(); splayTree = null; // Verify that the splay tree has the right size. var length = keys.length; assertEq(length, kSplayTreeSize); // Verify that the splay tree has sorted, unique keys. for (var i = 0; i < length - 1; i++) { assertEq(keys[i] < keys[i + 1], true); } } function SplayRun() { // Replace a few nodes in the splay tree. for (var i = 0; i < kSplayTreeModifications; i++) { var key = InsertNewNode(); var greatest = splayTree.findGreatestLessThan(key); if (greatest == null) splayTree.remove(key); else splayTree.remove(greatest.key); } } /** * Constructs a Splay tree. A splay tree is a self-balancing binary * search tree with the additional property that recently accessed * elements are quick to access again. It performs basic operations * such as insertion, look-up and removal in O(log(n)) amortized time. * * @constructor */ function SplayTree() { }; /** * Pointer to the root node of the tree. * * @type {SplayTree.Node} * @private */ SplayTree.prototype.root_ = null; /** * @return {boolean} Whether the tree is empty. */ SplayTree.prototype.isEmpty = function() { return !this.root_; }; /** * Inserts a node into the tree with the specified key and value if * the tree does not already contain a node with the specified key. If * the value is inserted, it becomes the root of the tree. * * @param {number} key Key to insert into the tree. * @param {*} value Value to insert into the tree. */ SplayTree.prototype.insert = function(key, value) { if (this.isEmpty()) { this.root_ = new SplayTree.Node(key, value); return; } // Splay on the key to move the last node on the search path for // the key to the root of the tree. this.splay_(key); if (this.root_.key == key) { return; } var node = new SplayTree.Node(key, value); if (key > this.root_.key) { node.left = this.root_; node.right = this.root_.right; this.root_.right = null; } else { node.right = this.root_; node.left = this.root_.left; this.root_.left = null; } this.root_ = node; }; /** * Removes a node with the specified key from the tree if the tree * contains a node with this key. The removed node is returned. If the * key is not found, an exception is thrown. * * @param {number} key Key to find and remove from the tree. * @return {SplayTree.Node} The removed node. */ SplayTree.prototype.remove = function(key) { if (this.isEmpty()) { throw Error('Key not found: ' + key); } this.splay_(key); if (this.root_.key != key) { throw Error('Key not found: ' + key); } var removed = this.root_; if (!this.root_.left) { this.root_ = this.root_.right; } else { var right = this.root_.right; this.root_ = this.root_.left; // Splay to make sure that the new root has an empty right child. this.splay_(key); // Insert the original right child as the right child of the new // root. this.root_.right = right; } return removed; }; /** * Returns the node having the specified key or null if the tree doesn't contain * a node with the specified key. * * @param {number} key Key to find in the tree. * @return {SplayTree.Node} Node having the specified key. */ SplayTree.prototype.find = function(key) { if (this.isEmpty()) { return null; } this.splay_(key); return this.root_.key == key ? this.root_ : null; }; /** * @return {SplayTree.Node} Node having the maximum key value that * is less or equal to the specified key value. */ SplayTree.prototype.findGreatestLessThan = function(key) { if (this.isEmpty()) { return null; } // Splay on the key to move the node with the given key or the last // node on the search path to the top of the tree. this.splay_(key); // Now the result is either the root node or the greatest node in // the left subtree. if (this.root_.key <= key) { return this.root_; } else if (this.root_.left) { return this.findMax(this.root_.left); } else { return null; } }; /** * @return {Array<*>} An array containing all the keys of tree's nodes. */ SplayTree.prototype.exportKeys = function() { var result = []; if (!this.isEmpty()) { this.root_.traverse_(function(node) { result.push(node.key); }); } return result; }; /** * Perform the splay operation for the given key. Moves the node with * the given key to the top of the tree. If no node has the given * key, the last node on the search path is moved to the top of the * tree. This is the simplified top-down splaying algorithm from: * "Self-adjusting Binary Search Trees" by Sleator and Tarjan * * @param {number} key Key to splay the tree on. * @private */ SplayTree.prototype.splay_ = function(key) { if (this.isEmpty()) { return; } // Create a dummy node. The use of the dummy node is a bit // counter-intuitive: The right child of the dummy node will hold // the L tree of the algorithm. The left child of the dummy node // will hold the R tree of the algorithm. Using a dummy node, left // and right will always be nodes and we avoid special cases. var dummy, left, right; dummy = left = right = new SplayTree.Node(null, null); var current = this.root_; while (true) { if (key < current.key) { if (!current.left) { break; } if (key < current.left.key) { // Rotate right. var tmp = current.left; current.left = tmp.right; tmp.right = current; current = tmp; if (!current.left) { break; } } // Link right. right.left = current; right = current; current = current.left; } else if (key > current.key) { if (!current.right) { break; } if (key > current.right.key) { // Rotate left. var tmp = current.right; current.right = tmp.left; tmp.left = current; current = tmp; if (!current.right) { break; } } // Link left. left.right = current; left = current; current = current.right; } else { break; } } // Assemble. left.right = current.left; right.left = current.right; current.left = dummy.right; current.right = dummy.left; this.root_ = current; }; /** * Constructs a Splay tree node. * * @param {number} key Key. * @param {*} value Value. */ SplayTree.Node = function(key, value) { this.key = key; this.value = value; }; /** * @type {SplayTree.Node} */ SplayTree.Node.prototype.left = null; /** * @type {SplayTree.Node} */ SplayTree.Node.prototype.right = null; /** * Performs an ordered traversal of the subtree starting at * this SplayTree.Node. * * @param {function(SplayTree.Node)} f Visitor function. * @private */ SplayTree.Node.prototype.traverse_ = function(f) { var current = this; while (current) { var left = current.left; if (left) left.traverse_(f); f(current); current = current.right; } }; SplaySetup(); SplayRun(); SplayTearDown();
{'content_hash': 'f0beb337fd11bd7f1ba338e23fdbe02f', 'timestamp': '', 'source': 'github', 'line_count': 393, 'max_line_length': 80, 'avg_line_length': 28.307888040712466, 'alnum_prop': 0.6551011235955057, 'repo_name': 'havocp/hwf', 'id': '6d9f8b97703e89b3ea4159f763fa32615e5f9430', 'size': '11125', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'deps/spidermonkey/trace-test/tests/v8-v5/check-splay.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '554069'}, {'name': 'Emacs Lisp', 'bytes': '402'}, {'name': 'JavaScript', 'bytes': '84'}, {'name': 'Shell', 'bytes': '11734'}]}
package tokens import ( "github.com/dustin/go-humanize" "math/rand" "sync" "time" "log" ) type Token struct { ValidTo time.Time ExpiresReadable string Id string VerifiedCount int } type Tokens struct { sync.RWMutex tokens []Token } func Init() Tokens { t := Tokens{} return t } func (t *Tokens) Generate() string { t.Cleanup() var token Token token.Id = RandomString(8) now := time.Now().UTC() token.ValidTo = now.Add(5 * time.Minute) t.Lock() t.tokens = append([]Token{token}, t.tokens...) t.Unlock() return token.Id } func (t *Tokens) Verify(token string) bool { t.Lock() found := false now := time.Now().UTC() for i, data := range t.tokens { if data.Id == token { if now.Before(data.ValidTo) { t.tokens[i].VerifiedCount = t.tokens[i].VerifiedCount + 1 found = true } } } t.Unlock() return found } func (t *Tokens) Cleanup() { var valid []Token t.Lock() if len(t.tokens) > 500 { now := time.Now().UTC() for _, data := range t.tokens { if now.Before(data.ValidTo) { valid = append(valid, data) } } before := len(t.tokens) t.tokens = valid after := len(t.tokens) log.Println("Token clean up:", before-after, "tokens have been removed.") } t.Unlock() } func (t *Tokens) GetAllTokens() []Token { t.RLock() defer t.RUnlock() var r []Token for _, data := range t.tokens { data.ExpiresReadable = humanize.Time(data.ValidTo) r = append(r, data) } return r } func RandomString(n int) string { var letters = []rune("abcdefghijklmnopqrstuvwxyz0123456789") b := make([]rune, n) for i := range b { b[i] = letters[rand.Intn(len(letters))] } return string(b) }
{'content_hash': '58dab36939f4a69e9e204c9560b8e165', 'timestamp': '', 'source': 'github', 'line_count': 96, 'max_line_length': 75, 'avg_line_length': 17.46875, 'alnum_prop': 0.627906976744186, 'repo_name': 'espebra/filebin', 'id': 'af2bcad0c19e96749827d6bc534e1746ee160e63', 'size': '1677', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'app/tokens/token.go', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '1230'}, {'name': 'Go', 'bytes': '82530'}, {'name': 'HTML', 'bytes': '85716'}, {'name': 'JavaScript', 'bytes': '28351'}, {'name': 'Makefile', 'bytes': '630'}, {'name': 'Shell', 'bytes': '1009'}]}
from parser_helper import response_extract from parsel import Selector from bs4 import BeautifulSoup from time import mktime from datetime import datetime from sys import version_info from html import escape import re config = { 'site': 'lesechos', 'websitename': 'les-echos', 'feeds': [ { 'url': 'http://syndication.lesechos.fr/rss/rss_une_titres.xml', 'name': 'rss_une_titres.xml', 'icon': 'https://assets.lesechos.com/lesechos/pics-news/images/favicons/ico_echos.ico', 'logo': '', }, { 'url': 'http://www.lesechos.fr/rss/rss_articles_journal.xml', 'name': 'rss_articles_journal.xml', 'icon': 'https://assets.lesechos.com/lesechos/pics-news/images/favicons/ico_echos.ico', 'logo': '', }, { 'url': 'http://syndication.lesechos.fr/rss/rss_plus_consultes.xml', 'name': 'rss_plus_consultes.xml', 'icon': 'https://assets.lesechos.com/lesechos/pics-news/images/favicons/ico_echos.ico', 'logo': '', }, ], 'allowed_domains': ['lesechos.fr'], 'regex_url_article_cleaner': re.compile('(?P<url>.+?)(?=#)'), 'force_encoding': 'utf-8', 'last_publish_update_field_name': 'published_parsed' } def parse_article(article, response_text, logger): """parse inner article""" sel = Selector(text=response_text) parsed_succeed = True last_parsed_succeed = article.get('last_parsed_succeed', None) try: article['date_published'] = response_extract(sel, 'time[itemprop=datePublished]::attr(datetime)') if not article['date_published']: article['date_published'] = response_extract(sel, 'meta[property="article:published_time"]::attr(content)') except: article['date_published'] = article['feed_original']['published_parsed'] pass try: article['date_modified'] = response_extract(sel, 'time[itemprop=dateModified]::attr(datetime)') if not article['date_modified']: article['date_modified'] = response_extract(sel, 'meta[property="article:modified_time"]::attr(content)') except: article['date_modified'] = None pass try: article['author'] = response_extract(sel, '.meta-author span::text') if not article['author']: article['author'] = response_extract(sel, 'meta[itemprop=creator]::attr(content)') if not article['author']: article['author'] = response_extract(sel, 'meta[property="article:author"]::attr(content)') except: pass try: if sel.css('h1.title-article span::text').extract(): title_part1 = response_extract(sel, 'h1.title-article span::text') title_part2 = response_extract(sel, 'h1.title-article::text', index=1) article['title'] = title_part1 + title_part2 else: article['title'] = response_extract(sel, 'h1.title-article::text', join_str=' ') if not article['title']: article['title'] = response_extract(sel, 'title::text') except: pass article['article_format'] = None content_article = sel.css('.content-article') if content_article: article['chapeau_article'] = response_extract(content_article, 'h2.chapo-article::text', join_str=' ') article['broken_html'] = content_article.extract_first() content_html = u'' soup = BeautifulSoup(article['broken_html'], 'html.parser') article_body = soup.findAll(attrs={"itemprop": "articleBody"}) for elem in article_body: if elem.name in ['h1', 'h2', 'h3']: content_html += u'&lt;h2&gt;' + escape(elem.text.strip()) + u'&lt;/h2&gt;' elif elem.name == 'p': content_html += u'&lt;p&gt;' + escape(elem.text.strip()) + u'&lt;/p&gt;' article['content_html'] = content_html article['article_format'] = 1 else: # try another format article['chapeau_article'] = response_extract(sel, 'h2.chapeau-article::text', join_str=' ') content_article = sel.css('div.contenu_article') if content_article: article['broken_html'] = content_article.extract_first() content_html = u'' soup = BeautifulSoup(article['broken_html'], 'html.parser') article_body = soup.findAll(attrs={"itemprop": "articleBody"})[0] for elem in article_body: if elem.name in ['h1', 'h2', 'h3']: content_html += u'&lt;h2&gt;' + escape(elem.text.strip()) + u'&lt;/h2&gt;' elif elem.name == 'p': content_html += u'&lt;p&gt;' + escape(elem.text.strip()) + u'&lt;/p&gt;' article['content_html'] = content_html article['article_format'] = 2 else: parsed_succeed = False pass need_serialize = not last_parsed_succeed or not parsed_succeed article['last_parsed_succeed'] = parsed_succeed if not parsed_succeed: return False, need_serialize published = datetime.fromtimestamp(mktime(article['feed_original']['published_parsed'])).isoformat() if version_info < (3, 0): published = unicode(published) try: enclosure = next((link for link in article['feed_original']['links'] if link['rel'] == 'enclosure'), {}) except: enclosure = {} article['rss'] = { 'published': published, 'updated': article.get('date_modified', ''), 'title': article['feed_original']['title'], 'link': article['feed_original']['link'], 'id': article['feed_original']['link'], 'author': article['feed_original']['author'], 'content_html': article['content_html'], 'enclosure_type': enclosure.get('type', ''), 'enclosure_href': enclosure.get('href', ''), 'enclosure_length': enclosure.get('length', ''), } return True, need_serialize
{'content_hash': '119cc8bc154e195612b939fa81454f5c', 'timestamp': '', 'source': 'github', 'line_count': 141, 'max_line_length': 119, 'avg_line_length': 43.60992907801418, 'alnum_prop': 0.5731013172873638, 'repo_name': 'nbigot/rss-scrapper', 'id': 'd87fda153f27bd93aad8b8986c4305442a3f85d5', 'size': '6174', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'parsers/lesechos.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '41794'}, {'name': 'Shell', 'bytes': '3548'}]}
/* Created on: Jun 13, 2016 * Author: T.Delame ([email protected]) */ # ifndef PROJECT_ROTATING_CAMERA_H_ # define PROJECT_ROTATING_CAMERA_H_ # include "../../graphics-origin/application/camera.h" namespace graphics_origin { namespace application { /**@brief A camera that rotate around the scene of the transparency demo. * * This camera simply rotate around the scene of the transparency demo. This * is done by adding angles to a variable at each update, in order to recompute * the whole view matrix with high precision. */ class rotating_camera : public graphics_origin::application::camera { Q_OBJECT public: explicit rotating_camera( QObject* parent = nullptr ); private: void do_update() override; gl_real m_last_update_time; gl_real m_rotation_angle; }; }} # endif
{'content_hash': 'cd2301c9c0737cf4bbcaad8a9c1714a8', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 81, 'avg_line_length': 30.77777777777778, 'alnum_prop': 0.7003610108303249, 'repo_name': 'tdelame/Graphics-Origin', 'id': 'eccc1353c2f628742f540a37b623babf4c74024b', 'size': '831', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tutorial/4_graphics/transparency/rotating_camera.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '201056'}, {'name': 'C++', 'bytes': '6700262'}, {'name': 'CMake', 'bytes': '44749'}, {'name': 'Cuda', 'bytes': '1753667'}, {'name': 'GLSL', 'bytes': '17733'}, {'name': 'QML', 'bytes': '14046'}, {'name': 'Shell', 'bytes': '2192'}]}
import datetime from django.test import TestCase from django.utils import timezone, formats from django.core.exceptions import ValidationError from scarlet.versioning.models import published_signal, BaseModel, VersionModel import models class ModelTests(TestCase): fixtures = ('test_data.json',) def _check_different_book_versions(self, bd, bp): self.assertTrue(bd.pk != bp.pk) bd_reviews = list(bd.review_set.all()) bp_reviews = list(bp.review_set.all()) bp_gallery = list(bp.galleries.all()) bd_gallery = list(bd.galleries.all()) self.assertEqual(len(bp_gallery), len(bd_gallery)) self.assertEqual(len(bp_reviews), len(bd_reviews)) bd_reviews[0].text = 'changed' bd_reviews[0].save() bd_gallery[0].name = 'changed' bd_gallery[0].save() self.assertTrue(models.Review.objects.filter(book=bd.pk, text='changed').exists()) self.assertFalse(models.Review.objects.filter(book=bp.pk, text='changed').exists()) self.assertTrue(models.Gallery.objects.filter(book=bd.pk, name='changed').exists()) self.assertFalse(models.Gallery.objects.filter(book=bp.pk, name='changed').exists()) def testBadModel(self): """ need to define _base_model in Meta, its value should be a subclass of BaseModel """ Base = type('Base', (BaseModel,), {'__module__': __name__}) # good Meta = type('Meta', (), {'_base_model': Base}) type('O1', (VersionModel,), {'Meta': Meta, '__module__': __name__}) # bad try: type('O2', (VersionModel,), {'Meta': Meta, '__module__': __name__}) except: self.assertRaises(TypeError) def testNew(self): a = models.Author(name='straight') a.save() self.assertTrue(models.AuthorBase.objects.filter(pk=a.object_id ).exists()) def testGetVersion(self): a = models.AuthorBase.objects.get(pk=1) self.assertEqual(a.get_version(state=models.Author.PUBLISHED), None) v = a.get_version(state=models.Author.DRAFT) self.assertEqual(v.name, 'test') v.publish() # Now returns self.assertEqual(a.get_version(date=timezone.now()), v) # Too old returns none self.assertEqual(a.get_version(date=a.created_date), None) def testPublishedSignal(self): book = models.Book.objects.get(pk=1) self.name = None # define the local listener def published_listener(sender, instance, **kwargs): self.name = instance.name # connect & send the signal published_signal.connect(published_listener) book.publish() self.assertEqual(self.name, book.name) base_book = models.BookBase.objects.get(pk=1) self.assertEqual(book.last_scheduled, base_book.v_last_save) def testPublishedFutureNoSignal(self): book = models.Book.objects.get(pk=1) # define the local listener def published_listener(sender, instance, **kwargs): assert False, "Should not have been called" # connect & send the signal published_signal.connect(published_listener) book.publish(when=timezone.now() + datetime.timedelta(hours=1)) self.assertTrue(book.state, models.Book.SCHEDULED) base_book = models.BookBase.objects.get(pk=1) self.assertFalse(book.last_scheduled == base_book.v_last_save) self.assertTrue(models.Book.objects.filter(object_id=book.object_id, state=models.Book.SCHEDULED).exists()) self.assertFalse(models.Book.objects.filter(object_id=book.object_id, state=models.Book.PUBLISHED).exists()) def testPublishAuthor(self): author = models.Author.objects.get(name='test') author.publish() ad = models.Author.objects.get(object_id=author.object_id, state=models.Author.DRAFT) ap = models.Author.objects.get(object_id=author.object_id, state=models.Author.PUBLISHED) self.assertTrue(ad.pk != ap.pk) # M2m is copied self.assertEqual(list(ap.associates.all()), [models.AuthorBase(pk=2)]) self.assertEqual(list(ad.associates.all()), [models.AuthorBase(pk=2)]) # M2M changes are isolated ab = models.AuthorBase.objects.get(pk=1) ad.associates.add(ab) self.assertEqual(list(ap.associates.all()), [models.AuthorBase(pk=2)]) self.assertEqual(list(ad.associates.all()), [models.AuthorBase(pk=2), models.AuthorBase(pk=1)]) def testPublishBook(self): book = models.Book.objects.get(pk=1) book.publish() bd = models.Book.objects.get(object_id=book.object_id, state=models.Author.DRAFT) bp = models.Book.objects.get(object_id=book.object_id, state=models.Author.PUBLISHED) self._check_different_book_versions(bd, bp) def testMakeDraftBook(self): book = models.Book.objects.get(pk=1) self.assertEqual(book.name, 'Book1') book.publish() # Change the draft odb = models.BookBase.objects.get(pk=1 ).get_version(state=models.Book.DRAFT) self.assertEqual(odb.last_scheduled, odb.last_save) odb.name = 'book2' odb.save() self.assertTrue(models.Book.objects.filter(name='book2').exists()) # Check last scheduled self.assertEqual(odb.last_scheduled, book.last_scheduled) self.assertTrue(odb.last_scheduled < odb.last_save) # Make the current published a draft opb = models.BookBase.objects.get(pk=1 ).get_version(state=models.Book.PUBLISHED) opb.make_draft() db = models.BookBase.objects.get(pk=1 ).get_version(state=models.Book.DRAFT) pb = models.BookBase.objects.get(pk=1 ).get_version(state=models.Book.PUBLISHED) # Check everything changed, properly # new draft is the old published self.assertEqual(db.pk, opb.pk) # but there is a new published self.assertTrue(db.pk != pb.pk) # the new draft is not the same as the old draft self.assertTrue(db.pk != odb.pk) # name was restored self.assertEqual(db.name, 'Book1') self.assertEqual(db.last_scheduled, pb.last_scheduled) self.assertEqual(db.last_scheduled, db.last_save) # Old draft is gone self.assertFalse(models.Book.objects.filter(name='book2').exists()) self._check_different_book_versions(db, pb) def testDeleteRelated(self): book = models.Book.objects.get(pk=1) rs = list(book.review_set.all()) gs = list(book.galleries.all()) book.publish() bp = models.Book.objects.get(object_id=book.object_id, state=models.Author.PUBLISHED) self.assertEqual(models.Review.objects.all().count(), 4) self.assertEqual(models.Gallery.objects.all().count(), 4) # After delete only orginal remains bp.delete() book = models.Book.objects.get(pk=1) self.assertEqual(models.Review.objects.all().count(), 2) self.assertEqual(models.Gallery.objects.all().count(), 2) self.assertEqual(list(book.review_set.all()), rs) self.assertEqual(list(book.galleries.all()), gs) def testDeleteNotRelated(self): store = models.Store.objects.get(pk=1) store.publish() sp = models.Store.objects.get(object_id=1, state=models.Store.PUBLISHED) self.assertEqual(list(sp.books.all()), [models.BookBase(pk=1)]) # After deletion the book still exists sp.delete() self.assertTrue(models.BookBase.objects.filter(pk=1).exists()) self.assertEqual(len(models.Store.objects.all()), 1) def testVersionedUnique(self): """ use versioned_unique to force unique on field value """ self.assertFalse(hasattr(models.Author, 'versioned_unique')) setattr(models.Author, 'versioned_unique', ['name']) self.assertEqual(models.Author.versioned_unique, ['name']) a1 = models.Author.objects.get(vid=1) # should fail on second(duplicate) instance a2 = models.Author(name=a1.name) with self.assertRaises(ValidationError): a2.validate_unique() # multiple versions are not affected (can co-exists) a3 = models.Author(object=a1.object,name=a1.name) a3.validate_unique() def testStatus1(self): book = models.Book.objects.get(vid=1) self.assertEqual(book.state, models.Book.DRAFT) self.assertEqual(book.status_line(), "Draft saved: 08/30/2012") # schedule to publish in future. should get status as Scheduled. future = timezone.now() + datetime.timedelta(days=7) book.publish(when=future) draft = models.Book.objects.get(vid=1) self.assertEqual(draft.last_save, draft.last_scheduled) self.assertEqual(draft.v_last_save, None) # v_last_save empty status = "%s: %s" % ('Publish Scheduled', formats.date_format(draft.date_published, "SHORT_DATE_FORMAT")) self.assertEqual(status, draft.status_line()) # publish it now. should get status as Published when = timezone.now() book = models.Book.objects.get(vid=1) book.publish(when=when) draft2 = models.Book.objects.get(vid=1) self.assertEqual(draft2.last_save, draft2.last_scheduled) self.assertEqual(draft2.last_save, draft2.v_last_save) status = "%s: %s" % ('Published', formats.date_format(draft2.date_published, "SHORT_DATE_FORMAT")) self.assertEqual(status, draft2.status_line()) self.assertEqual(draft2.date_published, when) # schedule to publish in future again. should get status as Scheduled book = models.Book.objects.get(vid=1) future = timezone.now() + datetime.timedelta(days=20) book.publish(when=future) draft = models.Book.objects.get(vid=1) self.assertEqual(draft.last_save, draft.last_scheduled) self.assertTrue(draft.last_scheduled > draft.v_last_save) status = "%s: %s" % ('Publish Scheduled', formats.date_format(draft.date_published, "SHORT_DATE_FORMAT")) self.assertEqual(status, draft.status_line()) def testStatus2(self): book = models.Book.objects.get(vid=1) self.assertEqual(book.state, models.Book.DRAFT) self.assertEqual(book.status_line(), "Draft saved: 08/30/2012") book.publish() book = models.Book.objects.get(object_id=book.object_id, state=models.Book.PUBLISHED) draft = models.Book.objects.get(vid=1, state=models.Book.DRAFT) self.assertEqual(book.v_last_save, draft.v_last_save) self.assertEqual(draft.last_save, draft.last_scheduled) self.assertEqual(draft.last_save, draft.v_last_save) status = "%s: %s" % ('Published', formats.date_format(draft.last_save, "SHORT_DATE_FORMAT")) self.assertEqual(status, book.status_line())
{'content_hash': '6f1cefdf72fafad55a035405ed975b43', 'timestamp': '', 'source': 'github', 'line_count': 299, 'max_line_length': 79, 'avg_line_length': 39.986622073578594, 'alnum_prop': 0.5921712947474072, 'repo_name': 'ff0000/scarlet', 'id': '76c04b783533c2bd02966998901616efdae9c7d4', 'size': '11956', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/version_twomodels/tests.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '217430'}, {'name': 'HTML', 'bytes': '43216'}, {'name': 'JavaScript', 'bytes': '2200686'}, {'name': 'Python', 'bytes': '508579'}, {'name': 'Ruby', 'bytes': '485'}, {'name': 'Shell', 'bytes': '1813'}]}
/** * Automatically generated file. Please do not edit. * @author Highcharts Config Generator by Karasiq * @see [[http://api.highcharts.com/highcharts]] */ package com.highcharts.config import scalajs.js, js.`|` import com.highcharts.CleanJsObject import com.highcharts.HighchartsUtils._ /** * @note JavaScript name: <code>series&lt;momentum&gt;-marker-states-select</code> */ @js.annotation.ScalaJSDefined class SeriesMomentumMarkerStatesSelect extends com.highcharts.HighchartsGenericObject { /** * <p>The fill color of the point marker.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-marker-states-select-fillcolor/">Solid red discs for selected points</a> * @since 6.0.0 */ val fillColor: js.UndefOr[String | js.Object] = js.undefined /** * <p>The color of the point marker&#39;s outline. When <code>undefined</code>, * the series&#39; or point&#39;s color is used.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-marker-states-select-linecolor/">Red line color for selected points</a> * @since 6.0.0 */ val lineColor: js.UndefOr[String | js.Object] = js.undefined /** * <p>The width of the point marker&#39;s outline.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-marker-states-select-linewidth/">3px line width for selected points</a> * @since 6.0.0 */ val lineWidth: js.UndefOr[Double] = js.undefined /** * <p>The radius of the point marker. In hover state, it defaults * to the normal state&#39;s radius + 2.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-marker-states-select-radius/">10px radius for selected points</a> * @since 6.0.0 */ val radius: js.UndefOr[Double] = js.undefined /** * <p>Enable or disable visible feedback for selection.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-marker-states-select-enabled/">Disabled select state</a> * @since 6.0.0 */ val enabled: js.UndefOr[Boolean] = js.undefined } object SeriesMomentumMarkerStatesSelect { /** * @param fillColor <p>The fill color of the point marker.</p> * @param lineColor <p>The color of the point marker&#39;s outline. When <code>undefined</code>,. the series&#39; or point&#39;s color is used.</p> * @param lineWidth <p>The width of the point marker&#39;s outline.</p> * @param radius <p>The radius of the point marker. In hover state, it defaults. to the normal state&#39;s radius + 2.</p> * @param enabled <p>Enable or disable visible feedback for selection.</p> */ def apply(fillColor: js.UndefOr[String | js.Object] = js.undefined, lineColor: js.UndefOr[String | js.Object] = js.undefined, lineWidth: js.UndefOr[Double] = js.undefined, radius: js.UndefOr[Double] = js.undefined, enabled: js.UndefOr[Boolean] = js.undefined): SeriesMomentumMarkerStatesSelect = { val fillColorOuter: js.UndefOr[String | js.Object] = fillColor val lineColorOuter: js.UndefOr[String | js.Object] = lineColor val lineWidthOuter: js.UndefOr[Double] = lineWidth val radiusOuter: js.UndefOr[Double] = radius val enabledOuter: js.UndefOr[Boolean] = enabled com.highcharts.HighchartsGenericObject.toCleanObject(new SeriesMomentumMarkerStatesSelect { override val fillColor: js.UndefOr[String | js.Object] = fillColorOuter override val lineColor: js.UndefOr[String | js.Object] = lineColorOuter override val lineWidth: js.UndefOr[Double] = lineWidthOuter override val radius: js.UndefOr[Double] = radiusOuter override val enabled: js.UndefOr[Boolean] = enabledOuter }) } }
{'content_hash': '61ce3cc3aa57c279308cdbe0aa93c394', 'timestamp': '', 'source': 'github', 'line_count': 78, 'max_line_length': 299, 'avg_line_length': 51.0, 'alnum_prop': 0.7171945701357466, 'repo_name': 'Karasiq/scalajs-highcharts', 'id': '75d574c436b68b0096c5b5720882334cd62e18ce', 'size': '3978', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/scala/com/highcharts/config/SeriesMomentumMarkerStatesSelect.scala', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Scala', 'bytes': '131509301'}]}
package dbtarzan.gui.table import org.scalatest.flatspec.AnyFlatSpec class TableColumnsFitterTest extends AnyFlatSpec { "logistic of 10" should "be around 10" in { assert(TableColumnsFitter.logistic(10) === 10.686513575978815) } "logistic of 20" should "be around 20" in { assert(TableColumnsFitter.logistic(20) === 21.24628288301699) } "logistic of 50" should "be around 50" in { assert(TableColumnsFitter.logistic(50) === 46.843696553792995) } "logistic of 100" should "be around 50" in { assert(TableColumnsFitter.logistic(100) === 49.97731033621018) } }
{'content_hash': 'd5f978c45ead792146df775fbad7eb46', 'timestamp': '', 'source': 'github', 'line_count': 21, 'max_line_length': 65, 'avg_line_length': 28.19047619047619, 'alnum_prop': 0.7246621621621622, 'repo_name': 'aferrandi/dbtarzan', 'id': '134b1133b213c11e0a3b5334cc4d05ad2d65e5cc', 'size': '592', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/test/scala/dbtarzan/gui/table/TableColumnsFitterTest.scala', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'AMPL', 'bytes': '2219'}, {'name': 'CSS', 'bytes': '251'}, {'name': 'HTML', 'bytes': '42198'}, {'name': 'NSIS', 'bytes': '2466'}, {'name': 'Scala', 'bytes': '336621'}, {'name': 'Shell', 'bytes': '3394'}]}
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. package com.cloud.agent.api; /** * */ public class DeleteLogicalRouterAnswer extends Answer { public DeleteLogicalRouterAnswer(Command command, boolean success, String details) { super(command, success, details); } public DeleteLogicalRouterAnswer(Command command, Exception e) { super(command, e); } }
{'content_hash': 'b057b3b49b9aa7546389e205a45f8838', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 70, 'avg_line_length': 36.125, 'alnum_prop': 0.7309688581314879, 'repo_name': 'mufaddalq/cloudstack-datera-driver', 'id': '8a6bb9f193a50cda7a6f102377ee93326991137d', 'size': '1156', 'binary': False, 'copies': '1', 'ref': 'refs/heads/4.2', 'path': 'plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/DeleteLogicalRouterAnswer.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ApacheConf', 'bytes': '250'}, {'name': 'Batchfile', 'bytes': '6317'}, {'name': 'CSS', 'bytes': '302008'}, {'name': 'FreeMarker', 'bytes': '4917'}, {'name': 'HTML', 'bytes': '38671'}, {'name': 'Java', 'bytes': '79758943'}, {'name': 'JavaScript', 'bytes': '4237188'}, {'name': 'Perl', 'bytes': '1879'}, {'name': 'Python', 'bytes': '5187499'}, {'name': 'Shell', 'bytes': '803262'}]}
<?php return [ /* |-------------------------------------------------------------------------- | Authentication Language Lines |-------------------------------------------------------------------------- | | The following language lines are used during authentication for various | messages that we need to display to the user. You are free to modify | these language lines according to your application's requirements. | */ 'failed' => 'Không tìm thấy thông tin đăng nhập được cung cấp', 'throttle' => 'Bạn đã cố gắng đăng nhập quá nhiều. Vui lòng quay lại trong :seconds giây.', ];
{'content_hash': 'e14253b6180fb85c838da4fcf22c48bc', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 95, 'avg_line_length': 37.294117647058826, 'alnum_prop': 0.5031545741324921, 'repo_name': 'iluminar/goodwork', 'id': '65116c3d028ecf7734913bddd7b6657359d13aef', 'size': '668', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'resources/lang/vi-VN/auth.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Dockerfile', 'bytes': '2133'}, {'name': 'HTML', 'bytes': '13010'}, {'name': 'JavaScript', 'bytes': '42172'}, {'name': 'PHP', 'bytes': '1108328'}, {'name': 'Shell', 'bytes': '3791'}, {'name': 'Vue', 'bytes': '290009'}]}
class Disassembler { public: Disassembler(); void disassemble(const std::string &fileName); ~Disassembler(); static const int PROGRAM_START = 512; private: void loadProgram(const std::string &fileName); char hexToChar(int h); unsigned char *buffer; unsigned int bufferLen; }; #endif
{'content_hash': '551c4bc47bce16554a16609f0711fad5', 'timestamp': '', 'source': 'github', 'line_count': 15, 'max_line_length': 49, 'avg_line_length': 20.466666666666665, 'alnum_prop': 0.7068403908794788, 'repo_name': 'jonesdy/Chip8-Disassembler', 'id': 'c6e560cda6ee6de9ea3caef9737c79f89972ed4c', 'size': '416', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Disassembler.hpp', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C++', 'bytes': '12716'}]}
<?php defined('BASEPATH') OR exit('No direct script access allowed'); if(!isset($class)){$class="navbar-default";} ?> <nav class="navbar <?php echo $class;?>"> <form class="navbar-form" style="padding:10px;"> <label class="navbar-title"> <?php echo $title;?> </label> <div class="form-group pull-right"> <div class="input-group"> <input id="txt_search" name="txt_search" type="text" class="form-control" style="color:black;" /> <label class="control-label" for="txt_search"> <?php echo lang('p_search');?> </label> <span class="input-group-btn"> <a href="#" class="a-search btn btn-primary"> <span class="glyphicon glyphicon-search" aria-hidden="true"></span> </a> </span> </div> </div> <div class="form-group pull-right"> <?php foreach($controls as $control) { echo "<div class='input-group' style='padding-right:10px;'>".$control."</div>"; } ?> </div> </form> </nav>
{'content_hash': 'd9b2515de8d7cd6ead7b026cf17fe370', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 113, 'avg_line_length': 39.354838709677416, 'alnum_prop': 0.4745901639344262, 'repo_name': 'DanielNeodata/Credipaz.XEndpoints', 'id': '66ca8dde2136eecc90f5987f871e5deef62e451f', 'size': '1220', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'application/views/general/brow/_header.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '21841'}, {'name': 'HTML', 'bytes': '5376343'}, {'name': 'JavaScript', 'bytes': '681584'}, {'name': 'PHP', 'bytes': '3018783'}, {'name': 'PowerShell', 'bytes': '2678'}]}
using System; using System.Security.Claims; using FubarDev.FtpServer.AccountManagement; namespace FubarDev.FtpServer.Features { /// <summary> /// Authorization information feature. /// </summary> public interface IAuthorizationInformationFeature { /// <summary> /// Gets or sets the current user. /// </summary> [Obsolete("Use the FtpUser property.")] IFtpUser? User { get; set; } /// <summary> /// Gets or sets the current user. /// </summary> ClaimsPrincipal? FtpUser { get; set; } /// <summary> /// Gets or sets the membership provider that authenticated the <see cref="FtpUser"/>. /// </summary> IMembershipProvider? MembershipProvider { get; set; } } }
{'content_hash': '74578ef25d33e66ba521f1ce6f4a11fa', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 94, 'avg_line_length': 27.24137931034483, 'alnum_prop': 0.6, 'repo_name': 'FubarDevelopment/FtpServer', 'id': '1944a2ab7c234f209a1af0fa0da8b4cf27a85083', 'size': '964', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/FubarDev.FtpServer.Abstractions/Features/IAuthorizationInformationFeature.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '1108064'}]}
<!DOCTYPE html> <html lang="es"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="application-name" content="esiosdata"> <title>esiosdata Web</title> <meta name="author" content="Eugenio Panadero" /> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" integrity="sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi" crossorigin="anonymous"> {# <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">#} {% block styles %} {% endblock %} </head> <body> <header> {% block header %} {% endblock %} </header> {% block content %} {% endblock %} <!-- jQuery first, then Tether, then Bootstrap JS. --> {# <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>#} {# <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.3.7/js/tether.min.js" integrity="sha384-XTs3FgkjiBgo8qjEjBk0tGmf3wPrWtA6coPfQDfFEY8AnYJwjalXCiosYRBIBZX8" crossorigin="anonymous"></script>#} {# <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js" integrity="sha384-BLiI7JTZm+JWlgKa0M0kGRpJbF2J8q+qreVrKBC47e3K6BW78kGLrCkeRX6I9RoK" crossorigin="anonymous"></script>#} {% block scripts %} {% endblock %} </body> </html>
{'content_hash': '77bcb13b4867d3b01f3d75ea22bfa293', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 224, 'avg_line_length': 56.724137931034484, 'alnum_prop': 0.6589665653495441, 'repo_name': 'azogue/esiosdata', 'id': '52239efa8ca7fe1f1338ae62934182af187d80c2', 'size': '1645', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'esiosdata/templates/layout.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '8688'}, {'name': 'Jupyter Notebook', 'bytes': '4067807'}, {'name': 'Python', 'bytes': '126329'}]}
namespace Skeleton.Web.Authentication.JwtBearer.Configuration.Validation { using System; using System.Collections.Generic; using Common.Extensions; using Microsoft.IdentityModel.Tokens; public static class TokenValidationParametersExtensions { public static TokenValidationParameters WithIssuerKeyValidation(this TokenValidationParameters parameters, SecurityKey securityKey, IssuerSigningKeyValidator keyValidator = null) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); if (securityKey == null) throw new ArgumentNullException(nameof(securityKey)); parameters.ValidateIssuerSigningKey = true; parameters.IssuerSigningKey = securityKey; parameters.IssuerSigningKeyValidator = keyValidator; return parameters; } public static TokenValidationParameters WithIssuerKeyValidation(this TokenValidationParameters parameters, IssuerSigningKeyResolver securityKeyResolver, IssuerSigningKeyValidator keyValidator = null) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); if (securityKeyResolver == null) throw new ArgumentNullException(nameof(securityKeyResolver)); parameters.ValidateIssuerSigningKey = true; parameters.IssuerSigningKeyResolver = securityKeyResolver; parameters.IssuerSigningKeyValidator = keyValidator; return parameters; } public static TokenValidationParameters WithIssuerKeyValidation(this TokenValidationParameters parameters, IEnumerable<SecurityKey> securityKeys, IssuerSigningKeyValidator keyValidator = null) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); var securityKeysArray = securityKeys.AsArray(); if (securityKeysArray.Length == 0) throw new ArgumentNullException(nameof(securityKeys)); parameters.ValidateIssuerSigningKey = true; parameters.IssuerSigningKeys = securityKeysArray; parameters.IssuerSigningKeyValidator = keyValidator; return parameters; } public static TokenValidationParameters WithoutIssuerKeyValidation(this TokenValidationParameters parameters) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); parameters.ValidateIssuerSigningKey = false; return parameters; } public static TokenValidationParameters WithLifetimeValidation(this TokenValidationParameters parameters, LifetimeValidator lifetimeValidator = null) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); parameters.ValidateLifetime = true; parameters.LifetimeValidator = lifetimeValidator; return parameters; } public static TokenValidationParameters WithoutLifetimeValidation(this TokenValidationParameters parameters) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); parameters.ValidateLifetime = false; return parameters; } public static TokenValidationParameters WithIssuerValidation(this TokenValidationParameters parameters, string validIssuer) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); if (string.IsNullOrWhiteSpace(validIssuer)) throw new ArgumentNullException(nameof(validIssuer)); parameters.ValidateIssuer = true; parameters.ValidIssuer = validIssuer; return parameters; } public static TokenValidationParameters WithIssuerValidation(this TokenValidationParameters parameters, IEnumerable<string> validIssuers) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); var validIssuersArray = validIssuers.AsArray(); if (validIssuersArray.Length == 0) throw new ArgumentNullException(nameof(validIssuers)); parameters.ValidateIssuer = true; parameters.ValidIssuers = validIssuersArray; return parameters; } public static TokenValidationParameters WithoutIssuerValidation(this TokenValidationParameters parameters) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); parameters.ValidateIssuer = false; return parameters; } public static TokenValidationParameters WithAudienceValidation(this TokenValidationParameters parameters, string validAudience) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); if (string.IsNullOrWhiteSpace(validAudience)) throw new ArgumentNullException(nameof(validAudience)); parameters.ValidateAudience = true; parameters.ValidAudience = validAudience; return parameters; } public static TokenValidationParameters WithAudienceValidation(this TokenValidationParameters parameters, IEnumerable<string> validAudiences) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); var validAudiencesArray = validAudiences.AsArray(); if (validAudiencesArray.Length == 0) throw new ArgumentNullException(nameof(validAudiences)); parameters.ValidateAudience = true; parameters.ValidAudiences = validAudiencesArray; return parameters; } public static TokenValidationParameters WithoutAudienceValidation(this TokenValidationParameters parameters) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); parameters.ValidateAudience = false; return parameters; } } }
{'content_hash': '12792c582ff588ee54be6c9731abe4ed', 'timestamp': '', 'source': 'github', 'line_count': 159, 'max_line_length': 117, 'avg_line_length': 40.0, 'alnum_prop': 0.6592767295597485, 'repo_name': 'litichevskiydv/WebInfrastructure', 'id': '3eb094d5e61a61dde337e8ea82953774f24affff', 'size': '6362', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Infrastructure/Web.Authentication/JwtBearer/Configuration/Validation/TokenValidationParametersExtensions.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '454396'}, {'name': 'PowerShell', 'bytes': '1061'}, {'name': 'Shell', 'bytes': '960'}]}
[Flake8](https://pypi.python.org/pypi/flake8) is a collection of tools that analyze the code without running it. This can be understood as a first line of defense and you learn about style and complexity problems you might have in your code. Run flake8 analysis: $ cd <path/to/your/clone> $ flake8 mau_mau/ tests/ --show-source If flake8 is happy it won't produce any output. If not, it looks ike this: mau_mau/play.py:39:80: E501 line too long (84 > 79 characters) #################################################################################### ^ mau_mau/play.py:41:1: E302 expected 2 blank lines, found 1 def main(): ^
{'content_hash': '7c70104677acdaf857d16ee31db42a37', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 241, 'avg_line_length': 46.375, 'alnum_prop': 0.545822102425876, 'repo_name': 'obestwalter/mau-mau', 'id': 'a31ed30257933774e0a180d74f392d09bd544857', 'size': '777', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/dev/static-analysis.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '24127'}]}
layout: page title: "ARTH 3079: Medieval Art Survey Statistics" comments: true description: "blanks" keywords: "ARTH,3079,CU,Boulder" --- <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script> <!-- <script src="../assets/js/highcharts.js"></script> --> <style type="text/css">@font-face { font-family: "Bebas Neue"; src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype"); } h1.Bebas { font-family: "Bebas Neue", Verdana, Tahoma; } </style> </head> <body> <div id="container" style="float: right; width: 45%; height: 88%; margin-left: 2.5%; margin-right: 2.5%;"></div> <script language="JavaScript"> $(document).ready(function() { var chart = {type: 'column'}; var title = {text: 'Grade Distribution'}; var xAxis = {categories: ['A','B','C','D','F'],crosshair: true}; var yAxis = {min: 0,title: {text: 'Percentage'}}; var tooltip = {headerFormat: '<center><b><span style="font-size:20px">{point.key}</span></b></center>', pointFormat: '<td style="padding:0"><b>{point.y:.1f}%</b></td>', footerFormat: '</table>',shared: true,useHTML: true}; var plotOptions = {column: {pointPadding: 0.0,borderWidth: 0}}; var credits = {enabled: false};var series= [{name: 'Percent',data: [23.71,59.06,13.2,0.6,3.44,]}]; var json = {}; json.chart = chart; json.title = title; json.tooltip = tooltip; json.xAxis = xAxis; json.yAxis = yAxis; json.series = series; json.plotOptions = plotOptions; json.credits = credits; $('#container').highcharts(json); }); </script> </body> #### GRADE AND WORKLOAD STATISTICS **Percent withdrawn**: 3.95% **Percent incomplete**: 0.94% **Average grade** (4.0 scale): 2.98 **Standard deviation in grades** (4.0 scale): 0.25 **Average workload** (raw): 2.5 **Standard deviation in workload** (raw): 0.17 #### COURSE AND INSTRUCTOR RATINGS/INFORMATION **Average course rating** (6 point scale): 4.49 **Standard deviation in course rating** (6 point scale): 0.76 **Average instructor rating** (6 point scale): 4.72 **Standard deviation in instructor rating** (6 point scale): 0.83 **Instructors**: <a href='../../instructors/Kirk_Ambrose'>Kirk Ambrose</a>, <a href='../../instructors/Christine_Bachman'>Christine Bachman</a>, <a href='../../instructors/Charles_Edward_Scillia'>Charles Edward Scillia</a> #### GENERAL CLASS INFORMATION **Years provided**: Fall 2006, Spring 2008, Spring 2009, Spring 2011, Fall 2013, Fall 2014, Fall 2015 **Credits**: 3 **RAP/Honors class?** Neither **Number of Sections**: 7 **Department**: AAAH **College**: College of Arts and Sciences **A&S Division**: Arts and Humanities **Level**: Upper **Activity**: LEC - Lecture
{'content_hash': 'b89df7caf12ff2d991538ef8d1d64777', 'timestamp': '', 'source': 'github', 'line_count': 91, 'max_line_length': 222, 'avg_line_length': 31.439560439560438, 'alnum_prop': 0.6602586508213911, 'repo_name': 'nikhilrajaram/nikhilrajaram.github.io', 'id': '1b34f8aeaac79b21a5cdc99c1d1f14e312f05bee', 'size': '2865', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'courses/ARTH-3079.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '15727'}, {'name': 'HTML', 'bytes': '48339721'}, {'name': 'Python', 'bytes': '9692'}, {'name': 'Ruby', 'bytes': '5940'}]}
ACCEPTED #### According to Index Fungorum #### Published in Annls mycol. 5: 244 (1907) #### Original name Uromyces celtidis Dietel ### Remarks null
{'content_hash': 'c1143ce9b9e648a35839271221fe2719', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 26, 'avg_line_length': 11.615384615384615, 'alnum_prop': 0.7019867549668874, 'repo_name': 'mdoering/backbone', 'id': 'cfecca3985cbc0af75282988a95b6bcc265f0b1f', 'size': '199', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Fungi/Basidiomycota/Pucciniomycetes/Pucciniales/Pucciniaceae/Uromyces/Uromyces celtidis/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.navercorp.pinpoint</groupId> <artifactId>pinpoint-plugins</artifactId> <version>1.9.0-SNAPSHOT</version> </parent> <artifactId>pinpoint-thrift-plugin</artifactId> <name>pinpoint-thrift-plugin</name> <packaging>jar</packaging> <dependencies> <dependency> <groupId>com.navercorp.pinpoint</groupId> <artifactId>pinpoint-bootstrap-core</artifactId> <scope>provided</scope> </dependency> <!-- Thrift --> <dependency> <groupId>org.apache.thrift</groupId> <artifactId>libthrift</artifactId> <scope>provided</scope> </dependency> <!-- Logging depedencies --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> <!-- commons-logging-adapter --> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <scope>compile</scope> </dependency> </dependencies> </project>
{'content_hash': 'dbf7e25f097d538b49ef08ef07cd2f0f', 'timestamp': '', 'source': 'github', 'line_count': 50, 'max_line_length': 104, 'avg_line_length': 34.28, 'alnum_prop': 0.5659276546091015, 'repo_name': 'Xylus/pinpoint', 'id': '306bc7836d44eefd5cf802aa5629cc578386ffc0', 'size': '1714', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'plugins/thrift/pom.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '23110'}, {'name': 'CSS', 'bytes': '534643'}, {'name': 'CoffeeScript', 'bytes': '10124'}, {'name': 'Groovy', 'bytes': '1423'}, {'name': 'HTML', 'bytes': '783457'}, {'name': 'Java', 'bytes': '16266462'}, {'name': 'JavaScript', 'bytes': '4821525'}, {'name': 'Makefile', 'bytes': '5246'}, {'name': 'PLSQL', 'bytes': '4156'}, {'name': 'Python', 'bytes': '3523'}, {'name': 'Ruby', 'bytes': '943'}, {'name': 'Shell', 'bytes': '31351'}, {'name': 'TSQL', 'bytes': '4316'}, {'name': 'Thrift', 'bytes': '15284'}, {'name': 'TypeScript', 'bytes': '1385542'}]}
""" The MIT License (MIT) Copyright (c) [2015-2018] [Andrew Annex] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import pytest import spiceypy as spice import os cwd = os.path.realpath(os.path.dirname(__file__)) def test_geterror(): spice.setmsg("some error occured") spice.sigerr("error") assert spice.failed() assert spice.getmsg("SHORT", 40) == "error" assert spice.getmsg("LONG", 200) == "some error occured" spice.reset() def test_getSpiceyException(): with pytest.raises(spice.stypes.SpiceyError): spice.furnsh(os.path.join(cwd, "_null_kernel.txt")) spice.reset() def test_emptyKernelPoolException(): with pytest.raises(spice.stypes.SpiceyError): spice.ckgp(0, 0, 0, "blah") spice.reset() def test_foundErrorChecker(): with pytest.raises(spice.stypes.SpiceyError): spice.bodc2n(-9991) spice.reset() def test_disable_found_catch(): spice.kclear() with spice.no_found_check(): name, found = spice.bodc2n(-9991) assert not found with pytest.raises(spice.stypes.SpiceyError): spice.bodc2n(-9991) # try more hands on method spice.found_check_off() name, found = spice.bodc2n(-9991) assert not found spice.found_check_on() spice.kclear() def test_recursive_disable_found_catch(): spice.kclear() assert spice.config.catch_false_founds def _recursive_call(i): if i <= 0: return else: with spice.no_found_check(): name, found = spice.bodc2n(-9991) assert not found _recursive_call(i-1) assert spice.config.catch_false_founds _recursive_call(100) spice.kclear() spice.found_check_off() _recursive_call(100) spice.kclear() spice.found_check_on() _recursive_call(100) spice.kclear() def test_found_check(): spice.kclear() spice.found_check_off() name, found = spice.bodc2n(-9991) assert not found spice.kclear() with spice.found_check(): with pytest.raises(spice.stypes.SpiceyError): name = spice.bodc2n(-9991) assert not spice.get_found_catch_state() spice.found_check_on() assert spice.get_found_catch_state() spice.kclear() def test_multiple_founds(): success = spice.stypes.SpiceyError(value="test", found=(True, True)) assert all(success.found) failed = spice.stypes.SpiceyError(value="test",found=(True, False)) assert not all(failed.found) # def test_fun @spice.spiceFoundExceptionThrower def test_fun(): return [0, 0], [False, True] # test it with pytest.raises(spice.stypes.SpiceyError): a = test_fun()
{'content_hash': 'cc1684a6b487e000ac44f4ecce0f673f', 'timestamp': '', 'source': 'github', 'line_count': 122, 'max_line_length': 78, 'avg_line_length': 30.221311475409838, 'alnum_prop': 0.6837537293192297, 'repo_name': 'drbitboy/SpiceyPy', 'id': '8a9d7cb227bf347606b8887dbcd5c0b1a6186d33', 'size': '3687', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spiceypy/tests/test_spiceerrors.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '1111'}, {'name': 'Python', 'bytes': '939452'}]}
using System; namespace Nohros { /// <summary> /// Defines a <see cref="Type"/> that is dynamically loaded at runtime. /// </summary> public interface IRuntimeType { /// <summary> /// Gets the assembly-qualified name of the provider type, which includes /// the name of the assembly from which the provider type was loaded. /// </summary> /// <seealso cref="System.Type.AssemblyQualifiedName"/> string Type { get; } /// <summary> /// Gets a string representing the fully qualified path to the directory /// where the assembly associated with the provider is located. /// </summary> /// <value> /// The fully qualified path to the folder where the provider assembly is /// stored. /// </value> /// <remarks> /// The assembly location must be an absolute path or a path relative to /// the configuration file. /// <para> /// The default location returned by this property is the application base /// directory. /// </para> /// </remarks> string Location { get; } } }
{'content_hash': '96686c2b89764dc52b5e3cf98ee22045', 'timestamp': '', 'source': 'github', 'line_count': 35, 'max_line_length': 78, 'avg_line_length': 31.62857142857143, 'alnum_prop': 0.6124661246612466, 'repo_name': 'nohros/must', 'id': '7c28bf2ea720afa21035921227058454075714d1', 'size': '1109', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/base/common/IRuntimeType.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '588'}, {'name': 'C#', 'bytes': '1940593'}, {'name': 'CSS', 'bytes': '18259'}, {'name': 'JavaScript', 'bytes': '10'}, {'name': 'Protocol Buffer', 'bytes': '342291'}, {'name': 'Python', 'bytes': '4365'}, {'name': 'SQLPL', 'bytes': '1904'}]}
ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Ravenelia pygmaea Lagerh. & Dietel ### Remarks null
{'content_hash': '943c742327d0788a71e9c065f8cdf99f', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 34, 'avg_line_length': 10.692307692307692, 'alnum_prop': 0.7050359712230215, 'repo_name': 'mdoering/backbone', 'id': '1956b75a6b230bb9b5f41984fa1c9ab0634c4f6d', 'size': '197', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Fungi/Basidiomycota/Pucciniomycetes/Pucciniales/Raveneliaceae/Ravenelia/Ravenelia pygmaea/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
package co.yiiu.module.attachment.repository; import co.yiiu.module.attachment.model.Attachment; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * Created by tomoya at 2018/1/24 */ @Repository public interface AttachmentRepository extends JpaRepository<Attachment, Integer> { Attachment findByMd5(String md5); }
{'content_hash': '24fd763f4fe5d53738b36b25581b5d4a', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 82, 'avg_line_length': 27.642857142857142, 'alnum_prop': 0.8113695090439277, 'repo_name': 'yiiu-co/yiiu', 'id': '2a42da56ac8c82bc031617a28701ff81a4b5edce', 'size': '387', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/co/yiiu/module/attachment/repository/AttachmentRepository.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '401261'}, {'name': 'FreeMarker', 'bytes': '134082'}, {'name': 'HTML', 'bytes': '1899479'}, {'name': 'Java', 'bytes': '297010'}, {'name': 'JavaScript', 'bytes': '2544396'}, {'name': 'PHP', 'bytes': '3846'}, {'name': 'Shell', 'bytes': '145'}]}
def consume(filename): chars = 0 words = 0 lines = 0 with open(filename, 'rt') as fp: for line in fp: lines += 1 words += len(line.strip().split()) chars += len(line) return chars, words, lines def daaaangerous(param=0): print("I'm the most dangerous function West of the Mississippi, no test " \ "will cover me!") return 3 / param
{'content_hash': 'efbab5fa459b59290ba2bc6309ee172b', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 79, 'avg_line_length': 23.22222222222222, 'alnum_prop': 0.5526315789473685, 'repo_name': 'terryjbates/pycon-tutorial-tbates', 'id': '7ee63581025d659f85c077b516cbc36c6755de16', 'size': '418', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'wordcount_lib.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Python', 'bytes': '3299'}]}
<?php use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model backend\models\MastersSearch */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="masters-search"> <?php $form = ActiveForm::begin([ 'action' => ['index'], 'method' => 'get', ]); ?> <?= $form->field($model, 'masters_id') ?> <?= $form->field($model, 'masters_first_name') ?> <?= $form->field($model, 'masters_last_name') ?> <?= $form->field($model, 'masters_email') ?> <?= $form->field($model, 'masters_photo') ?> <?= $form->field($model, 'masters_rate') ?> <div class="form-group"> <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?> <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?> </div> <?php ActiveForm::end(); ?> </div>
{'content_hash': '771f20f1a0d49d3601f3ae5db1dc2773', 'timestamp': '', 'source': 'github', 'line_count': 38, 'max_line_length': 75, 'avg_line_length': 22.473684210526315, 'alnum_prop': 0.5386416861826698, 'repo_name': 'tgamanov/easyservice', 'id': '8b159df4df3c1900e6ad8ef5122ec9cb745cffb8', 'size': '854', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'backend/views/masters/_search.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '1541'}, {'name': 'CSS', 'bytes': '2728'}, {'name': 'JavaScript', 'bytes': '222'}, {'name': 'PHP', 'bytes': '200093'}]}
<?xml version="1.0" encoding="UTF-8"?> <netapp xmlns="http://www.netapp.com/filer/admin" version="1.19"> <cifs-share-ace-set> <access-rights>Full control</access-rights> <share-name>hallo</share-name> <user-name>userdir</user-name> </cifs-share-ace-set> </netapp> <?xml version='1.0' encoding='UTF-8' ?> <netapp version='1.1' xmlns='http://www.netapp.com/filer/admin'> <!-- Output of cifs-share-ace-set [Execution Time: 1030 ms] --> <results status='passed'/> </netapp> <?xml version='1.0' encoding='UTF-8' ?> <netapp version='1.1' xmlns='http://www.netapp.com/filer/admin'> <!-- Output of cifs-share-ace-set [Execution Time: 1045 ms] --> <results errno='22' reason='Unknown user/group : asdf' status='failed'/> </netapp> <?xml version='1.0' encoding='UTF-8' ?> <netapp version='1.1' xmlns='http://www.netapp.com/filer/admin'> <!-- Output of cifs-share-ace-set [Execution Time: 1046 ms] --> <results errno='22' reason='No share is matching the name : hallo2' status='failed'/> </netapp> <?xml version="1.0" encoding="UTF-8"?> <netapp xmlns="http://www.netapp.com/filer/admin" version="1.19"> <cifs-share-ace-set> <access-rights>Full control</access-rights> <is-unixgroup>True</is-unixgroup> <share-name>hallo</share-name> <unix-group-name>luma</unix-group-name> </cifs-share-ace-set> </netapp> <?xml version='1.0' encoding='UTF-8' ?> <netapp version='1.1' xmlns='http://www.netapp.com/filer/admin'> <!-- Output of cifs-share-ace-set [Execution Time: 1020 ms] --> <results status='passed'/> </netapp> <?xml version='1.0' encoding='UTF-8' ?> <netapp version='1.1' xmlns='http://www.netapp.com/filer/admin'> <!-- Output of cifs-share-ace-set [Execution Time: 1030 ms] --> <results errno='22' reason='Unknown Unix group : lumaa' status='failed'/> </netapp> NT-Style rights - "Full Control" - "Read" - "Change" - "No Access"
{'content_hash': 'f4c026d3d6590d60f07604213a9c583a', 'timestamp': '', 'source': 'github', 'line_count': 68, 'max_line_length': 89, 'avg_line_length': 28.220588235294116, 'alnum_prop': 0.6492965085982283, 'repo_name': 'ifxit/nidhogg', 'id': 'd76efb71c9eb4e0bb8990d9b9656c3af938955ff', 'size': '1919', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'xml/sevenmode/cifs-share-ace-set.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '192703'}]}
/************************************************************ * Student Name: Maxim Vainshtein * * Exercise Name: Ex1 * * File description: Declaration of GameObject Class * ***********************************************************/ #ifndef __Ex1__GameObject__ #define __Ex1__GameObject__ #include <stdio.h> #include "Coordinate.h" #include "Collection.h" #include "Shape.h" /**************************************************************************************** * GameObject Class:Stores shapes assosiated with a GameObjects, can know if overlapped * * and has an origin point. Represents a collection of shapes with an * * origin point. * ***************************************************************************************/ class GameObject : public Coordinate, public Collection<Shape> { private: // --- PRIVATE FUNCTIONS --- // /********************************************************************************************** * function name: copyShapes * * The Input: const GameObject object (reference) * * The output: none * * The Function Opertion: Copies the input's GameObject's Shapes into the current object. * * *******************************************************************************************/ void copyShapes(const GameObject& cGameObject); protected: // --- PROTECTED FUNCTIONS --- // /********************************************************************************************** * function name: getShape * * The Input: const Coordinate object (reference) * * The output: Shape object (pointer) * * The Function Opertion: Returns the Shape object from the collection at the input * * Coordinate. Null if not found * * *******************************************************************************************/ Shape* getShape(const Coordinate& cCoordinate); public: // --- PUBLIC FUNCTIONS --- // /************************************************************************************************ * function name: GameObject Constructor * * The Input: const Coordinate object (reference) * * The output: none * * The Function Opertion: Initializes the object with an origin * * *********************************************************************************************/ GameObject(const Coordinate& cOrigin); /************************************************************************************************ * function name: GameObject Copy Constructor * * The Input: const GameObject object (reference) * * The output: none * * The Function Opertion: Initializes the object as a copy of the input * * *********************************************************************************************/ GameObject(const GameObject& cGameObject); /********************************************************************************************** * function name: GameObject Destructor * * The Input: none * * The output: none * * The Function Opertion: Destroys the current object. * * *******************************************************************************************/ virtual ~GameObject(); /********************************************************************************************** * function name: operator= * * The Input: const GameObject object (reference) * * The output: GameObject object (reference) * * The Function Opertion: Copies the contents of the input object * * *******************************************************************************************/ GameObject& operator=(const GameObject& cGameObject); /********************************************************************************************** * function name: isOverlap * * The Input: const GameObject object (reference), const Coordinate object (reference) * * The output: bool * * The Function Opertion: Returns true if the input GameObject overlaps the current object, * * with the addition of the Coordinate object to the input GameObject's* * position. If does not overlap, returns false. * * *******************************************************************************************/ bool isOverlap(const GameObject& cGameObject, const Coordinate& cCoordinate = Coordinate(0, 0)) const; /********************************************************************************************** * function name: isOverlap * * The Input: const Shape object (reference), const Coordinate object (reference) * * The output: bool * * The Function Opertion: Returns true if the input Shape overlaps the current object, * * with the addition of the Coordinate object to the input Shape * * position. If does not overlap, returns false. * * *******************************************************************************************/ bool isOverlap(const Shape& cShape, const Coordinate& cCoordinate = Coordinate(0, 0)) const; /********************************************************************************************** * function name: isOverlap * * The Input: const Coordinate object (reference) * * The output: bool * * The Function Opertion: Returns true if the current object overlaps the input Coordinate. * * *******************************************************************************************/ bool isOverlap(const Coordinate& cCoordinate) const; /********************************************************************************************** * function name: clone * * The Input: none * * The output: GameObject object (pointer) * * The Function Opertion: Returns a copy of the current object. * * *******************************************************************************************/ virtual GameObject* clone() const = 0; }; #endif
{'content_hash': 'af5b1d48237d342ff11db113d4e2421a', 'timestamp': '', 'source': 'github', 'line_count': 136, 'max_line_length': 106, 'avg_line_length': 62.470588235294116, 'alnum_prop': 0.2947269303201507, 'repo_name': 'MaximV88/Battleship', 'id': 'b07033699edbc90d8369e60aecf1122831752304', 'size': '8496', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Ex1/GameObject.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C++', 'bytes': '499885'}]}
<?php use Phpmig\Migration\Migration; class App extends Migration { /** * Do the migration */ public function up() { $sql = " CREATE TABLE `app` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '应用ID', `name` varchar(255) NOT NULL COMMENT '应用名称', `code` varchar(16) NOT NULL COMMENT '应用编码', `type` enum('plugin','theme') NOT NULL DEFAULT 'plugin' COMMENT '应用类型(plugin插件应用, theme主题应用)', `description` varchar(1024) NOT NULL DEFAULT '' COMMENT '应用描述', `icon` varchar(255) NOT NULL DEFAULT '' COMMENT '应用图标', `version` varchar(16) NOT NULL COMMENT '应用当前版本', `author` varchar(255) NOT NULL DEFAULT '' COMMENT '应用开发者名称', `created_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '应用安装时间', `updated_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '应用最后更新时间', PRIMARY KEY (`id`), UNIQUE KEY `code` (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='已安装的应用'; "; $container = $this->getContainer(); $container['db']->exec($sql); } /** * Undo the migration */ public function down() { $container = $this->getContainer(); $container['db']->exec("DROP TABLE `app`"); } }
{'content_hash': '8048f05da51151b64b1bd49787081c8a', 'timestamp': '', 'source': 'github', 'line_count': 41, 'max_line_length': 108, 'avg_line_length': 33.51219512195122, 'alnum_prop': 0.5473071324599709, 'repo_name': 'richtermark/SMEAGOnline', 'id': 'e44f1e3d7ea725b5486eaa37dd5214926ea11c26', 'size': '1500', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'vendor/codeages/plugin-bundle/Migrations/20161017114325_App.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '2648'}, {'name': 'CSS', 'bytes': '23380163'}, {'name': 'CoffeeScript', 'bytes': '83631'}, {'name': 'HTML', 'bytes': '4844559'}, {'name': 'JavaScript', 'bytes': '31547974'}, {'name': 'PHP', 'bytes': '22662089'}, {'name': 'PLSQL', 'bytes': '7483'}, {'name': 'Shell', 'bytes': '8793'}, {'name': 'Smarty', 'bytes': '12'}]}
#ifndef BMP085_H_ #define BMP085_H_ #include <stdio.h> #include <avr/io.h> #define BMP085_ADDR (0xEE) //0xEE default I2C address (write mode) #define BMP085_I2CFLEURYPATH "i2cmaster.h" //define the path to i2c fleury lib #define BMP085_I2CINIT 1 //init i2c //registers #define BMP085_REGAC1 0xAA #define BMP085_REGAC2 0xAC #define BMP085_REGAC3 0xAE #define BMP085_REGAC4 0xB0 #define BMP085_REGAC5 0xB2 #define BMP085_REGAC6 0xB4 #define BMP085_REGB1 0xB6 #define BMP085_REGB2 0xB8 #define BMP085_REGMB 0xBA #define BMP085_REGMC 0xBC #define BMP085_REGMD 0xBE #define BMP085_REGCONTROL 0xF4 //control #define BMP085_REGCONTROLOUTPUT 0xF6 //output 0xF6=MSB, 0xF7=LSB, 0xF8=XLSB #define BMP085_REGREADTEMPERATURE 0x2E //read temperature #define BMP085_REGREADPRESSURE 0x34 //read pressure //modes #define BMP085_MODEULTRALOWPOWER 0 //oversampling=0, internalsamples=1, maxconvtimepressure=4.5ms, avgcurrent=3uA, RMSnoise_hPA=0.06, RMSnoise_m=0.5 #define BMP085_MODESTANDARD 1 //oversampling=1, internalsamples=2, maxconvtimepressure=7.5ms, avgcurrent=5uA, RMSnoise_hPA=0.05, RMSnoise_m=0.4 #define BMP085_MODEHIGHRES 2 //oversampling=2, internalsamples=4, maxconvtimepressure=13.5ms, avgcurrent=7uA, RMSnoise_hPA=0.04, RMSnoise_m=0.3 #define BMP085_MODEULTRAHIGHRES 3 //oversampling=3, internalsamples=8, maxconvtimepressure=25.5ms, avgcurrent=12uA, RMSnoise_hPA=0.03, RMSnoise_m=0.25 //autoupdate temperature enabled #define BMP085_AUTOUPDATETEMP 1 //autoupdate temperature every read //setup parameters #define BMP085_MODE BMP085_MODEULTRAHIGHRES //define a mode #define BMP085_UNITPAOFFSET 0 //define a unit offset (pa) #define BMP085_UNITMOFFSET 0 //define a unit offset (m) //avarage filter #define BMP085_FILTERPRESSURE 1 //avarage filter for pressure //variables int16_t bmp085_regac1, bmp085_regac2, bmp085_regac3, bmp085_regb1, bmp085_regb2, bmp085_regmb, bmp085_regmc, bmp085_regmd; uint16_t bmp085_regac4, bmp085_regac5, bmp085_regac6; int32_t bmp085_rawtemperature, bmp085_rawpressure; //functions extern void bmp085_init(); extern int32_t bmp085_getpressure(); extern double bmp085_getaltitude(); extern double bmp085_gettemperature(); #endif
{'content_hash': '2b6fd417a098b9ca8f4aed2d97d61b80', 'timestamp': '', 'source': 'github', 'line_count': 60, 'max_line_length': 150, 'avg_line_length': 36.15, 'alnum_prop': 0.7902259105578607, 'repo_name': 'andyOsaft/02_SourceCode', 'id': '61dc8f3b2dd08ec40ed30bf2b2fffaf18d89be4a', 'size': '2513', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'avrStudio6projects/riskyDriver/riskyDriver/barometricSensor/bmp085.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '1793446'}, {'name': 'C', 'bytes': '77924541'}, {'name': 'C#', 'bytes': '6747'}, {'name': 'C++', 'bytes': '11749821'}, {'name': 'CSS', 'bytes': '64625'}, {'name': 'D', 'bytes': '1021150'}, {'name': 'JavaScript', 'bytes': '5283'}, {'name': 'Objective-C', 'bytes': '475394'}, {'name': 'Opa', 'bytes': '448'}, {'name': 'Pascal', 'bytes': '92668'}, {'name': 'Python', 'bytes': '2139'}, {'name': 'Scala', 'bytes': '37101'}, {'name': 'Shell', 'bytes': '361170'}, {'name': 'Standard ML', 'bytes': '2058'}, {'name': 'Tcl', 'bytes': '33098'}, {'name': 'XSLT', 'bytes': '2649269'}]}
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Copyright (c) 2011-2012 Litecoin Developers // Copyright (c) 2013 DeltaCoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "netbase.h" #include "util.h" #ifndef WIN32 #include <sys/fcntl.h> #endif #include "strlcpy.h" #include <boost/algorithm/string/case_conv.hpp> // for to_lower() using namespace std; // Settings typedef std::pair<CService, int> proxyType; static proxyType proxyInfo[NET_MAX]; static proxyType nameproxyInfo; int nConnectTimeout = 5000; bool fNameLookup = false; static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff }; enum Network ParseNetwork(std::string net) { boost::to_lower(net); if (net == "ipv4") return NET_IPV4; if (net == "ipv6") return NET_IPV6; if (net == "tor") return NET_TOR; if (net == "i2p") return NET_I2P; return NET_UNROUTABLE; } void SplitHostPort(std::string in, int &portOut, std::string &hostOut) { size_t colon = in.find_last_of(':'); // if a : is found, and it either follows a [...], or no other : is in the string, treat it as port separator bool fHaveColon = colon != in.npos; bool fBracketed = fHaveColon && (in[0]=='[' && in[colon-1]==']'); // if there is a colon, and in[0]=='[', colon is not 0, so in[colon-1] is safe bool fMultiColon = fHaveColon && (in.find_last_of(':',colon-1) != in.npos); if (fHaveColon && (colon==0 || fBracketed || !fMultiColon)) { char *endp = NULL; int n = strtol(in.c_str() + colon + 1, &endp, 10); if (endp && *endp == 0 && n >= 0) { in = in.substr(0, colon); if (n > 0 && n < 0x10000) portOut = n; } } if (in.size()>0 && in[0] == '[' && in[in.size()-1] == ']') hostOut = in.substr(1, in.size()-2); else hostOut = in; } bool static LookupIntern(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup) { vIP.clear(); { CNetAddr addr; if (addr.SetSpecial(std::string(pszName))) { vIP.push_back(addr); return true; } } struct addrinfo aiHint; memset(&aiHint, 0, sizeof(struct addrinfo)); aiHint.ai_socktype = SOCK_STREAM; aiHint.ai_protocol = IPPROTO_TCP; #ifdef WIN32 # ifdef USE_IPV6 aiHint.ai_family = AF_UNSPEC; # else aiHint.ai_family = AF_INET; # endif aiHint.ai_flags = fAllowLookup ? 0 : AI_NUMERICHOST; #else # ifdef USE_IPV6 aiHint.ai_family = AF_UNSPEC; # else aiHint.ai_family = AF_INET; # endif aiHint.ai_flags = fAllowLookup ? AI_ADDRCONFIG : AI_NUMERICHOST; #endif struct addrinfo *aiRes = NULL; int nErr = getaddrinfo(pszName, NULL, &aiHint, &aiRes); if (nErr) return false; struct addrinfo *aiTrav = aiRes; while (aiTrav != NULL && (nMaxSolutions == 0 || vIP.size() < nMaxSolutions)) { if (aiTrav->ai_family == AF_INET) { assert(aiTrav->ai_addrlen >= sizeof(sockaddr_in)); vIP.push_back(CNetAddr(((struct sockaddr_in*)(aiTrav->ai_addr))->sin_addr)); } #ifdef USE_IPV6 if (aiTrav->ai_family == AF_INET6) { assert(aiTrav->ai_addrlen >= sizeof(sockaddr_in6)); vIP.push_back(CNetAddr(((struct sockaddr_in6*)(aiTrav->ai_addr))->sin6_addr)); } #endif aiTrav = aiTrav->ai_next; } freeaddrinfo(aiRes); return (vIP.size() > 0); } bool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup) { if (pszName[0] == 0) return false; char psz[256]; char *pszHost = psz; strlcpy(psz, pszName, sizeof(psz)); if (psz[0] == '[' && psz[strlen(psz)-1] == ']') { pszHost = psz+1; psz[strlen(psz)-1] = 0; } return LookupIntern(pszHost, vIP, nMaxSolutions, fAllowLookup); } bool LookupHostNumeric(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions) { return LookupHost(pszName, vIP, nMaxSolutions, false); } bool Lookup(const char *pszName, std::vector<CService>& vAddr, int portDefault, bool fAllowLookup, unsigned int nMaxSolutions) { if (pszName[0] == 0) return false; int port = portDefault; std::string hostname = ""; SplitHostPort(std::string(pszName), port, hostname); std::vector<CNetAddr> vIP; bool fRet = LookupIntern(hostname.c_str(), vIP, nMaxSolutions, fAllowLookup); if (!fRet) return false; vAddr.resize(vIP.size()); for (unsigned int i = 0; i < vIP.size(); i++) vAddr[i] = CService(vIP[i], port); return true; } bool Lookup(const char *pszName, CService& addr, int portDefault, bool fAllowLookup) { std::vector<CService> vService; bool fRet = Lookup(pszName, vService, portDefault, fAllowLookup, 1); if (!fRet) return false; addr = vService[0]; return true; } bool LookupNumeric(const char *pszName, CService& addr, int portDefault) { return Lookup(pszName, addr, portDefault, false); } bool static Socks4(const CService &addrDest, SOCKET& hSocket) { printf("SOCKS4 connecting %s\n", addrDest.ToString().c_str()); if (!addrDest.IsIPv4()) { closesocket(hSocket); return error("Proxy destination is not IPv4"); } char pszSocks4IP[] = "\4\1\0\0\0\0\0\0user"; struct sockaddr_in addr; socklen_t len = sizeof(addr); if (!addrDest.GetSockAddr((struct sockaddr*)&addr, &len) || addr.sin_family != AF_INET) { closesocket(hSocket); return error("Cannot get proxy destination address"); } memcpy(pszSocks4IP + 2, &addr.sin_port, 2); memcpy(pszSocks4IP + 4, &addr.sin_addr, 4); char* pszSocks4 = pszSocks4IP; int nSize = sizeof(pszSocks4IP); int ret = send(hSocket, pszSocks4, nSize, MSG_NOSIGNAL); if (ret != nSize) { closesocket(hSocket); return error("Error sending to proxy"); } char pchRet[8]; if (recv(hSocket, pchRet, 8, 0) != 8) { closesocket(hSocket); return error("Error reading proxy response"); } if (pchRet[1] != 0x5a) { closesocket(hSocket); if (pchRet[1] != 0x5b) printf("ERROR: Proxy returned error %d\n", pchRet[1]); return false; } printf("SOCKS4 connected %s\n", addrDest.ToString().c_str()); return true; } bool static Socks5(string strDest, int port, SOCKET& hSocket) { printf("SOCKS5 connecting %s\n", strDest.c_str()); if (strDest.size() > 255) { closesocket(hSocket); return error("Hostname too long"); } char pszSocks5Init[] = "\5\1\0"; char *pszSocks5 = pszSocks5Init; ssize_t nSize = sizeof(pszSocks5Init) - 1; ssize_t ret = send(hSocket, pszSocks5, nSize, MSG_NOSIGNAL); if (ret != nSize) { closesocket(hSocket); return error("Error sending to proxy"); } char pchRet1[2]; if (recv(hSocket, pchRet1, 2, 0) != 2) { closesocket(hSocket); return error("Error reading proxy response"); } if (pchRet1[0] != 0x05 || pchRet1[1] != 0x00) { closesocket(hSocket); return error("Proxy failed to initialize"); } string strSocks5("\5\1"); strSocks5 += '\000'; strSocks5 += '\003'; strSocks5 += static_cast<char>(std::min((int)strDest.size(), 255)); strSocks5 += strDest; strSocks5 += static_cast<char>((port >> 8) & 0xFF); strSocks5 += static_cast<char>((port >> 0) & 0xFF); ret = send(hSocket, strSocks5.c_str(), strSocks5.size(), MSG_NOSIGNAL); if (ret != (ssize_t)strSocks5.size()) { closesocket(hSocket); return error("Error sending to proxy"); } char pchRet2[4]; if (recv(hSocket, pchRet2, 4, 0) != 4) { closesocket(hSocket); return error("Error reading proxy response"); } if (pchRet2[0] != 0x05) { closesocket(hSocket); return error("Proxy failed to accept request"); } if (pchRet2[1] != 0x00) { closesocket(hSocket); switch (pchRet2[1]) { case 0x01: return error("Proxy error: general failure"); case 0x02: return error("Proxy error: connection not allowed"); case 0x03: return error("Proxy error: network unreachable"); case 0x04: return error("Proxy error: host unreachable"); case 0x05: return error("Proxy error: connection refused"); case 0x06: return error("Proxy error: TTL expired"); case 0x07: return error("Proxy error: protocol error"); case 0x08: return error("Proxy error: address type not supported"); default: return error("Proxy error: unknown"); } } if (pchRet2[2] != 0x00) { closesocket(hSocket); return error("Error: malformed proxy response"); } char pchRet3[256]; switch (pchRet2[3]) { case 0x01: ret = recv(hSocket, pchRet3, 4, 0) != 4; break; case 0x04: ret = recv(hSocket, pchRet3, 16, 0) != 16; break; case 0x03: { ret = recv(hSocket, pchRet3, 1, 0) != 1; if (ret) return error("Error reading from proxy"); int nRecv = pchRet3[0]; ret = recv(hSocket, pchRet3, nRecv, 0) != nRecv; break; } default: closesocket(hSocket); return error("Error: malformed proxy response"); } if (ret) { closesocket(hSocket); return error("Error reading from proxy"); } if (recv(hSocket, pchRet3, 2, 0) != 2) { closesocket(hSocket); return error("Error reading from proxy"); } printf("SOCKS5 connected %s\n", strDest.c_str()); return true; } bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRet, int nTimeout) { hSocketRet = INVALID_SOCKET; #ifdef USE_IPV6 struct sockaddr_storage sockaddr; #else struct sockaddr sockaddr; #endif socklen_t len = sizeof(sockaddr); if (!addrConnect.GetSockAddr((struct sockaddr*)&sockaddr, &len)) { printf("Cannot connect to %s: unsupported network\n", addrConnect.ToString().c_str()); return false; } SOCKET hSocket = socket(((struct sockaddr*)&sockaddr)->sa_family, SOCK_STREAM, IPPROTO_TCP); if (hSocket == INVALID_SOCKET) return false; #ifdef SO_NOSIGPIPE int set = 1; setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int)); #endif #ifdef WIN32 u_long fNonblock = 1; if (ioctlsocket(hSocket, FIONBIO, &fNonblock) == SOCKET_ERROR) #else int fFlags = fcntl(hSocket, F_GETFL, 0); if (fcntl(hSocket, F_SETFL, fFlags | O_NONBLOCK) == -1) #endif { closesocket(hSocket); return false; } if (connect(hSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR) { // WSAEINVAL is here because some legacy version of winsock uses it if (WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK || WSAGetLastError() == WSAEINVAL) { struct timeval timeout; timeout.tv_sec = nTimeout / 1000; timeout.tv_usec = (nTimeout % 1000) * 1000; fd_set fdset; FD_ZERO(&fdset); FD_SET(hSocket, &fdset); int nRet = select(hSocket + 1, NULL, &fdset, NULL, &timeout); if (nRet == 0) { printf("connection timeout\n"); closesocket(hSocket); return false; } if (nRet == SOCKET_ERROR) { printf("select() for connection failed: %i\n",WSAGetLastError()); closesocket(hSocket); return false; } socklen_t nRetSize = sizeof(nRet); #ifdef WIN32 if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, (char*)(&nRet), &nRetSize) == SOCKET_ERROR) #else if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, &nRet, &nRetSize) == SOCKET_ERROR) #endif { printf("getsockopt() for connection failed: %i\n",WSAGetLastError()); closesocket(hSocket); return false; } if (nRet != 0) { printf("connect() failed after select(): %s\n",strerror(nRet)); closesocket(hSocket); return false; } } #ifdef WIN32 else if (WSAGetLastError() != WSAEISCONN) #else else #endif { printf("connect() failed: %i\n",WSAGetLastError()); closesocket(hSocket); return false; } } // this isn't even strictly necessary // CNode::ConnectNode immediately turns the socket back to non-blocking // but we'll turn it back to blocking just in case #ifdef WIN32 fNonblock = 0; if (ioctlsocket(hSocket, FIONBIO, &fNonblock) == SOCKET_ERROR) #else fFlags = fcntl(hSocket, F_GETFL, 0); if (fcntl(hSocket, F_SETFL, fFlags & !O_NONBLOCK) == SOCKET_ERROR) #endif { closesocket(hSocket); return false; } hSocketRet = hSocket; return true; } bool SetProxy(enum Network net, CService addrProxy, int nSocksVersion) { assert(net >= 0 && net < NET_MAX); if (nSocksVersion != 0 && nSocksVersion != 4 && nSocksVersion != 5) return false; if (nSocksVersion != 0 && !addrProxy.IsValid()) return false; proxyInfo[net] = std::make_pair(addrProxy, nSocksVersion); return true; } bool GetProxy(enum Network net, CService &addrProxy) { assert(net >= 0 && net < NET_MAX); if (!proxyInfo[net].second) return false; addrProxy = proxyInfo[net].first; return true; } bool SetNameProxy(CService addrProxy, int nSocksVersion) { if (nSocksVersion != 0 && nSocksVersion != 5) return false; if (nSocksVersion != 0 && !addrProxy.IsValid()) return false; nameproxyInfo = std::make_pair(addrProxy, nSocksVersion); return true; } bool GetNameProxy() { return nameproxyInfo.second != 0; } bool IsProxy(const CNetAddr &addr) { for (int i=0; i<NET_MAX; i++) { if (proxyInfo[i].second && (addr == (CNetAddr)proxyInfo[i].first)) return true; } return false; } bool ConnectSocket(const CService &addrDest, SOCKET& hSocketRet, int nTimeout) { const proxyType &proxy = proxyInfo[addrDest.GetNetwork()]; // no proxy needed if (!proxy.second) return ConnectSocketDirectly(addrDest, hSocketRet, nTimeout); SOCKET hSocket = INVALID_SOCKET; // first connect to proxy server if (!ConnectSocketDirectly(proxy.first, hSocket, nTimeout)) return false; // do socks negotiation switch (proxy.second) { case 4: if (!Socks4(addrDest, hSocket)) return false; break; case 5: if (!Socks5(addrDest.ToStringIP(), addrDest.GetPort(), hSocket)) return false; break; default: return false; } hSocketRet = hSocket; return true; } bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault, int nTimeout) { string strDest; int port = portDefault; SplitHostPort(string(pszDest), port, strDest); SOCKET hSocket = INVALID_SOCKET; CService addrResolved(CNetAddr(strDest, fNameLookup && !nameproxyInfo.second), port); if (addrResolved.IsValid()) { addr = addrResolved; return ConnectSocket(addr, hSocketRet, nTimeout); } addr = CService("0.0.0.0:0"); if (!nameproxyInfo.second) return false; if (!ConnectSocketDirectly(nameproxyInfo.first, hSocket, nTimeout)) return false; switch(nameproxyInfo.second) { default: case 4: return false; case 5: if (!Socks5(strDest, port, hSocket)) return false; break; } hSocketRet = hSocket; return true; } void CNetAddr::Init() { memset(ip, 0, 16); } void CNetAddr::SetIP(const CNetAddr& ipIn) { memcpy(ip, ipIn.ip, sizeof(ip)); } static const unsigned char pchOnionCat[] = {0xFD,0x87,0xD8,0x7E,0xEB,0x43}; static const unsigned char pchGarliCat[] = {0xFD,0x60,0xDB,0x4D,0xDD,0xB5}; bool CNetAddr::SetSpecial(const std::string &strName) { if (strName.size()>6 && strName.substr(strName.size() - 6, 6) == ".onion") { std::vector<unsigned char> vchAddr = DecodeBase32(strName.substr(0, strName.size() - 6).c_str()); if (vchAddr.size() != 16-sizeof(pchOnionCat)) return false; memcpy(ip, pchOnionCat, sizeof(pchOnionCat)); for (unsigned int i=0; i<16-sizeof(pchOnionCat); i++) ip[i + sizeof(pchOnionCat)] = vchAddr[i]; return true; } if (strName.size()>11 && strName.substr(strName.size() - 11, 11) == ".oc.b32.i2p") { std::vector<unsigned char> vchAddr = DecodeBase32(strName.substr(0, strName.size() - 11).c_str()); if (vchAddr.size() != 16-sizeof(pchGarliCat)) return false; memcpy(ip, pchOnionCat, sizeof(pchGarliCat)); for (unsigned int i=0; i<16-sizeof(pchGarliCat); i++) ip[i + sizeof(pchGarliCat)] = vchAddr[i]; return true; } return false; } CNetAddr::CNetAddr() { Init(); } CNetAddr::CNetAddr(const struct in_addr& ipv4Addr) { memcpy(ip, pchIPv4, 12); memcpy(ip+12, &ipv4Addr, 4); } #ifdef USE_IPV6 CNetAddr::CNetAddr(const struct in6_addr& ipv6Addr) { memcpy(ip, &ipv6Addr, 16); } #endif CNetAddr::CNetAddr(const char *pszIp, bool fAllowLookup) { Init(); std::vector<CNetAddr> vIP; if (LookupHost(pszIp, vIP, 1, fAllowLookup)) *this = vIP[0]; } CNetAddr::CNetAddr(const std::string &strIp, bool fAllowLookup) { Init(); std::vector<CNetAddr> vIP; if (LookupHost(strIp.c_str(), vIP, 1, fAllowLookup)) *this = vIP[0]; } int CNetAddr::GetByte(int n) const { return ip[15-n]; } bool CNetAddr::IsIPv4() const { return (memcmp(ip, pchIPv4, sizeof(pchIPv4)) == 0); } bool CNetAddr::IsIPv6() const { return (!IsIPv4() && !IsTor() && !IsI2P()); } bool CNetAddr::IsRFC1918() const { return IsIPv4() && ( GetByte(3) == 10 || (GetByte(3) == 192 && GetByte(2) == 168) || (GetByte(3) == 172 && (GetByte(2) >= 16 && GetByte(2) <= 31))); } bool CNetAddr::IsRFC3927() const { return IsIPv4() && (GetByte(3) == 169 && GetByte(2) == 254); } bool CNetAddr::IsRFC3849() const { return GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0x0D && GetByte(12) == 0xB8; } bool CNetAddr::IsRFC3964() const { return (GetByte(15) == 0x20 && GetByte(14) == 0x02); } bool CNetAddr::IsRFC6052() const { static const unsigned char pchRFC6052[] = {0,0x64,0xFF,0x9B,0,0,0,0,0,0,0,0}; return (memcmp(ip, pchRFC6052, sizeof(pchRFC6052)) == 0); } bool CNetAddr::IsRFC4380() const { return (GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0 && GetByte(12) == 0); } bool CNetAddr::IsRFC4862() const { static const unsigned char pchRFC4862[] = {0xFE,0x80,0,0,0,0,0,0}; return (memcmp(ip, pchRFC4862, sizeof(pchRFC4862)) == 0); } bool CNetAddr::IsRFC4193() const { return ((GetByte(15) & 0xFE) == 0xFC); } bool CNetAddr::IsRFC6145() const { static const unsigned char pchRFC6145[] = {0,0,0,0,0,0,0,0,0xFF,0xFF,0,0}; return (memcmp(ip, pchRFC6145, sizeof(pchRFC6145)) == 0); } bool CNetAddr::IsRFC4843() const { return (GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0x00 && (GetByte(12) & 0xF0) == 0x10); } bool CNetAddr::IsTor() const { return (memcmp(ip, pchOnionCat, sizeof(pchOnionCat)) == 0); } bool CNetAddr::IsI2P() const { return (memcmp(ip, pchGarliCat, sizeof(pchGarliCat)) == 0); } bool CNetAddr::IsLocal() const { // IPv4 loopback if (IsIPv4() && (GetByte(3) == 127 || GetByte(3) == 0)) return true; // IPv6 loopback (::1/128) static const unsigned char pchLocal[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}; if (memcmp(ip, pchLocal, 16) == 0) return true; return false; } bool CNetAddr::IsMulticast() const { return (IsIPv4() && (GetByte(3) & 0xF0) == 0xE0) || (GetByte(15) == 0xFF); } bool CNetAddr::IsValid() const { // Clean up 3-byte shifted addresses caused by garbage in size field // of addr messages from versions before 0.2.9 checksum. // Two consecutive addr messages look like this: // header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26 addr26 addr26... // so if the first length field is garbled, it reads the second batch // of addr misaligned by 3 bytes. if (memcmp(ip, pchIPv4+3, sizeof(pchIPv4)-3) == 0) return false; // unspecified IPv6 address (::/128) unsigned char ipNone[16] = {}; if (memcmp(ip, ipNone, 16) == 0) return false; // documentation IPv6 address if (IsRFC3849()) return false; if (IsIPv4()) { // INADDR_NONE uint32_t ipNone = INADDR_NONE; if (memcmp(ip+12, &ipNone, 4) == 0) return false; // 0 ipNone = 0; if (memcmp(ip+12, &ipNone, 4) == 0) return false; } return true; } bool CNetAddr::IsRoutable() const { return IsValid() && !(IsRFC1918() || IsRFC3927() || IsRFC4862() || (IsRFC4193() && !IsTor() && !IsI2P()) || IsRFC4843() || IsLocal()); } enum Network CNetAddr::GetNetwork() const { if (!IsRoutable()) return NET_UNROUTABLE; if (IsIPv4()) return NET_IPV4; if (IsTor()) return NET_TOR; if (IsI2P()) return NET_I2P; return NET_IPV6; } std::string CNetAddr::ToStringIP() const { if (IsTor()) return EncodeBase32(&ip[6], 10) + ".onion"; if (IsI2P()) return EncodeBase32(&ip[6], 10) + ".oc.b32.i2p"; CService serv(*this, 0); #ifdef USE_IPV6 struct sockaddr_storage sockaddr; #else struct sockaddr sockaddr; #endif socklen_t socklen = sizeof(sockaddr); if (serv.GetSockAddr((struct sockaddr*)&sockaddr, &socklen)) { char name[1025] = ""; if (!getnameinfo((const struct sockaddr*)&sockaddr, socklen, name, sizeof(name), NULL, 0, NI_NUMERICHOST)) return std::string(name); } if (IsIPv4()) return strprintf("%u.%u.%u.%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0)); else return strprintf("%x:%x:%x:%x:%x:%x:%x:%x", GetByte(15) << 8 | GetByte(14), GetByte(13) << 8 | GetByte(12), GetByte(11) << 8 | GetByte(10), GetByte(9) << 8 | GetByte(8), GetByte(7) << 8 | GetByte(6), GetByte(5) << 8 | GetByte(4), GetByte(3) << 8 | GetByte(2), GetByte(1) << 8 | GetByte(0)); } std::string CNetAddr::ToString() const { return ToStringIP(); } bool operator==(const CNetAddr& a, const CNetAddr& b) { return (memcmp(a.ip, b.ip, 16) == 0); } bool operator!=(const CNetAddr& a, const CNetAddr& b) { return (memcmp(a.ip, b.ip, 16) != 0); } bool operator<(const CNetAddr& a, const CNetAddr& b) { return (memcmp(a.ip, b.ip, 16) < 0); } bool CNetAddr::GetInAddr(struct in_addr* pipv4Addr) const { if (!IsIPv4()) return false; memcpy(pipv4Addr, ip+12, 4); return true; } #ifdef USE_IPV6 bool CNetAddr::GetIn6Addr(struct in6_addr* pipv6Addr) const { memcpy(pipv6Addr, ip, 16); return true; } #endif // get canonical identifier of an address' group // no two connections will be attempted to addresses with the same group std::vector<unsigned char> CNetAddr::GetGroup() const { std::vector<unsigned char> vchRet; int nClass = NET_IPV6; int nStartByte = 0; int nBits = 16; // all local addresses belong to the same group if (IsLocal()) { nClass = 255; nBits = 0; } // all unroutable addresses belong to the same group if (!IsRoutable()) { nClass = NET_UNROUTABLE; nBits = 0; } // for IPv4 addresses, '1' + the 16 higher-order bits of the IP // includes mapped IPv4, SIIT translated IPv4, and the well-known prefix else if (IsIPv4() || IsRFC6145() || IsRFC6052()) { nClass = NET_IPV4; nStartByte = 12; } // for 6to4 tunneled addresses, use the encapsulated IPv4 address else if (IsRFC3964()) { nClass = NET_IPV4; nStartByte = 2; } // for Teredo-tunneled IPv6 addresses, use the encapsulated IPv4 address else if (IsRFC4380()) { vchRet.push_back(NET_IPV4); vchRet.push_back(GetByte(3) ^ 0xFF); vchRet.push_back(GetByte(2) ^ 0xFF); return vchRet; } else if (IsTor()) { nClass = NET_TOR; nStartByte = 6; nBits = 4; } else if (IsI2P()) { nClass = NET_I2P; nStartByte = 6; nBits = 4; } // for he.net, use /36 groups else if (GetByte(15) == 0x20 && GetByte(14) == 0x11 && GetByte(13) == 0x04 && GetByte(12) == 0x70) nBits = 36; // for the rest of the IPv6 network, use /32 groups else nBits = 32; vchRet.push_back(nClass); while (nBits >= 8) { vchRet.push_back(GetByte(15 - nStartByte)); nStartByte++; nBits -= 8; } if (nBits > 0) vchRet.push_back(GetByte(15 - nStartByte) | ((1 << nBits) - 1)); return vchRet; } uint64 CNetAddr::GetHash() const { uint256 hash = Hash(&ip[0], &ip[16]); uint64 nRet; memcpy(&nRet, &hash, sizeof(nRet)); return nRet; } void CNetAddr::print() const { printf("CNetAddr(%s)\n", ToString().c_str()); } // private extensions to enum Network, only returned by GetExtNetwork, // and only used in GetReachabilityFrom static const int NET_UNKNOWN = NET_MAX + 0; static const int NET_TEREDO = NET_MAX + 1; int static GetExtNetwork(const CNetAddr *addr) { if (addr == NULL) return NET_UNKNOWN; if (addr->IsRFC4380()) return NET_TEREDO; return addr->GetNetwork(); } /** Calculates a metric for how reachable (*this) is from a given partner */ int CNetAddr::GetReachabilityFrom(const CNetAddr *paddrPartner) const { enum Reachability { REACH_UNREACHABLE, REACH_DEFAULT, REACH_TEREDO, REACH_IPV6_WEAK, REACH_IPV4, REACH_IPV6_STRONG, REACH_PRIVATE }; if (!IsRoutable()) return REACH_UNREACHABLE; int ourNet = GetExtNetwork(this); int theirNet = GetExtNetwork(paddrPartner); bool fTunnel = IsRFC3964() || IsRFC6052() || IsRFC6145(); switch(theirNet) { case NET_IPV4: switch(ourNet) { default: return REACH_DEFAULT; case NET_IPV4: return REACH_IPV4; } case NET_IPV6: switch(ourNet) { default: return REACH_DEFAULT; case NET_TEREDO: return REACH_TEREDO; case NET_IPV4: return REACH_IPV4; case NET_IPV6: return fTunnel ? REACH_IPV6_WEAK : REACH_IPV6_STRONG; // only prefer giving our IPv6 address if it's not tunneled } case NET_TOR: switch(ourNet) { default: return REACH_DEFAULT; case NET_IPV4: return REACH_IPV4; // Tor users can connect to IPv4 as well case NET_TOR: return REACH_PRIVATE; } case NET_I2P: switch(ourNet) { default: return REACH_DEFAULT; case NET_I2P: return REACH_PRIVATE; } case NET_TEREDO: switch(ourNet) { default: return REACH_DEFAULT; case NET_TEREDO: return REACH_TEREDO; case NET_IPV6: return REACH_IPV6_WEAK; case NET_IPV4: return REACH_IPV4; } case NET_UNKNOWN: case NET_UNROUTABLE: default: switch(ourNet) { default: return REACH_DEFAULT; case NET_TEREDO: return REACH_TEREDO; case NET_IPV6: return REACH_IPV6_WEAK; case NET_IPV4: return REACH_IPV4; case NET_I2P: return REACH_PRIVATE; // assume connections from unroutable addresses are case NET_TOR: return REACH_PRIVATE; // either from Tor/I2P, or don't care about our address } } } void CService::Init() { port = 0; } CService::CService() { Init(); } CService::CService(const CNetAddr& cip, unsigned short portIn) : CNetAddr(cip), port(portIn) { } CService::CService(const struct in_addr& ipv4Addr, unsigned short portIn) : CNetAddr(ipv4Addr), port(portIn) { } #ifdef USE_IPV6 CService::CService(const struct in6_addr& ipv6Addr, unsigned short portIn) : CNetAddr(ipv6Addr), port(portIn) { } #endif CService::CService(const struct sockaddr_in& addr) : CNetAddr(addr.sin_addr), port(ntohs(addr.sin_port)) { assert(addr.sin_family == AF_INET); } #ifdef USE_IPV6 CService::CService(const struct sockaddr_in6 &addr) : CNetAddr(addr.sin6_addr), port(ntohs(addr.sin6_port)) { assert(addr.sin6_family == AF_INET6); } #endif bool CService::SetSockAddr(const struct sockaddr *paddr) { switch (paddr->sa_family) { case AF_INET: *this = CService(*(const struct sockaddr_in*)paddr); return true; #ifdef USE_IPV6 case AF_INET6: *this = CService(*(const struct sockaddr_in6*)paddr); return true; #endif default: return false; } } CService::CService(const char *pszIpPort, bool fAllowLookup) { Init(); CService ip; if (Lookup(pszIpPort, ip, 0, fAllowLookup)) *this = ip; } CService::CService(const char *pszIpPort, int portDefault, bool fAllowLookup) { Init(); CService ip; if (Lookup(pszIpPort, ip, portDefault, fAllowLookup)) *this = ip; } CService::CService(const std::string &strIpPort, bool fAllowLookup) { Init(); CService ip; if (Lookup(strIpPort.c_str(), ip, 0, fAllowLookup)) *this = ip; } CService::CService(const std::string &strIpPort, int portDefault, bool fAllowLookup) { Init(); CService ip; if (Lookup(strIpPort.c_str(), ip, portDefault, fAllowLookup)) *this = ip; } unsigned short CService::GetPort() const { return port; } bool operator==(const CService& a, const CService& b) { return (CNetAddr)a == (CNetAddr)b && a.port == b.port; } bool operator!=(const CService& a, const CService& b) { return (CNetAddr)a != (CNetAddr)b || a.port != b.port; } bool operator<(const CService& a, const CService& b) { return (CNetAddr)a < (CNetAddr)b || ((CNetAddr)a == (CNetAddr)b && a.port < b.port); } bool CService::GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const { if (IsIPv4()) { if (*addrlen < (socklen_t)sizeof(struct sockaddr_in)) return false; *addrlen = sizeof(struct sockaddr_in); struct sockaddr_in *paddrin = (struct sockaddr_in*)paddr; memset(paddrin, 0, *addrlen); if (!GetInAddr(&paddrin->sin_addr)) return false; paddrin->sin_family = AF_INET; paddrin->sin_port = htons(port); return true; } #ifdef USE_IPV6 if (IsIPv6()) { if (*addrlen < (socklen_t)sizeof(struct sockaddr_in6)) return false; *addrlen = sizeof(struct sockaddr_in6); struct sockaddr_in6 *paddrin6 = (struct sockaddr_in6*)paddr; memset(paddrin6, 0, *addrlen); if (!GetIn6Addr(&paddrin6->sin6_addr)) return false; paddrin6->sin6_family = AF_INET6; paddrin6->sin6_port = htons(port); return true; } #endif return false; } std::vector<unsigned char> CService::GetKey() const { std::vector<unsigned char> vKey; vKey.resize(18); memcpy(&vKey[0], ip, 16); vKey[16] = port / 0x100; vKey[17] = port & 0x0FF; return vKey; } std::string CService::ToStringPort() const { return strprintf("%i", port); } std::string CService::ToStringIPPort() const { if (IsIPv4() || IsTor() || IsI2P()) { return ToStringIP() + ":" + ToStringPort(); } else { return "[" + ToStringIP() + "]:" + ToStringPort(); } } std::string CService::ToString() const { return ToStringIPPort(); } void CService::print() const { printf("CService(%s)\n", ToString().c_str()); } void CService::SetPort(unsigned short portIn) { port = portIn; }
{'content_hash': '1c2e7e9920d8aaa360ea3b8be9fdcd20', 'timestamp': '', 'source': 'github', 'line_count': 1165, 'max_line_length': 148, 'avg_line_length': 27.896995708154506, 'alnum_prop': 0.5986769230769231, 'repo_name': 'delta-project/deltacoin', 'id': '6bc184acaa1e3d7eec64ed4651cd4cbbf5c4b38a', 'size': '32500', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/netbase.cpp', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '78837'}, {'name': 'C++', 'bytes': '1373211'}, {'name': 'IDL', 'bytes': '11008'}, {'name': 'Objective-C', 'bytes': '2463'}, {'name': 'Python', 'bytes': '18144'}, {'name': 'Shell', 'bytes': '1144'}, {'name': 'TypeScript', 'bytes': '3810608'}]}
<?php namespace Nord\Lumen\Search\Contracts; interface Formatter { /** * @param mixed $value * * @return mixed */ public function format($value); }
{'content_hash': '9208ddf87310420ee1ac9b95ffb9db03', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 44, 'avg_line_length': 14.833333333333334, 'alnum_prop': 0.5898876404494382, 'repo_name': 'nordsoftware/lumen-search', 'id': '6d2551c82dbe39e5d96e65aac2fdc79f17c31e5d', 'size': '178', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'src/Contracts/Formatter.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '24577'}]}
:warning: this repo is no longer maintained, check out my new site at https://github.com/roperzh/roperzh.com This is the data for my personal website, proudly powered by [Hugo](http://hugo.spf13.com/) ## Dependencies - Hugo v0.13 - Node.js && Grunt.js ## Quick start To compile / watch the assets, run: ```bash $ npm install $ grunt ``` To start the Hugo server, run: ```bash $ hugo server --watch --buildDrafts ``` ## Deployment At first place, you need to configure your `deploy.sh` file, a sample is provided in the document root. Then just run: ```bash $ npm run deploy ``` Voilà!
{'content_hash': '54fd206fcfb12cc23edf7e2eae3d7ae8', 'timestamp': '', 'source': 'github', 'line_count': 35, 'max_line_length': 108, 'avg_line_length': 17.085714285714285, 'alnum_prop': 0.697324414715719, 'repo_name': 'roperzh/roperzh.github.io', 'id': '6a9ca7b0bab0d3e5f58a9d82e0c29bb18b603931', 'size': '614', 'binary': False, 'copies': '1', 'ref': 'refs/heads/source', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '22646'}, {'name': 'HTML', 'bytes': '9963'}, {'name': 'JavaScript', 'bytes': '8715'}, {'name': 'Shell', 'bytes': '3554'}]}
extern zend_class_entry *ice_auth_driver_ce; ZEPHIR_INIT_CLASS(Ice_Auth_Driver); PHP_METHOD(Ice_Auth_Driver, __construct); PHP_METHOD(Ice_Auth_Driver, checkHash); PHP_METHOD(Ice_Auth_Driver, completeLogin); PHP_METHOD(Ice_Auth_Driver, getOption); PHP_METHOD(Ice_Auth_Driver, getUser); PHP_METHOD(Ice_Auth_Driver, hash); PHP_METHOD(Ice_Auth_Driver, loggedIn); PHP_METHOD(Ice_Auth_Driver, logout); ZEND_BEGIN_ARG_INFO_EX(arginfo_ice_auth_driver___construct, 0, 0, 0) ZEND_ARG_ARRAY_INFO(0, options, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ice_auth_driver_checkhash, 0, 0, 2) ZEND_ARG_INFO(0, password) ZEND_ARG_INFO(0, hash) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ice_auth_driver_completelogin, 0, 0, 1) ZEND_ARG_INFO(0, user) ZEND_ARG_ARRAY_INFO(0, roles, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ice_auth_driver_getoption, 0, 0, 1) ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ice_auth_driver_getuser, 0, 0, 0) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ice_auth_driver_hash, 0, 0, 1) ZEND_ARG_INFO(0, password) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ice_auth_driver_loggedin, 0, 0, 0) ZEND_ARG_INFO(0, role) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ice_auth_driver_logout, 0, 0, 0) ZEND_ARG_INFO(0, destroy) ZEND_ARG_INFO(0, logoutAll) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(ice_auth_driver_method_entry) { PHP_ME(Ice_Auth_Driver, __construct, arginfo_ice_auth_driver___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Ice_Auth_Driver, checkHash, arginfo_ice_auth_driver_checkhash, ZEND_ACC_PUBLIC) PHP_ME(Ice_Auth_Driver, completeLogin, arginfo_ice_auth_driver_completelogin, ZEND_ACC_PROTECTED) PHP_ME(Ice_Auth_Driver, getOption, arginfo_ice_auth_driver_getoption, ZEND_ACC_PUBLIC) PHP_ME(Ice_Auth_Driver, getUser, arginfo_ice_auth_driver_getuser, ZEND_ACC_PUBLIC) PHP_ME(Ice_Auth_Driver, hash, arginfo_ice_auth_driver_hash, ZEND_ACC_PUBLIC) PHP_ME(Ice_Auth_Driver, loggedIn, arginfo_ice_auth_driver_loggedin, ZEND_ACC_PUBLIC) PHP_ME(Ice_Auth_Driver, logout, arginfo_ice_auth_driver_logout, ZEND_ACC_PUBLIC) PHP_FE_END };
{'content_hash': 'e0066700fd0517cc5bb82fb6f2764d51', 'timestamp': '', 'source': 'github', 'line_count': 60, 'max_line_length': 105, 'avg_line_length': 36.93333333333333, 'alnum_prop': 0.743231046931408, 'repo_name': '0x73/framework', 'id': '6e9b31065e45e9b7d97b45facedfc621e80ac25a', 'size': '2217', 'binary': False, 'copies': '1', 'ref': 'refs/heads/dev', 'path': 'ext/ice/auth/driver.zep.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '476933'}, {'name': 'C++', 'bytes': '7295'}, {'name': 'PHP', 'bytes': '24491'}, {'name': 'Shell', 'bytes': '1104'}, {'name': 'Zephir', 'bytes': '267104'}]}
using System.Windows.Controls; namespace Tailviewer.Ui.DataSourceTree { public sealed class TreeItem { public TreeViewItem TreeViewItem; public IDataSourceViewModel ViewModel; } }
{'content_hash': 'a60ac173289e281e6c51dbbf063ca919', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 40, 'avg_line_length': 18.8, 'alnum_prop': 0.8031914893617021, 'repo_name': 'Kittyfisto/Tailviewer', 'id': '1de562b97781636cf781711f62a131a12cd66937', 'size': '190', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/Tailviewer/Ui/DataSourceTree/TreeItem.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '17715'}, {'name': 'C#', 'bytes': '3221665'}, {'name': 'PureBasic', 'bytes': '751'}]}
package message import ( "bytes" "errors" "github.com/zhangpeihao/goamf" ) type PublishMessage struct { Cmd string Tid float64 StreamName string StreamType string } func NewPublishMessage(reader *bytes.Reader, encoding uint8, cmd string) (*PublishMessage, error) { msg := new(PublishMessage) var err error var tid interface{} var streamName interface{} var streamType interface{} var ok bool //var ok bool msg.Cmd = cmd err = nil // Reading Transaction ID if encoding == 0 { tid, err = amf.ReadValue(reader) } else { tid, err = amf.AMF3_ReadValue(reader) } if err != nil { return msg, errors.New("Unabled to decrypt transaction ID") } msg.Tid, ok = tid.(float64) if !ok { return msg, errors.New("Non valid Transtion ID") } // Reading Null value if encoding == 0 { streamName, err = amf.ReadValue(reader) } else { streamName, err = amf.AMF3_ReadValue(reader) } if err != nil { return msg, errors.New("Unable to Read NULL Value") } // Reading Stream Name if encoding == 0 { streamName, err = amf.ReadValue(reader) } else { streamName, err = amf.AMF3_ReadValue(reader) } if err != nil { return msg, errors.New("Unable to read Stream Name") } msg.StreamName = streamName.(string) //Reading stream type if cmd == "publish" { if encoding == 0 { streamType, err = amf.ReadValue(reader) } else { streamType, err = amf.AMF3_ReadValue(reader) } if err != nil { return msg, errors.New("Unable to read Stream Type") } msg.StreamType = streamType.(string) } return msg, nil } func (msg *PublishMessage) BuildPublishResultMessage(netstatus string, level string, code string, encoding uint8) (*bytes.Buffer, error) { payload := new(bytes.Buffer) var err error // Writing Result if encoding == 0 { _, err = amf.WriteValue(payload, netstatus) } else { _, err = amf.AMF3_WriteValue(payload, netstatus) } if err != nil { return nil, err } // Writing 0 if encoding == 0 { _, err = amf.WriteValue(payload, "0") } else { _, err = amf.AMF3_WriteValue(payload, "0") } if err != nil { return nil, err } // Writing null value if encoding == 0 { _, err = amf.WriteValue(payload, nil) } else { _, err = amf.AMF3_WriteValue(payload, nil) } if err != nil { return nil, err } // Writing Object obj := make(map[string]string) obj["level"] = level obj["code"] = code obj["description"] = msg.StreamName if encoding == 0 { _, err = amf.WriteValue(payload, obj) } else { _, err = amf.AMF3_WriteValue(payload, obj) } if err != nil { return nil, err } return payload, nil }
{'content_hash': 'f6673a5ad84a1abc1a81cb697031325c', 'timestamp': '', 'source': 'github', 'line_count': 130, 'max_line_length': 138, 'avg_line_length': 20.046153846153846, 'alnum_prop': 0.6546431312356101, 'repo_name': 'fserreau/rtmp_server', 'id': '816cd13baab5b8500b9ae19ad86684c917c3c455', 'size': '2606', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'rtmp_server/message/publishmessage.go', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'GCC Machine Description', 'bytes': '21'}, {'name': 'Go', 'bytes': '79359'}, {'name': 'HTML', 'bytes': '6514'}]}
//The MIT License (MIT) //Copyright (c) 2015 Jordi Corbilla //Permission is hereby granted, free of charge, to any person obtaining a copy //of this software and associated documentation files (the "Software"), to deal //in the Software without restriction, including without limitation the rights //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell //copies of the Software, and to permit persons to whom the Software is //furnished to do so, subject to the following conditions: //The above copyright notice and this permission notice shall be included in //all copies or substantial portions of the Software. //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN //THE SOFTWARE. using System; namespace Thundax.MapReduce { /// <summary> /// System Details /// </summary> public class SystemDetails { /// <summary> /// Show CPU Details /// </summary> public static void ShowCpuDetails() { foreach (var item in new System.Management.ManagementObjectSearcher("Select * from Win32_ComputerSystem").Get()) { Console.WriteLine("Number Of Physical Processors: {0} ", item["NumberOfProcessors"]); } int coreCount = 0; foreach (var item in new System.Management.ManagementObjectSearcher("Select * from Win32_Processor").Get()) { coreCount += int.Parse(item["NumberOfCores"].ToString()); } Console.WriteLine("Number Of Cores: {0}", coreCount); } } }
{'content_hash': 'b073e4e76167183c6cd349624c6e525f', 'timestamp': '', 'source': 'github', 'line_count': 50, 'max_line_length': 124, 'avg_line_length': 40.6, 'alnum_prop': 0.6650246305418719, 'repo_name': 'JordiCorbilla/MapReduce', 'id': 'c47725ab50a1152b00ca2494cd3a00078e911838', 'size': '2032', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Common.library/SystemDetails.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '37526'}]}
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ChangeListManager"> <list default="true" id="16dc4d9b-fbd4-4f16-8aed-257515304503" name="Default" comment=""> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/common/config/params-local.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/common/config/params.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/common/models/LoginForm.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/common/models/User.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/tests/_helpers/CodeHelper.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/tests/_helpers/TestHelper.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/tests/functional/TestGuy.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/tests/unit/CodeGuy.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/tests/unit/LoginFormTest.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/tests/unit/_bootstrap.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/aspect-mock/src/AspectMock/Core/Mocker.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/aspect-mock/src/AspectMock/Core/Registry.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/aspect-mock/src/AspectMock/Proxy/ClassProxy.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/aspect-mock/src/AspectMock/Proxy/MethodProxy.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/aspect-mock/src/AspectMock/Proxy/Verifier.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/aspect-mock/src/AspectMock/Test.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/AbstractGuy.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Event/Fail.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Event/PrintResult.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Event/Suite.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Event/Test.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Module.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Module/Filesystem.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Output.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/PHPUnit/Listener.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/PHPUnit/ResultPrinter/UI.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/PHPUnit/Runner.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Subscriber/Cest.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Subscriber/Console.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Subscriber/ErrorHandler.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Subscriber/Logger.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Subscriber/Module.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/SuiteManager.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/codeception/codeception/src/Codeception/Util/Autoload.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/monolog/monolog/src/Monolog/Logger.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/php-code-coverage/PHP/CodeCoverage.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Filter.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/php-file-iterator/File/Iterator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/php-file-iterator/File/Iterator/Facade.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/php-file-iterator/File/Iterator/Factory.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/php-text-template/Text/Template.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/php-timer/PHP/Timer.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/php-token-stream/PHP/Token.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/AssertionFailedError.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsFalse.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsTrue.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/Exception.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/ExpectationFailedException.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/SelfDescribing.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/Test.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/TestFailure.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/TestListener.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Runner/BaseTestRunner.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/TextUI/ResultPrinter.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Util/Filter.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Util/Printer.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Util/Test.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Util/Type.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/psr/log/Psr/Log/LoggerInterface.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Adapter/AbstractAdapter.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Adapter/AbstractFindAdapter.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Adapter/AdapterInterface.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Adapter/BsdFindAdapter.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Adapter/GnuFindAdapter.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Adapter/PhpAdapter.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Comparator/Comparator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Comparator/NumberComparator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Expression/Expression.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Expression/Glob.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Expression/Regex.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Expression/ValueInterface.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Finder.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Iterator/FilenameFilterIterator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Iterator/FilterIterator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Iterator/PathFilterIterator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Iterator/SortableIterator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/Shell/Shell.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/symfony/finder/Symfony/Component/Finder/SplFileInfo.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/base/Application.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/base/Arrayable.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/base/Behavior.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/base/Component.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/base/ErrorException.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/base/Event.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/base/Exception.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/base/Model.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/base/ModelEvent.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/base/Module.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/base/Object.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/behaviors/AutoTimestamp.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/db/ActiveRecord.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/db/Connection.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/db/Exception.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/db/Schema.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/db/TableSchema.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/db/mysql/Schema.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/helpers/ArrayHelper.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/helpers/ArrayHelperBase.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/helpers/Inflector.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/helpers/InflectorBase.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/helpers/Security.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/helpers/SecurityBase.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/helpers/StringHelper.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/helpers/StringHelperBase.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/i18n/I18N.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/i18n/MessageSource.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/i18n/PhpMessageSource.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/log/FileTarget.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/log/Logger.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/log/Target.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/validators/BooleanValidator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/validators/InlineValidator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/validators/RequiredValidator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/validators/Validator.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/web/Application.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/web/Identity.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/web/Session.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/web/User.php" afterPath="" /> <change type="DELETED" beforePath="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/web/UserEvent.php" afterPath="" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/vendor/jakubledl/dissect" afterPath="$PROJECT_DIR$/vendor/jakubledl/dissect" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/vendor/yiisoft/yii2" afterPath="$PROJECT_DIR$/vendor/yiisoft/yii2" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/tests/_bootstrap.php" afterPath="$PROJECT_DIR$/tests/_bootstrap.php" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/tests/_log/codeception-2013-08-01.log" afterPath="$PROJECT_DIR$/tests/_log/codeception-2013-08-01.log" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> </list> <ignored path="advanced.iws" /> <ignored path=".idea/workspace.xml" /> <file path="/Dummy.txt" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375328283018" ignored="false" /> <file path="/LoginFormTest.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375317347365" ignored="false" /> <file path="/a.dummy" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375061180254" ignored="false" /> <file path="/_bootstrap.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375231018883" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Kernel.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375221761348" ignored="false" /> <file path="/Kernel.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375055429856" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Util/Maybe.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375056882512" ignored="false" /> <file path="/Maybe.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375061238177" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Test.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375236686017" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Core/InstanceProxy.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375060497464" ignored="false" /> <file path="/InstanceProxy.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375133905082" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Core/ClassProxy.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375060288325" ignored="false" /> <file path="/ClassProxy.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375227684657" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Util/Undefined.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375056602346" ignored="false" /> <file path="/Mocker.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375058508380" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Core/Mocker.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375297815981" ignored="false" /> <file path="$USER_HOME$/AspectMock/tests/_data/cache/src/AspectMock/Core/Registry.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375136718760" ignored="false" /> <file path="/Registry.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375136687741" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Core/Verifier.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375060836017" ignored="false" /> <file path="/Verifier.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375063206032" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Proxy/Maybe.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375061170542" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Proxy/Anything.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375226777345" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Proxy/Verifier.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375234719224" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Proxy/Undefined.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375061226998" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Proxy/MethodProxy.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375235832183" ignored="false" /> <file path="/MethodProxy.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375134673402" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Core/Registry.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375136710280" ignored="false" /> <file path="/Test.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375233251454" ignored="false" /> <file path="$USER_HOME$/AspectMock/tests/_data/cache/tests/_data/demo/UserModel.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375130401559" ignored="false" /> <file path="$USER_HOME$/AspectMock/tests/_data/cache/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375130401559" ignored="false" /> <file path="/MockFailedTest.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375228257678" ignored="false" /> <file path="$USER_HOME$/AspectMock/tests/unit/MockFailedTest.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375228488311" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Proxy/InstanceProxy.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375234559286" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Proxy/ClassProxy.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375235840780" ignored="false" /> <file path="$USER_HOME$/AspectMock/tests/_data/cache/src/AspectMock/Proxy/InstanceProxy.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375133921128" ignored="false" /> <file path="/MockTest.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375230044140" ignored="false" /> <file path="$USER_HOME$/AspectMock/tests/_data/cache/tests/unit/MockTest.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375134052601" ignored="false" /> <file path="$USER_HOME$/AspectMock/tests/_data/cache/src/AspectMock/Proxy/MethodProxy.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375134688589" ignored="false" /> <file path="$USER_HOME$/AspectMock/tests/unit/testDoubleTest.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375229849788" ignored="false" /> <file path="/testDoubleTest.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375229685921" ignored="false" /> <file path="/YiiBase.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375206118189" ignored="false" /> <file path="/LoginForm.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375207372287" ignored="false" /> <file path="/FilterInjectorTransformer.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375218624400" ignored="false" /> <file path="$USER_HOME$/AspectMock/tests/_bootstrap.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375297594743" ignored="false" /> <file path="$USER_HOME$/AspectMock/tests/_log/coverage/index.html" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375230122265" ignored="false" /> <file path="/Anything.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375226755585" ignored="false" /> <file path="/fragment.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375227589856" ignored="false" /> <file path="$USER_HOME$/AspectMock/src/AspectMock/Proxy/AnythingClassProxy.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375227954448" ignored="false" /> <file path="/AnythingClassProxy.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375227954110" ignored="false" /> <file path="$USER_HOME$/AspectMock/tests/unit/MockTest.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375230044140" ignored="false" /> <file path="$USER_HOME$/AspectMock/scripts/build_doc.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375234765906" ignored="false" /> <file path="$USER_HOME$/AspectMock/README.md" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375267773501" ignored="false" /> <file path="$USER_HOME$/AspectMock/VERSION" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375310856356" ignored="false" /> <file path="/SecurityBase.php" changelist="16dc4d9b-fbd4-4f16-8aed-257515304503" time="1375298947808" ignored="false" /> <option name="TRACKING_ENABLED" value="true" /> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="LAST_RESOLUTION" value="IGNORE" /> </component> <component name="ChangesViewManager" flattened_view="true" show_ignored="false" /> <component name="CreatePatchCommitExecutor"> <option name="PATCH_PATH" value="" /> </component> <component name="DaemonCodeAnalyzer"> <disable_hints /> </component> <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> <component name="FavoritesManager"> <favorites_list name="advanced" /> </component> <component name="FileEditorManager"> <leaf> <file leaf-file-name="_bootstrap.php" pinned="false" current="true" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/tests/_bootstrap.php"> <provider selected="true" editor-type-id="text-editor"> <state line="2" column="0" selection-start="33" selection-end="33" vertical-scroll-proportion="0.072916664"> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="LoginFormTest.php" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/tests/unit/LoginFormTest.php"> <provider selected="true" editor-type-id="text-editor"> <state line="57" column="0" selection-start="1210" selection-end="1548" vertical-scroll-proportion="-15.888889"> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="LoginForm.php" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/common/models/LoginForm.php"> <provider selected="true" editor-type-id="text-editor"> <state line="32" column="0" selection-start="585" selection-end="585" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="FilterInjectorTransformer.php" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/vendor/lisachenko/go-aop-php/src/Go/Instrument/Transformer/FilterInjectorTransformer.php"> <provider selected="true" editor-type-id="text-editor"> <state line="153" column="66" selection-start="4379" selection-end="4379" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="SecurityBase.php" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/vendor/yiisoft/yii2/yii/helpers/SecurityBase.php"> <provider selected="true" editor-type-id="text-editor"> <state line="125" column="42" selection-start="4596" selection-end="4596" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="Kernel.php" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/vendor/codeception/aspect-mock/src/AspectMock/Kernel.php"> <provider selected="true" editor-type-id="text-editor"> <state line="12" column="0" selection-start="334" selection-end="334" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="Assert.php" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php"> <provider selected="true" editor-type-id="text-editor"> <state line="887" column="0" selection-start="28770" selection-end="28770" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="composer.json" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/composer.json"> <provider selected="true" editor-type-id="text-editor"> <state line="6" column="30" selection-start="258" selection-end="258" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> </file> </leaf> </component> <component name="FindManager"> <FindUsagesManager> <setting name="OPEN_NEW_TAB" value="false" /> </FindUsagesManager> </component> <component name="Git.Settings"> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> </component> <component name="GitLogSettings"> <option name="myDateState"> <MyDateState /> </option> </component> <component name="IdeDocumentHistory"> <option name="changedFiles"> <list> <option value="$PROJECT_DIR$/common/models/LoginForm.php" /> <option value="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/YiiBase.php" /> <option value="$PROJECT_DIR$/vendor/yiisoft/yii2/yii/YiiBase.php" /> <option value="$PROJECT_DIR$/tests/_data/cache/common/models/LoginForm.php" /> <option value="$PROJECT_DIR$/vendor/lisachenko/go-aop-php/src/Go/Instrument/ClassLoading/AopComposerLoader.php" /> <option value="$PROJECT_DIR$/vendor/codeception/aspect-mock/src/AspectMock/Kernel.php" /> <option value="$PROJECT_DIR$/vendor/lisachenko/go-aop-php/src/Go/Instrument/Transformer/FilterInjectorTransformer.php" /> <option value="$PROJECT_DIR$/composer.json" /> <option value="$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/helpers/SecurityBase.php" /> <option value="$PROJECT_DIR$/vendor/yiisoft/yii2/yii/helpers/SecurityBase.php" /> <option value="$PROJECT_DIR$/tests/unit/LoginFormTest.php" /> <option value="$PROJECT_DIR$/tests/_bootstrap.php" /> </list> </option> </component> <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" interpreter_name="Unnamed" /> <component name="ProjectFrameBounds"> <option name="x" value="-1" /> <option name="y" value="-4" /> <option name="width" value="1368" /> <option name="height" value="773" /> </component> <component name="ProjectLevelVcsManager" settingsEditedManually="false"> <OptionsSetting value="true" id="Add" /> <OptionsSetting value="true" id="Remove" /> <OptionsSetting value="true" id="Checkout" /> <OptionsSetting value="true" id="Update" /> <OptionsSetting value="true" id="Status" /> <OptionsSetting value="true" id="Edit" /> <ConfirmationsSetting value="0" id="Add" /> <ConfirmationsSetting value="0" id="Remove" /> </component> <component name="ProjectReloadState"> <option name="STATE" value="0" /> </component> <component name="ProjectView"> <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5"> <flattenPackages /> <showMembers /> <showModules /> <showLibraryContents ProjectPane="true" /> <hideEmptyPackages /> <abbreviatePackageNames /> <autoscrollToSource /> <autoscrollFromSource /> <sortByType /> </navigator> <panes> <pane id="ProjectPane"> <subPane> <PATH> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="tests" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="tests" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="unit" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="tests" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="_data" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="common" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="models" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="advanced" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="common" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> </subPane> </pane> <pane id="Scope" /> </panes> </component> <component name="PropertiesComponent"> <property name="WebServerToolWindowFactoryState" value="true" /> <property name="recentsLimit" value="5" /> <property name="restartRequiresConfirmation" value="true" /> <property name="last_opened_file_path" value="$PROJECT_DIR$" /> </component> <component name="PublishConfig"> <servers> <server id="d8e941fb-b390-4b46-9693-81da2dbfa863"> <serverdata> <mappings> <mapping local="$PROJECT_DIR$" /> </mappings> </serverdata> </server> </servers> </component> <component name="RunManager" selected="PHP Script.Test"> <configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit"> <TestRunner /> <method /> </configuration> <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console"> <method /> </configuration> <configuration default="true" type="PhpUnitRemoteRunConfigurationType" factoryName="PHPUnit on Server"> <method /> </configuration> <configuration default="false" name="Test" type="PhpLocalRunConfigurationType" factoryName="PHP Console" path="$PROJECT_DIR$/vendor/bin/codecept" scriptParameters="run"> <CommandLine workingDirectory="$PROJECT_DIR$" /> <RunnerSettings RunnerId="PhpScriptDebugRunner" /> <ConfigurationWrapper RunnerId="PhpScriptDebugRunner" /> <method /> </configuration> <list size="1"> <item index="0" class="java.lang.String" itemvalue="PHP Script.Test" /> </list> </component> <component name="ShelveChangesManager" show_recycled="false" /> <component name="TaskManager"> <task active="true" id="Default" summary="Default task"> <changelist id="16dc4d9b-fbd4-4f16-8aed-257515304503" name="Default" comment="" /> <created>1375016010656</created> <updated>1375016010656</updated> </task> <servers /> </component> <component name="ToolWindowManager"> <frame x="-1" y="-4" width="1368" height="773" extended-state="6" /> <editor active="true" /> <layout> <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32923076" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.15454546" sideWeight="0.5784615" order="0" side_tool="false" content_ui="combo" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.42153847" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3287037" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> </layout> </component> <component name="VcsContentAnnotationSettings"> <option name="myLimit" value="2678400000" /> </component> <component name="VcsManagerConfiguration"> <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" /> <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" /> <option name="CHECK_NEW_TODO" value="true" /> <option name="myTodoPanelSettings"> <value> <are-packages-shown value="false" /> <are-modules-shown value="false" /> <flatten-packages value="false" /> <is-autoscroll-to-source value="false" /> </value> </option> <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" /> <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" /> <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" /> <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" /> <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" /> <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" /> <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" /> <option name="CHANGED_ON_SERVER_INTERVAL" value="60" /> <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" /> <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" /> <option name="DEFAULT_PATCH_EXTENSION" value="patch" /> <option name="SHORT_DIFF_HORIZONTALLY" value="true" /> <option name="SHORT_DIFF_EXTRA_LINES" value="2" /> <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" /> <option name="INCLUDE_TEXT_INTO_PATCH" value="false" /> <option name="INCLUDE_TEXT_INTO_SHELF" value="false" /> <option name="SHOW_FILE_HISTORY_DETAILS" value="true" /> <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" /> <option name="SHOW_DIRTY_RECURSIVELY" value="false" /> <option name="LIMIT_HISTORY" value="true" /> <option name="MAXIMUM_HISTORY_ROWS" value="1000" /> <option name="UPDATE_FILTER_SCOPE_NAME" /> <option name="USE_COMMIT_MESSAGE_MARGIN" value="false" /> <option name="COMMIT_MESSAGE_MARGIN_SIZE" value="72" /> <option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="false" /> <option name="FORCE_NON_EMPTY_COMMENT" value="false" /> <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" /> <option name="LAST_COMMIT_MESSAGE" /> <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" /> <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" /> <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" /> <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" /> <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" /> <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" /> <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" /> <option name="ACTIVE_VCS_NAME" /> <option name="UPDATE_GROUP_BY_PACKAGES" value="false" /> <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" /> <option name="UPDATE_FILTER_BY_SCOPE" value="false" /> <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" /> <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" /> </component> <component name="XDebuggerManager"> <breakpoint-manager> <breakpoints> <line-breakpoint enabled="true" type="php"> <url>file://$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/YiiBase.php</url> <line>373</line> <option name="timeStamp" value="5" /> </line-breakpoint> <line-breakpoint enabled="true" type="php"> <url>file://$PROJECT_DIR$/tests/_data/cache/vendor/yiisoft/yii2/yii/YiiBase.php</url> <line>337</line> <option name="timeStamp" value="6" /> </line-breakpoint> <line-breakpoint enabled="true" type="php"> <url>file://$PROJECT_DIR$/tests/_data/cache/vendor/codeception/aspect-mock/src/AspectMock/Core/Mocker.php</url> <line>16</line> <option name="timeStamp" value="11" /> </line-breakpoint> <line-breakpoint enabled="true" type="php"> <url>file://$PROJECT_DIR$/tests/_data/cache/common/models/User.php</url> <line>189</line> <option name="timeStamp" value="13" /> </line-breakpoint> </breakpoints> <option name="time" value="16" /> </breakpoint-manager> </component> <component name="editorHistoryManager"> <entry file="file://$PROJECT_DIR$/vendor/lisachenko/go-aop-php/src/Go/Core/AspectKernel.php"> <provider selected="true" editor-type-id="text-editor"> <state line="105" column="0" selection-start="2820" selection-end="2820" vertical-scroll-proportion="-3.7037036"> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/vendor/codeception/codeception/src/Codeception/Configuration.php"> <provider selected="true" editor-type-id="text-editor"> <state line="79" column="0" selection-start="3052" selection-end="3052" vertical-scroll-proportion="-6.9259257" /> </provider> </entry> <entry file="file://$PROJECT_DIR$/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php"> <provider selected="true" editor-type-id="text-editor"> <state line="997" column="31" selection-start="27721" selection-end="27721" vertical-scroll-proportion="-0.7777778" /> </provider> </entry> <entry file="file://$PROJECT_DIR$/vendor/lisachenko/go-aop-php/src/Go/Instrument/ClassLoading/AopComposerLoader.php"> <provider selected="true" editor-type-id="text-editor"> <state line="41" column="0" selection-start="940" selection-end="940" vertical-scroll-proportion="-3.8888888" /> </provider> </entry> <entry file="file://$PROJECT_DIR$/common/models/User.php"> <provider selected="true" editor-type-id="text-editor"> <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/vendor/codeception/aspect-mock/src/AspectMock/Test.php"> <provider selected="true" editor-type-id="text-editor"> <state line="88" column="27" selection-start="2887" selection-end="2887" vertical-scroll-proportion="-7.259259" /> </provider> </entry> <entry file="file://$PROJECT_DIR$/composer.json"> <provider selected="true" editor-type-id="text-editor"> <state line="6" column="30" selection-start="258" selection-end="258" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/vendor/lisachenko/go-aop-php/src/Go/Instrument/Transformer/FilterInjectorTransformer.php"> <provider selected="true" editor-type-id="text-editor"> <state line="153" column="66" selection-start="4379" selection-end="4379" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/vendor/yiisoft/yii2/yii/helpers/SecurityBase.php"> <provider selected="true" editor-type-id="text-editor"> <state line="125" column="42" selection-start="4596" selection-end="4596" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php"> <provider selected="true" editor-type-id="text-editor"> <state line="887" column="0" selection-start="28770" selection-end="28770" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/vendor/codeception/aspect-mock/src/AspectMock/Kernel.php"> <provider selected="true" editor-type-id="text-editor"> <state line="12" column="0" selection-start="334" selection-end="334" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/common/models/LoginForm.php"> <provider selected="true" editor-type-id="text-editor"> <state line="32" column="0" selection-start="585" selection-end="585" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/tests/unit/LoginFormTest.php"> <provider selected="true" editor-type-id="text-editor"> <state line="57" column="0" selection-start="1210" selection-end="1548" vertical-scroll-proportion="-15.888889"> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/tests/_bootstrap.php"> <provider selected="true" editor-type-id="text-editor"> <state line="2" column="0" selection-start="33" selection-end="33" vertical-scroll-proportion="0.072916664"> <folding /> </state> </provider> </entry> </component> </project>
{'content_hash': 'c1240ed59e9997e2abbe5951c17fff3a', 'timestamp': '', 'source': 'github', 'line_count': 721, 'max_line_length': 223, 'avg_line_length': 79.97226074895978, 'alnum_prop': 0.6934963579604578, 'repo_name': 'DavertMik/Yii2-AspectMock', 'id': 'ed25c7b25a2f566d5146f528c48149dcf9d6c486', 'size': '57660', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '.idea/workspace.xml', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '2238'}, {'name': 'PHP', 'bytes': '56746'}, {'name': 'Shell', 'bytes': '1032'}]}
<!-- Footer --> <footer> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> <ul class="list-inline text-center"> {% if site.RSS %} <li> <a href="{{ "/feed.xml" | prepend: site.baseurl }}"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-rss fa-stack-1x fa-inverse"></i> </span> </a> </li> {% endif %} {% if site.twitter_username %} <li> <a href="https://twitter.com/{{ site.twitter_username }}"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-twitter fa-stack-1x fa-inverse"></i> </span> </a> </li> {% endif %} <!-- add Weibo, Zhihu by Hux, add target = "_blank" to <a> by Hux --> {% if site.zhihu_username %} <li> <a target="_blank" href="https://www.zhihu.com/people/{{ site.zhihu_username }}"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-stack-1x fa-inverse">知</i> </span> </a> </li> {% endif %} {% if site.weibo_username %} <li> <a target="_blank" href="http://weibo.com/{{ site.weibo_username }}"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-weibo fa-stack-1x fa-inverse"></i> </span> </a> </li> {% endif %} {% if site.facebook_username %} <li> <a target="_blank" href="https://www.facebook.com/{{ site.facebook_username }}"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-facebook fa-stack-1x fa-inverse"></i> </span> </a> </li> {% endif %} {% if site.github_username %} <li> <a target="_blank" href="https://github.com/{{ site.github_username }}"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-github fa-stack-1x fa-inverse"></i> </span> </a> </li> {% endif %} {% if site.linkedin_username %} <li> <a target="_blank" href="https://www.linkedin.com/in/{{ site.linkedin_username }}"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-linkedin fa-stack-1x fa-inverse"></i> </span> </a> </li> {% endif %} </ul> <p class="copyright text-muted"> Copyright &copy; {{ site.title }} {{ site.time | date: '%Y' }} <!-- <br> Theme by <a href="http://huangxuan.me">Hux</a> | <iframe style="margin-left: 2px; margin-bottom:-5px;" frameborder="0" scrolling="0" width="100px" height="20px" src="https://ghbtns.com/github-btn.html?user=huxpro&repo=huxpro.github.io&type=star&count=true" > </iframe> --> </p> </div> </div> </div> </footer> <!-- jQuery --> <script src="{{ "/js/jquery.min.js " | prepend: site.baseurl }}"></script> <!-- Bootstrap Core JavaScript --> <!-- Currently, only navbar scroll-down effect at desktop still depends on this --> <script src="{{ "/js/bootstrap.min.js " | prepend: site.baseurl }}"></script> <!-- Custom Theme JavaScript --> <script src="{{ "/js/hux-blog.min.js " | prepend: site.baseurl }}"></script> <!-- Service Worker --> {% if site.service-worker %} <script src="{{ "/js/snackbar.js " | prepend: site.baseurl }}"></script> <script src="{{ "/js/sw-registration.js " | prepend: site.baseurl }}"></script> {% endif %} <!-- async load function --> <script> function async(u, c) { var d = document, t = 'script', o = d.createElement(t), s = d.getElementsByTagName(t)[0]; o.src = u; if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); } s.parentNode.insertBefore(o, s); } </script> <!-- Because of the native support for backtick-style fenced code blocks right within the Markdown is landed in Github Pages, From V1.6, There is no need for Highlight.js, so Huxblog drops it officially. - https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0 - https://help.github.com/articles/creating-and-highlighting-code-blocks/ - https://github.com/jneen/rouge/wiki/list-of-supported-languages-and-lexers --> <!-- <script> async("http://cdn.bootcss.com/highlight.js/8.6/highlight.min.js", function(){ hljs.initHighlightingOnLoad(); }) </script> <link href="http://cdn.bootcss.com/highlight.js/8.6/styles/github.min.css" rel="stylesheet"> --> <!-- jquery.tagcloud.js --> <script> // only load tagcloud.js in tag.html if($('#tag_cloud').length !== 0){ async('{{ "/js/jquery.tagcloud.js" | prepend: site.baseurl }}',function(){ $.fn.tagcloud.defaults = { //size: {start: 1, end: 1, unit: 'em'}, color: {start: '#bbbbee', end: '#0085a1'}, }; $('#tag_cloud a').tagcloud(); }) } </script> <!--fastClick.js --> <script> async("//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js", function(){ var $nav = document.querySelector("nav"); if($nav) FastClick.attach($nav); }) </script> <!-- Google Analytics --> {% if site.ga_track_id %} <script> // dynamic User by Hux var _gaId = '{{ site.ga_track_id }}'; var _gaDomain = '{{ site.ga_domain }}'; // Originial (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', _gaId, _gaDomain); ga('send', 'pageview'); </script> {% endif %} <!-- Baidu Tongji --> {% if site.ba_track_id %} <script> // dynamic User by Hux var _baId = '{{ site.ba_track_id }}'; // Originial var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?" + _baId; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> {% endif %} <!-- Side Catalog --> {% if page.catalog %} <script type="text/javascript"> function generateCatalog (selector) { var P = $('div.post-container'),a,n,t,l,i,c; a = P.find('h1,h2,h3,h4,h5,h6'); a.each(function () { n = $(this).prop('tagName').toLowerCase(); i = "#"+$(this).prop('id'); t = $(this).text(); c = $('<a href="'+i+'" rel="nofollow">'+t+'</a>'); l = $('<li class="'+n+'_nav"></li>').append(c); $(selector).append(l); }); return true; } generateCatalog(".catalog-body"); // toggle side catalog $(".catalog-toggle").click((function(e){ e.preventDefault(); $('.side-catalog').toggleClass("fold") })) /* * Doc: https://github.com/davist11/jQuery-One-Page-Nav * Fork by Hux to support padding */ async("{{ '/js/jquery.nav.js' | prepend: site.baseurl }}", function () { $('.catalog-body').onePageNav({ currentClass: "active", changeHash: !1, easing: "swing", filter: "", scrollSpeed: 700, scrollOffset: 0, scrollThreshold: .2, begin: null, end: null, scrollChange: null, padding: 80 }); }); </script> {% endif %}
{'content_hash': '14a86d2974c987ab86b95864dbd206d3', 'timestamp': '', 'source': 'github', 'line_count': 251, 'max_line_length': 121, 'avg_line_length': 36.91633466135458, 'alnum_prop': 0.45057198359594214, 'repo_name': 'tom10ye/tom10ye.github.io', 'id': '0910c5126ca5d1c7e9e6ab260cf487274314dcf9', 'size': '9268', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '_includes/footer.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '105858'}, {'name': 'HTML', 'bytes': '230643'}, {'name': 'JavaScript', 'bytes': '50137'}]}
package main import ( "context" "fmt" "io/ioutil" "net/http" _ "net/http/pprof" // Comment this line to disable pprof endpoint. "net/url" "os" "os/signal" "path" "path/filepath" "runtime" "strings" "syscall" "time" md "cloud.google.com/go/compute/metadata" oc_prometheus "contrib.go.opencensus.io/exporter/prometheus" oc_stackdriver "contrib.go.opencensus.io/exporter/stackdriver" "github.com/Stackdriver/stackdriver-prometheus-sidecar/metadata" "github.com/Stackdriver/stackdriver-prometheus-sidecar/retrieval" "github.com/Stackdriver/stackdriver-prometheus-sidecar/stackdriver" "github.com/Stackdriver/stackdriver-prometheus-sidecar/tail" "github.com/Stackdriver/stackdriver-prometheus-sidecar/targets" "github.com/ghodss/yaml" "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" conntrack "github.com/mwitkow/go-conntrack" "github.com/oklog/oklog/pkg/group" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/common/promlog" promlogflag "github.com/prometheus/common/promlog/flag" "github.com/prometheus/common/version" "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/pkg/textparse" "github.com/prometheus/prometheus/promql" "go.opencensus.io/plugin/ocgrpc" "go.opencensus.io/plugin/ochttp" "go.opencensus.io/resource" "go.opencensus.io/stats" "go.opencensus.io/stats/view" "go.opencensus.io/tag" metric_pb "google.golang.org/genproto/googleapis/api/metric" "google.golang.org/grpc/resolver" "google.golang.org/grpc/resolver/manual" kingpin "gopkg.in/alecthomas/kingpin.v2" ) var ( sizeDistribution = view.Distribution(0, 1024, 2048, 4096, 16384, 65536, 262144, 1048576, 4194304, 33554432) latencyDistribution = view.Distribution(0, 1, 2, 5, 10, 15, 25, 50, 100, 200, 400, 800, 1500, 3000, 6000) // VersionTag identifies the version of this binary. VersionTag = tag.MustNewKey("version") // UptimeMeasure is a cumulative metric. UptimeMeasure = stats.Int64( "agent.googleapis.com/agent/uptime", "uptime of the Stackdriver Prometheus collector", stats.UnitSeconds) ) func init() { prometheus.MustRegister(version.NewCollector("prometheus")) if err := view.Register( &view.View{ Name: "opencensus.io/http/client/request_count", Description: "Count of HTTP requests started", Measure: ochttp.ClientRequestCount, TagKeys: []tag.Key{ochttp.Method, ochttp.Path}, Aggregation: view.Count(), }, &view.View{ Name: "opencensus.io/http/client/request_bytes", Description: "Size distribution of HTTP request body", Measure: ochttp.ClientRequestBytes, TagKeys: []tag.Key{ochttp.Method, ochttp.StatusCode, ochttp.Path}, Aggregation: sizeDistribution, }, &view.View{ Name: "opencensus.io/http/client/response_bytes", Description: "Size distribution of HTTP response body", Measure: ochttp.ClientResponseBytes, TagKeys: []tag.Key{ochttp.Method, ochttp.StatusCode, ochttp.Path}, Aggregation: sizeDistribution, }, &view.View{ Name: "opencensus.io/http/client/latency", Description: "Latency distribution of HTTP requests", TagKeys: []tag.Key{ochttp.Method, ochttp.StatusCode, ochttp.Path}, Measure: ochttp.ClientLatency, Aggregation: latencyDistribution, }, ); err != nil { panic(err) } if err := view.Register( ocgrpc.DefaultClientViews..., ); err != nil { panic(err) } if err := view.Register( &view.View{ Measure: UptimeMeasure, TagKeys: []tag.Key{VersionTag}, Aggregation: view.Sum(), }, ); err != nil { panic(err) } } type kubernetesConfig struct { Location string ClusterName string } type genericConfig struct { Location string Namespace string } type metricRenamesConfig struct { From string `json:"from"` To string `json:"to"` } type staticMetadataConfig struct { Metric string `json:"metric"` Type string `json:"type"` ValueType string `json:"value_type"` Help string `json:"help"` } type aggregatedCountersConfig struct { Metric string `json:"metric"` Filters []string `json:"filters"` Help string `json:"help"` } type fileConfig struct { MetricRenames []metricRenamesConfig `json:"metric_renames"` StaticMetadata []staticMetadataConfig `json:"static_metadata"` AggregatedCounters []aggregatedCountersConfig `json:"aggregated_counters"` } // Note: When adding a new config field, consider adding it to // statusz-tmpl.html type mainConfig struct { ConfigFilename string ProjectIDResource string KubernetesLabels kubernetesConfig GenericLabels genericConfig StackdriverAddress *url.URL MetricsPrefix string UseGKEResource bool StoreInFilesDirectory string WALDirectory string PrometheusURL *url.URL ListenAddress string EnableStatusz bool Filters []string Filtersets []string Aggregations retrieval.CounterAggregatorConfig MetricRenames map[string]string StaticMetadata []*metadata.Entry UseRestrictedIPs bool manualResolver *manual.Resolver MonitoringBackends []string PromlogConfig promlog.Config } func main() { if os.Getenv("DEBUG") != "" { runtime.SetBlockProfileRate(20) runtime.SetMutexProfileFraction(20) } var cfg mainConfig a := kingpin.New(filepath.Base(os.Args[0]), "The Prometheus monitoring server") a.Version(version.Print("prometheus")) a.HelpFlag.Short('h') a.Flag("config-file", "A configuration file.").StringVar(&cfg.ConfigFilename) projectID := a.Flag("stackdriver.project-id", "The Google project ID where Stackdriver will store the metrics."). Required(). String() a.Flag("stackdriver.api-address", "Address of the Stackdriver Monitoring API."). Default("https://monitoring.googleapis.com:443/").URLVar(&cfg.StackdriverAddress) a.Flag("stackdriver.use-restricted-ips", "If true, send all requests through restricted VIPs (EXPERIMENTAL)."). Default("false").BoolVar(&cfg.UseRestrictedIPs) a.Flag("stackdriver.kubernetes.location", "Value of the 'location' label in the Kubernetes Stackdriver MonitoredResources."). StringVar(&cfg.KubernetesLabels.Location) a.Flag("stackdriver.kubernetes.cluster-name", "Value of the 'cluster_name' label in the Kubernetes Stackdriver MonitoredResources."). StringVar(&cfg.KubernetesLabels.ClusterName) a.Flag("stackdriver.generic.location", "Location for metrics written with the generic resource, e.g. a cluster or data center name."). StringVar(&cfg.GenericLabels.Location) a.Flag("stackdriver.generic.namespace", "Namespace for metrics written with the generic resource, e.g. a cluster or data center name."). StringVar(&cfg.GenericLabels.Namespace) a.Flag("stackdriver.metrics-prefix", "Customized prefix for Stackdriver metrics. If not set, external.googleapis.com/prometheus will be used"). StringVar(&cfg.MetricsPrefix) a.Flag("stackdriver.use-gke-resource", "Whether to use the legacy gke_container MonitoredResource type instead of k8s_container"). Default("false").BoolVar(&cfg.UseGKEResource) a.Flag("stackdriver.store-in-files-directory", "If specified, store the CreateTimeSeriesRequest protobuf messages to files under this directory, instead of sending protobuf messages to Stackdriver Monitoring API."). StringVar(&cfg.StoreInFilesDirectory) a.Flag("prometheus.wal-directory", "Directory from where to read the Prometheus TSDB WAL."). Default("data/wal").StringVar(&cfg.WALDirectory) a.Flag("prometheus.api-address", "Address to listen on for UI, API, and telemetry."). Default("http://127.0.0.1:9090/").URLVar(&cfg.PrometheusURL) a.Flag("monitoring.backend", "Monitoring backend(s) for internal metrics").Default("prometheus"). EnumsVar(&cfg.MonitoringBackends, "prometheus", "stackdriver") a.Flag("web.listen-address", "Address to listen on for UI, API, and telemetry."). Default("0.0.0.0:9091").StringVar(&cfg.ListenAddress) a.Flag("web.enable-statusz", "If true, then enables a /statusz endpoint on the web server with diagnostic information."). Default("true").BoolVar(&cfg.EnableStatusz) a.Flag("include", "PromQL metric and label matcher which must pass for a series to be forwarded to Stackdriver. If repeated, the series must pass any of the filter sets to be forwarded."). StringsVar(&cfg.Filtersets) a.Flag("filter", "PromQL-style matcher for a single label which must pass for a series to be forwarded to Stackdriver. If repeated, the series must pass all filters to be forwarded. Deprecated, please use --include instead."). StringsVar(&cfg.Filters) promlogflag.AddFlags(a, &cfg.PromlogConfig) _, err := a.Parse(os.Args[1:]) if err != nil { fmt.Fprintln(os.Stderr, errors.Wrapf(err, "Error parsing commandline arguments")) a.Usage(os.Args[1:]) os.Exit(2) } logger := promlog.New(&cfg.PromlogConfig) if cfg.ConfigFilename != "" { cfg.MetricRenames, cfg.StaticMetadata, cfg.Aggregations, err = parseConfigFile(cfg.ConfigFilename) if err != nil { msg := fmt.Sprintf("Parse config file %s", cfg.ConfigFilename) level.Error(logger).Log("msg", msg, "err", err) os.Exit(2) } // Enable Stackdriver monitoring backend if counter aggregator configuration is present. if len(cfg.Aggregations) > 0 { sdEnabled := false for _, backend := range cfg.MonitoringBackends { if backend == "stackdriver" { sdEnabled = true } } if !sdEnabled { cfg.MonitoringBackends = append(cfg.MonitoringBackends, "stackdriver") } } } level.Info(logger).Log("msg", "Starting Stackdriver Prometheus sidecar", "version", version.Info()) level.Info(logger).Log("build_context", version.BuildContext()) level.Info(logger).Log("host_details", Uname()) level.Info(logger).Log("fd_limits", FdLimits()) // We instantiate a context here since the tailer is used by two other components. // The context will be used in the lifecycle of prometheusReader further down. ctx, cancel := context.WithCancel(context.Background()) go func() { uptimeUpdateTime := time.Now() c := time.Tick(60 * time.Second) for now := range c { stats.RecordWithTags(ctx, []tag.Mutator{tag.Upsert(VersionTag, fmt.Sprintf("stackdriver-prometheus-sidecar/%s", version.Version))}, UptimeMeasure.M(int64(now.Sub(uptimeUpdateTime).Seconds()))) uptimeUpdateTime = now } }() httpClient := &http.Client{Transport: &ochttp.Transport{}} if *projectID == "" { *projectID = getGCEProjectID() } for _, backend := range cfg.MonitoringBackends { switch backend { case "prometheus": promExporter, err := oc_prometheus.NewExporter(oc_prometheus.Options{ Registry: prometheus.DefaultRegisterer.(*prometheus.Registry), }) if err != nil { level.Error(logger).Log("msg", "Creating Prometheus exporter failed", "err", err) os.Exit(1) } view.RegisterExporter(promExporter) case "stackdriver": const reportingInterval = 60 * time.Second sd, err := oc_stackdriver.NewExporter(oc_stackdriver.Options{ ProjectID: *projectID, // If the OpenCensus resource environment variables aren't set, the monitored resource will likely fall back to `generic_task`. ResourceDetector: resource.FromEnv, ReportingInterval: reportingInterval, // Disable default `opencensus_task` label. DefaultMonitoringLabels: &oc_stackdriver.Labels{}, GetMetricType: func(v *view.View) string { // Curated metrics produced by this process. if strings.Contains(v.Name, "agent.googleapis.com") { return v.Name } // Default OpenCensus behavior. return path.Join("custom.googleapis.com", "opencensus", v.Name) }, }) if err != nil { level.Error(logger).Log("msg", "Creating Stackdriver exporter failed", "err", err) os.Exit(1) } defer sd.Flush() view.RegisterExporter(sd) view.SetReportingPeriod(reportingInterval) default: level.Error(logger).Log("msg", "Unknown monitoring backend", "backend", backend) os.Exit(1) } } var staticLabels = map[string]string{ retrieval.ProjectIDLabel: *projectID, retrieval.KubernetesLocationLabel: cfg.KubernetesLabels.Location, retrieval.KubernetesClusterNameLabel: cfg.KubernetesLabels.ClusterName, retrieval.GenericLocationLabel: cfg.GenericLabels.Location, retrieval.GenericNamespaceLabel: cfg.GenericLabels.Namespace, } fillMetadata(&staticLabels) for k, v := range staticLabels { if v == "" { delete(staticLabels, k) } } filtersets, err := parseFiltersets(logger, cfg.Filtersets, cfg.Filters) if err != nil { level.Error(logger).Log("msg", "Error parsing --include (or --filter)", "err", err) os.Exit(2) } cfg.ProjectIDResource = fmt.Sprintf("projects/%v", *projectID) if cfg.UseRestrictedIPs { // manual.GenerateAndRegisterManualResolver generates a Resolver and a random scheme. // It also registers the resolver. rb.InitialAddrs adds the addresses we are using // to resolve GCP API calls to the resolver. cfg.manualResolver, _ = manual.GenerateAndRegisterManualResolver() // These IP addresses correspond to restricted.googleapis.com and are not expected to change. cfg.manualResolver.InitialState(resolver.State{ Addresses: []resolver.Address{ {Addr: "199.36.153.4:443"}, {Addr: "199.36.153.5:443"}, {Addr: "199.36.153.6:443"}, {Addr: "199.36.153.7:443"}, }, }) } targetsURL, err := cfg.PrometheusURL.Parse(targets.DefaultAPIEndpoint) if err != nil { panic(err) } targetCache := targets.NewCache(logger, httpClient, targetsURL) metadataURL, err := cfg.PrometheusURL.Parse(metadata.DefaultEndpointPath) if err != nil { panic(err) } metadataCache := metadata.NewCache(httpClient, metadataURL, cfg.StaticMetadata) tailer, err := tail.Tail(ctx, cfg.WALDirectory) if err != nil { level.Error(logger).Log("msg", "Tailing WAL failed", "err", err) os.Exit(1) } // TODO(jkohen): Remove once we have proper translation of all metric // types. Currently Stackdriver fails the entire request if you attempt // to write to the different metric type, which we do fairly often at // this point, so lots of writes fail, and most writes fail. // config.DefaultQueueConfig.MaxSamplesPerSend = 1 config.DefaultQueueConfig.MaxSamplesPerSend = stackdriver.MaxTimeseriesesPerRequest // We want the queues to have enough buffer to ensure consistent flow with full batches // being available for every new request. // Testing with different latencies and shard numbers have shown that 3x of the batch size // works well. config.DefaultQueueConfig.Capacity = 3 * stackdriver.MaxTimeseriesesPerRequest var scf stackdriver.StorageClientFactory if len(cfg.StoreInFilesDirectory) > 0 { err := os.MkdirAll(cfg.StoreInFilesDirectory, 0700) if err != nil { level.Error(logger).Log( "msg", "Failure creating directory.", "err", err) os.Exit(1) } scf = &fileClientFactory{ dir: cfg.StoreInFilesDirectory, logger: log.With(logger, "component", "storage"), } } else { scf = &stackdriverClientFactory{ logger: log.With(logger, "component", "storage"), projectIDResource: cfg.ProjectIDResource, url: cfg.StackdriverAddress, timeout: 10 * time.Second, manualResolver: cfg.manualResolver, } } queueManager, err := stackdriver.NewQueueManager( log.With(logger, "component", "queue_manager"), config.DefaultQueueConfig, scf, tailer, ) if err != nil { level.Error(logger).Log("msg", "Creating queue manager failed", "err", err) os.Exit(1) } counterAggregator, err := retrieval.NewCounterAggregator( log.With(logger, "component", "counter_aggregator"), &cfg.Aggregations) if err != nil { level.Error(logger).Log("msg", "Creating counter aggregator failed", "err", err) os.Exit(1) } defer counterAggregator.Close() prometheusReader := retrieval.NewPrometheusReader( log.With(logger, "component", "Prometheus reader"), cfg.WALDirectory, tailer, filtersets, cfg.MetricRenames, retrieval.TargetsWithDiscoveredLabels(targetCache, labels.FromMap(staticLabels)), metadataCache, queueManager, cfg.MetricsPrefix, cfg.UseGKEResource, counterAggregator, ) // Exclude kingpin default flags to expose only Prometheus ones. boilerplateFlags := kingpin.New("", "").Version("") for _, f := range a.Model().Flags { if boilerplateFlags.GetFlag(f.Name) != nil { continue } } // Monitor outgoing connections on default transport with conntrack. http.DefaultTransport.(*http.Transport).DialContext = conntrack.NewDialContextFunc( conntrack.DialWithTracing(), ) http.Handle("/metrics", promhttp.Handler()) if cfg.EnableStatusz { http.Handle("/statusz", &statuszHandler{ logger: logger, projectID: *projectID, cfg: &cfg, }) } var g group.Group { ctx, cancel := context.WithCancel(context.Background()) g.Add(func() error { targetCache.Run(ctx) return nil }, func(error) { cancel() }) } { term := make(chan os.Signal) signal.Notify(term, os.Interrupt, syscall.SIGTERM) cancel := make(chan struct{}) g.Add( func() error { // Don't forget to release the reloadReady channel so that waiting blocks can exit normally. select { case <-term: level.Warn(logger).Log("msg", "Received SIGTERM, exiting gracefully...") case <-cancel: break } return nil }, func(err error) { close(cancel) }, ) } { // We use the context we defined higher up instead of a local one like in the other actors. // This is necessary since it's also used to manage the tailer's lifecycle, which the reader // depends on to exit properly. g.Add( func() error { startOffset, err := retrieval.ReadProgressFile(cfg.WALDirectory) if err != nil { level.Warn(logger).Log("msg", "reading progress file failed", "err", err) startOffset = 0 } // Write the file again once to ensure we have write permission on startup. if err := retrieval.SaveProgressFile(cfg.WALDirectory, startOffset); err != nil { return err } waitForPrometheus(ctx, logger, cfg.PrometheusURL) // Sleep a fixed amount of time to allow the first scrapes to complete. select { case <-time.After(time.Minute): case <-ctx.Done(): return nil } err = prometheusReader.Run(ctx, startOffset) level.Info(logger).Log("msg", "Prometheus reader stopped") return err }, func(err error) { // Prometheus reader needs to be stopped before closing the TSDB // so that it doesn't try to write samples to a closed storage. level.Info(logger).Log("msg", "Stopping Prometheus reader...") cancel() }, ) } { cancel := make(chan struct{}) g.Add( func() error { if err := queueManager.Start(); err != nil { return err } level.Info(logger).Log("msg", "Stackdriver client started") <-cancel return nil }, func(err error) { if err := queueManager.Stop(); err != nil { level.Error(logger).Log("msg", "Error stopping Stackdriver writer", "err", err) } close(cancel) }, ) } { cancel := make(chan struct{}) server := &http.Server{ Addr: cfg.ListenAddress, } g.Add( func() error { level.Info(logger).Log("msg", "Web server started") err := server.ListenAndServe() if err != http.ErrServerClosed { return err } <-cancel return nil }, func(err error) { if err := server.Shutdown(context.Background()); err != nil { level.Error(logger).Log("msg", "Error stopping web server", "err", err) } close(cancel) }, ) } if err := g.Run(); err != nil { level.Error(logger).Log("err", err) } level.Info(logger).Log("msg", "See you next time!") } type stackdriverClientFactory struct { logger log.Logger projectIDResource string url *url.URL timeout time.Duration manualResolver *manual.Resolver } func (s *stackdriverClientFactory) New() stackdriver.StorageClient { return stackdriver.NewClient(&stackdriver.ClientConfig{ Logger: s.logger, ProjectID: s.projectIDResource, URL: s.url, Timeout: s.timeout, Resolver: s.manualResolver, }) } func (s *stackdriverClientFactory) Name() string { return s.url.String() } // fileClientFactory generates StorageClient which writes to a newly // created file under dir. It requires dir an existing valid directory. type fileClientFactory struct { dir string logger log.Logger } // New creates an instance of stackdriver.StorageClient. Each instance // writes to a different file under dir. The returned instance is not // thread-safe. func (fcf *fileClientFactory) New() stackdriver.StorageClient { f, err := ioutil.TempFile(fcf.dir, "*.txt") if err != nil { level.Error(fcf.logger).Log( "msg", "failure creating files.", "err", err) } return stackdriver.NewCreateTimeSeriesRequestWriterCloser(f, fcf.logger) } func (fcf *fileClientFactory) Name() string { return "fileClientFactory" } func waitForPrometheus(ctx context.Context, logger log.Logger, promURL *url.URL) { tick := time.NewTicker(3 * time.Second) defer tick.Stop() u := *promURL u.Path = path.Join(promURL.Path, "/-/ready") for { select { case <-ctx.Done(): return case <-tick.C: resp, err := http.Get(u.String()) if err != nil { level.Warn(logger).Log("msg", "query Prometheus readiness", "err", err) continue } if resp.StatusCode/100 == 2 { return } level.Warn(logger).Log("msg", "Prometheus not ready", "status", resp.Status) } } } // parseFiltersets parses two flags that contain PromQL-style metric/label selectors and // returns a list of the resulting matchers. func parseFiltersets(logger log.Logger, filtersets, filters []string) ([][]*labels.Matcher, error) { var matchers [][]*labels.Matcher if len(filters) > 0 { level.Warn(logger).Log("msg", "--filter is deprecated; please use --include instead") f := fmt.Sprintf("{%s}", strings.Join(filters, ",")) m, err := promql.ParseMetricSelector(f) if err != nil { return nil, errors.Errorf("cannot parse --filter flag (metric filter '%s'): %q", f, err) } matchers = append(matchers, m) } for _, f := range filtersets { m, err := promql.ParseMetricSelector(f) if err != nil { return nil, errors.Errorf("cannot parse --include flag '%s': %q", f, err) } matchers = append(matchers, m) } return matchers, nil } func getGCEProjectID() string { if !md.OnGCE() { return "" } if id, err := md.ProjectID(); err == nil { return strings.TrimSpace(id) } return "" } func fillMetadata(staticConfig *map[string]string) { if !md.OnGCE() { return } if (*staticConfig)[retrieval.ProjectIDLabel] == "" { if id, err := md.ProjectID(); err == nil { id = strings.TrimSpace(id) (*staticConfig)[retrieval.ProjectIDLabel] = id } } if (*staticConfig)[retrieval.KubernetesLocationLabel] == "" { if l, err := md.InstanceAttributeValue("cluster-location"); err == nil { l = strings.TrimSpace(l) (*staticConfig)[retrieval.KubernetesLocationLabel] = l } } if (*staticConfig)[retrieval.KubernetesClusterNameLabel] == "" { if cn, err := md.InstanceAttributeValue("cluster-name"); err == nil { cn = strings.TrimSpace(cn) (*staticConfig)[retrieval.KubernetesClusterNameLabel] = cn } } } func parseConfigFile(filename string) (map[string]string, []*metadata.Entry, retrieval.CounterAggregatorConfig, error) { b, err := ioutil.ReadFile(filename) if err != nil { return nil, nil, nil, errors.Wrap(err, "reading file") } var fc fileConfig if err := yaml.Unmarshal(b, &fc); err != nil { return nil, nil, nil, errors.Wrap(err, "invalid YAML") } return processFileConfig(fc) } func processFileConfig(fc fileConfig) (map[string]string, []*metadata.Entry, retrieval.CounterAggregatorConfig, error) { renameMapping := map[string]string{} for _, r := range fc.MetricRenames { renameMapping[r.From] = r.To } staticMetadata := []*metadata.Entry{} for _, sm := range fc.StaticMetadata { switch sm.Type { case metadata.MetricTypeUntyped: // Convert "untyped" to the "unknown" type used internally as of Prometheus 2.5. sm.Type = textparse.MetricTypeUnknown case textparse.MetricTypeCounter, textparse.MetricTypeGauge, textparse.MetricTypeHistogram, textparse.MetricTypeSummary, textparse.MetricTypeUnknown: default: return nil, nil, nil, errors.Errorf("invalid metric type %q", sm.Type) } var valueType metric_pb.MetricDescriptor_ValueType switch sm.ValueType { case "double": valueType = metric_pb.MetricDescriptor_DOUBLE case "int64": valueType = metric_pb.MetricDescriptor_INT64 case "": valueType = metric_pb.MetricDescriptor_VALUE_TYPE_UNSPECIFIED default: return nil, nil, nil, errors.Errorf("invalid value type %q", sm.ValueType) } staticMetadata = append(staticMetadata, &metadata.Entry{Metric: sm.Metric, MetricType: textparse.MetricType(sm.Type), ValueType: valueType, Help: sm.Help}) } aggregations := make(retrieval.CounterAggregatorConfig) for _, c := range fc.AggregatedCounters { if _, ok := aggregations[c.Metric]; ok { return nil, nil, nil, errors.Errorf("duplicate counter aggregator metric %s", c.Metric) } a := &retrieval.CounterAggregatorMetricConfig{Help: c.Help} for _, f := range c.Filters { matcher, err := promql.ParseMetricSelector(f) if err != nil { return nil, nil, nil, errors.Errorf("cannot parse metric selector '%s': %q", f, err) } a.Matchers = append(a.Matchers, matcher) } aggregations[c.Metric] = a } return renameMapping, staticMetadata, aggregations, nil }
{'content_hash': 'cd2a4313817367688657b208f10d9be7', 'timestamp': '', 'source': 'github', 'line_count': 793, 'max_line_length': 227, 'avg_line_length': 32.55611601513241, 'alnum_prop': 0.703838555990239, 'repo_name': 'Stackdriver/stackdriver-prometheus-sidecar', 'id': '270035d420f6be9056f44feff939947a4675a067', 'size': '26468', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'cmd/stackdriver-prometheus-sidecar/main.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '303'}, {'name': 'Go', 'bytes': '294653'}, {'name': 'HTML', 'bytes': '4197'}, {'name': 'Makefile', 'bytes': '4829'}, {'name': 'Shell', 'bytes': '5926'}]}
var constants = require("./constants.js"); function BlockReward() { var milestones = [ 1500000000, // Initial Reward 1200000000, // Milestone 1 900000000, // Milestone 2 600000000, // Milestone 3 300000000 // Milestone 4 ]; // Distance between each milestone var distance = Math.floor(constants.rewards.distance); // Start rewards at block (n) var rewardOffset = Math.floor(constants.rewards.offset); var parseHeight = function (height) { height = parseInt(height); if (isNaN(height)) { throw "Invalid block height"; } else { return Math.abs(height); } }; this.calcMilestone = function (height) { var location = parseInt(parseHeight(height - rewardOffset) / distance), lastMile = milestones[milestones.length - 1]; if (location > (milestones.length - 1)) { return milestones.lastIndexOf(lastMile); } else { return location; } }; this.calcReward = function (height) { var height = parseHeight(height); if (height < rewardOffset) { return 0; } else { return milestones[this.calcMilestone(height)]; } }; this.calcSupply = function (height) { var height = parseHeight(height), milestone = this.calcMilestone(height), supply = constants.totalAmount / Math.pow(10,8), rewards = []; var amount = 0, multiplier = 0; for (var i = 0; i < milestones.length; i++) { if (milestone >= i) { multiplier = (milestones[i] / Math.pow(10,8)); if (height < rewardOffset) { break; // Rewards not started yet } else if (height < distance) { amount = height % distance; // Measure distance thus far } else { amount = distance; // Assign completed milestone height -= distance; // Deduct from total height // After last milestone if (height > 0 && i == milestones.length - 1) { var postHeight = rewardOffset - 1; if (height >= postHeight) { amount += (height - postHeight); } else { amount += (postHeight - height); } } } rewards.push([amount, multiplier]); } else { break; // Milestone out of bounds } } for (i = 0; i < rewards.length; i++) { var reward = rewards[i]; supply += reward[0] * reward[1]; } return supply * Math.pow(10,8); }; } // Exports module.exports = BlockReward;
{'content_hash': 'a9f899b6b2e3bc1497af6da002ca84be', 'timestamp': '', 'source': 'github', 'line_count': 96, 'max_line_length': 73, 'avg_line_length': 25.0, 'alnum_prop': 0.5995833333333334, 'repo_name': 'RiseVision/rise-core', 'id': 'f715be465984027b71339c95b457fe6054de93e0', 'size': '2400', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'helpers/blockReward.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '118420'}, {'name': 'HTML', 'bytes': '185443'}, {'name': 'JavaScript', 'bytes': '11420900'}, {'name': 'PLpgSQL', 'bytes': '9018'}]}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.9.1"/> <title>V8 API Reference Guide for io.js v1.0.3: v8::AccessorSignature Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for io.js v1.0.3 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1_accessor_signature.html">AccessorSignature</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-static-methods">Static Public Member Functions</a> &#124; <a href="classv8_1_1_accessor_signature-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">v8::AccessorSignature Class Reference</div> </div> </div><!--header--> <div class="contents"> <p><code>#include &lt;<a class="el" href="v8_8h_source.html">v8.h</a>&gt;</code></p> <div class="dynheader"> Inheritance diagram for v8::AccessorSignature:</div> <div class="dyncontent"> <div class="center"> <img src="classv8_1_1_accessor_signature.png" usemap="#v8::AccessorSignature_map" alt=""/> <map id="v8::AccessorSignature_map" name="v8::AccessorSignature_map"> <area href="classv8_1_1_data.html" alt="v8::Data" shape="rect" coords="0,0,140,24"/> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr class="memitem:a608c489295009cf8c343c1099559b1cf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a608c489295009cf8c343c1099559b1cf"></a> static <a class="el" href="classv8_1_1_local.html">Local</a>&lt; <a class="el" href="classv8_1_1_accessor_signature.html">AccessorSignature</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>New</b> (<a class="el" href="classv8_1_1_isolate.html">Isolate</a> *isolate, <a class="el" href="classv8_1_1_handle.html">Handle</a>&lt; <a class="el" href="classv8_1_1_function_template.html">FunctionTemplate</a> &gt; receiver=<a class="el" href="classv8_1_1_handle.html">Handle</a>&lt; <a class="el" href="classv8_1_1_function_template.html">FunctionTemplate</a> &gt;())</td></tr> <tr class="separator:a608c489295009cf8c343c1099559b1cf"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>An <a class="el" href="classv8_1_1_accessor_signature.html">AccessorSignature</a> specifies which receivers are valid parameters to an accessor callback. </p> </div><hr/>The documentation for this class was generated from the following file:<ul> <li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Aug 11 2015 23:49:13 for V8 API Reference Guide for io.js v1.0.3 by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9.1 </small></address> </body> </html>
{'content_hash': 'bd3807375ded9be9c077a964eb6946c8', 'timestamp': '', 'source': 'github', 'line_count': 129, 'max_line_length': 585, 'avg_line_length': 49.992248062015506, 'alnum_prop': 0.6656846022639169, 'repo_name': 'v8-dox/v8-dox.github.io', 'id': '90c5c1bca78be261e3896a82f158a92e677e26f9', 'size': '6449', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'd566ded/html/classv8_1_1_accessor_signature.html', 'mode': '33188', 'license': 'mit', 'language': []}
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'lifx_http' require 'minitest/autorun'
{'content_hash': '038c2e4e6445c1f38d92da8a9220d076', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 58, 'avg_line_length': 26.75, 'alnum_prop': 0.6822429906542056, 'repo_name': 'lparry/lifx_http', 'id': '88c4487728d3f1638299db329f7b16d5b6e04645', 'size': '107', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/test_helper.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '7510'}, {'name': 'Shell', 'bytes': '115'}]}
<?php /* AcmePromotionBundle:Default:delete.html.twig */ class __TwigTemplate_e26e2ac8b8a4a156f54e7147862ba2b890f63197521b525303c4aa229e554628 extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = false; $this->blocks = array( ); } protected function doDisplay(array $context, array $blocks = array()) { } public function getTemplateName() { return "AcmePromotionBundle:Default:delete.html.twig"; } public function getDebugInfo() { return array (); } }
{'content_hash': '0139812db5e9040dd7d56ba9cce9f31f', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 107, 'avg_line_length': 21.413793103448278, 'alnum_prop': 0.6409017713365539, 'repo_name': 'chuyu39/tpQuiz', 'id': 'ea09270b96058438cfb6c06c70c459174f82dbea', 'size': '621', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/cache/dev/twig/e2/6e/2ac8b8a4a156f54e7147862ba2b890f63197521b525303c4aa229e554628.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '18122'}, {'name': 'PHP', 'bytes': '70623'}]}
<?php class Catalin_SEO_Block_ConfigurableSwatches_Catalog_Layer_State_Swatch extends Mage_ConfigurableSwatches_Block_Catalog_Layer_State_Swatch { /** * @inheritdoc */ protected function _init($filter) { $dimHelper = Mage::helper('configurableswatches/swatchdimensions'); $this->setSwatchInnerWidth( $dimHelper->getInnerWidth(Mage_ConfigurableSwatches_Helper_Swatchdimensions::AREA_LAYER) ); $this->setSwatchInnerHeight( $dimHelper->getInnerHeight(Mage_ConfigurableSwatches_Helper_Swatchdimensions::AREA_LAYER) ); $this->setSwatchOuterWidth( $dimHelper->getOuterWidth(Mage_ConfigurableSwatches_Helper_Swatchdimensions::AREA_LAYER) ); $this->setSwatchOuterHeight( $dimHelper->getOuterHeight(Mage_ConfigurableSwatches_Helper_Swatchdimensions::AREA_LAYER) ); $swatchUrl = Mage::helper('configurableswatches/productimg') ->getGlobalSwatchUrl( $filter, $this->stripTags($filter->getLabel()), $this->getSwatchInnerWidth(), $this->getSwatchInnerHeight() ); $this->setSwatchUrl($swatchUrl); } }
{'content_hash': '1bc0e5f817585d3ddd3e1303fe136c04', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 138, 'avg_line_length': 34.5, 'alnum_prop': 0.6384863123993558, 'repo_name': 'Militree/improved-magento-layered-navigation', 'id': '80e7e376c457247e2bacb3b5879c45748070e8eb', 'size': '1669', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/code/community/Catalin/SEO/Block/ConfigurableSwatches/Catalog/Layer/State/Swatch.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '563'}, {'name': 'HTML', 'bytes': '19446'}, {'name': 'JavaScript', 'bytes': '29531'}, {'name': 'PHP', 'bytes': '332441'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Yolcan</title> <!-- Sets initial viewport load and disables zooming --> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- SEO --> <meta name="keywords" content=""> <meta name="description" content=""> <!-- Compatibility --> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="cleartype" content="on"> <!-- Favicon - generated with http://www.favicomatic.com/ --> <link rel="apple-touch-icon-precomposed" sizes="57x57" href="favicon/apple-touch-icon-57x57.png" /> <link rel="apple-touch-icon-precomposed" sizes="114x114" href="favicon/apple-touch-icon-114x114.png" /> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="favicon/apple-touch-icon-72x72.png" /> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="favicon/apple-touch-icon-144x144.png" /> <link rel="apple-touch-icon-precomposed" sizes="60x60" href="favicon/apple-touch-icon-60x60.png" /> <link rel="apple-touch-icon-precomposed" sizes="120x120" href="favicon/apple-touch-icon-120x120.png" /> <link rel="apple-touch-icon-precomposed" sizes="76x76" href="favicon/apple-touch-icon-76x76.png" /> <link rel="apple-touch-icon-precomposed" sizes="152x152" href="favicon/apple-touch-icon-152x152.png" /> <link rel="icon" type="image/png" href="favicon/favicon-196x196.png" sizes="196x196" /> <link rel="icon" type="image/png" href="favicon/favicon-96x96.png" sizes="96x96" /> <link rel="icon" type="image/png" href="favicon/favicon-32x32.png" sizes="32x32" /> <link rel="icon" type="image/png" href="favicon/favicon-16x16.png" sizes="16x16" /> <link rel="icon" type="image/png" href="favicon/favicon-128.png" sizes="128x128" /> <meta name="application-name" content="Little Crow"/> <meta name="msapplication-TileColor" content="#009C9F" /> <meta name="msapplication-TileImage" content="favicon/mstile-144x144.png" /> <meta name="msapplication-square70x70logo" content="favicon/mstile-70x70.png" /> <meta name="msapplication-square150x150logo" content="favicon/mstile-150x150.png" /> <meta name="msapplication-wide310x150logo" content="favicon/mstile-310x150.png" /> <meta name="msapplication-square310x310logo" content="favicon/mstile-310x310.png" /> <!-- CSS --> <link rel="stylesheet" type="text/css" href="style.css"> <!-- Google font(s) --> <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,800,700,400italic,600italic,700italic,800italic,300italic" rel="stylesheet" type="text/css"> <!-- Font awesome --> <!-- <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> --> <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. --> <!--[if lt IE 9]> <script src="js/html5shiv.js"></script> <script src="js/respond.min.js"></script> <![endif]--> <!-- Typekit --> <script src="https://use.typekit.net/upn0scl.js"></script> <script>try{Typekit.load({ async: true });}catch(e){}</script> </head> <body> <header class="[ bg-light ]"> <div class=" [ container ] "> <div class="[ row ]"> <div class="[ col-xs-6 ]"> <h1 class="[ no-margin-top-bottom ]"> <a title="Yolcan" href="index.html" id="logo"> <span class="[ hidden ]">Yolcan</span> <img class="[ width-logo ]" alt="Yolcan" src="img/logo.svg"> </a> </h1> </div> <div class="[ col-xs-6 inherit ][ visible-xs ][ margin-top--small ][ text-right ]"> <div class="[ inline-block ]"> <a data-toggle="modal" data-target="#menu-info"> <img class="[ svg ][ icon icon--iconed--large icon--stroke ][ color-primary ]"src="icons/infomation-circle.svg"> </a> <div id="menu-info" class="[ modal fade ]" role="dialog"> <div class="[ modal-dialog ]"> <div class="[ modal-content height-auto ][ color-light ]"> <div class="modal-header"> <button type="button" class="[ close ][ relative top-23 right-55 ]" data-dismiss="modal"> <img class="[ svg ][ icon icon--iconed--medium icon--stroke ][ color-primary ]"src="icons/close.svg"> </button> </div> <div class="[ no-margin ][ modal-body ][ bg-ligth ][ padding--top--large ][ text-center ]"> <ul class="[ no-padding ]"> <li><a data-toggle="modal" data-target="#ingresa">ingresa</a></li> <li><a href="perfil.html">tu perfil</a></li> <li><a href="cuenta.html">tu suscripción</a></li> <li><a href="faq.html">faq</a></li> <li><a href="blog.html">blog</a></li> </ul> </div> </div> </div> </div> </div> <div class="[ inline-block relative top-3 ][ margin-left--xsmall ]"> <a data-toggle="modal" data-target="#main-menu"> <img class="[ svg ][ icon icon--iconed--large icon--stroke ][ color-primary ]"src="icons/navigation.svg"> </a> <div id="main-menu" class="[ modal fade ]" role="dialog"> <div class="[ modal-dialog ]"> <div class="[ modal-content height-auto ][ color-light ]"> <div class="modal-header"> <button type="button" class="[ close ][ relative top-23 right-14 ]" data-dismiss="modal"> <img class="[ svg ][ icon icon--iconed--medium icon--stroke ][ color-primary ]"src="icons/close.svg"> </button> </div> <div class="[ no-margin ][ modal-body ][ bg-ligth ][ padding--top--large ][ text-center ]"> <ul class="[ padding ]"> <li><a class="[ margin-bottom ][ text-uppercase ][ border-bottom--orange ]" href="nuestros-productos.html"><strong>Productos</strong></a></li> <li><a class="[ margin-bottom ][ text-uppercase ][ border-bottom--green ]" href="conocenos.html"><strong>Conócenos</strong></a></li> <li><a class="[ margin-bottom ][ text-uppercase ][ border-bottom--blue ]" href="recetas.html"><strong>Recetas</strong></a></li> <li><a class="[ margin-bottom ][ text-uppercase ][ border-bottom--pink ]" href="visitanos.html"><strong>Visitas</strong></a></li> <li><a class="[ margin-bottom ][ text-uppercase ][ border-bottom--secondary ]" href="contactanos.html"><strong>Contáctanos</strong></a></li> </ul> </div> </div> </div> </div> </div> </div> <!-- info-menu desktop --> <div class="[ pull-right ][ hidden-xs ][ margin-top ][ padding--sides--xsmall ]"> <a class="[ color-primary-darken ][ info-menu ]" data-toggle="modal" data-target="#ingresa">ingresa</a> <a class="[ color-primary-darken ][ info-menu ]" href="perfil.html">tu perfil</a> <a class="[ color-primary-darken ][ info-menu ]" href="cuenta.html">tu suscripción</a> <a class="[ color-primary-darken ][ info-menu ]" href="faq.html">faq</a> <a class="[ color-primary-darken ][ info-menu ]" href="blog.html">blog</a> </div> </div> <!-- menu desktop --> <nav class="[ row ][ hidden-xs ]" > <div class="[ col-sm-12 ]"> <a class="[ color-primary-darken ][ width-20 ][ padding--right--xsmall ][ text-uppercase ][ ][ inline-block ]" href="nuestros-productos.html"><div class="[ border-bottom--orange ]">Productos</div> </a><a class="[ color-primary-darken ][ width-20 ][ padding--right--xsmall ][ text-uppercase ][ inline-block ]" href="conocenos.html"><div class="[ border-bottom--green ]">Conócenos</div> </a><a class="[ color-primary-darken ][ width-20 ][ padding--right--xsmall ][ text-uppercase ][ inline-block ]" href="recetas.html"><div class="[ border-bottom--blue ]">Recetas</div> </a><a class="[ color-primary-darken ][ width-20 ][ padding--right--xsmall ][ text-uppercase ][ inline-block ]" href="visitanos.html"><div class="[ border-bottom--pink ]">Visitas</div> </a><a class="[ color-primary-darken ][ width-20 ][ text-uppercase ][ inline-block ]" href="contactanos.html"><div class="[ border-bottom--secondary ]">Contáctanos</div></a> </div> </nav> </div> <!-- /container --> </header> <section class="[ user-content--visitas ]" > <h2>Visitanos</h2> <p>Vive la experiencia chinampera</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p> <img src="img/visitanos.jpg"> <h4>Duración aproximada: 2 horas 30 minutos</h4> <ul> <li>- Salida del embarcadero de Cuemanco</li> <li>- Visita chinampa tecnificada para ver proceso de potabilización de agua.</li> <li>- Aguas frescas de ingredientes naturales.</li> <li>- Tamales artesanales de maíz criollo.</li> <li>- Ensalada preparada en la chinampa.</li> </ul> </section> <article class="[ container ]"> <div class="[ row ]"> <section class="[ col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-1 col-lg-8 col-lg-offset-2 ][ margin-top ]"> <div class="[ row ][ text-center ]"> <div class="[ col-xs-3 padding--sides--xsmall col-sm-4 ]"> <p class="[ fz-18 ][ no-margin ]"><strong>Costo</strong></p> <p class="[ fz-16 ]">$2,000</p> </div> <div class="[ col-xs-4 padding--sides--xsmall col-sm-4 ]"> <p class="[ fz-18 ][ no-margin ]"><strong>Capacidad</strong></p> <p class="[ fz-16 ]">10 personas</p> </div> <div class="[ col-xs-5 padding--sides--xsmall col-sm-4 ]"> <p class="[ fz-18 ][ no-margin ]"><strong>Persona extra</strong></p> <p class="[ fz-16 ][ no-margin ]">$100 por niño</p> <p class="[ fz-16 ]">$200 por adulto</p> </div> <div class="[ visible-sm ][ margin-bottom ]"></div> </div> <div class="[ col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 ]"> <p class="[ lead ]" id="agenda">Agenda tu visita</p> <form> <div class="[ form-group ][ color-gray-xlight ]"> <label>Nombre</label> <input type="text" class="[ form-control bg-gray no-border-radius color-gray-xlight ]"> </div> <div class="[ row ]"> <div class="[ col-xs-12 col-sm-6 padding--right--small--sm ][ form-group ][ color-gray-xlight ]"> <label>Correo</label> <input type="email" class="[ form-control bg-gray no-border-radius color-gray-xlight ]"> </div> <div class="[ col-xs-12 col-sm-6 padding--left--small--sm ][ form-group ][ color-gray-xlight ]"> <label>Teléfono</label> <input type="text" class="[ form-control bg-gray no-border-radius color-gray-xlight ]"> </div> </div> <div class="[ row ]"> <div class="[ col-xs-6 padding--right--small ][ form-group ][ color-gray-xlight ]"> <label class="[ hidden-xs ]">Número de personas</label> <label class="[ visible-xs ]">No. de personas</label> <input type="text" class="[ form-control bg-gray no-border-radius color-gray-xlight ]"> </div> <div class="[ col-xs-6 padding--left--small ][ form-group ][ color-gray-xlight ]"> <label>Fecha</label> <input type="text" class="[ form-control bg-gray no-border-radius color-gray-xlight ]"> </div> </div> <div class="text-center"> <button type="submit" href="#" class="[ btn btn-secondary ][ margin-bottom ]">enviar</button> </div> </form> <div class="[ visible-sm ][ margin-bottom--large ]"></div> </div> </section> <section class="[ user-content--visitas ]"> <h2>Xochimilco</h2> <p>Yolcan nace en Xochimilco por eso siempre será una parte importante de nosotros, nuestra tierra de origen.</p> <p>Yolcan significa "tierra de origen" o "tierra de nacimiento" en Náhuatl. el proyecto de Yolcan nace en Xochimilco con la intención de conservar la chinampa como unidad productiva y como ecosistema.</p> <p>Las chinampas, o huertos flotantes, son un modelo legado por los xochimilcas y por los aztecas, que nos enseñan cómo el entorno puede ser aprovechado armónicamente para la producción de alimentos. En realidad las chinampas además de ser vestigios arqueológicos, son también ecosistemas artificiales ingeniosamente creados para sustentar el crecimiento de la población. Son sostenibles porque se tienen los recursos tales como el agua, la tierra, el lodo, los minerales y la materia orgánica a la mano. Es decir, no se necesita traer nada de fuera.</p> <h3>¿Cómo producimos en Yolcan?</h3> <p>Hoy en día, la zona chinampera rinde servicios medioambientales indispensables para la Ciudad de México. Es vasi regulador de agua, refugio de especies endémicas y migratorias, regulador de temperatura y cumple la función de producción de oxígeno. Además es patrimonio cultural de la humanidad debido a la riqueza cultural xochimilca. lamentablemente la zona chinampera está en riesgo ya que la mancha urbana continúa creciendo sobre ella. Gran parte de las chinampas están abandonadas y muchos de los xochimilcas ya no quieren trabajarlas.</p> <p>En Yolcan creemos que la manera de rescatar la chinampería es devolviéndole su vocación original: unidades de producción sustentable, tecnologías avanzadas de aprovechamiento de recursos. Este rescate no se puede hacer sin la participación de la comunidad chinampera.</p> <img src="img/visitanos2.jpg"> <p>Es por eso que nos involucramos con la comunidad para llevar a cabo una agricultura orgánica que recupera las prácticas originales, y a la vez, las complemente con nuevas técnicas.</p> <p>Desde el año 2011, Yolcan y su red de productores han rehabilitado más de cuatro hectáreas de chinampería. Se ha formado un grupo de 15 familias chinamperas trabajando orgánicamente y produciendo verduras de calidad. Se ha sentado un ejemplo exitoso, escalable y replicable de cómo deben substituir las chinampas. Se han encontrado mercados de pago justo, consumidores que valoran la producción campesina, su trabajo y la labor chinampera.</p> <p>Yolcan trabaja de la mano del Instituto de Biología de la UNAM y del CINVESTAV del Instituto Politécnico Nacional para mejorar la calidad del agua y de la tierra. Se han hecho análisis y estudios para aprovechar la flora local para hacer biofiltros de purificación de agua.</p> <img src="img/visitanos3.jpg"> <p>Xochimilco es el lugar de las flores y de los paseos en trajineras, un lugar donde los chilangos pasamos días agradables; momentos de ocio, de diversión y descanso.</p> <p>Xochimilco es también escenario de numerosas fiestas donde las tradiciones cristianas se mezclan con las tradiciones indígenas formando una riquisíma cultura comunal; un rincón en la ciudad en el que podemos respirar un aire de nostalgia al pasearnos por sus barrios y sus iglesias.</p> <p>Las chinampas presentan un claro ejemplo de cómo el hombre puede convivir armónicamente con la naturaleza. Ellas son un testamento de belleza de las ciudades y pueblos aztecas y xochimilcal. Imaginemos largos canales extendiéndose por gran parte de la ciudad, todos ellos rodeados de árboles, plantas y flores, que además de ser sumamente agradables a la vista, servían como vías de transporte y distribución para abastecer mercados.</p> <p>Más que un testamento, las chinampas y los canales don un modelo a seguir. Son un modelo de comunidad donde no solamente el hombre es tomado en consideración sino también la flora y la fauna, la tierra y el aguia. La cultura xochimilca es la cultura del agua. Es un modelo de comunidad y de cultura local.</p> </section> </div> </article> <footer class="[ bg-primary-darken ][ text-center ][ color-gray-xxlight ]"> <div class="[ container ]"> <div class="[ row ]"> <div class="[ col-sm-3 no-padding--right no-padding--left ]"> <h3><em>Contacto</em></h3> <!-- Contacto: social-media --> <a class="[ social-media ][ color-light color-secondary--hover no-decoration ]" href="tel:+525552555555"> <img class="[ svg icon icon--iconed--xlarge icon--thickness-3 icon--fill ][ color-light ]" src="icons/phone-5.svg"> <span class="[ hidden-xs ][ margin-left--small ][ inline-block align-middle ]">555555-5555</span> </a> <a class="[ social-media ][ color-light color-secondary--hover no-decoration ]" href=""><!-- whatsapp://send?abid=username&text=Hola --><!-- href="whatsapp://send?text=The text to share!" data-action="share/whatsapp/share" --> <img class="[ svg icon icon--iconed--xlarge icon--thickness-3 icon--fill ][ color-light ]" src="icons/logo-whatsapp.svg"> <span class="[ hidden-xs ][ margin-left--small ][ inline-block align-middle ]">555555-5555</span> </a> <a class="[ social-media ][ color-light color-secondary--hover no-decoration ]" href="mailto:[email protected]"> <img class="[ svg icon icon--iconed--xlarge icon--thickness-3 icon--fill ][ color-light ]" src="icons/email.svg"> <span class="[ hidden-xs ][ margin-left--small ][ inline-block align-middle ]">[email protected]</span> </a> <a class="[ social-media ][ color-light color-secondary--hover no-decoration ]" href="https://www.facebook.com/Yolcan-190099034343351/"> <img class="[ svg icon icon--iconed--xlarge icon--thickness-3 icon--fill ][ color-light ]" src="icons/facebook.svg"> <span class="[ hidden-xs ][ margin-left--small ][ inline-block align-middle ]">/yolcan</span> </a> <a class="[ social-media ][ color-light color-secondary--hover no-decoration ]" href="https://twitter.com/michinampa"> <img class="[ svg icon icon--iconed--xlarge icon--thickness-3 icon--fill ][ color-light ]" src="icons/twitter.svg"> <span class="[ hidden-xs ][ margin-left--small ][ inline-block align-middle ]">@yolcan</span> </a> <a class="[ social-media ][ color-light color-secondary--hover no-decoration ]" href="https://www.instagram.com/yolcan/"> <img class="[ svg icon icon--iconed--xlarge icon--thickness-3 icon--fill ][ color-light ]" src="icons/logo-instagram.svg"> <span class="[ hidden-xs ][ margin-left--small ][ inline-block align-middle ]">@yolcan</span> </a> </div> <div class="[ col-sm-4 col-md-3 ]"> <h3><em>Únete</em></h3> <div class="[ margin-bottom ]"> <a data-toggle="modal" data-target="#unete" class="[ inline-block align-middle ][ btn btn-secondary margin-top--small ]">registrate</a> <a href="visitanos.html#agenda" class="[ inline-block align-middle ][ btn btn-secondary ][ margin-top--small ]">agenda una cita</a> </div> </div> <div class="[ col-sm-2 col-md-3 ]"> <h3><em>Métodos de pago</em></h3> <div class="[ row ]"> <img class="[ icon icon--iconed--xxxlarge ][ margin-sides--small ]" src="icons/visa.svg" alt=""> <img class="[ icon icon--iconed--xxxlarge ][ margin-sides--small ]" src="icons/paypal.svg" alt=""> <img class="[ icon icon--iconed--xxxlarge ][ margin-sides--small ]" src="icons/mastercard.svg" alt=""> </div> </div> <div class="[ col-sm-3 ]"> <h3><em>Newsletter</em></h3> <div class="[ text-left ]"> <p>Recibe las últimas noticias y ofertas antes que nadie, déjanos tu correo.</p> <form class="[ margin-bottom ][ hidden-xs ]"> <div class="[ form-group ]"> <input type="text" class="[ form-control ][ no-border-radius ][ margin-bottom--small ]"> <button type="submit" href="#" class="[ btn btn-secondary ][ no-margin ]">suscribirme</button> </div> </form> </div> <!-- input inline --> <div class="[ visible-xs ]"> <form class="[ input-group ]"> <input type="text" class="[ form-control ][ no-border-radius ]"> <span class="[ input-group-btn ]"> <button class="[ input-search--button ][ btn btn-secondary ]" type="submit"> suscribirme </button> </span> </form> </div> </div> </div> <div class="[ row ]"> <div class="[ col-xs-12 ][ margin-top-bottom ]"> <p class="[ color-gray-xlight ]">Content copyright 2015. Yolcan. All right reserved.</p> </div> </div> </div> </footer> <!-- modal unete --> <div id="unete" class="[ modal fade ]" role="dialog"> <div class="[ modal-dialog ]"> <div class="[ modal-content ]"> <div class="[ modal-body ][ color-light ]"> <div class="[ bg-primary-darken width-bg margin-auto ][ padding--top-bottom ]"> <button type="button" class="[ close ][ pull-right relative left--20 z-index--100 ]" data-dismiss="modal"> <img class="[ svg ][ icon icon--iconed--normal icon--stroke icon--thickness-2 ][ color-secondary ][ absolute right-25 ]"src="icons/close.svg"> </button> <div class="[ row ]"> <div class="[ col-xs-10 col-xs-offset-1 ]"> <h2 class="[ text-center ][ no-margin--top ]">¡Bienvenido!</h2> <p class="[ text-center ]">Ingresa tus datos y comienza a formar parte de la comunidad <span class=" [ text-uppercase ]">yolcan</span></p> <form class="[ border-bottom--primary--medium ][ margin-bottom ][ text-left ]"> <div class="[ form-group ]"> <label class="[ sans-serif ][ no-margin ]">Nombre</label> <input type="text" class="[ form-control no-border-radius color-gray-xlight height-30 ]"> </div> <div class="[ form-group ]"> <label class="[ sans-serif ][ no-margin ]">Correo</label> <input type="email" class="[ form-control no-border-radius color-gray-xlight height-30 ]"> </div> <div class="[ form-group ]"> <label class="[ sans-serif ][ no-margin ]">Teléfono</label> <input type="text" class="[ form-control no-border-radius color-gray-xlight height-30 ]"> </div> <div class="[ text-center ]"> <button type="submit" href="#" class="[ btn btn-secondary padding--top-bottom--xsmall ][ margin-bottom ]">únete</button> </div> </form> <div class="[ text-center ]"> <a href="https://www.facebook.com"> <p class="[ small sans-serif ][ color-light ][ inline-block align-middle no-margin ]">Ingresa con</p> <button type="submit" href="#" class="[ btn btn-facebook ][ inline-block align-middle margin-left--small ]"> <img class="[ svg icon icon--iconed--normal icon--thickness-3 icon--fill ][ color-light ]" src="icons/facebook.svg"> <span class="[ color-light ][ inline-block align-middle ]">Facebook</span> </button> </a> </div> </div> </div> </div> </div> </div> </div> </div> <!-- modal ingresa --> <div id="ingresa" class="[ modal fade ]" role="dialog"> <div class="[ modal-dialog ]"> <div class="[ modal-content ]"> <div class="[ modal-body ][ color-light ]"> <div class="[ bg-primary-darken width-bg margin-auto ][ padding--top-bottom--large ]"> <button type="button" class="[ close ][ pull-right relative left--20 z-index--100 ]" data-dismiss="modal"> <img class="[ svg ][ icon icon--iconed--normal icon--stroke icon--thickness-2 ][ color-secondary ][ absolute right-25 ]"src="icons/close.svg"> </button> <div class="[ row ]"> <div class="[ col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 ]"> <h2 class="[ text-center ][ no-margin--top ]">¡Bienvenido!</h2> <p class="[ text-center ]">Ingresa en tu cuenta de <span class=" [ text-uppercase ]">yolcan</span></p> <form class="[ border-bottom--primary--medium ][ margin-bottom ][ text-left ]"> <div class="[ form-group ]"> <label class="[ sans-serif ]">Usuario</label> <input type="text" class="[ form-control no-border-radius color-gray-xlight height-30 ]"> </div> <div class="[ form-group ]"> <label class="[ sans-serif ]">Contraseña</label> <input type="password" class="[ form-control no-border-radius color-gray-xlight height-30 ]"> </div> <div class="[ text-center ][ margin-bottom ]"> <button type="submit" href="#" class="[ btn btn-secondary padding--top-bottom--xsmall ]">ingresa</button> </div> <p class="[ text-center ][ margin-bottom ][ small sans-serif ]">¿Olvidaste tu contraseña?</p> <div class="[ text-center ]"> <button type="submit" href="#" class="[ btn btn-secondary padding--top-bottom--xsmall ][ margin-bottom ]">crear cuenta</button> </div> </form> <div class="[ text-center ]"> <a href="https://www.facebook.com"> <p class="[ small sans-serif ][ color-light ][ inline-block align-middle no-margin ]">Ingresa con</p> <button type="submit" href="#" class="[ btn btn-facebook ][ inline-block align-middle margin-left--small ]"> <img class="[ svg icon icon--iconed--normal icon--thickness-3 icon--fill ][ color-light ]" src="icons/facebook.svg"> <span class="[ color-light ][ inline-block align-middle ]">Facebook</span> </button> </a> </div> </div> </div> </div><!-- end bg-primary --> </div><!-- end modal-body --> </div><!-- end modal-content --> </div><!-- end modal-dialog --> </div><!-- end modal --> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.0/js/bootstrap.min.js"></script> <!--<script src="js/plugins.js"></script>--> <script src="js/functions.js"></script> <script> $( document ).ready(function() { /** * On ready **/ imgToSvg(); /** * Triggered events **/ }); </script> </body> </html>
{'content_hash': '84cc679e01389db16e9289e38ee26e66', 'timestamp': '', 'source': 'github', 'line_count': 421, 'max_line_length': 559, 'avg_line_length': 62.02375296912114, 'alnum_prop': 0.6240042892156863, 'repo_name': 'pcuervo/yolcan', 'id': '7ef7cc2c04696f7268527c30758d55db1f79cb5f', 'size': '26196', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'visitanos.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '724572'}, {'name': 'HTML', 'bytes': '610394'}, {'name': 'JavaScript', 'bytes': '338799'}, {'name': 'PowerShell', 'bytes': '468'}, {'name': 'Python', 'bytes': '5734'}, {'name': 'Shell', 'bytes': '350'}]}
<?xml version="1.0" encoding="utf-8"?> <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> <entity name="prueba\pruebaBundle\Entity\Gastosoperativos" table="gastosoperativos"> <id name="idgastosoperativos" type="integer" column="idgastosoperativos"> <generator strategy="IDENTITY"/> </id> <field name="conceptogasto" type="string" column="conceptogasto" length="45" nullable="true"> <options> <option name="fixed"/> <option name="comment">tipo de gasto realizado: combustible, comida, repuesto, etc</option> </options> </field> <field name="facturagasto" type="string" column="facturagasto" length="45" nullable="true"> <options> <option name="fixed"/> <option name="comment">numero de factura</option> </options> </field> <field name="montogasto" type="string" column="montogasto" length="45" nullable="true"> <options> <option name="fixed"/> <option name="comment">monto de la factura</option> </options> </field> <field name="observacion" type="text" column="observacion" nullable="true"> <options> <option name="fixed"/> </options> </field> <field name="fechagasto" type="date" column="fechagasto" nullable="true"/> </entity> </doctrine-mapping>
{'content_hash': '018be470fdb41ba6b83b59296fa0741d', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 276, 'avg_line_length': 47.90625, 'alnum_prop': 0.6686236138290933, 'repo_name': 'jc181079/maher', 'id': 'f7a82cb8b5c5ca938d05291dd330606efdea94cb', 'size': '1533', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/prueba/pruebaBundle/Resources/config/doctrine/Gastosoperativos.orm.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '3605'}, {'name': 'CSS', 'bytes': '83815'}, {'name': 'HTML', 'bytes': '209161'}, {'name': 'JavaScript', 'bytes': '310574'}, {'name': 'PHP', 'bytes': '420720'}]}
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="test.application.domainobjects.Item" table="item" mutable="true"> <id name ="id" type="int" column="id"> <generator class="assigned"/></id> <property name="name" column="name" not-null="false" access="field"/> <property name="manufacturer" column="manufacturer" not-null="false" access="field"/> <property name="price" column="price" not-null="false" access="field"/> <property name="customerid" column="customer_id" not-null="false" access="field"/> </class> </hibernate-mapping>
{'content_hash': '31644d7bbeab6cf354173bd673ef140a', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 85, 'avg_line_length': 40.1764705882353, 'alnum_prop': 0.7203513909224012, 'repo_name': 'NCIP/caarray', 'id': 'f191cbf60a37f2600b5934f3ebb6090d6f90ce78', 'size': '683', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'software/third-party/ncicb.clm/testapp/src/Item.hbm.xml', 'mode': '33261', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '615'}, {'name': 'CSS', 'bytes': '126854'}, {'name': 'FreeMarker', 'bytes': '4941'}, {'name': 'Groovy', 'bytes': '4998'}, {'name': 'HTML', 'bytes': '101282'}, {'name': 'Java', 'bytes': '7360097'}, {'name': 'JavaScript', 'bytes': '1167628'}, {'name': 'Mathematica', 'bytes': '104531225'}, {'name': 'PLSQL', 'bytes': '38277'}, {'name': 'XSLT', 'bytes': '53231'}]}
{-# LANGUAGE FlexibleContexts, OverloadedStrings #-} module Handlers.Main (mainApp, itemlist) where import Types import qualified Data.Text.Lazy as T import Network.CGI.Text import Control.Monad.State import Data.ShoppingList import qualified Text.Blaze.Html5 as H import qualified Text.Blaze.Html5.Attributes as A import Text.Blaze.Html5 ((!)) import Text.Blaze.Renderer.Utf8 (renderHtml) import Data.Monoid check :: [Text] -> Shop CGIResult check x | not (null x) = do lift $ modify (disableMulti x) redirect "ostoslista.cgi" | otherwise = outputNothing appendNew :: Maybe Text -> Shop CGIResult appendNew Nothing = outputNothing appendNew (Just x) = do lift (modify (enable x)) redirect "ostoslista.cgi" mainApp :: Shop CGIResult mainApp = do setHeader "Content-Type" "text/html; charset=utf-8" getInput "append" >>= appendNew getMultiInput "list" >>= check l <- lift get outputFPS $ renderHtml (html l) html :: ShoppingList -> H.Html html list = H.docTypeHtml $ do H.head $ do H.meta ! A.charset "utf-8" H.meta ! A.name "viewport" ! A.content "width=device-width;" mkstyles styles mkscripts scripts H.title "Shopping list" H.body $ do H.div ! A.id "main" $ do H.h1 "Shopping list" H.div ! A.id "info" $ do H.p "0 items hidden" ! A.id "hiddenitems" H.a "toggle" ! A.href "#" ! A.id "show" H.div ! A.id "form" $ do H.form ! A.id "append" ! A.method "POST" $ do H.input ! A.id "input" ! A.type_ "text" ! A.name "append" H.input ! A.type_ "submit" ! A.value "Add new" H.form ! A.id "check" ! A.method "POST" $ do H.ul ! A.id "items" $ itemlist items H.input ! A.type_ "submit" ! A.value "Clear selected" where items = getAssoc list styles = ["css/style.css", "css/jquery.autocomplete.css"] scripts = reverse [ "http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" , "js/jquery.autocomplete.js" , "js/autocomplete.js" , "js/ajax.js"] mkfun :: (H.AttributeValue -> H.Html) -> [Text] -> H.Html mkfun f = foldr ((\ x m -> m `mappend` f x) . H.toValue) mempty mkstyles = mkfun css mkscripts = mkfun js css x = H.link ! A.rel "stylesheet" ! A.type_ "text/css" ! A.href x js x = H.script mempty ! A.type_ "application/javascript" ! A.src x itemlist :: [(Text, Int)] -> H.Html itemlist = foldr (\x m -> m `mappend` item x) mempty . reverse item :: Show a => (Text, a) -> H.Html item x@(a,b) = H.li ((H.input ! A.name "list" ! A.type_ "checkbox" ! A.value (H.toValue a)) `mappend` itemPP x) itemPP :: Show a => (Text, a) -> H.Html itemPP (a,b) = H.toHtml $ T.unwords [T.pack $ show b, "-", a]
{'content_hash': '0960549d3a3f363ad1f50bec08f4ac67', 'timestamp': '', 'source': 'github', 'line_count': 78, 'max_line_length': 111, 'avg_line_length': 34.96153846153846, 'alnum_prop': 0.6241290795746242, 'repo_name': 'MasseR/Shopping-list', 'id': '1e8d97f08c8ffd22f97b382fffa6f3222cdbc59a', 'size': '2727', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Handlers/Main.hs', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Haskell', 'bytes': '9096'}, {'name': 'JavaScript', 'bytes': '15124'}]}
package org.apache.dubbo.remoting.zookeeper.support; import org.apache.dubbo.common.URL; import org.apache.dubbo.common.logger.Logger; import org.apache.dubbo.common.logger.LoggerFactory; import org.apache.dubbo.common.utils.ConcurrentHashSet; import org.apache.dubbo.remoting.zookeeper.ChildListener; import org.apache.dubbo.remoting.zookeeper.DataListener; import org.apache.dubbo.remoting.zookeeper.StateListener; import org.apache.dubbo.remoting.zookeeper.ZookeeperClient; import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.Executor; public abstract class AbstractZookeeperClient<TargetDataListener, TargetChildListener> implements ZookeeperClient { protected static final Logger logger = LoggerFactory.getLogger(AbstractZookeeperClient.class); protected int DEFAULT_CONNECTION_TIMEOUT_MS = 5 * 1000; protected int DEFAULT_SESSION_TIMEOUT_MS = 60 * 1000; private final URL url; private final Set<StateListener> stateListeners = new CopyOnWriteArraySet<StateListener>(); private final ConcurrentMap<String, ConcurrentMap<ChildListener, TargetChildListener>> childListeners = new ConcurrentHashMap<String, ConcurrentMap<ChildListener, TargetChildListener>>(); private final ConcurrentMap<String, ConcurrentMap<DataListener, TargetDataListener>> listeners = new ConcurrentHashMap<String, ConcurrentMap<DataListener, TargetDataListener>>(); private volatile boolean closed = false; private final Set<String> persistentExistNodePath = new ConcurrentHashSet<>(); public AbstractZookeeperClient(URL url) { this.url = url; } @Override public URL getUrl() { return url; } @Override public void delete(String path){ //never mind if ephemeral persistentExistNodePath.remove(path); deletePath(path); } @Override public void create(String path, boolean ephemeral) { if (!ephemeral) { if(persistentExistNodePath.contains(path)){ return; } if (checkExists(path)) { persistentExistNodePath.add(path); return; } } int i = path.lastIndexOf('/'); if (i > 0) { create(path.substring(0, i), false); } if (ephemeral) { createEphemeral(path); } else { createPersistent(path); persistentExistNodePath.add(path); } } @Override public void addStateListener(StateListener listener) { stateListeners.add(listener); } @Override public void removeStateListener(StateListener listener) { stateListeners.remove(listener); } public Set<StateListener> getSessionListeners() { return stateListeners; } @Override public List<String> addChildListener(String path, final ChildListener listener) { ConcurrentMap<ChildListener, TargetChildListener> listeners = childListeners.get(path); if (listeners == null) { childListeners.putIfAbsent(path, new ConcurrentHashMap<ChildListener, TargetChildListener>()); listeners = childListeners.get(path); } TargetChildListener targetListener = listeners.get(listener); if (targetListener == null) { listeners.putIfAbsent(listener, createTargetChildListener(path, listener)); targetListener = listeners.get(listener); } return addTargetChildListener(path, targetListener); } @Override public void addDataListener(String path, DataListener listener) { this.addDataListener(path, listener, null); } @Override public void addDataListener(String path, DataListener listener, Executor executor) { ConcurrentMap<DataListener, TargetDataListener> dataListenerMap = listeners.get(path); if (dataListenerMap == null) { listeners.putIfAbsent(path, new ConcurrentHashMap<DataListener, TargetDataListener>()); dataListenerMap = listeners.get(path); } TargetDataListener targetListener = dataListenerMap.get(listener); if (targetListener == null) { dataListenerMap.putIfAbsent(listener, createTargetDataListener(path, listener)); targetListener = dataListenerMap.get(listener); } addTargetDataListener(path, targetListener, executor); } @Override public void removeDataListener(String path, DataListener listener ){ ConcurrentMap<DataListener, TargetDataListener> dataListenerMap = listeners.get(path); if (dataListenerMap != null) { TargetDataListener targetListener = dataListenerMap.remove(listener); if(targetListener != null){ removeTargetDataListener(path, targetListener); } } } @Override public void removeChildListener(String path, ChildListener listener) { ConcurrentMap<ChildListener, TargetChildListener> listeners = childListeners.get(path); if (listeners != null) { TargetChildListener targetListener = listeners.remove(listener); if (targetListener != null) { removeTargetChildListener(path, targetListener); } } } protected void stateChanged(int state) { for (StateListener sessionListener : getSessionListeners()) { sessionListener.stateChanged(state); } } @Override public void close() { if (closed) { return; } closed = true; try { doClose(); } catch (Throwable t) { logger.warn(t.getMessage(), t); } } @Override public void create(String path, String content, boolean ephemeral) { if (checkExists(path)) { delete(path); } int i = path.lastIndexOf('/'); if (i > 0) { create(path.substring(0, i), false); } if (ephemeral) { createEphemeral(path, content); } else { createPersistent(path, content); } } @Override public String getContent(String path) { if (!checkExists(path)) { return null; } return doGetContent(path); } protected abstract void doClose(); protected abstract void createPersistent(String path); protected abstract void createEphemeral(String path); protected abstract void createPersistent(String path, String data); protected abstract void createEphemeral(String path, String data); protected abstract boolean checkExists(String path); protected abstract TargetChildListener createTargetChildListener(String path, ChildListener listener); protected abstract List<String> addTargetChildListener(String path, TargetChildListener listener); protected abstract TargetDataListener createTargetDataListener(String path, DataListener listener); protected abstract void addTargetDataListener(String path, TargetDataListener listener); protected abstract void addTargetDataListener(String path, TargetDataListener listener, Executor executor); protected abstract void removeTargetDataListener(String path, TargetDataListener listener); protected abstract void removeTargetChildListener(String path, TargetChildListener listener); protected abstract String doGetContent(String path); /** * we invoke the zookeeper client to delete the node * @param path the node path */ protected abstract void deletePath(String path); }
{'content_hash': '2165f446ce42d202e8cd964139c3fb4b', 'timestamp': '', 'source': 'github', 'line_count': 227, 'max_line_length': 191, 'avg_line_length': 35.096916299559474, 'alnum_prop': 0.6609765281787373, 'repo_name': 'qtvbwfn/dubbo', 'id': 'c0258ebba89db07d3ad169bad0c21b86b867a954', 'size': '8783', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/support/AbstractZookeeperClient.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '2002'}, {'name': 'C++', 'bytes': '79499'}, {'name': 'Java', 'bytes': '8699967'}, {'name': 'Lex', 'bytes': '2076'}, {'name': 'Python', 'bytes': '316'}, {'name': 'Shell', 'bytes': '18630'}, {'name': 'Thrift', 'bytes': '1282'}]}
preload_app true worker_processes 3 timeout 30
{'content_hash': 'a184580532c85c7632367911eb4a4bb8', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 18, 'avg_line_length': 15.666666666666666, 'alnum_prop': 0.8297872340425532, 'repo_name': 'sunlightlabs/datajam', 'id': '11ee4bbd9e99c476241a7d372ae7ccd083272d9d', 'size': '47', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'config/unicorn.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '4232200'}, {'name': 'Ruby', 'bytes': '112289'}, {'name': 'Shell', 'bytes': '3711'}]}
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BuilderWithInheritance { class Program { static void Main(string[] args) { CuriousGenerics.Usage.Example(); } } }
{'content_hash': 'b22ade48ec89804b323f3d44f629a742', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 44, 'avg_line_length': 18.125, 'alnum_prop': 0.6517241379310345, 'repo_name': 'MartinZikmund/blog-2017', 'id': 'd144b5ec8279643e1f0cc88b87f219d883bf3be8', 'size': '292', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'BuilderWithInheritance/BuilderWithInheritance/Program.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '200946'}]}
<?xml version="1.0" encoding="UTF-8"?> <sem:triples uri="http://www.lds.org/vrl/objects/electrical-devices/thermostats" xmlns:sem="http://marklogic.com/semantics"> <sem:triple> <sem:subject>http://www.lds.org/vrl/objects/electrical-devices/thermostats</sem:subject> <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate> <sem:object datatype="xsd:string" xml:lang="eng">Thermostats</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/vrl/objects/electrical-devices/thermostats</sem:subject> <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate> <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/vrl</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/vrl/objects/electrical-devices/thermostats</sem:subject> <sem:predicate>http://www.lds.org/core#entityType</sem:predicate> <sem:object datatype="sem:iri">http://www.lds.org/Topic</sem:object> </sem:triple> </sem:triples>
{'content_hash': 'e140d9f7d8d4b4ad472ab5afd65582e5', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 124, 'avg_line_length': 56.611111111111114, 'alnum_prop': 0.719332679097154, 'repo_name': 'freshie/ml-taxonomies', 'id': '60fa1461868a0bcb5b8464f2c741fd92300dd4a9', 'size': '1019', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'roxy/data/gospel-topical-explorer-v2/taxonomies/vrl/objects/electrical-devices/thermostats.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '4422'}, {'name': 'CSS', 'bytes': '38665'}, {'name': 'HTML', 'bytes': '356'}, {'name': 'JavaScript', 'bytes': '411651'}, {'name': 'Ruby', 'bytes': '259121'}, {'name': 'Shell', 'bytes': '7329'}, {'name': 'XQuery', 'bytes': '857170'}, {'name': 'XSLT', 'bytes': '13753'}]}
'use strict'; module.exports = require('./lib/find-helpers');
{'content_hash': '48920e9495162f53ca794d7553299004', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 47, 'avg_line_length': 20.666666666666668, 'alnum_prop': 0.6935483870967742, 'repo_name': 'JasonTowner/find-helpers', 'id': 'c33c8b42d58075858186af234b410fa3d755d498', 'size': '62', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'index.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '1942'}]}
jsforphp ======== Tutorial code Jason Rhodes's ["JavaScript for PHP Developers"](https://code.tutsplus.com/courses/javascript-for-php-developers) tutsplus.com course. * PHP example application found in the /php directory * JS starter files are found in the /js directory **A note about dependencies** Typically I would .gitignore the vendor and node_modules folders in these apps so that we wouldn't be committing our dependency packages to the repo, but for this example app I thought it was best if you had access to the dependencies without having to worry about running composer or npm. If you prefer to install your own, remove php/vendor and js/node_modules and then run `composer install` and `npm install` in the respective folders to install dependencies yourself. (At that point you should probably add those folders to your .gitignore in your fork, too.)
{'content_hash': '724bdaaf7f9dd4aae825425faa65677e', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 289, 'avg_line_length': 67.0, 'alnum_prop': 0.7853042479908151, 'repo_name': 'jasonrhodes/jsforphp', 'id': '6584ec020593c45cf03bcae93f000e40fe467f82', 'size': '871', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '423'}, {'name': 'PHP', 'bytes': '1238'}]}
# redux-little-router [![Build Status](https://travis-ci.org/FormidableLabs/redux-little-router.svg?branch=master)](https://travis-ci.org/FormidableLabs/redux-little-router) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/7a6d3ed461d44fc0a83122dcda06728d)](https://www.codacy.com/app/tyler_9/redux-little-router?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=FormidableLabs/redux-little-router&amp;utm_campaign=Badge_Coverage) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/7a6d3ed461d44fc0a83122dcda06728d)](https://www.codacy.com/app/tyler_9/redux-little-router?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=FormidableLabs/redux-little-router&amp;utm_campaign=Badge_Grade) `redux-little-router` is a tiny router for Redux applications that lets the URL do the talking. The router follows three basic principles: - The URL is just another member of the state tree. - URL changes are just plain actions. - Route matching should be simple and extendable. While the core router does not depend on any view library, it provides flexible React bindings and components. ## Why another router? To understand why `redux-little-router` exists, check out our blog series, "Let the URL do the Talking": [Part 1](http://formidable.com/blog/2016/07/11/let-the-url-do-the-talking-part-1-the-pain-of-react-router-in-redux/) [Part 2](http://formidable.com/blog/2016/07/19/let-the-url-do-the-talking-part-2-bargaining-and-acceptance-with-redux-and-react-router/) [Part 3](http://formidable.com/blog/2016/07/25/let-the-url-do-the-talking-part-3-empower-the-url-with-redux-little-router/) While React Router is a great, well-supported library, it hoards URL state within the view layer and makes certain Redux patterns difficult, if not impossible. [This chart](http://imgur.com/a/Trlzw) outlines a major issue in accessing URL state from outside of React Router. `react-router-redux` is meant _only_ to enable time-travel debugging in React Router and doesn't allow you to safely access URL state. `redux-router`, while allowing you to access URL state, is experimental, lags behind React Router releases, and recommends `react-router-redux` in its `README`. `redux-little-router` makes URL state a first-class citizen of your Redux store and abstracts cross-browser navigation and routing into a pure Redux API. ## Redux usage To hook into Redux applications, `redux-little-router` uses a store enhancer that wraps the `history` module and adds current and previous router state to your store. The enhancer listens for location changes and dispatches rich actions containing the URL, parameters, and any custom data assigned to the route. It also intercepts navigation actions and calls their equivalent method in `history`. ### Wiring up the boilerplate The following is an example of a `redux-little-router` setup that works on both the browser and the server. At the bare minimum, you'll need to install the store enhancer (`createStoreWithRouter`) into your Redux store. ```js import { compose, createStore } from 'redux'; import { createStoreWithRouter } from 'redux-little-router'; import yourReducer from './your-app'; // Define your routes in a route-to-anything hash like below. // The value of the route key can be any serializable data. // This data gets attached to the `router` key of the state // tree when its corresponding route is matched and dispatched. // Useful for page titles and other route-specific data. // Uses https://github.com/snd/url-pattern for URL matching // and parameter extraction. const routes = { '/messages': { title: 'Message' }, '/messages/:user': { title: 'Message History' }, // You can also define nested route objects! // Just make sure each route key starts with a slash. '/': { title: 'Home', '/bio': { title: 'Biographies', '/:name': { title: 'Biography for:' } } } }; // This is an example of initializing the router in a client-only // single-page app. Passing in at least the `pathname` will allow // `createStoreWithRouter` to automatically setup the initial state // for the first browser location. const clientOnlyStore = createStore( yourReducer, initialState, createStoreWithRouter({ // The configured routes. Required. routes, // The basename for all routes. Optional. basename: '/example', // The initial URL. Required in all cases except for when // rehydrating the state tree on the client after a server render. pathname: '/home', // The initial query string object. Optional. query: { ex: 'ample' } }) ); // This is a wrapper function for setting up router boilerplate // for server-rendered universal React applications. // You can pull `url` and `query` from your express or hapi routes. // The below example uses a URL object from an express request. const initializeStore = ({ routes, requestUrl, requestQuery }) => { // Grab the initial state the server attached to your template after render const initialState = INITIAL_STATE_FROM_SERVER_RENDER; // Notice that `pathname` isn't required when rehydrating // the store since redux-little-router already added // the pathname to the initial state. const routerOptions = initialState ? { routes, basename: BASENAME_FROM_SERVER_RENDER } : { routes, basename: requestUrl.baseUrl, pathname: requestUrl.pathname, query: requestQuery, forServerRender: true // required for server renders! }; return createStore( yourReducer, initialState, createStoreWithRouter(routerOptions) ); }; ``` Often, you'll want to update state or trigger side effects after loading the initial URL. To maintain compatibility with other store enhancers (particularly ones that handle side effects, like `redux-loop` or `redux-saga`), we require this optional initial dispatch to happen in userland code by doing the following: ```js import { initializeCurrentLocation } from 'redux-little-router'; // ...after creating your store const initialLocation = store.getState().router; if (initialLocation) { store.dispatch(initializeCurrentLocation(initialLocation)); } ``` ### Provided actions and state On location changes, the store enhancer dispatches a LOCATION_CHANGED action that contains at least the following properties: ```js // For a URL matching /messages/:user { pathname: '/messages/a-user-has-no-name', route: '/messages/:user', params: { user: 'a-user-has-no-name' }, query: { // if your `history` instance uses `useQueries` some: 'thing' }, result: { arbitrary: 'data that you defined in your routes object!' parent: { // for nested routes only // contains the result of the parent route, // which contains each other parent route's // result recursively } } } ``` Your custom middleware can intercept this action to dispatch new actions in response to URL changes. The reducer consumes this action and adds the following to the root of the state tree on the `router` property: ```js { pathname: '/messages/a-user-has-no-name', route: '/messages/:user', params: { user: 'a-user-has-no-name' }, query: { some: 'thing' }, result: { arbitrary: 'data that you defined in your routes object!', parent: { /* the parent route's result */ }, }, previous: { pathname: '/messages', route: '/messages', params: {}, query: {}, result: { more: 'arbitrary data that you defined in your routes object!' parent: { /* the parent route's result */ } } } } ``` Your custom reducers or selectors can derive a large portion of your app's state from the URLs in the `router` property. ## React bindings and usage `redux-little-router` provides the following to make React integration easier: - A `<Fragment>` component that conditionally renders children based on current route and/or location conditions. - A `<Link>` component that sends navigation actions to the middleware when tapped or clicked. `<Link>` respects default modifier key and right-click behavior. A sibling component, `<PersistentQueryLink>`, persists the existing query string on navigation - A `provideRouter` HOC that passes down everything `<Fragment>` and `<Link>` need via context. `redux-little-router` assumes and requires that your root component is wrapped in `<Provider>` from `react-redux`. Both `provideRouter` and `<RouterProvider>` automatically `connect()` to updates from the router state. You can inspect the router state in any child component by using `connect()`: ```js export default connect(state => ({ router: state.router }))(YourComponent); ``` ### `<Fragment>` Think of `<Fragment>` as the midpoint of a "flexibility continuum" that starts with raw switch statements and ends with React Router's `<Route>` component. Fragments can live anywhere within the React tree, making split-pane or nested UIs easy to work with. The simplest fragment is one that displays when a route is active: ```es6 <Fragment forRoute='/home/messages/:team'> <p>This is the team messages page!</p> </Fragment> ``` You can also match a fragment against anything in the current `location` object: ```es6 <Fragment withConditions={location => location.query.superuser}> <p>Superusers see this on all routes!</p> </Fragment> ``` You can use `withConditions` in conjunction with `forRoute` to set strict conditions for when a `<Fragment>` should display. Two types of fragments exist: `<RelativeFragment>` (new to 9.0.0) and `<AbsoluteFragment>`. You can use either by doing the following: ```js import { RelativeFragment as Fragment } from 'redux-little-router'; // or import { AbsoluteFragment as Fragment } from 'redux-little-router'; ``` `<RelativeFragment>` lets you nest fragments to match your UI hierarchy to your route hierarchy, much like the `<Route>` component does in `react-router`. Given a URL of `/home/bio/dat-boi`, and the following elements: ```js <RelativeFragment forRoute='/home'> <h1>Home</h1> <RelativeFragment forRoute='/bio'> <h2>Bios</h2> <RelativeFragment forRoute='/dat-boi'> <h3>Dat Boi</h3> <p>Something something whaddup</p> </RelativeFragment> </RelativeFragment> </RelativeFragment> ``` ...React will render: ```js <div> <h1>Home</h1> <div> <h2>Bios</h2> <div> <h3>Dat Boi</h3> <p>Something something whaddup<p> </div> </div> </div> ``` `<RelativeFragment>` makes basic component-per-page navigation easy: ```js <Fragment forRoute='/'> <Fragment forRoute='/home'><Home /></Fragment> <Fragment forRoute='/about'><About /></Fragment> <Fragment forRoute='/messages'><Messages /></Fragment> <Fragment forRoute='/feed'><Feed /></Fragment> </Route> ``` `<AbsoluteFragment>`s do not communicate with their parent or child routes like `<RelativeFragment>`s do. The route you pass to `forRoute` must match an exact route in your routes configuration, and are analgous to absolute URLs (they are not "relative" to the `forRoute`s of any other fragment in the hierarchy). `<AbsoluteFragment>` accepts an additional `forRoutes` prop that allows the fragment to display on multiple routes: ```es6 <Fragment forRoutes={['/home/messages', '/home']}> <p>This displays in a couple of places!</p> </Fragment> ``` When in doubt, use `<RelativeFragment>`. `<AbsoluteFragment>` may be deprecated in a future release. ### `<Link>` Using the `<Link>` component is simple: ```es6 <Link className='anything' href='/yo'> Share Order </Link> ``` Alternatively, you can pass in a [location descriptor](https://github.com/mjackson/history/blob/9a5102c38a161f00c6ea027a88b87b0328b5dc93/docs/Location.md#location-descriptors) to `href`. This is useful for passing query objects: ```es6 <Link className='anything' href={{ pathname: '/home/messages/a-team?test=ing', query: { test: 'ing' } }}> Share Order </Link> ``` `<Link>` takes an optional valueless prop, `replaceState`, that changes the link navigation behavior from `pushState` to `replaceState` in the History API. ### `provideRouter` or `<RouterProvider>` Like React Router's `<Router>` component, you'll want to wrap `provideRouter` around your app's top-level component like so: ```es6 import React from 'react'; import ReactDOM from 'react-dom'; import { provideRouter } from 'redux-little-router'; import YourAppComponent from './'; import createYourStore from './state'; const AppComponentWithRouter = provideRouter({ store: createYourStore() })(YourAppComponent); ReactDOM.render(<AppComponentWithRouter />, document.getElementById('root'); ``` This allows `<Fragment>` and `<Link>` to obtain their `history` and `dispatch` instances without manual prop passing. If you'd rather use a plain component instead of a higher-ordered component, use `<RouterProvider>` like so: ```es6 import React from 'react'; import ReactDOM from 'react-dom'; import { RouterProvider } from 'redux-little-router'; import YourAppComponent from './'; import createYourStore from './state'; ReactDOM.render( <RouterProvider store={createYourStore()}> <YourComponent /> </RouterProvider> document.getElementById('root'); ) ``` ## Environment `redux-little-router` requires an ES5 compatible environment (no IE8). ## Stability We consider `redux-little-router` to be **stable**. Any API changes will be incremental. ## Versioning `redux-little-router` follows **strict semver**. Don't be alarmed by the high version number! Major version bumps represent _any_ breaking change, no matter how small, and do not represent a major shift in direction. We strive to make breaking changes small and compartmentalized.
{'content_hash': '0ccfd1f27ea4542d1d62e22ce8a096b6', 'timestamp': '', 'source': 'github', 'line_count': 366, 'max_line_length': 733, 'avg_line_length': 37.56284153005465, 'alnum_prop': 0.7285423334303172, 'repo_name': 'save-password/save-password.github.io', 'id': '303d2d0e8493f6449995aca5295c32bc096b454c', 'size': '13748', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'node_modules/redux-little-router/README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '14281'}, {'name': 'HTML', 'bytes': '10627'}, {'name': 'JavaScript', 'bytes': '77636'}]}
// // GTLTictactoeScore.m // // ---------------------------------------------------------------------------- // NOTE: This file is generated from Google APIs Discovery Service. // Service: // tictactoe/v1 // Classes: // GTLTictactoeScore (0 custom class methods, 4 custom properties) #import "GTLTictactoeScore.h" #import "GTLTictactoeUser.h" // ---------------------------------------------------------------------------- // // GTLTictactoeScore // @implementation GTLTictactoeScore @dynamic identifier, outcome, played, player; + (NSDictionary *)propertyToJSONKeyMap { NSDictionary *map = [NSDictionary dictionaryWithObject:@"id" forKey:@"identifier"]; return map; } @end
{'content_hash': 'fb3d6afeb86c7732fae3756be54e3af5', 'timestamp': '', 'source': 'github', 'line_count': 33, 'max_line_length': 79, 'avg_line_length': 22.12121212121212, 'alnum_prop': 0.5328767123287671, 'repo_name': 'opozo/web-endpoints', 'id': '834d793cdba21c87a4ca1028c74e504338504aba', 'size': '843', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'ios/TicTacToeSample/GTLTictactoeScore.m', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '4431'}, {'name': 'C++', 'bytes': '2926'}, {'name': 'CSS', 'bytes': '2708'}, {'name': 'HTML', 'bytes': '1686'}, {'name': 'Java', 'bytes': '78736'}, {'name': 'JavaScript', 'bytes': '13936'}, {'name': 'Objective-C', 'bytes': '737380'}, {'name': 'Python', 'bytes': '10179'}]}
Imports BVSoftware.Bvc5.Core Partial Class BVAdmin_Controls_CategoryPicker Inherits System.Web.UI.UserControl Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack() Then BindCategoriesGridView() End If End Sub Protected Sub BindCategoriesGridView() CategoriesGridView.DataSource = Catalog.Category.ListFullTreeWithIndents(True) CategoriesGridView.DataKeyNames = New String() {"value"} CategoriesGridView.DataBind() End Sub Public ReadOnly Property SelectedCategories() As StringCollection Get Dim result As New StringCollection For Each row As GridViewRow In CategoriesGridView.Rows If DirectCast(row.Cells(0).FindControl("chkSelected"), CheckBox).Checked Then result.Add(CategoriesGridView.DataKeys(row.RowIndex).Value) End If Next Return result End Get End Property End Class
{'content_hash': '6e440be209b5d728b7a35347c0950d66', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 96, 'avg_line_length': 34.733333333333334, 'alnum_prop': 0.6756238003838771, 'repo_name': 'ajaydex/Scopelist_2015', 'id': 'd4faec3c8272a512947f3aa5efcd8e6e4852a202', 'size': '1042', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'BVAdmin/Controls/CategoryPicker.ascx.vb', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ASP', 'bytes': '2866898'}, {'name': 'C#', 'bytes': '208973'}, {'name': 'CSS', 'bytes': '618701'}, {'name': 'HTML', 'bytes': '30821'}, {'name': 'JavaScript', 'bytes': '194117'}, {'name': 'SQLPL', 'bytes': '3612'}, {'name': 'Visual Basic', 'bytes': '4572224'}]}
// This header is generated for Chilkat v9.5.0 #ifndef _CkTrustedRootsW_H #define _CkTrustedRootsW_H #include "chilkatDefs.h" #include "CkString.h" #include "CkWideCharBase.h" class CkCertW; class CkJavaKeyStoreW; class CkBaseProgressW; #ifndef __sun__ #pragma pack (push, 8) #endif // CLASS: CkTrustedRootsW class CK_VISIBLE_PUBLIC CkTrustedRootsW : public CkWideCharBase { private: bool m_cbOwned; CkBaseProgressW *m_callback; // Don't allow assignment or copying these objects. CkTrustedRootsW(const CkTrustedRootsW &); CkTrustedRootsW &operator=(const CkTrustedRootsW &); public: CkTrustedRootsW(void); virtual ~CkTrustedRootsW(void); static CkTrustedRootsW *createNew(void); CkTrustedRootsW(bool bCallbackOwned); static CkTrustedRootsW *createNew(bool bCallbackOwned); void CK_VISIBLE_PRIVATE inject(void *impl); // May be called when finished with the object to free/dispose of any // internal resources held by the object. void dispose(void); CkBaseProgressW *get_EventCallbackObject(void) const; void put_EventCallbackObject(CkBaseProgressW *progress); // BEGIN PUBLIC INTERFACE // ---------------------- // Properties // ---------------------- // The number of certificates contained within this object. int get_NumCerts(void); // Indicates whether the operating system's CA root certificates are automatically // trusted. // // On a Windows operating system, this would be the registry-based CA certificate // stores. On a Linux system, this could be /etc/ssl/certs/ca-certificates.crt, if // it exists. The default value is true. Set this property equal to false to // prevent Chilkat from automatically trusting system-provided root CA // certificates. // bool get_TrustSystemCaRoots(void); // Indicates whether the operating system's CA root certificates are automatically // trusted. // // On a Windows operating system, this would be the registry-based CA certificate // stores. On a Linux system, this could be /etc/ssl/certs/ca-certificates.crt, if // it exists. The default value is true. Set this property equal to false to // prevent Chilkat from automatically trusting system-provided root CA // certificates. // void put_TrustSystemCaRoots(bool newVal); // ---------------------- // Methods // ---------------------- // Activates this collection of trusted roots as the set of CA and self-signed root // certificates that are to be trusted Chilkat-wide for PKCS7 signature validation // and SSL/TLS server certificate validation. bool Activate(void); // Adds a certificate to the collection of trusted roots. bool AddCert(const CkCertW &cert); // Adds the trusted certificates from a Java key store to the collection of trusted // roots. bool AddJavaKeyStore(CkJavaKeyStoreW &keystore); // Deactivates a previously set of activated trusted roots so that all roots / // self-signed certificates are implicitly trusted. bool Deactivate(void); // Returns the Nth cert contained within this object. The 1st certificate is at // index 0. // The caller is responsible for deleting the object returned by this method. CkCertW *GetCert(int index); // Loads a CA bundle in PEM format. This is a file containing CA root certificates // that are to be trusted. An example of one such file is the CA certs from // mozilla.org exported to a cacert.pem file by the mk-ca-bundle tool located here: // http://curl.haxx.se/docs/caextract.html. // // Note: This can also be called to load the /etc/ssl/certs/ca-certificates.crt // file on Linux systems. // bool LoadCaCertsPem(const wchar_t *path); // END PUBLIC INTERFACE }; #ifndef __sun__ #pragma pack (pop) #endif #endif
{'content_hash': '4d994a0fc809e6c029528d25ec6fb599', 'timestamp': '', 'source': 'github', 'line_count': 134, 'max_line_length': 84, 'avg_line_length': 28.70149253731343, 'alnum_prop': 0.7022880915236609, 'repo_name': 'SKKU-Tizen-SecBTKey/FrameworkVirtualKeyboard', 'id': '0ca7cdc840c7b58e1e707a65f895512e2d0c32a6', 'size': '3986', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'server/include/chilkat/CkTrustedRootsW.h', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '1107094'}, {'name': 'C++', 'bytes': '3542623'}, {'name': 'CMake', 'bytes': '1511'}]}
void gr2_decompress(uint32_t compressed_size, uint8_t* compressed_buffer, uint32_t step1, uint32_t step2, uint32_t decompressed_size, uint8_t* decompressed_buffer);
{'content_hash': '9448c08a8b90f67cdb85b4836ca3dd75', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 73, 'avg_line_length': 55.666666666666664, 'alnum_prop': 0.7844311377245509, 'repo_name': 'Arbos/nwn2mdk', 'id': 'bdcc2db5960691ddeee74562031b70a08dcc0fd1', 'size': '201', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'nwn2mdk-lib/gr2_decompress.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '366032'}, {'name': 'C++', 'bytes': '280525'}, {'name': 'Python', 'bytes': '30002'}]}
<?php namespace Wave\Objects; class RemoteStateTest extends \PHPUnit_Framework_TestCase { public function test_setDeployed_NoPackageFound_SetToNull() { $rs = new RemoteState(); $rs->Staged[] = Package::create('a', 'b'); $rs->setDeployed('n'); self::assertNull($rs->Deployed); } public function test_setDeployed_NoPackageFoundByPackage_SetToNull() { $rs = new RemoteState(); $rs->Staged[] = Package::create('a', 'b'); $rs->setDeployed(Package::create('a', 'n')); self::assertNull($rs->Deployed); } public function test_setDeployed_ByName_PackageSet() { $p = Package::create('a', 'b'); $rs = new RemoteState(); $rs->Staged[] = $p; $rs->setDeployed($p->Name); self::assertSame($p, $rs->Deployed); } public function test_setDeployed_ByPackage_PackageSet() { $p = Package::create('a', 'b'); $rs = new RemoteState(); $rs->Staged[] = $p; $rs->setDeployed($p); self::assertSame($p, $rs->Deployed); } public function test_hasDeployed_No_ReturnFalse() { $rs = new RemoteState(); $rs->Staged[] = Package::create('a', 'b'); self::assertFalse($rs->hasDeployed()); } public function test_hasDeployed_Yes_ReturnTrue() { $p = Package::create('a', 'b'); $rs = new RemoteState(); $rs->Staged[] = $p; $rs->setDeployed($p->Name); self::assertTrue($rs->hasDeployed()); } }
{'content_hash': '662c304be6ca57fc9aa136735187cc7f', 'timestamp': '', 'source': 'github', 'line_count': 66, 'max_line_length': 69, 'avg_line_length': 20.636363636363637, 'alnum_prop': 0.6233480176211453, 'repo_name': 'Oktopost/Wave', 'id': 'c1ee70e572dd554405836cd2bbc0293583ebede1', 'size': '1362', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/Wave/Objects/RemoteStateTest.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '136442'}]}
using Microsoft.AspNet.Identity.EntityFramework; namespace TM.UI.MVC { public class ApplicationRole:IdentityRole { public ApplicationRole() { } public ApplicationRole(string name):base(name) { } } }
{'content_hash': '2815bb3ba1d32f5b5c4e2e8df1376a15', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 52, 'avg_line_length': 15.941176470588236, 'alnum_prop': 0.5793357933579336, 'repo_name': 'ssh-git/training-manager', 'id': '04596d0b308fe1f0b84f10717568a333ea120816', 'size': '271', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/TM.UI.MVC/Identity/ApplicationRole.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '100'}, {'name': 'C#', 'bytes': '863886'}, {'name': 'CSS', 'bytes': '47804'}, {'name': 'HTML', 'bytes': '3407747'}, {'name': 'JavaScript', 'bytes': '592516'}, {'name': 'TypeScript', 'bytes': '36372'}]}
/** * \author Sergio Agostinho - sergio(dot)r(dot)agostinho(at)gmail(dot)com * \date created: 2017/05/09 * \date last modified: 2017/08/19 * \file geometry.h * \brief Defines a number of useful geometric types and functions * like rotations and pose holding types and operations */ #pragma once #ifndef CVL_COMMON_GEOMETRY_H_ #define CVL_COMMON_GEOMETRY_H_ #include <cvl/common/eigen.h> namespace ht { /** \addtogroup common * @{ */ /** \class AxisAngle * \brief Abstracts an axis angle rotation */ template<typename _Float> class AxisAngle { public: /** \brief Default ctor. Initialized an identity rotation */ AxisAngle () : data_ {0, 0, 1, 0} {} /** \brief Component-wise Ctor * * Allows setting all component individually * \note vx, vy, and vz are assumed to form a normalized * vector * \param[in] vx - x component of the axis * \param[in] vy - y component of the axis * \param[in] vz - y component of the axis * \param[in] angle - angle in radians */ AxisAngle ( const _Float vx, const _Float vy, const _Float vz, const _Float angle) : data_ {vx, vy, vz, angle} {} /** \brief Constructs an AxisAngle from Euler angles * * \note The rotation resultant rotation has the following order * R = Rx * Ry * Rz * \param[in] rx - rotation angle along x (in radians) * \param[in] ry - rotation angle along y (in radians) * \param[in] rz - rotation angle along z (in radians) */ AxisAngle ( const _Float rx, const _Float ry, const _Float rz) { using Eigen::AngleAxis; const AngleAxis<_Float> aa (AngleAxis<_Float> (rx, Vector3<_Float>::UnitX ()) * AngleAxis<_Float> (ry, Vector3<_Float>::UnitY ()) * AngleAxis<_Float> (rz, Vector3<_Float>::UnitZ ())); axis () = aa.axis (); angle () = aa.angle (); } /** \brief Initialize the object from an array * \note the first three component of the vector are assumed to * define a normalized 3D vector, and the last and angle in radians. * \param[in] data - 4 component array */ AxisAngle (const _Float (&data)[4]) : data_ (data) {} /** \brief Initialize an Eigen dense object of size 4 * \param[in] vec - an Eigen dense object * \note the first three component of the vector are assumed to * define a normalized 3D vector, and the last and angle in radians. */ template<typename _Derived> AxisAngle (const DenseBase<_Derived>& vec) { EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE (Vector4<_Float>, DenseBase<_Derived>); Eigen::Map<Vector4<_Float>> m (data_); m = vec; } /** \brief Initialize an Eigen::AngleAxis object * \param[in] aa - An Eigen AngleAxis object */ AxisAngle (const Eigen::AngleAxis<_Float>& aa) { data_[3] = aa.angle (); axis () = aa.axis (); } /** \brief Initialize an Eigen::Quaternion object * \param[in] quat - an Eigen Quaternion object */ template<typename _Derived> AxisAngle (const QuaternionBase<_Derived>& quat) { using Scalar = typename QuaternionBase<_Derived>::Scalar; static_assert ( std::is_same<_Float, Scalar>::value, "Scalar types must be similar"); const Eigen::AngleAxis<Scalar> aa(quat); axis () = aa.axis (); angle () = aa.angle (); } /** \brief Implements a rotation * vector product * \param[in] vec - the vector to be rotated * \return The rotated vector */ template<typename _Derived> Vector4<typename MatrixBase<_Derived>::Scalar> operator* (const MatrixBase<_Derived>& vec) const { using Scalar = typename MatrixBase<_Derived>::Scalar; static_assert ( std::is_same<_Float, Scalar>::value, "Scalar types must be similar"); EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(MatrixBase<_Derived>, 4); return Eigen::Transform<Scalar, 3, Eigen::Affine, Eigen::RowMajor> ( Eigen::AngleAxis<Scalar> (angle (), axis ()).toRotationMatrix () ) * vec; } /** \brief Provides access to the angle component * \return A reference to the angle element */ _Float& angle () { return data_[3]; } /** \brief Provides a const access to the angle component * \return The value of the angle element */ _Float angle () const { return data_[3]; } /** \brief Provides an Eigen::Map to the axis vector * \return An Eigen::Map to the axis vector */ Eigen::Map<Vector3<_Float>> axis () { return Eigen::Map<Vector3<_Float>> (data_); } /** \brief Provides a const version of an Eigen::Map to the axis vector * \return A const Eigen::Map to the axis vector */ Eigen::Map<const Vector3<_Float>> axis () const { return Eigen::Map<const Vector3<_Float>> (data_); } /** \brief Provides an Eigen::Map to the data container * \return An Eigen::Map to the data container */ Eigen::Map<Vector4<_Float>> vector () { return Eigen::Map<Vector4<_Float>> (data_); } /** \brief Provides a const version of an Eigen::Map to the data container * \return A const Eigen::Map to the data container */ Eigen::Map<const Vector4<_Float>> vector () const { return Eigen::Map<const Vector4<_Float>> (data_); } protected: /** \brief Data container holding the actual values * * The first three elements are a normalized axis and the fourth * the angle in radians. */ _Float data_[4]; }; /** \brief A floating point float instantiation of AxisAngle type */ using AxisAnglef = AxisAngle<float>; /** \brief A floating point double instantiation of AxisAngle type */ using AxisAngled = AxisAngle<double>; /** \class Pose * \brief Abstracts pose information, aggregating a rotation and * translation component. */ template<typename _Float> class Pose { public: /** \brief Default Ctor * * Initializes to and "identity" rotation and a zero translation. */ Pose () : tvec_ {0, 0, 0, 0} {} /** \brief Copy array ctor * * Initializes directly the rotation and translation arrays with * copies. * \param[in] rvec - an axis angle array. The first three components of the rotation vector are assumed * to be the normalized vector, and the fourth the angle. * \param[in] tvec - the translation vector array. The fourth * component of the translation vector is assumed to be 0. */ Pose (const _Float (&rvec)[4], const _Float (&tvec)[4]) : rvec_ (rvec) , tvec_ (tvec) {} /** \brief Copy Eigen dense object ctor * * Initializes directly the rotation and translation arrays with * copies. * \param[in] rvec - an axis angle dense object. The first three components of the rotation vector are assumed * to be the normalized vector, and the fourth the angle. * \param[in] tvec - the translation vector dense object. The fourth * component of the translation vector is assumed to be 0. */ template<typename _Derived> Pose (const DenseBase<_Derived>& rvec, const DenseBase<_Derived>& tvec) : rvec_ (rvec) { using Scalar = typename DenseBase<_Derived>::Scalar; static_assert ( std::is_same<_Float, Scalar>::value, "Scalar types must be similar"); EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(DenseBase<_Derived>, 4); translation () = tvec; } /** \brief Copy AxisAngle and Eigen dense object ctor * * Initializes directly the rotation and translation arrays with * copies. * \param[in] rvec - an AxisAngle object. * \param[in] tvec - the translation vector dense object. The fourth * component of the translation vector is assumed to be 0. */ template<typename _Derived> Pose (const AxisAngle<_Float>& rvec, const DenseBase<_Derived>& tvec) : rvec_ (rvec) { using Scalar = typename DenseBase<_Derived>::Scalar; static_assert ( std::is_same<_Float, Scalar>::value, "Scalar types must be similar"); EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(DenseBase<_Derived>, 4); translation () = tvec; } /** \brief Exposes a reference to the AxisAngle rotation * \return A reference to the AxisAngle rotation */ AxisAngle<_Float>& rotation () { return rvec_; } /** \brief Exposes a reference to the AxisAngle rotation * \return A const reference to the AxisAngle rotation */ const AxisAngle<_Float>& rotation () const { return rvec_; } /** \brief Exposes an Eigen::Map to the translation array * \return An Eigen::Map to the translation array */ Eigen::Map<Vector4<_Float>> translation () { return Eigen::Map<Vector4<_Float>> (tvec_); } /** \brief Exposes an Eigen::Map to the translation array * \return An const Eigen::Map to the translation array */ Eigen::Map<const Vector4<_Float>> translation () const { return Eigen::Map<const Vector4<_Float>> (tvec_); } protected: /** \brief The rotation AxisAngle component */ AxisAngle<_Float> rvec_; /** \brief The translation component */ _Float tvec_[4]; }; /** \brief A float instantiation of the Pose class. */ using Posef = Pose<float>; /** \brief A double instantiation of the Pose class. */ using Posed = Pose<double>; /** \brief Compose two transformations specified by their rotation and * translation components. * \param[out] rout - an AxisAngle with the composed output rotation * \param[out] tout - a MatrixBase object with the composed output translation * \param[in] rvec1 - an AxisAngle with the left rotation component * \param[in] tvec1 - a MatrixBase object with the left translation vector * \param[in] rvec2 - an AxisAngle with the right rotation component * \param[in] tvec2 - a MatrixBase object with the right translation vector */ template<typename _Derived> void compose (AxisAngle<typename MatrixBase<_Derived>::Scalar>& rout, MatrixBase<_Derived>& tout, const AxisAngle<typename MatrixBase<_Derived>::Scalar>& rvec1, const MatrixBase<_Derived>& tvec1, const AxisAngle<typename MatrixBase<_Derived>::Scalar>& rvec2, const MatrixBase<_Derived>& tvec2); /** \brief Compose two transformations specified by their rotation and * translation components. * \param[out] rout - a MatrixBase with the composed output rotation vector * \param[out] tout - a MatrixBase object with the composed output translation * \param[in] rvec1 - a MatrixBase with the left rotation component vector * \param[in] tvec1 - a MatrixBase object with the left translation vector * \param[in] rvec2 - a MatrixBase with the right rotation component vector * \param[in] tvec2 - a MatrixBase object with the right translation vector */ template<typename _Derived> void compose (MatrixBase<_Derived>& rout, MatrixBase<_Derived>& tout, const MatrixBase<_Derived>& rvec1, const MatrixBase<_Derived>& tvec1, const MatrixBase<_Derived>& rvec2, const MatrixBase<_Derived>& tvec2) { AxisAngle<typename MatrixBase<_Derived>::Scalar> aa_out; compose (aa_out, tout, rvec1, tvec1, rvec2, tvec2); rout = aa_out.vector (); } /** \brief Estimate the rigid transformation from set of points A to B * \param[out] rvec - angleaxis vector with the rotation between the two * point sets * \param[out] tvec - translation vector with between the two point sets * \param[in] pts_b - set of points B, size Nx3 * \param[in] pts_a - set of points A, size Nx3 */ template<typename _DerivedO, typename _DerivedI> void rigid (MatrixBase<_DerivedO>& rvec, MatrixBase<_DerivedO>& tvec, const MatrixBase<_DerivedI>& pts_b, const MatrixBase<_DerivedI>& pts_a); /** \brief Estimate the rigid transformation from set of points A to B * \param[out] rvec - AxisAngle object with the rotation between the two * point sets * \param[out] tvec - translation vector with between the two point sets * \param[in] pts_b - set of points B, size Nx3 * \param[in] pts_a - set of points A, size Nx3 */ template<typename _Derived> void rigid (AxisAngle<typename MatrixBase<_Derived>::Scalar>& rvec, MatrixBase<_Derived>& tvec, const MatrixBase<_Derived>& pts_b, const MatrixBase<_Derived>& pts_a) { rigid (rvec.vector (), tvec, pts_b, pts_a); } /** \brief Estimate the rigid transformation from set of points A to B * \param[in] pts_b - set of points B, size Nx3 * \param[in] pts_a - set of points A, size Nx3 * \return A Pose object with the transformation from set of points A to B */ template<typename _Derived> Pose<typename MatrixBase<_Derived>::Scalar> rigid ( const MatrixBase<_Derived>& pts_b, const MatrixBase<_Derived>& pts_a) { using Scalar = typename ht::MatrixBase<_Derived>::Scalar; Vector4<Scalar> rvec, tvec; rigid (rvec, tvec, pts_b, pts_a); return Pose<Scalar> (rvec, tvec); } /** \brief Generates a Rodrigues vector from a quaternion * \param[in] q - a Quaternion rotation * \return A Rodrigues vector */ template<typename _Derived> inline Vector3<typename QuaternionBase<_Derived>::Scalar> rodrigues (const QuaternionBase<_Derived>& q) { using Scalar = typename QuaternionBase<_Derived>::Scalar; const Eigen::AngleAxis<Scalar> aa(q); return Vector3<Scalar> (aa.angle () * aa.axis ()); } /** \brief Rotates a 3 element Vector provided a Rodrigues vector * \param[in] rodrigues - a Rodrigues rotation vector * \param[in] vec - the three dimensional vector to be rotated * \return The rotated 3 element Vector */ template<typename _Derived> inline Vector3<typename MatrixBase<_Derived>::Scalar> rotate (const MatrixBase<_Derived>& rodrigues, const MatrixBase<_Derived>& vec) { using Scalar = typename MatrixBase<_Derived>::Scalar; const Scalar norm = rodrigues.norm (); return Eigen::AngleAxis<Scalar> (norm, (1/norm)* rodrigues).toRotationMatrix () * vec; } /** @}*/ } /** \addtogroup common * @{ */ // Operators /** \brief The product between two rotations * \param[in] lhs - the left hand side AxisAngle object * \param[in] rhs - the right hand side AxisAngle object * \return The composed rotation AxisAngle */ template<typename _Float> ht::AxisAngle<_Float> operator* ( const ht::AxisAngle<_Float>& lhs, const ht::AxisAngle<_Float>& rhs); /** \brief The product between two transformations/poses * \param[in] lhs - the left hand side Pose object * \param[in] rhs - the right hand side Pose object * \return The composed pose/transformation Pose object */ template<typename _Float> ht::Pose<_Float> operator* ( const ht::Pose<_Float>& lhs, const ht::Pose<_Float>& rhs); /** @}*/ #include <cvl/common/impl/geometry.hpp> #endif //CVL_COMMON_GEOMETRY_H_
{'content_hash': '7cd6568342e4d0748781db1191f27b8f', 'timestamp': '', 'source': 'github', 'line_count': 435, 'max_line_length': 117, 'avg_line_length': 36.691954022988504, 'alnum_prop': 0.6135580477413696, 'repo_name': 'SergioRAgostinho/cvl', 'id': 'f4a83ea9512284325bc0dba5d7ef813db19daf24', 'size': '15961', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'common/include/cvl/common/geometry.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '2658'}, {'name': 'C++', 'bytes': '106918'}, {'name': 'CMake', 'bytes': '17322'}, {'name': 'Shell', 'bytes': '3332'}]}
package resolver import ( "bytes" "encoding/json" "flag" "fmt" "io" "io/ioutil" "log" "path" "strings" "github.com/bazelbuild/rules_docker/container/go/pkg/compat" "github.com/bazelbuild/rules_docker/container/go/pkg/utils" "github.com/google/go-containerregistry/pkg/authn" "github.com/google/go-containerregistry/pkg/name" "github.com/google/go-containerregistry/pkg/v1/remote" "gopkg.in/yaml.v2" ) // Flags defines the flags that rules_k8s may pass to the resolver type Flags struct { ImgChroot string K8sTemplate string SubstitutionsFile string AllowUnusedImages bool NoPush bool StampInfoFile utils.ArrayStringFlags ImgSpecs utils.ArrayStringFlags } // Commandline flags const ( FlagImgChroot = "image_chroot" FlagK8sTemplate = "template" FlagSubstitutionsFile = "substitutions" FlagAllowUnusedImages = "allow_unused_images" FlagNoPush = "no_push" FlagImgSpecs = "image_spec" FlagStampInfoFile = "stamp-info-file" ) // RegisterFlags will register the resolvers flags with the provided FlagSet. // It returns a struct that will contain the values once flags are parsed. // The caller is responsible for parsing flags when ready. func RegisterFlags(flagset *flag.FlagSet) *Flags { var flags Flags flagset.StringVar(&flags.ImgChroot, FlagImgChroot, "", "The repository under which to chroot image references when publishing them.") flagset.StringVar(&flags.K8sTemplate, FlagK8sTemplate, "", "The k8s YAML template file to resolve.") flagset.StringVar(&flags.SubstitutionsFile, FlagSubstitutionsFile, "", "A file with a list of substitutions that were made in the YAML template. Any stamp values that appear are stamped by the resolver.") flagset.BoolVar(&flags.AllowUnusedImages, FlagAllowUnusedImages, false, "Allow images that don't appear in the JSON. This is useful when generating multiple SKUs of a k8s_object, only some of which use a particular image.") flagset.BoolVar(&flags.NoPush, FlagNoPush, false, "Don't push images after resolving digests.") flagset.Var(&flags.ImgSpecs, FlagImgSpecs, "Associative lists of the constitutent elements of a docker image.") flagset.Var(&flags.StampInfoFile, FlagStampInfoFile, "One or more Bazel stamp info files.") return &flags } // Option can be passed to NewResolver to configure the resolver. type Option struct { apply func(r *Resolver) } // Resolver performs substitutions and resolves/pushes images type Resolver struct { flags *Flags // parseTag is called instead of name.NewTag, which allows overriding how image // tags are parsed. parseTag func(name string, opts ...name.Option) (name.Tag, error) } // ParseTagOption specifies a function to be used instead of name.NewTag to parse image tags. // // This option allows specifying different name.Option values in the call to name.Tag. For // example, the default logic for detecting whether a registry name is insecure can be // overridden. func ParseTagOption(f func(name string, opts ...name.Option) (name.Tag, error)) Option { return Option{ func(r *Resolver) { r.parseTag = f }, } } // NewResolver takes some Flags and returns a Resolver func NewResolver(flags *Flags, option ...Option) *Resolver { r := &Resolver{ flags: flags, parseTag: name.NewTag, } for _, o := range option { o.apply(r) } return r } // Resolve will parse the files pointed by the flags and return a resolvedTemplate and error as applicable func (r *Resolver) Resolve() (resolvedTemplate string, err error) { stamper, err := compat.NewStamper(r.flags.StampInfoFile) if err != nil { return "", fmt.Errorf("Failed to initialize the stamper: %w", err) } specs := []imageSpec{} for _, s := range r.flags.ImgSpecs { spec, err := parseImageSpec(s) if err != nil { return "", fmt.Errorf("Unable to parse image spec %q: %s", s, err) } specs = append(specs, spec) } substitutions := map[string]string{} if r.flags.SubstitutionsFile != "" { substitutions, err = parseSubstitutions(r.flags.SubstitutionsFile, stamper) if err != nil { return "", fmt.Errorf("Unable to parse substitutions file %s: %w", r.flags.SubstitutionsFile, err) } } resolvedImages, unseen, err := r.publish(specs, stamper) if err != nil { return "", fmt.Errorf("Unable to publish images: %w", err) } resolvedTemplate, err = resolveTemplate(r.flags.K8sTemplate, resolvedImages, unseen, substitutions) if err != nil { return resolvedTemplate, fmt.Errorf("Unable to resolve template file %q: %w", r.flags.K8sTemplate, err) } if len(unseen) > 0 && !r.flags.AllowUnusedImages { log.Printf("The following images given as --image_spec were not found in the template:") for i := range unseen { log.Printf("%s", i) } return resolvedTemplate, fmt.Errorf("--allow_unused_images can be specified to ignore this error.") } return } // imageSpec describes the differents parts of an image generated by // rules_docker. type imageSpec struct { // name is the name of the image. name string // imgTarball is the image in the `docker save` tarball format. imgTarball string // imgConfig if the config JSON file of the image. imgConfig string // digests is a list of files with the sha256 digests of the compressed // layers. digests []string // diffIDs is a list of files with the sha256 digests of the uncompressed // layers. diffIDs []string // compressedLayers are the paths to the compressed layer tarballs. compressedLayers []string // uncompressedLayers are the paths to the uncompressed layer tarballs. uncomressedLayers []string } // layers returns a list of strings that can be passed to the image reader in // the compatiblity package of rules_docker to read the layers of an image in // the format "va11,val2,val3,val4" where: // val1 is the compressed layer tarball. // val2 is the uncompressed layer tarball. // val3 is the digest file. // val4 is the diffID file. func (s *imageSpec) layers() ([]string, error) { result := []string{} if len(s.digests) != len(s.diffIDs) || len(s.diffIDs) != len(s.compressedLayers) || len(s.compressedLayers) != len(s.uncomressedLayers) { return nil, fmt.Errorf("digest, diffID, compressed blobs & uncompressed blobs had unequal lengths for image %s, got %d, %d, %d, %d, want all of the lengths to be equal", s.name, len(s.digests), len(s.diffIDs), len(s.compressedLayers), len(s.uncomressedLayers)) } for i, digest := range s.digests { diffID := s.diffIDs[i] compressedLayer := s.compressedLayers[i] uncompressedLayer := s.uncomressedLayers[i] result = append(result, fmt.Sprintf("%s,%s,%s,%s", compressedLayer, uncompressedLayer, digest, diffID)) } return result, nil } // parseImageSpec parses the differents parts of a single docker image specified // as string in the format "key1=val1;key2=val2" where the expected keys are: // 1. "name": Name of the image. // 2. "tarball": docker save tarball of the image. // 3. "config": JSON config file of the image. // 4. "diff_id": Files with sha256 digest of uncompressed layers. // 5. "digest": Files with sha256 digest of compressed layers. // 6. "compressed_layer": Path to compressed layer tarballs. // 7. "uncompressed_layer": Path to uncompressed layer tarballs. func parseImageSpec(spec string) (imageSpec, error) { result := imageSpec{} splitSpec := strings.Split(spec, ";") for _, s := range splitSpec { splitFields := strings.SplitN(s, "=", 2) if len(splitFields) != 2 { return imageSpec{}, fmt.Errorf("image spec item %q split by '=' into unexpected fields, got %d, want 2", s, len(splitFields)) } switch splitFields[0] { case "name": result.name = splitFields[1] case "tarball": result.imgTarball = splitFields[1] case "config": result.imgConfig = splitFields[1] case "diff_id": result.diffIDs = strings.Split(splitFields[1], ",") case "digest": result.digests = strings.Split(splitFields[1], ",") case "compressed_layer": result.compressedLayers = strings.Split(splitFields[1], ",") case "uncompressed_layer": result.uncomressedLayers = strings.Split(splitFields[1], ",") default: return imageSpec{}, fmt.Errorf("unknown image spec field %q", splitFields[0]) } } return result, nil } // parseSubsitutions parses a substitution file, which should be a JSON object // with strings to search for and values to replace them with. The replacement values // are stamped using the provided stamper. func parseSubstitutions(file string, stamper *compat.Stamper) (map[string]string, error) { b, err := ioutil.ReadFile(file) if err != nil { return nil, fmt.Errorf("unable to read file: %v", err) } result := struct { Substitutions map[string]string }{} if err := json.Unmarshal(b, &result); err != nil { return nil, fmt.Errorf("unmarshaling as JSON: %v", err) } for k, v := range result.Substitutions { result.Substitutions[k] = stamper.Stamp(v) } return result.Substitutions, nil } // publishSingle publishes a docker image with the given spec to the remote // registry indicated in the image name. The image name is stamped with the // given stamper. // The stamped image name is returned referenced by its sha256 digest. func (r *Resolver) publishSingle(spec imageSpec, stamper *compat.Stamper) (string, error) { layers, err := spec.layers() if err != nil { return "", fmt.Errorf("unable to convert the layer parts in image spec for %s into a single comma separated argument: %v", spec.name, err) } imgParts, err := compat.ImagePartsFromArgs(spec.imgConfig, "", spec.imgTarball, layers) if err != nil { return "", fmt.Errorf("unable to determine parts of the image from the specified arguments: %v", err) } cr := compat.Reader{Parts: imgParts} img, err := cr.ReadImage() if err != nil { return "", fmt.Errorf("error reading image: %v", err) } stampedName := stamper.Stamp(spec.name) var ref name.Reference if r.flags.ImgChroot != "" { n := path.Join(r.flags.ImgChroot, stampedName) t, err := r.parseTag(n, name.WeakValidation) if err != nil { return "", fmt.Errorf("unable to create a docker tag from stamped name %q: %v", n, err) } ref = t } else { t, err := r.parseTag(stampedName, name.WeakValidation) if err != nil { return "", fmt.Errorf("unable to create a docker tag from stamped name %q: %v", stampedName, err) } ref = t } auth, err := authn.DefaultKeychain.Resolve(ref.Context()) if err != nil { return "", fmt.Errorf("unable to get authenticator for image %v", ref.Name()) } if !r.flags.NoPush { if err := remote.Write(ref, img, remote.WithAuth(auth)); err != nil { return "", fmt.Errorf("unable to push image %v: %v", ref.Name(), err) } } d, err := img.Digest() if err != nil { return "", fmt.Errorf("unable to get digest of image %v", ref.Name()) } return fmt.Sprintf("%s/%s@%v", ref.Context().RegistryStr(), ref.Context().RepositoryStr(), d), nil } // publish publishes the image with the given spec. It returns: // 1. A map from the unstamped & tagged image name to the stamped image name // referenced by its sha256 digest. // 2. A set of unstamped & tagged image names that were pushed to the registry. func (r *Resolver) publish(spec []imageSpec, stamper *compat.Stamper) (map[string]string, map[string]bool, error) { overrides := make(map[string]string) unseen := make(map[string]bool) for _, s := range spec { digestRef, err := r.publishSingle(s, stamper) if err != nil { return nil, nil, err } overrides[s.name] = digestRef unseen[s.name] = true } return overrides, unseen, nil } // yamlResolver implements walking over arbitrary k8s YAML templates and // transforming every string in the YAML with a configured string resolver. type yamlResolver struct { // resolvedImages is a map from the tagged image name to the fully qualified // image name by sha256 digest. resolvedImages map[string]string // unseen is the set of images that haven't been seen yet. Image names // encountered in the k8s YAML template are removed from this set. unseen map[string]bool // strResolver is called to resolve every individual string encountered in // the k8s YAML template. The functor interface allows mocking the string // resolver in unit tests. strResolver func(*yamlResolver, string) (string, error) // numDocs stores the number of documents the resolver worked on when // resolveYAML was called. This is used for testing only. numDocs int } // resolveString resolves a string found in the k8s YAML template by replacing // a tagged image name with an image name referenced by its sha256 digest. If // the given string doesn't represent a tagged image, it is returned as is. // The given resolver is also modified: // 1. If the given string was a tagged image, the resolved image lookup in the // given resolver is updated to include a mapping from the given string to // the resolved image name. // 2. If the given string was a tagged image, the set of unseen images in the // given resolver is updated to exclude the given string. // The resolver is best-effort, i.e., if any errors are encountered, the given // string is returned as is. func resolveString(r *yamlResolver, s string) (string, error) { if _, ok := r.unseen[s]; ok { delete(r.unseen, s) } o, ok := r.resolvedImages[s] if ok { return o, nil } t, err := name.NewTag(s, name.StrictValidation) if err != nil { return s, nil } auth, err := authn.DefaultKeychain.Resolve(t.Context()) if err != nil { return s, nil } desc, err := remote.Get(t, remote.WithAuth(auth)) if err != nil { return s, nil } resolved := fmt.Sprintf("%s/%s@%v", t.Context().RegistryStr(), t.Context().RepositoryStr(), desc.Digest) r.resolvedImages[s] = resolved return resolved, nil } // resolveItem resolves the given YAML object if it's a string or recursively // walks into the YAML collection type. func (r *yamlResolver) resolveItem(i interface{}) (interface{}, error) { if s, ok := i.(string); ok { return r.strResolver(r, s) } if l, ok := i.([]interface{}); ok { return r.resolveList(l) } if m, ok := i.(map[interface{}]interface{}); ok { return r.resolveMap(m) } return i, nil } // resolveList recursively walks the given yaml list. func (r *yamlResolver) resolveList(l []interface{}) ([]interface{}, error) { result := []interface{}{} for _, i := range l { o, err := r.resolveItem(i) if err != nil { return nil, fmt.Errorf("error resolving item %v in list: %v", i, err) } result = append(result, o) } return result, nil } // resolveMap recursively walks the given yaml map. func (r *yamlResolver) resolveMap(m map[interface{}]interface{}) (map[interface{}]interface{}, error) { result := make(map[interface{}]interface{}) for k, v := range m { rk, err := r.resolveItem(k) if err != nil { return nil, fmt.Errorf("error resolving key %v in map: %v", k, err) } rv, err := r.resolveItem(v) if err != nil { return nil, fmt.Errorf("error resolving value %v in map: %v", v, err) } result[rk] = rv } return result, nil } // yamlDoc implements the yaml.Unmarshaler interface that allows decoding an // arbitrary YAML document. type yamlDoc struct { // vList stores an arbitrary YAML list. vList []interface{} // vMap stores an arbitrary YAML map. vMap map[interface{}]interface{} // isInt stores whether this YAML document stores an integer. isInt bool // vInt stores a YAML integer. vInt int // isBool stores whether this YAML document stores a boolean. isBool bool // vBool stores a YAML boolean. vBool bool // isStr stores whether this YAML document stores a string. isStr bool // vStr stores a YAML string. vStr string } // UnmarshalYAML loads an arbitrary YAML document which can be a YAML list or // a YAML map into the given YAML document. func (y *yamlDoc) UnmarshalYAML(unmarshal func(interface{}) error) error { if err := unmarshal(&y.vList); err == nil { return nil } if err := unmarshal(&y.vMap); err == nil { return nil } if err := unmarshal(&y.vInt); err == nil { y.isInt = true return nil } if err := unmarshal(&y.vBool); err == nil { y.isBool = true return nil } if err := unmarshal(&y.vStr); err == nil { y.isStr = true return nil } return fmt.Errorf("unable to parse given blob as a YAML list, map or string, integer or boolean") } // val gets the stored YAML value in this document. func (y *yamlDoc) val() interface{} { if y.vList != nil { return y.vList } if y.vMap != nil { return y.vMap } if y.isInt { return y.vInt } if y.isBool { return y.vBool } if y.isStr { return y.vStr } return nil } // resolveYAML recursively walks the given stream of arbitrary YAML documents // and calls the strResolver on each string in the YAML document. func (r *yamlResolver) resolveYAML(t io.Reader) ([]byte, error) { d := yaml.NewDecoder(t) buf := bytes.NewBuffer(nil) e := yaml.NewEncoder(buf) defer e.Close() for { y := yamlDoc{} err := d.Decode(&y) if err != nil && err != io.EOF { return nil, err } done := err == io.EOF o, err := r.resolveItem(y.val()) if err != nil { return nil, fmt.Errorf("error resolving YAML template: %v", err) } if o != nil { r.numDocs++ err = e.Encode(o) if err != nil { return nil, err } } if done { break } } return buf.Bytes(), nil } // resolveTemplate resolves the given YAML template using the given mapping from // tagged to fully qualified image names referenced by their digest and the // set of image names that haven't been seen yet. The given set of unseen images // is updated to exclude the image names encountered in the given template. The // given substitutions are made in the template. func resolveTemplate(templateFile string, resolvedImages map[string]string, unseen map[string]bool, substitutions map[string]string) (string, error) { t, err := ioutil.ReadFile(templateFile) if err != nil { return "", fmt.Errorf("unable to read template file %q: %v", templateFile, err) } for k, v := range substitutions { t = bytes.ReplaceAll(t, []byte(k), []byte(v)) } r := yamlResolver{ resolvedImages: resolvedImages, unseen: unseen, strResolver: resolveString, } resolved, err := r.resolveYAML(bytes.NewReader(t)) if err != nil { return "", fmt.Errorf("unable to resolve YAML template %q: %v", templateFile, err) } return string(resolved), nil }
{'content_hash': 'f9f92c90cd7cadb0201bdca85740839d', 'timestamp': '', 'source': 'github', 'line_count': 540, 'max_line_length': 262, 'avg_line_length': 33.97962962962963, 'alnum_prop': 0.7028175922393591, 'repo_name': 'bazelbuild/rules_k8s', 'id': 'a517da4c8ca08052e1a01d4845e8ead37180aab3', 'size': '18349', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'k8s/go/pkg/resolver/resolver.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '2338'}, {'name': 'Go', 'bytes': '22406'}, {'name': 'Makefile', 'bytes': '1209'}, {'name': 'Python', 'bytes': '4286'}, {'name': 'Shell', 'bytes': '14470'}, {'name': 'Smarty', 'bytes': '1816'}, {'name': 'Starlark', 'bytes': '54567'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `SCHED_RR` constant in crate `libc`."> <meta name="keywords" content="rust, rustlang, rust-lang, SCHED_RR"> <title>libc::SCHED_RR - Rust</title> <link rel="stylesheet" type="text/css" href="../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <a href='../libc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a> <p class='location'><a href='index.html'>libc</a></p><script>window.sidebarCurrent = {name: 'SCHED_RR', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='index.html'>libc</a>::<wbr><a class='constant' href=''>SCHED_RR</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-2463' class='srclink' href='../src/libc/unix/notbsd/linux/mod.rs.html#427' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const SCHED_RR: <a class='type' href='../libc/type.c_int.html' title='libc::c_int'>c_int</a><code> = </code><code>2</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../"; window.currentCrate = "libc"; window.playgroundUrl = ""; </script> <script src="../jquery.js"></script> <script src="../main.js"></script> <script defer src="../search-index.js"></script> </body> </html>
{'content_hash': '537364912a862d420b154cc54936e77e', 'timestamp': '', 'source': 'github', 'line_count': 114, 'max_line_length': 196, 'avg_line_length': 37.39473684210526, 'alnum_prop': 0.5055125498475252, 'repo_name': 'rxse/rust-markov-text', 'id': '5f61b75e240de3e1ddceeb5a655ee58c81c33199', 'size': '4273', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/libc/constant.SCHED_RR.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Rust', 'bytes': '3915'}]}
<?php class Column { protected $name; protected $autoIncrement; protected $defaultValue = null; // TODO: current_timestamp public function __construct($name) { $this->name = $name; } public function setAutoIncrement($autoIncrement) { $this->autoIncrement = $autoIncrement; } public function setDefaultValue($defaultValue) { $this->defaultValue = $defaultValue; } public function getName() { return $this->name; } public function isAutoIncrement() { return $this->autoIncrement; } public function convertTo($value) { return $value; } public function convertFrom($value) { return $value; } public function getDefaultValue() { return $this->defaultValue; } }
{'content_hash': 'b06f1cb86d119141cd3a24807d1b0a8c', 'timestamp': '', 'source': 'github', 'line_count': 42, 'max_line_length': 54, 'avg_line_length': 19.404761904761905, 'alnum_prop': 0.6049079754601226, 'repo_name': 'goph-R/MiniPHPFramework', 'id': '8cb4a4c311b26f799de9228a53c874981b5a9e60', 'size': '815', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'components/core/db/column.php', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '10058'}, {'name': 'HTML', 'bytes': '22582'}, {'name': 'JavaScript', 'bytes': '23617'}, {'name': 'PHP', 'bytes': '178240'}]}
// Autogenerated by hob window.cls || (window.cls = {}); cls.HttpLogger || (cls.HttpLogger = {}); cls.HttpLogger["2.0"] || (cls.HttpLogger["2.0"] = {}); cls.HttpLogger["2.0"].Header = function(arr) { /** * An identifier for the request; it is not necessarily unique across * time, as it is just the memory address of the request object. */ this.requestID = arr[0]; /** * The window ID is shared across scope. Notably, it's the same as in the ecmascript debugger. * INTERNAL: The value is from Window::id */ this.windowID = arr[1]; /** * Timestamp of the message, in milliseconds since `1970-01-01 00:00 UTC` * (be sure not to rely on the time being correct - this is client time, and * may be wildly different than the host time) * * Note: Float encoded as string */ this.time = arr[2]; /** * Header of the request/response, i.e. the `HTTP` data up until the first * occurence of `CR+LF+CR+LF`, inclusive. */ this.header = arr[3]; };
{'content_hash': '42fc3d827125e0fe0d4cfe688a72991a', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 97, 'avg_line_length': 31.78125, 'alnum_prop': 0.6283185840707964, 'repo_name': 'runeh/dragonfly-stp-1', 'id': 'cb72b5787ef38a9a756ab5d3c42289a1508e29d3', 'size': '1017', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'classes/httplogger.2.0.events.onresponse.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'JavaScript', 'bytes': '2361916'}, {'name': 'Python', 'bytes': '128456'}, {'name': 'Shell', 'bytes': '40'}]}
#ifndef MOVEMENTSERVICE_H #define MOVEMENTSERVICE_H #ifdef __cplusplus extern "C" { #endif /********************************************************************* * INCLUDES */ #include "st_util.h" /********************************************************************* * CONSTANTS */ // Service UUID #define MOVEMENT_SERV_UUID 0xAA80 #define MOVEMENT_DATA_UUID 0xAA81 #define MOVEMENT_CONF_UUID 0xAA82 #define MOVEMENT_PERI_UUID 0xAA83 // Sensor Profile Services bit fields #define MOVEMENT_SERVICE 0x00000020 // Length of sensor data in bytes #define MOVEMENT_DATA_LEN 18 /********************************************************************* * TYPEDEFS */ /********************************************************************* * MACROS */ /********************************************************************* * API FUNCTIONS */ /* * Movement_addService - Initializes the Sensor GATT Profile service by * registering GATT attributes with the GATT server. */ extern bStatus_t Movement_addService(void); /* * Movement_registerAppCBs - Registers the application callback function. * Only call this function once. * * appCallbacks - pointer to application callbacks. */ extern bStatus_t Movement_registerAppCBs(sensorCBs_t *appCallbacks); /* * Movement_setParameter - Set a Sensor GATT Profile parameter. * * param - Profile parameter ID * len - length of data to write * value - pointer to data to write. This is dependent on * the parameter ID and WILL be cast to the appropriate * data type (example: data type of uint16_t will be cast to * uint16_t pointer). */ extern bStatus_t Movement_setParameter(uint8_t param, uint8_t len, void *value); /* * Movement_getParameter - Get a Sensor GATT Profile parameter. * * param - Profile parameter ID * value - pointer to data to read. This is dependent on * the parameter ID and WILL be cast to the appropriate * data type (example: data type of uint16_t will be cast to * uint16_t pointer). */ extern bStatus_t Movement_getParameter(uint8_t param, void *value); /********************************************************************* *********************************************************************/ #ifdef __cplusplus } #endif #endif /* MOVEMENTSERVICE_H */
{'content_hash': 'ab4a90336457b4a9a71a480d5872ab9e', 'timestamp': '', 'source': 'github', 'line_count': 91, 'max_line_length': 80, 'avg_line_length': 26.86813186813187, 'alnum_prop': 0.52719836400818, 'repo_name': 'irext/irext-examples', 'id': '6adc075a3af2d09e4db8ed10e3530e4f8e726f39', 'size': '4735', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/Profiles/SensorProfile/CC26xx/movementservice.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '43081'}, {'name': 'C', 'bytes': '8276564'}, {'name': 'C++', 'bytes': '719121'}, {'name': 'CMake', 'bytes': '3854'}, {'name': 'Java', 'bytes': '187703'}, {'name': 'JavaScript', 'bytes': '4474'}, {'name': 'Makefile', 'bytes': '702'}, {'name': 'Objective-C', 'bytes': '3309'}, {'name': 'PowerShell', 'bytes': '4751'}]}
layout: default --- <div class="jekmdl-crumbs mdl-color-text--grey-500"> {{ site.title }} &gt; {{ page.title }} </div> <h3 class="page">{{ page.title }}</h3> <h4 class="page mdl-color-text--grey-500">{{ page.description }}</h4> <div class="jekmdl-post-content"> {{ content }} </div>
{'content_hash': '0f535aee20f1fedc0724bead9f8e5591', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 69, 'avg_line_length': 28.3, 'alnum_prop': 0.6325088339222615, 'repo_name': 'pmove/pmove.github.io', 'id': '3d6b81e186600247850e57c02162f0f5a4d910df', 'size': '287', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '_layouts/page.html', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '223528'}, {'name': 'GCC Machine Description', 'bytes': '708'}, {'name': 'HTML', 'bytes': '86842'}, {'name': 'JavaScript', 'bytes': '143303'}, {'name': 'Ruby', 'bytes': '122'}]}
require 'test_helper' class RepacksControllerTest < ActionController::TestCase # test "the truth" do # assert true # end end
{'content_hash': '153015e254c59d23aa6a3f9396ef9322', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 56, 'avg_line_length': 19.142857142857142, 'alnum_prop': 0.7238805970149254, 'repo_name': 'mumaoxi/super_pack', 'id': '2b1c102599808aed2c8db250dce0b8870106c74a', 'size': '134', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/controllers/repacks_controller_test.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '40086'}, {'name': 'HTML', 'bytes': '22265'}, {'name': 'JavaScript', 'bytes': '45481'}, {'name': 'Ruby', 'bytes': '51307'}]}
import Vue, { PluginObject } from 'vue'; import { Component } from 'vue-property-decorator'; import { INTEGERFIELD_NAME } from '../component-names'; import IntegerfieldPlugin from './integerfield'; import WithRender from './integerfield.sandbox.html'; @WithRender @Component export class MIntegerfieldSandbox extends Vue { public model1: number = 2; public model2: number = 0; public model3: number = 3; public model4: number = 5; public definedModel: any = ''; get isNumber(): boolean { return (typeof this.model1 === 'number'); } } const IntegerfieldSandboxPlugin: PluginObject<any> = { install(v, options): void { v.use(IntegerfieldPlugin); v.component(`${INTEGERFIELD_NAME}-sandbox`, MIntegerfieldSandbox); } }; export default IntegerfieldSandboxPlugin;
{'content_hash': 'fe8ea748e7bf8bb99c3009e095dd4b09', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 74, 'avg_line_length': 27.466666666666665, 'alnum_prop': 0.691747572815534, 'repo_name': 'ulaval/modul-components', 'id': '702b435b0b5fb43f154ee5a739fdce24b7c73b2a', 'size': '824', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'src/components/integerfield/integerfield.sandbox.ts', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '3055'}, {'name': 'CSS', 'bytes': '273104'}, {'name': 'Groovy', 'bytes': '2030'}, {'name': 'HTML', 'bytes': '460968'}, {'name': 'JavaScript', 'bytes': '21149'}, {'name': 'TypeScript', 'bytes': '2028431'}]}
namespace BodeAbp.Zero.Organizations.Domain { /// <summary> /// This interface is implemented entities those may have an <see cref="OrganizationUnit"/>. /// </summary> public interface IMayHaveOrganizationUnit { /// <summary> /// <see cref="OrganizationUnit"/>'s Id which this entity belongs to. /// Can be null if this entity is not related to any <see cref="OrganizationUnit"/>. /// </summary> long? OrganizationUnitId { get; set; } } }
{'content_hash': 'bbd0bd41bb15544ee013f81fedb0a29c', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 96, 'avg_line_length': 35.92857142857143, 'alnum_prop': 0.6282306163021869, 'repo_name': 'liuxx001/BodeAbp', 'id': 'acab0827579e1a4b94e2db3e50e056eb9ca85db1', 'size': '505', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/modules/BodeAbp.Zero/Organizations/Domain/IMayHaveOrganizationUnit.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '3157'}, {'name': 'C#', 'bytes': '2877453'}, {'name': 'CSS', 'bytes': '184470'}, {'name': 'HTML', 'bytes': '100338'}, {'name': 'JavaScript', 'bytes': '4167408'}]}
.. This file is automatically generated. Do not edit this file directly. Google Cloud Video Intelligence API Python Samples =============================================================================== .. image:: https://gstatic.com/cloudssh/images/open-btn.png :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=video/cloud-client/quickstart/README.rst This directory contains samples for Google Cloud Video Intelligence API. `Google Cloud Video Intelligence API`_ allows developers to easily integrate feature detection in video. .. _Google Cloud Video Intelligence API: https://cloud.google.com/video-intelligence/docs Setup ------------------------------------------------------------------------------- Authentication ++++++++++++++ This sample requires you to have authentication setup. Refer to the `Authentication Getting Started Guide`_ for instructions on setting up credentials for applications. .. _Authentication Getting Started Guide: https://cloud.google.com/docs/authentication/getting-started Install Dependencies ++++++++++++++++++++ #. Clone python-docs-samples and change directory to the sample directory you want to use. .. code-block:: bash $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git #. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup #. Create a virtualenv. Samples are compatible with Python 3.6+. .. code-block:: bash $ virtualenv env $ source env/bin/activate #. Install the dependencies needed to run the samples. .. code-block:: bash $ pip install -r requirements.txt .. _pip: https://pip.pypa.io/ .. _virtualenv: https://virtualenv.pypa.io/ Samples ------------------------------------------------------------------------------- quickstart +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. image:: https://gstatic.com/cloudssh/images/open-btn.png :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=video/cloud-client/quickstart/quickstart.py,video/cloud-client/quickstart/README.rst To run this sample: .. code-block:: bash $ python quickstart.py The client library ------------------------------------------------------------------------------- This sample uses the `Google Cloud Client Library for Python`_. You can read the documentation for more details on API usage and use GitHub to `browse the source`_ and `report issues`_. .. _Google Cloud Client Library for Python: https://googlecloudplatform.github.io/google-cloud-python/ .. _browse the source: https://github.com/GoogleCloudPlatform/google-cloud-python .. _report issues: https://github.com/GoogleCloudPlatform/google-cloud-python/issues .. _Google Cloud SDK: https://cloud.google.com/sdk/
{'content_hash': '0a24f8df5f22b3297cd5c77f921b07ce', 'timestamp': '', 'source': 'github', 'line_count': 113, 'max_line_length': 240, 'avg_line_length': 28.47787610619469, 'alnum_prop': 0.6488502175264139, 'repo_name': 'googleapis/python-videointelligence', 'id': 'e6b3904fdc858cde79561960012f27e1934643e6', 'size': '3219', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'samples/quickstart/README.rst', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '2050'}, {'name': 'Python', 'bytes': '1096190'}, {'name': 'Shell', 'bytes': '30693'}]}
package com.hotcloud.model; import javax.persistence.Column; import javax.persistence.Id; import java.io.Serializable; public class ResAreaNlljPK implements Serializable { private String dateline; private double areaguid; @Column(name = "dateline", nullable = false, length = 50) @Id public String getDateline() { return dateline; } public void setDateline(String dateline) { this.dateline = dateline; } @Column(name = "areaguid", nullable = false, precision = 0) @Id public double getAreaguid() { return areaguid; } public void setAreaguid(double areaguid) { this.areaguid = areaguid; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ResAreaNlljPK that = (ResAreaNlljPK) o; if (Double.compare(that.areaguid, areaguid) != 0) return false; if (dateline != null ? !dateline.equals(that.dateline) : that.dateline != null) return false; return true; } @Override public int hashCode() { int result; long temp; result = dateline != null ? dateline.hashCode() : 0; temp = Double.doubleToLongBits(areaguid); result = 31 * result + (int) (temp ^ (temp >>> 32)); return result; } }
{'content_hash': '0dba36fa09396b3099af45fe9734af90', 'timestamp': '', 'source': 'github', 'line_count': 53, 'max_line_length': 101, 'avg_line_length': 25.943396226415093, 'alnum_prop': 0.6152727272727273, 'repo_name': 'shizicheng/spring_mvc_template', 'id': '8bb7bbb1d76c703db72f15fad2c4fcfa8a7b7158', 'size': '1375', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/hotcloud/model/ResAreaNlljPK.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '1722800'}]}
module Registrar::SessionsHelper def sign_in_path path = "/auth/google" if Registrar.configuration&.state "#{path}?state=#{Registrar.configuration.state}" else path end end def sign_in(user) session[session_key] = session_manager_class.session_id(user) cookies.encrypted[session_key] = session_manager_class.session_id(user) if with_user_cookie? current_user = user end def signed_in? current_user.present? end def sign_out session[session_key] = nil session[:target] = nil cookies.encrypted[session_key] = nil if with_user_cookie? current_user = nil end def current_user=(user) @current_user = user end def current_user @current_user ||= session_manager_class.find_by_session_id(session[session_key]) end private def require_signed_in_user unless signed_in? session[:target] = request.fullpath redirect_to registrar.signin_path end end def with_user_cookie? @_with_user_cookie ||= Registrar.configuration.with_user_cookie end def session_manager_class Registrar.configuration.session_manager_class end def session_key Registrar.configuration.session_key end end
{'content_hash': 'f3efd3cc00b55c2500f825359a4055f7', 'timestamp': '', 'source': 'github', 'line_count': 58, 'max_line_length': 96, 'avg_line_length': 20.982758620689655, 'alnum_prop': 0.6877567789646672, 'repo_name': 'procore/registrar', 'id': '5b73b935d43de1036d3c0e09215b0b73ad800c3e', 'size': '1217', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/helpers/registrar/sessions_helper.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '686'}, {'name': 'HTML', 'bytes': '364'}, {'name': 'JavaScript', 'bytes': '596'}, {'name': 'Ruby', 'bytes': '36879'}]}
const DEFAULT_COLOR = "000000" const DEFAULT_BOLD = false const DEFAULT_SHOW_COPY = false const DEFAULT_COPY_PREFIX = "" const DEFAULT_COPY_SEP = ", " const DEFAULT_COPY_SUFFIX = "" function save_options() { var bold = document.getElementById('bold').checked; var color = document.getElementById('id-color').value; var copy = document.getElementById('show-copy').checked; var pref = document.getElementById('copy-prefix').value; var sep = document.getElementById('copy-sep').value; var suff = document.getElementById('copy-suffix').value; chrome.storage.sync.set({ boldId: bold, idColor: color, showCopy: copy, copyPrefix: pref, copySep: sep, copySuffix: suff }, function() { window.close(); }); } function reset_defaults() { document.getElementById('bold').checked = DEFAULT_BOLD; document.getElementById('show-copy').checked = DEFAULT_SHOW_COPY; document.getElementById('id-color').color.fromString("#"+DEFAULT_COLOR); document.getElementById('copy-prefix').value = DEFAULT_COPY_PREFIX; document.getElementById('copy-sep').value = DEFAULT_COPY_SEP; document.getElementById('copy-suffix').value = DEFAULT_COPY_SUFFIX; } function restore_options() { chrome.storage.sync.get({ boldId: DEFAULT_BOLD, showCopy: DEFAULT_SHOW_COPY, idColor: DEFAULT_COLOR, copyPrefix: DEFAULT_COPY_PREFIX, copySep: DEFAULT_COPY_SEP, copySuffix: DEFAULT_COPY_SUFFIX }, function(items) { document.getElementById('bold').checked = items.boldId; document.getElementById('show-copy').checked = items.showCopy; document.getElementById('id-color').color.fromString(items.idColor); document.getElementById('copy-prefix').value = items.copyPrefix; document.getElementById('copy-sep').value = items.copySep; document.getElementById('copy-suffix').value = items.copySuffix; }); } document.addEventListener('DOMContentLoaded', restore_options); document.getElementById('save').addEventListener('click', save_options); document.getElementById('defaults').addEventListener('click', reset_defaults);
{'content_hash': '7941477b019e6edbe8f0a0aa570e4829', 'timestamp': '', 'source': 'github', 'line_count': 56, 'max_line_length': 78, 'avg_line_length': 38.964285714285715, 'alnum_prop': 0.692025664527956, 'repo_name': 'dewyze/trello-card-numbers', 'id': '04d4afcf3a2e4adf50b755d5d719727463263950', 'size': '2182', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'options.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '3072'}, {'name': 'JavaScript', 'bytes': '41807'}]}
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{'content_hash': '1c652ecf7a58659640c71634992771fd', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': 'ea449f8f763d6c6cffd60435c5b31199ae5f34e0', 'size': '171', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Pteridophyta/Polypodiopsida/Cyatheales/Cyatheaceae/Alsophila/Alsophila vexans/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
Collection of helpful shell scripts ## make_apache_hosts Automatic hosts generation for apache. Search directories like `somename.dev` and creates a host file. Can detect web or www root directory. Supports parser, [official site](http://parser.ru) ### Usage ``` sudo ~/path_to_bin/make_apache_hosts.sh ```
{'content_hash': 'c4ffe624da56e6f905d12612987c71ca', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 77, 'avg_line_length': 23.846153846153847, 'alnum_prop': 0.7516129032258064, 'repo_name': 'ln-e/bin', 'id': '869cdbd13a6d429d78ac74b6dea6f2917fb661d0', 'size': '328', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Shell', 'bytes': '2337'}]}
package org.spincast.plugins.jdbc; import java.sql.Connection; import org.spincast.plugins.jdbc.statements.BatchInsertStatement; import org.spincast.plugins.jdbc.statements.DeleteStatement; import org.spincast.plugins.jdbc.statements.InsertStatement; import org.spincast.plugins.jdbc.statements.SelectStatement; import org.spincast.plugins.jdbc.statements.UpdateStatement; public interface JdbcStatementFactory { /** * Creates a Select statement. */ public SelectStatement createSelectStatement(Connection connection); /** * Creates an Insert statement. */ public InsertStatement createInsertStatement(Connection connection); /** * Creates an Batch Insert statement. */ public BatchInsertStatement createBatchInsertStatement(Connection connection); /** * Creates an Update statement. */ public UpdateStatement createUpdateStatement(Connection connection); /** * Creates an Delete statement. */ public DeleteStatement createDeleteStatement(Connection connection); }
{'content_hash': '952bbc2bdc5286769d12592dfd640308', 'timestamp': '', 'source': 'github', 'line_count': 39, 'max_line_length': 82, 'avg_line_length': 27.307692307692307, 'alnum_prop': 0.752112676056338, 'repo_name': 'spincast/spincast-framework', 'id': '979deee14df33008b01531fdd1407da263732e98', 'size': '1065', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spincast-plugins/spincast-plugins-jdbc-parent/spincast-plugins-jdbc/src/main/java/org/spincast/plugins/jdbc/JdbcStatementFactory.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '40884'}, {'name': 'HTML', 'bytes': '1573425'}, {'name': 'Java', 'bytes': '5355717'}, {'name': 'JavaScript', 'bytes': '113097'}, {'name': 'Shell', 'bytes': '6315'}]}
import React, { Component } from 'react'; import { ActivityIndicator, ListView, Text, View } from 'react-native'; export default class MoviesComponent extends Component { state = { isLoading: true, clonedMovies: [] }; componentDidMount() { fetch('https://facebook.github.io/react-native/movies.json') .then(response => response.json()) .then(responseJson => { const standardDataSource = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }); /* const movies = [ { title: 'Star Wars', releaseYear: '1977' }, { title: 'The Matrix', releaseYear: '1999' } ]; clonedMovies = standardDataSource.cloneWithRows(movies); */ this.setState({ isLoading: false, clonedMovies: standardDataSource.cloneWithRows(responseJson.movies) }); }); } render() { console.log('1. Getting data'); if (this.state.isLoading) { return ( <View> <ActivityIndicator /> </View> ); } console.log('2. Already get data'); return ( <View style={{ flex: 1, paddingTop: 30 }}> <ListView dataSource={this.state.clonedMovies} renderRow={rowData => ( <Text> Title: {rowData.title}, release year: {rowData.releaseYear} </Text> )} /> </View> ); } }
{'content_hash': '6ab2cfa6498a5502420156abf5e778fe', 'timestamp': '', 'source': 'github', 'line_count': 61, 'max_line_length': 77, 'avg_line_length': 24.75409836065574, 'alnum_prop': 0.519205298013245, 'repo_name': 'KyoungRan/react-native-ex-NDH', 'id': '2062f97cd62632ec0a81a146840487becf55e678', 'size': '1510', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'rn-12-SendGETrequestNfetchToListView.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '20934'}]}