query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
9f3852131425a4f5ab7eb6f45c9854da | Is this user a manager? This generally means elevated privileges but still no full read/write system access for safety. See also "privileged?" manager accounts are considered privileged. Administrators acquire manager privileges in passing. | [
{
"docid": "a395bb3d27eacaf6988217234f133276",
"score": "0.7845451",
"text": "def manager?\n return ( self.user_type == User::USER_TYPE_MANAGER or self.user_type == User::USER_TYPE_ADMIN )\n end",
"title": ""
}
] | [
{
"docid": "fa1a7f5ff72b9fb8c5093c9eea500607",
"score": "0.7913189",
"text": "def manager?\n return true if Tr8n::Config.admin_user?(user)\n return true if level >= Tr8n::Config.manager_level\n false\n end",
"title": ""
},
{
"docid": "baa6582c74d451e96f24c6e840a43f2b",
"score":... |
00b52099c746d056786117c047795e53 | Ajax endpoints for frontend validation | [
{
"docid": "375a1e6869ad09f06956e394e7f42348",
"score": "0.60689974",
"text": "def check_email_availability_and_validity\n values = Form.call(params[:form])\n validation_result = validate_email(address: values[:email],\n user: @current_user,\n ... | [
{
"docid": "7b9469427e079147632606725c84d4bd",
"score": "0.68037134",
"text": "def validate_and_authorize_xhr\n validate_xhr_request\n end",
"title": ""
},
{
"docid": "b2617adedbe58542cca523aff2f7944e",
"score": "0.66800904",
"text": "def valid\n render json: {}, status: 200\n... |
52e70fe0a310f1a46d958d11571240ff | POST /ptbudgets POST /ptbudgets.xml | [
{
"docid": "f9f812b15ae4151736dc0e2b37aba5bd",
"score": "0.7118288",
"text": "def create\n @ptbudget = Ptbudget.new(params[:ptbudget])\n\n respond_to do |format|\n if @ptbudget.save\n flash[:notice] = 'A new budget was successfully created.'\n format.html { redirect_to(@ptbudget... | [
{
"docid": "7994d6455e16b151ce59ba48670a4987",
"score": "0.6980694",
"text": "def ptbudget_params\n params.require(:ptbudget).permit(:fiscalstart, :budget, :used_budget, :budget_balance)\n end",
"title": ""
},
{
"docid": "e8c2d3470014947a822408873dc47916",
"score": "0.6608929",
... |
e4a43ba36bb0f676d791d25554b70871 | Remove the top card from your deck and return it | [
{
"docid": "295b4b51cbe80e44f70a635d334e6768",
"score": "0.63796264",
"text": "def deal_card\n if @unshuffled_deck[-1] == nil\n @unshuffled_deck = @addhand\n @addhand = @emptyarray\n @x = 0\n end\n card = @unshuffled_deck[@x]\n @unshuffled_deck[@x] = nil\n @x+=1\n return... | [
{
"docid": "e332beeac59dc6661fa44b86a60853bc",
"score": "0.808035",
"text": "def pop_card_top\n @cardList.pop\n end",
"title": ""
},
{
"docid": "4ea9dd6fe31e39a63729547a770d9112",
"score": "0.797527",
"text": "def remove_card\n cards.shift\n return cards\n end",
... |
82768e40d4c500636b66032a04054e65 | Internal: Indica si una experiencia se puede tomar con exclusividad total Retorna Boolean. | [
{
"docid": "f4e9b8554183a42307c278d5698e7f9d",
"score": "0.7031432",
"text": "def total_exclusivity_enabled?\n self.total_exclusivity_sales.present?\n end",
"title": ""
}
] | [
{
"docid": "e5f05ff767ff0eda3f799d07729f1a97",
"score": "0.7338519",
"text": "def total_exclusivity?\n self.exclusivity_id == Exclusivity.total_id\n end",
"title": ""
},
{
"docid": "08f377f2bc772d2d44fa4e84ac62f0fa",
"score": "0.6761496",
"text": "def inscrite?\n self.paiement... |
b7b03d8e2fb6c4929150dd2dc616ab19 | Gets the listItem property value. For drives in SharePoint, the associated document library list item. Readonly. Nullable. | [
{
"docid": "013945c2706d08d707597918ec60b573",
"score": "0.7353107",
"text": "def list_item\n return @list_item\n end",
"title": ""
}
] | [
{
"docid": "ec7ebe582c719c8c8dfbce4257021fbe",
"score": "0.6779934",
"text": "def list_item_id\n return @list_item_id\n end",
"title": ""
},
{
"docid": "2841e8d25036782b94e0d562c2ff6a46",
"score": "0.63707745",
"text": "def list_item=(value)\n ... |
b4b7840ba244a4b16fcb2c2f9262565b | Watch the hash index of a given mailbox this way redis will do only one operation at a time on that specific mailbox. We will keep retrying the transaction a few times per config value and send an exception up if it still fails after that | [
{
"docid": "5b164d3de88f1aabdbb73490ea8da751",
"score": "0.5478599",
"text": "def runMbxTransaction(hpk, op = '')\n limit = Rails.configuration.x.relay.mailbox_retry\n count, complete, res = 0, false, nil\n while count < limit and not complete\n rds.watch(\"mbx_#{hpk}\") do\n rds.mu... | [
{
"docid": "2d58b8950d45571336c994c1894fd9b5",
"score": "0.53310794",
"text": "def retry_update(x, hash_code, was_uncontended); end",
"title": ""
},
{
"docid": "563fb00e2f0041413606274e53c7b213",
"score": "0.49725968",
"text": "def try_obtain\n # Performing a single SET is atomi... |
890abc989ffa5e3f038d569f622e0d4f | Combined macdhist and rocr | [
{
"docid": "900bcc490c21698e2b0b8662ecfa93f4",
"score": "0.0",
"text": "def mhistslope(options={})\n options.reverse_merge!(:signal_period => 9, :time_period => 5)\n idx_range = calc_indexes(:ta_macdfix_lookback, options[:signal_period])\n result = Talib.ta_macdfix(idx_range.begin, idx_range.en... | [
{
"docid": "05f0b0df7aa74b20742e7b2761d4737e",
"score": "0.6143941",
"text": "def histograms; end",
"title": ""
},
{
"docid": "05f0b0df7aa74b20742e7b2761d4737e",
"score": "0.6143941",
"text": "def histograms; end",
"title": ""
},
{
"docid": "05f0b0df7aa74b20742e7b2761d473... |
c8aa584efed604324069d636e8eaeda9 | PUT /resource We need to use a copy of the resource because we don't want to change the current user in place. | [
{
"docid": "4dd1cfd6d067bff5e7e225eb27fd8af4",
"score": "0.0",
"text": "def update\r\n self.resource = resource_class.to_adapter.get!(send(:\"current_#{resource_name}\").to_key)\r\n prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)\r\n\r\n resource_... | [
{
"docid": "8821a7bf59b774efb642b32266cfd4de",
"score": "0.722461",
"text": "def put\n if(resource.collection?)\n Forbidden\n elsif(!resource.parent_exists? || !resource.parent_collection?)\n Conflict\n else\n resource.lock_check if resource.supports_locking?\n ... |
519c2e5a72ec44a26a4df5ce94d1a90e | GET /nfl_teams GET /nfl_teams.json | [
{
"docid": "f9d67319574840563418f64b611774aa",
"score": "0.0",
"text": "def index\n # @nfl_teams = NflTeam.all\n @afc = NflTeam.afc\n @nfc = NflTeam.nfc\n @all_teams = NflTeam.order(:city)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nf... | [
{
"docid": "162c5dfc6ecd3ee4a8ee6e08712576d9",
"score": "0.80661255",
"text": "def get_team_list ( page = 1 )\n get_api_resource \"#{@@api_base_url}teams/#{page}\"\n end",
"title": ""
},
{
"docid": "e779ef9a2c033109dfb54a7612a3674c",
"score": "0.7766389",
"text": "def teams\n ... |
da5241c7e498235fab3266c7e1fd1493 | GET /coupon_templates GET /coupon_templates.xml | [
{
"docid": "986337828a42bdce53ccbb5e437b1e58",
"score": "0.7451105",
"text": "def index\n @coupon_templates = @account.coupon_templates.find(:all, :order => 'expired_on ASC')\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @coupon_templates }\n e... | [
{
"docid": "cf497d1856ba98615cfcadcf2f86057d",
"score": "0.69546485",
"text": "def show\n @coupon_template = CouponTemplate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @coupon_template }\n end\n end",
"title": ""
},
... |
573378de713346f719dd4dfef44ac5da | Get the Zoomi public key for an Application Returns the Zoomi public key for an application. | [
{
"docid": "8b1c7d7061544e90f6f0318f53774e01",
"score": "0.7196192",
"text": "def get_application_zoomi_public_key_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ZoomiApi.get_application_zoomi_public_key ...'\n end\n # re... | [
{
"docid": "545643dc00f459b57645e179b009bf48",
"score": "0.81746703",
"text": "def get_application_zoomi_public_key(opts = {})\n data, _status_code, _headers = get_application_zoomi_public_key_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "5d927d37b99961cdb97bb06... |
6e902b2f9e99ad480cbe136eb6f0b4d9 | Finds all tags for context | [
{
"docid": "923e80bddbc5cb60fbfb6add98ab7c46",
"score": "0.77278167",
"text": "def get_tags_for_context(context)\n ActsAsTaggableOn::Tag.includes(:taggings)\n .where(\"taggings.context = '#{context}'\")\n .select(\"DISTINCT tags.*\")\n .map(&:name)\n end",
"title": ""
}
] | [
{
"docid": "a0cab6404d1702d353028deeb364e24e",
"score": "0.86408746",
"text": "def find_contextual_tags(context)\r\n tags.find(:all, :conditions => { 'taggings.context' => context})\r\n end",
"title": ""
},
{
"docid": "3aa5c6b75b18ad2e2d59ecd723ee255f",
"score": "0.78557485",
... |
78e5c872d59a06e36470b1e01cbcae9d | === GRAMMATICAL FUNCTION The canonical building block of learning to conjugate verbs in Latin. Take the present active infinitive, chop off the ending, and add the classic o,s,t,mus,tis,nt Wheelock Reference, p. 4. A&G, 160,a,1. === ARGUMENTS None === RETURNS TenseBlock | [
{
"docid": "08ef14d384136f18365d4a85631c74a9",
"score": "0.53820926",
"text": "def active_voice_indicative_mood_present_tense\n return TenseBlock.new(\n if conjugation == Linguistics::Latin::Verb::VerbTypes::First or\n conjugation == Linguistics::Latin::Verb::VerbTypes:... | [
{
"docid": "fa4e430bea308c0fbfa28b5790216727",
"score": "0.66324365",
"text": "def conjugate_past( verb )\n\t\tcase verb\n\t\twhen /e$/\n\t\t\treturn verb + 'd'\n\t\twhen /[^aeiou]y$/\n\t\t\treturn verb[ 0..-2 ] + 'ied'\n\t\telse\n\t\t\tif DOUBLING_VERBS.include?( verb )\n\t\t\t\tverb = verb + verb[ -1 ... |
cb27d0bba5f5638137a298258ac1e798 | Public: defines a node for sending an integer to HMRC name the name of the node. This will become the name of the method on the XmlSection. options a hash of options used to set up validations. Returns nothing you should rely on | [
{
"docid": "7f043933921e1625eb81a6c3afc7a199",
"score": "0.67546254",
"text": "def integer_node(name, options={})\n validators = [].tap do |validators|\n if options.has_key? :range\n validators << Validators::Range.new(options[:range][:min], options[:range][:max])\n end\n ... | [
{
"docid": "57876de2ab5696e1b9adb363ab679ad7",
"score": "0.57569706",
"text": "def node(name, options={})\n @nodes ||= {}\n @nodes[name] = options\n end",
"title": ""
},
{
"docid": "916eda4ed57be9468e1346fc45e9828a",
"score": "0.5439931",
"text": "def node(model_name, op... |
b455b285d1afdc1ee2d648f295a208f7 | Remove end segments, whose sequence length is under a specified value. | [
{
"docid": "498f27108041e282fb6544604be9117b",
"score": "0.6866056",
"text": "def remove_dead_ends(minlen)\n segments.each do |s|\n c = connectivity(s)\n rm(s) if s.length < minlen and\n (c[0] == 0 or c[1] == 0) and\n !cut_segment?(s)\n end\n self\n end",
"title":... | [
{
"docid": "c48e8ef262b1c6bbe5e3c143468d92dd",
"score": "0.67042106",
"text": "def remove_trailing(node_or_range, size); end",
"title": ""
},
{
"docid": "3201dd86bd089ffb5a52d6ec6d1fe203",
"score": "0.6314011",
"text": "def keep_tail(length)\n rank = size - length\n drop_ab... |
e12999c4416f546a7b366e630bf96e3e | Access the currently logged in user :api: public | [
{
"docid": "e1d6ef1ee403bd26f3f37c9bc6f5c1fb",
"score": "0.0",
"text": "def current_user(scope = :default)\n warden.user(scope)\n end",
"title": ""
}
] | [
{
"docid": "c605641ed1702350f9b7a74a314875aa",
"score": "0.85501504",
"text": "def getCurrentUser\n return User.find(session[:user_id])\n end",
"title": ""
},
{
"docid": "80d55744030877ce2893600a03c1d5e7",
"score": "0.85398954",
"text": "def current_user\n if logged_in?\n ... |
bdd3d4da50323b2cecf67d2ca1ac7f5c | GET /roles_users GET /roles_users.xml | [
{
"docid": "a2e038d173015f2ab83a9bf8a7463607",
"score": "0.0",
"text": "def index\n special_joins = {}\n\n ## BUILD MASTER HASH WITH ALL SUB-PARAMS ##\n allparams = {}\n allparams[:mainmodel] = RolesUser\n allparams[:webparams] = params\n allparams[:special_joins] = special_joins\n\n ... | [
{
"docid": "81f820aba49ac09ba424a3c44ecb4bf8",
"score": "0.76201355",
"text": "def account_users \n make_request(:get,\"#{account_url}/users.xml\")\n end",
"title": ""
},
{
"docid": "04956e99d1dc170882aa2e80b33238cc",
"score": "0.72173965",
"text": "def index\n @roles_user... |
a510914a5ce82a7788e8bb71a59f4b1f | The number of realtime connections attached to the channel. | [
{
"docid": "1bd76737925a058888f6fac04bfcbaef",
"score": "0.0",
"text": "def connections\n attributes[:connections]\n end",
"title": ""
}
] | [
{
"docid": "28f702b80193859e51debe6802b3c629",
"score": "0.7912469",
"text": "def channels_count\n channels.count\n end",
"title": ""
},
{
"docid": "c5878403328c54ea9d0974a0a71edbd7",
"score": "0.7765536",
"text": "def numConnections\n if activeConnections? then do\n n = ... |
0e9029c663309efc2ad2cda7ea7acda1 | The constructor which must be passed a tag value and an optional value for the field. | [
{
"docid": "b4c5f973bcc520934c0bf10cb8254f5a",
"score": "0.8246039",
"text": "def initialize(tag, value = \"\")\n @tag = tag\n @value = value\n end",
"title": ""
}
] | [
{
"docid": "1ff95cb2fbe5ee89e8723ebf2c93d02e",
"score": "0.7365811",
"text": "def initialize(field_name, value)\n @field_name = field_name\n @value = value\n end",
"title": ""
},
{
"docid": "30ae5750538d095ac15e9003a0fd8bfe",
"score": "0.70975983",
"text": "def initializ... |
bbe4a2c828118a9c70698d8e85683967 | End ASSOCIATIONS: All Associations of city_score Table to other tables. Begin METHODS: Custom methods for calls on model. Below Checks if previous score was higher or lower. | [
{
"docid": "d3e888c426302c0988420b5f84c61dc4",
"score": "0.49815348",
"text": "def score_increase?\n # Below - Makes sure in an if statement that a pervious veriosn exists first.\n if self.paper_trail.previous_version.nil?\n return false \n else # A previous version is there to calculate a... | [
{
"docid": "ed9398d41c1c2763716d1ee89b8181ae",
"score": "0.6417426",
"text": "def city_score_change \n # Below - Makes sure in an if statement that a pervious veriosn exists first.\n if self.paper_trail.previous_version.nil?\n return false \n else # A previous version does exist\n if ... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "0d2a1015c1b8d1b59b66627b179009bc",
"score": "0.0",
"text": "def detalle_pedido_params\n params.require(:detalle_pedido).permit(:pedido_id, :empresa_id, :plato_id, :cantidad, :costo_plato)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7498391",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6958937",
"text": "def strong_params\n params.require(:request).permit(param_white... |
d200f7614d29a92163e00d3ac949168a | Sets the various required data on the object. Hayabusa, crlf and arguments. | [
{
"docid": "a510accd42f1938a0957251ab1001d46",
"score": "0.0",
"text": "def initialize(args)\n @args = args\n @hb = @args[:hb]\n @crlf = \"\\r\\n\"\n end",
"title": ""
}
] | [
{
"docid": "69dd88931883c4d2ce676dce43da5303",
"score": "0.6472312",
"text": "def initialize(args={})\n @data = {}\n @data[:type] = ''\n @data[:data] = {}\n @data[:data][:datasets] = []\n @data[:options] = {}\n end",
"title": ""
},
{
"docid": "a884574eb6254e655947... |
f5fdcb84c8764d0557662c4a0e86abe0 | TODO: register and rebind events under the new system of dual collections | [
{
"docid": "3264c86bd87c94d451a5889b38b4c32d",
"score": "0.0",
"text": "def register(event)\n\t\t# event must be idle if it's new\n\t\t@idle_events.push event\n\t\t\n\t\treturn nil # prevent leakage\n\tend",
"title": ""
}
] | [
{
"docid": "8bf5d3bed012b57d83379ea9bb95654d",
"score": "0.6247156",
"text": "def bind_event_queues\n end",
"title": ""
},
{
"docid": "6c4a5df2dad67d5caa3569b74b6a8fb9",
"score": "0.61476725",
"text": "def on_aref(collection, index); end",
"title": ""
},
{
"docid": "80... |
82bd776d74288c3c3cf371e19b9ccc12 | Login to the system and retrieve the session key. | [
{
"docid": "19301e7c8de7d18b5a9d633781029032",
"score": "0.6931527",
"text": "def get_session_key\n\t\tres = RestClient.get 'https://secure.techfortesco.com/groceryapi_b1/restservice.aspx', {:params => {:command => 'LOGIN', :email => 'bwhtmn@gmail.com', :password => 'stokfridge', :developerkey => 'OULds... | [
{
"docid": "1ece8546fcbf3ade048aab5980506261",
"score": "0.7060815",
"text": "def login\n params = {\n 'method' => :post,\n 'command' => '/sessions'\n }\n\n response, headers = send_request(params)\n\n if !headers.has_key?(:x_vcloud_authorization... |
747ccf1775526bc67e6eacec1f454ba3 | Returns the array value in a vector | [
{
"docid": "0ba9b2f2c49e557613670e064fa977b5",
"score": "0.0",
"text": "def to_a(column_major=true)\n a = []\n if column_major\n for j in 0..3\n for i in 0..3\n a << self[i,j]\n end\n end\n ... | [
{
"docid": "3c5db9b5e3b4816908b3412a5051b8e8",
"score": "0.68880564",
"text": "def to_a\n @vector\n end",
"title": ""
},
{
"docid": "1332562638926cc6cab69df546eaf0fb",
"score": "0.6846463",
"text": "def [](i)\n \t@vector[i] \n end",
"title": ""
},
{
"docid... |
de91c842f8881d176b6d032ad5b5363a | Generates an image tag always relative to the current page unless absolute path or http url specified. img('test_image.gif') > img('contact/test_image.gif') > img(' > | [
{
"docid": "40b32684eb5f3d6e3746db8e269d3670",
"score": "0.6518132",
"text": "def img(name, options = {})\n options[:src] = name.match(%r{^((\\.\\.?)?/|https?://)}) ? name : \"#{current_page_relative_path}images/#{name}\"\n options[:alt] ||= name.split('/').last.split('.').first.capitalize... | [
{
"docid": "4198bccab232dad14cbfb3a0191e89c1",
"score": "0.72186387",
"text": "def image_tag(img, opts={})\n if img[0].chr == '/'\n opts[:src] = img\n else\n opts[:path] ||=\n if img =~ %r{^https?://}\n ''\n else\n if Merb::Config[:path_pre... |
f41f3bc127fbf37990a1a9df2873872b | these are the attr_accessors for the form these should be in & out of local time | [
{
"docid": "8540688cf8572f8cb39728b76fe80750",
"score": "0.0",
"text": "def s_time\n to_form_time(start_time.getlocal)\n end",
"title": ""
}
] | [
{
"docid": "3222fa56ef2603cbc00dc61ae69fdc78",
"score": "0.65906775",
"text": "def instance_attributes; end",
"title": ""
},
{
"docid": "119088f0f23b6b140ef9134559a64922",
"score": "0.6415208",
"text": "def attr_info; end",
"title": ""
},
{
"docid": "2dc9c5d731b1a45848546... |
ab03cdd32bc3da2abcbdb069b25c1590 | GET /responses GET /responses.json | [
{
"docid": "e646084025de84bb1feb3911786cb914",
"score": "0.71078247",
"text": "def index\n @responses = Response.all\n end",
"title": ""
}
] | [
{
"docid": "8133969096a3630059fa46752740d5ff",
"score": "0.7442789",
"text": "def responses\n question=Question.find(params[:questionId])\n render :json=> question.response\n end",
"title": ""
},
{
"docid": "b8e0862accab7b89d3ab1dd6752fbc12",
"score": "0.72299486",
"text": "de... |
b7cf07358f43ef1c9ed00e5b1fdbf62d | Add a tag to a batch of questions All questions that dont't have the tag and match filters will have it added. The returned number is the number of questions updated. Permissions Needed: TRIVIA_ADMIN | [
{
"docid": "391f4ca5f16f7341f3b96b7a8ab60641",
"score": "0.6748549",
"text": "def add_tag_to_questions_batch(opts = {})\n data, _status_code, _headers = add_tag_to_questions_batch_with_http_info(opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "3a111e218ae0b2f99d5cd5add79560d9",
"score": "0.67137516",
"text": "def create\n @question = Question.new(question_params)\n @question.user_id = current_user.id\n @tag_params = params[:tags_list]\n @tags = Tag.where(:text => @tag_params)\n Question.transaction do\n if @tag... |
6d94312015371577246be68037a5e398 | Returns the list of all EventType rows for all this Season's Meetings. [Steve, 20170718] Handmade has_many :event_types, through: :meetings (which can't work correctly) | [
{
"docid": "4f815d7d6307b0eafd79745c88ceb7e9",
"score": "0.6722352",
"text": "def event_types\n meeting_events.includes(:event_type).map(&:event_type)\n end",
"title": ""
}
] | [
{
"docid": "d1926641606a5b48b42c82bb4889e891",
"score": "0.61289215",
"text": "def all_events\n event_types.map { |etype| events(etype) }\n end",
"title": ""
},
{
"docid": "79288a36eb6e921792b5567d8fd55b49",
"score": "0.5798208",
"text": "def attended_events\n Event.where(... |
95dcccd9bbbdb6dcab1e5920a94fd8a8 | POST /universities POST /universities.json | [
{
"docid": "ba10e74e70e144d3c6a23deb717b2c0b",
"score": "0.5394358",
"text": "def create\n @university = University.new(params[:university])\n \n @university.users.first.admin = true\n\n respond_to do |format|\n if @university.save\n sign_in(:user, @university.users.first)\n ... | [
{
"docid": "6714835fd5f0ee7d74daad6222d24ea8",
"score": "0.6611861",
"text": "def universities_in_city\n universities = City.find(params[:id]).universities.order(name: :asc)\n\n render json: universities.to_json(), status: :ok\n end",
"title": ""
},
{
"docid": "069beebecd61779047f0a55... |
798797bbe5c33897a6294bf04ec74a33 | Optional the version number of the document the diagnostics are published for. | [
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.0",
"text": "def version; end",
"title": ""
}
] | [
{
"docid": "a5512b660952bd4f999aed2117f65488",
"score": "0.6956599",
"text": "def doc_version\n self['@version']\n end",
"title": ""
},
{
"docid": "65fe7176ee0c876b1092954ae84ecb45",
"score": "0.68220395",
"text": "def on_get_version(doc)\n end",
"title": ""
},
{... |
4f4870fb4b815bc3a93e49dacfb6e1a4 | parse template xml file into collection | [
{
"docid": "a5a713d96a5875086c306dbb495762fc",
"score": "0.0",
"text": "def get_metadata(partial, useExVal)\n\n element = partial.locate(COMPONENT)\n\n # first look for DataValues example if it's there use it and stop looking any farther.\n if(useExVal && (element.empty?) && !partial.locate(DAT... | [
{
"docid": "9ca222511fb0409c8f55aca84f4251a4",
"score": "0.6884412",
"text": "def xml_elements\n parsed_xml.xpath(\"//template/*\").to_xml\n end",
"title": ""
},
{
"docid": "82b7e29530b68f9bacfd0f0d20278222",
"score": "0.6602015",
"text": "def xml_elements\n ::Nokogiri::... |
a4e7126d2b37c7085de39d8dd6064914 | Returns +true+ if link should not be visited because its URL matches a skip_link pattern. | [
{
"docid": "9973df214fe49cee8676123a3e8f79a0",
"score": "0.84891933",
"text": "def skip_link?(link)\n @skip_link_patterns.any? { |pattern| link.path =~ /#{pattern}/ }\n end",
"title": ""
}
] | [
{
"docid": "651b1d2ebb0c488b114d9e46c65e1abb",
"score": "0.856316",
"text": "def skip_link?(link)\n @skip_link_patterns.each { |p| return true if link.path =~ p}\n return false\n end",
"title": ""
},
{
"docid": "95f0890a5400440cd447956de2825559",
"score": "0.84811956",
"... |
d3d0bcd29a3f11699e4677e8801907ad | Skill Effect : Damage Fix | [
{
"docid": "a70cb22b0e9f3dd6c811f864e4c4c212",
"score": "0.79132175",
"text": "def skill_effect_damagefix\r\n self.damage = nil unless $game_temp.in_battle\r\n end",
"title": ""
}
] | [
{
"docid": "69751a8d2e4df01f3d9b7c54c4f505cd",
"score": "0.8104345",
"text": "def attack_effect_damage\r\n self.hp -= self.damage\r\n end",
"title": ""
},
{
"docid": "d84f210faa0292e28e9993bbd85454bf",
"score": "0.80044454",
"text": "def skill_effect_disperation(skill)\r\n if ... |
f56d5fe5c75b83a711ac0ea6435c896f | parse svn revision and git commit hash from log | [
{
"docid": "d70a4ba13c7e9b01380aa4b816e0af6e",
"score": "0.6297401",
"text": "def gitlog(path='.')\n Dir.chdir path do\n log = `git log -n 1`\n\n def log.svnid\n self[/git-svn-id: .*@(\\d*)/,1]\n end\n\n def log.commit\n self [/commit ([a-f0-9]+)/,1]\n end\n\n ... | [
{
"docid": "1f5d014e749f9b2c5c130d0601d96a1a",
"score": "0.7573958",
"text": "def get_commit_log\n # log_str = `svn log -r\"#{last_tag_rev}\":HEAD \"#{SVN_URL}\" | egrep \"^[a-zA-Z]\"`\n # later we might want to get a path. or make it as additional info with merg history and stuff.\n svn_log_xm... |
99c90933b72227678631cf4ec29d5b90 | Add an active range | [
{
"docid": "fc73a1215a29b6ee0ca06051bda38705",
"score": "0.81019413",
"text": "def add_active_range(active_range)\n raise ArgumentError.new(Rack::AARM::DSL::Helpers::ARGUMENTS_BAD) unless active_range.is_a? Rack::AARM::DSL::ActiveRange\n @active_ranges << active_range\n self\n... | [
{
"docid": "ade6c7d27dc6aee394d307c4fea22002",
"score": "0.70091325",
"text": "def add_range(left, right)\n \n end",
"title": ""
},
{
"docid": "ade6c7d27dc6aee394d307c4fea22002",
"score": "0.70091325",
"text": "def add_range(left, right)\n \n end",
"title": ""... |
722634450799b65867373c6e98548d61 | Tworzenie linku do strony wylogowania | [
{
"docid": "1c01e221ab76dc7ef82af31f5ead0757",
"score": "0.0",
"text": "def signout_url\n {:controller => 'auth', :action => 'signout'}\n end",
"title": ""
}
] | [
{
"docid": "1638f8f3fbf748916ce56b77cb693eb9",
"score": "0.69248956",
"text": "def link_twitter\n\n end",
"title": ""
},
{
"docid": "1245b578ad70c251dcd004b03fcab7b4",
"score": "0.69110966",
"text": "def twitter_link(player)\n if player.twitter_screen_name\n # clean up any b... |
0d9ac5bc8a936d198c2ed8bcc8a9bc58 | Generic 400 bad request response | [
{
"docid": "bf51fce549e02f58c87b7b592521c147",
"score": "0.68015754",
"text": "def status_bad_request(errors = [])\n respond_to do |format|\n format.any { render json: errors.blank? ? operation_outcome_fatal.to_json : operation_outcome_with_errors(errors).to_json, status: :bad_request }\n end... | [
{
"docid": "c10d0d56b6a6c8d67b2525775ca513f3",
"score": "0.8048648",
"text": "def bad_request\n render json: {\n status: 400,\n message: 'Bad request'\n },\n status: :bad_request\n end",
"title": ""
},
{
"docid": "8d8a12... |
b33e8ba043dc6a77b4423b3af67ae194 | Builds the object from hash | [
{
"docid": "d14938d63ed3d118e3cf7c35df449ae9",
"score": "0.0",
"text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /\\AArray<(.*)>/i\n # check to ensure the input is an array given ... | [
{
"docid": "e2e77e3d4692b97a7841734d5d35a0ec",
"score": "0.7569417",
"text": "def from_hash(hash); end",
"title": ""
},
{
"docid": "e2e77e3d4692b97a7841734d5d35a0ec",
"score": "0.7569417",
"text": "def from_hash(hash); end",
"title": ""
},
{
"docid": "e2e77e3d4692b97a7841... |
e420c4a27be02b5fe6a80c29c3f5b33a | Returns the types of the data. See [Data types]( | [
{
"docid": "f4b57d83a3475076b8e31f029b12575d",
"score": "0.69472075",
"text": "def types\n fields.types\n end",
"title": ""
}
] | [
{
"docid": "89554c82b82d69f791a12dd9c2ca8b39",
"score": "0.7905832",
"text": "def data_type(*) end",
"title": ""
},
{
"docid": "ecb198034d73e6e7794991241f4bf9b2",
"score": "0.754648",
"text": "def verify_data_type()\n dt = @data_type.downcase\n tmp_text_array = Array.new\n t... |
a3dafa840081966d41082d477f6fa0f4 | ok so this is a little weird. In order for us to be able to say asset that we are on "pages" that have content in their URL that the user wouldnt know. Like a token. We can inspect the current path in order to build a path that is equal based on a page name. The example I made this for was 'the user setup page' which i... | [
{
"docid": "36500253d3607760ee57f4bb3d7a0f1e",
"score": "0.6654998",
"text": "def params_for_current_path\n app.routes.recognize_path page.current_path\n rescue ActionController::RoutingError\n {}\n end",
"title": ""
}
] | [
{
"docid": "1300de2357886695e9e322ff4cf6a5ee",
"score": "0.6713377",
"text": "def get_page_path(current_page)\n \"/\" + current_page.path.split('.').first + \"/\"\n end",
"title": ""
},
{
"docid": "5a0d7aeeb27114b0088d1529d83deeb9",
"score": "0.63355345",
"text": "def pages_path\... |
dd9e68a0e2090e3cdef69d3fbe60fc02 | If any, all the hooks that are required before a label should be set here. This method is optional | [
{
"docid": "5e510958a65eed8eba9ace7cdd170500",
"score": "0.0",
"text": "def prepare_label(shipment)\n end",
"title": ""
}
] | [
{
"docid": "b697346a7665f8fe06934555672e27a6",
"score": "0.62583643",
"text": "def label_overrides\n\t\t\t{}\n\t\tend",
"title": ""
},
{
"docid": "a46fceed34278cf2bd9ecaf7569bce00",
"score": "0.62427706",
"text": "def label_support; end",
"title": ""
},
{
"docid": "1acc34... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "ed564c8279832cd691199dc5103153c7",
"score": "0.0",
"text": "def profile_params\n params.require(:profile).permit(:religion,:gender,:city_of_birth,:country_of_birth,:state_of_birth,:income,:education_concentration,:interest,:is_manglik,:time_of_birth,:nakshatra,:marital_status,:diet,:smo... | [
{
"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... |
9948d01e3257644743f457d6563fb15c | 5 most recent opportunities | [
{
"docid": "159be8a1352ab43dceed9a9a6a005732",
"score": "0.6690369",
"text": "def recent_opportunities\n today = Time.zone.today\n post_opps = Opportunity.__elasticsearch__.where(status: :publish).where('response_due_on>?', today).where(source: :post).order(first_published_at: :desc).limit(4).... | [
{
"docid": "2e9fe6d6cb21b15a66414896512ff13f",
"score": "0.6903944",
"text": "def latest_five\n self.find :all, :limit=>5, :order => \"created_at desc\"\n end",
"title": ""
},
{
"docid": "0002808c7ee86c0210bdd53b7a0f9bd4",
"score": "0.6758831",
"text": "def five_recent_p... |
ca3a8555e7b3c7a3666b29c514e8617f | Creates an array of all ingredients | [
{
"docid": "ed05a1eb43baa62654841095c2adcf14",
"score": "0.7591204",
"text": "def ingredients_list\n @ingredients = Ingredient.all.collect { |p| [ p.name, p.id ]}\n end",
"title": ""
}
] | [
{
"docid": "84956bc41d95f856a4c90d1cda15b2c4",
"score": "0.79598576",
"text": "def ingredients\n self.recipe_ingredients.map do |recipeingredient|\n recipeingredient.ingredient\n end\n #returns an array of ingredients in the recipe_ingredients array\n end",
"title"... |
5b9c6593532e353057909fe5516e2bc5 | Add a NOT above an expression | [
{
"docid": "64796d4a751dac1c0a1817b3e943a1d7",
"score": "0.55977964",
"text": "def exp_add_not(exp, token)\n if exp[:token] && exp[:token] == token # If the token matches\n exp.keys.each do |key| # Find the key\n next if key == :token ... | [
{
"docid": "824950543ee1c1ff552608f8f541cb0d",
"score": "0.7145472",
"text": "def rewrite_not(expression)\n value = expression[1]\n\n s(:call,\n s(:colon2,\n s(:const, :VirtualKeywords),\n :REWRITTEN_KEYWORDS\n ), :call_not,\n s(:array,\n s(:self... |
39ce751cb740d9c4a7a89c7aa9d83fef | Retrieves a log stream by its ID. | [
{
"docid": "58566ac73637ed17797b3aa240555998",
"score": "0.8432232",
"text": "def log_stream(id)\n raise Auth0::InvalidParameter, 'Must supply a valid log stream id' if id.to_s.empty?\n path = \"#{log_streams_path}/#{id}\"\n get(path)\n end",
"title": ""
}
] | [
{
"docid": "e9ab41b1f093be29efe201c41d110a78",
"score": "0.78981555",
"text": "def get_stream id\n @streams[id]\n end",
"title": ""
},
{
"docid": "db576368d8bef395c93f458881cf570b",
"score": "0.7124133",
"text": "def stream(id)\n get(\"/tracks/#{Integer(id)}/stream\", ... |
28b9ab21200376da8e2813220a95b3ca | Update a &39;iam.LdapProvider&39; resource. | [
{
"docid": "594aa555c2e12c5d35e13863a44e6591",
"score": "0.0",
"text": "def patch_iam_ldap_provider_with_http_info(moid, iam_ldap_provider, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IamApi.patch_iam_ldap_provider ...'\n end\n # ver... | [
{
"docid": "1a127c5b8bab15eef0991d540f4bb297",
"score": "0.6543666",
"text": "def update\n if Providers::UpdateProvider.new(@provider, provider_params).update\n flash[:success] = c_t('success.update')\n redirect_to @provider\n else\n render :edit\n end\n end",
"title": ""
... |
0951852bd3f22ecefa3f05c92367321b | method just focusing on one customer, don't have to send the whole collection, as will only be looking at the one specified | [
{
"docid": "d5869c794c84946ad6390c3eff045ded",
"score": "0.0",
"text": "def remove_customer_cash(customer, cash_to_remove)\n return customer[:cash] -= cash_to_remove\nend",
"title": ""
}
] | [
{
"docid": "280e396c10586f638af5fd7742139339",
"score": "0.7021449",
"text": "def customer_selector(object, method, account, prompt, selected, options={}, html_options={})\n customers = account.customers.map {|c| [c.name, c.id]}\n select object, method, customers, :prompt => prompt, :selected => s... |
4e3c0b8721ef5c0c3349a9fcee61885b | Used by watch to record the time of a method call without losing the method's return value | [
{
"docid": "10dfe8f0ce89bab479d9d66fc0c098c4",
"score": "0.0",
"text": "def measure(name, &block)\n if self.running? name\n yield\n else\n result = nil\n self.results[name] ||= 0\n self.running << name\n self.results[name] += Benchmark.measure{result = yield}... | [
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.7046175",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.7046175",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"sc... |
ad8be3e7b7ebbe8cdc2b237d5f5063f7 | datetime User's most recent login time via SFTP | [
{
"docid": "33d254367934e609e658d433b72260c8",
"score": "0.7818066",
"text": "def last_sftp_login_at\n @attributes[:last_sftp_login_at]\n end",
"title": ""
}
] | [
{
"docid": "542af65cdbb908f16cc193b59e026424",
"score": "0.7539887",
"text": "def last_ftp_login_at\n @attributes[:last_ftp_login_at]\n end",
"title": ""
},
{
"docid": "2be20b82c92f34038711cfd5eb4c57b2",
"score": "0.65937656",
"text": "def last_login_at\n @attributes[:la... |
a57fa02de1769d3020a7daf4efba4b29 | return true if redirected | [
{
"docid": "284199d8fb9ccc241cf311757d042d70",
"score": "0.0",
"text": "def check_own_participant_and_redirect?\n unless @project.participants.ids.include? params[:participant_id].to_i\n flash[:danger] = 'Access denied. Participant does not belong to that project.'\n redirect_to display_pro... | [
{
"docid": "926ab65181c3576b38cff76e8cc04c5c",
"score": "0.8594206",
"text": "def redirected?\r\n @Out.redirected?\r\n end",
"title": ""
},
{
"docid": "9c1393b32df10a52b951ba68fc344982",
"score": "0.8509021",
"text": "def redirected?\n !!headers[\"Location\"]\n... |
b97f7d11f03399b83cf3df1d3fe020cd | ls solution more or less from memory | [
{
"docid": "9b4a70834e799bc8e697a8ed0037905b",
"score": "0.0",
"text": "def transpose(matrix)\n result = []\n (0..2).each do |column_idx|\n new_row = (0..2).map { |row_idx| matrix[row_idx][column_idx] }\n result.push new_row\n end\n result\nend",
"title": ""
}
] | [
{
"docid": "878117c779ca048ea6136908b3cbd97e",
"score": "0.6326785",
"text": "def lsd\n puts %x{ls -la --sort=t -r -p}\nend",
"title": ""
},
{
"docid": "13a38518ea0984e40e2c319e8641f776",
"score": "0.5822986",
"text": "def solution\n solutions\n end",
"title": ""
},
{
... |
cff159b8db65e06ac11484ed439a7307 | GET /modes/1 GET /modes/1.xml | [
{
"docid": "e10b1ba0d9dfa12542efff88ea65db0f",
"score": "0.7601858",
"text": "def show\n @modes = Mode.all\n @mode = Mode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mode }\n end\n end",
"title": ""
}
] | [
{
"docid": "0fa587d056997772d7a98e6535dac4d9",
"score": "0.73603064",
"text": "def modes\n @client.get('/Journey/Meta/Modes')\n end",
"title": ""
},
{
"docid": "382f2189053ce6a75048ca50c7f66cc4",
"score": "0.6813256",
"text": "def index\n @modes = Mode.all\n end",
... |
a7a817661c0faa5c863dfc7d8fa829b2 | Returns the string representation of the object | [
{
"docid": "a408df9f3be79d7c20500741a990725c",
"score": "0.0",
"text": "def to_s\n to_hash.to_s\n end",
"title": ""
}
] | [
{
"docid": "e0c61d22481a9b8a23b7a0620c2b5f87",
"score": "0.901024",
"text": "def to_s\n @object.to_s\n end",
"title": ""
},
{
"docid": "fc45164ab937a7dc1e465646a36f565c",
"score": "0.89506465",
"text": "def to_s\n object.to_s\n end",
"title": ""
},
{
"doci... |
f995d0b14056543e83d06f221c5cfe44 | Gets the current text of a page | [
{
"docid": "3fca7f02cb032e707f7452d23b1707fc",
"score": "0.0",
"text": "def get_page_contents(title)\n JSON.parse( \n @client.api.get(\"#{@client.base_uri.path}/api.php?#{URI.encode_www_form({\n :action => 'query',\n :prop => 'info|revisions',\n :titles => title,\n :r... | [
{
"docid": "5e160469aa481049ef78f5b59c3c5adb",
"score": "0.7997204",
"text": "def page_text\n @web_browser.text\n end",
"title": ""
},
{
"docid": "5a8b9aae65d57af728ba04c078caa82d",
"score": "0.7991914",
"text": "def page_text\r\n @web_browser.text\r\n end",
"titl... |
4794b383fd7ae4dfd85476c97d2cd0c3 | GET /establecimientos/new GET /establecimientos/new.json | [
{
"docid": "fed9ec4dfdaebeb1149f593e4c79722e",
"score": "0.7410024",
"text": "def new\n @establecimiento = Establecimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @establecimiento }\n end\n end",
"title": ""
}
] | [
{
"docid": "3b521a5dc4e9b0c5a84911bd81247573",
"score": "0.7519541",
"text": "def new\n @estacion = Estacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estacion }\n end\n end",
"title": ""
},
{
"docid": "cad0853a531674892a7fb... |
b0a68cc5fefefacb0da8f61bc287667f | GET /song_classes GET /song_classes.json | [
{
"docid": "d05f2633ba1b69e871f2643376e54f57",
"score": "0.7312282",
"text": "def index\n @song_classes = SongClass.all\n end",
"title": ""
}
] | [
{
"docid": "58ea81f9f7700b7f979271127c1b9e9f",
"score": "0.64230835",
"text": "def set_song_class\n @song_class = SongClass.find(params[:id])\n end",
"title": ""
},
{
"docid": "44d701006715273905b393d87acbec02",
"score": "0.6413044",
"text": "def fetch_classes_list\n uri =... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "81fc5a0f02388f5c905e061f95f0c1b8",
"score": "0.0",
"text": "def woodensofaset_params\n params.require(:woodensofaset).permit(:title, :description, :price, :image, :previewo, :previewt, :previewth, :sdescription, :offerprice, :coupon, :brand, :color, :warrenty, :material)\n end",
... | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69780594",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.678054",
"text": "def strong_params\n params.requi... |
3a41eff67e422d727f685e2dd7f11f17 | Get count for alive threads. | [
{
"docid": "3d00e4099155364d0d41fe627039ea5f",
"score": "0.7133119",
"text": "def num_alive\n self.map(&:alive?).keep_if { |v| v == true }.size\n end",
"title": ""
}
] | [
{
"docid": "98ffe3d4ac67bc8a950c026422af7e29",
"score": "0.7997515",
"text": "def count\n @threads.count\n end",
"title": ""
},
{
"docid": "e2ab928351e48db4ab0cbe4bd1fb04fd",
"score": "0.7860808",
"text": "def live_worker_count\n worker_counts[:alive]\n end",
"title":... |
e823183975b6e7c5b48fa188c31127bd | add up the sizes of shapefile components and avoid extra recursion. path should be the .shp file itself so that other files in the same dir are skipped | [
{
"docid": "82cabae4b93897fa997af5e9f2fa4dc5",
"score": "0.708956",
"text": "def get_multi_shp_bytes(path)\n begin\n return nil if ! File.exist?(path)\n base = File.basename(path.downcase, '.shp')\n loc = File.dirname(path)\n total = 0\n shp = (loc+\"/\"+base).downcase+\".shp... | [
{
"docid": "9eaa80421207e1bda6cbce7483d7f144",
"score": "0.6167851",
"text": "def size(path)\n debug(\" SIZE #{path}\")\n base, rest = split_path(path)\n case\n when base.nil?\n default\n when rest\n @subdirs[base].size(rest)\n when @files.has_key?(base)\n ... |
7673b7239a211b8bdae804ee089840f6 | Operations compile_master_plan() returns a Plan::MasterPlan for this System of Grammars | [
{
"docid": "f067636d17ca298d90bed2f8f355e856",
"score": "0.82932484",
"text": "def compile_master_plan()\n return Plan::MasterPlan.build( self )\n end",
"title": ""
}
] | [
{
"docid": "09ce84291c651f655228154a5841bc11",
"score": "0.5578132",
"text": "def create_master\n @plan = Plan.new(plan_params)\n @plan.plan_type = 'master'\n\n respond_to do |format|\n if @plan.save\n format.json { render :show, status: :created, location: api_v... |
b2b1a5c271ed44598ed1d3149111a428 | GET /backend/conf_activities GET /backend/conf_activities.json | [
{
"docid": "732eb88e2ac1413f187e68e7cddb353c",
"score": "0.79817796",
"text": "def index\n @backend_conf_activities = Conf::Activity.all\n end",
"title": ""
}
] | [
{
"docid": "21b623c965d25101ab1fde88c8821fca",
"score": "0.75542724",
"text": "def activities\n get_call(\"1/activities.json\")\n end",
"title": ""
},
{
"docid": "66e0ea9ac48ce37079941ace7e88de8e",
"score": "0.68641347",
"text": "def activities(params = {})\n scope 'defa... |
b5ea3c5b1cc2944d3c209d4dca815bf6 | Get a single field of a member's information. | [
{
"docid": "531a39544c42f48515803aadd87478ea",
"score": "0.7210626",
"text": "def getMemberField(memberId, field)\n\tresponse = RestClient.get(\"https://api.trello.com/1/members/\"+memberId+\"/\"+field+\"?key=\"+$key+\"&token=\"+$token+\"&filter=open\")\n\tresponse = JSON.parse(response)\nend",
"tit... | [
{
"docid": "06d58d27fa77eb7cd4deef537f4b1b1b",
"score": "0.73983014",
"text": "def get_field(name)\n get(name)\n end",
"title": ""
},
{
"docid": "5d06d5af538b6b10f243647394f18106",
"score": "0.7298308",
"text": "def field(name)\n fields.get(name)\n end",
... |
4af89ac175e188244c4ae9bd0cddffc4 | GET /modified_documents/1 GET /modified_documents/1.json | [
{
"docid": "d306e2685e4f4616a7ab2d05ddcf521c",
"score": "0.7756128",
"text": "def show\n @modified_document = ModifiedDocument.find(params[:id])\n render json: @modified_document, status: :ok\n end",
"title": ""
}
] | [
{
"docid": "e08baf5976b6cc4496d37242df06059e",
"score": "0.7210721",
"text": "def update\n @modified_document = ModifiedDocument.find(params[:id])\n \n if @modified_document.update(modified_document_params)\n render json: @modified_document, status: :ok \n else\n render json: @modi... |
c0cd4214911572047c6fb84ec77a8574 | POST /newsvilles POST /newsvilles.json | [
{
"docid": "b92eee561d08f20f58fe201c33ae4072",
"score": "0.70435756",
"text": "def create\n @newsville = Newsville.new(newsville_params)\n\n respond_to do |format|\n if @newsville.save\n format.html { redirect_to @newsville, notice: 'Newsville was successfully created.' }\n form... | [
{
"docid": "4889b9675b34909f69cf860f89b6c3bf",
"score": "0.6859915",
"text": "def create\n @lop_mon_hoc_sinh_vien = LopMonHocSinhVien.new(params[:lop_mon_hoc_sinh_vien])\n\n respond_to do |format|\n if @lop_mon_hoc_sinh_vien.save \n format.json { render json: @lop_mon_hoc_sinh_v... |
8cab9c0f6efed504bdb7ab24083406ec | Return term to be used to run module with CallFunction | [
{
"docid": "e24ad8ed5b939712104c95f3a2a065d6",
"score": "0.0",
"text": "def getClientTerm(step, _def, former_result)\n step = deep_copy(step)\n _def = deep_copy(_def)\n former_result = deep_copy(former_result)\n client = getClientName(\n Ops.get_string(step, \"name\", \"dummy\... | [
{
"docid": "b3f6bcf9d54b4bcb66185d3012f582a9",
"score": "0.66844743",
"text": "def call(*) end",
"title": ""
},
{
"docid": "45b9e71b1543d3dc73e9c136dad5f860",
"score": "0.6470256",
"text": "def call_name\n function_node\n end",
"title": ""
},
{
"docid": "22eca42bc... |
7a8c1b81ed915b6215e109a4521dd9aa | Creates a link that updates the specified form element with the current date and time when clicked. By default, this will also include a "Clear" link to clear out the same element instead. | [
{
"docid": "c11a6c5b8a62c1dcdf01c56db01e8925",
"score": "0.66071934",
"text": "def link_to_now(element_id, include_clear_link = true)\n str = \"\"\n str << link_to(\"Set to now\", \"#\", :class => \"link-to-now\", \"data-target\" => element_id.to_s)\n if include_clear_link\n str << separat... | [
{
"docid": "ba17721c487d48283ec6bebf726ee60d",
"score": "0.61669314",
"text": "def link_to_add_time(name, f, association)\n new_object = f.object.send(association).klass.new\n id = new_object.object_id\n fields = f.fields_for(association, new_object, child_index: id) do |builder|\n render(... |
0d2c2a19df3a2db2966422c2c1e6322b | POST /senders POST /senders.json | [
{
"docid": "91bdda3507bd36eb1c7bc682bf748de0",
"score": "0.0",
"text": "def create\n @sender = Sender.new(sender_params)\n\n num0 = rand(0...10).to_s\n num1 = rand(0...10).to_s\n num2 = rand(0...10).to_s\n num3 = rand(0...10).to_s\n num4 = rand(0...10).to_s\n num5 = rand(0...10).to_... | [
{
"docid": "e33f2c908ac36c2a063eaf255067e655",
"score": "0.6612571",
"text": "def senders()\n _params = {}\n return @master.call 'users/senders', _params\n end",
"title": ""
},
{
"docid": "d054e47768ac86eb628b30c5d817f54e",
"score": "0.6443907",
"text": "... |
d2fa751f2b9f6643a426ab95128cd7c0 | DELETE /mentors/1 DELETE /mentors/1.json | [
{
"docid": "8b701aabf4ad2b086ac1853f2a67a0d3",
"score": "0.7272228",
"text": "def destroy\n @mentor = Mentor.find(params[:id])\n @mentor.destroy\n\n respond_to do |format|\n format.html { redirect_to mentors_url, alert: \"Mentor was successfully removed.\" }\n format.json { head :no_c... | [
{
"docid": "277f4418a847578a1d7766d005abd25f",
"score": "0.7537415",
"text": "def destroy\n @mentor.destroy\n respond_to do |format|\n format.html { redirect_to mentors_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "beb9a783c7395bb4bd5fd... |
bd80ab52b7821fd89cdc68b32884a34f | The circumference of a circle is 2pir | [
{
"docid": "df845f2be8fbb441dd6358a94f5a27bc",
"score": "0.7494681",
"text": "def circumference\n \n end",
"title": ""
}
] | [
{
"docid": "ab64ad124a338c252686eb2f98bd71cb",
"score": "0.8636114",
"text": "def circumference_of_circle(radius)\r\n 2 * Pi * radius\r\nend",
"title": ""
},
{
"docid": "6e94a7e64b395f476d5eb20e33323252",
"score": "0.8347226",
"text": "def circumference(r)\n 2 * pi * r\nend",
... |
9b941250d62aa0b951f39609bc741c1b | GET /coin_values/new GET /coin_values/new.json | [
{
"docid": "73342b1181d5f60f06f9e1a41ca619cf",
"score": "0.79096276",
"text": "def new\n @coin_value = CoinValue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @coin_value }\n end\n end",
"title": ""
}
] | [
{
"docid": "f5ec5140e52cec0aeb78ce5f082ce4e9",
"score": "0.7593942",
"text": "def new\n @coin_value = CoinValue.find(params[:coin_value_id])\n @coin = @coin_value.coins.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @coin }\n end\n en... |
495095246ec1d32edf50b98ca9c55b31 | Encryption class initializes phrase instance variable provided by user Default state is an empty string | [
{
"docid": "5387914738ef0e8b5f398bb1e6c9fcb3",
"score": "0.74447095",
"text": "def initialize (phrase_to_encode=\"\")\n\t\t@starting_phrase = phrase_content(phrase_to_encode)\n\t\t@one_time_phrase = \"\"\n\t\t@encrypted_message = \"\"\n\tend",
"title": ""
}
] | [
{
"docid": "0f77d3baa0a8e4b3ee6a10aa2e8fd989",
"score": "0.664301",
"text": "def encrypt_phrase\n\t\tunencoded_array = @starting_phrase.split('').map{|v| v.ord - 65}\n\t\tone_time_array = @one_time_phrase.split('').map{|v| v.ord - 65}\n\t\tunencoded_array.each_with_index do |starting_value, index|\n\t\... |
ca0dea5ab96d35b24313b12e0fc08b1c | Format message content. Replace URLs in a message text with links to that URL. Encode unicode or unprintable characters with &; codepoints. Replace emojis with inline images if desired. | [
{
"docid": "d5e6a8113c536c1a2a9e3c6cd30c3b2a",
"score": "0.8002377",
"text": "def formatMessageText(messageText)\r\n s = 0\r\n result = \"\"\r\n while urlMatch = messageText.match(URI.regexp, s)\r\n if urlMatch.begin(0) > s\r\n result.concat(uniToHtml(messageText[s..urlMat... | [
{
"docid": "dc910c5231f676687b8d30897fd6e40b",
"score": "0.71438545",
"text": "def process_message(message)\n urls = []\n # Step 1: Extract all URLs and replace them with a placeholder.\n message = message.gsub(%r!(https?|ftps?|gopher|irc|xmpp|sip)://[[[:alnum:]]\\.,\\-_#\\+&%$/\\(\\)\\[\\]\\?=... |
114f5a32bbe1a4d56ffdcda24a48219b | Method to add an item to a list input: list, item name, and optional quantity steps: iterate throught the keys to check if the item exists if it exits add to the end of the hash the item with quantity if specified else otherwise set default value = 1 output: [updated item hash ] | [
{
"docid": "d1e24ab7ef6a0fd90371bd7858e7f598",
"score": "0.0",
"text": "def add_item(grocery_list, item, quantity)\n\tif grocery_list.member?(item)\n\t\tgrocery_list[item] += quantity\n\telse\n\t\tgrocery_list.store(item, quantity)\n\tend\n\tgrocery_list\nend",
"title": ""
}
] | [
{
"docid": "b488afbcb394a63cd316c33323edf145",
"score": "0.87543267",
"text": "def add_list(hash, item, quantity)\r\n# input: hash, item name and optional quantity\r\n# steps: \r\n\t# Create new hash key based on item name\r\n\t# IF no quantity specified\r\n\tif quantity == nil\r\n\t\t# Set quantity to ... |
08ddbf900580a603375f0ce0dc4e6fed | Parse the command line arguments | [
{
"docid": "2b794ffcdebd2465496c6d6d0d75319c",
"score": "0.0",
"text": "def parse_arguments(args, logger)\n options = OpenStruct.new\n options.api_url = 'http://127.0.0.1:3081'\n logger.level = Logger::INFO\n options.files = []\n\n parser = OptionParser.new do |opts|\n opts.banner = 'Usage: flap... | [
{
"docid": "1e211a00cdbb0a010283db89ac3cc687",
"score": "0.731781",
"text": "def parse_command_line args\n args.options do |opt|\n opt.on(\"rutema v#{Version::STRING}\")\n opt.on(\"Options:\")\n opt.on(\"--config FILE\", \"-c FILE\",String,\"Loads the configuration from FILE\")... |
718753c8201965652316e4de90de74e3 | Remove the element at given position | [
{
"docid": "e65b8c200a279f6e749245d5187e8401",
"score": "0.6645556",
"text": "def delete_at(position)\n invalidate_refs if symbols[position].is_a?(ProductionRef)\n symbols.delete_at(position)\n end",
"title": ""
}
] | [
{
"docid": "49b2a711a8ca3809925917d96494f2c4",
"score": "0.8272826",
"text": "def remove(position)\n native :del, [position]\n end",
"title": ""
},
{
"docid": "57074c9355ca6dd9839fdf7c07ff6e8e",
"score": "0.8106634",
"text": "def delete_at(pos) end",
"title": ""
},
{
... |
5b180c9d9865d944a2b3c94653cbca73 | DELETE /rake_files/1 DELETE /rake_files/1.json | [
{
"docid": "35e171fb7c5f7a084454834b1a8a317f",
"score": "0.7517117",
"text": "def destroy\n @rake_file = RakeFile.find(params[:id])\n @rake_file.destroy\n\n respond_to do |format|\n format.html { redirect_to rake_files_url }\n format.json { head :no_content }\n end\n end",
"ti... | [
{
"docid": "2148e2fd9383c12872890f51efee3615",
"score": "0.70845515",
"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... |
a6527a2ee7f77ed7a93a4b65ae76ef25 | Obtain an InputSet object, used to define inputs for an execution of this Choreo. | [
{
"docid": "b52635750516eb6c48c38744c539a3fc",
"score": "0.0",
"text": "def new_input_set()\n return DeleteBouncedAddressInputSet.new()\n end",
"title": ""
}
] | [
{
"docid": "d8eb34cfc5a1e737977f7023d4849c46",
"score": "0.67405313",
"text": "def new_input_set()\n return CreateObjectInputSet.new()\n end",
"title": ""
},
{
"docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33",
"score": "0.65799934",
"text": "def new_input_set()\n return R... |
cff4511a8889bfc0c07f58807c394c5f | Use this method to whitelist the permissible parameters. Example: params.require(:person).permit(:name, :age) Also, you can specialize this method with peruser checking of permissible attributes. | [
{
"docid": "28c9e9209d998c01f522eab2de1955f6",
"score": "0.0",
"text": "def contact_params\n params.require(:contact_us).permit(:name, :email, :subject, :body)\n end",
"title": ""
}
] | [
{
"docid": "08a3b9a8de9dd7334ffe66919731cb94",
"score": "0.78362924",
"text": "def permit_params!(params)\n if @allow_all_params\n params.permit!\n elsif @allowed_params\n @allowed_params.each do |resource, attributes|\n if params[resource].respond_to? :permit\n ... |
6c08d8f0b29ac1ef0b006642a38ba79e | DELETE /jam_sessions/1 DELETE /jam_sessions/1.json | [
{
"docid": "231c9a365f5500686e030a78173942fd",
"score": "0.7067937",
"text": "def destroy\n @jam_session.destroy\n @guests= GuestSessionAssociation.where(jam_session_id: @jam_session.id)\n @guests.destroy_all\n respond_to do |format|\n format.html { redirect_to jam_sessions_path }\n ... | [
{
"docid": "8495e13e2969defcd2ce872f0103cb12",
"score": "0.7205053",
"text": "def destroy\n @session = @client.sessions.find(params[:id])\n @session.destroy\n respond_to do |format|\n format.html { redirect_to client_url(@client), notice: 'Session was successfully destroyed.' }\n form... |
62553d596e614026c1d2876ba39a8f1d | Fonctions d'affichage des tables, possible de faire qu'une seule fonction mais comment ? | [
{
"docid": "2511120b4cd5752ce401f1b2483ab1c2",
"score": "0.0",
"text": "def client\n redirectco\n @title = \"Clients\"\n @clients = Client.all\n end",
"title": ""
}
] | [
{
"docid": "98d9a6dd9ad1839a61051e73597fdf5a",
"score": "0.78109056",
"text": "def table_comment(table_name); end",
"title": ""
},
{
"docid": "98d9a6dd9ad1839a61051e73597fdf5a",
"score": "0.78109056",
"text": "def table_comment(table_name); end",
"title": ""
},
{
"docid":... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "6e55af1e08ec59042114235451ccf405",
"score": "0.0",
"text": "def event_params\n params.permit(:objectId, :id, :address, :endDate, :imageThumbUrl, :moreInfo, :shortDescription, :title, :utf8, :_method, :authenticity_token, :commit)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7498391",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6958937",
"text": "def strong_params\n params.require(:request).permit(param_white... |
eee739ee4af73d8b3ad4e3453b3a4eeb | Search for the given keyword within the board | [
{
"docid": "70c1a16dee17f0aa9ce80f1499bca620",
"score": "0.7969557",
"text": "def search(keyword)\n # For each point on the board...\n (0...@rows).each do |row|\n (0...@cols).each do |col|\n # Check the first letter to see if keyword[0] == board[row][col]\n # This optimization a... | [
{
"docid": "f2f480b0cb64621f9ad5ea916e17e8d3",
"score": "0.7762588",
"text": "def search(word)\n search_word(word)\n end",
"title": ""
},
{
"docid": "f683bd54cfbeb88f5fcc68d409e90e07",
"score": "0.77395976",
"text": "def search(word)\n \n end",
"title": ""
},
... |
7349d57b4172f71709fc830a0e655f05 | for missing tuples, each branch must have at least one node failed all such node are suspicious | [
{
"docid": "9dfc5e70354c929668852eac75b7a97a",
"score": "0.5333384",
"text": "def where_cond_test_m(tuple_node_test_result_tbl)\n pk = @pkFullList.map { |pk| \"#{pk['alias']}_pk\" }.join(', ')\n @predicateTree.branches.each do |branch|\n branch.nodes.each do |nd|\n query = \"INSERT INT... | [
{
"docid": "0ff845c67dea9942184f31507ce3d780",
"score": "0.65132785",
"text": "def failed_nodes\n select do |node|\n node.failed?\n end\n end",
"title": ""
},
{
"docid": "a400e2ea731e43ed851d639bbc3e0a8c",
"score": "0.6446634",
"text": "def failed_nodes\n sel... |
880a478523fab5430919095ec05ec399 | POST /additions POST /additions.xml | [
{
"docid": "3c673903ac84bd61821f05b1843b75cf",
"score": "0.5197409",
"text": "def create\n @addition = Addition.new(params[:addition])\n employment_id = params[:employment_id]\n @addition.employee_id = @addition.employment.employee.id\n\n respond_to do |format|\n if @addition.save\n ... | [
{
"docid": "2996f64edd26f79ed1dbec8089271e16",
"score": "0.58804655",
"text": "def index\n @additions = Addition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @additions }\n end\n end",
"title": ""
},
{
"docid": "7c4901cbfecd... |
3b69d4fb3fe2c6529b7fee8788c4e987 | When this execution entered the :initialized state. | [
{
"docid": "6d3ab739b0ecec6e09fc211744e2dd02",
"score": "0.6749669",
"text": "def initialized_at\n state_at(:initialized)\n end",
"title": ""
}
] | [
{
"docid": "4c8439db0eda07a0e24e524732fafa74",
"score": "0.7694892",
"text": "def on_initialization_finished()\n end",
"title": ""
},
{
"docid": "f89c02d902b65c831453949cb2cf0462",
"score": "0.744042",
"text": "def initialized\n end",
"title": ""
},
{
"docid": "646323... |
4ffb12c81d7c6dc38c999da99d384779 | Checks whether a password is needed or not. For validations only. Passwords are always required if it's a new record, or if the password or confirmation are being set somewhere. | [
{
"docid": "d20cb4afe2b055973326c985db4c7c8a",
"score": "0.8216572",
"text": "def password_required?\n !persisted? || !password.blank? || !password_confirmation.blank?\n end",
"title": ""
}
] | [
{
"docid": "1878f0aab1f1076b3b53e728ef63881b",
"score": "0.8599125",
"text": "def password_required?\n return false if self.skip_password_validation\n true\n end",
"title": ""
},
{
"docid": "1878f0aab1f1076b3b53e728ef63881b",
"score": "0.8599125",
"text": "def password_r... |
97cafe205aababe1054c667a09f2b87e | see current auction live bid price | [
{
"docid": "d12f956df1f83b2aebb1ccf339e0a0f7",
"score": "0.0",
"text": "def bid_lists\n\t\tauction_item_bids = @auction.auction_item_bids.where(user_id: current_user.id)\n\t\trender json: @auction_item_bids.as_json\n\tend",
"title": ""
}
] | [
{
"docid": "7fd83fd8e82c44c977cb626627e42f28",
"score": "0.78869164",
"text": "def bid\n BigDecimal Fyb.public.ticker.perform.parse['bid'], 2\n end",
"title": ""
},
{
"docid": "a4a75e649cd57555a43dbe5afc399710",
"score": "0.7649336",
"text": "def current_bid\n if bids.coun... |
4c3a1fd41f7e965b954143276edce9ce | from a particular location, to how many cells is there an open path? | [
{
"docid": "3dd384c939f74c0e2d712601a9394875",
"score": "0.5959877",
"text": "def valid_path_count(map, origin_loc)\n return 0 unless origin_loc\n\n ok_cells = [FOOD_SYMBOL, nil]\n max_y, max_x = map_dimensions(map)\n cell_count = max_y * max_x\n\n spanning_path = Set.new\n to_check = ... | [
{
"docid": "595fe78f84b3c979055816892c7de184",
"score": "0.6872713",
"text": "def open_path_count(map, origin_loc)\n return 0 unless origin_loc\n\n ok_cells = [FOOD_SYMBOL, nil]\n max_x, max_y = map_dimensions(map)\n cell_count = max_x * max_y\n\n spanning_path = Set.new\n to_check = [... |
9e021a0b63e113d9c6688bc33f03cada | GET /areas_conocimientos/1 GET /areas_conocimientos/1.json | [
{
"docid": "e78519dc07ba635260d0dac80a8f7cd2",
"score": "0.6663402",
"text": "def show\n @area_conocimiento = AreaConocimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @area_conocimiento }\n end\n end",
"title": ""... | [
{
"docid": "227d6c8422984298ccdeef25325a9a2a",
"score": "0.73821914",
"text": "def index\n\n @coral = Coral.find(params[:coral_id])\n @observation = Observation.find(params[:observation_id])\n @areas = @observation.areas.find(params[:observation_id])\n\n respond_to do |format|\n format.... |
f20d34a74a4826a72b223b3cbcd8b42b | Updates the page after every action | [
{
"docid": "1fac4f77ec7f5dd2fc39c008f7f5bb29",
"score": "0.0",
"text": "def update_respond_to_parent(form,tab,msg,page)\n if params[:is_property_folder] == \"true\"\n portfolio_id = @folder ? @folder.portfolio_id : (params[:portfolio_id] ? params[:portfolio_id] : '')\n @folder = Folder.find_b... | [
{
"docid": "a3f89c4b75bbaaa39450c51c97264f61",
"score": "0.703283",
"text": "def update_page\n if visible && @page_change\n next_info_page if Input.trigger?(next_page_button) \n prev_info_page if Input.trigger?(prev_page_button)\n end\n end",
"title": ""
},
{
"docid": "75eaa... |
e15d3128483a60ac70cbd175b02358a4 | When a CustomField is removed we need also remove this field of contacts that use it | [
{
"docid": "4007deca621b730d9fe1443852d21698",
"score": "0.8330685",
"text": "def remove\n contacts_that_use_this_field = \n Contact.all.select {\n |contact| contact.contact_fields.include? self.name.downcase.to_sym\n }\n \n contacts_that_use_this_field.each do |contact|\n contact.re... | [
{
"docid": "ff7959e33709849b59c2843447d242b9",
"score": "0.7031526",
"text": "def destroy_custom_fields!\n CustomFieldMailchimpList.all.each do |field|\n field.klass.connection.remove_column(field.send(:table_name), field.name)\n field.klass.reset_column_information\n end... |
dfec0e03a721552300155d82b22093ff | Reject price if both amount AND promo_amount are blank | [
{
"docid": "efe48c0fe6c90efa2c00d54f1a75f4a2",
"score": "0.7792184",
"text": "def has_to_be_rejected?\n self.amount.blank? and self.promo_amount.blank?\n end",
"title": ""
}
] | [
{
"docid": "9312c6f14acf1ad511b6f2fc2fb827b1",
"score": "0.7884089",
"text": "def amount_has_to_be_filled_if_promo_amount\n if promo_amount.present? and amount.blank?\n self.errors.add :amount, :blank\n end\n end",
"title": ""
},
{
"docid": "9312c6f14acf1ad511b6f2fc2fb827b1",
... |
38ea045a0f89aaef4d255baec92d70db | Retrieves a list of files matching the criteria. | [
{
"docid": "d8c9b0a5097fc0bd7a0570d4e30acd76",
"score": "0.0",
"text": "def list_files bucket_name\n @client.execute(\n api_method: @storage.objects.list,\n parameters: { bucket: bucket_name }\n )\n end",
"title": ""
}
] | [
{
"docid": "c0933639a69ec5311af23e472461c83b",
"score": "0.75653917",
"text": "def files\n crit = files_criteria(@start, @end)\n return crit.entries\n end",
"title": ""
},
{
"docid": "5e2242235da4e63e0a1de27dd0d6f05d",
"score": "0.74390876",
"text": "def files\n matching_... |
dd424794b57e885521e52fdd40801468 | POST /comments POST /comments.json | [
{
"docid": "c709dbe0d33d047b23d478fa4037b57d",
"score": "0.0",
"text": "def create\n @comment = @song.comments.build(params[:comment])\n @comment.artist = @current_artist\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @song.artist, notice: 'Comment was succe... | [
{
"docid": "7b0a68ee4df9cfc8f7cc619d01d2577d",
"score": "0.7545733",
"text": "def create\n @comment = @post.comments.create!(comment_params)\n json_response(@comment, :created)\n end",
"title": ""
},
{
"docid": "278b898b0e96dc8518cb54546e69f368",
"score": "0.73734325",
"... |
b116206d8056d6808c88b6fc0166ea3d | Define a method that takes one integer argument Method should generate and return an array of the terms of the Fibonacci sequence create an array in the method that has the 0, 1, 1 to start set and index to the second 1 in the array (index 2) go through a block that goes however many times as the integer argument set a... | [
{
"docid": "4449078337901ff3bec0521dd8e315a2",
"score": "0.79634535",
"text": "def fibonacci(int)\n arr = [0, 1, 1]\n index = 2\n int.times{|i|\n i = arr[index] + arr[index - 1]\n arr << i \n index +=1\n }\n arr \nend",
"title": ""
}
] | [
{
"docid": "5145d2473bec16d185f9d51ac54b4782",
"score": "0.82739353",
"text": "def fib(totalIndex)\n current_index = 2\n fib_array = [0, 1, 1]\n until current_index == totalIndex - 1\n next_index = (fib_array[-1].to_i + fib_array[-2].to_i)\n fib_array << next_index\n current_index += 1\n en... |
fd5c8b17282e2914d3c6c6a8c4878c4b | def as_hours ; self / 60.minutes ; end Converts days into seconds. | [
{
"docid": "9d1035c733f880f828f89d46c0530d23",
"score": "0.6299662",
"text": "def days ; Duration[self * 86400] ; end",
"title": ""
}
] | [
{
"docid": "2e4777b3f808b439304cb3bd37d0c473",
"score": "0.81549805",
"text": "def hours\n seconds / 3600\n end",
"title": ""
},
{
"docid": "9bbca967bdec4bf93904138f026954e5",
"score": "0.7989556",
"text": "def hours ; self * 60.minutes ; end",
"title": ""
},
{
"d... |