query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
ee78c1a82f1b4dc6073dab9d942c5b2c
added for Sinatra env['rack.errors'] capability
[ { "docid": "fa6fc4f3217c484fc6557eec276156e8", "score": "0.0", "text": "def puts(boom)\n self.error(boom.to_s) if boom\n end", "title": "" } ]
[ { "docid": "1cd3ce45d8e0ac6d4361ccd6e1acc7d2", "score": "0.7737695", "text": "def setup_error_handling(rack_env)\n end", "title": "" }, { "docid": "ceba5a62b60e050ffc56c36813506b73", "score": "0.73421645", "text": "def errors\n @errors || (@env && (@errors = @env['rack.errors']...
8028524fd582ed1a1cce66e0116a0744
returns the URI of the apache.org generated checksum based on either an absolute path to the tarball or the tarball based path.
[ { "docid": "b838ea90d2b451dca6e4c0513285a11b", "score": "0.6691697", "text": "def default_tomcat_checksum_uri(base_uri, version, version_archive)\n URI.join(base_uri, \"tomcat-#{major_version(version)}/v#{version}/bin/#{version_archive}.#{version_checksum_algorithm(version)}\").to_s\n end", ...
[ { "docid": "c5b755f8a67e7e5f875908c9f9dcce67", "score": "0.81353855", "text": "def checksum_uri\n if new_resource.tarball_uri.empty?\n URI.join(new_resource.checksum_base_uri, \"tomcat-#{major_version}/v#{new_resource.version}/bin/apache-tomcat-#{new_resource.version}.tar.gz.md5\")\n else\n ...
7233f9ca9a156f2b635b133488ccd143
bear_room function is defined. Some text is printed, and the bear_moved variable is set to false.
[ { "docid": "375a4a961c4b0438f1f4105ac527a826", "score": "0.59682804", "text": "def bear_room\n puts \"There is a bear.\"\n puts \"The bear has a bunch of honey.\"\n puts \"The fat bear is in front of another door.\"\n puts \"How are you going to move the bear?\"\n bear_moved = false\n\n# While true...
[ { "docid": "25e81643840b3bdab7e2e18b786ea470", "score": "0.6718542", "text": "def bear_room()\n\tputs \"There is a bear here.\"\n\tputs \"The bear has a bunch of honey.\"\n\tputs \"The fat bear is in front of another door.\"\n\tputs \"How are you going to move the bear?\"\n\tbear_moved = false;\n\n\twhi...
99b159d56532470443bd2ee82a9108c2
Create a plain database instance or read replica, as described in our
[ { "docid": "d60a5cc56ac56e84ec6676834d7e5901", "score": "0.72881824", "text": "def createDb\n\n if @config['creation_style'] == \"point_in_time\"\n create_point_in_time\n elsif @config['read_replica_of']\n create_read_replica\n else\n create_ba...
[ { "docid": "939d63bda48281aec7d99f43b50d755c", "score": "0.72235155", "text": "def create_read_replica\n @config[\"source\"].kitten(@deploy)\n if !@config[\"source\"].id\n raise MuError.new \"Database '#{@config['name']}' couldn't resolve cloud id for source database\", deta...
8b2bb5d27a41b82794a3d6d152a5907a
Add a row for each of the asset for the org
[ { "docid": "40eab38c5fd852d07ae7392e00ef3713", "score": "0.554237", "text": "def add_rows(sheet)\n\n idx = 5\n sheet.add_row\n sheet.add_row\n sheet.add_row ['1. Revenue Vehicles - Percent of revenue vehicles that have met or exceeded their useful life benchmark'] + ['']*5\n sheet.merge_c...
[ { "docid": "ccf293887475a91636796128025a486b", "score": "0.75485533", "text": "def add_rows(sheet)\n if @assets.nil?\n asset_seed_foreign_key = @asset_class_name.constantize.asset_seed_class_name.foreign_key\n\n assets = @asset_class_name.constantize.operational.where(organization_id: @org...
0a88b6389ceb757b77dd4b11f4789278
DESIGN QUERY because ships are static assets and groups are usercreated, should this be left asis or should groups lead to a ship show?
[ { "docid": "7441bf00c3a18704b8021bc693934289", "score": "0.59860766", "text": "def ship_name(group)\n\t\tgroup.ship.name \n\tend", "title": "" } ]
[ { "docid": "8f9e310183c9d6764311a5a847c262bf", "score": "0.62545884", "text": "def index\n @ship_groups = ShipGroup.all\n end", "title": "" }, { "docid": "20cd0bb40b720f1b5e71e39f85188a00", "score": "0.60582024", "text": "def update_ship_group(group)\n if group[-2] < 0\n ...
60d68b5a7429f97995056a5bff2221b1
Server bound to port 2000
[ { "docid": "fa87bd60d4e6333186f16296fd310846", "score": "0.0", "text": "def do_user\n $client.puts \"User Name:\"\n $name = $client.recvfrom(20)[0]\n if $name[0..6] == 'TeaBoss'\n \t$userFlag = ture\n \t$client.puts \"331 User Name is OK, Need Password:\"\n \tdo_pass\n elsif $name[0..8] == 'anonymous'\n...
[ { "docid": "f740860e39f443cb38f75f3b5bb597a1", "score": "0.77365434", "text": "def start_server!; @server = TCPServer.open($port) end", "title": "" }, { "docid": "a8bb232e609170307bdc540395c7251a", "score": "0.7349909", "text": "def server(port = 9319)\r\n puts \"- Starting server o...
232a0d6557aed8f889158f6c5fdf183a
which takes a number as an argument and returns the value that results when the argument is multiplied by 5. Define a method hund_times, which takes and argument and returns the result of that argument being multiplied by 100. Define a method div_seven which takes an argument and returns the result of that argument div...
[ { "docid": "3a19a8c85948cd5515e67c97a95f0ea0", "score": "0.6801128", "text": "def five_times(num)\n return num*5.0\nend", "title": "" } ]
[ { "docid": "ee8a25c7314361a37f537f8b04e23c1a", "score": "0.71229875", "text": "def hund_times(number)\n number * 100\nend", "title": "" }, { "docid": "769d9b8c91c39db7accaef0fe1259a0a", "score": "0.69903165", "text": "def number_mangle(number)\n five_times(number) + hund_times(...
cb9c5ece4c18225de8e85b33a3f4c310
For this errata, CCAT is not yet started, and is not expected to happen because the advisory was shipped too long ago
[ { "docid": "cfb73b4b72294dcdc4eabed6b339a9b4", "score": "0.6623824", "text": "def ccat_old_not_started_errata\n Errata.find(11129)\n end", "title": "" } ]
[ { "docid": "3923fb43024fca8ef89f016cd6181aa5", "score": "0.6535561", "text": "def ccat_not_started_errata\n Errata.find(20044)\n end", "title": "" }, { "docid": "7df72dbd31e18dce42393e67779b8925", "score": "0.5579566", "text": "def setup_cutin\n return unless PONY::ERRNO::chec...
71ed9485390ba0ed96dc3001e722c166
Add a callback for stanza with type='chat'. These stanza are normally not broadcasted to all room occupants but are some sort of private messaging.
[ { "docid": "1acf0eddd486d93e745ba1a7998eff19", "score": "0.4849216", "text": "def add_private_message_callback(prio = 0, ref = nil, &block)\n @private_message_cbs.add(prio, ref, block)\n end", "title": "" } ]
[ { "docid": "660a737924d5d668adabfe3e2ab2a3bf", "score": "0.63299185", "text": "def on_message_chat(pipe, stanza)\n params = {:xmlns => 'message:chat', :to => stanza.from.to_s, :from => stanza.from.to_s, \n :id => stanza.id, :body => stanza.body}\n AgentXmpp.logger.info \"R...
8160ba6bf7429ca2aed0853330f38e9e
all of our valid players we allow
[ { "docid": "48ee7653f99c1733226d2aff06734c2e", "score": "0.5879538", "text": "def initialized_players\n Player.all\n end", "title": "" } ]
[ { "docid": "8f17d5d9a6d3414db09dd35ec309e392", "score": "0.7198019", "text": "def eligible_players\n\t\t\treturn @players.select {|player| !player.has_lost}\n\t\tend", "title": "" }, { "docid": "1f066b641da4099fc36e3de8c389ec1e", "score": "0.71521825", "text": "def validate_players(p...
8b31c9eda7a191c3c9e4c20033cb0248
add_write_handler($re, $code_ref) Allow the user to add their own matches and handlers to the write() method.
[ { "docid": "1dda6d3021b0aa81eb73c86b4f296f5e", "score": "0.8956624", "text": "def add_write_handler(regexp, code_ref)\n # return unless ref $_[1] eq 'CODE';\n\n @write_match.push([regexp, code_ref])\n end", "title": "" } ]
[ { "docid": "983e68b56849a9afd93724bb11b2bedc", "score": "0.57216924", "text": "def write_Handler(write)\n\texpr = write.branches[0]\n\ttypeExpr = expression_Handler(expr)\n\tif (typeExpr != :CANVAS)\n\t\tputs \"WRITE ERROR: the expression given must be a canvas.\"\n\t\treturn 1\n\tend\n\treturn 0\nend",...
cbdb8cd518f486a21ae25dcb82b81e47
DELETE /featured_blocks/1 DELETE /featured_blocks/1.json
[ { "docid": "ff2c658d7c0ea511f125ec70c2c3b742", "score": "0.79577017", "text": "def destroy\n @featured_block.destroy\n respond_to do |format|\n format.html { redirect_to featured_blocks_url, notice: 'Featured block was successfully destroyed.' }\n format.json { head :no_content }\n en...
[ { "docid": "ba910e4c9336337831edcaa958364da1", "score": "0.7447341", "text": "def destroy\n @block.destroy\n respond_to do |format|\n format.html { redirect_to blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bfa8ae1e971f57f252a3344...
45c28ba6a2ab475c6f7610ac27cfc609
DELETE /questionnaire_settings/1 DELETE /questionnaire_settings/1.xml
[ { "docid": "034933a1b6c525b8a70a0f9b85e0852c", "score": "0.75749624", "text": "def destroy\n\t@questionnaire_setting = QuestionnaireSetting.find(params[:id])\n\t@questionnaire_setting.destroy\n\n\trespond_to do |format|\n\t format.html { redirect_to(questionnaire_settings_url) }\n\t format.xml { head ...
[ { "docid": "7229c60682990f3d3be858827de9db99", "score": "0.6731679", "text": "def destroy\n @questionnaire = Questionnaire.find(params[:id])\n @questionnaire.destroy\n\n respond_to do |format|\n format.html { redirect_to questionnaires_url }\n format.xml { head :ok }\n end\n end"...
be8d5fd07572718b5c900f1d820db9dc
Mapping of node modules and names
[ { "docid": "c92b7478e1a2dad8f69751c3565a9b8f", "score": "0.0", "text": "def all\n @modules ||= []\n end", "title": "" } ]
[ { "docid": "2cc43a9fe94a59dac0ecca6a74468c4d", "score": "0.66286576", "text": "def dependency_mapping(node)\n mapping = {}\n dependencies_on_system(node).each do |n, deps|\n deps.each do |dep|\n mapping[dep] ||= []; mapping[dep] << n\n end\n end\n mapping\n end", "title...
a30b41b183f5b2b7339182a0e5b1ffe9
Use callbacks to share common setup or constraints between actions. def set_teacher
[ { "docid": "2f9ca260531f69ce5257d7ac13306176", "score": "0.0", "text": "def set_university\n @university = University.find(params[:university_id])\n end", "title": "" } ]
[ { "docid": "17baad9d948e3717a8dc36399b1b66f2", "score": "0.7149456", "text": "def set_teacher\n @teacher = Teacher.find(session[:teacher_id])\n end", "title": "" }, { "docid": "17baad9d948e3717a8dc36399b1b66f2", "score": "0.7149456", "text": "def set_teacher\n @teacher =...
78423107ceec776daaa1be0a6640ab60
upcoming shows, grouped by week, semester, others
[ { "docid": "a968ebd6015354e0ba1df6ed8f228072", "score": "0.68851286", "text": "def index\n\t\t@page_name = \" - Upcoming Shows\"\n\t\t@page_header_title = \"Upcoming Shows\"\n\t\t\n\t\t@shows = Show.future\n\t\t@this_week = @shows.select{|s| s.this_week?}\n\t\t@this_semester = (@shows - @this_week).sele...
[ { "docid": "9050bcb603c7876e93cc3f749dd48ce4", "score": "0.655202", "text": "def upcoming_by_week_and_day(visits)\n visits = visits.select {|visit|\n visit.scheduled_for >= Date.today.beginning_of_week }\n\n data = {}.tap do |skeleton|\n weeks = (0..1).map {|x| Date.today.beginning_of_we...
fa46e38a6a50acfbd8a1aa57962231d4
returns a gateway instance unless there is one assigned globally from the environment files
[ { "docid": "5a698b0e847168eda62ff8fc3981a097", "score": "0.6435687", "text": "def gateway(a_config_file_name=nil)\n unless @@gateway\n payflow_pro_config = config(a_config_file_name)\n gw = ActiveMerchant::Billing::PayflowGateway.new({\n :login => @@payflow_pro_login,\n ...
[ { "docid": "219265668559e761903252aa1ddf226a", "score": "0.71850437", "text": "def delivery_gateway\n super ||\n static_gateway && \"::StaticGateway::#{static_gateway}\".safe_constantize&.new\n end", "title": "" }, { "docid": "0dcd39119fecf4fae330dfd7d76f01ed", "score": "0.69364...
1a5d3809ad6f4d12925061534c895edd
GET /adhocs/1 GET /adhocs/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "4a4466eba715e0567a8e29964717ec3a", "score": "0.7033604", "text": "def index\n @adhocs = Adhoc.all\n end", "title": "" }, { "docid": "7330d63dd366edb32636da278c788dad", "score": "0.65259933", "text": "def index\n @apidocs = Apidoc.all\n end", "title": "" }, ...
6db03064c6f4e184fc07c339d7ccc155
Returns an array of visible columns
[ { "docid": "0fb3bb22614500a477e489ed6f606673", "score": "0.8017974", "text": "def get_columns_visible\n if columns\n return JSON.parse columns\n else\n return []\n end\n end", "title": "" } ]
[ { "docid": "39a3be2afe209479f1b47a4239515e66", "score": "0.75193614", "text": "def visible\n lines.map { |line| columns(line) }\n end", "title": "" }, { "docid": "96d3af509eb599d44ec5c203c0d9d222", "score": "0.7189329", "text": "def columns\n return @columns if @colu...
39e1c5b89fd4455bc08b64dd26bce252
Authorize user with his google (openid) account
[ { "docid": "4447302fcaa6764b448184b0473e1154", "score": "0.7216719", "text": "def google\n oauthorize \"Google\"\n end", "title": "" } ]
[ { "docid": "a204b29ac7bf5eedcccb853ee8634247", "score": "0.763134", "text": "def login_openid_google\n begin\n oidreq = consumer.begin(GOOGLE_OID_URI)\n rescue OpenID::OpenIDError => e\n flash[:error] = t('openid.provider_discovery_failed', provider_url: google_oid_url,\n ...
1e7d91825ad5532ade0c9b8970f08990
these are private for the user. as in only available for that user.
[ { "docid": "f83c89eba1318f895843870a580541a3", "score": "0.0", "text": "def home_timeline(pages = 1, &blk)\n multi = EventMachine::Synchrony::Multi.new\n Array(1..pages).each do |page|\n conn = connection(\"1/statuses/home_timeline.json?page=#{page}&count=200\")\n multi.add(page,...
[ { "docid": "d129cc756661d2db1b6e7ead9a68728c", "score": "0.7343782", "text": "def in_private; end", "title": "" }, { "docid": "bba0d99d8049a28f5bceab16ef497fa0", "score": "0.7201979", "text": "def privacy; end", "title": "" }, { "docid": "d11da73d7a741de16ef5e4fb4157a01a"...
39e7adffa539783c05d53fea22170591
Building Form Defaults from Table 4.2 in Achieving the 30% Goal: Energy and Cost Savings Analysis of ASHRAE Standard 90.12010 aspect ratio for NA repaced with floor area to perimeter ratio from prototype model
[ { "docid": "5ce8876d8d6db7f6c615c6f9e886b124", "score": "0.72889954", "text": "def building_form_defaults(building_type)\n\n hash = {}\n\n # calculate aspect ratios not represented on Table 4.2\n primary_aspet_ratio = calc_aspect_ratio(73958.0,2060.0)\n secondary_aspet_ratio = calc_aspect_ra...
[ { "docid": "ecfa9d7b27a80cc3edadd377c9fb4de7", "score": "0.7210697", "text": "def building_form_defaults(building_type)\n hash = {}\n\n # DOE Prototypes\n\n # calculate aspect ratios not represented on Table 4.2\n primary_footprint = 73958.0\n primary_p = 619.0 # wrote measure using calcu...
f009d91fef75a4c68bf356dc19e37538
show list of blended malt Scotch whiskies
[ { "docid": "d11a7c5fc174ae65431bcbd830f65308", "score": "0.78449637", "text": "def scotch_blended_malt\n puts \"Let's explore blended malt Scotch whiskies\"\n #call method to list whiskies for this particular type\n list_whiskies('c/309/blended-malt-scotch-whisky?filter=true&rfdata=~size.76#pro...
[ { "docid": "84c415d5593c35be706d9f10abd4a55b", "score": "0.7673178", "text": "def scotch_blended\n puts \"Let's explore blended Scotch whiskies\"\n #call method to list whiskies for this particular type\n list_whiskies('c/304/blended-scotch-whisky?filter=true&rfdata=~size.76#productlist-filter'...
698a589351b1d99f18925d69faf2d528
GET /rencontres/1 GET /rencontres/1.json
[ { "docid": "af77592e58e36874dfa9d51aaf5743ef", "score": "0.6637761", "text": "def show\n @rencontre = Rencontre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @rencontre }\n end\n end", "title": "" } ]
[ { "docid": "ce97c0ec09002da45135ad65feee595d", "score": "0.6643855", "text": "def index\n @residenciais = Residencial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @residenciais }\n end\n end", "title": "" }, { "docid": "782849...
073caa585c8368113b747bf6a13bbd8d
Set items by DB
[ { "docid": "f47fd22c37bd204464a5afe88558b482", "score": "0.0", "text": "def ___init_form(cdb)\n cdb[:group].each do |gid, gat|\n sg = @disp_dic.add_grp(gid, gat[:caption], nil, gat[:rank])\n ___init_member(cdb, gat[:members], sg)\n ___init_unit(cdb, gat[...
[ { "docid": "7d807132cf956c7f411a9604eaea626c", "score": "0.65873", "text": "def set_items\n @item = Item.find(params[:id])\n end", "title": "" }, { "docid": "8cc20b5b73b0057b3adff0f2db280fc3", "score": "0.6579399", "text": "def assign(model, items)\n model[name] ||= { 'd...
7623c01e59833e5cd73c9ac6d71586d7
Find a value in this Row by its header
[ { "docid": "2eaa4bdf1d7c91c96f9ed6a2370fb429", "score": "0.7095121", "text": "def value_by_header( header )\n self[ getref( header ) ]\n end", "title": "" } ]
[ { "docid": "489c6d9764e5a820eb033876177cbfbb", "score": "0.84355205", "text": "def get_value_by_header(header, row)\n return unless @header_row_terms.include?(header)\n value = row[@header_row.find_index(header)]\n return value\n end", "title": "" }, { "docid": "8ce706373187f909226...
1428ef9a905f7ebfffb17bfa406b141f
Searches for Access Token record with `:refresh_token` equal to `:previous_refresh_token` value.
[ { "docid": "a1cc42fae8ea5cb4c16e28729384047a", "score": "0.6404324", "text": "def old_refresh_token\n @old_refresh_token ||= self.class.by_previous_refresh_token(previous_refresh_token)\n end", "title": "" } ]
[ { "docid": "d2975aa7a5015532251b40c9953143d8", "score": "0.7660979", "text": "def by_previous_refresh_token(previous_refresh_token)\n find_by(refresh_token: previous_refresh_token)\n end", "title": "" }, { "docid": "b667debebd44457e0b0d7598ea736b64", "score": "0.61158544", ...
4786ebe11f5807e38ced02e8edac2826
Checks if the game ended in a tie A tie if the board is full but no one has won
[ { "docid": "0d6cca871cc0176f832f6ed4723021cc", "score": "0.0", "text": "def draw?\n @board.full? && !won?\n end", "title": "" } ]
[ { "docid": "ce2c03e838bba8a7146f5d499b305816", "score": "0.8292565", "text": "def tie?\n !win? && board.full?\n end", "title": "" }, { "docid": "bd825081073f45963eb978967f890516", "score": "0.8130491", "text": "def tie?\n # checks if board is full and no win\n @grid.flatten...
e9a0aae3a94a4967915982ac48fe6be1
Print a line of whitespace to clear out previous artefacts
[ { "docid": "6261248c566e458f5e41085ad24496a5", "score": "0.8089996", "text": "def clear_line\n print \"\\r%s\\r\" % ' ' * columns\n end", "title": "" } ]
[ { "docid": "9c35fc20f94afdafe70157e70e73985b", "score": "0.80068916", "text": "def clear_line; print \"\\e[2K\" end", "title": "" }, { "docid": "091849174b278d966b0270944fbd071e", "score": "0.7764718", "text": "def clear_line\n puts \"\\e[0A\\e[0G\"\n end", "title": "" ...
051ec021dde1ef7195d995d9292a153c
Generate the documentation using +Yard+.
[ { "docid": "84562c73202ac5b208a650033c586ee7", "score": "0.86838514", "text": "def generate_documentation\n croak 'Generating documentation'\n\n invoke :yard\n end", "title": "" } ]
[ { "docid": "f3a7ddc0a6dfa8337087387ab2f8c9ba", "score": "0.71758336", "text": "def generate_yardoc(includes, yardoc_db)\n system(\"yardoc --db #{yardoc_db} --no-output --no-api --no-private #{includes.join(' ')}\")\nend", "title": "" }, { "docid": "a88d1e0cb406c4c78d8ed105338bc3e8", "sc...
e1e7394e54cbb428003ec7496ce36213
Set/Update the email for a user.
[ { "docid": "6eaf19ced4ba48ca311e2604551e8c96", "score": "0.814727", "text": "def set_user_email(user_id, email)\n try_operation(__method__, user_id, email)\n end", "title": "" } ]
[ { "docid": "4d6a53da09e6f86e768ecaf8d3e35165", "score": "0.8257827", "text": "def user_email=(value)\n @user_email = value\n end", "title": "" }, { "docid": "4d6a53da09e6f86e768ecaf8d3e35165", "score": "0.8257827", "text": "def user_email=(value)\n ...
55d0946c8474ccf8dab76327e433f8fb
Determine if a string of text is sciency or not. Currently not very sophisticated.
[ { "docid": "19e111ab2d9c400d5062544a754e7e20", "score": "0.8643482", "text": "def is_sciency?(text)\n !text.downcase.match(/scien|logy|sophy|tech|comput|pokemon/).nil?\n end", "title": "" } ]
[ { "docid": "bc07dd49f5819af9d3ef86c2787443c4", "score": "0.6848853", "text": "def obscene?(text)\n text.include?(\"obscenities\")\nend", "title": "" }, { "docid": "bc07dd49f5819af9d3ef86c2787443c4", "score": "0.6848853", "text": "def obscene?(text)\n text.include?(\"obscenities\")\...
1d645b3c9492c2bb8d8ddb7ad1444ece
Gather all directories which supposedly contain PDFs
[ { "docid": "f3325ab1863c2ce0fa6ce4099f532889", "score": "0.0", "text": "def gather_working_dirs(dir)\n working_dirs = []\n # gather all directories within <dir>\n Dir.foreach(dir) {|d| working_dirs << \"#{dir}/#{d}\" if valid_working_dir?(dir, d) }\n return working_dirs\n end", "title":...
[ { "docid": "9b1de581a40e369fa598635ab1aded49", "score": "0.7476957", "text": "def get_pdf_files\n\t\tfolder = @folder_name.gsub(\"_\", \" \")\n\t\tfolder_name = extract_dir + \"#{folder}\"\n\t\tfiles = Dir.glob(\"#{folder_name}/*\")\n\t\tstore_pdf_file(files)\n\tend", "title": "" }, { "docid...
0b37bde8d532918ad7af2e80c9c0db28
Red light Returns Pin
[ { "docid": "2d532e14636c87f71db3b263d9115540", "score": "0.6436203", "text": "def red(pin_number = 4)\n @red ||= GPIOConfiguration.access_class.new(GPIOConfiguration.pin_conf(pin_number))\n end", "title": "" } ]
[ { "docid": "4f59376d81befb81f3af7d20daf8104f", "score": "0.65477586", "text": "def color\n @lightPhases[@pulseStep]\n end", "title": "" }, { "docid": "3097936b959dd17a603704c8695262b2", "score": "0.65399975", "text": "def white_light\n temperature(100)\n end", "ti...
1dc3cce36df5aea4ab40d23c0e797bd5
Appends user to the list of current followers.
[ { "docid": "fbef085762180c9402e022a835049dd6", "score": "0.8117951", "text": "def add_follower(user)\n @followers.push(user)\n end", "title": "" } ]
[ { "docid": "c542ce35df09d7c07b3addf6c436edba", "score": "0.82626015", "text": "def followUser(userToFollow)\n @followers << userToFollow\n end", "title": "" }, { "docid": "08f0de1dc8eb4ad7f588e9a4f9640f3c", "score": "0.8250306", "text": "def add_follower(user)\n @fol...
21026ffc7a7e477533619584977f5cd0
Retorna un bool indicando si el empleado esta en vacaciones, con permiso, o con licencia.
[ { "docid": "97a58880a831e3f560283b8d3b3400a4", "score": "0.0", "text": "def is_on_vacation?(date=Time.current)\n Vacation.is_on_vacation?(self.id, date)\n end", "title": "" } ]
[ { "docid": "12ede7400f01e10dfe1579806dc40f23", "score": "0.69808626", "text": "def vacio\r\n #Retornara 'true' si lo esta y retornara 'false' si no lo esta\r\n return @estructura.empty?\r\n end", "title": "" }, { "docid": "12ede7400f01e10dfe1579806dc40f23", "score": "0.6...
1abf9bb8de3d954cc3382a922c77a931
Acknowledge the transaction to Alipay. This method has to be called after a new apc arrives. Alipay will verify that all the information we received are correct and will return ok or a fail. Example: def ipn notify = AlipayNotification.new(request.raw_post) if notify.acknowledge ... process order ... if notify.complete...
[ { "docid": "4e6954c67aa33946666900e9408bfc1c", "score": "0.69097966", "text": "def acknowledge\n raise StandardError.new(\"Faulty alipay result: ILLEGAL_SIGN\") unless verify?\n true\n end", "title": "" } ]
[ { "docid": "6e7464c9a042808ff011f33bcc3952bf", "score": "0.7551942", "text": "def acknowledge(authcode = nil)\n payload = raw\n\n uri = URI.parse(Sinopac.notification_confirmation_url)\n\n request = Net::HTTP::Post.new(uri.path)\n\n request[\"Content-Length\"] = paylo...
ed626fcecb7db25d9fa410c062fa0027
Removes a node from the tree.
[ { "docid": "acb01bc5e66f80db583127f6f8d8d566", "score": "0.0", "text": "def delete(z)\n y = (z.left.nil? || z.right.nil?) ? z : successor(z)\n x = y.left.nil? ? y.right : y.left\n x.parent = y.parent\n\n if y.parent.nil?\n @root = x\n else\n if y == y.parent.left\n y.pare...
[ { "docid": "71185146bc38347cb0c51806cf30e08f", "score": "0.79527366", "text": "def remove_node(node) \n\n end", "title": "" }, { "docid": "6ce311d98b025e0387f6321b02f4d8c2", "score": "0.7944967", "text": "def remove_node( node )\n\t\t@nodes.delete( node.object_id )\n\tend", "tit...
e84e06488537738e6462f90158cc9da3
Updates the ID of the test case ==== Attributes +tcid+ TC ID
[ { "docid": "26cb0a9bdd80cda2ac2a9fc4405ffccf", "score": "0.74172384", "text": "def setTCID(tcid)\n\t\tlogger.info \"Update TCID from '#{@id}' to '#{tcid}'.\"\n\t\t@id = tcid;\n\t\t@dtr.title = {:name => @id, :title => @title};\n\tend", "title": "" } ]
[ { "docid": "11fc33fa2eee0c1dc682c28b59c87c51", "score": "0.6923254", "text": "def update(testcase_input, id)\n\t\t@testcase = Testcase.find(id)\n\t\tinput = {}\n\t\tinput[\"name\"] = testcase_input[\"name\"]\n\t\tinput[\"path\"] = testcase_input[\"className\"]\n\t\tinput[\"status\"] = testcase_input[\"s...
bb53b2312960e0192c689ef48ec21eca
Generates a generic page title. Prepend +title+ with "gbchaosmaster" and a pipe for separation. If +title+ is blank, simply return "gbchaosmaster". page_title "Test Page" => "gbchaosmaster | Test Page" page_title nil => "gbchaosmaster"
[ { "docid": "e6d69f8ec4477425eb0c834425411071", "score": "0.8203214", "text": "def page_title(title)\n \"gbchaosmaster#{\" | #{title}\" unless title.blank?}\"\n end", "title": "" } ]
[ { "docid": "36fcd77113cd94ec0133861de908990f", "score": "0.7925586", "text": "def gen_title(page_title)\n puts @me.valid_user?\n if !@me.valid_user?\n site_title=\"Delta Kappa Epsilon - Sigma Tau\"\n else\n site_title=\"DKE Server\"\n end\n if (page_title!=\"\")\n return \"...
e6e4eac6c30f7dda783f9663342bc90f
check_all_installed check_all_packages This method calls check_package for each package in the list defined in the Constants file
[ { "docid": "1d28757a37139c69fa6ad3dbb1f19a58", "score": "0.8379973", "text": "def check_all_packages\n packages_not_installed = []\n Constants::PACKAGES.each do |pkg|\n string = \"Looking for package #{pkg}...\"\n installed = check_package(pkg)\n installed ? string << green(\"Found\...
[ { "docid": "70f3e653c93d8177b254f3dc0f611be5", "score": "0.66251284", "text": "def read_facts_packages_installed(packages)\n packages_installed = {}\n packages.each do |package, opts|\n packages_installed[package] = check_package_installed(package, opts)\n end\n\n packages_installed\nend", "t...
ebb02bda47ec5abf9923dd33fe238618
Sets the wirelessDisplayBlockProjectionToThisDevice property value. Indicates whether or not to allow other devices from discovering this PC for projection.
[ { "docid": "e98baa1fdad49482a85a29b9c454295e", "score": "0.76976144", "text": "def wireless_display_block_projection_to_this_device=(value)\n @wireless_display_block_projection_to_this_device = value\n end", "title": "" } ]
[ { "docid": "03e3b132c0c35ce7724ab0240866b25f", "score": "0.6915055", "text": "def wireless_display_block_projection_to_this_device\n return @wireless_display_block_projection_to_this_device\n end", "title": "" }, { "docid": "d81d563398817c55c57fb5b00189be73", "s...
4a2a8050dbbf4b4580f90675747ec316
POST /responses POST /responses.xml
[ { "docid": "02c0f699fda7ce64b74584b8c24ad50b", "score": "0.0", "text": "def create\n\n # long way of adding a new response to a form (create then append to form model)\n # as redirecting back to the form will cause errors with half built appended objects\n @form = Noodall::Form.find(param...
[ { "docid": "224ecea9a32ef6684b9548cb895418d4", "score": "0.66405493", "text": "def create\n @question = Question.find(params[:question_id])\n @response = @question.responses.new(params[:response])\n\n respond_to do |format|\n if @response.save\n format.xml { head :ok }\n for...
33d46df5177e73c2271158dba443167c
Travel up the ancestry trees finding orphaned collections
[ { "docid": "76bf347745205fb56359417707b65b68", "score": "0.6090292", "text": "def orphaned_ancestors(nodes = parents)\n orphans = nodes.select { |node| node.parents.none? }\n parent_nodes = (nodes - orphans).map(&:parents).flatten\n orphans += orphaned_ancestors(parent_nodes) ...
[ { "docid": "f7707779e9f4e72ea08ac362a0ab3136", "score": "0.65682364", "text": "def roots\n self.find(:all, :conditions => \"(#{acts_as_nested_set_options[:scope]} AND #{acts_as_nested_set_options[:parent_column]} IS NULL)\", :order => \"#{acts_as_nested_set_options[:left_column]}\")\n en...
2523553c9e2f301b92adb5c773b68a60
GET /orderlogs/1 GET /orderlogs/1.json no real need for a show index shows everything needed. def show end GET /orderlogs/new audit log not to be created by a person manually def new
[ { "docid": "eb43effaf67a0f84c494f1dac4c80308", "score": "0.6441329", "text": "def create\n @orderlog = Orderlog.new(orderlog_params)\n\n respond_to do |format|\n if @orderlog.save\n format.html { redirect_to @orderlog, notice: 'Orderlog was successfully created.' }\n format.json...
[ { "docid": "50eb7c6428833e11d3b37c281696b75f", "score": "0.7071602", "text": "def new\n\t\t@log = Log.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @log }\n\t\tend\n\tend", "title": "" }, { "docid": "603f386e54c791baebdbcbb855d8ed34", ...
4dadc1d669c5707eddc177eaa37cca45
Is the Pokemon type ghost ?
[ { "docid": "00dc01f728969e3f433b9c18a4511855", "score": "0.8266288", "text": "def type_ghost?\n return type?(GameData::Types::GHOST)\n end", "title": "" } ]
[ { "docid": "131bfb086b1131311222e6d4da75415e", "score": "0.68394667", "text": "def type_poison?\n return type?(GameData::Types::POISON)\n end", "title": "" }, { "docid": "1e09442d87d20ad14754320a8c6e8702", "score": "0.66546947", "text": "def nice_place_for_tower? ghost\n ...
d833837570b4da50ac43b8d18319107b
Scan the command line args and remove the named one. Values can be specified either in the next argv element or in the same element after an equals sign.
[ { "docid": "d333adbc2ea55602f37d6a0fc7e8ca21", "score": "0.6265764", "text": "def extract_option_value!(name)\n value = nil\n ARGV.each_with_index do |option, index|\n if option == \"--#{name}\" || option.start_with?(\"--#{name}=\")\n option_index = index\n if option.include?(\"=\")\n ...
[ { "docid": "33662b3c466f09840dc877fb5daa3c9e", "score": "0.73101217", "text": "def remove_argument(*names)\n options = names.last.is_a?(Hash) ? names.pop : {}\n\n names.each do |name|\n arguments.delete_if { |a| a.name == name.to_s }\n undef_method name, \"#{name}=\" if o...
05b702a91896ac374fbc118051cf7bf6
================================================= ======================== USER Function =========================
[ { "docid": "38022bd94c207e779babd0bb1986bc24", "score": "0.0", "text": "def user_update\n _user = current_client\n _user.mot_de_passe = params[:mot_de_passe]\n _adresse = client_adresse\n _adresse.update_attributes(adress_params)\n render json: _adresse\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.7878344", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.6750537", "text": "def probers; end", "title": "" }, { "docid": "65ffca17e416f77c52ce148aeafbd826", ...
fe73a82e286a3413875ff20df3f8bf83
GET /receita GET /receita.json
[ { "docid": "c6a61decef5564bc406ae71e983cbc05", "score": "0.0", "text": "def index\n if logged_in? && (current_user.cliente.estoque_mp == \"Sim\") && (current_user.nivel_usuario == \"admin\")\n @receita = Receitum.where(cliente_id: current_user.cliente_id)\n else\n redirect_to root_path\n...
[ { "docid": "f372f104952d7e8a32d03b5cbe22d310", "score": "0.6822765", "text": "def index\n @repas = Repa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @repas }\n end\n end", "title": "" }, { "docid": "c9952ee4dc2f7c4619fc0fd3fd4...
97e26ed2d5d25ac80df8d8092d4940fb
DELETE /ai_logs/1 DELETE /ai_logs/1.json
[ { "docid": "2ad3487cb9b3a0ddc1899a91c92802f0", "score": "0.77032334", "text": "def destroy\n @ai_log.destroy\n respond_to do |format|\n format.html { redirect_to ai_logs_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "42f800db7b21a39d2ed9065dd7e38af5", "score": "0.71032655", "text": "def destroy\n @log = @client.logs.find(params[:id])\n @log.destroy\n\n respond_to do |format|\n format.html { redirect_to(client_url(@client)) }\n format.xml { head :ok }\n end\n end", "title": "" ...
73bdb23fa49c0052dc9da9dd3fe0812a
Returns +true+ if this event's line segment is above the point +p+.
[ { "docid": "d2f992da158b2a8da7fd30d377cf5629", "score": "0.72479117", "text": "def above?(point)\n !below?(point)\n end", "title": "" } ]
[ { "docid": "e15890ded7380cc409ae643c8a21c54e", "score": "0.72078174", "text": "def below?(p)\n if left\n Algorithms.ccw(@point, @other_event.point, p) > 0\n else\n Algorithms.ccw(@other_event.point, @point, p) > 0\n end\n end", "title": "" },...
02e9e5f872449fdfc11562d1b1ac04e7
List of all services
[ { "docid": "1c5d75e84e2317492145a39e17a7f8d8", "score": "0.0", "text": "def index\n @groups = Group.order(:name)\n @services = filter_services(params[:search])\n @services = sort_results(params, @services)\n @services = @services.paginate(:page => params[:page], \n :per_page =...
[ { "docid": "d2b8f71bbe7e252267411f1842e942e5", "score": "0.8687839", "text": "def list\n \tservice_list.each do |service|\n puts \"=== #{service.name} on #{service.host}:#{service.port} ===\"\n puts \" #{service.description}\"\n puts \" http://#{service.host}:#{servic...
60ceb18f8e1308e17fad78808fc3841f
Delete all current project directories
[ { "docid": "4840554d60b43c187b1fbd41773520d6", "score": "0.83046424", "text": "def delete_all_projects\n FileUtils.rm_rf(Dir.glob(\"#{DIR_PROJECTS}/*\"))\nend", "title": "" } ]
[ { "docid": "4cbc56e3bf6a67a74d9444a20482d166", "score": "0.7451652", "text": "def clean\n needs_cleaning = File.exist?(project_dir)\n if needs_cleaning\n log.info(log_key) { \"Cleaning project directory `#{project_dir}'\" }\n FileUtils.rm_rf(project_dir)\n end\n create_...
36e046365493a57bfd07b931d4171832
Utility to fetch email id
[ { "docid": "8e0790d6e8c16e9485d0dda783ebb58b", "score": "0.0", "text": "def receiver \t\n \t@user_email = user_receiver_params['users'] \t\n end", "title": "" } ]
[ { "docid": "d14e33c1926877340f75641d71e1da25", "score": "0.79500026", "text": "def user_id_for_email( email )\n u = $assigned_users[\"users\"].find {|user| user[\"email_address\"] == email}\n raise \"Unknown user email #{email}\" unless u\n u[\"id\"]\nend", "title": "" }, { "docid": "db22...
324c0266a5241420665b9bd2905f20f7
Function to cancel a trip
[ { "docid": "707516b1054a4f7f2e9fcc48bd3ec351", "score": "0.7735294", "text": "def cancel_trip\n\t\t@trip = Trip.find_by(_id: trip_params[:trip_id])\n\t\tif @trip.driver === current_user.id\n\t\t\tcurrent_user.trips_driving.delete(trip_params[:trip_id])\n\t\t\t@trip.accepted_users.each do |user_index|\n\...
[ { "docid": "b99342ed4e1437dda22a95423738a4de", "score": "0.85023844", "text": "def cancel_trip\n label = request_label(:cancel, trip_id)\n \n @http_request_bundler.add(\n label, \n @url + \"/cancel_trip\", \n :delete,\n head: headers,\n query: { trip_id: trip_id, cu...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "d1a3809c57b075f02b0c7c1cf16c8776", "score": "0.0", "text": "def agreement_params\n params.fetch(:agreement, {}).permit(:body, :display, :locale, :required, :ticked_by_default, :add_to_subscribers)\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...
1491af0e132e4f561c45092591efeeb4
Freezes additions to the serializes and notifies the controller what it will be able to respond to.
[ { "docid": "36478254a2ff0861a66c633914d2d8f4", "score": "0.0", "text": "def freeze_io!(**filter_opts)\n before_action :serializer_freeze_io_internal, **filter_opts\n\n output_error MediaTypes::Serialization::NoInputReceivedError do |p, _error|\n p.title 'Providing input is mandato...
[ { "docid": "b88ee3503ddbd4d65149646f2c025027", "score": "0.5560195", "text": "def register_worker\n super\n\n puts \"Fifo Startup - Updating worker list\"\n manager.request_refresh\n end", "title": "" }, { "docid": "615aa1685146604070d1672a63daa833", "sc...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "8e9c358e786ac6896cd8557c4db44fd1", "score": "0.0", "text": "def order_params\n params.require(:order).permit(:items, :total_price, :customer_name, :address, :note, :status)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.69490993", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6812977", "text": "def strong_params\n params.require(:listing_member).permi...
e74f8f623d090b06c82c497621a5f2be
GET /auctions/1 GET /auctions/1.json
[ { "docid": "0d33a23cd68445a64536eb30c303e5e8", "score": "0.0", "text": "def show\n @current_auction_player = @auction.current_auction_player || @auction.auction_players.first\n @current_player = @current_auction_player.player\n @highest_bid = @current_auction_player.highest_bid\n if current_...
[ { "docid": "3feeb60200b23bb71111faae95775c45", "score": "0.7733469", "text": "def show\n @auction = Auction.find(params[:id])\n @bids = @auction.bids.sort_by(&:bid_at).reverse\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @auction }\...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5b2658f2ab3be2319686c07f983e6ab9", "score": "0.0", "text": "def set_booking\n @booking = Booking.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...
2035ca12518ab8b4b86d8267c8837e10
Adds the item to the ordered members so that it displays in the items along side the FileSets on the show page
[ { "docid": "17cee61e5aea01afd91aece8b75a74a5", "score": "0.0", "text": "def add2(env, id)\n member = ActiveFedora::Base.find(id)\n return unless env.current_ability.can?(:edit, member)\n env.curation_concern.ordered_members << member\n end", "title": "" } ]
[ { "docid": "ec47146461f2c0afd1b27747ebfb5e77", "score": "0.61492264", "text": "def add_item(item)\r\n items.push(item)\r\n item.owner = self\r\n end", "title": "" }, { "docid": "e41dbd9f7ae8c3db83cd3bd726966c5f", "score": "0.5960272", "text": "def show\n create_item\n...
87b5cb530c950c002773a03a6ddfd063
GET /incident_types/1 GET /incident_types/1.json
[ { "docid": "1a045412f63d96212bc7f780ec9f52a0", "score": "0.7578175", "text": "def show\n @incident_type = IncidentType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incident_type }\n end\n end", "title": "" } ]
[ { "docid": "80116c34a45ce3a25726eb83aa5de2d8", "score": "0.66720116", "text": "def index\n @insured_types = InsuredType.all\n @title = \"Types of Insured Patients\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insured_types }\n end\n ...
4d9263888f37009ef77ee341ba8c1287
Creates a deep copy of this property.
[ { "docid": "35204d8783e832b6646ddc75a9e01c93", "score": "0.661466", "text": "def deep_copy\n copy = dup\n copy.values = {}\n @values.each { |k, v| copy.values[k] = v.clone }\n copy\n end", "title": "" } ]
[ { "docid": "d4c200a98f49868e3e86e48c0ab46028", "score": "0.7844971", "text": "def deep_copy\n Marshal.load(Marshal.dump(self))\n end", "title": "" }, { "docid": "d4c200a98f49868e3e86e48c0ab46028", "score": "0.7844971", "text": "def deep_copy\n Marshal.load(Marshal.dump(s...
c817cf00a7a8b4e21c395d3f04fae6e8
Return the latest version that the site location has for the the cookbook
[ { "docid": "3bcf1a8647700b9b850cd4ccb78a0936", "score": "0.65530694", "text": "def latest_version\n conn.latest_version(name)\n end", "title": "" } ]
[ { "docid": "313feb51aaec8a5a209c290a64dda5bf", "score": "0.75879955", "text": "def latest_cookbook_version\n @latest_cookbook_version ||= sorted_cookbook_versions.first\n end", "title": "" }, { "docid": "82e8aef82f059309429f20b17e7c2efd", "score": "0.7398958", "text": "def latest...
5928556b04c4e089e3f39cd1f0cf5ba3
POST /tests POST /tests.json
[ { "docid": "4e00b23077fd8d8bb3fcc34f255ac6ca", "score": "0.0", "text": "def create\n teacher_exclusive\n @test = Test.create title: params[:title], test_date: params[:test_date], subject_id: params[:subject_id],teacher_id: @current_user.id\n\n respond_to do |format|\n if @test.save\n ...
[ { "docid": "935f41397d2070970950fcf91d906b7b", "score": "0.72139466", "text": "def v2_tests_post(test_detail, opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: TestsApi#v2_tests_post ...\"\n end\n \n # verify the required parameter 'test_detai...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "0506d3cd5563f6429317313ec94cb4e1", "score": "0.0", "text": "def artist_params\n params.require(:artist).permit(:name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
16ddfcd11837e830bebb329d0732956d
Returns an array containing all linear creatives.
[ { "docid": "46de80471458c85950cc62b14365606c", "score": "0.7059043", "text": "def linear_creatives\n source_node.xpath('.//Creative/Linear').to_a.collect do |node|\n LinearCreative.new(node)\n end\n end", "title": "" } ]
[ { "docid": "913ce2fcd2fd60b81b23d0154fed66f2", "score": "0.60534376", "text": "def non_linear_creatives\n source_node.xpath('.//Creative/NonLinearAds/NonLinear').to_a.collect do |node|\n NonLinearCreative.new(node)\n end\n end", "title": "" }, { "docid": "6f72d414e4732ad2...
6089bed2f30a75f45010b875e42e77a8
POST /jobs POST /jobs.xml
[ { "docid": "db281329444fcc433ff42406e00e2070", "score": "0.5685915", "text": "def create\n @job = Job.new(params[:job])\n\t\t@job.person = current_user\n\n respond_to do |format|\n if @job.save\n flash[:notice] = 'Job Proposal successfully created.'\n format.html { redirect_to(@...
[ { "docid": "2f56188e36cd289fb0023745a184a41b", "score": "0.6847216", "text": "def create_job xml, name\n\t\t\tputs \"==> Creating job for project: '#{name}'\"\n\t\t\tbegin\n\t\t\t\tcreate_response = RestClient.post \"#{@jenkins_host}:#{@jenkins_port}/createItem/?name=#{name}\", xml , {:content_type => :...
428ab09a9f77ef2b757556c28914931d
GET /foo54s/1 or /foo54s/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "66ccbf17c31a1d47d3a12a1560789c8d", "score": "0.6305952", "text": "def get_aos_version(args = {}) \n get(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "719f324fd7e76ace60f0d241da747193", "score": "0.6236424", "text": "def get_aos_vers...
99ff4ad9c6ed0e8d5e839ce214e1ff73
Returns an array of the field types found in the underlying hash.
[ { "docid": "96e5e62f2c18cc5f640aea3cc74c0132", "score": "0.5373522", "text": "def content_types\n self.values.collect do |hash|\n (hash || {})['type']\n end.compact\n end", "title": "" } ]
[ { "docid": "e31bf026698fcda8116700346f5618ba", "score": "0.72189933", "text": "def field_types\r\n return @field_types\r\n end", "title": "" }, { "docid": "bc4e39d31dfdb716168fbd22fe705e59", "score": "0.7093731", "text": "def types\n FIELD_TYPES\n end", "title":...
11de458ba77d7c3558d80fde2285a0fd
TODO: Add additional logic to support parsing stats for each target under an ALB
[ { "docid": "4d10ad29542c710c4b05688869ea468b", "score": "0.0", "text": "def generate_config_ApplicationELB(awsregion,awsservice)\n applicationelbinstances = Array.new\n applicationelbtargetgroupinstances = Array.new\n\n Aws.config.update({\n region: \"#{awsregion}\",\n })\n\n applicationelb = Aw...
[ { "docid": "b9bdc8e967d37c82ce369b22510515c0", "score": "0.62558436", "text": "def target_health_check\n @alb_tgs\n end", "title": "" }, { "docid": "13dfce0773301be7d89d02781da79fab", "score": "0.54294646", "text": "def describe_target_health(tg_id, target_ids = [...
700df5eb4806be096234b8c3be7125c6
POST /kiosks POST /kiosks.json
[ { "docid": "ebf3f3073697ae64d04bedd7e77c41cd", "score": "0.0", "text": "def create\n @kiosk = Kiosk.new(kiosk_params)\n\n respond_to do |format|\n if @kiosk.save\n format.html { redirect_to @kiosk, notice: 'Kiosk was successfully created.' }\n format.json { render :show, status:...
[ { "docid": "45c1b1b07947db242e0cb045dd08f7a2", "score": "0.6262737", "text": "def create\n \n @key = Key.new(key_params)\n if @key.save\n render json: @key, status: :created, location: @key\n else\n render json: @key.errors, status: :unprocessable_entity\n end\n\n end", ...
63fcbcb4c9ce8fd42a795b6576c23dd2
out the current state.
[ { "docid": "7f5123df08e3246f9a6d179dc15098a9", "score": "0.0", "text": "def display_board(board)\n a = board[0] \n b = board[1] \n c = board[2] \n d = board[3] \n e = board[4] \n f = board[5] \n g = board[6] \n h = board[7] \n i = board[8] \n puts \" #{a} | #{b} | #{c} \"\n puts \"-----------\"\n ...
[ { "docid": "7b2800cedb1d335f3cb25042620f5541", "score": "0.7593203", "text": "def out\n state.last.flatten\n end", "title": "" }, { "docid": "34a90713a0e701353e983def5d8e600e", "score": "0.7330737", "text": "def state\n output(:state)\n end", "title": "" }, { ...
2f9440428cae1fd34f920449134f125a
Builds the path for the cached file
[ { "docid": "eb4832c44f7f9a838ca9cbbf9ae56c0c", "score": "0.7856359", "text": "def cache_file_path\n raise IOError.new 'Write permission is required for cache directory' unless File.writable?(@args[:cache_directory])\n \"#{@args[:cache_directory]}/#{Digest::SHA1.hexdigest((@args[:cache_ref] || ...
[ { "docid": "e526748620079d6c6030c85b4527d309", "score": "0.77474505", "text": "def file_path\n Dir.glob(config.cache).first || File.join(File.dirname(config.cache),\n File.basename(config.cache).gsub(/_.+\\.txt/, '_0.txt'))\n end", "title": "" }, ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0b660933ed5d873eace53570cc2c971f", "score": "0.0", "text": "def message_params\n params.require(:message).permit(:playcelet_id, :invited_playcelet_id, :invited_playcelet_ids, :app_id, :type)\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...
e8e4f83532a5e46b8f1e476530be5f1f
Return the intersection of multiple sorted sets
[ { "docid": "e06278eeca6b5285e030cd8bfaf9efb8", "score": "0.0", "text": "def zinter(*args, **_arg1); end", "title": "" } ]
[ { "docid": "c0599c7c07b6cf51f9d5e395fc7cb17b", "score": "0.79458946", "text": "def set_intersection set1, set2 \n\tresult \t\t\t= [];\n\tsec_index = 0 \n\tfirst_index = 0\n\n\twhile sec_index < set2.size && first_index < set1.size do \n\t\tif set1[first_index].to_i > set2[sec_index].to_i\n\t\t\tsec_i...
ba7a341105491ac1bb99266e5cfbedf8
method to return the value of the nth element from the beginning assume indexing starts at 0 while counting to n If cant use times loop, need a count of the indices time complexity: ?? Not dependent on linked list size, but index passed in. O(n), where n = index to find space complexity: O(1) => memory allocation const...
[ { "docid": "a2d6c0b412d5a46daaf38a9ffd557eb4", "score": "0.76631725", "text": "def find_nth_from_beginning(n)\r\n # Check if the list is empty\r\n return nil if @head == nil\r\n\r\n # Keep track of current place in list, starting at head\r\n curr = @head\r\n # Iterate through the lined li...
[ { "docid": "aebc5c08db22d0c0f5c53173b5a536d5", "score": "0.77898616", "text": "def find_nth_from_beginning(n)\r\n current = @head\r\n index = 0\r\n\r\n while current != nil\r\n if index == n\r\n return current.data\r\n else\r\n current = current.next\r\n index += ...
3ed7651a6aff280ef56abc045216fa43
finds documents containing all of the specified terms. if a block is given, each document is supplied to the block, and nil is returned. Otherwise, an array of documents is returned.
[ { "docid": "6c3cec394ab79dccd333f340f03fd2f7", "score": "0.7340767", "text": "def find(*terms)\n docs = terms.inject(nil) do |d, term| \n (d || @index[term]) & (@index[term] || 0)\n end\n result = block_given? ? nil : []\n @docs.each do |name, mask|\n if mask & docs != 0\n b...
[ { "docid": "14f41913b23573fa423c81a82970e346", "score": "0.72731966", "text": "def find_by_terms(terms, options = {}, &block)\n queryAllWithTerm(terms.join(','), options, &block)\n end", "title": "" }, { "docid": "0ebaccffacbf1e864268bf8bb5e3ec02", "score": "0.7045108", "text": "...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "675fae88f9224b7b52e52f0b386c6555", "score": "0.0", "text": "def set_pro_asphalt_product\n @pro_asphalt_product = ProAsphaltProduct.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...
e45ed6521e5f2d4bed1c1ab5622f1567
returns the bundle directory within the user's folder
[ { "docid": "f36410f9d09dcf235047055b1d9b9b61", "score": "0.6772292", "text": "def bundle_src_folder\n \"bundle_src_id_\" + self.id.to_s\n end", "title": "" } ]
[ { "docid": "50a543d7f15d10cb063acb4024db875f", "score": "0.784529", "text": "def bundle_dir\n File.expand_path(File.join(Bixby.repo_path, self.relative_path))\n end", "title": "" }, { "docid": "cafac68727e4decb6631fa9554da0013", "score": "0.7786279", "text": "def bundle_directory...
7f79a8a3a56b94847a6c7fc266b3b620
returns a list of related organisms, related through either the assay or the model
[ { "docid": "025fe54dffe1485f6df22278a589faa8", "score": "0.86008537", "text": "def related_organisms\n organisms = related_assays.collect{|a| a.organisms}.flatten.uniq.compact\n organisms = organisms | related_models.collect{|m| m.organism}.uniq.compact\n organisms\n end", "title": "" } ...
[ { "docid": "ce68f60780762a9f7f01acf6efe1ee08", "score": "0.8395155", "text": "def related_organisms\n organisms = assays.collect(&:organisms).flatten\n organisms |= models.collect(&:organism).flatten\n organisms.uniq.compact\n end", "title": "" }, { "docid": "017b2def1249b52282ae70...
215da173c0c7daa0d39002dd8d33d992
Current ember path (example: convert current url ' to 'new')
[ { "docid": "7e1b0b3b86b542b037c3fbb2bc0bae64", "score": "0.7615368", "text": "def current_ember_path\n current_url.sub(/https?.+\\/#/, '')\n end", "title": "" } ]
[ { "docid": "7ee852c1bd8e12fddec3eda2f12b5a92", "score": "0.76199365", "text": "def current_path; end", "title": "" }, { "docid": "71692b5caba858e526e44b50638e5b6e", "score": "0.74060786", "text": "def current_path\n current_url.path\n end", "title": "" }, { "d...
34a221a30915352d9080821d305d90b8
POST /inventory_models POST /inventory_models.json
[ { "docid": "089cb5a273d46315fb8f1b30a65e8ce2", "score": "0.69223464", "text": "def create\n @inventory_model = InventoryModel.new(inventory_model_params)\n\n respond_to do |format|\n if @inventory_model.save\n format.html { redirect_to @inventory_model, notice: 'Inventory model was suc...
[ { "docid": "28fd88cac0ddc4b856310ce80d994640", "score": "0.6438882", "text": "def create(model)\n response = connection.post url_for(:all), model.to_json\n handle_and_unpack_response(response, 201)\n end", "title": "" }, { "docid": "bce652e924268619e970ca5c56a59b14", "score"...
0923e96a0358a53a910dc585cb0d65ab
serialize extended private key
[ { "docid": "115035046e9b3f8a273378ccedb54ce5", "score": "0.7019002", "text": "def to_payload\n Bitcoin.network[:extended_privkey_version].htb << [depth].pack('C') << parent_fingerprint.htb << [number].pack('N') << chain_code << [0x00].pack('C') << priv_key.priv.htb\n end", "title": "" } ]
[ { "docid": "3b36b425da9e4fd20be753bf755fb2f5", "score": "0.7188921", "text": "def to_private_key_s\n Key.encode_base58check(:private_key, @key.private_key.to_s(2))\n end", "title": "" }, { "docid": "0807e76c6933185e93bb8845eb77cbab", "score": "0.71076804", "text": "def to_bytes\n...
46e55898971eb31ac96a537886ceb6f7
map the sufia resource type to the ORCID resource type
[ { "docid": "edf68a10abf2dc79f11a9b5df8a81abc", "score": "0.7759177", "text": "def map_to_orcid_type( resource_type )\n\n case resource_type\n when 'Article'\n return 'journal-article'\n when 'Book'\n return 'book'\n when 'Conference Paper'\n re...
[ { "docid": "0041bb71b00921395641d47f6add3ab7", "score": "0.65746695", "text": "def remap_resource_type\n return unless is_a?(Bulkrax::CsvFileSetEntry)\n\n parsed_metadata.delete('resourceType_attributes')\n parsed_metadata['resource_type'] = raw_metadata['resourcetype']&.split(/\\s*[|]\\s*/)\n ...
78549bf00e434ef46d7b94d62d63c64e
POST /todos POST /todos.json
[ { "docid": "3658da5fff18c27d24e4a12a7d095445", "score": "0.0", "text": "def create\n begin\n if todo_params[:subject] != '' && (todo_params[:status] == 'pending' || todo_params[:status] == 'done')\n todo = Todo.new(todo_params)\n\n if todo.content.nil?\n todo.content = ''\...
[ { "docid": "ddf11f56f15a2d22de0921c10a6e9404", "score": "0.76808834", "text": "def create\n @todo = Todo.new(todo_params)\n\n if @todo.save\n render json: @todo, status: 200\n else\n render json: @todo.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { ...
08af343366ccb433026fec9f034d581b
FIXME If the next statement is not read, redirect to the next screen instead.
[ { "docid": "a309519de4e0a8193536e3ff4253f550", "score": "0.0", "text": "def check_consent\n unless current_participant.consented?\n redirect_to '/' and return\n end\n end", "title": "" } ]
[ { "docid": "93bffa341c66443d4b73351443841a20", "score": "0.6510689", "text": "def statement_next\n respond_to do |format|\n if @application.save_statement statement_params\n format.html { redirect_to applications_courses_path }\n else\n format.html { render :statement }\n ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "d05fc66858eefd5dcc0c34ef2e655f1d", "score": "0.0", "text": "def sitio_params\n params.require(:sitio).permit(:sitio_nombre)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943033", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69584733", "text": "def permitted_params\n params.permit!\n end", "title"...
583eafd6e521fee21e50342f4d9e4fab
we start from index 1 and go to the left don't use i for anything after you find the key and the j j drives everything else
[ { "docid": "6e293feb2ea831dd97ba8ebb466a935f", "score": "0.0", "text": "def insertionSort(array)\n\n\t#edge case\n\tif array.length <= 1\n\t\treturn array\n\tend\n\n\tfor i in 1..array.length-1\n\n\t\tkey = array[i]\n\t\tj = i -1\n\n\t\twhile j >= 0 && array[j] > key\n\t\t\tarray[j+1] = array[j]\n\t\t\t...
[ { "docid": "8502efedfc66c69ea36cf903bbd9760d", "score": "0.65721935", "text": "def the_keys(k)\n arr = []\n for i in 0..3\n arr << k.left(i).first(8)\n end\n arr\nend", "title": "" }, { "docid": "c103d9c08c7b21975ffafa867bf7d43c", "score": "0.6330265", "text": "def rs( ar, c...
eb86ae83b6d107728f670acb010421d1
Scrub sensitive parameters from your log filter_parameter_logging :password
[ { "docid": "9acc06c9496235671f420b2cd75e9d89", "score": "0.0", "text": "def set_users\n @user = current_user\n end", "title": "" } ]
[ { "docid": "7a54048117803b08ea1002bd771bae99", "score": "0.71179545", "text": "def filter_secrets(msg)\n case type\n when :username_password then msg.gsub(password, '****')\n else msg\n end\n end", "title": "" }, { "docid": "4090378d23d7b03c053a48f1971877ee", "scor...
4e197f9c5f68e8bba6b79e39547ae99b
DELETE /messages/1 DELETE /messages/1.xml
[ { "docid": "b120a3b6d00043cdc991e8038c763806", "score": "0.0", "text": "def destroy\n @message = Message.find(params[:id])\n if @message.destroy \n flash[:notice] = \"Message deleted\"\n else\n flash[:notice] = \"Message could not be deleted\"\n end\n redirect_to(:action => \"in...
[ { "docid": "efdc03b89be3359a1849efdd9e755f83", "score": "0.7609453", "text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ee3b36d94e9fa9123f5e7ac28e6d702...
deb2d61042f32c3938e4ea026876251c
POST /properties POST /properties.json
[ { "docid": "5099175af0b83d712beb767129ad6cf7", "score": "0.6767272", "text": "def create\n @property = current_customer.properties.new(params[:property])\n\n respond_to do |format|\n if @property.save\n format.html { redirect_to customer_path(current_customer), notice: 'Address was suc...
[ { "docid": "5e751868e6fa9a7d22774d588f831615", "score": "0.7452886", "text": "def create\n @property = current_user.properties.new(property_params)\n\n if @property.save\n render json: @property, status: :created, location: @property\n else\n render json: @property.errors, status: :un...
4ab213aba745dff8f8293f1b4d9aab3a
GET /reminders/1 GET /reminders/1.json
[ { "docid": "ab6cc3888dacfbe506e0a2ad8ce9e5c9", "score": "0.0", "text": "def show\n if request.headers['X-PJAX'] \n render :layout => false\n elsif request.xhr?\n render :layout => false\n else\n render :layout => \"folder\"\n end\n end", "title": "" } ]
[ { "docid": "3966fb1f4f6f3f95ac850351ebf97ff1", "score": "0.7654919", "text": "def show\n @reminder = Reminder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reminder }\n end\n end", "title": "" }, { "docid": "3966f...
dde62ac0ef03221f09b531d1be9e9d08
Format data as string
[ { "docid": "985e8f234e734b9f84ef0673f5ee0f2b", "score": "0.6986413", "text": "def format_str(field, data)\n if @columns[field]\n @columns[field][:left] ? minus = '-' : minus = ''\n size = @columns[field][:size]\n\n if @columns[field][:adjust]\n ...
[ { "docid": "0ae12dd48e1b8ed3ddf93e0cb1afd5d4", "score": "0.75777406", "text": "def format_data(format, data, options)\n return \"\" if data.blank?\n \n case format\n when :text\n return data\n when :number\n return cnu(data, 0)\n when :number_no_format\n return data\n ...
9e17fbfa65c8be3b1d8d69b757994c07
gets BASIC auth info
[ { "docid": "10d6608d704af8ff75969cd81119edf9", "score": "0.75400066", "text": "def get_auth_data\n auth_key = @@http_auth_headers.find { |h| request.env.key?(h) }\n auth_data = request.env[auth_key].to_s.split unless auth_key.blank?\n auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_...
[ { "docid": "1cce6cb690641bf15d7044c94222aff1", "score": "0.77850956", "text": "def get_auth_data \n auth_data = nil\n [\n 'REDIRECT_REDIRECT_X_HTTP_AUTHORIZATION',\n 'REDIRECT_X_HTTP_AUTHORIZATION',\n 'X-HTTP_AUTHORIZATION', \n 'HTTP_AUTHORIZATION'\n ].each do |key|\n i...
1d78ad229a8a4beebd7eca55cb7163c4
speaking method barks woof when method is called
[ { "docid": "9120403176461a78d797b7d97f46cc89", "score": "0.0", "text": "def speak(num)\n num.times{|x| puts \"Woof!\"}\n end", "title": "" } ]
[ { "docid": "2d8d9f0527a44cd0febc5d6cbb3a22f2", "score": "0.66576767", "text": "def weber; end", "title": "" }, { "docid": "61d9ba9472dee59f7ac1018d4bdc63ce", "score": "0.6622352", "text": "def bang!\n \"bang!ed method\"\n end", "title": "" }, { "docid"...
f3fedd6c2a185eedf93a95d1060e6b40
Determine if the current node is DragonFly BSD.
[ { "docid": "cd1f0df3ee00ea9b3e4ea9aaac6ee1cd", "score": "0.75813144", "text": "def dragonfly_platform?(node = __getnode)\n node[\"platform\"] == \"dragonfly\"\n end", "title": "" } ]
[ { "docid": "89a9c08af43371beeaf36a383b39c7ec", "score": "0.8581348", "text": "def dragonflybsd?(node = __getnode)\n node[\"platform_family\"] == \"dragonflybsd\"\n end", "title": "" }, { "docid": "f2e564d862f415373ae06ee049586363", "score": "0.7823759", "text": "def netbs...
38d10885be87117a734962a91630d4aa
Custom Fields list returned in server response
[ { "docid": "04f5950dcaac8dd241d5acc66f320854", "score": "0.751109", "text": "def custom_fields_response\n data[:properties].custom_field_property do\n key :type, \"array\"\n key :xml, wrapped: true\n items do\n key :\"$ref\", \"CustomFieldValueApiResponse\"\n...
[ { "docid": "cef340486eab49e3771b0bc04c8228ab", "score": "0.7362148", "text": "def get_field_list\n return make_request(\"#{self.endpoint}/list/fields\")\n end", "title": "" }, { "docid": "4a1d23d98575199db1d4dd474a6d6c11", "score": "0.7100725", "text": "def custom_f...
c85f5eb2cd2ffeb1610f7bb147734458
Anzeige Zeitleiste als Diagramm
[ { "docid": "62be63c104a545aa55c10226cd468c23", "score": "0.0", "text": "def list_iostat_filetype_history_timeline\n where_from_groupfilter(params[:groupfilter], params[:groupby], proc{|key| iostat_filetype_key_rule(key)})\n @data_column_name = params[:data_column_name]\n\n data_column = nil\n ...
[ { "docid": "bb65a7b3058dc81c2135e739642e78ac", "score": "0.7615267", "text": "def diagram\n end", "title": "" }, { "docid": "45f619fa03f0279e46e49d4f8c87cc1f", "score": "0.65642047", "text": "def diagram\n line_contents.to_s + \"\\n\" + (\" \" * (column - 1)) + \"^\"\n end",...