query stringlengths 7 9.55k | document stringlengths 10 363k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102 values |
|---|---|---|---|---|---|---|
autofocus on minute text; fetch draft | def mounted()
@draft = ''
jQuery('#draft-minute-form').on 'shown.bs.modal' do
retrieve "draft/#{Agenda.title.gsub('-', '_')}", :text do |draft|
document.getElementById("draft-minute-text").focus()
@disabled = false
@draft = draft
jQuery('#draft-minute-text').animate(scrollTop: 0)
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def beginning_minute=(string)\n frm.select(:id=>\"release_minute\").select(string)\n end",
"def fill_in_date_time(field, with:)\n # date time picker can't be found by label\n # so we need to find it by input id\n input_id = page.find('label', text: field)['for']\n input = find_field(input_id)\n ... | [
"0.57386553",
"0.5310579",
"0.5194729",
"0.509426",
"0.5073351",
"0.5069829",
"0.50524896",
"0.5026007",
"0.50083077",
"0.4998745",
"0.49654967",
"0.49612442",
"0.49606293",
"0.49588794",
"0.49526522",
"0.4944988",
"0.49101463",
"0.4887629",
"0.4876456",
"0.4876456",
"0.48532... | 0.5791769 | 0 |
Return true if the value is in the tree, return false otherwise. | def search(find_val)
false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contains? (value)\n return false if @size == 0\n if @root.value == value\n \t\treturn true\n \tend\n \tnode=@root.next_node\n while(node!=nil)\n if node.value == value\n \treturn true\n end\n node=node.next_node\n end\n return false\n end",
"def include?(val... | [
"0.77055067",
"0.7561729",
"0.7557759",
"0.7523773",
"0.75091463",
"0.74652106",
"0.7330142",
"0.7296886",
"0.7292048",
"0.72914565",
"0.72521544",
"0.72453165",
"0.72388685",
"0.7218022",
"0.7180739",
"0.7054619",
"0.7052635",
"0.7047752",
"0.7031639",
"0.70187503",
"0.69667... | 0.0 | -1 |
Print out all tree nodes as they are visited in a preorder traversal. | def print_tree
''
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preorder_print(start, traversal)\n traversal\n end",
"def preorder_traversal(node=@root)\n return if (node == nil)\n preorder_traversal(node.left)\n preorder_traversal(node.right)\n puts node.value.to_s\n end",
"def preorder(node)\n # 1->2->4->5->3->6\n if node\n print node.valu... | [
"0.7534696",
"0.7330272",
"0.72936255",
"0.72645223",
"0.7237396",
"0.7166674",
"0.7011984",
"0.6990271",
"0.69566",
"0.6876235",
"0.6861882",
"0.6857561",
"0.6857505",
"0.6827987",
"0.6784903",
"0.67804146",
"0.677473",
"0.6700682",
"0.6560901",
"0.6560226",
"0.655841",
"0... | 0.6463592 | 28 |
Helper method use this to create a recursive search solution. | def preorder_search(start, find_val)
false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recursive_solution\n\n end",
"def recursive => nil",
"def recursive_search(path,current_depth)\n # If we haven't hit our max depth\n if current_depth < @depth \n sub_hash = @wiki\n # Follow our path down the hash\n path.each do |node|\n sub_hash = sub_hash[node]\n end\n\n # Expand th... | [
"0.718056",
"0.6937702",
"0.65080714",
"0.6427719",
"0.6426785",
"0.63000536",
"0.6122079",
"0.6054899",
"0.601959",
"0.5995331",
"0.5932973",
"0.5908785",
"0.58890814",
"0.5884935",
"0.5884047",
"0.58561194",
"0.58171386",
"0.5813582",
"0.5811641",
"0.5771825",
"0.5758444",
... | 0.0 | -1 |
Helper method use this to create a recursive print solution. | def preorder_print(start, traversal)
traversal
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recursive_print(array)\n\nend",
"def recursive_print(result=\"\", node=@head)\n\t\tif node.nil?\n\t\t\treturn result\n\t\tend \n\t\tresult += node.data\n\t\tif node.next \n\t\t\tresult += \" > \"\n\t\tend \n\t\trecursive_print(result, node.next)\n\tend",
"def printout\n\t\t\n\t\tindex = 0\n\t\t\n\t\tdef sm... | [
"0.77244544",
"0.7155743",
"0.7146073",
"0.70287025",
"0.68105376",
"0.6796006",
"0.6752244",
"0.6714344",
"0.66835916",
"0.6529089",
"0.6493609",
"0.6486903",
"0.6446816",
"0.64244366",
"0.64244366",
"0.6413528",
"0.63938963",
"0.63687193",
"0.63686424",
"0.6367435",
"0.6351... | 0.59771025 | 68 |
sort small items ascending by how many will fit with a large item | def compare(x,y)
a = CachedProduct.find_by_product_id(x['product_id'].to_s)
b = CachedProduct.find_by_product_id(y['product_id'].to_s)
return a.max_small <=> b.max_small
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bigSorting(unsorted)\n\nend",
"def sort_by_size(x,y)\n sizes = [\"Small\",\"Medium\",\"Large\",\"X-Large\",\"2X-Large\",\"3X-Large\"]\n cmp = sizes.index(x.tshirt) <=> sizes.index(y.tshirt)\n if cmp == 0\n x.name <=> y.name\n else\n cmp\n end\n end",
"def sort(companies)\n comp... | [
"0.6898534",
"0.64034766",
"0.63646644",
"0.6254244",
"0.6185378",
"0.6076496",
"0.59749776",
"0.5968773",
"0.5958477",
"0.5916909",
"0.59013885",
"0.5894115",
"0.5873949",
"0.57729805",
"0.57664263",
"0.5750422",
"0.57351613",
"0.5695349",
"0.56888324",
"0.5680713",
"0.56766... | 0.0 | -1 |
Accepts a parameters hash or another of the same class. If another instance of the same class is passed in then the parameters are copied to the new object. | def initialize(parameters={})
@type_conversion_errors = {}
set_parameters parameters
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def params=(hash); end",
"def params=(hash); end",
"def new_from_hash(hash)\n if hash == nil\n self.class.new.assign(self)\n else\n hash_obj = hash\n if hash.instance_of?(Hash)\n hash_obj = self.class.new\n merge_hash_into_object(hash, hash_obj)\n end\n instance = s... | [
"0.6601934",
"0.6601934",
"0.6557284",
"0.65064853",
"0.6406723",
"0.6403846",
"0.63889104",
"0.63269687",
"0.6313085",
"0.6272679",
"0.62692386",
"0.61685216",
"0.61587554",
"0.6140623",
"0.6124891",
"0.6102984",
"0.60734504",
"0.60636324",
"0.603781",
"0.5990681",
"0.596461... | 0.0 | -1 |
Executes the command by calling the method +execute+ if the validations pass. | def call(&block)
execute(&block) if valid?
execution_attempted!
self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_execute\n unless executed?\n execute\n end\n end",
"def execute\n begin\n return false unless check_guards\n execute_actions\n rollback_actions unless self.failed_action.nil?\n self.failed_action.nil?\n ensure\n self.save!\n end\n end",
"def vali... | [
"0.7264249",
"0.6978162",
"0.6307153",
"0.62791103",
"0.62602055",
"0.62602055",
"0.6254302",
"0.61683196",
"0.61567825",
"0.61552805",
"0.6111375",
"0.60871834",
"0.6076937",
"0.60015976",
"0.594665",
"0.593224",
"0.59228283",
"0.59144056",
"0.59117585",
"0.5905796",
"0.5903... | 0.57148004 | 33 |
Performs the actual command execution. It does not test if the command parameters are valid. Typically, +call+ should be called instead of calling +execute+ directly. +execute+ should be overridden in descendent classes | def execute
yield self if block_given?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execute\n raise NotImplementedError, 'Define `execute` in Command subclass'\n end",
"def execute\n parse_command\n run_command(command)\n end",
"def execute_command command_text\r\n #TODO: really, what is point of this \"convenience\" method!?\r\n ... | [
"0.77980447",
"0.7369215",
"0.71588427",
"0.7023105",
"0.69770896",
"0.69690865",
"0.696494",
"0.6884163",
"0.6870792",
"0.68640685",
"0.68640685",
"0.6844841",
"0.68096685",
"0.6802588",
"0.6795699",
"0.6784722",
"0.6753237",
"0.67511535",
"0.6734613",
"0.671731",
"0.6706360... | 0.0 | -1 |
Record that an attempt was made to execute this command whether or not it was successful. | def execution_attempted! #:nodoc:
@execution_attempted = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_successful_execution(cmd)\n @commands << cmd\n end",
"def succeed!\n self.success = true\n self\n end",
"def execute\n begin\n return false unless check_guards\n execute_actions\n rollback_actions unless self.failed_action.nil?\n self.failed_action.... | [
"0.6744505",
"0.6358301",
"0.6345598",
"0.63297653",
"0.6318208",
"0.62229633",
"0.6206643",
"0.6139654",
"0.61036855",
"0.6089372",
"0.60835266",
"0.6078316",
"0.6036439",
"0.59802395",
"0.59462726",
"0.59462726",
"0.59462726",
"0.59462726",
"0.59462726",
"0.59462726",
"0.59... | 0.72476405 | 0 |
True if execution has been attempted on this command | def execution_attempted?
@execution_attempted
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execution_attempted! #:nodoc:\n @execution_attempted = true\n end",
"def success?\n execution_attempted? && errors.empty?\n end",
"def check_execute\n unless executed?\n execute\n end\n end",
"def was_executed?\n execution_count > 0\n end",
"def executed?... | [
"0.7831649",
"0.7752585",
"0.7413956",
"0.7404941",
"0.73951423",
"0.7382643",
"0.7374486",
"0.7361519",
"0.7302127",
"0.7281738",
"0.7263574",
"0.71961886",
"0.69499964",
"0.6949619",
"0.6944002",
"0.69339454",
"0.6927709",
"0.69122976",
"0.69026864",
"0.6850913",
"0.6821138... | 0.82137465 | 0 |
Command has been executed without errors | def success?
execution_attempted? && errors.empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execute_command(command)\n end",
"def execute_command(command)\n end",
"def process; raise CommandError, \"command '#{command_name}' not implemented\" end",
"def execute(command)\n end",
"def execute(command) # rubocop:disable Lint/UnusedMethodArgument\n end",
"def command_fou... | [
"0.7556733",
"0.7556733",
"0.7535264",
"0.74686235",
"0.74166733",
"0.7223935",
"0.71668905",
"0.7041987",
"0.6988358",
"0.6974575",
"0.6974575",
"0.6974575",
"0.6974575",
"0.6974575",
"0.6974575",
"0.69261885",
"0.68849635",
"0.6884021",
"0.68041176",
"0.67573965",
"0.675555... | 0.0 | -1 |
Returns hash of all parameter names and values | def parameters
self.class.parameters.each_with_object({}) do |parameter, hash|
hash[parameter.name] = send(parameter.name)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_hash\n rethash = {}\n\n @parameters.each do |name, obj|\n rethash[name] = obj.value\n end\n\n rethash\n end",
"def params_to_hash\n {}\n end",
"def hashParameters params\n\n\t# Create a temp array\n\tparameters = []\n\n\t# Load each element into a one dimensional array\n\tp... | [
"0.76836854",
"0.7185262",
"0.71627903",
"0.7062407",
"0.69175506",
"0.6837775",
"0.67541045",
"0.6751691",
"0.67164475",
"0.6703607",
"0.6663427",
"0.6662047",
"0.6658911",
"0.665877",
"0.665613",
"0.66551304",
"0.66337407",
"0.6594281",
"0.65910405",
"0.65458107",
"0.654426... | 0.7170237 | 2 |
Sets parameter(s) from hash or instance of same class | def set_parameters(hash_or_instance)
parameters = extract_parameters_from_hash_or_instance(hash_or_instance)
parameters.each do |k,v|
send "#{k}=", v
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def params=(hash); end",
"def params=(hash); end",
"def set_params(hash)\n hash.each do |k,v|\n set_param(k, v)\n end\n end",
"def set_params!(param_hash={})\n param_hash.each { |k,v| @set_params[k.to_s] = v }\n end",
"def params=(hash)\n @params.replace hash\n end",
"def ... | [
"0.8115054",
"0.8115054",
"0.7277464",
"0.7253688",
"0.70757085",
"0.7006766",
"0.69906765",
"0.6957718",
"0.69406515",
"0.69389117",
"0.69149536",
"0.6862134",
"0.6850725",
"0.6740736",
"0.67055976",
"0.6703485",
"0.6703485",
"0.668554",
"0.6683647",
"0.6654948",
"0.6647649"... | 0.8123604 | 0 |
overriding this to make typecasting errors run at the end so they will not run if there is already an error on the column. Otherwise, when typecasting to an integer and using validates_numericality_of two errors will be generated. | def run_validations!
super
include_typecasting_errors
errors.empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enforce_integer_columns(options = {})\n # first get the non-integers\n options[:allow_nil] = true\n args = build_validation_args(options, :numeric, :not_a_number)\n validates_numericality_of(*args) unless args.first.is_a? Hash\n # now do the integers\n opti... | [
"0.62341934",
"0.6137441",
"0.61186206",
"0.60855174",
"0.6074752",
"0.5979723",
"0.59003586",
"0.58968014",
"0.5843285",
"0.55938995",
"0.5574281",
"0.55639166",
"0.55636966",
"0.55614865",
"0.5551228",
"0.55384344",
"0.5434551",
"0.54299635",
"0.5427072",
"0.53972936",
"0.5... | 0.6920223 | 0 |
=> 100 Compare it to a method | def square_it_method(num)
num * num
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def my_method\n 100\nend",
"def my_method\n 100\nend",
"def method_missing(method, *args, &block)\n if match = /has_less_([#{ROMAN_CHARS}])_than/.match(method.to_s)\n raise ERROR_ILLEGAL_COMPARISON unless args[0].is_a?(RomanNumeral)\n char = match[0]\n self.count(char) < args[0].count(char)... | [
"0.61974514",
"0.61974514",
"0.607814",
"0.6030998",
"0.5880611",
"0.58063346",
"0.57334423",
"0.55957216",
"0.55652666",
"0.55605483",
"0.5552397",
"0.5527076",
"0.5523094",
"0.551149",
"0.5503446",
"0.5500505",
"0.54954743",
"0.547477",
"0.54687715",
"0.5461989",
"0.5454511... | 0.0 | -1 |
=> 2 They keep the environment they were defined in even if they get passed into a new scope. | def invoke_10_times(proc)
10.times { proc.call }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scope=(_); end",
"def scope\n @env.unshift({})\n begin\n yield\n ensure\n @env.shift\n raise \"You went too far unextending env\" if @env.empty?\n end\n end",
"def global_scope; @scope = :global end",
"def original_env; end",
"def scope=(_arg0); end",
"def ... | [
"0.7532797",
"0.73215175",
"0.7111272",
"0.7107934",
"0.7086285",
"0.7086285",
"0.7086285",
"0.6886559",
"0.68244743",
"0.6819675",
"0.6788115",
"0.6788115",
"0.6778643",
"0.6778643",
"0.6778643",
"0.6778643",
"0.6778643",
"0.6778643",
"0.6778643",
"0.6778643",
"0.6778643",
... | 0.0 | -1 |
=> [0, 0, 0] A return statement in a method will from return it. But a return statement in a proc will return from the enclosing environment. | def first_even(nums)
nums.each do |num|
return num if num.even?
end
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ret_proc \n proc = Proc.new { return \"a return from inside the proc returns not only from the proc, but the enclosing method itself, unlike a lambda.\"}\n proc.call\n return \"returning from inside the method\"\n end",
"def proc_method\n\tproc_a = proc { |x| return x }\n\tproc_a.call(@expected_proc_r... | [
"0.73771155",
"0.72552615",
"0.7227902",
"0.72194076",
"0.7163516",
"0.69786584",
"0.6923454",
"0.6870602",
"0.6864693",
"0.6841951",
"0.67418003",
"0.64833295",
"0.64774376",
"0.643799",
"0.6407039",
"0.63979274",
"0.63753575",
"0.6331847",
"0.6317847",
"0.62996584",
"0.6280... | 0.0 | -1 |
=> 4 END /Users/joekelly/Desktop/Projects/rubykickstart/session3/notes/12allmethodstakeblocks.rb file content is listed below When you pass a block as a parameter, the block gets put into a special slot that every method has, whether they use the block or not. | def method
"result"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def meth5(&block)\n p block_given?\nend",
"def blocks; end",
"def blocks; end",
"def blocks; end",
"def block_method\nputs \"called outside block in block_method\"\n#add method, to check if there is a block on this method\nyield if block_given? #predicate method, it have question mark on end\nputs \"now w... | [
"0.71319723",
"0.70815116",
"0.70815116",
"0.70815116",
"0.6990421",
"0.69389415",
"0.67893296",
"0.6710025",
"0.66607285",
"0.66607285",
"0.66607285",
"0.66607285",
"0.66607285",
"0.66607285",
"0.66607285",
"0.66607285",
"0.66607285",
"0.66607285",
"0.66607285",
"0.66607285",
... | 0.0 | -1 |
=> "result" To access the block, use the ampersand, this will give it to you as a proc that you can use. | def method2(&block)
block.call.upcase
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_result(&block)\n result_from_block = block.call()\n puts result_from_block\nend",
"def print_block_result\n block_result = yield\n puts block_result\nend",
"def call_this_block\n # We pass in \"foo\" to yield so that the block gets passed an argument\n block_result = yield \"foo\" # Our block r... | [
"0.83746505",
"0.7472951",
"0.7466359",
"0.7367184",
"0.7209052",
"0.71555483",
"0.70872974",
"0.7072907",
"0.7070369",
"0.6999323",
"0.69947344",
"0.69822556",
"0.69794375",
"0.6930716",
"0.6930716",
"0.69219875",
"0.6890503",
"0.68735236",
"0.68534166",
"0.6840207",
"0.6812... | 0.0 | -1 |
=> "FROM THE BLOCK" If you didn't pass a block, it will be set to nil. | def method3(&block)
if block
"The block evaluates to #{block.call}"
else
"No block."
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def i_take_an_explicit_block &block\n puts block.inspect\nend",
"def test(&block)\n puts \"&block is, #{block}\"\nend",
"def say_hello(&block)\n puts \"Hello world\"\n name = block.call\n puts \"You entered #{name} as your name\"\nend",
"def foo(name, &block)\n @name = name\n block.call\nend",
"... | [
"0.7019481",
"0.67750156",
"0.6581044",
"0.65415",
"0.6520881",
"0.6520881",
"0.6465057",
"0.64577085",
"0.642351",
"0.64012444",
"0.63811153",
"0.6380705",
"0.6380705",
"0.6369575",
"0.63544786",
"0.63544786",
"0.6345151",
"0.6335273",
"0.6327338",
"0.6309016",
"0.6309016",
... | 0.6354309 | 17 |
=> "No block." Like with any proc, you can pass arguments to it | def heres_six(&block)
block.call 6
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def block=(_arg0); end",
"def block=(_arg0); end",
"def i_take_an_explicit_block &block\n puts block.inspect\nend",
"def procasaurus( &block )\n\tputs \"I am a procasaurus.\"\n\tputs block.class\n\t# note the proc must be the last parameter and must start with ampersand\nend",
"def run_block\n p = Pro... | [
"0.72313964",
"0.72313964",
"0.7140519",
"0.70442486",
"0.70355284",
"0.69677824",
"0.69375116",
"0.6933717",
"0.69218796",
"0.6908883",
"0.69050735",
"0.68803877",
"0.68542194",
"0.68542194",
"0.68109304",
"0.6784242",
"0.6777631",
"0.6760261",
"0.67583543",
"0.6757766",
"0.... | 0.0 | -1 |
=> "12 is Josh's favourite number" END /Users/joekelly/Desktop/Projects/rubykickstart/session3/notes/13differencebetweenblocksyntaxes.rb file content is listed below | def block_checker(array, &block)
[array.to_a, !!block]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def charm_failure\n slowly do\n\"\"\"\nDuncan barks, wags his tail, rolls over, does all his awesome tricks...\n\nBut the troll just looks on in disdain. \n\n'Go home, little dog, before I sqquish you.' \n\"\"\"\n end\n what_next\n end",
"def extract_code_blocks\n body.match /```([a-z]+)?\\n(.*)\\... | [
"0.6595406",
"0.6283895",
"0.6174429",
"0.6144977",
"0.61133885",
"0.6031825",
"0.59627444",
"0.59163",
"0.59163",
"0.590397",
"0.5889747",
"0.58800983",
"0.58523667",
"0.585213",
"0.58411056",
"0.58222455",
"0.58203346",
"0.5818648",
"0.5812686",
"0.58012456",
"0.57892275",
... | 0.0 | -1 |
=> "23: study :(" END /Users/joekelly/Desktop/Projects/rubykickstart/session3/notes/15forwardingblocks.rb file content is listed below Another common thing is to forward blocks to other methods | def meth1(&block)
"(meth1: #{block.call})"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def block_eg1(cutblock)\n puts \"this is the first message from 1 \"\n cutblock.call\n puts \"this is the middle message\"\n cutblock.call\n puts \"this is the last\\n\\n\"\nend",
"def log block_description, &block\n puts $space*$nesting_depth + 'Beginning \"'+block_description+'\" ...'\n $nesting_de... | [
"0.650154",
"0.61886084",
"0.61757696",
"0.61757696",
"0.61757696",
"0.6162162",
"0.6117942",
"0.59934926",
"0.5955436",
"0.59343284",
"0.59130865",
"0.5893949",
"0.58860874",
"0.58098376",
"0.58098376",
"0.575122",
"0.57492626",
"0.5723304",
"0.57169354",
"0.5715587",
"0.571... | 0.56079566 | 56 |
Use the & notation when calling a method to put a block into the method's block slot. | def meth2(&block)
"#{meth1(&block)} (meth2: #{block.call})"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def my_method(&my_block)\n\n puts \"hello method\"\n\n my_block.call\n\n return my_block\n\nend",
"def test(&block)\n puts \"&block is, #{block}\"\nend",
"def my_method(&my_block)\n\tputs \"We're in the method, about to invoke your block!\"\n\tmy_block.call\n\tputs \"We're back in the method!\"\nend"... | [
"0.7573938",
"0.7548392",
"0.75375235",
"0.7513926",
"0.74356765",
"0.73322695",
"0.73322695",
"0.72596854",
"0.71670455",
"0.7054961",
"0.6978364",
"0.697778",
"0.6921715",
"0.6912085",
"0.68967754",
"0.6886171",
"0.6822572",
"0.6808932",
"0.6804089",
"0.67838067",
"0.674873... | 0.64310145 | 51 |
=> "(meth1: 10) (meth2: 20)" END /Users/joekelly/Desktop/Projects/rubykickstart/session3/notes/16optionalparams.rb file content is listed below You have already seen ordinal parameters, they have a name and are mandatory. But you can make them optional by giving them an equal sign, and listing a default value. | def same_case(str, upcase = true)
return str.upcase if upcase
str.downcase
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def meth(\n arg1,\n arg2 , arg3 = 7 , *rest,\n\n\n last,\n required:,\n not_required: 7, **options)\nend",
"def meth(\n arg1,\n arg2 , arg3 = 7 , *rest,\n\n\n last,\n required:,\n not_required: 7, **options)\nend",
"def optionalParameters(a,b,*c)\n #so... | [
"0.66978526",
"0.66974586",
"0.6162105",
"0.6040979",
"0.6006214",
"0.5782017",
"0.5755491",
"0.57421666",
"0.5708149",
"0.5708149",
"0.56824064",
"0.5667428",
"0.56643385",
"0.56643385",
"0.56643385",
"0.56643385",
"0.56643385",
"0.56643385",
"0.56643385",
"0.56643385",
"0.5... | 0.0 | -1 |
=> "upper lower" optional parameters must go to the right of ordinal parameters, and are filled in from the left | def what_are_filled_in(a=5, b=4, c=3, d=2, e=1)
"#{a} #{b} #{c} #{d} #{e}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def order=(_arg0); end",
"def method(a, b=-2, *c)\r\nend",
"def sort_params=(_arg0); end",
"def sort_params=(_arg0); end",
"def meth(ordinal, optional=true, *variable_length, &block)\nend",
"def meth(ordinal, optional=true, *variable_length, &block)\nend",
"def parameters=(_arg0); end",
"def optional... | [
"0.6078194",
"0.602415",
"0.59534734",
"0.59534734",
"0.58855736",
"0.58855736",
"0.581441",
"0.57991165",
"0.5774244",
"0.5733405",
"0.5726446",
"0.5726446",
"0.571267",
"0.5711644",
"0.56998897",
"0.56855476",
"0.5664469",
"0.56507194",
"0.56362164",
"0.5618495",
"0.5597693... | 0.0 | -1 |
=> END /Users/joekelly/Desktop/Projects/rubykickstart/session3/notes/17variablelengthedparams.rb file content is listed below After listing your ordinal and optional parameters, you can take a variable length of arguments. To do this, you use '' before the parameter. In Ruby 1.8, it must be the last parameter. The parameters that match it will be put into an array. | def variable_length(first, second=:default, *rest)
[first, second, rest]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def arguments; end",
"def arguments; end",
"def arguments; end",
"def arguments\n \"\"\n end",
"def arg_size; end",
"def q1 *rest\n puts \"The number of parameters is #{rest.length}.\"\n puts rest\nend",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; en... | [
"0.6730426",
"0.6730426",
"0.6730426",
"0.65369976",
"0.6491429",
"0.6266541",
"0.62617344",
"0.62617344",
"0.62617344",
"0.62617344",
"0.62617344",
"0.62617344",
"0.62617344",
"0.62617344",
"0.62617344",
"0.62617344",
"0.62617344",
"0.62617344",
"0.62617344",
"0.62617344",
"... | 0.0 | -1 |
=> [1, 2, [3, 4]] how might we use it? | def minimum( *numbers )
min = numbers.first
numbers.each { |number| min = number if number < min }
min
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def arr\n a = [1,2,[3,4,[5]]]\n return a.flatten\nend",
"def flatten(list)\n list.flatten\nend",
"def using_flatten(arr)\n arr.flatten\nend",
"def using_flatten(array)\n array.flatten\n \nend",
"def using_flatten(array)\n array.flatten\nend",
"def using_flatten(array)\n array.flatten\nend",
"de... | [
"0.6930029",
"0.6883396",
"0.67238504",
"0.67142314",
"0.6651471",
"0.6651471",
"0.6651471",
"0.6651471",
"0.6651471",
"0.6651471",
"0.66494757",
"0.66494757",
"0.640513",
"0.63989854",
"0.63547635",
"0.6273393",
"0.6212642",
"0.61201966",
"0.60530746",
"0.6047458",
"0.604654... | 0.0 | -1 |
=> 3 END /Users/joekelly/Desktop/Projects/rubykickstart/session3/notes/18hashparams.rb file content is listed below If we wanted to pass a bunch of options to a method, we might use a hash table. | def same_case( str , options = Hash.new )
return str.upcase if options[:upcase]
return str.upcase if options[:downcase] == false
str.downcase
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def params=(hash); end",
"def params=(hash); end",
"def initialize(optHash)\n @optHash=optHash\n setParameters()\nend",
"def key; @opts['key'] end",
"def set_hash_length(opts)\n opts = check_params(opts,[:lengths])\n super(opts)\n end",
"def comments_hash_flag=(_arg0); end",
"def com... | [
"0.6228967",
"0.6228967",
"0.60891116",
"0.59030217",
"0.5753206",
"0.57402927",
"0.5737457",
"0.5703313",
"0.5657092",
"0.56328654",
"0.56328654",
"0.56328654",
"0.56328654",
"0.56328654",
"0.56328654",
"0.56328654",
"0.56328654",
"0.56328654",
"0.56328654",
"0.56328654",
"0... | 0.0 | -1 |
=> "UPPER LOWER" END /Users/joekelly/Desktop/Projects/rubykickstart/session3/notes/19puttingitalltogether.rb file content is listed below We've seen a lot of things we can do with method parameters. But how do they all work together? | def meth(ordinal, optional=true, *variable_length, &block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toUpper _args\n \"toUpper _args;\" \n end",
"def greetings(name)\n puts \"Hello #{name.capitalize}\"\nend",
"def capitalize!() end",
"def bar(s)\n s.upcase\nend",
"def shout(word)\n upper_case = word.upcase\nend",
"def caps_phrase(user_phrase)\n puts user_phrase.upcase\nend",
"def capit... | [
"0.72502166",
"0.697195",
"0.6772961",
"0.6768263",
"0.67427236",
"0.66704303",
"0.6651806",
"0.6626089",
"0.6619024",
"0.66150767",
"0.6589522",
"0.65374064",
"0.65316176",
"0.65316176",
"0.65255535",
"0.6497618",
"0.6466999",
"0.6458147",
"0.6457601",
"0.6451619",
"0.644281... | 0.0 | -1 |
the Majordomo messages expect all payloads to be wrapped in arrays; each element of the array will be sent as a separate frame | def encode(string)
[string]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_payload\n to_array.map { |line| MultiJson.encode(line) }.join(\"\\n\") + \"\\n\"\n end",
"def send_arr label, array\n @publisher.send_string label, ZMQ::SNDMORE\n\n # Everything but the last element\n array[0..-2].each do |e|\n @publisher.send_string e.to_s, ZMQ::SNDMORE\n ... | [
"0.65311843",
"0.6202391",
"0.6046696",
"0.6009739",
"0.6009739",
"0.5977682",
"0.5943428",
"0.59109986",
"0.5885378",
"0.58634925",
"0.5840609",
"0.58156985",
"0.57767576",
"0.5699993",
"0.56008995",
"0.55576664",
"0.5527136",
"0.5518746",
"0.5515965",
"0.5482349",
"0.544403... | 0.0 | -1 |
Y["1", "3", "2"] X["5", "4", "2"] Y.each do | d | X.each do | b | puts d / b end def Z X / Y.to_f end puts(Z) puts("The quotient with remainder is") + Z puts("Where 'Y' is") + Y.to_i end | def hellow3
'Hello'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def divide_numbers x, y\n x.fdiv(y)\nend",
"def divide_x_by_y (x, y)\nz = x/y\nend",
"def div(x, y)\n x / y\nend",
"def divide(x,y)\n x / y\n end",
"def divide(x, y)\n if y == 0\n return \"Psst. You can't divide by zero. Please try again.\"\n elsif x.is_a?(Integer) && y.is_a?(Integer) && x % y !... | [
"0.7373507",
"0.71624345",
"0.71368355",
"0.6980973",
"0.6864615",
"0.68050206",
"0.67962015",
"0.67644656",
"0.67174464",
"0.66777813",
"0.6646321",
"0.6643148",
"0.663118",
"0.6611416",
"0.66016644",
"0.65765357",
"0.65709174",
"0.65491205",
"0.65292597",
"0.6528061",
"0.65... | 0.0 | -1 |
C = (F 32) 5 / 9 | def my_func(f)
(f - 32) * 5/9
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def c2f(c)\n c * 9.0 / 5 + 32\nend",
"def f2c(temp_f)\n (temp_f - 32) * 5 / 9\nend",
"def ctof(c)\n\tc * (9.0 / 5.0) + 32\nend",
"def f2c(f)\n\tc = (5.0/9.0)*(f-32.0)\n\treturn c\nend",
"def ctof(c)\n f = c * 9.0/5.0 + 32.0\nend",
"def ctof(c)\n c * 9.0/5.0 + 32.0\nend",
"def ctof(tempC)\n (te... | [
"0.8089761",
"0.808306",
"0.8053431",
"0.7844864",
"0.779167",
"0.77519494",
"0.77133775",
"0.76750356",
"0.75938225",
"0.7559806",
"0.7530019",
"0.7508456",
"0.74995494",
"0.7493697",
"0.74671",
"0.7447913",
"0.7389961",
"0.72900295",
"0.7255671",
"0.72258395",
"0.72123337",... | 0.6506778 | 54 |
Get roles accessible by the current item | def accessible_roles
@accessible_roles = Role.accessible_by(current_ability, :read)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end",
"def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end",
"def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end",
"def accessible_... | [
"0.78122765",
"0.78122765",
"0.78122765",
"0.78122765",
"0.7811529",
"0.76795447",
"0.76666534",
"0.76302636",
"0.76035815",
"0.7598713",
"0.7523484",
"0.7493977",
"0.7241854",
"0.7235137",
"0.7192992",
"0.7192992",
"0.70472383",
"0.70472383",
"0.70329857",
"0.7022271",
"0.70... | 0.7673976 | 6 |
Make the current item object available to views | def get_user
@current_user = current_user
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n set_item\n end",
"def set_item\n @item = current_owner.items.find(params[:id])\n end",
"def set_item\n @item = Item.active.find(params[:id])\n end",
"def set_item\n # 出品機能未実装のため仮置き\n @item = Item.find(params[:id])\n end",
"def detail_item= item\n @detail_item = ... | [
"0.71627903",
"0.7080842",
"0.7027972",
"0.6933755",
"0.68935037",
"0.68513966",
"0.68513966",
"0.68223333",
"0.6822243",
"0.6821785",
"0.68172085",
"0.68172085",
"0.68172085",
"0.6809789",
"0.6809789",
"0.6809789",
"0.6809789",
"0.6808928",
"0.68019366",
"0.68019366",
"0.680... | 0.0 | -1 |
GET /items GET /items.xml GET /items.json HTML and AJAX | def index
self.identify_user
@items = @user.items
@itemlist = @items.map do |item|
convert_to_json(item)
end
respond_to do |format|
format.json { render :json => @itemlist }
format.xml { render :xml => @items }
format.html { render text: "Unsupported Format", status: 404 }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @items = Item.find(params[:id])\n render json: @items\n end",
"def index\n @items = Item.found\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |... | [
"0.71955526",
"0.71292394",
"0.6941722",
"0.69276595",
"0.69276595",
"0.69276595",
"0.69276595",
"0.69168884",
"0.68063194",
"0.68057394",
"0.67799366",
"0.67799366",
"0.67799366",
"0.67799366",
"0.67799366",
"0.67799366",
"0.67799366",
"0.67799366",
"0.67799366",
"0.67799366",... | 0.6323682 | 70 |
GET /items/new GET /items/new.xml GET /items/new.json HTML AND AJAX | def new
@user = current_user
@item = current_user.items.build
respond_to do |format|
format.json { render :json => @item }
format.xml { render :xml => @item }
format.html
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item }\n format.xml { render xml: @item }\n end\n end",
"def new\n @item = Item.new\n respond_to do |format|\n format.html # new.html.erb\n format.js ... | [
"0.7622476",
"0.754366",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
"0.74837774",
... | 0.0 | -1 |
GET /items/1 GET /items/1.xml GET /items/1.json HTML AND AJAX | def show
self.identify_user
@item = Item.find(params[:id])
@itemjson = convert_to_json(@item)
puts @itemjson
respond_to do |format|
format.json { render :json => @itemjson}
format.xml { render :xml => @item }
format.html
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n format.xml { render xml: @item }\n end\n end",
"def index\n @items = Item.found\n\n respond_to do |format|\n format.html # index.html.erb\... | [
"0.701099",
"0.6982144",
"0.6885989",
"0.6806936",
"0.67854387",
"0.6772803",
"0.6748662",
"0.6748497",
"0.6748497",
"0.6748497",
"0.6748497",
"0.67349297",
"0.67349297",
"0.67349297",
"0.67349297",
"0.67349297",
"0.67349297",
"0.67349297",
"0.67349297",
"0.67349297",
"0.6734... | 0.6522869 | 49 |
GET /items/1/edit GET /items/1/edit.xml GET /items/1/edit.json HTML AND AJAX | def edit
@item = Item.find(params[:id])
respond_to do |format|
format.json { render :json => @item }
format.xml { render :xml => @item }
format.html
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def edit\n @item = current_user.items.find(params[:id])\n respond_to do |format|\n format.js { render :action=>:redbox_edit, :layout=>false }\n format.html \n end\n end",
"def edit\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.json {render json: @page}\n ... | [
"0.6950683",
"0.6904527",
"0.6835319",
"0.67743874",
"0.67113703",
"0.6708336",
"0.66810805",
"0.6669407",
"0.6669191",
"0.66633934",
"0.66463244",
"0.66389227",
"0.6614933",
"0.6594326",
"0.6565247",
"0.65589446",
"0.65501803",
"0.65474755",
"0.6542083",
"0.6536543",
"0.6534... | 0.78335 | 0 |
DELETE /items/1 DELETE /items/1.xml DELETE /items/1.json HTML AND AJAX | def destroy
@item = Item.find(params[:id])
if current_user.id != @item.creator_id.to_i
respond_to do |format|
format.all { render :text => "Unauthorized action" }
end
return
end
puts 'Pass authentication check'
if @item.destroy
respond_to do |format|
format.all { render :json => {:result => :ok}, :status => 200 }
end
else
respond_to do |format|
format.all { render :text => "Could not delete comment", :status => :unprocessable_entity } # placeholder
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n format.js\n end\n end",
"def destroy\n @item_id = params[:id]\n @item = Item.find(@item_id)\n @item.destroy\n\n res... | [
"0.7605994",
"0.75893444",
"0.75560963",
"0.75140685",
"0.7436315",
"0.7428278",
"0.7404126",
"0.739164",
"0.739164",
"0.739164",
"0.739164",
"0.739164",
"0.739164",
"0.739164",
"0.739164",
"0.739164",
"0.739164",
"0.73844",
"0.7383663",
"0.7379116",
"0.73786134",
"0.737861... | 0.0 | -1 |
POST /items POST /items.xml POST /items.json HTML AND AJAX | def create
puts params
item_data = {
:title => params[:title],
:description => params[:description]
}
@item = current_user.items.build(item_data)
if params[:attachments]
params[:attachments].each do |att_id|
@att = Attachment.find(att_id)
@item.attachments.push(@att)
if @att.att_type == 'photo'
@item.photos.build(
photo_url: @att.url
)
end
end
end
if @item.save
respond_to do |format|
format.json { render :json => @item.to_json, :status => 200 }
format.xml { head :ok }
format.html { redirect_to :action => :index }
end
else
respond_to do |format|
format.json { render :text => "Could not create item", :status => :unprocessable_entity } # placeholder
format.xml { head :ok }
format.html { render :action => :new, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @item = Item.new(params[:item])\n respond_to do |format|\n if @item.save\n flash[:notice] = 'O item foi criado com sucesso.'\n format.html { redirect_to(@item) }\n format.js\n format.xml { render :xml => @item, :status => :created, :location => @it... | [
"0.6359919",
"0.6329103",
"0.62944096",
"0.620916",
"0.6130023",
"0.6092295",
"0.60868126",
"0.60177046",
"0.5995764",
"0.59737784",
"0.5951129",
"0.5934419",
"0.5907595",
"0.5894034",
"0.58922535",
"0.5891097",
"0.5869148",
"0.58653194",
"0.58646363",
"0.5853791",
"0.5853791... | 0.0 | -1 |
PUT /items/1 PUT /items/1.xml PUT /items/1.json HTML AND AJAX | def update
@item = Item.find(params[:id])
respond_to do |format|
if @item.update_attributes(params[:item])
flash[:notice] = "Item has been updated"
format.json { render :json => @item.to_json, :status => 200 }
format.xml { head :ok }
format.html { render :action => :edit }
else
format.json { render :text => "Could not update item", :status => :unprocessable_entity } #placeholder
format.xml { render :xml => @item.errors, :status => :unprocessable_entity }
format.html { render :action => :edit, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: Item.update(params[\"id\"], params[\"item\"])\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.js\n format.html { redirect_to @item, notice: 'Item was successfully updated.' ... | [
"0.7008002",
"0.6854704",
"0.6847166",
"0.6774122",
"0.6748265",
"0.6688311",
"0.6684777",
"0.662164",
"0.66208804",
"0.6612236",
"0.6605117",
"0.659216",
"0.6580029",
"0.6559096",
"0.6551084",
"0.65439725",
"0.6494292",
"0.64919853",
"0.6476299",
"0.64716256",
"0.64694285",
... | 0.69038594 | 1 |
Compute the direct dependences of the interface. | def computeDependences(list)
dependences = OCMSet.new
OCMSet::SECTIONS.each do |section|
@require[section].each do |req|
found = false
list.each do |iface|
for context in iface.provide do
if context[section].include?(req) then
dependences[section] << iface
found = true
break
end
end
end
raise "#{@id.name}: no dependence found for #{req.name}." unless found
end
end
return dependences.values.flatten.uniq
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def direct_dependencies; end",
"def get_dependencies(_fidl, _interaction_types, _project_dependencies)\n # noop\n end",
"def diffeq_depends_on()\n unless @diffeq_deps\n my_deps = depends_on # calculate @depends_on\n\n d1_name = Variable.derivative_of_name(@name)\n my_d1 = @parent.var... | [
"0.6960988",
"0.6530213",
"0.64618677",
"0.61875457",
"0.61219937",
"0.6067032",
"0.60298073",
"0.6001048",
"0.59841347",
"0.5975094",
"0.5964049",
"0.5944167",
"0.58562434",
"0.5852234",
"0.5819125",
"0.58160925",
"0.5805668",
"0.5784669",
"0.5765604",
"0.5756964",
"0.575666... | 0.59862655 | 8 |
Resolve the interface's dependences graph. | def resolveDependences(list)
#
# Resolve potential conflict if interface is unique.
#
if @unique then
filtered_interfaces = list.find_all do |f|
f != self && self.overlap?(f)
end
filtered_interfaces.each { |f| list.delete(f) }
end
#
# Compute the dependencies and try to resolve the conflicts, if any.
#
dlist = [ self ]
dlist, rlist, xlist = self.resolveDependencesRecursive([], list, dlist, [])
rlist.each do |r|
overlap = []
r_interface = list.find { |c| c.id == r }
overlap = xlist.find_all { |x| x.overlap?(r_interface) }
if not overlap.empty? then
overlap.each { |o| xlist.delete(o) }
end
end
if not xlist.empty? then
error = "Conflict found: "
xlist.each { |x| error += x.id.to_s + ' ' }
raise Exception.new(error)
end
return dlist
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resolve!\n dl, cl = resolve\n raise GraphException(\"Circular Dependency Detected: %s\" % cl) unless cl.nil?\n dl\n end",
"def resolve_dependencies\r\n @nodes.each do |node|\r\n puts \"processing #{node}\"\r\n\r\n node.outgoing_dependencies do |dependency|\r... | [
"0.67540306",
"0.66126996",
"0.6474788",
"0.6327091",
"0.61840016",
"0.6135421",
"0.60516834",
"0.5962147",
"0.59418637",
"0.58821917",
"0.5776535",
"0.5746366",
"0.57427555",
"0.5706056",
"0.56946623",
"0.5679514",
"0.5653791",
"0.5596924",
"0.5549896",
"0.5549744",
"0.55460... | 0.65449315 | 2 |
Check if two interfaces are equal. | def overlap?(i)
for context in @provide do
c = i.provide.find { |o| o.name == context.name }
return true if c != nil && context.overlap?(c)
end
return false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ==(other)\n ffi_delegate.eq(other.ffi_delegate)\n end",
"def equal?(other); end",
"def ==(other)\n raise NotImplementedError\n end",
"def ==(other)\n if other.nil?\n false\n else\n @public_ip == other.public_ip &&\n @public_po... | [
"0.63228333",
"0.6239595",
"0.6215505",
"0.61655223",
"0.6133544",
"0.60267496",
"0.5994666",
"0.5994325",
"0.59836864",
"0.59836864",
"0.59762025",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433... | 0.0 | -1 |
Check if two interfaces are equal. | def eql?(i)
return false if i == nil
return @id == i.id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ==(other)\n ffi_delegate.eq(other.ffi_delegate)\n end",
"def equal?(other); end",
"def ==(other)\n raise NotImplementedError\n end",
"def ==(other)\n if other.nil?\n false\n else\n @public_ip == other.public_ip &&\n @public_po... | [
"0.63228333",
"0.6239595",
"0.6215505",
"0.61655223",
"0.6133544",
"0.60267496",
"0.5994666",
"0.5994325",
"0.59836864",
"0.59836864",
"0.59762025",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433",
"0.5962433... | 0.0 | -1 |
Return the interface's hash value. | def hash
return @id.hash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash\n @hash || calculate_hash!\n end",
"def hash\n 0\n end",
"def hash\n @hash || @hash = (value.hash * -1)\n end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash\n @hash ||= b... | [
"0.73472756",
"0.7337885",
"0.7337465",
"0.7330194",
"0.7330194",
"0.7330194",
"0.7330194",
"0.7330194",
"0.7330194",
"0.7330194",
"0.728836",
"0.728836",
"0.72585124",
"0.7183493",
"0.7151624",
"0.7151624",
"0.7151624",
"0.7147535",
"0.71262664",
"0.70878905",
"0.707234",
... | 0.68240327 | 44 |
Display the interface in the terminal. | def display
puts ("[" + @id.name + ", " + @id.version + "]").green.bold
puts "author = ".blue + @author
print "wrapper = ".blue + @wrapper.to_s
puts ", unique = ".blue + @unique.to_s
puts
puts "[Path:]".green.bold
puts @path
#
# Display the provided elements
#
puts "\n[Provide]".green.bold
@provide.each do |context|
puts "\n<Context #{context.name}>".blue.bold
OCMSet::SECTIONS.each { |section| context[section].each { |k| puts k } }
end
#
# Display the required elements
#
if @require != nil then
puts "\n[Require]".green.bold
OCMSet::SECTIONS.each { |section| @require[section].each { |k| puts k } }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display\n if command\n write_green \"\\t#{hname}\"\n command && write_cyan(\"\\t vite-faits #{command}\")\n end\n # TODO Quand on pourra sortir une version HTML, on pourra mettre\n # un lien vers le mode d'emploi.\n # manuel && puts(\"\\t Anc... | [
"0.7115778",
"0.66148424",
"0.65679586",
"0.6557836",
"0.65077615",
"0.6463722",
"0.64463943",
"0.6445081",
"0.6443887",
"0.6443887",
"0.6431435",
"0.6375582",
"0.63747853",
"0.633644",
"0.63193804",
"0.63182443",
"0.6316558",
"0.6315028",
"0.6294344",
"0.6279015",
"0.6246701... | 0.0 | -1 |
GET /artwork_symbols GET /artwork_symbols.json | def index
@artwork_symbols = ArtworkSymbol.all.paginate(page: params[:page], per_page: 50).order('name ASC')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @artwork_symbol = ArtworkSymbol.new(artwork_symbol_params)\n\n respond_to do |format|\n if @artwork_symbol.save\n format.html { redirect_to @artwork_symbol, notice: 'Artwork symbol was successfully created.' }\n format.json { render :show, status: :created, location: @artwork_... | [
"0.6046496",
"0.5869437",
"0.5787883",
"0.5749128",
"0.5699992",
"0.5684782",
"0.562461",
"0.5567385",
"0.5562975",
"0.5548229",
"0.55352443",
"0.5523372",
"0.5480894",
"0.5462103",
"0.5444285",
"0.5443975",
"0.5443975",
"0.54323596",
"0.5420465",
"0.5404084",
"0.5392368",
... | 0.64724755 | 0 |
GET /artwork_symbols/1 GET /artwork_symbols/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @artwork_symbols = ArtworkSymbol.all.paginate(page: params[:page], per_page: 50).order('name ASC')\n end",
"def create\n @artwork_symbol = ArtworkSymbol.new(artwork_symbol_params)\n\n respond_to do |format|\n if @artwork_symbol.save\n format.html { redirect_to @artwork_symbol, n... | [
"0.62522185",
"0.62159055",
"0.6080931",
"0.60154706",
"0.58741015",
"0.58707434",
"0.5820864",
"0.5763915",
"0.573108",
"0.5688645",
"0.5685",
"0.5650858",
"0.56318986",
"0.56259286",
"0.5603981",
"0.56001776",
"0.55473566",
"0.5510422",
"0.5482407",
"0.547454",
"0.5474309",... | 0.0 | -1 |
POST /artwork_symbols POST /artwork_symbols.json | def create
@artwork_symbol = ArtworkSymbol.new(artwork_symbol_params)
respond_to do |format|
if @artwork_symbol.save
format.html { redirect_to @artwork_symbol, notice: 'Artwork symbol was successfully created.' }
format.json { render :show, status: :created, location: @artwork_symbol }
else
format.html { render :new }
format.json { render json: @artwork_symbol.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def artwork_symbol_params\n params[:artwork_symbol].permit(:name)\n end",
"def add\n unless TickerSymbol.where(symb: params['new_symbol']).nil?\n url = 'stock/' + params['new_symbol'] + '/company'\n company_data = JSON.parse( get_iex_json( url ) )\n print company_data\n unless comp... | [
"0.6378803",
"0.59464943",
"0.57780564",
"0.57773715",
"0.55244786",
"0.5282606",
"0.51991165",
"0.51720905",
"0.50597924",
"0.50492823",
"0.5025617",
"0.49595976",
"0.49579936",
"0.495467",
"0.49170217",
"0.49169332",
"0.49082446",
"0.48986527",
"0.4892236",
"0.48704258",
"0... | 0.714994 | 0 |
PATCH/PUT /artwork_symbols/1 PATCH/PUT /artwork_symbols/1.json | def update
respond_to do |format|
if @artwork_symbol.update(artwork_symbol_params)
format.html { redirect_to @artwork_symbol, notice: 'Artwork symbol was successfully updated.' }
format.json { render :show, status: :ok, location: @artwork_symbol }
else
format.html { render :edit }
format.json { render json: @artwork_symbol.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @artwork.update(update_artwork_params)\n format.json { render :show, status: :ok, location: @artwork }\n else\n format.json { render json: @artwork.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @glyph = Gl... | [
"0.6401142",
"0.6156533",
"0.59854776",
"0.59761703",
"0.5907662",
"0.58929586",
"0.58716685",
"0.5844132",
"0.5839373",
"0.58336985",
"0.5831616",
"0.58088213",
"0.578173",
"0.5771749",
"0.5754246",
"0.5739941",
"0.5724849",
"0.57183",
"0.57160056",
"0.57133716",
"0.5705371"... | 0.7428222 | 0 |
DELETE /artwork_symbols/1 DELETE /artwork_symbols/1.json | def destroy
@artwork_symbol.destroy
respond_to do |format|
format.html { redirect_to artwork_symbols_url, notice: 'Artwork symbol was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n puts \"I M IN DESTROY\"\n puts \"params[symbol_id]::::::::::::#{params[symbol_id]}\"\n @symbol_bank = SymbolBank.find(params[:id])\n @symbol_bank.destroy\n\n respond_to do |format|\n format.html { redirect_to symbol_banks_url }\n format.json { head :no_content }\n end\n e... | [
"0.6554079",
"0.64874136",
"0.64738995",
"0.6438851",
"0.6438309",
"0.6408298",
"0.6335878",
"0.62948143",
"0.62923104",
"0.6262431",
"0.6260801",
"0.625162",
"0.62472206",
"0.62459564",
"0.6244179",
"0.62413037",
"0.6236513",
"0.62326914",
"0.6221972",
"0.62209034",
"0.62082... | 0.7441761 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_artwork_symbol
@artwork_symbol = ArtworkSymbol.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def artwork_symbol_params
params[:artwork_symbol].permit(:name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.6980957",
"0.6783065",
"0.6747844",
"0.6741468",
"0.67356336",
"0.6592548",
"0.65036845",
"0.64978707",
"0.64825076",
"0.64795035",
"0.64560914",
"0.64397955",
"0.6379666",
"0.6376688",
"0.6366702",
"0.6319728",
"0.6300833",
"0.6300629",
"0.6294277",
"0.6293905",
"0.629117... | 0.0 | -1 |
GET /premios GET /premios.json | def index
@premios = Premio.all
respond_to do |format|
format.html # index.html.erb
format.json { render :json => @premios }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @premios }\n end\n end",
"def index\n @macs = Mac.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @macs }\n ... | [
"0.54381204",
"0.49589175",
"0.4860609",
"0.48284027",
"0.4828282",
"0.48077327",
"0.47667992",
"0.4723793",
"0.47224036",
"0.46959007",
"0.46837342",
"0.4683084",
"0.45838615",
"0.45586723",
"0.45445442",
"0.45441124",
"0.45243973",
"0.45045248",
"0.44735324",
"0.44735324",
... | 0.6312335 | 0 |
GET /premios/1 GET /premios/1.json | def show
@premio = Premio.find(params[:id])
#guarda o id do prêmio usado para mostrar o mesmo prêmio após selecionado
#também usado para gerar o cupom e deixar o id do prêmio escondido
session[:premio_id] = params[:id]
respond_to do |format|
format.html # show.html.erb
format.json { render :json => {
:imagem_info => @premio.imagem_info.url,
:link_to_imagem_topo => @premio.empresa.link_to_imagem_topo,
:imagem_topo => @premio.empresa.imagem_topo.url,
:link_to_imagem_meio => @premio.empresa.link_to_imagem_meio,
:imagem_meio => @premio.empresa.imagem_meio.url,
:link_to_imagem_inferior => @premio.empresa.link_to_imagem_inferior,
:imagem_inferior => @premio.empresa.imagem_inferior.url,
:descricao => @premio.descricao,
:sorteio => @premio.sorteio.strftime("%d/%m/%Y"),
:logado => usuario_signed_in?
} }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @premios }\n end\n end",
"def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pre... | [
"0.64763045",
"0.55373096",
"0.53275496",
"0.51645803",
"0.5062449",
"0.4977302",
"0.48390958",
"0.48354864",
"0.48310083",
"0.48145878",
"0.48032904",
"0.48012805",
"0.48006594",
"0.47947574",
"0.47871035",
"0.4786237",
"0.47764516",
"0.47752002",
"0.47679973",
"0.4766983",
... | 0.0 | -1 |
GET /premios/new GET /premios/new.json | def new
@premio = Premio.new
respond_to do |format|
format.html # new.html.erb
format.json { render :json => @premio }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @premio = Premio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @premio }\n end\n end",
"def new\n @contacter = Contacter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contacter }\n... | [
"0.6600705",
"0.6506941",
"0.63839763",
"0.6357989",
"0.6344449",
"0.6238727",
"0.62161654",
"0.62059265",
"0.62059265",
"0.6182527",
"0.6152142",
"0.61430615",
"0.61397284",
"0.6139079",
"0.6133943",
"0.61294603",
"0.61170596",
"0.6116741",
"0.6112198",
"0.608526",
"0.607126... | 0.6549225 | 1 |
POST /premios POST /premios.json | def create
@premio = Premio.new(params[:premio])
respond_to do |format|
if @premio.save
format.html { redirect_to @premio, :notice => 'Premio was successfully created.' }
format.json { render :json => @premio, :status => :created, :location => @premio }
else
format.html { render :action => "new" }
format.json { render :json => @premio.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cooked!\n Vedeu.log(\"Configuration::API terminal_mode: :cooked\")\n\n options[:terminal_mode] = :cooked\n end",
"def terminal_params\n params.require(:terminal).permit(:admin, :mac, :imei, :sim_iccid)\n end",
"def index\n @premios = Premio.all\n\n respond_to do |format|\n ... | [
"0.5034111",
"0.48818085",
"0.48368245",
"0.47575212",
"0.45850807",
"0.4519271",
"0.446661",
"0.44655564",
"0.4403657",
"0.43617547",
"0.43582588",
"0.42912102",
"0.42788315",
"0.4275274",
"0.42670208",
"0.42603377",
"0.42559537",
"0.42285097",
"0.42127904",
"0.41972935",
"0... | 0.4663728 | 4 |
PUT /premios/1 PUT /premios/1.json | def update
@premio = Premio.find(params[:id])
respond_to do |format|
if @premio.update_attributes(params[:premio])
format.html { redirect_to @premio, :notice => 'Premio was successfully updated.' }
format.json { head :no_content }
else
format.html { render :action => "edit" }
format.json { render :json => @premio.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n if @premio.update_attributes(params[:premio])\n format.html { redirect_to @premio, notice: 'Premio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: ... | [
"0.5710817",
"0.54008687",
"0.52993983",
"0.5133492",
"0.5012592",
"0.50006616",
"0.4963367",
"0.49626723",
"0.49262348",
"0.4914228",
"0.4879968",
"0.48780036",
"0.48681125",
"0.48416144",
"0.48392993",
"0.48388565",
"0.48275036",
"0.4825848",
"0.481896",
"0.4817325",
"0.481... | 0.57266384 | 0 |
DELETE /premios/1 DELETE /premios/1.json | def destroy
@premio = Premio.find(params[:id])
@premio.destroy
respond_to do |format|
format.html { redirect_to premios_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_cookie name, path\r\n command 'deleteCookie', name, path\r\n end",
"def destroy\n \n respond_to do |format|\n RestClient.delete 'localhost:3001/colores/'+@color.id.to_s, {:Authorization => 'admin irizREhyoG6Ejwr4AcjsQME9'}\n format.html { redirect_to colors_url, notice: \"Color was... | [
"0.5802092",
"0.57930374",
"0.57780457",
"0.5692974",
"0.5563834",
"0.55314684",
"0.55088896",
"0.54908794",
"0.54897314",
"0.5482194",
"0.54415286",
"0.54327476",
"0.5422622",
"0.54155844",
"0.54045355",
"0.53915805",
"0.5378258",
"0.5363064",
"0.5359313",
"0.53576076",
"0.5... | 0.6178964 | 1 |
create new RevDate with given year, month, day (numeric, using revolutionary year, month, day) | def initialize(year, month, day)
@year = year
@month = month
@day = day
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new(year = -4712, month = 1, day = 1, sg = ITALY)\n # we can catch this here already\n raise ArgumentError, \"invalid date\" if month > 12\n \n unless valid_civil?(year, month, day, sg)\n raise ArgumentError, \"invalid date, because it falls in the dropped days range of the calendar ... | [
"0.6563907",
"0.6498392",
"0.62064874",
"0.61141646",
"0.6031566",
"0.6012872",
"0.6003747",
"0.5988646",
"0.5974962",
"0.5974962",
"0.59747016",
"0.5971246",
"0.5896565",
"0.58178073",
"0.5799442",
"0.5795441",
"0.5781526",
"0.576734",
"0.57640797",
"0.5692246",
"0.56838757"... | 0.6145943 | 3 |
create human readable string of date | def to_s
names = ["Vendémiaire", "Brumaire", "Frimaire", "Nivôse", "Pluviôse",
"Ventôse", "Germinal", "Floréal", "Prairial", "Messidor",
"Thermidor", "Fructidor", "Sansculottides"]
s = ""
s += @day.to_s + " " + names[@month - 1] + " " + @year.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def date_str d\n Util::date(d)\n end",
"def human_readable_date\n d = self.date\n d.strftime(\"%B %d, %Y\")\n end",
"def to_s\n # TODO this breaks the minus spec: strftime\n format \"#{year}-%02d-%02d\", month, day\n end",
"def to_s()\n str = \"\" + @date.month.to... | [
"0.78620964",
"0.77620125",
"0.7576547",
"0.74893904",
"0.74830765",
"0.7474318",
"0.74503714",
"0.7434824",
"0.7429843",
"0.74103975",
"0.73735815",
"0.73657584",
"0.73332584",
"0.7269312",
"0.723448",
"0.7216986",
"0.720112",
"0.7184813",
"0.71165836",
"0.71123034",
"0.7109... | 0.0 | -1 |
return the date's symbol (associated plant, animal, or tool) | def daySymbol
dayNum = 30*(@month - 1) + (@day - 1)
symbols = ["Raisin (Grape)",
"Safran (Saffron)",
"Châtaigne (Chestnut)",
"Colchique (Crocus)",
"Cheval (Horse)",
"Balsamine (Impatiens)",
"Carotte (Carrot)",
"Amarante (Amaranth)",
"Panais (Parsnip)",
"Cuve (Vat)",
"Pomme de terre (Potato)",
"Immortelle (Strawflower)",
"Potiron (Calabaza)",
"Réséda (Mignonette)",
"Âne (Donkey)",
"Belle de nuit (The four o’clock flower)",
"Citrouille (Pumpkin)",
"Sarrasin (Buckwheat)",
"Tournesol (Sunflower)",
"Pressoir (Wine-Press)",
"Chanvre (Hemp)",
"Pêche (Peach)",
"Navet (Turnip)",
"Amaryllis (Amaryllis)",
"Bœuf (Cow)",
"Aubergine (Eggplant)",
"Piment (Chili Pepper)",
"Tomate (Tomato)",
"Orge (Barley)",
"Tonneau (Barrel)",
"Pomme (Apple)",
"Céleri (Celery)",
"Poire (Pear)",
"Betterave (Beet root)",
"Oie (Goose)",
"Héliotrope (Heliotrope)",
"Figue (Fig)",
"Scorsonère (Black Salsify)",
"Alisier (Chequer Tree)",
"Charrue (Plough)",
"Salsifis (Salsify)",
"Macre (Water chestnut)",
"Topinambour (Jerusalem Artichoke)",
"Endive (Endive)",
"Dindon (Turkey)",
"Chervis (Skirret)",
"Cresson (Watercress)",
"Dentelaire (Leadworts)",
"Grenade (Pomegranate)",
"Herse (Harrow)",
"Bacchante (Asarum baccharis)",
"Azerole (Acerola)",
"Garance (Madder)",
"Orange (Orange)",
"Faisan (Pheasant)",
"Pistache (Pistachio)",
"Macjonc (Tuberous pea)",
"Coing (Quince)",
"Cormier (Service tree)",
"Rouleau (Roller)",
"Raiponce (Rampion)",
"Turneps (Turnip)",
"Chicorée (Chicory)",
"Nèfle (Medlar)",
"Cochon (Pig)",
"Mâche (Corn Salad)",
"Chou-fleur (Cauliflower)",
"Miel (Honey)",
"Genièvre (Juniper)",
"Pioche (Pickaxe)",
"Cire (Wax)",
"Raifort (Horseradish)",
"Cèdre (Cedar tree)",
"Sapin (Fir tree)",
"Chevreuil (Roe Deer)",
"Ajonc (Gorse)",
"Cyprès (Cypress Tree)",
"Lierre (Ivy)",
"Sabine (Juniper)",
"Hoyau (Grub-hoe)",
"Érable sucré (Maple Tree)",
"Bruyère (Heather)",
"Roseau (Reed plant)",
"Oseille (Sorrel)",
"Grillon (Cricket)",
"Pignon (Pinenut)",
"Liège (cork)",
"Truffe (Truffle)",
"Olive (Olive)",
"Pelle (shovel)",
"Tourbe (Peat)",
"Houille (Coal)",
"Bitume (Bitumen)",
"Soufre (Sulphur)",
"Chien (Dog)",
"Lave (Lava)",
"Terre végétale (Topsoil)",
"Fumier (Manure)",
"Salpêtre (Saltpeter)",
"Fléau (Flail)",
"Granit (Granite stone)",
"Argile (Clay)",
"Ardoise (Slate)",
"Grès (Sandstone)",
"Lapin (Rabbit)",
"Silex (Flint)",
"Marne (Marl)",
"Pierre à chaux (Limestone)",
"Marbre (Marble)",
"Van (Winnowing basket)",
"Pierre à plâtre (Gypsum)",
"Sel (Salt)",
"Fer (Iron)",
"Cuivre (Copper)",
"Chat (Cat)",
"Étain (Tin)",
"Plomb (Lead)",
"Zinc (Zinc)",
"Mercure (Mercury (metal))",
"Crible (Sieve)",
"Lauréole (Spurge-laurel)",
"Mousse (Moss)",
"Fragon (Butcher’s Broom)",
"Perce-neige (Snowdrop)",
"Taureau (Bull)",
"Laurier-thym (Laurustinus)",
"Amadouvier (Tinder polypore)",
"Mézéréon (Daphne mezereum)",
"Peuplier (Poplar Tree)",
"Coignée (Axe)",
"Ellébore (Hellebore)",
"Brocoli (Broccoli)",
"Laurier (Laurel)",
"Avelinier (Cob or filbert)",
"Vache (Cow)",
"Buis (Box Tree)",
"Lichen (Lichen)",
"If (Yew tree)",
"Pulmonaire (Lungwort)",
"Serpette (Billhook)",
"Thlaspi (Pennycress)",
"Thimelé (Rose Daphne)",
"Chiendent (Couch Grass)",
"Trainasse (Knotweed)",
"Lièvre (Hare)",
"Guède (Woad)",
"Noisetier (Hazel)",
"Cyclamen (Cyclamen)",
"Chélidoine (Celandine)",
"Traîneau (Sleigh)",
"Tussilage (Coltsfoot)",
"Cornouiller (Dogwood)",
"Violier (Matthiola)",
"Troène (Privet)",
"Bouc (Billygoat)",
"Asaret (Wild Ginger)",
"Alaterne (Buckthorn)",
"Violette (Violet (plant))",
"Marceau (Goat Willow)",
"Bêche (Spade)",
"Narcisse (Narcissus)",
"Orme (Elm Tree)",
"Fumeterre (Common fumitory)",
"Vélar (Hedge Mustard)",
"Chèvre (Goat)",
"Épinard (Spinach)",
"Doronic (Large-flowered Leopard’s Bane)",
"Mouron (Pimpernel)",
"Cerfeuil (Chervil)",
"Cordeau (Twine)",
"Mandragore (Mandrake)",
"Persil (Parsley)",
"Cochléaria (Scurvy-grass)",
"Pâquerette (Daisy)",
"Thon (Tuna)",
"Pissenlit (Dandelion)",
"Sylve (Forest)",
"Capillaire (Maidenhair fern)",
"Frêne (Ash Tree)",
"Plantoir (Dibber: a hand gardening tool)",
"Primevère (Primrose)",
"Platane (Plane Tree)",
"Asperge (Asparagus)",
"Tulipe (Tulip)",
"Poule (Hen)",
"Bette (Chard Plant)",
"Bouleau (Birch Tree)",
"Jonquille (Daffodil)",
"Aulne (Alder)",
"Couvoir (Hatchery)",
"Pervenche (Periwinkle)",
"Charme (Ironwood)",
"Morille (Morel)",
"Hêtre (Beech Tree)",
"Abeille (Bee)",
"Laitue (Lettuce)",
"Mélèze (Larch)",
"Ciguë (Hemlock)",
"Radis (Radish)",
"Ruche (Hive)",
"Gainier (Judas tree)",
"Romaine (Lettuce)",
"Marronnier (Chestnut Oak)",
"Roquette (Arugula or Rocket)",
"Pigeon (Pigeon)",
"Lilas (Lilac)",
"Anémone (Anemone)",
"Pensée (Pansy)",
"Myrtille (Blueberry)",
"Greffoir (Knife)",
"Rose (Rose)",
"Chêne (Oak Tree)",
"Fougère (Fern)",
"Aubépine (Hawthorn)",
"Rossignol (Nightingale)",
"Ancolie (Columbine)",
"Muguet (Lily of the Valley)",
"Champignon (Button mushroom)",
"Hyacinthe (Hyacinth)",
"Râteau (Rake)",
"Rhubarbe (Rhubarb)",
"Sainfoin (Sainfoin)",
"Bâton-d’or (Wallflower)",
"Chamérops (Palm tree)",
"Ver à soie (Silkworm)",
"Consoude (Comfrey)",
"Pimprenelle (Salad Burnet)",
"Corbeille d’or (Basket of Gold)",
"Arroche (Orache)",
"Sarcloir (Garden hoe)",
"Statice (Sea Lavender)",
"Fritillaire (Fritillary)",
"Bourrache (Borage)",
"Valériane (Valerian)",
"Carpe (Carp)",
"Fusain (Spindle (shrub))",
"Civette (Chive)",
"Buglosse (Bugloss)",
"Sénevé (Wild mustard)",
"Houlette (Shepherd’s crook)",
"Luzerne (Alfalfa)",
"Hémérocalle (Daylily)",
"Trèfle (Clover)",
"Angélique (Angelica)",
"Canard (Duck)",
"Mélisse (Lemon Balm)",
"Fromental (Oat grass)",
"Martagon (Martagon lily)",
"Serpolet (Thyme plant)",
"Faux (Scythe)",
"Fraise (Strawberry)",
"Bétoine (Woundwort)",
"Pois (Pea)",
"Acacia (Acacia)",
"Caille (Quail)",
"Œillet (Carnation)",
"Sureau (Elderberry)",
"Pavot (Poppy plant)",
"Tilleul (Linden or Lime tree)",
"Fourche (Pitchfork)",
"Barbeau (Cornflower)",
"Camomille (Camomile)",
"Chèvrefeuille (Honeysuckle)",
"caille-lait (Bedstraw)",
"Tanche (Tench)",
"Jasmin (Jasmine Plant)",
"Verveine (Verbena)",
"Thym (Thyme Plant)",
"Pivoine (Peony Plant)",
"Chariot (Hand Cart)",
"Seigle (Rye)",
"Avoine (Oats)",
"Oignon (Onion)",
"Véronique (Speedwell)",
"Mulet (Mule)",
"Romarin (Rosemary)",
"Concombre (Cucumber)",
"Échalote (Shallot)",
"Absinthe (Wormwood)",
"Faucille (Sickle)",
"Coriandre (Coriander)",
"Artichaut (Artichoke)",
"Girofle (Clove)",
"Lavande (Lavender)",
"Chamois (Chamois)",
"Tabac (Tobacco)",
"Groseille (Currant)",
"Gesse (Hairy Vetchling)",
"Cerise (Cherry)",
"Parc (Park)",
"Menthe (Mint)",
"Cumin (Cumin)",
"Haricot (Bean)",
"Orcanète (Alkanet)",
"Pintade (Guinea fowl)",
"Sauge (Sage Plant)",
"Ail (Garlic)",
"Vesce (Tare)",
"Blé (Wheat)",
"Chalémie (Shawm)",
"Épeautre (Einkorn Wheat)",
"Bouillon blanc (Common Mullein)",
"Melon (Honeydew Melon)",
"Ivraie (Ryegrass)",
"Bélier (Ram)",
"Prêle (Horsetail)",
"Armoise (Mugwort)",
"Carthame (Safflower)",
"Mûre (Blackberry)",
"Arrosoir (Watering Can)",
"Panis (Panic grass)",
"Salicorne (Common Glasswort)",
"Abricot (Apricot)",
"Basilic (Basil)",
"Brebis (Ewe)",
"Guimauve (Marshmallow root)",
"Lin (Flax)",
"Amande (Almond)",
"Gentiane (Gentian)",
"Écluse (Lock)",
"Carline (Carline thistle)",
"Câprier (Caper)",
"Lentille (Lentil)",
"Aunée (Yellow starwort)",
"Loutre (Otter)",
"Myrte (Myrtle)",
"Colza (Rapeseed)",
"Lupin (Lupin)",
"Coton (Cotton)",
"Moulin (Mill)",
"Prune (Plum)",
"Millet (Millet)",
"Lycoperdon (Puffball)",
"Escourgeon (Six-row Barley)",
"Saumon (Salmon)",
"Tubéreuse (Tuberose)",
"Sucrion (Sugar melon)",
"Apocyn (Apocynum)",
"Réglisse (Liquorice)",
"Échelle (Ladder)",
"Pastèque (Watermelon)",
"Fenouil (Fennel)",
"Épine vinette (Barberry)",
"Noix (Walnut)",
"Truite (Trout)",
"Citron (Lemon)",
"Cardère (Teasel)",
"Nerprun (Buckthorn)",
"Tagette (Mexican Marigold)",
"Hotte (Sack)",
"Églantine (Wild Rose)",
"Noisette (Hazelnut)",
"Houblon (Hops)",
"Sorgho (Sorghum)",
"Écrevisse (Crayfish)",
"Bigarade (Bitter Orange)",
"Verge d’or (Goldenrod)",
"Maïs (Maize or Corn)",
"Marron (Chestnut)",
"Panier (Basket)",
"La Fête de la Vertu (Celebration of Virtue)",
"La Fête du Génie (Celebration of Talent)",
"La Fête du Travail (Celebration of Labour)",
"La Fête de l'Opinion (Celebration of Principles)",
"La Fête des Récompenses (Celebration of Honours)",
"La Fête de la Révolution (Celebration of the Revolution)"]
return symbols[dayNum]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def roman_event(date)\n date[2]\n end",
"def as_sym(date)\n date.strftime(\"%a\").downcase.to_sym\n end",
"def date() self[:date]; end",
"def day_name; Date::DAYNAMES[wday] end",
"def date \n \"date\" \n end",
"def day; end",
"def easy_date; date; end",
"def date; end",
"def... | [
"0.63759995",
"0.6034681",
"0.59478706",
"0.5940942",
"0.5926677",
"0.59115964",
"0.5883612",
"0.5796437",
"0.5796437",
"0.5796437",
"0.5796437",
"0.56665385",
"0.5665496",
"0.5663355",
"0.56421393",
"0.5629921",
"0.5609742",
"0.56091493",
"0.55920225",
"0.5561758",
"0.556069... | 0.66535 | 0 |
A task to monitor | def task(name, &block)
task = Wodan::Task.new(name)
yield(task)
wodan.tasks << task
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def task\n end",
"def monitor; end",
"def task_report\n print \"task #{@name} is #{@state}\"\n case @state\n when 'waiting' ; puts \"\"\n when 'running'\n puts \" and \"+VT100.RED(\"has not completed\")+\" because\"\n @emits.each { |event_name|\n ... | [
"0.7157362",
"0.6705366",
"0.6380405",
"0.63540995",
"0.6335088",
"0.62536836",
"0.62392247",
"0.6151832",
"0.6140144",
"0.6060038",
"0.60487795",
"0.6044313",
"0.6041796",
"0.60265565",
"0.60216993",
"0.60162365",
"0.6015654",
"0.59932137",
"0.5979599",
"0.59409785",
"0.5940... | 0.58214146 | 32 |
Gets the normalized directory path String for this blob. | def dir
@dir ||= self.class.normalize_dir(::File.dirname(@path))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n @directory\n end",
"def directory_name\n return @directory_name.to_s if @directory_name\n return local_path.basename.to_s if exist?\n return name\n end",
"def directoryname\n new_parts = @parts[0..-2]\n new_parts[0] = absolute_prefix + new_parts[0]\n FilePath.new(*... | [
"0.714756",
"0.71290964",
"0.673288",
"0.6648179",
"0.66268164",
"0.6618571",
"0.66057193",
"0.6576609",
"0.6574388",
"0.6525342",
"0.64563096",
"0.645625",
"0.64474887",
"0.6416838",
"0.63706696",
"0.6350038",
"0.6346546",
"0.63357425",
"0.63331056",
"0.6302244",
"0.62957644... | 0.61994743 | 36 |
Gets the file base name String for this blob. | def name
@name ||= ::File.basename(@path)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def base_name\n File.basename(file_name)\n end",
"def base\n File.basename @filename, extension_with_delimiter\n end",
"def get_corresponding_file_base_name\n return File.basename(@URL)\n end",
"def base()\n sub_ext('').basename.to_s\n end",
"def base_name\n File.basename... | [
"0.8167793",
"0.8034736",
"0.79164684",
"0.7819805",
"0.7744379",
"0.7640878",
"0.7613311",
"0.7585046",
"0.75820327",
"0.75538164",
"0.75538164",
"0.74952304",
"0.73697686",
"0.7212607",
"0.72058594",
"0.70567733",
"0.70447135",
"0.7020719",
"0.70019054",
"0.6988627",
"0.698... | 0.6654159 | 52 |
Gets a Grit::Blob instance for this blob. repo Grit::Repo instance for the Grit::Blob. Returns an unbaked Grit::Blob instance. | def blob(repo)
@blob ||= Grit::Blob.create(repo,
:id => @sha, :name => name, :size => @size)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def blob\n @blob ||= ($repo.gblob(@rev + ':' + @name))\n end",
"def blob\n @blob ||= image.to_blob\n end",
"def blob(id, commit_sha=nil, path=nil)\n blob = self.lookup(id); blob_entry={}\n if commit_sha && path\n commit = self.lookup(commit_sha)\n unless comm... | [
"0.7978034",
"0.6997656",
"0.67002213",
"0.65411824",
"0.6367336",
"0.63655615",
"0.62690234",
"0.6194238",
"0.6183753",
"0.6094445",
"0.60825676",
"0.6049865",
"0.6021602",
"0.6001665",
"0.6001665",
"0.59536",
"0.5914461",
"0.5901281",
"0.589945",
"0.5892387",
"0.58584577",
... | 0.7991585 | 0 |
Gets a Page instance for this blob. wiki Gollum::Wiki instance for the Gollum::Page Returns a Gollum::Page instance. | def page(wiki, commit)
blob = self.blob(wiki.repo)
page = wiki.page_class.new(wiki).populate(blob, self.dir)
page.version = commit
page
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def page\n @page_object ||= Page.find(self.page_id)\n rescue\n nil\n end",
"def page_object\n @page\n end",
"def page_object\n @page\n end",
"def page\n @page ||= retrieve_page\n end",
"def page\n @page ||= retrieve_page\n end",
"def page\n @... | [
"0.75451785",
"0.7389194",
"0.7389194",
"0.72426635",
"0.72426635",
"0.70587254",
"0.7049628",
"0.6957463",
"0.6760992",
"0.6680988",
"0.6676338",
"0.6459358",
"0.64564544",
"0.64183456",
"0.6369608",
"0.6272012",
"0.62137717",
"0.6174501",
"0.6126684",
"0.608311",
"0.6075257... | 0.71868813 | 5 |
Changes default port to 8080 Tell configure to look for pcre in HOMEBREW_PREFIX | def patches
DATA
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def port\n conf['port'] || '80'\n end",
"def port_set(port)\n rebuild_uri :port => port\n end",
"def proxy_port; end",
"def base_port\n (options[:port] || env[\"PORT\"] || ENV[\"PORT\"] || 5000).to_i\n end",
"def host_with_port; end",
"def default_httpd_port\n if monit_version &&... | [
"0.61214525",
"0.60873634",
"0.5910187",
"0.5886581",
"0.58162165",
"0.57693076",
"0.57402724",
"0.573379",
"0.57178086",
"0.5689331",
"0.567434",
"0.56655586",
"0.5655973",
"0.5651475",
"0.562018",
"0.559096",
"0.55797225",
"0.5575391",
"0.55581486",
"0.5556788",
"0.5556027"... | 0.0 | -1 |
Route a request to the correct controller based on the given data. | def call(env)
route = @routes.map do |exp, meta|
next unless matches = env["PATH_INFO"].match(exp)
meta.merge(captures: matches)
end.compact.first
return Yokunai::ErrorsController.new(env).not_found unless route
request_method = env["REQUEST_METHOD"]
if route[:methods].include?(request_method)
Object.const_get(route[:class])
.new(env, route[:captures])
.public_send(request_method.downcase)
else
Yokunai::ErrorsController.new(env).unsupported_method
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run(req, res)\n # The #run method will figure out what URL was requested, match it to\n # the path regex of one Route object, and finally ask the Route to\n # instantiate the appropriate controller, and call the appropriate method.\n end",
"def run(req, res)\n match_data = @pattern.match(req.pat... | [
"0.68689656",
"0.6567625",
"0.6463206",
"0.6456079",
"0.6443208",
"0.63865155",
"0.63791794",
"0.6195597",
"0.61416394",
"0.6119806",
"0.6048663",
"0.6024157",
"0.60168743",
"0.5961125",
"0.59358037",
"0.5894857",
"0.58873594",
"0.5866275",
"0.5865712",
"0.5865712",
"0.585468... | 0.48136893 | 97 |
transform to the format daff understands | def to_daff_data(hs)
return [] if hs.nil? || hs.empty?
# first row contains the keys
[hs[0].keys] + hs.map(&:values)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transform; end",
"def transform\n end",
"def transformation\n end",
"def transforms; end",
"def transformations; end",
"def transform_values!; end",
"def normalizer; end",
"def to_dfa\n fa.determinize\n end",
"def transform(transformation)\n end",
"def transformed_entries entri... | [
"0.71629995",
"0.6861315",
"0.6766257",
"0.66958874",
"0.6494446",
"0.6473748",
"0.6284781",
"0.59748363",
"0.5925796",
"0.5904637",
"0.5853795",
"0.5830171",
"0.5815758",
"0.57902956",
"0.57843685",
"0.57562",
"0.57562",
"0.5731144",
"0.5728842",
"0.5699563",
"0.5676201",
... | 0.0 | -1 |
TODO include the diff summary in serializable | def summary_hash
# :row_inserts, :row_updates, :row_deletes, :row_reorders
# :col_inserts, :col_updates, :col_deletes, :col_reorders, :col_renames
# :row_count_initial_with_header, :row_count_final_with_header
# :row_count_initial, :row_count_final
# :col_count_initial, :col_count_final
# :different
{
different: @summary.different,
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def diff\n @diff ||= begin\n commit.diffs.collect{|diff| diff.diff}.join(\"\\n\")\n end\n end",
"def make_my_diffs_pretty!; end",
"def persistable_diff(a, b)\n diff = Diff::LCS.diff a, b\n reify_diff_element(diff).as_json\n end",
"def diff_to_compare; end",
"def diff=(o);... | [
"0.69506544",
"0.6941856",
"0.68770057",
"0.67682993",
"0.67010725",
"0.66523933",
"0.6601903",
"0.65986055",
"0.65919304",
"0.6454654",
"0.62909037",
"0.62712216",
"0.6221042",
"0.61422247",
"0.61082023",
"0.61039174",
"0.60487163",
"0.59871465",
"0.59425485",
"0.58664876",
... | 0.0 | -1 |
GET /miscellaneous_items GET /miscellaneous_items.xml | def index
if params[:from] and params[:to]
if params[:from].blank? and params[:to].blank?
flash[:error] = "Please choose a valid date"
@search = MiscellaneousItem.search(params[:search])
@miscellaneous_items = [] #@search.all(:order => "transaction_date DESC, amount", :limit => 0, :joins => :agent)
else
from = Date.parse(params[:from]).to_s rescue from = Date.today.to_s
to = Date.parse(params[:to]).to_s rescue to = Date.today.to_s
@search = MiscellaneousItem.search(params[:search])
@search.transaction_date_greater_than_or_equal_to(from)
@search.transaction_date_less_than_or_equal_to(to)
if params[:option]
unless params[:option][:agent_name].blank?
check_name = params[:option][:agent_name]
end
end
if check_name
agent_id = MiscellaneousItem.check_agent_name(check_name)
@search.agent_id_equals(agent_id)
@miscellaneous_items = @search.all
else
@miscellaneous_items = @search.all
end
end
else
@search = MiscellaneousItem.search(params[:search])
@miscellaneous_items = [] #@search.all(:order => "date_paid DESC", :limit => 0)
end
@miscellaneous_items = @miscellaneous_items.paginate(:page => params[:page], :per_page => 30)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @miscellaneous_item = MiscellaneousItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @miscellaneous_item }\n end\n end",
"def new\n @miscellaneous_item = MiscellaneousItem.new\n\n respond_to do |format|\n forma... | [
"0.72636783",
"0.66251177",
"0.6381508",
"0.62261814",
"0.61888254",
"0.6175204",
"0.60594785",
"0.6027527",
"0.5968608",
"0.5913716",
"0.589272",
"0.588977",
"0.58821106",
"0.58361715",
"0.5831662",
"0.5763648",
"0.57517284",
"0.5750091",
"0.57420284",
"0.5738643",
"0.573100... | 0.0 | -1 |
GET /miscellaneous_items/1 GET /miscellaneous_items/1.xml | def show
@miscellaneous_item = MiscellaneousItem.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @miscellaneous_item }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @miscellaneous_item = MiscellaneousItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @miscellaneous_item }\n end\n end",
"def index\n @items_mobs = ItemsMob.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n ... | [
"0.66794676",
"0.62437767",
"0.605938",
"0.6004241",
"0.5953134",
"0.5914868",
"0.588695",
"0.5838852",
"0.58314127",
"0.5811259",
"0.5800752",
"0.5799038",
"0.5799038",
"0.5799038",
"0.5799038",
"0.5799038",
"0.5799038",
"0.5790172",
"0.57844895",
"0.5739035",
"0.571314",
... | 0.7342621 | 0 |
GET /miscellaneous_items/new GET /miscellaneous_items/new.xml | def new
@miscellaneous_item = MiscellaneousItem.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @miscellaneous_item }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @miscellaneous_item = MiscellaneousItem.new(params[:miscellaneous_item])\n\n respond_to do |format|\n if @miscellaneous_item.save\n flash[:notice] = 'MiscellaneousItem was successfully created.'\n format.html { redirect_to(@miscellaneous_item) }\n format.xml { render :... | [
"0.73890924",
"0.71475095",
"0.71475095",
"0.71475095",
"0.71475095",
"0.71475095",
"0.71475095",
"0.71475095",
"0.71475095",
"0.7133957",
"0.71129155",
"0.71029276",
"0.70728016",
"0.6927841",
"0.68855906",
"0.68108475",
"0.6793",
"0.67912483",
"0.67632073",
"0.67266023",
"0... | 0.8019944 | 0 |
POST /miscellaneous_items POST /miscellaneous_items.xml | def create
@miscellaneous_item = MiscellaneousItem.new(params[:miscellaneous_item])
respond_to do |format|
if @miscellaneous_item.save
flash[:notice] = 'MiscellaneousItem was successfully created.'
format.html { redirect_to(@miscellaneous_item) }
format.xml { render :xml => @miscellaneous_item, :status => :created, :location => @miscellaneous_item }
else
format.html { render :action => "new" }
format.xml { render :xml => @miscellaneous_item.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @miscellaneous_item = MiscellaneousItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @miscellaneous_item }\n end\n end",
"def create\n item = list.items.create!(item_params)\n render json: item, status: 201\n end",
"def create\n... | [
"0.6374522",
"0.59442604",
"0.5928585",
"0.59123266",
"0.5857304",
"0.58002025",
"0.5746391",
"0.5745602",
"0.57412714",
"0.5695307",
"0.56937146",
"0.56818205",
"0.56773686",
"0.5671517",
"0.5668003",
"0.5636266",
"0.56309557",
"0.561101",
"0.5610839",
"0.56086254",
"0.56076... | 0.7085851 | 0 |
PUT /miscellaneous_items/1 PUT /miscellaneous_items/1.xml | def update
@miscellaneous_item = MiscellaneousItem.find(params[:id])
respond_to do |format|
if @miscellaneous_item.update_attributes(params[:miscellaneous_item])
flash[:notice] = 'MiscellaneousItem was successfully updated.'
format.html { redirect_to(@miscellaneous_item) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @miscellaneous_item.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @miscellaneous_item = MiscellaneousItem.new(params[:miscellaneous_item])\n\n respond_to do |format|\n if @miscellaneous_item.save\n flash[:notice] = 'MiscellaneousItem was successfully created.'\n format.html { redirect_to(@miscellaneous_item) }\n format.xml { render :... | [
"0.5891184",
"0.588577",
"0.58823144",
"0.58461684",
"0.5809623",
"0.5789424",
"0.5781747",
"0.5779316",
"0.577845",
"0.57597697",
"0.5738083",
"0.57321125",
"0.57308215",
"0.57302815",
"0.57264614",
"0.57264614",
"0.57264614",
"0.5719591",
"0.57094854",
"0.56950957",
"0.5693... | 0.7045057 | 0 |
DELETE /miscellaneous_items/1 DELETE /miscellaneous_items/1.xml | def destroy
@miscellaneous_item = MiscellaneousItem.find(params[:id])
@miscellaneous_item.destroy
respond_to do |format|
format.html { redirect_to(miscellaneous_items_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @miscellaneous_child = MiscellaneousChild.find(params[:id])\n @miscellaneous_child.destroy\n\n respond_to do |format|\n format.html { redirect_to(miscellaneous_children_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/conte... | [
"0.65647507",
"0.65392745",
"0.6398129",
"0.63070196",
"0.6306006",
"0.62958527",
"0.62775135",
"0.6276724",
"0.62676466",
"0.62266654",
"0.6207234",
"0.6201764",
"0.61872166",
"0.61872166",
"0.61872166",
"0.61872166",
"0.61872166",
"0.61872166",
"0.61838245",
"0.61692387",
"... | 0.73356366 | 0 |
GET /profiles GET /profiles.json | def index
@profiles = Profile.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n authorize Profile\n @profiles = ProfilePolicy::Scope.new(current_user, @user.profiles).resolve\n render json: @profiles\n end",
"def get_default_profile \n get(\"/profiles.json/default\")\nend",
"def profiles \n personid = params[:id]\n @response = JSON.parse(current_user.access... | [
"0.77193916",
"0.75128365",
"0.7509529",
"0.7472739",
"0.7472042",
"0.7427816",
"0.7366555",
"0.7366555",
"0.72750694",
"0.7274087",
"0.72641665",
"0.7193044",
"0.7188361",
"0.7108386",
"0.7067094",
"0.7061127",
"0.7061127",
"0.7061127",
"0.70376235",
"0.70244056",
"0.6998496... | 0.6856475 | 43 |
GET /profiles/1 GET /profiles/1.json | def show
@posts = Post.where(hidden: false).where(:user_id => @profile.user.id).order('created_at DESC').page params[:page]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_default_profile \n get(\"/profiles.json/default\")\nend",
"def my_profiles\n @user = User.find(params[:user_id])\n @profiles = @user.profiles\n end",
"def show\n profile = Profile.find(params[:id])\n render status: 200, json: profile\n end",
"def index\n authorize Profile\n @profi... | [
"0.7775649",
"0.74931335",
"0.74876684",
"0.736598",
"0.7305961",
"0.7302657",
"0.7301793",
"0.72450936",
"0.72319347",
"0.72319347",
"0.72319347",
"0.72181976",
"0.72181976",
"0.71651715",
"0.71410364",
"0.7114219",
"0.70800215",
"0.7046293",
"0.70175827",
"0.69905627",
"0.6... | 0.0 | -1 |
POST /profiles POST /profiles.json | def create
@profile = Profile.new(profile_params)
authorize @profile
respond_to do |format|
if @profile.save
format.html { redirect_to @profile, notice: 'Profile was successfully created.' }
format.json { render :show, status: :created, location: @profile }
else
format.html { render :new }
format.json { render json: @profile.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @profile = current_user.profiles.build(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n ... | [
"0.73701555",
"0.7367171",
"0.72288865",
"0.71786684",
"0.7172963",
"0.7170674",
"0.71145105",
"0.7096289",
"0.707034",
"0.7002038",
"0.7002038",
"0.7002038",
"0.7002038",
"0.7002038",
"0.7002038",
"0.7002038",
"0.6997514",
"0.69700205",
"0.69617796",
"0.6937631",
"0.6937631"... | 0.62169695 | 98 |
PATCH/PUT /profiles/1 PATCH/PUT /profiles/1.json | def update
respond_to do |format|
if @profile.update(profile_params)
format.html { redirect_to vanity_profile_path(:id => @profile.user.name), notice: 'Profile was successfully updated.' }
format.json { render :show, status: :ok, location: @profile }
else
format.html { render :edit }
format.json { render json: @profile.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @profiles = current_user.profiles.find(params[:id])\n\n respond_to do |format|\n if @profiles.update(profile_params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profiles }\n ... | [
"0.7386528",
"0.7121499",
"0.711318",
"0.7097071",
"0.709138",
"0.709138",
"0.709138",
"0.70766556",
"0.70632905",
"0.70601624",
"0.7022545",
"0.7013014",
"0.69967467",
"0.69850945",
"0.69850945",
"0.69850945",
"0.69850945",
"0.69791424",
"0.69747424",
"0.69681233",
"0.696714... | 0.70704883 | 8 |
DELETE /profiles/1 DELETE /profiles/1.json | def destroy
@profile.destroy
respond_to do |format|
format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n ... | [
"0.7739456",
"0.7739456",
"0.7739456",
"0.7707937",
"0.77065504",
"0.77065504",
"0.77065504",
"0.77065504",
"0.77065504",
"0.77065504",
"0.77065504",
"0.77065504",
"0.7706363",
"0.7704212",
"0.769637",
"0.7687797",
"0.7687588",
"0.7687588",
"0.76273435",
"0.7588475",
"0.75627... | 0.74744916 | 48 |
Use callbacks to share common setup or constraints between actions. | def set_profile
@profile = Profile.friendly.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def profile_params
params.require(:profile).permit(:user_id, :display_name, :image, :banner, :slug, :bio, :website, :twitter)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
Make sure these word lists exist | def word_list_exists(name)
begin
$current_case.count("word-list:\"#{name}\"")
return true
rescue Exception => exc
return false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_for_definitions\n @words.each do |word|\n @lemma ? lemma = \" - #{@lemmas[word]}\" : lemma = \"\"\n\n # Strip characters - mimics trimWordLowerCase in texts.js\n regex = /[\\u200B-\\u200D\\uFEFF\\u00A0]/\n word.gsub!(regex, \"\")\n regex = /^[.,!¡?¿:;\\/|\\\\'\"“”‘... | [
"0.7391479",
"0.6668344",
"0.6659616",
"0.6642127",
"0.6545326",
"0.64692163",
"0.6361747",
"0.63507783",
"0.63425034",
"0.6310698",
"0.62760085",
"0.6251572",
"0.6245987",
"0.6245987",
"0.62399167",
"0.6222771",
"0.6193846",
"0.6169626",
"0.615987",
"0.61499333",
"0.614836",... | 0.70371914 | 1 |
Use callbacks to share common setup or constraints between actions. | def set_account
@account = Account.find(params[:id])
rescue ActiveRecord::RecordNotFound
render json: { error: $ERROR_INFO.message }, status: :not_found
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163927",
"0.6046165",
"0.59465253",
"0.59167755",
"0.58904207",
"0.58346355",
"0.577713",
"0.5703502",
"0.5703502",
"0.56531286",
"0.56215113",
"0.54224145",
"0.5410795",
"0.5410795",
"0.5410795",
"0.53924775",
"0.5379919",
"0.53580743",
"0.53401667",
"0.53397506",
"0.533... | 0.0 | -1 |
Only allow a trusted parameter "white list" through. | def account_params
params.require(:account).permit(:email, :password, :current_password)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def expected_permitted_parameter_names; end",
"def param_whitelist\n [:role, :title]\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def permitted_params\n []\n end",
... | [
"0.7121987",
"0.70541996",
"0.69483954",
"0.6902367",
"0.6733912",
"0.6717838",
"0.6687021",
"0.6676254",
"0.66612333",
"0.6555296",
"0.6527056",
"0.6456324",
"0.6450841",
"0.6450127",
"0.6447226",
"0.6434961",
"0.64121825",
"0.64121825",
"0.63913447",
"0.63804525",
"0.638045... | 0.0 | -1 |
memmap method is based on | def memmap
pid = $$
f= File.open "/proc/#{pid}/cmdline"
cmd= f.read.split "\0"
f= File.open "/proc/#{pid}/maps"
stack = heap = nil
data = Array.new
f.each_line do |line|
data << line.split(' ').first.split('-') if line.match cmd.first
stack = line.split(' ').first.split('-') if line.match "stack"
heap = line.split(' ').first.split('-') if line.match "heap"
end
unless data.empty?
@data= data.map do |a|
a= a.map do |e|
e.to_i(16)
end
end
end
unless stack.nil?
@stack= stack.map do |e|
e.to_i(16)
end
end
unless heap.nil?
@heap= heap.map do |e|
e.to_i(16)
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def memos; end",
"def memos; end",
"def mem(*) end",
"def make_memory_addressable\n hash = {}\n @data.length.times do |index|\n key = HumanComputer::Processor.eight_bitify index\n hash[key] = @data[index]\n end\n @data = hash\n end",
"def read(off, sz=4096); Ragweed::Wr... | [
"0.6622615",
"0.6622615",
"0.6399159",
"0.60531455",
"0.601997",
"0.58994913",
"0.5898935",
"0.58432436",
"0.5770079",
"0.56304926",
"0.56276196",
"0.56069815",
"0.55884534",
"0.5577522",
"0.5572116",
"0.55376565",
"0.5536974",
"0.5507512",
"0.55058056",
"0.54760176",
"0.5475... | 0.71156275 | 0 |
GET /line_items GET /line_items.json | def index
@line_items = LineItem.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @line_items }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {\n render json: @line_items \n }\n end\n end",
"def index\n @line_items = @order.line_items\n\n render json: @line_items\n end",
"def li... | [
"0.7619621",
"0.7579001",
"0.74959284",
"0.7447879",
"0.74131817",
"0.7400883",
"0.73949015",
"0.73949015",
"0.73949015",
"0.73949015",
"0.73949015",
"0.73949015",
"0.73949015",
"0.73949015",
"0.73949015",
"0.73949015",
"0.73949015",
"0.7394513",
"0.72700405",
"0.7269355",
"0... | 0.74669135 | 6 |
GET /line_items/1 GET /line_items/1.json | def show
@line_item = LineItem.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @line_item }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @line_item = @order.line_items.find(params[:id])\n\n render json: @line_item\n end",
"def show\n puts params.inspect.green\n\n @line_item = LineItem.find(params[:id])\n\n puts @line_items.inspect.magenta\n\n respond_to do |format|\n format.html # show.html.erb\n format.jso... | [
"0.7516723",
"0.7455819",
"0.7342249",
"0.7341003",
"0.73255855",
"0.73170966",
"0.72770566",
"0.7244238",
"0.7244238",
"0.7244238",
"0.7244238",
"0.72067314",
"0.71952313",
"0.7064094",
"0.70640516",
"0.70640516",
"0.70640516",
"0.70640516",
"0.70640516",
"0.70640516",
"0.70... | 0.74113274 | 8 |
GET /line_items/new GET /line_items/new.json | def new
@line_item = LineItem.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @line_item }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @lineitem = Lineitem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lineitem }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @line_... | [
"0.8266442",
"0.822149",
"0.8160804",
"0.7782807",
"0.7768962",
"0.7549798",
"0.7548422",
"0.75240606",
"0.75240606",
"0.74592066",
"0.7284249",
"0.7238863",
"0.72111607",
"0.71894693",
"0.7175733",
"0.70911485",
"0.708704",
"0.7046844",
"0.70398986",
"0.70121247",
"0.699105"... | 0.8297957 | 8 |
POST /line_items POST /line_items.json Creates a new LineItem when a product is added to cart. Calls method in cart model that adds product to the cart listing. Subtracts from quantity of product. If quantity is 0, customer is informed that product is out of stock. | def create
@cart = current_cart
product = Product.find(params[:product_id])
if product.quantity > 0
@line_item = @cart.add_product(product.id)
product.update_attributes(:quantity => product.quantity - 1)
end
respond_to do |format|
if @line_item
if @line_item.save
format.html { redirect_to store_url}
format.js { @current_item = @line_item}
format.json { render json: @line_item, status: :created, location: @line_item }
else
format.html { render action: "new" }
format.json { render json: @line_item.errors, status: :unprocessable_entity }
end
else
format.html {redirect_to store_url, :notice => 'Sorry! Looks like that product is out of stock'}
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_line_item\n\t\tset_sale\n\t\tpopulate_products\n\n\t\texisting_line_item = Item.where('product_id = ? AND sale_id = ?', params[:product_id], @sale.id).first\n\n\t\tif existing_line_item.blank?\n\t\t\tline_item = Item.new(product_id: params[:product_id], sale_id: params[:sale_id], quantity: params[:quant... | [
"0.80490047",
"0.79378974",
"0.78989446",
"0.78562003",
"0.7829388",
"0.77694505",
"0.7760947",
"0.7750323",
"0.7719439",
"0.76808935",
"0.76739484",
"0.7672433",
"0.7634859",
"0.76076436",
"0.75617236",
"0.75553215",
"0.7540249",
"0.7511087",
"0.7490194",
"0.7471138",
"0.740... | 0.7716445 | 9 |
DELETE /line_items/1 DELETE /line_items/1.json Removes product from cart; calls remove_product method in cart. When product is moved, quantity attribute is updated so that the product in cart is "returned" to the main inventory. | def destroy
@cart = current_cart
product = Product.find(params[:product_id])
#@line_item = LineItem.find(params[:id])
@line_item = @cart.remove_product(product.id)
product.update_attributes(:quantity => product.quantity + 1)
respond_to do |format|
format.html { redirect_to store_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n\n if params[:product_id] then\n# TODO need to use @cart.id to ensure only this users line_item is accessed.\n current_item = LineItem.find_by_product_id(params[:product_id] )\n else\n current_item = LineItem.find(params[:id])\n end\n\n if current_item\n current_item.quantit... | [
"0.82011235",
"0.7937417",
"0.7804881",
"0.77042943",
"0.76757544",
"0.7641766",
"0.7544792",
"0.7535273",
"0.7512755",
"0.74975467",
"0.7463813",
"0.74611145",
"0.7449174",
"0.74490124",
"0.74416757",
"0.7307449",
"0.72973126",
"0.7224416",
"0.7153994",
"0.71281266",
"0.7123... | 0.81706566 | 1 |
PUT /line_items/1 PUT /line_items/1.json | def update
@line_item = LineItem.find(params[:id])
respond_to do |format|
if @line_item.update_attributes(params[:line_item])
format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @line_item.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @line_item = @order.line_items.find(params[:id])\n\n if @line_item.update(line_item_params)\n head :no_content\n else\n render json: @line_item.errors, status: :unprocessable_entity\n end\n end",
"def update\n @line_item = LineItem.find(params[:id])\n\n respond_to do |fo... | [
"0.75274915",
"0.7351354",
"0.73112833",
"0.7279287",
"0.7242768",
"0.7206155",
"0.7196351",
"0.7190699",
"0.7104807",
"0.7104807",
"0.71046823",
"0.71046823",
"0.71046823",
"0.71046823",
"0.71046823",
"0.71046823",
"0.71046823",
"0.7080236",
"0.70737576",
"0.70631504",
"0.70... | 0.7309161 | 6 |
p encrypt("abc") p encrypt("zed") | def decrypt(encoded_phrase)
alphabet = "abcdefghijklmnopqrstuvwxyz"
loop_counter = 0
decrypted_result = ""
while loop_counter < encoded_phrase.length
current_index = alphabet.index(encoded_phrase[loop_counter])
current_letter = encoded_phrase[loop_counter]
if current_letter == 'a'
decrypted_result += 'z'
elsif current_letter == " "
decrypted_result += " "
else
previous_letter = alphabet[current_index - 1]
decrypted_result += previous_letter
end
loop_counter += 1
end
decrypted_result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encrypt; end",
"def test_it_encrypts_a_single_letter\n cryptographer = Cryptographer.new\n assert_equal \"n\", cryptographer.encrypt(\"a\")\n end",
"def test_it_encrypts_a_single_char ###\n cryptographer = Cryptographer.new\n assert_equal \"n\", cryptographer.encrypt_1(\"a\")\n end",
"def e... | [
"0.7934466",
"0.7506167",
"0.74988496",
"0.74558085",
"0.73458767",
"0.7317432",
"0.73171896",
"0.7242086",
"0.72366744",
"0.721721",
"0.72169286",
"0.7203565",
"0.7125579",
"0.7070596",
"0.7029967",
"0.70246613",
"0.7009031",
"0.7000419",
"0.69559276",
"0.6952344",
"0.694667... | 0.0 | -1 |
Specifies if self can be watched. | def is_watchable?
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def watching?\n @watcher && @watcher.alive? ? true : false\n end",
"def watch?\n false\n end",
"def can_watch?(song)\n song.open? ||\n song.closed? && authenticated? ||\n authenticated? && @current_user.played?(song)\n end",
"def poll_writable?\n true\n end",
"def ... | [
"0.64068794",
"0.63668895",
"0.6277696",
"0.6012779",
"0.599301",
"0.5961691",
"0.5937113",
"0.5933498",
"0.5861864",
"0.5847888",
"0.5809642",
"0.5809642",
"0.5782405",
"0.5770361",
"0.57503444",
"0.57259876",
"0.5719201",
"0.5683221",
"0.5676588",
"0.56623",
"0.56614196",
... | 0.76025665 | 0 |
Devuelve el evento cuyo id fue recibido. | def show
event = Event.find params[ :id ]
expose event, serializer: EventSerializer
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id\n self.event['id'].to_i\n end",
"def set_servico_evento\n @servico_evento = Servico::Evento.find(params[:id])\n end",
"def set_event(id)\n @event = Event.find(id)\n end",
"def after_init(id)\n @event_id = id\n end",
"def item id\n ljcall :getevents, :selecttype... | [
"0.6421807",
"0.6287632",
"0.62391174",
"0.6127028",
"0.6097526",
"0.60773134",
"0.60773134",
"0.60773134",
"0.60773134",
"0.6055085",
"0.6017853",
"0.59592",
"0.5864523",
"0.5812277",
"0.58103204",
"0.56893814",
"0.5681095",
"0.5675228",
"0.56630075",
"0.56625384",
"0.565351... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.