query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
a7c9ac03317d4bcec57db08615abafb0
Get a flow execution&39;s details. Flow execution details are available for several days after the flow is started.
[ { "docid": "c6a1e156ee8ed921dfb78117a8bd95e4", "score": "0.6684863", "text": "def get_flows_execution_with_http_info(flow_execution_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ArchitectApi.get_flows_execution ...\"\n end\n \n ...
[ { "docid": "83f5d3de5265d760aa9f3cc9c7f57315", "score": "0.73162925", "text": "def get_execution_info\n execution = @swf.describe_workflow_execution(\n domain: @domain,\n execution: @execution\n )\n execution[\"executionInfo\"]\n end", "title":...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "456eaf3ced45512dfe1455dbf3ee6402", "score": "0.0", "text": "def set_share\n # @share = Share.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;...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "6879baffd0009d8fbf6d6f310b0465a4", "score": "0.0", "text": "def daily_work_params\n params.require(:daily_work).permit(\n :date,\n :user_id,\n daily_work_kpis_attributes: [:id, :title, :kpi_id, :task_id, :hours, :comment, :_destroy],\n )\n end", "t...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74968386", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958337", "text": "def strong_params\n params.require(:request).permit(param_whit...
1194369afc25bf3aea34be4a8b9e8c36
PUT /businesses/1 PUT /businesses/1.json
[ { "docid": "65fae3d8ed9d011f937350feaf40c1bf", "score": "0.535841", "text": "def update\n @business = Business.find(params[:id])\n\n respond_to do |format|\n if @business.update_attributes(params[:business])\n format.html { redirect_to @business, notice: 'Business was successfully upda...
[ { "docid": "664e7b8d3595cf3ab2f18fabc22d1fe5", "score": "0.65456283", "text": "def update\n @bus.update(bus_params)\n respond_with(@bus)\n end", "title": "" }, { "docid": "06cfaceed9673b50336302398877e3a4", "score": "0.65383804", "text": "def update\n update_object(@busines...
5a39233b39d9d8b330e872f4aff27d42
is there still a new TopStory theme
[ { "docid": "3f122de60fef1f4e5d614985fa0ee689", "score": "0.5557049", "text": "def isTopStoryUpToDate?\n TopStory.last.created_at.strftime('%d').eql? Time.now.strftime('%d')\n end", "title": "" } ]
[ { "docid": "a4ade44e83f03e6b15d9b17ec38e791f", "score": "0.7142343", "text": "def has_theme?(theme_tag) has_tag(:theme, theme_tag) end", "title": "" }, { "docid": "7d2598200f29025394184bb9df1198c6", "score": "0.66920424", "text": "def applied?\n SpreeTheme.site_class.current.t...
91848726edf1439a2a9c2ca34b2b833a
PUT /quotations/1 PUT /quotations/1.json
[ { "docid": "77a38e65c2f79c71d722ff30f2ce81a3", "score": "0.57715553", "text": "def update\n\n respond_to do |format|\n if @quotation.update_attributes(params[:quotation])\n format.html { redirect_to orcamentos_path(@quotation.vendor), notice: 'O orçamento foi atualizado com sucesso.' }\n ...
[ { "docid": "f655b09a5dd5e724582884c8b433b1f1", "score": "0.70140976", "text": "def update\n megam_rest.update_quotas(to_hash)\n end", "title": "" }, { "docid": "1d7cf8b953e3e56ab4d417fa387b45b4", "score": "0.66660666", "text": "def set_quotation\n @quotation = ...
24891f0be1dc7644e02c7b3f6eac9381
Use to fill normal frame
[ { "docid": "7e776a0cd42835d94e46f8708c04bb5c", "score": "0.5312006", "text": "def add_normal_frame(index, frame)\n pin = @pins[index]\n if @pins[index.succ].nil?\n frame.score = pin\n @skip_flag = true\n else\n frame.score = pin + @pins[index.succ]\n @skip_fla...
[ { "docid": "e307f38a6b6e928e44eef65c8d8a59cb", "score": "0.66658455", "text": "def fillrect(*)\n super\n end", "title": "" }, { "docid": "e1d8130298a72d7d1bce6f8472e370fd", "score": "0.6623773", "text": "def fill\n \t@fill\n end", "title": "" }, { "docid": "99a4...
819f4b0cbd9569c15c17a47ec8b1f6ea
4) Displays a form to the user.
[ { "docid": "e68f46bfd8877386c908a622b4cb009b", "score": "0.0", "text": "def new\n @post = Post.new\n end", "title": "" } ]
[ { "docid": "4c5ddadeffb8658af85b4d31d78c26f0", "score": "0.72435373", "text": "def form; end", "title": "" }, { "docid": "4359f17cccd1b44ee098eeaaa38305d9", "score": "0.7154046", "text": "def form\n end", "title": "" }, { "docid": "ab5f721237b79940671bfc35760303b2", "...
edee01767f3190b0670f185036d8b12c
'password' is a virtual attribute
[ { "docid": "9609fa13a05512bdfd51106d0d95feab", "score": "0.0", "text": "def password=(password)\n @password = password\n if password.present?\n generate_salt\n self.hashed_password = self.class.encrypt_password(password, salt)\n end\n end", "title": "" } ]
[ { "docid": "c062c7fa71e4b7d8b767e45a3377d938", "score": "0.8463913", "text": "def password; self[:password] end", "title": "" }, { "docid": "ef33d01ddcdc985225d590bda266f56c", "score": "0.81615293", "text": "def password\n @attributes[:password]\n end", "title": "" }, ...
84f141c9032a7147440379910bbe94f1
metodos para replicacao nos dbfs
[ { "docid": "9ba58dde6ff83dc9c48c790092511dc3", "score": "0.57127327", "text": "def dbf_delete\n sql = \"select excluir_duplicata_receber_dbf(#{self.id}) as resultado\"\n x = Duplicata.replicando_no_banco(sql)\n end", "title": "" } ]
[ { "docid": "526f41cef05e3d0b35f9fdfd22b046f4", "score": "0.6536235", "text": "def clone_database\n \n end", "title": "" }, { "docid": "34f510cc81fb4e7236fae7c011d3f12f", "score": "0.6504157", "text": "def flushdb; end", "title": "" }, { "docid": "2010259cadefde50e...
9825f4ee02b812b493446cca6fce3cb6
POST /opportunities POST /opportunities.json
[ { "docid": "5c31e1e27439ab6c4f362b2fa7db0bfd", "score": "0.68809533", "text": "def create\n @opportunity = Opportunity.new(opportunity_params)\n @opportunity.user = current_user\n\n respond_to do |format|\n if @opportunity.save\n format.html { redirect_to @opportunity, notice: 'Oppo...
[ { "docid": "a35d27193a76ec1a4f32e8c1d209f161", "score": "0.7642337", "text": "def create\n @opportunity = findable_opportunities.new(opportunity_params)\n\n respond_to do |format|\n if @opportunity.save\n format.html { redirect_to @opportunity, notice: I18n.t('controllers.opportunities...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "accff5f61daa8757d022a9ccc4d76b20", "score": "0.0", "text": "def set_venda\n @venda = Venda.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60320485", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6013371", "text": "de...
ab0f538b8865d2eb9746cd47912cf34e
outerName is a class name or a namespace
[ { "docid": "aceb4b4844995ceced2be329187ab847", "score": "0.0", "text": "def makeStubDef(outerName)\n constStr = (@constMemfunc) ? \"const \" : \"\"\n\n numberOfArgs = ArgumentSplitter.new(@typedArgSetWithoutDefault).argSet.size\n # Treat void-only arg empty\n numberOfArgs = 0 if @arg...
[ { "docid": "405ad21760ed7761ae5d1bff67be2b15", "score": "0.7327439", "text": "def class_name\n enclosing_names.join('::')\n end", "title": "" }, { "docid": "0f25860f2a151e7a28d164a186249cab", "score": "0.70342004", "text": "def outer_class\r\n if inner_class?\r\n ...
40faaa447a7413882a99f4d820dd1b6a
Helper method to call a customized drink by this name
[ { "docid": "e2476fc58ad977d5eef6e016c4c914c8", "score": "0.6812016", "text": "def custom_drink_name\n \"Customized Drink\"\nend", "title": "" } ]
[ { "docid": "9fb8389c31c940a23e36e112d4b1bafe", "score": "0.5969144", "text": "def make_drink\n puts 'a drink'\n end", "title": "" }, { "docid": "c7e60d7e99309f3c897d860d6d0c0f0e", "score": "0.572613", "text": "def sell_a_drink_to_guest(guest_obj, drink_name_str)\n @bar.sell_a_...
aee3557cd123c098b6b7a5e460e1f4ab
partial update to show new entries
[ { "docid": "3a73b5d86394cdc608d7254fdd13b53e", "score": "0.0", "text": "def relist\n @chatroom \t= Chatroom.find(params['chatroom_id'])\n @user = current_user\n @membership = Membership.find(:all, :conditions => {:chatroom_id => @chatroom.id, :user_id => @user.id })\n @users = User.all(:join...
[ { "docid": "41dd207e9bad6792d80552db6da20d85", "score": "0.68064475", "text": "def edit\n find_and_show_entries(false)\n end", "title": "" }, { "docid": "b9dae03604327c75a7dc902ced2d3a52", "score": "0.6726519", "text": "def update\n respond_to do |format|\n if entry.updat...
c99f2e0d26e41c806a0611791e4d77ba
Add a dependencies by name, version requirements, and a final optional :dev or :development symbol indicating its for development.
[ { "docid": "9de9471f2d20bb25e402fa3ce43cd9b1", "score": "0.6884082", "text": "def depend( name, *args )\n if args.last == :dev || args.last == :development\n args.pop\n add_development_dependency( name, *args )\n else\n add_dependency( name, *args )\n end\n end", ...
[ { "docid": "8ff8da8d8bf4f163502efc9410b811a3", "score": "0.724554", "text": "def add_dependency(name, version = nil)\n @requires[name] = version\n end", "title": "" }, { "docid": "8a822c315cafe427e1ff3db679e43453", "score": "0.68907166", "text": "def depend_on( name, versio...
27a4ca981c779747c8c7113208e97ccb
PATCH/PUT /damages/1 or /damages/1.json
[ { "docid": "4e9b977e52da7aa3944f30dea89368e8", "score": "0.7497913", "text": "def update\n respond_to do |format|\n if @damage.update(damage_params)\n format.html { redirect_to @damage, notice: \"Damage was successfully updated.\" }\n format.json { render :show, status: :ok, locati...
[ { "docid": "ad113299eefa97bcfeae63a097e687df", "score": "0.7629979", "text": "def update\n @damage = Damage.find(params[:id])\n\n respond_to do |format|\n if @damage.update_attributes(params[:damage])\n format.html { redirect_to @damage, notice: 'Damage was successfully updated.' }\n ...
88809ff84b3b2c7f22ad841e5dd895e2
POST /feeds POST /feeds.json
[ { "docid": "69b7a461290970374d45fe30eae32d62", "score": "0.64976615", "text": "def create\n @feed = Feed.new(feed_params)\n\n respond_to do |format|\n if @feed.save\n format.html { redirect_to @feed, notice: 'Feed was successfully created.' }\n format.json { render action: 'show...
[ { "docid": "2e8a15707e9607497708ec6dca35a57a", "score": "0.7148137", "text": "def create\n @user = User.find(params[:user_id])\n @feed = Feed.new(feed_params)\n @user.feeds << @feed\n\n if @feed.save\n render json: @feed, status: :created\n else\n render json: @feed.errors, stat...
8d0b8457ddbc6baf6049df84097df1ef
Returns the INode object for the requested path
[ { "docid": "7e94c9b6caabea9c303719f878eab608", "score": "0.6186379", "text": "def node_for_path(path)\n path = path.gsub(%r{^/+|/+$}, '')\n return cache[path] if cache.key? path\n\n # Is it the root node?\n return root_node if path.size == 0\n\n # Attempting to fetch i...
[ { "docid": "8d9f6e62ee73f469a6adec6bb4b48f7b", "score": "0.6687154", "text": "def node(path)\n path_components = scan_path(path)\n\n #not actually injecting anything here, we're just following the hash of hashes...\n path_components.inject(@root) { |dir,file|\n ...
cccb28d35d9034be02459a0a8678f362
POST /match_forms POST /match_forms.json
[ { "docid": "62ec6e2b0840fce1cccfaa6519eb20bd", "score": "0.66616917", "text": "def create\n @match_form = MatchForm.new(match_form_params)\n\n respond_to do |format|\n if @match_form.save\n format.html { redirect_to @match_form, notice: 'Match form was successfully created.' }\n ...
[ { "docid": "45c5b00fd1fe5f5579e02430faaaa220", "score": "0.6444493", "text": "def index\n @match_forms = MatchForm.all\n end", "title": "" }, { "docid": "df62446c5c8baea57fbe1a743af5e0df", "score": "0.60018903", "text": "def set_match_form\n @match_form = MatchForm.find(para...
af5e6ad39078e2c7a7776d1dc7f7470f
returns an Array of this follower's cults
[ { "docid": "31828e861006ac671444edea152434c3", "score": "0.78390193", "text": "def cults\n # ran the method on self (f1.cults)\n # self = follower instance\n # get this follower's info (self)\n # iterate through all BloodOath instances\n # select matching BloodOath ins...
[ { "docid": "08bd5b6514f1955858f4987d3d270495", "score": "0.8044876", "text": "def cults\n follower_bos = BloodOath.all.select {|b_o_instance| b_o_instance.follower == self}\n follower_cults = follower_bos.map {|b_o_instance| b_o_instance.cult}\n follower_cults.uniq\n end", "title": "" },...
54c39db5f7958a8d3bbf1591ca11bfc9
Build a method, `big_shoe_rebounds`, that will return the number of rebounds associated with the player that has the largest shoe size. Break this one down into steps: First, find the player with the largest shoe size Then, return that player's number of rebounds Remember to think about return values here.
[ { "docid": "a37ce7e893a7293969318ad17a5c5d29", "score": "0.7756258", "text": "def big_shoe_rebounds\n rebounds = 0\n big_shoe = 0\n game_hash.each do |loc, data|\n data[:players].each do |player_stats|\n if player_stats[:shoe] > big_shoe\n big_shoe = player_stats[:shoe]\n ...
[ { "docid": "ce08cfcda2b529b15e4332215748e8e5", "score": "0.8049876", "text": "def big_shoe_rebounds\n #Find player with biggest shoe\n find_number_rebounds(find_max_shoe)\nend", "title": "" }, { "docid": "29d0c0ae5779654162c92f0b86e192fc", "score": "0.795801", "text": "def rebounds...
32ced74f467da3c2cbc7f61a2a5d4c0c
Implements the serialized path of a code object.
[ { "docid": "4ded075cb6eb4344b9a06f121abd1eb7", "score": "0.6188686", "text": "def serialized_path(object)\n return object if object.is_a?(String)\n return File.join(object.path.split('::')) + (@extension.empty? ? '' : \".#{@extension}\")\n end", "title": "" } ]
[ { "docid": "1e2f4df7f324d7748863fdbf1eb4ad8a", "score": "0.7474669", "text": "def serialized_path(object); end", "title": "" }, { "docid": "1e2f4df7f324d7748863fdbf1eb4ad8a", "score": "0.7474669", "text": "def serialized_path(object); end", "title": "" }, { "docid": "5423...
c2cc5c7f617e18962a2f6c74a600579b
Funcion para log in del user
[ { "docid": "4ad2ec6bc5cadfe7a9784a7cbf479d24", "score": "0.0", "text": "def create\n user = User.authenticate(params[:email], params[:password])\n\tif user\n\t session[:user_id] = user.id\n\t redirect_to root_url, :notice => \"Logged in!\"\n\telse\n\t flash.now.alert = \"Invalid email or password\...
[ { "docid": "73f6b28de0c53d6be61244ad27047cb4", "score": "0.7394692", "text": "def login_user(user = User.create!(email: 'marcos@iugu.com.br', password: '123456'))\n \tlogin_as user, scope: :user\n user\n end", "title": "" }, { "docid": "be761afec1401bf4c1fd22c2e77ce61b", "score": "0...
3888bd485dc65dfb08ab60afcebc211e
POST /presets POST /presets.json
[ { "docid": "6a4d65c9542fd07174d0b2e154ab87e1", "score": "0.6599655", "text": "def create\n @preset = Preset.new(params[:preset])\n @preset.user_id = current_user.id\n respond_to do |format|\n if @preset.save\n format.html { redirect_to @preset, notice: 'Preset was successfully creat...
[ { "docid": "da2d4d4edc9c2a4bfcc47eec85c51c67", "score": "0.6124885", "text": "def create\n @preset = Preset.new(params[:preset])\n\n respond_to do |format|\n if @preset.save\n flash[:notice] = 'Preset was successfully created.'\n format.html { redirect_to(@preset) }\n for...
76076ff0f703d1b8fcd007d5c883a239
The core message of the notification
[ { "docid": "5e874e770a9b3a7dfda1f23542106ebf", "score": "0.6082643", "text": "def message\n \"#{event.kind}\"\n end", "title": "" } ]
[ { "docid": "a02fbf56549d15fb47c1ac8d02c1ae7f", "score": "0.7095066", "text": "def message\n \"You have a new notification!\"\n end", "title": "" }, { "docid": "db581639a67ebe3dfedf7215c17c2401", "score": "0.700564", "text": "def message\n \n end", "title": ""...
d912eeffbf6ea99e0f8227ed9eae0573
searchable do integer :id do id end text :track_name end recording_start_time is input as hh:mm:ss but stored as seconds
[ { "docid": "95ca35fa4c884a117f83e73c063310dc", "score": "0.566805", "text": "def recording_start_time=(time)\n if time.blank?\n super(nil)\n else\n super(time.split(':').map { |a| a.to_i }.inject(0) { |a, b| a * 60 + b})\n end\n end", "title": "" } ]
[ { "docid": "5302ae4ca1062e8b250591c37cfdb48d", "score": "0.6157433", "text": "def track_params\n params.require(:track).permit(:start_time, :end_time, :total_time, :tag, :work_type, :user_id)\n end", "title": "" }, { "docid": "5affc6c2f9bd758a0b04755766886094", "score": "0.612816...
501cb026c691d0578d1c8576202e47eb
Returns Array of String (without evaluating dataset objects).
[ { "docid": "99bfa374ebf40aae3941587f3c9bc287", "score": "0.0", "text": "def dataset_names\n metadata[:datasets]\n end", "title": "" } ]
[ { "docid": "4147f1677b7db96152243e5f317dcff3", "score": "0.6397315", "text": "def dc_eval_to_array(expression)\n expression.split(/\\ |\\,|\\(|\\)/).delete_if {|e| e.blank? }.map {|e| e.gsub(/\\'|\\\"/,'').strip }\nend", "title": "" }, { "docid": "e29bc43814d7dbc715c97c571a850821", "sco...
bfc265c354865f52a285020379f61a38
Create an instance variable that stores a single coupon object Use AR method find & params to find the specific object Render to show.html.erb in views/coupons
[ { "docid": "0dd8e30d5034ea88b16f759136c697fc", "score": "0.82615715", "text": "def show\n @coupon = Coupon.find(params[:id])\n end", "title": "" } ]
[ { "docid": "32a96354899f77e49ff21115ce1b2bfd", "score": "0.83485824", "text": "def show\n @coupon = Coupon.find(params[:id])\n end", "title": "" }, { "docid": "66e216bdf48401cfe2e0a0f1c85667fb", "score": "0.8220395", "text": "def show\n @o_single = UserCoupon.find(params[:id])...
99bb296ca41dd8606b4a69d2096e861c
Saving customer info and displaying tour info entry page.
[ { "docid": "518981c0dde18ced3a1e0bdd276b32bc", "score": "0.78106207", "text": "def tour_info\n @page_title = 'Tour Info'\n\n @customer = retrieve_customer\n if @customer != nil\n @customer.ip_address = request.remote_ip\n if !@customer.update_attributes(params[:customer])\n fla...
[ { "docid": "4ae5130c13262cca9a86e5217eb4ec25", "score": "0.62919295", "text": "def customer\n @phys = Physician.find(:all) #gets all physicians\n if request.post?\n \n if params[:commit] == \"save\" #save from physician modal page\n @phys = Physician.new(:address => params[:addres...
84c77a7e23ba6ab75ea7cf1249f26773
Renders a crud form for the current entry with default_crud_attrs or the given attribute array. An options hash may be given as the last argument. If a block is given, a custom form may be rendered and attrs is ignored.
[ { "docid": "f175958ca7abfa66af5bbe1a1d289c59", "score": "0.8066111", "text": "def crud_form(*attrs, &block)\n options = attrs.extract_options!\n attrs = default_crud_attrs - %i[created_at updated_at] if attrs.blank?\n attrs << options\n standard_form(path_args(entry), *attrs, &block)\n end"...
[ { "docid": "6a9601012f4cdc1523d4acdd921c10e8", "score": "0.7194307", "text": "def crud_form(object, *attrs, &block)\n options = attrs.extract_options!\n cancel_url = get_cancel_url(object, options)\n \n standard_form(object, options) do |form|\n content = if block_given?\n captur...
16679b00e2152e487f23a234b5cc1d92
Show Charge Show details of a specific Charge using a given &x60;:id&x60;.
[ { "docid": "a40cb8e7fcea20dcf95c06900dc15e0b", "score": "0.6612362", "text": "def show_charge_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ChargesApi.show_charge ...'\n end\n # verify the required parameter 'id' is ...
[ { "docid": "87257214ae09c569a8f57fbfec84d721", "score": "0.7433968", "text": "def show_charge(id, opts = {})\n data, _status_code, _headers = show_charge_with_http_info(id, opts)\n data\n end", "title": "" }, { "docid": "59f8fa2d6ee08c11ec97b4c1abed8b0b", "score": "0.7297008...
32b5d954b5e2a01f9d674875fc441d02
update true subscriber nonbillable
[ { "docid": "4917fdbebf84a90fe370bab38021df9c", "score": "0.65270984", "text": "def non_billable_button\n @subscriber = Subscriber.find(params[:id])\n if @subscriber.non_billable == false\n @subscriber.update_attributes(non_billable: true)\n end\n @json_data = { \"non_billable\...
[ { "docid": "e0f18245262ae63f848ec22ab38e900e", "score": "0.6969208", "text": "def toggle_subscription!\n self.unsubscribed = !unsubscribed\n save\n end", "title": "" }, { "docid": "f2ec73ea2e0c9a0c3fc99b4f28a81f8d", "score": "0.6469776", "text": "def subscribe_to_updates\n ...
f5bf23f3a2ba4cee82c978dc1569b30f
remove seek data by inode (when source file deleted)
[ { "docid": "43446485ac5b58d625d7d017a50d2078", "score": "0.5922907", "text": "def delete_key(inode)\r\n @db_mon.synchronize {\r\n @seek_db.delete(inode) rescue nil\r\n }\r\n end", "title": "" } ]
[ { "docid": "751c73611628453f518274b0dcbf150d", "score": "0.6027966", "text": "def delete_from_disk; end", "title": "" }, { "docid": "b43e8accb0ea181d45ed94d1e8eea60f", "score": "0.59977597", "text": "def copy(io, context)\n super\n if io.respond_to?(:path) && io.pat...
7a1bc359bc31b08d99d3334007dc2ce2
DELETE /upload_files/1 DELETE /upload_files/1.xml
[ { "docid": "a135493943c7db3f92af212d0110c7b5", "score": "0.7353133", "text": "def destroy\n @upload_file = UploadFile.find(params[:id])\n doc_no=@upload_file.doc_no\n @upload_file.destroy\n\n respond_to do |format|\n format.html { redirect_to upload_files_url(:doc_no=>doc_no) }\n f...
[ { "docid": "7bc85308b4f9bbf4903fb2066cc5642b", "score": "0.75603354", "text": "def destroy\n @file_upload = FileUpload.find(params[:id])\n @file_upload.destroy\n\n respond_to do |format|\n format.html { redirect_to(file_uploads_url) }\n format.xml { head :ok }\n end\n end", "...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0c7941a6812ad0a07fe146c44fd68822", "score": "0.0", "text": "def set_player\n show\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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2b73362ad7bf778f2544b81bd088251b", "score": "0.0", "text": "def set_and_authorize_due_date\n @due_date = policy_scope(base_object).find(params[:id])\n authorize @due_date\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60326946", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015941", "text": "de...
567f22951f9d768ac17afbfe69410cf8
POST for grades changes
[ { "docid": "5d59023f79bfc391c14f906db3952c5c", "score": "0.682499", "text": "def changeGrades\n print \"@1\"\n # print params[:max]\n # takes the new grades criteris.\n # goes through all enrolls. and modifies the grade according to the new grades criteria.\n grade_bounds = [\n ...
[ { "docid": "d8f03e50904508324535259d726c927e", "score": "0.7442485", "text": "def update_grades(new_grades)\n reload! unless @input_names\n \n page = @client.get @url\n grade_form = page.form_with :action => /detail/i\n new_grades.each do |assignment_name, new_grade|\n unless input_n...
be86160f11f34444ed73cdb7d15ff75e
Scraping from Masterview 2.0
[ { "docid": "b7101a261cd7a245ad0ea7099dc7e347", "score": "0.0", "text": "def scrape_page(page, comment_url)\n page.at(\"table.rgMasterTable\").search(\"tr.rgRow,tr.rgAltRow\").each do |tr|\n tds = tr.search('td').map{|t| t.inner_html.gsub(\"\\r\\n\", \"\").strip}\n day, month, year = tds[2].split(...
[ { "docid": "73df85b286aebec621fd0439445faf24", "score": "0.6634963", "text": "def scrape_show\n\n end", "title": "" }, { "docid": "17567fcee68c4d169100a5adcd8a4232", "score": "0.6486423", "text": "def scrape(url)\r\n end", "title": "" }, { "docid": "115c66bd365d61c58703...
93841cafee735a7d634bfa93c55de5e0
Returns a limit that will be used on the query
[ { "docid": "062a3131d33823690c8ab49abf8dce9e", "score": "0.0", "text": "def get_autocomplete_limit(options)\n options[:limit] ||= 10\n end", "title": "" } ]
[ { "docid": "a6425d2fa55606e391096759ea40eb41", "score": "0.83633053", "text": "def query_limit\n if params[:limit]\n limit = params[:limit].to_i # defaults to 0\n if self.respond_to?(:allowed_limit) && !self.allowed_limit.nil?\n [limit, allowed_limit].min\n else\n ...
73339376842edc3016d5c603cd331944
Same as +can_do+ mathod, but returns a string name of the CSS class to enable or disable a rendered item according to the currrent user access grants. (Usually, 'disabled' for no access/don't perform, and +nil+ otherwise)
[ { "docid": "80e6a93a31012ef628c5c8fe65207e65", "score": "0.7199838", "text": "def get_css_class_to_do( ctrl_name, action_name = 'index' )\n if can_do( ctrl_name, action_name )\n nil\n else\n 'disabled'\n end\n end", "title": "" } ]
[ { "docid": "5dcd06b7d0bededaadce740ee9ffaffe", "score": "0.68667305", "text": "def get_css_class_to_access( ctrl_name )\n if can_access( ctrl_name )\n nil\n else\n 'disabled'\n end\n end", "title": "" }, { "docid": "5d1e7cd6ff77f1cca6d1b6d4d50595f8", "score": "0.59696...
cbc69b864b268ea67d2d13267c36edb3
Add a logger to the MultiLogger and adjust its level to the MultiLogger's current level.
[ { "docid": "ef13c771065ce268bb67f346cf1dfec3", "score": "0.7768799", "text": "def add_logger(logger)\n logger.level = level\n @loggers << logger\n end", "title": "" } ]
[ { "docid": "7f2cde947fcc0adbcb4d1d9b479f4c74", "score": "0.71602935", "text": "def add_logger(logger)\n\t start_logging\n\t @loggers << logger\n\tend", "title": "" }, { "docid": "a740543c9e9a98e19f4ab4bd5fb22bd9", "score": "0.71110916", "text": "def add_logger(logger)\n @log...
1855b9aa36e21ebb82af057bd50b8e51
Initialize an Entry. This will also yield itself, so an Entry can be constructed like this: entry = Entry.new do |entry| entry.title = "My Cool entry" end +o+:: An XML Reader or a Hash of attributes.
[ { "docid": "745f4286b1cc40e3127a9577cfb6dc61", "score": "0.75138927", "text": "def initialize(o = {})\n @links = Links.new\n @authors = []\n @contributors = []\n @categories = []\n \n case o\n when XML::Reader\n if current_node_is?(o, 'entry', At...
[ { "docid": "e18c1ae1bf94a38ded30212e1f4be881", "score": "0.74488163", "text": "def initialize(o = {})\n @links = Links.new\n @authors = []\n @contributors = []\n @categories = []\n\n case o\n when Nokogiri::XML::Reader\n if current_node_is?(o, 'entry', Atom::NAMESPAC...
4de3241c287260b069ca08b46d991a8b
Waits until the element is visible
[ { "docid": "a41825fdbb74b67a90a23c313ced8975", "score": "0.74703", "text": "def when_visible(timeout=::PageObject.default_element_wait)\n when_present(timeout)\n element.wait_until(timeout: timeout, message: \"Element not visible in #{timeout} seconds\", &:visible?)\n self\n en...
[ { "docid": "a397b64eea513d32c084d3003ded3f59", "score": "0.838602", "text": "def wait_until_visible\n wait_for_visibility(true) { DriverManager.driver.find_element(@by, @locator).displayed? }\n end", "title": "" }, { "docid": "bf7c9430140fa346f553e4b781119cd4", "score": "0.8140137", ...
0ae418b08e754c9fa8c903215f803d0d
Registers the item in the Ready Menu.
[ { "docid": "79fec96eb713157663a216f7e2920bb7", "score": "0.5801691", "text": "def pbRegisterItem(item)\n if item.is_a?(String) || item.is_a?(Symbol)\n item = getID(PBItems,item)\n end\n if !item || item<1\n raise ArgumentError.new(_INTL(\"Item number {1} is invalid.\",item))\n re...
[ { "docid": "07e780b827dc2b63777f2147ecbad460", "score": "0.58742607", "text": "def register_state_item(item)\n name = item.name\n if @state_items[name]\n raise \"Duplicate item name: #{name}! Failing!\"\n end\n @state_items[name] = item\n if item.zone?\n @zones.pus...
cf6edcd90375d524d41797979b1c6823
POST /api/v1/users/token_varification reset password token varification
[ { "docid": "9adfa7fab2949e68578a0afbc1784fea", "score": "0.0", "text": "def token_verification\n user = User.with_reset_password_token(params[:user][:reset_password_token])\n if user && user.email == params[:user][:email] && user.reset_password_period_valid?\n render_success_resp...
[ { "docid": "4a8d9e241f2056b332cab336ed6f2d93", "score": "0.7530991", "text": "def with_reset_password_token(token); end", "title": "" }, { "docid": "61d1cc8844c255b848a4f127694f5e36", "score": "0.7427701", "text": "def forgot_password token\n recipients token.user.email\n f...
af8e2fc42399850292025cdda6903638
app specific environment variables.
[ { "docid": "23c9ab37308eba9316ff3550c7e7f626", "score": "0.6463189", "text": "def default_app_variables_path\n Hanami.root.join(\"apps\", Concierge.app.to_s, \"config\", \"environment_variables.yml\").to_s\n end", "title": "" } ]
[ { "docid": "bd1d501b2cb07953ec759dab24efe265", "score": "0.75201654", "text": "def env_config; end", "title": "" }, { "docid": "bd1d501b2cb07953ec759dab24efe265", "score": "0.75201654", "text": "def env_config; end", "title": "" }, { "docid": "bd1d501b2cb07953ec759dab24ef...
7572e69f587d4adde9a698abbac44c29
PUT /carts/1 PUT /carts/1.xml
[ { "docid": "b1aa26a28e08640fa5872183b1372c43", "score": "0.0", "text": "def update\n #@cart_item = session_cart.shopping_cart_items.find(params[:id])\n\n respond_to do |format|\n if session_cart.update_attributes(params[:cart])\n if params[:commit] && params[:commit] == \"checkout\"\n ...
[ { "docid": "8a71d9c7ea55392fb47b2f950a1b0495", "score": "0.65048224", "text": "def update\n @cart = Cart.find(params[:id])\n\n respond_to do |format|\n if @cart.update_attributes(params[:cart])\n flash[:notice] = 'Cart was successfully updated.'\n format.html { redirect_to(@cart...
177797b7e146f57365fc19cdfd9f60ef
POST /children POST /children.json
[ { "docid": "f2b0673a1bb580aa798149e50cf5e0de", "score": "0.5761691", "text": "def create\n @child = Child.new(child_params)\n base_uri = 'https://postjson-d117c.firebaseio.com/'\n @firebase = Firebase::Client.new(base_uri)\n kid = []\n child_params.each do |k,v|\n kid << k\n ...
[ { "docid": "50d9c02cec905d2ade6fa2c9f24cb035", "score": "0.7426617", "text": "def create_post!(params)\n @children.create! params\n end", "title": "" }, { "docid": "812a70516c81e60f615b2ac2a8d5d721", "score": "0.73090565", "text": "def create\n @children = Children.new(params[...
97b01f401b310832887bccd330d0fd3e
GET /allergen_components/1 GET /allergen_components/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "7021214e68687f3932b5c92cbc0c0633", "score": "0.743687", "text": "def components\n\t return JSON.parse(get(\"info/components.json\"))\n\tend", "title": "" }, { "docid": "6a980194ac676133468b7dde46a1192e", "score": "0.7231996", "text": "def index\n @allergen_components ...
197a334bc76be82e855ee1cf3f9ccd18
Show the value of the first node
[ { "docid": "620b198db72993cac39ad03630d2bf90", "score": "0.0", "text": "def peek\n raise EmptyQueueError if is_empty?\n @head.data\n end", "title": "" } ]
[ { "docid": "b593b5a838f2ea6a12fba001727dd781", "score": "0.7845881", "text": "def getFirst\n @firstNode.value\n end", "title": "" }, { "docid": "1549d390c935f97e167f53c7a554899d", "score": "0.72628736", "text": "def value\n node.string\n end", "title": "" ...
199bfb5bec27147ca6972606c3fafb91
Triggers an event, moving record to associated state, if permitted Raises exception if event is not permitted
[ { "docid": "3e6493e85e692d754123cf58208cd10c", "score": "0.6480659", "text": "def trigger!(event, metadata={})\n if !trigger(event, metadata)\n raise StateTransitionException::TransitionNotPermitted\n end\n end", "title": "" } ]
[ { "docid": "f8d6bea5a10127ef5aafb4e9844f65d8", "score": "0.6229441", "text": "def trigger(event, metadata={})\n if (event_permitted(event) || User.is_admin?(metadata[:user_id])) &&\n required_metadata_present?(event, metadata)\n to_state = self.event_to_state(event)\n callbac...
14713210bbceb73f53e55e5152a51213
POST /requests POST /requests.json
[ { "docid": "5c8280e144fcd43fb5455ecb61cea0b1", "score": "0.57172066", "text": "def create\n @request = Request.new(request_params)\n\n respond_to do |format|\n if @request.save\n format.html do\n redirect_to user_requests_path,\n notice: 'Request was succe...
[ { "docid": "a318fea357a4f157da49db8a2440f565", "score": "0.72750616", "text": "def create\n RestClient.post \"#{@uri}/api/requests\", @data.to_json, :content_type => :json\n end", "title": "" }, { "docid": "f3e5a41d5f246112fb00f6a4d86d9da3", "score": "0.6256417", "text": "def...
74239dae12903555efb98e7ee65af49d
tell the led string to render
[ { "docid": "6c371bc90b7121c63856ee7cbdcfa3bd", "score": "0.6272336", "text": "def render!\n serial_write \"r;\"\n end", "title": "" } ]
[ { "docid": "d96f49c957a8bfedbc161e14d1d9f7ad", "score": "0.6326887", "text": "def render_data pad, lineno, text\n text = text.join\n # FIXME why repeatedly getting this colorpair\n cp = @color_pair\n att = @attrib\n FFI::NCurses.wattron(pad,FFI::NCurses.COLOR_PAIR(cp) ...
4fdf7e179e8794f001693dbbcad58d0d
Return true if request is valid. def is_valid_request?
[ { "docid": "46a177c32232dbe935934a06cefa6511", "score": "0.0", "text": "def items\n unless @items\n @items = (@doc/\"product\").collect {|item| Element.new(item)}\n end\n @items\n end", "title": "" } ]
[ { "docid": "ab4339bbd5199eda59338279d012e20f", "score": "0.93123084", "text": "def valid_request?\n true\n end", "title": "" }, { "docid": "abdc40894375c619deea034e57181500", "score": "0.87378854", "text": "def valid_request?\n \n end", "title": "" }, { ...
eee621497b66a04cc71ec3926f174c77
Read a service Read a service
[ { "docid": "b12e10feb7dbb4b6eba87340d9113d30", "score": "0.0", "text": "def read_service_for_tenant_with_http_info(service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PolicyApi.read_service_for_tenant ...\"\n end\n # verify the ...
[ { "docid": "7061160cb98f17f33ef2e734f2795313", "score": "0.6753136", "text": "def service\n services.fetch(service_name)\n end", "title": "" }, { "docid": "9e3f3ac05d53fed4617f91897310890b", "score": "0.66918033", "text": "def read_service(service)\n vals = Hash.new\n host, por...
5d5d395924de2e8562a7baeef0cd1766
echo returns the input string i.e., if the passed input string is "hello", returns "hello"
[ { "docid": "d1e90fea81041a5ad934ba86038d228b", "score": "0.6332094", "text": "def echo hello\n return hello\nend", "title": "" } ]
[ { "docid": "a343ea1f398ab3bb706995a4bda077d0", "score": "0.8129564", "text": "def echo (string)\n string\n end", "title": "" }, { "docid": "8784d1ec78196e2b5142d05f6815b12e", "score": "0.8114601", "text": "def echo(string)\n string\n end", "title": "" }, { "docid"...
049da2faf9013df61fbefeaec6cb1c38
Creates a new Super for the rule currently being defined in the grammar. A block may be provided to specify semantic behavior (via ext).
[ { "docid": "764fd52fc70eebc357258c8b4ac2ffb5", "score": "0.68341017", "text": "def sup(&block)\n ext(Super.new, block)\n end", "title": "" } ]
[ { "docid": "2fad3244ba65871efbc44edddc476451", "score": "0.6821774", "text": "def sup(&block)\n ext(Super.new, block)\n end", "title": "" }, { "docid": "4d9776a1d374095d211d8920b714642f", "score": "0.59749925", "text": "def inherit(klass, &block)\n Class.new(klass, &...
52ceb63468a23fd1c77ac27182eadb05
test if the user can follow another user and create the relationship method will throw an exception if not possible
[ { "docid": "769736433c7085012ffa7838241c96f1", "score": "0.0", "text": "def test_follow_user\n assert_raise {users(:testUser_1).follow_user(users(:testUser2))}\n assert_raise {users(:testUser_1).follow_user(nil)}\n assert_raise {users(:testUser_1).follow_user(users(:testUser1))}\n assert_not...
[ { "docid": "b1225c0c8dd7827bb9570b584572bec3", "score": "0.77791286", "text": "def follow!(other_user)\n relationships.create!(followed_id:other_user.id)\n end", "title": "" }, { "docid": "9f6d7a23bdb6e4b06feb50e47a25e4cf", "score": "0.77761656", "text": "def follow!(other_user)\...
fa5ae9740f2d5ff1e6d84e85b9348992
Make sure newattr handles required features correctly.
[ { "docid": "92e2da8f7b153d49d1aebe860995c494", "score": "0.71580374", "text": "def test_newattr_and_required_features\n # Make a type with some features\n type = mktype\n type.feature :fone, \"Something\"\n type.feature :ftwo, \"Something else\"\n type.newparam(:name) {}\n\n # Make thr...
[ { "docid": "682c484f27307a37a962f834606c7b30", "score": "0.65315807", "text": "def check_for_old_attributes!\n unless node['build_essential'].nil?\n Chef::Log.warn <<-EOH\nnode['build_essential'] has been changed to node['build-essential'] to match the\ncookbook name and community standards....
1bf41563618a1457f717a80ad3c5c0fb
define the arguments that the user will input note there is no 'model' argument provided here. This may cause an issue.
[ { "docid": "501c25dc8013a7a5a48ef94db4225d19", "score": "0.0", "text": "def arguments(model = nil)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n # Future functionality\n # zone_titles = []\n # model.getThermalZones.each do |thermalZone|\n # zone_name = thermalZone.name.empty? ? ...
[ { "docid": "1ca1a7bc10c62ac56c28e41de24cddfe", "score": "0.75553864", "text": "def arguments(model = nil)\n args = OpenStudio::Measure::OSArgumentVector.new\n\t\n variable_name = OpenStudio::Measure::OSArgument.makeStringArgument(\"variable_name\",true)\n variable_name.setDisplayName(\"Enter Va...
4ee2174c6d0642c80b7d070beedbff03
All ObjectCodeObject attributes are obtained and returned
[ { "docid": "2c7c73434fd2d2557110c7a414237085", "score": "0.0", "text": "def get_random_object_code_object(object_sub_type_code='')\n get_kuali_business_object('KFS-COA', 'ObjectCode', \"universityFiscalYear=#{get_aft_parameter_value(ParameterConstants::CURRENT_FISCAL_YEAR)}&chartOfAccountsCode=#{get_...
[ { "docid": "f6b7256ff19b979aafb9b47f2a3d7aee", "score": "0.6530292", "text": "def available_selectable_object_attribute(business_object_code=nil)\n object_attributes =[]\n if business_object_code\n object_attributes = Irm::ObjectAttribute.selectable_column.query_by_status_code(\"ENABLED\").mu...
d32cbf8cc1ce214e848abe68fd0efde7
returns the intersection with another object
[ { "docid": "16b9de22d5c13eb83b2bcba3826b5abe", "score": "0.67951757", "text": "def intersect obj\n obj.intersectVerticalLine(self)\n end", "title": "" } ]
[ { "docid": "35d848cf018ac511e2632bea10c0265d", "score": "0.8296638", "text": "def __intersect__(object); object; end", "title": "" }, { "docid": "adaebc3ac9dd7f54e0745d7921209104", "score": "0.8240694", "text": "def __intersect__(object)\n object.__intersect_from_object__(...
920249648ba99fdfbc3de94c93d6f84d
GET /business_cards GET /business_cards.json
[ { "docid": "8ebb736983887008c4dc07082b8ca0b0", "score": "0.7524042", "text": "def index\n @business_cards = BusinessCard.all\n end", "title": "" } ]
[ { "docid": "3c5d761456c8c1dc36e25a735869382e", "score": "0.7093244", "text": "def show\n @bizcard = Bizcard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bizcard }\n end\n end", "title": "" }, { "docid": "84626643...
6c508a7c3385860cf45197caac874441
sources: [:file|:attachement] default is :file
[ { "docid": "27f13b97f6b3e3d75c836f2b419085d1", "score": "0.0", "text": "def rename_paperclip_file(model, new_filename, source=:file)\r\n unless paperclip_local_storage?\r\n config_warn \"Paperclip 'rename' requires using the local 'filesystem'. Not renaming from #{model.file_file_name.inspect} ...
[ { "docid": "3157c17c9a87b24113e376060ac444dc", "score": "0.74111235", "text": "def source_files; end", "title": "" }, { "docid": "5b9475e992be5b6404931eb5150edce9", "score": "0.73778105", "text": "def sources; end", "title": "" }, { "docid": "c6c670bedc5c721f5eabd3bf3bcde...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "a327a918e5b0d60f4cde4be780a2e8b7", "score": "0.0", "text": "def tablature_params\n params.permit(:name, :url, :description, :composer, :skill)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "...
c46db66703aaaca363d593ee7c77c93d
Checks upper sign restrictions for all x items (if index not supplied) or just ind restriction for given item
[ { "docid": "45caf619354008b5a159f7b32d2b6d45", "score": "0.6538582", "text": "def upper_sign_restriction_apply?(x = plan.x, ind = nil)\n return x.to_f.lte? up_restr[ind] if ind\n x.to_a.flatten.zip(up_restr).all? do |x_item, restr_item|\n x_item.to_f.lte? restr_item\n end\n end"...
[ { "docid": "326b1b4c91138d306d1b3ffe2af23510", "score": "0.5672331", "text": "def lower_sign_restriction_apply?(x = plan.x, ind = nil)\n return x.to_f.gte? low_restr[ind] if ind\n x.to_a.flatten.zip(low_restr).all? do |x_item, restr_item|\n x_item.to_f.gte? restr_item\n end\n en...
d69661c8bd4775ccec5c9c84f84ad13e
GET /weight_events GET /weight_events.json
[ { "docid": "78d6422e84ca88a83e26429511d3467c", "score": "0.7246602", "text": "def index\n @page = (params[:page].to_i > 0) ? params[:page].to_i : 1\n @per = (params[:per].to_i == 0) ? 100 : params[:per].to_i.clamp(1, 1000)\n\n @weight_events = WeightEvent.order(id: :desc).limit(@per).offset((@...
[ { "docid": "5d24a46f570324fd5a4c29144b000b42", "score": "0.6273222", "text": "def set_weight_event\n @weight_event = WeightEvent.find(params[:id])\n end", "title": "" }, { "docid": "68ed11088389be43b322d4f0dc75f7d6", "score": "0.6131962", "text": "def index\n #returns all ...
69009f929300654187b50f511fe0580e
NOTE: Facebook issues separate IDs to each application, so these can't be matched directly against Kitsu Facebook IDs, and need to be matched using the ids_for_business edge in the FB Graph API.
[ { "docid": "283c8d3c6e70c66169bc90f35ab97302", "score": "0.0", "text": "def facebook_id\n @data.dig('_auth_data_facebook', 'id')\n end", "title": "" } ]
[ { "docid": "6c836cecc837a9778d4b8a06a2b8d239", "score": "0.6327377", "text": "def applications\n results = @tropo_client.get(\"applications\")\n result_with_ids = []\n results.each do |app|\n result_with_ids << app.merge!({ :application_id => get_element(app.href) })\n end\n result_w...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2c8de512eeee574e356b42319165a946", "score": "0.0", "text": "def set_media_history\n @media_history = MediaHistory.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;...
87c143198eb382d7de7793413bd4b915
needs to return nil so minimax will work
[ { "docid": "ef415e26a317586f6a57dcd6110ec3e5", "score": "0.0", "text": "def winner?\n winner = (rows + columns + diagonals).find() do |sequence|\n sequence.first != :empty and sequence.all?{ |x| x == sequence.first }\n end\n winner ? winner.first : nil\n end", "title": "" } ]
[ { "docid": "1c79420d37308c4c7d9a289b1555cb2f", "score": "0.7483925", "text": "def minimize; end", "title": "" }, { "docid": "d409e9c1811ca85a80b664c377418e9a", "score": "0.74631363", "text": "def minimize\n end", "title": "" }, { "docid": "0800de86739c2c9a202e538f66b5a...
913cd28d8e07dc1bfd047081d0c0b585
GET /writes/1 GET /writes/1.json
[ { "docid": "e65d5deaa6e805915c1c58820db85294", "score": "0.0", "text": "def show\n @comments = @write.comments\n @comment = Comment.new\n end", "title": "" } ]
[ { "docid": "7704c1b17cab74f48680749540613bef", "score": "0.67102385", "text": "def write(*args)\n get(*args)\n end", "title": "" }, { "docid": "ec497af2ae50b2f1dece510d7e6c323c", "score": "0.668588", "text": "def index\n @writes = Write.all\n end", "title": "" }, { ...
88c63af9b01a8aaad07ac15af8c0feb1
POST /imes/d089hs POST /imes/d089hs.json
[ { "docid": "ed233d19bed5e66aff8cc2c7e6c384f1", "score": "0.64865583", "text": "def create\n @imes_d089h = Imes::D089h.new(imes_d089h_params)\n\n respond_to do |format|\n if @imes_d089h.save\n format.html { redirect_to @imes_d089h, notice: 'D089h was successfully created.' }\n fo...
[ { "docid": "7d77ff5d544b3539f60c355fd7b565b8", "score": "0.61983204", "text": "def create\n @imes_d888h = Imes::D888h.new(imes_d888h_params)\n\n respond_to do |format|\n if @imes_d888h.save\n format.html { redirect_to @imes_d888h, notice: 'D888h was successfully created.' }\n fo...
2b5aa0e0af297b65580689bb230220fd
GET /issue_resources/1 GET /issue_resources/1.json
[ { "docid": "6d0698e6d70eed95a458197a80f0d98d", "score": "0.772797", "text": "def show\n @issue_resource = IssueResource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @issue_resource }\n end\n end", "title": "" } ]
[ { "docid": "44042ea4ec1a4dae6507b48400117caa", "score": "0.71288764", "text": "def show\n @issue = Issue.find(params[:id])\n @resource = @issue\n @notes = @issue.notes\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @issue }\n end\n end", ...
bd4fefce30596fb13e58fd1a9bf9a95c
I worked on this challenge with: Sam Arkless, lasse sviland Our Refactored Solution
[ { "docid": "51e38aaa997cd203798c4b8e90360002", "score": "0.0", "text": "def bakery_num(num_of_people, fav_food) \n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1}\n food_qty = {\"pie\" => 0, \"cake\" => 0, \"cookie\" => 0}\n\n has_fave = false #creates new variable, has_fave, which is equal ...
[ { "docid": "af5213168e0ee82b120bec44b2735af5", "score": "0.66835123", "text": "def solution(a)\n size = 0\n value = -1\n (0..(a.length-1)).each do |i|\n if(size == 0)\n size = 1\n value = a[i]\n else\n if(value != a[i])\n size = size - 1\n else\n size = size + ...
5620c83ec0f2e751be4557936085ea09
Class accessor for the license builder
[ { "docid": "bf3b4ede90fc7dd892ce2d05b312adc0", "score": "0.78364754", "text": "def license_builder\n ManifestBuilder::LicenseBuilder\n end", "title": "" } ]
[ { "docid": "1d03ccf08ce27bae5ec5b4e3d3680809", "score": "0.7683413", "text": "def license\n return @license\n end", "title": "" }, { "docid": "7ec3449682ef5d3a1c27c0213773ba5f", "score": "0.74736965", "text": "def license\n read_property 'License'\n ...
62dbb76f0665b3682adc340d1aa8febf
Get a particular service attachment. Returns detailed Attachment information for a given service attachment.
[ { "docid": "4e9fb0b8e1ce9f2f4df556b4ef650e96", "score": "0.73098195", "text": "def get_service_attachment_with_http_info(service_attachment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.get_service_attachment ...\"\n end\n ...
[ { "docid": "eec928f02abeeaa0fb9c7382885391ee", "score": "0.7943766", "text": "def get_service_attachment(service_attachment_id, opts = {})\n data, _status_code, _headers = get_service_attachment_with_http_info(service_attachment_id, opts)\n data\n end", "title": "" }, { "docid":...
7dc8d8734879209405b71a90311cb1a8
Return the next sequence ID
[ { "docid": "25e26a9a31fc50a70a22e147f21c5063", "score": "0.8347065", "text": "def next_seq_id\n @tx_seq_id += 1\n end", "title": "" } ]
[ { "docid": "4a25a894a4378ad4eb27a94f5f336c03", "score": "0.81901276", "text": "def next_sequence\n @sequence.to_i + 1\n end", "title": "" }, { "docid": "28fb1254a716aec95344d5c280b3b5f9", "score": "0.8094886", "text": "def next_id\n id = @next_id\n @next_id += 1\n ...
482d5abf0a2a3cce034323fd422888c9
method to determine the raid type
[ { "docid": "38ebcedd0c4b101f70c3d854b59ed3b1", "score": "0.7657814", "text": "def getRaidType\n\t#begin exception handling for method\n\tbegin\n #tries hpacucli command and cleans the output of leading/trailing whitelines\n #and empty elements\n @@raidTypeArray = `sudo hpacucli ctrl...
[ { "docid": "27eccd53398d1f19814a07a7a29cd4bb", "score": "0.787869", "text": "def getRaidType\n require \"CheckRaidType\"\n raidType = CheckRaidType.new\n\treturn raidType.getRaidType\n end", "title": "" }, { "docid": "7891951b09a78b00e9e4f1020270632e", "score": "0.685526...
202a2544e24fe015ff3545358889bdf4
verify_file > true or false Verifies if input or output file matches the provided MD5 Hash
[ { "docid": "77af61a20c4895ea2beb4a0490c5bc1c", "score": "0.7086279", "text": "def verify_file(mode, header_hash)\n # Select mode\n case mode\n when :IN\n hash_hex = header_hash['OH'].dup\n file_handle = open_in_file @file_in_path\n file_handle.seek...
[ { "docid": "a824d76c3decd89920ba0539f9952cbc", "score": "0.7232748", "text": "def verify_checksum(filename)\n if options[:sha256]\n verify_sha256_hash(filename, options[:sha256])\n elsif options[:sha1]\n verify_sha1_hash(filename, options[:sha1])\n end\n end",...
2306f4603b8b51e702e502b228559b76
Parse the tokens using reverse polish notation and return the whole algorithm corrected in a way we can easily evaluate over
[ { "docid": "ddf84625c6fb99f97a5b258e004293f4", "score": "0.5988622", "text": "def parse()\n @stack = []\n @rpn = []\n\n @tokens.each do |symbol|\n shunt(symbol)\n end\n\n return @rpn.concat(@stack.reverse)\n end", "title": "" } ]
[ { "docid": "ab24da96dc0d558b7f6ac960dbb7dc9e", "score": "0.63108325", "text": "def parse(tokens)\n working = parse_parens(tokens)\n fail \"Something broke: len = #{working.length}\" if (working.length % 2) == 0\n working = parse_ops(working, /^d$/) if working.length > 1\n fail \"Something br...
4b03716886dd16bb64efa840f9919a04
CALL THIS METHOD FROM FRONT END
[ { "docid": "ac7c95f12a6242135fe91ca6402c56a1", "score": "0.0", "text": "def read_message\n self.update(read: true)\n end", "title": "" } ]
[ { "docid": "e6d321f827333c13ccd774b53e6e0e1c", "score": "0.6584359", "text": "def back; end", "title": "" }, { "docid": "cefa636d42b0cae13f1b9c8d69e7515a", "score": "0.6526856", "text": "def call\r\n end", "title": "" }, { "docid": "462f660db193e8894824ce01a14e88fd",...
87901932c19ed3e732848b322fa89ee0
GET /consumables/1 or /consumables/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "06277cba2760234ac1d06f3de5ed69a9", "score": "0.6278811", "text": "def index\n @consumables = Consumable.all\n end", "title": "" }, { "docid": "79ec36ac425286888bc7ac5ff1ed2bc6", "score": "0.6138351", "text": "def index\n @concursos = Concurso.all\n\n respond_to ...
9f2ef3ca2da42e7ab5d29210df406747
Send semminder after no activity about 2 days
[ { "docid": "a6ff71fddb9019e6c4465b9b047bd2b3", "score": "0.5320241", "text": "def send_reminder_no_activity(options)\n mailer_content = options['mailer_content']\n MemberMailer.send_reminder_no_activity(mailer_content).deliver if mailer_content.present?\n end", "title": "" } ]
[ { "docid": "6c56b84e53aac9627b650520f7808ed1", "score": "0.6545573", "text": "def reminder_sent\n end", "title": "" }, { "docid": "d1e1c4f7a0c8434f00817db6cb24106e", "score": "0.6415949", "text": "def send_reminder\r\n\t\tif Date.today == expiration_date - 1\r\n\t\t\tReminderMailer....
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0efd77822ea12bcca49b7d1e256fc268", "score": "0.0", "text": "def set_m_question\n @m_question = MQuestion.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.603186", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015241", "text": "def ...
5158d7c08e95f083c3c34898340b3829
Sends the given RCON packet to the server
[ { "docid": "2392095140f913b655269d22ab634207", "score": "0.5324763", "text": "def send(data_packet)\n connect if @socket.nil? || @socket.closed?\n\n super\n end", "title": "" } ]
[ { "docid": "4f528f160768f60783184ea2a1f2d0c8", "score": "0.6961842", "text": "def rcon_send(command); end", "title": "" }, { "docid": "65ffd9847f463687e8bbb3d87774ca3e", "score": "0.6033882", "text": "def rcon_send(command)\n send RCONGoldSrcRequest.new(command)\n end", "titl...
ca0d8a39407b642168489bfd2f252f11
Palauttaa vasemmal lapsen indeksin
[ { "docid": "818b83bff5b347ea45d1f5737f783bab", "score": "0.0", "text": "def child_index_left index\n [@d * index + 1, @heap.length-1].min\n end", "title": "" } ]
[ { "docid": "4b155bb04ece1e48ace44223cd5ac811", "score": "0.66039556", "text": "def huella\n\t\tindice1 = 0\n\t\t#dependiendo del vct de cada ingrediente, se le pone un indice\n\t\tif vct < 670\n\t\t\tindice1 = 1\n\t\t\t\n\t\telsif vct > 830\n\t\t\tindice1 = 3\n\t\telse \n\t\t\tindice1 = 2\n\t\tend \n\t\...
7d64a953d9a19834d1ed7203a3165be4
predefined method NOT to be removed
[ { "docid": "741a903814579be74cb7ed1b713f7e03", "score": "0.0", "text": "def check_valid(secret)\r\n\t@game.secret = secret\r\n\tsarray = []\r\n\ti = 0\r\n\tsecret.split('').each do|c| \r\n\t\tsarray[i] = c\r\n\t\ti=i+1\r\n\tend\r\nend", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.792181", "text": "def private; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", "score": "0.7842519", "text": "def custom; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", ...
79fb6d667c01d155bd11c6f00442a6be
Used to provide data for autocomplete on taxon field
[ { "docid": "5850fdd7fb62e9990adf6895d64a6831", "score": "0.6957864", "text": "def autocomplete\n @taxa = Taxon.order(:scientific_name).search(params[:term])\n list = @taxa.map {|t| Hash[id: t.id, label: t.label, value: t.scientific_name]}\n respond_to do |format|\n format.html { render :in...
[ { "docid": "0e01ebf5bc6b4085803502cdac1093b6", "score": "0.6582837", "text": "def call\n add_fields(leeds_taxi: true)\n end", "title": "" }, { "docid": "5f62c78add290c24b65d8205468365fe", "score": "0.6531084", "text": "def auto_complete_info(field)\r\n { \"id\" => id, \"la...
debf53aeebe786dce90072675fb3609e
Site Alerts Deletes all alerts from the site.
[ { "docid": "2df518f41f475de97d2f81e0c0e187f0", "score": "0.62168604", "text": "def delete_all_site_alerts_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SiteApi.delete_all_site_alerts ...\"\n end\n # verify the requi...
[ { "docid": "7876e6527e191d11e988dd89ec908e3f", "score": "0.7425809", "text": "def delete_all_site_alerts(id, opts = {})\n data, _status_code, _headers = delete_all_site_alerts_with_http_info(id, opts)\n data\n end", "title": "" }, { "docid": "8d62fc80edfaf6ffe9231b534b6836aa", ...
3c28dd54172d6b72c1b373fa93c07b85
Overrides the +version_attributes+ method to include label passed into the parent object, by way of a +commit_label+ attr_accessor.
[ { "docid": "5a0b91449910c742fd9ffcff801b2def", "score": "0.87120295", "text": "def version_attributes\n super.merge(:commit_label => commit_label)\n end", "title": "" } ]
[ { "docid": "1947933efc2ecef331057968e9903d96", "score": "0.61617595", "text": "def attributes_for_version\n versioned_attributes_from_object(self)\n end", "title": "" }, { "docid": "f14760f1485ea18387da3dea87d64c17", "score": "0.58723277", "text": "def version_attribu...
67083f1686b292770d312010580fa79e
Format floating point numbers according to Payson specifications; strings with commas as decimal separators.
[ { "docid": "eba0295b9310d44a7aa5943e5fe58742", "score": "0.64563453", "text": "def format_number(n)\n sprintf(\"%.2f\", n).gsub('.',',')\n end", "title": "" } ]
[ { "docid": "13c926b47f137ef8a36d3095bc4995b8", "score": "0.7440209", "text": "def format(comma = ',', decimal = '.')\n\t\tto_s.reverse.scan(/(?:-?\\d{1,3}(?:\\.\\d{1,3})?-?)/).map { |s| s.sub('.', decimal) }.join(comma).reverse\n\tend", "title": "" }, { "docid": "5aab676ca3856c0a99c3b8116b85...
41006e6880f7fa7f739ff757c1d8b012
Turn a path into string and symbol segments so it can be reconstructed, as in the case of a named route. ==== Parameters path:: The path to split into segments. ==== Returns Array:: The Symbol and String segments for the path.
[ { "docid": "c0548a68b9d92c209fc85fedf41d0760", "score": "0.7327001", "text": "def segments_from_path(path)\n # Remove leading ^ and trailing $ from each segment (left-overs from regexp joining)\n strip = proc { |str| str.gsub(/^\\^/, '').gsub(/\\$$/, '') }\n segments = []\n w...
[ { "docid": "0fc76a99dca9c37bab043c888e283998", "score": "0.7307869", "text": "def parse_path(path)\n path[1..-1].split(Const::UNESCAPED_SLASH).map do |s|\n arr = s.gsub(\n Const::ESCAPED_SLASH,\n Const::SLASH\n ).split(Const::UNESCAPED_COLON)\n rou...
53ea0881abc2509dad92b4cc871d64e1
POST /descriptions POST /descriptions.xml
[ { "docid": "659dac0b93d3f5946da8801123dad542", "score": "0.6343009", "text": "def create\n @description = Description.new(params[:description])\n \n respond_to do |format|\n if @description.save_and_index\n flash[:notice] = 'Description was successfully created.'\n format.htm...
[ { "docid": "61f0a0c9e123cc7d73a4aac8177f7102", "score": "0.6242366", "text": "def create\n @desc = Desc.new(params[:desc])\n\n respond_to do |format|\n if @desc.save\n format.html { redirect_to @desc, notice: 'Desc was successfully created.' }\n format.json { render json: @desc,...
09285eb3f1143d5451ebde1ffb77808e
Handles updating edge costs on the table
[ { "docid": "eada6473aecda1dcc7f3a7ffc0a74031", "score": "0.6301984", "text": "def handleEntryUpdate(destNode, newcost)\n\ti = $neighbors.index{|n| n.name == destNode}\n\t$neighbors[i].cost = newcost\n\t$local_change = 1\nend", "title": "" } ]
[ { "docid": "1a32bbdfd856dbd7ce16f0e464263cb2", "score": "0.6200763", "text": "def save_cost\n self.update_attribute(:sale_price,self.orders.sum(:sale_price).ceil)\n self.update_attribute(:final_price,self.orders.sum(:final_price).ceil)\n end", "title": "" }, { "docid": "a55e9666a8d51d...
5e15bc61eecd1fa91be29c6518bf5cce
returns true if given code matches number in DB
[ { "docid": "69d95237346eba49b6f96ae6cd9ca3b0", "score": "0.70874685", "text": "def verify_code?(number:, code:, user:)\n user.phones.find_by_number(number, code: code)\n end", "title": "" } ]
[ { "docid": "667f6974b5d97d7c02e14b5eb2d4ab6b", "score": "0.6908439", "text": "def active_code?(code)\n find :first, :conditions => {:code => code}\n end", "title": "" }, { "docid": "07d3f46b44cbe5e0056fc7e9f06ab0b2", "score": "0.6895805", "text": "def success?\n ...
9a98663e718f60b145ec6ab481c436d2
Allows user to enter street, zip or boro and get back results based on that info with options to either add to favorites, show favorites, new search or quit
[ { "docid": "87b7b8adb19901585672bfafe43638d0", "score": "0.73756075", "text": "def search_location\n prompt = TTY::Prompt.new\n options = %w(Enter_street Enter_zip Enter_boro Go_back Quit)\n search = prompt.select(\"Choose search method:\", options)\n\n case search\n when \"Enter_street\"...
[ { "docid": "7aea045d776cca4eed2185bbbb64ab17", "score": "0.6803658", "text": "def search\t\t\n\t\t @query = params[:query]\n\t\t @streets = Street.search @query, :page => params[:page], :per_page => 10\t\t\n\tend", "title": "" }, { "docid": "c581e4d98283609ebbe51654866a5aad", "score": "0...
e4116e07d5cc16e9f88e9826660c8fa3
PUT /devices/1 PUT /devices/1.xml
[ { "docid": "c43ddf431019577cd21bcc05ad18ac74", "score": "0.599442", "text": "def update\n @device = Device.find(params[:id])\n\n respond_to do |format|\n if @device.update_attributes(params[:device])\n flash[:notice] = 'Device was successfully updated.'\n format.html { redirect_...
[ { "docid": "608d2f58e93e2a844cba814b363df9ef", "score": "0.6375398", "text": "def update(id, name=\"Updated Name\", extension=0000)\n xml_req =\"{\\\"device\\\":{ \\\"id\\\":#{id},\\\"number\\\":\\\"#{number}\\\",\\\"name\\\":\\\"#{name}\\\",\\\"address\\\":\\\"#{address}\\\"}}\"\n \n \n request =...
586cc16a9bcd63b364a5291fea7e00c5
TODO default config_param :server_type, :string, :default => 'nonblocking'
[ { "docid": "5b81117e9cfd484617627f0ca81388c4", "score": "0.0", "text": "def initialize\n require 'zmq'\n super\n end", "title": "" } ]
[ { "docid": "c6ce6fcc04c155a6adab42980f373a1a", "score": "0.63660514", "text": "def configure_server(options = T.unsafe(nil)); end", "title": "" }, { "docid": "7b659c38b64fedec047e9c8f812835d5", "score": "0.6276633", "text": "def server_flags; end", "title": "" }, { "docid...
77696eb5074c6574d343101c4228f37a
find c's index in the Charset string, decrement the index by offset, and ensure it wraps around properly c is the current character from the encrypted message. offset is distance to travel backwards (perhaps wrapping around) in the given character set to decode the character
[ { "docid": "0cf63237fec424b616475de38efe4a45", "score": "0.6714542", "text": "def charmap( c, offset )\n start_index = Charset.index(c)\n finish_index = start_index - offset\n if finish_index < 0\n finish_index = Charset.length + finish_index\n end\n return Charset[finish_index]\nend", "titl...
[ { "docid": "30c077579d8ed1dc9464355b5821dc92", "score": "0.7174027", "text": "def ceasar_cipher_decrypt(text, offset)\n\n # Note this is my implementation and may differ from\n # others regarding the upper and lower bounds\n # of printable characters. If any ceasar cipher is used\n # in the ...