query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
2917f536a3fd19a4009d3c0736c9101c
GET /fnss_datacenter_three_tiers GET /fnss_datacenter_three_tiers.json
[ { "docid": "4e3644b1b0460deefa47082bac3a01c7", "score": "0.7553371", "text": "def index\n @fnss_datacenter_three_tiers = FnssDatacenterThreeTier.all\n end", "title": "" } ]
[ { "docid": "394b664f25c70944f119c98cb9f79cfc", "score": "0.65975285", "text": "def set_fnss_datacenter_three_tier\n @fnss_datacenter_three_tier = FnssDatacenterThreeTier.find(params[:id])\n end", "title": "" }, { "docid": "6d7ad55b9aa7f21b939e364b054fa73c", "score": "0.61348116",...
5d4332d68176aed60c8b2876b548a2a1
Saves JSON file containing translations
[ { "docid": "7a5f959affad6fdec92b9198a47e7708", "score": "0.81554174", "text": "def save!\n FileUtils.mkdir_p File.dirname(self.file)\n\n File.open(self.file, \"w+\") do |f|\n f << %(#{self.namespace}.translations || (#{self.namespace}.translations = {});\\n)\n self.transl...
[ { "docid": "ea7af4b55a03925be10756431cb7b2f2", "score": "0.7884241", "text": "def save(translations, file)\n file = Rails.root.join(file)\n FileUtils.mkdir_p File.dirname(file)\n\n File.open(file, \"w+\") do |f|\n f << %(var I18n = I18n || {};\\n)\n f << %(I18n.translations ...
46abd641cc16d93ff4c2431b50770b89
PATCH/PUT /image_watermarks/1 PATCH/PUT /image_watermarks/1.json
[ { "docid": "0a362d2411b6b932035afba6c461f51f", "score": "0.6213466", "text": "def update\n respond_to do |format|\n begin\n flash[:success] = 'Image optimized.'\n @image_watermark.update(image_watermark_params)\n @image_watermark.make_watermark\n @image_watermark.save...
[ { "docid": "099dd8af0cd3b35377351bdc78683360", "score": "0.652601", "text": "def update\n if water_location.update(water_location_params)\n image_url = get_image_url\n render json: water_location, get_image_url: image_url\n else\n render json: water_location.errors, status: :unprocessab...
b41acab4fe1797bd7691e54b460a1fad
with the elements of the original list in reverse order. Do not modify the original list. You may not use Arrayreverse or Arrayreverse!, nor may you use the method you wrote in the previous exercise.
[ { "docid": "2efcba0fcba21261766c8c08d89aaf17", "score": "0.0", "text": "def reverse(array)\n reversed_array = []\n (array.size - 1).downto(0) { |i| reversed_array << array[i] }\n reversed_array\nend", "title": "" } ]
[ { "docid": "870590d4f189a096eb92380affee34a5", "score": "0.86574286", "text": "def reverse!(list)\n new_array = []\n list.each do |element|\n new_array.unshift(element)\n end\n new_array.each_with_index do |v, i|\n list[i] = v\n end\n list\nend", "title": "" }, { "docid": "d7d7d9...
0579d2b9219eb29dfc258c2db26ea08d
Get docker image id from name
[ { "docid": "43c129fc7c88407598ecf458bbf3ee2c", "score": "0.8160472", "text": "def get_docker_image_id_from_name(options)\n image_id = \"none\"\n images = get_docker_image_list(options)\n images.each do |image|\n values = image.split(/\\s+/)\n image_name = values[0]\n image_id = value...
[ { "docid": "5508120411acad144926dce67fcbb944", "score": "0.80848444", "text": "def docker_id(name)\n\t\treturn command_send(\"sudo docker ps -a --no-trunc -f name=#{name} | grep '\\\\s#{name}$' | tail -n 1 | awk '{ print $1 }'\")\n\tend", "title": "" }, { "docid": "d058e796b4e2098c1dfafefc33...
a14d8df226b22026b557857aacdd494a
Assign multiple userIDs to a cluster.
[ { "docid": "a74d5694f563b27936aa31b75bdbb506", "score": "0.7672399", "text": "def assign_user_ids(user_ids, cluster_name, opts = {})\n @transporter.write(:POST, '/1/clusters/mapping/batch', { cluster: cluster_name, users: user_ids }, opts)\n end", "title": "" } ]
[ { "docid": "0b06aeb28219f54cf819379cd04c4f05", "score": "0.6837575", "text": "def cluster_ids=(ids)\n ids.each do |cluster_id|\n cluster = Cluster.find cluster_id\n self.nodes << cluster.nodes\n end\n end", "title": "" }, { "docid": "90d4042f2da4a3ca7d4bd586c108d0da", "s...
97f61e487907dd213022e1eadf1eff64
Stops a running hub listener, which may have been started in another ruby instance.
[ { "docid": "fe7cb8bff7425f70f0fb6462b1ecfeb3", "score": "0.84373116", "text": "def stop\n raise \"no hub listener process is running\" unless @pid\n Process.kill(\"INT\",@pid)\n puts \"stopped hub listener PID #{@pid}\"\n self.cleanup\n end", "title": "" } ]
[ { "docid": "30d57ebba2c456174f3ce6b817685dee", "score": "0.7518693", "text": "def shutdown\n @listener.kill\n end", "title": "" }, { "docid": "20aad2849a456febdec05be41a5464e5", "score": "0.73086065", "text": "def stop\n @listener&.stop\n @listener = nil\n end", ...
8bc1f3c3b5a5502afeb85cf3c7f57494
return a copy of this object with a different Metadata instance attached
[ { "docid": "3f9057df96759267512edbad46bb9502", "score": "0.0", "text": "def with_metadata(metadata)\n self.class.new(world, radius: radius, center: center, metadata: metadata)\n end", "title": "" } ]
[ { "docid": "d01d7b6118855344b1c128c07a82e40b", "score": "0.7247409", "text": "def initialize_copy(other)\n super(other)\n @metadata = other.metadata\n end", "title": "" }, { "docid": "6794b9c6b299ab332e1049f9fbc00f25", "score": "0.7196431", "text": "def initialize_copy(o...
b1a697b3a0c9a7f7cadf4fa00d255452
POST /song_requests POST /song_requests.json
[ { "docid": "d3c2abbe505f34e811ef646a93fb986d", "score": "0.61558145", "text": "def create\n @song_request = @invitation.song_requests.build(song_request_params)\n\n respond_to do |format|\n if @song_request.save\n format.html { redirect_to @invitation }\n else\n format.html...
[ { "docid": "20300a1f0ece036e36920191ec5daf77", "score": "0.66855115", "text": "def song_request_params\n params.require(:song_request).permit(:title, :artist)\n end", "title": "" }, { "docid": "4090cd12e1d085e8b69ad7bbbf2c8bb2", "score": "0.6334739", "text": "def create_songs...
03b3939b3d874aed098b8e2e200316c6
Cache the SSH connection to the remote host
[ { "docid": "7a7e86fcdbb647caae1bc8d6e42c9ad6", "score": "0.6800641", "text": "def ssh\n @connection ||= @ssh.connect\n return @ssh\n end", "title": "" } ]
[ { "docid": "55d74cdc58c6f96d96a56a561f74c310", "score": "0.6745401", "text": "def ssh\n @ssh\n end", "title": "" }, { "docid": "55d74cdc58c6f96d96a56a561f74c310", "score": "0.6745401", "text": "def ssh\n @ssh\n end", "title": "" }, { "docid": "e4dfd8772522...
6e732a1ac3f5f0706a1f9f88a2f126f5
GET /certificates/new GET /certificates/new.xml
[ { "docid": "fe5ab902f034224b3650c3c05896e405", "score": "0.72705346", "text": "def new\n @certificate = Certificate.new\n @person = Person.find(params[:person_id])\n @url = admin_person_certificates_url(@person)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml ...
[ { "docid": "ed37a384d12e8f6f85db7a33dca6bc61", "score": "0.7189103", "text": "def new\n @certificate = Certificate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @certificate }\n end\n end", "title": "" }, { "docid": "e3d113b5a3...
ee17e94088c8f9992bfae32bc015c093
PATCH/PUT /use_case_ledgers/1 PATCH/PUT /use_case_ledgers/1.json
[ { "docid": "4b407a0bd166083d4a092cd4ea73154a", "score": "0.60661185", "text": "def update\n respond_to do |format|\n if @use_case_ledger.update(use_case_ledger_params)\n format.html { redirect_to @use_case_ledger, notice: 'Use case ledger was successfully updated.' }\n format.json ...
[ { "docid": "a0b1d9bf0501cdc9aa6ad1cb2bc87d1e", "score": "0.58274496", "text": "def update\n @use_case = UseCase.find(params[:id])\n\n respond_to do |format|\n if @use_case.update_attributes(params[:use_case])\n format.html { redirect_to @use_case, notice: 'Use case was successfully upd...
9070c0adbead46e5cf787116c76bc56e
!SLIDE END !SLIDE Transportsend_result Send Result to stream.
[ { "docid": "d9bc24a895805d46de6a7e1432a613f6", "score": "0.6289016", "text": "def send_result state\n result = state.result\n message = state.message\n if @one_way && message.block\n message.block.call(result)\n else\n # Avoid sending back entire Message in Result.\n ...
[ { "docid": "6c1f081abad8f3cc6df11422d8e53b89", "score": "0.7057419", "text": "def _send_result result_payload, webrick_result\n # ???\n end", "title": "" }, { "docid": "657f97e27df41c8069ac5d9356b47bb8", "score": "0.7033355", "text": "def _send_result state\n rack_...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "18f9b61c150fa7355605d47282f4a7ac", "score": "0.0", "text": "def set_skills\n @skill = Skill.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...
41d6cb57fbf4914fdd18fdf76f1ae860
PATCH/PUT /events/1 PATCH/PUT /events/1.json
[ { "docid": "760fbe71ff1d4794455a6d236b528dde", "score": "0.0", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }...
[ { "docid": "dc4ff2adcbcefec9118bdd7e8716ad75", "score": "0.7375797", "text": "def update\n event = event.find(params[\"id\"]) \n event.update_attributes(event_params) \n respond_with event, json: event\n end", "title": "" }, { "docid": "0050f781a1e526879347940817ef65b8", "score...
f3c8094a1c046322e2a9b6df66ea9a8c
Display output when an example is pending
[ { "docid": "9cc5ec5be0a224c247495afe114e56bc", "score": "0.7874619", "text": "def example_pending(example)\n super(example)\n msg = example.execution_result[:pending_message]\n output << \"\\n\" << bold('Result: ') << pending_color('pending') << \"\\n\"\n output << bold(\"Reason: \")...
[ { "docid": "131348017f6f62bad3b329502631daee", "score": "0.77016455", "text": "def example_pending( example )\n\t\tmsg = self.format_example( example )\n\t\tpending_msg = example.metadata[ :execution_result ][ :pending_message ]\n\t\tmsg << \", PENDING%s)\" % [ \": #{pending_msg}\" || '' ]\n\t\tself.out...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b8ff362ae5c191d8a92adec7f07bba42", "score": "0.0", "text": "def targeted_muscle_params\n params.require(:targeted_muscle).permit(:exercise_id, :muscle_id, :primary)\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...
98bcaed3ea4bd79407ce1ae94986e9c5
Provide a detailed, user friendly representation source://twilioruby//lib/twilioruby/rest/insights/v1/conference.rb284
[ { "docid": "473108fa97cee58671b779c2ccfec06f", "score": "0.0", "text": "def inspect; end", "title": "" } ]
[ { "docid": "4eb416801588afc5e2686223ef4057a3", "score": "0.73263884", "text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Insights.V1.ConferenceParticipantInstance #{values}>\"\n end", "title"...
c816a8d37b99e07675f0bd9d03f9f12c
Validates that the defined certificates exist
[ { "docid": "c3db0243f6e97a10529bb8d716143db6", "score": "0.8196438", "text": "def validate_certificates\n validate_each :certificates do |c|\n cert = self.grid.certificates.find_by(subject: c[:subject])\n unless cert\n [:not_found, \"Certificate #{c[:subject]} does not exist\...
[ { "docid": "e5f8b81a87fba32ebff12559e7c8aeb8", "score": "0.72337395", "text": "def valid_certificates?\n Certificates.new(@chain_url, @signature, Oj.to_json(@request)).valid?\n end", "title": "" }, { "docid": "83c2746096dae82d347896181c859a33", "score": "0.6730149", "text": "...
7e869545e3f474a98ee7f4a91e90bf79
GET /archive_entry_couriers/1 GET /archive_entry_couriers/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "ccd079588c9e856303b030f96befd56f", "score": "0.7057329", "text": "def index\n @archive_entry_couriers = ArchiveEntryCourier.all\n end", "title": "" }, { "docid": "618804b5e11a883314e00adddb58ec28", "score": "0.65246075", "text": "def index\n @entry_couriers = Entry...
3e772fc084049519f5158f71e8cdd704
GET /admin/towns/new GET /admin/towns/new.xml
[ { "docid": "2d8ef6ef4ed426cac543bfcc5b863ec7", "score": "0.73103184", "text": "def new\n @admin_town = Admin::Town.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @admin_town }\n end\n end", "title": "" } ]
[ { "docid": "f32294648b9c50c2224539c9ddd18920", "score": "0.6981209", "text": "def create\n @admin_town = Admin::Town.new(params[:admin_town])\n\n respond_to do |format|\n if @admin_town.save\n format.html { redirect_to(@admin_town, :notice => 'Town was successfully created.') }\n ...
2e3391ce836daad29b51cc77e00f14f8
Returns the DummyAssociationReflection object for the +association+ (use the symbol). Account.reflect_on_association(:owner) returns the owner AssociationReflection Invoice.reflect_on_association(:line_items).macro returns :has_many
[ { "docid": "132a789b64ee091953ab539c31ecec56", "score": "0.7940435", "text": "def reflect_on_association(association)\n reflection = reflections[association]\n reflection if reflection.is_a?(DummyAssociationReflection)\n end", "title": "" } ]
[ { "docid": "7aed59ea3df08e3d9661189212864ff3", "score": "0.7608279", "text": "def _reflect_on_association(association)\n val = reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n unless val\n # When a has_many is paired with a has_and_belongs_t...
cc01bd979b627d52bbcc49a5ea88a91b
Converts an array of query objects to an array of android xml string resources
[ { "docid": "2b81ac9bd7a04e6ab25f6c211705c0ab", "score": "0.53247935", "text": "def objects_to_xml(objects)\t\t\n\t\tif objects.nil? || objects.size < 1 then\n\t\t\treturn []\n\t\tend\n\t\n\t\toutput = []\n\t\t\n\t\tobjects.each do |object|\n\t\t\toutput << object.to_xml\n\t\tend\n\t\t\n\t\treturn output...
[ { "docid": "2e021f4ce40de82c1168b5790fe6f2de", "score": "0.64349794", "text": "def build_xml_arrays\n\t\toutput = []\n\t\t\n\t\ttables = @ddl_reader.table_statements_xml\n\t\tif tables.size > 0 then\n\t\t\toutput << '<array id=\"array_queries_table_create\">'\n\t\t\ttables.each do |table|\n\t\t\t\toutpu...
50f9f185a7e0a4b735aeced6110bd841
Calculates hash code according to all attributes.
[ { "docid": "62b7604676edfcf3b6f9c72275deee1e", "score": "0.0", "text": "def hash\n [class_id, object_type, contract, contract_status, contract_status_reason, contract_updated_time, covered_product_line_end_date, device_id, device_type, end_customer, end_user_global_ultimate, is_valid, item_type, ma...
[ { "docid": "d63333ed15c27e3f7526f0c6f8099546", "score": "0.7118691", "text": "def attr_hash\n Digest::MD5.hexdigest(\"#{@name}:#{@ruby_type}\")\n end", "title": "" }, { "docid": "23cdf6a080837fbe407633be0799ea0e", "score": "0.70400536", "text": "def hash() end", "title": ...
9fe72d097d5a146ea539ebb9186d4428
isAccusation PURPOSE: simply returns if the guess is an accusation or not PARAMETERS: none Returns: a boolean indicating whether or not accusation
[ { "docid": "8686fc7ba6f3d428393226df0a23b63a", "score": "0.7656502", "text": "def isAccusation()\n @accusation\n end", "title": "" } ]
[ { "docid": "7138de029f0454abe82be19e9a64e395", "score": "0.6367566", "text": "def has_ace?\n @cards.each { |c| return true if c[0] == 65 }\n return false\n end", "title": "" }, { "docid": "f75b1b9727e1b6cba28e22515f8a0901", "score": "0.6024173", "text": "def check_for_accident...
37fa31f7d71a3b09f9ff666e689697d7
receives player move and mark records player mark on gameboard
[ { "docid": "a39eec487a6d6597ef15f0c161ba3ae3", "score": "0.69227046", "text": "def mark_board(move, curr_player_mark)\n self.squares[move] = curr_player_mark\n end", "title": "" } ]
[ { "docid": "9e89270d0a481bd9227c3b652cc887a8", "score": "0.69444346", "text": "def player_moved\n\t\t\t# Record their move\n\t\t\trecord_last_action\n\t\t\t# Send each player an event notification\n\t\t\tsend_each_player(:player_moved)\n\t\tend", "title": "" }, { "docid": "384b9081439f8a3dde...
5a1579122dd0cfb39c2d5817951cfc3e
DELETE /time_entries/1 DELETE /time_entries/1.json
[ { "docid": "60e37c0f41dbb7d6d12aa23c86327155", "score": "0.7171503", "text": "def destroy\n @time_entry = current_firm.all_time_entries.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to params[:ret] || firm_time_entries_path(current_firm) }\n ...
[ { "docid": "f0fffa6a81b6f3ee6dd0fc4cdc9a1eb7", "score": "0.77798426", "text": "def destroy\n @time_entry = TimeEntry.with_deleted.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to time_entries_url }\n format.json { head :no_content }\n e...
96f0324784fea238a4886b6c8640b600
Dumps each filename string in a verbose format for display purposes.
[ { "docid": "d92a5ee1389f4a104923909bf371ce63", "score": "0.5621006", "text": "def list_files_to_be_processed(filenames, dest_name)\n unless filenames.empty?\n puts \"\\r\\n - #{dest_name} diffs to be processed:\"\n filenames.each { |filename| puts \" #{filename}\" }\n end\n end", ...
[ { "docid": "d01823bfc961cdbcec4ef77bb0f3a186", "score": "0.59442824", "text": "def output_details(files) \n @stdout.puts\n @stdout.puts \"Details\".bold\n files.each do |t|\n fname = t.path\n @stdout.puts \"File: %s\" % [((t.status == FileData::STATUS_OK) ? fname : fnam...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "eb6473c413f41b656fe6d669793f07de", "score": "0.0", "text": "def set_member\n @member = Member.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163443", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.604317", "text": "def action_hook; ...
e9279d559d787f4e9313840c2a15489c
Span Events must be enabled for Infinite Tracing
[ { "docid": "6ea80b59ba36d72b0e816e6e08983378", "score": "0.70680976", "text": "def span_events_enabled?\n NewRelic::Agent.config[:'span_events.enabled']\n end", "title": "" } ]
[ { "docid": "b2349afb8ab6997e0c6008ad9b64a2a2", "score": "0.6058628", "text": "def on_start(span, _parent_context)\n context = span.context\n trace_id = context.trace_id\n\n lock do\n if all_spans_count(traces_spans_count) >= max_queue_size\n # instead o...
b33ba954000d5c02f8161061ba4c4809
GET /images GET /images.json
[ { "docid": "0ae2b9cec691ef5de87ea1e3b0fd634c", "score": "0.72539264", "text": "def index\n @images = Image.order('created_at DESC').page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @images }\n end\n end", "title": "" } ]
[ { "docid": "a830ab57c6055538be9c6c825680b7c1", "score": "0.81821454", "text": "def list params = {}\n @connection.get(build_path(\"/images/json\", params)) \n end", "title": "" }, { "docid": "2188d5393353371aa9e1dea901c227ba", "score": "0.7909451", "text": "def list\n @i...
96c1e58d25e2ce707b7817a4864316e2
The key we use in redis to ensure unique posts
[ { "docid": "fc1dda277aa14ebca7a33563c47a338a", "score": "0.81263226", "text": "def unique_post_key\n \"unique-post-#{user_id}:#{raw_hash}\"\n end", "title": "" } ]
[ { "docid": "14fdb2118b788f9ef124e062ecda7070", "score": "0.73596996", "text": "def redis_key; end", "title": "" }, { "docid": "ace7754b2ef3408f75fd9b277d24d496", "score": "0.6942636", "text": "def redis_key(str)\n \"question:#{self.id}:#{str}\"\n end", "title": "" }, { ...
0e44f9fa1d219191ff08809387603e3c
Returns put_url and get_url for a new file that should be uploaded by the client. Of course get_url will work after file is uploaded.
[ { "docid": "f75b1d207412e3f2dd686166a9439142", "score": "0.0", "text": "def handle(helper, req, env)\n if skip_direct_upload\n not_available_response(helper)\n else\n format = req.GET()['format'] || 'png'\n object_name = \"img-#{SecureRandom.uuid}.#{format}\"\n ...
[ { "docid": "218b1ac95a693b90ca5380d4f413677d", "score": "0.69077665", "text": "def get_pre_singed_url_for_put\n @service_response = UserManagement::DocumentsUploader::V2::ForPut.new(params).perform\n format_service_response\n end", "title": "" }, { "docid": "496ab3200e1e4190d64c0fd798...
4b5711c5d760f270ef576f44751895f1
Run hcledit with the given args and the given stdin. Return stdout.
[ { "docid": "352d95224adcc4a063b8b22faeab682b", "score": "0.8516781", "text": "def hcledit(args, stdin)\n out, err, status = Open3.capture3(\"hcledit\", *args, stdin_data: stdin)\n if status != 0\n raise \"hcledit exited with exit code #{status}: #{err}\"\n end\n out\nend", "title": "" } ]
[ { "docid": "1b722aff2e116904380120d8c4c57709", "score": "0.65029275", "text": "def run(input=[])\n mock_terminal\n input.each { |i| $terminal.write_line(i) }\n $terminal.close_write\n RHC::CLI.start(arguments)\n end", "title": "" }, { "docid": "c9ee68f70911ed1544f1e05f24d5a893",...
7dff2e669cf999ae9eaeca9391658d0b
1 day for expiry time
[ { "docid": "8c54fe3018e1484cd9d94d058cf00307", "score": "0.0", "text": "def index\n redirect_to(controller: \"portal\", action: \"experimentlist\")\n end", "title": "" } ]
[ { "docid": "77eb3cb461e8c8abde8ae1e2c073bd92", "score": "0.7988879", "text": "def set_expiration_date\n self.expiry_date = Date.today + 365.days\n end", "title": "" }, { "docid": "6f98c83e6fd498cc4b6e67722e94db22", "score": "0.7906083", "text": "def expiry\n @expiry ||= 6...
5d3f2d3b5d36a40faa978d502cc062e0
Run a discrete highpass filter over the signal data (using SincFilter). Modifies current object.
[ { "docid": "1694cb12b0a6f9b5d0d4ee9c29a8e2aa", "score": "0.7276338", "text": "def highpass! cutoff_freq, order\n filter = SincFilter.new(:sample_rate => @sample_rate, :order => order, :cutoff_freq => cutoff_freq)\n @data = filter.highpass(@data)\n return self\n end", "title": "" } ]
[ { "docid": "79624806187a032f53d428f3f9024ba6", "score": "0.5908014", "text": "def bandpass! left_cutoff, right_cutoff, order\n filter = DualSincFilter.new(\n :sample_rate => @sample_rate,\n :order => order,\n :left_cutoff_freq => left_cutoff,\n :right_cutoff_freq => right_cutoff\n...
9b17063e771d53cd76bd2f0aad03452a
Adds sort by newest in addition to default index search
[ { "docid": "e5589659b2b3cdfdcaeb06ef4c18c938", "score": "0.6534476", "text": "def newest\n params[:sort] = 'ACTIVATED_AT DESC'\n params[:school_id] = auth_user.current_school_id\n index\n end", "title": "" } ]
[ { "docid": "9552b9eee1d1762b45227f0e8d8400cc", "score": "0.67772985", "text": "def latest_order\n # order(created_at: :desc)\n scan_index_forward(false)\n end", "title": "" }, { "docid": "f60b88ed66537fa8c6df041a5d131c15", "score": "0.6736446", "text": "def index_s...
1cb74c46bb90c68c51886a941f88e072
Utility for importing data from various catalogs
[ { "docid": "e2c2e0292f615f0d85602dc4a687add3", "score": "0.0", "text": "def getname(ngc, names)\n names.each_line do |l|\n m_ngc = l[36,5]\n name = l[0,35]\n if ngc == m_ngc\n return name\n end\n end\n return \"-\"\n end", "title": "" } ]
[ { "docid": "9c8db950d339aebc09b625f79d06c5b1", "score": "0.63097274", "text": "def load_catalogs\n file = File.open(\"#{Rails.root}/config/silver_hornet/catalogs.yml\")\n yaml = YAML.load(file)\n yaml.each do |item|\n read(item)\n end\n @@catalogs = []\n Catalog.all.each do |cat|\...
be56453d5ca4e56ff2ed61d350629e63
The kernel recursivly implements merge sort arr is the array to sort helper is a helper array to copy tmp work to low is the lowest index in the subarray, inclusive high is the highest index in the subarray, inclusive ordered is the ordering proc
[ { "docid": "c9bfd999b4327c88e73452987acdf7d2", "score": "0.7732044", "text": "def merge_kernel(arr, helper, low, high, ordered)\n if low < high\n mid = (low + high)/2\n merge_kernel(arr, helper, low, mid, ordered)\n merge_kernel(arr, helper, mid+1, high, ordered)\n merge(arr, helper, low, m...
[ { "docid": "b8f9c29f07674e09d2003e0545ecc53d", "score": "0.86278474", "text": "def merge_sort (in_arr, ordered)\n arr = Array.new(in_arr)\n helper = Array.new(arr.length)\n merge_kernel(arr, helper, 0, arr.length-1, ordered)\n return arr\nend", "title": "" }, { "docid": "65a0cf28475f4ce1...
40aac4bcc06cc5cbec228a73d2ba7f8f
POST /transactions POST /transactions.json
[ { "docid": "c5a9b9040dc155dba7ed7e4ce9b0711d", "score": "0.62876374", "text": "def create\n @transaction = Transaction.new(transaction_params)\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to '/check-out', notice: 'Transaction was successfully created.' }\n ...
[ { "docid": "0223c6f1aa8e4390fc1de89565f96635", "score": "0.7125511", "text": "def postTransaction(useridgiving, useridreceiving, amount)\n parameters={useridgiving: useridgiving.to_i, useridreceiving: useridreceiving.to_i, amount: amount.to_f, state: \"initial\"}\n options = {\n :body =...
9e51894ac82083bd4e9ca2379a0ec54b
define_singleton_configuration_definition_method Define a configuration definition method.
[ { "docid": "db1c4d50afeb7a5a2dad9f38c7bd7d1e", "score": "0.7233486", "text": "def define_singleton_configuration_definition_method( ccm_method_name )\n \n ccm = self\n \n #==================================#\n # attr_singleton_ccm_method_name #\n # attr_module_ccm_method_name #...
[ { "docid": "88839f325508ce962f2ba9f8bb281c11", "score": "0.74581784", "text": "def idempotently_define_singleton_method(name, &definition); end", "title": "" }, { "docid": "c7e10550511a1f56f1c4ffb629064ee2", "score": "0.65622264", "text": "def define_singleton_method(method_name, con...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "91556db2d24c4203dc19073934242efd", "score": "0.0", "text": "def enable_person_params\n params.require(:enable_person).permit(:clients_id, :nombre, :apellido, :dni, :estado)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496716", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6956598", "text": "def strong_params\n params.require(:request).permit(param_white...
975a830017e0ab4ceeaa88a427ee27fb
Constructs a new instance.
[ { "docid": "5e623d9f64380a21fa3b83b7a4c6d044", "score": "0.0", "text": "def initialize(value, unknown = nil)\n super(self.class.binding_type, value, unknown)\n end", "title": "" } ]
[ { "docid": "e2b31d60b2b5b380040a867c381a1b70", "score": "0.8045547", "text": "def new\n \n end", "title": "" }, { "docid": "e2b31d60b2b5b380040a867c381a1b70", "score": "0.8045547", "text": "def new\n \n end", "title": "" }, { "docid": "e2b31d60b2b5b380040a867c381a1b70...
584dc0b4254e7428bff22d566ecde208
Returns all of the credentials received from the CredentialHandler, except for ignored fields. Args: credentials: request credentials Returns: hash with header names and values
[ { "docid": "51cac37b79238a4122b029716cc6ccef", "score": "0.7250184", "text": "def headers(credentials)\n result = credentials.reject do |field, value|\n IGNORED_FIELDS.include?(field)\n end\n result[:access_token] = get_token(credentials)\n return result\n end",...
[ { "docid": "7634973613751509083eb1f848addbf7", "score": "0.7208589", "text": "def headers(credentials)\n @token = generate_token(credentials) if @token == nil\n result = {}\n result[:authToken] = @token\n credentials.each do |p, v|\n result[p] = v unless IGNORED_FIEL...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a658bcb06cde155953f07ee90214a70e", "score": "0.0", "text": "def event_params\n params.require(:event).permit(:titulo, :descripcion, :fecha_contacto, :nombre_contacto, :numero_contacto, :shop_id, :type_id , :state_id, :user_id)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6981537", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.67835593", "text": "def strong_params\n params.requ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7da7000c45c3472325c1608b432984aa", "score": "0.0", "text": "def set_transaction\n @transaction = Transaction.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.61642385", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60448", "text": "def action_hook; ...
e19b8505c80174fe6cb1919e59165784
return agency name as single string
[ { "docid": "ec3679af08d6c675033b45129455b4c8", "score": "0.0", "text": "def standard_agency1(scope, prefix, mandate)\n case scope\n when \"national\"\n ret = NATIONAL&.dig(@lang, gb_mandate_suffix(prefix, mandate).to_sym,\n :admin) || nil\n ret = ret.jo...
[ { "docid": "cb2f67b7c60ac51220413653c502876c", "score": "0.6868128", "text": "def agency_names(options = {})\n autolink = true unless options[:no_links]\n\n if agencies.present?\n agencies = model.agencies.map{|a| \"the #{h.link_to_if autolink, a.name, a.url}\" }\n else\n agencies = m...
f11e42964b5937a11391a3ec42b47220
Override this method stub to compare various Folio related files, e.g., after Folio XML import.
[ { "docid": "029df458a8bd56b75d8fe7b5ec0e4cf3", "score": "0.0", "text": "def compare_folio(options)\n end", "title": "" } ]
[ { "docid": "f323babc1632a06040680ebb5abd9522", "score": "0.65071553", "text": "def diff_files; end", "title": "" }, { "docid": "4fdd69a9ef07137593493df6f6d72928", "score": "0.63200414", "text": "def compare_files\n @files.each do |file|\n compare_file(file)\n end\n end", ...
ef55bfcf2fbe14eff38de77f30e74f21
BEGINNING OF TIC TAC TOE METHODS
[ { "docid": "503acc8ad30bea057b3cdb4c2e84300c", "score": "0.0", "text": "def ttt_board\n board = []\n 3.times do |x|\n board << [\" \",\" \",\" \"]\n end\n board\n end", "title": "" } ]
[ { "docid": "8d0e128ad87cd20a86507c09c46a6f67", "score": "0.7291908", "text": "def termitidae()\n end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.6594724", "text": "def telegraphical()\n end", "title": "" }, { "docid": "2dbabd0eeb642c3...
e33c8b7ecff740b7d41531f70f021487
Updates tags for a given owner using the params passed through the tagging web interface. This just updates the tags for a given owner, which defaults to the current user it doesn't affect other peoples tags for that item.
[ { "docid": "82f74012eccead75cb79f89ce92edaa5", "score": "0.6180128", "text": "def update_owned_annotations entity, attr='tag', owner=User.current_user\n unless owner.nil?\n entity.tag_as_user_with_params params, attr\n if immediately_clear_tag_cloud?\n expire_annotation_fragm...
[ { "docid": "dd06a2bfa66c282f716a4310b39868f1", "score": "0.6324392", "text": "def update_owner!(owner_key, data)\n put \"/owner/#{owner_key}\", body: data\n end", "title": "" }, { "docid": "92ac1da324faaebb9c710e37dda7b0bc", "score": "0.6017257", "text": "def owner=(owner)\n ...
9728e131b933c490d95cf2edebde11bb
Updates last activity time of current user if he is logged in
[ { "docid": "5d38c303138240d91ff2275f27c6b089", "score": "0.7954387", "text": "def update_last_activity\n current_user.try(:update_last_activity)\n end", "title": "" } ]
[ { "docid": "5c5700376b0f6d3d1992bad329b2dd4f", "score": "0.89408994", "text": "def update_last_user_activity\n if current_user\n current_user.update_attributes(:last_user_activity => Time.now)\n end\n end", "title": "" }, { "docid": "dfa2a0078e125a8b8c4c158a8e08c915", "score"...
e169f7c98c1bbff08759904db65fb154
GET /mycelia/1 GET /mycelia/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "764a35b8c40e94081ae31d4ae4fab03d", "score": "0.6469224", "text": "def show\n @cavale = Cavale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cavale }\n end\n end", "title": "" }, { "docid": "94b5e6a94e2...
7c957ffbfb7f757e02b1a86e9b67918f
Does a handydandy 3d projection to the window
[ { "docid": "93db7ab235df834804504895f21f2d18", "score": "0.0", "text": "def draw\n # Draw background\n self.draw_quad(0, 0, BG_COLOR,\n self.width, 0, BG_COLOR,\n self.width, self.height, BG_COLOR,\n 0, self.height, BG_COLOR...
[ { "docid": "40e69a117552ee35f4332ccc5ece91aa", "score": "0.7093322", "text": "def view3D; end", "title": "" }, { "docid": "ec73e3a3ad2605e8daded541309579c4", "score": "0.6970813", "text": "def view_3D; end", "title": "" }, { "docid": "de91e8dbb03c20589e33bd96ea4ae1d9", ...
8df3a38d09d9db71436751cd75f4f63e
Explicitly because it conflicts with select method
[ { "docid": "04c13b5dbf463297f54063512a2d3570", "score": "0.0", "text": "def select *args\n SingletonBrowser.instance.browser.send :select, *args\n end", "title": "" } ]
[ { "docid": "435ec51293e0f5fc7b9e081e4382879f", "score": "0.83003205", "text": "def select; end", "title": "" }, { "docid": "2922ea024319263819ee712b7757afef", "score": "0.7689676", "text": "def select(*args) end", "title": "" }, { "docid": "f922c478ae2a66f482dc725b21da0ae...
a1363825656cd3379856aabe994b0219
Public: Resolve a set of files, directories, and patterns to a list of paths to test.
[ { "docid": "5eda0e07fef9bbc9269bf34f0cea5f4b", "score": "0.68888927", "text": "def resolve_paths names\n if context.tag_filters.any?\n # Bats doesn't support tags\n []\n elsif names.any?\n paths = []\n for name in names\n paths.concat Array(resolve_name nam...
[ { "docid": "36832a337ed67d51138f321989413b87", "score": "0.73322713", "text": "def resolve_paths names\n if names.any?\n paths = []\n for name in names\n paths.concat Array(resolve_name name)\n end\n paths\n else\n Array(resolve_as_directory test_dir...
7f882e0b9aed7298681810106dd9e4e9
Search the XML document.
[ { "docid": "0f45c2a5c0ff04f23ce55df73a848376", "score": "0.0", "text": "def state_from_xml(doc, resource, ch = nil)\n case REXML::XPath.first(doc, \"//datavalues/#{resource}#{ch}state\").text.to_i\n when 0\n s = \"off\"\n when 1\n s = \"on\"\n el...
[ { "docid": "a363f5866702e4ca5d8d10d9999748a9", "score": "0.78108317", "text": "def search_xml(search_path)\n\t\t\tself.artist_xml.search(search_path)\n\t\trescue Exception => e\n\t\t\tputs \"Error searching XML: #{e}\"\n\t\tend", "title": "" }, { "docid": "a363f5866702e4ca5d8d10d9999748a9", ...
77066b78e176a9edf81f85aa134e204b
GET /expenses/1 GET /expenses/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b6f455b68a6369a701b0729e38c67dff", "score": "0.76643664", "text": "def index\n @expenses = Expense.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n end", "title": "" }, { "docid": "9ff8a84f500cec409...
9002e97babb4487600b32f6d6a1bca5b
PUT /residenciais/1 PUT /residenciais/1.json
[ { "docid": "6e2212a1bf3fe2d5bff8d9959691ca8f", "score": "0.0", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n #format.html { redirect_to [@user.apartamento.residencial, @user.apartamento, @user], notice: 'Us...
[ { "docid": "1841e61c7cd7870c997fccf3f0dc370d", "score": "0.68651193", "text": "def update\n respond_to do |format|\n if @residencia.update(residencia_params)\n format.html { redirect_to [@programa, @residencia], notice: 'residencia was successfully updated.' }\n format.json { rende...
f08e3ccf96276aef5fcc123e84bb77ce
POST /cities POST /cities.json
[ { "docid": "03225d4867432de9d5435aaed9627198", "score": "0.61616117", "text": "def create\n @city = City.new(city_params)\n end", "title": "" } ]
[ { "docid": "c4b0b159e3ed0ae4a733499ff06f1dbb", "score": "0.69075155", "text": "def create\n @city = City.new(city_params)\n\n if @city.save\n render json: @city, status: :created, location: @city\n else\n render json: @city.errors, status: :unprocessable_entity\n end\n end", "...
f763f1b3a25e3aea2a5d33e854a994bf
def views start = 1 count = start + 1 count.each do |count|
[ { "docid": "94e80f793e5dac5bf4a919beaf9473a5", "score": "0.0", "text": "def bottles\n @bottles = 99\n @bottles_less = @bottles - 1\n\n end", "title": "" } ]
[ { "docid": "34d00efb9e9392c8ce5cff5fa9bdea79", "score": "0.7118049", "text": "def increment_views!\n increment!('views_count')\n end", "title": "" }, { "docid": "eedafbd2fc9bfacae82723a3c345bf39", "score": "0.7028829", "text": "def increment_no_of_views\n self.increment!(:...
05bdb094891c07209a2feb46cef03252
Set default font sizes.
[ { "docid": "f195827cfd415d12eaff60c2833c1739", "score": "0.78673494", "text": "def set_font_sizes(font_sizes:)\n {\n method: \"Page.setFontSizes\",\n params: { fontSizes: font_sizes }.compact\n }\n end", "title": "" } ]
[ { "docid": "017d0d9a0d8973a0760af83450a763a7", "score": "0.7454809", "text": "def default_font_size\n (options[:default] and options[:default][:size]) ? options[:default][:size] : 40\n end", "title": "" }, { "docid": "c8aba4b8e8b9ac1b4bf7d1ef1a783ce0", "score": "0.717142", ...
86443cfc40b577098bf98a59d7920017
Create a new object based on a hash. This is used to create a new object based on the server response.
[ { "docid": "87a3a6dd0902f34b4883e5ead22079c3", "score": "0.0", "text": "def factory(attrs)\n # Example:\n # => {\"name\"=>\"iOS Distribution: SunApps GmbH\",\n # \"certificateId\"=>\"XC5PH8DAAA\",\n # \"serialNumber\"=>\"797E732CCE8B7AAA\",\n # \"status\"=...
[ { "docid": "9d2fbaf59b434ce9a278dceeca93a9e0", "score": "0.79310834", "text": "def create(hash); end", "title": "" }, { "docid": "7d63a7b603a6caf8cad1ba1f7cb16b84", "score": "0.73230535", "text": "def create_with(hash)\n obj = nil\n arity = self.method(:initialize).arity\n\...
ae80334e9f87b8fc81f8ddd2332fc681
Additional content key defined check
[ { "docid": "6202e4b70a62a5d90fe99c952ae9b8f8", "score": "0.7393192", "text": "def additional_content_key_defined?\n return true if additional_content_key_exists?\n\n if Rails.env.development?\n raise AdditionalContentKeyNotDefined,\n \"Key not defined in AdditionalContent: '#{addit...
[ { "docid": "c1c7a119770abe10f867705d7a67f704", "score": "0.7525482", "text": "def key?(key)\n @content.key?(key)\n end", "title": "" }, { "docid": "92d98afbb6f9d52ba4ee1ee27cce925b", "score": "0.7416962", "text": "def additional_content_key_exists?\n ::AdditionalC...
b9426ce1bd407909eb29b6e0f52ed7ce
checks for valid family name, terms of use check and user block check
[ { "docid": "f76b2287d9ba9a5e57b4f3d166dccdbc", "score": "0.0", "text": "def initialize()\n #@hide_float_menu = true\n end", "title": "" } ]
[ { "docid": "60d4e5821138d7b0846a006236d97c4d", "score": "0.61565495", "text": "def validate_family(v); end", "title": "" }, { "docid": "25b55e812c703a7935ba6122f501ecfb", "score": "0.5995477", "text": "def check_if_in_acbl_honorary_members(name, has_alter_egos, alter_egos)\n # Does ...
32745adc5123cd0ff4de66150bd55d52
Filter endpoint records for current user HACK return ids list (no embed option in AMS 0.10)
[ { "docid": "0b49d6c5bce2b45034b1de7cfeccf028", "score": "0.6199666", "text": "def endpoints\n endpoints = object.endpoints\n unless current_user.admin?\n endpoints = object.endpoints.select { |ep| ep.project.users.include?(current_user) }\n end\n endpoints.map { |e| e.id }\n end", ...
[ { "docid": "2e777164f456f8373ca78ad5333ba83f", "score": "0.6290235", "text": "def filtering_ids\n return nil unless current_user\n\n return @filtering_ids if @filtering_ids\n\n @filtering_ids = Rails.cache.read cache_ids_key\n end", "title": "" }, { "docid": "673cee4b2f2211...
abb75321e0db47b8b760f69c16ac86d8
Edit linked a requirement
[ { "docid": "e2843953d2971143f9b5334862c70c3a", "score": "0.561065", "text": "def edit_requirement_tracker\n find_user\n if !@user.nil?\n\n status=@req.status\n\n if ((status!=\"Approved\" and params[:requirement][:status]==\"Approved\" and (@user.privilige==\"Admin\" or @user.privilige==...
[ { "docid": "3d0726c4ad279e38db228416b5b37a60", "score": "0.65400624", "text": "def set_requirement\n @requirement = Requirement.find(params[:id])\n end", "title": "" }, { "docid": "3d0726c4ad279e38db228416b5b37a60", "score": "0.65400624", "text": "def set_requirement\n @...
39649ea78eb1f3a1d44ad20e8023a3eb
Return organisation related organisations if any
[ { "docid": "a9b36259e0d0d1227e218b9a30ca0e9d", "score": "0.82061744", "text": "def organisation_related_organisations\n \torganisation_related_organisations = []\n org_related_organisations_ids = related_organisations.collect{|ro| ro.org_organisation_id}.flatten.compact\n\t\n\torg_related_organisati...
[ { "docid": "dc27171b7fd7aa518c7bf6aa830572fb", "score": "0.80790836", "text": "def organisations\n @organisations ||= Organisation.where('m.u' => id)\n end", "title": "" }, { "docid": "f5f071b6700b8f473da07e311ec65ecb", "score": "0.79110706", "text": "def organisations\n Organ...
53b4c6e6df4bb1435bc4983c4c0c942b
Returns only the children with +results+
[ { "docid": "857b2bdb3beb9bc8062775dcd3e27bf9", "score": "0.8369089", "text": "def children_with_results\n children.select(&:any_results_including_children?)\n end", "title": "" } ]
[ { "docid": "086631a8d2daa1d348abfb221e3d917d", "score": "0.6459362", "text": "def children\n\t\treturn self.search( :one, '(objectClass=*)' )\n\tend", "title": "" }, { "docid": "d51e2e3a977f8f6be9261d8c09d75f0a", "score": "0.6355265", "text": "def any_results_including_children?\n ...
97e459e47912311ead9a9c266c9941b5
GET /personas/1 GET /personas/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "297f82d105d9f3b0db2238a60540b233", "score": "0.7634019", "text": "def show\n @persona = Persona.find(params[:id])\n render json: @persona\n end", "title": "" }, { "docid": "dbd3d788157761fda2e0a6efcd8111b7", "score": "0.7497771", "text": "def index\n @personas =...
bf33f032d17e9fa328d4c4def94f2b5f
The plugin requires logged_in? to return true or false if the user is logged in. Uncomment and call your auth frameworks equivalent below if different. eg. for devise:
[ { "docid": "2b3bec24f368a0ab6d5d1761a324ddbf", "score": "0.74387866", "text": "def logged_in?\n user_signed_in?\n end", "title": "" } ]
[ { "docid": "20ac395f86939b0e41a152606967d40f", "score": "0.7890554", "text": "def logged_in?\n !!current_auth\n end", "title": "" }, { "docid": "c4fe9fe2cfa4010d87c3861c50aec87b", "score": "0.78172666", "text": "def logged_in?\n if current_user\n true\n else\n fal...
6f27134ba8108c6313e60f3684ec810f
Pushes some context objects and yields block
[ { "docid": "eda5b323b57c398ab3ad94d4bd39b94c", "score": "0.55689484", "text": "def with(hash) \n @state = @state.push(current_mode)\n hash.each_pair {|k,v| @state[k]=v}\n r = block_given? ? yield(self, context_node) : nil\n @state = @state.pop\n r\n end", "tit...
[ { "docid": "bb5729f5f9496ddf193976a724f2711d", "score": "0.71936667", "text": "def in_context(&block)\n ctx = self.merge\n yield ctx\n end", "title": "" }, { "docid": "37a5bf9a3bc741712aa458a1c597272f", "score": "0.7114739", "text": "def with(context, &block)\n ctx = self.m...
c1c08833c472782e2336a9a85bc8fe11
Update Payment Allocations Process
[ { "docid": "99da33585d1ef712b0ee06dce267b9bf", "score": "0.78783965", "text": "def update_allocations\n puts \"Running payment_process.update_allocations\"\n create_allocation_transactions\n # verify_journal_set\n end", "title": "" } ]
[ { "docid": "644c5348277be8161ff6a377e6ecfbc1", "score": "0.63160497", "text": "def adjust_all_invoice_allocations\n if changed_attributes[:service_provider_service_amount]\n # puts \"CHANGED: invoice_allocations.size: #{invoice_allocations.size}\"\n adjust_invoice_allocations(\"ServiceProvi...
717152a9065bdf810328ed36515c1e72
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.pedido_mailer.recebido.subject
[ { "docid": "6e985b7504cac3eac77dbb102f8bd99f", "score": "0.0", "text": "def recebido(pedido)\n @pedido = pedido\n\n mail to: pedido.email, subject: \"Confirmação de pedido da FG Games\"\n end", "title": "" } ]
[ { "docid": "ea740e704e8f1173fb87b45dfcaaf989", "score": "0.8005749", "text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end", "title": "" }, { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.7568602", "text": "def subject_for\n ActiveSupport...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "fe2e84aefd92746eca0e97387498c7b6", "score": "0.0", "text": "def update!(**args)\n @permissions = args[:permissions] unless args[:permissions].nil?\n end", "title": "" } ]
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
aa2f1c3954a2e76fa2c9dbaf73ab1fa4
Run Celluloid in the foreground
[ { "docid": "3149a1c7104339a272ecf134c1c43105", "score": "0.77633184", "text": "def run\n\n # Run in the background if daemonizing\n (daemonize; return) if @options[:daemonize]\n\n # Otherwise, run in the foreground\n launch_celluloid(true)\n end", "title": "" } ]
[ { "docid": "f79d059914471adf23ea254eb6d3e21d", "score": "0.6589524", "text": "def launch!\n run!\n end", "title": "" }, { "docid": "6a9a61bcefdfbb0c9f87766118bdda8e", "score": "0.63596016", "text": "def run\n if daemonize\n run_background\n else\n run_...
a238180281d12f8556157ca920bfa073
Form for Item instance (Common fields) This helper method will render the partial items/_form.html.erb and passed some parameters to it link the block to bind to that form. Parameters : object: Instance of an Item object title : String defining the form title &block : Block to bind to the partial for specific fields of...
[ { "docid": "851907d1c636291e1e4e5a0eda88baaa", "score": "0.7808662", "text": "def form_for_item(object, title = '', ajaxsubmit=nil,url=nil,&block )\n\t\tconcat(render(:partial => \"generic_for_item/form\", :locals => { :block => block, :title => title,:remote=>ajaxsubmit,:url=>url }))\n end", "titl...
[ { "docid": "c3024cc2760d3c0d942cae7c23e7e8ff", "score": "0.68883854", "text": "def form_for_container(object, title = '', &block)\n\t\tconcat(render(:partial => \"containers/form\", :locals => { :block => block, :title => title }))\n end", "title": "" }, { "docid": "31631adb40c41eeca131a24b...
96d79a29783c4e646d27edf845e374d8
Test if mutation is killed by test report
[ { "docid": "bc81cbfa11cef0a02ddc8090f66eee0c", "score": "0.6081244", "text": "def killed_by?(test_report)\n self.class::SHOULD_PASS.equal?(test_report.passed)\n end", "title": "" } ]
[ { "docid": "0235e770820cb051230fd0e0d1b2c219", "score": "0.7682384", "text": "def mutation_dead?\n test_report = report.test_report\n killer.mutation.should_fail? && test_report.failed?\n end", "title": "" }, { "docid": "28e246a28bf9f73e0eb64b05f0609e32", "score": "0.6...
da68a91f540227da267171b19236c8ad
POST /tutorials POST /tutorials.json
[ { "docid": "a553a4daefc4405af7c807462a87b577", "score": "0.6986987", "text": "def create\n @tutorial = Tutorial.new(tutorial_params)\n\n respond_to do |format|\n if @tutorial.save\n format.html { redirect_to admin_tutorials_path, notice: 'Tutorial was successfully created.' }\n ...
[ { "docid": "6414ef383f00ef8b8fc33ed68133eee8", "score": "0.7624717", "text": "def create\n @tutorial = @framework.tutorials.build(tutorial_params)\n\n if @tutorial.save\n render :show, status: :created\n else\n render json: @tutorial.errors, status: :unprocessable_entity\n end\n e...
3d29b1fcf11ef5f658cc7799ffe01022
DELETE /schedules/1 DELETE /schedules/1.json
[ { "docid": "ec6246e296a2f73ae79e93928864f5f4", "score": "0.7978833", "text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :no_content }\n end\n end", "title...
[ { "docid": "472d790b7e67c564304e69e63a6ac51c", "score": "0.8132402", "text": "def destroy\n @schedule = getSchedules()[params[:id]]\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :no_content }\n end\n end", "titl...
c7b971cdbb155460a82163276042f7fe
Objectto_a is deprecated, though it does have the desired behavior
[ { "docid": "6ee21d57ad11248f56a08ad1971a21c4", "score": "0.0", "text": "def safe_to_array(o)\n case o\n when NilClass\n []\n when Array\n o\n else\n [o]\n end\n end", "title": "" } ]
[ { "docid": "876b963c40598a360335b36629211cd7", "score": "0.7984707", "text": "def to_a() end", "title": "" }, { "docid": "c96ae571ddf821f2185a34a16a364359", "score": "0.7937527", "text": "def to_a; end", "title": "" }, { "docid": "c96ae571ddf821f2185a34a16a364359", "s...
0abb4778f0c1ec5334c8c4fefd225ee2
NB n WORST CASE list = [ 0, 3, 5, 4, 5, 10, 1, 90 ] p my_min_iterative(list)
[ { "docid": "5a9e5c1866decb717e0e3482e3077565", "score": "0.0", "text": "def largest_sub_sum(array)\n subsets = []\n i = 0\n while i < array.length\n j = i\n while j < array.length\n subsets << array[i..j]\n j += 1\n end\n i += 1\n end\n result = nil\n subsets.map {|subset| su...
[ { "docid": "405e4dabac6e5a00c42cc3d60b2b13fb", "score": "0.73593956", "text": "def my_better_min(list)\n min = list[0] #1\n\n list.each_with_index do |ele_1, i| #n\n if ele_1 < min # 1 *n\n min = ele_1 #1 *n\n end\n end\n\n min #1\n # (i...list.length).each do |j|\n # if list[i] l...
13567753eeb144557c4ceae97dc62077
If this is a preflight OPTIONS request, then shortcircuit the request, return only the necessary headers and return an empty text/plain.
[ { "docid": "fe154407ea9f33af5df05a5ffe973af6", "score": "0.7098383", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-...
[ { "docid": "c01beb23714dd89b52bf69d8ac226e17", "score": "0.76129806", "text": "def handle_options\n head(:ok) if request.request_method == \"OPTIONS\"\n end", "title": "" }, { "docid": "a1551a2cb6679b07269ec79c28d2ee03", "score": "0.7466649", "text": "def cors_preflight_check\n ...
13c49b34a66ab89f016b04325557e9a5
The latest published version. Returns an instance of ArticleVersion
[ { "docid": "7fced1f5b9baf52ce5012d5ce265bb52", "score": "0.66964316", "text": "def display_version\n ActiveSupport::Deprecation.warn(\"Article#display_version is deprecated. Use Article#latest_published_version instead. \")\n self.latest_published_version\n end", "title": "" } ]
[ { "docid": "3b4ff942aad33b0a37c56167a2e27aa8", "score": "0.8057796", "text": "def latest_version\n self.article_versions.first\n end", "title": "" }, { "docid": "a408344b3026f2f734c342d347d55177", "score": "0.7264541", "text": "def original_published_version\n self.article_ver...
dbcb02ce8743528352b0dbc0298a09ea
SQLServer Helpers attr_reader :select_statement_lock
[ { "docid": "82a209aa38174d62c3acec3fa6f0028e", "score": "0.89503306", "text": "def select_statement_lock\n Thread.current[:'Arel::Visitors::SQLServerNG.select_statement_lock']\n end", "title": "" } ]
[ { "docid": "3bd8295d8f9e968d42f30f9f2b6d9851", "score": "0.740702", "text": "def select_lock_sql(sql)\n @opts[:lock] == :update ? sql : super\n end", "title": "" }, { "docid": "5db4208f51bc11b5fc005d7cceb93c03", "score": "0.7344462", "text": "def select_lock_sql(sql)\n ...
bd9ae1f0483e7496a589f79bfeb2a99c
PUT /ponto_assinaturas/1 PUT /ponto_assinaturas/1.xml
[ { "docid": "ef195de28619f0b41591786b241e7e29", "score": "0.6618391", "text": "def update\n @ponto_assinatura = PontoAssinatura.find(params[:id])\n\n respond_to do |format|\n if @ponto_assinatura.update_attributes(params[:ponto_assinatura])\n format.html { redirect_to(@ponto_assinatura,...
[ { "docid": "177a19f7f85a31ed8cc5bc04c10f899d", "score": "0.6403197", "text": "def update\n @tipo_osexterna = TipoOsexterna.find(params[:id])\n\n respond_to do |format|\n if @tipo_osexterna.update_attributes(params[:tipo_osexterna])\n flash[:notice] = 'ATUALIZADO COM SUCESSO.'\n ...
94830bb9c40f164d4e1da25ea4abe61f
these are instance methods that are called on the object to return the converted temperature.
[ { "docid": "d2eaf7fc913fb62a65b4431d3ba23b03", "score": "0.6724485", "text": "def in_fahrenheit\n self.class.ctof(@temperature)\n end", "title": "" } ]
[ { "docid": "4d6b4c601167b1c6b1d26724078840eb", "score": "0.75840324", "text": "def temperature_converter(temp_in_celcius)\n return temp_in_celcius * 9.0/5 + 32\nend", "title": "" }, { "docid": "528de5d8eb913677f377ffa4c4cd4fa6", "score": "0.7438878", "text": "def temperature\n ...
9315ed6f9b3fcab36a23b1bc86fe1225
Parse a Unix like FTP LIST entries.
[ { "docid": "3585f9888d0000fb50b3472d4c35859c", "score": "0.57228476", "text": "def initialize(raw)\n super(raw)\n match = REGEXP.match(raw.strip) or raise ParserError, \"Unix: regexp exception #{raw}\"\n\n case match[1]\n when /d/ then @dir = true\n wh...
[ { "docid": "e9ee721bc293f78e9b2520d65f622c0e", "score": "0.6224633", "text": "def parse_list; end", "title": "" }, { "docid": "e9ee721bc293f78e9b2520d65f622c0e", "score": "0.6224633", "text": "def parse_list; end", "title": "" }, { "docid": "30390736a0085270274cdfe1746f24...
dcc7c78e430244159d1f89225b512a78
Shortcut for creating blocks
[ { "docid": "53e7af5cf57bb4589ba1fbb30b112625", "score": "0.75121313", "text": "def __create_block(name, location = nil, &block)\n Bade::Runtime::Block.new(name, location, self, &block)\n end", "title": "" } ]
[ { "docid": "f0724c094e43ae15560f3d52210bed1c", "score": "0.7632845", "text": "def new_block name\n new_b = Block.new( name , @function , @next )\n @next = new_b\n return new_b\n end", "title": "" }, { "docid": "edd4b105a06f76a72191872de9768a79", "score": "0.7576588", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "abcb81977324eff8fada51eaa65a633a", "score": "0.0", "text": "def set_graphic\n @graphic = Graphic.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...
1c27150d0bd5e1b81006b4ace3dbbdea
Toma un array de sets de entrenamiento y devuelve un array de arrays, con los sets contiguos con el mismo ejercicio juntos Ej : [ curl, curl, squat, squat, curl, squat] > [[curl, curl], [squat, squat], [curl], [squat]]
[ { "docid": "98a2947fffb995567c31c7c012bbb4e7", "score": "0.0", "text": "def partitionize(array)\r\n p = Array.new\r\n\r\n array.each_with_index do |x, i|\r\n if i == 0 || x.exercise_id != array[i-1].exercise_id\r\n p << Array.new\r\n end\r\n p.last << x\r\n end\r\n p\r\...
[ { "docid": "38101a6c032301366cef77bf4c99cfee", "score": "0.7358327", "text": "def get_sets\n result = []\n (0..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 3)).each do |a|\n ((a + 1)..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 2)).each do |b|\n ((b + 1)..(TAILLE_TAPIS + TAILLE_EXT*self.etend...
fa4efa9bcdc62341451bcc0ca79a1536
PATCH/PUT /performances/1 PATCH/PUT /performances/1.json
[ { "docid": "ece0d1b629cf81703cc15c88dff295e4", "score": "0.70051265", "text": "def update\n respond_to do |format|\n if @performance.update(performance_params)\n format.html { redirect_to @performance, notice: 'Performance was successfully updated.' }\n format.json { render :show, ...
[ { "docid": "3714bfa1fd0f7aa3bf7f79dccffc8ded", "score": "0.66480845", "text": "def update\n @performance_test = PerformanceTest.find(params[:id])\n\n respond_to do |format|\n if @performance_test.update_attributes(params[:performance_test])\n format.html { redirect_to @performance_test...
e279d8f7a944655f80f7bbb80652fbea
function purpose: "How much cash does the shop have?" access the data(hash) and return the value attached to :total_cash
[ { "docid": "d49006f9d8fef82185e09ce3f9fcfa1d", "score": "0.7660757", "text": "def total_cash(shop_cash)\n return shop_cash[:admin][:total_cash]\nend", "title": "" } ]
[ { "docid": "8ee8b4d7663a7a54754a1ca5771cf9c9", "score": "0.7882121", "text": "def total_cash(pet_shop_hash)\n return pet_shop_hash[:admin][:total_cash]\nend", "title": "" }, { "docid": "19e2b7070e72d9f88348a489a60b9c8f", "score": "0.7576526", "text": "def total_cash(cash)\n return ...
f4816d2e8a6dc0189ea1a3911e23bbf5
Return the type of activity. We switch on the class.to_s because the class itself is quite long (due to ActiveRecord).
[ { "docid": "efbd7e6a84eb404597608f79c792f97d", "score": "0.8494724", "text": "def activity_type(activity)\n activity.item.class.to_s \n end", "title": "" } ]
[ { "docid": "a2ab7e25b72e4b3993bef2df949436e5", "score": "0.84008265", "text": "def activity_type\n return @activity_type\n end", "title": "" }, { "docid": "0461bf9a51e1b73b00bf4fc49db1a46e", "score": "0.8324125", "text": "def activity_type(activity)\n act...
817d5093ccbbfa2a9dbbf07764b7584a
GetConversationData get the bots data for all users in a conversation
[ { "docid": "5efb416592c8989c4401e7acb6b1c31d", "score": "0.7654759", "text": "def get_conversation_data(opts = {})\n # opts['channel_id'] & opts['conversation_id']\n uri = \"/v3/botstate/#{opts['channel_id']}/conversations/#{opts['conversation_id']}\"\n BotFramework::BotData.new api_get(u...
[ { "docid": "d02ac75ff51b17bdef752a94a1664f86", "score": "0.72935224", "text": "def get_private_conversation_data(opts = {})\n uri = \"/v3/botstate/#{opts['channel_id']}/conversations/#{opts['conversation_id']}/users/#{opts['user_id']}\"\n BotFramework::BotData.new api_get(uri)\n end", "...
32c108b267dde4e40921fbfa900a84c3
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/routes/v2/trunk.rb27
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "0f17cc6fc75f90821c4de18311f34412", "score": "0.63337505", "text": "def route_name; end", "title": "" }, { "docid": "0f17cc6fc75f90821c4de18311f34412", "score": "0.63337505", "text": "def route_name; end", "title": "" }, { "docid": "0f21bce8205b052ae0fb5db62387...
610906ebf8987d94600542753ab85c58
FUNCTION: sendThread LAST REVISION: September 29, 2014 DESIGNER: Callum Styan PROGRAMMER: Callum Styan INTERFACE: sendThread(fName, filesize, sock) fName: name of the file we requested from the server filesize: size of the file we requested from the server sock: socket for the transfer of file data NOTES: This function...
[ { "docid": "3db976146dd655cf7d101eb62a359c02", "score": "0.8158003", "text": "def sendThread (cmdSock, sock, fName)\n\tpath = File.expand_path(\"..\", Dir.pwd) + \"/testFiles/\" + fName\n\tbegin\n\t\tFile.open(fName, \"rb\") do |file|\n\t\t\tcmdSock.puts(file.size)\n\t\t\twhile data = file.gets do\n\t\t...
[ { "docid": "96e58448ee4d943770e926eb7e85dcd6", "score": "0.81271315", "text": "def sendThread(cmdSock, sock, fName)\n\tsize = 1024\n\tputs \"Sending a file\"\n\tpath = File.expand_path(\"..\", Dir.pwd) + \"/testFiles/\" + fName\n\tfExists = File.exists?(path)\n\t#if the file exists attempt to open it an...
69beaa3e957d1fc356539d0314d703e1
Custom attribute writer method checking allowed values (enum).
[ { "docid": "de85c0aa94b41c9449f483d22890cc56", "score": "0.0", "text": "def backup_status=(backup_status)\n validator = EnumAttributeValidator.new('String', [\"InitializingProtection\", \"Protected\", \"ExceedsInterval\"])\n unless validator.valid?(backup_status)\n fail ArgumentError, \...
[ { "docid": "8146b840a980695b919bbb80892fcc0c", "score": "0.61607504", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_D...
fbbdebe5ddb8bf93f144c5a7b6d52c17
=begin :type player_id: Integer :rtype: Void =end
[ { "docid": "92812ee6027e7f92100a9cfadedbad70", "score": "0.6665155", "text": "def reset(player_id)\n \n end", "title": "" } ]
[ { "docid": "03b25036d7e18e7f9de21776144681ce", "score": "0.69595015", "text": "def initial_completed(player_id); 0; end", "title": "" }, { "docid": "30545b4c479b81642db1eba9ab6fa217", "score": "0.6767559", "text": "def player; end", "title": "" }, { "docid": "9264f3e7a077...
b044c7754c7acf9fc3e0dd9a15e83d98
GL reports are deactivated in new transam instance if a chart of account exists, GL features are enabled therefore need to activate reports
[ { "docid": "cb15e2c3d17597a2fe51cc533d4f05aa", "score": "0.7574424", "text": "def activate_gl_reports\n report_type = ReportType.find_by(name: \"GL/Accounting Report\")\n report_type.update!(active: true)\n\n report_type.reports.update_all(active: true)\n\n end", "title": "" } ]
[ { "docid": "88e1e7f680618310e135fa699e1bfb65", "score": "0.62181807", "text": "def compare_report\n @accounts_enabled = (Configuration.get_config_value 'MultiFeeAccountEnabled').to_i == 1\n @accounts = FeeAccount.all if @accounts_enabled\n end", "title": "" }, { "docid": "13d4697d4019...
50f9f185a7e0a4b735aeced6110bd841
Calculates hash code according to all attributes.
[ { "docid": "517852e7302f814ddea36a78c2bc7ebf", "score": "0.0", "text": "def hash\n [id, type, subtype, item, service_template, board, summary_setting, discussion_setting, internal_analysis_setting, tasks_setting, documents_setting, resources_setting, budget_hours_setting, finance_information_settin...
[ { "docid": "08105588814074a5aed46dbb236c8d02", "score": "0.791457", "text": "def hash_code; Digest::SHA256.hexdigest(@attributes.values.join); end", "title": "" }, { "docid": "706cbdb4c78e6b67e29589df0a4b1b5c", "score": "0.73099273", "text": "def attr_hash\n md5 = Digest::MD5.ne...