query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
b01243243b4c6952df42269c29be156a | Remove the node and shift depth of descendant nodes. soft delete (1) soft delete (2) grove delete (3) normal delete | [
{
"docid": "37a91fafc54f1415ed498311b00272f4",
"score": "0.67256975",
"text": "def remove(node_obj)\n transaction do\n remove_node = ff_resolve_nodes(node_obj, true) # refresh\n raise ActiveRecord::Rollback if remove_node.blank? # nil as dubious\n\n ... | [
{
"docid": "9e2b4870bb85a1b013f1f97c439ecef5",
"score": "0.72230095",
"text": "def delete\n if @left.leaf? && @right.leaf?\n if @parent==nil\n @tree.root=leaf_instance\n elsif @parent.left==self\n @parent.left=leaf_instance\n else\n @par... |
d9fa3cdfb02730bfd907220af01c81ab | Drawing a card from end of deck. // Returns: Card object | [
{
"docid": "6ff42be541b0626b8b1db478a013c7c7",
"score": "0.7496729",
"text": "def draw\n @deck.pop\n end",
"title": ""
}
] | [
{
"docid": "521ff8b21056aed59128da220a962714",
"score": "0.8280967",
"text": "def draw_card(deck)\n deck.shift\n end",
"title": ""
},
{
"docid": "f22e561147b0694a9d9a4ee7acf36b8b",
"score": "0.8272277",
"text": "def draw_a_card\n @deck.pop\n end",
"title": ""
},
{... |
b022786f85160e6aa7b84778a817b589 | calls Marhal.dump to marshal out a two item array. The first item is the list from Item.children. The second item is snap | [
{
"docid": "53dcda7e03de289391d79ed90791cd17",
"score": "0.64650595",
"text": "def dump(path, snap)\n Zlib::GzipWriter.open(dump_path(path), 9) do |gz|\n Marshal.dump([ $snapper_version, $snapper_release, Item.children, snap ], gz)\n end\n end",
"title": ""
}
] | [
{
"docid": "e461fa04f1e772c7251f7ef39d4a80f8",
"score": "0.6390905",
"text": "def marshal_dump\n inv = []\n each do |o|\n if o.is_a? GameObject\n inv << [o.game_object_id, position(o)]\n else\n inv << [o, position(o)]\n end\n end\n\n inv << @capacity\n \n\n ... |
62a1020fcf1bf405f02f0563bb2a4a10 | Probably a better way to do this. Make it a little more DRY | [
{
"docid": "94d77513521b18745d339ca0715117ca",
"score": "0.0",
"text": "def post_response(api_method, data, format=nil, additional_headers=nil)\n if format == :json\n headers = {'Accept'=>'application/json'}\n end\n if additional_headers\n headers.merge!(additional_headers)\... | [
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.66319907",
"text": "def private; end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
"score": "0.5941408",
"text": "def probers; end",
"title": ""
},
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
... |
5e5fff051a76c101363672954574e6ef | Prepares tests for an api request | [
{
"docid": "3c15c67b00dfdcc384590417a314271b",
"score": "0.5747423",
"text": "def testing_api_request(id)\n fixture = File.read(File.expand_path(\"../fixtures/api_response.json\", __FILE__))\n stub_request(:get, \"https://favro.com/api/v1/cards?cardSequentialId=#{id}&unique=true&limit=1\")\n .to_re... | [
{
"docid": "7dfb83e110f3e51a57d119ea68f3c701",
"score": "0.6542729",
"text": "def setup\n @controller = SourceDataController.new\n @request = ActionController::TestRequest.new\n @response = ActionController::TestResponse.new\n \n @source_name = 'something'\n @unexistent_name =... |
8b6a273919d8bca2e89384110f74a396 | There is no "minimum" UUID. | [
{
"docid": "e8dfe155762061ba8315a1fe276e26a9",
"score": "0.64234334",
"text": "def minimum_id(...)\n end",
"title": ""
}
] | [
{
"docid": "a2fe83d9ffc27745ebcfe3acf39751d4",
"score": "0.76210165",
"text": "def short_uuid\n uuid[0..7]\n end",
"title": ""
},
{
"docid": "3c720880a9bc82c777bccd36d442eead",
"score": "0.7141723",
"text": "def short_uuid\n rand(36**8).to_s(36)\n end",
"title": ""
},
... |
ede1e4e478c2dfafcff2e8a9096bf855 | no pieces between king and rook, and both are at their original positions | [
{
"docid": "0db7dfd405c2e6b10815c227b4214314",
"score": "0.0",
"text": "def castling?\n\t\trooks = self.game.pieces.where(\"user_id = ? AND type = ?\", self.user_id, \"Rook\")\n\t\trooks.each do |rook|\n\t\t\tif !rook.has_moved && !self.has_moved && !rook.pieces_between?(self.x_position, self.y_position... | [
{
"docid": "9fd8375209b7aaf6c3d61965499a28a7",
"score": "0.72796226",
"text": "def moves\n # All pieces can stay in place\n [[0,0]]\n end",
"title": ""
},
{
"docid": "d62398e3c267aa043e175337c4e014bf",
"score": "0.7224177",
"text": "def checkmoves(king, attacking_pieces,... |
05110790ec9128deec110f177bdc659e | Paths for which the link is required. The return value is an empty array if the link is not embedded in a graph. Otherwise, an array of tuples path/boolean is returned. The boolean value tells if the link is used in direct (true) or reverse direction (false) in the path. | [
{
"docid": "0e6d3b4b1df6a0fb96eba309ea66703a",
"score": "0.5078577",
"text": "def paths\n @paths ||= []\n @paths\n end",
"title": ""
}
] | [
{
"docid": "428ae8a55741e36e3c964d1a94c0e654",
"score": "0.57820004",
"text": "def path?(point, direction)\n @paths[point] & direction != 0\n end",
"title": ""
},
{
"docid": "6a88d6919f84c97e1118155b0a8f30d7",
"score": "0.5749842",
"text": "def directed_only?\n true\n end... |
6bb81ccbbe52d8d2950727bffa6c95bc | Extract the error code from a log line | [
{
"docid": "da99378948fa3c7daad16770ba11e7fc",
"score": "0.84142375",
"text": "def extract_error_code(line)\n line.split(' ')[0]\n end",
"title": ""
}
] | [
{
"docid": "92e3be998f3843ab922dfe9815498b45",
"score": "0.7470794",
"text": "def error_code\n /^%ERROR:(.*)$/\n end",
"title": ""
},
{
"docid": "91b2d02ecf2cfc8fc1f11d4cea4028b5",
"score": "0.7451676",
"text": "def line_log_error(log)\n log.find { |line| line.include? '... |
e152b41696f8e8745ea7ce9058d0026d | Searches the source for a title. | [
{
"docid": "1e6f1ad4bb8ad4f462885cd54f7ad4e5",
"score": "0.64619976",
"text": "def extract_title(source)\n match = source.match(/#{@info[:class_name]}\\.new.*?:title\\s=>\\s[\"'](.+?)[\"']/m)\n match ? match[1] : File.basename(@file, '.rb').titleize\n end",
"title": ""
}
] | [
{
"docid": "0d6ff93adbacff76ce68bc4be00e7564",
"score": "0.7450373",
"text": "def getByTitle(title)\n return @sourceHash[title]\n end",
"title": ""
},
{
"docid": "66ba5e52831e63cfca2ffacfb4977cf0",
"score": "0.7011563",
"text": "def find_by_title(title)\n all = self[:all]\... |
4f4373f6e7e9dd52fe2e25d013a6f524 | Scenario: method name "<" Default: pass | [
{
"docid": "165eed291c04c6c61abf774cebdf3574",
"score": "0.0",
"text": "def <\r\nend",
"title": ""
}
] | [
{
"docid": "327c8a72c08fb60b904e51ff0a9d1307",
"score": "0.66089463",
"text": "def scenario; end",
"title": ""
},
{
"docid": "327c8a72c08fb60b904e51ff0a9d1307",
"score": "0.66089463",
"text": "def scenario; end",
"title": ""
},
{
"docid": "fde55acc7ede19d371c586be7b27b1af... |
d44ec723fcb951155f1e969d0bca1723 | GET /through_tables/new GET /through_tables/new.json | [
{
"docid": "10eb5d8ae3181bcf49ad9f66a35ff1f7",
"score": "0.8424862",
"text": "def new\n @through_table = ThroughTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @through_table }\n end\n end",
"title": ""
}
] | [
{
"docid": "667de3b36ebf233e3dedc7f739168003",
"score": "0.7816837",
"text": "def create\n @through_table = ThroughTable.new(params[:through_table])\n\n respond_to do |format|\n if @through_table.save\n format.html { redirect_to @through_table, notice: 'Through table was successfully c... |
abdfcd37b31970d18df3a3e10c000b5e | GET /participatings GET /participatings.json | [
{
"docid": "7fa897e48cefcc3fb17b4b4fba0a347a",
"score": "0.77547425",
"text": "def index\n @participatings = Participating.all\n end",
"title": ""
}
] | [
{
"docid": "837c99f6e23fc98c6868a30e049c11c8",
"score": "0.764624",
"text": "def index\n @participates = Participate.all\n respond_to do |format|\n\t\t\tformat.html { render :index }\n\t\t\tformat.json { render json: Oj.dump(@participates) }\n\t\tend\n\n end",
"title": ""
},
{
"docid"... |
ff1f3814ffb467db84f5da295024783b | Returns the contact with the specified id. If no contact has the id, returns nil. | [
{
"docid": "e6ba29ba46f81fec5d7f3e91025f29e5",
"score": "0.69793946",
"text": "def find(id)\n # Find the Contact in the 'contacts.csv' file with the matching id.\n contacts = CSV.read('./contacts.csv')\n contact_find = []\n find_contact = contacts.map do |array| \n if array[0]... | [
{
"docid": "d9ad9883e7097329ecdce00899340aba",
"score": "0.87318325",
"text": "def find(id)\n raise ArgumentError, \"You must enter a valid ID.\" if id.nil?\n contact = Contact.all.find { |contact| contact.id == id }\n raise ContactNotFoundError, \"No contact with ID #{id} found.\" if con... |
995bf028c2da0b0b3231af6b60717b48 | Get the total number of recommendations. | [
{
"docid": "a7d128b5e26c783743b245cad49fab5c",
"score": "0.8489242",
"text": "def total_recommendations\n\t\t\trecommendations = 0\n\t\t\tmeal_recommendations.each do |r|\n\t\t\t\tif r.rating?\n\t\t\t\t\trecommendations += 1\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn recommendations\n\t\tend",
"title": "... | [
{
"docid": "7960938be6f6a4ef1ca858e62d1e24b1",
"score": "0.77775013",
"text": "def article_recommended_count\n article_recommended_count = 0\n self.articles.each do |article|\n article_recommended_count = article_recommended_count + article.article_recommendations_count\n end\n article_... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "988c66030d7e4f1df1fd5e0ebfda596d",
"score": "0.0",
"text": "def seat_params\n params.require(:seat).permit(:concert_id, :row, :number, :price)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74939764",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6955084",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
b330ec7fcd222079b96c384b6e6f4e1c | POST /evaluation_account_events POST /evaluation_account_events.json | [
{
"docid": "ca0f579f884778af3f4fb552c10ca28e",
"score": "0.7740737",
"text": "def create\n @evaluation_account_event = EvaluationAccountEvent.new(evaluation_account_event_params)\n\n respond_to do |format|\n if @evaluation_account_event.save\n format.html { redirect_to @evaluation_acco... | [
{
"docid": "963243e15812016d98cacd47e491ded1",
"score": "0.6816245",
"text": "def evaluation_account_event_params\n params.require(:evaluation_account_event).permit(:num_followers_start, :num_followers_end, :evaluation_id)\n end",
"title": ""
},
{
"docid": "e6c2399eab89bc9d422b8ba1a5... |
ecb78a33b64f5f9582c52293349c8342 | The actual instance a model reference points to with the to_record_type/id | [
{
"docid": "2e422aaffec7b7f6fa6dd85d9fb4014d",
"score": "0.68914455",
"text": "def to_record\n return @to_record if @to_record\n\n # @to_record = to_record_class.find(to_record_id)\n @to_record = to_record_assoc\n\n unless @to_record\n raise FphsException, \"Model Reference (#{id}) 'to ... | [
{
"docid": "98f459979cd4a52c21a35a107a81fdee",
"score": "0.7525831",
"text": "def get_record_instance\r\n @record\r\n end",
"title": ""
},
{
"docid": "25c9016d6ef4fbf54d0bb6e238194d7f",
"score": "0.7450385",
"text": "def get_record_instance\n @record\n end",
"titl... |
0dee01ca76385874f66a9f9141ae60ff | Update device cleanup configuration. | [
{
"docid": "02d72f8f18942d44ff44c01b202cc7fe",
"score": "0.0",
"text": "def update_device_cleanup_configuration_using_post_with_http_info(content, id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AllEndpointsApi.update_device_cleanup_configurat... | [
{
"docid": "c2a9348cba8f521a2cbc58a406206b3d",
"score": "0.6253139",
"text": "def destroy\n if !current_user.manager?\n head :forbidden\n else\n Device.where(device_configuration_id: @device_configuration.id).each do |d|\n d.update(device_configuration_id: nil)\n end\n @... |
d4ba6836462ae3455d5ed11ebba0fcba | GET /fake_answers/1 GET /fake_answers/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "cb4efda85b93aab594ff669338d47296",
"score": "0.7414684",
"text": "def index\n @answers = Answer.where(url_params)\n if @answers.size == 1\n @answers.first!\n end\n render json: @answers\n end",
"title": ""
},
{
"docid": "4980b2bb800a9c4cafd70509bb4af299",
"s... |
d54e7375cc998a99b391fd236255379f | Nothing special here, proposal model takes care of nested presenter models. Gotta love Rails :) | [
{
"docid": "1b566c1e95582fef43ec8f348988e99d",
"score": "0.5630844",
"text": "def create\n @itinerary = Itinerary.includes([:conference, :user]).find(params[:itinerary_id])\n @proposal = @itinerary.proposals.build(proposal_params)\n @proposal.conference = @itinerary.conference\n @proposal.us... | [
{
"docid": "58617b912aa49826ae7d01a4f7fab873",
"score": "0.6910629",
"text": "def proposals\n object.proposals.decorate\n end",
"title": ""
},
{
"docid": "c5f2d583c5e929028d9769fe43508ace",
"score": "0.63693094",
"text": "def proposals\n Proposal.order(:title)\n end",
"ti... |
7d038739f7d0f867d72ab4f3ab95d1cc | Select all the runs which do not belong to the author of the answer and which are related to the same activity (it's important when there are multiple runs belonging to the same user, e.g. in case of sequence). | [
{
"docid": "beeef8aa484bf7fb0347a4c18aed1950",
"score": "0.63456154",
"text": "def collaborators_runs(activity, user)\n runs.select { |r| r.user != user && r.activity == activity }\n end",
"title": ""
}
] | [
{
"docid": "5d503dd6f69d17edbc58de682a0bbf2f",
"score": "0.6012468",
"text": "def return_run_workouts\n\t\tjoins(:run_type).where.not(\"run_types.name=?\", \"Race\")\n\tend",
"title": ""
},
{
"docid": "b136c98c23c287240e5e62c24fcbb174",
"score": "0.5911291",
"text": "def not_answered... |
a484747ef4c4bacfeb401df3f4abbec9 | This goes through each endpoint class and creates singletone methods on the client that query those classes. We do this to avoid possible namespace collisions in the future when adding new classes | [
{
"docid": "f299d30fcb3f52677f451aad749be030",
"score": "0.6892281",
"text": "def define_request_methods\n REQUEST_CLASSES.each do |request_class|\n endpoint_instance = request_class.new(self)\n create_methods_from_instance(endpoint_instance)\n end\n end",
"title": ""
}
... | [
{
"docid": "7d03f090ef57c41998bc3a88d7219c69",
"score": "0.7420758",
"text": "def append_request_methods_to_class\n Constants::ENDPOINT_CLASSES.each do |endpoint_class|\n endpoint_instance = endpoint_class.new(self)\n create_methods_from_instance(endpoint_instance)\n end\n end... |
d480e1bd3fe11b2022cb0aa7287dfe4a | Return html sanitized teaser for text, if format option is defined, text will be converted from format to html | [
{
"docid": "4b408c5fcd262676a2d23c4935e93958",
"score": "0.7156452",
"text": "def teaser(text, options = {})\n options.reverse_merge!(:length => 150, :omission => '...')\n format = options.delete(:format) if options[:format]\n truncate(strip_tags(to_html(text.to_s, format)).strip, options)\n e... | [
{
"docid": "4d142bc09dcee329772906ff122f6765",
"score": "0.73928046",
"text": "def format(text)\n sanitize(markdown(text))\n end",
"title": ""
},
{
"docid": "a34cc61d61570c70877aac2c872b162a",
"score": "0.7372561",
"text": "def format(text)\n sanitize(markdown(text))\n en... |
8ee593e2d4ea3ef3e5b6147c0a437ce2 | Initialize a TagContainer from an ogg file. | [
{
"docid": "5fd0bf43bc6a5b9436c87e002c2cc775",
"score": "0.6882446",
"text": "def initialize(file)\n begin\n h = Hash.new\n\n stdout_str, stderr_str, status = Open3.capture3('python3', OGG_JSON_SCRIPT, '-l', file.to_s)\n if status != 0 then\n raise ... | [
{
"docid": "025f31677de8b2ad6660f6b65d744fa3",
"score": "0.7052154",
"text": "def ogg(path, tags = {})\n TestingFile.new(path, tags)\n end",
"title": ""
},
{
"docid": "025f31677de8b2ad6660f6b65d744fa3",
"score": "0.7052154",
"text": "def ogg(path, tags = {})\n Testin... |
e6be21842a73b11b50f95732693aa0f4 | GET /portfolios/1 GET /portfolios/1.json | [
{
"docid": "e9977d4f50c3528a1aa156e52da07ab7",
"score": "0.6317646",
"text": "def show\n @portfolio = Portfolio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @portfolio }\n end\n end",
"title": ""
}
] | [
{
"docid": "cdba1d329718916860bad7ac7c395c72",
"score": "0.7743487",
"text": "def portfolios options = {}\n perform_get(\"/me/portfolios\", options)\n end",
"title": ""
},
{
"docid": "1f97fb1daedfee713b755eb514c13bfb",
"score": "0.7408238",
"text": "def portfolios options... |
22d88e6aa66c2d94bd31d3d7def4487a | PATCH/PUT /days/1 PATCH/PUT /days/1.json | [
{
"docid": "72c5755db35e71f7eb156d0bb7074934",
"score": "0.65981644",
"text": "def update\n respond_to do |format|\n if @day.update(day_params)\n format.html { redirect_to @plan, notice: 'Day was successfully updated.' }\n format.json { render :show, status: :ok, location: @day }\n... | [
{
"docid": "ee914533715bde20620f2e7bdf25b6ee",
"score": "0.7172199",
"text": "def update\n @day = Day.find(params[:id])\n\n if @day.update(params[:day])\n head :no_content\n else\n render json: @day.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"... |
2951d81c3e995fd69ba4f3e21989fa96 | GET /metro_service_areas GET /metro_service_areas.xml | [
{
"docid": "b910f5af293f0ffa4aa852dc75695333",
"score": "0.5837103",
"text": "def index\n @msa_search = params[:msa_search]\n conditions = [\"name like ?\", \"%#{@msa_search}%\"] unless @msa_search.nil?\n @metro_service_areas = MetroServiceArea.paginate(:all, :conditions => conditions, :order =... | [
{
"docid": "4410028bc8f603db80d9f15204875e9f",
"score": "0.6918747",
"text": "def show\n @metro_service_area = MetroServiceArea.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @metro_service_area }\n end\n end",
"title": "... |
c8038f3e4b584b416303d52dda627a01 | POST /posta POST /posta.json | [
{
"docid": "c28820cb318b0b057185ed627235646c",
"score": "0.0",
"text": "def create\n @postum = Postum.new(params[:postum])\n\n\n respond_to do |format|\n if @postum.save\n\t Postum.posliPostu(current_user,@postum.prijimatelia,@postum)\n #format.html #{ render 'posta/postum', notic... | [
{
"docid": "51da420121fb8c69e8d0bd4a0e187c96",
"score": "0.6684658",
"text": "def create\n @apost = Apost.new(apost_params)\n\n respond_to do |format|\n if @apost.save\n format.html { redirect_to @apost, notice: 'Apost was successfully created.' }\n format.json { render :show, s... |
b8c115c89ee08a0c6414703f91e66288 | ... and gets redirected to home, which returns back the original json with an added field "classifier_decision" classifier_decision==true means discrepancy found, classifier_decision==false means no discrepancy | [
{
"docid": "e3ccd5b49a40e51e33800c46d19a154c",
"score": "0.5421981",
"text": "def home\n @prescription = Prescription.new\n @prescription.values = JSON.parse(params[:prescription_values])\n reader = PrescriptionObjectReader.new(@prescription)\n @pipeline = Pipeline.new(reader, [MyFeatures.ne... | [
{
"docid": "9616e913cb479515a7e127dd0e27b6ae",
"score": "0.57549345",
"text": "def initial_classification\n self.url.to_s.strip!\n\n # per-user ranking\n bayes = self.user.bayes\n path_status = bayes.classify(self.path).downcase rescue 'down'\n host_status = bayes.classify(self.host).down... |
07c18cffe4a47b22026d60a06d6f9e5c | Push a notification to SNS | [
{
"docid": "be0532e703fe11ed075006fa0863b986",
"score": "0.71089727",
"text": "def publish_to_sns\n\t\tif dwelling && dwelling.topic\n\t\tdwelling.topic.publish( \"#{owner.name} #{body} #{dwelling_item.class}.\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t :subject => \"Roomie Notification\",\n\t\t\t\t\t\t\t\t\t\t\t\t\... | [
{
"docid": "6cdcd76c87ff0db7c6861eeadebf8c4f",
"score": "0.829608",
"text": "def send_sns_notification(sns_topic,subject,message)\n # create the sns client object\n client = Aws::SNS::Client.new(region: 'us-east-1')\n # publish the message to the sns topic\n resp = client.publish(topic_arn: ... |
0474d8cd5b58a71aa1aa7925f3fa254f | Remove the given file, removing any constants and other files loaded by the file. | [
{
"docid": "b0ad7612305a99efdc6b08b3789e28f5",
"score": "0.7289882",
"text": "def remove(name)\n file = @files[name] || return\n remove_feature(name) if $LOADED_FEATURES.include?(name)\n file[:features].each{|feature| remove_feature(feature)}\n remove_constants(name){file[:co... | [
{
"docid": "dbe08315f9f16a2668478b22166b52e1",
"score": "0.80542606",
"text": "def remove_file(file)\n @files.delete(file)\n @implicitly_defined = true if @files.size == 0 && namespace?\n end",
"title": ""
},
{
"docid": "76a0012f6c0b83bc91e3a31d910831eb",
"score": "0.7552034... |
066675d4dedb4f6f6bebce652b9d552f | Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results. | [
{
"docid": "19b59dc0404314e875cf38a8febf526e",
"score": "0.0",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetWordListsResultSet.new(resp)\n return results\n end",
"title": ""
}
] | [
{
"docid": "ea872306361fc864408e8279b0199bbe",
"score": "0.7594412",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "bf6609d69b18cbe3a5f620c672c2cbbf",
"score": "0.7... |
543e3859ae66d130852740aa7580cc52 | TODO move to a helper | [
{
"docid": "7fe7ed09549eab95692416832b7d5306",
"score": "0.0",
"text": "def starred_class(user)\n\t\tif self.is_starred_by_user(user)\n\t\t\treturn \"starred\"\n\t\telse\n\t\t\treturn \"\"\n\t\tend\n\tend",
"title": ""
}
] | [
{
"docid": "18dccc4e509a937b27ab700928bdba8e",
"score": "0.6292984",
"text": "def helper; end",
"title": ""
},
{
"docid": "18dccc4e509a937b27ab700928bdba8e",
"score": "0.6292984",
"text": "def helper; end",
"title": ""
},
{
"docid": "18dccc4e509a937b27ab700928bdba8e",
... |
af876e2bc676fd6986826356a525eff3 | DELETE /player_records/1 DELETE /player_records/1.json | [
{
"docid": "012c5c06dedd1a324be2e218dda48b81",
"score": "0.77110654",
"text": "def destroy\n @player_record.destroy\n respond_to do |format|\n format.html { redirect_to player_records_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "21cb9c01d3eb14fd5a429d7545d28fea",
"score": "0.77209365",
"text": "def destroy\n @player_record = PlayerRecord.find(params[:id])\n @player_record.destroy\n\n respond_to do |format|\n format.html { redirect_to player_records_url }\n format.json { head :no_content }\n end... |
89541d5444d0e98ab8074161252a374a | Use to connect to MySQL DB | [
{
"docid": "ee1af5c6ff13396ef6e3a4c926aefc44",
"score": "0.68506634",
"text": "def connect_to_db\n puts \"Please enter IP storing Mysql DB: \"\n db_ip = gets.chomp\n puts \"Please input db username: \"\n db_user = gets.chomp\n puts \"Please input db password: \"\n db_pass = gets.chomp\n puts \"Pl... | [
{
"docid": "b935174e9928969cde317254ab578a7c",
"score": "0.83585644",
"text": "def connect!\n @handle = DBI.connect(\"DBI:Mysql:#{@options[:database]}:#{@options[:host]}\", @options[:user], @options[:password])\n end",
"title": ""
},
{
"docid": "4d02c3c12ec13ea6171c5de4823d4953",
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "067bb3636934c2288af35623f4fc5b8c",
"score": "0.0",
"text": "def enginestatus_params\n params.require(:enginestatus).permit(:name)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
d82ff97a9d8b72f09dba6e9cfb0c473d | PATCH/PUT /estadia/1 PATCH/PUT /estadia/1.json | [
{
"docid": "912ff37dfb0fe9386619f5084d5e5ec6",
"score": "0.62687373",
"text": "def update\n respond_to do |format|\n if @estadia.update(estadia_params)\n format.html { redirect_to @estadia, notice: 'Estadia was successfully updated.' }\n format.json { render :show, status: :ok, loc... | [
{
"docid": "b89f7321e47bba4cc92fd02231b19c6c",
"score": "0.6673833",
"text": "def update\n @estudiante = Estudiante.find(params[:id])\n\n if @estudiante.update(params[:estudiante])\n head :no_content\n else\n render json: @estudiante.errors, status: :unprocessable_entity\n end\n e... |
d99d0b09a6a5c5822ff8a7d304e5ec83 | Returns the category corresponding to a given id | [
{
"docid": "7a6d9926e5ead226d719536cc4b31d63",
"score": "0.7550096",
"text": "def get_by_id(id, cats_only = false)\n raise \"Cannot do a look-up with a blank id!\" if id.blank?\n object = self.categories.select { |category| category.type_identifier == id }\n object = self.entities.select ... | [
{
"docid": "4031c36795b8563d4cf746a185b2d85e",
"score": "0.8955283",
"text": "def category(id)\n categories.select do |category|\n category.id == id\n end.first\n end",
"title": ""
},
{
"docid": "68ed303747ba18012361a4c31ac151ab",
"score": "0.8646087",
"te... |
2264a260744d286a169f0f974f98b32f | GET /apenados GET /apenados.json | [
{
"docid": "25c7b0739d5218bbbc6062f53b292009",
"score": "0.0",
"text": "def index\n if current_user.admin?\n @apenados = Apenado.all.paginate(:page => params[:page])\n else\n @apenados = current_user.unidade.apenados.paginate(:page => params[:page])\n end\n end",
"title": ""
}
... | [
{
"docid": "67f0947475337f10f1a023a9c7552c44",
"score": "0.7566755",
"text": "def index\n @apoderados = Apoderado.all\n end",
"title": ""
},
{
"docid": "de8f773ad80a2b816d29e8768f7760c1",
"score": "0.71427476",
"text": "def index\n @afiliados = Afiliado.order(\"apellido_nombre... |
c042a79a06e61d4c0474b48797e541fd | GET /security_users_roles/new GET /security_users_roles/new.json | [
{
"docid": "e238d96fd1ed1904faea58ed10c12f48",
"score": "0.7502061",
"text": "def new\n @security_users_role = SecurityUsersRole.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.js { @security_users_role }\n format.json { render json: @security_users_role }\n ... | [
{
"docid": "64bbfd429b3f62103804f9f963c66899",
"score": "0.8020655",
"text": "def new\n @roles_user = RolesUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @roles_user }\n end\n end",
"title": ""
},
{
"docid": "f8ab5ff640da00d3... |
fde264b82abbd59157367c4e472cfa49 | since we cannot filter on category for settings, we will do it in ruby params : the results has of the api call returns : array of availbakle categories | [
{
"docid": "ade70e187fa29f061e8936f1e2b8e873",
"score": "0.0",
"text": "def get_available_categories(the_hash)\n result = []\n the_hash.each do |h|\n result.push(h['category']) unless result.include?(h['category'])\n end\n return result\nend",
"title": ""
}
] | [
{
"docid": "f477230c33075803bfb6dd600eb6cf1b",
"score": "0.70563614",
"text": "def categorize\n out = {}.to_json\n if params[:url]\n # uri_enc_url = Rack::Utils.escape(params[:url])\n endpoint = \"http://access.alchemyapi.com/calls/url/URLGetCategory\"\n q = \"#{endpoint}?apikey=#{E... |
3d65b4caa967acf773ae28ce724ab854 | Verify if the current API version can satisfy the API version in the request's Accept header | [
{
"docid": "8587e1411da4bc9f8acdd0578f73b7bd",
"score": "0.8349795",
"text": "def verify_accept_header_version\n media_types = HTTP::Accept::MediaTypes.parse accept_header\n\n # Select media types of format 'application/vnd.openwebslides+json; version=...'\n request_versions = media_types.selec... | [
{
"docid": "bf6e6119447e037387e41bf414ee5bfb",
"score": "0.8486321",
"text": "def versioned_accept_header?(request)\n request.headers[:accept].include?(\"application/vnd.api.v#{@version}+json\")\n end",
"title": ""
},
{
"docid": "8ec18aead4c118c5f3eb6164e6f90aff",
"score": "0.7920323... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "0409b908194a6a63c98affd016a0403e",
"score": "0.0",
"text": "def award_option_params\n params.require(:award_option).permit(:name, :nomination_type_id)\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... |
0f83a2b636821fe70692b1047992d4e2 | Returns true if this language uses spaces between words in titles. | [
{
"docid": "81dee1a9228e1aebcbed4061e67b94dc",
"score": "0.7798632",
"text": "def uses_spaces_in_titles_in_title_consistency_validation\n true\n end",
"title": ""
}
] | [
{
"docid": "509777d99afcbb22e7df94d4a1c57038",
"score": "0.6567206",
"text": "def __add_extra_space?(word)\n return false unless @extra_space\n word = word.gsub(/\\.$/o, '') unless word.nil?\n return false if ABBREV.include?(word)\n return false if @abbreviations.include?(word)\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "2f5a9b71fa4343ae1c0604334572f705",
"score": "0.0",
"text": "def set_merchant_group\n @merchant_merchant_group = Merchant::MerchantGroup.find(params[:merchant_group_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... |
7a4e9ce64ed4dc128b295dc4c60df9d4 | Calls a method resource to update a vertex and returns a renderable JSON response | [
{
"docid": "3527698628d32da57b7104a88226815c",
"score": "0.0",
"text": "def patch(resource_url, body = nil, &block)\n http_patch = Net::HTTP::Patch.new resource_url, {'Content-Type' =>'application/json'}\n http_patch.body = json_body(body) if body\n call_http_server http_patch, &block\n ... | [
{
"docid": "636a87eb2d9fe550b1403bb621689aa1",
"score": "0.76011467",
"text": "def update\n respond_to do |format|\n if @vertex.update(vertex_params)\n format.html { redirect_to @vertex, notice: 'Vertex was successfully updated.' }\n format.json { render :show, status: :ok, locatio... |
7fc7eb58d40e064b2a1ad8ba8a0b7b56 | DELETE /equipment/1 DELETE /equipment/1.json | [
{
"docid": "772e6f51672e20c557d20845973b020c",
"score": "0.7499359",
"text": "def destroy\n @equipment.destroy\n respond_to do |format|\n format.html { redirect_to equipment_index_url, notice: 'Equipment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
... | [
{
"docid": "6c794a553d1f625f8b8351a5484b0d3c",
"score": "0.7864608",
"text": "def destroy\n @equipment = Equipment.find(params[:id])\n @equipment.destroy\n\n respond_to do |format|\n format.html { redirect_to equipment_index_url }\n format.json { head :no_content }\n end\n end",
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "ab19c35367fd7f9237bb274c24cd4931",
"score": "0.0",
"text": "def set_uf\n @uf = Uf.find_by(date: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... |
65eb5958379f919591d868fb41519a05 | GET /ppbs GET /ppbs.json | [
{
"docid": "2d8f7f705ed590d2723988a3471aa288",
"score": "0.6454338",
"text": "def index\n @ppbs = Ppb.all.paginate(page: params[:page], per_page: 15)\n end",
"title": ""
}
] | [
{
"docid": "9768ba9fc46f21c1217bdcc1bcf5d985",
"score": "0.67701274",
"text": "def show\n @bp = Bp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bp }\n end\n end",
"title": ""
},
{
"docid": "454edcad61dd1962ae5216... |
fea7c1d2c01cf1524eca35fec361e1f3 | Set the value of the RelationshipID input for this Choreo. | [
{
"docid": "7cb9210a68273772c416783da56f31d1",
"score": "0.7163751",
"text": "def set_RelationshipID(value)\n set_input(\"RelationshipID\", value)\n end",
"title": ""
}
] | [
{
"docid": "20ce501c17769f432041d566b9559b38",
"score": "0.68040746",
"text": "def set_relationship\n @relationship = Relationship.find(params[:id])\n end",
"title": ""
},
{
"docid": "20ce501c17769f432041d566b9559b38",
"score": "0.68040746",
"text": "def set_relationship\n ... |
3ed19f953a2f3270f949b513142a5486 | Parse string into AST, with comments | [
{
"docid": "707c3f856f21f940223ce3c5dfa5e5d2",
"score": "0.71331763",
"text": "def parse_with_comments(source); end",
"title": ""
}
] | [
{
"docid": "8b8317f27094fcfaa4bc0afc3b64b7b5",
"score": "0.7583928",
"text": "def parse str\n begin\n @str=str\n @tokens=Lexer.new.tokenize(str)\n @tokens=@tokens.reject!{|tok| tok.is_a? [:comment,:newline]}\n ast=parse_module()\n #pp ast\n rescue Exception =... |
cb4b58fb1105709b12baeb97da9ca199 | Check if we are logged in with admin privelages. | [
{
"docid": "bf5fde8146f79771bb2eb9ff41ab243d",
"score": "0.73063684",
"text": "def admin?\n\t\tuser_session.admin?\n\tend",
"title": ""
}
] | [
{
"docid": "2473f391c73aa1a33c949e8075b2b41f",
"score": "0.8047535",
"text": "def admin_logged_in?\n !current_admin.nil?\n end",
"title": ""
},
{
"docid": "abdb791ec4843e8fd3cc9e8d20648bbd",
"score": "0.79823464",
"text": "def admin_logged_in?\n current_user && current_u... |
035d8de21b7861148fb4ab9c5350f01f | You will write a method is_prime? that takes in a number This method returns a boolean, indicating whether the number is prime. Note: A prime number is only divisible by 1 and itself. The method pick_primes that takes in an array of numbers The method should return a new array containing only the prime numbers The meth... | [
{
"docid": "0527b92786076119b7162e3245d9c187",
"score": "0.0",
"text": "def is_prime?(num)\n for i in 2..num/2 do\n if num % i == 0\n return false\n end\n end\n return true\nend",
"title": ""
}
] | [
{
"docid": "11144f104d411555e1cdd5962085990c",
"score": "0.83385",
"text": "def prime? (number)\n if number < 2 \n return FALSE\n elsif number == 2 || number == 3\n return TRUE\n end\n \n#creates new array and stores all numbers less than given number. Divides the number by all numbers le... |
4b1e12e33668f3a8e41f614275748106 | PUT /tasks/1 PUT /tasks/1.json | [
{
"docid": "786e9e4bbbe5857caf57fe49caf50629",
"score": "0.0",
"text": "def update\n\n @task = Task.find(params[:id])\n @workspaces = current_user.workspaces\n @project = Project.find_by_id(params[:project_id])\n @workspace = Workspace.find(params[:workspace_id])\n @projects = @workspace.... | [
{
"docid": "cac9c96d9b119273d80222fef2554029",
"score": "0.761173",
"text": "def update\n @task.update!(task_params)\n json_response(@task)\n end",
"title": ""
},
{
"docid": "099e7266a80d49d1d0e30816e04aff39",
"score": "0.759024",
"text": "def update\n task = Task.find(para... |
3e23a848fbf078faecb68a1772a95110 | Parses the supplied string for all relevant information. | [
{
"docid": "a7c8e917371ec69a43d8c24b6c9c767a",
"score": "0.0",
"text": "def parse\n find_name\n find_package\n find_methods\n find_getters\n find_setters\n end",
"title": ""
}
] | [
{
"docid": "57a0870d643300906d0724e23e3c3d5f",
"score": "0.78723985",
"text": "def parse(str); end",
"title": ""
},
{
"docid": "57a0870d643300906d0724e23e3c3d5f",
"score": "0.78723985",
"text": "def parse(str); end",
"title": ""
},
{
"docid": "83f0434b818a331ecc7ff4cdfe46... |
c43cbd34ef9953a4864563b8d3b5b1ba | => "H" Expressions can be used as well as literals for default values | [
{
"docid": "0372aec3ca254e8e1d3e532497ee8912",
"score": "0.0",
"text": "def first_characters_improved(some_string, length=some_string.length)\n\tsome_string[0, length]\nend",
"title": ""
}
] | [
{
"docid": "b7df2f8b6a67e9a1cd309d9827da70c3",
"score": "0.59816426",
"text": "def H\n X()\n β()\n end",
"title": ""
},
{
"docid": "78cb893146519ee180c4b860e4b20c86",
"score": "0.59710634",
"text": "def ho(x=nil)\n x ? \"Ho #{x}\" : \"Ho!\"\nend",
"title": ""
},
{
... |
f2e286b30a4d4ea2e10ce7b4cf7b078b | Returns the chain of parents leading to the target. | [
{
"docid": "bafde835ddd8211ba1927f6ddc3f9277",
"score": "0.8083939",
"text": "def parents(target)\n\t\tancestors = [target]\n\t\tcurrent_ancestor = target\n\t\tmoves = []\n\t\tuntil current_ancestor==nil\n\t\t\tcurrent_ancestor = current_ancestor.parent\n\t\t\tancestors << current_ancestor unless curren... | [
{
"docid": "677275489972be0ef7694ee8204003dc",
"score": "0.73620003",
"text": "def ancestors_through_parents(result = [self], start = self)\n if start.parent.nil?\n return result.reverse\n else\n result << start.parent\n ancestors_through_parents(result, start.parent)\n end\n en... |
d8c283ef4425b93074610117a4eabc06 | Defines a path for the specified entity. Examples: Halcyon.paths.define(:tmp, Halcyon.root/'tmp') OR Halcyon.paths.define(:tmp => Halcyon.root/'tmp') | [
{
"docid": "313d22b2919f9c5caeef069c4d49b388",
"score": "0.54990196",
"text": "def define(key_or_hash, value = nil)\n if key_or_hash.is_a?(Hash) and value.nil?\n key_or_hash.keys.each do |key|\n self.define(key, key_or_hash[key])\n end\n else\n self.pa... | [
{
"docid": "5b6db61dabff4e198300221ac82b71a5",
"score": "0.63559526",
"text": "def create_path(path, value)\n \n end",
"title": ""
},
{
"docid": "8a5f7285d141a8003df73f8ed38f99dd",
"score": "0.6142786",
"text": "def set_path_node(x, y)\n set_node(x, y, :path)\n end",
... |
878a693e586e438a2a16745775c9e082 | IE10 runs on Win8 Client/Server | [
{
"docid": "20d16daa9bc4bc848e7974ce79cc5e2b",
"score": "0.5480104",
"text": "def compatible_with?(hw, os)\r\n if os.kind_of?(OS::Windows8Client) or os.kind_of?(OS::Windows8Server)\r\n return super\r\n end\r\n\r\n return false\r\n end",
"title": ""
}
] | [
{
"docid": "3ec127e5edc09e87ef2b83cf65df1a34",
"score": "0.64451355",
"text": "def is_explorer?\n \trequest.user_agent.downcase =~ /msie/\n end",
"title": ""
},
{
"docid": "e07152b2646df15f72a23030d48d49ea",
"score": "0.6268766",
"text": "def version_msie\n\t\t\n\tend",
"title"... |
91f0a80fda9bd3b9cb1c0e0a95f49e0a | Receives event from i3ipc server socket. | [
{
"docid": "eec3e14817c7ca4b36c8791e9febe50c",
"score": "0.7884091",
"text": "def receive_event(type = nil)\n check_connected\n # length of \"i3-ipc\" + 4 bytes length + 4 bytes type\n data = @socket.read 14\n magic, len, recv_type = unpack_header(data)\n\n # Strip highest bit\n... | [
{
"docid": "2f92cc20e5d72a493aedbfc0398da507",
"score": "0.6825271",
"text": "def process_notification\n size = in_socket.readline.strip!\n msg = in_socket.read( size.to_i )\n \n msg.strip!\n logger.debug \"GOT Event: '#{msg}'\" \n\n if is_shutdown... |
ff0d082b2d11c0efab4445cedd76ce8c | Convert from FHIR ethnicity. Could be ombCategory or a dataabsentreason | [
{
"docid": "411945ff62cadd4f95eb65db2c25163d",
"score": "0.74235237",
"text": "def from_us_core_ethnicity(patient)\n eth_url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity'\n eth_ext = patient&.extension&.find { |e| e.url == eth_url }\n omb_eth = eth_ext&.extension&.find {... | [
{
"docid": "72b48e30bbd4e6c33a053725596edddd",
"score": "0.7027044",
"text": "def to_us_core_ethnicity(ethnicity)\n # Don't return an extension if no ethnicity specified\n return nil if ethnicity.nil? || !ValidationHelper::VALID_PATIENT_ENUMS[:ethnicity].include?(ethnicity)\n\n # Build out exte... |
2f7a05dfa5c58a17e6e3f8391be5c290 | Generate a class reader and writer for the attribute | [
{
"docid": "1b78941565fb5bc8e66ee2c251e7ddd9",
"score": "0.0",
"text": "def sync_mattr_accessor(*attributes, &block)\n sync_cattr_writer(*attributes)\n sync_cattr_reader(*attributes, &block)\n end",
"title": ""
}
] | [
{
"docid": "66e5d2ce7a200d4bc912c13e1b6dbf66",
"score": "0.72215086",
"text": "def generate_attr_reader(name, data)\n define_singleton_method(name) do\n Marshal.load(Marshal.dump(data))\n end\n\n send(name)\n end",
"title": ""
},
{
"docid": "9c58a6c9b8ecd7e56417a3d0a... |
fceeaefba2a8a8feed4dbecebcb50df8 | Updates the translated attributes | [
{
"docid": "41bf4ffec029ebbeefbc74b593b09a04",
"score": "0.7311198",
"text": "def set_translated_attributes(language_code, attributes)\n \n translation.update_terms(language_code, attributes)\n \n end",
"title": ""
}
] | [
{
"docid": "15334276d634be065b57074b26f20243",
"score": "0.7329646",
"text": "def set_translated_attributes(language_code, attributes)\n\n translation.update_terms(language_code, attributes)\n\n end",
"title": ""
},
{
"docid": "eaf01fc308dec9b94c81fe3f857cde2c",
"scor... |
dd440f13962bd3756927419a2344d40c | this is called by Gosu to see if should show the cursor (or mouse) | [
{
"docid": "912eb62c90a4eacd5a4e27891d20ee9d",
"score": "0.650151",
"text": "def needs_cursor?\n true\n end",
"title": ""
}
] | [
{
"docid": "9264944b4cf3cb4302a58628100ecbf8",
"score": "0.79011106",
"text": "def cursor_visible?\n if front?\n front.cursor_visible?\n\n elsif previous?\n previous.cursor_visible?\n\n else\n interface.cursor_visible?\n\n end\n end",
"titl... |
72d992288e33d9ad42faad6befa27c95 | Return true if seance file exists | [
{
"docid": "ff490a8c18fd68d1d3d719eb1ea450ab",
"score": "0.79894686",
"text": "def exists?\n File.exists? path\n end",
"title": ""
}
] | [
{
"docid": "5537d6ac3a34c48a13ecc317fe0d74a8",
"score": "0.84976643",
"text": "def exists?\n !!file\n end",
"title": ""
},
{
"docid": "5537d6ac3a34c48a13ecc317fe0d74a8",
"score": "0.84976643",
"text": "def exists?\n !!file\n end",
"title": ""
},
... |
7294e99a0973e8f8331101ea38501be1 | ========================= MIXED PALLET CRIERIA CODE ========================= | [
{
"docid": "58b0d0d0e353a546ee3a86f9f3008835",
"score": "0.0",
"text": "def mixed_pallet_criteria\n render :inline => %{\n\t\t<% @content_header_caption = \"'please enter pallet number'\"%>\n\n\t\t<%= build_get_pallet_number_form()%>\n\n\t\t}, :layout => 'content'\n\n end",
"title": ""
}
] | [
{
"docid": "f372e1d5d358663784f34209ed2c9274",
"score": "0.64188063",
"text": "def cp_b\n end",
"title": ""
},
{
"docid": "3a6009acaef6e132e5b8e423bf433a07",
"score": "0.62152946",
"text": "def ca; end",
"title": ""
},
{
"docid": "da485106dffea14c465ac3f9f6f289d3",
... |
69035e5aa689b72a44f0ebf5a74d7b4f | Add an Range selector. Values in the passed hash can be either a Range or an Array. of the passed hash has multiple elements, the condition will be AND. The range is inclusive. === Example Product.between(availibility: 1..3, price: [12, 20]) will append this selector: "((availibility:[1 TO 3] AND price:[12 TO 20]))" | [
{
"docid": "d1def11754d130335439361c328f1184",
"score": "0.58398545",
"text": "def between(*criterion)\n clone.tap do |crit|\n crit.add_restriction do\n criterion.each do |c|\n crit.add_restriction(to_lucene_pair(c, operator: \"BETWEEN\"))\n end\n end\n ... | [
{
"docid": "bf86165fa2e6eca5dd23ff6ebdaa07a7",
"score": "0.68429744",
"text": "def compose_range_options_node(node, hash)\n fail ClearlyQuery::FilterArgumentError.new(\"range filter must be {'from': 'value', 'to': 'value'} or {'interval': 'value'} got '#{hash}'\") unless hash.is_a?(Hash)\n\n ... |
15e6d4a7c9f193470e6101f7d2953ec6 | Instantiates the search builder that builds a query for items that are members of the current collection. This is used in the show view. | [
{
"docid": "07c2c71829f112ed37081336263aeb6d",
"score": "0.776559",
"text": "def member_search_builder\n @member_search_builder ||= CollectionMemberSearchBuilder.new(self)\n end",
"title": ""
}
] | [
{
"docid": "03f2f2146806b358c13a9adf51c2853e",
"score": "0.7063472",
"text": "def member_search_builder\n @member_search_builder ||= member_search_builder_class.new(self)\n end",
"title": ""
},
{
"docid": "5cf11017e53d710e4b9015c9a7b9afd6",
"score": "0.70165735",
"text": "def... |
a1b1b6e14da2eb1b7d18ba66b8964823 | Implement methods that call the remote Service | [
{
"docid": "d906fa5b5d3565be23f12925d5430912",
"score": "0.61202365",
"text": "def method_missing(method, *args, &block)\n result = call(method, *args)\n\n # #TODO if Service returns method undefined, call super\n #\n # Define the method if the call was successful and no other thread... | [
{
"docid": "40ca499fadaf57f7246e4f4acff32f2c",
"score": "0.69663155",
"text": "def invoke_rpc_method\n # Get a new instance of the service\n @service = @klass.new\n\n # Define our response callback to perform the \"successful\" response to our client\n # This decouples the se... |
a40bbbbd9e38e4b06bf359325e5ffdea | Method to set the refresh interval. "refreshInterval:(display:''," \ "pause:!f,section:1,value:)" | [
{
"docid": "5ea2dd30070ef5e5976eed18a7002bf6",
"score": "0.7714501",
"text": "def refresh_interval_param(seconds)\n return nil unless seconds\n \"refreshInterval:(display:'#{seconds}%20seconds',\" \\\n \"pause:!f,section:1,value:#{seconds * 1000})\"\n end",
"title": ""
}
] | [
{
"docid": "5650f705e6f9f682f52d682a513d55e4",
"score": "0.7206509",
"text": "def refresh=(value)\n conf['dashboard']['refresh'] = value.to_i\n end",
"title": ""
},
{
"docid": "5690f79d6103bd9f36137d368543e900",
"score": "0.7136368",
"text": "def refresh_interval\n @refresh_... |
1a58db9e5848b686a032a2e323643447 | Public: Calculates the day after profit and losses Returns a Decimal to 2dp | [
{
"docid": "3f92ba852178741f0121e340330242f2",
"score": "0.58877975",
"text": "def profit_day_rate(cal)\n day_rate = avg_rate_card_amount_cents.round(2)\n mins_tracked = Timing.minute_duration_submitted_for_period_and_client(id, cal.start_date, cal.end_date)\n days_tracked = (hours = mins_track... | [
{
"docid": "2596915d7c5ca6c0db960f2489f82ae2",
"score": "0.71875906",
"text": "def usd_profit\n break_even(:usd).abs\n end",
"title": ""
},
{
"docid": "14d23e4ba5808e72b326df0de264a54c",
"score": "0.7125905",
"text": "def btc_profit\n break_even.abs\n end",
"title": ""
... |
81d2553351b56cae3a63d4122170bce6 | Return the actual operator's name for supplied method type where type one of :assignment, :has_one, :belongs_to, :has_many etc | [
{
"docid": "76345216a608c16f09ef235295d33053",
"score": "0.75690025",
"text": "def operator_for( type )\n return operator if(@operator_type == type.to_sym)\n nil\n end",
"title": ""
}
] | [
{
"docid": "cf22b927f1c0cd9fae3799380c50ab97",
"score": "0.7213017",
"text": "def for_type( type )\n model_method_list.find_all { |mm| mm.operator_type? type }\n end",
"title": ""
},
{
"docid": "c62c3025d15e5c6c562a8f855b10712a",
"score": "0.71898466",
"text": "def operat... |
8b41ffff60298c98df71b9fe34b4bd14 | merges options +opts+ with those of +args+ if any | [
{
"docid": "4dff032d82ec40bd1f21a1654b068a6e",
"score": "0.8272168",
"text": "def merge_opts(args, opts)\n res = args.dup\n if res.last.is_a? Hash\n # there are already options\n # keep them\n orig_opts = res.last\n orig_opts.replace(opts.merge(orig_opts))\n else\n res ... | [
{
"docid": "cfb9373a62a7dce65974573858bb3ae2",
"score": "0.7340189",
"text": "def merge(opts); end",
"title": ""
},
{
"docid": "1fb2bf99bbf67d9fda5e9f08b29c0680",
"score": "0.67705584",
"text": "def options(opts)\n opts.each { |k,v| merge_options(k, v) }\n end",
"titl... |
1563d329a38b6995b75cdcaa2fbe2fdf | Generate the html for the grid | [
{
"docid": "090471398790f4dfbaa002cba23dcc3a",
"score": "0.72434396",
"text": "def render\n # Add extra classes based on boolean accessors\n @css_classes << :container if @container\n @css_classes << :showgrid if @showgrid\n \n options = {}\n options[:i... | [
{
"docid": "60321ac48209d370c3315da376814d0f",
"score": "0.7457445",
"text": "def render\r\n puts \" #{(0..8).to_a.join(' ')}\"\r\n grid.each_with_index do |row, i|\r\n puts \"#{i} #{row.join(' ')}\"\r\n end\r\n end",
"title": ""
},
{
"docid": "4bc67d5327b... |
d26ebd2185081ef902734c1002400f8d | this function takes in a customer and a number and takes the number away from the current customers total cash. doesnt need to return anything. is tested by another function. | [
{
"docid": "38ad2955b287dd53dcb95384c88caa69",
"score": "0.6674795",
"text": "def remove_customer_cash(customer, amount_to_be_removed)\ncustomer[:cash] -= amount_to_be_removed\nend",
"title": ""
}
] | [
{
"docid": "d0775496b289e789cd3ba682c6726a6c",
"score": "0.71074057",
"text": "def remove_customer_cash(customer, amount)\n return customer[:cash] -= amount\nend",
"title": ""
},
{
"docid": "d0775496b289e789cd3ba682c6726a6c",
"score": "0.71074057",
"text": "def remove_customer_cash(... |
44f2496af667abf56598aa7721131903 | Override callback URL OmniAuth by default passes the entire URL of the callback, including query parameters. Azure fails validation because that doesn't match the registered callback. | [
{
"docid": "cc4e869e9ceb7ed51ee0a9f2da8feefd",
"score": "0.6417755",
"text": "def callback_url\n options[:redirect_uri] || (full_host + script_name + callback_path)\n end",
"title": ""
}
] | [
{
"docid": "6dda46397490929511c595e6423a50f0",
"score": "0.70251095",
"text": "def callback_url\n if options.authorization_code_from_signed_request_in_cookie\n ''\n else\n # Fixes regression in omniauth-oauth2 v1.4.0 by https://github.com/intridea/omniauth-oauth2/commit/8... |
fe0711e5e635445ad40eb93f96a31b75 | This one is currently not active | [
{
"docid": "739e026a80c1819481dae42406c441e9",
"score": "0.0",
"text": "def send_route_phone\n @export = Export.new\n authorize @export\n flash[:notice] = \"Route has been sent to your phone, #{current_user.first_name}\"\n # start background job sending a text via API with link\n count_ex... | [
{
"docid": "ca097545995bba092374cf5ab88c48b3",
"score": "0.7723505",
"text": "def active?; end",
"title": ""
},
{
"docid": "ca097545995bba092374cf5ab88c48b3",
"score": "0.7723505",
"text": "def active?; end",
"title": ""
},
{
"docid": "ca097545995bba092374cf5ab88c48b3",
... |
e41bdded62361f60ac8c0ae0e8f4e062 | Creates a new vulnerability | [
{
"docid": "0b90ded0043a084479184ce05b11720c",
"score": "0.8216833",
"text": "def create_vulnerability(opts = {})\n data, _status_code, _headers = create_vulnerability_with_http_info(opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "142180f4bb07cd725bc436378d69a57d",
"score": "0.8218808",
"text": "def create_vulnerability\n @result = Result.cached_find(params[:result_id])\n @title = params[:type]\n vuln = Vulnerability.new\n #if ![\"observation\", \"High\", \"Medium\", \"Low\", \"Critical\"].index(params[:se... |
f156b6097cdabca20cab6b04c9dac001 | Method to reset the tags of taggable item based in a form params. | [
{
"docid": "2dcf56d98598fa9fc07c102cb3dd46aa",
"score": "0.0",
"text": "def keywords_attributes=(new_keyword_ids)\n self.mirrored_with_taggings = true\n assign_new_keywords!(new_keyword_ids: new_keyword_ids)\n end",
"title": ""
}
] | [
{
"docid": "bd9a1b9fec3c12c42fb8a25cc8a916f6",
"score": "0.6717087",
"text": "def reset\n @tags.clear\n end",
"title": ""
},
{
"docid": "493a67455a09117fcd21eb3a658b97f7",
"score": "0.6163465",
"text": "def update_tags\n tags=self.tag_ids.clone\n unless tags.nil?\n ... |
c158a88699458a21105acdc310dca821 | Shuts down this runnable. The default implementation does nothing. | [
{
"docid": "5bf753f26373d5b7d51116fe7f296d7c",
"score": "0.6050679",
"text": "def shutdown\n end",
"title": ""
}
] | [
{
"docid": "bb5d690ccf33a7efbc74bc566da0ff10",
"score": "0.67267084",
"text": "def shut_down\n end",
"title": ""
},
{
"docid": "0035081512ae92b8c986bba00393291d",
"score": "0.6693182",
"text": "def shutdown\n shutdown_proxy\n exit_thread\n super\n end",
"titl... |
4eb312f4aac6a7eedd2b13341a1079ed | POST /preregisters POST /preregisters.xml | [
{
"docid": "687d6461e2ff2aa94a66885b60d6e27d",
"score": "0.5809003",
"text": "def create\n @preregister = Preregister.new(params[:preregister])\n\n respond_to do |format|\n if @preregister.save\n format.html { redirect_to root_path }\n format.xml { render :xml => @preregister, ... | [
{
"docid": "4a1f3ca39857a9d4788e50739e9d4715",
"score": "0.6484187",
"text": "def destroy\n @preregister = Preregister.find(params[:id])\n @preregister.destroy\n\n respond_to do |format|\n format.html { redirect_to(preregisters_url) }\n format.xml { head :ok }\n end\n end",
"... |
b96aac2ff28dc7ae94bffcfeaffb92a9 | Returns an Array of the DateTime(S) of the given status If entity statuses of given key are not found, return an empty array | [
{
"docid": "5ac8fdaaf4f4f06f9b47d20d63f9a223",
"score": "0.6921855",
"text": "def times_of_status(key)\r\n key = key.to_s\r\n status = Status.find_by_key(key)\r\n if status\r\n ess = EntityStatus.find(:all, :conditions => {:trackable_id => self.id, :status_id => status.id}, :order => :... | [
{
"docid": "e6c5a61c068bdf098bd485fb43e6182d",
"score": "0.6519602",
"text": "def time_of_status(key)\r\n key = key.to_s\r\n status = Status.find_by_key(key)\r\n if status\r\n es = EntityStatus.find(:last, :conditions => {:trackable_id => self.id, :status_id => status.id}, :order => :c... |
a6f570d14f986238724c6e8d85b6e059 | connectivity is percentage XOR in covered area | [
{
"docid": "e385df453a1fd525e173add03047d2f7",
"score": "0.5629289",
"text": "def scoreExclusivity\n covered = 0\n xor = 0\n colSums.each{|sum|\n if sum == 1\n xor += 1\n covered += 1\n elsif sum > 1\n covered += 1\n end\n }\n return xor.to_f/covered.to_f... | [
{
"docid": "8c2b781db3143e05b2b93bf4d3bfb2ee",
"score": "0.59896255",
"text": "def scoreExclusivity(mat)\n covered = 0\n xor = 0\n mat.first.each_index{|i|\n sum = 0\n mat.each{|node|\n sum += node[i].to_i\n }\n if sum == 1\n xor += 1\n covered += 1\n elsif sum > 1\n ... |
dd424794b57e885521e52fdd40801468 | POST /comments POST /comments.json | [
{
"docid": "5334fbe8d293e0e3433bd03590355caa",
"score": "0.0",
"text": "def create\n @comment = Comment.new(@params)\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @comment, notice: 'Comment was successfully created.' }\n format.json { render action: '... | [
{
"docid": "7b0a68ee4df9cfc8f7cc619d01d2577d",
"score": "0.7545733",
"text": "def create\n @comment = @post.comments.create!(comment_params)\n json_response(@comment, :created)\n end",
"title": ""
},
{
"docid": "278b898b0e96dc8518cb54546e69f368",
"score": "0.73734325",
"... |
422beb9085a295ff4078db7497c97807 | POST /tabled_user_scores POST /tabled_user_scores.json | [
{
"docid": "bba628536985986c0d6ef7ace4ce01fa",
"score": "0.8142585",
"text": "def create\n @tabled_user_score_params = params[:tabled_user_scores]\n @tabled_user_score_params.each do |tabled_user_score_param|\n @tabled_user_score = TabledUserScore.new(:user_id => tabled_user_score_param[:user... | [
{
"docid": "13499685db2a4dabe85327fc582bdf41",
"score": "0.7087701",
"text": "def tabled_user_score_params\n params.require(:tabled_user_score).permit(:user_id, :score)\n end",
"title": ""
},
{
"docid": "f17a66a4fa76a4cd9100f870735de3c2",
"score": "0.6914312",
"text": "def create... |
848675e72abb131573d4bfe2e9a4fa86 | The method is used to subtract a vector from this one. | [
{
"docid": "53d4df2c7897c8b6e7c48dc9e1f08b48",
"score": "0.783776",
"text": "def -(vector2)\n end",
"title": ""
}
] | [
{
"docid": "471c005890158b0353210d655fb28aeb",
"score": "0.81970143",
"text": "def -(vector)\n self + (-vector)\n end",
"title": ""
},
{
"docid": "8aec136061acac10041d525ef3195564",
"score": "0.8126739",
"text": "def -(other_vector)\n Vector.new @x - other_vector.x, @y -... |
efd91a789cdb1670f18a3685ce80667b | GET /boards GET /boards.json | [
{
"docid": "5f203b08acc3ebb81efdc010666835d0",
"score": "0.0",
"text": "def index\n\t\tcurrent_player_id = current_player['id']\n\n\t\t# pp current_player\n\n @boards = Board.where( orf_id: current_player_id ).or( Board.where( wulf_id: current_player_id ) ).includes( :orf, :wulf, :owner )\n end",
... | [
{
"docid": "ea3299e54cb35af5ca2c0297873bbd76",
"score": "0.8206462",
"text": "def get_all_boards\n request(Net::HTTP::Get, \"/api/#{API_VERSION}/#{RESOURCE_NAME}\", nil, nil, false)\n end",
"title": ""
},
{
"docid": "8c4a007aecc67eaaf38769c8e9cc1156",
"score": "0.80803424",
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "aeba12e80cb808b69bfd54840a04e6ab",
"score": "0.0",
"text": "def user_params\n params.require(:user).permit(:name, :email, :password, :is_admin, :is_instructor)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69795185",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6782116",
"text": "def strong_params\n params.requ... |
8cf129a7af8ca04ffb6ef01ac7a15bd1 | return x y 7 end p addfive(6,55) | [
{
"docid": "0bef4230ed6d05a502802f11be7401d2",
"score": "0.0",
"text": "def maximum(a,b)\n if (a > b)\n return a\n else\n return b\n end\nend",
"title": ""
}
] | [
{
"docid": "52aa8562d741003bdbc817e196f22f1c",
"score": "0.72677934",
"text": "def add_five(n)\n\tn + 5\nend",
"title": ""
},
{
"docid": "21103d84bf5e40f83de7dc57ea654b9a",
"score": "0.7152987",
"text": "def add_five(n)\n n + 5 \nend",
"title": ""
},
{
"docid": "38ef2c9e... |
a7edd176bae950377c5078b6c1459dd4 | Recursively creates xml for a given hash of tagvalue pair. Uses javaize_key on the tags to create the tags needed by iDeal. | [
{
"docid": "6f60f956d5bf7068cd6b31dacf177b3d",
"score": "0.51851445",
"text": "def xml_from_array(builder, tags_and_values)\n tags_and_values.each do |tag, value|\n tag = javaize_key(tag)\n if value.is_a?(Array)\n builder.tag!(tag) { xml_from_array(builder, value) }\n... | [
{
"docid": "7a866905ead2222176c64ba23d2c8b7d",
"score": "0.6811272",
"text": "def build(xml, key, value)\n case value\n when Hash\n xml.tag!(key.to_s){|t|\n value.each { |k, v|\n build(t, k, v)\n }\n }\n when Array\n valu... |
865835998f99ee29f5e31117f0bf2d7e | Copies files in a directory filtering them with a given extension | [
{
"docid": "7bf0d08b01feba9347e78460a298d88d",
"score": "0.6191136",
"text": "def selective_copy(directory, &block)\n Dir[File.join(source_paths, directory)].each do |filename|\n file = filename.to_s.gsub(\"#{Engine.root.to_s}/\", '')\n copy_file file\n end\n end",
... | [
{
"docid": "45e5044c1ffa5ae595966a8aa39106ce",
"score": "0.70013815",
"text": "def process_directory(src, dest, ext = nil)\n src_path = '%s/*.%s' % [File.expand_path(src), ext || '*']\n dest_path = File.expand_path dest\n Dir.glob(src_path) do |file|\n dest_file = File.join... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "736651faa93d806a62cfb0b72f93f881",
"score": "0.0",
"text": "def set_source_master\n @source_master = SourceMaster.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;... |
2563470214712c29da4dcad45ba2d21f | Leave these methods alone! This method makes sure the file has been created (properly) | [
{
"docid": "18494886a082c2cbda26c94d5e05672e",
"score": "0.0",
"text": "def setup_file\n unless File.exists?('link_db')\n File.open('link_db', 'a+') do |link_database|\n link_database.write(\"[]\")\n end\n end\nend",
"title": ""
}
] | [
{
"docid": "5172af083eeae3246bbf6662d7b6a76c",
"score": "0.7301923",
"text": "def create!\n if(!File.exist?(@file))\n FileUtils.mkdir_p(@file)\n FileUtils.touch(@file)\n end\n end",
"title": ""
},
{
"docid": "75ae5890a19b09d8feb72636c9f483e7",
"score": "0.70916444",
... |
76b82212f5d461d55e3d370ff42961b2 | restituisce l'ammontare di bonus al parametro che conferisce al gruppo rispetto al proprio parametro statico (senza moltiplicatori) | [
{
"docid": "41861ed8685b8d81d2d7e28ad7e681f0",
"score": "0.0",
"text": "def param_gift(param)\n multiplier = 0.0\n states.compact.inject(0.0) {|multiplier, state| multiplier + state.param_gift[param] }\n case param\n when :atk\n value = static_atk\n when :def\n val... | [
{
"docid": "d2a3e76dace1d20847c7305d0a07c365",
"score": "0.65916604",
"text": "def calculo \n self.minutos_reales = 5 * 480 #cantidad de OPERARIOS * Jornada de Trabajo(Turnos)\n self.costo_minuto = 89 #Costo Real por minuto\n self.otros_costos = 540 * 89 #Tiempo Total(Minutos) * Cos... |
ec4759ef6e275234ca540b46b44208aa | The time this method's children took to execute | [
{
"docid": "843b4352554511ff1a4e1a0e430ee480",
"score": "0.79307455",
"text": "def children_time\n self.total_time - self.self_time - self.wait_time\n end",
"title": ""
}
] | [
{
"docid": "5c9b5fffd147e60a9ab28823d906669d",
"score": "0.7163077",
"text": "def children_duration; end",
"title": ""
},
{
"docid": "30f089b3cb8b3758d771fd26c51d3595",
"score": "0.7135039",
"text": "def total_time=(_arg0); end",
"title": ""
},
{
"docid": "1d81e47b48248bc... |
b3dc0eb1bc87be8677720fe7bc520787 | Return the highest ranked dish (for the wine) in the list of dishes | [
{
"docid": "169ef3be7d7e2733c2f88f77e92e60fc",
"score": "0.7713317",
"text": "def most_preferred_dish(wine, dishes)\n wines[wine].detect do |preference|\n dishes.include?(preference.object)\n end.object\n end",
"title": ""
}
] | [
{
"docid": "23c7ccbde08e8a46c995dc0c491b0c02",
"score": "0.6683043",
"text": "def dominant(fish)\n fish_arr = ms(fish)\n fish_arr.last\nend",
"title": ""
},
{
"docid": "f46c069d2768c4a3c9a8ce9eaf365401",
"score": "0.66295034",
"text": "def highest; sorted_ranks.first ; end",
"t... |
3140a62fae22ed61c09f85e67a4f7f64 | Returns the direction that is the horizontal mirror to the given +direction+. This will work even if the +direction+ value is in the UNDER bitmask. | [
{
"docid": "bbb11bae81935dfe234a146a475fe08f",
"score": "0.7165797",
"text": "def hmirror(direction)\n if direction & UNDER != 0\n hmirror(direction >> UNDER_SHIFT) << UNDER_SHIFT\n else\n case direction\n when E then W\n when W then E\n when NW then NE\n when NE th... | [
{
"docid": "94613c992b917a9d72ac602696ecf80f",
"score": "0.6436834",
"text": "def vmirror(direction)\n if direction & UNDER != 0\n vmirror(direction >> UNDER_SHIFT) << UNDER_SHIFT\n else\n case direction\n when N then S\n when S then N\n when NE then SE\n when NW th... |
e7068c1ba6476502f0979be9ea13bd3e | Establece un ranking de usuarios por grupo, teniendo en cuenta los aportes relacionados con las especies del grupo | [
{
"docid": "e8b6fcc72664bdcf965062e8008ef106",
"score": "0.6491806",
"text": "def users_ranking\n User.find_by_sql(\"SELECT U.id, U.name, COUNT(R.id) ediciones\n FROM users U, reviews R, species S, groups G, group_users GU, species_groups SG, models m\n WHERE U.id = R.user_id AND U.id = GU... | [
{
"docid": "a30fc15593fd72a7bf21f822d5cccc53",
"score": "0.6289992",
"text": "def user_rank!\n r = 1\n users.order('rating DESC').each do |u|\n user_universities.find_by_user_id(u.id).update_attribute(:rank, r)\n r += 1\n end\n end",
"title": ""
},
{
"docid": "1f1c1366885... |
25f26d6619e71ab3e8ca1e778a5d0201 | Useful for manual debugging Prints the response returned by DX::http_request | [
{
"docid": "d9dc604c87e9c352ef53441127cd5799",
"score": "0.59646016",
"text": "def printresp(resp)\n if (!resp.is_a?(String))\n puts JSON.pretty_generate(resp)\n else\n puts resp\n end\nend",
"title": ""
}
] | [
{
"docid": "d6523fccaab63f9f9976f90908e2e001",
"score": "0.754462",
"text": "def debug_info(address, body, response)\n puts \"Request: #{address}\"\n puts \"Body: #{body}\"\n puts \"Response: #{response.body}\"\n end",
"title": ""
},
{
"docid": "01125ddf3f3226eb44580991a66e9eda",
... |