query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
bcf5d5d28d0bd6148c125cb87bbe0e28
POST /accidents POST /accidents.json
[ { "docid": "d94e158cf018e2d9c77b756ba4d26b0e", "score": "0.634484", "text": "def create\n @accident = Accident.new(params[:accident])\n\n respond_to do |format|\n if @accident.save\n format.html { redirect_to @accident, notice: 'Accident was successfully created.' }\n format.jso...
[ { "docid": "95f2eaed497fdd37e3e04431a5e61d46", "score": "0.6254609", "text": "def create\n @accident = Accident.new(accident_params)\n\n respond_to do |format|\n if @accident.save\n format.html { redirect_to @accident, notice: 'Unfall erstellt.' }\n format.json { render :show, s...
d43bb00f8c44f332ca84f95a943f4352
Retrieve queue details for an organization pipeline
[ { "docid": "7b45b7c5633699047af130ab7001fc91", "score": "0.68842894", "text": "def get_pipeline_queue(organization, pipeline, opts = {})\n data, _status_code, _headers = get_pipeline_queue_with_http_info(organization, pipeline, opts)\n data\n end", "title": "" } ]
[ { "docid": "6d10566a889e86b8f4facf85ae953935", "score": "0.70498633", "text": "def get_pipeline_queue_with_http_info(organization, pipeline, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BlueOceanApi.get_pipeline_queue ...'\n end\n # v...
1cd604dea78e703bbfa2991dc0dc943f
GET /extinctions GET /extinctions.json
[ { "docid": "a11192d548ca2775e722bbb4e1fe1c9b", "score": "0.7165678", "text": "def index\n @extinctions = Extinction.all\n end", "title": "" } ]
[ { "docid": "3b1ea06498fbbde4dbdc1723dbdb7cc0", "score": "0.6299742", "text": "def index\n expert_opinions = ExpertOpinion.all\n json_response(expert_opinions)\n end", "title": "" }, { "docid": "70f4e9428da76f530dedf015a5cff7ce", "score": "0.6120466", "text": "def index\n...
9001e002a93bffe349e39ea9588c9a30
public methods inherited from Puppet::Provider
[ { "docid": "584c72dc02610821b7d60064575f9cec", "score": "0.0", "text": "def exists?\n # false if the user passed in cert and private key data, this will force\n # a call to create()\n return false if resource[:cert] && resource[:priv_key]\n\n # if we're trying to delete the cert, we simply n...
[ { "docid": "3d4b50c5461403562aad354b43746294", "score": "0.72050786", "text": "def type\n :puppet_provider\n end", "title": "" }, { "docid": "8a77c1770835602bded28e5b727a44de", "score": "0.6921541", "text": "def provider; end", "title": "" }, { "docid": "e21095589b2ef...
b00e1e2ba08f1fc1c3d79e99112346bb
GET /horses GET /horses.json
[ { "docid": "efea353149972e906952dfbf219e902c", "score": "0.7701271", "text": "def index\n @horses = Horse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @horses }\n end\n end", "title": "" } ]
[ { "docid": "51fd66e0e22809d0b077213a7b528811", "score": "0.71648157", "text": "def index\n @horses = Horse.all\n end", "title": "" }, { "docid": "51fd66e0e22809d0b077213a7b528811", "score": "0.71648157", "text": "def index\n @horses = Horse.all\n end", "title": "" }, ...
251d82c97bdbe5eac2e7684637283573
reduce 370 omitted reduce 371 omitted
[ { "docid": "1564a7916d24bb0ce1b3c8701b7d76fc", "score": "0.0", "text": "def _reduce_372(val, _values, result)\n result = @builder.arg(val[0])\n \n result\nend", "title": "" } ]
[ { "docid": "8da6d05568e0cf5b51807ae64ca3f5a3", "score": "0.74001604", "text": "def _reduce_603(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "8da6d05568e0cf5b51807ae64ca3f5a3", "score": "0.74001604", "text": "def _...
507824003f728ee5c0642611c57aa2da
Parse a string to a Liquid Condition source://jekyll4.2.2/lib/jekyll/filters.rb:487
[ { "docid": "dfdbd4c1399c4a002f390e694b876f51", "score": "0.62931025", "text": "def parse_condition(exp); end", "title": "" } ]
[ { "docid": "17cca22685f65c29f22b304124f6a29e", "score": "0.65874076", "text": "def parse_condition; end", "title": "" }, { "docid": "17cca22685f65c29f22b304124f6a29e", "score": "0.65874076", "text": "def parse_condition; end", "title": "" }, { "docid": "0bf269ce40c7c99b6f...
59be2c6e6ea43db7204570eab7d77469
The following rules determine truthiness: If value is nil or false return false. Otherwise return true.
[ { "docid": "068255c5ebc61584d3ef85aaa0f6c76a", "score": "0.7191803", "text": "def is_truthy?(value)\n return false if value.nil?\n return false if value.is_a?(FalseClass)\n return true\n end", "title": "" } ]
[ { "docid": "79814bb573b2975b5e7f1f8d89bbed3f", "score": "0.77415085", "text": "def truthy?(val); !falsey?(val); end", "title": "" }, { "docid": "43b858b819b015134abfb38490b6d712", "score": "0.75691473", "text": "def truthy?(value)\n return false if value.nil? || value.is_a?(FalseC...
138fafa13d76cec89f084f37ec18861c
PUT /inputs/1 PUT /inputs/1.json
[ { "docid": "530902030637d0fa523258f1b464fb55", "score": "0.6247428", "text": "def update\n @input = Input.find(params[:id])\n\n respond_to do |format|\n if @input.update_attributes(params[:input])\n format.html { redirect_to @input, notice: 'Input was successfully updated.' }\n ...
[ { "docid": "8e18db431964c254de53caa41795b702", "score": "0.62535375", "text": "def put *args\n make_request :put, *args\n end", "title": "" }, { "docid": "7ea6408822a5d3ffb97bc5983c7dfaa3", "score": "0.6245146", "text": "def update!(**args)\n @input = args[:input] if arg...
c51c2973801e117ee6aeb2d22e29826d
GET /mvideos GET /mvideos.json
[ { "docid": "8da21c7434431f0602ade03160938c86", "score": "0.66054153", "text": "def index\n @mvideos = Mvideo.paginate(:page => params[:page] || 1).order(date: :desc)\n @header_bg='bg-dark'\n respond_to do |format|\n format.html\n format.json { render json: { :mvideo => @mvideos.as_jso...
[ { "docid": "24b55059068ab0d5a2d271c5910b82f2", "score": "0.7410597", "text": "def all_videos\n videos = Video.all\n\n if videos\n render json: {\n videos: videos\n }\n else\n render json:{\n status: 500\n }\n end\n end", "title": "" }, { "docid"...
6d059dc3da1944de6881e2a5aa19723f
created different method to remove cards from player It was breaking my pile_cards method
[ { "docid": "838532d9b945ed5c5b284c485f070808", "score": "0.7848047", "text": "def remove_cards_from_player\n if type == :basic\n player2.deck.remove_card\n player1.deck.remove_card\n elsif type == :war || :mutually_assured_destruction\n 3.times do\n player2.deck.remove_card\n...
[ { "docid": "977db0c7bcab427eca6e83b563e01ddd", "score": "0.7862028", "text": "def remove_card(position) end", "title": "" }, { "docid": "64112f6d1695ce7fe02060b513066ae7", "score": "0.7783733", "text": "def remove_card!\n @cards.pop\n end", "title": "" }, { "docid": "...
072d3182ff7a4b9f9b83b24037036310
BEG12 Id: 640 Name: Transaction Type Code Type: ID Min/Max: 2/2 Description: Code specifying the type of transaction
[ { "docid": "ef7f34c7e47800cdf22b05e96dfe2597", "score": "0.0", "text": "def BEG12=(arg)", "title": "" } ]
[ { "docid": "fc78e50e44c644f666bcbeae86cae694", "score": "0.6792994", "text": "def transaction_code\n return (@transaction_code || 50)\n end", "title": "" }, { "docid": "193369864c762a55fa710ae9ef994e9b", "score": "0.6774875", "text": "def transaction_type\n case tran...
5969585b358dcf77eb689eeda0929562
PATCH/PUT /questionnaires/1 PATCH/PUT /questionnaires/1.json
[ { "docid": "84d1228e2105c745d2de398474ae2929", "score": "0.0", "text": "def update\n question_ids = []\n if questions_params\n questions_params.each do |question_id|\n question_ids << question_id.to_i\n end\n end\n\n questionnaire_saved = @questionnaire.update(questionnaire_...
[ { "docid": "29561a0334671dc8cddbe9dd997dc0f6", "score": "0.718518", "text": "def update\n update_resource @questionnaire, questionnaire_params\n respond_with @questionnaire unless response_body\n end", "title": "" }, { "docid": "5b53c07c3a3d46f5df77d182ea2af68c", "score": "0.71818...
1a49d1fff89b96051e1aefbc2e35d3ee
Each row in the predefined files containing lists of securities is of them form: ["NAME", name "ID_BB_SEC_NUM_DES", ticker "FEED_SOURCE", pricing source === exchange label "ID_BB_SEC_NUM_SRC", irrelevant BSID (Bloomberg Security ID Number with Source) e.g. 1095270768082 "ID_BB_UNIQUE", irrelevant unique id e.g. IX26248...
[ { "docid": "5e8d76468386ee9687b86d75f3e2ab7a", "score": "0.5421203", "text": "def convert_row_to_security(row)\n name, ticker, pricing_source, bsid, unique_id, security_type, market_sector, figi, composite_bbgid = *row[0..8]\n\n Security.new(name, ticker, pricing_source, bsid, unique_id, secur...
[ { "docid": "be2f54e382ef89153e24a41b48f9e44b", "score": "0.63157576", "text": "def get_securities(url)\n if block_given?\n zip_file_contents = Net::HTTP.get(URI(url))\n #temp_filename = \"securities-#{SecureRandom.uuid}.txt.zip\"\n temp_filename = File.basename(url)\n\n ...
fbe04a9b69270f21e80a147afe59c2fb
Provide a detailed, user friendly representation source://twilioruby//lib/twilioruby/rest/preview/wireless/command.rb235
[ { "docid": "473108fa97cee58671b779c2ccfec06f", "score": "0.0", "text": "def inspect; end", "title": "" } ]
[ { "docid": "6d45b429ecc0a7d277a6f4e476dadfa4", "score": "0.61818194", "text": "def commands\n\t\t{\n\t#\t\t\"dev_image\" => \"Attempt to grab a frame from webcam\",\n\t#\t\t\"dev_audio\" => \"Attempt to record microphone audio\",\n\t\t\t\"screengrab\" => \"Attempt to grab screen shot from process's ac...
c47b4fb5c91940cb5bde5439670b8fc1
True, if any of the element's contents has essence validations defined.
[ { "docid": "1707934dcb806e21cdd23e52110e5bec", "score": "0.7128017", "text": "def has_validations?\n !contents.detect(&:has_validations?).blank?\n end", "title": "" } ]
[ { "docid": "3b68436b0292909727b171659f9b774c", "score": "0.6206397", "text": "def valid?\n all? {|e| e.respond_to?(:valid?) ? e.valid? : true}\n end", "title": "" }, { "docid": "72f43e101d9a076a8cb39f963729a8f0", "score": "0.62004006", "text": "def is_valid_element?(element)\n ...
39d3058c5a2d5e9dbb06b9500e11ff39
Funcion que retorna el modo de la declaracion
[ { "docid": "82b73da804011d949d9ce019ce3ae9e1", "score": "0.63551253", "text": "def get_modo()\r\n\t\treturn \"tipo\"\r\n\tend", "title": "" } ]
[ { "docid": "0ed3fdd2588b388ba05981ce52ceb01a", "score": "0.65156156", "text": "def mod\n @mod \n end", "title": "" }, { "docid": "7ddd08a2e9575285187386c9fe1b5833", "score": "0.62091464", "text": "def get_definition\n\n end", "title": "" }, { "docid": "51da98836...
2fbf09b6ccec48c14b614bce4ef56c03
Show changes on pages linked to the selected page instead.
[ { "docid": "4b7dafbfc9423ce1bf7af629cb9ed1ad", "score": "0.5451772", "text": "def showlinkedto()\n merge(showlinkedto: 'true')\n end", "title": "" } ]
[ { "docid": "bd0cbc1742bc9e38e4f0f3f07320362a", "score": "0.69259334", "text": "def page_changed page\n\t\t\tmutate.current_page page\n\t\tend", "title": "" }, { "docid": "1388a4900c57bb24abd54b68ed66f60a", "score": "0.6377394", "text": "def onContentsModified(pages)\n Utils....
5501ccfd94a6a09122e06ec56710f855
GET /orders or /orders.json
[ { "docid": "95c5d4496c226ebafde1fc43f5f41646", "score": "0.0", "text": "def index\n @club = current_member.club\n @order_history_approved = Order.where(requester_id: current_member.id,\n returned: false)\n .where.not(appro...
[ { "docid": "23052f52af86f70778b67e0afeeea3d4", "score": "0.78166753", "text": "def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end", "title": "" }, { "docid": "758a2f8f96273e5938f621811501d1a3", "score": "0.7588489", "text": "def orders\n ...
06972868635159943b1a4069ad74d0c1
if this email is deleted by both sender and receiver
[ { "docid": "37fc27bed21e3f3ae6e4a89bb75d41f2", "score": "0.75139034", "text": "def delete_by_both?\n (delete_by_receiver and delete_by_sender)? true : false\n end", "title": "" } ]
[ { "docid": "fda3604c01cfc70220644e8dac581f22", "score": "0.838833", "text": "def delete_from_received(email)\r\n if email.receiver_id == self.id\r\n email.update_attribute :receiver_deleted, true\r\n return true\r\n else\r\n return false\r\n en...
a70ce50bcbb878d31d81fb4a6566c9fe
=begin Inserts a word into the trie. :type word: String :rtype: Void =end
[ { "docid": "c4e6636153e5d3ba70340eb5f86da6da", "score": "0.7849222", "text": "def insert(word)\r\n n = @root\r\n word.chars.each_with_index do |chr, i|\r\n if !n.next.has_key?(chr)\r\n n.next[chr] = Node.new\r\n end\r\n n = n.next[chr]\r\n end\r\n #puts ...
[ { "docid": "771fecf463f7ce88e9e3fa37365e5066", "score": "0.85153466", "text": "def insert(word)\n current_node = @root\n word.chars.each do |char|\n node = current_node.children[char]\n if !node\n node = TrieNode.new();\n current_node.chi...
c050839e26c108c991d74b16c98382dc
DELETE /projects/1 DELETE /projects/1.json
[ { "docid": "e4eabccf3254c09325b990a2565f4cb9", "score": "0.0", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "ce10449f9ce0fd62fdc6ce11492b8372", "score": "0.7899063", "text": "def destroy\n @root = \"projects\"\n \n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\...
ea3647863fa1bae26b54034d059c9862
using list for now until title class is recognized by dcon Returns the about link from the footer
[ { "docid": "abb803e7c9eb02b58b4de6c8d571bb19", "score": "0.0", "text": "def footer_about_link\n $tracer.trace(__method__)\n return ToolTag.new(nav.className(\"authentication\").a.at(0), __method__)\n end", "title": "" } ]
[ { "docid": "4e467c3dfc3e9792a496adb55781754b", "score": "0.6485332", "text": "def title_view\n html = \"\"\n html << \"<span class=\\\"icon12 icomoon-icon-home home_page\\\"></span>\" if self[:home_page]\n html << (ActionController::Base.helpers.link_to self[:title], Applicati...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "07765f754297ffa8d9c3d57263522183", "score": "0.0", "text": "def set_service_version\n @service_version = ServiceVersion.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; ...
b5992fcd97d5624a0fd633430b084c9e
For all responses in this controller, return the CORS access control headers.
[ { "docid": "5c6b92b65b4a48de3c9a18c7c696b074", "score": "0.73718077", "text": "def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end", "title": "...
[ { "docid": "dd9776cefe509fd0c72c49b62e36ccb2", "score": "0.7619929", "text": "def response_headers(env)\n cors_origin(env) ? cors_headers(env) : {}\n end", "title": "" }, { "docid": "6d626ca8f3a92950aa67b7ed72d8be02", "score": "0.76049924", "text": "def cors_set_a...
60a2d5780cc513a68a465672bc49ad2c
DELETE /ice_creams/1 DELETE /ice_creams/1.json
[ { "docid": "b57475d0d231f06f27f9397efcadec59", "score": "0.70323366", "text": "def destroy\n @ice_cream.destroy\n respond_to do |format|\n format.html { redirect_to ice_creams_url, notice: 'Ice cream was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.7143255", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "0f5762492d96e053af5cd75d5643a7d9", "score": "0.7032462", "text": "def destroy\n @ice_cream.destroy\n respond_to do |fo...
4d64079826a3013a3ee1e8549fe2d7bc
=> ["I", "want", 4, "pets", "but", "I", "only", "have", 3, ":(." ]
[ { "docid": "c65c1d86dce7cc5ac0e82c02ae3bbafe", "score": "0.0", "text": "def my_hash_modification_method(source, thing_to_modify)\n source.each do |key, value|\n source[key]+= thing_to_modify\n end\nend", "title": "" } ]
[ { "docid": "6fa0fce89f8b5887ca457d1b1ae5b12d", "score": "0.639212", "text": "def words\n %w(this array has five words)\nend", "title": "" }, { "docid": "f9546da0a4d6b79c2b8aeaa24de6be93", "score": "0.62637925", "text": "def whisper_words(words)\r\n return words.map { |ele| ele.down...
fe1313d3ad41ab31df691a61c152bb0b
Replace this with your real tests.
[ { "docid": "72fd36c52f9358823fcd80b429120869", "score": "0.0", "text": "def test_truth\n assert true\n end", "title": "" } ]
[ { "docid": "16a6d5e8eabd975007f205c109c50890", "score": "0.7378937", "text": "def testing; end", "title": "" }, { "docid": "1068832c8229c37488788b46a0871f26", "score": "0.6994956", "text": "def testing\n end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e",...
00225535ce12d823d635579cde0dd610
Returns false until kill/disconnect have been called.
[ { "docid": "5d589d784d07969e91dbe604f1a4296e", "score": "0.0", "text": "def stopping?\n stopped? or @stopping\n end", "title": "" } ]
[ { "docid": "9ef267bc3be42e5bcea3ffc1fd19b3ea", "score": "0.77559173", "text": "def is_disconnect?\n\t\treturn false\n\tend", "title": "" }, { "docid": "9cdbdb26b916c450302ff523a73bab04", "score": "0.7580867", "text": "def terminated?\n false\n end", "title": "" }, ...
c8380051290210b6a4196cadea1d6924
use an instance of Rails ActionController::HTML::FullSanitizer to remove all HTML tags from the FeedEntry.summary
[ { "docid": "e4a2c35dd2384bf1757bbd99432be6f2", "score": "0.0", "text": "def initialize\n @html_sanitizer = HTML::FullSanitizer.new\n end", "title": "" } ]
[ { "docid": "02f1f8847568858cbecb7025c3e9e2da", "score": "0.79207605", "text": "def clean_entries(feed)\n full_sanitizer = Rails::Html::FullSanitizer.new\n feed.entries.map do |entry|\n clean_summary = full_sanitizer.sanitize(entry.summary)\n clean_sentences(clean_summary)\n end\n end...
9818d595b7e9116aab10caa3d10a1a7b
POST /api/v1/followers POST /api/v1/followers.json
[ { "docid": "5b7123afc6d16e82558a4ba99c1fec2b", "score": "0.7592421", "text": "def create\n @api_v1_follower = Api::V1::Follower.new(api_v1_follower_params)\n @api_v1_follower.follower_id = @current_user.id\n\n if @api_v1_follower.save\n render json: @api_v1_follower, status: :created, loca...
[ { "docid": "3e03433a89e1998376325d90400a9663", "score": "0.7520545", "text": "def followers *args\n hash = args_to_hash(args)\n hash[:username] = @username\n @api.request(\"users/followers/?#{build_query_string(hash)}\")\n end", "title": "" }, { "docid": "b4c7fcdba8095ed8fd...
6e086ca84d5d4f400abe62074068b3fb
Writes a field based on the field information, field ID and value. field_info A Hash containing the definition of the field: :name The name of the field. :type The type of the field, which must be a Thrift::Types constant. :binary A Boolean flag that indicates if Thrift::Types::STRING is a binary string (string without...
[ { "docid": "0eda12fe35980c32e4fe11f2b01e62ac", "score": "0.750742", "text": "def write_field(*args)\n if args.size == 3\n # handles the documented method signature - write_field(field_info, fid, value)\n field_info = args[0]\n fid = args[1]\n value = args[2]\n elsif...
[ { "docid": "d517ab232a2f04bbb03567bd29e8ce0a", "score": "0.7227506", "text": "def write_type(field_info, value)\n # if field_info is a Fixnum, assume it is a Thrift::Types constant\n # convert it into a field_info Hash for backwards compatibility\n if field_info.is_a? Fixnum\n fiel...
d4412f19ee1ac925121919110e86d235
this attack is easy enough to see if you draw out CBC decryption, reuse the KEY as the IV and are able to make decryption requests
[ { "docid": "a8509357ef9396d62609f4487b8e1af9", "score": "0.0", "text": "def test_challenge_27\n ciphertext = f1(\"\")\n c0 = ciphertext[0...16]\n attack_ciphertext = [c0, \"\\x00\" * 16, c0, \"A\" * 256].join\n error_text = admin?(attack_ciphertext)\n\n ...
[ { "docid": "bec4201dfeb7a2084e3895e36bf9efe1", "score": "0.7602544", "text": "def decrypt_cipher(key:)\n decipher = OpenSSL::Cipher::AES.new(128, :CBC).decrypt\n decipher.iv = @iv\n decipher.key = key\n decipher.padding = 0\n\n decipher.update(@cipher_text) + decipher.final\n end", "...
4a415e0ef40d639db9e968e639713129
DELETE /records/1 DELETE /records/1.json
[ { "docid": "4c1532d6f0744ab5ef38d24ba3e2a484", "score": "0.6909112", "text": "def destroy\n @record.destroy\n respond_to do |format|\n format.html { redirect_to records_url, notice: 'Record was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "...
[ { "docid": "1dcc007f27864590e4036129dc921844", "score": "0.74103963", "text": "def destroy\n @record = Record.find(params[:id])\n @record.destroy\n\n respond_to do |format|\n format.html { redirect_to records_url }\n format.json { head :ok }\n end\n end", "title": "" }, { ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7682ad0020af307fe54234a4c634579c", "score": "0.0", "text": "def set_wish_list\n @wish_list = WishList.find_by_id(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...
c0edbd9c8ae796fa3e1abed6cfc06ecc
To add days or weeks to a Time object, the seconds must be calculated and added back. A day in seconds is equal to 24 60 60 (hours minutes seconds) the days parameter will multiple by the amount of days provided and weeks is the same factor times 7 times the amount of weeks specified
[ { "docid": "112f30bf360928f7ee2e09096f055512", "score": "0.72345805", "text": "def add_days(week, days)\r\n day_in_seconds = 86400 # 24 * 60 * 60\r\n day_sum = days * day_in_seconds\r\n week_sum = 7 * day_in_seconds * week\r\n total_days = day_sum + week_sum\r\nend", "title": "" } ]
[ { "docid": "a707d70cba8f9211d3c9800e2f449a39", "score": "0.66248626", "text": "def add_weeks weeks, gamedays\n span_size = gamedays - weeks.size\n span_before = span_size / 2\n span_after = span_size - span_before\n if @start_week - span_before < 1\n span_after += (s...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d624723ef9922358f39605bfcea9ebd6", "score": "0.0", "text": "def set_crawl_log\n @crawl_log = CrawlLog.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310596", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014974", "text": "de...
93dfe0e9a031f57f349d77728f85cb13
Alerters are created from json, either posted from a web page or client app, or loaded from disk The alerter action field should be registered against the upstream expression When creating, the base URL of the application /patterns route from the perspective of the end user should be passed if possible
[ { "docid": "abbe1e661aeaca4d1c2de7d3e999d04d", "score": "0.0", "text": "def initialize(json, base_url = \"#{AppConfig.base_url}patterns\")\n @json = json\n @parsed_json = JSON.parse(json, :symbolize_names => true)\n @alert_events = {}\n @alert_counter = 0\n @alert_limit = ALERT_LIMIT\n ...
[ { "docid": "ccb6af1ba43d6e9bd9e7ef759f5f7e03", "score": "0.53981805", "text": "def url_template; end", "title": "" }, { "docid": "ccb6af1ba43d6e9bd9e7ef759f5f7e03", "score": "0.53981805", "text": "def url_template; end", "title": "" }, { "docid": "cdf4afc716bb259cc3a99e9c...
7cdc8e5ba1ccc1db28311c6893ff4372
Returns a text representation of the Playlist.
[ { "docid": "969dc3d916f43171d8d64ffb9a1741f6", "score": "0.65586776", "text": "def create_text\n songs.inject(\"\") do |list, song|\n list << \"#{song.filename}, #{song.title}\\n\"\n end\n end", "title": "" } ]
[ { "docid": "e00b20ce7b8736f4d502c12fcc737342", "score": "0.7104556", "text": "def generate(playlist)\n text = \"[playlist]\\n\\n\"\n playlist.tracks.each_with_index do |t, index|\n index += 1\n duration = (t.duration / 1000).round\n text += \"File#{index}=#{t.location}\\n\...
2f0c971add6bd58482dbf0c5a05cd16e
Checks to see if current user's work can be marked as completed; if not, returns error and reference to problem
[ { "docid": "b674ec073d1942ce8cedfc3088d4693d", "score": "0.0", "text": "def verify_mark_complete(account)\n case self.status\n ###########DATA ENTRY############\n when STATUS_DE1, STATUS_DE2\n #Check that there are any annotations for this user\n annoCount = Annotation.where(\...
[ { "docid": "8c1244c3fbbaaeca19884f52c7ce555e", "score": "0.6858324", "text": "def has_completed?\n CompleteProblem.where(\"user_id=? and problem_id=?\", @current_user[:id], params[:id]).size > 0\n end", "title": "" }, { "docid": "800751857a365a1f75b66d76a4d3e6ef", "score": "0.6576630...
d89d285279596424db842de13871eb35
POST /sections POST /sections.json
[ { "docid": "baed99c0c1045663f9a8a2cfa098b832", "score": "0.70205486", "text": "def create\n @section = Section.new(section_params)\n\n respond_to do |format|\n if @section.save\n format.html { redirect_to sections_path, notice: 'La sección fue creada correctamente.' }\n format.j...
[ { "docid": "0434e08e79e40d59ca7349c6a789ef49", "score": "0.7223789", "text": "def create\n @section = Section.new(section_params)\n if @section.save\n render \"api/sections/_show\"\n else\n render json: @section.errors.full_messages.join(\", \"), status: :unprocessable_entity\n end...
8e895b186f7875908b1a28a4b6e8398e
POST request, to update a user
[ { "docid": "fc0f39f918df73dd51cfeaa86b3a4b50", "score": "0.7737674", "text": "def update\n # retrieve user data from request (params)\n email = params[:email]\n\n # query DB for the specific user \n user = User.where(:email => email)\n\n @user = user.update(user_params...
[ { "docid": "bb443a428f2563539f43b17c71594928", "score": "0.80284417", "text": "def update_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title"...
912ddf0e6252022766f7714d615cabc6
GET /delivery_dates/1 GET /delivery_dates/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "5798285742939ee011b143d9ceb14131", "score": "0.7159883", "text": "def index\n @delivery_dates = DeliveryDate.all\n end", "title": "" }, { "docid": "0f948da96803ca1fd1046eab645fbc2c", "score": "0.62251", "text": "def set_delivery_date\n @delivery_date = DeliveryDa...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "22555e117435bc1fd6485a47811e4c82", "score": "0.0", "text": "def set_membership_option\n @membership_option = MembershipOption.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
a519a8eccc0253ce0386c731e89ea15c
Returns an updated title of the website
[ { "docid": "f0f8eb19aabd59307da58fb28dab2253", "score": "0.0", "text": "def get_title\r\ntitle =\r\nend \r\n\r\n#Returns an array with state info from its website\r\ndef get_info(state_id)\r\nhref =\r\n\r\nstate_page = Nokogiri::HTML(open(href))\r\n\r\n#Scrapes an individual state website and printsa do...
[ { "docid": "cec04a0eed7140c6a5f58213b885ec88", "score": "0.8308898", "text": "def update_title!\n title = Nokogiri::HTML.parse(open(full_url)).title\n self.update(title: title)\n end", "title": "" }, { "docid": "f2430d0d2930adf92733a85e0dce66df", "score": "0.7948971", "text": ...
eb1b0c8a13b683e2129881e7ab6eac57
POST /babies POST /babies.json
[ { "docid": "3117099da81506e8187d450d4371b412", "score": "0.5855033", "text": "def create\n @user=User.find(params[:user_id])\n @baby = @user.babies.build(baby_params)\n\n respond_to do |format|\n if @baby.save\n format.html { redirect_to @baby, notice: 'Baby was successfully created...
[ { "docid": "ca0dd8f7b8f3894c6b383bbb99a8e052", "score": "0.6957017", "text": "def create\n @kebab = Kebab.new(kebab_params)\n\n respond_to do |format|\n if @kebab.save\n format.html { redirect_to @kebab, notice: 'Kebab was successfully created.' }\n format.json { render :show, s...
118808c30fe319e0e2a133b89657c0e6
Perform Automatic Recovery (called at end of turn)
[ { "docid": "692536cc95a80e91f5bac41cf63ed18b", "score": "0.6627289", "text": "def do_auto_recovery\n if auto_hp_recover and not dead?\n self.hp += maxhp / 20\n end\n end", "title": "" } ]
[ { "docid": "614c5c8ebf3fd146c4f9c55446546a2a", "score": "0.7655451", "text": "def recovery_final\n end", "title": "" }, { "docid": "5d248ebba151b0dac3f277156b0c73d5", "score": "0.74759865", "text": "def recover\n @recovery.call(@host) if @recovery\n @up = true\n end", ...
0fcb6be7bac31057e51a618212471b33
Finds an existing FacebookAccount using unique_id of self === Return Existing account if found, nil otherwise
[ { "docid": "b58758c3a56638769b6be27d46ac664f", "score": "0.61795217", "text": "def existing\n return self.class.find_by_unique_id(unique_id)\n end", "title": "" } ]
[ { "docid": "9f704ec53c326e8a5016d572f9dbaabc", "score": "0.724005", "text": "def find_facebook_account\n @facebook_session = facebook_session\n @account = Account.find_by_facebook_uid(@facebook_session.user.uid)\n \n raise ActiveRecord::RecordNotFound unless @account\n # Assign the curren...
f5c569ae789886293e892712267fd05c
Evaluates decisions for given imput
[ { "docid": "74899db3f1fcb54ea712979f4061503d", "score": "0.0", "text": "def evaluate_decisions(id, body, opts = {})\n data, _status_code, _headers = evaluate_decisions_with_http_info(id, body, opts)\n return data\n end", "title": "" } ]
[ { "docid": "4c0e7a528802b953876f2da880d9e181", "score": "0.6458286", "text": "def evaluate(mission=nil)\n ifs_result = self.handle_series(@ifs,mission)\n return ifs_result if ifs_result.respond_to?(:each)\n if ifs_result\n # Ifs have been met, do thens.\n return self.handle_series(@th...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5a6ba8cb4f763743a93132aa3693d34f", "score": "0.0", "text": "def ms_location_params\n params.require(:ms_location).permit(:mobile_code, :mini_box, :imei, :serial_no, :mobile_no, :region, :rncname, :building_id, :location)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
c313dac43dab4ec7ecb9bde51a400d4e
Given an array of specimens, write a function biodiversity(ary) which returns the biodiversity index of the argument passed in. The biodiversity index is defined by the following formula: biodiversityIndex = numberOfSpecies ^ 2 smallestPopulationSize / largestPopulationSize
[ { "docid": "8cc0276129218aac6df8671638facee2", "score": "0.76002735", "text": "def biodiversity(animals_array)\n animals = Hash.new(0)\n animals_array.each {|animal| animals[animal] += 1 }\n\n smallest = animals.values.min\n largest = animals.values.max\n number_species = animals_array.uniq.count\n...
[ { "docid": "014d558989f39f53b72dc7dc88db4c4e", "score": "0.80648905", "text": "def biodiversity_index(specimens)\n count = animal_count(specimens)\n count[0] ** 2 * count[1] / count[2]\nend", "title": "" }, { "docid": "6611972078a3dc38525409bdb681ca75", "score": "0.79789364", "text...
3292f5b3a00d19f2ee433194f911331e
POST /skill_categorys POST /skill_categorys.xml
[ { "docid": "32f841b137511fdbf53182d17b641c73", "score": "0.7169124", "text": "def create\n @skill_category = SkillCategory.new(params[:skill_category])\n\n respond_to do |format|\n if @skill_category.save\n format.html { redirect_to(admin_skills_path, :notice => 'SkillCategory ...
[ { "docid": "2461e89765e5502472a5ce3a74d57ace", "score": "0.7094303", "text": "def create\n @skill_category = SkillCategory.new(skill_category_params)\n\n respond_to do |format|\n if @skill_category.save\n format.html { redirect_to @skill_category, notice: 'Skill category was successful...
2abb10fd290c589d6de9f416eb6d70cc
Will load items from SimpleDB up to i.
[ { "docid": "b797350fe802b43ca998b4bad0c0a8f7", "score": "0.70968294", "text": "def load_to(i)\n return if @items.size >= i\n while @items.size < i && !@next_token.nil?\n load_next_token_set\n end\n end", "title": "" } ]
[ { "docid": "88868e2b8e153973686bd7fad408c4a8", "score": "0.58042526", "text": "def load\n all do |items|\n @list.items = items.reverse\n end\n end", "title": "" }, { "docid": "6f36ebb63396c69a25355c564a6580f4", "score": "0.5726094", "text": "def load_multi(cache_f...
c6621dee469aae137f3b12ccc5fa507f
PUT /wadls/1 PUT /wadls/1.json
[ { "docid": "bc2923fb399ec255063ed604f16ee5da", "score": "0.70740557", "text": "def update\n @wadl = Wadl.find(params[:id])\n\n respond_to do |format|\n if @wadl.update_attributes(params[:wadl])\n format.html { redirect_to @wadl, notice: 'Wadl was successfully updated.' }\n forma...
[ { "docid": "09fb203d8961ffe4e945942ee6cf9149", "score": "0.7077881", "text": "def update\n if @wod.update(wod_params)\n render json: @wod\n else\n render json: @wod.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b886e68ec01cae0114a0badac6f2...
3041c442c1915046a45954f8e1b18f54
Returns all resolution 0 hexagons (base cells).
[ { "docid": "e194cf40747a93ed77279ca27e21d3c2", "score": "0.600899", "text": "def base_cells\n out = H3Indexes.of_size(base_cell_count)\n Bindings::Private.res_0_indexes(out)\n out.read\n end", "title": "" } ]
[ { "docid": "336c1acd7103992a7c364d722db04f4f", "score": "0.60993034", "text": "def hex_colors_rows\n \t[['Hexcolors']] +\n @hexcolors.map do |colors| \n \t[colors] \n end\n \tend", "title": "" }, { "docid": "29688adb6d2c84c1519766dcd47687eb", "score": "0.592419", "...
60144e0b926d23a96dd9804003a45875
DELETE /google_mcc_accounts/1 DELETE /google_mcc_accounts/1.json
[ { "docid": "3bb6a9554ef45ad58c0795955e6f54d7", "score": "0.80690193", "text": "def destroy\n @google_mcc_account = GoogleMccAccount.find(params[:id])\n @google_mcc_account.destroy\n\n respond_to do |format|\n format.html { redirect_to google_mcc_accounts_url }\n format.json { head :no...
[ { "docid": "673cec3a5122bc06a2a1e85c3b12c834", "score": "0.70934325", "text": "def destroy\n @google_account.destroy\n respond_to do |format|\n format.html { redirect_to google_accounts_url, notice: 'Google account was successfully destroyed.' }\n format.json { head :no_content }\n en...
a6d394cbc2d9adf04f63ee4615989c4a
Create a new function. You can pass a list of [permissions](/docs/permissions) to allow different project users or team with access to execute the function using the client API.
[ { "docid": "880ec20bc359dc8ce9d9bae21939fb8f", "score": "0.72428775", "text": "def create(function_id:, name:, runtime:, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil)\n path = '/functions'\n\n if function_id.nil?\n raise Appwrite::Exception.new(...
[ { "docid": "dc8ab0977472662d307be61c7d22652b", "score": "0.6944496", "text": "def create_function(name, class_type, *resource_names)\n function = Function.new\n function.class_type = class_type\n function.alias = name\n function.resources = []\n res = ODPS.conn.post do |req|\n ...
b30079e17643c5949b10607e82699211
DELETE /jobs/1 DELETE /jobs/1.xml
[ { "docid": "a181c565c74477a74493540dffeb2245", "score": "0.7000084", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n\t\t\tformat.json { render :json => @job, :status => 2...
[ { "docid": "f9108257de4704c003a2446e159f62cd", "score": "0.742081", "text": "def delete(id)\n connection.delete do |req|\n req.url \"job/#{id}\"\n end\n end", "title": "" }, { "docid": "e15e8cb5eb801ed7fa960fc557e7c08f", "score": "0.7219612", "text": "def ...
cd45de444eec2ce54cd5baf66cb5bc61
Specifies a onetoone association with another class. This class should only be used if this class contains the foreign key. Methods will be added for retrieval and query for a single associated object, for which this object holds an id: [association(force_reload = false)] Returns the associated object. +nil+ is returne...
[ { "docid": "8864b11a981b5d57b0f459dcf8878009", "score": "0.0", "text": "def belongs_to(name, options = {})\n Builder::BelongsTo.build(self, name, options)\n end", "title": "" } ]
[ { "docid": "aa872020cbd432c8abbcdeccd4eac128", "score": "0.7330102", "text": "def belongs_to(association_id, options={})\n validate_belongs_to_options(options)\n klass = options[:class] || Inflector.classify(association_id)\n foreign_key = options[:foreign_key]\n primary_key ...
acc7802a083b4875a3c48a717c711aa3
showing the has many relationships return all the associated orders / reader method
[ { "docid": "2c9f2268791a62fb1657e9657a5d4063", "score": "0.0", "text": "def orders\n Order.all.select do |order| # select will return an array\n order.customer == self\n end\n end", "title": "" } ]
[ { "docid": "3d22e1ce145bf671d898f2db03b379c0", "score": "0.73960936", "text": "def get_all_orders\n @orders = Order.all\n\n @show_detail = true\n end", "title": "" }, { "docid": "dc0cc7b8fb79993a6f3f6a38999227cb", "score": "0.73574173", "text": "def orders\n @orders = Order...
eeabec91e23cc4e57f8a001a174834f6
POST /realtors POST /realtors.json
[ { "docid": "4cff3b90abd770123b6e2cda745a92c3", "score": "0.53100336", "text": "def create\n val = realtor_params\n if val[:company_id].blank?\n val[:company_id] = 1\n @realtor = Realtor.includes(:company).new(val)\n else\n @realtor = Realtor.includes(:company).new(realtor_params)\n...
[ { "docid": "407077cfb7367140e6ab9cbc422b8dc7", "score": "0.6572528", "text": "def create\n @realtor = Realtor.new(params[:realtor])\n\n respond_to do |format|\n if @realtor.save\n format.html { redirect_to @realtor, notice: 'Realtor was successfully created.' }\n format.json { r...
f37ed26318b155b6a625faac043a5ced
The page method allows the layout to be set on a specific path page "/about.html", :layout => false page "/", :layout => :homepage_layout
[ { "docid": "d92544bb4be967b7ec027179ac66df75", "score": "0.0", "text": "def page(url, options={}, &block)\n has_block = block_given?\n options[:layout] = settings.layout if options[:layout].nil?\n \n if options.has_key?(:proxy)\n settings.proxied_paths[url] = options[:proxy]\n...
[ { "docid": "f79e420152a85559d17e9a839bcede14", "score": "0.7597197", "text": "def my_page\n set_layout [false, false, false]\n render layout: '/layouts/mypage_layout'\n end", "title": "" }, { "docid": "75116c6de155ee66e26acdc3357ea508", "score": "0.7569819", "text": ...
21672e14f45ca619061663df77028db3
These are important for windows to get permissions right, and may be useful for SELinux and other ACL approaches. Please use them as the arguments to Tempfile.new() consistently.
[ { "docid": "4f374f80516082ddeb1beff946c99e02", "score": "0.0", "text": "def tempfile_basename\n basename = ::File.basename(@new_resource.path, tempfile_extension)\n # the leading \"[.]chef-\" here should be considered a public API and should not be changed\n basename.insert 0, \"che...
[ { "docid": "d4254b4b54482625faf8f10ed2b980ca", "score": "0.6808678", "text": "def unix_perms=(_arg0); end", "title": "" }, { "docid": "534c4c830122f0bb05d5263dffd6e35c", "score": "0.67695236", "text": "def unix_perms; end", "title": "" }, { "docid": "48e31bbb3bd4244c0c846...
0495db5d48e715fb91163c79c5d028d7
Removes whitespaces in the front and end of the input from first and last name and also the biography
[ { "docid": "2092bcda879086d8f3632ccee8deb92e", "score": "0.76936907", "text": "def remove_whitespace\n self.first_name = self.first_name.strip\n self.last_name = self.last_name.strip\n self.biography = self.biography.strip\n end", "title": "" } ]
[ { "docid": "b4d8bb37d34f5933096af891407100c1", "score": "0.7499903", "text": "def format_name(first, last)\n return nil if first.empty? || last.empty?\n f = first.delete(\" \")\n l = last.delete(\" \")\n username = f[0]\n username << l\n user = username.downcase\n user.gsub(/[\\W]/, '') # this is...
0b616de1eef365cacaf4fe4c817a5be2
[ body body! ]
[ { "docid": "a07d87422e2ec94b78f939c698dbf5c7", "score": "0.0", "text": "def _request_body_agent component_key, media_type, data: { }, **options\n request_body component_key,\n (@method_name['!'] ? :req : :opt), media_type, data: data, **options\n end", "title": "" }...
[ { "docid": "05d15f1ff00c344193bdbb2c7f16c5ba", "score": "0.7850711", "text": "def body=(body); end", "title": "" }, { "docid": "05d15f1ff00c344193bdbb2c7f16c5ba", "score": "0.7850711", "text": "def body=(body); end", "title": "" }, { "docid": "75b409867db0282615294714aa1c...
2f8fa1c6020607b72216cc0d88e882ba
POST /specialisations POST /specialisations.json
[ { "docid": "f6bb7df5c9e50feca7755d9da337a698", "score": "0.7016159", "text": "def create\n @specialisation = Specialisation.new(params[:specialisation])\n\n respond_to do |format|\n if @specialisation.save\n format.html { redirect_to @specialisation, notice: 'Specialisation was success...
[ { "docid": "4ee9e00efb50232f37ff34bebba9f7b5", "score": "0.7621467", "text": "def create\n @specialisation = @person.specialisations.build(specialisation_params)\n\n respond_to do |format|\n if @specialisation.save\n format.html { redirect_to new_person_specialisation_path(@person), no...
1451196990f47534c599192e08c484c2
Provide a default URL as a default if there hasn't been a file uploaded:
[ { "docid": "8ee84475593eaeec698ce84d191a8368", "score": "0.0", "text": "def default_url(*args)\n # For Rails 3.1+ asset pipeline compatibility:\n # ActionController::Base.helpers.asset_path(\"fallback/\" + [version_name, \"default.png\"].compact.join('_'))\n \n \"/images/fallback/\" + [version...
[ { "docid": "b60fd9da936d3a3a2ede5b89d2cb78a3", "score": "0.8193984", "text": "def default_url\n '/no_file'\n end", "title": "" }, { "docid": "7e0c7efbe20c579ceeafc492e36148cb", "score": "0.74905765", "text": "def default_url\n ''\n end", "title": "" }, { "docid": ...
ca656263e40f15d7552a16814b367564
Indicates whether the option is required
[ { "docid": "162c7d9c209e36075f0dd73cd84b8657", "score": "0.7325492", "text": "def required?; @required; end", "title": "" } ]
[ { "docid": "9796bf53397f5cd8330afb88b9729260", "score": "0.8860581", "text": "def required?\n options.fetch(:required)\n end", "title": "" }, { "docid": "e402ddb66a782a1ab97f61ea5d99182b", "score": "0.8830139", "text": "def required?\n @options[:required] ? tru...
a6784affd0ade4cd81fcb142d73724f9
cache_classes is true in production and testing, need to modify the ApplicationController
[ { "docid": "85676c2f3d026c3c800451f0b8c875ec", "score": "0.0", "text": "def controller_parent\n if caching?\n ApplicationController\n else\n ActionController::Base\n end\n end", "title": "" } ]
[ { "docid": "5aa07fee9a3597dfaef436d6e9e4c493", "score": "0.799631", "text": "def cache_classes; end", "title": "" }, { "docid": "fdc27566d91b45b0679b3f665d217691", "score": "0.6963356", "text": "def rails_mark_classes_for_reload\n unless Rails.application.config.cache_classes\n ...
55eac2fbec3ecf2763173c5d013195e9
returns a blogger's post with the most likes
[ { "docid": "a6524c48f79e7bfeb841a7bf1f3b6951", "score": "0.7380646", "text": "def featured_post\n # access all of blogger's posts\n # compare likes to get the max\n self.posts.max_by { |post| post.likes }\n end", "title": "" } ]
[ { "docid": "efdd99a9177265412fb48768f8b1653f", "score": "0.84679216", "text": "def most_likes\n most = 0\n most_post = self.posts.first\n self.posts.each do |post|\n if post.likes > most\n most = post.likes\n most_post = post\n end\n end\n most_post\n end", "t...
9eb90be7bef33c99d282d0f98cb36b42
Details about one user
[ { "docid": "e31c58575965ec8f250aa288a64ed5b4", "score": "0.0", "text": "def show\n respond_to do |format|\n format.json { render json: @user_c, status: 200 }\n end\n end", "title": "" } ]
[ { "docid": "23ae77a8e0f1e27ca36fb0e8576c5e02", "score": "0.7899258", "text": "def info\n @user = current_user\n end", "title": "" }, { "docid": "55836acde852fb65ab2c501191677a73", "score": "0.783272", "text": "def user_details\n user_details_for(@qualified_username).first\n ...
be94b506dde37b32cf2c4b5c31936bcd
GET /roles GET /roles.xml
[ { "docid": "c26a84d578001cf052ecfd2735e92cf7", "score": "0.73884916", "text": "def index\n @roles = Role.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @roles }\n end\n end", "title": "" } ]
[ { "docid": "73f7077148011877614d47b6ca64f17c", "score": "0.765395", "text": "def index\n @roles = @client.roles\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @roles }\n end\n end", "title": "" }, { "docid": "35e381700272ddfcf2237...
02dc79eb08979f145697822c1ab75ac0
PUT /dial_results/1 PUT /dial_results/1.xml
[ { "docid": "821940363c10b03176039ef82bdcf27f", "score": "0.6304157", "text": "def update\n @dial_result = DialResult.find(params[:id])\n\n respond_to do |format|\n if @dial_result.update_attributes(params[:dial_result])\n flash[:notice] = 'DialResult was successfully updated.'\n ...
[ { "docid": "c2c0b673628fdc28b181d18c0afd2d5b", "score": "0.65373456", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "title": "" }, { "docid": "a6cb028915d2fc3389698931aafa5e35", "score": "0.57...
3e78721c612b69c4943a7b61c17b40bd
TODO: dirty updates reverts here?
[ { "docid": "3b61bcc01ff58cef827600f597fada11", "score": "0.0", "text": "def _in_place_definition_update\n t = OntologyClass.find(params[:id])\n t.update_attributes(:definition => params[:value].strip, :updated_by => Person.find($person_id))\n if t.save\n render :text => t.definition\n e...
[ { "docid": "470ad6ed6a3184ea5d1aed5cee420b97", "score": "0.76605093", "text": "def dirty; end", "title": "" }, { "docid": "cb2162d3a1fd3434effd12aa702f250f", "score": "0.7425259", "text": "def update() end", "title": "" }, { "docid": "5ca2caa1a207739e77f437de35e41cf1", ...
18e2b86e429e6fe541572867992ec86d
The hexagonal distance the item can reach.
[ { "docid": "fd5e190a10d1ce08a3002c8f7270b5c2", "score": "0.0", "text": "def ability_range\n return $1.to_i if self.note =~ /<grid[\\s_]*range:[\\s]*(\\d+)>/i\n return 1\n end", "title": "" } ]
[ { "docid": "d46fbedd813e00ec1f6a5405a577d690", "score": "0.70087516", "text": "def distance(toHex)\n\t\tfromHex = self\n\t\tcy = (fromHex.y - toHex.y).abs # change in y\n\t\tcx = (fromHex.x - toHex.x).abs # change in x\n\t\tdist = (cy > cx) ? cy : (cy + (cx-cy) / 2) #each cy gives you a free x move. ...
5310f582a5471bd28ca965fb54a63ae9
Set the value of the Currency input for this Choreo.
[ { "docid": "e8610501e22f1ab1873b8ffb29f5f737", "score": "0.7436132", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" } ]
[ { "docid": "3679414cdee6319cd5b5a309d3cf67f2", "score": "0.7706122", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "3679414cdee6319cd5b5a309d3cf67f2", "score": "0.7706122", "text": "def set_Currency(value)\n set...
44fa088d6afe5b89f972b6189d3c25af
PATCH/PUT /colors/1 PATCH/PUT /colors/1.json
[ { "docid": "f3cfe8d0e480336a599b8c45e8a8d7bc", "score": "0.6652569", "text": "def update\n respond_to do |format|\n if @color.update(color_params)\n format.html {redirect_to colors_path, :flash => {success: 'Color editado exitosamente'}}\n format.json {render :show, status: :ok, lo...
[ { "docid": "aae7791b432a3bcd840d92a9e483eecd", "score": "0.7073579", "text": "def update\n photo = Photo.find(params[:id])\n photo.update!(color: params[:color])\n render json: photo\n end", "title": "" }, { "docid": "5d115c60a6b653e0584f1040a1309a12", "score": "0...
1ff1389a7281f8e40a43858fb94b9fe3
Calls a specific Proc. Params: +int+:: Position of executed proc in the proc collection. Corresponding to item on the same position.
[ { "docid": "2922725b8e240869e2bde94b5397dc38", "score": "0.5625884", "text": "def executeMenuLambda(int)\n @MenuProcs[int].call\n end", "title": "" } ]
[ { "docid": "cd99c79b127c0b29455ce95c4bac1ac5", "score": "0.650524", "text": "def take_proc(proc) #defining the method\n [1, 2, 3, 4, 5].each do |number| #here, EACH number in the array is being called \n proc.call number #here the proc calls the number into its program\n end\nend", "title": "" ...
18228c5551aff55791bd63667b8e5690
Get the request params.
[ { "docid": "ebd798b1dc6a4a3499d558f7acc8bce1", "score": "0.7952163", "text": "def params\n @request.params\n end", "title": "" } ]
[ { "docid": "0595bbded25ca66aa52f2711a4ff20d4", "score": "0.8565253", "text": "def params\n request.params\n end", "title": "" }, { "docid": "8c8a0ab84caf8a46263111f2500a385d", "score": "0.8541355", "text": "def params\n request.params\n end", "title": "" }, ...
45ffb55f07dab777c2c1a2b1d8134f3a
GET /deliveries/1 GET /deliveries/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "deb7e47bb484bb4c93713b1c246b1b81", "score": "0.7491162", "text": "def index\n @deliveries = Delivery.all\n render json: @deliveries, status: :ok\n end", "title": "" }, { "docid": "87570f0bd82fb0605cd24ee5a45c8e94", "score": "0.7468894", "text": "def deliveries(para...
e7b013d71db7c69d82b05cc1534db5e2
Writes each argument to the stream, appending a newline to any item that does not already end in a newline.
[ { "docid": "02aa855053e70338fed4cabd652a13f4", "score": "0.61033684", "text": "def puts(*items)\n items.each do |item|\n data = item.to_s\n write(data[-1] == \"\\n\" ? data : \"#{data}\\n\")\n end\n nil\n end", "title": "" } ]
[ { "docid": "7393c69031d4e50e8d7e71320991d8aa", "score": "0.747616", "text": "def write_lines(*arguments)\n\t\t\t\tif arguments.empty?\n\t\t\t\t\t@stream.write(CRLF)\n\t\t\t\telse\n\t\t\t\t\targuments.each do |arg|\n\t\t\t\t\t\t@stream.write(arg)\n\t\t\t\t\t\t@stream.write(CRLF)\n\t\t\t\t\tend\n\t\t\t\te...
8f6f8892f9a091154dfa244b6742f46a
PUT /email_submissions/1 PUT /email_submissions/1.json
[ { "docid": "f875e7136dd585e7adb2a976760c1fe7", "score": "0.68065125", "text": "def update\n @emails = Email.all\n @messages = EmailMessage.all\n @email_submission = EmailSubmission.find(params[:id])\n\n respond_to do |format|\n if @email_submission.update_attributes(params[:email_submis...
[ { "docid": "e0723e7abf71c02bc4c2945b2fec269b", "score": "0.675152", "text": "def update\n respond_to do |format|\n if @submission.update(params.require(:submission).permit(:email))\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.js...
8a08b1c2d4fa0235505b5244c45ecbb6
Format error raised in loop_eval
[ { "docid": "d2973bb52a433c92df0c2cd20f7e4266", "score": "0.0", "text": "def format_error err\n \"#{err.class}: #{err.message}\\n #{err.backtrace.join(\"\\n \")}\"\n end", "title": "" } ]
[ { "docid": "cd7d5df1c3728f69a6cb12f944a15977", "score": "0.69521236", "text": "def print_eval_error err\n puts(format_error(err))\n rescue StandardError, SyntaxError => e\n Rib.warn(\"Error while printing error:\\n #{format_error(e)}\")\n end", "title": "" }, { "docid": "ad09e05ea58...
f9e83178065e224329cb9d068266f17e
TODO Add index for question id on prompts table
[ { "docid": "dfbd51e6a5bcc4b4f005b4ec8705f74f", "score": "0.0", "text": "def catchup_prompts_weights\n weights = Hash.new(0)\n throttle_min = 0.05\n #assuming all prompts exist\n\n #the_prompts = prompts.find(:all, :select => 'id, votes_count')\n #We don't really need to instantiate all the obj...
[ { "docid": "a856dfa5126b901b12a47a2389bfcf65", "score": "0.6652119", "text": "def question\n\t\t@question_id\n\tend", "title": "" }, { "docid": "55575cc6f2a27e76ac0ca7227a6ad296", "score": "0.6589773", "text": "def question\n # get the question for every user\n end", "title":...
c8c10616a2913010d386948e23047acb
POST /lift_instructors POST /lift_instructors.json
[ { "docid": "84c75fa8b3bcbd5560404a9cac6c0400", "score": "0.7309328", "text": "def create\n @lift_instructor = LiftInstructor.new(lift_instructor_params)\n\n respond_to do |format|\n if @lift_instructor.save\n format.html { redirect_to @lift_instructor, notice: 'Lift instructor was succ...
[ { "docid": "86d4805194a962ecf5be5f87315922b0", "score": "0.6810667", "text": "def index\n @lift_instructors = LiftInstructor.all\n end", "title": "" }, { "docid": "d942ad9fe01239d3a7192441ef564147", "score": "0.6792686", "text": "def create\n @instructor = Instructor.new(instr...
255d0691b03ad62a15a10ec28c145893
GET /purchases GET /purchases.json
[ { "docid": "ccaeacf67858285f373edb5f6a3f019e", "score": "0.7217834", "text": "def index\n @purchases = Purchase.all\n end", "title": "" } ]
[ { "docid": "8588dd22561e312be2cc7e4c7309ac42", "score": "0.8360539", "text": "def purchases; JSON[Api::get_purchases(self)]; end", "title": "" }, { "docid": "69c3956eab68345b758f3320de7f890b", "score": "0.76304215", "text": "def index\n @purchases = Purchase.all\n\n respond_to ...
5bf84e256b0f30314ada00ae9e5f8fd3
Filter this library out of the backtrace on a failure. preserve original call then call again to remove this directory from the backtrace
[ { "docid": "b4490e6abf847c89040e883e9e9f3010", "score": "0.6076825", "text": "def filter_backtrace_with_lightning_test backtrace, prefix=nil\n rv = filter_backtrace_without_lightning_test(backtrace, prefix)\n rv = filter_backtrace_without_lightning_test(rv, File.dirname(__FILE__))\n rv\n end",...
[ { "docid": "b522c916ad0fbf86f208c447fff4ab7b", "score": "0.73085696", "text": "def clean_backtrace(&block) #:nodoc:\n # Modified from Rails' version\n begin\n yield\n rescue Object => error\n library_path = Regexp.new(\n File.expand_path(\"#{File.dirname...
e204b7c40730cafe36cae291681bc21d
Gets the verticalAlignment property value. Represents the vertical alignment for the specified object. The possible values are: Top, Center, Bottom, Justify, Distributed.
[ { "docid": "3d46ff2705be77642e67b62d544e525b", "score": "0.78158396", "text": "def vertical_alignment\n return @vertical_alignment\n end", "title": "" } ]
[ { "docid": "920d986b372fbaeed3e1f8eb26357280", "score": "0.7632121", "text": "def vertical_alignment=(value)\n @vertical_alignment = value\n end", "title": "" }, { "docid": "ce2572ca8771ec3a91153286d3b1e2c9", "score": "0.7601971", "text": "def vertical_align...
66e21a458b23cce0f48c359b9d8b7d7d
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
[ { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.0", "text": "def context; end", "title": "" } ]
[ { "docid": "d1758edd04b6374162470ca44c3f1250", "score": "0.687208", "text": "def context\n unless @instance_context\n @instance_context = AuthTokenPromotionContext.new(@version )\n end\n @instance_context\n ...
085526ac4a8bd22db4d8b27dee6bc82f
Takes an array of +absolute_paths+ and turns it into an array of paths relative to +dir+
[ { "docid": "2f6f7a9cf2f75ff0f5c668c22a4633f7", "score": "0.7360349", "text": "def to_relative(dir, absolute_paths)\n dir = File.expand_path(dir)\n absolute_paths.collect{|p| File.expand_path(p)[dir.length+1..-1]}\n end", "title": "" } ]
[ { "docid": "ea7f503bfbe1879627d75f292ba928ad", "score": "0.7307311", "text": "def relativize_paths(paths)\n return paths unless relativize_paths?\n paths.map do |path|\n path.gsub(%r{^(!)?#{ @directory }/},'\\1')\n end\n end", "title": "" }, { "docid": "8bc3695a09b2ca0...
6482beda7de49efb7bb251b7a32e3682
as simple as i could think to start with.
[ { "docid": "4e070aa7d2c41a9c862a09b79c6f863f", "score": "0.0", "text": "def add_or_remove_cash(pet_shop,cash_add)\n pet_shop[:admin][:total_cash] = pet_shop[:admin][:total_cash] + cash_add\n end", "title": "" } ]
[ { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6505663", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6505663", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",...
460bafc55ab39e95ba98e38cdfd5cb6f
Parser must have a lots of methods (see /usr/lib/ruby/1.8/rexml/parsers/streamparser.rb) We dont need most of them in AwsParser and method_missing helps us to skip their definition
[ { "docid": "6b572f5c321ec893e4ae9727176141ae", "score": "0.5504443", "text": "def method_missing(method, *params)\n # if the method is one of known - just skip it ...\n return if [:comment, :attlistdecl, :notationdecl, :elementdecl,\n :entitydecl, :cdata, :xmldecl, :attlistdecl...
[ { "docid": "4d88da413eaad1254b88d8317d6c8a3d", "score": "0.68930215", "text": "def parse_method; :unknown; end", "title": "" }, { "docid": "91ee59b967b77543cddb7c8207465cac", "score": "0.6720477", "text": "def parse! parser\n raise NotImplementedError\n end", "title": "" },...
6fb6a4c783f2e46277c437d9a51cecda
=begin Understanding the problem every character has an ascii value we would like to sum up the ascii values of a given string if the string has length 0, the result should be 0 Algorithm: create array of chars in the string (use Stringchars) map chars to their ascii values (use Enumerablemap and Stringord) add all the...
[ { "docid": "1748def2e2616941e5ecab1eafc04541", "score": "0.70625967", "text": "def ascii_value(string)\n string.chars.map { |char| char.ord }.inject(0, &:+)\nend", "title": "" } ]
[ { "docid": "a89c7bb90414f60f376b18da132205d8", "score": "0.795018", "text": "def ascii_sum(str)\n return nil if (!str.is_a? String) || str.empty?\n\n sum = 0\n str.each_char do |e|\n if (e =~ /[[:alpha:]]/) != 0\n sum = nil\n break\n end\n sum += e.upcase.ord\n end\n sum\nend", ...
c4675cc771002a3f651f5fcafe86a4e6
combine firecloud_project & firecloud_workspace for use in generating URLs (via firecloud_link_for)
[ { "docid": "40e5ca26add4aa67b485cda79a7c4f9c", "score": "0.61039156", "text": "def display_name\n \"#{self.firecloud_project}/#{self.firecloud_workspace}\"\n end", "title": "" } ]
[ { "docid": "39d150e53cd3f79fe6e37c39cbd2f756", "score": "0.707561", "text": "def workspace_url\n \"https://portal.firecloud.org/#workspaces/#{self.firecloud_project}/#{self.firecloud_workspace}\"\n end", "title": "" }, { "docid": "631981f6c19cbce124cc28d56f8a1005", "score": "0.662692...
ef832d8a183e50fe5ab5f29ceb9b10b4
DELETE /grade_classes/1 DELETE /grade_classes/1.json
[ { "docid": "71b6a05dfd2b395a8140f9a2e8208d09", "score": "0.7914369", "text": "def destroy\n @grade_class.destroy\n respond_to do |format|\n format.html { redirect_to grade_classes_url, notice: 'Grade class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "53657d183badde834f4867742fd727a6", "score": "0.743541", "text": "def destroy\n @grade = Grade.find(params[:id])\n @grade.destroy\n\n respond_to do |format|\n format.html { redirect_to grades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, ...
a413ef030d3232205851cf5ad47c8703
GET /users/1 GET /users/1.xml
[ { "docid": "ae7e98ce46732a197762c6a5803e3d14", "score": "0.0", "text": "def show\n @page_title = \"User Details\"\n \n @admin_section = true\n @tabs = true\n \n @user = User.find(params[:id])\n \n @user_asset = UserAsset.new\n @user_asset.user_id = @user.id \n \n @cours...
[ { "docid": "81f820aba49ac09ba424a3c44ecb4bf8", "score": "0.80139303", "text": "def account_users \n make_request(:get,\"#{account_url}/users.xml\")\n end", "title": "" }, { "docid": "ecc296ddabf83c44bc2e12a4a9eba06b", "score": "0.7118081", "text": "def show\n @users = User...
385582907bc0bf2c67ec1f4f7850bb67
Reassign a group sponsor to another group member
[ { "docid": "402bebdd9810365bffaeca46cae479ab", "score": "0.72352767", "text": "def reassign_sponsor(user_id)\n current_sponsor = adult_sponsor\n proposed_sponsor = self.users.find(user_id)\n if current_sponsor && proposed_sponsor\n current_sponsor.change_role_level(\"member\")\n propo...
[ { "docid": "897a14e9df326c1ad3858e19fd8b2a6b", "score": "0.6300726", "text": "def set_sponsor(id)\n @sponsor = Sponsor.find(id)\n end", "title": "" }, { "docid": "b4f234d7bcfa3689ad7daa24a00e8921", "score": "0.62871635", "text": "def set_sponsor\n @sponsor = Sponsor.find...
91c80b1001fe371dd1fbaf2d7040a332
Returns the value of attribute subscribe_sql_active_record. source://rackminiprofiler//lib/mini_profiler.rb21
[ { "docid": "5bd79b8c4ba9c668d032973ab7365a04", "score": "0.7436666", "text": "def subscribe_sql_active_record; end", "title": "" } ]
[ { "docid": "65ee1b84072b7c0b744c54c0b84835ec", "score": "0.7089065", "text": "def subscribe_sql_active_record=(_arg0); end", "title": "" }, { "docid": "18141f7a41af6b990206cd557ddcdf59", "score": "0.55882096", "text": "def with_sql_subscription\n ActiveSupport::Notifications.sub...
ccd926a2976957610d2c87f946b82369
Returns the previous slice in the container, or +nil+ if this is the first slice.
[ { "docid": "b0ebfdc2c09011c4b7cf352d3bee4d4f", "score": "0.7974498", "text": "def previous_slice\n index = peers.index(self) - 1\n index < 0 ? nil : peers[index]\n end", "title": "" } ]
[ { "docid": "55134b6e65569152693f46babf1a1e6e", "score": "0.7572584", "text": "def prev\n\t\tif(@index>1)\n\t\t\t@index-=1\n\t\t\treturn @data[@index-1]\n\t\telse\n\t\t\treturn nil\n\t\tend\n\tend", "title": "" }, { "docid": "34b604dacfc538fcd09807333dc9510a", "score": "0.74020964", "...
e07e589575e76f8d4489518194c867ee
Metodo que revisa la correctitud de la clase Booleano
[ { "docid": "7f958fcef3165b54dfd9af672133cdde", "score": "0.0", "text": "def check tabla, tipoF = nil\n\t\t@tipo = \"boolean\"\n\t\t@inicio = @nombre.linea\n\tend", "title": "" } ]
[ { "docid": "14c6d6891ad527d77c6e8e8bde6f93d9", "score": "0.74214906", "text": "def boolean; end", "title": "" }, { "docid": "6d2b243e5e91467886f7fe160eaae851", "score": "0.7270188", "text": "def make_true; end", "title": "" }, { "docid": "6d2b243e5e91467886f7fe160eaae851"...