query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
737a14e2936c2f3266d901103e9d0df1
GET /customerpayments GET /customerpayments.xml
[ { "docid": "a9eed8b8940d79d290d8899946d715df", "score": "0.0", "text": "def index\n\n @companies = Company.where(user_id: current_user.id).order(\"name\")\n @path = 'customerpayments'\n @pagetitle = \"customerpayments\"\n \n respond_to do |format|\n format.html\n end\n end", ...
[ { "docid": "5d174f617111b832c9c64fb2cd4a0b72", "score": "0.66155714", "text": "def list params={}, extra=nil\n if self.url == \"customers\"\n url = \"/payment/v1/customers/\" + Epayco.apiKey + \"/\"\n elsif self.url == \"plan\"\n url = \"/recurring/v1/plans/\" + Epayco.ap...
385b2186704ff5e7f10f81f91b37a9dd
helper function to return a formatted date in views. function will return a formatted date depending on the presence of start_time and/or end_time
[ { "docid": "e589eece96708019df48f69d545e07bf", "score": "0.8085482", "text": "def formatted_date\n if !self.start_time.nil? && !self.end_time.nil?\n return self.date.strftime(\"%B %d, %Y\") + \" from \" + self.start_time.strftime(\"%I:%M%p\") + \" to \" + self.end_time.strftime(\"%I:%M%p\")\n ...
[ { "docid": "8161d29b4c9d94a7fd62bdf87c74ad87", "score": "0.80173373", "text": "def display_date\n if start_at or end_at\n display_date = \"// \"\n if start_at and end_at\n if start_at.month == end_at.month and start_at.year == end_at.year\n display_date << \"#{I18n.t('from_t...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5d299afd182a7ccde843a7efe58535b0", "score": "0.0", "text": "def setting_params\n params.require(:setting).permit(:overtime_hours_day, :overtime_hours_week, :break_length, :break_time, \n :work_start_time, :work_end_time, :work_time_tolerance, :week_start_day, :book_travel_time, :dist...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6981269", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6783559", "text": "def strong_params\n params.requi...
5f1be6753d1064635d4f3720289ca9a1
if we happen to be on an SSL page, go back to http
[ { "docid": "82401ba06897d87d475140dd61459c0d", "score": "0.0", "text": "def show\n if this_request_is_really_a_search\n do_the_search\n return\n end\n return redirect_to taxon_overview_path(params[:id]), :status => :moved_permanently\n end", "title": "" } ]
[ { "docid": "5f5adfb89bca2c21e4c04a94172dea61", "score": "0.80161655", "text": "def redirect_back_to_http\n redirect_to protocol: \"http://\", status: :moved_permanently if request.ssl?\n end", "title": "" }, { "docid": "2339e665d7b2f662c4f717cb3cc4aa8b", "score": "0.79509", "tex...
9b471d105e952ec55dc113366d01ed22
uploading to s3 is actually the slowest part if done serially. We apply a healthy dose of concurrency.
[ { "docid": "39d8c029bb0c6a687b29f4a0aa0385dd", "score": "0.775373", "text": "def upload_to_s3!\n s_time = Time.now\n\n # All the jpgs, which are in a _files/ dir, and subdirs of that.\n futures = []\n dir_path = Pathname.new(local_dzi_dir_path)\n # We get back full paths from FS...
[ { "docid": "deea4e6612438d6084fc84bc07c1c0c1", "score": "0.7437462", "text": "def queue_upload_to_s3(options = {})\n ZZ::ZZA.new.track_transaction(\"photo.upload.s3.start\", self.id)\n options[:priority] = self.work_priority\n ZZ::Async::S3Upload.enqueue( self.id, options )\n logger.debug(\"...
c38fd28cff63bc2785b83dd9f105e745
PUT /metrics/1 PUT /metrics/1.json
[ { "docid": "640777876329c77b5843c87831bf4ed7", "score": "0.68581665", "text": "def update\n @metric = Metric.find(params[:id])\n\n respond_to do |format|\n if @metric.update_attributes(params[:metric])\n format.html { redirect_to @metric, notice: 'Metric was successfully updated.' }\n ...
[ { "docid": "15c52c322f4ccb65e4f8e7eed5820e32", "score": "0.7176907", "text": "def update\n @metric = @idea.metrics.find(params[:id])\n\n if @metric.update_attributes(params[:metric])\n render json: { text: \"success\"}\n else\n render json: { text: \"fail\"}\n end\n end", "tit...
5c13d2cebbb9202bde0cbf2a58eb9049
sends the collected data to ushahidi/crowdmap
[ { "docid": "e7014e27444073295d76d0133169d5c8", "score": "0.0", "text": "def capture_data!(report)\n client = UshahidiClient.new\n log(\"about to post report #{report} using #{client}\") if DEBUG\n res = client.post_report(report)\n log(\"got this response from ushahidi: #{res}\") if DEBUG\n ...
[ { "docid": "ce1bd174cd7df3cdb498e5bd21364805", "score": "0.6083407", "text": "def index\n @data = Datum.all\n @time = Time.now.strftime(\"%H:%M %m-%d-%y \")\n \n @data.each do |data|\n data.gmaps = true\n data.update_attributes(:gmaps)\n end\n \n @json = Datum.all.to_gmaps...
2a9d0bfa3a5fb4c20fb0136f55448099
Create a new campaign sequence.
[ { "docid": "5f12bf4e07ce46a263d197263d6f224c", "score": "0.0", "text": "def post_outbound_sequences(body, opts = {})\n data, _status_code, _headers = post_outbound_sequences_with_http_info(body, opts)\n return data\n end", "title": "" } ]
[ { "docid": "b21c30c08b3477fe15366d1e513b43f0", "score": "0.6823883", "text": "def create\n @mail_sequence = MailSequence.new(params[:mail_sequence])\n\n respond_to do |format|\n if @mail_sequence.save\n format.html { redirect_to @mail_sequence.campaign, notice: 'Mail sequence was succe...
927cd2fa8717a691c0b899ef9102b366
Print a red error message to the console.
[ { "docid": "258269c0e6d3e97cf99dc741fbe608aa", "score": "0.6835694", "text": "def error(message, options = { })\n ::Guard::UI.error(color(message, ';31'), options)\n end", "title": "" } ]
[ { "docid": "b9366fae5c65c778d27bc9129484e44e", "score": "0.83471924", "text": "def error(message)\n message = message.red unless message.color?\n puts(stderr, message)\n end", "title": "" }, { "docid": "ed9d9e00564b80cc2736630c6e2ed534", "score": "0.8316429", "text": "de...
99c4c248fd12c26a6d6265cd26940d6b
Recalculate sums by issuer for display in the graphs
[ { "docid": "058a354e4123f1638ca39469cb19433f", "score": "0.79604083", "text": "def calculate_sums_by_issuer\n sold_issuances, proposed_issuances = format_sold_and_proposed_issuances(\n params[:issuers],\n params[:debt_filters]\n )\n\n data = build_chart_array_data(...
[ { "docid": "57917d1ce948c507e79580f6262770e6", "score": "0.6500496", "text": "def update_totals\n self.pretax_amount = items.sum(:pretax_amount)\n self.amount = items.sum(:amount)\n end", "title": "" }, { "docid": "e1278495f062d3cd5409a2d0bd0c891b", "score": "0.6326795", "text...
a3194b1baceff88c14ec162618b61d21
Create a new group object
[ { "docid": "9f2de0a4ecb70b545f268a65417b827d", "score": "0.7524201", "text": "def create\n @group = Group.new(group_params)\n\n respond_to do |format|\n if @group.save\n format.json { render json: @group, status: :created }\n else\n format.json { ren...
[ { "docid": "9fb7c09902e1c2ac059809890e26f08c", "score": "0.8384932", "text": "def createGroup\n call :createGroup\n end", "title": "" }, { "docid": "72d1f98dfafa353fd5f784d3629d7698", "score": "0.82593834", "text": "def create_group(attributes)\n BrickFTP::API::Group.cre...
0118bf089ad1b5bbadc8cf94bfe505fc
Determines whether it's past the last posting time for today.
[ { "docid": "bf353c863b5c80c3b451c3b4408d15ac", "score": "0.65715706", "text": "def ended_for_today?\n now >= end_of_day_today\n end", "title": "" } ]
[ { "docid": "c96c73b7110265e695dc6ea3d425c3e0", "score": "0.76386994", "text": "def past?\n\t\t\t\treturn self < Time.now\n\t\t\tend", "title": "" }, { "docid": "9e98337f9fe0a915676450c2ee830450", "score": "0.75315976", "text": "def past?\r\n self < ::Date.current\r\n ...
f377be7fbe6ace95009050c297ca21b2
GET /posts GET /posts.xml
[ { "docid": "858ac5c2086c49ae9ffe832d9c31fb73", "score": "0.0", "text": "def index\n self.current_objects = current_model.find(:all)\n\n respond_to do |format|\n format.html { render_resource :index }# index.html.erb\n format.xml { render :xml => self.current_objects }\n end\n end", ...
[ { "docid": "96353a9632432f29bdb1830a6be90489", "score": "0.72866184", "text": "def index\n @posts = Post.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "title": "" }, { "docid": "f2ee44b73f3580e58...
1a2c7b291aa382136571396c593d2878
Get the total depth of a given fragment or operation
[ { "docid": "797ddaea1e96a3569e21fbcb02c6c50d", "score": "0.6945872", "text": "def get_total_depth(scope_name, depths, fragments)\n own_fragments = fragments[scope_name]\n depths[scope_name] + own_fragments.reduce(0) { |memo, frag_name| memo + get_total_depth(frag_name, depths, fragments) }...
[ { "docid": "ac29bdd75670dd99809ce019fa69fe13", "score": "0.7367739", "text": "def depth\n @traversal_position.depth\n end", "title": "" }, { "docid": "77254b68a311e3f71e623479a2ae4e91", "score": "0.7303574", "text": "def depth\n if empty?\n 0\n else\n if @...
5f922dfb7f6c44d13db1709634f6e5c9
DELETE /user_blogs/1 DELETE /user_blogs/1.json
[ { "docid": "56aa9cf130bba442027d24d83488f0e4", "score": "0.6582269", "text": "def destroy\n @user_blog = UserBlog.find(params[:id])\n @post = @user_blog.posts.where(user_blog_id: @user_blog.id)\n @post.each do |post|\n @comment = post.comments.where(post_id: post.id)\n @comment.each d...
[ { "docid": "0452ca8e78b9fc20048f6dde7d87d25e", "score": "0.7640488", "text": "def destroy\n @user_blog = UserBlog.find(params[:id])\n @user_blog.destroy\n\n respond_to do |format|\n format.html { redirect_to user_blogs_url }\n format.json { head :no_content }\n end\n end", "ti...
b4a6024086739e08de9e88e300389360
Mutexmarshal_load marshal_load(p1) for marshalling mutexes and condvars
[ { "docid": "3a7c712bec9103126dbf0e6d3a4c9180", "score": "0.5348813", "text": "def marshal_load(arg0)\n end", "title": "" } ]
[ { "docid": "a7530140ce456866f2629882b51ee275", "score": "0.57415056", "text": "def marshal_dump\n raise \"Unable to dump locked mutex\" unless @waiters.empty?\n 1\n end", "title": "" }, { "docid": "82a13b068392b8d4d7c5aba23ae6049c", "score": "0.54317933", "text": "def load_mut...
2584076780edf7ec0583079cbd725f06
Init method Put here all the code needed to initialize our plasmoid
[ { "docid": "53072fcf2d6ef0254c3c30580d37e96f", "score": "0.0", "text": "def init\n setMinimumPollingInterval(1000)\n\n begin\n @ups = Ups.new(host='localhost', ups='myups')\n end\n\n updateStaticData('UPSLoad', '%', 0, 100, 'Ups Load')\n\n updateStaticData('UPSBatteryChar...
[ { "docid": "adfd75599e9fe9addd5ecc48ad25ab2d", "score": "0.73086625", "text": "def initialize\n init\n end", "title": "" }, { "docid": "dc90d29d71dcbecfbdd1751b07b0b039", "score": "0.73064107", "text": "def init\n end", "title": "" }, { "docid": "dc90d29d71dcbe...
a7f78a26e6ca5c5a39eebef156e484b3
I just discovered you could do this.
[ { "docid": "fb5d34757edbcb13b2c90966e1e59e41", "score": "0.0", "text": "def decode(numbers, key)\n result = \"\"\n numbers.each_with_index do |n, i|\n result += (n ^ key[i % 3].ord).chr\n end\n result\nend", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.71742195", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.65665185", "text": "def probers; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a",...
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "11da0e4ef25e6def87ce2ebfea8a1527", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListFirewallsResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "c4ca32683e8ce75eb6a187d63df8fa77", "score": "0.76639634", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6f7a7d9be674ad4cf17d6743eb1f7836", "scor...
4e9874292eeaf9707ab3697d7a01102a
Determine if a player is currently in check. Expects a boolean value to represent whos turn it currently is true = black, white = false
[ { "docid": "aef15b4f43e906aae861827e2947d604", "score": "0.6963472", "text": "def player_in_check?(is_black)\n # Grabs active players king\n king = self.pieces.find_by(type: 'King', is_black: is_black)\n\n # Grab all opponent pieces\n opponent_pieces = self.pieces.active.where(is_black: !is_...
[ { "docid": "1f7e8a6ab77943ca83bc242c85864451", "score": "0.7675708", "text": "def check_check\n if player_on_turn == \"white\" #player one is player on turn\n return true if find_king(\"white\").attacked_by_black == true\n elsif player_on_turn == \"black\"\n return true if find_king(\"bl...
fd58daa09c61ca0bfcab62dd4174ba43
line method: customers in order of their place in line
[ { "docid": "1538bb8bbbf39f63cf162e1bd86f6629", "score": "0.6351836", "text": "def line(deli)\n if deli.empty?\n puts \"The line is currently empty.\"\n else\n line_order = deli.map.with_index(1) do |name, index|\n \"#{index}. #{name}\"\n end.join(\" \")\n puts \"The line is currentl...
[ { "docid": "b1b6130f4fa2a951b75658ff9244389d", "score": "0.7436957", "text": "def line(customers)\n # initiate line_info prior to finding the info\n line_info = \"\"\n\n ## find out if there's actually a customer\n # if not, line info should reflect that\n # Otherwise, line info should list custome...
3f89202537129541936b95bea9fefe0e
Removes a User from all Channels from the ChannelList. Returning a Set of Channels in which the User was.
[ { "docid": "2f252add86549f2896159c065ed681b1", "score": "0.7093117", "text": "def remove_user(nick)\n @mutex.synchronize do\n channels = Set.new\n\n @channels.each do |channel|\n if channel.remove_user(nick)\n channels << channel\n end\n end\n\n ...
[ { "docid": "c987b02e647f917770a564c3e2d2ac41", "score": "0.6489384", "text": "def admin_usergroups_removeChannels(options = {})\n raise ArgumentError, 'Required arguments :channel_ids missing' if options[:channel_ids].nil?\n raise ArgumentError, 'Required arguments :usergroup_id mi...
b48625fe97b24fe5000cec00ecfeeacd
Set tags for a storage account
[ { "docid": "fee79731419e97fe5635ca4f782bb136", "score": "0.7491517", "text": "def update_tags_of_storage_account(name, tags)\n url = rest_api_url(REST_API_PROVIDER_STORAGE, REST_API_STORAGE_ACCOUNTS, name: name)\n request_body = {\n tags: tags\n }\n http_patch(url, request_bod...
[ { "docid": "19fbdd263b640143d30e9990e334286d", "score": "0.6565323", "text": "def set_tags(tags)\n @tags.update(tags)\n end", "title": "" }, { "docid": "9e5e6295d948fbd12917afe6ba241b0b", "score": "0.65292716", "text": "def set_tag(tag_name, tag_value)\n end_point_url = ...
7d7a2ea98c022e601afc5d7eab32c8ec
Returns the country specific portion of locale as code symbol E.g. :deDE I18n.locale_country_code > :DE :en I18n.locale_country_code > nil :"itIT" I18n.locale_country_code > :IT "de_DE" I18n.locale_country_code > :DE
[ { "docid": "bc82330706990576a876625dd1500f70", "score": "0.7084435", "text": "def locale_country(locale = nil)\n (locale || I18n.locale).to_s.match(/[_-](\\w{2})$/) ? $1.to_sym : nil\n end", "title": "" } ]
[ { "docid": "afd900e5ff7bdaf25ad54e9ae39b6129", "score": "0.75378704", "text": "def country_code_alpha2\n country_code == 'EL' ? 'GR' : country_code\n end", "title": "" }, { "docid": "dea843e29bb592cb0da636add606ff93", "score": "0.75203794", "text": "def country_code\n cc =...
f21f29aa43323c5d37e732003d99d7f5
enum value "map" is not permitted due to conflict with ActiveRecord map method so we use interactive_map internally.
[ { "docid": "1517034814000b700a73bc89fc7ffc5c", "score": "0.6426627", "text": "def transform_map_to_interactive_map(data)\n data[:nature] = \"interactive_map\" if data[:nature] == \"map\"\n data = transform_map_to_interactive_map_in_card(data)\n data = transform_map_to_interactive_map_in_l...
[ { "docid": "5f7ba8778bde671365fc29e14ad43c07", "score": "0.61726236", "text": "def visit_map(binding_type)\n raise NotImplementedError\n end", "title": "" }, { "docid": "0acf57fbe5070f23e881a8b7405bf0ae", "score": "0.6113605", "text": "def my_map\n end", "title...
0413e58ec2590a7bb06c843ef2d28e30
Get the value of cells in range.
[ { "docid": "ad302aa77d37b56a314a756d6edb6bfc", "score": "0.7454736", "text": "def get_worksheet_cells_range_value( get_worksheet_cells_range_value_request, opts = {})\n\n data, _status_code, _headers = get_worksheet_cells_range_value_request.create_http_request(@api_client,opts )\n return da...
[ { "docid": "caaebe0fd26d49b54a8be73599efc34f", "score": "0.71168345", "text": "def get_CellValue()\n \t return @outputs[\"CellValue\"]\n \tend", "title": "" }, { "docid": "741eaadaf00f9ae963ccc5bab78f8f3d", "score": "0.69820803", "text": "def get_range(p_range)\n\t\t\t\t@s...
770d6e11922b3f313d59f27a63511edc
PATCH/PUT /flowers/1 PATCH/PUT /flowers/1.json
[ { "docid": "9ec57f69f3b8e361d753f6eb3e03152a", "score": "0.5791429", "text": "def update\n respond_to do |format|\n if @flower.update(flower_params)\n format.html { redirect_to @flower, notice: 'Flower was successfully updated.' }\n format.json { render :show, status: :ok, location...
[ { "docid": "e9ef16a0fbdf45f55fd45ba2fdbe9676", "score": "0.63018876", "text": "def update\n @spoofer = Spoofer.find(params[:id])\n\n respond_to do |format|\n if @spoofer.update_attributes(params[:spoofer])\n format.html { redirect_to @spoofer, notice: 'Spoofer was successfully updated....
505a6ffb4343a3ac295de460cbf79c3f
Redirect to another page.
[ { "docid": "ab2187e56eb37943e730636abe5a2352", "score": "0.0", "text": "def formRedirect(url)\n {:redirect=>url}.to_json\n end", "title": "" } ]
[ { "docid": "b1ddb8c414db9047e77ec57af1dc03bb", "score": "0.7603466", "text": "def redirect_to(url)\n prepare_render_or_redirect\n\n @res.status = 302\n @res[\"Location\"] = url\n\n nil\n end", "title": "" }, { "docid": "b1fe44363db1331a344e92a4b01732a6", "score": "0.7566783"...
9fa565d04b4e1b1a81329cc39c3d1c5e
GET /services/1 GET /services/1.json
[ { "docid": "931925552ec4756b31a3408530c6d802", "score": "0.0", "text": "def show\n @service = Service.find(params[:id])\n @addresses = @service.addresses_services\n @a1 = Address.find(@addresses[0][:address_id])\n @a2 = Address.find(@addresses[1][:address_id])\n @status = Status.find(@ser...
[ { "docid": "eeaeaa12cf77a12f32bab1ca39002ccb", "score": "0.7525181", "text": "def index\n endpoint(get(services_url).body)\n end", "title": "" }, { "docid": "09df2be842a22a8bf2c06dda5c18923d", "score": "0.74776435", "text": "def service(id)\n request :get, \"/services/#{id...
977e189fb2fc86dacfef73398108e02f
Function for Changing Access Time, Modified Time and Created Time of Files Supplied in an Array The files have to be in %WinDir%\System32 folder.
[ { "docid": "471f2eec8e56e6e89df0b413c9babe9d", "score": "0.6065682", "text": "def chmace(session,cmds)\n\twindir = ''\n\twindrtmp = \"\"\n\tprint_status(\"Changing Access Time, Modified Time and Created Time of Files Used\")\n\twindir = session.fs.file.expand_path(\"%WinDir%\")\n\tcmds.each do |c|\n\t\t...
[ { "docid": "06baaf70c9dec2299c266a649c96eac1", "score": "0.60746145", "text": "def update_modification_time(file)\n MTIMES[file] = File.mtime(file)\n end", "title": "" }, { "docid": "b8383f841c8a87c38b81329537496e9a", "score": "0.5999147", "text": "def set_modify_time(new_mod...
3d55609f1403b0eed0c31ca486e45097
Finds O pieces on a board and outputs total score for each O found. 3 points per O piece PreCondition: Valid board in the form of a 2D array PostCondition: No data change. Returns unique data value: total
[ { "docid": "6e6a2928661ad774e9b1372d156a20ad", "score": "0.7083766", "text": "def find_pieces(board)\n\t\tx = (board.length) - 2\n\t\ty = (board[0].length) - 2\n\t\ttotal = 0\n\n\t\tfor start_x in 1...x\n\t\t\tfor start_y in 1...y\n\t\t\t\tif find_piece_helper(start_x, start_y, board, 0) == 1\n\t\t\t\t\...
[ { "docid": "c7ad0210b9507f04fa644944564a35c1", "score": "0.66740423", "text": "def get_score\n empty_squares = [] # lists of empty squares we have already counted\n score = [0, 0] # [score of black, score of white]\n\n #for each stone of the board\n @board.board_of_stone.each_with_in...
0154a4b50b8a380d0357f64cd5b38cfd
Fake a good RC
[ { "docid": "beca831fb21acdbebfd098845b291841", "score": "0.0", "text": "def good_rc(output = '', args = {})\n @rc = 0\n @output = output\n @error_msg = args[:error_msg]\n self\n end", "title": "" } ]
[ { "docid": "dff37ea0d68b9c86bab1ceb2dfb658a9", "score": "0.6098725", "text": "def rc; end", "title": "" }, { "docid": "a9afec2fa8ae3baa9a67bcf0d739efc5", "score": "0.5804274", "text": "def test_client\n TflApi::Client.new(app_id: 12345, app_key: 6789, host: 'https://somehost', log...
ea78fde04c0c8b3705c73f45ba06ad84
Sets the mdmEnrolledCount property value. The number of devices enrolled in MDM
[ { "docid": "033cfbbc696ff3aa5a6fcb37eea83742", "score": "0.85643697", "text": "def mdm_enrolled_count=(value)\n @mdm_enrolled_count = value\n end", "title": "" } ]
[ { "docid": "5e6f34b4380d7d500b1ca1c1efe34820", "score": "0.7453398", "text": "def mdm_enrolled_count\n return @mdm_enrolled_count\n end", "title": "" }, { "docid": "34248d284f9286febcfe3a22132e8f8b", "score": "0.74456954", "text": "def enrolled_device_count=...
e8333984870fc512b610fbb4167b871f
asks for song name or track number and returns song name
[ { "docid": "f8dbd96c4fa73cb9ebbf98d632420076", "score": "0.6718387", "text": "def play(songs)\n puts \"Please enter a song name or number:\"\n input = gets.chomp\n if songs.include?(input)\n puts input\n elsif input.to_i && input.to_i.between?(1, songs.count)\n puts \"Playing #{songs[input.to...
[ { "docid": "2cff855b807613dcf0bdb5c08a48d7ab", "score": "0.7411492", "text": "def play_song\n puts \"Which song number would you like to play?\"\n songNumber = gets.strip\n \n #get song names\n songNames = []\n Song.all.each {|songinstance|\n songNames << songinstance.name\n }\...
cca95566b5eb1e8c828c2e63022ed07f
returns current SSO method object according to session nil is returned if nothing was found or invalid method is stored
[ { "docid": "69a8b4d3bad2a104b73da9f3126d4a49", "score": "0.8261392", "text": "def get_sso_method\n if (sso_method_class = session[:sso_method])\n sso_method_class.constantize.new(self)\n end\n rescue NameError\n logger.error \"Unknown SSO method #{sso_method_class}\"\n nil\n end", ...
[ { "docid": "de094e4456c1caca16cfa673b66f6436", "score": "0.6385763", "text": "def session_authentication_method(sym=nil)\n @session_authentication_method = sym if sym\n @session_authentication_method\n end", "title": "" }, { "docid": "78a5e6a497b78ccf14be51bdb923b583", ...
966c0aa224dbadbb3d4d35bb3c0e43c6
DELETE /share_operations/1 DELETE /share_operations/1.json
[ { "docid": "86f1b40c5dcdf94a7012de4cdd5bfadd", "score": "0.7648407", "text": "def destroy\n @share_operation.destroy\n respond_to do |format|\n format.html { redirect_to share_operations_url, notice: 'Share operation was successfully destroyed.' }\n format.json { head :no_content }\n ...
[ { "docid": "13c25a5745ab0986f0b7c4e095e11a33", "score": "0.70334595", "text": "def destroy\n @share.destroy\n respond_to do |format|\n format.html { redirect_to shares_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "13c25a5745ab0986f0b7c4...
94853857dd771e9dca4c447ca84af17b
POST /gibiers POST /gibiers.json
[ { "docid": "b8aab3e0eb6073fc5b087975bfdc4e01", "score": "0.7239088", "text": "def create\n @gibier = Gibier.new(gibier_params)\n\n respond_to do |format|\n if @gibier.save\n format.html { redirect_to @gibier, notice: 'Gibier was successfully created.' }\n format.json { render ac...
[ { "docid": "a6050bcceb6a07e2758aa7e0d0eb7ff4", "score": "0.6638939", "text": "def create\n @type_gibier = TypeGibier.new(type_gibier_params)\n\n respond_to do |format|\n if @type_gibier.save\n format.html { redirect_to @type_gibier, notice: 'Type gibier was successfully created.' }\n ...
74473e5231e396df7c55f4686cc8ff1e
PATCH/PUT /permisos/1 PATCH/PUT /permisos/1.json
[ { "docid": "fb39904b2ac139ccb6b868b457f70261", "score": "0.5960709", "text": "def update\n respond_to do |format|\n if @permiso.update(permiso_params)\n format.html { redirect_to @permiso, notice: 'Permisos actualizados exitosamente.' }\n format.json { head :no_content }\n els...
[ { "docid": "b4cc3ee2207b39abaf779a6078bbaf3a", "score": "0.6068696", "text": "def patch\n PATCH\n end", "title": "" }, { "docid": "b4cc3ee2207b39abaf779a6078bbaf3a", "score": "0.6068696", "text": "def patch\n PATCH\n end", "title": "" }, { "docid": "fa1620...
60dbd6cc9b821b94dddad54e6d079d39
Start Guard by initialize the defined Guards and watch the file system. This is the default task, so calling `guard` is the same as calling `guard start`.
[ { "docid": "76be9a0715e49ed91e2e7a4eef2f9fa5", "score": "0.7808307", "text": "def start\n ::Guard.start(options)\n end", "title": "" } ]
[ { "docid": "6a68705c3209c5ecd73c9d4fe9880ab2", "score": "0.75818473", "text": "def start\r\n ::Guard.start(options)\r\n end", "title": "" }, { "docid": "6a815d934274ab8842f88771860010eb", "score": "0.7396192", "text": "def start\n return if ENV[\"GUARD_ENV\"] == 'test'\n...
707e53afc9f0be5736cc1fa09e419228
DELETE /purchases/1 DELETE /purchases/1.json
[ { "docid": "96a4280e3a75e21a15fc70cc46c24e17", "score": "0.6664133", "text": "def destroy\n#py comment 5 lines belows\n# @purchase.destroy\n# respond_to do |format|\n# format.html { redirect_to purchases_url }\n# format.json { head :no_content }\n# end\n\n#py add 2 lines below \n ...
[ { "docid": "05b276ce572f0abf782c76c0270e06fd", "score": "0.7556757", "text": "def destroy\n @purchase = Purchase.find(params[:id])\n @purchase.destroy\n\n respond_to do |format|\n format.html { redirect_to purchases_url }\n format.json { head :no_content }\n end\n end", "title...
0be02594ad9404396335e453728dfff8
copy across the credit card details
[ { "docid": "6a52ddcdc9381bbc1c312a4dbc84a61b", "score": "0.6612845", "text": "def populate_from_cc(new_credit_card)\n #clear derived fields\n self.display_number=nil\n self.expiration_date=nil\n\n REMOTE_FIELDS.each do |f|\n #double rescue so it will read from hashes or record...
[ { "docid": "bb875f7f725419279ffc17004eb2f15f", "score": "0.67929405", "text": "def get_created_credit_card(data)\n {\n primaryAccountNumber: (data['primary_number'] || data[:primary_number]),\n expirationMonth: (data['expiration_month'] || data[:expiration_month]),\n expiration...
56f3bb82aa3d547ccff31ac6de15b3b0
Returns an array of filenames
[ { "docid": "2e0e0e7b031297b19fb5f6b675706eb0", "score": "0.69546676", "text": "def to_a\n @file_list.map { |movie| movie.filename }\n end", "title": "" } ]
[ { "docid": "6b8283665ba9fa656933f33d0e802a60", "score": "0.84178686", "text": "def filenames\n map(&:filename).map(&:to_s)\n end", "title": "" }, { "docid": "9d2b0f1edd53a1a4674e123802750969", "score": "0.8407961", "text": "def filenames\n map(&:filename)\n end", ...
fe1313d3ad41ab31df691a61c152bb0b
Replace this with your real tests.
[ { "docid": "6c921a7a98d24ee651354746509b19c4", "score": "0.0", "text": "def test_signin_with_invalid_user\n post :signin, :user => {:username => \"wrong\", :password => \"wrong\" }\n assert_response :success\n assert_equal \"Your username or password was invalid. Please try again.\", flash[:not...
[ { "docid": "35a51327dd0b5c9a884bb0e6f7155697", "score": "0.7446459", "text": "def testing\n # ...\n end", "title": "" }, { "docid": "1a6186064d8218f9aa0c8b82bcc4fdae", "score": "0.6956364", "text": "def __dummy_test__\n end", "title": "" }, { "docid": "8fbc...
64447ff562930116681ea8ecb667b6ba
This method reads an FTP response based on FTP continuation stuff
[ { "docid": "e2db3e6e4d409b1a0ba2fb4b9efb444c", "score": "0.67941004", "text": "def recv_ftp_resp(nsock = self.sock)\n found_end = false\n resp = \"\"\n left = \"\"\n if !@ftpbuff.empty?\n left << @ftpbuff\n @ftpbuff = \"\"\n end\n while true\n data = nsock.get_once(-1, f...
[ { "docid": "208350a4b2d1e528d88aa39e93d4c500", "score": "0.632188", "text": "def receive_response\r\n @file_read.readline\r\n end", "title": "" }, { "docid": "985eae4a4b6bf308d332abad6e97e252", "score": "0.60388756", "text": "def recv_response # :nodoc:\n stat = ''\n wh...
e772f76f152a58a4cea3fc784c45bd89
Servers are counted from "1", not zero!
[ { "docid": "9affebe8bf87155b0f7cf72def1fcceb", "score": "0.0", "text": "def thin_pid_for_server(number)\n thin_pid.sub(/\\.pid$/, \".#{thin_socket ? number - 1 : thin_port_for_server(number)}.pid\")\n end", "title": "" } ]
[ { "docid": "dec7ee9706ee6189672ce74c54cf1fa6", "score": "0.74693227", "text": "def count\n servers.length\n end", "title": "" }, { "docid": "c63a97f472a00c5dfd33f68a04112149", "score": "0.70849943", "text": "def servers_count\n response.headers['Cache-Control'] = '...
d3a8a2f4b09b6295352dde5c27480cc8
=> 1 Experiment We should be able to do similar thing with a method
[ { "docid": "801323d593c4ee01abc15012f4868897", "score": "0.0", "text": "def g; 1; end", "title": "" } ]
[ { "docid": "38acac325988b30fa045834ae1a38d1c", "score": "0.671975", "text": "def profile_examples=(_arg0); end", "title": "" }, { "docid": "148eccc462b51f7738f0a0a8e62b6404", "score": "0.6671727", "text": "def runs; end", "title": "" }, { "docid": "531e031f7909ef7aae62ddc...
1daaf6bcdddd5a9e3bd59e6d67d0f485
Jobs are created/modified/deleted to match jobs/Main.groovy.
[ { "docid": "3d3d02a8357972eba1d5fea11dfd6a4c", "score": "0.0", "text": "def test_jobs\n # Disable security.\n ansible_playbook '--tags solita_jenkins_security', <<-EOF\n ---\n - hosts: vagrant\n vars:\n solita_jenkins_security_realm: none\n roles:\n - solita.jenkins\n...
[ { "docid": "66978ca3f56b9174b77da3e4cb7f4b1b", "score": "0.7339117", "text": "def jobs; end", "title": "" }, { "docid": "66978ca3f56b9174b77da3e4cb7f4b1b", "score": "0.7339117", "text": "def jobs; end", "title": "" }, { "docid": "cb651ff8958253f066108b1b27fc9fd5", "sc...
bf44778e0d399a3eec2a327caf71ad36
Convert from tile_x, tile_y, zoom level to longitude and latitude in degrees (slight loss of precision). Tile coordinates may be floats or integer; they must lie within map range.
[ { "docid": "c1b1539209b65e7be76f8839744dcc22", "score": "0.6119778", "text": "def tile_xy_zl_to_lng_lat(tile_x, tile_y, zl)\n tile_size = map_tile_size(zl)\n raise ArgumentError, \"tile index must be within bounds ((#{tile_x},#{tile_y}) vs #{tile_size})\" unless ((0..(tile_size-1)).include?(ti...
[ { "docid": "120198da0f75a401873998fdd8390bee", "score": "0.74063975", "text": "def tile2latlon(x, y, zoom)\n n = 2.0 ** zoom\n lon_deg = x / n * 360.0 - 180.0\n lat_rad = Math.atan(Math.sinh(Math::PI * (1 - 2 * y / n.to_f)))\n lat_deg = degrees(lat_rad)\n return lat_deg, lon_deg\nend", "title":...
7615a2046be5e410588714bc360b1055
DELETE /redirects/1 or /redirects/1.json
[ { "docid": "0e9bfa3909a3018decaf8ddeb9dee342", "score": "0.67221326", "text": "def destroy\n @redirect.destroy\n respond_to do |format|\n format.html { redirect_to redirects_url, flash: { success: 'Redirect was successfully destroyed.' } }\n format.json { head :no_content }\n end\n e...
[ { "docid": "8bef6cbe477cb8552adf4383324a0bc4", "score": "0.70056623", "text": "def delete_via_redirect(path, parameters = {}, headers = {})\n delete path, parameters, headers\n follow_redirect! while redirect?\n status\n end", "title": "" }, { "docid": "412e1570def5...
102d04ed7321607554d1f97c30341a73
Finds and returns the largest integer value the array Assumes that the array is not sorted. Approach: Start with max value as value of first index in array During loop, check if current value is greater than current max value If greater, chanage max to current value; if not, move on Return the max value after loop is c...
[ { "docid": "803351255099978ec13df6a77839fc09", "score": "0.7438531", "text": "def find_largest(array, length)\n max = array[0]\n\n length.times do |index|\n if array[index] > max\n max = array[index]\n end\n end\n\n return max\nend", "title": "" } ]
[ { "docid": "8a77231c9c3f70d0a1197907cfd3b155", "score": "0.85472924", "text": "def find_max_value(array)\n i = 0 \n max = 0 \n \n while i < array.length do\n if max < array[i]\n max = array[i]\n end \n i += 1 \nend \n return max\nend", "title": "" }, { "docid": "56d4f8b0051532...
c7b781b5ff2de518dfb8bfa23a99fa3c
Outputs the RDF/JSON representation of all stored triples.
[ { "docid": "d93d18bc803b20a71a4d974a74c687ac", "score": "0.0", "text": "def write_epilogue\n puts @json.to_json\n super\n end", "title": "" } ]
[ { "docid": "7da833443132e6f730417b2dc1e54be4", "score": "0.64408034", "text": "def to_ntriples()\n buffer = RDF::Writer.for(:ntriples).buffer do |writer|\n writer << to_rdf\n end\n return buffer\n end", "title": "" }, { "docid": "7da833443132e6f730417b2dc1e...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "80952991ead472ed80ca758bc7be3ad0", "score": "0.0", "text": "def add_user_params\n params.require(:add_user).permit(:name, :password, :level, :email)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
29308f05ae18cee4ee9e2b4eec19f593
rubocop:enable Metrics/PerceivedComplexity rubocop:enable Metrics/ParameterLists
[ { "docid": "b4a9ae68db8266dc13458ddda9bf816a", "score": "0.0", "text": "def standard_exception\n Object.const_get('Wavefront::Exception')\n .const_get(\"Invalid#{class_basename}Id\")\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.64230025", "text": "def desired; end", "title": "" }, { "docid": "22cedc7bf6749c5a730c17ddb7c38970", "score": "0.6309917", "text": "def used_by=(_arg0); end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf...
2945259770a4eb6f9d8a22a155520f07
Creates the specified Data Lake Storage Gen1 account Returns response code 200 ok if successfully created account
[ { "docid": "f92206e8aaf8f4ac0c3ab73b557321dd", "score": "0.75167984", "text": "def create_gen1_account(name) \n\n account_create = {\n \"location\"=> \"centralus\",\n \"tags\"=> {\n \"test_key\"=> \"test_value\"\n },\n ...
[ { "docid": "3ee4a97335dc8198aa96a057bf6be69f", "score": "0.73075026", "text": "def account_create(uid,display_name)\n user_hash = @client.user_create(\"#{uid}\",\"#{display_name}\")\n Rails.logger.debug '> Radosgw: Account create'\n user_json = user_hash.to_json\n storage = Storage.new(STORA...
dd66d4d628d85d2052b6a1c49ed225d6
returns a user's membership for a specific epicenter
[ { "docid": "97dca91e2d251e0f2b1b3941fc3d36a3", "score": "0.81659776", "text": "def get_membership(epicenter)\n return self.memberships.where(:epicenter_id => epicenter.id).first\n end", "title": "" } ]
[ { "docid": "ad80193daedc4032f072f941107555ff", "score": "0.6813028", "text": "def get_membership( user )\n self.memberships.find_by_user_id(user)\n end", "title": "" }, { "docid": "72f41550c546141554cd5e6ebe747db3", "score": "0.66632974", "text": "def meetup_member\n return Me...
27576f819bd37ede59d9c0135c75b113
Check if at least one element returns true
[ { "docid": "541d05583070fc7499285a09736877a3", "score": "0.0", "text": "def some\r\n each do |value|\r\n result = yield(value)\r\n return true if result\r\n end\r\n return false\r\n end", "title": "" } ]
[ { "docid": "176bb6b9832ce8850c46e2d5483a7c5d", "score": "0.7440724", "text": "def any?\n ! empty?\n end", "title": "" }, { "docid": "2e28d303995beccc770310f896003a12", "score": "0.741719", "text": "def any?\n !empty?\n end", "title": "" }, { "docid": "2e28d303...
335d2f3bccf69931e02a03da733b0719
redoing it for fun :)
[ { "docid": "eac017f5cded9dca73f4790245e2386a", "score": "0.0", "text": "def max_multiple \n possible_numbers = (divisor..bound).to_a\n remainder_zero_numbers = []\n possible_numbers.each do |num|\n remainder_zero_numbers << num if num%divisor == 0\n end\n remainder_zero_numbers.max\nend", "t...
[ { "docid": "59d2448e8d436f1c1301a01649c28bba", "score": "0.79594576", "text": "def redo\n end", "title": "" }, { "docid": "98a0284787303bf0ee64f110d0d32ca5", "score": "0.7919867", "text": "def redo\n\t\t\n\tend", "title": "" }, { "docid": "b08b24b03be2813871a0acb6dec40b0...
93cb5411d17aba1368600f82bc7e5dcc
GET /Posts GET /Posts.json
[ { "docid": "39596744f4aed5e2cf57c2c2548ff330", "score": "0.0", "text": "def index\n # redirect_to root_path\n @posts = Post.all.reverse\n end", "title": "" } ]
[ { "docid": "915c0178f9e4347098d8a463c2cbe6b0", "score": "0.77093875", "text": "def show\n @posts = Post.find(params[:id])\n render json: @posts\n end", "title": "" }, { "docid": "9e4bfaa87507d05255fbaeadc1ecb1d6", "score": "0.752933", "text": "def index\n @posts = Post.all\...
c8f3ef6eb9a587f18d5ca7b549d83cde
This method will be called after each post receive and only if the provided user is present in GitLab. All callbacks for post receive should be placed here.
[ { "docid": "a70a270a9888f624d663c8be57a058ed", "score": "0.557757", "text": "def trigger_post_receive(oldrev, newrev, ref, user)\n data = post_receive_data(oldrev, newrev, ref, user)\n\n # Create satellite\n self.satellite.create unless self.satellite.exists?\n\n # Create push event\n sel...
[ { "docid": "09aeb813211152db54964467e7ee5d35", "score": "0.6816371", "text": "def _after_set_user; end", "title": "" }, { "docid": "f8e61be4c5b3321b1157576edf4b803a", "score": "0.6654964", "text": "def post_process(user)\n # No actions\n end", "title": "" }, { "docid"...
261b211eb92285cb6ba9dd6154a38349
Chops off the suffix from s, if s ends with suffix.
[ { "docid": "23fb18f7f743106b08455f1d2e1c8a0d", "score": "0.7991067", "text": "def trim_suffix(s, suffix)\n s.end_with? suffix and s[0..-(suffix.length + 1)] or s\n end", "title": "" } ]
[ { "docid": "8b4a81c1ab97a7362fbed9cfc13e7596", "score": "0.7496645", "text": "def strip_suffix(str, suffix)\n str.end_with?(suffix) ? str.slice(0...-suffix.length) : str\n end", "title": "" }, { "docid": "508bf985f9a0e9500e030fa3f92cc458", "score": "0.7125452", "text": "d...
dfd00ef763e42e1efc9746bcd87b5bb9
Initialize the application passing the given group. By default, the group is :default source://railties/7.0.4/lib/rails/application.rb370
[ { "docid": "f0362e6859768b01d7ed7ce32bbf67b6", "score": "0.0", "text": "def initialize!(group = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "22c8cad4f55717cef245ae1521c48711", "score": "0.8095067", "text": "def initialize!(group=:default) #:nodoc:\n raise \"Application has been already initialized.\" if @initialized\n\n ActiveSupport.run_load_hooks(:before_initialize, self)\n @railties = Railties.new\n\n run_i...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "145ae24d1d323f3bbc901496d5fcb961", "score": "0.0", "text": "def log_params\n params.require(:log).permit(:log,\n :visit_id)\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...
4ee35c513bdfd848e5e74c4b5e6a5901
this method returns the distance according to all the attributes of the same FORMAT as the parameter INDICATOR says
[ { "docid": "8ab6eae65dbccbdaa05826513ad08d4b", "score": "0.7007646", "text": "def get_distance(indicator, row_from_training, example_to_classify)\n atts = @attributes\n\t\tdist = 0\n\t\tcase indicator\n\t\t\twhen CONTINUOUS_CONST\n\t\t\t\tatts.each do |a|\n\t\t\t\t\tif a.format == CONTINUOUS_CONST\n ...
[ { "docid": "eacfc7ad78e5078c66160b81776900e6", "score": "0.6662185", "text": "def calculate_distance_by_attributes(t, e)\n option = @option\n\t\ts1 = get_distance(CONTINUOUS_CONST, t, e)\n\t\ts2 = get_distance(NOMINAL_CONST, t, e)\n\t\ts3 = get_distance(BINARY_CONST, t, e)\n\t\tsum = s1 + s2 + s3\n ...
ec12171f50179cdacd021f957fd3df6e
Should be overridden by an extending class.
[ { "docid": "0929b5725be8d834c4b71858b80fc6ad", "score": "0.0", "text": "def process\n post_process\n end", "title": "" } ]
[ { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.8355969", "text": "def override; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.7559079", "text": "def overrides; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e"...
4cc43cadd24aca96fad6a2b84a4dcbd9
Define any customized permissions here.
[ { "docid": "66065fa6db96079fa4129c2c153b25df", "score": "0.76628286", "text": "def custom_permissions\n # our custom action to deliver json to viewer, same permissions as show\n alias_action :viewer_images_info, to: :read\n\n if current_user.admin?\n # Role management\n # don't allow ...
[ { "docid": "e7fa55c996c89a154f6ff748543f9ee3", "score": "0.8672363", "text": "def define_permissions\n end", "title": "" }, { "docid": "9414be29752fb67f99b3187e2c835691", "score": "0.846895", "text": "def custom_permissions\n end", "title": "" }, { "docid": "9414be297...
04c9204b6b3c0226d4f2963d883d3426
the array will store all the deals scraped from the website
[ { "docid": "3a2f2e24ab3716876978b6f0d39fe4f8", "score": "0.0", "text": "def initialize(name = \"\", url = \"\")\n @name = name\n @url = url\n @details = details\n scrape_details\n end", "title": "" } ]
[ { "docid": "3906286f57d16f0bc0899d7282310eee", "score": "0.7231598", "text": "def get_coupons\n @rewards_source = async_response(\"https://m.cvs.com/mt/www.cvs.com/extracare/landing.jsp\")[:body]\n if $debug\n puts @rewards_source\n exit\n end\n @deals_array = Array.new...
5d52aef2d4a9a9d514b29c9d2df1076e
POST /card_ips POST /card_ips.json
[ { "docid": "86399e03e4c92d049a38ce363eb4b68e", "score": "0.78957754", "text": "def create\n @card_ips = CardIp.factory(card_ip_params)\n\n if @card_ips.save\n render :show, status: :created\n else\n render json: @card_ip.errors, status: :unprocessable_entity\n end\n end", "tit...
[ { "docid": "42a79e623d68c7b14c38b38fcfce6699", "score": "0.6287357", "text": "def card_ip_params\n params.fetch(:card_ip, {}).permit!\n end", "title": "" }, { "docid": "22276345280767a0305ab0981dcd7e66", "score": "0.6264578", "text": "def create\n @ip = @customer.ips.new(p...
0bbd03e6b9c3adf3ae733efede8d45e0
maxContiguousArea : Decimal The largest amount of open space available in a commercial building
[ { "docid": "ba9f33f68f74ccc320f00f0271b4ae12", "score": "0.8393545", "text": "def max_contiguous_area\n self.dig_for_decimal(\"maxContiguousArea\")\n end", "title": "" } ]
[ { "docid": "d16081daad927fce155403d51e7b5754", "score": "0.6679478", "text": "def cost_with_max_global_in_left_side\n (@buildings_calculator.max_height * (@buildings_calculator.left_width + 1)) +\n (@buildings_calculator.max_right * @buildings_calculator.right_width)\n end", "title": ...
0123e482533c80050550da4f88344e6c
file is required now
[ { "docid": "b1fec8d4f44692e2664cd95bc8e0f55e", "score": "0.0", "text": "def display_name(options = {}) # :yields: String\n opt = {\n :type => nil\n }.merge!(options.symbolize_keys)\n\n case opt\n when :for_select_list\n primer.display_name + \" \" + pcr.display_name\n else\n ...
[ { "docid": "f64b1762aa68f1f1530e968cfb21a452", "score": "0.70265186", "text": "def check_file\n super\n end", "title": "" }, { "docid": "6a74d5b5be3dfb4f79bc632b214bb699", "score": "0.7004013", "text": "def require!(_file_)\n raise 'must implement'\n end", "title"...
8b21ef47730767673c8731608e17bb17
Checks if the set contains any items.
[ { "docid": "ae60ee3127810a6ac866cfe8e9073010", "score": "0.6463111", "text": "def empty?\n return !exists?\n end", "title": "" } ]
[ { "docid": "80a7ad11d9a12dbf1dbb36dde1eb0bd0", "score": "0.76958275", "text": "def any?\n @items && @items.any?\n end", "title": "" }, { "docid": "49f732a3e96fab918eb6fbfff3edef00", "score": "0.769267", "text": "def isEmpty? #just check if the set has any elements\r\n...
84185030af2fcd9e20b139befdfb4e68
soma dois valores que descendem de Numeric
[ { "docid": "341990380d73fdcc87fd865589c6fe1b", "score": "0.0", "text": "def somar(*args)\n\t\traise \"envie no minimo dois numeros\" if args.size < 2\n\t\traise \"insira somente numeros\" unless valid_args?(args)\n\t\targs.inject(0){|total, value| total + value}\n end", "title": "" } ]
[ { "docid": "f4685f02775b44a89a5be828a5004ab6", "score": "0.6796212", "text": "def numeric?; float?; end", "title": "" }, { "docid": "b9c90a47db9100978a636c2f339b1bdd", "score": "0.6697055", "text": "def numericize\n\t\tcollect(&:to_f)\n\tend", "title": "" }, { "docid": "2...
29621021a8f4e6f671d3c749cc8de592
GET /elections/1 GET /elections/1.xml
[ { "docid": "da4f39dc34699fa319ae724a71518244", "score": "0.7595797", "text": "def show\n @election = Election.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @election }\n end\n end", "title": "" } ]
[ { "docid": "836681029704f24ba655ed336824ec2c", "score": "0.683209", "text": "def index\n @elections = Election.all\n end", "title": "" }, { "docid": "a121c5a9bf593d04ae642680c093ac24", "score": "0.6739732", "text": "def new\n @election = Election.new\n\n respond_to do |form...
3202c0d49727b32e0beba5a596fc0700
If true, use ISO 8601 format for dates and times. Otherwise, fall back to the Active Support legacy format. source://activesupport//lib/active_support/json/encoding.rb117
[ { "docid": "698848c580560deb6f932016978cf929", "score": "0.74724835", "text": "def use_standard_json_time_format=(_arg0); end", "title": "" } ]
[ { "docid": "40f72457d186582c3ae3e478d3398fb9", "score": "0.7835696", "text": "def use_standard_json_time_format; end", "title": "" }, { "docid": "40f72457d186582c3ae3e478d3398fb9", "score": "0.7835696", "text": "def use_standard_json_time_format; end", "title": "" }, { "d...
003f48425b7252c5a40aac463c437996
POST /divesites or /divesites.json
[ { "docid": "6b6002f46d041f7d5531b60deb2f2222", "score": "0.6331908", "text": "def create\n @divesite = Divesite.new(divesite_params)\n\n respond_to do |format|\n if @divesite.save\n format.html { redirect_to @divesite, notice: \"Divesite was successfully created.\" }\n format.js...
[ { "docid": "de22504687294fd38e680592b0f8d860", "score": "0.6080687", "text": "def divisions(**options) = get('/divisions', **options)", "title": "" }, { "docid": "12e907e40137c58da49396605391a7c7", "score": "0.5852464", "text": "def create\n @diving = Diving.new(diving_params)\n\n...
e2c429d40c11483a755ff3d8c8e0fa7a
This has the effect of moving all the higher items down one.
[ { "docid": "0f8805691adade4caebaca02f0fdbcbf", "score": "0.680853", "text": "def increment_positions_on_higher_items\n return unless in_list?\n acts_as_list_class.update_all(\n \"#{:position} = (#{:position} + 1)\", \"#{:position} < #{send(:position).to_i}\"\n ...
[ { "docid": "5bb8d461f96ede12ffd5acc490226cdb", "score": "0.82816607", "text": "def move_higher\n return unless higher_item\n\n acts_as_list_class.transaction do\n higher_item.increment_position\n decrement_position\n end\n end", "title": "" }...
fb1466d10c0c3d2dc0706329d96ccd24
Creates a consumer object and caches it for OAuth plugin using Twitter API configuration === Return Consumer from OAuth plugin.
[ { "docid": "427fb16aa010e981b72ba99a468481a2", "score": "0.78272915", "text": "def consumer\n @consumer ||= begin\n options = {:site => @@config[\"site\"], :request_endpoint => @@config[\"site\"]}\n OAuth::Consumer.new(@@config[\"consumer_token\"],\n ...
[ { "docid": "c9d2036fa8b5f6f6b3d0b78c2d4ec035", "score": "0.82945704", "text": "def get_consumer\n ::OAuth::Consumer.new(@key, @secret, @configuration)\n end", "title": "" }, { "docid": "11730d580226ac9c9036ebb6f69c8ecd", "score": "0.8181884", "text": "def oauth_consumer\n...
3b28766467ac1f2e0ff815e7fd1ab480
Use vector maths to calculate a point a given distance along a line defined by its start and end points.
[ { "docid": "454d7986fbd0e4b663b5abc77cce645f", "score": "0.7907499", "text": "def lineVectorPoint(x1,y1,x2,y2,distance)\n point = []\n vx = x2 - x1\n vy = y2 - y1 \n magnitude = Math.sqrt(vx*vx + vy*vy) \n vx /= magnitude\n vy /= magnitude \n point[0] = x1 + vx * distance\n point[1] = y1 + vy ...
[ { "docid": "77aeced281cd79f18f02a2aebfbd7dbe", "score": "0.76570845", "text": "def distance_of_point_to_line(point, line_start, line_end)\n segment = line_start - line_end\n d = line_start - point\n\n projection = d.projection_onto(segment)\n point.distance_to(line_start - pr...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b8ff1a8331e8bb9c48bfec55458294c1", "score": "0.0", "text": "def set_weakness_answer\n @weakness_answer = WeaknessAnswer.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...
321e8bfb0ad3d8a054efeede08fdb869
Outputs an underlined bold string stating the ipa is being deployed and it's file size
[ { "docid": "9eef1ac4c70d49516380e97babd84853", "score": "0.7491331", "text": "def deploying_ipa(ipa)\n puts\n deploying = \"Deploying IPA\"\n puts bold(deploying)\n puts deploying.length.times.map {\"=\"}.join\n puts\n puts (\"#{filesize(ipa)}MB\")\n puts...
[ { "docid": "32e70b11fa1b4f7131e886626096d72b", "score": "0.68342286", "text": "def show_program_h_size\n\t\t\tputs \" Size of program headers: #{@elf_program_h_size} (bytes)\"\n\t\tend", "title": "" }, { "docid": "b8193acee0cf9013cf262b184ab9dd9f", "score": "0.67918587", "...
094aca0c8fef7455396dedf4b41d5ea4
GET /search_daums GET /search_daums.json
[ { "docid": "f83955f8236fe0bbf9dc55933cdc98d1", "score": "0.0", "text": "def index\n @search_daums = SearchDaum.all\n \n term_date = Date.parse((Date.today - 5).to_s)\n \n while term_date < (Date.today)\n daum_url = \"http://rank.ezme.net/?mode=recmd\" + \"1\" + \"&day=\" + term_date....
[ { "docid": "2365ee141bb8941d16b81e8c206e8e2a", "score": "0.6698672", "text": "def search_with_dsei\n results = People.where(\"name ILIKE ?\", \"%#{params[:query]}%\").where(:dsei_id => params[:dsei_id], :user_id => [nil, false]).order(:name).limit(100)\n\n render json: results.map{ |person| { id: ...
5f002e5d434d142a9d75ea9fd5a1319b
DELETE /joseph_memos/1 DELETE /joseph_memos/1.json
[ { "docid": "f8b677a21799668c29677aed5a29767a", "score": "0.67633104", "text": "def destroy\n @joseph_memo.destroy\n respond_to do |format|\n format.html { redirect_to joseph_memos_url, notice: 'Joseph memo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.6977293", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "33b888c8f2b033bb54789de80c57d692", "score": "0.6896678", "text": "def delete\n client.delete(url)\n @deleted = true\ne...
0449b42e77d2a8c89e0742e0022ce043
POST /sys_users POST /sys_users.json
[ { "docid": "979490a764dc4ddab7378c08e04021c8", "score": "0.66752917", "text": "def create\n @sys_user = SysUser.new(sys_user_params)\n @sys_user.password = Digest::MD5.hexdigest(params[:sys_user][:password])\n respond_to do |format|\n if @sys_user.save\n format.html { redirect_to @s...
[ { "docid": "3b711243d66b8c504d72f2f8229cc9d6", "score": "0.68657154", "text": "def create_user\n value = user_params\n create_user = HTTParty.post(ms_ip(\"rg\")+\"/users\", body: value.to_json, :headers => { 'Content-Type' => 'application/json' })\n if create_user.code == 201\n cre...
2f9a622df1b90a606e8d3befb97efbb3
:callseq: on_if_mod: (untyped predicate, untyped statement) > IfNode source://syntax_tree//lib/syntax_tree/parser.rb2085
[ { "docid": "39ac10a30358a6950690ea8b99a9adcd", "score": "0.8046622", "text": "def on_if_mod(predicate, statement); end", "title": "" } ]
[ { "docid": "e425807dbbd929d4ebcad826252fb45d", "score": "0.7819737", "text": "def on_if_mod(predicate, statement)\n find_scanner_event(:@kw, 'if')\n\n {\n type: :if_mod,\n body: [predicate, statement],\n sl: statement[:sl],\n sc: statement[:sc],\n el: predicate[:el],\n ...
38d62564917c966b3cfd8db43424db8c
GET /areas/new GET /areas/new.json
[ { "docid": "ae2916fc37b4378175e1a562030e3aba", "score": "0.75987095", "text": "def new\n @breadcrumb = 'create'\n @area = Area.new\n @departments = departments_dropdown\n @workers = workers_dropdown\n\n respond_to do |format|\n format.html # new.html.erb\n format.j...
[ { "docid": "333e05dfa1abdb03ed2a8aeb8ead3848", "score": "0.8211101", "text": "def new\n @area = Area.new\n @other_areas = Area.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end", "title": "" }, { "docid": "1fd2f1...
336f9c7964e446956c3d5d5f18cfbcf8
should only be called by Instance after all attributes have been defined
[ { "docid": "e12c1c29b7d41b5e3b5816f31737de7d", "score": "0.0", "text": "def attribute_names\n @attribute_names ||= attributes.map(&:name)\n end", "title": "" } ]
[ { "docid": "046d3b1493bd813f4be8929deb2a30a3", "score": "0.72229105", "text": "def setup_attrs\n end", "title": "" }, { "docid": "ca5c5d8d9e9512973ab0e5159a095601", "score": "0.7165472", "text": "def declared_attributes; end", "title": "" }, { "docid": "50a5e52bd179ac7c2...
b9413595faf456434c43946ae953a002
Cria um usuario,se nao criar por algum motivo vai mostar um erro 422
[ { "docid": "2354332fa19a242825b6ebad7478bd81", "score": "0.7064367", "text": "def create\n user = User.new(user_params)\n\n if user.save\n render json: user, status: 201\n else\n render json: { errors: user.errors }, status: 422\n end\n end", "title": "" } ]
[ { "docid": "e684372bbbc9c797eca0610d556ca87a", "score": "0.79968554", "text": "def create\n user = User.new(user_params)\n if user.save\n render json: {status: \"Se ha creado el usuario\"}, status: :ok\n else\n # el estatus :unprocessable_entity es el error #422\n render json: {s...
7dec95e75d4038a9f6026b17dc2deca7
return an array with the modes for the params (always length 3)
[ { "docid": "39645c64634635189faa25106d9e87f7", "score": "0.8012606", "text": "def get_modes instruction\n modes = instruction.to_s.chars.map(&:to_i)\n while modes.length < 5\n modes.unshift 0\n end\n modes[0..2]\n # flip the order so they are in order of the param order\n # [param...
[ { "docid": "9706dc02aeefdae952e62d52b34df921", "score": "0.7202016", "text": "def modes\n chords.map(&:modes).flatten\n end", "title": "" }, { "docid": "41836fa088f2f3d2c96bff5c1a0a9a85", "score": "0.71740717", "text": "def modes\n mode_codes.keys\n end", "title": "" ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "849df9c7c051df48c303b8957724bd24", "score": "0.0", "text": "def set_comment\n @comment = comment.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...
397f2748a8ae8a3baf95741b74897ae7
GET /members/1 GET /members/1.json
[ { "docid": "3004b574d95a1c30a15c076b01bf29f6", "score": "0.71454984", "text": "def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end", "title": "" } ]
[ { "docid": "d743f502b758a7352730ff7d6044c6b3", "score": "0.80867594", "text": "def my_members(params = {})\n get(\"/members\", params)\n end", "title": "" }, { "docid": "2eb3a656ce97b066f36c71fd7f539be3", "score": "0.78612804", "text": "def show\n members = MemberRepo....
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "d0536af2bad08e1fb54e251db7b7044e", "score": "0.0", "text": "def brands_category_params\n params.require(:brands_category).permit(:category_id_id, :brand_id_id)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.69497335", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6812623", "text": "def strong_params\n params.require(:listing_member).permi...
c1a12361e2163b7293d1f264b76b0c5e
Edit a transaction metadata
[ { "docid": "43cade3075d92af03851231e367618aa", "score": "0.0", "text": "def users_id_user_connections_id_connection_accounts_id_account_transactions_id_transaction_put_with_http_info(id_user, id_connection, id_account, id_transaction, opts = {})\n if @api_client.config.debugging\n @api_clien...
[ { "docid": "2382b0c2b2da10e1a5d05b2fae464290", "score": "0.6346512", "text": "def audit_metadata(metadata={})\n @audit_metadata = @audit_metadata.try(:update, metadata) || metadata\n end", "title": "" }, { "docid": "5dbc806b5351f3ac5c3ba0105af27e5b", "score": "0.6088052", "text":...
80a02a489a234af9a5f2ac51cca9be4c
Initializes variables for the templates.
[ { "docid": "f7001a4f1369216c08054285ebbc025c", "score": "0.0", "text": "def initialize_variables!\n @root = destination_root\n @project_dir = File.basename(@root)\n @name = (options.name || @project_dir)\n\n @scm = if File.directory?(File.join(@root,'.git')) then :gi...
[ { "docid": "2c5a93e97f05e6e1a9affb48345ef1d0", "score": "0.7371394", "text": "def init\n @templates = []# GradebookTemplate.all\n @loaded_templates = GradebookTemplate.all \n load_templates\n end", "title": "" }, { "docid": "b6a2eead93b96667ed0e74df0a3ee464"...
3ec33028175e7ca0096b7438f66e3fdd
=begin :type x: Integer :rtype: Void =end
[ { "docid": "90bbb477a6755b6249e68d88a8f08534", "score": "0.0", "text": "def push(x)\n @stack << x\n end", "title": "" } ]
[ { "docid": "319844747af69d9b07ea6b54b97db82d", "score": "0.67966765", "text": "def x\n @x ||= 0\n end", "title": "" }, { "docid": "319844747af69d9b07ea6b54b97db82d", "score": "0.67966765", "text": "def x\n @x ||= 0\n end", "title": "" }, { "docid": "d216b3...
a5066ec2fae42aac9921bd2fc04b341e
GET /doughnuts/1 GET /doughnuts/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "d602995bd4674b3368ac7d43cf0b9e06", "score": "0.64547473", "text": "def get\n respond_to do |format|\n format.json { render json: @drug.as_json } \n end\n end", "title": "" }, { "docid": "8c4e64689486ddba90a68fa961c933be", "score": "0.64535165", "text": "def sh...
795d58caae9094dfaf63d9d1a08e1701
Reload the cache for this model by retrieving all of the instances in the dataset freezing them, populating the hash cache, and defining class methods of the form by_[attribute].
[ { "docid": "a936d431c823054b2be4f829f87c9bd1", "score": "0.62707835", "text": "def load_alternate_key_cache(*attrs)\n if attrs.empty?\n @alternate_key_cache = {}\n return\n end\n\n objects = dataset.all\n lookups = {}\n attrs.each { |att...
[ { "docid": "828c21eb5f98b91e2509fb3f7b646f50", "score": "0.77080643", "text": "def reload\n attrs = @@redis.set_members(\"#{self.class.name}:#{@cached_attrs[:id]}:attrs\").map(&:to_sym)\n attrs.each do |attr|\n @cached_attrs[attr] = @@redis.get(\"#{self.class.name}:#{@cached_attrs[:id]}...
77226bd489c956429e6cd81c4a5f58d2
Returns the transaction date of the latest transaction in the current set
[ { "docid": "50034ab527f692daed5bd17144722a13", "score": "0.7461909", "text": "def end_date\n @transactions.empty? ? nil : sorted_transactions.last.transaction_at\n end", "title": "" } ]
[ { "docid": "a333a7ba9f9d8004cbccd1ba4c8dc160", "score": "0.8060652", "text": "def latest\n return self.transactions.first(:order => [:date.desc])\n end", "title": "" }, { "docid": "221af6e40f51ae3bbbc223b16f8cbae7", "score": "0.7671386", "text": "def last_transaction\n @la...
02f2adf54826e78fbabf2bccaffe0a33
Refresh VM states for all selected or single displayed ems(s)
[ { "docid": "2bffe59acb8eaa6f990a876b02e7e14c", "score": "0.5792622", "text": "def refreshemss\n assert_privileges(params[:pressed])\n emss = []\n if @lastaction == \"show_list\" # showing a list, scan all selected emss\n emss = find_checked_items\n if emss.empty?\n add_flash(_(...
[ { "docid": "13e24b91da92b37b732a852522f95325", "score": "0.6013114", "text": "def vcenter_vms_state\n vc_uuid = @vic.vim.serviceContent.about.instanceUuid\n\n view = @vic.vim\n .serviceContent\n .viewManager\n .CreateContainerView(\n ...
6ec1ba34e9e3e5b9772a23c6a1e52fc5
Decodes the packet, looks for the request and passes the response over to the requester
[ { "docid": "e48aecc0e256313bee8a65360e277f56", "score": "0.54976255", "text": "def receive_data(data)\n msg = nil\n begin\n msg = Resolv::DNS::Message.decode data\n rescue\n else\n req = @requests[msg.id]\n if req\n @requests.delete(msg.i...
[ { "docid": "3e0f394ef05186d85325fbf986da3f20", "score": "0.73869044", "text": "def dispatch_request(packet); end", "title": "" }, { "docid": "10618e3b78f00a0f9aaabb0f36792d02", "score": "0.65797913", "text": "def reply\n bytes_read = receive_packet 1400\n\n if @buffer.long == 0...
aedc1fbb138d5f174a3e3bb67f0b2fd4
Tree looks like: A | B / \ \ C D E / \ F G
[ { "docid": "350534a8b0d728630adeb725a01241b1", "score": "0.0", "text": "def test_walk_interesting_tree\n # The test could be rewritten to support 1.8.7, but it would likely be much\n # harder to read.\n skip \"Lack of set ordering in Ruby 1.8.7 prevents this test from running correctly\" if RUB...
[ { "docid": "1ec6bc58978a9abd4d91d1d912631562", "score": "0.7316979", "text": "def tree; end", "title": "" }, { "docid": "1ec6bc58978a9abd4d91d1d912631562", "score": "0.7316979", "text": "def tree; end", "title": "" }, { "docid": "153d206b89b00743169de2e75bc4a84b", "sc...
977dcf0d4736932a0af07611f4dd51ae
method: get, url: /api/saloons/:id/booking_reports
[ { "docid": "b0a41940bb05bc2bdccf876b43ab937b", "score": "0.6843229", "text": "def booking_reports\n bookings = @saloon.bookings.includes(:service, :chair, :customer)\n .where(\"booking_date >= ? and booking_date <= ?\", 1.month.ago.to_date, Time.now.to_date)\n\n total_reven...
[ { "docid": "221d014d16e913e68f352563cd9563d8", "score": "0.6832956", "text": "def index\n @booking_details = BookingDetail.all\n end", "title": "" }, { "docid": "2f3d5d1571aa23b22cfdc4b1615a8882", "score": "0.67886424", "text": "def report(id)\n get(\"reports/#{id}\")\n ...