query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
291a444d37894d9f6ef936b570d41f28
Returns the job's action name
[ { "docid": "18de5c0b7d9d34598fa48506623ddd28", "score": "0.70135516", "text": "def action_name\n task&.action_model&.name\n end", "title": "" } ]
[ { "docid": "ed47338d6bc7b7bdd8311b5489633c80", "score": "0.792108", "text": "def action_name\n ACTIONS[action.to_s]\n end", "title": "" }, { "docid": "b913b47765026881e279980a586ffa75", "score": "0.78676146", "text": "def action_name\n return @action_name\n ...
f0ea49b1dfa183466738eb348326c5ae
Sets the kioskModeApps property value. A list of apps that will be allowed to run when the device is in Kiosk Mode. This collection can contain a maximum of 500 elements.
[ { "docid": "331a1d7890c0bf8b5a2e9bde98fbb1c8", "score": "0.8497059", "text": "def kiosk_mode_apps=(value)\n @kiosk_mode_apps = value\n end", "title": "" } ]
[ { "docid": "41077349742e40b55ddb420f3932686c", "score": "0.7109572", "text": "def apps=(value)\n @apps = value\n end", "title": "" }, { "docid": "a56c1b670469a27b0e1c7550e5f61f42", "score": "0.698422", "text": "def kiosk_mode_apps\n return @ki...
99da3709f7008c4a6e77ce54e580a2cd
Return all events for stack
[ { "docid": "411661cdcdda484a523d94ff88b110e4", "score": "0.7809804", "text": "def event_all(stack, marker = nil)\n params = marker ? {:marker => marker} : {}\n result = request(\n :path => \"/stacks/#{stack.name}/#{stack.id}/events\",\n :method => :get,\n ...
[ { "docid": "57eb6671c2d775d9516f35ebd5a8854e", "score": "0.79948014", "text": "def event_all(stack)\n raise NotImplementedError\n end", "title": "" }, { "docid": "3e7af7949cfd0b9a339e8122d1ee77ad", "score": "0.7795928", "text": "def event_all(stack, evt_id = nil)\n ...
222f2f8465ca79f5a4d177b0fe5cd16a
list all comment on given blog via jquery ajax when show the detail of blog
[ { "docid": "d47d2cc07e3fd573f8378103d6531a2d", "score": "0.80469644", "text": "def comment_list\n #render :json => Comment.comment_list_ajax(params[:blog_id])\n @comments=Comment.comment_list(params[:blog_id])\n end", "title": "" } ]
[ { "docid": "454170f31918b558a3b11d78a336e967", "score": "0.75255865", "text": "def index\n blog = Blog.find(params[:blog_id])\n @comments = blog.comments\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @comments }\n end\n end", "title": ""...
469abee999c53f0318f55a5bf205d0f1
store a given URL (defaults to current) in case we need to redirect back later
[ { "docid": "3263dfd935575f8a30e41296c476a974", "score": "0.7304974", "text": "def store_location(url = url_for(controller: controller_name, action: action_name))\n # It's possible to create a redirection attack with a redirect to data: protocol... and possibly others, so:\n # Whitelisting redirect...
[ { "docid": "4a83b8f0abaac276751195d779a43984", "score": "0.7945061", "text": "def store_location\n unless request.fullpath =~ /\\/#{URL_IGNORE_LIST.join('|')}/\n session[:previous_url] = request.fullpath\n end\n end", "title": "" }, { "docid": "3c6aee9a83179200fc416d099afa42ef", ...
2ac6a6998ae9beeb278de74dc715cfc3
, :except => ['user']
[ { "docid": "28a55b81a1bfd73ea09ba612660aacf3", "score": "0.0", "text": "def user\n @user.postFacebook \"hello\"\n response = {\n :message => params[:id],\n :name => user.screen_name\n }\n respond_to do |format|\n format.json { render :json => create_json(response), :status ...
[ { "docid": "8beb83e4c88a0b92aa4297fe31f57eac", "score": "0.6997023", "text": "def exclude; end", "title": "" }, { "docid": "6953375fb44b6dcfce3184de8921bd81", "score": "0.68319565", "text": "def excluded; end", "title": "" }, { "docid": "1f416d4da5defe1e3f28fe19020b2920",...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "771e38e331dcecd8ff2a1ad688571e13", "score": "0.0", "text": "def set_eventplanner\n @eventplanner = Eventplanner.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...
efa14355fe3635abedd7e69c1047a2dc
GET /product_results/1 GET /product_results/1.xml
[ { "docid": "9117be90eec2b65c9454c9e34ef5d017", "score": "0.0", "text": "def summary\r\n \r\n @ph_product = PhProduct.find(params[:ph_result_id])\r\n @product = @ph_product.product\r\n @step = 1 \r\n if @ph_product.ph_intermediate_result \r\n if !@ph_product.ph_result\r\n ph_resu...
[ { "docid": "d2f6c8d124f2774426777e4b9a269968", "score": "0.7558931", "text": "def index\r\n @product_results = ProductResult.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @product_results }\r\n end\r\n end", "title": "" }, ...
c734926bc3780f2c952dfe068e6f0f11
GET /help_contents/1 GET /help_contents/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "7e19d7ce26d75590b6e86dfd0ee4c406", "score": "0.75443923", "text": "def index\n @help_contents = HelpContent.all\n end", "title": "" }, { "docid": "23b5e52b44e6fbc83b0b742d5ee390a5", "score": "0.6937297", "text": "def show\n @need_help = NeedHelp.find(params[:id])\n...
86ff4b1059413915cf2cf77fe0e83e6d
Removes a URI resource.
[ { "docid": "fdab486546b5c1c5cec79870e6fb657b", "score": "0.6794459", "text": "def remove_resource(name)\n\t\tservice.remove_resource(name)\n\tend", "title": "" } ]
[ { "docid": "6741e7ffe787831a107c3b080c56e96b", "score": "0.739033", "text": "def remove\n @resource = nil\n end", "title": "" }, { "docid": "cb3f7da64d3ba6920a798a76cd532f58", "score": "0.7345825", "text": "def delete_resource(uri)\n clear\n uri = URI.parse(uri)\n ...
6004b4e6108bac543aeac802972d3ccd
Updates an application at target cloud.
[ { "docid": "32c908a5674be0e8828d27be2d7b4267", "score": "0.6756075", "text": "def update_app(name, manifest = {})\n require_login\n raise CloudFoundry::Client::Exception::BadParams, \"Name cannot be blank\" if name.nil? || name.empty?\n raise CloudFoundry::Client::Exception::BadPara...
[ { "docid": "0a6718ebc63f397ce7f47b23b2102030", "score": "0.7161644", "text": "def update_application(application_id, application)\n # start updating the buildpacks\n if application.key? :runtimes\n # can fail if runtime URLs are invalid or names do not exist on this pl...
450f72d094d23542573b9f0f26a38084
Returns true if this is a leaf node
[ { "docid": "80779b80d8e54fc30ed0f88f32a9d1ff", "score": "0.7855089", "text": "def leaf?\n #!new_record? && right - left == 1\n right - left == 1\n end", "title": "" } ]
[ { "docid": "759038f2a2b6266214c12ee310069787", "score": "0.87808466", "text": "def leaf?\n rgt-lft == 1\n end", "title": "" }, { "docid": "5225b486b43508c8c4e9e86d3c6ab9ed", "score": "0.87488437", "text": "def leaf?\n return false\n end", "title"...
c13b003c439894805250572febadd155
Article model doesn't lend itself to saving tweets individually > transfer all the Article attributes to the Clipping object?
[ { "docid": "3b2f07c8d21da9494bc28f1cb384cc2b", "score": "0.6048449", "text": "def make(clipping_params, current_user)\n @clipping = Clipping.new\n @article = Article.where(id=clipping_params[\"format\"])\n @clipping.title = @article[0].title\n @clipping.tweet = @article[0].tweet_1\n @clip...
[ { "docid": "0d86e1266a8ac49930f6e28ec115aa9e", "score": "0.575525", "text": "def save\n @@stories << self \n end", "title": "" }, { "docid": "72dee0fc15f2ccea65e5483088eeaa75", "score": "0.5694757", "text": "def prepare_for_updating\n @thread = @entity.a_thread\n @thread.a...
5721ee4ce637b43e34a34ddb3ca4e867
Set the Typhoeus configuration options by passing a block.
[ { "docid": "6b6bdc443ed3c72a8871c786ead6c2ce", "score": "0.0", "text": "def configure\n yield Config\n end", "title": "" } ]
[ { "docid": "12eb3c1de3837dece778b97ab4fe0547", "score": "0.7538547", "text": "def configure(&block)\n Config.set(&block)\n end", "title": "" }, { "docid": "8a08c14e693cb7cf6c994cc5f9bc7cf3", "score": "0.7440281", "text": "def configure(options = T.unsafe(nil), &block); end", ...
2a40588beefcc1f516c9de0dfb50ce9b
Returns the current position
[ { "docid": "608d1feb4a3a0d43c82905664654756f", "score": "0.0", "text": "def read\n State.pos.dup\n end", "title": "" } ]
[ { "docid": "ca854e12177aaac0c0442457ad47e18b", "score": "0.880523", "text": "def current_position; end", "title": "" }, { "docid": "fc5002343132b19bdb191066e5707112", "score": "0.8630872", "text": "def current_position\n @current_position ||= calculate_position\n end", "title...
61d98648cbc5a6579b9b55837e9edc30
GET /demobs/1 or /demobs/1.json
[ { "docid": "5e830aa445086024db731b4287c19fba", "score": "0.0", "text": "def show\n @resource = Resource.find(params[:resource_id])\n @incident = Incident.find(@resource.incident_id)\n @demob = Demob.find(params[:id])\n @logistics_units = @demob.units[0..5]\n @finance_units = @demob.units[...
[ { "docid": "0decf20125654969be5f3b444e17d6b1", "score": "0.65140826", "text": "def demo(id)\n get_record \"/demos/#{id}\"\n end", "title": "" }, { "docid": "414725e8cbd45c931db70dfcfb5acdcb", "score": "0.6398173", "text": "def demos\n get_records \"demo\", \"/demos\"\n end", ...
8fe133c6ee49d64471a0154a6217c951
Get the cache configuration for the class.
[ { "docid": "5af4b4aa9e734193ec397b665327ed8a", "score": "0.0", "text": "def last_mod_cache_config\n if defined?(@last_mod_cache_config) && @last_mod_cache_config\n @last_mod_cache_config\n else\n superclass.last_mod_cache_config if superclass.respond_to?(:last_mod_cache_config)\n...
[ { "docid": "6a22b93c50208ca2907b62b5b99d987e", "score": "0.7466266", "text": "def cache_options\n self.class.cache_options\n end", "title": "" }, { "docid": "4c4f8cc09ade2c8a5cc6a9e508853809", "score": "0.7451262", "text": "def cache_config\n @cache_config ||= Exch...
2b8c1909b085fadbdb1bb029d4340fe6
Make a brand new PNG image with MiniMagick There's no API for making an image from scratch using MiniMagic. This calls `convert` directly to make a new white PNG of the given dimensions, then loads it with MiniMagick.
[ { "docid": "2f334b0356522412bf6ebc4a830878c3", "score": "0.6164618", "text": "def create_new_image(width:, height:)\n tempfile = Tempfile.new(['wordcloud', '.png'])\n MiniMagick::Tool::Convert.new do |new_image|\n new_image.size \"#{width}x#{height}\"\n new_image ...
[ { "docid": "c8268b39074dc9430c5b71233e69d6fa", "score": "0.6359505", "text": "def image_magick_do(new_size, file_name)\n image = MiniMagick::Image.open(@record.name)\n\n a = new_size.split(/x|\\+/).map(&:to_i)\n a += [0, 0] if a.size < 4\n image_offset(image, a[2, 2]) if a[2, 2] != [0, 0]\n\n img_w...
250544409bbd4b5e0baec04c098b74b4
Use api_user Devise scope for JSON access
[ { "docid": "4a608da877325d91cf5cd9f17025629e", "score": "0.0", "text": "def authenticate_user!(*args)\n super and return unless args.blank?\n json_request? ? authenticate_api_user! : super\n end", "title": "" } ]
[ { "docid": "8234dc1e37c5367642a60846bf8aa93f", "score": "0.727749", "text": "def user_api\n end", "title": "" }, { "docid": "72202159e47688038b2e3aafeddb043e", "score": "0.68762636", "text": "def jsonapi_expose\n {\n current_user: current_user || User.new,\n current_abi...
dc1d012a05776d2b37f3f934d53748a4
Renders one source line in clang diagnostic style, with highlights.
[ { "docid": "90117f1533bc8ad0bff4239e34322ba0", "score": "0.5398547", "text": "def render_line(range, ellipsis=false, range_end=false)\n source_line = range.source_line\n highlight_line = ' ' * source_line.length\n\n @highlights.each do |highlight|\n line_range = range.source_buff...
[ { "docid": "36e036afa776f75ddd344d666db4ecd7", "score": "0.66862655", "text": "def render\n source_line = @location.source_line\n highlight_line = ' ' * source_line.length\n\n @highlights.each do |hilight|\n range = hilight.column_range\n highlight_line[range] = '~' * hil...
caa9a7d45eee3f6a47029ff4b14dcf7a
def edit if params[:password] != "" || params[:password_confirm] != "" if params[:password] == params[:password_confirm] current_user.password = params[:password] current_user.update_attribute(:crypted_password, current_user.encrypt(params[:password])) else flash[:notice] = "Passwords don't match. Please try again." re...
[ { "docid": "b5977c9ba4943a3673bef678088fc649", "score": "0.0", "text": "def create\n\t\t@user = User.new(params[:user])\n\t\tnew_pass = generate_password()\n\t\t@user.password = new_pass\n\t\t@user.password_confirmation = new_pass\n\n\t\tif @user.save\n\t\t\tflash[:notice] = 'User was successfully creat...
[ { "docid": "051e27bbfac6390c699178c005f7ff79", "score": "0.76688457", "text": "def update\n @user = current_user\n user = current_user\n if (params[:user][:current_password].present? && params[:user][:password].present?)\n user = false if(! User.authenticate(current_user.login, params[:us...
89bf5e074df32a1ccabe8231def4d1bc
copies the current params (or whatever is passed in as the 3rd arg) removes the field value from params[:f] removes the field if there are no more values in params[:f][field] removes additional params (page, id, etc..)
[ { "docid": "9e2e585d2a16be46102908ccd13f24f5", "score": "0.7224255", "text": "def remove_facet_params(field, value, source_params=params)\n p = source_params.dup\n # need to dup the facet values too,\n # if the values aren't dup'd, then the values\n # from the session will get remove in the ...
[ { "docid": "bfe424cca4b58177ace5d0cf74872ab8", "score": "0.76540023", "text": "def remove_facet_params(field, value)\n p=params.dup\n p.delete :page\n p[:f][field] = p[:f][field] - [value]\n p[:f].delete(field) if p[:f][field].size == 0\n p\n end", "title": "" }, { "docid": "...
049d03b41feeafb06964e6e171944375
This creates a copy of `self`, with `new_options` applied.
[ { "docid": "198870d329785067ff6d2b583db95a9b", "score": "0.6621336", "text": "def merge(new_options); end", "title": "" } ]
[ { "docid": "2fd1432ccb7a9b804e5510e2422f7fb4", "score": "0.790475", "text": "def clone_options\n dup\n end", "title": "" }, { "docid": "df74f331f20f6863a9812877081f0977", "score": "0.7775749", "text": "def dup_for(new_options = {})\n self.class.new(options.merge(new_opti...
b828c4b3c1fa078260c587e87ce5dfca
On Game Pause Start Processing
[ { "docid": "fb81df9d09b3388acef74a1cb107f301", "score": "0.7928416", "text": "def on_game_pause_start\n # Set Game Paused Flag & Pause Frame Count\n @game_paused = true ; @pause_frame_count = Graphics.frame_count\n end", "title": "" } ]
[ { "docid": "b24c1eeb79a6806e6f52a713ac064474", "score": "0.76229286", "text": "def pause_processing\n @processing = false\n end", "title": "" }, { "docid": "0b3425fac6af0eba831a56ef0ae8e6da", "score": "0.7529337", "text": "def on_game_pause_end\n # Set Game Paused Flag & G...
4876447c28ca63930c58eaf0d3b1edd7
The number of errors at this level. This does not include nested errors.
[ { "docid": "2fb33bd2c4dc00a8c1ed9e5ec7c1858c", "score": "0.7123287", "text": "def size\n @errors.size\n end", "title": "" } ]
[ { "docid": "5af13285e5dc7f25a31b93d9a037c1cf", "score": "0.83797973", "text": "def error_count\n @errors.size\n end", "title": "" }, { "docid": "343a7e3c5956ae06186e2de9710cfd20", "score": "0.83282864", "text": "def error_count\n @error_count ||= @node['errors']....
67d04fce3e4ad92f7d7d515ef6b5d959
Return a list of the character's activated abilities
[ { "docid": "cb2ecfb48df14af86980b45e4b30933f", "score": "0.80842847", "text": "def activated_abilities\n activated = abilities.select{|ability| ability.activated?}\n \n # Add the item abilities\n return activated + item_actions\n end", "title": "" } ]
[ { "docid": "1a5a4c183a465b0ab8bd4985ffe783ac", "score": "0.7477018", "text": "def abilities\n (read_attribute(:abilities) || '').split(' ')\n end", "title": "" }, { "docid": "a56332554e5877ec61cad643c57c7009", "score": "0.7173833", "text": "def abilities\n\t\t\t@abilities ||= {}\...
f83c19babd2ec6fac0b01ee8ac92310a
Checks if a file already exists in the site source
[ { "docid": "cf04f9bd54571c854c44b35994eb5136", "score": "0.76395506", "text": "def file_exists?(file_path)\n if @site.respond_to?(:in_source_dir)\n File.exist? @site.in_source_dir(file_path)\n else\n File.exist? Jekyll.sanitized_path(@site.source, file_path)\n end\n end",...
[ { "docid": "a80203a092dbe077afdabb5de05e3956", "score": "0.80257016", "text": "def file_exists?(file_path)\n File.exist? @site.in_source_dir(file_path)\n end", "title": "" }, { "docid": "a80203a092dbe077afdabb5de05e3956", "score": "0.80257016", "text": "def file_exists?(file_...
231c3b661c052d4728deb0cb283c4793
Add our relation aliases to key aliases
[ { "docid": "4729bd4a7c70de1cadcdfc49dca20500", "score": "0.7664078", "text": "def aliases\n super.merge(relation_aliases)\n end", "title": "" } ]
[ { "docid": "b16ed7aee8ab0321d0830c3b1df2daba", "score": "0.77408415", "text": "def relation_aliases\n {}.tap do |h|\n relations.each do |type, relationships|\n relationships.each do |name, relationship|\n h[relationship[:alias]] = name\n end\n ...
2a30977795f9448e3a0a5c0308f67def
== Order Items === Get order items support data. Get support data used in order items. ==== Example
[ { "docid": "87dfaad1af2567910ebb6cf67954a336", "score": "0.80835205", "text": "def get_order_items_support_data\n @client.raw('get', '/ecommerce/order-items/support-data')\n end", "title": "" } ]
[ { "docid": "125b77981d556d1f54249d27a08c1cf2", "score": "0.6754854", "text": "def items\n @items ||= data[\"items\"].map { |item| OrderItem.new(item) }\n end", "title": "" }, { "docid": "ce6512f3539399f1e44f5dea88666ad0", "score": "0.65448904", "text": "def get_orders_support...
9be55c2a9f3a042c366e4d27d80d5b2f
GET /variations/1 GET /variations/1.json
[ { "docid": "bb4540fe91a2c2558ee49b7366b60ee2", "score": "0.0", "text": "def show\n \n end", "title": "" } ]
[ { "docid": "d45e1192282ef32d4c71289698451997", "score": "0.78712046", "text": "def get_product_variations\n @client.raw('get', '/ecommerce/product-variations')\n end", "title": "" }, { "docid": "ce052de17e3c8e38c36c19da6602bcf7", "score": "0.7820623", "text": "def get_variations(...
438c1ecacf8c72c64929e83111b299d9
Create a batch of new entities.
[ { "docid": "b9297f99202d7695d9e99dcf3f36fc2d", "score": "0.0", "text": "def api_focus_batch_new_post(opts = {})\n api_focus_batch_new_post_with_http_info(opts)\n nil\n end", "title": "" } ]
[ { "docid": "a66ae82017d72ccb8a5e6841b8ba45da", "score": "0.7295337", "text": "def create_entities\n entity_types.each do |entity_type|\n create_entities_of(entity_type)\n end\n end", "title": "" }, { "docid": "6572e87be1fb238c680acb17a47889fc", "score": "0.7274865", ...
f701031a7046225b21eaaff5b60e340d
PATCH/PUT /user_charities/1 PATCH/PUT /user_charities/1.json
[ { "docid": "20b9c556ae493d60cb71c968e947f6f1", "score": "0.6629332", "text": "def update\n respond_to do |format|\n if @user_charity.update(user_charity_params)\n format.html { redirect_to @user_charity, notice: 'User charity was successfully updated.' }\n format.json { render :sho...
[ { "docid": "23a904e6ddd4b6b07c4b53353e78cf93", "score": "0.6109527", "text": "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end", "title": "" }, { "docid": "4781fa7337315133553edb54194e6202", "score": "0.606277", "text": "def update\n render json: U...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "496edcdb9457f9eab88c939138e33954", "score": "0.0", "text": "def post_params\n params.require(:post).permit(:id, :title, :body, :published, category_ids: [])\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496729", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958585", "text": "def strong_params\n params.require(:request).permit(param_white...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9940e23e990f3b27cd1e66286cf612ce", "score": "0.0", "text": "def reserve_params\n params.require(:reserve).permit(:id, :description, :shift, :start_time, :end_time, :employee_id, :laboratory_id, :validation_id, quantities_attributes: [:id, :product_id, :amount, :_destroy, products_attrib...
[ { "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...
c050839e26c108c991d74b16c98382dc
DELETE /projects/1 DELETE /projects/1.json
[ { "docid": "a112deccb9a665c450a61846f2b739b8", "score": "0.0", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to current_user.account }\n format.js { @projects = @account.projects }\n format.json { head :no_content }\n end\n end", "...
[ { "docid": "ce10449f9ce0fd62fdc6ce11492b8372", "score": "0.7898264", "text": "def destroy\n @root = \"projects\"\n \n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\...
250aac671c3f8d9b59535a43d3217279
This method update the changes to the user profile or renders the edit form if any error occours
[ { "docid": "6e561174ffd287876c353b59eea8f28d", "score": "0.0", "text": "def update\n @user = User.find(params[:id])\n if @user.update_attributes(params[:user])\n flash[:success] = \"Profile updated\"\n sign_in_user @user\n redirect_to [:edit, @user]\n else\n render 'edit'\n ...
[ { "docid": "15b0bc55894e82a8f61631832daf73a7", "score": "0.82727253", "text": "def update\n # Retrieve the user from the database\n @user = User.find( params[:user_id] )\n # Retrieve user's profile\n @profile = @user.profile\n # Mass assign edited profile attributes and save (up...
66e21a458b23cce0f48c359b9d8b7d7d
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
[ { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.0", "text": "def context; end", "title": "" } ]
[ { "docid": "d1758edd04b6374162470ca44c3f1250", "score": "0.6871734", "text": "def context\n unless @instance_context\n @instance_context = AuthTokenPromotionContext.new(@version )\n end\n @instance_context\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b4bc00f01109d6c953ee04767f3f01f4", "score": "0.0", "text": "def set_personnel\n @personnel = Personnel.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
38add97e613ea933b7857d8fed807d90
generate a csr pem file given a subject and a private key
[ { "docid": "c544a9b9c3e221eb54ae8d16bc66f98b", "score": "0.67702097", "text": "def gen_x509_request(subject, key)\n raise TypeError, \"subject must be a Ruby OpenSSL::X509::Name object\" unless subject.is_a?(::OpenSSL::X509::Name)\n raise TypeError, \"key must be a Ruby OpenSSL::PKey::EC o...
[ { "docid": "8f9a1e2c62b649728448982db5ac3d14", "score": "0.7025496", "text": "def openssl_create_csr(*args,&block)\n key = args[0][:key]\n name = OpenSSL::X509::Name.new [['CN', \"To be detailed\"]]\n req = OpenSSL::X509::Request.new\n req.version = 0\n req.subject = name\n req.public_...
a770db78056cd00c2a27c725ede943b9
Close all browsers and delete cookies.
[ { "docid": "5b998d549ee55f0b039e48912e45e579", "score": "0.8108319", "text": "def close_browsers_and_delete_cookies\n $tracer.trace(\"PowerUpRewardsDSL : #{__method__}, Line : #{__LINE__}\")\n $tracer.report(\"Should #{__method__}.\")\n close_all\n m = $options.silent_mode\n $options.sile...
[ { "docid": "53435bcf797ff9c6caf3dbe3d91a0b83", "score": "0.827534", "text": "def close_browsers_and_delete_cookies\n $tracer.trace(\"GameStopMobileDSL : #{__method__}, Line : #{__LINE__}\")\n close_all\n m = $options.silent_mode\n $options.silent_mode = true\n if (os_name == \"mswin32\")\...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c8032038403f1f9b89659b7971d396a0", "score": "0.0", "text": "def set_supply_movement\n @supply_movement = SupplyMovement.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.61637366", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60446453", "text": "def action_hoo...
528a00d90357f7aced76c248d658fe08
Create the given slave.
[ { "docid": "696ed899c9ee5018705634c620ae6789", "score": "0.63349557", "text": "def action_create\n if current_resource.exists? && correct_config?\n Chef::Log.debug(\"#{new_resource} exists - skipping\")\n else\n converge_by(\"Create #{new_resource}\") do\n executor.groov...
[ { "docid": "5b92ea1542bee6831b93e4f2ad545f3c", "score": "0.6883794", "text": "def add_slave(*cmdline, name: nil, **spawn_options)\n slave = Slave.new(*cmdline, name: name, seed: seed, **spawn_options)\n slave.needed!\n register_slave(slave)\n slave\n en...
908c2855ad9ae40402ab87da463c5080
TODO Implement weekly analysis.
[ { "docid": "133a4a9a5c744d69d2b4721939db9e6b", "score": "0.6363367", "text": "def generate_week_periods\n end", "title": "" } ]
[ { "docid": "ce1b21a4fc81856b57d0c7764dc9a8fa", "score": "0.7346765", "text": "def weeks; end", "title": "" }, { "docid": "f2cb3a06f55e1a77697325a02da87141", "score": "0.7002473", "text": "def week; end", "title": "" }, { "docid": "e72a14a7de121c4b3cee3f1749265cd5", "s...
466ac6a4aff3a8b5252f948241a20721
GET /tipo_produtos/1 GET /tipo_produtos/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "aa984abc773c328bfae3ed0240031101", "score": "0.7403062", "text": "def show\n @tipo_producto = TipoProducto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_producto }\n end\n end", "title": "" }, { "...
3725e9423511d5aaf2a97f3fb16494e5
The following steps are carried out (in no particular order): 1. Launch Ant.
[ { "docid": "bf3ccf0402d7471ee4cbdea40a30f8ee", "score": "0.75745034", "text": "def run\n super\n\n # Generate the build XML.\n @logger.debug('Generating Ant build file...')\n params = {':ruby_bin' => environment.ruby_bin, ':args' => Converter.to_command_line_args(@cl_propagate),\n ...
[ { "docid": "1c95385bf025774aa6d7b99b68a08e66", "score": "0.7295205", "text": "def ant\n @ant ||= ::Antwrap::AntProject.new(:ant_home => ant_home,\n :name => \"ivy-ant\", :basedir => Dir.pwd, :declarative => true)\n init(@ant) if should_init?\n @ant\n end", "title": "" }, { "do...
32be7a3ca75a9de4c153f966aca7ffbf
checks a potentialPassword (plaintext) against the "stored" password of the identity. This is done by salting and hashing the potentialPassword in the same way as the real password has been encrypted and stored in the database.
[ { "docid": "2799095a3ede3af1c000b06db31d7d40", "score": "0.7211774", "text": "def has_password?(potentialPassword)\n encrypted_password == encrypt_password(potentialPassword)\n end", "title": "" } ]
[ { "docid": "737b1f9b3dd343f7d065249248c3ba24", "score": "0.7060226", "text": "def correct_password?(password)\n crypted_password == encrypt_plaintext_password(password)\n end", "title": "" }, { "docid": "b145cd7fba352472e0599c0e76fd20b7", "score": "0.7002673", "text": "def passwo...
04019eb4f770de4d977007bd1ce1eaae
POST /pricing_defaults POST /pricing_defaults.json
[ { "docid": "2da5a55ce686f9e1a47f5d381fb2730d", "score": "0.7646062", "text": "def create\n\t\t@pricing_default = PricingDefault.new(params[:pricing_default])\n\n\t\trespond_to do |format|\n\t\t\tif @pricing_default.save\n\t\t\t\tformat.html { redirect_to pricing_defaults_url, flash: { info: 'Pricing def...
[ { "docid": "9b46b4ad35fd1b988b34944003ce3fae", "score": "0.6633333", "text": "def create\n @miscellaneous_pricing = MiscellaneousPricing.new(miscellaneous_pricing_params)\n\n if @miscellaneous_pricing.save\n render json: @miscellaneous_pricing, status: :created, location: @miscellaneous_prici...
9b4f32ba5bf7b0634d8c18e8171ef7a5
reduce 614 omitted reduce 615 omitted
[ { "docid": "3a08dda7f27430a3d453441e551479d1", "score": "0.0", "text": "def _reduce_616(val, _values, result)\n list = val[0].dup\n more = val[2].sexp_body\n list.push(*more) unless more.empty?\n result = list\n ...
[ { "docid": "dd458ee5bd7f974c08686357ef463ece", "score": "0.7437822", "text": "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "9c8f6a83bb5a721f7ab83f1cff91f26d", "score": "0.7424839", "text": "de...
290f1de91245c76ef3833fd1000f589f
Define your play method below
[ { "docid": "112ba962e18ce1877df8254939dec8ea", "score": "0.0", "text": "def play()\n \n while !over?()\n turn()\n end\n \n if won?()\n puts \"Congratulations #{winner()}!\"\n elsif draw?()\n puts \"Cat's Game!\"\n end\n end", "title": "" } ]
[ { "docid": "68219f003a195d32dc813c3985175f6f", "score": "0.91277385", "text": "def play\n \n end", "title": "" }, { "docid": "4a47c84d511d91b9083a5b0a1d9eff85", "score": "0.9031555", "text": "def play; end", "title": "" }, { "docid": "b82d37ab1b312789b3b27c088b8af245"...
c2f90ceba27c647d2067e9741129d6c5
Set a bit (1/0)
[ { "docid": "d1e923439e921ecc344cbc6e10536653", "score": "0.62429637", "text": "def []=(position, value)\n if value == 1\n @field[position / ELEMENT_WIDTH] |= 1 << (position % ELEMENT_WIDTH)\n elsif (@field[position / ELEMENT_WIDTH]) & (1 << (position % ELEMENT_WIDTH)) != 0\n @field[posit...
[ { "docid": "e2ce05413b4b1b897701412a9fd61fed", "score": "0.8832141", "text": "def set(bit)\n end", "title": "" }, { "docid": "77f0c3682ce80d08aee0be2ae65e12db", "score": "0.8241617", "text": "def setbit(key, offset, value)\n\t\t\t\t\tcall('SETBIT', key, offset, value)\n\t\t\t\tend...
3e8c843bc18d15fa556c57cf5ca712fb
Autolink URLs through Rinku.
[ { "docid": "9305b9bc75a79c6104be5df72d5f97b7", "score": "0.81063867", "text": "def autolink\n convert do |current|\n Rinku.auto_link(current)\n end\n end", "title": "" } ]
[ { "docid": "cf74f7ba1f63c930afc1b20fc04aefa8", "score": "0.6747446", "text": "def append_links\n @append_links = true\n end", "title": "" }, { "docid": "fea33128071275c665aa911203c16f99", "score": "0.67390364", "text": "def link() url; end", "title": "" }, { ...
efec2c403a09f7300155ceb929db2310
GET /students/1 GET /students/1.json
[ { "docid": "cef6e3c461335502e829c2a9f1f42011", "score": "0.71746093", "text": "def show\n @student = Student.find(params[:id])\n\t\t@course = Course.find(@student.course_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", ...
[ { "docid": "5bf4e8949f38afe1b66fa156e54bc6a2", "score": "0.7810203", "text": "def show\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @student }\n end\n end", "title": "" }, { "docid": "5afa8751df7b881b2d90d8b09dcc5ddd", "sco...
381e92882f7849ef267c21a32ce3c3e3
the script basename, for recycling into help messages
[ { "docid": "4f20712e70a4e50f07099cd1c98a698a", "score": "0.7418063", "text": "def raw_script_name\n File.basename($0)\n end", "title": "" } ]
[ { "docid": "10149c9364bcf1d7bfd88a0956f31157", "score": "0.7159514", "text": "def basename; end", "title": "" }, { "docid": "10149c9364bcf1d7bfd88a0956f31157", "score": "0.7159514", "text": "def basename; end", "title": "" }, { "docid": "10149c9364bcf1d7bfd88a0956f31157",...
b1fdf4f96515bf95e70a45b5ecd307cb
From the page 666 str%arg > string Format Uses str as a format specification and returns the result of applying it to arg. If the format specification contains more than one substitution, then arg must be an Array containing the values to be substituted. See (Objectsprintf on page 626) for details of the format string.
[ { "docid": "ef551e382ddbefcacbfae8047bcc7573", "score": "0.0", "text": "def test_String_InstanceMethods_PercentSign\n\t\tassert_equal(\"00123\", \"%05d\" % 123)\n\tend", "title": "" } ]
[ { "docid": "59184043b4541f00c04a9435c21a1c05", "score": "0.7398659", "text": "def format(str, *args)\n str.gsub!(/%year/, year.to_s)\n str.gsub!(/%month/, month.to_s)\n str.gsub!(/%mday/, mday.to_s)\n str.gsub!(/%yday/, yday.to_s)\n sprintf str, *args\n end", "title": "" ...
987d7c4dec1c19a5279b7e1f56b7da2d
Make or detect a backup folder for preexisting dotfiles
[ { "docid": "3a72859c952c159d32c6fbdbb64935ee", "score": "0.65663767", "text": "def make_backup_folder(backup_folder_path)\n if File.exist?(backup_folder_path) && File.directory?(backup_folder_path)\n puts \"USING EXISTING BACKUP FOLDER: #{backup_folder_path}\"\n else\n puts \"MAKING ...
[ { "docid": "a889abf30ac655cd8bf1a7fab588538e", "score": "0.6794841", "text": "def dot_file_replace\n pretty_print \"Symlinking dotfiles...\"\n DOT_FILES.each do |dot_file|\n dot_file_location = File.expand_path(\"~/#{dot_file}\")\n unless File.exists?(dot_file_location)\n # symlink the file...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d143cc0898d2b06cd381ffecb48dd16a", "score": "0.0", "text": "def set_notum\n @exercicio = Exercicio.find(params[:exercicio_id])\n @resolucao = Resolucao.find_by_exercicio_id(params[:exercicio_id])\n @nota = Nota.find_by_exercicio_id(params[:exercicio_id])\n if @nota == nil...
[ { "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...
90c37562663ac2dc6367c9bd02985bbe
Returns all .zip in the files list
[ { "docid": "58f70dd7ba587f45ade3736157e8924c", "score": "0.8115972", "text": "def zipfiles_in_files\n files.select { |file| file =~ /\\.zip/ }\n end", "title": "" } ]
[ { "docid": "7f096965b3c4eec982f5997297c79ec4", "score": "0.82616055", "text": "def list_all_files()\n\t\t\t@zip = Nuget::ZipHelper.new(@tmp) if @zip == nil\n\n\t\t\t@zip.get_entries_from_dir(\"\").each do |entry|\n\t\t\t\tputs entry.name\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "42b49...
6d97b4b3a88867322c2fca7ab6a412bb
example: g = Glyph.new g.vert_text_orient=val print g =>
[ { "docid": "787f2bdf38fac132390e09623857605c", "score": "0.7102558", "text": "def vert_text_orient= value\r\n value = value.to_s\r\n @attributes['vert-text-orient'] = value\r\n value.to_number\r\n end", "title": "" } ]
[ { "docid": "b0ec36f8102c1ba9d3c17fce77de5a31", "score": "0.6546874", "text": "def vertAlign; end", "title": "" }, { "docid": "b0ec36f8102c1ba9d3c17fce77de5a31", "score": "0.6546874", "text": "def vertAlign; end", "title": "" }, { "docid": "4ecb6b17877aa9c2ca6d8b9dd234c83d...
e7dc84b88e604b75e82715bd8d23ba07
Question with headline and Yes/No Buttons
[ { "docid": "177995dda268ed6003779de99258d9db", "score": "0.6288099", "text": "def AnyQuestion(headline, message, yes_button_message, no_button_message, focus)\n Builtins.y2milestone(1, \"%1\", message) if @log_yesno_messages\n\n ret = false\n if @display_yesno_messages\n if Ops.gre...
[ { "docid": "d223a5ec175540eee6ba0e4834b5f84a", "score": "0.68528855", "text": "def ask_questionaire\n alert_reserved_and_exit if git.reserved_branch?\n announce\n ask_title\n ask_label\n ask_pivotal_ids if config.use_pivotal_tracker\n ask_jira_ids if config.use_...
3f57a406e4c376040d9358dae873ad93
XXX This is an after_save callback instead of a normal validation so we can refer to the `id`, `created_at`, and `updated_at` columns (which aren't available until after saving the row).
[ { "docid": "c7c21d9892113951b5c56a945ffb82e8", "score": "0.0", "text": "def validate_previous_version\n if previous_version.present? && previous_version_id >= id\n raise \"The previous version must be before the current version (id=#{id}, previous_version.id=#{previous_version.id})\"\n elsif ...
[ { "docid": "0fbe3dd790f1aaa020a6dceb784cadb8", "score": "0.6670213", "text": "def _before_validation\n set_create_timestamp if new?\n super\n end", "title": "" }, { "docid": "bd027b62e93a162c8894a4338f2c546d", "score": "0.65812534", "text": "def save ...
859a709fe414c72e48e3ff47cedcb978
Embracing lazy dev mode
[ { "docid": "3b495e6dbd66d432495b052a13a676b2", "score": "0.0", "text": "def number_to_short_month_name(month_number)\n\n case month_number\n\n when 1\n first_month_string = \"Jan\"\n\n when 2\n second_month_string = \"Feb\"\n\n when 3\n third_month_string = \"Mar\"\n\n when 4\n fourth_m...
[ { "docid": "60048fb32bc8a2c48749411924b6f2cb", "score": "0.7013733", "text": "def request_debug_assets?; end", "title": "" }, { "docid": "404ac6fd3adc46996d04106f5f1df61a", "score": "0.6636289", "text": "def debug_mode; end", "title": "" }, { "docid": "a731cdbd35a5022d996...
31dda3bd933a89b0e2eabe26bcad743e
Normalizes a search to be a Fargo::Search object
[ { "docid": "0c812a1d051e23946a23c4dc1c517908", "score": "0.8599803", "text": "def normalize search\n if search.is_a? Search\n search\n else\n Search.new :query => search\n end\n end", "title": "" } ]
[ { "docid": "22a3b0df8bc903019b6815a23b437210", "score": "0.6692298", "text": "def scaffold_search_object(attributes = {})\n object = new\n scaffold_attributes(:search).each{|field| object.send(\"#{field}=\", nil) unless object.send(field) == nil}\n scaffold_set_attributes(object, attributes)\n ...
01500495d01d5e991b84d54dcad0fd67
Returns string representation of batch suitable as an identifier Returns nil if there is no batch or it's emtpy, in which case we don't have a suitable identifier
[ { "docid": "3007c788f87a57d5ceea5a566e88d351", "score": "0.6968669", "text": "def batch_id\n @batch && @batch.id\n end", "title": "" } ]
[ { "docid": "c970835ca448fe05e2e3c24b4cd527d6", "score": "0.6772867", "text": "def get_batch_id(batch_token)\n return if batch_token.blank?\n batch_id = batch_token.first.split('/').last\n batch_id\n end", "title": "" }, { "docid": "1042448f64325ca347300b502f67e68a", "score": "0...
ab8010175874d333987c5388fd78a1cd
Load an existing database entity for this object, or create a new one
[ { "docid": "df0359e053d9a536af327ac6deace7ca", "score": "0.59413093", "text": "def retrieve_entity\n if self.id\n @entity = Deltacloud::Database::Entity::retrieve(@model)\n if @entity.exists?\n after_retrieve\n end\n else\n @entity = nil\n end\n end...
[ { "docid": "179696ba5fd0761035c5fd09f70d0faa", "score": "0.7078033", "text": "def entity load=true\n @entity ||= (klass.where(id: id).first if load)\n end", "title": "" }, { "docid": "d2beeb22cb1b5a0db7ff3632251cf150", "score": "0.67967606", "text": "def load_entity(type, id)\n ...
35ee43e37233ca8e6cb8c3554ef049b3
Creates an +Invite+ from one +User+ to another +User+ with an optional note. This is simply a wrapper to Invite.send! to make sending invitations feel a little more natural.
[ { "docid": "c2458f146af32a6f5c161a2a7f666048", "score": "0.77385736", "text": "def invite!(user_from, user_to, note=\"\")\n Invite.send!(user_from, user_to, note, self)\n end", "title": "" } ]
[ { "docid": "ff29f9077f9b0981987cb248f497292b", "score": "0.64034927", "text": "def invite(user, options = {})\n group = options[:to] or raise \"Must give a :to => group option\"\n if user.kind_of?(String)\n user = User.create! :login => user, :created_from_invite => true\n end\n Invite....
127d9f282f4cc0b2d386bbf33cf37df7
POST /coins POST /coins.json
[ { "docid": "c89ca639ab221f16e306173dca3d6ee9", "score": "0.70976514", "text": "def create\n # @coin = Coin.new(coin_params)\n @coin = current_user.coins.new(coin_params)\n\n respond_to do |format|\n if @coin.save\n format.html { redirect_to @coin, notice: 'Coin(s) successfully added...
[ { "docid": "57d456a37a596a83a9ac264a4a341ab1", "score": "0.7263024", "text": "def create\n @coin = @coin_value.coins.build(params[:coin])\n\n respond_to do |format|\n if @coin.save\n format.html { redirect_to coin_value_coins_url(@coin_value), :notice => 'Coin was successfully created....
e96f9bd520ace97c34861f0cad4ed11d
GET /visita_tecnicas/1 GET /visita_tecnicas/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "24216f9876f89e7ab349e1f2ebbb0cf8", "score": "0.7630327", "text": "def index\n @tecnicas = Tecnica.all\n render json: @tecnicas\n end", "title": "" }, { "docid": "04ff13325b8e1a7b67c37cf81a5d174d", "score": "0.69420284", "text": "def index\n @visita_tecnicas = Vi...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6246c00507d87d1f85da36e39dbe3abd", "score": "0.0", "text": "def set_job_listing\n @job_listing = JobListing.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...
176bff6bdcad2dd1783552f29d41208c
supprimer un type de paiement en changeant le statut
[ { "docid": "59a636694cf145f0fd2a80cbbde3e9d4", "score": "0.69510156", "text": "def delete_type_paiement\n data = params[:type_id]\n\n #recherche et suppression\n query = Modepaiement.find(data)\n query.status = 0\n if query.save\n redirect_to parametre_type_paiement_path\n end\n ...
[ { "docid": "740c3f04d680405a1a4e2ffed5beb09f", "score": "0.72887594", "text": "def remove(type); end", "title": "" }, { "docid": "fd5a1cd2ed2d1215c737321350e6b9fc", "score": "0.6811275", "text": "def purge_type!(type)\n # puts \"*** before purge type #{type},Document.count:#{D...
da31b7e2e820622c79a979641863a857
Builds regular expression query clause(s).
[ { "docid": "955daf29cead358456babe569971779b", "score": "0.0", "text": "def regex(**mapping)\n render(STANDARD, REGEX, **mapping)\n end", "title": "" } ]
[ { "docid": "4a10ec37e994baf00496aece01e1c30f", "score": "0.6310045", "text": "def build_regex(fields)\n fields_or = fields.map { |field| \"#{field}(\\\\[\\\\])?\" }.join('|')\n\n Regexp.new(\"^#{fields_or}$\")\n end", "title": "" }, { "docid": "c6a4f2608a5b6f964fcbc123218a...
2e8118593f1215095b324ca76a13f3bc
DELETE /admin/applcts/1 DELETE /admin/applcts/1.json
[ { "docid": "20029e25813e1677c987963c4bdc45d5", "score": "0.74225557", "text": "def destroy\n @admin_applct.destroy\n respond_to do |format|\n format.html { redirect_to admin_applcts_url, notice: 'Applct was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "6bac329c89711953ca6bc8811a7cd45a", "score": "0.70650256", "text": "def delete_app name\n\t\t\tdelete(\"/apps/#{name}.json?token=#{auth_token}\")\n\t\tend", "title": "" }, { "docid": "9d3132fa4d9f52107547a6a1974a50ab", "score": "0.6985845", "text": "def delete_app name\n ...
f45eed6ab9d4398f5f96935898b1fe75
Time Complexity: Space Complexity:
[ { "docid": "8618f99d6bea069d7b52f561d46e224e", "score": "0.0", "text": "def postorder\n raise NotImplementedError\n end", "title": "" } ]
[ { "docid": "27f29666484272c0d973e8400c4c357c", "score": "0.6323769", "text": "def hash_two_sum?(arr, num)\n hash = Hash.new(0) #O(1) work\n arr.each do |ele| # N times\n return true if hash.has_key?(num - ele) # O(1) work\n hash[ele]+= 1 # O(1) work\n end\n false\nend", "ti...
68ef8b16b05fad3296014d968e359f20
1st November 2009 at 10:00 1st December 2010
[ { "docid": "5a31a3a2577946157a9bd38e7721cb4a", "score": "0.0", "text": "def same_day_different_month_different_year_starting_time\n [\n full_date_starting_time(start_on),\n separator,\n full_date(end_on),\n ]\n end", "title": "" } ]
[ { "docid": "0f16d8bb959da2fd0bd07f24b230767e", "score": "0.6229599", "text": "def at_beginning_of_month; end", "title": "" }, { "docid": "0f16d8bb959da2fd0bd07f24b230767e", "score": "0.6229599", "text": "def at_beginning_of_month; end", "title": "" }, { "docid": "911253aa...
4bb85958a9ab5fa2a30712022b537b51
GET /order_transactions/1 GET /order_transactions/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "dedca7da8dfa4daf92c60c183fd0a330", "score": "0.7377658", "text": "def transactionById\n results = HTTParty.get(\"http://192.168.99.101:4050/transactions/\" + (params[:id]).to_s)\n render json: results.parsed_response, status: results.code\n end", "title": "" }, { "do...
12a7e88037476aa1c99af9059f7e591c
Type of the string Return type: Fixnum
[ { "docid": "2e19d3f0408794e3355e39a66c1e1a6a", "score": "0.64374125", "text": "def type\n\t\t@str.type\n\tend", "title": "" } ]
[ { "docid": "6190b6f7e8fe39e6c75e71463784029a", "score": "0.7293956", "text": "def type_string\n \"int\"\n end", "title": "" }, { "docid": "071e11b2d590b05dc8fec8b3faa2e49e", "score": "0.68590844", "text": "def convert_fixnum_to_type\n\t\tcase @language\n\t\twhen :java, :java_...
5c6b03ae6851a765d6fe8ca0d57c9544
Next, at a minimum, you need to implement a search_implementation method, which takes a normalized hash of search instructions as input (see documentation at normalized_search_arguments), and returns BentoSearch::Results item. The Results object should have total_items set with total hitcount, and contain BentoSearch::...
[ { "docid": "3ee06193c6c8f8d640a719c6ad0acdf7", "score": "0.65766484", "text": "def search_implementation(args)\n\n # 'args' should be a normalized search arguments hash including the following elements:\n # :query, :per_page, :start, :page, :search_field, :sort\n Rails.logger.debug(\"mjc12test:...
[ { "docid": "f4850f2211220ac616340e1759b16c5a", "score": "0.7481324", "text": "def search_implementation(args)\n scrape_url = construct_search_url(args)\n response = http_client.get(scrape_url)\n\n unless response.ok?\n error = BentoSearch::Results.new\n error.error = {\n status...
99b719f2c556596ddb703c33f32b1f98
DELETE /aventures/1 DELETE /aventures/1.json
[ { "docid": "bdff41e194e4828911cc43ce542001c7", "score": "0.7103013", "text": "def destroy\n @aventure.destroy\n respond_to do |format|\n format.html { redirect_to aventures_url, notice: 'Aventure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "tit...
[ { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.7263238", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "914fd39b77e1d1d68c7d8290a26eebf6", "score": "0.69332266", "text": "def destr...
1b2f6d3e71720be26789debdd9c5599e
After the transaction is committed, assigns stored changes to committed changes
[ { "docid": "8eb0640b76d658cff94ed4aa5a2b1b6d", "score": "0.63745856", "text": "def __changes_committed\n @__committed_changes = @__changes_to_commit\n end", "title": "" } ]
[ { "docid": "94830732421ea717bf1ef1f3f0bb1424", "score": "0.71549904", "text": "def commit\n @original = @current\n end", "title": "" }, { "docid": "a7341b1977a5e69db218b98623783eb6", "score": "0.70767486", "text": "def commit\n @changed = nil\n end", "...
246d84377fa63a20acc63c8b5da7c28c
Generate a hash of NC groups to be consumed by mkgroups.rb num_top the number of groups to create at this level max_children the maximum number of child groups created max_depth the deepest number of groups created prefix don't change this Note that with the default values, this can easily generate over 1000 groups
[ { "docid": "2faa2794306d9a605886d12944aa15fe", "score": "0.832799", "text": "def create_groups num_top=40,max_children=3,max_depth=7,prefix='top',max_rules=30\n #puts \"create groups #{prefix} #{num_top},#{max_children},#{max_depth}\"\n tree = {}\n return {} if max_depth == 0\n for i in 0..n...
[ { "docid": "f7917713c16fd6de1f94af7ace3571b0", "score": "0.6298765", "text": "def group_depth; end", "title": "" }, { "docid": "f7917713c16fd6de1f94af7ace3571b0", "score": "0.6298765", "text": "def group_depth; end", "title": "" }, { "docid": "f7917713c16fd6de1f94af7ace35...
9b1e16c9101543490dc995848b3ac2e4
PUT /botigues/1 PUT /botigues/1.json
[ { "docid": "3133610b03f434cac3c02553af8e3848", "score": "0.6107365", "text": "def update\n @botiga = Botiga.find(params[:id])\n\n respond_to do |format|\n if @botiga.update_attributes(params[:botiga])\n format.html { redirect_to @botiga, notice: 'Botiga was successfully updated.' }\n ...
[ { "docid": "619f34ae4368fc17768606d8048a6b8a", "score": "0.6506918", "text": "def update\n respond_to do |format|\n if @bot.update(bot_params)\n format.html { redirect_to @bot, notice: 'Le bot a été mis à jour.' }\n format.json { render :show, status: :ok, location: @bot }\n e...
3945245758a990f82deefd207e8e9d0f
Serialize the datastream's RDF relationships to solr
[ { "docid": "4a9be7e9fa76285c603a10de815a0d23", "score": "0.0", "text": "def solrize_rdf_assertions(file_path, solr_doc = {})\n solr_doc.merge! indexing_service.generate_solr_document(prefix_method(file_path))\n end", "title": "" } ]
[ { "docid": "8ef50baf5dd14382619e998b439c07c2", "score": "0.64757967", "text": "def to_rdf\n retrieve_triples_from_database(accept_header=\"application/rdf+xml\")\n end", "title": "" }, { "docid": "1ed8b882f006c2dae0a310ea9495a590", "score": "0.6257687", "text": "def to_rdf\n ...
bfb151a1d6cce2a1ef365ab5b0f6cce6
name Name of table opts
[ { "docid": "8d397ff3215337aad1edcf26544362ba", "score": "0.0", "text": "def initialize(name = nil, attributes = {})\n super name\n @name = name || \"nw_#{object_id}\"\n @attributes = attributes\n @nodes = {}\n @name2node = {}\n @links = {}\n @name2link = {}\n @epo...
[ { "docid": "5cc258f192ac68e0491f19c51bf0b822", "score": "0.7582048", "text": "def proper_table_name(name, options = T.unsafe(nil)); end", "title": "" }, { "docid": "6352afee8a3fbcca8e2b7ad70a62b1ca", "score": "0.7426108", "text": "def table_name_options(config = T.unsafe(nil)); end",...
bfd7d0c8c807511dfaf88882d0ef62ac
The Genehgnc returns the HGNC symbol for the gene.
[ { "docid": "83ee615048840935c7a1ce4e1021d116", "score": "0.77488273", "text": "def hgnc\n hgnc_db_id = ExternalDb.find_by_db_name('HGNC_curated_gene').id\n xref = self.all_xrefs.select{|x| x.external_db_id == hgnc_db_id}[0]\n return nil if xref.nil?\n return xref.display_labe...
[ { "docid": "90ef1131ef996c6fea8a4fb589a7bd94", "score": "0.601803", "text": "def gene_id\n description.andand.match(/ GN=(\\w+) ?/)[1]\n end", "title": "" }, { "docid": "3349515aa3a426696d21b2a307697532", "score": "0.54360306", "text": "def g1\n @g1 ||= values_to_sentence(...
8bef442f964c3d29c0e38cf498e0abf7
GET /xml_feed_handlers/1 GET /xml_feed_handlers/1.xml
[ { "docid": "5838d99421d78b3bff0f5bbafcf3c03c", "score": "0.0", "text": "def show\n products = Product.find(:all)\n @xml_feed_handler = XmlFeedHandler.find(params[:id])\n @results = @xml_feed_handler.xml_import_results\n\n @select_array = []\n products[0..20].each do |p|\n @select_arr...
[ { "docid": "70c019e1e6e7bd9a070f4c6c37150329", "score": "0.6555033", "text": "def new\n @xml_feed_handler = XmlFeedHandler.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @xml_feed_handler }\n end\n end", "title": "" }, { "docid"...
34d07596196f1a6c1670b73f049b0567
Returns a part of adequate volume if one exists. If no sample exists return nil
[ { "docid": "8ebf68f025206cc21398c27b4052d2bd", "score": "0.80014217", "text": "def get_part(sample_name:, volume_required: nil)\n parts.each do |part|\n next unless part.item.sample.name.equal? sample_name\n next unless part.enough_volume? volume_required\n return part\n end\n re...
[ { "docid": "a57f8a21148ca889e0b309d8c6b63f31", "score": "0.61369175", "text": "def target_sample\n target_sample = samples.find_by(\"distractor IS NULL or distractor = ?\", false)\n target_sample ||= samples.take\n end", "title": "" }, { "docid": "f32e64fcdc3426db158befe561d7c880", ...
d33cae8a281711f25c61b60730357e5f
Write a method that takes three integers representing angles of a triangle Returns :acute, :obtuse, :right, or :invalid
[ { "docid": "ccacf51570eb3bf6f98d0e85aa032c7d", "score": "0.89220166", "text": "def triangle(angle_1, angle_2, angle_3)\n angles = [angle_1, angle_2, angle_3]\n case\n when angles.inject(:+) != 180 || angles.include?(0)\n :invalid\n when angles.include?(90)\n :right\n when angles.any? { |angle...
[ { "docid": "e98acc97fdc234164b4e6888a3ffcd0a", "score": "0.9035607", "text": "def triangle(first, second, third)\n angles = [first, second, third]\n return :invalid unless angles.sum == 180 && angles.none?(0)\n\n case\n when angles.any?(90) then :right\n when angles.all? { |angle| angle < 90 } then...
a8f6728f951242fbf2ddc5ee7b5fc881
Return the metadata for this account configuration
[ { "docid": "b4c0587432f5841b43afd3faab6fd9da", "score": "0.0", "text": "def notify\n {\n }\n end", "title": "" } ]
[ { "docid": "2c6517f751ddf90c718ce570f40e54c9", "score": "0.7687827", "text": "def metadata\n configuration.metadata\n end", "title": "" }, { "docid": "5bf2dcf7b03c15e578090be94ee08493", "score": "0.70891064", "text": "def metadata\n @metadata\n end", "title": ...
43b4a6ebba8186716fd4dc64a9141b5e
Current line being executed by the VM.
[ { "docid": "9d1dd7a72c597e6af0913cd41ae89e47", "score": "0.67846096", "text": "def line\n return 0 unless self.method\n # We subtract 1 because the ip is actually set to what it should do\n # next, not what it's currently doing (unless we are at the start of\n # a new context).\n ip = sel...
[ { "docid": "6b84527308d6b37229944820ea13f2f7", "score": "0.8435822", "text": "def line\n if active?\n @session.request(:vim_get_current_line)\n end\n end", "title": "" }, { "docid": "eae01f92eca400ebb46e76e6a2ec1f91", "score": "0.8143916", "text": "def line\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "924e9638e208342cbe619b55061ebe5f", "score": "0.0", "text": "def set_crew_big_sonu_schedule\n @crew_big_sonu_schedule = Crew::BigSonuSchedule.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6162554", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60452986", "text": "def action_hook...
bfefe398c27bb592a035ec62a7e13072
Patients this user has enrolled
[ { "docid": "b5a1a8ec55f9924255e7e2f6875214ac", "score": "0.73966545", "text": "def enrolled_patients\n created_patients\n end", "title": "" } ]
[ { "docid": "5649bb0f2f4efc0ad42f6ea1dc8107af", "score": "0.6878733", "text": "def enrolled_patients\n begin\n patients = enroller_table_data(params, current_user)\n rescue InvalidQueryError => e\n return render json: e, status: :bad_request\n end\n\n render json: patients\n end", ...
6512d6817f9eb2478d24ef4ccb1eee85
take one sample from the distribution and remove from distribution forever
[ { "docid": "6771ba745de5bbac9e99979473fdb844", "score": "0.81485915", "text": "def sample_from_distribution_and_remove\n sample = sample_from_distribution\n mass = distribution_lookup[sample]\n\n @total_mass -= mass\n distribution_lookup.delete(sample)\n distribution.delete_if {...
[ { "docid": "b2fdf3b2c2a5af44f291df6a5e1b982f", "score": "0.82255834", "text": "def sample_from_distribution_and_remove\n sample = sample_from_distribution\n\n if @values.is_a?(Range)\n @values = @values.to_a\n end\n\n @values.delete(sample)\n @num_values = @values.length\...
bef8a64543d799db72d0e4c735cc3cf9
assumes an even numbered list of elements
[ { "docid": "e62111e4e316d9f4d23ba6375bcd3320", "score": "0.0", "text": "def compare_adjacent_elements words\n\t\twords = transpose_list words\n\t\twords.each do |x|\n\t\t\t#require 'debug'\n\t\t\tcase x.first <=> x.last\n\t\t\twhen -1\n\t\t\t\t@winners << x.first\n\t\t\t\t@losers << x.last\n\t\t\twhen ...
[ { "docid": "e0a4bf58e6ca4d76cf635608c59042e5", "score": "0.74637055", "text": "def odd_elements(array) \n \n array.each_with_index do |element, index|\n if index % 2 == 0\n next\n end\n \n end\nend", "title": "" }, { "docid": "7111dbaa80aa8008281f6199...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "40b5878f63890d1cbeaee13c057d18b3", "score": "0.0", "text": "def book_params\n params.require(:book).permit(:title, :author, :description, :amazon_id, category_ids: [])\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...
2d7b0875c142f764f6f1deb3f3201e73
POST /pacientes POST /pacientes.xml
[ { "docid": "4bbc74bb0af9cbdc738122b8a9f72f20", "score": "0.6714638", "text": "def create\n @paciente = Paciente.new(params[:paciente])\n\n respond_to do |format|\n if @paciente.save\n format.html { redirect_to(@paciente, :notice => 'El Paciente se creo exitosamente.') }\n format...
[ { "docid": "f88af4a6bcbe4a88450ee40e33174f42", "score": "0.65420055", "text": "def create\n @pacient = Pacient.new(params[:pacient])\n\n respond_to do |format|\n if @pacient.save\n format.html { redirect_to(@pacient, :notice => t(\"flash.notices.model.pacient.created\"))}\n form...
079d0a4fd83f5383ac739acc5a6784f8
Read Returns all association types between two object types
[ { "docid": "3057ac60e7a03b4c87f47cde79d706d1", "score": "0.0", "text": "def get_all(from_object_type, to_object_type, opts = {})\n data, _status_code, _headers = get_all_with_http_info(from_object_type, to_object_type, opts)\n data\n end", "title": "" } ]
[ { "docid": "fe5d89a34db4f10d159d7775a1c4fdb6", "score": "0.63813716", "text": "def referenced_types\n [@type]\n end", "title": "" }, { "docid": "8abdfec216dbbf4c880804f8055b08d8", "score": "0.6227689", "text": "def object_types; end", "title": "" }, { "docid": "e5...
ce10553bf85038360a77644159af7438
MySQL uses a lot of indices to get round its performance issues. Postgres's query planner won't use them, and they make import writes slow. Strip things back to what we do require.
[ { "docid": "816170cff21e8e2ecabf33062f36e2cc", "score": "0.54216695", "text": "def up\n remove_index_if_exists :hits, %i[host_id hit_on]\n remove_index_if_exists :hits, %i[host_id http_status]\n remove_index_if_exists :hits, %i[host_id path_hash hit_on http_status]\n remove_index_if_exists :...
[ { "docid": "ab3508bd17c724386ecd1b541a25bfde", "score": "0.64652383", "text": "def install_missing_indexes\n db_connection.execute(\n <<-SQL\n SELECT install_missing_indexes();\n SQL\n )\n end", "title": "" }, { "docid": "d869d98e63d5a648957b14e2de1d2e8b", "score"...
70bc3db5c1c293cf571c8f10bd37fa6a
Holds generators configuration: config.generators do |g| g.orm :datamapper, :migration => true g.template_engine :haml g.test_framework :rspec end If you want to disable color in console, do: config.generators.colorize_logging = false
[ { "docid": "add606e172f509169e7d293765f3646f", "score": "0.6712829", "text": "def generators\n @@generators ||= Rails::Configuration::Generators.new\n if block_given?\n yield @@generators\n else\n @@generators\n end\n end", "title": "" } ]
[ { "docid": "e2c77dc4ff45c95edde25b9ec502f37c", "score": "0.7619964", "text": "def generate_generators_config\n template 'generators.rb.tt', 'config/initializers/generators.rb', force: true\n end", "title": "" }, { "docid": "c3a92ae25335e1013e152443a35a8c2d", "score": "0.75496054"...
938811b4211793e98236263981998e64
PATCH/PUT /xcusers/1 PATCH/PUT /xcusers/1.json
[ { "docid": "51f102e02e2bd412aa4210a9f2123e6d", "score": "0.5179557", "text": "def update\n respond_to do |format|\n if @xcuser.update(xcuser_params)\n format.html { redirect_to @xcuser, notice: 'Xcuser was successfully updated.' }\n format.json { render :show, status: :ok, location...
[ { "docid": "4e0e59715d19dce2a47fccc2c67326dd", "score": "0.6067041", "text": "def patch!\n request! :patch\n end", "title": "" }, { "docid": "7cbcb2cda6e100042f124dacd474f3be", "score": "0.6043393", "text": "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[...
5823c75f7437cf9f59a185b6d2ebf8b8
GET /posts/1 GET /posts/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "915c0178f9e4347098d8a463c2cbe6b0", "score": "0.77119195", "text": "def show\n @posts = Post.find(params[:id])\n render json: @posts\n end", "title": "" }, { "docid": "ad221611c85e1ec63d3385d6179e41a2", "score": "0.73543334", "text": "def show\n render json: Post...
6afce915b27ea58a18c7b187103863b0
DELETE /notas/1 DELETE /notas/1.xml
[ { "docid": "95b7e9ee80f5f04e65fdeac758c947b2", "score": "0.66418695", "text": "def destroy\n @nota = @solicitud.notas.find(params[:id])\n @nota.destroy\n\n respond_to do |format|\n format.html { redirect_to(solicitud_notas_url(@solicitud)) }\n format.xml { head :ok }\n end\n end"...
[ { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.6798557", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "df26116eb86dbadafed7137f9e3c2f9e", "score": "0.6789765", "text": "def delete!\r\n return nil unless exi...