query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
eee7095e9a25719017bd5d5e6fdd0f93
Member Action: method is to opt in to MFA for those users who opted out authn_context is the policy, connect represents the ID.me flow auth token required
[ { "docid": "d3d8fe7418663d2770340e0ced428ea2", "score": "0.5681198", "text": "def multifactor\n policy = @current_user&.authn_context\n authn_context = policy.present? ? \"#{policy}_multifactor\" : 'multifactor'\n render json: { multifactor_url: build_url(authn_context: authn_context, con...
[ { "docid": "1304e1322cc6bf7b603517c286ade70e", "score": "0.58382905", "text": "def login\n @redirect = params[:redirect]\n if request.post?\n @user = User.authenticate(params[:email], params[:password])\n if !@user\n error(\"Invalid email/password combination\")\n return re...
39999063a33926e5b4af391f35b76557
Update cursor position index : index
[ { "docid": "91b56aa708e2e2715c95234576e3d623", "score": "0.0", "text": "def update_arrows(index)\n @arrows[index].x = @arrows[index].enemy.actual_x\n @arrows[index].y = @arrows[index].enemy.actual_y\n end", "title": "" } ]
[ { "docid": "b94129e479103bc0314df4d167fb53d4", "score": "0.77275306", "text": "def cur_pos=(idx)\n @cursor_moved=true\n @cursor.pos=idx\n end", "title": "" }, { "docid": "dc7e35002b0c2b4e65c384aa7ab3487e", "score": "0.69605005", "text": "def cursor_to_decision\n @inde...
90ae248a9c6580c8a7a49f0989ba3dbc
Switch to the DVD angle with the ID [value]. Cycle through the available angles if [value] is omitted or negative.
[ { "docid": "30e84c1e33eeeed83b6edebb1a3b1e0c", "score": "0.73411506", "text": "def switch_angle _value=0\n send_cmd(\"switch_angle #{_value}\")\n end", "title": "" } ]
[ { "docid": "080042f91ceaa4672ee86dd5a714a348", "score": "0.5829954", "text": "def turn(dir, val)\n\ti_now = $directions.index($direction)\n\ti_change = dir == \"R\" ? (val / 90 * 1) : (val / 90 * -1)\n\ti_new = (i_now + i_change) % 4\n\t$direction = $directions[i_new]\nend", "title": "" }, { ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "14191beab913cd16b0364ecc2e6f3e42", "score": "0.0", "text": "def isr_interface_params\n valid_params = [ :note ] # always permitted\n valid_params.push( :desc, :cfr_record_id, \n :l_group_id, :p_group_id, :title, :desc, \n :safety_related, :if_status, :if_level ) unles...
[ { "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...
fc64ae8c43317adc9ade655328b63c0c
i dont want to store the short prefix name into db ... meaningless to other modules
[ { "docid": "79347b04b0445b4a7d03f9e65942dd29", "score": "0.0", "text": "def districts_by_prefix(districts, prefix)\n name_eng = case prefix\n when :hk\n \"Hong Kong Island\"\n when :kln\n \"Kowloon\"\n when :nt\n \"New Territories\"\n when :is\n \"Islands\"\n else\n nil\n end\n \n...
[ { "docid": "cf8a0a3ff03afa520106fccfbcf39038", "score": "0.71799177", "text": "def prefix\n 'oai_dc' \n end", "title": "" }, { "docid": "adc0572664f10d3da519c507fed8cd6c", "score": "0.70285064", "text": "def name_prefix; end", "title": "" }, { "docid": "18c1f2c1af780a...
7c653204775feb0e0e65e2b908b08502
Check the PO file for syntactical correctness
[ { "docid": "f659ae9bfaa21c80f62e96534efac00d", "score": "0.7156273", "text": "def lint_po\n system %Q{msgcat \"#{@pofile}\" > /dev/null}\n success or die \"The PO file '#{@pofile}' is broken, aborting.\"\n end", "title": "" } ]
[ { "docid": "39ad6d0c26eb25a0b528a03bb4413cb3", "score": "0.609489", "text": "def check_file(filename)\n @file = File.new(filename, 'r')\n check_header\n check_fct_nbr\n check_fct_size\n check_line_longer\n check_trailing_whitespaces\n check_space_between_kw\n check_fct_space_after_paren\n check...
37283258120937bf88df679caa14e948
Load the data for this object out of a XMLNode
[ { "docid": "97cc00dbfe7ed3189f9a1808a5e5f261", "score": "0.7130544", "text": "def load_from_xml(node)\n # Get all information from the root's children nodes\n node.children.each do |child|\n case child.name\n when 'name'\n @name = child.content\n when 'key' ...
[ { "docid": "f2d26463d639b35942c8c2ea306c9d80", "score": "0.72672176", "text": "def load_from_xml(node)\n # Get all information from the root's children nodes\n node.children.each do |child|\n case child.name\n when 'body'\n @body = child.content\n when 'auth...
f9aeb871bb1efff3e9eeee6586123034
POST /events POST /events.json
[ { "docid": "cd48cdff9b5f510e03b6c538f73318ca", "score": "0.0", "text": "def create\n @event = Event.new(event_params) #params[:event])\n\n respond_to do |format|\n if @event.save\n create_lists(@event)\n format.html { redirect_to @event, \n notice: I18n.t('....
[ { "docid": "8beb709b44028dcb6cde70ea2be23fa3", "score": "0.76767963", "text": "def create\n megam_rest.post_events(to_hash)\n end", "title": "" }, { "docid": "2eac2345f845c02c8478dafe0b803519", "score": "0.75318", "text": "def create\n @event = Event.new(event_pa...
74620f8c292aa27280e600234f7272a3
GET /utility_charges GET /utility_charges.json
[ { "docid": "9851c26977be69ecd15558f6cc4d6ca2", "score": "0.6195698", "text": "def index\n @utility_charges = UtilityCharge.all\n @units = Unit.all\n end", "title": "" } ]
[ { "docid": "e885f740b852ac36ab6c2df58bea7f01", "score": "0.7148096", "text": "def charges(owner_key)\n get \"/charge/#{owner_key}\"\n end", "title": "" }, { "docid": "bbb3c008ab2258e1cc56e117e65bdf7f", "score": "0.68129385", "text": "def all_charges(customer_id)\n get(\"#{...
cb66eb8287f164a161824382ea81d4d6
GET /skills GET /skills.json
[ { "docid": "d1fe041032306cbe456bc704de291951", "score": "0.632453", "text": "def index\n @skill_categories = SkillCategory.includes(:skills)\n # @skills = Skill.all\n end", "title": "" } ]
[ { "docid": "d17627d7f2310e373f0b2d40329bb2ca", "score": "0.77104056", "text": "def list_skills\n\t\trender json: Skill.where(language_id: params[:language_id]).to_json\n\tend", "title": "" }, { "docid": "47bc587ad09586ab0ee959f33f01f51a", "score": "0.76897246", "text": "def skills(id...
386a4041f8d0a54b32f01ebbd8fd1d34
Adds a group to this user the group_id is allways stored within this user object the user object is not saved after this method call returns true if the group could be added successfully group The group object to be added to this user
[ { "docid": "10db51c0763f97383448f6c85ef2746a", "score": "0.7165678", "text": "def add_group( group )\n raise TypeError.new('not a group') unless group.is_a?(Ecore::Group)\n tmp_group_ids = self.group_ids.split(',')\n tmp_group_ids.delete(group.id)\n tmp_group_ids << group.id\n s...
[ { "docid": "c2fb20fc97491e93632efd00deba0b5e", "score": "0.7869573", "text": "def add_to_group(group)\n if self.user_groups.include? group or !(group.is_a? UserGroup)\n return false\n else\n self.user_groups << group\n return true\n end\n end", "title": "" }, { "doci...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "83a88206c869282c784d74b904b8fc7f", "score": "0.0", "text": "def set_news2\n @news2 = News2.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...
478ea5a97f6b9e6c3b053fe641b9ff80
checamos si el usuario es admin
[ { "docid": "b727ac85f42226e6e902a4c49f6802f6", "score": "0.0", "text": "def check_admin\n\t\tif session[:user_id] && session[:mod0]\n\t\t\t@iam = true\n\t\telse\n\t\t\t@iam = false\n\t\tend\t\n\tend", "title": "" } ]
[ { "docid": "783658f4d3aaf7b69af803d757660127", "score": "0.86275977", "text": "def admin?\n if session[:user_id]\n User.find(session[:user_id]).admin\n else\n false\n end\n end", "title": "" }, { "docid": "bbb502944fe2f5d847fc24a59ba1110f", "score": "0.8620883", "...
bf89e590051ce2f4c243a2e602637fb3
Get a word from remote "random word" service def initialize() end
[ { "docid": "e403b3fa16751b9bd44a150260c13d19", "score": "0.0", "text": "def initialize(word)\n @word = word\n @guesses = ''\n @wrong_guesses = ''\n @current_letter = ''\n end", "title": "" } ]
[ { "docid": "b3ab0b8ba4a69d4dabacba38ef7761e0", "score": "0.73977077", "text": "def choose_word\n uri = URI('https://random-word-api.herokuapp.com/word?number=5')\n words = Net::HTTP.get(uri) \n words = words.delete(\"[\").delete(\"]\").delete(\"\\\"\")\n words = words.split(...
a18d36e52586b3fec32dd673746042d5
Atualiza o arquivo, incluindo o UFFMail passado
[ { "docid": "ecf36e4e00e2572d30ccf722019c27dd", "score": "0.6550353", "text": "def atualiza_uffmail(matricula, uffmail)\n CSV.open(\"temp.csv\", \"wb\") do |csv|\n CSV.foreach(@path,headers:true, return_headers:true)do |linha|\n if linha[\"matricula\"]== matricula\n linha[\"uffmai...
[ { "docid": "31f96ef73a667c2d9d77eb220b0a3079", "score": "0.6058065", "text": "def write_email\n dir = @mailbox.dir\n Dir.mkdir dir, 0o755 unless Dir.exist? dir\n File.write File.join(dir, @hash), @raw, encoding: Encoding::BINARY\n end", "title": "" }, { "docid": "7103e58a6935310a6c...
4e6352a3c0534bca7ebd782d853968f3
DELETE /profiles/1 DELETE /profiles/1.json
[ { "docid": "055d6fbbba506b05358bb49107ca6f1c", "score": "0.742901", "text": "def destroy\n @profile.destroy\n end", "title": "" } ]
[ { "docid": "5ffaf08225ad9fec4628ada45a471c40", "score": "0.7739456", "text": "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "title": "" }, ...
2f084ae59b63e25962756384484634d0
POST /garmin_ids POST /garmin_ids.xml
[ { "docid": "2051e0334efa0b68559eb39302383cab", "score": "0.58014673", "text": "def create\n @garmin_id = GarminId.new(params[:garmin_id])\n\n respond_to do |format|\n if @garmin_id.save\n format.html { redirect_to(@garmin_id, :notice => 'Garmin was successfully created.') }\n fo...
[ { "docid": "0aabd93825f21e8bc76f44c6312d1cdb", "score": "0.5762256", "text": "def set_ids\n @ids = params[:ids].split(\",\")\n end", "title": "" }, { "docid": "e0e6dfd0724881da70b145156ec2f063", "score": "0.5452085", "text": "def modify_organism_ids\n return unless params[:emb...
04674201792b7dfbd9359d4035c5ed12
Request a device (pin name) be turned on or off. Changes GPIO pin output state and returns a string for Siri to say indicating success or failure.
[ { "docid": "4d760a7b0c3b37d8635ef322a4bff6ab", "score": "0.6146185", "text": "def set_pin(name, value)\n name.downcase!\n name.chomp!\n name.strip!\n if @pins.keys.include?(name)\n pinval = @io.read(@pins[name])\n pinval = pinval == 1 ? true : false\n if pinval != value\n ...
[ { "docid": "267b7c5ea31180ed40a36ece5748992a", "score": "0.727496", "text": "def turnOn()\n\t`gpio write {outpin} -`\nend", "title": "" }, { "docid": "3d35cce246ca1122daa92e73f831a70a", "score": "0.67260844", "text": "def on\n Platform.driver.pin_set(pin, GPIO_HIGH) if direction...
cb94fb03141a6d88eedbd01ab3341ee2
Register default actions for the protocol
[ { "docid": "efdeb4ed1fb27984108c8fdd2205a086", "score": "0.0", "text": "def initialize(market_type, options = {})\n @options={\n :concurrency => 10,\n :threaded => true,\n :retries => 0,\n :local_actions => {\n ACTION[:import] => nil,\n ...
[ { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.7154515", "text": "def register_action(action); end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.68585634", "text": "def default_action; end", "title": "" }, { "docid": "21d75f9f5765...
137c45c99ebb1f1afceb78c79a501eb2
Initiate the export of a dnc list. Returns 200 if received OK.
[ { "docid": "e1270e0c046ad859674bf45ddeae8cb6", "score": "0.61847657", "text": "def post_outbound_dnclist_export_with_http_info(dnc_list_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OutboundApi.post_outbound_dnclist_export ...\"\n end\...
[ { "docid": "77607f0a6d70920b11e27c916c5defd1", "score": "0.6277366", "text": "def get_outbound_dnclist_export_with_http_info(dnc_list_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OutboundApi.get_outbound_dnclist_export ...\"\n end\n ...
707edc3c5ceb64e9050bdbea5851f0f2
Download the rows from this dataset that cannot be imported as a csv
[ { "docid": "7101074facc44f3a102afda76d4c1219", "score": "0.71148765", "text": "def download_problematic_rows\n import_job = ImportJob.find(params[:import_job_id])\n @output_csv_string = import_job.problem_rows_csv_string\n respond_to do |format|\n format.csv do\n filename = \"#{File...
[ { "docid": "65c897e15e95f5c0a1919afbe5530f80", "score": "0.6531906", "text": "def import_csv_full\n \n end", "title": "" }, { "docid": "8cddf3382815d5a41e24e7243d3e316a", "score": "0.6083181", "text": "def retrieve_records_for_csv\n records = fetch_records\n records = filte...
a2889c857dcb3bca8b4bd326b46d4fba
Return the proxied media at the given URL.
[ { "docid": "6daa48cb4043a643df2b2514edb5fd08", "score": "0.0", "text": "def get\n render_proxied_url(params[:u])\n end", "title": "" } ]
[ { "docid": "f56d64167b3718e03a7e0c9b1dd69b70", "score": "0.6824456", "text": "def url\n response = client.media(path)\n response['url']\n end", "title": "" }, { "docid": "f776ace303de6cc3e1c178eb62f52806", "score": "0.66996765", "text": "def get_media(url)\n ...
55635bba472ebbf04bfe329e368f0f3d
get the total visits of each primary source of payment by taking patient treatments as parameter
[ { "docid": "d3aba1056c38546aba67768b2bdc0684", "score": "0.78517115", "text": "def get_visits_by_source(patient_treatments)\n return 0 if patient_treatments.empty?\n treatment_visits = 0\n patient_treatments.each do |treatment|\n treatment_visits += treatment.treatment_visits.selec...
[ { "docid": "12e135bb2c35916d7c76fc0e02b29d3e", "score": "0.764385", "text": "def get_visits_by_primary_source\n medicare_treatments = get_treatments_by_insurance(\"MEDICARE\")\n tricare_treatments = get_treatments_by_insurance(\"TRICARE\")\n medical_treatments = get_treatments_by_insuranc...
ff16c43102862a03dd3c471bb0efa3a0
marks deployment as "Succeeded" or "Failed"
[ { "docid": "570a6df3617142e9883f7ac8b3ce9590", "score": "0.6808971", "text": "def update(deployment)\n GITHUB.create_deployment_status(\n deployment.url,\n state,\n target_url: @deploy.url,\n description: @deploy.summary\n )\n end", "title": "" } ]
[ { "docid": "bf02a754b6208d905a1b2d1c718f0469", "score": "0.69795734", "text": "def notify_finishing\n @color = GREEN\n @msg = \"Deployment Finished\"\n post\n end", "title": "" }, { "docid": "c4eb55bb55ac149cac2e465ad224a4ce", "score": "0.69239765", "text": "def fin...
366b96bcfd5272b01d7cbc1dd07f0a45
reduce 50 omitted reduce 51 omitted
[ { "docid": "7791abd34c6aafa226402d95a26332f9", "score": "0.0", "text": "def _reduce_52(val, _values, result)\n lhs, _, rhs = val\n result = logical_op :and, lhs, rhs\n\n result\nend", "title": "" } ]
[ { "docid": "b35cd3ff909b6957693091ac0d428612", "score": "0.73424125", "text": "def _reduce_50(val, _values, result); end", "title": "" }, { "docid": "b35cd3ff909b6957693091ac0d428612", "score": "0.73424125", "text": "def _reduce_50(val, _values, result); end", "title": "" }, ...
bb79ce0cde4bf1ee289d372ca8a52647
GET /image_urls/new GET /image_urls/new.json
[ { "docid": "01a4e4c3d05de25ea1fce8d31f4dbc34", "score": "0.73979616", "text": "def new\n @image_url = ImageUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image_url }\n end\n end", "title": "" } ]
[ { "docid": "36082cbe2480ba8a783bc96d792b4edc", "score": "0.65958863", "text": "def new\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image }\n end\n end", "title": "" }, { "docid": "36082cbe2480ba8a783bc96d792b4...
306e603aca36d1a10d5f1fb2225bbb70
This attaches resources to the client Resources map to a specific model
[ { "docid": "60b03ca3ec0210def95a6a0b1281c725", "score": "0.0", "text": "def method_missing(name, *args, &block)\n if self.class.resources.keys.include?(name)\n resources[name] ||= self.class.resources[name].new(connection: connection)\n resources[name]\n else\n super\n ...
[ { "docid": "ab1602f7b523165fc9c02a0297753df9", "score": "0.67561954", "text": "def add_resource\n ResourceBuilder.new(model: model, builder: builder).append\n end", "title": "" }, { "docid": "01bb03a00b50597e91eab283b3b503ac", "score": "0.62056357", "text": "def add_model...
686a2a40df7c87039d040bf0b6e2eb3e
Your age in seconds > 788940000.0
[ { "docid": "57f6dd3798c365578c30a4f759da9456", "score": "0.8129881", "text": "def age_in_seconds\n return 60 * 60 * 24 * 365.25 * 25\nend", "title": "" } ]
[ { "docid": "9d3ae265db78280d8ce132c664316c90", "score": "0.8312457", "text": "def age\n ((Time.now - birthday.to_time).to_i / 31557600) #Time.now.to_i => 1377193854 and 1970-01-01.to_i=>1968 \n # therefore substracting them equals =>1377191886(s...
45bc9c2760c6e014ae021030a3309756
PATCH/PUT /lugars/1 PATCH/PUT /lugars/1.json
[ { "docid": "fd931d64571f3c9b83931591b880aec9", "score": "0.6122909", "text": "def update\n respond_to do |format|\n if @lugar.update(lugar_params)\n format.html { redirect_to @lugar, notice: 'Lugar was successfully updated.' }\n format.json { render :show, status: :ok, location: @l...
[ { "docid": "fa16209f5ac39ae638cdf45c17fd5f18", "score": "0.64829963", "text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end", "title": "" }, { "docid": "fa16209f5ac39ae638cdf45c17fd5f18", "score": "0.64829963", "t...
017bee3f2b08df31bbd6495539087c95
determines whether a sentence is a palindrome ignores case ignores whitespace ignores punctuation is_vowel
[ { "docid": "0fb6ea2d604ca2e0489ea4e851c845af", "score": "0.0", "text": "def is_vowel char\n char.is_a?(String) && !!char.match(/[aeiou]/i)\nend", "title": "" } ]
[ { "docid": "deae056ad48464256a0d34dcd44513fa", "score": "0.85456455", "text": "def palindrome_sentence?(sentence)\n normalized = sentence.gsub(/[^a-z]/i, \"\").downcase\n normalized.reverse == normalized\n end", "title": "" }, { "docid": "5101c1f99cebbcfc3956189e755838a7", "score"...
21cb44c859818a95e8cd1a3cc053ba12
change to the base directory before evaluating block
[ { "docid": "e53fdbc2720b4f79c2b12423ed071868", "score": "0.65939283", "text": "def in_base_dir(&block)\n in_dir(Zim::Config.suite_directory, &block)\n end", "title": "" } ]
[ { "docid": "79ce63459094c9f7de77a6ef26a378d9", "score": "0.67713904", "text": "def reset_base_dir!\n @base_dir = \"\"\n end", "title": "" }, { "docid": "c21dbe88bcb007f8a7d9ca27a66d22a8", "score": "0.6716758", "text": "def base_dir(name, dir_string = nil, &dir_block)\n ...
403a3422d7a51ef1443e65f178b32d75
Returns Persister object built from serialized data
[ { "docid": "0b6ad7325a9a2a7acb0db699b8174e08", "score": "0.6456915", "text": "def from_hash(persister_data)\n # Extract the specific Persister class\n persister_class = persister_data['class'].constantize\n unless persister_class < InventoryRefresh::Persister\n raise \"Persister cl...
[ { "docid": "5fe6a67242420ae138fd7bc5d2e3029f", "score": "0.597827", "text": "def from data\n obj = new\n obj.decode data\n obj\n end", "title": "" }, { "docid": "03d7844ae0af3eddb1410a8d13dfed0a", "score": "0.5944696", "text": "def instantiate\n resource.new(da...
8b7803c9fe0821f03c95461964963b4d
Initializes a Response instance
[ { "docid": "add356d8b00840149f3f86041d25202d", "score": "0.0", "text": "def initialize(response, opts = {})\n @response = response\n @options = {:parse => :automatic}.merge(opts)\n end", "title": "" } ]
[ { "docid": "1dcfdd0696cb995ba3d06f4652b934c6", "score": "0.8389361", "text": "def initialize resp\n @response = resp\n end", "title": "" }, { "docid": "8c680dc28fa829bcf8c19290620f6a7c", "score": "0.81357765", "text": "def initialize(response)\n\t\t\tsuper\n\t\t\t@response = ...
69a3bef936b89f232c50c06e2c416c0c
PUT /gateways/1 PUT /gateways/1.json
[ { "docid": "86260d76ac54bea801eba59b9465455f", "score": "0.5972154", "text": "def update\n @gateway = Gateway.find(params[:id])\n\n respond_to do |format|\n if @gateway.update_attributes(params[:gateway])\n format.html { redirect_to @gateway, notice: 'Gateway was successfully updated.'...
[ { "docid": "351a9ec5ce5a1226d01f8177793e4683", "score": "0.6236061", "text": "def update\n @gateway = Gateway.find(params[:id])\n\n respond_to do |format|\n if @gateway.update_attributes(params[:gateway])\n format.html { redirect_to gateways_path, notice: 'Gateway was successfully upda...
6206334cd874e31f3c0550185929cb91
Array of all days within start and end times.
[ { "docid": "3f533a4ad24ba882dab926dfbb451c34", "score": "0.68916774", "text": "def days(start_time, end_time, newfirst=true)\n start_date = start_time.to_date\n end_date = end_time.to_date\n days = []\n if newfirst\n end_date.downto(start_date) { |d| days << d } \n else\n sta...
[ { "docid": "14622224e2454f0ce6f5107b8a20feff", "score": "0.77876806", "text": "def dates_array\n start_date = self.start_date.to_date\n end_date = self.end_date.to_date\n array = Array.new\n return array if end_date<start_date\n (start_date..end_date).each do |i|\n array << i if self...
ae2d84ee8280f4cf3967035b88da61a7
SOCIAL NETWORKS Indica si tiene redes sociales definidas
[ { "docid": "6e3c8df73526f0c014fda82c83efa094", "score": "0.59595317", "text": "def social_networks?\n social_networks_set.avaliables?\n end", "title": "" } ]
[ { "docid": "6be571d08df7eb449b693911fcd335b4", "score": "0.6621383", "text": "def social_networks\n social_networks_set.avaliables\n end", "title": "" }, { "docid": "8e30974f03c539caee1043db2f6e808a", "score": "0.65373445", "text": "def avaliables\n # Comprobamos cada red soci...
d5fc4d5791fb7c91fd71f8424ad50822
POST /charities POST /charities.json
[ { "docid": "0a8249ca3d0093f4fbe80f41b39677c0", "score": "0.0", "text": "def create\n @charity = Charity.new(params[:charity])\n\n respond_to do |format|\n if @charity.save\n @client = @charity.client\n @nav = AdditionalInformationNav.new(@client)\n @step = @nav.nav\n ...
[ { "docid": "7927c4c8f09c58fb3efb93b62107e2e7", "score": "0.68592066", "text": "def create\n @charity = Charity.new(params[:charity])\n\n respond_to do |format|\n if @charity.save\n format.html { redirect_to admins_charities_url, notice: 'Charity was successfully created.' }\n fo...
4eef6ff0bab0c666ab387cb5cf92927b
YOUR CODES DOWN HERE : INDEX :
[ { "docid": "4fe15cb1162813c095f1b35cfddcc059", "score": "0.0", "text": "def index\n paramsr\n global\n end", "title": "" } ]
[ { "docid": "c15dfe6233649a295f9c226f5f56bd4f", "score": "0.65698695", "text": "def lttfindex\n end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.6543077", "text": "def advanced; end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e...
7c4728cdd9fa6f72e625674960f49fd7
Update Game Pause Input
[ { "docid": "c7b5e4b84b7b72cd7260288092e42f02", "score": "0.8570921", "text": "def update_game_pause_input \n # If Input Trigger (Pause Key)\n if Input.trigger?(TDS::Pause_Screen_Settings::Pause_Key)\n # Return if Game cannot be paused\n return if !TDS::Pause_Screen_Settings.can_pause_...
[ { "docid": "d27178cef68b7a7a959db967642ee4b6", "score": "0.71962047", "text": "def pause\n @paused += 1\n end", "title": "" }, { "docid": "4351e69638deea62c4805f1f2eeb6eea", "score": "0.71411884", "text": "def pause_or_not\n @pause = !@pause\n if @pause\n Text.new(\"Ga...
561cdf63dc28b3b896f79477462abbc4
This returns the path for the edit action for the given object, by default current_object[link:classes/Resourceful/Default/Accessors.htmlM000012]. For example, in HatsController the following are equivalent: edit_object_path => "/hats/12/edit"
[ { "docid": "c1b69bb88054592e89f87576eeccb128", "score": "0.746921", "text": "def edit_object_path(*args); edit_object_route('path', *extract_object_plus_options(args)); end", "title": "" } ]
[ { "docid": "e26dc70baf0441d518d5a3368d5e8ae7", "score": "0.843003", "text": "def edit_object_path(object = current_object); edit_object_route(object, 'path'); end", "title": "" }, { "docid": "1f3ed91b1d01d3778c74dfbabe52b6ec", "score": "0.84018797", "text": "def edit_path(object)\n ...
2b5304976eb0cfb7927a816a41ca3498
Write a function, `rec_intersection(rect1, rect2)` and returns the intersection of the two. Rectangles are represented as a pair of coordinatepairs: the bottomleft and topright coordinates (given in `[x, y]` notation). Hint: You can calculate the leftmost x coordinate of the intersection by taking the maximum of the le...
[ { "docid": "02394f0eba351cc053b10234c3423e5a", "score": "0.88739353", "text": "def rec_intersection(rect1, rect2)\n x_min = [rect1[0][0], rect2[0][0]].max\n x_max = [rect1[1][0], rect2[1][0]].min\n\n y_min = [rect1[0][1], rect2[0][1]].max\n y_max = [rect1[1][1], rect2[1][1]].min\n\n return nil if (...
[ { "docid": "33902f22edb388f0341f0adeacae9b23", "score": "0.9085005", "text": "def rec_intersection(rect1, rect2)\n bot_x, bot_y = [rect1[0][0], rect2[0][0]].max, [rect1[0][1], rect2[0][1]].max\n top_x, top_y = [rect1[1][0], rect2[1][0]].min, [rect1[1][1], rect2[1][1]].min\n return nil if bot_x > top_...
38990355f9d6f1dcde0bf9e24005ef96
TODO: votable with anoynmous user
[ { "docid": "21e20a56dc8a9f7972b1e2d3568fde15", "score": "0.0", "text": "def vote\n raise CForum::ForbiddenException.new if current_user.blank?\n\n @thread, @message, @id = get_thread_w_post\n\n if @message.user_id == current_user.user_id\n flash[:error] = t('messages.do_not_vote_yourself')...
[ { "docid": "12ee5a306fa94d6c08708388e886012d", "score": "0.7375928", "text": "def user; end", "title": "" }, { "docid": "12ee5a306fa94d6c08708388e886012d", "score": "0.7375928", "text": "def user; end", "title": "" }, { "docid": "12ee5a306fa94d6c08708388e886012d", "sc...
98c279de3213dd5344d3aff05d5065e3
Converts the link tag to HTML.
[ { "docid": "7a2378bf19b41e421afb47e76f44f4b8", "score": "0.0", "text": "def to_s\n to_html\n end", "title": "" } ]
[ { "docid": "ce4d313bfbb9ab5189e57a45745070ba", "score": "0.69046336", "text": "def html_link(item)\n tag :a, yield, :href => item.url\n end", "title": "" }, { "docid": "5d701ab7330be19602f6d227ac1efe62", "score": "0.68629664", "text": "def link(link, title, content)\n\t ...
9f5100f29daad7ff94353d7cf39c5363
GET /new_city_notifications/new GET /new_city_notifications/new.json
[ { "docid": "b813dea5df7f1edb451d4e3bedfd39f4", "score": "0.83636075", "text": "def new\n @new_city_notification = NewCityNotification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_city_notification }\n end\n end", "title": "" } ]
[ { "docid": "d1bf104816004ba1862fff82b118d5e8", "score": "0.7924086", "text": "def create\n @new_city_notification = NewCityNotification.new(params[:new_city_notification])\n\n\n respond_to do |format|\n if @new_city_notification.save\n format.html { redirect_to @new_city_notification, ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "4782b93895d5a9eef0ac094de6bf34d6", "score": "0.0", "text": "def camera_params\n params.require(:cdot_camera_camera).permit(:name, :description, :latitude, :longitude, :source, :icon, :status, :weather_station, :cdot_camera_id)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "...
b6b9cd199dfaed08c4c534812e0ac109
Check to see if the all the properties in the model are valid
[ { "docid": "c5e614059445772321d22e43275ef83e", "score": "0.0", "text": "def valid?\n \n \n \n \n \n \n \n \n \n \n if @quartz_cron_expression.nil?\n return false\n end\n\n \n \n \n \n \n \n \n \n ...
[ { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" ...
4d8e892ee37f683af05a226d288daf9c
added "filter" on the above result and the filter doesn't have to be in the printed results following is examples
[ { "docid": "a25db63bd27dadce2bf58bc8c780fa23", "score": "0.0", "text": "def printcat(cat)\n list = $page.css('.oneRes').select{|play| play.css('.detail li a')[1].text == cat}\n list.each do |play|\n puts \"#{play.css('.eventTitle').text}---#{play.css('.detail li a')[0].text}\"\n end\nend", "...
[ { "docid": "08ecfc5d5251841112a950c6a2dcc756", "score": "0.8016406", "text": "def filter; end", "title": "" }, { "docid": "08ecfc5d5251841112a950c6a2dcc756", "score": "0.8016406", "text": "def filter; end", "title": "" }, { "docid": "08ecfc5d5251841112a950c6a2dcc756", ...
3602bd3218aeb75b7895dc672caa53a8
If a username is configured for the SCM, return the commandline switches for that. Note that we don't need to return the password switch, since Capistrano will check for that prompt in the output and will respond appropriately.
[ { "docid": "3b41877b47d1bd4ef6cb50fc742ced2f", "score": "0.6926032", "text": "def authentication\n username = variable(:scm_username)\n return \"\" unless username\n result = \"--username #{variable(:scm_username)} \"\n result << \"--password #{variable(:scm_p...
[ { "docid": "5a0cf523be9666c0526e22028da8fc72", "score": "0.66317344", "text": "def scm_password_or_prompt\n @scm_password_or_prompt ||= variable(:scm_password) ||\n (Capistrano::CLI.password_prompt(\"hg password: \") if variable(:scm_prefer_prompt))\n end", "title": "" }...
c99d383663ee7356d9876899c9655d51
GET /edge_types/new GET /edge_types/new.json
[ { "docid": "23d9dcb03886a820fcc21aede9d71c08", "score": "0.7777319", "text": "def new\n @edge_type = EdgeType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @edge_type }\n end\n end", "title": "" } ]
[ { "docid": "be9fa95c97eebabe74dbf6fe959f0b9a", "score": "0.72423315", "text": "def create\n @edge_type = EdgeType.new(params[:edge_type])\n\n respond_to do |format|\n if @edge_type.save\n format.html { redirect_to @edge_type, notice: 'Edge type was successfully created.' }\n for...
527bbe1287a2ee054d6c7c2353938209
return random sentences default is 3 sentences
[ { "docid": "fd0ff6e6f98342a241672d91b4de1682", "score": "0.794005", "text": "def sentences(sentence_count = 3)\n Faker::Lorem.sentences(sentence_count).join(' ')\n end", "title": "" } ]
[ { "docid": "879483df26b33579a0182176b4d78f94", "score": "0.80099916", "text": "def sentences(sentence_count = 3)\n Faker::Lorem.sentences(number: sentence_count).join(' ')\n end", "title": "" }, { "docid": "23c19cb8b15655f4724f8e321c1b1086", "score": "0.7767806", "text": "def...
6c0fba351fd8858b3b428fb58f2075d9
Checks whether the caluclated fitting error (summed in quadrature over all wavelengths) is larger than a specified cutoff.
[ { "docid": "aa3ef0811d444ae0394a5d38a086e16b", "score": "0.6334307", "text": "def check_error(to_check)\n\n if @parameters[:fit_error_cutoff] then\n\n total_error = 0\n\n to_check.getFitErrorByChannel.each do |d|\n\n total_error += d**2\n\n end\n\n total_error =...
[ { "docid": "8365659b88b50dd64b9f361aef5c4a38", "score": "0.5682187", "text": "def fails_threshold?\n return false if sample_size < options.sample_threshold\n\n failure_rate >= options.rate_threshold\n end", "title": "" }, { "docid": "23009fc7dceaac2b28ed052400658e42", "score...
d9ac71a7cb1c09eb8f3330cb8842a862
Set up the list of all guide pages to scrape
[ { "docid": "3c453c36a6a340289a9813852587ff57", "score": "0.66525394", "text": "def make_guide_page_list\n puts 'Making a list of all the pages to scrape...'\n i = 0\n # There were 77 pages of summaries to scrape when I wrote this\n 2.times do\n i += 1\n page = \"http://www.bbc.co.uk/programmes...
[ { "docid": "688479a89ab11bab7a721ec23e45d5b4", "score": "0.64215785", "text": "def scrape_course_info\n counter = 1\n @all_ucas_urls.each do |url|\n unparsed_page = HTTParty.get(url)\n parsed_page = Nokogiri::HTML(unparsed_page)\n\n # pages with multiple options have to be treated differently...
9792d791cd1f283dc56b9a98d9fdf642
Get the dimensions of this asset ==== Returns String:: An RMagick compatible geometry string (i.e. '200x200')
[ { "docid": "c5a3ee1898006ff30c34bf4126a19ecb", "score": "0.64984447", "text": "def geometry\n image = load_image\n\n \"#{image.columns}x#{image.rows}\"\n end", "title": "" } ]
[ { "docid": "c3c0abee31cbe446ee384ef38177d61b", "score": "0.717481", "text": "def size\n \"#{width}x#{height}\"\n end", "title": "" }, { "docid": "c3c0abee31cbe446ee384ef38177d61b", "score": "0.717481", "text": "def size\n \"#{width}x#{height}\"\n end", "title": ""...
22e226184ebed4ab4a9b194819b6555b
Do not allocate extra space for another array, you must do this by modifying the input array inplace with O(1) extra memory. 3/19/19
[ { "docid": "d2f07975f22278d9f2703f36f738f734", "score": "0.0", "text": "def remove_duplicates(nums)\n seen = {}\n \n nums.each_with_index do |num, idx|\n if seen[num]\n nums[idx] = nil\n else\n seen[num] = true\n end\n end\n \n nums.delete(nil...
[ { "docid": "0f7060433624e3d4e98f328f90e2ac10", "score": "0.7628489", "text": "def replace(other_array); end", "title": "" }, { "docid": "0f7060433624e3d4e98f328f90e2ac10", "score": "0.7628489", "text": "def replace(other_array); end", "title": "" }, { "docid": "bd30c989e3...
c66bc22bb1090723eff3a8457fc51264
Get bonuses redemption method.
[ { "docid": "1c2305d5436016f582c93c1cb2435c8a", "score": "0.6478586", "text": "def get_bonus_redemption_method(bonuses_redemption_method_slug)\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/utilities/bonuses-redemption-methods/{bonuses_r...
[ { "docid": "e81f5605d0a8109db80ada95b5759527", "score": "0.6662175", "text": "def get_bonus_redemption_methods\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/utilities/bonuses-redemption-methods'\r\n _query_url = APIHelper.clean_ur...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e1c3f034d777c95233f5f249e07893d8", "score": "0.0", "text": "def framework_params\n params.require(:framework).permit(:name, resource_ids: [])\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...
3f54c15fc7fae025b3b000ac9b9b2be0
Array Subsets Base case if array is empty, return the array in another array case 1: if array.empty?, return [[], [num1]]
[ { "docid": "d597a59040fcc61014c187134ef878be", "score": "0.68608785", "text": "def subsets(arr)\n return [[]] if arr == [] \n\n new_arr = []\n last = arr[-1]\n subset = subsets(arr[0..-2])\n\n subset.each do |suba|\n new_arr << suba + [last]\n end\n \n subset + new_arr\n\n...
[ { "docid": "5b5da6bba161d9bafa31fce037f39a7f", "score": "0.7691517", "text": "def array_subsets(array)\n return [array] if array.empty?\n \nend", "title": "" }, { "docid": "54f56313758963fd4da99906f5d0b10f", "score": "0.745806", "text": "def subsets(arr)\n return [arr] if arr.empty...
1b2936ce0ec337f50fe766794bd227a6
Formats the parameters passed in the way the server expects
[ { "docid": "c6aa7fabba06be6d0dd16fb5c0580142", "score": "0.0", "text": "def build_request_item(query_id, query_template, params, cache)\n {\n query_id: query_id,\n query_template: query_template,\n query_params: params,\n cache: cache\n }\n end", "title": "" ...
[ { "docid": "99f11a7d1c684b45660c00ca417eba8c", "score": "0.7353565", "text": "def formatted_params\n format_hash(@params)\n end", "title": "" }, { "docid": "114d9c92f1778cf0ded92b2652507a57", "score": "0.6752218", "text": "def format_parameters(params)\n params.map { |...
b20f8b8248e61dab65129621ecf59b8c
+++++++++++++++++++++++++++++++++++++++++++++++ SECTION METHOD +++++++++++++++++++++++++++++++++++++++++++++++ Convert 2 arrays to hashes
[ { "docid": "9bdc8743adf344ff2e05432144dab106", "score": "0.74136394", "text": "def get_hashes_from_two_array(arr_key, arr_value)\n return arr_key.zip(arr_value).to_h\nend", "title": "" } ]
[ { "docid": "05452ba431236ca5d8236f37f98fe8cd", "score": "0.8284843", "text": "def arrays_to_hash(array1,array2)\n\t myhash=Hash.new\n\t\tfor i in 0...array1.length\n\t myhash[array1[i]]=array2[i]\n\tend\n\t\t puts myhash\n\tend", "title": "" }, { "docid": "280eff413029f0b04c74336ee9c643b7", ...
8c368dfd385f1f5616aeff8651c556d3
Creates/updates beacon presence record in database for given user with enter information and enter occurrence timestamp.
[ { "docid": "f9037fa130f3f3917b6b047a576fa8db", "score": "0.60260874", "text": "def enter\n bp = presence.first_or_create\n\n if bp.valid_timestamp_for_enter?(timestamp)\n bp.update_attributes(timestamp: timestamp, present: true)\n end\n end", "title": "" } ]
[ { "docid": "b3e552fda9b5071d2fae83a07589e1ea", "score": "0.6663057", "text": "def user_enter\n if params[:beacon_key].kind_of?(Array)\n beacon_key = params[:beacon_key].to_a\n else\n beacon_key = [params[:beacon_key]]\n end\n beacons = Beacon.where(key: beacon_key)\n\n ...
6f82b627355340ff44c3d49395afebb4
POST /item_per_installations POST /item_per_installations.json
[ { "docid": "d972794d44e3ca4359a38f0eee72f9e4", "score": "0.64998734", "text": "def create\n @item_per_installation = ItemPerInstallation.new(item_per_installation_params)\n\n respond_to do |format|\n if @item_per_installation.save\n format.html { redirect_to @item_per_installation, not...
[ { "docid": "43cd18e22cfb2988abe4e99e8a10fbc1", "score": "0.66658014", "text": "def set_item_per_installation\n @item_per_installation = ItemPerInstallation.find(params[:id])\n end", "title": "" }, { "docid": "2efbf76f433f577c2f93248f74f4784a", "score": "0.6653831", "text": "d...
50dc84f122dd7129863a54f86ac266c7
capturing numbers between start and stop recursively
[ { "docid": "ac32e3336735c3e496a1f4fef4cca4f7", "score": "0.60924727", "text": "def range(start, stop)\n return [start + 1] if stop - start == 2\n range(start,stop-1) + [stop - 1]\nend", "title": "" } ]
[ { "docid": "adc488ca674654c61ac12f8e8dd9bfc9", "score": "0.68637276", "text": "def start( end_number )\n $o_count += 1\n current_number = 0\n\n while current_number < end_number\n dive( current_number, 0 )\n current_number += 1\n end\nend", "title": "" }, { "docid": "30d084c1dbb836...
5ccc119d7cc6db98df6b064dd33b537a
POST /talleres POST /talleres.json
[ { "docid": "baa79f4753e5ea98d674aab51e7aa925", "score": "0.5599329", "text": "def create\n @taller = Taller.new(params[:taller])\n @taller.hora = \"#{params[:date][:hour]}:#{params[:date][:minute]}\"\n\n respond_to do |format|\n if @taller.save\n format.html { redirect_to @taller, n...
[ { "docid": "b83640ef1d9d626ba2ee4fa61d87fc90", "score": "0.69604844", "text": "def create\n @taller = Taller.new(taller_params)\n\n respond_to do |format|\n if @taller.save\n format.html { redirect_to @taller, notice: 'Taller was successfully created.' }\n format.json { render :...
1097a7e7758f08d32addfc88ea3fdcab
GET /users GET /users.json
[ { "docid": "b4aaab7565278b2479230549be79f246", "score": "0.0", "text": "def index\n @users = User.all\nend", "title": "" } ]
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.84081405", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "543509c6588e2f79a8dbcd1cdcdaf7b9", "score": "0.836071", "text": "def users\...
1e6d98fadabd0c2dad611a768aaacfc0
3 Have to compare a value from the list against everything else in the list Nested loop List is not sorted
[ { "docid": "7f8b53932339ee204c99a8edfcc030a9", "score": "0.0", "text": "def mode(list)\nmax_count = 0\n list.each do |n| #looping through og list of numbers\n count = 0\n list.each do |m| # count how many of n exist in the list.\n if n == m\n count +=1\n ...
[ { "docid": "a58089ffc8f88d8f9cfcb32139c21e54", "score": "0.62737864", "text": "def supply_check(item, list)\n list.each do |listItem|\n if item == listItem\n return true\n end\nreturn false\n end \nend", "title": "" }, { "docid": "51857d84628f828cffd1cb8fc94d4d94", "score": ...
65cb12ecb517c23cb2fba580f6d27dba
create Instance Method for drink projected rating
[ { "docid": "a78e2e502e162d2ae0599970c7c111e2", "score": "0.63705736", "text": "def user_drink_projected_rating(drink_id)\n @projected_rating = UserDrinkRecommendation.where(user_id: self.id, beer_id: drink_id)[0]\n if !@projected_rating.blank?\n if @projected_rating.projected_rating >= 10.0\n...
[ { "docid": "7f2575b6bae0d0e7eb8916bf8c524d14", "score": "0.6731768", "text": "def create_ratyrate\n\t\tself.rate(self.rating, self.user, \"rating\", false)\n\tend", "title": "" }, { "docid": "991ca0b358d34cc6ed8c5f35107cd27e", "score": "0.6441457", "text": "def rating #Getter\n @r...
93d63d75cf7b2ba5782484a00e7569a8
routes file get '/menu' => 'homefirst_menu'
[ { "docid": "115e32ea8c40afda68a5cfc57c60b824", "score": "0.6703976", "text": "def first_menu\n menu = Menu.find(1)\n redirect_to menu\n end", "title": "" } ]
[ { "docid": "5009e6a63c5f078e6eaed80f83908692", "score": "0.6822893", "text": "def routes; end", "title": "" }, { "docid": "5009e6a63c5f078e6eaed80f83908692", "score": "0.6822893", "text": "def routes; end", "title": "" }, { "docid": "5009e6a63c5f078e6eaed80f83908692", ...
c3dc990128ed0f09f1a786632fbec6f4
Public: Initialize a new Particle. pos An initial Vector. Returns a new Particle.
[ { "docid": "59548382fa8fbeb82b7410cb4d057ada", "score": "0.6274532", "text": "def initialize(pos)\n @pos = pos\n @last_pos = pos\n end", "title": "" } ]
[ { "docid": "915092e4ba00a5a93b1b5b640e970fd0", "score": "0.70847803", "text": "def initParticle(p)\n\n\t\t\n\t\t@angle = (@angle + rand(-@angleVariance..@angleVariance))\n\t\t#@angle = 90\n\t\t@vel_x = @speed * Math.cos(angle * Math::PI / 180)\n\t\t@vel_y = @speed * Math.sin(angle * Math::PI / 180)\n\n\...
a5195de0602989d12ce034914a6b3486
observation_date is the date that a price, volume, divident payout, or share count observation was observed The observation made on the observation_date is the value we are wanting to adjust for splits/dividends. adjustment_base_date is the date (occurring after observation_date) from which our adjustment "look back" i...
[ { "docid": "37f77ce362068131202945446b6af5d9", "score": "0.65102065", "text": "def calculate_cumulative_adjustment_factor(security, observation_datestamp, adjustment_base_datestamp)\n # 1. look up all corporate actions between (observation_date, adjustment_base_date]\n corporate_actions = Find...
[ { "docid": "22f26270f5db07eef5d51a5f54d7d6ed", "score": "0.50039613", "text": "def update_outcome\n #need to include estimation indicator for instances where the outcome date is estimated.\n @needs_date_picker = true\n @patient = Patient.find(session[:patient_id])\n give_drugs_encounters = @...
e2e3fa5c8291918f1a4d86db20bdd04c
DELETE /subquestionanswers/1 DELETE /subquestionanswers/1.json
[ { "docid": "7f789e7fd998adb701bad0787a92d47d", "score": "0.7658266", "text": "def destroy\n @subquestionanswer.destroy\n respond_to do |format|\n format.html { redirect_to subquestionanswers_url, notice: 'Subquestionanswer was successfully destroyed.' }\n format.json { head :no_content }...
[ { "docid": "a18056052536f89e269b598a671d1997", "score": "0.7763433", "text": "def destroy\n @subanswer.destroy\n respond_to do |format|\n format.html { redirect_to subanswers_url, notice: 'Subanswer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "...
723699f3251cb206ea01f25a06680921
stops inspect from recursivly looking at the inner hash.
[ { "docid": "233b1f089ddb7acc73a9ac6be2d8be83", "score": "0.0", "text": "def inspect\n \"#<#{self.class}:0x%x #{self.name}>\" % object_id\n end", "title": "" } ]
[ { "docid": "72a94224e373414a2e47570e6dec2e52", "score": "0.6301786", "text": "def inspect_inner_hash(hash)\r\n hash.each do |key, value|\r\n if value.is_a? Array\r\n print_label key\r\n extract_hashes_and_print value\r\n elsif value.is_a? Hash\r\n print_subk...
43a9695336b6dc039fc618e9827f2268
POST /resources POST /resources.json
[ { "docid": "133c71e7b8d14d06ccbb43f851464390", "score": "0.0", "text": "def create\n @resource = Resource.new(resource_params)\n @resource.user_id = current_user.id\n @resource.download.attach(params[:resource][:image])\n @resource.download.attach(params[:resource][:download])\n respond_t...
[ { "docid": "e18ad7a2dc6c5ab51abdd1e6504e6b16", "score": "0.68995935", "text": "def create\n\tputs \"create\"\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n format.json { render json: @resource, status: :created, location: @resource }\n ...
70972dedd4b7849f80f485c2970dbfc0
POST /video_request_comments POST /video_request_comments.json
[ { "docid": "ac5db9c39986c8d31b8f2ef8289d48dd", "score": "0.76528156", "text": "def create\n @video_request_comment = VideoRequest::Comment.new(\n video_request_comment_params.merge(video_request_id: params['id'], user_id: current_user.id)\n )\n respond_to do |format|\n if @video_reque...
[ { "docid": "5e819af7fbe34434df438ba8ab89bb8f", "score": "0.69776887", "text": "def video_comment_params\n params.require(:video_comment).permit(:creation, :video_id, :customer_id, :comment)\n end", "title": "" }, { "docid": "7c5bf30d466eacff7703614d5ab26932", "score": "0.6878262"...
72f435105bfb24bc6b0c640dd1f6880f
Property stop Token sale state related pages
[ { "docid": "46087dff3be670b3d9a4c1a251bdd024", "score": "0.52814347", "text": "def get_token_sale_state_page_names(key)\n _page = token_sale_state_page_names[key.to_sym]\n fail \"Token sale state (#{key}) related page not defined.\" if _page.blank?\n return _page\n end", "t...
[ { "docid": "a135a9f3cfcf8f39968dd96435c7410a", "score": "0.5846016", "text": "def get_token_sale_state_page_name\n if !properties_array.include?(GlobalConstant::User.doptin_mail_sent_property)\n # FOR API USERS and non verify page opted in users\n if properties_array.include?(Gl...
4baf403f57326c77201cbdb503bbdb50
Defined as n > n/2 if even, n > 3n+1 if odd until n == 1
[ { "docid": "b0a4f55a8c57a357e4231c185bc98f58", "score": "0.0", "text": "def collatz_sequence\n n = self\n results = []\n\n until n == 1\n results << n\n n = n.even? ? n / 2 : n * 3 + 1\n end\n\n results\n end", "title": "" } ]
[ { "docid": "b42eb4465b169f1981dfe468aa02c55e", "score": "0.7751518", "text": "def problem3 n\n 2.step(n,1).each do |x|\n return x-1 if n == 1\n n /= x if x.prime? && (n % x == 0)\n end\nend", "title": "" }, { "docid": "a47672fe01f238fc23498ec6b03fc4db", "score": "0.73370147", ...
f6eb460c93e3d10a2b5ae3cd1f96d367
Returns current field's name, for e.g. 'minute', 'hour', and likewise.
[ { "docid": "a701c7122b7195d1bdc8868cc17a99be", "score": "0.70223314", "text": "def field_name\n self.class.name.split(\"::\").last.downcase.sub(\"of\", \"_of_\"). \\\n sub(\"field\", \"\").downcase\n end", "title": "" } ]
[ { "docid": "39bdcffa084a57c5a40dbef01a2523dc", "score": "0.7476621", "text": "def field_name\n @field.name\n end", "title": "" }, { "docid": "5f220ff81e57364f986fa1e0ab5befe2", "score": "0.70838934", "text": "def field_name\r\n @field_name ||= begin\r\n %r/(\\w+)F...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b6d8c745bc3f0b9f78d93f42b4fa6f51", "score": "0.0", "text": "def avatar_params\n params.require(:avatar).permit(:name, :sex, :head_id, :body_id)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6981606", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6784227", "text": "def strong_params\n params.requi...
fd82464868253e33baf6963eab0bfb0e
Returns the number of words in the word list of +size+
[ { "docid": "385c41e816ef008427b407538f695474", "score": "0.9295189", "text": "def num_words(size)\n total = 0\n @word_list.each{ |word| total += 1 if word.size == size }\n total\n end", "title": "" } ]
[ { "docid": "dad9bfd4caabacf1465216677d5ee68b", "score": "0.79736686", "text": "def size\n @words.size\n end", "title": "" }, { "docid": "92666ecebfd589ea8b39458a81752d36", "score": "0.7720512", "text": "def word_count\n return words.size\n end", "title": "" }, {...
ea22237b90f6638a8046181b8529e32b
return updated at date formatted
[ { "docid": "7a3649550557c8ce99745e6a8ecc9d91", "score": "0.76598567", "text": "def the_updated_at(format = :long)\n h.l(object.created_at, format: format.to_sym)\n end", "title": "" } ]
[ { "docid": "d55cef384ac0d20b469b57b1766a42f8", "score": "0.85295147", "text": "def updateddate\n \t\"#{updated_at.to_s[0..9]}\"\n end", "title": "" }, { "docid": "a409ba4b014adec43a309c08b8b3fe5f", "score": "0.82901585", "text": "def updated_at_string\n @updated_string\n end"...
928f407ef0e55b16be3726cfed178404
Determine whether the file should be rendered with Liquid. Returns false if the document is either an asset file or a yaml file, or if the document doesn't contain any Liquid Tags or Variables, true otherwise.
[ { "docid": "719616c5cfd84b3462dbb2f7ddcb4a6d", "score": "0.5356693", "text": "def render_with_liquid?; end", "title": "" } ]
[ { "docid": "7fa7d07708622abb9048665812f7c38d", "score": "0.7727341", "text": "def render_with_liquid?\n return false if data[\"render_with_liquid\"] == false\n\n !(coffeescript_file? || yaml_file? || !Utils.has_liquid_construct?(content))\n end", "title": "" }, { "docid": "4eb4a...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "81487086b7b5c1a689c8a83447587467", "score": "0.0", "text": "def set_simulation\n @simulation = Simulation.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...
3a9695c5596893b7857cc168bce82a24
Remove suffixes from the requested language, leave others alone
[ { "docid": "867fc739e3981f2b9620466373bf7f82", "score": "0.0", "text": "def fields_for(hsh, lang)\n separator = LANG_SEP\n suffix = /#{separator}#{lang}\\z/i\n\n hsh.reject{|key, val| val.blank?}.hmap do |key, value|\n [key.sub(suffix, '').to_sym, value]\n end\nend", "title": "" } ]
[ { "docid": "1e5dedfe2469cdca36b1de93d4151124", "score": "0.71253663", "text": "def suffixize(lang)\n lang.blank? ? \"\" : \"_#{lang}\"\n end", "title": "" }, { "docid": "e9a247bf880ce0033fce6a97d7709d5c", "score": "0.6310489", "text": "def remove_lang(uri, lang=self.path_lang...
4972bfb880e42839ef1e1f1be2fa99c2
Raw WS message received parse it and dispatch appropriate client handler
[ { "docid": "fbc4d67e0611dca413522c6f37ceabc8", "score": "0.58582616", "text": "def on_message(env, raw_json)\r\n json = JSON.parse(raw_json)\r\n type = json['type'] or raise 'Missing required param: type'\r\n\r\n Broker.instrument('browser-broker') {\r\n Broker.instrument('broker')...
[ { "docid": "5674c92d77b69ca588906eab12168ebf", "score": "0.6987598", "text": "def handle(socket, parsed_message)\n end", "title": "" }, { "docid": "c94d1e901a6c16602b3d8c3881ab1b7f", "score": "0.67391264", "text": "def handle_message(message); end", "title": "" }, { ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "05dc0f9a6c830c216f605d46e84601dc", "score": "0.0", "text": "def update!(**args)\n @disable_freshness = args[:disable_freshness] if args.key?(:disable_freshness)\n @disable_personalization = args[:disable_personalization] if args.key?(:disable_personalization)\n end",...
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.7307693", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72636455", "text": "def update(...
c8e86da1995e3ac2ce604895ddd3b1ee
Add a callback. label The Symbol identifier to attach this callback. Returns nothing. source://pry//lib/pry/slop.rb398
[ { "docid": "2d73dd4b40b864f1cf12b9296be5cd0e", "score": "0.81403506", "text": "def add_callback(label, &block); end", "title": "" } ]
[ { "docid": "d37cefbe5ea547d6c39ed89294414766", "score": "0.79841757", "text": "def add_callback(label, &block)\n (@callbacks[label] ||= []) << block\n end", "title": "" }, { "docid": "56eb34bf05dabcb4357460a405b3c06b", "score": "0.69533324", "text": "def on(label, &block)\n ...
45fb4efad6139abc5938f30ebdd1cf70
Setting up strict parameters for searching
[ { "docid": "11a7b013484fddaa257d28e480d623db", "score": "0.0", "text": "def search_params\n # ts_start: nil, ts_end: nil, b_read: false, star_color: [], star_symbol: [],\n # comment_fragment: nil, page: 1, per_page: 100, order_by: 'created_at', order_dir: 'asc'\n params.require(:list).permi...
[ { "docid": "1105a2feae212fb2b2aa23ca2212a6e5", "score": "0.72418594", "text": "def setup_search_options\n params[:search] ||= \"\"\n params.keys.each do |param|\n if param =~ /(\\w+)_id$/\n unless params[param].blank?\n query = \" #{$1} = #{params[param]}\"\n ...
c0f3f200f8082f3b53e332480bf67f3f
Reset the tags for this file to the ones in the given array
[ { "docid": "1e8202963fbf5ecd8dcf958e2209bd34", "score": "0.0", "text": "def tags=(new_tags)\n @tags = parse_tags(new_tags)\n @saved = false\n save if @autosave\n @tags\n end", "title": "" } ]
[ { "docid": "a6becb4dda8f9951b0d66ae1ee93d9fb", "score": "0.7204626", "text": "def set_tags(array_tags)\n unless array_tags.blank?\n tags_da_salvare = []\n #qui arriva un array che contiene o id di tag presenti o il nome del nuovo tag\n array_tags.each{|tag|\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b8dbc32eb425fb648cb9872373eca8cd", "score": "0.0", "text": "def set_singer\n @singer = Singer.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...
a5343c012886b07ec511a5b7532522fd
this method will be removed when the chess library will be used rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength
[ { "docid": "72957eccf3ecd795a972e2b7363ff09c", "score": "0.0", "text": "def attempt_login\n if params[:email].present? && params[:password].present?\n found_user = User.where(email: params[:email]).first\n authorized_user = found_user.authenticate(params[:password]) if found_user\n end\n...
[ { "docid": "b7c7ba5b88f14297e76cfcba84214f80", "score": "0.58020765", "text": "def setup( )\n\t\t\t(\"a\"..\"h\").each do |f|\n\t\t\t\t@squares[\"#{f}2\"] = Chess::Pawn.new(self, \"#{f}2\", :white)\n\t\t\t\t@squares[\"#{f}7\"] = Chess::Pawn.new(self, \"#{f}7\", :black)\n\t\t\tend\n\t\t\t[\"a\", \"h\"]....
ad447a7434c4300d735156098ca1f08e
Gets the screenCaptureBlocked property value. Indicates whether or not to block screenshots.
[ { "docid": "af505910db44dbf1c436f9b9c4fda931", "score": "0.83359134", "text": "def screen_capture_blocked\n return @screen_capture_blocked\n end", "title": "" } ]
[ { "docid": "f2a0be9540f7ac65f4eb0d44f8191204", "score": "0.8001237", "text": "def screen_capture_blocked=(value)\n @screen_capture_blocked = value\n end", "title": "" }, { "docid": "f2a0be9540f7ac65f4eb0d44f8191204", "score": "0.8001237", "text": "def screen...
6f3870fcae01581cd12068aaa64f47f3
Only works if this class is derived (includes) HTTParty if ENV["DEBUG"] debug_output $stdout end
[ { "docid": "216e19e27ce648d80bb86b430d83bcfd", "score": "0.0", "text": "def initialize\n Gamewisp.load_configuration\n self.token_store = TokenStore.new\n self.auth = Authorizer.new 'createauth', self.token_store\n end", "title": "" } ]
[ { "docid": "f806f8c423fb12347a81fa630b0bdf51", "score": "0.65130186", "text": "def debug_output; end", "title": "" }, { "docid": "f806f8c423fb12347a81fa630b0bdf51", "score": "0.65130186", "text": "def debug_output; end", "title": "" }, { "docid": "f806f8c423fb12347a81fa63...
62592b571075e10339369413a3d0f7cc
Delete a Tier1 segment port Delete a Tier1 segment port by giving ID.
[ { "docid": "f1086cc9cb9d4b11bef9cc7edfdb8563", "score": "0.6862636", "text": "def delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsA...
[ { "docid": "074fcdca76a59adbb4b0525da939c04d", "score": "0.70703673", "text": "def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "title": "" }, { "docid": "8...
8ed00556d4122e3eccfd9b5389522ebd
PUT /users/1 PUT /users/1.json
[ { "docid": "b0b28249bcc19b8c72959481fe71a4c3", "score": "0.0", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json ...
[ { "docid": "b5edb8a9b2cad14c7874c5f42c5809e9", "score": "0.7438286", "text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end", ...
5c71d4d92d2cb96fca16a858fee34b3e
return the currently logged in user
[ { "docid": "eea812da280b97fe603d28d0363b36ee", "score": "0.0", "text": "def current_user\n @user ||= User.find_by(id: session[:user_id])\n end", "title": "" } ]
[ { "docid": "80d55744030877ce2893600a03c1d5e7", "score": "0.889944", "text": "def current_user\n if logged_in?\n User.find user_id\n end\n end", "title": "" }, { "docid": "9d2474d7146090be50a4cbd24f0b226c", "score": "0.87777656", "text": "def current_user\n \tif s...
5b08b6122fe39c0fba35eed12a7af935
Find the users seprately so it'll use AR cache in most cases
[ { "docid": "3216186cf6d3b1d189264aeee70f1f3f", "score": "0.0", "text": "def members(options = {})\n fetched_member_ids.map{ |id| User.find_by(id: id) }\n end", "title": "" } ]
[ { "docid": "1b249161caa39798bec5c8d65908e4c7", "score": "0.75951177", "text": "def work_users\n user_ids = Rails.cache.fetch(\"#{cache_key_with_version}/all_user_ids\") { self.users.pluck(:id) }\n User.where(id: user_ids) \n end", "title": "" }, { "docid": "b76c61585e9e72664167a1c20...
20a7902588a4026e8f630680cde76399
GET /begens GET /begens.json
[ { "docid": "7beb231fb67e23de8e694d1de4f4d5e0", "score": "0.6867156", "text": "def index\n @begens = Begen.all\n end", "title": "" } ]
[ { "docid": "e27729d4ea768b422214fdf952e2065f", "score": "0.66090477", "text": "def get_brandings\n request :get,\n '/v3/brandings.json'\n end", "title": "" }, { "docid": "55661ff5a7a662de6c34c647d1e2ee73", "score": "0.6470428", "text": "def index\n @beers = Beer.a...
6c40b704cd8c9a647d242430a7ac08ac
a.concat(b).sort! index = a.length / 2 if a.length.even? if a.length == 0 nil else result = (a[index1] + a[index]).to_f / 2.0 result % 1 == 0 ? result.to_i : result end else a[index] end end
[ { "docid": "a3bac976ce88985126396c7812c4ef24", "score": "0.0", "text": "def median_of(array)\n n = array.length\n index = n / 2\n if n.odd?\n array[index]\n else\n if array.length == 0\n nil\n else\n result = (array[index - 1] + array[index]).to_f / 2.0\n result == result.to_...
[ { "docid": "f4ec6e0f607280e0e964fb08043b52cf", "score": "0.7288584", "text": "def combine(a, b)\n # create a results array\n result = []\n # counters pointing to the index of the smallest elements in each array\n # check that we have elements to compare\n while a.length > 0 && b.length > ...
28b725a061e97f71dd5e7fcbb4db73f4
DELETE /syllogisms/1 DELETE /syllogisms/1.json
[ { "docid": "a310a865341db70287ccc725a81486ec", "score": "0.7573518", "text": "def destroy\n @syllogism.destroy\n respond_to do |format|\n format.html { redirect_to syllogisms_url, notice: 'Syllogism was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "...
[ { "docid": "b22f81749d06ef6033ce9db1902a3b6c", "score": "0.6958356", "text": "def destroy\n @syllabus = Syllabus.find(params[:id])\n @syllabus.destroy\n\n respond_to do |format|\n format.html { redirect_to syllabuses_url }\n format.json { head :no_content }\n end\n end", "titl...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "fe83a1be58321c3d0c5deb38a6f7f9a9", "score": "0.0", "text": "def set_janken\n @janken = Janken.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;...
70268814970a8237c7c3870e2f1a0fe2
Query/Execute (Supported by Aerospike 3+ servers only) QueryExecute applies operations on records that match the statement filter. Records are not returned to the client. This asynchronous server call will return before the command is complete. The user can optionally wait for command completion by using the returned E...
[ { "docid": "5d5833e4f25dcea66f43934dca077bf8", "score": "0.62454116", "text": "def query_execute(statement, operations = [], options = nil)\n policy = create_policy(options, WritePolicy, default_write_policy)\n\n if statement.nil?\n raise Aerospike::Exceptions::Aerospike.new(Aerospike::...
[ { "docid": "16df1c5c8099adaf7ae5b86f6c563cd5", "score": "0.5593991", "text": "def query_partitions(partition_filter, statement, options = nil)\n policy = create_policy(options, QueryPolicy, default_query_policy)\n new_policy = policy.clone\n\n nodes = @cluster.nodes\n if nodes.empty?...