query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
0182cabadbb60586ea72a1efd2efd4ed
Get all file from drive folder
[ { "docid": "b0f621388aff164c50b23e79f4e112cb", "score": "0.71840334", "text": "def get_drive_files_list(folder)\n ls = Hash.new\n page_token = nil\n begin\n (files, page_token) = folder.files(\"pageToken\" => page_token)\n files.each do |f|\n ls[f.original_filename]...
[ { "docid": "ece649cd0ac9352e9373c8b606c527cc", "score": "0.76029235", "text": "def list_file\n result = @client.execute(\n api_method: drive.files.list\n )\n notify \"LIST RESULT : #{result.data.inspect}\" \n result.data.items.each do |item|\n if item.mime_type =~ %r{...
e4f3355aee0f8c8af17f18e8ffe2322b
Draws the game field on the console using cyan background color.
[ { "docid": "4d01bd8477a812699cf06812b857b684", "score": "0.70899206", "text": "def draw\n\t\tfield.each do |arr|\n\t\t\tarr.each { |i| print \" #{i} \".black.bg_cyan }\n\t\t\tputs\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "4906d3ee20599f48aa5701edcfb34918", "score": "0.7263046", "text": "def draw_game_field\n\t\tsystem 'clear'\n\t\tputs \"My field:\".green.bold\n\t\t@human.field.draw\n\t\tputs \"\\nComputer's moves:\".blue.bold\n\t\t@computer.draw_opponent_field_map\n\t\tputs \"\\nMy moves:\".blue.bold\n\t\t@h...
f87a280dfb3550876fa8c27b4e7b8c24
def over? if draw? true elsif won? true else false end end
[ { "docid": "504f66223acb929547191247f326f375", "score": "0.9407686", "text": "def over?\n draw? || won?\n end", "title": "" } ]
[ { "docid": "8d78a64db2b7177bf60abcbd0354f8b3", "score": "0.94815063", "text": "def over?\n draw? || won? ? true : false\n end", "title": "" }, { "docid": "8d78a64db2b7177bf60abcbd0354f8b3", "score": "0.94815063", "text": "def over?\n draw? || won? ? true : false\n end", "...
054a33125a6af09a017a19ebaca28eb5
POST /tutors POST /tutors.json
[ { "docid": "08b7d321896aa0bfb46d2ecf802df82d", "score": "0.0", "text": "def create\n\n # id=params.require(:tutor).permit(subject_ids:[])\n\n @tutor = Tutor.new(tutor_params)\n\n @user=current_user\n\n @user.is_tutor=true\n\n @tutor.user=@user\n\n\n point=Geocoder.coordinates(@tutor.ad...
[ { "docid": "abe4638d33dcb5aa5cf92d5d96e99c41", "score": "0.7089422", "text": "def create\n\t\t@tut = Tutorial.new(tut_params)\n\t\tif @tut.save\n\t\t\trender json: @tut, status: :created\n\t\telse\n\t\t\t render json: @tut.errors, status: :unprocessable_entity\n\t\tend \n\tend", "title": "" }, {...
f5afc513e574358b0abcd997c5157fb0
End for Iter 22 Sets the password reset attributes.
[ { "docid": "a7247cea15336b71b41c4dd6611aa8bb", "score": "0.0", "text": "def create_reset_digest\n self.reset_token = User.new_token\n update_attribute(:reset_password_token, User.digest(reset_token))\n update_attribute(:reset_password_sent_at, Time.zone.now)\n end", "title": "" } ]
[ { "docid": "98de200108c1574665172060e7feef6b", "score": "0.65118694", "text": "def reset_password\n klass = Pillowfort.config.token_class.to_s.classify.constantize\n random = klass.friendly_secret(40)\n\n self.password = random\n self.password_co...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "d01d515897823ec33729b37d12df1345", "score": "0.0", "text": "def user_params\n params.require(type.underscore.to_sym).permit(:names, :lastnames, :type, :age, :cellphone, :email, :init_preg_week, :salary, :category_id, :password)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
31c510a2e561045b680257dd03f9f5db
do not write to log password filter_parameter_logging :password GET /users GET /users.xml
[ { "docid": "100592add7c7869628dcbc9007646678", "score": "0.0", "text": "def index\n @users = User.all\n @title = \"users\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end", "title": "" } ]
[ { "docid": "3100f9d0b6167d98e0613f51a93259e6", "score": "0.61125547", "text": "def params_filters\n @params_filters ||= %w(password)\n end", "title": "" }, { "docid": "3100f9d0b6167d98e0613f51a93259e6", "score": "0.61125547", "text": "def params_filters\n @params_filters...
91d4171823c9e87fb63cd1ae35384042
PATCH/PUT /kelas/1 PATCH/PUT /kelas/1.json
[ { "docid": "bb2387e6b155d1f2c6f4f8e751f27907", "score": "0.68176705", "text": "def update\n respond_to do |format|\n if @kela.update(kela_params)\n format.html { redirect_to @kela, notice: 'Kela was successfully updated.' }\n format.json { head :no_content }\n else\n fo...
[ { "docid": "4e0e59715d19dce2a47fccc2c67326dd", "score": "0.6629407", "text": "def patch!\n request! :patch\n end", "title": "" }, { "docid": "e7663d0348b74542ff1d2f4fd96156fe", "score": "0.6474783", "text": "def api_patch(path, data = {})\n api_request(:patch, path, :data =>...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e2f98bb8504031a2c32e7ec7e3b1002d", "score": "0.0", "text": "def project_params\n params.require(:project).permit(:name, :directory)\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...
6f8b4429c4916778a61014c2b98a365d
M E T H O D S
[ { "docid": "279a16828eadf87d67e1525e083c29b7", "score": "0.0", "text": "def certificate_list\n certificates = self.certs #[0].certificate.name\n list = certificates.collect! {|x| x.certificate.name + \"; \" }\n list.join()\n end", "title": "" } ]
[ { "docid": "afbc4c54dabf4c09a70792d90ead3525", "score": "0.6562585", "text": "def sn\n end", "title": "" }, { "docid": "390e283749098492e2050521dbffffe5", "score": "0.6037666", "text": "def message() end", "title": "" }, { "docid": "ad244bd0c45d5d9274f7612fa6fee9...
c2e92f3f49eaf7c728cbdc0ae8fd0460
Update OptionSelects for the provided group option name. Just a helper to UI method "opt_select"
[ { "docid": "df1d3bb653176235fb4e209687470661", "score": "0.0", "text": "def opt_select(var_name, *extra_stuff, &b)\n self.class.opt_select(var_name, *extra_stuff, &b)\n end", "title": "" } ]
[ { "docid": "9a4c308e6015f62a406113c357f88a5f", "score": "0.6197925", "text": "def set_option_group\n @option_group = OptionGroup.find(params[:id])\n end", "title": "" }, { "docid": "8171c074d7d469e319dcb09ca4cb7214", "score": "0.61518997", "text": "def update\n respond_to ...
a39ce96fa99c119f7ce688b00f0df504
Write a method that takes in two strings and prints a concatenation of those two strings, for example the arguments could be (man, woman) and the end result might be "When Harry Met Sally". Then, call that method.
[ { "docid": "cb4ba20ede8e3ee1e14aa1ebffddfcb9", "score": "0.0", "text": "def movie_script(man, woman)\n puts \"#{man} did not know that this trip to the beach with some friends will change his life,\"\n puts \"and the reason was #{woman}.\"\n end", "title": "" } ]
[ { "docid": "7c97df6a99db437d1e39c953d38a097e", "score": "0.79490364", "text": "def concatenate(first_string, second_string)\n puts \"Greetings #{first_string}, shall we play #{second_string}?\"\n#OR puts \"Greetings \" + first_string + \", shall we play \" + second_string + \"?\"\nend", "title": ""...
ccac324a90659c8a5271b5d4adadfdd3
This method mirrors the one in the MediaObject model but makes use of the master files passed in which can be SpeedyAF Objects This would be good to refactor in the future but speeds things up considerably for now
[ { "docid": "2a96352a47efe47954e43b541fea2e35", "score": "0.0", "text": "def gather_all_comments(media_object, master_files)\n media_object.comment.sort + master_files.collect do |mf|\n mf.comment.reject(&:blank?).collect do |c|\n mf.display_title.present? ? \"[#{mf.display_tit...
[ { "docid": "b0cca0ea4de2326f516d9ef9184c3626", "score": "0.6594156", "text": "def update_master_files(context)\n media_object = context[:media_object]\n files = context[:master_files] || {}\n deleted_master_files = []\n if not files.blank?\n files.each_pair do |id,master_file|\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "1993b5989e9748efd1330d5a1e1b0f96", "score": "0.0", "text": "def trend_params\n params[:trend]\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496205", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957069", "text": "def strong_params\n params.require(:request).permit(param_white...
44b567c1df764e577165343afced2de4
does tests for proper handling of string names for booleans (true/false)
[ { "docid": "8c00b2c514090cc94dc87b16c58659cb", "score": "0.0", "text": "def test04\r\n @connection.start_transaction do |tx|\r\n stmt = Statement.new(@connection, tx,\r\n \"insert into bool_types values(?)\",\r\n 3)\r\n \r\n\t...
[ { "docid": "2b7eb1f492150c80475e92951517b1f8", "score": "0.75757235", "text": "def to_bool(questionable_string)\n if questionable_string == \"true\"\n true\n else\n false\n end \nend", "title": "" }, { "docid": "fed84a1a7884289cb3bd1746f7c13cf8", "score": "0.75...
40fd0575ca9b570d46cc0a2598bbcc03
Fix noteid parameters with bad prefixes (some application servers, e.g., Apache, NGINX, mangle encoded slashes).
[ { "docid": "f65e015b84f153640ef8100123cc3c34", "score": "0.7074393", "text": "def clean_note_id(id)\n id = id.match(/\\Ahttp:\\/\\w/) ? id.sub('http:/', 'http://') : id\n CGI.unescape(id)\n end", "title": "" } ]
[ { "docid": "2cdb54cefb75a79dd397311b490dea18", "score": "0.6255217", "text": "def fixed_id\n\n # replace scheme:/X with scheme://X\n # from rfc3986 section 3.1 (page 16):\n # scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n params[:id].sub %r{^([a-z][a-z0-9\\+\\-\\.]*):/([^/]+)}...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b353ac9e06f5c66c3009a07754b51150", "score": "0.0", "text": "def user_params\n params.require(:user).permit(:name, :line1, :line2, :city, :state, :zip, :phone)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6979893", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781746", "text": "def strong_params\n params.requi...
c367c7c9da1ebd46e51ebbb07e22d5e4
DON'T USE THIS ONE USE replace2
[ { "docid": "671313f7d785440ca7932369a58e91f3", "score": "0.0", "text": "def replace!(match, repl)\n self.each_index {|i|\n if self[i] == match\n self[i] = repl\n else\n self[i].replace!(match, repl) if self[i].is_a? Sexp\n end\n }\n end", "title": "" } ]
[ { "docid": "507b24e65f40076ed9a9098c7426bee0", "score": "0.8071142", "text": "def replace; end", "title": "" }, { "docid": "3a0cfc7d602e0d369f5db5d1d60c5440", "score": "0.717706", "text": "def gsub!(x,y) end", "title": "" }, { "docid": "359dbf55d675d678dd8c96e5a1f75417", ...
ff3f3f5db3580bde440bb156abdc92cb
Searches for the specified text which MUST NOT be a product item code (SKU)
[ { "docid": "b978f5bea900416f136664ecc3af07c3", "score": "0.5118477", "text": "def search_for_text(text)\n fail \"INTERNAL ERROR: In method call to 'search_for_text' no text was entered\" if text == nil\n self.search_text = text\n submit_search\n if Capybara.current_session.current_url.includ...
[ { "docid": "ed1ce4095d53039d83000a94aecd7c7b", "score": "0.59753484", "text": "def text_not_search (string,text)\n\tif $browser.text.include? string \n\t\tputs \"Error: #{text} should not be present\"\n\tend\nend", "title": "" }, { "docid": "888f5007ae7e2e57d25ea6a40694f8f3", "score": "0...
29ea5fd604c0263235aeaf6a31929e2b
Get the features of every fragment.
[ { "docid": "d78f5c02fb60353831d413f4bfe272d4", "score": "0.5855781", "text": "def featurize(doc)\n frag = nil\n doc.frags.each do |frag|\n get_features(frag, self)\n end\n end", "title": "" } ]
[ { "docid": "32c3b4f320b18c3926c5f0259c3aef01", "score": "0.6801339", "text": "def get_features(frag, model)\n w1 = (frag.cleaned.last or '')\n w2 = (frag.next or '')\n\n frag.features = [\"w1_#{w1}\", \"w2_#{w2}\", \"both_#{w1}_#{w2}\"]\n\n if not w2.empty?\n ...
7a0c0740644019418e8a43a3249a8b36
checks if the current status of the device is :closed
[ { "docid": "fa1bb9270e80a6285ea84d227b80d3c1", "score": "0.8205322", "text": "def closed?\n status == :closed\n end", "title": "" } ]
[ { "docid": "fd4238b819eb516f267bf846233b57de", "score": "0.8217492", "text": "def closed?\n self.status == 'closed'\n end", "title": "" }, { "docid": "1a9a9c76d361f081b8f1f740fea321be", "score": "0.8196223", "text": "def closed?\n @status == :closed\n end", "title": "...
991c7891aa1bc5c92d48e81a69932827
because they belong to the versions to keep
[ { "docid": "f2c4352b2c625cdc3082fb7357238c6f", "score": "0.60791963", "text": "def verification_ids_to_keep_for_version_ids_to_keep\n @verification_ids_to_keep_for_version_ids_to_keep ||= resolve_ids(db[:verifications].select(:id).where(provider_version_id: version_ids_to_keep))\n end", ...
[ { "docid": "fb6520dd9884440fa0fba832aa380181", "score": "0.67700005", "text": "def versions_delete_markers; end", "title": "" }, { "docid": "d07ece6f91aec39ac76aed7a28037922", "score": "0.6562968", "text": "def clean_old_versions( versions_to_keep )\n find( :all, :conditions...
a2415b613fb393756e8e31a7e119de80
Initialize a new instance
[ { "docid": "73f630f1e3d42d0bb24e723b6ccf7762", "score": "0.0", "text": "def initialize(**opt)\n opt = opt.dup\n @url = opt.delete(:url) || BASE_URL\n @options = opt\n end", "title": "" } ]
[ { "docid": "7b2a9c01c879a0b2fdf74f0f38b03e4e", "score": "0.84960294", "text": "def initialize\n initialize!\n end", "title": "" }, { "docid": "7b2a9c01c879a0b2fdf74f0f38b03e4e", "score": "0.84960294", "text": "def initialize\n initialize!\n end", "title": "" }, ...
68775f854ee3419c6bb6116ab72875fa
safe call to push! which blocks until the fifo is not full
[ { "docid": "e3e08719ed84fb75f122ee7e0c4570ed", "score": "0.71937567", "text": "def push &put\n #Thread.pass while self.full?\n sleep 0.01 while self.full?\n self.push! &put\n end", "title": "" } ]
[ { "docid": "3acaceceb06aabc54e368d54a144ae6e", "score": "0.7115878", "text": "def push\n begin\n write_data\n rescue LockMethod::Locked\n sleep 0.5\n push\n end\n end", "title": "" }, { "docid": "96fe9d233b4856fcdff284151d4e6f17", "score": "0.66085345", "text...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "8676f70623b09203865624ff2621e86d", "score": "0.0", "text": "def world_import_params\n params.require(:world_import).permit(:import_to_uri, :import_from_uri)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7493595", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6954758", "text": "def strong_params\n params.require(:request).permit(param_white...
80a42bcfdcbcfe7d911ad713c2dd9c4f
Returns a bill and it's votes from the API given it's slug
[ { "docid": "1974162986a82ad61fb4e5c5a007ca9c", "score": "0.842028", "text": "def bill_votes_from_api(slug)\n # Get the bill from the API and turn it into a hashie\n url = \"#{CONFIG['base_url']}/api/bills/\" + slug\n bill = Hashie::Mash.new HTTParty.get url\n\n # Get the % of upvotes on the ...
[ { "docid": "11ec775e5c0f67adfdcc03d62c585ff0", "score": "0.6437664", "text": "def get_specific_bill_from_api(pp_bill_id)\n api_url = \"https://api.propublica.org/congress/v1/#{pp_bill_id.split(\"-\")[1].to_s}/bills/#{pp_bill_id.split(\"-\")[0].to_s}.json\"\n response_string = RestClient::Request.execu...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d02534030959602e946263c872d52fb6", "score": "0.0", "text": "def set_best_feature\n @best_feature = BestFeature.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...
9b77ad5e2d0dc02ffc58cab1a13d4efd
PUT /app_submissions/1 PUT /app_submissions/1.xml
[ { "docid": "fcf0e3e36502f669fe26ab7e3736082a", "score": "0.63844645", "text": "def update\n @app_submission = AppSubmission.find(params[:id])\n\n respond_to do |format|\n if @app_submission.update_attributes(params[:app_submission])\n format.html { redirect_to(admin_app_submission_path...
[ { "docid": "ad54471b285e5e357d9be959c8ade2d8", "score": "0.6325538", "text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content...
44872f21ef2b2a8d2cc9e2043d512c3e
Process an incoming message from the EC. This method is called by the callback hook, which was set up in the 'start' method of this Communicator. First, we parse the message to extract the command and its arguments. Then, we check if this command should trigger some Communicatorspecific actions. Finally, we pass this c...
[ { "docid": "47f33dbb0d9358465a24bb8b283fd5d3", "score": "0.7597226", "text": "def execute_command (event)\n\n # Extract the Message from the PubSub Event\n begin\n message = event.first_element(\"items\").first_element(\"item\").first_element(\"message\").first_element(\"body\").text\n i...
[ { "docid": "51b56e4371a34f372fe9eff3b2f4764d", "score": "0.7240986", "text": "def execute_command (event)\n # Extract the Message from the PubSub Event\n begin\n message = event.first_element(\"items\").first_element(\"item\").first_element(\"message\").first_element(\"body\").text\n inc...
6892e6043f442b4d4abbeae21e290b1a
create engineer, return engineer or error message
[ { "docid": "161d6cf4b317b9fa419470fd6f9bf991", "score": "0.7890235", "text": "def create\n\t\tengineer = Engineer.create(engineer_params)\n\n\t\tif !engineer.errors.any?\n\t\t\trender json: engineer\n\t\telsif engineer.errors.messages[:name][0] == \"has already been taken\"\n\t\t\trender json: {message:...
[ { "docid": "281a43bc71e247bb91856f6a6fa166f5", "score": "0.7055746", "text": "def create\n @engineer = Engineer.new(params[:engineer]) \n respond_to do |format|\n if @engineer.save\n flash[:notice] = 'Engineer was successfully created.'\n format.html { redirect_to(@engine...
68c765af27d9cbcad029b7abaf742c44
index refers to the index.html.haml template, nothing to do with DB.
[ { "docid": "4c16a8ecaf9bccdbc8ce783816b4f69d", "score": "0.0", "text": "def as_index_string\n case type\n when \"text\" then \"truncate(#{model.name.as_singular}.#{name}, length: 30)\"\n else \"#{model.name.as_singular}.#{name}\"\n end\n end", "title": "" } ]
[ { "docid": "86d1075b6dc915eb03de206cf790a1ae", "score": "0.7731564", "text": "def index\n\t\tprepare_variable_for_index_template\n\tend", "title": "" }, { "docid": "f6e7209f8e8edb2483c2aa60c70368fe", "score": "0.74716604", "text": "def index_template\n :index\n end", "title":...
007ba91bcfe25e20441353057cac78f3
Get the header day HTML's code
[ { "docid": "db266a0880937999b47b4f345e5184f0", "score": "0.755366", "text": "def calendar_header_day(name)\n html = \"\\t\\t<div class=\\\"#{CSS_CALENDAR_COL} #{CSS_CALENDAR_HEADER}\\\">#{name}</div>\\n\"\n html.html_safe\n return html\n end", "title": "" } ...
[ { "docid": "0689984cd9e363ee231f7fc3715b639b", "score": "0.7535236", "text": "def calendar_header_days\n html = calendar_header_day(l('date.day_names')[@refdate.cwday % 7])\n html.html_safe\n return html\n end", "title": "" }, { "docid": "8fad59a85ac18...
c48e191115121c7100a8779deb388160
Execute BLOCK, passing each section in this file as an argument
[ { "docid": "5efc2fb2fa8c802d3959a182319963fc", "score": "0.6582069", "text": "def each_section(&block)\n @files.each do |file, list|\n list.each do |entry|\n yield(entry) if entry.is_a?(Section)\n end\n end\n end", "title": "" } ]
[ { "docid": "3d22dbcb285f9c0ff26fdb8f6f76afa7", "score": "0.66520154", "text": "def sections(*args); end", "title": "" }, { "docid": "a0514c72bc6e6ef02c348b4371a7a93f", "score": "0.65184873", "text": "def process_blocks(blocks); end", "title": "" }, { "docid": "4844169ab2e...
459f1ce892c800ba590e5d26b0f84440
output for zsh autocompetion, print out id, title and cleaned url
[ { "docid": "a1d930dae30b82d4925ea7b9da2263cb", "score": "0.5521021", "text": "def autocomplete\n @allurls.each do |url|\n name = clean_name(url)\n link = clean_link(url)\n puts url.id + \":\" + name + \":\" + link\n end\n end", "title": "" } ]
[ { "docid": "dfa839156cb6b87393ba34145f9d1e50", "score": "0.61994904", "text": "def print_url_info(url_string)\nputs \"\\n////////////////////////////////////////////////////////////////////////////////\\n\\n\n Build submitted. To view your build progress, go to\\n#{url_string}\\n\\n\n//////////////////...
19149d686b80a1f4af366295a290d1dc
GET /riders/1 GET /riders/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "da1c3f5e4f8fd4c01bd95ec0dd616230", "score": "0.74036187", "text": "def index\n @riders = Rider.all\n render json: @riders\n end", "title": "" }, { "docid": "273c3d03f0844c4bba6f3ab3182173da", "score": "0.7351844", "text": "def index\n @riders = Rider.all\n\n ...
080da3f231df0f818665c0ea7b2b27a3
DELETE /photo_types/1 DELETE /photo_types/1.json
[ { "docid": "e53e457d0a0ab2e25010236a1ce07288", "score": "0.7687124", "text": "def destroy\r\n @photo_type.destroy\r\n respond_to do |format|\r\n format.html { redirect_to photo_types_url, notice: 'Photo type was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r...
[ { "docid": "dbad7a0db3b293049840e4db6e7831d5", "score": "0.7663999", "text": "def destroy\n @photo_type = PhotoType.find(params[:id])\n @photo_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(photo_types_url) }\n format.xml { head :ok }\n end\n end", "title...
91f6b668ee9c88968c0c89f45c89f56f
Function to install payload as a service
[ { "docid": "857932b642d0b2faf9024ee5672dd0b9", "score": "0.58174884", "text": "def install_as_service(script_on_target)\n if not is_uac_enabled? or is_admin?\n print_status(\"Installing as service..\")\n nam = Rex::Text.rand_text_alpha(rand(8)+8)\n print_status(\"Creating service #{nam...
[ { "docid": "b8c94ed3128515a4efd544bb0638b52a", "score": "0.6670307", "text": "def add(payload) # :args: :name, :serverName, :serviceType, :port\n raise ArgumentError, 'payload cannot be null' if payload.nil?\n payload = Netscaler.hash_hack(payload)\n validate_payload(payload, [:name, :se...
0711542842c77aa8d58efa7c86096b8f
5 points Write a program that follows the execution of a block and a method. It will display a short message informing the user when execution has reached both the method and the block. For example: $ ruby exercise1.rb Executing the method Executing the block TIP: Don't over think this one. The simpler the better.
[ { "docid": "fc1992ae5765707ada4d474b1e57f0fb", "score": "0.69909614", "text": "def follow_the_execution(&block)\n puts 'Executing the method'\n block.call\nend", "title": "" } ]
[ { "docid": "f5f0c14a1efccf7c92ac7892ba53cc75", "score": "0.73429275", "text": "def follow_the_execution(method_param1, method_param2, &block)\n puts 'Executing the method'\n puts \"method_param1 is #{method_param1}\"\n puts \"method_param2 is #{method_param2}\"\n block.call('lunch', 'tacos')\nend", ...
23082e3ffebbb82f72d0cd67548dc24e
DELETE /functions/1 DELETE /functions/1.json
[ { "docid": "67fbbc1ed3177b9aadfc4397e0140de8", "score": "0.0", "text": "def destroy\n @technique.destroy\n respond_to do |format|\n format.html { redirect_to techniques_url, notice: 'Function was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title":...
[ { "docid": "df68c546037e38a96a89255500e04312", "score": "0.720524", "text": "def destroy\n @admin_function.destroy\n respond_to do |format|\n format.html { redirect_to admin_functions_url, notice: 'Function was successfully destroyed.' }\n format.json { head :no_content }\n end\n end...
5823c75f7437cf9f59a185b6d2ebf8b8
GET /posts/1 GET /posts/1.json
[ { "docid": "46730ba09da49d458587b456121d4042", "score": "0.0", "text": "def show\n @album_attachments = @album.photos.all\n end", "title": "" } ]
[ { "docid": "c884d3048f42b4b1b768c271940bbed7", "score": "0.74366486", "text": "def show\n post_id = params[:id]\n render json: V1::Post.get_a_post(post_id)\n end", "title": "" }, { "docid": "fb578f587fdfe1b0a8d3ac27001f9611", "score": "0.736357", "text": "def index\n ...
48d4c3c8bce7f0026d6c94e47bd44871
DELETE /diagnostic_amiantes/1 DELETE /diagnostic_amiantes/1.json
[ { "docid": "1ce9052ff347b03e50759a81d6ff2d2a", "score": "0.7735999", "text": "def destroy\n @diagnostic_amiante.destroy\n respond_to do |format|\n format.html { redirect_to diagnostic_amiantes_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "dd5e6595c0b9c2edc0e4d3d21a72b7c8", "score": "0.7275945", "text": "def destroy\n @diagnostic_test = DiagnosticTest.find(params[:id])\n @diagnostic_test.destroy\n\n respond_to do |format|\n format.html { redirect_to client_diagnostic_tests_url }\n format.json { head :ok }\n ...
6250e5aa45747acdf24cb46c63cc9aab
Method to check if it's a Full House Three of a kind with a pair
[ { "docid": "77cdc9705259e3edfb619eb1da0e5438", "score": "0.77104783", "text": "def fullhouse(array)\n i = 0\n t = false\n pa = false\n \n # Check if it has 3 of a kind and a pair\n for elements in array\n if array[i] == 3\n t = true\n i += 1\n elsif array[i] == ...
[ { "docid": "c56220706a13adce74502d5bc93a3590", "score": "0.8192965", "text": "def full_house?(h)\n one_pair?(h) && three_of_a_kind?(h)\n end", "title": "" }, { "docid": "3605e8a1fffa531b07247e11762dd055", "score": "0.79486287", "text": "def full_house\n return unless t...
56a0a00a7a63d177ca9cde8f610dc8a5
PUBLIC INTERFACE INTER FACE TO CONF TREE Return summary of configuration
[ { "docid": "5d4bf6d678b074aab8d5d52faff50d09", "score": "0.0", "text": "def Summary\n summary = \"\"\n summary = Summary.AddHeader(summary, _(\"Drives\"))\n num = Builtins.size(@AutoPartPlan)\n summary = Summary.AddLine(\n summary,\n Builtins.sformat(_(\"Total of %1 dri...
[ { "docid": "08d0462151a4c654f9e8e8a1d5ecde1a", "score": "0.7143526", "text": "def show_config\n puts \"Building with configuration:\"\n puts \"========================================================================\"\n puts\n puts configuration_summary\n end", "title": "" }, { ...
58451e4fb36798dcc63642b6e3ed34ae
list all tags of a repo
[ { "docid": "cdbc9c46024295a6c3d36c18a09aa504", "score": "0.84152013", "text": "def tags(repo)\n result = send_get_request(\"/#{repo}/tags/list\")\n return result['tags']\n end", "title": "" } ]
[ { "docid": "dcf6143b1e5d5e34798efc0356efbce3", "score": "0.7789982", "text": "def tags\n return GitHub::API.json(\"/repos/show/#{self.owner}/#{self.name}/tag\")['tags']\n end", "title": "" }, { "docid": "0c75ceb979b356cd289f89741ea349a9", "score": "0.77473915", "text": "def a...
408b30619d198801c62ab2c9cdfd64f9
Calculate the variance of a series
[ { "docid": "006231c571b1ec7f228617f586069cfa", "score": "0.886119", "text": "def variance(series)\r\n n = 0\r\n avg = 0.0\r\n s = 0.0\r\n series.each { |x|\r\n n = n + 1\r\n delta = x - avg\r\n avg = avg + (delta / n)\r\n s = s + delta * (x - avg)\r\n }\r\n # if you...
[ { "docid": "aed9f32f6a85b315f3a81047dce34c40", "score": "0.8172721", "text": "def variance\n m = self.mean\n sum = 0.0\n self.each {|v| sum += (v-m)**2 }\n sum/self.size\n end", "title": "" }, { "docid": "3afd00dcf44b5125cbc707df4d9f61b3", "score": "0.8148029", "text": "...
72eea324e4d12d2c899950ee9a320a15
PATCH/PUT /user_interessados/1 PATCH/PUT /user_interessados/1.json
[ { "docid": "8b307c5c48fb180b12b7e6de1b849b9e", "score": "0.7087949", "text": "def update\n respond_to do |format|\n if @user_interessado.update(user_interessado_params)\n format.html { redirect_to @user_interessado, notice: 'User interessado was successfully updated.' }\n format.js...
[ { "docid": "3b79ec0097a76ef85fc6e9656edc3daf", "score": "0.70399815", "text": "def patch_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end", "title": "...
97d731ca19c8505a3b8fc90aa7f4b8c0
Add an edge to the value
[ { "docid": "9d375435734aad1bc7d05dbc4a2f8eb0", "score": "0.66665477", "text": "def add_edge(node_from_key, node_to_key, value)\n edge_key = [node_from_key, node_to_key]\n if self.exist_nodes(edge_key)\n @edges[edge_key] = value\n else\n return false\n end\n end", "title": "" ...
[ { "docid": "f0a61329d05040a536a1eb72139a30c4", "score": "0.77821904", "text": "def edge=(value); end", "title": "" }, { "docid": "3990a2b35750291c3bae625321ccbf21", "score": "0.7503962", "text": "def add_edge(x, y)\r\n @edges[x] << y\r\n end", "title": "" }, { "do...
30765bb34d321c7d78f69e4c401c8b15
Returns the processed Mailer instance. We keep this instance on hand so we can run callbacks and delegate exception handling to it.
[ { "docid": "b321f57044085ebebccd993c8ee8e702", "score": "0.769017", "text": "def processed_mailer\n @processed_mailer ||= @mailer_class.new.tap do |mailer|\n mailer.process @action, *@args\n end\n end", "title": "" } ]
[ { "docid": "87428d5c6b46e87bdf401f2989c0fdee", "score": "0.6918928", "text": "def __getobj__ # :nodoc:\n @mail_message ||= processed_mailer.message\n end", "title": "" }, { "docid": "033852b592834a3fce3dafdf7cf013db", "score": "0.661729", "text": "def mailer\n @mailer_re...
3fd840b8c9cf2ca40897f86058f106d6
DELETE /bakers/1 DELETE /bakers/1.json
[ { "docid": "79a4d953d720454ee375fd14ec4c54e6", "score": "0.6483783", "text": "def destroy\n @baker.destroy\n respond_to do |format|\n format.html { redirect_to bakers_url, notice: 'Baker was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "40a807de69597305c89e7c21639a0479", "score": "0.6798425", "text": "def destroy\n @backup.destroy\n respond_to do |format|\n format.html { redirect_to backups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3bf0336f3f50d2266435b...
714316fdf5dba18238654cfe9ff8ccb4
Create a snippet Create a snippet for a particular service and version.
[ { "docid": "f1dfb8a202680f27e92a00a9c8f3db1c", "score": "0.67574507", "text": "def create_snippet(opts = {})\n data, _status_code, _headers = create_snippet_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "5dc3b270de66b124d09ac1bc526f8532", "score": "0.68513465", "text": "def create_snippet_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SnippetApi.create_snippet ...'\n end\n # unbox the parameters from the hash\...
abcb833b7d314271096c2e16eb8178ec
GET /people/1 GET /people/1.xml
[ { "docid": "56af7d2a20567be16dfb83b6262905da", "score": "0.67176646", "text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" } ]
[ { "docid": "e4f5f9360f3d4d8e2a853f7c91f23ee9", "score": "0.70985335", "text": "def show\n\n @people = People.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @people }\n end\n end", "title": "" }, { "docid": "90331487...
47ab0d69551ee716b62f790e459b4eb7
Returns the user's name in the following format: first_name last_name
[ { "docid": "ed3958c5f42baeeff1659e4670b0f351", "score": "0.0", "text": "def proper_name\n first_name + \" \" + last_name\n end", "title": "" } ]
[ { "docid": "313ad9690512440c47cfa1871d5c5fae", "score": "0.87531126", "text": "def user_name(user) \n\t\t\"#{user.first_name} #{user.last_name.first}.\"\n\tend", "title": "" }, { "docid": "a115dad57b8d6ab607d81297b8d2b736", "score": "0.8700606", "text": "def get_full_user_name(user)\...
ad840ed3f963b3a54799d3f2f828b0ba
Shows active session threads.
[ { "docid": "6d2c5d01b1b9fa4b4fd2906760a32108", "score": "0.0", "text": "def session(command)\n\t\tcommand.shift\n\t\tfound = false\n\n\t\tunless command.empty? || command.length < 1\n\t\t\tthread_join = command.take(1).first.to_s\n\t\t\tthread_pos = 1\n\n\t\t\tif thread_join == 'list'\n\t\t\t\t@@thread...
[ { "docid": "cc0fca3c8600fe588abacb19ba255d50", "score": "0.7012021", "text": "def listActiveThreads(*args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n response = get('users/listActiveThreads', options)\n end", "title": "" }, { "docid": "c270e5cc7cf7fd962e2197cdee924abc",...
bd416bf59d47cfb0b2ab75f711172c7a
Feel free to google "how to generate a random number in ruby" Uses a range def roll rand(1..6) end Selects a random number from an array
[ { "docid": "0cb337f82ff2b123629fb89594b593dd", "score": "0.7567964", "text": "def roll\n numbers = [1,2,3,4,5,6]\n numbers.sample\nend", "title": "" } ]
[ { "docid": "1c7ed601e4ed47495c428d2bd597d825", "score": "0.8798335", "text": "def roll\n\n #random number using range\n rand(1..6)\n\n#random number using array\n ary = [1,2,3,4,5,6]\n ary[rand(ary.length)]\nend", "title": "" }, { "docid": "1c9a06f8ec2fcf9c82dcd54d92908a23", "score": ...
0999b0d6199bfd204f00b27033a38d00
override GitlabUploader if set to true it erases the original file when uploading and we copy from the artifacts archive, so artifacts end up without the file
[ { "docid": "acd13edd08e3d15d5388e5cbb5539896", "score": "0.0", "text": "def move_to_cache\n false\n end", "title": "" } ]
[ { "docid": "c9340a6a0f8133649926504508a6522f", "score": "0.6147085", "text": "def cleanup_file_to_upload force=false\n if force || self.uploading?\n remove_source\n end\n end", "title": "" }, { "docid": "0e63038dba47aaf94ced9b9ee7c03249", "score": "0.60974437", "text": "d...
75ef9ee27a4dcaeeef4bdb733b1c3b61
Offset of root directory in bytes from start of filesystem
[ { "docid": "28ace43830fafa6eedc0a76ff74b8d29", "score": "0.70196426", "text": "def pos_root_dir\n return @pos_root_dir unless @pos_root_dir.nil?\n @pos_root_dir = (bpb.bytes_per_ls * (bpb.num_reserved_ls + (ls_per_fat * bpb.num_fats)))\n @pos_root_dir\n end", "title": "" } ]
[ { "docid": "214ddb90d33259e79229b42c05616b95", "score": "0.6621888", "text": "def size_root_dir\n return @size_root_dir unless @size_root_dir.nil?\n @size_root_dir = (ls_per_root_dir * bpb.bytes_per_ls)\n @size_root_dir\n end", "title": "" }, { "docid": "6f59da149dc23c7e001...
ce1d1df27ed372a7afbd9e3e4f15a5e8
GET /materiallinks/1 GET /materiallinks/1.json
[ { "docid": "0d64ca4b3096f7cec8a51d190fa0155a", "score": "0.0", "text": "def show\n @user_author = User.find_by_id(@materiallink.user_id)\n @user_author_name = @user_author.username\n end", "title": "" } ]
[ { "docid": "c4bbcdfec73c2fb2ca6f07cd7e473ef7", "score": "0.6806572", "text": "def show\n @materia = Materia.find(params[:id])\n\n render json: @materia\n end", "title": "" }, { "docid": "d40cc25e17d242228d520d7e000d8a72", "score": "0.66039973", "text": "def show\n @materia ...
b2efcef7297945755aa037d79c2d74ec
Describe the next rake task. Example: desc "Run the Unit Tests" task :test => [:build] runtests end
[ { "docid": "beefeaae97b4e65bb6516466863399ec", "score": "0.0", "text": "def desc(description)\n last_description = description\n end", "title": "" } ]
[ { "docid": "615779adeb1eed86da91231eb701293a", "score": "0.7091762", "text": "def test_task(commande, sorte)\n raise \"Sorte de test invalide: #{sorte}\" unless [:unitaire, :acceptation].include?(sorte)\n\n suffixe = sorte == :unitaire ? '' : '_acceptation'\n repertoire = \"test#{suffixe}\"\n nom_ta...
5267a72a8d15005aa2541492798ff232
GET /risk_probabilities/new GET /risk_probabilities/new.xml
[ { "docid": "d164313572481389be3b50430e41ff18", "score": "0.79225224", "text": "def new\n @risk_probability = RiskProbability.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @risk_probability }\n end\n end", "title": "" } ]
[ { "docid": "07f59341fc21ca03ece14ad77a5d9e23", "score": "0.73555714", "text": "def create\n @risk_probability = RiskProbability.new(params[:risk_probability])\n\n respond_to do |format|\n if @risk_probability.save\n format.html { redirect_to(@risk_probability, :notice => t(\"screens.no...
4fd3a4e802a339afb896a687acbfcf67
Implementing topological sort using both Khan's and Tarian's algorithms
[ { "docid": "7fc7b71b8f2b4f5cff3877a01c88c45d", "score": "0.75821954", "text": "def topological_sort(vertices)\n # Khan's\n\n # queue = []\n # list = []\n\n # vertices.each do |vertex|\n # if vertex.in_edges.empty? \n # queue.push(vertex)\n # end\n # end\n\n # r...
[ { "docid": "73f9030c79dc3323eea7fae6373c4caa", "score": "0.81534433", "text": "def topological_sort(vertices)\n return kahns_algorithm(vertices)\n #return tarjans_algorithm(vertices)\nend", "title": "" }, { "docid": "61538ec7329ee5524e097fdf0d9a157a", "score": "0.80224806", "text":...
685a6dac5dbbe023f5953acb15bfc59b
to call: AdminMailer.with(org: Organization.first).new_org.deliver_now
[ { "docid": "97ea041e24dc315b2f7a24305004ba72", "score": "0.6505225", "text": "def new_org\n @org = params[:org]\n @name = params[:name]\n @phone = params[:phone]\n @position = params[:position]\n @web = @org.website\n @address = @org.addresses.first.printable_address\n @ein = @org.e...
[ { "docid": "a21b931675b41bd2cd44307983bdd229", "score": "0.7213874", "text": "def new_organization_admin_welcome(organization, user)\n @organization = organization\n @user = user\n\n mail(to: user.email, subject: \"You're now admin of #{org.name}\")\n end", "title": "" }, { "docid"...
4c81a28b84767b758e6303c62d46c056
Get the category id of the app's type (ors, national, local)
[ { "docid": "f63b31ca44031d3c8bb9659c3a31c220", "score": "0.0", "text": "def type(index)\n get_field_from_relationship(workspace_id(index), @fields_extra[:type])\n end", "title": "" } ]
[ { "docid": "f02a781aa85ac8b528fe670417da1dc5", "score": "0.74550855", "text": "def get_category_type_code\n category_type ? category_type.code : '?'\n end", "title": "" }, { "docid": "f02a781aa85ac8b528fe670417da1dc5", "score": "0.74550855", "text": "def get_category_type_code\n ...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "15c14bdcd6f8fc055599f2936b04690d", "score": "0.0", "text": "def description\n request.headers['description']\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist...
b78211297e9a614d757680ab0c5d12c5
Returns list of active features
[ { "docid": "46c5ef9d0389158f34b81cfd14f725c9", "score": "0.763716", "text": "def active_features\n data = read_file(@yaml_file_name)\n get_active_features(data, @environment)\n end", "title": "" } ]
[ { "docid": "99192e4cbf5c638b86e7ec3f044570d1", "score": "0.83038825", "text": "def active_features\n @model.where(active: true).map { |f| f.name.to_sym }\n end", "title": "" }, { "docid": "7d4b398d766bfe8ed893f0047886f01f", "score": "0.80363107", "text": "def features\n ...
123c5c07e5d151336a0b090a55ccbf04
Country Code is E.164 Country Code
[ { "docid": "7172320b14af0a7779877e147a890b87", "score": "0.9038001", "text": "def country_code\n e164_country_code\n end", "title": "" } ]
[ { "docid": "bd6a9a603c34cf5b4be8afe3043a57f3", "score": "0.8889164", "text": "def e164_country_code\n '53'\n end", "title": "" }, { "docid": "bd6a9a603c34cf5b4be8afe3043a57f3", "score": "0.8888543", "text": "def e164_country_code\n '53'\n end", "title": "" }, ...
256c1cf04ec0c4bed37e9613945486b5
Public: Return nucleotide at position. pos The Integer Returns The String or nil.
[ { "docid": "d8a216241b567bb1d27e8ae4fb0c1114", "score": "0.0", "text": "def []( pos )\n @seq[pos]\n end", "title": "" } ]
[ { "docid": "aa6cd9d42aa82781904f6b5c49b6c7bc", "score": "0.5503552", "text": "def char_at_pos str, pos, width=0\n str[width-pos,1] || \"\"\n end", "title": "" }, { "docid": "37a6deaad20744e4153db3307d83ee1e", "score": "0.5427603", "text": "def p(pos)\n valid_position?(pos)...
f41980fe90820eede761ae72c173e040
How many docs should be returned
[ { "docid": "6bc1e0009cbe2b070296bcc611789f22", "score": "0.0", "text": "def rest\n @options[:limit] - @count if @options[:limit] > 0\n end", "title": "" } ]
[ { "docid": "2c7cbe66b7b52396600def44a63d6f7a", "score": "0.81509155", "text": "def num_docs\n @client[:documents].count\n end", "title": "" }, { "docid": "f1e52e1c9e8f9928a1d26d71f6d43cf7", "score": "0.7940402", "text": "def num_docs\n @client[DOCUMENTS_COLLECTION].count...
0d0de88a1c7d773fa797a8cc2c6f0539
Returns a array of numbered tracks for use in a table.
[ { "docid": "8b258a5caff679b057e3b54bbd9ab9d0", "score": "0.7459676", "text": "def getTracksAsTable\n table = []\n tracks.each do |track|\n table.push([\"#{track.track_number}.\", track.track_name])\n end\n return table\n end", "title": "" } ]
[ { "docid": "a5b64af6f0c26824462e594bc1508ec3", "score": "0.6361457", "text": "def tracks\n @tracks ||= Redlics.redis { |r| r.bitcount(track_bits) }\n end", "title": "" }, { "docid": "42de0f097f755f59808dcdb4ae2486b1", "score": "0.63267624", "text": "def tracks\n return @...
768e6910862faa309ba8c9da8094cade
For finding a Guest User
[ { "docid": "fde6cfdb97599b473a6b2158f6a699fd", "score": "0.74967957", "text": "def guest_user\n User.find(session[:guest_user_id].nil? ? session[:guest_user_id] = create_guest_user.id : session[:guest_user_id])\n end", "title": "" } ]
[ { "docid": "15cbae01eea96a9a5229b5a1b8b2399f", "score": "0.7977709", "text": "def guest_user\n User.find_by_email('guest@guest.com')\n end", "title": "" }, { "docid": "2f6895ca20da705e0f6e707d7f9c1a4a", "score": "0.77612543", "text": "def guest\n defaultuser = (\n case Ac...
b8794addf59cb5cde40a26a2257a8f8d
Sets the groups property value. Filter group set used to decide whether given object is in scope for provisioning. This is the filter which should be used in most cases. If an object used to satisfy this filter at a given moment, and then the object or the filter was changed so that filter is not satisfied any longer, ...
[ { "docid": "64a1fb304206b1e7aa07c4e805a33371", "score": "0.73017424", "text": "def groups=(value)\n @groups = value\n end", "title": "" } ]
[ { "docid": "c2e417e3f258af470dd216b2c9ca83df", "score": "0.666217", "text": "def input_filter_groups=(value)\n @input_filter_groups = value\n end", "title": "" }, { "docid": "70418d2190b7d93361f5a5b2bcea5155", "score": "0.6651356", "text": "def category_filt...
17aa811bcf9c92afebdf9fd977a726de
Generate output for this context
[ { "docid": "c1f6030168c521fcff41d8733b73683a", "score": "0.0", "text": "def to_s\n return content unless node?\n props = properties || {}\n html = props.collect{ |key, value| '%s=\"%s\"' % [key, value] }\n attrs = \"\" \n attrs = (\" \" << html.join(\" \")) unless html.empty?\n...
[ { "docid": "83abea8104ea1f954ca9ba1fb8e12985", "score": "0.75333685", "text": "def generate()\n\t\t\t@out = []\n\t\t\t@context = []\n\n\t\t\ttrim_nil_lines\n\n\t\t\t@lines.each_with_index do |line, i|\n\t\t\t\twrite_with_context(line.line, line.context, next_context(i))\n\t\t\tend\n\t\t\twrite_with_cont...
52261043ba6d242c099a706e365a1733
Client supports the follow content formats if the content property refers to a `literal of type MarkupContent`. The order describes the preferred format of the client.
[ { "docid": "b190c1a6789bc4b4ade7daf8e9bb5359", "score": "0.6276818", "text": "def content_format\n attributes.fetch(:contentFormat)\n end", "title": "" } ]
[ { "docid": "729e620044e616ffbeec952260d117ad", "score": "0.5770758", "text": "def format_content?\n options[:format_content] != false\n end", "title": "" }, { "docid": "1d69be2d67ce2d8739825a80d8c0870e", "score": "0.5667977", "text": "def contentformat(value)\n _conten...
c2aebbcccfc31274b94928137b4d53e4
takes in matrices as arrays and returns the product of two as an array
[ { "docid": "884cad137ef544b84d633b759a9ebe79", "score": "0.0", "text": "def multiply_matrix(m1, m2) \n matrix1 = make_matrix(m1)\n matrix2 = make_matrix(m2)\n if matrix1.column_count == matrix2.row_count\n result = (matrix1 * matrix2).to_a\n return result\n else \n return \"Can't multipl...
[ { "docid": "28a36e2768b0e0b8be00e02a1588bca3", "score": "0.78266066", "text": "def matrix_mult(a, b)\n \n m = a.length # num rows in resulting matrix\n p = b.length # inner dimension, which must be equivalent to a.first.length\n n = b.first.length # num cols in resulting matrix\n \n resu...
204f6428fd054b428ec401dea2f3c860
Exercise from Chapter 14 Blocks and Procs Sam Gerber Write a method that takes a block and calls it once for each hour that has passed today. That way, if I were to pass in the block: do puts "dong!" end it would chime (sort of) like a grandfather clock. Test your method out with a few different blocks. HINT: You can u...
[ { "docid": "6653d0d9e2a30a52e71882bbaa310360", "score": "0.8292904", "text": "def grandfather_clock(&block)\n (Time.new.hour % 12).times do\n block.call\n end\nend", "title": "" } ]
[ { "docid": "2f8704d21eb8b4629c42bbc42d592348", "score": "0.86081314", "text": "def grandfather_clock &block\n time = Time.new.hour\n if time == 0\n time = 12\n elsif time > 12\n time = time - 12\n end\n\n time.times do\n block.call\n end\n\n # Work in progress for output once every hour...
45fcf70855beac1d9b333e96b910f8ab
PUT /admin/order/billing_addresses/1 PUT /admin/order/billing_addresses/1.xml
[ { "docid": "cffdc86608e618fc40e25920fa5cdfd6", "score": "0.58458513", "text": "def create\n old_address = Address.find_by_id(params[:old_address_id])\n @billing_address = session_admin_cart[:user].addresses.new(params[:address])\n if old_address && (old_address.default? || old_address.bil...
[ { "docid": "5d370fe03fbfe94b86cc512dcfa7621a", "score": "0.6819389", "text": "def update(body = {})\n @client.invoice_address.update(body)\n end", "title": "" }, { "docid": "0203adfd3c94f1700625cd8ed9bf9b42", "score": "0.6813367", "text": "def update\n respond_to do |forma...
2008ff928c6c58c3da2ecb38a4473122
Sandicor does this :|
[ { "docid": "5e4ff5241a198908cae7f02b5b8bd28c", "score": "0.0", "text": "def test_lookup_table_resolve_returns_multi_value_array_when_multi_with_quoted_values\n fragment = { \"Interpretation\" => \"LookupMulti\" }\n\n lookup_table = Rets::Metadata::LookupTable.new(fragment, nil)\n\n lookup_table...
[ { "docid": "7ec57c3874853e50086febdbdd3221bf", "score": "0.67726797", "text": "def wedding; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.67307836", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3"...
15f4234ffa019345cb216f3cde303fd9
retuns user who took the book
[ { "docid": "117a3b06f54ecadcface347189a6a848", "score": "0.69435114", "text": "def taken_by\n self.histories.where(returned: nil).last.user\n end", "title": "" } ]
[ { "docid": "a2e76b13f587e8dec301dbab2e1bb8d0", "score": "0.68617815", "text": "def book_owner\n @book = Book.find(params[:id])\n user = Author.find(@book.author_id)\n\n unless is_admin?\n if !current_user?(user)\n flash[:danger] = \"You are not authorized to edit this book.\"\n ...
5845ff23308b30af967f4fff397599a9
agency_ids; comment back in to be able to remove individual agencies
[ { "docid": "4c3e3036625b77ce2fd35592b5c4471a", "score": "0.0", "text": "def search_adding_filter(condition,value)\n conditions = params.dup[:conditions] || {}\n\n if PLURAL_FILTERS.include?(condition)\n conditions[condition] ||= []\n conditions[condition] << value\n else\n condit...
[ { "docid": "49280423aed65c4ab62de87c04de77a2", "score": "0.6312708", "text": "def agencies\n Agency.where(id: transportation_agencies.pluck(:id) + oversight_agencies.pluck(:id))\n end", "title": "" }, { "docid": "802d002de97bd19d285a211c0490d353", "score": "0.6063354", "text": "d...
23d33b9daf695fb61b44a683b335af95
Login to MediaWiki [username] Username [password] Password [domain] Domain for authentication plugin logins (eg. LDAP), optional defaults to 'local' if not given Throws MediaWiki::Unauthorized if login fails
[ { "docid": "cbce0e04a661d9c4fe9c3345158ab113", "score": "0.7295815", "text": "def login(username, password, domain = 'local')\n form_data = {'action' => 'login', 'lgname' => username, 'lgpassword' => password, 'lgdomain' => domain}\n make_api_request(form_data)\n @password = password\n ...
[ { "docid": "62ff73b9a17671f7748a7c59685877a9", "score": "0.673527", "text": "def login(username = nil, password = nil)\n self.username, self.password = username, password if username && password\n self.instance.login\n end", "title": "" }, { "docid": "55c6e4fde8acf846d1724...
547647cd841822ed490ba01a107bf369
Example: OpenWeatherMapClient.new.forecast(city: 'Dublin, IE') Dates returned assume a UTC timezone
[ { "docid": "a7e8a42e8649d9ee467ab69e9ba36cc7", "score": "0.66800404", "text": "def forecast(city:, days: 3)\n result = api_call(path: '/data/2.5/forecast/daily', query: { q: city, cnt: days, units: 'metric' })\n days = result['list'].map.with_index do |day, i|\n { cloud_cover: day['clouds'],\...
[ { "docid": "84d3d2d908eddb8cb3a404b1121c1efe", "score": "0.71838814", "text": "def weather_forecast\n city = self.city\n state = self.state\n ForecastFacade.forecast(city, state)\n end", "title": "" }, { "docid": "6da8ddd84b320c27edd9e6ef1b850a84", "score": "0.7013602", "te...
d490a7594922e8434a555904fed1bf72
Join all lines of text and ensures each one ends with \n
[ { "docid": "c9442966a9caf4b3a53568c843c26b1f", "score": "0.57177824", "text": "def join(strings)\n sep = $OUTPUT_FIELD_SEPARATOR || \"\\n\"\n strings.map do |string|\n next if string.nil?\n string.end_with?(sep) ? string : string + sep\n end.join\n end", "title": "" ...
[ { "docid": "42387c4c8ee938e121595c46257be54e", "score": "0.7238188", "text": "def trailing_join(lines)\n lines.join(\"\\n\") + \"\\n\"\n end", "title": "" }, { "docid": "89d72583e4abbcd9647184f92ec68168", "score": "0.6960108", "text": "def as_text\n lines.join NEWLINE\n end",...
663a5c2e33cbef5456e8867b113dfaa6
PUT /recommendation_requests/1 PUT /recommendation_requests/1.json
[ { "docid": "a0e9f826b08ea7ff5732123d41aaadeb", "score": "0.7087212", "text": "def update\n @recommendation_request = RecommendationRequest.find(params[:id])\n\n respond_to do |format|\n if @recommendation_request.update_attributes(params[:recommendation_request])\n format.html { redire...
[ { "docid": "b382088984d37b6d22911d5a14dec4b3", "score": "0.65397525", "text": "def update\n @recommendation = Recommendation.find(params[:id])\n\n respond_to do |format|\n if @recommendation.update_attributes(params[:recommendation])\n format.html { redirect_to @recommendation, notice:...
fb99b1efb7d9ecff0bb7719b0c1df16e
POST /cars || cars_path Create a new car
[ { "docid": "d8937829522b659d7b52f62c21206456", "score": "0.75794965", "text": "def create\n @car = Car.new(car_params)\n\n if @car.save\n respond_with(@car, location: cars_url, notice: 'Vehicle was successfully created.')\n else\n respond_with(@car)\n end\n end", "title": "" ...
[ { "docid": "fa28269228cf02799f38fa9e66a1421b", "score": "0.7778208", "text": "def create\n Car.create(\n name: params[:car][:name],\n image_url: params[:car][:image_url],\n self_driving: params[:car][:self_driving],\n range: params[:car][:range],\n starting_price: params[:car...
f87763fc38dca8863866dcb4086f9ba4
GET /questions GET /questions.xml
[ { "docid": "58d47a3dc866616f4279b9a06273a4d5", "score": "0.731576", "text": "def index\n @questions = Question.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" } ]
[ { "docid": "f21bdf5068d061850a35a8ce3e340eba", "score": "0.7777713", "text": "def questions\n self.class.get('/2.2/questions', @options)\n end", "title": "" }, { "docid": "4d0208e7b8e4c89bad251ec25f7b5f03", "score": "0.7430585", "text": "def show\n @questions = @test.questions...
cf54a12ec175b88d3af4c3378edd07ee
Send any signal to the process. By default it sends a SIGTERM, just like UNIX's kill command. It does not wait for the process to run the signal, therefore, if giving a signal that results in termination, it is better to use :quit.
[ { "docid": "ae51bd25fbea5adb4433fc6174ea62f6", "score": "0.0", "text": "def kill(signal='SIGTERM')\n return false if @status\n \n begin\n result = Process::kill(signal, @pid)\n return result\n rescue Errno::ESRCH => e\n return false\n end\n end", "title": "" } ]
[ { "docid": "4a6ccd7d458222a3209e85672b7a77e8", "score": "0.7697251", "text": "def send_signal(signal)\n Process.kill(signal, @pid)\n end", "title": "" }, { "docid": "ce5d689d3a0479592076d945b3313093", "score": "0.7467959", "text": "def kill(signal = :TERM)\n Process.kill(s...
ad4ef169b6375ceb427c32f2cc7ad38e
no need for explicit closing. when the event loop terminates, the connection is closed anyway.
[ { "docid": "e92c786608274cd152c241e28354e5a0", "score": "0.0", "text": "def close; true; end", "title": "" } ]
[ { "docid": "d1544bfb706cca30544668354bfcfda5", "score": "0.8090162", "text": "def event_loop_connection_close\n @em_connection.close_connection if @em_connection\n end", "title": "" }, { "docid": "6fcda37817d7fc08176fa637813e74fe", "score": "0.7544451", "text": "def conne...
d88b62c65c81ae69a4d7d2f741189c42
Title:change_temp_password Description:Change temporary password
[ { "docid": "64c94b126678739317d9ace60e8bab01", "score": "0.8689114", "text": "def change_temp_password\n\tend", "title": "" } ]
[ { "docid": "18b5dd88bd774b2fb24084919e0bb7b4", "score": "0.7905858", "text": "def set_temp_password() \n\t\t#Generate new password\n\t\tpassword = User.generate_password()\n\t\t\n\t\tsalt = self.salt\n\t\tenc_password = Digest::SHA1.hexdigest(salt+password)\n\t\t\n\t\tself.temp_password = enc_password\n...
b3b89bfc09d890c50db0c26399aadb3b
GET /resource/edit def edit super end PUT /resource
[ { "docid": "dc0f25f39e1af67341cb57a0418366bf", "score": "0.0", "text": "def update\n self.resource = resource_class.to_adapter.get!(send(:\"current_#{resource_name}\").to_key)\n prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)\n pass = params[:medi...
[ { "docid": "ba80e10e6e38236e4e708035cfd9e6cb", "score": "0.84682256", "text": "def edit\n respond_with(resource)\n end", "title": "" }, { "docid": "c28a52c2f0b5174ec3cc4c3f945e7cd7", "score": "0.79906833", "text": "def edit\n @resource = Resource.find(params[:id])\n \n ...
88678888c5c9337a6134579b95c8e82b
=============================================================================== Picking up an item found on the ground ===============================================================================
[ { "docid": "f110be69ecdc407830f584c69ab22dcd", "score": "0.0", "text": "def pbItemBall(item,quantity=1)\r\n item = GameData::Item.get(item)\r\n return false if !item || quantity<1\r\n itemname = (quantity>1) ? item.name_plural : item.name\r\n pocket = item.pocket\r\n move = item.move\r\n if $Pokem...
[ { "docid": "6b18d947141f36cbfe4c933fe160b9ba", "score": "0.71401346", "text": "def lookup_item(which_holdings=0,which_item=0)\n end", "title": "" }, { "docid": "108b5866b0e1a4fe019c5efdfa10feda", "score": "0.69762796", "text": "def pbChooseItemScreen\n oldlastpocket=@bag.lastpock...
5cfc99e663d05c9ce130d60ce650229c
Will divide road (RGeo::Feature::LineString) into consecutive points(RGeo::Feature::Point) at a distance distance. This function inturn calls divide_linestring_into_points() to divide each road into points. This method inturn calls divide_line_into_points() +road+ the Linestring representing the road. A road is a RGeo:...
[ { "docid": "d0290a69295cd0fef55460ac004a8f78", "score": "0.78328836", "text": "def divide_linestring_into_points(road, distance)\n points = road.points\n\n i = 0\n linestring_points = []\n while( i < points.length - 1)\n start_point = points[i]\n end_point = points[i+1]\n dist...
[ { "docid": "11efd0e06e8746fdf22cbb87300f74d8", "score": "0.74014866", "text": "def divide_roads_into_points(distance)\n\n @road_points = Hash.new()\n\n @shapefile.each do |linestrings|\n\n if linestrings.attributes.keys().include?(@id_field) == false\n raise \"Attribute #{@id_field} is...
57a12d1455a7366cffea75da1f2c65bd
Sleep until 2 seconds have passed since the last request and perform the given request.
[ { "docid": "953e83be1c3a1901130627f9a94d796b", "score": "0.62140924", "text": "def after_limit\n seconds_passed = Time.now - @last_request_time\n wait_time = @gap - seconds_passed\n sleep(wait_time) if wait_time > 0\n @last_request_time = Time.now\n yield\n end", "title":...
[ { "docid": "982855cd523af076a57183ecd0aa4b68", "score": "0.6813548", "text": "def perform_sleepily!(timeout=60*60*1000, &block)\n @on_complete = block if block_given?\n Thread.new {\n STDERR.puts \"Before send: #{uri}\"\n before_send.call(self) if before_send\n \n S...
2005e3ce76b1927fbf34d8a957115052
PUT /comments/1 PUT /comments/1.json
[ { "docid": "6b0a142a47c5abac4ae9c6a153d6b70f", "score": "0.0", "text": "def update\r\n @comment = Comment.find(params[:id])\r\n if session[:user_admin]\r\n respond_to do |format|\r\n if @comment.update_attributes(params[:comment])\r\n format.html { redirect_to @comment, notice: '...
[ { "docid": "1dbb9320c747e53a3ed8fbd81c7b2d14", "score": "0.72938055", "text": "def update\n @api_v1_comment = @post.comments.find(params[:id])\n params[:comment].delete :created_at\n params[:comment].delete :updated_at\n respond_to do |format|\n if @api_v1_comment.update_attributes(para...
a8fed0d05baac1c13c5f64b7ee1c05f0
Explanation You will be building a calculator. A calculator can perform multiple arithmetic operations. Your function should allow the user to choose which operation is expected, enter in the values to perform the operation on, and ultimately view the result. Specification: A user should be given a menu of operations A...
[ { "docid": "e2d3556335732a1d58b068e4cd357054", "score": "0.0", "text": "def main_menu\n puts \"(b) - basic calculator\"\n puts \"(a) - advanced calculator\"\n puts \"(bmi) - BMI calculator\"\n puts \"(m) - mortgage calculator\"\n puts \"(t) - trip calculator\"\n puts \"(q) - quit\"\nend", "tit...
[ { "docid": "f2600b0edf60978ade9ab0748ab93c72", "score": "0.81229955", "text": "def calculator \n valid_operations = [\"add\",\"+\",\"subtract\",\"-\",\"multiply\",\"*\",\"divide\",\"/\"]\n \n # ask user for math operations \n # check if operation is valid and if not ask for a new input \n ...
7825409ceb5373528435488060322fec
Get the comments of the task. ==== Returns List of Comment object.
[ { "docid": "406b7a999434874bcc7d18513970ac2b", "score": "0.7023673", "text": "def getComments\r\n\t\t\t\t\treturn @comments\r\n\t\t\t\tend", "title": "" } ]
[ { "docid": "8b0d9793b262944f4ac27fa4bc60fb3e", "score": "0.72236145", "text": "def index\n @task_comments = Task::Comment.all\n end", "title": "" }, { "docid": "563032b7ace0f51cc8a968565a27023c", "score": "0.7146187", "text": "def list_tasks_with_comments\n all_tasks = Task.all\...
1eadf1922b6822b783617f171e97f450
Fetch value for requested cache key if it dosen't exist calls trending_request and saves the requested data to the cache
[ { "docid": "67ba82f2c13ab04c13701de353bb58ee", "score": "0.68568856", "text": "def cached_trending\n Rails.cache.fetch(cleaned_query_param, cache_nils: false, :expires_in => 1.hours) do\n request_trending\n #Check for empty array in case there are no trending devs for the specif...
[ { "docid": "145cf7aca34d20412380c3efbb0cd655", "score": "0.688468", "text": "def call_with_cache(key)\n cache.key?(key) ? cache[key] : cache[key] = fetch(key).call\n end", "title": "" }, { "docid": "8ef95bceedc8fd5f201c116c4ad3b621", "score": "0.6489719", "text": "def...
a9080daa332caacabcac9806e1c7032f
Overrides two methods to state that saving an email field it's not necessary to save an user
[ { "docid": "3c5a60e42bdd01ee4e2beec566c7f8f8", "score": "0.0", "text": "def email_required?\n false\n end", "title": "" } ]
[ { "docid": "ebb047589895c332cb92c582c879bf46", "score": "0.76044834", "text": "def save_email\n self.email = email\n end", "title": "" }, { "docid": "34132e5b07d1eca2b48f9e063b3ac947", "score": "0.7499318", "text": "def set_email\n self.email = user.email if user_id\n end...
912b21edc006361ec5fc5f83fe7eb50a
POST /holidays POST /holidays.xml
[ { "docid": "31f9e54095569d322d0e31eeeef58a40", "score": "0.64513665", "text": "def create\n @holiday = Holiday.new(params[:holiday])\n\n respond_to do |format|\n if @holiday.save\n \tflash[:notice] = 'Holiday was successfully created!'\n format.html { redirect_to('/holidays') }\n ...
[ { "docid": "0e84ffc1d4f7a05af285892486789e31", "score": "0.65649414", "text": "def create\n @holiday = Holiday.new(params[:holiday])\n\n\n respond_to do |format|\n if @holiday.save\n HolidayMailer.holiday_request(@holiday).deliver\n format.html { redirect_to(employee_root_path, ...
82901b7953a456f896e42b8858d58cd8
Set the value of the ContentType input for this Choreo.
[ { "docid": "4aae733f85156400844f3231e8ae9090", "score": "0.76498663", "text": "def set_ContentType(value)\n set_input(\"ContentType\", value)\n end", "title": "" } ]
[ { "docid": "e0ed1f769c5f668ee780ab6ad83d09f3", "score": "0.7614113", "text": "def set_ContentType(value)\n set_input(\"ContentType\", value)\n end", "title": "" }, { "docid": "e0ed1f769c5f668ee780ab6ad83d09f3", "score": "0.76132053", "text": "def set_ContentType(v...
d168db43dce2275e277991b935b947df
create people at a floor and put them in a queue to get on the elevator
[ { "docid": "c9b7d1befce99a98a95a47c38056a17c", "score": "0.5649838", "text": "def populate(nPeople)\n @floors[0].enqueue(Person.new(0,1,self))\n @floors[0].enqueue(Person.new(0,3,self))\n @floors[0].enqueue(Person.new(0,4,self))\n @floors[0].enqueue(Person.new(0,3,self))\n @floors[0].enqu...
[ { "docid": "87e6275d3ad85f7a98340ce10933b790", "score": "0.664827", "text": "def createFloorDoorsList\n for x in 1..@numberOfFloors do\n @floorDoorsList.append(Door.new(x, DoorStatus::CLOSED, x))\n # puts \"elevator#{@id} door floor #{@floorDoorsList[x - 1].id} created\"\n ...
b605ffea99977c47042d435ca20cdf0d
Helper method that gives signedin user option to save drink to favorites
[ { "docid": "738d301c12907e3f1e65dff939622467", "score": "0.67590606", "text": "def favorite\n drink = Order.last.drink\n $prompt.select(\"Would you like to add this order to your Favorites?\") do |menu|\n menu.choice \"Yes\", -> {drink.custom_favorite; self.update(favorite?: tru...
[ { "docid": "adef3b2fbdf0e68a020aa11648a2b979", "score": "0.701752", "text": "def save_as_favorite\n redirect_to root_path and return if not is_logged_in\n session[:favorite_dessert_id] = params[:id] # SET favorite\n flash[:notice] = \"dessert #{params[:id]} saved in session as favorite!\"\n ...