query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
d10c4affa4bf90e454a8d233383318be
Import other runtime configuration files.
[ { "docid": "ee3adf1a2749e4052eedfdd7d56f4028", "score": "0.0", "text": "def import(glob, opts={})\n paths = []\n\n glob = glob + '**/*' if glob.end_with?('/')\n\n if from = opts[:from]\n paths = Find.path(glob, :from=>from)\n else\n if glob.start_with?('/')\n i...
[ { "docid": "e060787757dde7f71a62fd7f1ece3f88", "score": "0.6485379", "text": "def loadConfigurationFiles\n baseDirectory = 'configuration'\n\n mainDirectory = 'Configuration'\n customDirectory = 'myConfiguration'\n\n mainPath = Nil.joinPaths(baseDirectory, mainDirectory)\n customPath = Nil.joinPath...
ef4e76155a82a875f1345ff6cb2e180a
// Exp Level Mode only skill_exp_max This method is used to set the maximum_exp obtainable by a skill
[ { "docid": "c309cce7b1c6b320753278488bec1aaa", "score": "0.71530384", "text": "def skill_exp_max(skill)\n result = skill.skl_exp_list[skill.skl_maxlevel] + 10\n return result\n end", "title": "" } ]
[ { "docid": "3b071282c28dd391ccfa5afdb3827be4", "score": "0.6647122", "text": "def exp=(exp)\n @exp = [[exp, 9999999].min, 0].max\n # Level up\n while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0\n @level += 1\n # Learn skill\n for j in $data_classes[@class_id].learning...
9744238e36075aac3e933978eabac47b
send an XQuery query to Tamino sQuery (string, in):: XQuery query Type of access:: public Returns:: boolean true on success or false on error
[ { "docid": "55213646c778579f83fa6e72c4f4985b", "score": "0.7187961", "text": "def query(sQuery)\n \n if (!sQuery.is_a? String)\n raise \"The X-Query is not recognized: \\\"#{sQuery}\\\"\"\n end\n \n @_bReturnValue = true;\n \n if (@_sHttpRequestMethod == \"GET\") \n if ...
[ { "docid": "18d66be40039f6091bb1e73e6e8dcf4a", "score": "0.7890931", "text": "def xquery(sQuery)\n \n unless sQuery.is_a? String\n raise \"The XQuery is not recognized: \\\"#{sQuery}\\\"\"\n end\n @_bReturnValue = true;\n \n if (@_sHttpRequestMethod == \"GET\") \n if (@_bCur...
3ec2c018ad34d2566167742b6fc9cfc3
Get the commercial week of the year of this date.
[ { "docid": "1f3e59b640fe0da9e5ad3811e9cf260f", "score": "0.6449068", "text": "def cweek() commercial[1] end", "title": "" } ]
[ { "docid": "837629210039a9f2717fd19fbae7c1ad", "score": "0.82395405", "text": "def week\n @year || date_part_or_default(:cweek) { Date.today.cweek }\n end", "title": "" }, { "docid": "19102eba1172b1ca614e4983e6f0607f", "score": "0.81952876", "text": "def year_week\n @year_we...
cbfe56816a8b020e201a2758c26f3d16
fix if the user deletes all recipes or deletes recipe.json file
[ { "docid": "fb40438c654c1b9e5afa78a2ee875d35", "score": "0.60319257", "text": "def reset\r\n content = JSON.parse(Faraday.get(\"#{@@api_root}/recipes/random#{@@api_key}\").body)[\"recipes\"]\r\n reset_book = convert_api_data(content)\r\n file = []\r\n file << reset_book\r\n File.write(RECIPES_PATH,...
[ { "docid": "864766d7f6954ce19b29c75ebca1873f", "score": "0.6541288", "text": "def check_for_recipes\n recipes = self.recipes.map(&:id)\n if recipes.any?\n self.errors.add :base, \"Cannot delete ingredient while dependant recipes exist.\"\n return false\n end\n end", "title": "" ...
802e27ec2e5d423f6c10dbf3a5d1568c
PUT /posts/1 PUT /posts/1.json
[ { "docid": "25192d7966c43b7613ce1b2f18f7d1c6", "score": "0.6180399", "text": "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, :notice => 'Post was successfully updated.' }\n for...
[ { "docid": "fef606243741752603cf8b7a9b458009", "score": "0.7055501", "text": "def update\n user = User.find_by({token: env['HTTP_TOKEN']})\n post = user.posts.find(params[:id])\n post.update(post_params)\n render json: post\n\n end", "title": "" }, { "doci...
00c59dd7cf5719fe08aa7b96f72a026e
GET /checkins GET /checkins.json
[ { "docid": "2c673bb21d63a5081e0ba2e9c6061d13", "score": "0.7591662", "text": "def index\n if current_user.try(:admin?)\n @checkins = Checkin.all\n @checkins_for_json = current_user.checkins\n elsif user_signed_in?\n @checkins = current_user.checkins\n @checkins_for_json = @chec...
[ { "docid": "27ff95807ca675981d5b5ee58fb39160", "score": "0.7336951", "text": "def checkins(id = 'self', options = {})\n get(\"users/#{id}/checkins\").checkins\n end", "title": "" }, { "docid": "b5c708a64161e33717f87afbe156f00f", "score": "0.7324804", "text": "def index\n ...
45f9da6417f6aaf3330c1a11d805cf4d
We need to define here the parameters which are allowed from external apps/PL
[ { "docid": "85c74b78aa894c87cca2d0001f18376c", "score": "0.0", "text": "def message_params\n params.require(:message).permit(:body)\n end", "title": "" } ]
[ { "docid": "d776711817bf6bc1f145594060bfb5e1", "score": "0.6857656", "text": "def parameters; end", "title": "" }, { "docid": "d776711817bf6bc1f145594060bfb5e1", "score": "0.6857656", "text": "def parameters; end", "title": "" }, { "docid": "d776711817bf6bc1f145594060bfb5...
bb9ecd93b89b4bf2724fb3e3e3c16383
Add one or more private keys to each box. Also stores key paths in the set so when new boxes are added they will get the same keys, +additional_keys+ is a list of file paths to private keys Returns the instance of Rye::Set
[ { "docid": "59dd5a43b78a49cf6dd4e921e72ad8de", "score": "0.76262367", "text": "def add_keys(*additional_keys)\n additional_keys = additional_keys.flatten.compact\n @opts[:keys] ||= []\n @opts[:keys] += additional_keys\n @opts[:keys].uniq!\n @boxes.each do |box|\n box.add_...
[ { "docid": "906d8b49d31d1bc64b8894e3ebf20da8", "score": "0.61651385", "text": "def add_keys(*keys)\n keys = keys.flatten.compact || []\n return if keys.empty?\n Rye.shell(\"ssh-add\", keys)\n end", "title": "" }, { "docid": "0f6eaa7aaf1fd3ea3de5b639eb044468", "score": "0.607895...
1096b18bc7efa97a90530c65e5e8f7bf
=begin using .each to print ooo oo o =end
[ { "docid": "6c4ecb1377f6d9fcd19964958015e6af", "score": "0.0", "text": "def print_logo3()\n i = 1; l = -3\n x = \"x\"; y = \"o\"\n (1..3).zip(-3..-1).each do\n i.times {print x}\n l.abs.times {print y}\n print \"\\n\"\n i += 1; l += 1\n end\nend", "title": "" } ]
[ { "docid": "ba9262039c7ed731fc626fe9d608d42f", "score": "0.7501538", "text": "def printEach x\n x.each{|z| puts z}\nend", "title": "" }, { "docid": "a911da2cd25122abdccfde509c5364ce", "score": "0.7343048", "text": "def pringEach(arr);arr.each{|i| puts i} end", "title": "" },...
44610e6eaedbfd8a6d7753d9280b2c3f
GET /municipalities/new GET /municipalities/new.json
[ { "docid": "f19634c54d0f604b32fcea34260f9431", "score": "0.7396973", "text": "def new\n @municipality = Municipality.new\n @province = nil\n if params[:province_id]\n @province = Province.find(params[:province_id].to_i)\n else\n @province = Province.first\n end\n @object = [@...
[ { "docid": "4a861794629007760f30c63cba82bd55", "score": "0.7813035", "text": "def new\n @municipal = Municipal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @municipal }\n end\n end", "title": "" }, { "docid": "5a4d14bd4bff4e4a1f...
ea52ab949d42ef79b8a42addf0882e10
Implementation of Clamp::Commandexecute Delegates to SpacewalkHtmlCleanCommandprocess_tag
[ { "docid": "6117f7d7d806deca3f5bcb80f6497e93", "score": "0.505409", "text": "def execute\n\n logger = Logger.new(\"/dev/null\")\n logger.level = Logger::WARN\n log_adapter = JerichoLoggerAdapter.new(logger)\n\n\n Dir.glob('./**/*.{jsp,jspf}').each do |path|\n content = File.re...
[ { "docid": "5c73e054646e8976aeeb778ec75ac6c6", "score": "0.52892184", "text": "def child_process(result)\n end", "title": "" }, { "docid": "bd1acc5dfb018f6ab97a967d5abb9f4a", "score": "0.5263641", "text": "def process(_cmd); raise NotImplementedError\n end", "title": ""...
5726af6deea643da8d11f33ec8945c6b
GET /snipets/1 GET /snipets/1.json
[ { "docid": "2bf23738c16e693c8635dadff6bd3228", "score": "0.0", "text": "def show\n @snipet = Snipet.find(params[:id])\n begin\n @data = DataManager.instance.execute(@snipet.query)\n p @data\n begin\n @table_recods = @data.map{|r| r.map{|x| \"<td>#{x}</td>\" }.join() }.map{|r|...
[ { "docid": "8db765e9062a74c412a81af7797d2eba", "score": "0.66769385", "text": "def index\n @snakes = Snake.all\n render json: @snakes\n end", "title": "" }, { "docid": "a53d91cf10eaed8dc6be9d94be2462e1", "score": "0.66698277", "text": "def index\n @snipers = Sniper.all\n e...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "c2240fa7be6b5bfaa4795c722cccd250", "score": "0.0", "text": "def bedroom_type_params\n params.require(:bedroom_type).permit(:name, :price)\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"...
ad0517e69bc9fedbacde546719f635ec
Constructs a new resource and passes it to the client. This resource will not have been saved on the server.
[ { "docid": "cc34a52c9117a3d88c51a41a343a1cc4", "score": "0.0", "text": "def new \n @clearance = Clearance.new\n @student = Student.new\n \n end", "title": "" } ]
[ { "docid": "3527ea3c8fdf52e0b521c79714d1e51e", "score": "0.7761369", "text": "def new_resource(*args)\n Freemle::Client::Resource.new(*args)\n end", "title": "" }, { "docid": "b750a3dc6649361c898be26ab9207ea9", "score": "0.7549374", "text": "def create(resource)\n resour...
4f74f96b0f40a3013fde62fb696963e1
end the arguments method define what happens when the measure is run
[ { "docid": "2996b703334927c5e87e2cff8eeb3c03", "score": "0.0", "text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # Use the built-in error checking\n if not runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n ...
[ { "docid": "a2dd09cfd832ed391005833a8d9c1c5c", "score": "0.6389297", "text": "def measure(*args)\n raise RuntimeError,\n 'Ruler#measure called, but should be redefined by a real ruler.'\n end", "title": "" }, { "docid": "df1737ac90b4bc30e887a5813a4382f0", "score": "0.63422...
cd1119b0c0ee3688b1f254b78322b359
Execute the fOOrth code supplied by the parser. ==== Parameters: parser An instance of the Parser class that supplies parsed source code to be executed.
[ { "docid": "1186c04767166919a8f8a27bb65370a0", "score": "0.7264115", "text": "def execute(parser)\r\n # Make sure we are in :Execute mode.\r\n check_mode([:Execute])\r\n \r\n #Set up compiler control data\r\n save_parser = @context[:parser]\r\n @context[:parser] = parser\r\...
[ { "docid": "bc6fb1c9d8b45744f168375150236eb6", "score": "0.7350058", "text": "def execute(parser)\r\n # Make sure we are in :Execute mode.\r\n check_mode([:Execute])\r\n \r\n #Set up compiler control data\r\n save_parser = @parser\r\n @parser, @level, @quotes, @buffer = par...
d6fab8329de51bfbc92ffcc550d1ed33
assign_grade 67 assign_grade 70 2b. STRETCH: Create exceptions to your method if the number passed is less than 0 or greater than 100. Copy and paste the original code below to add the exceptions.
[ { "docid": "2ab86121948e33fa108487f74e96c1b9", "score": "0.73477864", "text": "def assign_grade_letter num\n if num == 100 && num >= 90\n puts \"A\"\n elsif num >= 80 && num < 90\n puts \"B\"\n elsif num >= 70 && num < 80\n puts \"C\"\n elsif num >= 60 && num < 70\n ...
[ { "docid": "55d849c31e7035bf4ce36400dacc7de1", "score": "0.7631358", "text": "def assign_grade2 num\n case num\n when 90...100\n \"A\"\n when 80..89\n \"B\"\n when 70..79\n \"C\"\n when 60..69\n \"D\"\n when 0..60\n \"FAILED\"\n end\n if num < 0...
8c39c6e04cd6e85e8d12fe6194cd02ca
Returns true if the pin is currently configured to be an output.
[ { "docid": "78d4411b53987ee8ba44acdf261ba5fc", "score": "0.83226883", "text": "def output?\n @mplab_pin.output?\n end", "title": "" } ]
[ { "docid": "403e712d6eac1181af0d01f70115dac6", "score": "0.76420176", "text": "def output_port?\n @type == :output\n end", "title": "" }, { "docid": "11c0752b57eccdd6d300d5d8e620a7c7", "score": "0.73244303", "text": "def driving_high?\n output? && @mplab_pin.high?\n e...
75415f7fa1af1071847dc2f9227b0b7a
PATCH/PUT /intertitles/1 PATCH/PUT /intertitles/1.json
[ { "docid": "271dcd93e00039873cd2945003b2a1ae", "score": "0.75267744", "text": "def update\n @intertitle = Intertitle.find(params[:id])\n respond_to do |format|\n if @intertitle.update(intertitle_params)\n format.html { redirect_to @intertitle, notice: 'Intertitle was successfully updat...
[ { "docid": "6ec978a014d03bc2af88a06b316e35a5", "score": "0.6213996", "text": "def update\n @headline = Headline.find(params[:id])\n\n respond_to do |format|\n if @headline.update_attributes(params[:headline])\n format.html { redirect_to @headline, notice: 'Headline was successfully upd...
de8aef94bef6eaf35b529f453f3d595d
== GET /catalog/facet/:id == GET /:lens/facet/:id Displays values and pagination links for a single facet field. This method overrides:
[ { "docid": "725333084ed185807471be169aa15519", "score": "0.58873016", "text": "def facet\n super\n end", "title": "" } ]
[ { "docid": "252b1a3a5bfa9b6c755ae8fb11582910", "score": "0.79455936", "text": "def facet\n unless (params[:id] && blacklight_config.facet_fields[params[:id]])\n raise ActionController::RoutingError, 'Not Found'\n end\n @facet = blacklight_config.facet_fields[params[:id]]\n\n @response =...
809539889d9495feaf76a28d2fffdce3
Public: Get available stacks for current app.
[ { "docid": "5b35476d07a6b86be4ee8ea809602cbd", "score": "0.66504616", "text": "def stacks\n @stacks ||= StackSet.new self\n end", "title": "" } ]
[ { "docid": "2506f1782bcf6b806bf9fbfe644648cb", "score": "0.75848854", "text": "def list_available_solution_stacks()\n request({\n 'Operation' => 'ListAvailableSolutionStacks',\n :parser => Fog::Parsers::AWS::ElasticBeanstalk::ListAvailableSolutio...
b1832f48b1a07546aced062216fde85f
Write a method, rotate(array, shift) that, given an array and an integer (shift), rotates the array inplace by the shift amount. Hint: some combination of shift/push or unshift/pop should come in handy here. rotate([1, 2, 3, 4], 1) ==> [4, 1, 2, 3] rotate([1, 2], 2) ==> [1, 2] rotate([4, 5, 6, 7], 3) ==> [5, 6, 7, 4]
[ { "docid": "b7f3908de8b1fd383fea9ec2ef23d54b", "score": "0.7901868", "text": "def rotate(array, shift) \n\n move = array.pop(shift)\n\n array.unshift(move)\n\n p array.flatten\n\nend", "title": "" } ]
[ { "docid": "dc28baa28d9d63a78d928e9e1af52245", "score": "0.8727454", "text": "def rotate(array, shift)\nend", "title": "" }, { "docid": "1f166de4855824c4445c42ba55cc4da9", "score": "0.83685017", "text": "def rotate(arr, shift)\n if shift > 0\n shift.times do\n val = arr.pop\...
d41de6878e392104ccb8ee32fa7641c8
validates :date_cannot_be_in_the_past validates :start_end_check
[ { "docid": "b7308f8dabb7a2e88056823b75924cdc", "score": "0.0", "text": "def date_cannot_be_in_the_past\n if lesson_date.present?\n # if lesson_date.present? && lesson_date < Date.today\n # errors.add(:lesson_date, \": 過去の日付は使用できません\")\n # end\n end\n end", "title": "" }...
[ { "docid": "fd188ea7a9abfbb6313c274431649544", "score": "0.84945816", "text": "def check_date\n if start_at.present? && end_at.present?\n errors.add(:start_at, \"must be less then end date\") if self.start_at > self.end_at\n end\n end", "title": "" }, { "docid": "771851aab4849c27...
6d496a6a06902e2a38ff4b1ab0838cbb
GET /to_sees/1 GET /to_sees/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "5acdea44dd0cc7368248db28bd73f2ee", "score": "0.6504615", "text": "def index\n @to_sees = ToSee.all\n end", "title": "" }, { "docid": "4e9990bf46558221361c33172dc5c2ec", "score": "0.60920525", "text": "def show\n @sede = Sede.find(params[:id])\n\n respond_to do |...
392857269688ad63f0d606f382373891
DELETE /indicator_files/1 DELETE /indicator_files/1.json
[ { "docid": "2c28ce816b1370e541ec5f1afdb11a38", "score": "0.0", "text": "def destroy\n @town.destroy\n respond_to do |format|\n format.html { redirect_to towns_url, notice: 'Town was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "2148e2fd9383c12872890f51efee3615", "score": "0.71785355", "text": "def delete\n begin\n task_id = \"#{@file}\".gsub(/\\.\\/singularity\\//, \"\").gsub(/\\.json/, \"\")\n # delete the request\n RestClient.delete \"#{@uri}/api/requests/request/#{task_id}\"\n pu...
79b2e24c6991ffe242516a8947ceef27
This method creates the ffmpeg command that we'll be using
[ { "docid": "691bd03a9cb3393d03f18f57528a6c90", "score": "0.7374752", "text": "def convert_command\n #new_name = \"#{File.basename(video.path, \".*\").parameterize}.avi\" \n File.rename(video.path, File.join(File.dirname(video.path), \"#{video_file_name.parameterize}.avi\"))\n #File.r...
[ { "docid": "1a0afc895d7fef39ef2aaf146249b8f5", "score": "0.82520187", "text": "def ffmpeg_command\n \"#{ffmpeg_bin} #{@options.parsed}\"\n end", "title": "" }, { "docid": "03a9703bc3828b80c2c2de1f262a8ecb", "score": "0.8058137", "text": "def command_transcode\n command =...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3038cf8cb7b890fe50f8e31c2da8cf9f", "score": "0.0", "text": "def space_params\n params.require(:space).permit(:name, :cover, :access_control).to_h\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
57fdabb84f2631db5413b03b3a2be344
Keep track of turns
[ { "docid": "8dd77f949e3374d9431988ed8413be73", "score": "0.0", "text": "def turn_count(board)\n counter = 0\n board.each do |spaces|\n if spaces == 'X' || spaces == 'O'\n counter += 1\n end\n end\n counter\nend", "title": "" } ]
[ { "docid": "819422ea2e9939075e4fc5424099d822", "score": "0.7433854", "text": "def game_turns\n end", "title": "" }, { "docid": "1edf1beb8212de3517f5b5a79d5faf8e", "score": "0.72282165", "text": "def change_turns\n current_game.next_turn\n end", "title": "" }, { "doci...
c7d76ea311104ca0ae8abfba37213b41
builds payment object from payment_type in before callback
[ { "docid": "386b97d350dbe2573e2ffaf7cadb42bf", "score": "0.8074763", "text": "def build_payment_object_from_payment_type\n if self.sender && self.payment_type == :piggy_bank\n self.payment_object = self.sender.piggy_bank\n end\n end", "title": "" } ]
[ { "docid": "a11a77faa5ecec563671688dede27eb3", "score": "0.7199142", "text": "def process_payment!\n @payment_type.pay\n end", "title": "" }, { "docid": "f9f3e54467caf6baace96087885c1595", "score": "0.69642353", "text": "def prepay(payment_type)\n result = request_prepay_id(pa...
e13a6fef908e42bceb47b113a224792d
terrible name, the list of 'servers' lines in the config
[ { "docid": "5dce12ecbc8d3fe10cb2e26359778b81", "score": "0.0", "text": "def server_hash\n @server_hash ||= {}.tap do |h|\n num_members.times do |idx|\n h[\"server.#{idx}\"] = \"127.0.0.1:#{base_port + FOLLOWER_PORT_OFFSET + idx}:#{base_port + LEADER_PORT_OFFSET + idx}\"\n ...
[ { "docid": "c99926ade8fee8ffff5a15a6d937f2ac", "score": "0.8277854", "text": "def servers\n @config['servers'].map { |server| server.split(/:/) }\n end", "title": "" }, { "docid": "549fa2e63d543bd5624b85dc054acd57", "score": "0.7495812", "text": "def servers\n configuration....
1ce462ba3c15bcf21ca60a9fc528b79c
Array of symbolized helper methods to expose on the License class
[ { "docid": "96713da36474030227f470450e7b0c33", "score": "0.4960158", "text": "def helper_methods\n members - PREDICATE_FIELDS + PREDICATE_FIELDS.map { |f| \"#{f}?\".to_sym }\n end", "title": "" } ]
[ { "docid": "2ed3bf83c7bbfd850c559693ca177fbb", "score": "0.6475632", "text": "def licenses *names\n names.to_strings.each do |name| \n begin\n module_name = \"#{name.camelize}License\"\n clazz = module_name.constantize\n clazz.new(self).enforce!\n re...
61f20d0a627ba11e05c4d99aa2f2bcfa
LTI AUTHENTICATION most of the LTI stuff happens in the launch_controller
[ { "docid": "a8e19c6a413eb542d7801ac391382986", "score": "0.0", "text": "def load_user\n @auth_user ||= User.find(session[:user_id]) unless session[:user_id].nil?\n end", "title": "" } ]
[ { "docid": "81e9e37a2ee69cfaa79a9cf6f3bec5b2", "score": "0.7584564", "text": "def launch\n # Code based on:\n # https://github.com/IMSGlobal/lti-1-3-php-library/blob/master/src/lti/LTI_Message_Launch.php\n unless File.exist?(\"#{Rails.configuration.lti_config_location}/lti_config.yml\")\n ...
6d8dd61fae7595ab627c8c6054bc8394
POST /images POST /images.json
[ { "docid": "e6ff95bad5579050ee5c7914b481a9ab", "score": "0.0", "text": "def create\n model = params[:type].constantize\n @image = model.new(params[:image])\n @image.save!\n redirect_to :back, :notice => t(\"notice.successfully_created\")\n end", "title": "" } ]
[ { "docid": "1afcdf9e3c6ff84580f999d797e4de34", "score": "0.7459582", "text": "def create\n # byebug\n @image = Image.create(image_params)\n render json: @image\n end", "title": "" }, { "docid": "457f589782dd14d0823d6e5557b2563d", "score": "0.73181874", "text": "def upload_i...
c25f6349b64cab57661d236acbb4e28a
Creates a Gtk::EventBox which displays the time spent / left in the game Arguments : +chrono+ > the chrono object. +parent+ > The GtkObject the ChronoUi is attached to. A Playscreen Object
[ { "docid": "3515a109827983f9bf7b09365aac7220", "score": "0.62222356", "text": "def initialize(chrono,parent)\n\t\t@parent = parent\n\t\t@assets = MenuAssets.getInstance\n @chrono = chrono\n @chTable = Gtk::Table.new(4,7)\n img = Gtk::Image.new(file:File.dirname(__FILE__) + \"/../../../Assets/\"...
[ { "docid": "91dda90aac716755aa57d5c77bc67bc9", "score": "0.59129435", "text": "def show\n @clock.updateTimeLeft()\n end", "title": "" }, { "docid": "0d64cc529767125ad5d28f73244fd26c", "score": "0.523712", "text": "def draw_event_time(text)\n width = Phase::Config::Bar[:time_wi...
295e431091c1afe9a5a0d1c8188b83aa
Use callbacks to share common setup or constraints between actions. Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2c4e8136112b5ecfe4a227de9a92cc2e", "score": "0.0", "text": "def user_params\n params.require(:user).permit(:login, :password, :role)\n end", "title": "" } ]
[ { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.625224", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "6fc66e33c4fa3df2443a99dc75fd5909", "score": "0.602461", "text": "def before_action(controller, context)\n end", ...
22b7e1d57e2f99f23c62be8ecdb97ad2
GET choose winner page
[ { "docid": "c6d7ac6c89be3c4f9b758445a8268536", "score": "0.6693309", "text": "def choose_winner; end", "title": "" } ]
[ { "docid": "f3609be9c11902b7c2088a464a6b2c08", "score": "0.6555233", "text": "def play_game\nget_winner(comp_choose_rps,user_choose_rps)\t\nend", "title": "" }, { "docid": "047f3dee1e326501f5d4c5ee9c841706", "score": "0.62487817", "text": "def show\n @winner = Winner.find(params[:...
9e76bf57f6c621c621e75694ab45e85b
can be used for "As an administrator, I can reserve an available room for a given date range"
[ { "docid": "a658f4484ee46207680abbcb1ecba570", "score": "0.0", "text": "def make_reservation(first_night, last_night=first_night)\n nights = date_range(first_night, last_night)\n rooms_avail = unreserved_and_unblocked(nights)\n if rooms_avail == {}\n raise ArgumentError.new(\"Can't...
[ { "docid": "36bd1a1046285cbd14373df00e6600c2", "score": "0.7864127", "text": "def reserve_room(start_date, end_date)\n start_date = Time.parse(start_date)\n end_date = Time.parse(end_date)\n range = create_hotel_range(start_date, end_date) # for hotel\n e_date = end_date - 1 # rooms do not k...
546544a1972f9bbdf99eaa64532ad3be
DELETE /trabajos/1 DELETE /trabajos/1.json
[ { "docid": "763b11d224bfeba766cadea7755ff4b8", "score": "0.71120113", "text": "def destroy\n @trabajo.destroy\n respond_to do |format|\n format.html { redirect_to cliente_url(@cliente), notice: 'Trabajo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.7252223", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "e7634ae7e65c950f91c08680a9be70f8", "score": "0.7200593", "text": "def destroy\n @trabalho = Trabalho.find(params[:id])\n ...
7a2a82d4c95f08cb45589f303cc15594
Creates a volume group
[ { "docid": "afd93f6632685cd0589ddd9f0780cdf7", "score": "0.81503195", "text": "def create_volume_group(name)\n @logger.debug('Request for creating a new' \\\n \"volume group with name = #{name}\")\n task = JSON.parse(\n @client.post('v2.0', 'volume_groups', { ...
[ { "docid": "2d06e5189d0b58954205f521a8e42ed0", "score": "0.7551376", "text": "def vag_create(group_name)\n api_call = {\n :method => \"CreateVolumeAccessGroup\",\n :params => {\n :name => group_name,\n :attributes => {}\n }\n }\n answer = query_sf(api_call)\n ret...
2711761f6b1d413082e658b904308d0a
Define a subcommand group.
[ { "docid": "985cc918f98daf13979f3bf6e0996f5e", "score": "0.83856916", "text": "def define_command_group name, opts = nil, &blk\n opts = { :documentation => opts } unless Hash === opts\n opts[:supercommand] = self\n cmd = @subcommands.cmd_group name, opts, &blk\n cmd\n end", "t...
[ { "docid": "bd43b438b4d4a8e1649e0adab0f0fd9f", "score": "0.79437155", "text": "def define_command_group name, opts = nil, &blk\n opts = { :documentation => opts } if String === opts\n opts ||= { }\n opts[:documentation] ||= @default_documentation\n cmd = create_command! name,...
b69ab7f206fdd158eeeb7a8cd405a789
DELETE /children/1 DELETE /children/1.xml
[ { "docid": "57706030b4351c6538f1a992763b2ad6", "score": "0.70087814", "text": "def destroy\n @child = Child.find(params[:id])\n @child.destroy\n\n respond_to do |format|\n format.html { redirect_to(children_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "1081dcbd9a7792eafe6ec6e795ed4cdf", "score": "0.7472431", "text": "def delete_child(child); end", "title": "" }, { "docid": "49dd2043fb25938c8a337eba6a87fdeb", "score": "0.7213369", "text": "def delete\n @children = []\n @parent.delete_child(name)\n ...
beaa10409c37ed94134909eecfa29b97
update the item in hash
[ { "docid": "c5fb712341d67736241519bcf3f20d04", "score": "0.7350876", "text": "def update_item(item_name, new_quantity, h)\n h[item_name] = new_quantity\nend", "title": "" } ]
[ { "docid": "4ae9c87a0bde2592e6ec9fd19454ae08", "score": "0.8293938", "text": "def update(hash); end", "title": "" }, { "docid": "af2dbc6ff788a6b513c56a10e378d9af", "score": "0.79491717", "text": "def update (hash, item, quantity= 0)\n\thash[item] = quantity\nreturn hash\nend", "t...
60e7eefa911b2ee37f8bb9e0902001ae
GET /other_visits/new GET /other_visits/new.json
[ { "docid": "991d29b3946953004cb62be105bc69fd", "score": "0.72676224", "text": "def new\n @next_order = OtherVisit.find(:first, :order => \"updated_at desc\")\n if @next_order.nil? or @next_order.order_number.nil?\n @next_order = nil\n else\n @prev_order = @next_order.order_number\...
[ { "docid": "9f9ab3174b6baf1e58a09603d4f851eb", "score": "0.7365454", "text": "def new\n @visit = Visit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @visit }\n end\n end", "title": "" }, { "docid": "9f9ab3174b6baf1e58a09603d4f851...
de92db1dc8fc8b17a83eb3e0d17fa586
When pattern has no matches, go to list page with flash message, title displayed is default no_hits_title
[ { "docid": "b19dbcd2f489e5961eeefafa96e56357", "score": "0.6337645", "text": "def test_user_search_unmatched\n login\n unmatched_pattern = \"NonexistentUserContent\"\n get_without_clearing_flash(:index,\n params: { pattern: unmatched_pattern })\n assert_template...
[ { "docid": "4db444e6c92a1f42deedef767c64c53e", "score": "0.6499546", "text": "def render_search_to_page_title_with_blank_catch(params)\n if render_search_to_page_title_without_blank_catch(params).present?\n render_search_to_page_title_without_blank_catch(params)\n else\n 'Browse Everythi...
a0a826ccbf9181136057e530ee1a21d7
Utility method to explicitly state params accepted by controller
[ { "docid": "eabc448a0125bded0cc36b0abb928dcf", "score": "0.0", "text": "def manuscript_params\n params.require(:manuscript).permit(:title, :author, :journal, :document)\n end", "title": "" } ]
[ { "docid": "499815d044703d8de2c9319aa87f1724", "score": "0.704587", "text": "def params; @controller.params; end", "title": "" }, { "docid": "9b1523f1924ab7f4b5ef36c74153a37c", "score": "0.6942395", "text": "def rails_params=(_); end", "title": "" }, { "docid": "7ba07d...
57e00d39b9aab5b933aaa82ebb906144
Like to_s(), but don't return an empty string in case there are no parts.
[ { "docid": "77cf0ac9d17d1579ba7399a74fc7d8ee", "score": "0.0", "text": "def to_display\n\t\t\tcomparable? ? self.to_s : NONE_STR\n\t\tend", "title": "" } ]
[ { "docid": "b51e11689562472707f5e884ab666215", "score": "0.714655", "text": "def to_s(); ''; end", "title": "" }, { "docid": "7af4133bd9fb822c9e575cc31ff67458", "score": "0.713057", "text": "def to_str; \"\"; end", "title": "" }, { "docid": "0b1cc12809048c01ae10b5b731b30d...
250b47604ec7f3f26349832b10e051a5
This method tells us if the user is an blogger or not.
[ { "docid": "123ed8bf9cde38441fe5dc3613ae9019", "score": "0.8339799", "text": "def is_blogger?\n role == 'blogger'\n end", "title": "" } ]
[ { "docid": "c389ea989a40706822628dcd4aaada10", "score": "0.7760696", "text": "def is_blogger_logged_in?\n !!current_blogger \n end", "title": "" }, { "docid": "117f7140b23e9c41cd07bd06c4bbff00", "score": "0.7491646", "text": "def this_blogger?(post)\n current_blogger == ...
747bdac10ebd9915a676cf63d5dbf8d4
get specific field to search if present
[ { "docid": "21ec3aeac167283bbad61d299bae0295", "score": "0.0", "text": "def find_by\n @params['find_by'] if @params.keys.include?('find_by')\n end", "title": "" } ]
[ { "docid": "0bb4fb9001162ce25df97f8bc42d37af", "score": "0.7092283", "text": "def get_field_from_solr id, field\n result = Blacklight.solr.find( {:q => 'id:\"'+id+'\"', :qt => 'document', :fl => field, :rows => 1 } )\n result[\"response\"][\"docs\"].empty? ? nil : result[\"response\"][\"docs\"].fi...
22b20003051a6f933cb129b921382246
Used to disable lifecycle for bucket
[ { "docid": "e3a211ba158098f208e7bcee255cb2b3", "score": "0.8097023", "text": "def disable_lifecycle\n !!client.bucket_disable_lifecycle\n end", "title": "" } ]
[ { "docid": "532fdadd9ab0d761894cf02aa16da4fb", "score": "0.864815", "text": "def bucket_disable_lifecycle\n query = { 'lifecycle' => false }\n http.delete('/', query: query, bucket: bucket)\n end", "title": "" }, { "docid": "d87bd3208aadb1457180525fd84eef1f", "sc...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "981d61c9209b0edb6e9acce0384e4984", "score": "0.0", "text": "def set_word\n word = WordClass.new(params[:titulo])\n @word = Word.find_by(titulo: word.url_serialize)\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...
11f72e58d39304118af11b91716a742f
DELETE /inventories/1 DELETE /inventories/1.json
[ { "docid": "05cd5b5e85a2491c330917848ad07a3f", "score": "0.6766414", "text": "def destroy\n @inventory.destroy\n respond_to do |format|\n format.html { redirect_to inventories_url, notice: 'Inventory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "eebc5a988a118f597f74482771163865", "score": "0.7225345", "text": "def destroy\n @inventory = @user.inventories.find(params[:id])\n @inventory.destroy\n\n respond_to do |format|\n format.html { redirect_to game_user_inventories_url }\n format.json { head :no_content }\n ...
d777cf4d713b94d91e40e5eb419f34fa
list of possible veichles to choose from
[ { "docid": "cfed7193a5744c28a319a4a896dab54e", "score": "0.6383191", "text": "def veichles\n ['Bil', 'Moped', 'Motorsykkel', 'Tungt kjøretøy', 'ATV', 'Buss', 'Sykkel']\n end", "title": "" } ]
[ { "docid": "233a2371de4930e7acf3eb8143c221ee", "score": "0.6271729", "text": "def all_the_choices\n solution_pool_temp = []\n for i in 0..5\n for j in 0..5\n for k in 0..5\n for l in 0..5\n solution_pool_temp.push([COLOR_CHOICES[i], COLOR_CHOICES[j], COLOR_CHOICES[k...
9a7928c9c8edc3dc56af78d8d8470c81
Specify a custom url path to retrieve send the service call to. Article.find(:all).from :published
[ { "docid": "e8ed57dd9502a053b467bf303025c7dc", "score": "0.0", "text": "def from(f); @from = f; self; end", "title": "" } ]
[ { "docid": "5fedcd51f360665ed23d25e446c033cb", "score": "0.6354034", "text": "def index\n # Use the custom Article.published method to return all articles that is\n # marked published.\n @articles = @query.publishings.try(order_param).page(params[:page])\n render 'api/v1/articles/index'\n e...
673f64e6f62c8c6c596a49c62a9c72b6
POST /faleconoscos POST /faleconoscos.json
[ { "docid": "296511368be4a4d782f3d5650e38cda2", "score": "0.7179487", "text": "def create\n @faleconosco = Faleconosco.new(faleconosco_params)\n\n respond_to do |format|\n if @faleconosco.save\n format.html { redirect_to @faleconosco, notice: 'Faleconosco was successfully created.' }\n ...
[ { "docid": "e56464b243ed2780e018bb79235fc3df", "score": "0.6291851", "text": "def create\n\n @frasco = Frasco.new(frasco_params)\n\n respond_to do |format|\n if @frasco.save\n format.html { redirect_to @frasco, notice: 'Frasco was successfully created.' }\n format.json { render ...
be1f2c9e1a54f222cdce9bf1c8e0ae52
skip_before_filter :authenticate GET /zombies GET /zombies.json
[ { "docid": "638d2841b6b11e54557b24f1bfa9ce33", "score": "0.0", "text": "def index\n @students = Student.all\n render json: {students: @students}\n end", "title": "" } ]
[ { "docid": "2123f3b52ab4613bfe8dd9f579ac6f74", "score": "0.603752", "text": "def index\n render json: Buyer.all, except: :password_digest\n end", "title": "" }, { "docid": "bab8419c55ce4e40316df4e07c481345", "score": "0.60222024", "text": "def index\n @undead_banes = UndeadBan...
9fcf5a49f62073375826a40650ef295c
Tries to parse a declaration, and returns the value parsed so far if it fails. This has three possible return types. It can return `nil`, indicating that parsing failed completely and the scanner hasn't moved forward at all. It can return an Array, indicating that parsing failed after consuming some text (possibly cont...
[ { "docid": "e8c348369f2265da01037f0abd5b637c", "score": "0.0", "text": "def try_declaration; end", "title": "" } ]
[ { "docid": "c0ed0703f936da081a74efffcecab1ba", "score": "0.6516006", "text": "def parse_declaration(input = @tokens)\n input = TokenScanner.new(input) unless input.is_a?(TokenScanner)\n\n while input.peek && input.peek[:node] == :whitespace\n input.consume\n end\n\n if input.p...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "0d5a67f1444f7b06b24c5c45c9419596", "score": "0.0", "text": "def multimedia_type_params\n params.require(:multimedia_type).permit(:name_multimedia_type, :desc_multimedia_type)\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"...
c70fffdf12d341bcf1b29d000c3702df
GET /events/1 GET /events/1.json
[ { "docid": "23e812655b53bd4254d6112fdc9bb31d", "score": "0.0", "text": "def show\n if admin?\n @event = Event.find_by_slug(params[:id]) \n else\n @event = Event.published.find_by_slug(params[:id]) \n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.js...
[ { "docid": "2d5580b43c7c18bcd8a06713fa4be0f1", "score": "0.75926495", "text": "def show\n\t\tevent_id = params[:id]\n\t\tif event_id.present?\n\t\t\t@event = Com::Nbos::Events::Event.active_events.where(:id => event_id)\n\t\t\trender :json => @event\n\t\telse\n\t\t\trender :json => {status: 400, message...
c95fff22d14425c8c7436591abc20a34
Returns value by key.
[ { "docid": "9bac18e1b010babaf49b2b1586dd5342", "score": "0.0", "text": "def [](key)\n @h[key]\n end", "title": "" } ]
[ { "docid": "6e0764fd23cdcf8d6b190ff54cae7a57", "score": "0.8204997", "text": "def getValue(key)\n return @values[key]\n end", "title": "" }, { "docid": "b2d3f3e5d7cd24412fa021d9aacfb02a", "score": "0.8063598", "text": "def [](key)\n get_value(key)\n end", "title": "" ...
195845e021fd78fd62343ef5fbf731cb
GET : renders list of users checks for order_by params and sets ordering accordingly checks for search params and adds query options accordingly sort by status needs a custom sorting logic where sorting is decided by predefined array of statuses
[ { "docid": "d14e273777edb83aeaaadf599fcf7a66", "score": "0.7077231", "text": "def users\n order = params[:order_by] || \"default\"\n order_type = params[:order_type] || \"ASC\"\n case order\n when \"default\"\n order = \"suitability_user_assessments.completed_at DESC\"\n when \...
[ { "docid": "9cdf8ec1be271c516688a09a46b2e7b5", "score": "0.7658464", "text": "def list\n username = params[:username].blank? ? '' : params[:username]\n role = params[:role].blank? ? 0 : params[:role].to_i\n employee = params[:employee].blank? ? '' : params[:employee]\n status = params[:statu...
897d63c45a2a9c334b5e3cf64202927d
Test that decoding a float as a string works.
[ { "docid": "5a2a79e5fbbcaf975042cde21d216e5d", "score": "0.7735733", "text": "def test_decode_float()\n input = [\n 131, 99, 49, 46, 49, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,\n 48, 48, 48, 48, 56, 56, 56, 50, 101, 43, 48, 48, 0, 0, 0, 0, 0]\n expected = 1.1\n\n stream = Erlang::...
[ { "docid": "53ec5b0a7657bbce0066c67f38a4dd28", "score": "0.7529086", "text": "def test_parse_float_string\n assert_equal 0.0, parse_float_string(\"\\x00\\x00\\x00\\x80\")\n assert_equal -100.0, parse_float_string(\"\\x00\\x00\\xc8\\xc2\").round(2)\n assert_equal -122.44, parse_float_string(\"\\...
986420b1cb2d2fc425faddc1d24f7665
Helper method that defaults the submitted time.
[ { "docid": "6897b0607281046f1520a7600511c351", "score": "0.0", "text": "def add_link(target)\n link = Link.new\n link.target_type = target.class.to_s\n link.target_id = target.id\n #adding a link to the link collection should set the polymorphic assosication\n ...
[ { "docid": "75ce0b562ae78905014edfa410c1fab7", "score": "0.7334785", "text": "def submitted_date_time=(value)\n @submitted_date_time = value\n end", "title": "" }, { "docid": "75ce0b562ae78905014edfa410c1fab7", "score": "0.7334785", "text": "def submitted_da...
c1cfc6a6476c78c1a758bfd3b0558f2e
GET /goals GET /goals.json
[ { "docid": "a185a9f3460855d4d60fef69eae53c4f", "score": "0.64168024", "text": "def index\n @user = current_user\n @goals = @user.goals.order(last_checkin: :asc)\n @social_goals = @user.social_goals\n @goal_owners = @user.goal_owners\n end", "title": "" } ]
[ { "docid": "de74e25a31dcc4628b9e7b58cd1c0adc", "score": "0.80164856", "text": "def index\n\t\t@goals = current_user.goal\n\t\trender json: @goals, status: 200 \n\tend", "title": "" }, { "docid": "f00ae4266a9a3f58815f0b1fc73f7070", "score": "0.79188377", "text": "def index\n @goals...
453e4df1b3f7a78231a7010fa450ff19
Sets modes from ProtocolMessageflags
[ { "docid": "eacf60313e971790d7adbda889a6f4d8", "score": "0.787178", "text": "def set_modes_from_flags(flags)\n return unless flags\n\n message_modes = MODES.select do |mode|\n flag = Ably::Models::ProtocolMessage::ATTACH_FLAGS_MAPPING[mode.to_sym]\n flags & flag == flag\n en...
[ { "docid": "c57a798e650376bc18af4173321c9715", "score": "0.6592386", "text": "def modes_to_flags\n modes.map { |mode| Ably::Models::ProtocolMessage::ATTACH_FLAGS_MAPPING[mode.to_sym] }.reduce(:|)\n end", "title": "" }, { "docid": "2843ad31f93c1aea5a92dd7d4c64558f", "score": "0.64...
9b33e128a3ae8586974fbbdbaedec1ec
Define what happens when the measure is run
[ { "docid": "9e345fe1b67e6a7d75d904868521c3fb", "score": "0.0", "text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # Use the built-in error checking\n if !runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n # ...
[ { "docid": "99ab945a1927e84fe17934e1440b9eb0", "score": "0.748641", "text": "def measure(&block); @measure = block; end", "title": "" }, { "docid": "98be183bacea0b93f865dcb476b3ac9c", "score": "0.7055002", "text": "def measure(&block)\n @measure = block\n end", "title": "" ...
2ca2d1359356fbf32a2d1ab28047070f
When logging in (session_controller), nil is passed as the access token and init_access_token() is called to obtain an access token from FB. In other controllers, this object is initialized with the access token stored in the session object.
[ { "docid": "e2abb1ad0b255bd8202256f41f461183", "score": "0.6820421", "text": "def initialize(access_token)\n @app_id = Rails.application.config.facebook_app_id\n @app_secret = Rails.application.config.facebook_app_secret\n @redirect_uri = Rails.application.config.facebook_redirect_u...
[ { "docid": "5855168556a8a7e102f2b8e9eee8465f", "score": "0.757098", "text": "def init_access_token(params)\n @access_token = request_token.get_access_token(params)\n end", "title": "" }, { "docid": "87398482d72640d3f6a6f5431a347873", "score": "0.7454307", "text": "def init_oa...
29e66dea726e41362670c5b97479711c
returns information about the exception, like the class name, the message, the backtrace, the cause ( if gem 'cause' is used)
[ { "docid": "eda9beceec8b284ca47b88e8ff9abb9d", "score": "0.65973", "text": "def exception_data\n exception_service.merge(\n error_class: @exception.class.to_s,\n message: @exception.respond_to?(:message) ? @exception.message : exception.inspect,\n backtrace: @exception.respond...
[ { "docid": "2862596235ffac52b774e5a9e86b6fec", "score": "0.7412299", "text": "def exception_info(e)\n backtrace = Array(e.backtrace)[0, 500]\n\n res = {\n 'class' => e.class.to_s,\n 'message' => e.message,\n 'backtrace' => backtrace.join(\"\\n\"),\n 'rollup' => Dig...
c6152b22d1aa2f9fcd89255319328db1
Allows customer attributes to be passed in from a form when signing up
[ { "docid": "3023c184b34194e7d1c60a2d4c2aebd9", "score": "0.0", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up).push(:avatar_file_name, :avatar_content_type,\n :avatar_file_size, :avatar_updated_at, :company_name, :country_id, :firstname,\n :interna...
[ { "docid": "e4465b738cd1ac4993c54a35a0617726", "score": "0.6648997", "text": "def customer_params\n params.fetch(:customer, {}).permit(\n :first_name,\n :last_name,\n :company_name,\n :company_id,\n :email,\n :is_professional,\n :address,\n :zip...
c022e1c410125020c72479d724bf3145
Post feed: posts written by User and their friends in reverse chronological order Adds attributes for number of likes (like_count), is it liked by some User (user_likes)
[ { "docid": "7c52577cc6b740451bd7428f5976a9b3", "score": "0.7666252", "text": "def post_feed\n Post.select(\"posts.*\",\n \"COUNT(likes.user_id) AS like_count\",\n \"COUNT(ul.user_id) AS user_likes\")\n .left_joins(:likes)\n .joins(\"LEFT JOIN likes ul ON ul.pos...
[ { "docid": "718a78203a30b7bbf3770fe566e40139", "score": "0.74765515", "text": "def posts_user_like_count\n count = 0\n posts.map do |p|\n vk_client.likes.get_list(owner_id: id, type: 'post', item_id: p.id).users.each do |u|\n count += 1 if u == user_id\n end\n end\n...
ccb20582c5695df52552d89c35206b33
PUT /truck_groups/1 PUT /truck_groups/1.json
[ { "docid": "1e09e68ccf89a9e9fe2df34144367cf0", "score": "0.7141207", "text": "def update\r\n @truck_group = TruckGroup.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @truck_group.update_attributes(params[:truck_group])\r\n format.html { redirect_to @truck_group, notice: 'Truck...
[ { "docid": "bc07532f1f27eb69006d34b15668626a", "score": "0.67161435", "text": "def UpdateGroup params = {}\n \n APICall(path: 'groups.json',method: 'PUT',payload: params.to_json)\n \n end", "title": "" }, { "docid": "8937194ffef8886922cd228b4e324703", "score": "...
36ef044f588693b366b2d08229703243
Class Method ============================================================================== Method ==============================================================================
[ { "docid": "e8d2c04922c50f2e59c5b16945d94a54", "score": "0.0", "text": "def filename_sanitize_ext(filename)\n filename = filename.split('.')\n ext = filename.delete(filename.last)\n random = SecureRandom.hex(2)\n return filename.join().parameterize + \"-#{random}.#{ext}\"\n end", "title...
[ { "docid": "70a9ab19790aba2cea22b6ec1c17d391", "score": "0.64967406", "text": "def private_class_method\n end", "title": "" }, { "docid": "49560b3ade41bfbe4a3b9d6b401dd517", "score": "0.6379178", "text": "def exc; end", "title": "" }, { "docid": "7898d3d2aa84e38eaf45...
aa1e6faebe75616323e402af8b3fd5ae
GET /creates/1 or /creates/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a9b819643df3fe9bce8176e96a563655", "score": "0.6492483", "text": "def index\n @creates = Create.all\n end", "title": "" }, { "docid": "f57d6fc8d77bb99eefe2021e73d9257c", "score": "0.64167565", "text": "def create\n streak, success = jsonapi_create.to_a\n\n i...
2b9daad786e19c52f9822f8f22ac9d26
hello it is data some source code
[ { "docid": "92c6554b75eee4e1804ffa36098f7d5a", "score": "0.0", "text": "def initialize(secret, *signature_key_or_options)\n options = signature_key_or_options.extract_options!\n sign_secret = signature_key_or_options.first\n @secret = secret\n @sign_secret = sign_secret\n @cipher = options[:cipher]...
[ { "docid": "6ffcd5be6264e90fc3d9ade5c8c96f76", "score": "0.6557435", "text": "def source() end", "title": "" }, { "docid": "f5f8feb6676e859831e81b994743faa4", "score": "0.61961734", "text": "def string=(code); end", "title": "" }, { "docid": "400c209566598c0a66b1324bf65a4...
3c929cb1078d450c3643468166fe901e
POST /archivo_hitos POST /archivo_hitos.json
[ { "docid": "185acc7d2df5f5594ffd847c8b071aab", "score": "0.5542724", "text": "def create\n @archivo_hito = ArchivoHito.new(archivo_hito_params)\n\n respond_to do |format|\n if @archivo_hito.save\n format.html { redirect_to @archivo_hito, notice: 'Archivo hito was successfully created.'...
[ { "docid": "c142dc9f10a71c60522a01de5f1cbe4a", "score": "0.6223203", "text": "def index\n @archivo_hitos = ArchivoHito.all\n end", "title": "" }, { "docid": "d929a418bf867d5bb9a11f73633ae437", "score": "0.605789", "text": "def create\n @hit = Hit.new(params[:hit])\n\n respo...
63e16dc4d218513e4026892aba50f02a
GET /hashtags/1 GET /hashtags/1.xml
[ { "docid": "a9c9acef4afe149b1cb868d8487c5605", "score": "0.6638211", "text": "def show\n @hashtag = Hashtag.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hashtag }\n end\n end", "title": "" } ]
[ { "docid": "a3e2661d95238ea21bd5cacde1ce412c", "score": "0.6535454", "text": "def index\n @hashtags = Hashtag.all\n end", "title": "" }, { "docid": "a3e2661d95238ea21bd5cacde1ce412c", "score": "0.6535454", "text": "def index\n @hashtags = Hashtag.all\n end", "title": "" ...
064a6727923700801f46b4b46311ad10
BADGE extra code for awarding badges here
[ { "docid": "2a01ede8272bc00f9a5e8b748b351ca0", "score": "0.0", "text": "def badge_level(name)\n these_badges = self.badges.find_all { |b| b.name == name }\n if these_badges.any?\n these_badges.sort_by { |b| b.level }.last.level\n else\n 0\n end\n end", "title": "" } ]
[ { "docid": "937d5fc30f6eae47a5235a8e5e385ce5", "score": "0.7763531", "text": "def badges\n end", "title": "" }, { "docid": "f47648e4f53144d8e7de3ee1a252a100", "score": "0.73694384", "text": "def badge; end", "title": "" }, { "docid": "0d6627f3013b2b0b35ea580d6f444f77", ...
567a35b55d57cd4c88f63996bd8c7d30
DELETE /distributor_missed_pincodes/1 DELETE /distributor_missed_pincodes/1.json
[ { "docid": "970ca76cba26da7624fea33101a2f627", "score": "0.7924933", "text": "def destroy\n @distributor_missed_pincode.destroy\n respond_to do |format|\n format.html { redirect_to distributor_missed_pincodes_url, notice: 'Distributor missed pincode was successfully destroyed.' }\n forma...
[ { "docid": "1daccabb1300867d8b7edbcdcfac24b2", "score": "0.67503977", "text": "def destroy\n @pincode.destroy\n respond_to do |format|\n format.html { redirect_to pincodes_url, notice: 'Pincode was successfully destroyed.' }\n format.json { head :no_content }\n\n token = session[:ac...
6fa8627e151325042105a0d7e362d3df
dump a cluster and its subclusters to the console.
[ { "docid": "e208af2d6d121215d456391b025bcd42", "score": "0.6325779", "text": "def dump(response, level = 0)\r\n response['clusters'].each do |cluster|\r\n print \"%s%s [%i document(s)]\\n\" %\r\n [\" \" * (level + 1),\r\n cluster['phrases'].join(\", \"),\r\n c...
[ { "docid": "8dc9d872de514f539a7d4d2e4834603e", "score": "0.6652334", "text": "def dumpCluster(cluster)\n $evm.log(\"info\",\"#{@method} - Cluster:<#{cluster.name}> Begin Attributes [cluster.attributes]\")\n cluster.attributes.sort.each { |k, v| $evm.log(\"info\", \"#{@method} - Cluster:<#{cluster....
a9878ab2be04e792688d69b4511f0836
end of init metnod
[ { "docid": "3f12b06019eb8b8902a051c9857bee9e", "score": "0.0", "text": "def value_set(filename)\n\t\t\t@filename = filename\n\t\t\t@offset = 0\n\t\t\t@line = \"\"\n\t\tend", "title": "" } ]
[ { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.88677174", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.88677174", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "...
847ef0becfe6af49a0f8d2218a425636
This method should delete the contact HINT: Check the Array class docs for builtin methods that might be useful here
[ { "docid": "49dd3ee3ec41bda914692a55bbe5a489", "score": "0.7534675", "text": "def delete\n @@contacts.delete(self)\n end", "title": "" } ]
[ { "docid": "6b8f248a1f8ac917755c787c3eb24594", "score": "0.80965954", "text": "def delete\n @@contacts.delete(self) #I'm honestly just making an educated guess with this one. Or just a regular guess.\n end", "title": "" }, { "docid": "42eb4de443475684d90920cf3d1b62f2", "score": "0....
728df5d580a9b047c664bd884704051f
Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.)
[ { "docid": "bfadd77a35de369b762578ca01ab040d", "score": "0.77002114", "text": "def managedObjectContext\n unless @managedObjectContext\n coordinator = self.persistentStoreCoordinator\n if coordinator\n @managedObjectContext = NSManagedObjectContext.new\n @managedObjectContext....
[ { "docid": "73a67f4dbbdcde39d42aba2509d6d7b7", "score": "0.7330786", "text": "def managedObjectContext\n if @managedObjectContext\n return @managedObjectContext\n end\n\n coordinator = self.persistentStoreCoordinator\n if coordinator != nil\n @managedObjectContext = NSManagedObject...
04685ee1113149d76c23ae44ca15d813
POST /members POST /members.json
[ { "docid": "d9c9b570e9ce0beafd73189051d068c4", "score": "0.6595865", "text": "def create\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render json: @member, status: :created, location: @m...
[ { "docid": "0da26b7aa32be08283438deaf34ac0e0", "score": "0.6734318", "text": "def add_member_to_list(user, list, member_id, options={})\n post(\"/#{user}/#{list}/members.json\", options.merge(:id => member_id))\n end", "title": "" }, { "docid": "dfc0bebba417ecc03e98c03a4309fc7d", ...
b73ca07cb144249ba3723a97e566e75e
Run restorecon to fix label
[ { "docid": "6d9052dd33184bd23143c0161d89bd54", "score": "0.0", "text": "def relabel_files\n spec = new_resource.file_spec\n escaped = Regexp.escape spec\n\n # find common path between regex and string\n common = if spec == escaped\n spec\n ...
[ { "docid": "45121f5b1abd01d4a94e93d89b2d8f40", "score": "0.62569946", "text": "def _restore # restore ?(label)\r\n pc = @pc\r\n\r\n $state.data = $gtk.deserialize_state 'app/save.txt'\r\n @pc = $state.data.pc\r\n\r\n data = $gtk.read_file 'app/save.data'\r\n if data\r\n @memory = dat...
784408e7c91ac5fcce7b1b54f6c05f62
:category: High level is a deletion notification ?
[ { "docid": "c8b707f17a7997e51e0802e04dfafc88", "score": "0.6916533", "text": "def delete?\n self.notification_type.human==\"Delete\"\n end", "title": "" } ]
[ { "docid": "386a2ec636bda9293210dbf3f3884e86", "score": "0.6952451", "text": "def deleted(item)\n end", "title": "" }, { "docid": "b6dd47ded11d30c2a2d33a492edff118", "score": "0.69250923", "text": "def notify_deletion\n Services::ServiceScheduledForDeletionEvent.create_and_publ...
433a5bb58fe940006f33c64ad94ff9cc
POST /attachments POST /attachments.json
[ { "docid": "34ba49a698e702ad9e0ca4b68958b33a", "score": "0.6243306", "text": "def create\n @attachment = Attachment.new(attachment_params)\n @attachment.user_id = current_user.id\n @attachment.num_queue = 0\n respond_to do |format|\n if @attachment.save\n format.html { redirect_t...
[ { "docid": "0c3f4c69077dcf215c275689b7c858f6", "score": "0.73675305", "text": "def postAttachments(cardId, file, name)\n\tresponse = RestClient.post(\n\t\t\t'https://api.trello.com/1/cards/'+cardId+'/attachments',\n\t\t\t:file => file,\n\t\t\t:name\t\t\t\t=> name,\n\t\t\t:key => $key,\n\...
5da11140dbf2ff34a5d4b51f0f5b93dc
Similar to Targeturl_pattern but considering the in scope domains as well
[ { "docid": "7e9b3d2005780f0acc41f1d2941ce8f1", "score": "0.6442803", "text": "def scope_url_pattern\n return @scope_url_pattern if @scope_url_pattern\n\n domains = [uri.host + uri.path]\n\n domains += if scope.domains.empty?\n Array(scope.invalid_domains[1..-1])\n ...
[ { "docid": "7a45e3900b7e5e4440d85de27f2c8dd3", "score": "0.593229", "text": "def reg_url; /(.+)/; end", "title": "" }, { "docid": "7a45e3900b7e5e4440d85de27f2c8dd3", "score": "0.593229", "text": "def reg_url; /(.+)/; end", "title": "" }, { "docid": "54e5f0f645425da2eb312a...
abaca09445b28d9b7cfcbc58feb32214
Use callbacks to share common setup or constraints between actions. def set_category
[ { "docid": "54ad8b514eb0f8dc660d342d2cd025a0", "score": "0.0", "text": "def load_product\n @product = Product.find(params[:product_id])\n end", "title": "" } ]
[ { "docid": "db23f6cc6028a88c1f2038a54253550f", "score": "0.68532133", "text": "def set_category(val)\n self.category = val\n self\n end", "title": "" }, { "docid": "fe33ab202612f2766759e4f1e49ee1e5", "score": "0.67909825", "text": "def set_category\n @category = Cat...
493fdcef847a9e34e97d5afcf1f7a1ce
Checks whether there are duplicate assignments of the same name by the same instructor. If the assignments are assigned to courses, it's OK to have duplicate names in different courses.
[ { "docid": "522bd56424c8d12375a091e29da08f3d", "score": "0.81196415", "text": "def duplicate_name?\n if course\n Assignment.find(:all, :conditions => ['course_id = ? and instructor_id = ? and name = ?',\n course_id, instructor_id, name]).count > 1\n else\n Assignment.find(:all, :c...
[ { "docid": "5bdc26c653a72f359c3dbcdbef293dfa", "score": "0.80754364", "text": "def duplicate_name?\n if course\n Assignment.find(:all, :conditions => ['course_id = ? and instructor_id = ? and name = ?', \n course_id, instructor_id, name]).count > 1\n else\n Assignment.find(:all, :...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7d367e72ee513038a2b0bfbf1e6f0ad6", "score": "0.0", "text": "def set_ticket_loop\n @ticket_loop = TicketLoop.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163443", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.604317", "text": "def action_hook; ...
940f69fc7c8442369455954435ca1329
POST /gifts POST /gifts.json
[ { "docid": "9ddd3cda4b2af9c8528c9a495eebd576", "score": "0.0", "text": "def create\n @gift = Gift.new(gift_params)\n\n respond_to do |format|\n if @gift.save\n format.html { redirect_to @gift, notice: 'Gift was successfully created.' }\n format.json { render :show, status: :crea...
[ { "docid": "56303d95b04cf85ad4bfa50a90f06efd", "score": "0.730762", "text": "def create\n @gif = Gif.new(params[:gif])\n\n respond_to do |format|\n if @gif.save\n format.html { redirect_to @gif, :notice => 'Gif was successfully created.' }\n format.json { render :json => @gif, :...
85cc2336bb3e83ac8e708aaa42ef8a39
Get the URL to a given variant, by style. This method handles both `has_one_attachment` and `has_many_attachments` relationships. If aname resolves to a `ActiveStorage::Attached::Many`, the idx parameter indicates which attachment to target. If sname is a string or a symbol, the method looks it up in the styles that we...
[ { "docid": "e326d4c6044153060757ed43bd7222d1", "score": "0.73902094", "text": "def attachment_variant_url(aname, sname, *rest)\n a = (aname.is_a?(String) || aname.is_a?(Symbol)) ? send(aname) : aname\n opts = if a.is_a?(ActiveStorage::Attached::One)\n rest[0]\n ...
[ { "docid": "8fb83b212af85a2acdefc2d67665ea76", "score": "0.6732688", "text": "def attachment_variant(aname, sname, *rest)\n pp = (sname.is_a?(Symbol) || sname.is_a?(String)) ? self.class.attachment_style(aname, sname) : sname\n a = (aname.is_a?(String) || aname.is_a?(Symbol)) ? send(aname)...
9240380e401c7c120a1fd34497e5ca11
DELETE /torrents/1 DELETE /torrents/1.xml
[ { "docid": "5c56e95b8f103d329985ba27f20a2ca7", "score": "0.7438704", "text": "def destroy\n @torrent = Torrent.find(params[:id])\n @remote.remove_torrent(@torrent)\n @torrent.set_state(:skipped)\n @torrent.save\n\n respond_to do |format|\n format.html { redirect_to(torrents_url) }\n ...
[ { "docid": "1a3b6c417deb7c9b51a96197e1c2e78c", "score": "0.78690445", "text": "def destroy\n @torrent = Torrent.find(params[:id])\n @torrent.destroy\n\n format.html { redirect_to(torrents_url) }\n format.xml { head :ok }\n end", "title": "" }, { "docid": "7258fe7be12a71e9dd...
4bf62dbb7abc136a428aa69634c17229
Tells if there is any input signal.
[ { "docid": "a652e04ce6a584a11f803fd72de7b1cc", "score": "0.69279474", "text": "def has_input?\n return !@inputs.empty?\n end", "title": "" } ]
[ { "docid": "a57ba43074a6c86a2f0764e09de8f7de", "score": "0.7888782", "text": "def has_signal?\n return ( self.has_input? or self.has_output? or self.has_inout? or\n self.has_inner? )\n end", "title": "" }, { "docid": "0dcf29e7cddf31ed8c61a029d850a272", ...
938526712c776358c0e75d6df145d4c1
DELETE /cnhs/1 DELETE /cnhs/1.json
[ { "docid": "f22f08319c37ec6bcac2a2f301013c35", "score": "0.7265562", "text": "def destroy\n @cnh.destroy\n respond_to do |format|\n format.html { redirect_to cnhs_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b5588e2d9c888828301667ff12b3750b", "score": "0.69626045", "text": "def destroy\n @hc.destroy\n respond_to do |format|\n format.html { redirect_to hcs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a50...
6c04d41b7b8700c36cd8ab0d08fc3c26
GET /enseignants/1 GET /enseignants/1.xml
[ { "docid": "99deaa45e40058e6e688f7eacdd1d8a5", "score": "0.0", "text": "def show\n @adresse = @enseignant.adress(session[:locale])\n #########################################\n # Les Contributions de Cette enseigant\n @prof_enseigns = @enseignant.enseignements\n @contribution = Contri...
[ { "docid": "c93985a43be8d0c9fcaa258e860ae1d3", "score": "0.6328796", "text": "def show\n @entree = Entree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @entree }\n end\n end", "title": "" }, { "docid": "88505bdde...
480d7e0f104f9b446ef960ef53f00a1a
Search for line of three consecutive counters. Start from the position of the latest counter. Search in all available directions. If another 2 eligible counters are of the same color, then there is a "line of three". Note: these methods overwrite the identical ones in class Board
[ { "docid": "6f734f1473c8f0790e0826bbfa960c67", "score": "0.0", "text": "def line_of_three?\n puts \"in line-of-thre ... ? \"\n result = vert_d? || horiz_lr? || diag_bltr? || diag_brtl?\n # see meanings of abreviations in methods below\n end", "title": "" } ]
[ { "docid": "0e5f66c4e13c9884bb20c3094d999129", "score": "0.6645942", "text": "def line_of_two? # look for adjacent counter of same color \n puts \"in line-of-two? \"\n case @frame[@row][@col] \n when @frame[@row - (num + 1)][@col], # vertically down \\\n ...
973aa8b4c9a7548fd78d17772115a9ba
DELETE /machine_user_phones/1 DELETE /machine_user_phones/1.xml
[ { "docid": "1240c488e07ed0514fe23e17d73d1238", "score": "0.71961147", "text": "def destroy\n @machine_user_phone = MachineUserPhone.find(params[:id])\n @machine_user_phone.destroy\n\n respond_to do |format|\n format.html { redirect_to(machine_user_phones_url) }\n format.xml { head :o...
[ { "docid": "d8a72277365bbd9edea72d64c8238e2d", "score": "0.65968436", "text": "def removeDevice\n # Removes the files first\n begin\n removeContent\n rescue Exception => e\n putsE(e)\n end\n \n # Remove device_auth_groups\n begin\n DeviceAuthGroup.delete_all(:device_i...
7a7dfabe9c4f05e988ed77732eafaabf
Close this logger, flushing the remaining data to I/O
[ { "docid": "49db49667bd465ae5a959471f4851b10", "score": "0.7368187", "text": "def close\n if threaded?\n @dump_queue.push nil\n @dump_thread.join\n end\n ensure\n logfile.close\n end", "title": "...
[ { "docid": "9fc4f8d3591c07fe3a45d9985ea71121", "score": "0.8358884", "text": "def close\n flush\n @log.close if @log.respond_to?(:close)\n @log = nil\n end", "title": "" }, { "docid": "1e372c04974ca103f9e7ecb8c79121c9", "score": "0.810501", "text": "def close\n ...
b54055eaf23030d28f0fe5cc73a54bfa
The apoapsis radius, if the eccentricity is less than one.
[ { "docid": "92f0d97cdee49f44919398a614c3054f", "score": "0.5489344", "text": "def apoapsis\n if self.closed?\n return self.semimajor_axis * (1 + self.eccentricity)\n else\n return nil\n end\n end", "title": "" } ]
[ { "docid": "f04526dace08f48263fdbd39d78be684", "score": "0.69844806", "text": "def earth_radius \n 6378137\n end", "title": "" }, { "docid": "028643533cce8ec5fed2a7624abeacfe", "score": "0.6896822", "text": "def radius_of_circumscribed_circle\n (length_ab * length_bc * len...