query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c3aceffd80602bfbeb8c0563f716d31c
GET /organizations/new GET /organizations/new.json
[ { "docid": "0c50992c52fd13b6ed7da5c59d9327b4", "score": "0.7459801", "text": "def new\n @organization = Organization.new\n end", "title": "" } ]
[ { "docid": "a823a453a7d2d4a5102d1c4f9c0790d7", "score": "0.80002916", "text": "def new\n @organization = Organization.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @organization }\n end\n end", "title": "" }, { "docid": "a823a453...
bf6aaf1e7e4adc93bad26a6af0528379
tests if the algorithm spots infeasible pairs for which it is impossible to obtain valid runs; more precisely this impossibility is spotted within the Vertical Growth step of the algorithm.
[ { "docid": "297c4deff5cd097f012646b15ea2fa10", "score": "0.622844", "text": "def test_impossible_combination_VG\r\n\t\tassert_raise(ArgumentError.new(\"The input provided doesn't allow the creation of valid runs(raised in vertical_growth)\")) {IPOAlgorithm.new(3,[2,2,2],File.dirname(__FILE__)+\"/input_f...
[ { "docid": "7d0959a1c91f24c8063f31c55cdf4ce3", "score": "0.68404824", "text": "def unsolvable?\n 9.times do |y|\n 9.times do |x|\n next unless @board[y][x].zero?\n return true if self.possible_values(x,y).nil?\n end\n end \n false\n end", "title": "" }, { ...
f65b2c3119082c136aca92acddc9c01a
for ergonomically recalling the current fullpath of the namespace
[ { "docid": "236512e6633fbf5bb0f516ff9f32c6b0", "score": "0.59624", "text": "def namespace_path(path = '')\n File.expand_path(File.join(store_path, namespace, path))\n end", "title": "" } ]
[ { "docid": "897af59b0e5bc1a0f6d69dd7160aaf66", "score": "0.68636113", "text": "def namespaced_path\n @namespaced_path ||= name.tr('-', '/')\n end", "title": "" }, { "docid": "78719f289c71d50d2a22bc25260fd741", "score": "0.67840534", "text": "def namespace; end", "title": "" ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2d50adcd2dbae4dce03d9b9c3ecdcd0d", "score": "0.0", "text": "def document_params\n params.require(:document).permit(:uri, :date, :title, :body, :meta_title, :meta_desc, :meta_keywords)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74959", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957448", "text": "def strong_params\n params.require(:request).permit(param_whiteli...
c55b041f8ef0abc7182c7ad1fe142ee1
Add n randomly created LifeForms to the Universe
[ { "docid": "fc735ec11efdca81e8ea3fce5b596541", "score": "0.8213172", "text": "def populate(n)\n\t\tn.times { self << random_lifeform }\n\tend", "title": "" } ]
[ { "docid": "a4e3334ef267473d2acb0c08d84b9fb1", "score": "0.61974734", "text": "def mk_systeme( n )\n planetes = (0...n).map do |i|\n Planete.new( \"#{i}\",\n 0,\n rand(10E+15),\n Vector[rand(10E+10), rand(10E+10)],\n Vector[rand(10E+10)...
5b867f265ecdba336a4ca8092cf6b6a8
Get current tempo mode Returns the current tempo mode either a bpm value or :link. To know the current BPM value when this thread is in :link mode see `current_bpm`. This can be set via the fns `use_bpm`, `with_bpm`, `use_sample_bpm` and `with_sample_bpm`.
[ { "docid": "894d594e55f24cbf7343906409c810c4", "score": "0.6804265", "text": "def current_bpm_mode\n #This is a stub, used for indexing\nend", "title": "" } ]
[ { "docid": "e3f54bb6d42716e03f51ee622e257417", "score": "0.6757959", "text": "def tempo_bpm\n @tempo_bpm ||= calculate_tempo_bpm\n end", "title": "" }, { "docid": "df73316ad186b6096d80342541ee9d2c", "score": "0.63197154", "text": "def current_mode\n\t\tspeed = @data.speed\n\t...
046c57e8bbfb4fd008cd0966508c7cd5
The method should return true if the string contains only vowels. The method should return false otherwise.
[ { "docid": "e326d81f83685ff62cd2ee9832fb8538", "score": "0.8397142", "text": "def only_vowels?(str)\n vowels = \"aeiou\"\n str.split(\"\").all? do |char| #splits string into seperate array (aaoeee) -> [a,a,o,e,e,e]\n vowels.include?(char) #checks if the whole array includes any vowels [iou]...
[ { "docid": "109b4d9a3bf0e93880c2ff6bc0b164ed", "score": "0.8494073", "text": "def only_vowels?(str)\n vowels = \"aeiou\"\n str.split(\"\").all? { |char| vowels.include?(char) } # the all? method is inapplicaable to strings so I needed to split the string into an array\nend", "title": "" }, ...
acb4e3c9f741d9b2aa440ccf73470559
GET /recipes GET /recipes.json
[ { "docid": "a564c4f0d3269a63bb4b097b1933e601", "score": "0.0", "text": "def index\n if params[:search]\n @recipes = Recipe.search(params[:search]).order(\"name ASC\")\n else\n @recipes = Recipe.all.order('name ASC')\n end\n end", "title": "" } ]
[ { "docid": "3d2d3e1a102aa64d4a392b701004a710", "score": "0.7560326", "text": "def index\n render json: recipes\n end", "title": "" }, { "docid": "8f815392eae4c1163c211d4fd9c8da64", "score": "0.753776", "text": "def index\n @recipes = @client.recipes\n end", "title...
7bc0d64a7454eac33129b7b4cde06d2e
as per the requirements this returns a string
[ { "docid": "663a3a2d5c9eb7ab1d411983a5e2fc57", "score": "0.0", "text": "def print_ordered_names\n names = ''\n order_nodes do |node|\n names = names + node.name + \"\\s\"\n end\n names\n end", "title": "" } ]
[ { "docid": "e2605bc7a2f9b5ea50adaa22fbf273e6", "score": "0.72182417", "text": "def to_s\n assert_exists\n return string_creator.join(\"\\n\")\n end", "title": "" }, { "docid": "e2605bc7a2f9b5ea50adaa22fbf273e6", "score": "0.72182417", "text": "def to_s\n ...
fbc7bc627001c67799a0b186b9d48d52
Get a list of paging policies for a user Get paging policies for a user This API may be called a maximum of 2 times per second.
[ { "docid": "a894325f878195b530c35045e7a5018d", "score": "0.5456881", "text": "def api_public_v1_user_user_policies_get(x_vo_api_id, x_vo_api_key, user, opts = {})\n data, _status_code, _headers = api_public_v1_user_user_policies_get_with_http_info(x_vo_api_id, x_vo_api_key, user, opts)\n data\...
[ { "docid": "0035b84711c392f4884bbaf42a38d18e", "score": "0.7076066", "text": "def list_user_policies(user_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ListUserPolicies'\n\t\targs[:query]['UserName'] = user_name\n\t\targs[:region] = optional[:_region] if (optional.k...
db77f889215639ed2bfa0c1f927ba4e2
string representation of an entry
[ { "docid": "ba756c2067fe8bf12ca8a2bb0d935107", "score": "0.0", "text": "def print_contents\n\t\tputs \"Artist: %s\" % [@artist]\n\t\tputs \"Album: %s\" % [@title]\n\t\tputs \"Released: %s\" % [@year]\n\n\t\tif @cd_count > 0\n\t\tputs \"CD(%d): %s\" % [@cd_count, @cd_id]\n\t\tend\n\n\t\tif @tape_count > ...
[ { "docid": "5b1ff622c8eb4277aebb04f46059f718", "score": "0.8600887", "text": "def entry_to_str(entry)\n entry.to_s\n end", "title": "" }, { "docid": "e0897cdbd1e37736c10531d99dea0347", "score": "0.7349705", "text": "def to_s\n result = ''\n @entries.each { |entry| resul...
f103c2e10dbe7ae4a94ecd62a97b6129
Render the seed template in the context of the receiver.
[ { "docid": "d2d4f6e95760b41e41eafde855def6b5", "score": "0.75965965", "text": "def render_seed( notification )\n\t\ttemplate = self.load_template( SEED_TEMPLATE )\n\t\treturn template.result( binding() )\n\tend", "title": "" } ]
[ { "docid": "01bd13525a2650708fca32c0ec91e3f4", "score": "0.69957393", "text": "def render_template(context, options); end", "title": "" }, { "docid": "51bfae69eb7931f8f38e9324be0c359c", "score": "0.67999184", "text": "def render\n ERB.new(@template, nil, '-').result(binding)\n en...
8b535bcc1fc79f01188545ef0e5661b2
Validate the markup of a URI
[ { "docid": "bac6b3bf8ed926e99e7d87f84dbc4cb9", "score": "0.7510581", "text": "def validate_uri(uri)\n validate_text(Net::HTTP.get(URI.parse(uri)))\n end", "title": "" } ]
[ { "docid": "8cf0ba0d85555692aff6b77d9b03cae0", "score": "0.7760377", "text": "def validate_uri(uri)\n return validate({:doc => uri})\n end", "title": "" }, { "docid": "8d0d1757d9804f309f3092c9bd7ce0df", "score": "0.7329923", "text": "def validate_uri(uri)\n return valida...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8b15b4150a83a17f2243262fd3e2b0f2", "score": "0.0", "text": "def set_distributor\n @distributor = @distributors[params[:id]]\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60326946", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015941", "text": "de...
71c73b71123a82c5a359dfde58bd7b5c
DELETE /start_male4x100mts/1 DELETE /start_male4x100mts/1.json
[ { "docid": "d1d9f0c16d827574acf9cd451d7fbf54", "score": "0.70831454", "text": "def destroy\n @start_male4x100mt.destroy\n respond_to do |format|\n format.html { redirect_to start_male4x100mts_url, notice: 'Start male4x100mt was successfully destroyed.' }\n format.json { head :no_content ...
[ { "docid": "13dafc4d02f0f68b899a4803d655eaf1", "score": "0.69964826", "text": "def destroy\n @start_male800mt.destroy\n respond_to do |format|\n format.html { redirect_to start_male800mts_url, notice: 'Start male800mt was successfully destroyed.' }\n format.json { head :no_content }\n ...
e25088ca0c8c2ea84148509888da96ae
Polls the Justin.TV API to find the number of current viewers on the channel.
[ { "docid": "4b703e8537006c7281482b41b0b7ae0b", "score": "0.79239875", "text": "def viewers\n client = Jtv::JtvClient.new\n json_data = client.get( \"/stream/list.json?channel=#{self.id}\" )\n if json_data.body == \"[]\"\n return nil\n else\n data = JSON.parse( json_data.body )\n ...
[ { "docid": "27af665d176f03b5cc25473c68046457", "score": "0.652377", "text": "def viewCount\n\tviewtickets = $client.views.find(:id => 61136848)\n\tviewtickets.tickets.each { |x| puts x }\nend", "title": "" }, { "docid": "bfaffaa756a82ec94b3df553f9ea96a1", "score": "0.635338", "text":...
b6138ffdad0f8dec6f24eefb74e2b1d4
PATCH/PUT /mensajes/1 PATCH/PUT /mensajes/1.json
[ { "docid": "c2718a35c519e242dd28a964d19e7a8f", "score": "0.6289454", "text": "def update\n respond_to do |format|\n if @objeto.update(mensaje_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Mensaje was successfully updated.' }\n format.json { ren...
[ { "docid": "35a8ab16da15de0be64dd313ccd084eb", "score": "0.6854273", "text": "def update\n @mensaje = Mensaje.find(params[:id])\n\n respond_to do |format|\n if @mensaje.update_attributes(params[:mensaje])\n format.html { redirect_to @mensaje, notice: 'Mensaje was successfully updated.'...
93612157454cf75c94e86434878ae359
Support method for deep transforming nested hashes and arrays written by sakuro 10887
[ { "docid": "4cd215433c831e3cc13319bc76dc3026", "score": "0.6775889", "text": "def _deep_transform_keys_in_object!(object, &block)\n case object\n when Hash\n object.keys.each do |key|\n value = object.delete(key)\n object[yield(key)] = _deep_transform_keys_in_object!(value, &blo...
[ { "docid": "968b15ca920ed10267db497ac095e8e8", "score": "0.73055285", "text": "def deep_transform_keys(&block); end", "title": "" }, { "docid": "95d01147445adbc7f5dda74f811ef9c4", "score": "0.72908324", "text": "def deep_transform_keys!(&block); end", "title": "" }, { "do...
3d78a690ff258e667d7bee662785c650
int64 Number of login tries within `user_lockout_within` hours before users are locked out
[ { "docid": "fe2dd6aa18d0d5e6baa8ff24231cc4d4", "score": "0.69643396", "text": "def user_lockout_tries\n @attributes[:user_lockout_tries]\n end", "title": "" } ]
[ { "docid": "1cc421b8319152a2f5c8ab0a494fa052", "score": "0.689968", "text": "def time_until_unlock\n return 0 unless access_locked?\n return ((User.unlock_in - (Time.current - locked_at)) / 60).round\n end", "title": "" }, { "docid": "e56946953b7ee1b67ea936858a283d7a", "score": "0...
507c36dbc592ca7c790cbf1626617701
GET /people/1/contributions GET .people/1/contributions.json
[ { "docid": "6803c2605437565adb141035e2b6e1cb", "score": "0.7270595", "text": "def index\r\n @contributions = @person.contributions\r\n end", "title": "" } ]
[ { "docid": "35edcf18a8045a98677c585aa0d2a6c5", "score": "0.75771564", "text": "def index\n user = User.find_by(id: params[:user_id])\n return respond_with contributions: [], status: :not_found if user.nil?\n contributions = user.contributions\n respond_with contributions: contributions, stat...
def37f3336959c0597288fe5401948c8
ok so day = 04 month = 2 year = 2017 but we store an array of months and use an index+1 to get a name for the month where it would look nice mmmm, a box on the website for entering the day you want but dropdowns for month and year. Perhaps both on recovering and entering new transactions
[ { "docid": "2a056583c831e77fc5519cee5a259417", "score": "0.0", "text": "def save()\n sql = \"INSERT INTO transactions (merchant, tag_id, value, datestore) VALUES ('#{@merchant}', #{@tag_id}, #{@value}, '#{@datestore}') RETURNING *;\"\n transaction = SqlRunner.run( sql ).first\n @id = transaction['id'...
[ { "docid": "ae6b0f71617ef6746b7d8e2ffb619c2f", "score": "0.68705547", "text": "def months_information\n (1).upto(12).collect{|i| \"<option>#{\"%02d\" % i}</option>\"}.join('').html_safe\n end", "title": "" }, { "docid": "20476665aee07ea2f11c21eabfe3ea90", "score": "0.6853431", "t...
2a43f781e3c19848aecf25543d2e9cb6
Draw Lines Between Nodes draw lines between all the nodes def draw_lines
[ { "docid": "3bb18ec9694f7c556d155d5335141e85", "score": "0.0", "text": "def mouse_clicked\n\t\t#puts \"NodeController#mouse_clicked\"\n\t\t#loop through nodes\n\t\t@nodes.each do |node|\n\t\t\t#puts \"NodeController#mouse_clicked: node \" + node.to_s + \" at (\" + node.node_x.to_s + \", \" + node.node_y...
[ { "docid": "57031952d85ced17a3f935b2964e1d98", "score": "0.7332449", "text": "def draw_nodes\n\t\t#puts \"NodeController#draw_nodes\"\n\t\t@nodes.each_with_index do |node, ind|\n\t\t\tif ind == @now_moving\n\t\t\t\tnode.highlight\n\t\t\telse\n\t\t\t\tnode.draw\n\t\t\tend\n\t\tend\n\tend", "title": "...
9c5a5bdaccd29ebcdf566c60681915c5
Under Relative Humidity Warning Threshold text field
[ { "docid": "0237ac7934b5e1db9bb5a5777f5006e6", "score": "0.57071733", "text": "def h_undralrm; catdet.form(:name, 'rpcControlSensorSettingForm').text_field(:id,'humThresholdLoAlm'); end", "title": "" } ]
[ { "docid": "556a5295bf4f75965d00c400362fa27f", "score": "0.60459954", "text": "def h_undrwrng; catdet.form(:name, 'rpcControlSensorSettingForm').text_field(:id,'humThresholdLoWrn'); end", "title": "" }, { "docid": "6c31ed3115c9ebe3c826a07431cb2c24", "score": "0.594859", "text": "def ...
2600ea2fcbb38f7eefb8616680ce8eec
calculate A & B values from hashAOAA
[ { "docid": "7a090a73e8b64cac46e33e1c197b9525", "score": "0.785551", "text": "def calcA_B(hashAOAA)\n a = hashAOAA[\"eMax\"][1] - hashAOAA[\"eMid\"][1]\n b = hashAOAA[\"eMid\"][1] - hashAOAA[\"eMin\"][1]\n [a,b]\n end", "title": "" } ]
[ { "docid": "b02b0d102072c068a4ac051857d275d8", "score": "0.66234595", "text": "def hash\n result = 0\n self.keys.each do |key|\n result += ALPHA.index(key).hash.abs + self[key].hash.abs\n end\n result\n end", "title": "" }, { "docid": "818dfb991535496155f05f3aaf2ee71f", ...
a10f8c096ff0036b987248cc04a3062f
POST /games POST /games.xml
[ { "docid": "628035fbef30bcc84662131bc115eafa", "score": "0.62605745", "text": "def create\n @game = Game.new(params[:game])\n respond_to do |format|\n if @game.save\n flash[:notice] = 'Game was successfully created.'\n format.html { redirect_to(@game) }\n format.xml { re...
[ { "docid": "643d073094feaee606374cfbe52650c4", "score": "0.6862163", "text": "def add_game\n HTTParty.post(\"http://localhost:9292/games/\", body: {name: @name, geekId: @geekId, image: @image, scrape_date: @scrape_date, weight: @weight, playtime: @playtime, description: @description, designer: ...
ed7eec7488c0ed929ed476aabc4de0cf
para PUT o PATCH
[ { "docid": "691e3bde861cbda7d0bb533fcbb31672", "score": "0.0", "text": "def update\n user = User.find(params[:id])\n if user.update(params_user)\n render json: user, status: 200\n else\n render json: user.errors, status: 422\n end\n\n end", "title": "" ...
[ { "docid": "b4cc3ee2207b39abaf779a6078bbaf3a", "score": "0.756928", "text": "def patch\n PATCH\n end", "title": "" }, { "docid": "b4cc3ee2207b39abaf779a6078bbaf3a", "score": "0.756928", "text": "def patch\n PATCH\n end", "title": "" }, { "docid": "ea416b07...
f8a8c71b569cb04b24b5374a2b51b902
Since this function gets called 60 times per seconds it just get better input by incrementing a value. The milliseconds function was to spotty to get a good constant value to comapare against. You could possibly factor it down, but then your spending more processing time on that alone.
[ { "docid": "ae9af38131ac751759264cb60d652405", "score": "0.0", "text": "def update\n\t\t# Timing for the key input\n\t\tif @last_time % 3 == 0\n\t\t\tcase (@button_state)\n\t\t\t\twhen :up then @shape.rotate(:clockwise)\n\t\t\t\twhen :left then @shape.move_left\n\t\t\t\twhen :right then @shape.move_righ...
[ { "docid": "e211b5cc7a5f6f4fbc99d5cfd4104661", "score": "0.66865385", "text": "def register_tick\r\n\t\t\t@accum_fps += 1\r\n @ticks += 1\r\n\t\t\tcurrent_second = Gosu::milliseconds / 1000\r\n\t\t\tif current_second != @current_second\r\n\t\t\t\t@current_second = current_second\r\n\t\t\t\t@fps = @...
d213437f1a02c475c35a298fd0c6b579
is the spy hooked?
[ { "docid": "5f3fb37f3ff599538d1fa273804b4d70", "score": "0.67016774", "text": "def hooked?\n self == self.class.get(base_object, method_name, singleton_method)\n end", "title": "" } ]
[ { "docid": "a8f6635af5d24812a24d9951a4157dfb", "score": "0.6799586", "text": "def spy_on *msgs\n msgs.each do |msg|\n spy msg\n end\n end", "title": "" }, { "docid": "0b4b414f02f43193303ed087b523373f", "score": "0.6769385", "text": "def verify_stubbed_calls; end", "ti...
46c576f0878941f871a893502b4ce9be
Regenerates single_access_token of current_user, then redirects to previous page.
[ { "docid": "907209667cda718e3f39cbb695fc7aed", "score": "0.6503294", "text": "def regenerate_key\n u = current_user\n begin\n u.reset_single_access_token!\n flash[:notice] = _('Your RSS URL has been regenerated.')\n rescue Exception\n flash[:error] = _(\"Couldn't regenerate the U...
[ { "docid": "0d86252dc60bdcd4b43852da86cc26d6", "score": "0.68203765", "text": "def reset_single_access_token!\n reset_single_access_token\n save_without_session_maintenance\n end", "title": "" }, { "docid": "b193dd88512a2b11a48a5bec99379db2", "score": "0.66...
a76d1ac509d5470ffaf9789561539a75
Delete IPv6 DAD profile Delete IPv6 DAD profile
[ { "docid": "0266be950d75fe58431bf961540a39e4", "score": "0.6904816", "text": "def delete_ipv6_dad_profile_0_with_http_info(dad_profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkingProfilesIPV6DADProfilesApi.delete_...
[ { "docid": "b45dca3eab594e044ae3f3c4dcda7a76", "score": "0.695901", "text": "def delete_ipv6_dad_profile_0(dad_profile_id, opts = {})\n delete_ipv6_dad_profile_0_with_http_info(dad_profile_id, opts)\n nil\n end", "title": "" }, { "docid": "23993c4484c2362673af41cd35e1104b", ...
65e1666b37a65d3b136bd58cd83ce2ed
GET /requests/new GET /requests/new.json
[ { "docid": "a37543823c681d55e1f4301ae299f5e0", "score": "0.7366353", "text": "def new\n @request = Request.new\n @queries = Query.all\n @dictionaries = dictionaries\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", ...
[ { "docid": "b6c00328c603b6f67c82ceb0ca824da1", "score": "0.75960726", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "title": "" }, { "docid": "b6c00328c603b6f67c82ceb...
b5c2993a66db72796ecac9affea9d286
Render navigational information in the form of breadcrumbs
[ { "docid": "75caacf4644074f8609b03bda2d3285b", "score": "0.6784397", "text": "def breadcrumbs\n return unless show_breadcrumbs?\n\n content_for(\n :breadcrumbs,\n content_tag(:ol, class: \"breadcrumb\") do\n concat(content_tag(:li, link_to(\"Home\", root_path)))\n\n ...
[ { "docid": "4957243488e95331af0b69b83c34c0d3", "score": "0.77085876", "text": "def breadcrumbs; end", "title": "" }, { "docid": "4957243488e95331af0b69b83c34c0d3", "score": "0.77085876", "text": "def breadcrumbs; end", "title": "" }, { "docid": "4957243488e95331af0b69b83c...
6e078ba50b02e8c52cecbebb52ec8ebb
Returns Hash list of all files found
[ { "docid": "a6d0af9e69ba46b45ab2450ba0e2ce26", "score": "0.0", "text": "def to_hash\n return @file_table\n end", "title": "" } ]
[ { "docid": "635575457bc0a5ce5da719ec5cc1722a", "score": "0.80201596", "text": "def listFileHashes\n return contentHost.listFileHashes(baseDir)\n end", "title": "" }, { "docid": "b29b19d9fa6b5f124c078533e3375016", "score": "0.7622003", "text": "def all_files\n @files_hash.v...
86a6488daae1a29a8ff6b3868cb19b1e
VIVO degree abbreviations are not unique, so the degree label is required to disambiguate these abbreviations. Find all VIVO abbreviations that match more than one label
[ { "docid": "d8cdb2a9e8c16172f4d3f220123b8424", "score": "0.7040858", "text": "def vivo_degree_abbreviation_ambiguous\n @vivo_degree_abbreviation_ambiguous ||= begin\n h = {}\n vivo_degree_abbreviations.keys.each do |a|\n # select all labels that use this abbreviation\...
[ { "docid": "6a78702d1f709483f2c42c039ac45fd7", "score": "0.61598814", "text": "def degree_acronyms(degree)\n # Cleanup the degree\n degree = degree.strip.gsub(/['\"]/,'')\n # Find all the capital letters\n degree_caps = capitals(degree)\n abbrevs = []\n\n # TODO...
cae28626681bca97e1f5a6c737750104
POST /statuses POST /statuses.json
[ { "docid": "b065d7c996115bd87f3c812692d9e36b", "score": "0.0", "text": "def create\n @status = Status.new(status_params)\n\n if @status.save\n render json: @status\n else\n render json: @status.errors, status: :unprocessable_entity\n end\n end", "title": "" } ]
[ { "docid": "c28ad5d86fbc4bc993a73f1765d4708e", "score": "0.6963445", "text": "def update_status(status)\n post \"statuses/update\", :post => {:status => status}\n end", "title": "" }, { "docid": "7245d9188c2e1f0ad6cd86fe4a52211b", "score": "0.6957925", "text": "def postTweet(stat...
594a7e405fddaea81ec2e96bf542d6cb
Returns the array of ContactIDs. If the contact_ids array has been assigned, will return that array. Otherwise, returns any loaded ContactIDs
[ { "docid": "33b31775d68d084a543f02c909352871", "score": "0.8694998", "text": "def contact_ids\n if defined?(@contact_ids)\n @contact_ids\n else\n contacts.map(&:contact_id)\n end\n end", "title": "" } ]
[ { "docid": "55d3507f58b5e037b879135252329617", "score": "0.79797715", "text": "def load_contact_ids\n @contact_ids ||= begin\n contact_id_sql = end_of_association_chain.scoped.ok_to_email.select('contacts.id').to_sql\n Contact.connection.send(:select_values, contact_id_sql, 'Contact ID Load...
235b8c2fa4dde2c79a6781e2c062953c
This yields the midpoints of the four sides of the box.
[ { "docid": "8d364b73e3f3cc2aa8d53bf206bc85d9", "score": "0.7861313", "text": "def midpoints\n\t\t\treturn to_enum(:midpoints) unless block_given?\n\t\t\t\n\t\t\tsize = self.size\n\t\t\t\n\t\t\tyield(Vector[@origin[0] + size[0] / 2, @origin[1]])\n\t\t\tyield(Vector[@origin[0] + size[0], @origin[1] + size...
[ { "docid": "7d73953e5a74137c22b1bc7103861be1", "score": "0.6188817", "text": "def mid_point\n (furthrest_left+furthrest_right)/2\nend", "title": "" }, { "docid": "ccfb38efad4f8d2e37b86a89243df40a", "score": "0.61230886", "text": "def sides\n if @sides.nil? then\n @sides...
72ec82f36c89054ccc3c27d75a674a5c
Gets a signal by +path+. NOTE: +path+ can also be a single name or a reference object. def get_signal(path) path = path.path_each if path.respond_to?(:path_each) Ref case. if path.respond_to?(:each) then Path is iterable: look for the first name. path = path.each name = path.each.next Maybe it is a system instance. sys...
[ { "docid": "f633a6e6af4bf8efb13be6821dbba53a", "score": "0.6193215", "text": "def get_signal(name)\n return @inners[name]\n end", "title": "" } ]
[ { "docid": "6bfe90f70546419b6a5c5fc8c7b1623a", "score": "0.70361686", "text": "def get_signal(name)\n return get_input(name) || get_output(name) || get_inout(name) # ||\n # get_inner(name)\n end", "title": "" }, { "docid": "fda660d20409a1878af5b64232d02e2e...
ea33a45f5d4f7037122d0cff5f05cbf5
//Gets list of activities based on category/user filter GET /activities/get_activities Params: user_id, category_id //filter on category or user ID if relevant Returns: activities[activity]
[ { "docid": "1c4de6e4b7eaa6dc1aa1b3bf44315fa6", "score": "0.7406293", "text": "def get_activities\n\t\tviewer = nil\n\t\tviewer = User.find_by_id(params[:user_id]) if (params.has_key?(:user_id))\n\t\t\n @activities = Activity.getActivitiesBy2(params[:category_id], params[:user_id])\n\t\t(0...@acti...
[ { "docid": "55c690f22aa866dfe205c540a59c2d9d", "score": "0.7132211", "text": "def index(user)\n activities = []\n json = eval(RestClient.get(ENDPOINT + \"/activities?user_id=#{user}\").to_s)\n json.each do |attributes|\n activities << Activity.new(attributes)\n end\n acti...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "f7674a8c41e1d6b6f3dba905024b4e6d", "score": "0.0", "text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @failure_count = args[:failure_count] if args.key?(:failure_count)\n @notification_pubsub_topic = args[:notification_pub...
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
93a23a8a9b308e1767541f60b2265835
Gets the memberOf property value. Groups and administrative units that this device is a member of. Readonly. Nullable. Supports $expand.
[ { "docid": "d6cc4fbcdd4a1d010bf667ac6c19bcbb", "score": "0.69137084", "text": "def member_of\n return @member_of\n end", "title": "" } ]
[ { "docid": "d34bcb82fa72863e573a92d8573de46c", "score": "0.6170529", "text": "def member_of()\n return MicrosoftGraph::Groups::Item::MemberOf::MemberOfRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "195e06f6233e86967...
e6c4f4aaa7cc1e02bb4026184cb2d6bf
Accesses origin.y + size.height.
[ { "docid": "b24dd39824b231e6d4a245f93314cf1f", "score": "0.6667305", "text": "def bottom\n y + height\n end", "title": "" } ]
[ { "docid": "e61abdce16cec5be8a20000e896da546", "score": "0.7104046", "text": "def y\n origin.y\n end", "title": "" }, { "docid": "85a1534a1e0012512c225382e654b92f", "score": "0.7000216", "text": "def get_y\r\n return @y + @sprite[0].height/2\r\n end", "title...
d84fbf0f5b03c4d9df9f3ee042ef197f
Satisfied when all sub expressions match +o+
[ { "docid": "c7b0e5f2f644c43b8158468106a540c2", "score": "0.6003608", "text": "def satisfy?(o, data={})\n return nil unless options.all?{|exp| exp.is_a?(Sexp) ? exp.satisfy?(o, data) : exp == o}\n \n capture_match o, data\n end", "title": "" } ]
[ { "docid": "fc3dc96abc094147e640893bbb5ec0bf", "score": "0.6282229", "text": "def satisfy?(o, data={})\n return false unless o.is_a? Sexp\n return false unless length == o.length || (last.is_a?(Sexp) && last.greedy?)\n \n each_with_index do |child,i|\n if child.is_a?(Sexp)\n cand...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3a6126f486d8c5750cece624f3b55586", "score": "0.0", "text": "def team_goal_params\n params.require(:team_goal).permit(:team_id, :start_date, :end_date, :distance, :duration, :activity, :title)\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...
21acc47da7a1b8da2c5b4cea45eb3449
create human readable string of date
[ { "docid": "5cfaab81c0901bde33e39a27f7eaefff", "score": "0.72341514", "text": "def to_s \n s = \"\"\n s += @day.to_s + \" \" + NAMES[@month - 1] + \" \" + @year.to_s\n end", "title": "" } ]
[ { "docid": "1a873f09db8c1a10cb572cd275b41e7d", "score": "0.79156435", "text": "def humanize\n @date.strftime(\"%A, %B %d\")\n end", "title": "" }, { "docid": "8e874ca816fa75739a7e414447713330", "score": "0.7833136", "text": "def formated_date(date)\n return \"\" if date.ni...
29504ac38668b6f988c476c32c3c9c7d
Converts the version into a constraint string recognizable by RubyGems. TODO: Better name Constraintto_s2. ++
[ { "docid": "ef248a1b12b5a8f883df7117843d1768", "score": "0.54828393", "text": "def to_gem_version\n op = (operator == '=~' ? '~>' : operator)\n \"%s %s\" % [op, number]\n end", "title": "" } ]
[ { "docid": "a0c2059bc37dc08e6911d000d49a6988", "score": "0.72015077", "text": "def with_version_constraints_strings\n map do |recipe_name|\n if @versions[recipe_name]\n \"#{recipe_name}@#{@versions[recipe_name]}\"\n else\n recipe_name\n end\n ...
e21f269d5f57eee71bff0234062736cc
GET /payment_forms/new GET /payment_forms/new.xml
[ { "docid": "7af3e077b14139c898962f536ca22662", "score": "0.78404987", "text": "def new\n @payment_form = PaymentForm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @payment_form }\n end\n end", "title": "" } ]
[ { "docid": "b0bc0f0ccd4879800e5737d085db9d74", "score": "0.7442792", "text": "def new\n @payment = Payment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @payment }\n end\n end", "title": "" }, { "docid": "4140823079bf4480b6d8a0...
4b4040eace0aa012a04c56ada5dedc63
July 4/5, 2013 Tealeaf course 1 Expanded English Number from Chris Pine's 'How to Program,' ch. 10 Finally got it! Yeah!!
[ { "docid": "b59f760664da1bd0e3d052133d0198cd", "score": "0.69761294", "text": "def english_number number\n if number < 0 # No negative numbers.\n return 'Please enter a number that isn\\'t negative.'\n end\n\n if number == 0\n return 'zero'\n end\n\n # No more special cases! No more returns!\...
[ { "docid": "998ff2c77724b6a8f21f15d7ee58cb14", "score": "0.7298728", "text": "def english_number number\n\n num_string = '' # This is the string we will return.\n ones_place = ['one', 'two', 'three', 'four', 'five',\n 'six', 'seven', 'eight', 'nine']\n ...
d8d3430b0c8dfe58c56f70e82ba249bd
Returns the hour as an integer.
[ { "docid": "193a39a0b5a50d5da4e69712cb012c31", "score": "0.7788181", "text": "def hour\n return @t_hour\n end", "title": "" } ]
[ { "docid": "8c742b3fafb1042dc8fdbee1a09a87bd", "score": "0.81606686", "text": "def to_i\n hour * 60 + minute\n end", "title": "" }, { "docid": "e500bfea3f2a2ac27bfc831a4a3d0e3d", "score": "0.79816437", "text": "def hour\n # seconds_since_start_of_day / H_SECS\n ...
cd73e016017d22b61941b29f664433f0
use Rack::Session::Redis must be used after Rack::Session::Cookie use Rack::Protection, except: :http_origin convenience methods
[ { "docid": "c1ddd58464347382305969a5279396a3", "score": "0.0", "text": "def user\n env['warden'].user\n end", "title": "" } ]
[ { "docid": "b7b3aa3ff725ff9a6dacef0ff0a9e6a5", "score": "0.6897358", "text": "def rack_session; end", "title": "" }, { "docid": "cf55ec3ac26303e596e5ccf2638d34a5", "score": "0.6493437", "text": "def rack_session=(_); end", "title": "" }, { "docid": "1e73fb3378faa12609ca40...
b927db89edb1d535498a72ea5ee515fe
analyzing data of class object, performing a calculation based on that data
[ { "docid": "a102cc20b0c0453e6b26b416540e708c", "score": "0.0", "text": "def speed_of_spread #in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n if @population_density >= 200\n speed = 0.5\...
[ { "docid": "49a80f9ea814d026c0642158d161b09b", "score": "0.6156073", "text": "def calculate_fitness\r\n positive = 0\r\n negative = 0\r\n @@data.instances.each do |instance|\r\n # Calculate output\r\n classification = classify(instance) < 0 ? @@class_attribute.values[0] : @@class_attr...
0ebec3a796b22ad352b98a6c2259d82e
Launch School Solution 1
[ { "docid": "4878099704bf0a1d21a861e91f341d4c", "score": "0.0", "text": "def zipper(array1, array2)\n result = []\n array1.each_with_index do |element, index|\n result << [element, array2[index]]\n end\n result\nend", "title": "" } ]
[ { "docid": "613a8e040a7596af8348364440cde65c", "score": "0.64434886", "text": "def launch\n end", "title": "" }, { "docid": "f79d059914471adf23ea254eb6d3e21d", "score": "0.60546553", "text": "def launch!\n run!\n end", "title": "" }, { "docid": "e0123370b26cfa773...
b58fc5c4268c8c68d89b06f703b0ece2
Private: The directory used for storing the manifest Returns a Fog::Storage::AWS::Directory object
[ { "docid": "50f307527fbd282c5b9c5d3c4285a58b", "score": "0.84539825", "text": "def directory\n return @directory if @directory\n\n unless @directory = Manifesto.storage.directories.get(Manifesto.bucket)\n @directory = Manifesto.storage.directories.create(:key => Manifesto.bucket)\n sleep...
[ { "docid": "87537a557c20db9dd1ec0849d8b378a3", "score": "0.71500534", "text": "def directory\n return _meta_data['directory'] if _meta_data.has_key? 'directory'\n dir\n end", "title": "" }, { "docid": "d568ee2a7b88315e01f8d98e04f48a1d", "score": "0.67951113", "text": "def stor...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "6fb17e5de45cbfb27bd4ebfe30919f3b", "score": "0.0", "text": "def new_input_set()\n return ShowGroupInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.6741255", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.65807736", "text": "def new_input_set()\n return Ru...
2dc449ce514a38f311aa50165143a4a0
UNIT TESTS FOR METHOD get_starting_location(x) Equivalence classes: x>= 0.75 > returns 1 x>= 0.5 && returns 2 x>= 0.25 && returns 3 x returns 4 If x >= 0.75, will return 1
[ { "docid": "722515f69559c8a0202f784d2ab291ed", "score": "0.73475426", "text": "def test_1_starting_location\n driver_simulation = DriverSimulation::new\n assert_equal 1, driver_simulation.get_starting_location(0.75)\n end", "title": "" } ]
[ { "docid": "510f99112480e4ed5c33119c822e10ce", "score": "0.7255666", "text": "def test_4_starting_location\n driver_simulation = DriverSimulation::new\n assert_equal 4, driver_simulation.get_starting_location(0.05)\n end", "title": "" }, { "docid": "8d61f0bc17ec51a4d70f4e7c1e2b9dbb", ...
6d5987f9a359487f012fe305bba9557b
Figure out if the substitution is required, or merely suggested: Watch (a movie) vs Watch [this movie]
[ { "docid": "4ef01e0ee94c16880c8d8e3c49d97b49", "score": "0.54731953", "text": "def setup_substitution_type\n return unless self.do_name\n if self.do_name.match(/\\((.*)?\\)/)\n return :allowed\n elsif self.do_name.match(/\\[(.*)?\\]/)\n return :required\n end\n end", "title": ...
[ { "docid": "2dd42f66f14615d5941664cb94a64e00", "score": "0.58886", "text": "def present_participle\n plural = self.to_s.en.plural_verb\n\n\t\tplural.sub!( /ie$/, 'y' ) or\n\t\t\tplural.sub!( /ue$/, 'u' ) or\n\t\t\tplural.sub!( /([auy])e$/, '$1' ) or\n\t\t\tplural.sub!( /i$/, '' ) or\n\t\t\tplural...
9f0a39e05f4c93ed799d5a4598c3a0c4
Get the element with the highest priority and remove it from the queue. The highest priority is determined by the block given at instantiation time. The deletion time is O(log n), with n is the size of the queue. Return nil if the queue is empty.
[ { "docid": "21a6b34ed0fab86ca39774d4392f3038", "score": "0.5880068", "text": "def pop\n return nil if empty?\n @que.pop\n end", "title": "" } ]
[ { "docid": "dbe2ce6b24f41e1c15a5fcf608622056", "score": "0.70474225", "text": "def dequeue\n @mutex.synchronize do\n # Check if the queue is empty.\n if @head == @tail # not using empty? to avoid extra synchronize block\n return nil\n end\n\n # Remove next object.\n ob...
5a6d1b311007d3f2b761c79e74c17b5b
replaces this Scope in the "parent" chain with a copy, empties current scope, and returns. Essentially an inplace push operation
[ { "docid": "a5c1abbf273e8096f3368fe4efc48df6", "score": "0.68262714", "text": "def push!\n @depth += 1\n replacement = dup\n replacement.parent = @parent\n replacement.renames = @renames\n @renames = {}\n @parent = replacement\n clear\n end", "title": "" } ]
[ { "docid": "a5bea21825e08222fa210dbf6cd2db61", "score": "0.649322", "text": "def push(new_scope={})\n raise StackLevelError, \"Nesting too deep\" if @scopes.length > 100\n @scopes.unshift(new_scope)\n end", "title": "" }, { "docid": "f772671516437257e05971b316dd07fc", "score...
79c19f33d6f891e8b3675007e9acb7e1
Retrieves a NETWORK resource request:: _Hash_ hash containing the data of the request [return] _String_,_Integer_ NETWORK occi representation or error, status code
[ { "docid": "fa1a5686b4c6c458018ad9cd382f1486", "score": "0.589049", "text": "def get_network(request, params)\n network = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml(params[:id]),\n @client)\n\n # --- Prepare XML Response ---\n rc...
[ { "docid": "970fbd57a03338f7f7206ce4694820ce", "score": "0.571246", "text": "def net_http_res; end", "title": "" }, { "docid": "5c7a31a3a3f8074ebc20c1f7111c85b8", "score": "0.57034516", "text": "def get url\n net_http_response = self.connection.get url\n [net_http_response.body...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ac8b5984f8c841032f2b6c6846e312df", "score": "0.0", "text": "def set_training\n @training = Training.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;...
2af8dfed34129cb60749ceabeda47763
Indicate whether this is a despined item.
[ { "docid": "517dd29e4da3be51abb12540d6f7ea6e", "score": "0.0", "text": "def despined?(barcode)\n values(:despined_barcodes_a).include?(barcode)\n end", "title": "" } ]
[ { "docid": "1fae8fbd44c2cc596466fd2404f44c7c", "score": "0.7209229", "text": "def item?\n @item_id != 0\n end", "title": "" }, { "docid": "33a7b558532a97be56a147fdfa03d83f", "score": "0.6877738", "text": "def is_a_item?\r\n return ITEM_USING.include?(@kind) && (@item_id !=...
3a1f2d9c51501949c72f1a9719c48f0c
lexer rule tokens! (TOKENS) (in ANTLRv3Grammar.g)
[ { "docid": "796a26b8f0c38b1e8666c57a2abbb65a", "score": "0.8384884", "text": "def tokens!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 59 )\n\n type = TOKENS\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - -...
[ { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.66926146", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.66926146", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", ...
c3871d5222723b5d7f73ef24ab11e035
Add more helper methods to be used by all tests here...
[ { "docid": "eaa49b87cb91d109990967389934a332", "score": "0.0", "text": "def generate_tweet_that_mentions_only_tweechable(text, bot_name, bot_id)\n Twitter::Tweet.new({id: 1,\n favorite_count: 0,\n lang: \"en\",\n retweet_count: 0,\n ...
[ { "docid": "e708ad90e8ce43e3a3a3a99c57b26047", "score": "0.7330966", "text": "def test_legacy_helpers\n assert_equal @patron.primary_phone, @patron.primary_address_phone\n assert_equal @patron.secondary_phone, @patron.secondary_address_phone\n assert_nil @patron.primary_address_mobile_phone\n ...
73a88107ca1bfa63f749b3c8f27c5653
GET /recommend/recommend_events GET /recommend/recommend_events.json
[ { "docid": "4902e227ad0e02fc8c8d8619d2dfecbf", "score": "0.63194567", "text": "def index\n @recommend_recommend_events = Recommend::RecommendEvent.paginate(:page => params[:page])\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), recommend_reco...
[ { "docid": "22c983fd7c1563490ce95411ce1e9ab9", "score": "0.7053215", "text": "def get_recommended_events( params )\n LastFM.requires_authentication\n LastFM.get( \"user.getRecommendedEvents\", params, :secure )\n end", "title": "" }, { "docid": "d6540eeb01a0a2c5a67c244e476...
046b02cae29b302eefc6412440e94e1f
DELETE /appointments/1 DELETE /appointments/1.json
[ { "docid": "bfc239026fb9ab1ce44eb0590f7968d0", "score": "0.0", "text": "def destroy\n @appointment.destroy\n respond_to do |format|\n format.html {redirect_to protocol_url, notice: 'Consulta apagada com sucesso'}\n format.js {flash.now[:notice] = 'Consulta apagada com sucesso'}\n fo...
[ { "docid": "bf8c21831c69d832d807c39d5bf67394", "score": "0.8034218", "text": "def delete_appointment\n\t\tid = grab_id(\"delete\")\n\t\taddress = @url + \"/\" + id\n\t\tresponse = HTTParty.delete(address)\n\t\tresponse.body\n\tend", "title": "" }, { "docid": "761cfe19688ad8e3010fa2e15ee3cba...
dd92110a3f033f82e7cb54a4ee92c458
GET /examenes/new GET /examenes/new.xml
[ { "docid": "44dc8bacc77a899ab785708f998d0ce0", "score": "0.0", "text": "def new\n @examen = Examen.new\n @examen.usuario_id=params[:usuario_id]\n \n respond_to do |format|\n format.html # new.html.erb\n format.js { render :layout => false}\n format.xml { render :xml => @exame...
[ { "docid": "150a0423ae33848061a654eb8bb12e72", "score": "0.7625314", "text": "def new\n @exam = Exam.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @exam }\n end\n end", "title": "" }, { "docid": "150a0423ae33848061a654eb8bb12e7...
56f9c9f8d3287567dba1a0dc05f4f64d
GET /inmate_counts/new GET /inmate_counts/new.json
[ { "docid": "1face6d9ab42946e615778609102d4b1", "score": "0.8127851", "text": "def new\n @inmate_count = InmateCount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inmate_count }\n end\n end", "title": "" } ]
[ { "docid": "9c3ee76c27ad6acc277023941e39f705", "score": "0.77200556", "text": "def create\n @inmate_count = InmateCount.new(params[:inmate_count])\n\n respond_to do |format|\n if @inmate_count.save\n format.html { redirect_to @inmate_count, notice: 'Inmate count was successfully create...
75f737cb04afa266a16fd69cced68a86
def to_s title end
[ { "docid": "c95b02b333114c6df52501a06b92135d", "score": "0.0", "text": "def tag_list\n # tags.collect {|t| t.name}.join(\", \")\n tags.join(\", \")\n end", "title": "" } ]
[ { "docid": "b0dbfebf96e1040d3a68523e1804c198", "score": "0.95746464", "text": "def to_s; title; end", "title": "" }, { "docid": "b9689eae3abf65c821b4e71f80bda0ea", "score": "0.93466616", "text": "def to_s\n title\n end", "title": "" }, { "docid": "b9689eae3abf65c8...
aa3f56863ab784234564f51172ea4740
calculate the height of each row by default, it will be the height option minus the day names height, divided by the total number of calendar rows this gets tricky, however, if there are too many event rows to fit into the row's height then we need to add additional height
[ { "docid": "2aeb76f67ad3faed74a37b9f6c14d9c7", "score": "0.8777691", "text": "def row_heights\n # number of rows is the number of days in the event strips divided by 7\n num_cal_rows = options[:event_strips].first.size / 7\n # the row will be at least this big\n min_height = ...
[ { "docid": "d94380532da12660f35e67686e30b717", "score": "0.850026", "text": "def cal_row_heights(options)\n # number of rows is the number of days in the event strips divided by 7\n num_cal_rows = options[:event_strips].first.size / 7\n # the row will be at least this big\n min_heigh...
740bc2942493d40756df0f3f61b4c1eb
POST /reviewreasons POST /reviewreasons.json
[ { "docid": "697d20b508d4cc89ddc959a0b001797e", "score": "0.697466", "text": "def create\n @reviewreason = Reviewreason.new(params[:reviewreason])\n\n respond_to do |format|\n if @reviewreason.save\n format.html { redirect_to @reviewreason, notice: 'Reviewreason was successfully created...
[ { "docid": "fd6cc3969e8dcec555035cb90d865b2e", "score": "0.6468601", "text": "def create\n @reason = @review_stage.reasons.build(params[:reason])\n\n respond_to do |format|\n if @reason.save\n flash[:notice] = 'Reason was successfully created.'\n format.html { redirect_to([@user...
abefb6219f634ea001874038f3be1a33
ARCHIVE OF .GZ FILES
[ { "docid": "4413825e935bda333c5e8f04c6d96003", "score": "0.0", "text": "def look_through_archive(directory, file_basename = \"*\", compression = \"gz\")\n counter = 0\n files = Dir.glob(\"/#{directory}/#{file_basename}.*.#{compression}\")\n files = sort_archive(files)\n\n files.each ...
[ { "docid": "fc012c943772bc2038f77920654a3fde", "score": "0.7323139", "text": "def archive\n io = tar(@dir)\n gz = gzip(io)\n File.open(\"/opt/app/log/demo.tar.gz\", \"wb\") {|f| f << gz}\n end", "title": "" }, { "docid": "dd2fca4e4abe989c59c2740859b75b5d", "score": "0.7282709",...
cc7367035ed53bb84e0ed63ccd2ab429
All the `Goal` records available to this user
[ { "docid": "9ef55840f5b58d279145eaecd8a8a200", "score": "0.77904755", "text": "def goals\n Management::Goal.all(self)\n end", "title": "" } ]
[ { "docid": "aeeb7e09d3c82907cad6895ca9d9f3d0", "score": "0.7767468", "text": "def index\n @user_goals = UserGoal.all\n end", "title": "" }, { "docid": "d52f92da8308864b79e4672c113c0a8f", "score": "0.7517111", "text": "def index\n @goals = current_user.goals.all\n end", "t...
3effe9061dc1c24d07da24178a95a009
Sets the audioDeviceName property value. Specifies the name of the audio device in the room.
[ { "docid": "e612a7bd3a020bf43eae8a4b996674ee", "score": "0.7755652", "text": "def audio_device_name=(value)\n @audio_device_name = value\n end", "title": "" } ]
[ { "docid": "769a19040cbaf2ef02efc1ee83ec95d2", "score": "0.6528667", "text": "def device_name=(value)\n @device_name = value\n end", "title": "" }, { "docid": "769a19040cbaf2ef02efc1ee83ec95d2", "score": "0.6528667", "text": "def device_name=(value)\n ...
098a6d44e2c5d2cd0dc3ac9060426875
PATCH/PUT /fund_cashes/1 PATCH/PUT /fund_cashes/1.json
[ { "docid": "e74be4b9dec96e397bab867823144321", "score": "0.6195783", "text": "def update\n respond_to do |format|\n if @fund_cash.update(fund_cash_params)\n format.html { redirect_to @fund_cash, notice: 'Fund cash was successfully updated.' }\n format.json { render :show, status: :...
[ { "docid": "27183fedf3772af7655f96b5f186fc38", "score": "0.69068176", "text": "def update\n @cash = current_company.cashes.find(params[:id])\n respond_to do |format|\n if @cash.update(cash_params)\n format.html { redirect_to @cash, notice: 'Cash was successfully updated.' }\n fo...
d34e76afe484550df92f126baed06e12
search through the directory for a file with the same base, and if it exists, set our part to be the max + 1 so we don't clobber existing files.
[ { "docid": "c50ad55b58f9c4cd92afab04bb3ef00b", "score": "0.6115764", "text": "def starting_part\n return 0 unless ::File.directory? @directory\n\n base_path = ::File.join(@directory, next_base)\n\n part_numbers = Dir.glob(base_path + '.part*').map do |item|\n match ...
[ { "docid": "1b1c1f7bccdefbc3680e435e2339063e", "score": "0.59248185", "text": "def next_file_name(dir)\n n = @last_file\n n = sorted_mail_entries(dir).last.to_i unless n\n begin\n n += 1\n end while File.exist?(\"#{dir}/#{n}\")\n @last_file = n\n \"#{@dirname}/#{n}\"...
20f7c5a9a66b9e247ee3d76aa343f4f1
we start off successful SUBROUTINES Load the nodes to be expected
[ { "docid": "bcfa171b7b76476ec61699a29430d7d8", "score": "0.0", "text": "def load_node_names(server_listing_file)\n retvals = Array.new\n File.open(server_listing_file, \"r\") do |f|\n f.each_line do |line|\n line.chop!\n line =~ /^node (\\w+\\.js) /\n if ($1)\n retvals.push($1...
[ { "docid": "7170c98d4259e3e8d61ec7f2fd483b27", "score": "0.6996561", "text": "def load_nodes; end", "title": "" }, { "docid": "7170c98d4259e3e8d61ec7f2fd483b27", "score": "0.699612", "text": "def load_nodes; end", "title": "" }, { "docid": "fb7bf9cc49134026feaa50382eb9eea...
f9856c731ef6a5ca743f6a8fcf2204bc
average of an array of numbers
[ { "docid": "1380f9190a9fbeff519401d721399b78", "score": "0.0", "text": "def average\n\t\treturn self.suma/self.length.to_f\n\tend", "title": "" } ]
[ { "docid": "6361c3ca1fe6d4a37cacc86a9bd7082e", "score": "0.87429214", "text": "def array_average(arr)\n return arr.reduce(:+).to_f / arr.size\n end", "title": "" }, { "docid": "b981aa40631efec459101ee6b9dda931", "score": "0.8571074", "text": "def average\n @array.map(&...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "137e5d7f657db005a4353b02bf1ef128", "score": "0.0", "text": "def set_blog_suggestion\n @blog_suggestion = BlogSuggestion.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;...
b16a79ee35296e398ca76d47b4f17f90
POST /invoices POST /invoices.xml
[ { "docid": "8e9183cadef6d9788df38434b1759240", "score": "0.61965364", "text": "def create\n self.invoice_var = invoice_model.new(invoice_params)\n\n respond_to do |format|\n if invoice_var.save\n format.html { redirect_to(invoice_var, :notice => \"#{invoice.to_s.humanize.capitalize} cr...
[ { "docid": "8eace452ebdf95cec8f8a2225b2e1bf2", "score": "0.7038786", "text": "def test_post_invoices_xml \n Redmine::ApiTest::Base.should_allow_api_authentication(:post,\n '/invoices.xml',\n {:invoice => {:project_id => 1, :number ...
f260b0743e3635ff851ba1fb8f391b00
GET /users/1 GET /users/1.json
[ { "docid": "a2250472e6113849e0f4f64d07efe4f1", "score": "0.0", "text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user }\n end\n end", "title": "" } ]
[ { "docid": "4152fb6556ae83f7cdd6c362f17ad9bf", "score": "0.81046426", "text": "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n ...
1a6ff2f63fb7af8d6b0243423b324c69
=begin Given a list of two values, return them as a string representation of a fraction. For example, [3, 10] would be "3 / 10" =end
[ { "docid": "396541e662d4be50d5c2547146ab20f7", "score": "0.7821901", "text": "def to_s_fraction(values)\n return \"#{values[1] - values[0]} / #{values[1]}\"\n end", "title": "" } ]
[ { "docid": "595c522355eb28f45489adfe128d1397", "score": "0.68729717", "text": "def get_fraction(fraction)\n fraction.split('/').map(&:to_i)\nend", "title": "" }, { "docid": "eaaa30d745327666c4e07112c2bc9ddf", "score": "0.6783815", "text": "def evaluate_fractions(text)\n text.gs...
24775265b3722780852c8b167e323423
before_action :verify_logged_in, only: [:new, :create, :edit, :update, :destroy]
[ { "docid": "2890c5e7f4c2f157d2f62ee5397a410f", "score": "0.0", "text": "def index\n @reviews = Review.all\n end", "title": "" } ]
[ { "docid": "2fd8508be4a135c97e3b71cc083d867d", "score": "0.7384427", "text": "def logged_in\r\n end", "title": "" }, { "docid": "44a2c582e68ff1e2adf5ff5aace4b664", "score": "0.7321002", "text": "def new\n #user wants to log in \n end", "title": "" }, { "docid": "44a2...
1558a7c8b0c1df1dfc1e4422094d2642
Returns the command that +save_as+ would execute as a string
[ { "docid": "9edf34b6f74e1480d617699d9161b19e", "score": "0.596064", "text": "def fake_save_as(output_filename)\r\n \"convert #{@filename} #{@actions.join(' ')} #{output_filename}\"\r\n end", "title": "" } ]
[ { "docid": "58eab40839b136d84e98f93602c3aa36", "score": "0.69769204", "text": "def to_s\n cmd\n end", "title": "" }, { "docid": "93b5c791ae5b3e2ba7c36c215bf20f6e", "score": "0.6848488", "text": "def to_s \n @cmd\n end", "title": "" }, { "docid": "e53afe1b0ef04...
719b1d20e27177f25cceff03055b0690
Reads data from socket.
[ { "docid": "996c6b5e1dafedaca190728898e6271e", "score": "0.0", "text": "def read(len)\r\n buf = \"\\0\" * len\r\n Win32API.new(\"msvcrt\", \"_read\", \"lpl\", \"l\").call(@fd, buf, len)\r\n buf\r\n end", "title": "" } ]
[ { "docid": "37d001f348788304d5472e971d5045e0", "score": "0.8058544", "text": "def read\n @socket.gets\n end", "title": "" }, { "docid": "f7854920ac687a5f9b5675a5e2539d90", "score": "0.80086744", "text": "def read()\n data = @sock.recv(8192)\n return data\n en...
dadd87224cd6f0d75bbb82a6cdc2b85b
DELETE /tdwg_gazetteers/1 DELETE /tdwg_gazetteers/1.json
[ { "docid": "d1303638e501da622381913253f288fe", "score": "0.7838081", "text": "def destroy\n @tdwg_gazetteer.destroy\n respond_to do |format|\n format.html { redirect_to tdwg_gazetteers_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "2e2020f67134e5ebbefc8702b27e9e6c", "score": "0.6816071", "text": "def destroy\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n @gethotelstaticdatagd.destroy\n\n respond_to do |format|\n format.html { redirect_to gethotelstaticdatagds_url }\n format.json {...
44bd681a404813d86bc7f7d59a23961c
Returns `true` if this query did not match when last executed. When the solution sequence is empty, this method can be used to determine whether the query failed to match or not.
[ { "docid": "af7103576941efc31f29c44d2a3ef3e3", "score": "0.65661204", "text": "def failed?\n solutions.empty?\n end", "title": "" } ]
[ { "docid": "a8426f151ef4fad9a61942e6f754d0a4", "score": "0.631321", "text": "def solved?\n @solution != nil\n end", "title": "" }, { "docid": "6363c017f572b4dd97284a5f2542719a", "score": "0.6274165", "text": "def is_query?\n if @qr.to_i.eql? (0)\n ...
8f75ed4c903bec581dfd1848f8061a2e
TODO: FIX tRNS chunk behavior for nonindexed images (saving is fine, reading is not)
[ { "docid": "7ed28f611ab505f360e65312c4ed9184", "score": "0.56931096", "text": "def test_add_transparency_chunk\n img = Imgrb::Image.new(41,41,0)\n transparency_chunk = Imgrb::Chunks::ChunktRNS.assemble(0,:indexed)\n img.add_chunk(transparency_chunk)\n\n png_str = save_png_to_string(img, 1)\n...
[ { "docid": "98a0957ced4bbb3010d62fd1c54a85e9", "score": "0.6585529", "text": "def save chunk_nr, io\n\t\t\t# retrieve data from io and compare sig \n\t\tend", "title": "" }, { "docid": "82cc32025ce552538fe0ddc407169342", "score": "0.616397", "text": "def test_hist_chunk\n\n each_f...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "38f8f8e027a0192af48b157f09c65e78", "score": "0.0", "text": "def set_item\n @item = Item.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;...
17ade8d714caf3f79087253afbc1455c
The total number of negative ballots cast for this Votable in the provided +scope+. If +scope+ is not provided, reports for the _default_ scope. If the Votable has a +cached_ballot_summary+ column and +skip_cache+ is +false+, returns the cached total.
[ { "docid": "7dd7e7c04ebb023b911c95eec1ad59a8", "score": "0.70778674", "text": "def total_down_ballots(scope = nil, skip_cache: false)\n if !skip_cache && caching_ballot_summary?\n scoped_cache_summary(scope)['down'].to_i\n else\n down_ballots_for(scope: scope).count\n end\n ...
[ { "docid": "b460e5ae1713287f0b662d0bfea0b0e2", "score": "0.7882446", "text": "def total_ballots(scope = nil, skip_cache: false)\n if !skip_cache && caching_ballot_summary?\n scoped_cache_summary(scope)['total'].to_i\n else\n find_ballots_for(scope: scope).count\n end\n en...
9499f5fafa4aaeb89f9eb03d54e95baa
Returns the list of profiles which should be included on a node based on the role associated with the passed certname and any other configuration factors which may impact profiles for that node. External database and external ca configurations can cause database and certificate_authority profiles to be dropped from mon...
[ { "docid": "dca97b3e9b70cde3f949acdffc1ab6d8", "score": "0.7391607", "text": "def get_node_profiles(certname)\n role = get_role_for(certname)\n profiles = get_role_profiles(role)\n\n if (default_roles).include?(role)\n profiles.reject! do |r|\n case r\n...
[ { "docid": "b3a12f640e6c5a6de953b86bdca0be5e", "score": "0.58404285", "text": "def collect_current_node(certname, role, node)\n properties = {\n 'certname' => certname,\n 'order' => output_order(role),\n 'resources' => node['resources'],\n 'role' => r...
c874a59a91dc9839b95df1edb8c1ef12
List NetworkAdapters for Source Returns an array of NetworkAdapter objects
[ { "docid": "2f5c58a825f72fa12c8956d95a15235a", "score": "0.55324775", "text": "def list_source_network_adapters_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.list_source_network_adapters ...'\n end\n # ver...
[ { "docid": "e5f053f77c60fe85fdb16070516c9078", "score": "0.6886372", "text": "def parse_network_adapters\n # netsh interface ipv4 show interfaces\n # Get-NetAdapter | Sort-Object ifIndex | select ifIndex, Name\n script_code = 'Get-WMIObject Win32_NetworkAdapter | Sort-Object InterfaceInde...
41a069d094e7bbb1b24e2f1cb700b08e
Check for official validator
[ { "docid": "9b84ba5292bd54f19231d21167482661", "score": "0.63401496", "text": "def validator?; system('which question-validator > /dev/null 2>&1'); end", "title": "" } ]
[ { "docid": "3f706f70915d3af428b57b1c5975a0eb", "score": "0.6764888", "text": "def valid?\n return false unless name\n return false unless version\n return false unless summary\n #return false unless maintainer\n #return false unless homepage\n true\n end", "title": "...
0281c64173267e42c5d3bdb567d9bb9e
applies the errors in error_object to self returns false so failure cases can end with this invocation
[ { "docid": "03a666293b8d7aae269728b2740f5354", "score": "0.66598886", "text": "def inherit_errors(error_object)\n error_object = error_object.errors if error_object.respond_to?(:errors)\n\n error_object.each do |k,v|\n\n next if self._error_ignores[k.to_sym]\n\n if respond_to?(\"...
[ { "docid": "a8447fc469e63508bd003c2fb12d81b4", "score": "0.6689107", "text": "def errors_for(_object); end", "title": "" }, { "docid": "b5619ff295f1a95f469ee5170a350f89", "score": "0.66689444", "text": "def error?()\n #This is a stub, used for indexing\n end", "...
c530f231865ee220e3a902d8fd297b6c
This is a module. We'll cover these soon!
[ { "docid": "4a5d5c6507a2ba0a8c4b27261e79ecc4", "score": "0.0", "text": "def first_n_primes(n)\n return \"n must be an integer.\" unless n.is_a? Integer\n return \"n must be greater than 0.\" unless n > 0\n Prime.first n\nend", "title": "" } ]
[ { "docid": "9de4306501711176ab8084b28395030d", "score": "0.7245491", "text": "def module; end", "title": "" }, { "docid": "7db0727baf89eb76beac27c515d7fe32", "score": "0.6734697", "text": "def support; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", ...
dfbb59026c968eb954df87e73a7489ad
Redis key for storing one cron job. source://sidekiqcron//lib/sidekiq/cron/job.rb645
[ { "docid": "14fdb2118b788f9ef124e062ecda7070", "score": "0.72082", "text": "def redis_key; end", "title": "" } ]
[ { "docid": "252d5374db5236d376a8bfe6802944b2", "score": "0.8403518", "text": "def redis_key\n Sidekiq::Crond::JobKeys.redis_key @name\n end", "title": "" }, { "docid": "2842d003417f50c92563e520bee2019c", "score": "0.7796036", "text": "def redis_key\n \"#{@job.redis_k...
7a3c5f2de3ed3cbaf4018c274ccd323d
PATCH/PUT /bookcovers/1 PATCH/PUT /bookcovers/1.json
[ { "docid": "d491a6daf5c4b330ee438939c3db8ca0", "score": "0.6914038", "text": "def update\n respond_to do |format|\n if @bookcover.update(bookcover_params)\n format.html { redirect_to @bookcover, notice: 'Bookcover was successfully updated.' }\n format.json { head :no_content }\n ...
[ { "docid": "e5718b2e256dfc37644e28bad9c6dfb3", "score": "0.6851803", "text": "def update\n\t\tupload_cover\n\n\t\trespond_to do |format|\n\t\t\tif @book.update(book_params)\n\t\t\t\tformat.html { redirect_to @book, notice: 'Book was successfully updated.' }\n\t\t\t\tformat.json { render :show, status: :...
67f83ceb2ce208c38388101aa94ccda3
ends valid_input? runs after credit card program input is valid. Outputs and returns full list (from constants above).
[ { "docid": "6b33117f9e5b6659f859c41cd6031856", "score": "0.0", "text": "def transfer_options (input)\n puts \"You have selected the #{input.capitalize} loyalty program\"\n puts \"You can transfer your points to the following airlines and hotel chains:\"\n puts \" \"\n\n if input == \"amex\" || inp...
[ { "docid": "9a5aa3530afd232f972b449a7742a269", "score": "0.6595814", "text": "def validate_cards(numbers = \"\", no_output = false)\n \n # if a String split it on the new line. Reject any empty values\n numbers_array = numbers.split(/\\n/).reject(&:empty?) if numbers.is_a? String \n \n # u...
9b06a771b891acf879e35812ced46bbd
will calculate the Fibonacci sequence up to the given number
[ { "docid": "e82eaecab6582de64eaed8da2450be9d", "score": "0.0", "text": "def calculate\n # account for special cases. if the number of calcualte is 2 or less only the seed will be needed\n case @num\n when 0\n [] \n when 1\n [0]\n when 2\n [1,2]\n else\n # run with i...
[ { "docid": "5d0900a876585e1cca68cf34893c211b", "score": "0.85608375", "text": "def fibonacci(n)\n a = 0\n b = 1\n\n # Compute Fibonacci number in the desired position.\n n.times do\n temp = a\n a = b\n # Add up previous two numbers in sequence.\n b = temp + b\n end\n\n retu...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "db812a57420e4dfc9b978c8c63aa826d", "score": "0.0", "text": "def set_admin_event\n @admin_event = Event.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...
8635d3192b7180951be51b28571707c2
count of students signed up to a hobby
[ { "docid": "e7c3777d56eb44809f2899a8a7f547f1", "score": "0.6528359", "text": "def num_students\n num_students = 0\n self.teachers.each do |teacher|\n num_students += teacher.students.length\n end\n num_students\n end", "title": "" } ]
[ { "docid": "738aedfa3bcb2c166eb8c355b17ff34d", "score": "0.6981682", "text": "def count_students\n students.size\n end", "title": "" }, { "docid": "140f66e6e7b9ff2aea010fe3db4f98eb", "score": "0.6798854", "text": "def student_count\n student_ids = bookings.confirmed.map { |boo...