query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
1ceb67dc430d782e49f6bb768736d7e9
This method removes the topmost buffer. It does not flush the buffer in any way. Use +flush_and_pop_buffer+ for that.
[ { "docid": "e2cbe6c46c4d80fb5708fdad2b9aade3", "score": "0.748564", "text": "def pop_buffer\n poped = nil\n\n if buffer_stack\n poped = buffer_stack.pop\n # We need to delete the whole array to prevent a memory leak\n # from piling threads\n @buffer.delete(Thread.cu...
[ { "docid": "bd773dae53ddc34c7ad0a970789385e1", "score": "0.7594597", "text": "def pop_discard_buffer\r\n raise Shells::NotRunning unless running?\r\n # a standard pop discarding current data and retrieving the history.\r\n debug 'Discarding buffer <<'\r\n sync do\r\n hist_stdo...
9e25d4440ab1999386d911d16791a823
The deserialization information for the current model
[ { "docid": "6be8a451492b6ffd8a83c2355386dbe6", "score": "0.0", "text": "def get_field_deserializers()\n return super.merge({\n \"azureADAppId\" => lambda {|n| @azure_a_d_app_id = n.get_string_value() },\n \"communicationServiceId\" => lambda {|n| @com...
[ { "docid": "613f62eeb3655523fae5d548dc6e7875", "score": "0.6579711", "text": "def get_field_deserializers()\n return {\n \"downloadUrl\" => lambda {|n| @download_url = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_val...
c9cbe16b9df57ae4781c13cb4351fbf7
GET /academics/new GET /academics/new.json
[ { "docid": "ec77b223ecf427b9f2b8983a7e990f13", "score": "0.0", "text": "def new\n @academic.image_url = \"photo.png\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @academic }\n end\n end", "title": "" } ]
[ { "docid": "df6e97ba784354631e752894899b49cb", "score": "0.7051969", "text": "def new\n @anagrafica = Anagrafica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @anagrafica }\n end\n end", "title": "" }, { "docid": "11d470ce4fcf35c...
790268d460282027e70710794ce1fb4d
Below method prints students into separate lists depending on their cohort. You can filter whom you want to print by firsdt letter of their name, max. name length or cohort.
[ { "docid": "2d7a1bb36fa93a09adac48af553cb095", "score": "0.8434435", "text": "def print_students_list\n students = filter_ask\n if students == [] then return puts \"No students meet your criteria. Sorry.\" end\n cohorts = cohort_filter(students)\n print_header\n cohorts.each do |cohort|\n puts c...
[ { "docid": "2d81dc67282e489875fcad29aee346a4", "score": "0.8262719", "text": "def print_students_list(names)\n names_group = names.group_by { |x| x[:cohort] }\n names_group.each do |cohort, names|\n puts \"\"\n puts \"#{cohort.capitalize}:\".center(10)\n names.each_with_index{ |x, index| puts...
398ec7e4b4f47c4fac3cf7e8a80bd7fa
DELETE /fund_types/1 DELETE /fund_types/1.json
[ { "docid": "e93adadd16656320bb198e0afc66ae86", "score": "0.7603142", "text": "def destroy\n @fund_type.destroy\n respond_to do |format|\n format.html { redirect_to fund_types_url, notice: 'Fund type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "...
[ { "docid": "441ce396b9538c43a9a8df51cb943952", "score": "0.7368081", "text": "def destroy\n @fee_type.destroy\n\n respond_to do |format|\n format.html { redirect_to fees_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0f1262f58d1b8efd8454...
69beaa3e957d1fc356539d0314d703e1
Custom attribute writer method checking allowed values (enum).
[ { "docid": "ae6002809eef1e13371a54166d713fd6", "score": "0.0", "text": "def string_condition_type=(string_condition_type)\n validator = EnumAttributeValidator.new('String', ['equals', 'contains', 'starts_with', 'ends_with', 'regex'])\n unless validator.valid?(string_condition_type)\n fa...
[ { "docid": "af6d0e33773bc681443214ce777b13e1", "score": "0.70866877", "text": "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "title": "" }, { "docid": "85eec95603dc239e3d18923b2c672b31", "score": "0.648...
dc3f34cf83e12a302d38a322fa1b6a78
Initializes this client and creates a new, associated tweeter instance with this client set as the delegate. Also, for all of this clients handlers it will call client= if defined. Lastly, it updates BirdGrinder::Client.current to point to itself.
[ { "docid": "ccad03c25c3cf43df91d8dc02251cd10", "score": "0.84521794", "text": "def initialize\n logger.debug \"Initializing client...\"\n @tweeter = BirdGrinder::Tweeter.new(self)\n logger.debug \"Notifying handlers of the client\"\n handlers.each { |h| h.client = self if h.respond_t...
[ { "docid": "a1c7ca14995186996b0777f597056e0e", "score": "0.69745886", "text": "def init_client\n @client ||= TwitterOAuth::Client.new(client_params)\n end", "title": "" }, { "docid": "1705cc1c152e689e6b091739c2679020", "score": "0.68794096", "text": "def client\n @client |...
6a74d89d6025c77149c25d2f9160cbb3
Goal Decumulation Status Track the status of a decumulation goal
[ { "docid": "d7c1fb14e8ff56c9564afa790d29b25b", "score": "0.66973656", "text": "def goal_decumulation_status(goal_decumulation_status_request, opts = {})\n data, _status_code, _headers = goal_decumulation_status_with_http_info(goal_decumulation_status_request, opts)\n data\n end", "title...
[ { "docid": "c4744ab5634e64351e53414f8d80c2f3", "score": "0.7221105", "text": "def update_goal_status\n status = self.goal.status(self.user_id)\n status.value += self.value\n status.save\n end", "title": "" }, { "docid": "1eb4c1b8c6ee2faa7069606bdf844bc3", "score": "0.67...
d4c523fe7ae9a5de4e3501d4aa179749
Returns the name of this cardinality, based on its two cardinal numbers (for source and destination). Can be any of +:one_to_one:+, +:one_to_many+, or +:many_to_many+. The name +:many_to_one+ also exists, but Rails ERD always normalises these kinds of relationships by inverting them, so they become +:one_to_many+ assoc...
[ { "docid": "1bec7c636d9bf527a95b69333e3ac728", "score": "0.61687934", "text": "def name\n CLASSES[cardinality_class]\n end", "title": "" } ]
[ { "docid": "02e8a60b21caa7a1f1116d4906aaa439", "score": "0.57070845", "text": "def name\n ALL.each_pair do |name, direction|\n return name.to_s if direction == self\n end\n nil\n end", "title": "" }, { "docid": "768f9441d4ecdc1f42bae86a17c5cdeb", "score": "0.5588...
73622c385a75041ebc2c67a8d0248b27
set the status to 'reverted' passing along any additional messages
[ { "docid": "d7252e7d9f7e60c1735271ec494c8dbb", "score": "0.68835425", "text": "def reverted(*messages)\n job_status({ 'status' => STATUS_REVERTED }, *messages)\n @logger.error(\"Job #{@uuid}: #{messages.join(' ')}\")\n end", "title": "" } ]
[ { "docid": "def15956c226acbccf10357a1c3c00c6", "score": "0.73609734", "text": "def revert_state_text\n\t\tif @order.order_state == 'delivered'\n\t\t\t'Revert to In-Progress'\n\t\telsif @order.order_state == 'in-progress'\n\t\t\t'Revert to New'\n\t\tend\n\tend", "title": "" }, { "docid": "b5e...
86711b8b6a4ff924b9a42dc6bb8a4fad
Add default styles to default target, default styles will be automatically added to xhtml document
[ { "docid": "b147e58c3d1212da55e0c290759bd1bc", "score": "0.715164", "text": "def add_default_style(*file_paths)\n @default_target.add_default_style(*file_paths)\n end", "title": "" } ]
[ { "docid": "b0a2aad32473c738c4de234c82497fb9", "score": "0.69502544", "text": "def add_default_styles(*file_paths)\n @default_target.add_default_styles(*file_paths)\n end", "title": "" }, { "docid": "d3791149b18e5da8868f31330c112a23", "score": "0.6555907", "text": "def use_de...
e24fc635f2b9d2fb04352c20a0638ea6
last_seen is in localtime already!
[ { "docid": "620be749c9c0f848b430bd9cd0bb2268", "score": "0.0", "text": "def show_last_datetime employee\n return '' if employee.last_seen.blank?\n employee.last_seen.strftime '%d/%m/%Y %H:%M'\n end", "title": "" } ]
[ { "docid": "a6abf64eacb0f31a34b359daa7b9d0d7", "score": "0.7989964", "text": "def last_seen; end", "title": "" }, { "docid": "b551176bf401a8103de72f623ba5fb3f", "score": "0.7409807", "text": "def get_last_seen \n\treturn self.last_seen\nend", "title": "" }, { "docid": "4a...
f777b1b4e3d6c58397179d88eae29372
Return true unless province translation exists and contains special province 'none' with value 'true'
[ { "docid": "cb7819bb5ae2771a7c2eee15753904be", "score": "0.7835752", "text": "def has_provinces?(country)\n translation_hash = merge_translation_hashes(country, :provinces)\n\n !(translation_hash && translation_hash[:none] == 'true')\n end", "title": "" } ]
[ { "docid": "e6257b2bc5e061aff3fed493f900ae4b", "score": "0.6471505", "text": "def phrase_untranslated?\n !phrase_translated?\n end", "title": "" }, { "docid": "b90628d500e9265f0b18d1dd007d1085", "score": "0.6451469", "text": "def translation_enabled?\n (!@disable_transla...
3828bc8de49d97c9f72da5a469455db1
To retrive the Events Schedule.
[ { "docid": "a37d34fbe5548d9aa6536fad8f94a563", "score": "0.0", "text": "def sport_events\n puts \"suganya\"\n puts @sport = Sport.find(params[:id])\n puts @events = Event.find_all_by_sport_id(params[:id])\n puts @events.inspect\nend", "title": "" } ]
[ { "docid": "2693da95ba2c2dfb3d902bb03e3e59c5", "score": "0.73739076", "text": "def schedules\n return @schedules\n end", "title": "" }, { "docid": "c9ff3733722bbf0816f92a0489f226d2", "score": "0.72174585", "tex...
ef44ef5bab29d72fd45a17be55ca9fcb
This private method is called when deleting a part for binder type kits. It deletes the cup and part entries from the respective tables
[ { "docid": "bd4b85bd3c8e68ddc11390e82ab38cf8", "score": "0.6978266", "text": "def delete_binder_kit_part\n if Kitting::Kit.find_by_id(params[:kit_id]).kit_media_type.kit_type== \"binder\"\n @binder_cup = Kitting::Cup.find(:all, :conditions => ['kit_id =?', params[:kit_id].to_i])\n @de...
[ { "docid": "c4cf5e8f51495cc02dfab9937ce27939", "score": "0.6628734", "text": "def delete_the_kind_of_related_data_table\n @kind.participant_templates.destroy_all\n @kind.observer_templates.destroy_all\n @kind.agenda_templates.destroy_all\n end", "title": "" }, { "docid": "a...
0bd07304f9d12d70a43f189a649e6e64
Hard is a synonym for assertionless.
[ { "docid": "723d3382f086b13939fcafa127b1b60b", "score": "0.7520517", "text": "def hard?\n @hard || self.class.assertionless\n end", "title": "" } ]
[ { "docid": "7e0d793bb416d2348086451422f210fb", "score": "0.6376164", "text": "def deny(assertion)\n assert !assertion\n end", "title": "" }, { "docid": "0fb95161f3db79028ca1d8e744759d69", "score": "0.6291017", "text": "def assert_false(exp, msg=nil)\n FalseAssay.assert!(exp,...
3a9ad35265e21d3437218ed130637d6c
Builds headers for request to remote service.
[ { "docid": "d87f48aaefc86b85edddf730c4fff41c", "score": "0.73803854", "text": "def build_request_headers(http_method = nil)\n headers = {}\n\n if session_token\n logger.info \"SessionToken: #{session_token}\" if logger\n headers['Api-Session-Token'] = session_token\n end\n\n...
[ { "docid": "36aeee59e4b3820c79c8a8ccc1edaa8a", "score": "0.75775373", "text": "def build_request_headers(headers, http_method, uri); end", "title": "" }, { "docid": "b32d6ffc195399cd33711031e95f3845", "score": "0.7312161", "text": "def build_request_headers(headers, http_method=nil)\...
7ee42c1b8bf59a46725a998c513308f3
PUT /flash_cards/1 PUT /flash_cards/1.xml
[ { "docid": "96f9a48d3518fbb3c7e6407d53a1dbfb", "score": "0.7002742", "text": "def update\n @flash_card = FlashCard.find(params[:id])\n\n respond_to do |format|\n if @flash_card.update_attributes(params[:flash_card])\n format.html { redirect_to(@flash_card, :notice => 'Flash card was su...
[ { "docid": "bb19681ac163a1e99362080781f65333", "score": "0.68431836", "text": "def update\n @flashcard = Flashcard.find(params[:id])\n\n respond_to do |format|\n if @flashcard.update_attributes(params[:flashcard])\n format.html { redirect_to @flashcard, notice: 'Flashcard was successfu...
997bfc648edc1b07536bb0f71b293adf
Adds metadata.gz to the gemformat tar file which was saved from a previous add_gem_contents call.
[ { "docid": "9975ca43dc67b8c253f96b7bc0a6df08", "score": "0.7881125", "text": "def add_metadata\n return if @metadata.nil?\n\n @tar_writer.add_file \"metadata.gz\", 0644 do |io|\n begin\n sio = @signer ? StringIO.new : nil\n gzos = Zlib::GzipWriter.new(sio || io)\n gzos.wr...
[ { "docid": "1da0e77253705ae85ee46e329cb4a6e1", "score": "0.7900277", "text": "def add_gem_contents\n @tar_writer.add_file \"data.tar.gz\", 0644 do |inner|\n sio = @signer ? StringIO.new : nil\n Zlib::GzipWriter.wrap(sio || inner) do |os|\n\n Gem::Package::TarWriter.new os do |data_ta...
05cd3986248cc30deb731955b8de9653
Set the value of the CommentType input for this Choreo.
[ { "docid": "76a70efe6709305dbb699628a1d2029f", "score": "0.78748435", "text": "def set_CommentType(value)\n set_input(\"CommentType\", value)\n end", "title": "" } ]
[ { "docid": "94679ca8d9fcc147f81b169be4d6c1f4", "score": "0.6897406", "text": "def commentable_type=(commentable_type)\n write_attribute(:commentable_type, commentable_type)\n end", "title": "" }, { "docid": "45642dfd768737d6d2277d56a04b6ce9", "score": "0.6339815", "text": "def se...
a77dd07749fb980e9bff83b5497fcf5f
Create a User hash from Person model
[ { "docid": "87fb2d4bce2bd21b051150d31f5177fb", "score": "0.72634023", "text": "def from_model(person)\n hash = HashUtils.compact(\n EntityUtils.model_to_hash(person).merge({\n # This is a spot to modify hash contents if needed\n }))\n return UserService::API::DataTypes...
[ { "docid": "a3d78e57f632ae211626e6ea993d96a0", "score": "0.66555625", "text": "def to_hash #este metodo eh para converter o objeto Factory para hash\n {\n full_name: @full_name, #essa conversão me possibilita acessar a propriedade\n email: @email,\n password: @password\n }\n end", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0caa569afa3d326af30b04b6217a2f7e", "score": "0.0", "text": "def institucion_params\n params.require(:institucion).permit(:cod, :nombre, :email, :direccion, :telefono)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69811666", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782836", "text": "def strong_params\n params.requ...
ee02513af458b0bd6a1d62dc9d39d75b
Extract invalid pairs on response => ["GBPNZD", "AUDCAD", "AUDCHF" ...] not exists on DB
[ { "docid": "1c906d89188bdc53901569d95d6c4e07", "score": "0.5895739", "text": "def delete_exists_pairs_in_response\n make_currency_pairs - CurrencyPair.pluck(:pair)\n end", "title": "" } ]
[ { "docid": "81839abaff39e1455e8b97d98350cc17", "score": "0.691494", "text": "def valid_response_pairs\n split_into_pairs_response.select do |pair|\n (pair - currency_codes).size.zero?\n end\n end", "title": "" }, { "docid": "71cc0d0cb614ddad0be78471c8933f20", "score": "0.6239...
9def53e3069dc03a9cd698eb799c82e0
DELETE /prd_thresholds/1 DELETE /prd_thresholds/1.xml
[ { "docid": "1257636513eb54033b506ae223018e11", "score": "0.7526981", "text": "def destroy\n @prd_threshold = PrdThreshold.find(params[:id])\n @prd_threshold.destroy\n\n respond_to do |format|\n format.html { redirect_to(prd_thresholds_url) }\n format.xml { head :ok }\n end\n end"...
[ { "docid": "22328cbae1768553b796ad8a4f04f990", "score": "0.6942988", "text": "def destroy\n @deposit_threshold = DepositThreshold.find(params[:id])\n @deposit_threshold.destroy\n\n respond_to do |format|\n format.html { redirect_to(deposit_thresholds_url) }\n format.xml { head :ok }\...
43682f7f782522b4f56af0bbebdab6ee
Returns the last key
[ { "docid": "beda9454cc5b7aeb2a9a2612d60b32db", "score": "0.7819196", "text": "def last_key\n time_to_key last_time, @resolution\n end", "title": "" } ]
[ { "docid": "2bb841315939b23cf8ab3f18c03acdc3", "score": "0.8889067", "text": "def last\n last_key.get\n end", "title": "" }, { "docid": "1bcc96fa4bfee8d6cc5faefc266052d8", "score": "0.8709298", "text": "def last\n keys.last\n end", "title": "" }, { "docid": "a...
6c60e8beba3b79bc3993462eef517ad5
POST /event_days POST /event_days.json
[ { "docid": "b57e3ef5d46f9c6a61a74af3669fbf24", "score": "0.67621946", "text": "def create\n @event_day = EventDay.new(event_day_params)\n @event = Event.find(params[:event_id])\n\n respond_to do |format|\n if @event_day.save\n format.html { redirect_to @event, notice: 'Event day was...
[ { "docid": "121f0b660a5e211a8c6aeb010b5d8eea", "score": "0.63594234", "text": "def create_day\n trip = Trip.find(params[:id])\n offset = 0\n trip.days.all.each do |day|\n offset += 1\n end\n @day = Day.new({\"date\" => trip.beginning + offset , \"trip\" => trip})\n trip.update_a...
d955e67d964c0e0abfc923170c01d7ff
Ditransitive Verb Phrase exactly two immediate consituents of type NP Do not count NPs that are marked as, for example, NPSBJ. Dealing with nesting and making sure that you only consider the immediate consituents will be tricky, especially if you are using RegEx
[ { "docid": "798be409ee38b4482f976df1a722a5bc", "score": "0.5060101", "text": "def countNumDitran(res)\n\t\tdCount = 0\n\n\t\tif res == nil || res.length == 0\n\t\t\treturn dCount\n\t\tend\n\n\t\t# make sure to not count, for example, NP-SBJ\n\n\t\tres.each do |constituent|\n\t\t\t# verify Ditransitive V...
[ { "docid": "a01c3beef6d8b84304e81a3266669563", "score": "0.54697895", "text": "def part_two(pass)\n triples = pass.scan(/(.)\\1\\1/)\n doubles = pass.scan(/(.)\\1/)\n triples.empty? ||\n (triples.any? && (doubles - triples).any? && (triples - doubles).empty?)\nend", "title": "" }, { "d...
892e3e6d557ee1b082ed8a3249dc534f
GET /bookmarks or /bookmarks.json
[ { "docid": "7c2e80be46d37e78aa24efc4c4846c8a", "score": "0.66554725", "text": "def index\n bookmarks = Bookmark.all.most_recent\n render json: bookmarks\n end", "title": "" } ]
[ { "docid": "63ad4b3dc1844cd5e0bb05fe79d822e4", "score": "0.75644386", "text": "def get_bookmark(url=nil)\n url = \"/bookmarks\" if url.nil?\n get url, nil, HTTP_HDR\n end", "title": "" }, { "docid": "0e4f8b8acdce413ed26de4b7ec55b454", "score": "0.7323554", "text": "def index\n...
6340fe867310007ff6966e0b34bb5950
insert without checking for duplicates
[ { "docid": "97d199dec0f48935fdf7104d099273e7", "score": "0.0", "text": "def do_insert_command(records)\n execute_sql_command(compile_insert_command(records))\n end", "title": "" } ]
[ { "docid": "36880dcb8a0f2049982d0a15a4bfe130", "score": "0.69680136", "text": "def insert(val)\n return false if @set.include?(val)\n @set.add(val)\n return true\n end", "title": "" }, { "docid": "ddce88ee1eeca943d4d11404fbb5e29d", "score": "0.69623286", "text": "de...
18548c9a945088e5a2ff1c6e5834f35a
Attempts to read then end of `FILTER` expression.
[ { "docid": "9eb4ff2aae7c61a209dfa9db5807d5fd", "score": "0.7697002", "text": "def read_filter_ending\n match(RE_FILTER_END)\n end", "title": "" } ]
[ { "docid": "955911b7d2a70e6c299037e185b45438", "score": "0.77748615", "text": "def read_filter\n return nil unless match(RE_FILTER)\n while (read_filter_condition || read_filter_ending); end\n true\n end", "title": "" }, { "docid": "5d2e3f705800086f738a9f2ea11041ec", "s...
7d48ee86dcb3ef0803bff1d928d0c319
Returns given number of results, newest first, as a hash array Each hash contains the fields `title`, `price`, and `issue_date`
[ { "docid": "a2adfb8ff0ac37a15170feade2c275f8", "score": "0.59088373", "text": "def getListings(count)\n rcount = 0\n results = []\n url_token = \"\" #Stores additional query tokens\n\n while rcount < count\n feed = RSS::Parser.parse(open(@base_url + url_token).read, false)\n feed.i...
[ { "docid": "b29b4295cea824448c56cc203ee9df6a", "score": "0.5912234", "text": "def sort_past_results(pr)\n sorted = {\n \"1\" => [],\n \"10\" => [],\n \"100\" => [],\n \"1000\" => [],\n }\n parse_json(pr).each do |result_hash|\n result_hash.each do |chunk, data|\n ...
75c43127f4c284066f728af70e1a6cf5
Function to search the idcc_targ_rep mart and return details for all the KOMPCSD/EUCOMM products within...
[ { "docid": "ab13dc8f644e7f3e39091a8d39b5e480", "score": "0.6775613", "text": "def idcc_targ_rep_get_all_products\n dist_products = {}\n\n ['KOMP-CSD','EUCOMM'].each do |project_filter|\n puts \"[idcc_targ_rep_get_all_products] - requesting data for '#{project_filter}' projects...\"\n dat...
[ { "docid": "11c9f4c3889712e302807b01827db1c2", "score": "0.65574247", "text": "def find_htgt_to_targ_rep_discrepancies\n htgt_products = {}\n idcc_products = {}\n \n threads = []\n threads << Thread.new() { htgt_products = htgt_targ_get_all_distributable_products }\n threads << Thread....
abd37bdd940d175bad46be3cfaf24f68
PUT /workshop_processes/1 PUT /workshop_processes/1.json
[ { "docid": "244dfcd0d5831baf209068db8945ef66", "score": "0.72381115", "text": "def update\n @workshop_process = WorkshopProcess.find(params[:id])\n\n respond_to do |format|\n if @workshop_process.update_attributes(params[:workshop_process])\n format.html { redirect_to @workshop_process...
[ { "docid": "17f1259e9591c118d5a869718ff30ed6", "score": "0.651282", "text": "def create\n @workshop_process = WorkshopProcess.new(params[:workshop_process])\n\n respond_to do |format|\n if @workshop_process.save\n format.html { redirect_to @workshop_process, notice: 'Workshop process w...
2a4983b51699c1db607ade422256c2e2
The same data after removing rows/columns E.g., when finding first plan, some rows/columns are 'crossedout': they are taken out of the minimal item / northwest item search, but the indices of the matrix should stay the same as before. def available_data
[ { "docid": "b6408401d809d5b984a1567d9efd6ed4", "score": "0.0", "text": "def m\n a.length\n end", "title": "" } ]
[ { "docid": "b15da860305a9b939536e8b8cec5285e", "score": "0.6055562", "text": "def compact_rows!\n @data.delete_if { |ar| ar.all? { |el| el.to_s.empty? } || ar.empty? }\n calc_dimensions\n end", "title": "" }, { "docid": "1b58883275edb9f345faa5218caa55a7", "score": "0.5949375...
8b8fd1fd2faff5a115a82c7a5a3f0bcd
array with 1 nested hash element
[ { "docid": "ed13d7a6eef292a1e6f2d15ae0fbcaae", "score": "0.0", "text": "def merge_data(keys, data)\n combined = []\n keys.each do |element| # e.g. {:first_name=>\"blake\"}\n combined << element.merge(data[0][element[:first_name]])\n # element.merge(data[0][\"blake\"])\n end\n combine...
[ { "docid": "8fda64c56afdac4b77349a048592284d", "score": "0.73177856", "text": "def hash\n [].hash\n end", "title": "" }, { "docid": "a393d92bf444469ea536dc633d0b4755", "score": "0.6905722", "text": "def to_ary\n [@hash]\n end", "title": "" }, { "docid"...
4b0299e56414843366d9b9d6b7027d4b
This name is either the name explicitly assigned (if any) or is constructed to form a unique index name.
[ { "docid": "a38551f5202b70b307a24ef54101f4a9", "score": "0.65370446", "text": "def name\n uc = @uniqueness_constraint\n r = real_name\n return r if r && r !~ /^(Ex|In)ternalUniquenessConstraint[0-9]+$/\n (uc.is_preferred_identifier ? \"PK_\" : \"IX_\") +\n view_name ...
[ { "docid": "e5311a95c555156fbd5740af4e4f4850", "score": "0.80643326", "text": "def indexed_name(name = nil)\n @indexed_name = name.to_sym if name\n @indexed_name\n end", "title": "" }, { "docid": "832584e4741d4991b722306dc23f20c6", "score": "0.78409445", "text": "d...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f00e63b4ef1d4c7d00d8422a3d52f8c8", "score": "0.0", "text": "def set_maker\n @maker = Maker.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...
33d99d8a95b978e41bec542b9c077c80
PATCH/PUT /scenarios/1 PATCH/PUT /scenarios/1.json
[ { "docid": "4a62c5853cca7df4dc72983df199f9e8", "score": "0.6190043", "text": "def update\n respond_to do |format|\n if @scenario.update(scenario_params)\n if params[:scenario][:questions_attributes]\n format.html {redirect_to scenario_questions_path(@scenario, new_answer: params[...
[ { "docid": "68d16904dd061c71e2a272d2d31007e9", "score": "0.69924337", "text": "def update\n scenario = Scenario.find(params[:id])\n scenario.update(scenario_params)\n scenario.steps = []\n json_response(step_builder(scenario), status: :updated)\n rescue => e\n render json: {error: e.mess...
9014fb1f4f8c969d115707607bf2c471
pick random backend from replica set
[ { "docid": "90aec5f4b5819945eab1fc6915062600", "score": "0.6597346", "text": "def backend_for_shard(table, shard)\n rs_for_shard(table, shard).sample\n end", "title": "" } ]
[ { "docid": "b4240c74e96db9f864790ca1fd0a9936", "score": "0.64323044", "text": "def select_replica(user)\n # If the user's `min_lsn` is `NULL` then they haven't performed an operation\n # yet, and we don't yet know if we can use a replica yet. Default to the\n # primary.\n return :default if user.min...
a9f53c6797156bbcb4aa6057e2180ba4
GET /office_spaces/1 GET /office_spaces/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b1d311c10ae1aa9f5bdcc6abeaac1e72", "score": "0.7405778", "text": "def index\n @office_spaces = OfficeSpace.all\n end", "title": "" }, { "docid": "57cd3b24dc29f9bfaab076f5b07eddad", "score": "0.69393253", "text": "def index\n @spaces = Space.all\n\n respond_to do...
d601934226da641067de84169085d7b1
Get an organization membership
[ { "docid": "841f19657010969dae9c487020f0f117", "score": "0.7252443", "text": "def organization_membership(org, options = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "daf8eb295c40296b5675eed8241b135e", "score": "0.81784827", "text": "def organization_membership(org_id)\n organization_memberships.where(org_id: org_id).first\n end", "title": "" }, { "docid": "ddb657dd551400881da79be1d32e7035", "score": "0.77715284", "text": "def memb...
22b1852e9cab0eabc28bd96e7def2752
Get all groups of contacts for the user
[ { "docid": "565d1ad1f85f8d3c877d9fe48d6c0e4d", "score": "0.7661749", "text": "def groups()\n get('contactGroupList')\n end", "title": "" } ]
[ { "docid": "9020e6800848b1bb4df300ebe1c4514a", "score": "0.7159416", "text": "def index\n @contact_groups = ContactGroup.where(user_id: current_user.id)\n end", "title": "" }, { "docid": "70500d3fc0c1e9902040194fbb992d32", "score": "0.71512663", "text": "def groups_by_contact(fir...
abf90778492c06bd2cf515ad645f042d
GET /boat_colors/1 GET /boat_colors/1.xml
[ { "docid": "4cd8118dc1fc987452c5d3514527bc50", "score": "0.7158989", "text": "def show\n @boat_color = BoatColor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @boat_color }\n end\n end", "title": "" } ]
[ { "docid": "45bba463fff3c1826d7ac4f7746368e5", "score": "0.68019414", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @colors }\n end\n end", "title": "" }, { "docid": "aae408e65561216770a5fcbd56356398", "score": ...
ea8d56982f6b1be582a68562bb4c6afa
password digest creates gibberish that is saved in the database provided by bcrypt, which has the password hash and salt. It is saved to database instead of plain password for security reasons.
[ { "docid": "7c14269c4f277f8b2f7537487982283e", "score": "0.0", "text": "def password=(password)\n\t\t@password = password\n\t\tself.password_digest = BCrypt::Password.create(password)\n\tend", "title": "" } ]
[ { "docid": "f113712a762a271ad91a2bc9830d1eb3", "score": "0.79514056", "text": "def set_password_digest\n self.password_digest = BCrypt::Password.create(@password)\n end", "title": "" }, { "docid": "86d144e86da54290af1fdb78c0c83a45", "score": "0.78565806", "text": "def digest(stri...
5afc13214d5166d6397a72fad68daab8
POST /users POST /users.xml
[ { "docid": "b2eb0ce12c3f75a655fb264b021fb4c7", "score": "0.5558225", "text": "def create\n @user = User.new(user_params)\n @user.admin = false\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(root_url, notice: 'User was successfully created.') }\n format...
[ { "docid": "4794c3e6e2db462f4d8769453efddedd", "score": "0.71678036", "text": "def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end", "title": "" }, { "docid": "df2e8c709ee6535536069a3...
96e9bbea170695374966f25d2d90cbb8
GET /staff/reports/courses/:id/course_genders.json Provides course genders JSON for background loading of charts.
[ { "docid": "f66aa788a7801628d4de2eb9fa4195f2", "score": "0.81987315", "text": "def course_genders\n authorize :report, :view?\n render json: Application.report_course_genders(params[:id], params[:year].to_i)\n end", "title": "" } ]
[ { "docid": "46c17d1c5c5aadbb0bfa750034d38d9c", "score": "0.70684475", "text": "def college_genders\n authorize :report, :view?\n render json: Application.report_gender(params[:id], params[:year].to_i)\n end", "title": "" }, { "docid": "32d099c83c4793b47427575084ece2e7", "score": "...
fc82edb94dbdbe7b59ef2f56099aaa72
`Newman::TestMailerdeliver_message` method is used to construct and immediately deliver a message with the delivery settings set to test mode.
[ { "docid": "55959c8064eb4d23b7916685332f10e8", "score": "0.6267344", "text": "def deliver_message(*a, &b)\n new_message(*a, &b).deliver\n end", "title": "" } ]
[ { "docid": "e266011dc89b2c48b02e0b665386c459", "score": "0.69244146", "text": "def deliver_test_message(recipient, options = {})\n subject = options[:subject] || \"Testing AsyncEmail\"\n body = options[:body] || \"Test email sent at #{Time.now}\"\n Mail.deliver do\n from ...
8afa8998eb7f633bd2a4389e9efa7fe6
this is variant on problem01. we went through all the effort to calculate the binary search for the seat but there was an easier way! we're just building a bitfield, so if you gsub into 0/1 and then turn into base 10, this problem is free! Thank you, chat!
[ { "docid": "a0c52ea193ea7043f6cb429088d5dd2b", "score": "0.0", "text": "def main\n pp seats_from_line_smart(\"FBFBBFFRLR\")\n return\nend", "title": "" } ]
[ { "docid": "9030d4c893c2a690574cd446dd67c57c", "score": "0.6311585", "text": "def problem_90\n # The 'pairs' we need are.\n # [2,5] is removed since it always needs to be present, as does\n # [1,8]\n # Otherwise we start with [1], [8] and 4 slots to fill\n # 0 -> 146\n # 6 -> 0134\n # We need to ...
d16eeb9565280781c254eedf110e980e
Returns only resources with no parent resource.
[ { "docid": "54fc96e4e89fa0077ea198eb39a210e6", "score": "0.79494774", "text": "def resources_without_parents(resources)\n resources.select do |r| \n r.parent.nil? or !resources.include?(r.parent)\n end\n end", "title": "" } ]
[ { "docid": "3b56d2283e1a1e9b7ac0398b42b2ade0", "score": "0.70284355", "text": "def objects_without_parents\n @collection.select{|o| o.parent.nil?}\n end", "title": "" }, { "docid": "1aa0f9dd07ce95c55a7e964c238605c0", "score": "0.70188916", "text": "def list_resource\n ...
d4b0037c9ab772515cc1ee1f95299d62
returns the y center coordinate given the hexagon number (hn) dictionary fh: hexagon (f)ull (h)eight
[ { "docid": "ba7dfda3c82b34bbf20459f009f33fad", "score": "0.76434577", "text": "def y_center(p_hn)\n return yp_from_hn(p_hn) + fh / 2 \n end", "title": "" } ]
[ { "docid": "df41d430953f1b9607953c117ed1e850", "score": "0.7290689", "text": "def central_hexagon_number\n return hn_from_hcl(((maxcol - 1) / 2).floor, (maxlin / 2).floor)\n end", "title": "" }, { "docid": "a46969d5585df1810a4b64626b89cf0a", "score": "0.6401211", "text": "def hig...
f11593514fbbf3ef00c8b83c4ad5e136
Push a new message into a cache
[ { "docid": "75b7d756b67fdbed28a528b4115ac33c", "score": "0.78380036", "text": "def cache_store(key, message)\n @messages[key] = [] if @messages[key].nil?\n @messages[key].shift if @messages[key].length == 10\n @messages[key] << message\n end", "title": "" } ]
[ { "docid": "facd69fcf8866ce68b5c346d59e2da21", "score": "0.7355058", "text": "def cache_message(msg)\r\n # @conn.prepare(\"insert_quote\", \"INSERT INTO quotes (nickname, message, date_added) VALUES ($1, $2)\")\r\n # @conn.exec_prepared(\"insert_quote\", [msg.nickname, msg.text, Time.now])\r\n ...
98432e47e622d4a9ffbcfae79555b41e
Returns a CloudServers::Image object for the image identified by the provided id. >> image = cs.get_image(8) =>
[ { "docid": "cc91bd57767ad192af5a356f5b476a4c", "score": "0.87801397", "text": "def get_image(id)\n CloudServers::Image.new(self,id)\n end", "title": "" } ]
[ { "docid": "19907400c581a54b3ba5abde86ee9287", "score": "0.8460351", "text": "def get_image(id)\n OpenStack::Compute::Image.new(self,id)\n end", "title": "" }, { "docid": "19907400c581a54b3ba5abde86ee9287", "score": "0.8460351", "text": "def get_image(id)\n OpenStack::Co...
225ad80f54e3c1f08fd001cb34a9ae35
Update the internal state relating to module nesting on 'end'. If the current 'end' pairs up with a class or a module then we should
[ { "docid": "012045e3422cdb4ad8bbdd0c4ca4cd01", "score": "0.67591023", "text": "def track_module_nesting_end(token, kind = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "accd83f3f089646239980833c822adc3", "score": "0.6790162", "text": "def track_module_nesting_end(token, kind = :keyword)\n @module_nesting.pop if kind == :keyword && %w[class module].include?(token)\n end", "title": "" }, { "docid": "2d413fd77b86c90df272f8d65a69a567", "...
a25a53286b55063546addbdc007d2d13
The increment function adds to the current progress value The current progress, can't go higher than the maximum Arguments : amount > value which will be added to the current progress
[ { "docid": "413a95dedcdb57b007e795bbf593c2da", "score": "0.8358829", "text": "def increment(amount = 1)\n self.start_time ||= Time.now\n self.current = (self.current + amount < self.max ? self.current + amount : self.max)\n self.previous_time ||= Time.now\n calc_percent\n end"...
[ { "docid": "84586c8ee21f4a7bc09d39194f1c3764", "score": "0.8028389", "text": "def increment_progress\n update(progress: self.progress += 1.0 / 4)\n end", "title": "" }, { "docid": "80b5d70b85e1149bda509cb8ffbb6719", "score": "0.8022751", "text": "def increment_completion incr=1\n...
f9e86a8c838953e5e5840f8fe8570230
Sets the attribute owner
[ { "docid": "8028b98191da1c3f357ab45898de201a", "score": "0.65381575", "text": "def owner=(_arg0); end", "title": "" } ]
[ { "docid": "d231fdf4d2556a1e2664ad905eb990ee", "score": "0.8256307", "text": "def owner=(value)\n @owner = value\n end", "title": "" }, { "docid": "d231fdf4d2556a1e2664ad905eb990ee", "score": "0.8256307", "text": "def owner=(value)\n @owner = ...
9b46cc99ba60cce53cb8124fc72d6bf7
Delete the specified task name.
[ { "docid": "ae0a1c75bc49b285c1eb00bc6147b67c", "score": "0.6603235", "text": "def delete(task)\n raise Error, 'null pointer' if @pITS.nil?\n raise TypeError unless task.is_a?(String)\n\n task = multi_to_wide(task)\n\n lpVtbl = 0.chr * 4\n table = 0.chr * 32\n\n memcpy(lpVt...
[ { "docid": "14dffda2ac53a3f3d35a1a6da0776a92", "score": "0.870325", "text": "def del_task(name)\n @log.info(\"Controller: Deleting Task #{name}\")\n @tasks.delete(name)\n end", "title": "" }, { "docid": "b8fd627a672612b26bc7bfd27b701688", "score": "0.7451195", "text": "de...
0a0191f6537b2bf17af8bd1de7e3a266
DELETE /builds/1 DELETE /builds/1.json
[ { "docid": "ccbd706db61c486fd13ee9121e751c8c", "score": "0.74548626", "text": "def destroy\n @build.destroy\n respond_to do |format|\n format.html { redirect_to builds_url, notice: 'Build was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "3d4824db2ad2b6d7fbfe3db8c2b20a7d", "score": "0.77080184", "text": "def destroy\n @build = Build.find(params[:id])\n @build.destroy\n\n respond_to do |format|\n format.html { redirect_to builds_url }\n format.json { head :ok }\n end\n end", "title": "" }, { ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "d02f14fdb93b9fea0704d50647ae4525", "score": "0.0", "text": "def page_params\n all_options = params.require(:site_page).fetch(:content, nil).try(:permit!)\n params.require(:site_page).permit(:name, :description, :site_id, :uri, :parent_id, :content_type, :show_on_menu, :page_version).me...
[ { "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...
9d879e4cc33a8014efe3d14ca1746204
Metodos com as acoes
[ { "docid": "881d2eb05372a9f43463919099fc026a", "score": "0.0", "text": "def clicar_mais\n botao_mais.click\n end", "title": "" } ]
[ { "docid": "3d772291b58a7efcb1dee99e7e1b2284", "score": "0.65920645", "text": "def agregarMetodos unaClase\n self.metodos.each do |metodo|\n self.agregar_metodo(unaClase,metodo[0],&metodo[1])\n end\n end", "title": "" }, { "docid": "b5372528b3f0196104272909376bd1aa", "score":...
f5fd4f75368a5392e58aad5e35c1743d
Same as fifth but raises ActiveRecord::RecordNotFound if no record is found. source://activerecord//lib/active_record/relation/finder_methods.rb246
[ { "docid": "bd4311c4fae6575a5c54ef3a17037765", "score": "0.0", "text": "def fifth!; end", "title": "" } ]
[ { "docid": "f02c946acf10d4ff8f501e54b7e4a565", "score": "0.72146106", "text": "def not_found\n raise ActiveRecord::RecordNotFound\n end", "title": "" }, { "docid": "7a76f3a61557c1959c7660b965c1f80f", "score": "0.7064831", "text": "def raise_not_found\n raise ActiveRecord::Reco...
6c47855c4c209f3a12b01a0d5c33f1c9
PATCH/PUT /ingredients/1 PATCH/PUT /ingredients/1.json
[ { "docid": "ccfe41ebd2193a1ad1b7bdd98702dcf2", "score": "0.65729845", "text": "def update\n respond_to do |format|\n if @ingredient.update(ingredient_params)\n format.html do\n redirect_to @ingredient,\n notice: 'Ingrediente atualizado com sucesso'\n e...
[ { "docid": "9049f8c4fc85ec90aa5727e4655a9bc3", "score": "0.7543691", "text": "def update\n @recipe = Recipe.find(params[:id])\n ingredients = params[:ingredients]\n unless ingredients.blank?\n @recipe.ingredient_ids = ingredients.collect {|key, value| key}\n end\n\n respond_to do |fo...
57cc0407c4938af9adb935c987b7f31d
enum status: [ :active, :inactive ] after_initialize :set_default_role, :if => :new_record?
[ { "docid": "4f550b6ca038cfec42998ace120bb912", "score": "0.0", "text": "def faculty_profile\n url = \"https://beta.digitalmeasures.com/login/service/v4/UserSchema/USERNAME:#{self.username}/INDIVIDUAL-ACTIVITIES-Business\"\n RestClient::Request.execute method: :get, url: url, user: 'ua/fac_repo...
[ { "docid": "a7f784a1819d7d5743008101634d9252", "score": "0.69761795", "text": "def initialize\r\n self.status = 'inactive'\r\n end", "title": "" }, { "docid": "a5c61dd02cf98f7cfc5264204a4a2377", "score": "0.685078", "text": "def set_default_status\n self['status'] = 'activ...
bdeba1112a741cb09ed64cde80947612
This is the main method of the class, it calls all the utility methods of the calls in a sequential order
[ { "docid": "ca35d43f753da0e4e7142e969092ee93", "score": "0.0", "text": "def processFiles\n readRemoteXML\n parsePhotoRequestReponseXMl2\n handle_files\n zip_files\n end", "title": "" } ]
[ { "docid": "7090856f6f0462a10eea7d5770cc4a6c", "score": "0.6873246", "text": "def calls; end", "title": "" }, { "docid": "7090856f6f0462a10eea7d5770cc4a6c", "score": "0.6873246", "text": "def calls; end", "title": "" }, { "docid": "615e70ab313f201058f68805cba50710", "...
565481ae4f2abec15d7f8faaa9713dd3
Method: find_all_people Returns a list of all the people in the directory service that are in the search paths. Providers must override this method. Returns: An `Array` of UUID strings, each of which can be passed to to obtain data about a person in the directory.
[ { "docid": "57ee28782fbfd50d0d5bb22366d32c76", "score": "0.70107627", "text": "def find_all_people\n raise \"Required method not implemented in #{self.class.name}: \" +\n \"find_all_people\"\n end", "title": "" } ]
[ { "docid": "cc849f8d76f4b17994f3b0a4e5bc9052", "score": "0.80520904", "text": "def find_all_people\n return collect_from_search_paths do |search_path|\n perform_query(search_path, \n \"(objectClass=person)\", [\"objectGUID\"]\n ).collect { |item| format_uuid(item[\"objectGU...
116b2c06952ae16d30984515387d74ff
Add a comment block
[ { "docid": "2e6b90a0d373772bf7032954a258d9ee", "score": "0.0", "text": "def comment(text)\n return if text.nil?\n if @policy.directive(Policy::PRESERVE_COMMENTS) =~ /true/i\n # Strip out conditional directives\n text.gsub!(%r{<!?!\\[(?:end)?if*\\]}ixm,\"\")\n text.gsub!(%r...
[ { "docid": "6ed6bf0e4b0c02b4fb81c31d77a70c0e", "score": "0.8131603", "text": "def add_comment(comment); end", "title": "" }, { "docid": "9ee5be9b706f442340f0e37728ed0aef", "score": "0.7862044", "text": "def add_comment( line )\n self << CommentBlock.new unless last.is_a? CommentBl...
dcc28174c36db75bd293dff4cf6873ae
difference (filtered) options can have :only_holidays => true
[ { "docid": "d4ee698af0d81ac1d9decffc72ba1c95", "score": "0.0", "text": "def initialize(person_id, options = {})\r\n @person = Person.find(person_id)\r\n raise \"could not find this person by id '#{person_id}'\" if not @person\r\n @person_id = person_id\r\n @name = @person.name\r\n...
[ { "docid": "9ab8309564aa14352f988484c45bccd9", "score": "0.6524142", "text": "def date_filter options\n # date search\n if date_present?(options[\"date_from\"]) || date_present?(options[\"date_to\"])\n from, to = date_set(options[\"date_from\"], options[\"date_to\"])\n options[\"f\"] = [...
c5b16d9676d84fb743f4cf28bee38aa4
POST /tasks POST /tasks.json
[ { "docid": "6004a2ae10abd65cafb378ad8a88df37", "score": "0.0", "text": "def create\n @task = Task.new :name => params[:name], :goal_id => params[:goal_id], :position => params[:position], :archived => params[:archived], :done => params[:done]\n\n respond_to do |format|\n if @task.save\n ...
[ { "docid": "cc005a7eb380d9479fe88f237f4f4b86", "score": "0.75518596", "text": "def create\n task = current_user.tasks.build(task_params)\n\n if task.save\n render json: task, status: 201\n else\n render json: { errors: task.errors }, status: 422\n end\n end", "title": "" }, ...
df5fe9958e219d14a8f76d8e09cfc85e
show associated data for the instance that is called
[ { "docid": "4ed50a9dcfbae49fd9b418521674dff1", "score": "0.0", "text": "def show \n @book = Book.find_by(id: params[:id])\n render json: @book\n\n end", "title": "" } ]
[ { "docid": "3a581999bdc25fcd13079c7ea58d7c2c", "score": "0.7168587", "text": "def show\n\t\t\t\to = data_klass.first(:name => name)\n\t\t\t\tif o\n\t\t\t\t\tputs o.attributes.to_yaml\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "304a28fe9ccd5a55ea69c7e5169632cd", "score": "0.68875...
2b72718d8f25844d7f2a33f924674772
Method to shift an upper case letter
[ { "docid": "cb53096fe640502716e9982b5dce76c4", "score": "0.0", "text": "def shift_letter (letter, shift)\n n = letter . ord - shift\n if n < 'A' . ord\n then n = n + NR_OF_LETTERS\n end\n return n . chr\nend", "title": "" } ]
[ { "docid": "92eb305a9a139fa6dd8a2c59ab7220d5", "score": "0.83340704", "text": "def change_upcase(letter, shift, capital_alphabet)\n \n new_letter_index = capital_alphabet.index(letter)+shift\n \n return capital_alphabet[absolute_index(new_letter_index)]\nend", "title": "" }, { "d...
f8ea935718be86b03a494bea86112159
Coordinates all the actions. Breaks when rabbit is asleep. Returns carrot_count
[ { "docid": "15116ee7416ec5270a49f52c17ea6a63", "score": "0.6728273", "text": "def runner\n set_starting_position\n until @rabbit_asleep \n eat_carrot\n possible_moves\n end \n @carrot_count\nend", "title": "" } ]
[ { "docid": "c0f41881fea44b76014e9a7dc19294a2", "score": "0.6086496", "text": "def eat_carrot \n square = @matrix[@current_row][@current_column]\n return @rabbit_asleep = true if square == 0 \n @carrot_count += square \n @matrix[@current_row][@current_column] = 0 \nend", "title": "" }, { ...
3926d3bcc508ce8da43ad90e50ffb59e
POST /liquidaciones POST /liquidaciones.json
[ { "docid": "9e45485d691e2c183ef0c3b7d46978fd", "score": "0.6626079", "text": "def create\n @liquidacion = Liquidacion.new(liquidacion_params)\n if @liquidacion.save \n redirect_to [:edit, @liquidacion], notice: t('action.save')\n else\n render :new \n end\n end", "title": "" ...
[ { "docid": "25d7775839888fec810b5bb4de4a3bea", "score": "0.7523594", "text": "def create\n \n @liquidacion = Liquidacion.new(liquidacion_params)\n\n respond_to do |format|\n if @liquidacion.save\n format.html { redirect_to @liquidacion, notice: 'Liquidacion fue creado exitosamente.'...
ebc5a0b012f8ec40fa0da571327164ed
translate the id into the label use for cases where we can reliably get the id from the label (ie. local authorities)
[ { "docid": "011024a882422f775e3e8d96fbcf2845", "score": "0.0", "text": "def build_field(value, index)\n options = build_field_options(value, index)\n cp_service = AuthorityService::CurrentPersonService.new\n options[:value] = cp_service.find_value_string(value)\n if options.delete(:type) == ...
[ { "docid": "945dca0bd5fb8427d3bc1c9536e02097", "score": "0.7795683", "text": "def label_with_id\n text_and_id( :label )\n end", "title": "" }, { "docid": "945dca0bd5fb8427d3bc1c9536e02097", "score": "0.7795683", "text": "def label_with_id\n text_and_id( :label )\n end", "...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "708c1b5a3c2101ae73183dcf8e1ef7a8", "score": "0.0", "text": "def set_navigator\n @navigator = Navigator.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...
17901ded54f27969d7bf165a4f948e19
Compare page title with title.
[ { "docid": "0c91c6239755ca2222631751585afb3c", "score": "0.783296", "text": "def is_page_title?(title)\n wait_for_page_title\n page_title.eql?(title)\n end", "title": "" } ]
[ { "docid": "c7c21abd2a9662f9b1942608467064a3", "score": "0.8096035", "text": "def title_with_page_title_check\n return @page.title if @page && !@page.title.blank?\n title_without_page_title_check\n end", "title": "" }, { "docid": "c7c21abd2a9662f9b1942608467064a3", "sc...
cb7fa69c09c089264b7b97f42917a37d
return the total fine for an overdue lease (daily cost days overdue) as a string
[ { "docid": "7964a0ac4e460ebb358bea819d47de17", "score": "0.78289294", "text": "def total_fine()\n fine = daily_cost().to_f * days_overdue().to_f\n return fine.to_s + \"0\"\n end", "title": "" } ]
[ { "docid": "c0389a912364f764630f8f086a5f5fee", "score": "0.6965856", "text": "def days_overdue\n return 0 unless overdue?\n\n loans_by_creation_asc.overdue.first.days_overdue\n end", "title": "" }, { "docid": "9c16230b4861570fee0c69ec75c22749", "score": "0.6903892", "text": "d...
1d143f2941bc73fb0e425dea6c36041b
GET /templates GET /templates.json
[ { "docid": "9ab0f397c7604177f5bcc03c24bd9199", "score": "0.6625809", "text": "def index\n if params[:name]\n @template = Template.find_by_name(params[:name])\n if @template\n respond_ok \"template\", @template\n else\n respond_err \"template\", Template.new, \"i18> No tem...
[ { "docid": "02d40ffd34632b276b3a900afa1cebd8", "score": "0.8109515", "text": "def templates\n response = get \"storage/template\"\n data = JSON.parse response.body\n data\n end", "title": "" }, { "docid": "88c544c265ccbafeced4b371a73363e4", "score": "0.8020366", "text": "de...
3c4355b459e460559bb803e761b5fc07
save passed mob object but revise only if required
[ { "docid": "8e7eac2175c66e948dc29026e1058587", "score": "0.0", "text": "def manage_mob_revisions(mob)\n unless Reputation.revise?(current_user) \n mob.approved_by = current_user\n mob.approved_at = Time.now\n mob.save(:without_revision => true)\n save_relationships(mob)\n #r...
[ { "docid": "8e6cc5968d2f24565100cd83810f0b48", "score": "0.70102364", "text": "def save(obj)\n persist(obj, false)\n end", "title": "" }, { "docid": "c9584bff3624f8ea714cb0237a667edf", "score": "0.66659117", "text": "def save!; end", "title": "" }, { "docid": "aca...
c032880de85eea2930fc16575a78acf3
Iterate through the attributes of this object
[ { "docid": "fd014f00896238a2fc95942ef3638173", "score": "0.0", "text": "def each(&block)\n node_data.each(&block)\n end", "title": "" } ]
[ { "docid": "e9ab53cd277709cd91a754757d63e485", "score": "0.7682553", "text": "def each &block\n attributes.each(&block)\n end", "title": "" }, { "docid": "c2762bc1e317a150f4fe92861f3c0cb3", "score": "0.7622353", "text": "def each\n @attributes.values.each do |attribute...
b727fa2ae58134ff8b0ece1cc71b322b
removes date range params from link
[ { "docid": "c70c405ba8294c9c77bf40d410e9265a", "score": "0.62505907", "text": "def range_remove_url(url_in)\n url = url_in.gsub(/[&?]range%5Byear_.*%5D%5Bbegin%5D=[\\d]{3,4}&range%5Byear_.*%5D%5Bend%5D=[\\d]{3,4}/, '')\n url.gsub!(\"&commit=Apply\", '')\n url.gsub(/[&?]range%5Byear_.*%5D%5Bbegi...
[ { "docid": "75811dfac1428cd15b671eef0ba67278", "score": "0.6606751", "text": "def permalink(params)\n params.delete('authenticity_token')\n params.delete('commit')\n params.delete('utf8')\n params['method_params'].each do |key,m_params|\n m_params['start_date'] = strip_year_if_current(m...
915b86fe6804c21215b2738362c3def7
PATCH/PUT /registro_insumos_reactivos/1 PATCH/PUT /registro_insumos_reactivos/1.json
[ { "docid": "02b80e3ce894bc22a4c705eba3c2fc3d", "score": "0.74207336", "text": "def update\n respond_to do |format|\n if @registro_insumos_reactivo.update(registro_insumos_reactivo_params)\n format.html { redirect_to @registro_insumos_reactivo, notice: 'Registro insumos reactivo was succes...
[ { "docid": "4e1772d1d906a576328f2d9dbff6f4f7", "score": "0.72223383", "text": "def update\n respond_to do |format|\n if @insumos_reactivo.update(insumos_reactivo_params)\n format.html { redirect_to @insumos_reactivo, notice: 'Insumos reactivo was successfully updated.' }\n format.j...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "78824efb6d918fdca25edc40cf7696ca", "score": "0.0", "text": "def update!(**args)\n @annotation_results = args[:annotation_results] if args.key?(:annotation_results)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
b0105b3829e01e95e312e7a475b5d7f7
Added by Tejaswi ni Patil. To import data from excel file On 19 Aug 2015
[ { "docid": "14d41c41069a23698e366cfd858131ba", "score": "0.0", "text": "def import_data\n @seller = Spree::Seller.find(params[:seller_id])\n @message = \"\"\n @msg = \"\"\n if params[:action_name] == 'Impozrt Images' && File.extname(params[:attachment].original_filename) != \...
[ { "docid": "2edc2c919bb8e64821b999e6eeec8272", "score": "0.7034567", "text": "def import_from_excel\n file = params[:file] \n begin\n # Retreive the extension of the file\n file_ext = File.extname(file.original_filename) \n raise \"Unknown file type: #{file.ori...
5053698c151aa79cde70fcf75ee34d89
GET /api/v1/mentorship_ratings GET /api/v1/mentorship_ratings.json
[ { "docid": "cbccc17be85665a9e704fade967f50c7", "score": "0.79392856", "text": "def index\n @api_v1_mentorship_ratings = Api::V1::MentorshipRating.all\n end", "title": "" } ]
[ { "docid": "932ffe9926739db624d1041790627ac5", "score": "0.7436315", "text": "def api_v1_mentorship_rating_params\n params.fetch(:api_v1_mentorship_rating, {})\n end", "title": "" }, { "docid": "22b94507799b4c83b9983d5b40541a99", "score": "0.72604007", "text": "def ratings\n ...
0d0026c5d8bf234eff7f2c5d4034bab9
Creates an instance of this email address. This is a shortcut to EmailAddress::Address.new
[ { "docid": "57abd19d597631ea67e6c45dab25909a", "score": "0.8357895", "text": "def new(email_address, config={})\n Address.new(email_address, config)\n end", "title": "" } ]
[ { "docid": "8a00d5ba1571b970ca9f9296e374a672", "score": "0.7418714", "text": "def address\n @address ||= Mail::Address.new(self.to_s) rescue nil\n end", "title": "" }, { "docid": "e8a6d08c4197bbb1cdbe329aa298fab6", "score": "0.6791329", "text": "def initialize(string)\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "dc60c401fa0bfbac7b6103d322da044f", "score": "0.0", "text": "def set_reldocument\n @reldocument = Reldocument.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...
129e5cd20cc8dd9b6523d3bdf39b7658
GET /type_users/1 GET /type_users/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f0733641eb9e871c635b18cbb1d83cd5", "score": "0.75517035", "text": "def get_user_listing(user, type, params = {})\n name = extract_attribute(user, :name)\n path = \"/user/#{name}/#{type}.json\"\n params[:show] ||= :given\n\n object_from_response :get, path,...
fa00cb99057106c365de6f255f207f53
get and output phrase from dictionary
[ { "docid": "fa7ddd7267fa2fc5e7562fc36135cce5", "score": "0.61426944", "text": "def say_phrase(key, emotion_char = '.', special_phrase = nil)\n if special_phrase.nil?\n puts @all_phrases[key].capitalize + emotion_char\n else\n puts \"#{special_phrase.capitalize},\" \\\n \"#{@all...
[ { "docid": "2b74732bf9aee984b9bccc881b1270a0", "score": "0.6666348", "text": "def get_paper(word)\npaper = {:stock => \"a common stock paper 10# weight\", :extra => \"super bold\"}\np paper[word]\nend", "title": "" }, { "docid": "4c680b24f83dfb6cbc4277c5efa8244f", "score": "0.6586715", ...
3fc7d1888d04050a442b271619c89ce5
Check whether the user's access token is valid.
[ { "docid": "c865f1de7701282bbafeb7bb65346f0d", "score": "0.6880635", "text": "def check_access_token\n @access_token = session[:access_token]\n\n begin\n @client = Octokit::Client.new :access_token => @access_token\n @user = @client.user\n rescue => e\n # The token has been revoked, so inval...
[ { "docid": "823ceb1f1750bf5d1bcb711f11d877ec", "score": "0.8221683", "text": "def is_access_token_valid?\n response = @client.get(\"#{@base_url}/v1/users/self\", access_token: get_user_access_token )\n code_status = JSON.parse(response.body)[\"meta\"][\"code\"]\n code_status == 200 ? true : fal...
dd424794b57e885521e52fdd40801468
POST /comments POST /comments.json
[ { "docid": "9c18034519678c76c68b6a85ff31ec8f", "score": "0.0", "text": "def create\n @comment = Comment.new(params[:comment])\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @comment.theme, notice: 'Kommentar wurde erfolgreich erstellt.' }\n format.json...
[ { "docid": "7b0a68ee4df9cfc8f7cc619d01d2577d", "score": "0.7545618", "text": "def create\n @comment = @post.comments.create!(comment_params)\n json_response(@comment, :created)\n end", "title": "" }, { "docid": "278b898b0e96dc8518cb54546e69f368", "score": "0.7373569", "t...
213826c40562b722b8496699395611be
DELETE /registration_responses/1 DELETE /registration_responses/1.json
[ { "docid": "d5da7b9b44ea56deb5d3cb4022c2a854", "score": "0.80338633", "text": "def destroy\n @registration_response = @registration.registration_responses.find(params[:id])\n @registration_response.destroy\n\n respond_to do |format|\n format.html { redirect_to registration_registration_res...
[ { "docid": "47925df71bd65f1bc0fe3eb65de91926", "score": "0.7247586", "text": "def destroy\n @registration_request.destroy\n respond_to do |format|\n format.html { redirect_to registration_requests_url, notice: 'Registration request was successfully destroyed.' }\n format.json { head :no_...
5dff8fa8728500da65e078ad03b37da1
Run one test of the postfix calculator. Exits with a success (0) exit code IFF the specified test passes.
[ { "docid": "24afd6b2dd11a687e4ec76750407635b", "score": "0.5747293", "text": "def usage\r\n\tputs \"Usage: ./runTest.rb [-v] <calculator exe> <expected result> <expr>\"\r\n\tputs \" -v option prints verbose output if test fails\"\r\n\tputs \" If <expected result> is ERROR, then an error is expected\"\...
[ { "docid": "3e97d0ac50c96f4592373dc8c1a51ae1", "score": "0.62818617", "text": "def run_test(test)\n command = nil\n if test.include?(\"pass\") \n command = \"pass\"\n elsif test.include?(\"fail\")\n command = \"fail\"\n else\n puts \"not a valid test\"\n exit 1\n end\n\n main = get_mai...
e3be760ea5e768b7b75a73e4835894cb
Virtual attribute setter Takes a plist string and converts it to a ruby object and assigns it to receipts
[ { "docid": "e58f1b3e98ac3267b36f9c4d33cfc0b5", "score": "0.57931894", "text": "def installs_plist=(value)\n plist_virtual_attribute_set(:installs,value)\n end", "title": "" } ]
[ { "docid": "1dc8167dbc0d64e10fa83181e39c6673", "score": "0.7654308", "text": "def receipts_plist=(value)\n plist_virtual_attribute_set(:receipts,value)\n end", "title": "" }, { "docid": "13635ceeb667055421660babd946e623", "score": "0.7580334", "text": "def receipts_plist=(value)\...
ca7cf8a1a667226148000c755dc7ec45
DELETE /orders/1 DELETE /orders/1.xml
[ { "docid": "e2706f8a2e2c3b63aa46daae573b6b9a", "score": "0.7007644", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to(orders_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "21d6750007e787d77b3dcba4fbf6afcf", "score": "0.70455605", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to(orders_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { ...
52185778c4f77af7836417894691c0c3
en attente de savoir si utile users/new def new
[ { "docid": "d894d6c640e1ebf0867eecca015cabdd", "score": "0.0", "text": "def edit\n @user = current_user\n # @user = User.find(params[:id])\n end", "title": "" } ]
[ { "docid": "3f55d7a78456476f69b4818eb660bc4a", "score": "0.79699457", "text": "def new_user; end", "title": "" }, { "docid": "e0cd99b2c6a0718b01c44d4783e10748", "score": "0.787573", "text": "def new\n # no need for functionality because all we want to do is render a new user p...
0f78aa5ad60c15f8a4b0810214135fe2
Show the percentage representation of a numeric value.
[ { "docid": "b500427b94add9d0527ad2e700ecd042", "score": "0.7059493", "text": "def percentage(number, precision = 2)\n return if number.to_s.empty?\n\n ret = \"%02.#{ precision }f%\" % number\n ret.gsub(/\\.0*%$/, '%')\n end", "title": "" } ]
[ { "docid": "e7d776cbff44e44bde2fae2c806334e3", "score": "0.83633757", "text": "def pretty_percentage(value)\n\t\tsprintf('%.2f', value) + \"%\"\n\tend", "title": "" }, { "docid": "2cda7bddce851603fe77540138a757b1", "score": "0.8330987", "text": "def percentage(num)\n \"#{num *...
f2402f990ec3a3035dd6f8699811648c
here we will have a problem with nested objects. and will have to provide a better way to query this.
[ { "docid": "c2dfe9681ea1c3543a42f17130e7f1ae", "score": "0.0", "text": "def get_object\n\t\tbegin\n\t\t\tself.object_class.constantize.find(object_id)\n\t\trescue Mongoid::Errors::DocumentNotFound\n\t\t\tputs \"could not find the document.\"\n\t\t\tnil\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "a87dbefe9ae9a8fa1b35fafc72fefb7e", "score": "0.6341299", "text": "def subobjects; @subobjects; end", "title": "" }, { "docid": "28ac66a82fe38728eea4a9837e3bd6ac", "score": "0.6183728", "text": "def child_objects; end", "title": "" }, { "docid": "d83a348669fc73...
04bacc75c8b96303b2a6aed849098b2f
GET /contests/1 GET /contests/1.xml
[ { "docid": "6a0e3d9d1da82a7207ea7f9aed0143b4", "score": "0.0", "text": "def show\n @contest = Contest.find(params[:id])\n # admin/show.html.erb\n end", "title": "" } ]
[ { "docid": "8ce1c171a36e847cee081e5ea322fa4a", "score": "0.75853413", "text": "def index\n @contests = Contest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contests }\n end\n end", "title": "" }, { "docid": "74f0c3fb79766e2...
646367e2570dcedbb871ba6a6c56692c
DELETE /estrenos/1 DELETE /estrenos/1.json
[ { "docid": "9d84dede2a5364e7ff417167461d5ef2", "score": "0.69785583", "text": "def destroy\n @estreno.destroy\n respond_to do |format|\n format.html { redirect_to estrenos_url, notice: 'Estreno eliminado.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.743674", "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": "b...
0335124d4b1b2cea774b82e0067638b6
returns roles that currently have permission
[ { "docid": "f4491811c37dba30deb3cff2d1e661e3", "score": "0.765788", "text": "def roles_with_permission\n shift.location.loc_group.roles\n end", "title": "" } ]
[ { "docid": "8aaf1a6319ed2d78a4e06398cc94d197", "score": "0.81376904", "text": "def roles\n roles_from_users\n end", "title": "" }, { "docid": "ad692163c89c0fd193379020d418833a", "score": "0.79167324", "text": "def role_permissions\n return @role_permissions\n ...
28cdf473014a1199dd3c9260a26f8a96
GET /cursos/1 GET /cursos/1.json
[ { "docid": "b5fd67cae2b8574319ac90777b3464e7", "score": "0.5780305", "text": "def show\n @curso = Curso.find(params[:id])\n redirect_to '/users/'+current_user.id.to_s+'/cursos/'+@curso.id.to_s+'/edit'\n end", "title": "" } ]
[ { "docid": "eb40784899ac9f9f5f8b1d0cfc29240a", "score": "0.7460664", "text": "def index\n @cursos = Curso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cursos }\n end\n end", "title": "" }, { "docid": "ad1e4323a9b5bf8b33c40d8e...