query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
1b8b4f462a82206bfbf8a24cebb71e04
3. The interpreter cannot concatenate an integer with a string. You could use string interpolation or convert the integer to a string using the to_s method. 4. The output would be: 1 3 1 2 5.
[ { "docid": "41cd9ea2fce3b2fcdfad72a765f46c38", "score": "0.0", "text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend", "title": "" } ]
[ { "docid": "4be5890b8d5155e10fd992aa83840bff", "score": "0.7140187", "text": "def intToString(number)\n end", "title": "" }, { "docid": "dbb2f0e61bce20533dc4592a3864da46", "score": "0.6810209", "text": "def stringy_2 (integer, first_number = 1)\n numbers = []\n \n integer.times d...
268fa5c8dae66872a04e34d15e17e867
DELETE /princes/1 DELETE /princes/1.json
[ { "docid": "7e815d0b71f56eae29d8b65a45ec2fb5", "score": "0.0", "text": "def destroy\n\n @users = Prince.find(params[:id])\n authorize @users\n\n @prince.destroy\n respond_to do |format|\n format.html { redirect_to princes_url, notice: 'Prince was successfully destroyed.' }\n format...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7043205", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "...
95df8bd721904a7f43e759e406d5fbe6
Check if edit or update Check if action is an edit or update action type. The check will pass if it is an `edit` or `update` action Usage update_actions? true update_actions? false edit_actions? true edit_actions? false
[ { "docid": "39a8ac037da2017e604f0310138fc4f6", "score": "0.7598156", "text": "def update_actions?\n update_actions.include?(action)\n end", "title": "" } ]
[ { "docid": "93302beedbb79482a9862a4311d20824", "score": "0.8354041", "text": "def edit_action?\n %i[edit update].include?(action)\n end", "title": "" }, { "docid": "42bc41b4607d8fd7e05f4b0ff122b23a", "score": "0.80773777", "text": "def edit_or_update?\n [\"edit\", \"update...
dff66738bc29ab9d6ae280762a2c1bdd
List Edge Clusters under an Enforcement Point Paginated list of all Edge Clusters under an Enforcement Point
[ { "docid": "ce4ab88085f23b0dea9be4c7af1eb2a3", "score": "0.6047448", "text": "def list_edge_clusters_for_enforcement_point_with_http_info(site_id, enforcementpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInfraEnforcementPointsApi...
[ { "docid": "bb4ee048022eb8d31075be8a6d7f3724", "score": "0.60495186", "text": "def list_edge_clusters_for_enforcement_point(site_id, enforcementpoint_id, opts = {})\n data, _status_code, _headers = list_edge_clusters_for_enforcement_point_with_http_info(site_id, enforcementpoint_id, opts)\n da...
1bfb098c80fd1361b8222f65f2464c3d
GET /resource/cancel Forces the session data which is usually expired after sign in to be expired now. This is useful if the user wants to cancel oauth signing in/up in the middle of the process, removing all OAuth session data.
[ { "docid": "4ac94a220a636bd185fdaec6b50ca6d5", "score": "0.7635337", "text": "def cancel\n expire_session_data_after_sign_in!\n redirect_to new_registration_path(resource_name)\n end", "title": "" } ]
[ { "docid": "2bdafa513ed392cdbdc8926b6ba266dd", "score": "0.736778", "text": "def cancel(oid, request, session)\n session.clear\n access_denied\n end", "title": "" }, { "docid": "4fd39e27d6e860d322de99b88849e92c", "score": "0.731201", "text": "def cancel\n expire...
9eb5fce4fd4d1e339ca2064054128810
Checks if is set the organisation session
[ { "docid": "d71b44599343ce515446fe8b28b82694", "score": "0.78268975", "text": "def organisation?\n current_organisation.present?\n end", "title": "" } ]
[ { "docid": "d2a4100144cacce1f57c8bb1406d2ade", "score": "0.74749684", "text": "def check_org\n unless current_user.organisation == @meeting.division.organisation\n redirect_to current_user, :alert => \"Sorry, you are not authorised for that\"\n end\n end", "title": "" }, { ...
55e3565ee44cb971c2164ce1fff196f4
FUNCTION : Update joining date DESCRIPTION : Function to be used by ADMIN/HR to update joining date for resume
[ { "docid": "3744ee79a5856c5796ffca0775e3f7ea", "score": "0.77819157", "text": "def update_joining\n joining_date = params[:resume][:joining_date]\n status = params[:resume][:status]\n comment = params[:resume][:comment]\n resume = Resume.find(params[:resu...
[ { "docid": "81e88525fed5c4e21ecf35fc641046b6", "score": "0.6864002", "text": "def mark_joining\n status = \"JOINING\"\n match = ReqMatch.find(params[:match])\n resume = Resume.find(params[:resume_id])\n joining_date = params[:joining_date]\n\n overall_status = resume.re...
a89b16df47543eebe32efaa0777ac760
Maps given layouts for Rails select form helper.
[ { "docid": "fa3644a382f1e49a80e6d8abbc1179d8", "score": "0.6346231", "text": "def mapped_layouts_for_select(layouts)\n layouts.each do |layout|\n @map_array << [human_layout_name(layout[\"name\"]), layout[\"name\"]]\n end\n @map_array\n end", "title": "" } ]
[ { "docid": "00ad87bab8930711cc108b36897fc254", "score": "0.64918274", "text": "def _layout_for_option(name); end", "title": "" }, { "docid": "1a1a9556d32615f10c3d13cd2033a3c4", "score": "0.5976654", "text": "def layouts_for_select(language_id, only_layoutpages = false)\n @map_...
9651425f60500324685627a3635f0ae6
Unset the updated columns hash before returning from save.
[ { "docid": "172cb53bef88c21c4221a2a383647823", "score": "0.74824363", "text": "def _save(opts)\n super\n ensure\n @columns_updated = nil\n end", "title": "" } ]
[ { "docid": "7fb71a8b77bf45a9ad379e53ca48347a", "score": "0.75467306", "text": "def _save_update_all_columns_hash\n v = super\n v.delete(model.lock_column)\n v\n end", "title": "" }, { "docid": "a3839d999d562ea4a55718f739fffa07", "score": "0.7512449", ...
0a0a09b110aef66e7dddb86362976dde
Prepare site data for site payload. The method maintains backward compatibility if the key 'data' is already used in _config.yml. Returns the Hash to be hooked to site.data. source://jekyll4.2.2/lib/jekyll/site.rb:280
[ { "docid": "cd730222f05425e5ae81595ed81b0ba9", "score": "0.63739276", "text": "def site_data; end", "title": "" } ]
[ { "docid": "4f10441ea23ad7386a9531d594079a5e", "score": "0.74402857", "text": "def site_data\n @site_data ||= (config[\"data\"] || data)\n end", "title": "" }, { "docid": "d41f7cf10ca2c024804e5b0cb019f801", "score": "0.7107632", "text": "def site_payload\n {\"site\...
5d2f55b12479eefcbb4ccceab519c36a
Set event psc_ideal_date to the event start date if it is blank
[ { "docid": "17c59da466053dede41b3033985c2976", "score": "0.9038329", "text": "def set_psc_ideal_date\n self.psc_ideal_date = self.event_start_date if self.psc_ideal_date.blank?\n end", "title": "" } ]
[ { "docid": "e765db84e8a78d595c8ea61a95fdb374", "score": "0.7022639", "text": "def set_start_date(event, sdt, *args)\n unless event\n return nil\n end\n if event.eventenddate.to_date >= sdt && event.eventstartdate.to_date <= sdt\n event.eventstartdate = sdt\n event\n else\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0c66cbd14177c1f96d15d195cea6cab0", "score": "0.0", "text": "def set_interface_group\n @interface_group = InterfaceGroup.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...
5ddaaa0f1d30715000912fdc312a0df0
makes a random string I think
[ { "docid": "95d417c105ef98d4d3bc0f8fd64913b7", "score": "0.0", "text": "def generate_code(number)\n charset = Array('a'..'z')\n Array.new(number) { charset.sample }.join\nend", "title": "" } ]
[ { "docid": "ad817547aa34baefa700ce0e444af4f0", "score": "0.8351055", "text": "def random_string\n [*('a'..'z'),*('0'..'9')].shuffle[0,8].join\n end", "title": "" }, { "docid": "5677f309b079f5ee3abecf509b906a45", "score": "0.81923974", "text": "def random_string()\n\n\t\t(...
1ac2c50cdcd75ab41fbff11145e9428c
The reciprocal type of a one_to_many association is a many_to_one association.
[ { "docid": "af594c3c343be57c19186fd0e36d2cfd", "score": "0.87933064", "text": "def reciprocal_type\n :many_to_one\n end", "title": "" } ]
[ { "docid": "23e36173951c56880f1805e8cecccb05", "score": "0.87955624", "text": "def reciprocal_type\n :many_to_one\n end", "title": "" }, { "docid": "788bfff16463847a54eb8d06df716a26", "score": "0.8676533", "text": "def reciprocal_type\n :one_to_many\n end", ...
c4fece9f23f7e74e056528d68714af05
Creates an object for ouput out of an argument
[ { "docid": "395eb842c33a51ee2151951c41452929", "score": "0.76429087", "text": "def create_output(arg)\n if arg.nil?\n \"\"\n elsif arg.respond_to?(:<<)\n arg\n else\n raise \"Illegal output object: #{arg.inspect}\"\n end\n end", "title": "" } ]
[ { "docid": "1b5ed241f427468d15700c9553ccc1b7", "score": "0.6622992", "text": "def initialize(output)\n @output = output\nend", "title": "" }, { "docid": "9257c5879d7c8523ac87651207bb395e", "score": "0.64732915", "text": "def create_out (msg)\n @ironout = Ironfist::Output.new(msg)...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "0c876419a51f28a3e7e84d9985f358e2", "score": "0.0", "text": "def update!(**args)\n @errors = args[:errors] if args.key?(:errors)\n @row_number = args[:row_number] if args.key?(:row_number)\n @vm_name = args[:vm_name] if args.key?(:vm_name)\n @vm_uuid = args...
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
1d94ac0178442e5487a467c3be80f3c6
Called to connect to remote services like FTP and S3.
[ { "docid": "ef298b6c227a1d455f8ffa8363c86b8a", "score": "0.59701526", "text": "def connect!\n end", "title": "" } ]
[ { "docid": "1d039b674a1025b6b9fa47677bca3ca3", "score": "0.66853553", "text": "def connect_to_server\n @service.connect(connect_settings)\n end", "title": "" }, { "docid": "5f3200afa90b6b9d927f514cfcdb2c5f", "score": "0.6443104", "text": "def connect(options)\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4ac37ff6b077bf04a1a5c19eb15498fd", "score": "0.0", "text": "def set_donation\n @donation = Donation.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...
a364a8f20180f230a49eb380d72e2ac5
PATCH/PUT /targets/1 PATCH/PUT /targets/1.json
[ { "docid": "fbeb0d19582ff62a7089d2d68805a336", "score": "0.6279917", "text": "def update\n @target = current_user.targets.find(params[:target][:id])\n\n respond_to do |format|\n if @target.update(target_params)\n format.html { redirect_to index_home_path, notice: 'Target was successful...
[ { "docid": "d938a7ab8b7eea10f000f50fa5194ebb", "score": "0.648806", "text": "def update!(**args)\n @target_id = args[:target_id] if args.key?(:target_id)\n @target_type = args[:target_type] if args.key?(:target_type)\n end", "title": "" }, { "docid": "bde252a4427cfca...
9af815cc1d2256440fd87ee67b4e5bb8
PUT /effort_log_line_items/1 PUT /effort_log_line_items/1.xml
[ { "docid": "77903254f48606dd3330071d0248f5ad", "score": "0.7405775", "text": "def update\n @effort_log_line_item = EffortLogLineItem.find(params[:id])\n\n respond_to do |format|\n if @effort_log_line_item.update_attributes(params[:effort_log_line_item])\n flash[:notice] = 'EffortLogLin...
[ { "docid": "f43975ff0f31320620094a1cbd867f05", "score": "0.6537726", "text": "def update\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n if @line_item.update_attributes(params[:line_item])\n format.html { redirect_to(@line_item, :notice => 'Line item was successf...
5764ddc8b7d05652e5790687ddea013c
Find and return all Social Security Numbers.
[ { "docid": "1da9fbbd3b3e48111de7f35a3dd90819", "score": "0.46120256", "text": "def grab_all_ssns(string)\n string.scan(/\\d{3}-\\d{2}-\\d{4}/)\nend", "title": "" } ]
[ { "docid": "822e41e33142b186670fb82a0317b48b", "score": "0.56934756", "text": "def social_security_number(&p)\n if block_given? then attribute('SSN',&p) else attribute('SSN') end\n end", "title": "" }, { "docid": "d235867e101904e7bf8539a4fbd6d81e", "score": "0.5521305", "text": "...
21494e28ee24987997189838fb4589e5
DELETE /characters/1 DELETE /characters/1.json
[ { "docid": "f5d903400e442fe97e8ef54a1a565a05", "score": "0.6959477", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to game_path(@game), flash: { success: I18n.t('flash_messages.success.destroyed', model: I18n.t('model.character')) } }\n forma...
[ { "docid": "da9dea2b7f2f1515416748e3b33bc995", "score": "0.78668696", "text": "def destroy\n p \"Character destroy route accessed\"\n set_character\n render json: @character.destroy()\n end", "title": "" }, { "docid": "59c47e64fd78418cdb35270b22cf8416", "score": "0.771623", ...
971267cf89ee4410ad3f847fc40ac184
download multiple files from a directory in a batch local dir is the dir where to download the file on the local machine remote_paths is the dir where to get the files on the remote machine remote_files is an arr of files names to get
[ { "docid": "bc2da00f602d6e98554a31ee8cf26c0f", "score": "0.82764786", "text": "def download_files local_dir, remote_dir,remote_files,opts = {}\n safe_fetch do\n @ssh.sftp.connect do |sftp|\n Logger.<<(__FILE__,\"INFO\",\"Will start download #{remote_dir}/* fr...
[ { "docid": "89fd39b9118b5b8a0ba3dbaebd1e0438", "score": "0.7766202", "text": "def pull_files(remote_path,local_path)\n debug_p(\"pull_files from #{remote_path} to #{local_path}\")\n @sftp_session.dir.foreach(remote_path){ |path|\n #unless path.name == \".\" || path.name == \"..\"\n #not ...
575024487dd6ed1872fb1218ca358734
Returns the public (unsigned) URL for this object. s3.bucket('bucketname').object('objkey').public_url => " To use virtual hosted bucket url. Uses https unless secure: false is set. If the bucket name contains dots (.) then you will need to set secure: false. s3.bucket('mybucket.com').object('key') .public_url(virtual_...
[ { "docid": "c93aa900470b9be6980975c323942fa3", "score": "0.7741842", "text": "def public_url(options = {})\n url = URI.parse(bucket.url(options))\n url.path += '/' unless url.path[-1] == '/'\n url.path += key.gsub(/[^\\/]+/) { |s| Seahorse::Util.uri_escape(s) }\n url.to_s\n ...
[ { "docid": "64e9f792519a9eee703754e4fe868d48", "score": "0.80059165", "text": "def public_uri\n URI.parse(s3obj.url(:expires_in => self.class.url_lifetime))\n end", "title": "" }, { "docid": "7f10aec377be347e327c133c8469c806", "score": "0.7661355", "text": "def public...
4fcf7220c93cb60d56b6e31bbd6681e1
POST /custom_camo_hats POST /custom_camo_hats.json
[ { "docid": "06f1175b721f66258bba878a76178e3e", "score": "0.5975684", "text": "def create\n @custom_camo_hat = CustomCamoHat.new(custom_camo_hat_params)\n @custom_camo_hat.brand_id = params[:brand_id]\n\n respond_to do |format|\n if @custom_camo_hat.save\n format.html { redirect_to @...
[ { "docid": "ec108d8e36b408d550b6f05b74d384bc", "score": "0.5932223", "text": "def set_custom_camo_hat\n @custom_camo_hat = CustomCamoHat.find(params[:id])\n end", "title": "" }, { "docid": "7ee5ce5ce0597f38e6fbc2a90d280f73", "score": "0.57962877", "text": "def custom_camo_hat...
ff36d8da036a95ebf86b2ec7bc808a3a
checks if the linked list has a cycle. A cycle exists if any node in the linked list links to a node already visited. returns true if a cycle is found, false otherwise. Time Complexity: O(n) where n is the length of the list. Space Complexity: O(1) We only use constant sized variables
[ { "docid": "095482fc412da839496ffe7ea7f1e413", "score": "0.79168344", "text": "def has_cycle\r\n return false if @head.nil?\r\n fast = @head.next\r\n slow = @head\r\n i = 0\r\n until fast.nil?\r\n slow = slow.next if i % 2 == 1\r\n fast = fast.next\r\n i += 1\r\n retur...
[ { "docid": "480906518a93995e148925e9fe62004f", "score": "0.8514866", "text": "def has_cycle\r\n # return head if empty or only 1 value\r\n return false if @head == nil\r\n return false if @head.next_node == nil\r\n\r\n slow = @head \r\n fast = @head.next_node\r\n\r\n # slow travels 1 no...
acaf86e2ff45c22aab8ea79d288bc5dd
Create and return an image object. send_image doesn't exist in this implementation: instead the controller calls create_image then uses send_data to send it to the client (it seems that send_data isn't available in the scope of the model!)
[ { "docid": "bb4d1117f9b9e3ea4ca0b3089b269223", "score": "0.0", "text": "def create_image(code)\n\t\tcode = self.decode(code)\n\t\tangle = 5.degrees\n\t\twidth = 80\n\t\theight = 25\n\t\tbg = GD2::Color[0xff, 0xff, 0xff]\n\t\tfg = GD2::Color[0x00, 0x00, 0x00]\n\t\tcap_image = GD2::Image::TrueColor.new(80...
[ { "docid": "fd163ef4fecc0e69782bc78042801479", "score": "0.761052", "text": "def create\n\n # Save original image and image style transferred image if requested.\n\n if image_params[\"ios_data\"]\n # Handle images from iOS\n # logger.info \"Need to decode iOS image.\"\n tmp_params =...
2a3d2920854abba154046ee3e25b90f3
POST /items POST /items.json
[ { "docid": "cbb5317540f7c2bce3f4670cf52dfb9c", "score": "0.0", "text": "def create\n @item = Item.new(item_params)\n @item.owner_id = current_user.id\n @item.university_id = current_user.university.id\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, n...
[ { "docid": "1a87b6b1a8f3fc007c549688390eae3f", "score": "0.75517005", "text": "def create_item\n item = @list.items.create(:title => params[:title], :details => params[:details], :deadline => params[:deadline], :tags => params[:tags])\n render json: { item: item }\n end", "title": "" }, {...
a550f0fdd5944405353c6506d94b7c8f
decides and returns subgenre based on record store description
[ { "docid": "e7d2634a10aeac47b6121b623ebebf3b", "score": "0.7580243", "text": "def parse_subgenre(description)\n subgenres = [\n [\n \"highly\",\n \"recommended\",\n \"recommend\"\n ],\n [\n \"ambient\",\n...
[ { "docid": "e8d3eaa027b48dd9a0cce19fa05abbfb", "score": "0.7133901", "text": "def genre; end", "title": "" }, { "docid": "e8d3eaa027b48dd9a0cce19fa05abbfb", "score": "0.7133901", "text": "def genre; end", "title": "" }, { "docid": "92f587b3aa8af2b6c450a4af405c1fe1", "...
e8455316508be7653be28086baa26257
Clicks the "Publish" link for the specified Template.
[ { "docid": "899b8acf134301baeda5e564ebefa6b9", "score": "0.6163103", "text": "def publish(templatename)\n frm.table(:class=>\"listHier lines nolines\").row(:text=>/#{Regexp.escape(templatename)}/).link(:text=>\"Publish\").click\n end", "title": "" } ]
[ { "docid": "d1af7279a8ca4f3417fc322f2ace3fba", "score": "0.68184876", "text": "def publish\n frm.link(:text=>\"Publish\").click\n PublishAssessment.new(@browser)\n end", "title": "" }, { "docid": "d1af7279a8ca4f3417fc322f2ace3fba", "score": "0.68184876", "text": "def publish\n...
7e90dbb9bb61cca6c10f2fa152d34c1d
"f"ind the last file or directory of which name starts with the given String.
[ { "docid": "7a79e5bd95213fa3094f39ef8427f2bd", "score": "0.0", "text": "def F\n c = get_char and (@last_command = -> { find_reverse c }).call\n end", "title": "" } ]
[ { "docid": "047ac4f1b7a4ba787a8740ca1a5fef76", "score": "0.6165879", "text": "def finddir(s) #private\n Abbr.index(s.downcase) || Full.index(s.downcase) || -1\nend", "title": "" }, { "docid": "6d461d60b0f1510c38e4b762dfc706e9", "score": "0.61427164", "text": "def first_last(str)\n\t...
1c211b387b58f6aacf218022c20e4882
Sets the default value on the receiver. Normally this method is only called during Configurableinitialize_config, and only then when init? returns true.
[ { "docid": "f77b7da737132939c7cec6df5ec13c14", "score": "0.65254575", "text": "def init(receiver)\n receiver.send(writer, default)\n end", "title": "" } ]
[ { "docid": "972d9a437149a252a295e485f663b548", "score": "0.7979655", "text": "def set_default(value)\r\n\t\t\tself.default_value = value\r\n\t\tend", "title": "" }, { "docid": "58516e81e1b61a2fbdf025a42ba02b12", "score": "0.76734453", "text": "def default_value=(value)\n\t\t@default_...
e9161ff37e825360374220668d739752
GET /zanry GET /zanry.json
[ { "docid": "4d3e198b3528c6c293c5233f221d208c", "score": "0.69382185", "text": "def index\n @zanry = Zanr.all\n end", "title": "" } ]
[ { "docid": "e831eed9b1027900f14f203b4723461a", "score": "0.6383503", "text": "def index\n if params[:q]\n url = \"http://api.worldweatheronline.com/premium/v1/tz.ashx?q=#{params[:q]}&format=json&key=2c46659bd90a41a0bcf132257162410\"\n @json = ActiveSupport::JSON.decode(open(url).read)\n ...
f74336e0c51e600fbaebbba8fe1b4bd4
test selecting an incorrect action type
[ { "docid": "2931f878f60c0aaf51775f27f69eb3e7", "score": "0.7558389", "text": "def test_select_incorrect_action_types\n controller_method = \"select/incorrect/action/types/get\"\n Privilege.resource :cbac_privilege, controller_method, :get\n Privilege.select(controller_method, :get)\n assert_...
[ { "docid": "4833c82d424c947ed0f3d9bbcc52a55c", "score": "0.7399606", "text": "def test_select_the_other_action_type\n controller_method = \"select/the/other/action/type/get\"\n Privilege.resource :cbac_privilege, controller_method, :get\n assert_match(/PrivilegeSets only exist for other action/...
abcef7c4ecd6717f4f2eedb59d1fac3e
Loads grid.css.erb file, binds it to current instance, and returns output
[ { "docid": "e5a34157f1af87360f9864a44d057d3e", "score": "0.74491584", "text": "def generate_grid_css\n # loads up erb template to evaluate custom widths\n css = ERB::new(File.path_to_string(CustomLayout::CSS_ERB_FILE))\n \n # bind it to this instance\n css.result(binding)\n end...
[ { "docid": "8f5d939a7697c8c5520270d3600f403d", "score": "0.60842985", "text": "def render\n source = File.expand_path(\"../stylesheets/template.#{format}.erb\", __FILE__)\n ERB.new(File.read(source), nil, '-').result(binding)\n end", "title": "" }, { "docid": "f4218e82c442b24ff5...
377128cf6939033ac284a00177488a29
This is called by the GitHub API after user agrees to authorize the app. It is also called when he clicks 'Sign Up with Github', even if he has already authorize it
[ { "docid": "4300f1676b767abc5e9a95127dd94bf2", "score": "0.59915036", "text": "def callback\n \tbegin\n\n \t\t# Get the authentication token\n \t\tauthorization_code = params[:code]\n\t @access_token = github.get_token authorization_code\n\t @access_token.token\n\t\t\n\t\t # Get GitHub usernam...
[ { "docid": "17050bb59f23ce23b3dedbc8c35f875e", "score": "0.7269632", "text": "def authorize_github\n redirect_to \"https://github.com/login/oauth/authorize?client_id=#{GITHUB_CONFIG['client_key']}\"\n end", "title": "" }, { "docid": "91b4786884bab7baa17d765939c6a3f8", "score": "0.712...
fa3a8cd92831576e27154cb0ea9848ae
is called Combined Comparison operator. It returns: 0 if first operand equals the second one; +1 if first operand is greater than the second one; 1 if first operand is less than the second one.
[ { "docid": "f044e0c4364bd289059c313124824813", "score": "0.0", "text": "def <=>(other)\n # Descending order\n other.rank <=> @rank\n end", "title": "" } ]
[ { "docid": "64207cafe09c9daeaf0b8a18a01e797d", "score": "0.7125983", "text": "def compare(left, right)\n left_right = left.to_s + right.to_s\n right_left = right.to_s + left.to_s\n left_right.to_i > right_left.to_i\nend", "title": "" }, { "docid": "1babbe192303edea1e9678d87578ddd7", "...
ed28be5183306f16b9bdcb00b167370a
++ add sav vehicle and assign to a sav base (override) _savBase_:: sav base (ignored) return:: new sav
[ { "docid": "7b16b83ae47be9eccf3fbef720776477", "score": "0.75418186", "text": "def addNewSavVehicleToBase(savBase = nil)\n _savList = [] ;\n @corpList.each{|corp|\n _newSav = corp.addNewSavVehicleIfNeed() ;\n _savList.push(_newSav) ;\n }\n return _savList ;\n end", ...
[ { "docid": "c5b28af703cb2219087021fc058dce5b", "score": "0.5382145", "text": "def create_item(data)\n fail 'Base class does not include ::Record!' if @base && !@base.include?(::Record)\n item = (@base || Record).new\n item.data = data\n item\n end", "title": "" }, { "docid": "0a...
bb5903e1f87a0af4fc2cd6ba8a86d912
Builds a new Hairballs::Plugin and adds it to thelist of `.plugins` that can be used.
[ { "docid": "b68042a87ed8c22b4d4b7929a5f2af75", "score": "0.0", "text": "def add_plugin(name, **options)\n vputs \"[config] Adding plugin: #{name}\"\n plugin = Plugin.new(name, options)\n yield plugin\n plugins << plugin\n vputs \"[config] Added plugin: #{name}\"\n\n plugin\...
[ { "docid": "07a437f709da1258a117120bea4a525c", "score": "0.67582464", "text": "def load_plugins(project)\n Plugin.repository.each do |build_plugin|\n id, _ = build_plugin.instance_method(:initialize).source_location\n unless @@plugins_hash[id.to_sym]\n plugin = build_plugin.new(id)\n...
7919f45a88ef0e242c31afa0d25d21a9
significant change: Allow pershard roles
[ { "docid": "5e08e2b5549544c6f8d1efed8cab4c62", "score": "0.0", "text": "def current_role(without_overrides: false, target_shard: current_shard)\n return super() if without_overrides\n\n sharded_role = nil\n connected_to_stack.reverse_each do |hash|\n shard_role = ha...
[ { "docid": "720fa5370d0bbe5d4f9363f8396f1a78", "score": "0.7493428", "text": "def role; end", "title": "" }, { "docid": "720fa5370d0bbe5d4f9363f8396f1a78", "score": "0.7493428", "text": "def role; end", "title": "" }, { "docid": "720fa5370d0bbe5d4f9363f8396f1a78", "sc...
8431e125fc306473857ac69af7f40cca
DELETE /circulos/1 DELETE /circulos/1.json
[ { "docid": "179f7287885b134c8607a7a4313db784", "score": "0.66896373", "text": "def destroy\n @circulo.destroy\n respond_to do |format|\n format.html { redirect_to circulos_url, notice: 'Circulo eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end", "title": "...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.74244493", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": ...
a64ef8d4f44df1b220a90a2a32e26e0f
Find guest_user object associated with the current session, creating one as needed
[ { "docid": "7a5d081662c732bee6dc74cd1e83f5be", "score": "0.84039366", "text": "def guest_user\n if session[:guest_user_id]\n guest = Guest.where(id: session[:guest_user_id]).first\n end\n guest ||= Guest.create\n session[:guest_user_id] = guest.id\n guest\n end", "...
[ { "docid": "fde6cfdb97599b473a6b2158f6a699fd", "score": "0.8372495", "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": "84d40efaa18043aaa92160f2ffe3d6c5", ...
4e2126cad87ea24a2fa7d51bfbe259f9
takes a hash and saves it to the datastore
[ { "docid": "1d415891afb3aa6c11f8802cbbfcb3ef", "score": "0.5911284", "text": "def save(data)\n ScraperWiki.save_sqlite(unique_keys=UNIQUE_KEYS, data)\nend", "title": "" } ]
[ { "docid": "e42b6d0ea1c20494aab250ee255834bd", "score": "0.7122615", "text": "def add_hash(hash)\n\t# add hash to the DB\nend", "title": "" }, { "docid": "24cbd5003d01c86c5845331532c66510", "score": "0.7081784", "text": "def put(hash)\n Rails.logger.info hash.inspect\n key ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "580ee881e5a0a62e279c1854a906467b", "score": "0.0", "text": "def custom_expense_type_params\n params.require(:custom_expense_type).permit(:name)\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...
b816b0cb27e576f927470fd0908e9cb3
validate the configuration Raise when configuration is not valid Remove " or " from urls
[ { "docid": "67fcd0144e585b6af6e7e46ed211a771", "score": "0.0", "text": "def valid!\n format!\n\n %i[username token gateway api_version].each do |field|\n validate_presence(field)\n end\n\n true\n end", "title": "" } ]
[ { "docid": "6d3c47cd05de02d605f11f0a70e7a7c1", "score": "0.722859", "text": "def validate_url!(url)\n URI(url)\n rescue\n raise Chef::Exceptions::ConfigurationError,\n \"Chef::Config[:data_collector][:output_locations][:urls] contains the url #{url} which is not valid...
92cd8411d5790c66b2d6c39b4244e41a
the main method that builds what will become the yaml file
[ { "docid": "904f8bf6b341c67d4cd140f5d09b90a7", "score": "0.0", "text": "def build_resource_data(name, data)\n properties = data[\"properties\"].reject { |v| %w{name sensitive}.include?(v[\"name\"]) || v[\"deprecated\"] }.sort_by! { |v| v[\"name\"] }\n\n r = {}\n\n # We want all our resour...
[ { "docid": "b33397bc26692567b56318595ebd6a92", "score": "0.7182555", "text": "def generate_yaml\n raw_sections = File.read(__FILE__.gsub('.rb', '.wiki')).\n split(/^==/).\n map{|l| /=*(.+):(.+)====(.+)/m.match(l)}.compact\n\n sections = raw_sections.map do |r|\n desc =...
bf285d3bb43d1610b9c6eba89a723f6a
Lua code for converting the different scores to their respective pigeonhole lists. This reduces the amount of lua string manipulation which dramatically impoves the speed. Also deletes old keys (not needed in production because of namespaces). Only needed when scoring.
[ { "docid": "05d2cf428c5e93a642c3ef3d66a10153", "score": "0.60244083", "text": "def converter_lua_code\n if valid_query? && scoring?\n <<-LUA\n local temp_list_ = '#{namespace}' .. 'temp_list_'\n local converter = {}\n for i=max_score,0,-1 do\n converter[i] = temp_l...
[ { "docid": "61f1d5864815903a893537a5d4fcf72c", "score": "0.6226778", "text": "def converter ()\n\n\n\n\n\n\n player_scores = $players.map do |player|\n\n if player[:card_type][0] ==\"A\"\n # player[:card_type][0]=14\n {\n name: player[:name],\n score: 14\n }\n elsif p...
8fa21cadadb2169ff9848ee102e502b7
DELETE /inform_mails/1 DELETE /inform_mails/1.json
[ { "docid": "731bccefe91bede89c6a3022b5760624", "score": "0.7717761", "text": "def destroy\n @inform_mail = InformMail.find(params[:id])\n @inform_mail.destroy\n\n respond_to do |format|\n format.html { redirect_to inform_mails_url }\n format.json { head :no_content }\n end\n end",...
[ { "docid": "d550b727f1065446084320c4d6a1dd36", "score": "0.77185816", "text": "def destroy\n @inform_mail.destroy\n respond_to do |format|\n format.html { redirect_to inform_mails_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "44bd1e5fe6...
28808f59d39ac4a69f133989d567d705
create an API client +config+ optional Confstruct +&block+ config block Example: Shove::App.new( app_id: "myappid" app_key: "myappkey" )
[ { "docid": "251cb0bf037a6b14fb52c29994270019", "score": "0.63721824", "text": "def initialize config={}\n @config = config\n @app_id = config[:app_id]\n @app_key = config[:app_key]\n @api_url = config[:api_url] || \"https://api.shove.io\"\n @ws_url = config[:ws_url]\n\n ...
[ { "docid": "5e45c88baf0e9aab56c90216a6b59af3", "score": "0.6773164", "text": "def init(data = {}, &blk)\n defaults = {:application_id => ENV[\"PARSE_APPLICATION_ID\"], :api_key => ENV[\"PARSE_REST_API_KEY\"]}\n defaults.merge!(data)\n\n # use less permissive key if both are specified\n ...
efd1dd928611c0cf92a81d412daa755a
Icon link to object helpers
[ { "docid": "686ecc439fce8827a6fa575aa1340f11", "score": "0.6593216", "text": "def icon_link_to_new(object, options = {})\n options[:name] = ''\n options[:class] ||= 'icon icon-plus action-button'\n options[:title] ||= t('.to_new', default: :icon_to_new_object, model: object_class_name(object))\...
[ { "docid": "f1653bfea9c16ced1446cd58406c6577", "score": "0.7722049", "text": "def link_with_icon(name, object, options = {})\n contents = []\n contents << \"<a href='#{object}' data-toggle='tooltip' title='#{options[:title]}'>\"\n contents << \"<i class='icon-#{options[:icon]}'></i>\"\n cont...
cc3bce0e36197935fd1bd0f4c2da519c
Does the mangling xcconfig need to be updated?
[ { "docid": "e3bf69934c52c24c685c5245e366f38a", "score": "0.6995627", "text": "def needs_update?\n return true unless File.exist?(@context.xcconfig_path)\n xcconfig_hash = Xcodeproj::Config.new(File.new(@context.xcconfig_path)).to_hash\n needs_update = xcconfig_hash[MANGLED_SPECS_CHECKSUM_...
[ { "docid": "be928c9c8c1c3bd9d40667e04a51cb56", "score": "0.76034766", "text": "def update_mangling!\n Pod::UI.message '- Updating mangling xcconfig' do\n builder = Builder.new(@context.pods_project_path, @context.pod_target_labels)\n builder.build!\n\n defines = Defines.manglin...
5f5625c75847cfd68268d97d2c5886e9
tell you how old the planet is in earth years
[ { "docid": "c7f65a42f5f2d1238f2f87611174e88a", "score": "0.7077485", "text": "def age_of_planet(planet)\n # formula uses 60 for minutes in an hour and 60 for seconds in a minute \n # should prefer variables (constants?)\n planet_age = ( Time.new - @beginning ) / ( planet.rate_of_rot...
[ { "docid": "fd984beaa9d0c58f8781c0c1efe25797", "score": "0.74514526", "text": "def local_age(planet, solar_system)\n current_year = Time.new.year\n earth_years = current_year - solar_system.formation_year\n earth_days = earth_years * 365\n planet_age = earth_days / planet.rate\n return \"#{planet.n...
8ab62e064adb463ecba22bd56b82ca1e
See ActionController::RequestForgeryProtection for details Scrub sensitive parameters from your log filter_parameter_logging :password
[ { "docid": "23a07792ed8a4693e847ab21dda280b8", "score": "0.0", "text": "def find_location\n doc = REXML::Document.new(open(\"http://api.foursquare.com/v1/user\", :http_basic_authentication=>[\"sthorpe@gmail.com\", \"mytruelove\"]))\n c = doc.elements.to_a( \"//name\" )\n @location = c.first.tex...
[ { "docid": "3100f9d0b6167d98e0613f51a93259e6", "score": "0.6777806", "text": "def params_filters\n @params_filters ||= %w(password)\n end", "title": "" }, { "docid": "3100f9d0b6167d98e0613f51a93259e6", "score": "0.6777806", "text": "def params_filters\n @params_filters |...
7164909cecf8fbc7447414628eb45888
Add revision after updating of the page. If revisioned attributes of the page or any page part were changed.
[ { "docid": "38465662eb27f3503baedf90119d7a34", "score": "0.7956636", "text": "def add_revision\n attributes = get_attributes(FIELDS['page_part_revision_attributes'])\n attributes['number'] = self.page.number_of_last_revision\n attributes['filter_id'] = nil if attributes['filte...
[ { "docid": "f84a35b03de94e8fedd7ef08faab563f", "score": "0.6791131", "text": "def update_with_revision\n store_revision do\n update_without_revision\n end\n end", "title": "" }, { "docid": "5e3095c0ef9e2ae38777732cbf9fff3c", "score": "0.6409304", "text": "def add_...
b9c82e4486961c5f13c7140a4b52c0ad
follow normal method_missing and if still not found, look for the method on associated attribute object (att_value)
[ { "docid": "a2a1c0b5e03307dabab75d30f3ef432b", "score": "0.75593626", "text": "def method_missing(method_name, *args)\n begin\n super;\n rescue NoMethodError => e\n self.att_value.send(method_name, *args);\n end\n end", "title": "" } ]
[ { "docid": "cac22058ba351d8ba9b188a164e1c9e6", "score": "0.76010346", "text": "def method_missing(method, *args) \n return @attribute.send(method, *args) if @attribute.respond_to?(method)\n raise NoMethodError.new(method.to_s)\n end", "title": "" }, { "docid...
995967e5acb95a6353f9a8980e754d11
Returns all siblings and a reference to the current node, respecting permitted/hidden categories
[ { "docid": "f9bf88b456a5927832478ccdc62c3fed", "score": "0.68220806", "text": "def self_and_siblings\n parent ? parent.children : self.class.roots\n end", "title": "" } ]
[ { "docid": "893d65bcd7517d37c43ac161a5a86478", "score": "0.74346346", "text": "def get_siblings\n self.root? ? [] : self.siblings.select { |d| d.id != self.id }\n end", "title": "" }, { "docid": "68fda7c7df21e5c0e1790041e3d9cec3", "score": "0.7432363", "text": "def siblings...
73b3acded1af71fd4a85c6f899ab9db1
GET /labors/1 GET /labors/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "0e35e34301f963848dab473497ae49b1", "score": "0.7011768", "text": "def index\n @labors = Labor.all\n end", "title": "" }, { "docid": "a83730b65ceaefadc49a3ce371b518df", "score": "0.6819835", "text": "def index\n @labs = Lab.all\n\n respond_to do |format|\n f...
0878e63ea7e3b5a45cd02a02da45e239
Generates SQL that produces one row per Answer and/or Choice for the given mission. Assumes the language desired is English. Currently does not respect the locale (uses canonical_name).
[ { "docid": "ab7caa217017546e78db61de18a18035", "score": "0.55828995", "text": "def generate\n Response\n .select(\"responses.id AS response_id\")\n .select(\"responses.created_at AS submission_time\")\n .select(\"responses.reviewed AS is_reviewed\")\n .select(\"forms.name AS form_...
[ { "docid": "3d5612466f1aa9580a14fd667793e1e7", "score": "0.5406642", "text": "def execute()\n\t\n\t \n\tif (@parameters['template'] == \"Yes\") \n\t\tresult= \"<h2>\" +@base_entry['Survey_Template_Name'] +\"</h2>\"\n\telse\n\t\tresult= \"\"\n\tend\n\tresult << \"\\n\" << @parameters['h_table_structure']...
d18a9b853874177d83c53866006c6918
determines how many of the die are in the roll
[ { "docid": "b08d504870d2dd88bb30b5d172131c68", "score": "0.75508654", "text": "def how_many?\n @roll.count(@die)\n end", "title": "" } ]
[ { "docid": "54edc96e68076bc5b6db521b2c2897f8", "score": "0.7939499", "text": "def dice_count\n @dice.count\n end", "title": "" }, { "docid": "f5e65528526c440ebc25a0e618cb6186", "score": "0.7333143", "text": "def roll_die\n num = 0\n num = rand(sides) + 1\n\n ...
fcb4434bbafb6fb346f35bb814bcd7f7
Set attachment for the default_image role
[ { "docid": "557c625db58da88feb0ed4bec10285a9", "score": "0.85330904", "text": "def default_image_file=(file)\n self.attachments.build(file: file, role: 'default_image')\n end", "title": "" } ]
[ { "docid": "63ece9a834fadf9d0d94be8f54468b2e", "score": "0.8475756", "text": "def default_image_file=(file)\n attachments.build(file: file, role: 'default_image')\n end", "title": "" }, { "docid": "cfba442f67f718f7acd33465fc3517e7", "score": "0.8467479", "text": "def default_imag...
7c0bb8448066d03f3cbf948836a3334e
Returns true if the user is logged in, false otherwise.
[ { "docid": "be70d9e2f2572b85d49bb87417a80770", "score": "0.0", "text": "def logged_in?\n !current_user.nil?\n end", "title": "" } ]
[ { "docid": "31fb4132def094f5ed9925db932d58eb", "score": "0.89972186", "text": "def user_is_logged_in\n if session[:current_user] != nil\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "5e8797ab67adadcb571fb446716121fe", "score": "0.8901693"...
442ef5d7cfe25b6c0876390dcdaa629c
I N S T A N C E M E T H O D S Initialize a new tag that expects Ruby code in its `body`. Calls the tag's parse_pi_body method with the specified `body`.
[ { "docid": "2ce4849d683eaf080e19f5d352b4ac0c", "score": "0.6174013", "text": "def initialize( body, linenum=nil, colnum=nil ) # :notnew:\n\t\tsuper\n\n\t\t@body = body.strip\n\t\t@identifiers = []\n\t\t@matched_pattern = self.match_tag_pattern( body )\n\tend", "title": "" } ]
[ { "docid": "5c72f85ed500cb61b574b79d99c3406f", "score": "0.6653123", "text": "def initialize(body, code)\n @body = body\n @code = code.to_i\n end", "title": "" }, { "docid": "b0b25f9dcb4376e191d59be6dc0eef9f", "score": "0.65554", "text": "def initialize(body, code)\n ...
8bfb79f7593a00685f1ec160268c6876
Retrieve information about a Plaid application Allows financial institutions to retrieve information about Plaid clients for the purpose of building controltower experiences
[ { "docid": "a8b9f6d481c14faf8f995bd59eaa0f0c", "score": "0.0", "text": "def application_get(application_get_request, opts = {})\n data, _status_code, _headers = application_get_with_http_info(application_get_request, opts)\n data\n end", "title": "" } ]
[ { "docid": "3fb3eeb3315241da0ead80765dbbf452", "score": "0.67114615", "text": "def get\n search = PLATFORMS[platform_id][:search]\n search.fetch_app_details params[:id], params\n end", "title": "" }, { "docid": "fd502ac918b599445de63a9768d2895a", "score": "0.64775366", "...
41738fc8e156252f9f8d757a76f31f90
POST /book_histories POST /book_histories.json
[ { "docid": "b1b5a0175a0b6cd7734039e569c87bf0", "score": "0.0", "text": "def create\n @book_history = BookHistory.new(book_history_params)\n respond_to do |format|\n if @book_history.save\n #This first email goes to tell the book owner the book is being borrowed.\n BookHistoryMai...
[ { "docid": "27c14e87213c38701582dc41a2003d5e", "score": "0.7124042", "text": "def create\n megam_rest.post_billedhistories(to_hash)\n end", "title": "" }, { "docid": "7a15d1d0f7f33077bfdec6aecb7776e9", "score": "0.6851713", "text": "def create\n @book_history = B...
61b5b5316b6e35405c47aff19b78cf54
Set the value of the EntriesPerPage input for this Choreo.
[ { "docid": "aa3393e73e431e6e6297451ce6033a7d", "score": "0.7818168", "text": "def set_EntriesPerPage(value)\n set_input(\"EntriesPerPage\", value)\n end", "title": "" } ]
[ { "docid": "9ce6b401050a7caec246c477e4f20c76", "score": "0.7484441", "text": "def entries_per_page=(entries)\n @entries_per_page = entries\n end", "title": "" }, { "docid": "adfc1af34a4c0fc241b9640aec35aa30", "score": "0.6354851", "text": "def set_PerPage(value)\n set_in...
311536b988db35e9c835ec7947226e97
DELETE /reservations/1 DELETE /reservations/1.json
[ { "docid": "919521e26bcfbe16bc72f6be80b3016c", "score": "0.0", "text": "def destroy\n @reservation = Reservation.find(params[:id])\n\n @reservation.reservation_rooms.each do |reservation|\n my_room=Room.find(reservation.room_id)\n #si tiene reservaciones pendientes\n #ignoro los que...
[ { "docid": "ceee3073ac3d20426647280f92c594b3", "score": "0.7747309", "text": "def destroy\n reservation = Reservation.find(params[:id])\n if reservation\n reservation.destroy\n render json: reservation\n else \n render json: [\"Reservation doesnt exist\"], status: 404 \n end \...
b15d3d2bc902c2a88b50afa57154b6da
TODO Add scope for roles
[ { "docid": "110d8a8205bcc3da42e01185c86e7be1", "score": "0.0", "text": "def downcase_role\n self.role.downcase\n end", "title": "" } ]
[ { "docid": "720fa5370d0bbe5d4f9363f8396f1a78", "score": "0.7379137", "text": "def role; end", "title": "" }, { "docid": "720fa5370d0bbe5d4f9363f8396f1a78", "score": "0.7379137", "text": "def role; end", "title": "" }, { "docid": "8aaf1a6319ed2d78a4e06398cc94d197", "sc...
cc90b8d70d79cefcffc63629fa998925
Set the logger type to curl which has more information.
[ { "docid": "0da87b0d61b6216957556381e59e0af7", "score": "0.64340127", "text": "def verbose_logger=(verbosity)\n default_options[:log_format] = verbosity ? :curl : :apache\n end", "title": "" } ]
[ { "docid": "11750e023b8718d29ba771ce9bc1b53d", "score": "0.6278822", "text": "def set_debug_flag\n if @http_log_debug\n @httparty_log_level = :debug\n @httparty_log_format = :curl\n end\n end", "title": "" }, { "docid": "11750e023b8718d29ba771ce9bc1b53d", "scor...
fa2de0da7c06726ffddb402cb4f7ef18
If an optional copylist is padded in via a stdin or a pipe.
[ { "docid": "7e55627931fa0f61bbc7b15089fa738c", "score": "0.6500371", "text": "def extended_copylist\n list = []\n if STDIN.fcntl(Fcntl::F_GETFL, 0) == 0\n val = STDIN.read\n if !val.empty?\n list = YAML.load(val)\n end\n end\n list\n end", "title"...
[ { "docid": "df20ef40c6aae4269eaf077b534076d8", "score": "0.58862454", "text": "def _cp(obj = Readline::HISTORY.entries[-2], *options)\n if obj.respond_to?(:join) && !options.include?(:a)\n if options.include?(:s)\n obj = obj.map { |element| \":#{element.to_s}\" }\n end\n out = obj.join(\"...
9fca8467a522b17191124f2a85196d8a
Slouzi pouze pro ladici ucely. Vypise dulezite informace o danem projektu, vcetne seznamu zamestnanych programatoru a seznamu cekajicich, zpracovavanych a zpracovanych projektu. U zpracovavanych a zpracovanych projektu vypise i podrobnosti o techto projektech.
[ { "docid": "c1f0b2f59aeb0fdde3ef57d47c92d255", "score": "0.0", "text": "def print_debug_info\n puts \"Company #{name}, day #{days}:\"\n puts \"\\tState: #{state}\"\n puts \"\\tCurrent cash flow: #{budget}\"\n puts \"\\tDaily expenses: #{daily_expenses}\"\n puts \"\\tCapacity: #{capacity}\...
[ { "docid": "163651d7b1ea4c4b252cdbf5595211f3", "score": "0.5963519", "text": "def set_projekt\n @projekt = Projekt.find(params[:id])\n end", "title": "" }, { "docid": "24bf588e3ff86eb3ad4e26fcc98a7714", "score": "0.5886157", "text": "def set_projeto\n @projeto = Projeto....
4f9a4fc4f1f75702c93300278d283773
Applies environment, external JSON attributes, and override run list to the node, Then expands the run_list. === Returns node:: The modified node object. node is modified in place.
[ { "docid": "7964b24a2ba77fcd6b63e89b424a26ac", "score": "0.62496513", "text": "def build_node\n # consume_external_attrs may add items to the run_list. Save the\n # expanded run_list, which we will pass to the server later to\n # determine which versions of cookbooks to use.\n\n ...
[ { "docid": "e27417390ea1d93e0a45123fef2abbca", "score": "0.7435997", "text": "def expand_run_list\n validate_run_list!(run_list)\n\n node.run_list(run_list)\n node.automatic_attrs[:policy_revision] = revision_id\n node.automatic_attrs[:roles] = []\n node.automatic_attr...
298eec818f51a4138f149bab83e7cd7d
nextLetter will return the next consonant or vowel with in a string and return
[ { "docid": "061546e2e8d8e56fa0b97d8485b1c3e0", "score": "0.75636506", "text": "def nextLetter(full_name)\n vowels = 'aeiou'\n split_letters = full_name.split('')\n split_letters.map! { |letter|\n if letter != \" \"\n if vowels.index(letter.downcase) != nil\n letter = nextVowel(letter)\...
[ { "docid": "ea546d3b6da1ad0f8d793450c7f284c8", "score": "0.7871858", "text": "def next_letter(letter)\n\tvowels = \"aeiou\".chars\n\tconsonants = \"bcdfghjklmnpqrstvwxyz\".chars \n\t\n\tcase\n\t\twhen vowels.include?(letter)\n\t\t\tif letter == vowels[-1]\n\t\t\t\tnew_letter = vowels[0]\n\t\t\telse\t\n\...
caf0a0799ea0e9f0228142fd3676af6c
Range over which data validation is applied, in "A1:B2" format Available for type whole, decimal, date, time, textLength, list, custom default nil
[ { "docid": "c697f66f104295cd686acc4362dbb100", "score": "0.0", "text": "def sqref; end", "title": "" } ]
[ { "docid": "5ea4f86aec0fdbdf04e9975519b49cb3", "score": "0.66949105", "text": "def validates_length_range(range, atts, opts=OPTS)\n validatable_attributes_for_type(:length_range, atts, opts){|a,v,m| validation_error_message(m, range) if v.nil? || !range.cover?(v.length)}\n end", "tit...
40b704fd69b8f6575032663cec8ff7e7
Function to enforce file group.
[ { "docid": "feda715d13c92c7d00a282254c5097c7", "score": "0.49347368", "text": "def group=(group)\n debug \"#{self.artifactid}: Changing group to '#{self.artifactGroup}'.\"\n begin\n File.chown(nil,Etc.getgrnam(self.group).gid,self.artifact)\n rescue => detail\n ...
[ { "docid": "36d8723d92b72c288821b0edf2d49f06", "score": "0.6427467", "text": "def updatedb_file_group?(file, group)\n owner = updatedb_file_group(file)\n group == owner\n end", "title": "" }, { "docid": "57b56fb90cfe3e6ffa0911c3962a2e09", "score": "0.6297955", "tex...
53c78167bbaf3ac0f62d901723ff839d
======================================================================================================= Shoes definition for RMSquad Main Application
[ { "docid": "69e6881da7f12b3ab32ef514e6029435", "score": "0.67998856", "text": "def launch(folder)\n # Main Application definition\n Shoes.app(title: \"RMSquad | #{File.basename(folder)}\", height: 768, width: 1024, resizable: true) do\n @lock = Lock.new\n stack(margin: 10) do\n ...
[ { "docid": "de410b367558c923f30a3e9d9e1b1bb1", "score": "0.6489949", "text": "def owner\n #returns Shoes::App\n throw NotImplementedError\n end", "title": "" }, { "docid": "8232b5a12bae01b5d8c53f6135d4ff80", "score": "0.63801926", "text": "def run\n \tapp = FXApp.new \...
78549bf00e434ef46d7b94d62d63c64e
POST /todos POST /todos.json
[ { "docid": "fb88e50fa07090a6524083077123a6bb", "score": "0.0", "text": "def create\n @todo = Todo.new(todo_params)\n\n respond_to do |format|\n if @todo.save\n event = @todo.target_events.build(content: 'created todo', target_field: 'content')\n event.user = current_user\n ...
[ { "docid": "38197400f519c568668059985d5c7af9", "score": "0.77191365", "text": "def create\n @todo = Todo.create(todo_params)\n render json: @todo\n end", "title": "" }, { "docid": "1a161d591cd3dce6ba415b6023a0962c", "score": "0.7682156", "text": "def create\n @tod...
bc357e0af057a8427699dd6f20338628
Makes all the (instance) methods in the helper module available to templates rendered through this controller. ==== Parameters module The module to include into the current helper module for the class
[ { "docid": "821b9744036a3d2a0ba8af3018f32cbf", "score": "0.62703526", "text": "def add_template_helper(mod)\n _helpers.module_eval { include mod }\n end", "title": "" } ]
[ { "docid": "f64dc34e507511e804bd57194c191fac", "score": "0.6860397", "text": "def helper( *modules )\n machine.helper *modules\n end", "title": "" }, { "docid": "5e80d9b7d25c04b151cb37ecfb522103", "score": "0.68534636", "text": "def helpers\n ActionController::Base.helpers...
76871fa8a1792d463f42d4d4a9226182
before_save :normalize_card_number, if: "paid_with_card?"
[ { "docid": "d203aef12b4790b37a320ecba58cb27a", "score": "0.0", "text": "def create_dates\n \n initial_dates\n field_dates\n greenhouse_dates\n self.save!\n end", "title": "" } ]
[ { "docid": "416b8d514892a722e0c159103ddd185e", "score": "0.6653711", "text": "def after_save\n update_attribute(:cs_number, ref_number) if cs_number != ref_number\n end", "title": "" }, { "docid": "12c36b8ce0ef8079f8a37711261fe00c", "score": "0.6489589", "text": "def before_save(...
58b395ecb7366044e2d37aba11737e07
Reloads Rails. This isn't too reliable really, but it should work for most minimal reload purposes. The only reliable way to reload properly is to stop and then start the process.
[ { "docid": "307dc1fe41fb42c036dcf69efbdc6258", "score": "0.73481345", "text": "def reload!\n if not @rails_handler\n raise \"Rails was not configured. Read the docs for RailsConfigurator.\"\n end\n\n log \"Reloading Rails...\"\n @rails_handler.reload!\n log \...
[ { "docid": "cfbe3afb2fdc4db6b703ac92a7b32c0b", "score": "0.750757", "text": "def reload\n MUTEX.synchronize do\n if @reloaders[0].respond_to?(:execute)\n reload_with_rails\n else\n reload_without_rails\n end\n end\n end", "title": "" }, { "...
3cbedd86fe55c24c636feb0cdc983e4c
Reset this timer. Do not call while paused.
[ { "docid": "d24d95c87094d5bc12ad569a2b8a7195", "score": "0.6638273", "text": "def reset(offset = @group.current_offset)\n\t\t\t# This logic allows us to minimise the interaction with @group.timers.\n\t\t\t# A timer with a handle is always registered with the group.\n\t\t\tif @handle\n\t\t\t\t@handle.can...
[ { "docid": "2755bda76c35e4eb69b67d837955f199", "score": "0.8214395", "text": "def reset_timer\n @started = Time.now\n end", "title": "" }, { "docid": "969e7a9db3f37973bc7a96b9eceda6b3", "score": "0.7631664", "text": "def reset_timer; end", "title": "" }, { "do...
91584547feebeffc82645f39101cd502
A footer for sub menus to go back to the main menu
[ { "docid": "39a43153caa3f8128699fab931cc5331", "score": "0.7774058", "text": "def footer_two\n puts \"To go back to the main menu, enter 'back'.\"\n end", "title": "" } ]
[ { "docid": "821213e5c1a9a650c3be3c98526d8992", "score": "0.692496", "text": "def footer\n end", "title": "" }, { "docid": "047655b53f43a35abd4770d7159f1fce", "score": "0.69044137", "text": "def Footer\n end", "title": "" }, { "docid": "3fdffbde108f7ca6389d7f13fac45c52...
826cdcc24fb2b60e870bbaf31897ee9c
Each company has it's own subdomain so the url must be dynamic. This is achieved by replacing the with the subdomain in the instance if a sub_domain was given. Else the SalesKing domain MUST include the subdomain
[ { "docid": "9b5b133ea9ab25292d663d62669899f4", "score": "0.6530395", "text": "def sk_url\n return @sk_url unless sub_domain\n @sk_url.gsub('*', sub_domain).gsub(/\\/\\z/, '' )\n end", "title": "" } ]
[ { "docid": "36a10d0cef1ccd292be8b6b47442783c", "score": "0.72720456", "text": "def subdomain\n ENV['DESK_SUBDOMAIN']\n end", "title": "" }, { "docid": "b6b33e40033b38b26e7ba5e24cdc373c", "score": "0.7246457", "text": "def subdomain\n self.name.gsub('_', '.')\n end", ...
3f3e4f9921d0be7a5461333c6820dd4b
DELETE /group_me_bots/1 DELETE /group_me_bots/1.json
[ { "docid": "0e5ae97286f9eda4cffc85ce72ba8efb", "score": "0.7805727", "text": "def destroy\n @group_me_bot.destroy\n respond_to do |format|\n format.html { redirect_to group_me_bots_url, notice: 'Group me bot was successfully destroyed.' }\n format.json { head :no_content }\n end\n en...
[ { "docid": "d5382fbfe363b89f2f2045d4cee1dc4d", "score": "0.71397454", "text": "def destroy\n @bot = Bot.find(params[:id])\n @bot.destroy\n\n respond_to do |format|\n format.html { redirect_to bots_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { ...
5fb33b4a17949e9bcf7f7650cde01498
return all school subjects for a classroom
[ { "docid": "3ec28e5cf1bfe0853f0df71812849153", "score": "0.6479509", "text": "def school_subjects\n @classroom = Classroom.find(params[:classroom_id]) unless params[:classroom_id].blank?\n render :update do |page|\n page.replace_html 'school_subject_select', collection_select(:event, :school_...
[ { "docid": "76b9a782f1e2868c9584f1cc7522bc96", "score": "0.8436034", "text": "def get_subjects_for_class( school_class )\n out = []; curriculums = []\n curriculums = school_class.curriculums\n\n unless curriculums.empty?\n qualifications = curriculums.collect{ |c| c.qualification }...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "fc10765c0a46f8f3b411f3cee967bf89", "score": "0.0", "text": "def set_shared_note\n @shared_note = SharedNote.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...
c71e4b9e94ba40fb9db255eb6a24bcb6
Check if directions are equal by seeing if their magnitudes are equal.
[ { "docid": "864f703ab59c48702564a7dfa184c216", "score": "0.0", "text": "def ==(other)\n self.x == other.x && self.y == other.y\n end", "title": "" } ]
[ { "docid": "f501c2f4241bee6cdb910c4ee2f64690", "score": "0.6542387", "text": "def eql?(other)\n super && directions.eql?(other.directions)\n end", "title": "" }, { "docid": "c4103ff77298683db657f9841a43a3e7", "score": "0.65221685", "text": "def test_samedirection_edge...
522dff3246e3fe66ce748890245d8433
build a response to be sent to client
[ { "docid": "f4b20c13a5a1394b5482953dc4544a0a", "score": "0.7412264", "text": "def build_response\n valid? ? [status, headers, [response_body]] : @original_response\n end", "title": "" } ]
[ { "docid": "3c64bfd3e129fd949a789e0d31060483", "score": "0.76393175", "text": "def build_response(connection, request); end", "title": "" }, { "docid": "b34da03f56b99fc986c7b92f97f82b17", "score": "0.7516792", "text": "def build_response\n Hotwire::Response.from_request(self)\n ...
770aed570072e82eb7392713a6d15bf0
Edit action reuires UPDATE ACTION
[ { "docid": "a12bbaf0b089d9b6790a3cdfaec57bc8", "score": "0.0", "text": "def update\n #before action\n #Also in update we need to include the whitelisted fields\n if @recipe.update(recipe_params)\n flash[:success] = \"Your recipe was updated successfully\"\n #We want to redirect the us...
[ { "docid": "93cc896280c3ee12deabf38785bef111", "score": "0.82359976", "text": "def edit\r\n end", "title": "" }, { "docid": "2486fb5620707bc2856b50e6ea360b1e", "score": "0.8235804", "text": "def edit\n\n end", "title": "" }, { "docid": "df9f5e7a8ee9177de214354201d...
29c66220c8db5bcde0a016be6dcd80ff
GET /articles/1 GET /articles/1.xml
[ { "docid": "6a3bf7c1a07f305f747a39cb65f16d3e", "score": "0.0", "text": "def show\n @article = Article.find_by_permalink(params[:permalink])\n if @article\n @article.increment!(:visited_count, 1)\n @categories = Category.find(:all)\n @lastest = Article.find(:all,:limit=>10,:order=>\"...
[ { "docid": "9b2ae244078a489c28d52b4984ce970f", "score": "0.7446893", "text": "def index\n @articles = Article.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @articles }\n end\n end", "title": "" }, { "docid": "9b2ae2440...
6abb88225fa62b2a6c0c1becc0130780
Load the configuration data Returns an NSDictionary representation of the the preferences file if it exists If it doesn't, return nil
[ { "docid": "cb8398ee47bd512ad9a006637750e6c3", "score": "0.7364515", "text": "def load_config\n @preferences = \"/Library/Preferences/com.apple.RemoteManagement.plist\"\n config = NSMutableDictionary.dictionaryWithContentsOfFile(@preferences)\n end", "title": "" } ]
[ { "docid": "c0d92be854338930c866854c895825df", "score": "0.69718564", "text": "def read_config\n @config = {}\n begin\n @config = Psych.load_file('config/prefs.yml')\n puts 'preferences loaded'\n rescue => e\n puts e\n puts e.backtrace\n puts 'An error occured while loading the prefere...
d8c65a4f4a324dd4f0514336f3d4ec42
For AJAX request to get previous version
[ { "docid": "ff3fa2f3938d3892680043aeea88a246", "score": "0.68988574", "text": "def get_previous_version\n content_version = ContentVersion.find(params[:id])\n render :text => content_version.title+\"||\"+content_version.body+\"||\"+params[:id]\n end", "title": "" } ]
[ { "docid": "6e8dfbb372c9a2f524a4aedbc80a3251", "score": "0.6724138", "text": "def previous_version\n self[:previous_version]\n end", "title": "" }, { "docid": "624dfbb0421e8f6b1ca72a96ca11326e", "score": "0.66291887", "text": "def get_version\n request('getVersion')\n ...
39b4ee2c02d35d6e2b21239b9f08ee45
GET /projekts GET /projekts.json
[ { "docid": "5e7cc7db0afc28d7c7dac58c3a795bae", "score": "0.0", "text": "def index\n\n if current_user.roleid ==1\n @projekts = Projekt.all\n if params[:id].nil? \n @projekt = Projekt.first\n else\n @projekt = Projekt.find(:all, :conditions => [ \"id = ?\", params[:id]]).f...
[ { "docid": "7f48fc79095de417bb92bd3fc37081ce", "score": "0.6872417", "text": "def index\n @projetos = Projeto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projetos }\n end\n end", "title": "" }, { "docid": "a0f4d41a4643e66f4d...
d6354e45be5978ee39129170bca72831
:callseq: running?() => boolean Returns true if it finds a running Jetty server that supports the Buildr requests for deploying, stopping, etc.
[ { "docid": "bc2e498ff7083148b7923e73b5347aae", "score": "0.68890274", "text": "def running?()\n uri = URI.parse(url)\n begin\n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request_get(\"/buildr/\")\n response.is_a?(Net::HTTPSuccess) && response.body ...
[ { "docid": "93adb2d386de93eca0dace4f6180fef8", "score": "0.7909483", "text": "def is_jetty_running?(params)\n Jettywrapper.configure(params)\n pid = Jettywrapper.instance.pid\n return false unless pid\n true\n end", "title": "" }, { "docid": "df7426635a530153b1b5c19994...
c18353c78c232ed0e9fc2b1a540e208e
Metodo que calcula el porcentaje de hidratos correspondiente a un plato
[ { "docid": "05553ea7cbe1ddc1fc8ced77c796ba2d", "score": "0.6193002", "text": "def porc_hidratos\n auxNodo = @alimentos.head\n auxNodo1 = @gramos.head\n porc_hidratos = 0\n while(auxNodo != nil && auxNodo1 != nil)\n porc_hidratos += (auxNodo.value.hidratos * auxNodo1.value) / 100\n ...
[ { "docid": "42aed0b394daa85d475ab0becedb2245", "score": "0.70736516", "text": "def porcentaje_hidratos_de_carbono\n\t\tresultado = ((hidratos_de_carbono / 260.0) * 100.0).round(2)\n\tend", "title": "" }, { "docid": "0ed62a65260a6c047f1b958d305cb755", "score": "0.68847287", "text": "d...
a6c622d72d96f88ec91927687ab56336
GET /excluded_colonies/1 GET /excluded_colonies/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b808f45f69409f1fa734dacd791e9ca1", "score": "0.7750466", "text": "def index\n @excluded_colonies = ExcludedColony.all\n end", "title": "" }, { "docid": "32092c1ef881fdc2f46a272d84e80a28", "score": "0.6733386", "text": "def destroy\n @excluded_colony.destroy\n re...
f0a983747f0da8c020ae6f99793e5d5d
Attribute Accessor Method [Writer]
[ { "docid": "86f776ec1a197878f96894e24f7e2219", "score": "0.0", "text": "def breed=(whichBreed)\n @breed = whichBreed\n end", "title": "" } ]
[ { "docid": "818a28ea23a393353f522258d13ba1d1", "score": "0.74782753", "text": "def writer(*args)\n attr_writer(*args)\n args\n end", "title": "" }, { "docid": "5a0bcdaca95c21b13aacca36f9fad742", "score": "0.7385542", "text": "def _write_attribute(attr_name, value); end", "...
ff9e4d6deafb5c3f62c2f48dc1bdc19e
returns true if the two cuboids intersect each other. False otherwise.
[ { "docid": "650f4ad6652dd5dbae71bc1e320d492e", "score": "0.811974", "text": "def intersects?(other)\n self_min_point = self.vertices.first\n self_max_point = self.vertices.last\n\n # detect if cuboid and other cuboid share a common point (integer values only)\n (self_min_point[:x]..self_max_...
[ { "docid": "8a418ab32455843f7f636491de897cf3", "score": "0.8342102", "text": "def intersects?(other)\n # Any of the following conditions means the cuboids DO NOT intersect, so we\n # negate the entire thing. This will return TRUE where the two cuboids intersect\n # each other and FALSE otherwis...
382b91745fd75856f527549f0ebd967c
Write a method that recursively finds the first `n` factorial numbers and returns them. N! is the product of the numbers 1 to N. Be aware that the first factorial number is 0!, which is defined to equal 1. The 2nd factorial is 1!, the 3rd factorial is 2!, etc. The "calls itself recursively" spec may say that there is n...
[ { "docid": "f8591e97fba5cd73d1c31ae2aa72d31e", "score": "0.0", "text": "def factorials_rec(num)\n return [] if num == 0\n return [1] if num == 1\n prev = factorials_rec(num - 1)\n prev + [prev.last * (num - 1)]\nend", "title": "" } ]
[ { "docid": "f127e2632a77b5dd784590028f5a0fd0", "score": "0.7746756", "text": "def factorial_recursive(n)\n\tif n == 0\n\t\treturn 1 # 0! = 1\n\telse\n\t\treturn n*factorial_recursive(n-1) #keep calling the function\n\tend\nend", "title": "" }, { "docid": "1268b4f47bf5f986fb0c34d00c895a3e", ...
ae2c286729528024c8e7e27ea314271f
GET /slides GET /slides.json
[ { "docid": "9380a26cd1631c2a0b7b3631b0d7a2bd", "score": "0.65665066", "text": "def index\n @slides = @presentation.slides.order(sort_order: :asc)\n redirect_to new_presentation_slide_path(@presentation) unless @slides.any?\n end", "title": "" } ]
[ { "docid": "f6d8dbf626d154b99e237d3b410a790e", "score": "0.79548234", "text": "def show\n @slide_show = SlideShow.find(params[:id])\n @slides = @slide_show.slides\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slide_show.to_json(include: :slides...
5ee288ed436e9b9eab1c281e1fb9612e
Method to register all the event decoders to the event handler chain.
[ { "docid": "47f3cfad3b31f7765ea6b992372268d2", "score": "0.80543536", "text": "def register_event_decoders(&block)\n\n\t# Set the event decoders proc\n\tevent_decoders_proc = block\t\t\t\t\t\t\t\t\t\t\t\t\t\t# This may be broken\nend", "title": "" } ]
[ { "docid": "9c06fa36086c40a165c7edfeefc104e2", "score": "0.6301212", "text": "def register_handlers\n register_handler :ready do |stanza|\n EventMachine::Synchrony.next_tick do\n on_ready(stanza)\n end\n end\n\n register_handler :message, :groupchat? do ...