query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "615f9ddaa5fd968f73165b1fca700864", "score": "0.0", "text": "def set_task\n @task = Task.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
df7381067a227f8c50b2f715d69a5fb6
POST /sales_associates POST /sales_associates.json
[ { "docid": "53a0c81d56e3f9ddab916cc6878e96e0", "score": "0.73303646", "text": "def create\n @sales_associate = SalesAssociate.new(sales_associate_params)\n\n respond_to do |format|\n if @sales_associate.save\n format.html { redirect_to @sales_associate, notice: 'Sales associate was suc...
[ { "docid": "f7119fa9bddb7ba3103b1f8b9883f7ea", "score": "0.6265727", "text": "def set_sales_associate\n @sales_associate = SalesAssociate.find(params[:id])\n end", "title": "" }, { "docid": "e497240f833dd37ed154512dad867c4b", "score": "0.62097234", "text": "def sales_associat...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "084bc88c027cb37d9c5ae4ceaac88804", "score": "0.0", "text": "def set_clinic_condition\n @clinic_condition = ClinicCondition.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
d703bf9c998cb4a090de79501f5d66c1
GET /tagsearches/1 GET /tagsearches/1.json
[ { "docid": "03dda3cf5828852e3dac82db41d2e5a2", "score": "0.6690158", "text": "def show\n @tagsearch = Tagsearch.find(params[:id])\n @base_url = 'http://api.douban.com/v2/movie/search?tag='\n @result_tag = JSON.parse(open(URI.encode(@base_url + @tagsearch.tag)).read)\n\n respond_to do |format...
[ { "docid": "e3324bde5c6549fd1481bca57d60ade4", "score": "0.70475006", "text": "def index\n @tags = Tag.all#.search(params[:query])\n end", "title": "" }, { "docid": "eff2a32fa9962a16b92dd167fc694dc8", "score": "0.6965147", "text": "def tags\n klass = Object.const_get(\"Concept...
6bdfe54e558ccc5f2966a43d299d16c3
Check if cache time has expired
[ { "docid": "8cbf8fd0d3893488e9d778a2f86970a4", "score": "0.0", "text": "def time_check_allow?(key, stamp)\n Time.now.to_i - stamp.to_i > apply_limit(key)\n end", "title": "" } ]
[ { "docid": "bf971416243658c6bad2f6f85b20691c", "score": "0.867696", "text": "def is_expired?(cache)\n cache[\"date\"].to_i < (Time.now.to_i - CACHE_DURATION)\n end", "title": "" }, { "docid": "6663dae7ead8620ce87706778c001846", "score": "0.83523285", "text": "def expired?\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0047d9025f988dc019ef6c931e94477d", "score": "0.0", "text": "def set_docstate_change\n @docstate_change = DocstateChange.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...
5ecbf17b62adff07080738b49e693888
POST /purchase_orders POST /purchase_orders.json
[ { "docid": "99ef99ab882d034a61c44b58c12de123", "score": "0.7073195", "text": "def create\n @purchase_order = PurchaseOrder.new(params[:purchase_order])\n\n respond_to do |format|\n if @purchase_order.save\n format.html { redirect_to @purchase_order, notice: 'Purchase order was successf...
[ { "docid": "ee8d8e8e024d35ee13910acc551b370b", "score": "0.7707985", "text": "def create_order\n post_request \"orders\"\n end", "title": "" }, { "docid": "e61417b75d12bf40c6c2032541849f5a", "score": "0.7264499", "text": "def submit_order_json\n\n\t\t\tshipping_address_id = p...
7bd49da12c0672c22cd924b6f98b2813
GET /admins/1 GET /admins/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "60b96471a6471e61d945a2b646037c74", "score": "0.76173425", "text": "def index\n @admins = Admin.all\n\n render json: @admins\n end", "title": "" }, { "docid": "4b73e6ca430b326f362f0508de05cb28", "score": "0.75116575", "text": "def index\n @admins = Admin.all\n\n ...
09d4c2d5fbb70bb28f147eff8ffd400d
Default polygon with 8 vertices
[ { "docid": "726522a50e5ec4f7a359553fe554c8c1", "score": "0.7239319", "text": "def test_default_8Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[400,285],[425,260],[450,260],[475,285],[475,310],[450,335],[425,335],[400,310]], Color.hp_gauge_color1)\n c...
[ { "docid": "ad22af24d30446ed0643eb4b15d24c90", "score": "0.699607", "text": "def test_default_4Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[200,200],[250,200],[250,250],[200,250]], Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end", ...
a9f087abae562b35e11dd8921c057477
Validates student search results (as best as possible) Will prompt for manual input if necessary
[ { "docid": "2d1f8551826679d8f9d3a8f6c2632323", "score": "0.5828474", "text": "def validate_student_result(result)\n (valid = check_multiple(result)) unless (valid = check_empty(result))\n\n if valid.nil?\n result[:pco_id] = result[:pco_id][0]\n result[:pco_name] = result[:pco_name][0]\n ...
[ { "docid": "c3e10ddeff5f08c47b7f43bac56975f4", "score": "0.7035067", "text": "def student_search\n student_list = Student.all\n puts 'Enter Student Name : '\n c = gets.chomp\n student = student_list.find { |s| s[1].include?(c) }\n student.nil? ? not_found_message : student_search_result(s...
d9e9e88fa4c705a242823c5262133aa5
Returns the callback URL for this participant, based upon the callback URLs passed when the workflow was created.
[ { "docid": "1acfe20dd5fe1ee32943bf8369783175", "score": "0.8684215", "text": "def callback_url\n url = if _workitem.fields['callbacks'].is_a?(String)\n _workitem.fields['callbacks']\n else\n _workitem.fields['callbacks'][participant_name]\n end\n ...
[ { "docid": "fd98d26a9465702248ac90c61593f9f2", "score": "0.76692724", "text": "def callback_url\n full_host + script_name + callback_path\n end", "title": "" }, { "docid": "fd98d26a9465702248ac90c61593f9f2", "score": "0.76692724", "text": "def callback_url\n full_h...
eb10c6f870c4c12e424429221a401f0e
OAuth user's school's people.
[ { "docid": "6288b619d30493631b6c74fbf05eb86a", "score": "0.0", "text": "def people(query={})\n response = self.simple_client.get(\"/api/v1/people?#{query.to_query}\")\n # TODO modularize, re-use\n if response[\"page\"]\n return WillPaginate::Collection.create(response[\"page\"],response[\"...
[ { "docid": "6f9dee276641eae193124429f5d592ee", "score": "0.67023027", "text": "def schools\n Rollcall::School.for_user(self).order(:display_name)\n end", "title": "" }, { "docid": "25e6c17bfb27ab1e5f0d41df0ee6df90", "score": "0.6483664", "text": "def user_schools\n @us...
641538b61544b01a52147107013608d0
Options Expirations Returns a list of all current and upcoming option contract expiration dates for a particular symbol.
[ { "docid": "6d67461adb92b6a9b7b60e9d7e83db8b", "score": "0.593599", "text": "def get_options_expirations_eod(symbol, opts = {})\n data, _status_code, _headers = get_options_expirations_eod_with_http_info(symbol, opts)\n return data\n end", "title": "" } ]
[ { "docid": "4fd2d31d0781cab141ee12e86bb3203e", "score": "0.69813025", "text": "def getCurrentOptionDates()\n params = {\n :q => @symbol,\n }\n\n page = nil\n begin\n page = @@agent.get(CURRENT_OPTION_DATA_URI, params)\n rescue => e\n logger.error(\"Unab...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ca88757ce2b6a9c79e127e9fdbe36f4e", "score": "0.0", "text": "def set_auto\n @auto = Auto.find_by(id: 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...
886603c68a37bfda50b72fc73ac11c86
Set ssh keys overwrites user's ~/.ssh/authorized_keys
[ { "docid": "ff0cc0c4df04dd7663d002520fd2dc26", "score": "0.74767244", "text": "def set_ssh_keys\n userHome = new_resource.home || \"/home/#{ new_resource.name }\"\n\n Chef::Log.debug \"Overwriting user's authorized ssh keys\"\n\n # Overwrite the ~/.ssh/authorized_keys\n template \"set_ssh_au...
[ { "docid": "70d6bd5c0cc6c76917ecfc6535d941f3", "score": "0.77728677", "text": "def authorized_ssh_keys=(value)\n @authorized_ssh_keys = value\n end", "title": "" }, { "docid": "81a552c62f25f04cdc85643a424d1bf1", "score": "0.7633008", "text": "def update_authorized_keys\n ...
247efafdbb088e4c66826e291fd25407
}}} Returns primary key value passed in reqeust parameters. Name of primary key is retreived from model klass associated with this controller (Foo_Controller > model Foo). In case you want to retreive the primary key value of another model klass, pass it as an argument. If more than one primary key value could be resol...
[ { "docid": "0abc126d76f2d1e28643e5530a881268", "score": "0.0", "text": "def id(klass=nil)\n # {{{\n return param(:id) if param(:id)\n if !@instance_id then\n klass ||= @klass \n return unless klass\n id_values = []\n klass.get_own_primary_keys.each { |key|\n id_values <...
[ { "docid": "ca4ad51f7f65b5ffdf2a4d605a98ddd3", "score": "0.7755409", "text": "def primary_key\n pk = columns.values.find { |c| c.params[:primary_key] }\n # raise \"Primary key is not defined on '#{table_name}'\" unless pk\n pk\n end", "title": "" }, { "docid...
ee1ac2448d57047ff2164aa823e37192
Combine the arrival date and time
[ { "docid": "b39d0b8af4bad83b8ea38a10a99f5c9c", "score": "0.63094705", "text": "def arrive_date_time\n return nil if arrive_date.nil?\n h, m, s = arrive_time.nil? ? [0, 0] : [arrive_time.hour, arrive_time.min]\n Time.new(arrive_date.year, arrive_date.month, arrive_date.day, h, m)\n end", "t...
[ { "docid": "f5fbe4dbfc68c1201e0c64b46b8b5fd6", "score": "0.7803303", "text": "def arrival_time\n self.date + self.duration\n end", "title": "" }, { "docid": "90c8c180889aab08c9e8141cf445cb9b", "score": "0.71307516", "text": "def arrival_time\n\t\t\tget_full_details if @arrival_ti...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "8f53d42b55a0e8d6683e9e7e405eda49", "score": "0.0", "text": "def update!(**args)\n @availability = args[:availability] if args.key?(:availability)\n @domain_name = args[:domain_name] if args.key?(:domain_name)\n @domain_notices = args[:domain_notices] if args.key?(:...
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
d3a38570a3908007ce40fd35ae542705
Get the top 10 popular contents over the last 14 days
[ { "docid": "a3b14fb6e40555a9a1272252fab3d8f5", "score": "0.0", "text": "def top_paths(repo, options = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "7f382abe552dba38e2bff6d855375095", "score": "0.6638964", "text": "def top10\n sixty_second_snapshot.each_with_object(Hash.new(0)) {|(_ts, tag), freq_hash|\n freq_hash[tag] += 1 #create hash of tag => count of times used\n }.sort_by {|(tag, freq)|\n [-freq, tag] ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "428521a2bd38572536d093fbc24dfde6", "score": "0.0", "text": "def comment_params\n params.require(:comment).permit(:commenter, :body, :post_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...
62940bc0a48471d2eeda0aab9bd9fa14
Update the window cursor
[ { "docid": "68e9e6d83729dba36f2cb517b9ee804f", "score": "0.0", "text": "def update\n return if validated?\n return validate if Input.trigger?(:A) || (Mouse.trigger?(:left) && @skills.simple_mouse_in?)\n return cancel if Input.trigger?(:B)\n last_index = @skills.index\n update_ke...
[ { "docid": "32160971ed8065ae0fa633281f23c43e", "score": "0.808781", "text": "def update_cursor\n cursor_rect.set((@index % 2) * DELTA_X, (@index / 2) * DELTA_Y)\n $game_system.se_play($data_system.cursor_se)\n end", "title": "" }, { "docid": "4fa829931ae609d1bbc010144399d5...
13aa51887fc11443ddc176afbf506f88
Return a Dest specification for a specific location (and optional zoom level).
[ { "docid": "a3cd694e6af8bf9324498901598a7db2", "score": "0.4950146", "text": "def dest_xyz(left, top, zoom = nil, dest_page = page)\n [dest_page.dictionary, :XYZ, left, top, zoom]\n end", "title": "" } ]
[ { "docid": "5163e49edb086db9d8b9fbc59b868160", "score": "0.53221047", "text": "def destination\n @destination ||= Location.new(params[:destination])\n end", "title": "" }, { "docid": "231c1cfa1521bcdb66681b6042d5d11c", "score": "0.5234534", "text": "def location_zoom_street\n...
ca38c915949d696271f4d34aaaa5914a
Get an instance by id of the model
[ { "docid": "6bc9ef7cb382c0be7ef4d7b9d7e552f5", "score": "0.7347196", "text": "def get(id)\n klass.find(wrap_key(id))\n end", "title": "" } ]
[ { "docid": "e70a5d70a4730d630c2b046fdb9d83c6", "score": "0.7931207", "text": "def find(id)\n @model.find_by_id(id)\n end", "title": "" }, { "docid": "ef89e550d19a6bfd27596e3263b257ec", "score": "0.7850643", "text": "def find_by_id(id)\n @client.get(\"/#{@model}/#{id}\")\n ...
8d77163077b12aeaeacc01e01a4dc77d
returns the methods that are set like ["amount_usd", "amount_wmr"]
[ { "docid": "d4ffa5ad3a396d018684ba39b9c9acec", "score": "0.60497534", "text": "def amounts_set\n %w(amount_usd amount_wmr amount_wme).select{|m| !self.send(m).blank? }\n end", "title": "" } ]
[ { "docid": "b46a0ff5df6a95a3c191d9456a2298ad", "score": "0.702781", "text": "def methods\n \n methods = {\"initialize\" => \"\", \"methods\" => \"\", \"isBeer\" => \"\", \"isCider\" => \"\", \"isHighAlcohol\" => \"\", \"setPriceWithNtb\" => \"\", \"setPiceWithSellsheet\" => \"\", \"setPriceWithWhole...
ef28f95cc75aa46bbc94569788482287
Returns the first matching track control attributation for a given namespace and xpath
[ { "docid": "5697a2c74f48ee244adec591291fb60c", "score": "0.675022", "text": "def track(index_or_ns, xpath)\n\t\t\tif index_or_ns.is_a?(String)\n\t\t\t\t# lookup proofsheets by namespace prefix\n\t\t\t\tproofsheets = self.select { |ps| ps.namespace_uri == index_or_ns } \n\t\t\telse\n\t\t\t\tproofsheets =...
[ { "docid": "0cc0175447368aa1d6560bb84a269401", "score": "0.59660786", "text": "def find_first(xpath, nslist = nil)\r\n find(xpath, nslist).first\r\n end", "title": "" }, { "docid": "bd37380a89cebbae605df44c060f8f57", "score": "0.593256", "text": "def find_first(xpath, nsl...
ef4a29ceb023beb816b1b0b19ed24d6c
select_every_even takes in an array returns a list of evenindexed items from the input
[ { "docid": "076cd3d24ed30bbe9d8a314ef70d040e", "score": "0.87083346", "text": "def select_every_even arr\n arr.select.with_index { |ele, i| ele if i.even? }\n end", "title": "" } ]
[ { "docid": "88ce0510c866179395159e0a051e08c0", "score": "0.87881285", "text": "def select_every_even(arr)\n arr.select.with_index { |item, index| item if index.even? }\n end", "title": "" }, { "docid": "88ce0510c866179395159e0a051e08c0", "score": "0.87881285", "text": "def select...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "cd08a16fdf2e3cfa51d7dbd2411e8141", "score": "0.0", "text": "def set_post\n @post = current_user.posts.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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c51813c577d8fb4e018e9eb399d38119", "score": "0.0", "text": "def set_offsite_request\n @offsite_request = OffsiteRequest.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...
3676f2c745909a656397f3e3b00ef13a
validates :title, :source, :reference, presence: true
[ { "docid": "74d0b7fe4b7681bb7ecf97d34bd36f2e", "score": "0.0", "text": "def is_user_potential_author?(user, author)\n\n is_user_not_already_author = self.authors.all? { user.author != author }\n\n user_author_name = \"#{user.last_name}\"\n matching_names = author.name.include?(user_author_name)...
[ { "docid": "a19248c5f479a92dd71e931adccb85d9", "score": "0.6970428", "text": "def validate\n validates_presence([:title, :body])\n end", "title": "" }, { "docid": "4c6d0dea9f782d6abcf530d75449109d", "score": "0.6641703", "text": "def validate_title\n errors.add(:title, :must_b...
47b8d386a466a336d0c2ab2749d92ac8
Enable timer for the block.
[ { "docid": "38e45579057c3d4ee71cdbeacedc74ba", "score": "0.0", "text": "def time\n @began = Time.now\n yield\n ensure\n self.info \"Finished in %.1f sec.\" % (Time.now - @began)\n end", "title": "" } ]
[ { "docid": "6609aef4276d339bc56ecddc2a29f945", "score": "0.66283596", "text": "def start_timer\n @start_time = Time.now\n end", "title": "" }, { "docid": "e8df565c09a080c868ccb69e4ccc7dfc", "score": "0.6490196", "text": "def start_timer\n @timer ||= detach_timer\n end...
c94b1a32ac18fe22dc03952c208db1f2
Fetch stats and other interesting data from the GitHub API
[ { "docid": "cd2546eec2458e319168ab080c36bdf9", "score": "0.63232505", "text": "def get_repo_data(repo)\n headers = {'Authorization': \"token #{GH_OAUTH_TOKEN}\"} if GH_OAUTH_TOKEN\n data = cached_request(\"https://api.github.com/repos/#{repo}\", headers)\n unless data.empty?\n bran...
[ { "docid": "1dd40c8110425039b815d154cb1a3c20", "score": "0.7579281", "text": "def append_github_data\n # e.g. https://api.github.com/repos/fastlane/fastlane\n url = self.homepage.gsub(\"github.com/\", \"api.github.com/repos/\")\n url = url[0..-2] if url.end_with?(\"/\") # what...
c23e631e3921aba2fb46be372da288aa
parse a board agenda file by passing it through each parser. Additionally, converts the file to utf8, adds index markers for major sections, looks for flagged reports, and performs various minor cleanup actions. If quick is false, crosschecks with committee membership will be performed. This supports the board agenda t...
[ { "docid": "e4ea817e83f690f92e7f9f188c4a2cf5", "score": "0.819691", "text": "def parse(file, quick=false)\n @file = file\n @quick = quick\n\n unless @file.valid_encoding?\n filter = proc {|c| c.unpack1('U') rescue 0xFFFD}\n @file = @file.chars.map(&filter).pack('U*').force_encoding('u...
[ { "docid": "f2612938695647a77bf2f58eaf4567a9", "score": "0.56954604", "text": "def parse_sections\n AIPP::Downloader.new(storage: AIPP.options.storage, source: sources_file) do |downloader|\n @dependencies.tsort(AIPP.options.section).each do |section|\n info(\"parsing #{section.sect...
cece5fee3b5dc1db5f7c8a6c310ce535
Attach an existing document to a transaction or a transactions_cluster
[ { "docid": "89f52766921db2f441d6ec0fe4510aa5", "score": "0.0", "text": "def users_id_user_accounts_id_account_transactions_id_transaction_documents_put_with_http_info(id_user, id_account, id_transaction, id_document, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.de...
[ { "docid": "622020bf7a2d6cabdb3fb8a20c1c2b47", "score": "0.6261403", "text": "def upsert_document(index, id, document)\n @logger.debug(\"ELASTICSEARCH\") { \"Trying to update document with id #{id}\" }\n updated_document = update_document index, id, document\n if updated_document.nil?\n @l...
1b72d38c4297e1b9c6bf960f721659f9
PATCH/PUT /coches/1 PATCH/PUT /coches/1.json
[ { "docid": "67582715215fa10d473ac461afedf510", "score": "0.0", "text": "def update\n respond_to do |format|\n if @coche.update(coch_params)\n format.html { redirect_to action: :show_one, id: @coche.id, placa: @coche.placa, notice: 'Compra realizada Satisfactoriamente' }\n format.js...
[ { "docid": "0e65cdc9292802e959485d7d653a4e0a", "score": "0.6194129", "text": "def update\n respond_to do |format|\n if @cocktail.update(cocktail_params)\n if (params['cocktail']['ingredients'] != nil)\n for id in params['cocktail']['ingredients']\n @cocktail.ingredient...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "abf6b7c2d32f8c255fd5af7cb3339a30", "score": "0.0", "text": "def koma_params\n params[:koma]\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...
9a387346ca37ac0bcc3dee8e5f8443ef
GET /games/1 GET /games/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "e918ba46836aa1fb04a89945e728619f", "score": "0.77774805", "text": "def show\n @game = Game.find(params[:id])\n render json: @game, status: 200\n end", "title": "" }, { "docid": "3d46c62c7250529d62fe894fd79eec0b", "score": "0.77492905", "text": "def index\n @game...
f4c2a356bd24a817c65ddc31da29601a
Utility message Checks if the server is up and running.
[ { "docid": "9197fc753ed10f60cdf9b5302dde9e49", "score": "0.0", "text": "def ping(options={})\n begin\n send_message(SkyDB::Message::Ping.new(options))\n return true\n rescue\n return false\n end\n end", "title": "" } ]
[ { "docid": "916014aa4cf69d9e0e314b3300c808cd", "score": "0.7206939", "text": "def doi_server_reachable?\n Ezid::Client.new.server_status.up? rescue false\n end", "title": "" }, { "docid": "916014aa4cf69d9e0e314b3300c808cd", "score": "0.7206939", "text": "def doi_server_re...
e8a5708ed5a90f016c51f31c908d56fd
DELETE /consumed_units/1 DELETE /consumed_units/1.json
[ { "docid": "99e311e893d3029338959a962cf5f268", "score": "0.7681292", "text": "def destroy\n @consumed_unit.destroy\n respond_to do |format|\n format.html { redirect_to '/', notice: 'Consumed unit was DELETED.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "30530be057cc14f85b8cb57555f51de2", "score": "0.7166399", "text": "def destroy\n @produced_unit = ProducedUnit.find(params[:id])\n @produced_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to produced_units_url }\n format.json { head :no_content }\n end\...
a6f263455436f18085339986b90b9831
GET / Welcome Page
[ { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.0", "text": "def index; end", "title": "" } ]
[ { "docid": "0f90714bce03cedd9dc51ec696b08c33", "score": "0.77947736", "text": "def welcome\n welcome_get if request.get?\n welcome_post if request.post?\n end", "title": "" }, { "docid": "ddaf912f28146e8d1dc52b269887a0aa", "score": "0.7775544", "text": "def welcome_page\n end...
74529d3e8c31cc9d82abe237325fceb1
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/conversations/v1/conversation/message/delivery_receipt.rb116
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "d0b9c1620b03ff70f19cc3acb2a50426", "score": "0.71064234", "text": "def sample_delivery_receipt(options = {})\n options[:message_id] ||= \"123e71195545ad204bdd99f2070a7d86\"\n options[:error] ||= \"None\"\n options[:status] ||= \"delivered\"\n options[:dat...
606fcc5cfd82784698669f836ea49e8e
This callback method is called with any string between a tag.
[ { "docid": "501a15c4d40f4998ce361ec5995d6437", "score": "0.0", "text": "def characters(string)\n if @interesting and not @pre\n @plaintext << string\n end\n end", "title": "" } ]
[ { "docid": "a9c7f9938dc9b5b5cfe99fd47254035a", "score": "0.723468", "text": "def example_tag(text); end", "title": "" }, { "docid": "db6015582e6779ec198c7a651da47a8e", "score": "0.71207803", "text": "def see_tag(text); end", "title": "" }, { "docid": "e9a36bd302c12095e17d...
f260b0743e3635ff851ba1fb8f391b00
GET /users/1 GET /users/1.json
[ { "docid": "70dbbd7ee1c5db4b752a5017881b2beb", "score": "0.0", "text": "def show\n @tracks = Track.all\n end", "title": "" } ]
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.7716421", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "a95dfe28d6b386aafc5fb53749e84258", "score": "0.7511324", "text": "def user\n...
35d6fd348815a39982b6d0667642437a
PATCH/PUT /us_events/1 PATCH/PUT /us_events/1.json
[ { "docid": "fe8226d0ca451e4bb8cf8f709b14261f", "score": "0.69263095", "text": "def update\n respond_to do |format|\n if @us_event.update(us_event_params)\n format.html { redirect_to @us_event, notice: 'Us event was successfully updated.' }\n format.json { render :show, status: :ok,...
[ { "docid": "dc4ff2adcbcefec9118bdd7e8716ad75", "score": "0.7364376", "text": "def update\n event = event.find(params[\"id\"]) \n event.update_attributes(event_params) \n respond_with event, json: event\n end", "title": "" }, { "docid": "0050f781a1e526879347940817ef65b8", "score...
bfbcddcc918ef40f76e5014276919dbc
Preview this email at
[ { "docid": "513d1f1bb0ddce812b194460db07164a", "score": "0.0", "text": "def name\n ClassMailer.name\n end", "title": "" } ]
[ { "docid": "947d18f31928dcf9761bdcbda7f18565", "score": "0.71475905", "text": "def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end", "title": "" }, { "docid": "f9cb02c07e98bbf5e69bcea1540cfe24", "score": "0.71186084", "text": "def preview\n @e...
c4e596e34c80e28016e9d6b5ff98241c
before_action :configure_sign_up_params, only: [:create] before_action :configure_account_update_params, only: [:update]
[ { "docid": "f96100078201f502ca2c9ca5eaa91490", "score": "0.0", "text": "def new\n build_resource\n yield resource if block_given?\n end", "title": "" } ]
[ { "docid": "cdd69125ae507d5cde30d119935e6309", "score": "0.7224054", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:email,:password, :password_confirmation, :first_name, :last_name, :circonscription])\n devise_parameter_sanitizer.permit(:account_update,...
4f5e1136a5a9a59e08519940231f7ee7
check if run gatlingrsyncauto command
[ { "docid": "9d324ecdf8403443cc07a4938dd663c0", "score": "0.73289657", "text": "def valid_command(plugins)\n gatling_cmd = ARGV.any? { |s| s.include?('gatling-rsync-auto') }\n\n if gatling_cmd\n gatling_plugin_enabled = plugins.select { |item| item['name'] == 'vagrant-gatling-rsync...
[ { "docid": "ae7929192d83e1c1b0e5181e29e232b8", "score": "0.71161294", "text": "def check_prereqs\n cmd_out = `which rsync`\n if cmd_out.strip == ''\n puts \"Error : rsync not found.\"\n exit\n end\n end", "title": "" }, { "docid": "a905e18aae07ca2f39cd251f61ce39fd", "...
ef399c5ab85aa914b5797cac17eaf87b
def get_puzzle puts "Enter Height" row = gets.chomp puts 'Enter Width' col = gets.chomp
[ { "docid": "8a4e72fd9d9888c2d78ef344f4aadc13", "score": "0.0", "text": "def process_user_response(arr)\r\n while (key = gets.chomp) != 'exit'\r\n puts \"Please write u, l, r, d or 'exit' to quite\"\r\n case key\r\n when 'u' then move_up(arr)\r\n when 'l' then move_left(arr)\r\...
[ { "docid": "4a019672968e2f3a0e8c4c388e74d16b", "score": "0.74105793", "text": "def player_guess\n puts \"Please enter the row you think the ship is in:\"\n @row_input = gets.chomp\n puts \"Please enter the column you think the ship is in:\"\n @column_input = gets.chomp\nend", "title": ""...
c0a78f4140e23183fd4d60defc5b8955
initialize Class init Inputs: number of columns (c), rows(r) and length of the line (l) return: void
[ { "docid": "f689f1494f2cc9a77f9adb012b3494ab", "score": "0.0", "text": "def initialize(c, r, l)\n\n @root = TkRoot.new do \n title \"Hello World\" \n # the min size of window \n minsize(1024,660) \n end \n\n @root.title = \"Window\"\n\n rowsTextBox = TkEn...
[ { "docid": "284ddef0ee25482773d5898d20d345f1", "score": "0.7228227", "text": "def initialize(rows,cols)\n # Variables que guardaran el numero de filas y clomunas de la matriz.\n @rows, @cols = rows, cols\n end", "title": "" }, { "docid": "72b2825b90961bac4ce53ef2...
f7fa28458cb27fe4b2a2225e7d4be703
Enable/Disable NFS protocol for a share. If the dataset contains any network ACLs, they will be removed as well.
[ { "docid": "49301d40f61f743bfcf636f1223dd590", "score": "0.51629776", "text": "def set_nfs_sharing_on_share_post(set_nfs_sharing_on_share_param, opts = {})\n data, _status_code, _headers = set_nfs_sharing_on_share_post_with_http_info(set_nfs_sharing_on_share_param, opts)\n return data\n end...
[ { "docid": "cbc23cc4f75ce5316e27cb6dc4b03ee2", "score": "0.56372315", "text": "def mount_nfs_share(share, volume_name)\n begin\n Puppet.debug(\"%s: Mounting %s with volume name %s\" % [Time.now, share, volume_name])\n host.esxcli.storage.nfs.add({:host => resource[:nfs_hostname],\n ...
fc14af6597267747ec8055c147f9525f
Update company & office text fields at view from organization select
[ { "docid": "fa2af20b167f845b9538dff348b69838", "score": "0.81776196", "text": "def in_update_company_and_office_textfields_from_organization\n organization = params[:org]\n if organization != '0'\n @organization = Organization.find(organization)\n @companies = @organization.blank...
[ { "docid": "53fcdaaf3bb46b2c5adaa32c9ee0f8f8", "score": "0.82558", "text": "def ve_update_company_and_office_textfields_from_organization\n organization = params[:org]\n if organization != '0'\n @organization = Organization.find(organization)\n @companies = @organization.blank? ?...
29fda3c252b34c2602452b6c9452a8e1
DELETE /appunto_righe/1 DELETE /appunto_righe/1.xml
[ { "docid": "89762068d5827835210547a60f41d3f4", "score": "0.0", "text": "def destroy\n @appunto_riga = AppuntoRiga.find(params[:id])\n @appunto_riga.destroy\n flash[:notice] = 'Riga eliminata.'\n respond_to do |format|\n format.html { redirect_to appunto_righe_url }\n format.js\n ...
[ { "docid": "df26116eb86dbadafed7137f9e3c2f9e", "score": "0.7121979", "text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc....
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c0aa62452f98df7499389ee20d8396e2", "score": "0.0", "text": "def capital_account_params\n params.require(:capital_account).permit(\n :name,\n :budget,\n :client_id,\n )\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497917", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69572496", "text": "def strong_params\n params.require(:request).permit(param_whit...
1c9f27a0223e4b91eb55f2c928b7fb40
then half the array and then start the search over again. Once I hit half the process starts again and this will continue till I hit the number or run out of array. If the number is not in the array then the method should return 1.
[ { "docid": "b0b48eb47bbfe6b8754ce3edb3ddaf13", "score": "0.0", "text": "def chop(num, array)\n array.sort.each_with_index do |x, index|\n \n end\nend", "title": "" } ]
[ { "docid": "3ab33f1f3037bb1b3a724481a82d02a1", "score": "0.73063195", "text": "def binary_search_while_loop(array, desired_num)\n\n start_index = 0\n end_index = array.length - 1\n\n while start_index <= end_index\n mid_index = (start_index + end_index) / 2\n\n if array[mid_index] == desired_nu...
3338cf3de46555fedaf17188ed5830fd
Baseline implementation for the update_capacity_commitment REST call
[ { "docid": "94570df960b2e10e4faa6bd490c0ff2a", "score": "0.78649586", "text": "def update_capacity_commitment request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transc...
[ { "docid": "9a0704cf4315d20d00d7ee7312f2047b", "score": "0.66632205", "text": "def merge_capacity_commitments request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transc...
c427a6c8555767e57a9b2d7d79aa51e3
Ensure that all subsequent methods are available as Module Functions
[ { "docid": "9368ebd65cb301b5ab25b712360ac11d", "score": "0.0", "text": "def create_category(name: \"Test Category\")\n SidebarCategory.create!(name: name, order: SidebarCategory.next_order)\n end", "title": "" } ]
[ { "docid": "a1d5aa1e24980d17efed573cc96a01ec", "score": "0.71454877", "text": "def all_relevant_methods_for(mod); end", "title": "" }, { "docid": "a1d5aa1e24980d17efed573cc96a01ec", "score": "0.71454877", "text": "def all_relevant_methods_for(mod); end", "title": "" }, { ...
78fe4cb6c93c7368ba7c1118424e8ee9
GET /studentscores GET /studentscores.json
[ { "docid": "000e6806dbf1116d172216a82c722ec5", "score": "0.7329338", "text": "def index\n\t\t@studentscores = Studentscore.all\n\tend", "title": "" } ]
[ { "docid": "fdd1a2404285c2b12cebc23ca64b6f7b", "score": "0.69443893", "text": "def get_students\n @course = Course.find(params[:course_id])\n\n render json: @course.students\n end", "title": "" }, { "docid": "2e7c6c776002f58fe16e70ccf4c107cd", "score": "0.67243063", "text": "d...
689292b3453161266dddd1d85cc29ded
Create a new VehicleService client object.
[ { "docid": "65103764af156989f021217a1bbff4b2", "score": "0.63345474", "text": "def initialize\n # These require statements are intentionally placed here to initialize\n # the gRPC module only when it's required.\n # See https://github.com/googleapis/toolkit/issues/446\n ...
[ { "docid": "4e8188dc29b95326a8253dd0ccb51937", "score": "0.6362768", "text": "def create_service(options)\n require_relative 'service'\n Service.new(@api, @api.do_request(\"POST\", get_base_api_path() + \"/services\", options))\n end", "title": "" }, { "docid": "c23c1a3d58b1...
3ff7411571203e3ad6bf877cd779db7d
Se mustran los alumnos que aprobaron
[ { "docid": "08228b5cb3a671b0771425d820c38395", "score": "0.5649562", "text": "def alumnos_aprobados(notas, nota_minima= 5)\n promedio = {}\n notas.each { |key, value| promedio[key] = value.inject(0) { |acum, n| acum + n.to_f / value.length}.round(2) }\n aprovados = {}\n aprovados = promedio.select{ ...
[ { "docid": "1c9eec7bdd75fbafc9d565ee86926264", "score": "0.6503744", "text": "def alumnos_proyecto\n cadena = \"\"\n self.alumnos.each do |alumno|\n cadena += \"#{alumno.no_control} #{alumno.apellido_paterno} #{alumno.apellido_materno} #{alumno.nombre} | \"\n end\n cadena\n end", "...
c7b1617eccdd0608389ce61f19de0ddc
Set current values from values array
[ { "docid": "0e451557f59aa6c3c59f3e5a3d21c4de", "score": "0.0", "text": "def value_setter(mask_column, values, mapping)\n send(\"#{mask_column}=\", 0)\n\n values = values.map(&:to_sym).compact.uniq\n\n values &= mapping.keys\n\n values.each { |value| send(\"#{mask_column}=\", send(mask_column...
[ { "docid": "dee8b1a54b2522d970a7a1256584f896", "score": "0.7441964", "text": "def set(values)\n @updates.merge!(values)\n end", "title": "" }, { "docid": "791801df67a7794b234d910474c8b91b", "score": "0.7372219", "text": "def values=(newValues)\n @values = newVa...
ce98675df93d074f9ba374d271fa89fa
Part sent to the victim, insert your code here !!!
[ { "docid": "2d28c6676170a924ca5582c679cf644f", "score": "0.0", "text": "def on_request_uri(cli, req)\n\t\tcode = %Q{\n\t\t\tXSSF_XHR.open('TRACE', '#{datastore['path']}', false);\n\t\t\tXSSF_XHR.send(null);\n\t\t\t\n\t\t\tXSSF_POST(XSSF_XHR.responseText, #{self.name});\n\t\t}\n\t\t\n\t\tsend_response(cl...
[ { "docid": "34c872395d8f19ad9339c9055966778f", "score": "0.63930565", "text": "def pre_send; end", "title": "" }, { "docid": "34c872395d8f19ad9339c9055966778f", "score": "0.63930565", "text": "def pre_send; end", "title": "" }, { "docid": "2a4c500447a00468c80f3cafdd88e707...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8d36fe0c17b82191bd5e5ae42302f1fe", "score": "0.0", "text": "def set_initiative_user\n @initiative_user = InitiativeUser.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...
d4a1edaae4d92d004632cf64501ce2e7
DELETE /users/1 DELETE /users/1.json
[ { "docid": "15bbd6148634eeae1703a9d0983f5a27", "score": "0.0", "text": "def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "8e69eb3ff3374e0db6fa9eb17958df65", "score": "0.7875409", "text": "def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end", "title": "" }, { "docid": "6f74a32c6fdb67babd4a903e37b5baa4", "score": "0.7751816", "text": "...
428de430a45c409458da6ba2d260a0d0
Check if there is changes for autosaving
[ { "docid": "40a9cc07330b9d00a85dc50e7733ac0d", "score": "0.74248356", "text": "def changed_for_autosave?(doc)\n doc.new_record? || doc.changed? || doc.marked_for_destruction?\n end", "title": "" } ]
[ { "docid": "ffc7af286034fd191a9473c15e169728", "score": "0.7470145", "text": "def changed_for_autosave?\n new_record? || has_changes_to_save? || marked_for_destruction? || nested_records_changed_for_autosave?\n end", "title": "" }, { "docid": "1ab11f8a59f8fa66337fb18d1087c205", "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ae12c3a36c0fd1f7b69a15df9a2800b6", "score": "0.0", "text": "def facult_params\n params.require(:facult).permit(:name, :logo, :info, :url)\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...
cbd5f132b564147920968f2415cd1025
GET /accouncements/new GET /accouncements/new.json
[ { "docid": "f9839d17632889a8996e89176de7dd03", "score": "0.748262", "text": "def new\n @accouncement = Announcement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @accouncement }\n end\n end", "title": "" } ]
[ { "docid": "d8fbe3e4832d43d0acd9c475769b2a86", "score": "0.7151382", "text": "def new\n @acount = Acount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @acount }\n end\n end", "title": "" }, { "docid": "9f701f8c15779deb226229fd367...
06cdebf964283c19c0e25fdfec6d1fe7
GET /property_images/123/original GET /property_images/123/original.png
[ { "docid": "6f81714dcc4e77f33d6d46af33dbb2fc", "score": "0.7845672", "text": "def original\n @property_image = PropertyImage.find(params[:id])\n respond_to do |format|\n format.html # original.html.erb\n format.png # original.png.flexi\n end\n end", "title": "" } ]
[ { "docid": "03af4437195282cc024959598f85daaf", "score": "0.6923658", "text": "def thumb\n @property_image = PropertyImage.find(params[:id])\n respond_to do |format|\n format.jpg # thumb.jpg.flexi\n end\n end", "title": "" }, { "docid": "10acb53eac8d4fcf80cd8e43bb220deb", ...
0e3d873d3be30f570826b54107c74598
GET /mdl_events/new GET /mdl_events/new
[ { "docid": "c3d90ff99926aa6417b55fbeb8be32dc", "score": "0.0", "text": "def new\n @mdl_event = MdlEvent.new\n end", "title": "" } ]
[ { "docid": "0d58503edd57819aebb7c7ce42a58acc", "score": "0.7779038", "text": "def new\n\tif user_type == 'admin' || user_type == 'super_admin' || user_type == 'manager'\n\t\t@event = current_user.event_draft\n\t\t@title = @header = 'Добавление новости'\n\t\t@path_array = [\n\t\t\t\t\t {:name =>...
68888f40e17eb6e959d2bf8c532c18d4
update one or more stats counters by arbitrary amounts stats an Array of stat names, or a String (one stat) delta The quantity to change each counter by sample_rate how often to sample
[ { "docid": "ed9fd95952daeb8b2e4468b2610a27d0", "score": "0.82916707", "text": "def update_counters(stats, delta=1, sample_rate=1)\n stats = [stats] if stats.class == String\n\n data = stats.inject({}) do |hash, val|\n hash[val] = \"#{ delta }|c\"\n hash\n end\n\n send d...
[ { "docid": "ba4bece0d68e3247b1ddbed5cd64f9c0", "score": "0.827608", "text": "def update_counter(stats, delta = 1, sample_rate = 1)\n stats = Array(stats)\n p = @prefix ? \"#{@prefix}.\" : '' # apply prefix to each\n send_stats(stats.map { |s| \"#{p}#{s}:#{delta}|c\" }, sample_rate)\n e...
2f4662d42c89db4eb1eea5b0fd5a5512
Write a recursive method that returns the first "num" factorial numbers. Note that the 1st factorial number is 0!, which equals 1. The 2nd factorial is 1!, the 3rd factorial is 2!, etc.
[ { "docid": "73d2e449b9318ad4131d80fdf06f0ae5", "score": "0.0", "text": "def factorials_rec(num)\n return 1 if num == 0\n return 1 if num == 1 \n facts = []\n i = 1\n while i < num\n individual_factorial = i * factorials_rec(i)\n facts << individual_factorial\n i += 1\n end\n facts\n\nend...
[ { "docid": "947d2bda8343375c462d35f71f093324", "score": "0.86899453", "text": "def firstFactorial(num)\n\tif num == 0\n \t1\n \telse\n \tnum * firstFactorial(num-1)\n \tend\nend", "title": "" }, { "docid": "c4b349ecb0870877cd36da91fb81b732", "score": "0.86211246", "text": "de...
8309464bdcf8f3fd69e594ca5331dbc2
Override the directory where uploaded files will be stored. This path will be appended to the S3 bucket url.
[ { "docid": "a86bd7a9deb4531fbe90d97ce4ae9056", "score": "0.0", "text": "def store_dir\n if model.is_a?(Institution)\n \"institutions/#{model.id}/images/\"\n elsif model.is_a?(AppConfig)\n \"app_configs/#{model.id}/images/\"\n else\n \"collections_v2/#{s3_collection_uid}/images/\"...
[ { "docid": "64406ccf0dd4b7ad51a9c1bc938e8947", "score": "0.69050866", "text": "def store_dir\n if model.new_record? || (model.persisted? && model.saved_changes?) then\n \tself.fog_directory = bucket_name\n \t\"#{ENV['ENVIRONMENT']}/uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model...
85a2d5647806f28f584460abbd3fcd26
Add log messages to the response object.
[ { "docid": "80a28863a55d6c38e46c85791c4bfb5f", "score": "0.0", "text": "def add_logs(*logs)\n # Validation.\n must_str = \"must be (non-empty) strings\"\n not_empty = \"can not be empty strings\"\n logs.each do |log|\n raise(ArgumentError, \"Logs #{must_str}.\") unless log.is_...
[ { "docid": "a858590b2c73035365a8fcfc434cf30f", "score": "0.7002539", "text": "def log_response\n log \"SOAP response (status #{@response.code}):\"\n log @response.body\n end", "title": "" }, { "docid": "25028584657a6dcaee812d19c711530c", "score": "0.6963463", "text": "de...
5ac44ee45f6c30db10a8a3d4677d0d6f
Updates the sort state. Call this in the controller prior to calling sort_clause. criteria can be either an array or a hash of allowed keys
[ { "docid": "879376a28e7abdffe9f299f83d8b04b6", "score": "0.73232317", "text": "def sort_update(criteria, sort_name=nil)\n sort_name ||= self.sort_name\n @sort_criteria = Redmine::SortCriteria.new(params[:sort] || session[sort_name] || @sort_default)\n @sortable_columns = criteria\n session[s...
[ { "docid": "80d6855b536dd3bf55889293d1001830", "score": "0.7409486", "text": "def apply_sorting\n if spec = criteria.options[:sort]\n in_place_sort(spec)\n end\n end", "title": "" }, { "docid": "80d6855b536dd3bf55889293d1001830", "score": "0.7409486", "tex...
7450776feabc7b022173458fb517ebd2
POST /ratings POST /ratings.json
[ { "docid": "a14037f61adc961d627ddfbe4573b578", "score": "0.0", "text": "def create\n @event = load_event\n @rating = Rating.new(rating_params)\n @rating.event = @event\n @rating.user = current_user\n authorize @rating, :create?\n respond_to do |format|\n if @rating.save\n f...
[ { "docid": "80607604df544a568a0e626df1de07da", "score": "0.77209014", "text": "def create\n @rating = Rating.new(rating_params)\n if @rating.save\n render json: @rating, status: 201\n else\n render json: @rating.errors, status: :unprocessable_entity\n end\n end", "title": "" ...
ae91e4b5d97c03237af5d3a0c342bb1d
Get patron account information from Sirsi.
[ { "docid": "d974287aee8f95666a8c0e31115f9fde", "score": "0.6513658", "text": "def get_patron(user, **opt)\n return unless (cid = account_id(user))\n get_data('users', cid, opt)\n data = response&.body&.presence\n IlsPatron.new(data, error: @exception)\n end", "title": "" } ]
[ { "docid": "fa0abce5fc4bd20f083a7f3ce50d16c8", "score": "0.62085783", "text": "def patron_info(patron_key, item_details: {})\n folio_graphql_client.patron_info(patron_key)\n end", "title": "" }, { "docid": "d5690fd6fbb83cce9aef9f17a1b2ef7e", "score": "0.6173002", "text": "def acc...
6f58c75152c336fd4bf395684f34b6a7
Retrieves the zaxis of this transformation.
[ { "docid": "c8f553c19e6ce8097f29bbda34fa47e0", "score": "0.6985452", "text": "def zaxis\n end", "title": "" } ]
[ { "docid": "25b9cbed281c0abce7d0511ea208ac97", "score": "0.6872756", "text": "def zaxis\n end", "title": "" }, { "docid": "e59511c0f2c0624824ac8aee1168309b", "score": "0.68462175", "text": "def z_axis_coords\n current_z_coord = self.current_pos[2]\n [current_z_coord, (current_...
3e0883f5a558fa63c2ec7893aaceb992
message is an array of number strings, public key is an array [n, e]
[ { "docid": "03253b1ecdefffb0d7a1fea27c05cf31", "score": "0.69311965", "text": "def decode(msg, public_key)\n r = []\n d = break_pub_key public_key\n n = public_key[0]\n\n msg.each do |line|\n line_int = line.to_i\n decoded_line = (line**d)%n\n puts decoded_line\n r << dec...
[ { "docid": "402555e2a8e9813e09b57aab2befc04f", "score": "0.71230835", "text": "def parsed_message_against_key\n @message = @message.join(\" \").downcase.chars\n @message = @message.each_slice(rotation_key.length).to_a\n # x = @message.map { |chunk| chunk.zip(rotation_key).to_h }\n end", "t...
606773c08dc7761ebd721780ae9106c6
Do not use the method Arrayrotate or Arrayrotate! for your implementation.
[ { "docid": "23b26b2b2c0edfebaef3dc9538871ab8", "score": "0.0", "text": "def rotate_array(arr)\n new_arr = arr.clone\n first = new_arr.shift\n new_arr.push(first)\n new_arr\nend", "title": "" } ]
[ { "docid": "cf20eaaa25f8296bb19d40200a4e05c8", "score": "0.8206427", "text": "def rotate2(input_array)\n # TODO\nend", "title": "" }, { "docid": "7d14d30cc1a417aada6d090ae827b936", "score": "0.8194676", "text": "def rotate1(input_array)\n # TODO\nend", "title": "" }, { ...
86f4ad65e798809d94086d4a61c6a999
def set_nonce self.nonce = (Time.new.to_f1000).to_i.to_s msec end
[ { "docid": "cd59dfe23dd496b7c1e717985b6cc7d8", "score": "0.0", "text": "def set_signature\n message = @nonce + api.user + api.show_key\n OpenSSL::HMAC.hexdigest(\"SHA256\", @api.show_secret, message)\n end", "title": "" } ]
[ { "docid": "d34a19f409d2c42597f3446fb62f7c31", "score": "0.8041607", "text": "def nonce\n Time.now.to_f.to_s\n end", "title": "" }, { "docid": "d34a19f409d2c42597f3446fb62f7c31", "score": "0.8041607", "text": "def nonce\n Time.now.to_f.to_s\n end", "title": "" }...
dc5681e26ef729c60f7e43e5f661e31a
Functions related to validations
[ { "docid": "6aec9e94f800f38168a594f1331ff63b", "score": "0.0", "text": "def company?\n Profile.find_by_name('Entreprise financière').id == profile_id.to_i rescue false\n end", "title": "" } ]
[ { "docid": "6b045ce4860f3e02870498792c74a0b9", "score": "0.81694186", "text": "def validate; end", "title": "" }, { "docid": "6b045ce4860f3e02870498792c74a0b9", "score": "0.81694186", "text": "def validate; end", "title": "" }, { "docid": "6b045ce4860f3e02870498792c74a0b9...
9287efa30b820301162dc577a61e3fed
POST Registers a new user
[ { "docid": "65f5f12a5db48af40d190fbae76c764c", "score": "0.0", "text": "def register\n @user = Auth::User.create params[:auth_user]\n if verify_recaptcha(:model => @user) && @user.save\n redirect_to :action => :create\n else\n render :template => \"auth/signup\...
[ { "docid": "69c8214d70d871740e4eea6cb87dd154", "score": "0.784214", "text": "def register\n sign_out(:user)\n user = User.new(params[:user])\n\n if user.save\n render json: { user_id: user.id }, status: :created\n else\n render json: { msg: user.errors.full_messages.to_sentence }, ...
3ca48a4845aecd68d0ce837e0cbc42aa
Returns a CardMask for the given string
[ { "docid": "58cb86e60a5fdeea696203bf6afca529", "score": "0.52168053", "text": "def get_cards(str)\n\t\treturn PokerEvalAPI.TextToPokerEval(str)\n\tend", "title": "" } ]
[ { "docid": "f267ee99e76231744737774569c2ca3a", "score": "0.67737436", "text": "def mask\n # can't contain a valid credit card number, so return immediately\n if @digit_count < 14\n output @chars\n reset\n return\n end\n\n # holds indexes of the characters we should mask in the...
0b93a6980fd2c4008fa585ba285c80d0
The normal offset, i.e., the distance from the punctuation token where a space should be, is 1.
[ { "docid": "e0803aa34633206037478bc86991f5df", "score": "0.6545534", "text": "def offset(token)\n 1\n end", "title": "" } ]
[ { "docid": "6b108102e8304173bcffe8bdf0e7b511", "score": "0.62428457", "text": "def offset(token)\n case token.type\n when :tLABEL then token.text.length + 1\n when :tCOLON then 1\n end\n end", "title": "" }, { "docid": "6b108102e8304173bcffe8bdf0e7b...
4f6d88706090aeafe613745da925515b
POST /reservations POST /reservations.json
[ { "docid": "7174e96f3e723d832ab64b019ac19757", "score": "0.0", "text": "def create\n @reservation = Reservation.new(reservation_params)\n @reservation.status = 'current'\n @reservation.user_id = @user.id\n @reservation.rental_charge = @reservation.calculate_rental_charge\n @car = @reserva...
[ { "docid": "fab0b61d59635c6c7ed84df1765a31b4", "score": "0.79937094", "text": "def future_reservations\n method = \"futureReservations\"\n post_request(method)\n end", "title": "" }, { "docid": "fab0b61d59635c6c7ed84df1765a31b4", "score": "0.79937094", "text": "def future_rese...
cf02dfc986949ed4991d7781ab191d88
ensure that there are no line items referencing this product
[ { "docid": "1ffde66b01df15958d04ece052dabd7d", "score": "0.793406", "text": "def ensure_not_referenced_by_any_line_item\n if line_items.count.zero?\n return true\n else\n errors.add(:base, 'Line Items present')\n return false\n end\n end", "title": "" } ]
[ { "docid": "88c0337284c08a432c1799f6821a65c9", "score": "0.8540937", "text": "def ensure_not_referenced_by_any_line_item\n if line_items.any?\n errors.add(:base, 'Line items with this product present')\n false\n end\n end", "title": "" }, { "docid": "6cdab59512374d...
b07bce8501bcf57588e463450e3e148f
Create a new symbol as a titleized version of the underlying symbol.
[ { "docid": "ee7baf1de585de53867e0d04122564c8", "score": "0.604907", "text": "def titleize\n self.to_s.titleize.to_sym\n end", "title": "" } ]
[ { "docid": "2c1b7088c9c1f0e56777fa43c537b7ae", "score": "0.6760088", "text": "def formalize_symbol!\n replace(symbol2hgncid.hgncid2symbol)\n end", "title": "" }, { "docid": "ca4befd7ba942aa591ac1d75773c465a", "score": "0.67226523", "text": "def title(new_title = nil)\n if ne...
d629c49027c56df9c45ff42a3173f23e
DELETE /investors/1 DELETE /investors/1.json
[ { "docid": "630a7e2c7cf2efe6dd342184fada8d0f", "score": "0.8040091", "text": "def destroy\n @investor = Investor.find(params[:id])\n @investor.destroy\n\n respond_to do |format|\n format.html { redirect_to investors_url }\n format.json { head :no_content }\n end\n end", "title...
[ { "docid": "a91662e38b5321ea78f6659f05020baf", "score": "0.77499986", "text": "def destroy\n @invest.destroy\n respond_to do |format|\n format.html { redirect_to invests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a91662e38b5321ea78f6...
ec643a2fb6fa204b5fd3dcef2e3f6d4c
Todo: Add description for test test_allow_dynamic_form_fields
[ { "docid": "cda529ec3a9d005d0baf4c4262c98417", "score": "0.7798641", "text": "def test_allow_dynamic_form_fields()\n # Parameters for the API call\n name = 'farhan'\n\n # dictionary for optional form parameters\n optional_form_parameters = {}\n optional_form_parameters['field'] = 'QA'\n\...
[ { "docid": "8fd5d3fdf22b6dda7a5f3a15222fb740", "score": "0.71595347", "text": "def dynamic_form_fields(builder)\n # Allow dynamic fields in our Project to be processed by form_for\n create_virtual_attributes!\n\n @object.fields.each do |field|\n h.haml_concat process_field(builder, field)\...
205cd1cee22b515676bc974ef97b2afb
Processes the XLS files stored locally.
[ { "docid": "52253ede4affa02124854b07718ecc52", "score": "0.5536515", "text": "def process_xlss(specific_year=nil)\n data = []\n STATES_WITH_DC.each do |state|\n puts \"PROCESSING #{state}...\"\n SPECS.each do |spec|\n # Years to iterate over either determined by spec, or just a single year\...
[ { "docid": "3a8e0c6621649fb80e20561d1350d5fc", "score": "0.6425946", "text": "def process_filename(request)\n require 'spreadsheet'\n # pass an IO object to Spreadsheet.open\n # this works 100% of the time\n # spreadsheet = Spreadsheet.open \"#{Rails.root}/public/EJStoreLoca...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "d4f905c33ca9d9cbe59424da78d48898", "score": "0.0", "text": "def new_input_set()\n return AddTagsInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.6741255", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.65807736", "text": "def new_input_set()\n return Ru...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "1de113cb6df03eaa1587c3ad5c00ab81", "score": "0.0", "text": "def cilist_params\n params.require(:cilist).permit(:cell_or_location, :waste_type_id, :benefit_id, :current_state, :improvement_suggestion, :implementation_status_id, :feasibility_id, :user_id, :sort_order, :active_status)\n end...
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "...
d817f06a10498d5716e2c2e6fd93ff1b
DELETE /requisitions/1 DELETE /requisitions/1.json
[ { "docid": "57e29b0c2a6851624c6354356054f5dc", "score": "0.68390715", "text": "def destroy\n @requisition.destroy\n respond_to do |format|\n format.html { redirect_to requisitions_url, notice: 'Requisition was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "eb5803ec3418fe14d5446a88cac6986b", "score": "0.71905726", "text": "def destroy\n @requisition = Requisition.find(params[:id])\n @requisition.destroy\n\n respond_to do |format|\n format.html { redirect_to requisitions_url }\n format.json { head :no_content }\n end\n end...
3114f5583f9342b91c67eb4848833fd1
Returns true if this is a STRING record or false if not
[ { "docid": "da6839f22a6cfe40b26ee73880b531e1", "score": "0.71530753", "text": "def is_string?(); @type == GRT_STRING; end", "title": "" } ]
[ { "docid": "aea191fe33077e43251a301b28e76cac", "score": "0.81875944", "text": "def string?\n data_type == String\n end", "title": "" }, { "docid": "ed213758f2c4da36e4dc4580d6b49925", "score": "0.7996214", "text": "def string?\n type == \"STRING\"\n end", ...
e248963c6aea40116d6b1c275b81f0c6
Method used to close a buffer
[ { "docid": "977a519c226ae5b9503eb75721ba7aa1", "score": "0.0", "text": "def killBuffer buffer\n @frames.delete buffer\n end", "title": "" } ]
[ { "docid": "8d0df9416af10e8421779a013d646f42", "score": "0.85319394", "text": "def close_buffer; end", "title": "" }, { "docid": "450c36fe47b8827a22236ab40508621c", "score": "0.7877836", "text": "def close(buffer = \"\")\n return if @block.nil?\n\n to_call, ...
00c93c19cbbfca2b4353ab2ded5744ce
Save the solution in a file named tsp_greed.rb
[ { "docid": "0a13ed36e6321af3de683b10881c4d17", "score": "0.0", "text": "def nearest_possible_neighbor(graph_of_cities, current_city)\n while current_city.visited == false\n neighbor_cities = current_city.neighbors\n next_city = neighbor_cities[0]\n\n for current_neighbor in neighbor_cities\n ...
[ { "docid": "4a1925394591975e7f7ed1197911573b", "score": "0.5898279", "text": "def save_solution verify=true\n # TODO: dump hash with all data?\n save_something nes.dump, savefile,\n verify: verify, verbose: printevery\n end", "title": "" }, { "docid": "c3cc1ce2c9f88cab417103428dd...
01e8dcff5c25e3ece8f0b74017ad3859
Remove a selection from the set of selected options in a multiselect element using an option locator. See the +select+ command for more information about option locators.
[ { "docid": "4f1309c6b76bcc1c8b6eed9adb466703", "score": "0.70021164", "text": "def remove_selection locator, option_locator\r\n command 'removeSelection', locator, option_locator\r\n end", "title": "" } ]
[ { "docid": "8b6ee347449e594577c9e51bbd17771c", "score": "0.74577653", "text": "def clear_multi_option_select(how, what)\n select_element=$driver.find_element(how, what)\n select_element.find_elements(:tag_name, \"option\").each do |option|\n if option.selected?\n option.toggle\n ...
2e8b7c90bbefcf8390a3b0caf1f74891
Make sure all models are loaded without reloading any that ActiveRecord::Base is already aware of (otherwise we start to hit some messy dependencies issues).
[ { "docid": "b12bffb8adf9f2c051bba8c6cb832652", "score": "0.6862058", "text": "def load_models\n ThinkingSphinx::Configuration.instance.model_directories.each do |base|\n Dir[\"#{base}**/*.rb\"].each do |file|\n model_name = file.gsub(/^#{base}([\\w_\\/\\\\]+)\\.rb/, '\\1')\n \n ...
[ { "docid": "371fb696b9c4b0f4fadb5e234e7a0439", "score": "0.79369247", "text": "def load_all_models\n # Make a reasonable effort to load all models\n return unless defined?(Rails)\n Dir[Rails.root + 'app/models/**/*.rb'].each do |path|\n require path\n end\n...
7381e944e2db0ebf973e6f8f5d2a139b
PUT /experience_levels/1 PUT /experience_levels/1.json
[ { "docid": "2ac2c1eec5f3ef41054d92f824ad8a6c", "score": "0.72437084", "text": "def update\n @experience_level = ExperienceLevel.find(params[:id])\n\n respond_to do |format|\n if @experience_level.update_attributes(user_params)\n format.html { redirect_to @experience_level, notice: 'Exp...
[ { "docid": "8c2530db1072ed68b09b72ad010ded0a", "score": "0.6757888", "text": "def update\n @exam_level = ExamLevel.find(params[:id])\n\n respond_to do |format|\n if @exam_level.update_attributes(params[:exam_level])\n format.html { redirect_to @exam_level, notice: 'Exam level was succe...
f1914b12140adc07345ebd7aaa9c07b4
confirmation email after signup
[ { "docid": "f1ccfdc65b5bdb2e116d593d03be486d", "score": "0.0", "text": "def smb_confirm(user)\n @smb = user\n mail(:to => user.email, :subject => \"Registration Confirmation\")\n end", "title": "" } ]
[ { "docid": "51a2b00c68f2b6852a91913225c869ae", "score": "0.795404", "text": "def signup_confirmation(user)\n @user = user\n\n mail to: user.email, subject: \"Sign Up Confirmation\"\n end", "title": "" }, { "docid": "cb7e945928ab286d58a1ae143d33e5e9", "score": "0.79038346", "te...
6fafa1d91fd03cd05391df54616df606
Filters the list, based on a set of key => value arguments.
[ { "docid": "5c88d793c668e7580817257d2bfa49c1", "score": "0.6099661", "text": "def filter(args = {}, operator = 'AND')\n return @output if args.empty?\n\n operator = operator.upcase\n\n return {} unless ['AND', 'OR', 'NOT'].include? operator\n\n count = args.size\n filtered = {}\n\n @ou...
[ { "docid": "0fc16854ddec84bd10666baa89a0ce04", "score": "0.7303475", "text": "def filter(arguments)\n new_conditions = []\n for key,value in arguments\n new_conditions.push(build_condition(key,value))\n end\n join_conditions(new_conditions)\n end", "title": "" }, { "docid":...
18c29732d811396110971aa01dbd197a
Check if object is an battler
[ { "docid": "a422c02772e32606d4e3ac3045888910", "score": "0.70840484", "text": "def battler?\n return false\n end", "title": "" } ]
[ { "docid": "811ef6788121e0378301394892c7a8af", "score": "0.7604304", "text": "def actor?\n @battler && @battler.is_a?(Game_Actor)\n end", "title": "" }, { "docid": "811ef6788121e0378301394892c7a8af", "score": "0.7604304", "text": "def actor?\n @battler && @battler.is_a?(Game_A...