query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c7fc765d65111207944d97330648d16f
Whether this object has the given property
[ { "docid": "b19a9485108fece9f21b3651fcd8de14", "score": "0.76984876", "text": "def property? name\n self.class.available_properties.include? name.to_s\n end", "title": "" } ]
[ { "docid": "d801df12d530b3c4522196b260301e49", "score": "0.83051753", "text": "def has?(prop)\n val = self.send prop\n ! val.nil? && ! val.empty?\n end", "title": "" }, { "docid": "6705838c06dc84ce5c950541c414737b", "score": "0.82183737", "text": "def has_property?(property)\n...
8c29cd27349abc03bb5c9416f731549e
PUT /prompts/1 PUT /prompts/1.json
[ { "docid": "7a94df1441ce11562896bb1a74c9cd95", "score": "0.6940083", "text": "def update\n @prompt = Prompt.find(params[:id])\n\n respond_to do |format|\n if @prompt.update_attributes(params[:prompt])\n format.html { redirect_to @prompt, notice: 'Prompt was successfully updated.' }\n ...
[ { "docid": "aa4cb6c5ee43da05dce6d416db28f8cb", "score": "0.6807684", "text": "def update\n respond_to do |format|\n if @prompt.update(prompt_params)\n format.html { redirect_to @prompt, notice: 'Prompt was successfully updated.' }\n format.json { render :show, status: :ok, location...
db16ff885d9facb2d76ee985959ea123
Change it to another ResultSet subclass
[ { "docid": "173d064dab7e12febefe3b3c2296d95f", "score": "0.0", "text": "def transmogrify(klass, opts=nil)\n opts ||= self.options\n klass.new(resources, *attributes, opts)\n end", "title": "" } ]
[ { "docid": "f850d9ea901411abb24998cded7ea788", "score": "0.63829607", "text": "def result_set; end", "title": "" }, { "docid": "f850d9ea901411abb24998cded7ea788", "score": "0.63829607", "text": "def result_set; end", "title": "" }, { "docid": "f33931f16b0c6c97763f0c1486f1...
ffed85a4d2dc642299d5cb77c5d7c4bf
PATCH/PUT /action_items/1 PATCH/PUT /action_items/1.json
[ { "docid": "153e9054aa30af3c5d51e55f4990599a", "score": "0.72273934", "text": "def update\n @action_item = ActionItem.find(params[:id])\n\n respond_to do |format|\n if @action_item.update_attributes(action_item_params)\n format.html { redirect_to @action_item, notice: 'Action item was ...
[ { "docid": "a9ffb77c7e3080b3008260f9b6874260", "score": "0.7285412", "text": "def update\n respond_to do |format|\n if @action_item.update(action_item_params)\n format.html { redirect_to @action_item, notice: 'Action item was successfully updated.' }\n format.json { head :no_conten...
eaffb43c1d542e08b640ead5c1b2fb6f
GET /business_units GET /business_units.json
[ { "docid": "12771960a0a2b8351daf475ceef894fc", "score": "0.7490423", "text": "def index\n @business_units = BusinessUnit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @business_units }\n end\n end", "title": "" } ]
[ { "docid": "23ce945b70348a772ea7a63974e7bc23", "score": "0.83262837", "text": "def business_units_list\n url = \"#{@sal_url}/api/v2/business_units/\"\n json_resp_body(url)['results']\n end", "title": "" }, { "docid": "1068803776bd3f40a42c15c31eb8be3f", "score": "0.73888534",...
f44d37f8ea64e8919730b4f008e1325c
Control logic for createview GET /projects/:project_id/subprojects/:subproject_id/subsubprojects/new
[ { "docid": "8d027256145716e642413be8d02256b6", "score": "0.74573016", "text": "def new\n # build a 'temporary' post which is written to DB later (create-method)\n @subsubproject = Subsubproject.new\n end", "title": "" } ]
[ { "docid": "0f81ecb1eecf5060501530e8afba3f1e", "score": "0.7925083", "text": "def create\n @project = Project.find(params[:project_id])\n @sub_project = @project.sub_projects.create(params[:sub_project])\n\n\n \n\n redirect_to project_path(@project)\n end", "title": "" }, { "doc...
f161645085b617f62de5008db3435521
RATHER THAN UPDATNIG EXISTING RECIPE, MARK EXISTING RECIPE OBSOLETE THEN CREATE NEW INSTANCE. THIS WILL PROVIDE FULL HISTORICAL TRACKING.
[ { "docid": "fd6a3ec1cef3b51c2b6af74142065d1b", "score": "0.0", "text": "def update\n # MARK CURRENT RECIPE INACTIVE.\n Recipe.update(params[:id], :active => '0')\n # CREATE NEW RECIPE FROM THAT IN FORM\n logger.debug(\"-=-=-=-=-=-=-=-=-= b4 create -=-=-=-=-=-=-=-=-=-=-=-=\");\n ...
[ { "docid": "f5c9ac1a181b5139c7bdeb5ad6a3b4cd", "score": "0.5561011", "text": "def refresh\n super do |modified|\n return unless modified\n `createrepo -d #{@dir}` #TODO: --update switch?\n end\n end", "title": "" }, { "docid": "3c4c1db183e63e474efcd2339a9...
9c6e78689f4104dcd7411bbb53593220
O(n^2) time O(1) space version
[ { "docid": "b9c5906d8d5f3d1a37eb8b8d2b81ca6a", "score": "0.0", "text": "def remove_dups_2(head)\n check = head\n until check.nil?\n crawler = check\n until crawler.next.nil?\n if check.val == crawler.next.val\n cralwer.next = cralwer.next.next\n else\n crawler = crawler.n...
[ { "docid": "239f4a4623ff9a2dc517cbbef43d4f3d", "score": "0.6748119", "text": "def optimize_for_space(arr)\n arr[0...-1].each_with_index do |el, idx|\n arr[idx + 1..-1].each do |el2|\n return el if el == el2\n end\n end\n \"No Duplicates\"\nend", "title": "" }, { "docid": "9bfae...
1786f86017156494648a626cfc4820f2
Returns fiber information string. Also aliased as: [`inspect`](
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "074d7a6fde0e365fd6e4d7dc0498dadf", "score": "0.7271289", "text": "def inspect\n if @tag\n \"#<Fiber #{tag}:#{object_id} #{location} (#{state})>\"\n else\n \"#<Fiber:#{object_id} #{location} (#{state})>\"\n end\n end", "title": "" }, { "docid": "4e00fdcc2618a70...
10f5f3c5978397796df4f4192349f1c3
return the coordinates of the node
[ { "docid": "2e767c0adada7f10b3211daecec1f196", "score": "0.66590756", "text": "def getcoord\n return (xcrd.to_s + ',' + ycrd.to_s)\n end", "title": "" } ]
[ { "docid": "205be97599601ea5c3e429601502d715", "score": "0.7697356", "text": "def coords\n [@top, @left, @bottom, @right]\n end", "title": "" }, { "docid": "e4ecc80ca7de41b5eb83e8a4050b6a13", "score": "0.74666375", "text": "def coords\n @coords\n end", "title": ""...
6c67fc58ae9e41d7076cd484d32cbb45
Reify onto `model` an attribute named `k` with value `v` from `version`. `ObjectAttributedeserialize` will return the mapped enum value and in Rails < 5, the []= uses the integer type caster from the column definition (in general) and thus will turn a (usually) string to 0 instead of the correct value.
[ { "docid": "20646222936f8d2ec252ed17c602f60c", "score": "0.65544486", "text": "def reify_attribute(k, v, model, version)\n if model.has_attribute?(k)\n model[k.to_sym] = v\n elsif model.respond_to?(\"#{k}=\")\n model.send(\"#{k}=\", v)\n elsif version.logger\n ...
[ { "docid": "ab6ca4a3c26aa931a7699b9615e95f74", "score": "0.5896015", "text": "def reify_attributes(model, version, attrs)\n AttributeSerializers::ObjectAttribute.new(model.class).deserialize(attrs)\n attrs.each do |k, v|\n reify_attribute(k, v, model, version)\n end\n ...
bb858f5bbba320fba65d0a11bfcdc1a6
PATCH/PUT /locations/1 PATCH/PUT /locations/1.json
[ { "docid": "8a4eac2fda1e9874d798e233956fca3f", "score": "0.6313446", "text": "def update\n @location = @event.locations.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(location_params)\n format.html { redirect_to event_location_path(event_id: @location.eve...
[ { "docid": "fe2318e68ec2d233776255ecfdfdc562", "score": "0.6937377", "text": "def inline_update\n respond_to do |format|\n if @location.update(location_params)\n format.json { render :show, status: :ok, location: @location }\n else\n format.json { render json: { error: @locati...
29de4ad97f879f5616712e400d27d623
uses truncate method options supports :limit which is applied if the column type is string or text
[ { "docid": "2fe460ae2b147cfd0e10a0cd057f69a8", "score": "0.68562424", "text": "def admin_data_get_value_for_column(column, source, options = {})\n options.reverse_merge!(:limit => 400)\n if column.type == :datetime\n d = source.send(column.name)\n d.strftime('%m/%d/%Y %H:%M:%S %p') unles...
[ { "docid": "a00ec5ce6870f7b5086f0cc7d07e9efe", "score": "0.76808643", "text": "def truncate\n end", "title": "" }, { "docid": "49b9ddc7d3a2b6171aeb6cfd0484e192", "score": "0.7653844", "text": "def truncate(truncate)\n self.query.truncate = truncate\n self\n end", "t...
b484a178b987b583efbfad844a9a6c04
Rules Solve the following problems in ruby using the fewest amount of characters possible. Each problem should be solved using a single method per hole Method Names do not count as characters but params do. def my_awesome_method(num, letter) = 10 chars num,letter Spaces, new lines, and puts statements do NOT count The ...
[ { "docid": "0ee52789a504f7166dc07c915c95f272", "score": "0.0", "text": "def sum(a)\n a.reduce(&:+)\nend", "title": "" } ]
[ { "docid": "ddde080743be764f34af6aae48fe7dcc", "score": "0.63385355", "text": "def sum\n local_array = multiply_word_with_letter_multiplier\n local_array.inject(:+)\n end", "title": "" }, { "docid": "dbbb622525063854badc8596054dbdd7", "score": "0.6167057", "text": "def sum_of_...
9e13ce3acc11178031bf668baa282068
Logout of redux, invalidates your token. After calling this you cannot make any further requests with this client
[ { "docid": "4dba3a587b2df806b8028b35e8b88361", "score": "0.0", "text": "def logout\n data_for(:logout)\n return nil\n end", "title": "" } ]
[ { "docid": "87e0b109e9e79b74a3b66c70a9acf798", "score": "0.7833766", "text": "def logout\n response = @session.delete\n @auth_token = nil\n @rest.default_headers = { 'Content-Type' => 'application/json' }\n response\n end", "title": "" }, { "docid": "a5436a2fccdf...
93cf29a41e9922ec9345b61a39598dee
Unzip one level of marker Recursively unzip the string if asked to
[ { "docid": "89424b42c4bfdcc12f2ecba00b5c0c8e", "score": "0.75190055", "text": "def unzip(string, recursive=false)\n\n # A string without ( can be taken as is.\n # Return its length\n if string.index('(').nil?\n return string.length\n end\n\n # Size of the current string\n size = 0\n\n # Loop u...
[ { "docid": "fdd8c86fd34aa27f3c84f373d9157659", "score": "0.71103793", "text": "def unzip(string)\n Zlib::Inflate.inflate(string)\n end", "title": "" }, { "docid": "e858d8a4e03b1c22e16156360067420d", "score": "0.69556075", "text": "def unzip(string)\n require 'zlib'\n Gem.in...
3840ea5ad25caeed8249a5ec41712d00
This action generate the object to provide details for view fee structure for selected student. It display the particular, discount, fines in well format with total payment amount.
[ { "docid": "dba80fb1bed36c465afb31b6ec2d40d0", "score": "0.65098786", "text": "def student_fees_structure\n @student = Student.shod(params[:student_id])\n @collection = FinanceFeeCollection.shod(params[:collection_id])\n @category = @collection.finance_fee_category\n @particulars ||= @collec...
[ { "docid": "0809fdd7fe2480cc952fa6b53b2d63d9", "score": "0.72724897", "text": "def fee_structure_pdf\n @student = Student.find(params[:id])\n tbl_name = params[:fee_type]\n fee_type = tbl_name.singularize\n fee_name = fee_model_name tbl_name\n collection_name = (\"#{fee_type.camelize}Coll...
863a665c542f45a07b9b4f2dc978a345
This method is called right after initialize. It's only here to simplify the implementation of Brushes, mainly to avoid passing all those arguments to super. There is a bit of redundancy with canvas and document here. It's there to avoid method calls.
[ { "docid": "6acba5af8c217b7015d61088be51dd59", "score": "0.49751252", "text": "def setup(canvas, document)\n @canvas = canvas\n @document = document\n end", "title": "" } ]
[ { "docid": "4ca6353111d175f42789ba944dadfa97", "score": "0.5652894", "text": "def setup\n super\n @background_colour = @colour\n @foreground_colour = Palette.white\n end", "title": "" }, { "docid": "cadef14ec983ad78b05a53ac56b4f846", "score": "0.545482", "te...
3ece00bb1c5e6bfa02d1c45058406fc1
GET /krs GET /krs.json
[ { "docid": "ac0ff89780b863d7cb6ac7e91f131612", "score": "0.64635146", "text": "def index\n @krs = Kr.all\n end", "title": "" } ]
[ { "docid": "1b063c451719d55efece379086b83d4b", "score": "0.62309605", "text": "def index\n @rsakeys = Rsakey.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rsakeys }\n end\n end", "title": "" }, { "docid": "0a97dfc5f9fb90f6a303...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "321421f0a958b2a7099444e7ee5270bb", "score": "0.0", "text": "def set_admin_police_man\n @police_man = PoliceMan.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
c5f196441945066b31aba87707a2fa8d
Window visibility n : opacity
[ { "docid": "1ee93c68249456807cb4a8a088f463d2", "score": "0.56688046", "text": "def visible=(n)\n @meters.each{|sprite| sprite.visible = n }\n end", "title": "" } ]
[ { "docid": "7bed8d339b34dd0b73297234ad5f1de2", "score": "0.6912529", "text": "def visible=(n)\n @gold_window.visible = n\n super\n end", "title": "" }, { "docid": "0fedc77d76e0cad06daeb5194c1ff457", "score": "0.654712", "text": "def visible=(value)\n @background.visible = v...
15a2f9f3211327e0a7799b5cfcf55c48
PATCH/PUT /boards/1 PATCH/PUT /boards/1.json
[ { "docid": "af8bf7facb6658bbc57a47afb7ab2efc", "score": "0.6685053", "text": "def update\n respond_to do |format|\n if @board.update(board_params)\n format.html { redirect_to @board, notice: 'Board was successfully updated.' }\n format.json { render :show, status: :ok, location: @b...
[ { "docid": "c7da9feae20ef25b3e4c8537e53f1283", "score": "0.70116717", "text": "def update\n @board = Board.find(params[:id])\n\n respond_to do |format|\n if @board.update_attributes(params[:board])\n format.html { redirect_to @board, notice: 'Board was successfully updated.' }\n ...
5684383ed6a1586c5aac27e9b1a2153d
Returns the path to the Primavera API
[ { "docid": "2303fe11e118a6af3c3ec3f1c78b2106", "score": "0.74803394", "text": "def primavera_path(url)\n 'http://localhost:49275/api/'+url\n end", "title": "" } ]
[ { "docid": "1af10abe0888cb364c86f828ebd9f611", "score": "0.7327003", "text": "def api_path\n @api_path ||= find_api_path(base_uri)\n end", "title": "" }, { "docid": "2bb9b0a2fa7d201dde164472540f18fa", "score": "0.7271751", "text": "def api_path(path)\n \"/rest/v#{optio...
9acfdf244624b587542a17a81839a527
list all academics involved in assessing this project
[ { "docid": "9a30fc6eda063d50ccf623b01003d15c", "score": "0.6978265", "text": "def academics\n [supervisor] + examiners\n end", "title": "" } ]
[ { "docid": "a97ca8af8892139ba59668535cdd6392", "score": "0.64476216", "text": "def index\n @academies = Academy.all\n end", "title": "" }, { "docid": "5b402e4fdbae2a9d0b9b33cf425ae642", "score": "0.64055073", "text": "def accompanists\n self.appearances.with_role('accompanist'...
8fda8a973924cde43b2a823be91c993e
To make comparison easier sort and uniq all arrays in properties hash By default ['a', 'b'] != ['b', 'a'], hence it's required
[ { "docid": "3a1b1e7f88834026f954309753e3699e", "score": "0.78327745", "text": "def standardize_properties(hash)\n hash.each do |k, v|\n hash[k] = v.sort.uniq if v.is_a?(Array)\n end\n\n hash\n end", "title": "" } ]
[ { "docid": "ac92becab7cff8a0c68551f72492c705", "score": "0.72271883", "text": "def unify_properties(properties)\n properties.each do |k, v|\n if v.is_a?(Array)\n properties[k] = v.map(&:to_s)\n properties[k] = v.sort.uniq\n else\n properties[k] = v.to_s\n ...
9d784632b60e056500775b1f92a66848
Indicates an error in the text box by turning current text red.
[ { "docid": "0ad00a218bdf0ebfcc48ee6088288a45", "score": "0.7898052", "text": "def do_error\n @error = true\n val = self.value\n clear()\n set_default_style(Wx::TextAttr.new( Wx::RED))\n set_value(val)\n set_default_style(Wx::TextAttr.new( Wx::BLACK))\n set_insertion_po...
[ { "docid": "16150d93249c076db06460431dae3d80", "score": "0.77817714", "text": "def text_error(text); text_red(text);end", "title": "" }, { "docid": "4fd8fd99d3042a7342adbbd333c59338", "score": "0.74047744", "text": "def highlight_error(text); highlight_red(text);end", "title": ""...
f94c1b327d784d19ba6a7c98bbcbbfe0
this test will make sure that the fucntion check_answer? works properly, so we are checking that it says true when we put in the right answer and false when we put in the wrong answer
[ { "docid": "e662f3cf9aeea212f574b14623f1ad7e", "score": "0.8080964", "text": "def test_answer_check_works\n assert_equal(true, @question.check_answer?(\"Pavel\"))\n assert_equal(false, @question.check_answer?(\"Wrong Answer\"))\n end", "title": "" } ]
[ { "docid": "c5f0072e96a178d6bb77062288d69a1a", "score": "0.807522", "text": "def answer_correct?(answer)\n @correct_answer == answer\n end", "title": "" }, { "docid": "c7d793ec1a0dc49c993468d944a16c42", "score": "0.8035543", "text": "def validate_answer(answer)\n answer == @re...
a99335e5b48e17f599a750dc6d48d3e6
Descriptive title for source
[ { "docid": "49b7592c9ee7ec8fa91a6adc58541dd4", "score": "0.0", "text": "def description\n returning String.new do |d|\n d << backup_site.name.capitalize \n if title && !title.blank?\n d << \" - \" << title\n elsif respond_to?(:name) && !name.blank?\n d << \" - \" << name ...
[ { "docid": "d624c8587499161cb0b2a1333b80b5c9", "score": "0.77034086", "text": "def source_title\n bib_source_title || get_item_data_by_name('TitleSource')\n end", "title": "" }, { "docid": "c6e8a2a9a1277c0a10a0acaaa6a9d297", "score": "0.76143104", "text": "def titleize\n\...
ec7faa0514c60cc1fb6999c00acdbf84
Bubble down the +root+ to its appropriate place to restore the heap property.
[ { "docid": "f78f2574629df07843b3b77cca73dfc1", "score": "0.63483334", "text": "def rebalance_single_heap(root, size)\n while size > 1\n first = first_child(root, size)\n second = second_child(root)\n \n if smaller_root_than_child?(first, second)\n # second child is bigger\n...
[ { "docid": "b3217e36c6c269201f2960f09cee36b9", "score": "0.6905328", "text": "def restore\n @root.restore\n end", "title": "" }, { "docid": "6ca02375d41f0ba94c592c34916bf354", "score": "0.67053264", "text": "def restructure\n heapArray = [@root]\n heapArray.each do |i|\n ...
fa4fbb5c57dc64101b45510787d49aa1
GET /utentes/1 or /utentes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "567ba2f2bc6a19983a01c0ddc6e9ae2b", "score": "0.6662945", "text": "def show\n @utente = Utente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @utente }\n end\n end", "title": "" }, { "docid": "766f7ce5904...
c5a9eb0a3d9fa08ee78c5c260adf4439
5, 10, 15, 20, 25...
[ { "docid": "8bef829177d33cdfb2ba5b27b5341354", "score": "0.0", "text": "def nth(n)\n\tif n <= 0\n\t\treturn 0 \n\tend\n\tif n == 1 \n\t\treturn 5 \n\telse \n\t\treturn nth(n-1) + 5 \n\tend\nend", "title": "" } ]
[ { "docid": "559c26bb04d7f384b8fda21c538a42c8", "score": "0.6720881", "text": "def multiples\n 0.step(70,10).to_a \nend", "title": "" }, { "docid": "0c7c1f37cfdef23e6ee91a952dc8d198", "score": "0.65945303", "text": "def pattern(multiple, limit)\n (multiple - 1).step(by: multiple, to...
52634e632c6c311a37bd0650d793c286
DELETE /alkohols/1 DELETE /alkohols/1.json
[ { "docid": "458c0c5face94d476152dad1a300c275", "score": "0.0", "text": "def destroy\n @alkohol.event.remove_alcohol @alkohol\n @alkohol.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.73826796", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": ...
e73dcfaf1d27330b9b07fef0cfe2f387
Returns true if the URI objects are equal. This method does NOT normalize either URI before doing the comparison.
[ { "docid": "1944d9eff80e07893064d1a8a9384dc6", "score": "0.76121855", "text": "def eql?(uri); end", "title": "" } ]
[ { "docid": "94f01da9affd3264f90c6404d550b355", "score": "0.80744123", "text": "def eql?(other)\n @uri.eql?(other.uri)\n end", "title": "" }, { "docid": "ba9164899a8874e940acc4021ce23e48", "score": "0.78251445", "text": "def ==(other)\n other.is_a?(URI) && normalize.to_s ...
47ebc97288ce42d099cfaf1f5e59f107
PATCH/PUT /documents/1 PATCH/PUT /documents/1.json
[ { "docid": "5390848e10a0dbaaef719b854b8c54d3", "score": "0.6279162", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { head :no_content }\n e...
[ { "docid": "2d32a6bb6396297f25f2a914263ae5c9", "score": "0.69231576", "text": "def update\n respond_with Document.find(params[:id]).update_attributes(params[:doc])\n end", "title": "" }, { "docid": "165ffbf60f9cc0af0fb88bfb9979e5f3", "score": "0.68758374", "...
c9665ae26f17e994f05986963faad78f
Checks to see whether the current object has a parent feature in the database. Returns true if it does, false otherwise
[ { "docid": "bfd8044abf5b20609f6a699393c20555", "score": "0.73397833", "text": "def has_parent?\n not self.parents[0].nil?\n end", "title": "" } ]
[ { "docid": "832bb6e73fb1237e14b999347fa5180f", "score": "0.83819824", "text": "def has_parents?\n if Parent.find :first, :conditions => {:feature_id => self.id}\n true\n else\n false\n end\n end", "title": "" }, { "docid": "1916d1d0f97a46c2354a041dd5e7095b", "score": ...
b8594cefa8c01b77da007c9eb39cd0d9
GET /file_assets/1 GET /file_assets/1.xml
[ { "docid": "0675bff510a708c46d8878cede3ec93a", "score": "0.66453934", "text": "def show\n @fa_id=setup_id\n @file_asset = JSON(access_token.get(\"/api/v1/file_assets/#{@fa_id}\").body)\n @tags_obj = JSON[access_token.get(\"/api/v1/tags\").body]\n @file_asset_tags = JSON[access_token.get(\"/a...
[ { "docid": "9c9d2c318aa1e40300397b2adc1f6d83", "score": "0.73688745", "text": "def index\n @file_assets = JSON[access_token.get(\"/api/v1/file_assets\").body]\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @file_assets }\n end\n end", ...
5d79e4ae77d1adc944ce514f00d0913f
The platformaware path to the Store
[ { "docid": "6ce8eb8722ceb6531c5b5a455e26dd21", "score": "0.0", "text": "def path\n path = if PLATFORM =~ /win32/\n win32_path\n else\n File.join(File.expand_path('~'), '.sake')\n end\n FileUtils.touch(path) unless File.file?(path)\n path\n end", "title": "" ...
[ { "docid": "c751649edf2b3f6b73065b876da99c3e", "score": "0.77035457", "text": "def store_dir\n \"#{base_store_dir}/#{model.id}\"\n end", "title": "" }, { "docid": "d1d3aa4f43c14248689dbd2ec23e0963", "score": "0.7557257", "text": "def store_dir\n File.join STORE_DIR, \"#{model....
c63e38da9cb707690a91edaef1796531
RedBox popup for adding new groups
[ { "docid": "9c597a86c87014496135e9d0431c310d", "score": "0.7547086", "text": "def work_group_popup_link_action_new\n return link_to_remote_redbox(\"Create new group\", \n { :url => new_work_group_url,\n :failure => \"alert('Sorry, an error has occurred.'); RedBox.close();\"},\n { :id...
[ { "docid": "8bf757e53ef3df2fb8923fa984c98367", "score": "0.6997059", "text": "def edit_group_name_by_popup(rest_method, *args)\n return '' unless rest_method.is_a? RestMethod\n \n options = args.extract_options!\n \n # default config options\n options.reverse_merge!(:style => \"\",\n ...
15a2c867671ba5f2cf60a3e8c61d4612
Sets the characters property of your app.xml file
[ { "docid": "1872099ce45f7414ee234aa4eae84c5d", "score": "0.6507459", "text": "def characters=(v)\n Axlsx.validate_int v\n @characters = v\n end", "title": "" } ]
[ { "docid": "fcc7d4defff00ef0b9aad4ca6e576985", "score": "0.59930575", "text": "def on_characters(chars)\n end", "title": "" }, { "docid": "bbe1d8089583305d72ff68a1297f8a96", "score": "0.57906544", "text": "def character=(value)\n @character = value.to_s\n end", ...
d168551ca7e11e00deeb77608b0ab5e0
GET /uids GET /uids.json
[ { "docid": "2a5c36bfb7cc6fbb17376f5bc676a133", "score": "0.0", "text": "def index\n @q = Uid.order(\"id desc\").ransack(params[:q])\n @uids = @q.result(distinct: true).paginate(:page => params[:page], :per_page => 30)\n end", "title": "" } ]
[ { "docid": "28d5e7b71c9a1059b3d47c909e8c85ba", "score": "0.7607545", "text": "def get_user_by_id_list\n @ulist = []\n if params[:uids].nil?\n badparams(\"uids\")\n else\n params[:uids].split(\",\").each do |item|\n u = User.find(item)\n if !(u.nil?)\n @ulist << ...
4293b2559e0e1c37dc7fd83c8ab3249e
Name: float32 Type: float Signed: false
[ { "docid": "465112992da000a0a180b674d91be826", "score": "0.77960885", "text": "def read_float32\n primitive_read_float\n end", "title": "" } ]
[ { "docid": "f024b088e5ce5711489ca3b7eddf00fb", "score": "0.7533379", "text": "def write_float32(value)\n end", "title": "" }, { "docid": "18a82c81ef05f64d07969de47ed277c1", "score": "0.73078144", "text": "def float32\n @content.unpack('g')[0]\n end", "title": "" }, ...
01aec46918c97d2e502899ac8845dd95
After this test runs, make sure to check that the file is returned to its original state.
[ { "docid": "152c708599da051400e2238b3979c7b6", "score": "0.0", "text": "def test_create_a_new_task\n results = Task.createNewTask(\"#{MyApp.settings.root}/tests/unit/tasks_test_add_new.txt\", \"Bob\", \"Sweep up Grandpa's ashes\", \"12373514\")\n assert_equal(nil, results)\n end", "...
[ { "docid": "071fdcf144b36a68cb7c53a488904f27", "score": "0.68665755", "text": "def test_ut_original_file_01\n assert @original_file.save\n original_file_copy = OriginalFile.find(@original_file.id)\n assert_equal @original_file.normal_result_id, original_file_copy.normal_result_id\n assert @o...
33aa9e9a7b6bb873db860cb092e835c1
Creates a new Retrieval Lite document. Upon initialization, the content is parsed into individual tokens, and its term frequencies are recorded.
[ { "docid": "95e1c6e55c1de94dd7822c983d0d736f", "score": "0.7137297", "text": "def new_document(content, opts = {})\n RetrievalLite::Document.new(content, opts)\n end", "title": "" } ]
[ { "docid": "babda404346edb5dd6662aa85dd6703b", "score": "0.6182426", "text": "def new\n @definition = Definition.new\n @words = Word.all\n end", "title": "" }, { "docid": "fde34f809b973e6b2a54aa41d1e04ad1", "score": "0.6174084", "text": "def new(raw_content, opts = {})\n...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ce377e8dad2e13e1cbc954a29df7b46a", "score": "0.0", "text": "def set_tumor\n @tumor = Tumor.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
426f5e32a043cccea3473ec21ec5ec5a
Runs a deterministic routine with no input. Captures the output
[ { "docid": "7f5233a9c42a5385ecd62f4315edd77a", "score": "0.6459206", "text": "def sim_full_program_no_input\n @output = \"\"\n # new thread\n halted = false\n @time = Time.now\n t = Thread.new(){ \n run \n halted = true\n }\n \n # Wait\n 100.times{|n|\n sleep(@sim...
[ { "docid": "d6ce545a3386ed840438c340aa5571e0", "score": "0.6524668", "text": "def process_begin(dummy, output)\n nil\n end", "title": "" }, { "docid": "336378a877a8a25e8f1785678d732bae", "score": "0.6234066", "text": "def process(input, output)\n nil\n end", "title": "" ...
71284f138e2441dbbf04d2b3d61c7c68
Update the attributes of a library link in the database
[ { "docid": "61403cf00675470757b6a5d48493254c", "score": "0.6370584", "text": "def update\n @library = @user.libraries.find(params[:id])\n raise ActiveRecord::RecordNotFound unless @library\n \n if @library.update_attributes(params[:library])\n @user.libraries.reload\n redirect_to u...
[ { "docid": "6a6b164dcede16f06192a7bf9877cd20", "score": "0.6417207", "text": "def update\n\t\tupdated_info = params.require(:rlink).permit(:link, :random_string)\n\t\trlink = Rlink.find(params[:id])\n\t\trlink.update_attributes(updated_info)\n\t\tredirect_to rlink\n\tend", "title": "" }, { "...
fb35b3359e828e1e63b294483de9d9f0
Note: host is by uid(do.1), all others by uuid
[ { "docid": "cb8ce89d91f0da86a739d71339e0c836", "score": "0.0", "text": "def tags\n request.get '/tags'\n # e.g. [\"component\", \"generation\", \"host\", \"member\"]\n end", "title": "" } ]
[ { "docid": "c1bac877c2b91c8c3c4c69204091cd43", "score": "0.7085538", "text": "def id ; @id || @host ; end", "title": "" }, { "docid": "c32e36e670f9d3865447a75bfbf8e2dd", "score": "0.6995192", "text": "def uuid\n @client.call('host.get_all', @sid)['Value'][0]\n end", "titl...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "eecf84e1ed55013b79d195c00f92f75c", "score": "0.0", "text": "def set_question\n @question = Question.friendly.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6031952", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015048", "text": "def...
b6ca1d1db51fefe5f8fdb19231a9c678
Intializes a counter. Compares pop density to a number, determines the speed of the spread. Prints a statement
[ { "docid": "8ed610fa45b0a81a2c33c5ff416f381b", "score": "0.0", "text": "def speed_of_spread#(population_density, state) #in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n # speed = 0.0\n ca...
[ { "docid": "a1153b84ff4398c4f7d4ef10bc067cf5", "score": "0.6718445", "text": "def speed_of_spread\r\n speed = 0.0\r\n\r\n if @population_density >= 200\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n speed += 1\r\n elsif @population_density >= 100\r\n speed += 1.5\r\...
98aacb3e275bc5769490b059c61fb473
GET /tipo_actividades GET /tipo_actividades.json
[ { "docid": "7b5a6037f057f7681b6efa99d1ecec96", "score": "0.63421565", "text": "def index\n\t\tauthorize! :index, TipoActividad\n @tipo_actividades = TipoActividad.all\n end", "title": "" } ]
[ { "docid": "a4326ca3557511019d221e4777c825ad", "score": "0.75004077", "text": "def index\n @tipo_actividades = TipoActividad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @tipo_actividades }\n end\n end", "title": "" }, { "d...
ee5d0f8a64bed50ef8e7cf92897dd7ef
Generates a string from converting all elements of the Array to strings, inserting a separator between each. The separator defaults to $,. Detects recursive Arrays.
[ { "docid": "24ddd664de58987290b9b1c0f3737756", "score": "0.6297396", "text": "def join(sep=nil)\n return \"\" if @total == 0\n\n out = \"\"\n return \"[...]\" if Thread.detect_recursion self do\n sep = sep ? StringValue(sep) : $,\n out.taint if sep.tainted? or self.tainted?\n\n #...
[ { "docid": "8b2893516f80a7ab374fe6c66eba6e87", "score": "0.7028389", "text": "def __io_like__array_join(array, separator, seen = [])\n seen.push(array.object_id)\n need_separator = false\n result = array.inject('') do |memo, item|\n memo << separator if need_separator\n need...
ed128513bae350eb09cefc200e5b5e2f
full_name is a function that takes a first_name, last_name and title and returns a formatted name.
[ { "docid": "17a8d3ecdb6188032cf147a51c14b487", "score": "0.0", "text": "def full_name(first_name, last_name, title)\n # Example comment line\n #initializes a local variable called name and set it to nil\n name = nil\n #conditional to run if all arguments are true (if they all exist)\n if title && f...
[ { "docid": "619f4a3ecf5ef52f2d39705a42034d46", "score": "0.90145206", "text": "def full_name(first_name, last_name)\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "46cd901b4c0199cd08a14b3e6a84218e", "score": "0.8782593", "text": "def full_name\n \"#{first...
2d96d5da7faa91292993dc963af385d1
POST /bairro_micros POST /bairro_micros.xml
[ { "docid": "ab957fb57a768c85f3b38adecf1e5022", "score": "0.5712857", "text": "def create\n @bairro_micro = BairroMicro.new(params[:bairro_micro])\n\n respond_to do |format|\n if @bairro_micro.save\n flash[:notice] = 'BairroMicro was successfully created.'\n format.html { redirec...
[ { "docid": "0d868feee734966b65697ef42ba11e3a", "score": "0.5432998", "text": "def create(bin_params)\n @rest.post('save', bin_params)\n end", "title": "" }, { "docid": "2898a7d3abde8dafc1220f1edd01f969", "score": "0.5312817", "text": "def post(buffer)\n connection.post(\"#{c...
5852efe2cce44c611ed524ca4961e665
GET /donates GET /donates.json
[ { "docid": "3d3dd86d83c256dd4349206d1102df46", "score": "0.69454885", "text": "def index\n @donates = Donate.order('id DESC').page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @donates }\n end\n end", "title": "" } ]
[ { "docid": "96d70237ab7f250be3867c8dcb481b92", "score": "0.7303026", "text": "def project_donations(project_id)\n return get(\"/projects/#{project_id}/donations\")\n end", "title": "" }, { "docid": "7f90fe7f8e2a2daa8b96ab7a5f7188b5", "score": "0.70779306", "text": "def donates(ap...
1dd9eb70f5a5260a59460febd4fcf0a7
Creates and initializes a new instance of the Deployments class.
[ { "docid": "b716e2eab6b0cce582efd27c6177f8a8", "score": "0.0", "text": "def initialize(client)\n @client = client\n end", "title": "" } ]
[ { "docid": "e8e0adc1b3aeb290f7cf2524e6a497d2", "score": "0.6728284", "text": "def new_deployment(attrs)\n Deployment.from_hash(api, attrs.merge(:app_environment => self))\n end", "title": "" }, { "docid": "1fcffe62bf8fef200bf1c95f88be2fc7", "score": "0.639266", "text": "d...
e5660eac4f8a094f6480f4862a7d6475
GET /user_accounts/1 GET /user_accounts/1.json
[ { "docid": "d77d5b92042809aa5d91d706cc15510a", "score": "0.0", "text": "def show\n @current_user_books = current_user_account.books\n @search = @current_user_books.ransack(params[:q])\n @results = @search.result(:distinct => true).order('created_at DESC')\n end", "title": "" } ]
[ { "docid": "3d3ff04ef8494c8c36fbe48c94bdaeb2", "score": "0.76470685", "text": "def accounts\n get(ROBINHOOD_ACCOUNTS_ROUTE, return_as_json: true)\n end", "title": "" }, { "docid": "ca863cb0daac453cb713dbb5798fef5d", "score": "0.75734544", "text": "def index\n accounts = curren...
909fed63f3423ad6ffd6d037584ed0d0
couldn't get this one to work for the whole, but it seemingly works for a part. tried to create helper methods but ran out of time.
[ { "docid": "943d703af13f2911101f9caf00bbc880", "score": "0.0", "text": "def enough_ingredients_for?(recipe)\n enough = false\n recipe.ingredients_required.each do |ingredient, quantity|\n @stock.each do |stock_ingredient, stock_quantity|\n enough = stock_quantity > quantity\n end\...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.6669207", "text": "def private; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.60790414", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", ...
71fabaee10950974e04181d57698a4de
tries to parse response body as a json
[ { "docid": "3caa87894bf65e50720347d84161320c", "score": "0.0", "text": "def json\n @json ||= begin\n MultiJson.load(response.body, symbolize_keys: true)\n rescue MultiJson::ParseError\n {}\n end\n end", "title": "" } ]
[ { "docid": "cfae2baa95f32a40dcdc4bb5561d11c1", "score": "0.8386819", "text": "def parse_response_body(response_body)\n begin\n JSON.parse(response_body)\n rescue\n response_body\n end\n end", "title": "" }, { "docid": "d07abf14bd931366366d69449bed981a", "score": "0.82...
a3dd328b512595e2430045f2b9b64a37
p.e. 'Phil recoit le mail ... '
[ { "docid": "f6fd9a9b5df577b9939ce948999bf13a", "score": "0.0", "text": "def mail chaine, options = nil\n chaine.instance_of?(ChaineMethod) || chaine = ChaineMethod.new(chaine, options)\n chaine << 'mail'\nend", "title": "" } ]
[ { "docid": "58ef8552cefb8da8855b52eb28181664", "score": "0.7345581", "text": "def get_the_email_text(name)\n\tname.capitalize!\n\tbody = \"Bonjour,\nJe m'appelle #{NAME_OF_SENDER}, je suis élève à The Hacking Project, une formation au code gratuite, sans locaux, sans sélection, sans restriction géograph...
0cb328d7be5dae98550948aa76223650
request is overridden and the request and response are stored as a hash that can be written to a cache file
[ { "docid": "3f087af77b0a9b45a069c54bca9ab5e2", "score": "0.0", "text": "def request(req, body = nil, &block)\n response = alias_for_request(req, body)\n path = \"http://#{req.bauth if req.bauth}#{req['host']}#{req.path}\"\n if @@fakes[req.method][path]\n @@fakes[req...
[ { "docid": "c7d78b474b36e5b9578bc1edbd927b10", "score": "0.7143681", "text": "def cache_request\n cache\n end", "title": "" }, { "docid": "77ff47c7f24d5b1bbc2004251ed2c1e1", "score": "0.7005633", "text": "def write(request, response)\n key = cache_key_for(request)\...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "11678058718c100239ae2469381dd416", "score": "0.0", "text": "def update!(**args)\n @monthly_day_recurrence = args[:monthly_day_recurrence] if args.key?(:monthly_day_recurrence)\n @monthly_weekday_recurrence = args[:monthly_weekday_recurrence] if args.key?(:monthly_weekday_re...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
4eea37dc1f5df224c1473ccdc3fd91eb
Perform any necessary initial requests to the network server By default, this is empty, but can be overridden by subclasses.
[ { "docid": "1334945040d98a44ef2947d6859808e1", "score": "0.65782005", "text": "def initial_requests(_requester)\n # Intentionally left blank\n end", "title": "" } ]
[ { "docid": "ceb7b6811dc064d3d432a48e7695d194", "score": "0.65113693", "text": "def initialize(*args)\n super\n @requests = Requests.new(self, @handler, @reactor)\n @ordered_workers = Array.new\n end", "title": "" }, { "docid": "3eaf4d1a2149af448769e86b707581...
11cc3b76b3b876e267754939f9e76ffb
returns width of image
[ { "docid": "5e65bd020d395cb5617e77a195a3a28d", "score": "0.8550912", "text": "def width\n @image[\"width\"]\n end", "title": "" } ]
[ { "docid": "ad23a5da3b7103fba845cbbd1f9e6d2f", "score": "0.88126445", "text": "def width\n @image.width\n end", "title": "" }, { "docid": "ad23a5da3b7103fba845cbbd1f9e6d2f", "score": "0.88126445", "text": "def width\n @image.width\n end", "title": "" }, { ...
bfbcddcc918ef40f76e5014276919dbc
Preview this email at
[ { "docid": "f6781c33e920a36417bceb75e7dbb67d", "score": "0.0", "text": "def failure\n UserMailer.failure\n end", "title": "" } ]
[ { "docid": "947d18f31928dcf9761bdcbda7f18565", "score": "0.71475905", "text": "def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end", "title": "" }, { "docid": "f9cb02c07e98bbf5e69bcea1540cfe24", "score": "0.71186084", "text": "def preview\n @e...
d41455b1c0d6348811987aef31610039
FIXME: convert everything to float with .to_f (ref:
[ { "docid": "e64eb1e440da05389f3ce36fdc5e9fc2", "score": "0.0", "text": "def test_scalar_exp\n assert_equal [1,4,9,16], @matrixConst.scalar_exp(2)\n end", "title": "" } ]
[ { "docid": "9486a64340ef1ace92bd9050308ef5c6", "score": "0.7542367", "text": "def value_to_float(value); end", "title": "" }, { "docid": "9486a64340ef1ace92bd9050308ef5c6", "score": "0.7542367", "text": "def value_to_float(value); end", "title": "" }, { "docid": "03f57d72...
ff232017c55e02e647f0fe0e3f446754
/deputes/fiche/OMC_PA722268 PB DE CONNEXION TCP DEPUIS 20H..............
[ { "docid": "fa4bfb1d0964bd104aadb399ce50c630", "score": "0.0", "text": "def get_first_name(url)\n\tpage = Nokogiri::HTML(open(\"http://www2.assemblee-nationale.fr#{url[1..-1]}\"))\n\n\tget_first = page.xpath('//body/div/div[3]/div/div/section/div/article/div[3]/div/div/div/ul/li/a').text\n\n\t# sort un ...
[ { "docid": "eace621a523bcbf3e044d8575b9b3c58", "score": "0.54208106", "text": "def url\n \"#{site.distant_url}/bureau/#{frigo.owner_id}/frigo#mess_#{id}\"\n end", "title": "" }, { "docid": "e9c63a34fdc7f0f7a7f84134154b636b", "score": "0.54112303", "text": "def promedio\n print ...
712e935577fee16fadf11c2b5e8a411f
It accomplishes this feat through massive randomization. The number of possible UUID values is approximately 3.4 X 10E38. Each UUID consists of 32 hexadecimal characters, and is typically broken into 5 sections like this 844412 and represented as a string. It looks like this: "f65c57f6a6aa17a8faa1a67f2dc9fa91" Write a ...
[ { "docid": "5b2f40407a53c9418f64818947d00c75", "score": "0.8381121", "text": "def return_uuid\n hex_chars = ('0'..'9').to_a + ('a'..'f').to_a\n section_lengths = [8, 4, 4, 4, 12]\n full_number = []\n\n section_lengths.each do |len|\n hex_number = ''\n len.times do\n char = hex_chars.sampl...
[ { "docid": "a100d8916ea8d24e46d97008a4ab46d6", "score": "0.8833402", "text": "def return_uuid\n hex = \"0123456789abcdef\"\n \n hex_arr = hex.chars\n # => [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n \n uuid = \"\"\n str = \"\"...
fe8cd7ce30dc82d3f817f8e1130e6009
GET /quizzes/new GET /quizzes/new.json
[ { "docid": "4fd66180a158269d95448a82d7f3605b", "score": "0.722131", "text": "def new\n @quiz = Quiz.new(:organization_id => current_org.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quiz }\n end\n end", "title": "" } ]
[ { "docid": "a294bd3f05deed2a4f656e83e7216e27", "score": "0.8201562", "text": "def new\n @quizz = Quizz.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quizz }\n end\n end", "title": "" }, { "docid": "1f4e2d1bdf10e259de99b1dd657392...
249aa56170f2cc86e189f5c874891739
Sets the hostPairingBlocked property value. indicates whether or not to allow host pairing to control the devices an iOS device can pair with when the iOS device is in supervised mode.
[ { "docid": "549475883c5a373ac4d1b7fc842233fa", "score": "0.8392774", "text": "def host_pairing_blocked=(value)\n @host_pairing_blocked = value\n end", "title": "" } ]
[ { "docid": "ac2d1ecc027e4d8f7fdde8684d3a7f69", "score": "0.6876293", "text": "def host_pairing_blocked\n return @host_pairing_blocked\n end", "title": "" }, { "docid": "e31402f20079feae4955fe569545dfe3", "score": "0.6033915", "text": "def bluetooth_blocked=(...
43e93fbc39127396aaddd759dddef2f4
When a symbol, say symb, in a rhs is followed by a '' modifier, then a rule will be generated with a lhs named symb suffix_plus implicitly called: rule('declaration_star' => 'declaration_star declaration').tag suffix_star_more implicitly called: rule('declaration_star' => '').tag suffix_star_last
[ { "docid": "c09b7e2cf7a6b33ae254dc0baafbe7d6", "score": "0.5790385", "text": "def suffix_star\n '_star'\n end", "title": "" } ]
[ { "docid": "2a9ed1725f2a3c87cf957c9e3add734c", "score": "0.6174396", "text": "def symbol_suffix\n \"* \"\n end", "title": "" }, { "docid": "1e97d8df683e6487b92f9639179d9a03", "score": "0.6147746", "text": "def disambiguate_symbol; end", "title": "" }, { "docid": "...
bd3a7dfddc30bc69012064ac1ec450c4
Given a hash with numeric values, return the key for the smallest value
[ { "docid": "72b82d2405ecc595050d1327e6a1b490", "score": "0.0", "text": "def key_for_min_value(name_hash)\n lowest_key = nil\n lowest_value = nil\n name_hash.each do |name, value|\n if lowest_value == nil || value < lowest_value\n lowest_value = value\n lowest_key = name\n end\n end\n...
[ { "docid": "187165074e32a7573ee53a9cabb44ed4", "score": "0.8880842", "text": "def key_for_min_value(hash)\n lowest_key=nil \n lowest_value= Float::INFINITY\n hash.each do |name,number|\n if number < lowest_value\n lowest_value=number\n lowest_key= name\n end \n end\n lowest_key\nend...
633f707d8846520c2764d12045e1f1d4
This makes the assumption that duplicating the decorator is intended to produce a new "wrapper" around the associated object and not to also create a new object as well (which can lead to unexpected results).
[ { "docid": "ffb9258e945a7eba755b466d0d0cdfb8", "score": "0.0", "text": "def deep_dup\n # noinspection RubyMismatchedReturnType\n dup\n end", "title": "" } ]
[ { "docid": "51bfbf6ae0d75d14a48c9fef610c0ff2", "score": "0.71186435", "text": "def decorate!; end", "title": "" }, { "docid": "51bfbf6ae0d75d14a48c9fef610c0ff2", "score": "0.71186435", "text": "def decorate!; end", "title": "" }, { "docid": "bf1ce9774737d15f7e2bf7a579dbeb...
b5b2aa32bc2c4cb97adf59d17e849591
Wrapper to pull a list of countries from our table It will also call an Ajax function which changes a container with an id of 'state_select_container' to a drop down with the proper states for that country.
[ { "docid": "a9a28f36900fc4b1141c3c7e04671783", "score": "0.6893179", "text": "def ut_country_select_with_states(object, method, method_state, options = {:include_blank => true}, html_options = {}) \n collection = ::StateCountryConstants::PRIMARY_COUNTRIES + DmCore::Country.find(:all, :order => '...
[ { "docid": "1d382ef342f580f1cde1d100ba1c2024", "score": "0.67279816", "text": "def list_states\n if params[:country_2_code].present?\n all_states = [[\"\", \"Select State/Province\"]]\n Country.find_country_by_alpha2(\"#{params[:country_2_code]}\").states.sort.map { |state|\n all_sta...
6ebd9e67c1eca4687f5867eb630a5605
access the GET param
[ { "docid": "c392d58c354593efeebfc6dab89b692d", "score": "0.6649131", "text": "def get?(param)\n if !@get[param].nil?\n @get[param]\n else\n nil\n end\n end", "title": "" } ]
[ { "docid": "2ca3ffaf3490b1a0664bf5677cb5671a", "score": "0.77748257", "text": "def get_param\n return @payload.get_path(\"param\"){@name}\n end", "title": "" }, { "docid": "2ca3ffaf3490b1a0664bf5677cb5671a", "score": "0.77748257", "text": "def get_param\n return @pay...
e7b131f8f01a1c7c836be64aed7ebbd5
Protected current_selections Hash of element Arrays, keyed by bucket name. wanted_distribution The wanted distribution as a hash of percentage Floats. Returns Hash of multipliers needd for each bucket to reach its current wanted distribution.
[ { "docid": "5acb3d64ba78339f8308343de233dc33", "score": "0.87243944", "text": "def needed_multipliers( current_selections, wanted_distribution )\n total_size = self.class.elements_count( current_selections )\n \n current_selections.keys.inject({}) do |memo, bucket_name|\n bucket_si...
[ { "docid": "f4512757ffcb89776293cc6b6c47e63f", "score": "0.73476726", "text": "def trim_candidates( current_selections, wanted_distribution )\n multipliers = self.needed_multipliers( current_selections, wanted_distribution ).to_a\n multipliers.select do |bucket_name, multiplier|\n # Can...
ffc6e7c93fecbeae852e66870e107d71
specify if medium is given in params hash
[ { "docid": "f526c4f652cf2071dad012425242ba12", "score": "0.752752", "text": "def medium_params_set?\n params[:resource][:medium_attributes] && params[:resource][:medium_type]\n end", "title": "" } ]
[ { "docid": "2d9a3f9ee4d8ca7d2dd9f6cf27acfc8e", "score": "0.7108584", "text": "def medium_params\n params.require(:medium).permit(:user_id, :article_id, :url, :title, :caption, :is_featured, :type)\n end", "title": "" }, { "docid": "fa6301a158310611912f9d32045eaa05", "score": "0.7...
e66c50449af73bf69421f1290d46eb37
DELETE /field_goals/1 DELETE /field_goals/1.json
[ { "docid": "eab3c822b64a957272c1d544f2b64262", "score": "0.7955508", "text": "def destroy\n @field_goal = FieldGoal.find(params[:id])\n @field_goal.destroy\n\n respond_to do |format|\n format.html { redirect_to field_goals_url }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "7115691780a30d726d21900cbaa529d7", "score": "0.69958353", "text": "def destroy\n @goal = Goal.find(params[:id])\n @goal.destroy\n\n respond_to do |format|\n format.html { redirect_to list_goals_path }\n format.json { head :no_content }\n end\n end", "title": "" }...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "725fe253322f6f73b5936e31414ba59d", "score": "0.0", "text": "def root_certificate_params\n params.fetch(:root_certificate, {}).permit(:ca, :key)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
038a0fadb3e969c1c21a9394d066ccf8
Search for a product Handles : Post /searchproduct Renders : products/index > if find the item
[ { "docid": "d39e9de392f0517fe58029c7860df179", "score": "0.72316366", "text": "def search\n q = params[:query]\n @products = Array.new\n\n if q\n all = Product.all\n if !all.empty?\n all.each do |p|\n if (p[:description] =~ /#{q}/i) or (p[:title] =~ /#{q}/i)\n ...
[ { "docid": "7ab1ac7f30c3e149d0d71c6c754d9e2b", "score": "0.75638705", "text": "def search\n @products = Product.search(params[:query], params[:type])\n render partial: 'results'\n end", "title": "" }, { "docid": "54f99c39d7682bcc92ef7f71cf463dba", "score": "0.7554095", "text":...
8904e609db9261459f9da7fe6754c86b
User who committed this revision to this file
[ { "docid": "9e5f843178d58a54a14dfe833943fbe0", "score": "0.6394793", "text": "def user; changeset.user; end", "title": "" } ]
[ { "docid": "ac257cdf4aaae1d7f8cc5774eec5b7a3", "score": "0.7323493", "text": "def author\n new_commit.author\n end", "title": "" }, { "docid": "8d95b5ead81b09cd97d2c1b836ae7e74", "score": "0.7156232", "text": "def author\n @author ||= run 'git config --get user.name'...
cef4d61019d9fda56b21d027975f8861
a method to create a biosequence based on a feature extracted from a rich sequence object
[ { "docid": "8e68a559914582a6a40863af7dc79fe7", "score": "0.8225472", "text": "def create_biosequence_from_feature(feature,rich_sequence_object, protein = false)\n location_string = location_string_from_feature(feature)\n cds_sequence = rich_sequence_object.seq.splice(location_string)\n cds_sequence =...
[ { "docid": "7530f4fe1c0aa725e2745cbf2ff9a52c", "score": "0.7399077", "text": "def create_features_ensembl_seq_obj(bioseq,targets)\r\n targets.each do |key,value|\r\n f1 = Bio::Feature.new(\"target_CTTCTT\",\"#{key[0]}..#{key[1]}\")\r\n #im no sure if it is a interior coding exon \r\n ...
0608eb41d339cec2e2957d6c3817d5af
Extract the root and wildcard part of the pattern
[ { "docid": "1fe8b8dba2de5d1702cdfc80500c4c8e", "score": "0.49832273", "text": "def scan\n @segments.each_with_index do |segment, i|\n if @found_wildcard || segment.include?('*')\n add_to_wildcard(segment)\n else\n if i == @segments.size - 1 # For the last segment it might be a...
[ { "docid": "2a9b58ed63324e42eb41212d14720b7e", "score": "0.68688494", "text": "def extract(pattern); end", "title": "" }, { "docid": "bd648d427d659757c285e260d4615061", "score": "0.59348166", "text": "def on_match_pattern(node); end", "title": "" }, { "docid": "6099250d89...
92a71413b26bf0744c9cf17baa0dcc5b
The Hotel Order Instant API `https` request
[ { "docid": "6ae70defa1ad40e58fd9384819fcb909", "score": "0.578804", "text": "def instant(params={})\n self.request(__method__, params, https=true)\n end", "title": "" } ]
[ { "docid": "402b2161236a769a16f1e7cbb37d3cbf", "score": "0.6457484", "text": "def open_orders\n private_request 'open_orders/GHS/BTC'\n end", "title": "" }, { "docid": "aa3dc351f72f7513c09034e659cc7264", "score": "0.6320339", "text": "def order(params={})\n self.request(...
866198987008ef014d1663cb29355b14
Sets database variables from remote database.yaml
[ { "docid": "a95cab7cf8b9ec870d944e3fca63dacc", "score": "0.74440295", "text": "def load_db_config\n puts \"Rails Env #{ rails_env }\"\n cfg = remote_db_config[\"production\"]\n set(:db_file) { \"#{db_name}-dump.sql\" }\n set(:db_remote_file) { \"#{shared_path}/backup/#{db_file}\" }\n set(...
[ { "docid": "ab8d561323a073276d1ddba74a5f4dfd", "score": "0.77018684", "text": "def prepare_from_yaml\n set(:db_user) { db_config[rails_env][\"username\"] }\n set(:db_pass) { db_config[rails_env][\"password\"] }\n set(:db_host) { db_config[rails_env][\"host\"] }\n set(:db_name...
b7b3abf065cd0ac47ec172a1a9205751
Show (id: identification of the spin) Provides a view of the Spin Candidate
[ { "docid": "b0319f7d7ee187a11180d0db0e164bd8", "score": "0.82511175", "text": "def show\n @spin = SpinCandidate.find_by(user_id: current_user.id, id: params[:id])\n unless @spin\n render_error_exchange(:spin_candidate_not_found, :not_found)\n return\n end\n return_respo...
[ { "docid": "9fa7a1c4608d343226d56569d73970fb", "score": "0.7463838", "text": "def show\n return unless check_params_required(:id)\n if params[:user_id]\n @user = User.find_by_github_login(params[:user_id])\n return_response status: :not_found unless @user\n @spin = Spin.f...
982e73b4f2432d1de5cbf00778255c42
PUT /caravan_domicile_types/1 PUT /caravan_domicile_types/1.xml
[ { "docid": "156bac89f9d1f569b00d944e17ef0109", "score": "0.65478426", "text": "def update\n @caravan_domicile_type = CaravanDomicileType.find(params[:id])\n\n respond_to do |format|\n if @caravan_domicile_type.update_attributes(params[:caravan_domicile_type])\n format.html { redirect_t...
[ { "docid": "7135fb697b7207235b005378f787670c", "score": "0.64072627", "text": "def update\n @car_domicile_type = CarDomicileType.find(params[:id])\n\n respond_to do |format|\n if @car_domicile_type.update_attributes(params[:car_domicile_type])\n format.html { redirect_to(@car_domicile_...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "307b2b63cfccc277019e035ce055dd74", "score": "0.0", "text": "def set_ticket\n if @current_user.role.customer?\n @ticket = @current_user.tickets.find(params[:id])\n else\n @ticket = Ticket.find(params[:id])\n end\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
8d71950d758298cc87d711022e825966
Creates a temporary variable with an unused name.
[ { "docid": "003eb822a9b682021818444324a3130a", "score": "0.68068546", "text": "def create_temporary(name = nil)\n unless name\n @temporary_counter += 1\n name = current_temporary\n end\n Bindings::TemporaryBinding.new(name, nil)\n end", "title"...
[ { "docid": "1d9c1b644b8528e57c187fdfc8f02662", "score": "0.6824677", "text": "def tmpVar(name); \"#{'_'*3}#{name}#{'_'*3}\" end", "title": "" }, { "docid": "1d9c1b644b8528e57c187fdfc8f02662", "score": "0.6824677", "text": "def tmpVar(name); \"#{'_'*3}#{name}#{'_'*3}\" end", "titl...
37236e10b7d80faffa950e0ae5f03284
Splits a newline separated string into LDAP groups for this group. +value+ can be either a newline separated string or an array of strings.
[ { "docid": "e32236cd1b11c50668c98a04050bf70e", "score": "0.65329504", "text": "def ldap_group_list=(value)\n # convert string into array.\n value = value.split(\"\\n\") if value.is_a?(String)\n\n @ldap_group_list = nil\n\n if value.is_a?(Array) && value.count > 0\n\n value = value.map{|...
[ { "docid": "5ebd1c6c15e2e3e196c92f819a1d86f4", "score": "0.6273542", "text": "def split_value(value)\n arr = value.split(pattern)\n # If the result of split is empty, it was probably an empty string.\n if arr.empty?\n return [value]\n end\n\n arr\n end", "title": "...
cd6a177ef7779fcef8def5d2083cb5e1
Check if there are no matching previous passwords in the history The number of passwords to look back is in Settings::CheckPrevPasswords
[ { "docid": "d41572c89d3eb420a4bd28ad1309565c", "score": "0.8744205", "text": "def no_matching_prev_passwords\n num = Settings::CheckPrevPasswords\n\n # If number is 1, this counts as the previous password, which we are checking anyway in default new_password_changed?\n return true if num < 2\n\...
[ { "docid": "995c3ac9ab89f9c79a8df679679a5965", "score": "0.6865938", "text": "def valid_password_history_count?\n self.class.password_history_count > 0\n end", "title": "" }, { "docid": "59fee91b048c09263af767423134c217", "score": "0.6774348", "text": "def password_in_his...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b34fe965d70dcecc1a5ba5808dc925b1", "score": "0.0", "text": "def set_pick\n @pick = Pick.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
906258c25a3486fbc68588db9a48e0c9
GET /cxpt/mnews/1 GET /cxpt/mnews/1.json
[ { "docid": "2fd391ac9b4b4e47a52377a440261f88", "score": "0.0", "text": "def show\n p @cxpt_mnews.cate\n end", "title": "" } ]
[ { "docid": "edd7ba9766c5a97dc99627879c5a83c9", "score": "0.7622871", "text": "def getNews\n request \"/Notification/getNews.json\"\n end", "title": "" }, { "docid": "ad0bef7f61ae2451b93c6a1d2a4e1eb2", "score": "0.71872675", "text": "def index\n\n news_url = 'https://newsap...
be95131053f0325e539514266d7138a6
Add a new recommendation to the database
[ { "docid": "757dd9af6e24ee9b35d746d1b3cba8be", "score": "0.6437906", "text": "def create_recommendation\n instructor_id = Instructor.find_by(email: session[:user_email]).id\n \n # Determine if the request checkbox was selected\n rec_request = false\n if params[:recRequest]\n rec_requ...
[ { "docid": "e9ff4a77cc42fd65cf56b04e46778758", "score": "0.7335321", "text": "def insert_recommendation\n\t\tproblem_id = params[:p_id]\n\t\tstudent_id = params[:s_id]\n\t\trecommender_id = params[:r_id]\n\n\t\trecommendation = Recommendation.new\n\t\trecommendation.problem_id = problem_id\n\t\trecommen...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "73f40bfcb4baed6015fc6a1941ca8d07", "score": "0.0", "text": "def round_params\n params.require(:round).permit(:character, :points, :round_count, :city, :country, :river)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6981537", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.67835593", "text": "def strong_params\n params.requ...
d333edb2ab0fd08d1d227539e07d7f01
Run the given 'httpd' command with the correct config file and flags.
[ { "docid": "0705357125e3070d737147ad41daa8f4", "score": "0.7039123", "text": "def apache_cmd( command )\n\t\t\thttpd = which( 'httpd' )\n\t\t\tpid = log_and_run( @logfile, httpd, '-f', CONFIGFILE, '-e', 'debug', '-k', command )\n\t\t\tProcess.waitpid( pid )\n\t\t\treturn pid\n\t\tend", "title": "" ...
[ { "docid": "4f23d6336820b4f22bd007b0d9b8448a", "score": "0.66345733", "text": "def httpd_args\n \"-nohttpd\"\n end", "title": "" }, { "docid": "452a20424ba7798bf17cd5b08cf5c8d3", "score": "0.6407747", "text": "def start\n ctl_proxy('start','httpd started')\n ...
29cb6c9749ebf9ef4d57c19f4285e158
Perform a drag action from the right to the left side to close the menu
[ { "docid": "1232b9eec20097267a17948957fcf764", "score": "0.8672465", "text": "def close_menu\n pending\n perform_action('drag', 20, 0, 10, 10, 10)\n end", "title": "" } ]
[ { "docid": "47b45997c9f21c2d89f31c6df0fd5264", "score": "0.67490005", "text": "def close_menu\n touch_screen_element 'Close menu Button', close_menu_button\n end", "title": "" }, { "docid": "2485a08f139ff057a1c534d2e5e34a6a", "score": "0.6345155", "text": "def right_click()\n ...
9250ee8d7a0b125a7a7f460224df7a0c
Display a two dimensional color index array with nonuniform cell sizes.
[ { "docid": "af7489ac2b57dec3826da30d02d3ca07", "score": "0.5730057", "text": "def nonuniformcellarray(x, y, dimx, dimy, color)\n raise ArgumentError unless x.length == dimx + 1 && y.length == dimy + 1\n\n nx = dimx == x.length ? -dimx : dimx\n ny = dimy == y.length ? -dimy : dimy\n s...
[ { "docid": "3862085044ddc180c7b89eda2edbb8aa", "score": "0.7093974", "text": "def display_color_index\n require_color_echo_get\n\n CE.rainbow\n cnt = 134\n @padding = \" \" * 2\n\n header = \"OK, Let me check color index list... :)\"\n mes = CE.rainbow.get(@padding + \"-\" * cn...
856f601d241a87be758ff5157fcad93b
Apache has already authenticated but we are behind a proxy so use HTTP_X_FORWARDED_USER instead
[ { "docid": "f13b0b0b98ae2e8d0c036cf4395b33bf", "score": "0.7906601", "text": "def proxy_apache_authenticate\n logger.info(\"proxy_apache_authenticate as #{request.env[\"HTTP_X_FORWARDED_USER\"]}\")\n common_authenticate(request.headers[\"HTTP_X_FORWARDED_USER\"])\n return true\n end", "tit...
[ { "docid": "fcb5dfce977adf6570acc296d3a66bd9", "score": "0.7304366", "text": "def admin_http_auth_user\n # This needs special magic in mongrel: http://www.ruby-forum.com/topic/83067\n # Hence the second clause which reads X-Forwarded-User header if available.\n # See the rewrite rul...
1b5227829676abed246843cf9534a202
Displays the current turn and current player.
[ { "docid": "be8d907aca9ec248bc6fcb1506d46444", "score": "0.8251152", "text": "def display_current_turn\n puts \"Turn #{@turn + 1}, Player #{(@turn % 2) + 1}\"\n end", "title": "" } ]
[ { "docid": "b1c2d4eadbd4f9cbf36d4abe0e59f98e", "score": "0.7741393", "text": "def view_turn\n Display.draw_board(@cur_board, @player_white, @player_black)\n Display.move_info(@turn, @player_to_move, FileReader.get_move(\"#{@turn}#{@player_to_move}\", @data))\n end", "title": "" },...
fc893e9eaf4b8337a9ef4b8061094666
PATCH/PUT /fund_raise_supports/1 PATCH/PUT /fund_raise_supports/1.json
[ { "docid": "b5acd0c8f0d96c0806d19c2b2ecc04aa", "score": "0.6783993", "text": "def update\n respond_to do |format|\n if @fund_raise_support.update(fund_raise_support_params)\n format.html { redirect_to @fund_raise_support, notice: 'Fund raise support was successfully updated.' }\n f...
[ { "docid": "ed0826bfec77d499b10e6b0e6ded59c9", "score": "0.60996455", "text": "def patch?; request_method == \"PATCH\" end", "title": "" }, { "docid": "d9b581cab2333ebe97150464311bc619", "score": "0.6030202", "text": "def update\n respond_to do |format|\n if @fund_require...