query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
8f59742329147ba916eb53cfdae7ceee
Returns a URI. For example: " info: Returns an 'info:' URI instead of 'https:'
[ { "docid": "c76f86a54840f0151114e7287196f5b3", "score": "0.7040881", "text": "def to_uri info: false\n if info\n URI(_info_uri)\n else\n URI(_http_url)\n end\n end", "title": "" } ]
[ { "docid": "b91e643426fcc8efa3b5b1ca918ca73e", "score": "0.70281774", "text": "def gen_url url, text\n scheme, url, = parse_url url\n\n \"[#{text.sub(%r{^#{scheme}:/*}i, '')}](#{url})\"\n end", "title": "" }, { "docid": "0e399de021211bb4f9a3b16267cf8b1c", "score": "0.6993388", ...
268cad1008b02922c542fd181e489d86
POST /member_times POST /member_times.json
[ { "docid": "ad5016e73475879b3cdd27bd68e97f4a", "score": "0.6646711", "text": "def create\n @member_time = MemberTime.new(params[:member_time])\n\n respond_to do |format|\n if @member_time.save\n format.html { redirect_to @member_time, notice: 'Member time was successfully created.' }\n...
[ { "docid": "9643dbad41152e48fe6d4a1344291faa", "score": "0.6171883", "text": "def create\n #for multiple entries\n params[:member_id].zip(params[:mem]).each do |mid,tm|\n @race_timing_grp_evnt = RaceTimingGrpEvnt.new(params[:race_timing_grp_evnt])\n @race_timing_grp_evnt.member_id = ...
81bf651e2864d3209729841fdc135f08
GET /faillogs/new GET /faillogs/new.json
[ { "docid": "5fc718fc92244e128ee48e933813c625", "score": "0.8167738", "text": "def new\n @faillog = Faillog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @faillog }\n end\n end", "title": "" } ]
[ { "docid": "1cddbf5a13d8bd6a35b7199a6c4afb0e", "score": "0.721263", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @log }\n end\n end", "title": "" }, { "docid": "2a1d210c390a698821fd20c0d3a73581", "score": "0.7098381"...
cad06dc42468d983be963d9412f928c4
Now wheel.diameter is embedded deeply inside a complex method. This complex method depends on Gear responding to wheel and on wheel responding to diameter. Embedding this external dependency inside the gear_inches method is unnecessary and increases its vulnerability. You can reduce your chance of being forced to make ...
[ { "docid": "f032027cf990add58d0e8d9e0d8df174", "score": "0.64379084", "text": "def gear_inches\n # ... a few lines of scary math\n foo = some_intermediate_result * diameter\n # ... more lines of scary math\nend", "title": "" } ]
[ { "docid": "0ac69a4905e99d4a6336c4d864cf1957", "score": "0.7757896", "text": "def gear_inches\n # Dependency: Name of Wheel class. What if it changes or you want a\n # different type of wheel?\n # Dependency: Name of message to send to the Wheel instance (`diameter`)\n # Dependen...
d8b0260a3767ae2093e8e5623caf5eda
PATCH/PUT /tests/1 PATCH/PUT /tests/1.json
[ { "docid": "92dddf1a5e0a4c9f633bd91d07dfdba3", "score": "0.0", "text": "def update\n respond_to do |format|\n if @disease.update(disease_params)\n format.html { redirect_to @disease, notice: 'Disease was successfully updated.' }\n format.json { head :no_content }\n else\n ...
[ { "docid": "765f860f9a42473cc91d620dc9d2fba2", "score": "0.67356986", "text": "def update\n @testspec = Testspec.find(params[:id])\n\n respond_to do |format|\n if @testspec.update_attributes(params[:testspec])\n format.html { redirect_to @testspec, notice: 'Testspec was successfully up...
f398515989678aaa9cba8b3d0a5b497f
Immediately update the status to the given one.
[ { "docid": "86a17ea0f18d79cdb64ba146572c47b1", "score": "0.70556927", "text": "def status!(status)\n self.update(status: status)\n end", "title": "" } ]
[ { "docid": "d0b1eac913898eb7cc2fab0049e3050c", "score": "0.8017732", "text": "def update_status\n @status = !@status\n end", "title": "" }, { "docid": "28029162c64bb54efb4e5401b85df04f", "score": "0.7988379", "text": "def update_status(status)\n self.status = status if status....
5c343844617727939c7de77e3a798f35
test the project configuration
[ { "docid": "5cbbf4b69fb88ee47dd3d8d131996797", "score": "0.0", "text": "def test_tempdir_exists\n assert File.directory?(tempdir)\n end", "title": "" } ]
[ { "docid": "2dc5a008e07776179ac5243efb20a47c", "score": "0.7188457", "text": "def test_configuration\n c = Patir::Configurator.new(\"samples/empty.cfg\")\n assert_equal(c.configuration, c)\n\n c = Patir::Configurator.new(\"samples/chain.cfg\")\n assert_equal(c.configuration, c)\n ...
11e0a16f1f8198774cf35989e4864773
Syntactic sugar just offering the existing Array count function under a name that makes more sense for our use case. There's another way to do this, btw. Look up how Ruby supports aliasing.
[ { "docid": "14f151d48a06343e6c71cd19a909aec7", "score": "0.0", "text": "def word_count\n self.count\n end", "title": "" } ]
[ { "docid": "f9428bcf12fa09ee93ec6d728144a179", "score": "0.72851974", "text": "def count\n # Quick fix\n # Would be better to count while traversing rather than building array then counting that\n to_a.count\n end", "title": "" }, { "docid": "59e8553a6007dad02302e61950abacea", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "650e3f9cfb82bd1d740fd2e30f8a84a1", "score": "0.0", "text": "def account_group_params\n params.require(:account_group).permit(:name, :description, :default_expiry)\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...
dd220558df1d79c655106d7d5e0f3893
Done with the given topic. If none is specified, then topic is assumed to be the current branch (if it's a topic branch).
[ { "docid": "1f28f1c5f934193d3faf4fc7f4176644", "score": "0.8144142", "text": "def done topic=nil, opts={}\n if topic.nil?\n raise \"\n Current branch is not a topic branch. Switch to a topic branch or\n supply an argument.\n \".oneline if current_topic.nil?\n\n ...
[ { "docid": "b9e46e8da363fb960c3d24481517ad8c", "score": "0.64653003", "text": "def delete_topic(topic, &block)\n if t = OmfCommon::CommProvider::Local::Topic.find(topic)\n t.release\n else\n warn \"Attempt to delete unknown topic '#{topic}\"\n end ...
3c41b404e7316c4fad29736d8aa83ebf
Write the text element.
[ { "docid": "fb55791c9f0a61093c00a13811b93b89", "score": "0.6250873", "text": "def write_text_t(comment)\n text = comment.string\n attributes = []\n\n attributes << ['xml:space', 'preserve'] if text =~ /^\\s/ || text =~ /\\s$/\n\n @writer.data_element('t', text, attributes)\n ...
[ { "docid": "3343e7261373b6d0b92798c8e062155a", "score": "0.7420874", "text": "def write(text)\n content.send @opts[:write], text\n end", "title": "" }, { "docid": "c1a43a3e17042b949a05ab2061ef01e6", "score": "0.7076043", "text": "def write_text_t(text)\n attrib...
1cc17a82940b35d7164e5568c6b0d420
previous post by id
[ { "docid": "532ba6693f912e283890611051507d0d", "score": "0.876019", "text": "def previous_post\n self.class.first(:conditions => [\"id < ?\", id], :order => \"id desc\")\n end", "title": "" } ]
[ { "docid": "f5a6a79a3dc1f3c514126f6f7f473c00", "score": "0.82379824", "text": "def previous_post_id(post_id)\n return nil if first_post?(post_id) || !contains?(post_id)\n\n n = post_ids.index(post_id) - 1\n post_ids[n]\n end", "title": "" }, { "docid": "59c28b6731adf47621a130b96720...
97c4a6fbc319110a5487dccd7a343317
Time Complexity: O(n m)
[ { "docid": "67bd857504f5cca6cd9ee9269ba788ed", "score": "0.0", "text": "def solution(n, a)\n counters = Array.new(n, 0)\n\n a.each do |el|\n if el > n\n max = counters.max\n counters.map!{ |el| el = max }\n else\n counters[el-1] += 1\n end\n\n ...
[ { "docid": "94b952c4eec254dafeaf15d164f67032", "score": "0.6987192", "text": "def slow_solution(m, a)\n n = a.size\n return 1 if n == 1\n distinct = 0\n n.times do |back|\n (back..n - 1).each do |front|\n if a[back..front] == a[back..front].uniq\n distinct += 1\n else\n br...
8318b50a9bf2c6a78a36b95ee59b8438
POST /legal_spouses POST /legal_spouses.json
[ { "docid": "3a0005edebbf07032b44ff318b221621", "score": "0.7235692", "text": "def create\n @legal_spouse = LegalSpouse.new(legal_spouse_params)\n respond_to do |format|\n\n if @legal_spouse.save\n format.html { redirect_to staff_register3_path, notice: 'Personal detail was successfully...
[ { "docid": "251b1cab62a7b7918638410b55e41c84", "score": "0.7207874", "text": "def legal_spouse_params\n params.require(:legal_spouse).permit(:spouse_name, :spouse_nric, :spouse_dob, :spouse_age, :spouse_pob, :spouse_race, :spouse_religion, :spouse_tel_no, :spouse_hp_no, :spouse_occupation, :spouse_...
6a7670e5001eb1dd91cee5c88319d3f8
Based on Perl API 'get_all_Genes' method for Variation class. Get a genomic region starting from the Variation coordinates, expanding the region upstream and downstream.
[ { "docid": "5660355225152ddaae8a81a809d173ac", "score": "0.5309917", "text": "def fetch_region(up = 5000, down = 5000)\n sr = core_connection(self.seq_region_id)\n slice = Ensembl::Core::Slice.fetch_by_region(Ensembl::Core::CoordSystem.find(sr.coord_system_id).name,sr.name,self.seq_region_...
[ { "docid": "dfa24586df54c9e35b4508386e8debe4", "score": "0.5710976", "text": "def regions(for_select = true)\n fetch_array_for $regions, for_select\n end", "title": "" }, { "docid": "833a4dbfab28b1282522bbeab4e9c271", "score": "0.5484971", "text": "def all\n # return an a...
f3ef635e02c31783bf160700485cd9f9
Truncates table while maintaining region boundaries (deletes all records by recreating the table)
[ { "docid": "a97f0cbf3f5b01f2d86e3ff044b562bb", "score": "0.5702654", "text": "def truncate_preserve(table_name_str)\n puts \"Truncating '#{table_name_str}' table (it may take a while):\"\n table_name = TableName.valueOf(table_name_str)\n\n if enabled?(table_name_str)\n puts 'Disabl...
[ { "docid": "c5eed960fbb8a766468c21e94fcf8912", "score": "0.7018481", "text": "def truncate_table\n\t\t\t transaction { connection.execute(\"TRUNCATE TABLE #{quoted_table_name};\") }\n\t\t end", "title": "" }, { "docid": "85f0bfc4a01410890666ffb56a913073", "score": "0.678553", "text...
812ffd1e98248b22b00c38339010931f
Get the profile own and followed lines but not get conversations (messageble_type = 'Network' && undercover = false)
[ { "docid": "da419a96f9d1a0bd344f80e6177173fc", "score": "0.4695121", "text": "def profile_communities\n messages = MessageQuery.new(current_user).communities(\n params[:limit], params[:offset]\n )\n\n render json: {\n messages: messages.as_json(\n methods: %i[\n avatar...
[ { "docid": "5142e2c8a2c53b30c1cccb46c9fd3f79", "score": "0.65500176", "text": "def get_non_custom_lines\n message = Message.find(params[:message_id])\n\n # on landing page if custom line within distance then fetch all its non custom lines + All non custom lines created on Own custom line.\n # i...
4a9373580e8f1dd6d59184c125b5fcd9
Comparison between two vectors for quality.
[ { "docid": "b3a0cb1223f3a391680b0ea6b3e1dd81", "score": "0.0", "text": "def eql?(other)\n other.points == points\n end", "title": "" } ]
[ { "docid": "922129824ed7db567a69f5239e0f5543", "score": "0.6671312", "text": "def vector_equals(v1,v2,eps)\n\t\tx = (v1[0] - v2[0] < eps )\n\t\ty = (v1[1] - v2[1] < eps )\n\t\tz = (v1[2] - v2[2] < eps )\n\t\tputs \" #{x} || #{y} || #{z} \"\n\t\tx && y && z\n\tend", "title": "" }, { "docid": ...
bfd72261b448b7051b3e0ad7f781e79b
Gets the stopwords, from stopwords.txt, and stores them in an array called list.
[ { "docid": "4d3ea7d6382e1e2c6a17f78034f19e55", "score": "0.817812", "text": "def get_stopword_list\n list = []\n \n begin\n File.open(\"stopwords.txt\", \"r\") do |file|\n file.each_line { |line| list.push( line.chomp ) }\n end\n rescue\n puts \"The file 'stop...
[ { "docid": "71e11190ebbf1b9bd2427edbc4133638", "score": "0.81683105", "text": "def stopwords\n @stopwords ||= IO.readlines(@stopwords_file).map { |l| l.strip }\n end", "title": "" }, { "docid": "6a333dbac73f16d52f435fa612faf4e8", "score": "0.8101308", "text": "def stopwords\n...
383ee65a6adbfef73a2b1f23c1121d5e
Generic method to deliver notifications for a predecided event Delivers the following : => 1) Notification to the passed user object => 2) mail to the passed user object => 3) SMS alert to the passed user if it is allowed Also if some special operation is to be carried out after sending notification, the name of the me...
[ { "docid": "f8d091abd857f347bfbbf10367f71b27", "score": "0.7249421", "text": "def deliver_notifications(event, args = [])\n # event = CONTACT_TEMPLATES[event]\n # Notification.send_notification(event[:notif], args << self) if event[:notif]\n # Notifier.deliver_mail(event[:mail], args << sel...
[ { "docid": "276f4598b1c316081ce5131c3f6dcbbb", "score": "0.6138354", "text": "def method_missing(meth, *args, &block)\n options = args.extract_options!\n bool_args = args.map{|arg| arg.respond_to?(:is_tekeya_attachable)}.uniq\n is_notification = bool_args.length == 1 && bool_a...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "abfb065a5b182330adc7fdc60fd43220", "score": "0.0", "text": "def set_vehiculo\n @vehiculo = Vehiculo.find(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...
afbefa50fe1f88bb556b99df5f3b9bee
Returns list of article's author names as a readable list, separated by commas and the word "and".
[ { "docid": "760bb114b03c8581f2196948bc0c1a34", "score": "0.7534472", "text": "def authors_list\n case self.authors.length\n when 0\n return nil\n when 1\n return self.authors.first.name\n when 2\n return self.authors.first.name + \" and \" + self.authors.second.name\n ...
[ { "docid": "e4c73cb1776c9bb4777af88066e9d1f3", "score": "0.8438465", "text": "def author_list(after_initials='.', separate_last_and_initials=' ', delim=\", \", and_word=\"and\", join_with_ands=false)\n if authors.is_a? String\n authors\n else \n names = []\n names = authors.map do |...
58b2e3d7135e7ec0ff5187bd30a05db0
GET /employee_activity_rates/1 GET /employee_activity_rates/1.xml
[ { "docid": "da439af999118b1730a0e2e6a8fd3e9b", "score": "0.73230624", "text": "def show\n @employee_activity_rate = EmployeeActivityRate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @employee_activity_rate }\n end\n end", ...
[ { "docid": "46ca5cf2259fac1374a744bf0cf096b1", "score": "0.7058745", "text": "def retrieve_rates(date)\n path = \"http://openexchangerates.org/api/historical/#{date.to_s}.json?app_id=#{$app_id}\"\n response = Net::HTTP.get_response(URI.parse path)\n # TODO: error handling\n response.body\nend", ...
97dc969d0b40e715595c850f4c13aa64
Recovers consumers. Used by the Automatic Network Failure Recovery feature.
[ { "docid": "f16995a13b0caca54986d976d0e65243", "score": "0.84460735", "text": "def recover_consumers\n @consumers.values.each do |c|\n begin\n self.unregister_consumer(c.consumer_tag)\n c.recover_from_network_failure\n rescue Exception => e\n # TODO: logger\...
[ { "docid": "e7daeae718422374eacf7d3700bbdaae", "score": "0.79490364", "text": "def recover_consumers\n unless @consumers.empty?\n @work_pool = ConsumerWorkPool.new(@work_pool.size, @work_pool.abort_on_exception)\n @work_pool.start\n end\n\n @consumer_mutex.synchronize { @con...
3629d183c27c5e4a8904ca919db6aeb8
POST /cdbalgies POST /cdbalgies.json
[ { "docid": "87fbaaea382db5ffaf21f1ea486ed3d6", "score": "0.63766426", "text": "def create\n @cdbalgy = Cdbalgy.new(cdbalgy_params)\n\n respond_to do |format|\n if @cdbalgy.save\n format.html { redirect_to @cdbalgy, notice: 'Cdbalgy was successfully created.' }\n format.json { re...
[ { "docid": "6bfff1a04dd0aca59554eedde94438e5", "score": "0.5956818", "text": "def create\n @cyb = Cyb.new(cyb_params)\n\n respond_to do |format|\n if @cyb.save\n format.html { redirect_to @cyb, notice: 'Cyb was successfully created.' }\n format.json { render :show, status: :crea...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "475742ae61ed4e06dd63645fafc6e73a", "score": "0.0", "text": "def set_member\n @member = Member.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;...
cd860d7858af244e8e33f596a5f95d0c
GET /item_rankings GET /item_rankings.json
[ { "docid": "e36774596cd1fb68cae88a6a24dfb70e", "score": "0.77147114", "text": "def index\n @item_rankings = ItemRanking.all\n end", "title": "" } ]
[ { "docid": "65d7ab5ee2fdca7c2862e04c84f4de1f", "score": "0.72139746", "text": "def ranking(opts={})\r\n Rakuten::Request.get(\"https://app.rakuten.co.jp/services/api/IchibaItem/Ranking/20120927\", Rakuten::Api.merge(opts))\r\n end", "title": "" }, { "docid": "fd004ff198ad1fa6...
83b9a5c4c54ea73eabbed7b4da2722a4
Stores the user's requested destination before requiring login:
[ { "docid": "79edb4bad53f83bcea56994660677e6a", "score": "0.0", "text": "def store_location\n if request.get?\n session[:return_to] = request.url\n end\n end", "title": "" } ]
[ { "docid": "ec98f60a27974765270b5eadb1c790ef", "score": "0.72842324", "text": "def store_location\n # store last url - this is needed for post-login redirect to whatever the user last visited.\n return unless request.get? \n if (!request.fullpath.match(\"/users\") &&\n !request.xhr?)...
be4a74159d9fb997a6f4708c91e26293
PATCH/PUT /work_activities/1 or /work_activities/1.json
[ { "docid": "cee8eb261a13375a41e7407405c529f1", "score": "0.0", "text": "def update\n respond_to do |format|\n if @work_activity.update(work_activity_params)\n unless params[:aktivitas].nil?\n @array = []\n @array = params[:aktivitas]\n @work_activity.update(akti...
[ { "docid": "b67e36b50a7357dbfc3a0fb2c523d83a", "score": "0.7205696", "text": "def update\n respond_to do |format|\n if @workout.update(workout_name: workout_params[:workout_name], notes: workout_params[:notes], focus: workout_params[:focus])\n @workout.workout_activities.each_with_index d...
3919f1a458717d415d92463c6bb44024
Determines whether a course with the given department and level exists in the given courses list
[ { "docid": "ccd135e0b25d71aa53751b3c39768e63", "score": "0.8200263", "text": "def requisite_course_taken?(courses, department, level)\n courses.any? do |course|\n course.department == department && course.level.to_s == level\n end\n end", "title": "" } ]
[ { "docid": "64430569b226767baf3af8fc5828bb17", "score": "0.6589891", "text": "def enrolled_in?(course)\n\t self.courses.include?(course)\n end", "title": "" }, { "docid": "ac825aa62d192173f6f16e39d7393c31", "score": "0.65161854", "text": "def has_course?(course)\n self.courses.i...
4a425dcfad19b05f1b875ad38f8d9c83
Reset variables, so that they don't interfere between tests
[ { "docid": "e3e0878f69ef823ceab38c3454ca47eb", "score": "0.0", "text": "def reset\n @platforms_info = {}\n end", "title": "" } ]
[ { "docid": "904ffe77b154ed0f439a7366f2c44517", "score": "0.8113759", "text": "def reset_testing\n @mistakes = 0\n @tests = 0\n end", "title": "" }, { "docid": "eeb58ada1950db820b70dd89a989f598", "score": "0.7956681", "text": "def reset!; setup; end", "title": "" }, { ...
26ab1e858f8be9ea1a4c79fcea0c4ddd
users should not be able to review their own papers
[ { "docid": "c901fbfc2c761b12f861c981888a3840", "score": "0.65473455", "text": "def own_paper\n @paper = Paper.find(params[:paper_id])\n if @paper.user == current_user\n redirect_to user_path(current_user)\n flash[:error] = \"You cannot review your own paper\"\n end\n end"...
[ { "docid": "c92dfdf7a2274478c7d49bb1020d049c", "score": "0.73620445", "text": "def reviewable?; false; end", "title": "" }, { "docid": "19c6429d01ab7ac7ade70e2a1457d7b3", "score": "0.6638972", "text": "def verify_reviewer_or_admin\n raise User::Forbidden, 'Only the reviewer may pe...
a967894876a0a6c2afa3c780ff2e2a0a
TODO: Some more care is necessary for the properties box, i.e. when displayed object is deleted or unselected x0, y0, x, y: selection rectangle for drag select, ... depending on msg x0, y0 may be rounded to active grid (rotate) or be initial position... return: true/false for absorbed indication, or maybe a new element
[ { "docid": "c79f431374e12dfeb3d62a79891f90da", "score": "0.5597428", "text": "def process_event(boxlist, event, x0, y0, x, y, hit_selected, selected, msg)\n\t\tsilent_change = false\n\t\treturn false if @state == State::Deleted || @selectable == 0\n\t\treturn false if self.class == Text && @visibility =...
[ { "docid": "ecc36c3fb9f74fdce05687859030b9b0", "score": "0.64663017", "text": "def has_corners?\n\n component_def.entities.any? do |e|\n e.get_attribute(ATTR_DICT_PART, \"corner\") && e.get_attribute(ATTR_DICT_PART, \"name\")\n end\n\n end", "title": "" }, { "docid": "e801531891a...
d8871e5f75ee5bb0c14afe1f60341665
init mean to start with
[ { "docid": "35922f628ddfc665169b8f3f1df05852", "score": "0.0", "text": "def initialize(name)\n @name = name\n @position = 0 #starting position\n end", "title": "" } ]
[ { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.66938174", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.66938174", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "...
e15156f43034cb503c5ee6da9a5f21d0
The first index past the end of the array
[ { "docid": "959f2fe8e113b0c19885edf10f322787", "score": "0.0", "text": "def index_limit\n @buffer.length + @offset\n end", "title": "" } ]
[ { "docid": "55bd89174e219b60335bfdc5a9e9b62e", "score": "0.7558401", "text": "def last_significant_index\n return nil if empty?\n (0..(size-1)).to_a.reverse.each do |i|\n return i if @array[i] && !@array[i].empty? # self for sanity\n end\n return 0\n end", "title": "" ...
38f2943224aab700536c9f27755996ef
returns a list of all appointments assigned to the current patient
[ { "docid": "1773cc7a1dea03a4e488c9eaa8715426", "score": "0.75734246", "text": "def appointments\n Appointment.all.select {|appointments| appointments.patient == self}\n end", "title": "" } ]
[ { "docid": "411ac59b289ed8488ce1d61894444950", "score": "0.8429131", "text": "def appointments\n doctor_patients.map do |dp|\n dp.patient\n end\n end", "title": "" }, { "docid": "4c78028f6bf9ec176a997fca6699618e", "score": "0.8250827", "text": "def appoint...
b9919844b148f6903792bcfe2b320074
draw tile map BG
[ { "docid": "7f14682e33f0c21264f05bc695236901", "score": "0.0", "text": "def draw(bx, by, n)\n cw, ch = 32, 32 # cell size\n bx = bx.to_i\n by = by.to_i\n\n imgs = @imgs[n]\n lenx = @bgarr[0].length\n leny = @bgarr.length\n cx = (bx / cw) % lenx\n cy = (by / ch) % leny\n sx = ...
[ { "docid": "2c9b0169aa49a0216e502854f7f70ab6", "score": "0.7493706", "text": "def draw_map game_map\r\n tiles = game_map.tiles # 2d array of the tiles set!\r\n wooden_plank_image = game_map.wooden_plank # image of the wooden plank \r\n i = 0\r\n j = 0\r\n unit_wi...
d59a836060a83f923fad14df51d2c978
1. Set up a stack of disks 2. Set up a set of 3 stacks 3. Loop until it's over 4. Display the stacks 5. Get move to position 6. Get move from position 7. Move the disk while checking to see if move is valid
[ { "docid": "628210990698e899f97dbc1362475bc9", "score": "0.0", "text": "def disks\n (1..3).to_a.reverse\nend", "title": "" } ]
[ { "docid": "188950717cc16a42780822e8b9f9a500", "score": "0.7790012", "text": "def hanoi\n disks = (1..3).to_a.reverse\n stacks = [disks, [], []]\n until stacks[0].empty? && stacks[1..2].any?(&:empty?)\n max_height = stacks.map(&:count).max\n render_string = (max_height - 1).downto(0).map do |he...
01e64f04128e952d2ae93d861431bc6c
MEMBER PAGES notes associated with this event_photo
[ { "docid": "b31047fe19c742bce7d334afa864d7ac", "score": "0.593355", "text": "def notes\n @event_photo = EventPhoto.find(params[:id])\n @notes = @event_photo.notes.includes(:author).search_sort_paginate(params, :parent => @event_photo)\n end", "title": "" } ]
[ { "docid": "b0d58d3cdd7c206827cf68c177dcfeb0", "score": "0.5932628", "text": "def membership_payment_notes\n payment_notes(Payment::PAYMENT_TYPE_MEMBER)\n end", "title": "" }, { "docid": "298b4b8d4adfbc139b259845a8799d37", "score": "0.5761621", "text": "def person_notes\n ...
de1dd6a31d29dc7a967d0f00ee48e6ac
input students info from the user and do some validations
[ { "docid": "f5b0b3261812d269e39950e9e5c2e168", "score": "0.69760877", "text": "def input_students\n puts \"To finish, just hit return twice\"\n puts \"Please enter the names of the students\"\n puts \"Name:\"\n #get the first name\n #remove the white space at the end of the line\n name = STDIN.get...
[ { "docid": "44e432eebc9c33d406b4c831a60be341", "score": "0.7393629", "text": "def input_student\n puts \"Entering a name for the #{ @month } cohort\".bold.blue\n puts \"Please enter a new name -- (\".blue + \"press 'return' to exit\" + \")\".blue\n puts short_bar\n print \"Name\".yellow + \"...
ec0d44c4fd9cb65ed71f88c61a76945e
Set the value of the SiteID input for this Choreo.
[ { "docid": "e4149d7ea487e5f5220768bd3496a891", "score": "0.7605955", "text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end", "title": "" } ]
[ { "docid": "325490f29fd19c572de27de1605d48c1", "score": "0.771423", "text": "def site_id=(site_id)\n if !site_id.nil? && site_id < 1\n fail ArgumentError, 'invalid value for \"site_id\", must be greater than or equal to 1.'\n end\n\n @site_id = site_id\n end", "title": "" ...
5092f464f33ed00ebd5cf276e8000e00
Returns whether the specified API extension is supported by the current OpenGL or OpenGL ES context. It searches both for client API extension and context creation API extensions. A context must be current on the calling thread.
[ { "docid": "39e8bd259486dc04ed436974685b2680", "score": "0.59407115", "text": "def supported?(extension_name)\n end", "title": "" } ]
[ { "docid": "2264800bb134a53c07b752338c94faf6", "score": "0.6807052", "text": "def glfwExtensionSupported(extension)\n return glfw_call(GLFW_EXTENSION_SUPPORTED, extension) == 1\n end", "title": "" }, { "docid": "30c6deed6dada529cb06a43b2fa78ae0", "score": "0.6485285", "text": "de...
cbdc488390d1a462a9cec27cd9f21f67
GET /events GET /events.xml
[ { "docid": "b9383f6b143cc67aa92f8431fadfa0ea", "score": "0.0", "text": "def index\n @browse = Event::Browse.new(params)\n @events = @browse.events\n @browse.errors.each { |error| append_flash :failure, error }\n render_events @events\n end", "title": "" } ]
[ { "docid": "5afd9c217db582ab4e1d31c633a112c3", "score": "0.75144434", "text": "def index\n @events = Event.get_events(params)\n end", "title": "" }, { "docid": "655773957e1b525642f0e9136bbde84b", "score": "0.74835473", "text": "def index\n @events = Event.lookup\n\n respond...
447d9d7f13dee29900acf71b2fbfd445
TODO Calculate consequence of SNV and check if it results in STOP GAIN or STOP LOSS or START GAIN TODO Calculate frameshift using the complete motif. A deletion of 1, followed by a deletion of size 2 might result in an SEMIINFRAME
[ { "docid": "eb9bd8f5d9e061d8d0c06d0e5c551691", "score": "0.58122504", "text": "def determine_consequence(refseq = nil)\n\t\tif @exons.size > 0 then\n\t\t\t@consequences = @motif.map do |ma|\n\t\t\t\tconsequence = \"NA\"\n\t\t\t\t\n\t\t\t\tif ma[:type] == \"WT\" then\n\t\t\t\t\tconsequence = \"WILDTYPE\"...
[ { "docid": "0b0f74e44fa808a51960757728b0ecfc", "score": "0.5337316", "text": "def stopstop minsize=30\n type = \"XX\"\n orfs = []\n translate = Nucleotide::Translate.new(@trn_table)\n aa_frames = translate.aa_6_frames(@seq)\n # p @seq\n # pp aa_frames\n num = 0\n aa_frames.each d...
73b063ce937febfb5f3a5f7971299dd3
Checks if a filter has already been added to the filter_chain
[ { "docid": "d2de2bcce80018baf3e4c7799cf7c775", "score": "0.85014945", "text": "def filter_already_added?(filter)\n return self.filter_chain.collect(&:method).include?(filter)\n end", "title": "" } ]
[ { "docid": "976e01a024921f0b67dd27b6bc14c09f", "score": "0.6885435", "text": "def filter_exists?(name)\n !custom_filters[name].nil?\n end", "title": "" }, { "docid": "4d45832fdec0a2e0a30fdcae4158c40c", "score": "0.6719492", "text": "def before_filter_if_not_already_added(...
84bca4fff4e13e949a19b4f95806851a
support function for representative_image_paths. copied over from project.rb
[ { "docid": "fdf38ed3a7bb0b74bbc500a1defa0a84", "score": "0.0", "text": "def representative_products(num_products=3)\n self.products.limit(num_products)\n end", "title": "" } ]
[ { "docid": "174059a72043813a7c7d63a038e52f19", "score": "0.72412086", "text": "def formatted_image_paths\n image_paths.map { |image_path| \"[#{image_path}]\" }.join(' ')\n end", "title": "" }, { "docid": "e785c0d92c4663c240ba9dfa518466c8", "score": "0.71678156", "text": "def imag...
9084462f925c843300fe12fad964c94b
Open files and compare their contents with the appropriate algorithm
[ { "docid": "e620dae9575df3fc63d419c647b8ed2d", "score": "0.6374054", "text": "def compare_files(f1, f2)\n begin\n file1 = IO.read f1[:path]\n file2 = IO.read f2[:path]\n rescue => e # file doesn't exists, db have to be updated\n @show.call \"\\t[Error]: #{e} Please update your datab...
[ { "docid": "e40f663cf124e431e5138757e2a9123c", "score": "0.7189405", "text": "def compare_file(a, b)\r\n return false unless File.size(a) == File.size(b)\r\n File.open(a, 'rb') {|fa|\r\n File.open(b, 'rb') {|fb|\r\n return compare_stream(fa, fb)\r\n }\r\n }\r\n end", "titl...
1125aba8651e0321ca8264fe874d7149
NEED TO ADD check if soft link valid delete make age at mri an pet appointment file?
[ { "docid": "d7b02f5293f98adcd91acb7d0f25f642", "score": "0.0", "text": "def run_up_reggieid_links\n\n @schedule = Schedule.where(\"name in ('up_reggieid_links')\").first\n @schedulerun = Schedulerun.new\n @schedulerun.schedule_id = @schedule.id\n @schedulerun.comment =\"starting up_reg...
[ { "docid": "105cb09a9540cc280f6dcb61660f55a4", "score": "0.5457671", "text": "def restricted_link?\n @record.fulltext_link[:expires] == true\n end", "title": "" }, { "docid": "4a279518dadaf4a5a3ea6b50620abce2", "score": "0.5400901", "text": "def deleted?(file); end", "title":...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2e6e5d16f48d9d7a2509d99a215eb6f5", "score": "0.0", "text": "def set_exchange\n @exchange = Exchange.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...
33c9e242dbdf76a331114fdb43c99f0a
Runs the initial bootstrapping install
[ { "docid": "06d30bf29699fe56d67e1f3f7c82bb1e", "score": "0.0", "text": "def bootstrap_mono(pe_conf_path, pe_tarball_path, target_master = @target_master)\n env_vars = \"PE_CONF_PATH=#{pe_conf_path};\"\n env_vars << \"PE_TARBALL_PATH=#{pe_tarball_path};\"\n env_vars << \"PE_TARGET_MASTER=#...
[ { "docid": "b0b16c3f2cb574fe8a3a433a801649ad", "score": "0.6990674", "text": "def install_bootstrap\n puts \"Running bootstrap subcommand of install command\"\n # none of these will be required in the future... but are for now\n check_option(\"primary_master\", \"install\")\n instal...
b0c621c9987a07d3ac89046118a0e012
Edit a document Edit metadata of a specific document.
[ { "docid": "e4a33f51a07f30172d23f37561c66281", "score": "0.0", "text": "def users_id_user_transactions_id_transaction_documents_id_document_put(id_user, id_transaction, id_document, opts = {})\n data, _status_code, _headers = users_id_user_transactions_id_transaction_documents_id_document_put_with_...
[ { "docid": "35f58f2fe5af061beb687f474934a3de", "score": "0.7337401", "text": "def edit_metadata\n not_authorized if Revs::Application.config.disable_editing == true\n @document=SolrDocument.find(params[:id])\n updates=params[:document]\n updates.each {|field,value| @document.send(\"#...
a95fd098e61f658c3f4ed62f856e140a
Baseline implementation for the list_schemas REST call
[ { "docid": "ff198bb4486eed7be2630fc1e5a7b2c9", "score": "0.7064459", "text": "def list_schemas request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_schemas_re...
[ { "docid": "52aa65b5d0f5551852c25d5cc6b5ec5e", "score": "0.75181127", "text": "def get_schemas\n @schemas\n end", "title": "" }, { "docid": "4b70e72ed4e14df7131bc2ddb66018a3", "score": "0.70627576", "text": "def index\n @schemas = Schema.all\n\n respond_to do |format|\n ...
ef351ce95207982b13bfa02ece732a54
Set the +width+ of the frames returned by +decode_frame+
[ { "docid": "4e06731c52bf178a233882d48ee7a7c6", "score": "0.6209411", "text": "def width=(width)\n return if width == @width\n @width = width\n teardown\n end", "title": "" } ]
[ { "docid": "50086a439548fdaa8a77636f6850e064", "score": "0.6854759", "text": "def width=(width)\r\n src_rect.width = width\r\n @width = width\r\n end", "title": "" }, { "docid": "35c096efc59602fac7ba20ace146d92b", "score": "0.67667246", "text": "def setwidth=(value)\n @...
5b0682f1e4d10c5605ff1699b7e3494a
creating a new item in database
[ { "docid": "ee0f90345c0801aa498c6d5964800d30", "score": "0.0", "text": "def create\n @bean = Bean.new(bean_params)\n if @bean.save\n redirect_to beans_path\n else\n render :new\n end\n end", "title": "" } ]
[ { "docid": "1dddde315033b87b53532944f0cedbe8", "score": "0.76012963", "text": "def create_new_item(name, price)\n\tclient = create_db_client\n\tcreate = client.query(\"INSERT INTO items(name, price) values('#{name}', #{price})\")\nend", "title": "" }, { "docid": "651d8e72bff4e4e531e9b196f293...
37efa285242b2e97328f84ae14cfe838
Add a command to the youngest hash in the array of hashes
[ { "docid": "75df145b47e78f3c934a436649df291f", "score": "0.5758188", "text": "def addCommand(num, command)\n\t\t@mUnfinished.synchronize do\n\t\t\t@unfinished.first[num] = command\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "6596873790402cdc09006b60bc2233e4", "score": "0.6359802", "text": "def add_command(command)\n if command.respond_to?(\"commandhash\")\n theCommand = command.commandhash\n else\n theCommand = command\n end\n\n @commandsHash[:commands] << theCommand...
3b9c6f896682987fe5182b33c9a0789a
def create_offer_details(units, order_id) self.offer_details.create(order_id: order_id, units: units) end
[ { "docid": "c7e8e1b786637345cc54ebd26cc5e835", "score": "0.0", "text": "def create_review_ticket\n\t\tproduct_score_id = ProductScore.where(product_id: self.product_id, user_id: self.user_id).first.id\n\t\tReviewTicket.create_ticket_for_product(self.order_id, self.order.user_id, product_score_id, self.p...
[ { "docid": "3b44a66b74189ed3bbc36fe6b766ddfb", "score": "0.65085083", "text": "def create\n get_data\n @purchase_detail = @purchase.details.create(params[:purchase_detail])\n get_data\n end", "title": "" }, { "docid": "51b16cc8bd0077169c48781bf6f3e8dd", "score": "0.6375422", ...
7d10ad1182f0403e74222aff0b7d7a5b
Selects the current line.
[ { "docid": "485be2c22825efd9774c5e4d239ebfb4", "score": "0.8539375", "text": "def select_line\n buffer_current.select_current_line\n update_status_line\n end", "title": "" } ]
[ { "docid": "5aa1edcfb80a4ef04c1daa7a0e7f35d7", "score": "0.68078965", "text": "def goto_next_selection\n return if selected_rows().length == 0 \n row = selected_rows().sort.find { |i| i > @obj.current_index }\n row ||= @obj.current_index\n #@obj.current_index = row\n @obj.goto_l...
91fea95a2325b97608cdee36a120ab5e
Prints the results to standard out in the csv format specified.
[ { "docid": "ac862908868cf0a46a49bc225150a7f5", "score": "0.0", "text": "def display_results_json\n puts @filehash \n end", "title": "" } ]
[ { "docid": "a214da707a6dbbe8d81e406e55661e05", "score": "0.7508897", "text": "def print_csv_results\n FileUtils.mkdir_p(\"data\")\n File.open(\"data/results.csv\", \"w\") do |f|\n @data.sort_by{|id, values| values[\"sum_dose\"]}.each do |id, values|\n f.puts \"%s\\t%d\\t%.4f\" % [id, v...
688bf380e32fcd4bf528e1d55c699054
compute index offsets for provided key
[ { "docid": "24840332e5dc1680e85a16cffc0a2075", "score": "0.6271854", "text": "def indexes_for(key)\n indexes = []\n @opts[:hashes].times do |i|\n yield Zlib.crc32(\"#{key}:#{i+@opts[:seed]}\") % @opts[:size]\n end\n end", "title": "" } ]
[ { "docid": "0f147528468e7a9fea5bb262ee678cda", "score": "0.75434405", "text": "def get_offsets(key)\n @backend.get_key_offset(:domain => @domain, :key => key)\n end", "title": "" }, { "docid": "cd5950c1a1400c9465b7e58da748e1c8", "score": "0.71786004", "text": "def index_spanning(...
03edbfe1bcf46a66231cf071cf9b8f5d
GET /animals/1 GET /animals/1.json
[ { "docid": "68e510fa24badf24a95322a783e20609", "score": "0.6740335", "text": "def show\n render json: AnimalSerializer.new(@animal, root:false).to_json\n end", "title": "" } ]
[ { "docid": "821b7d4596593f0e14d89f3c8bdf60d6", "score": "0.7910601", "text": "def show\n @animal = Animal.find(params[:id])\n render json: @animal\n end", "title": "" }, { "docid": "5dc326dbd1a5a967abb025ff216e4954", "score": "0.7677247", "text": "def show\n @animal = Anima...
e73a06c1d37e7514731362394a68c415
now handled by XHR request but we need to know if there will be any results in advance of showing the table and generating the request again. A little bit wasteful of cpu but not too much
[ { "docid": "bca22180ce603222a3c007f34a72532f", "score": "0.0", "text": "def find_variables(query, page)\n #which datasets can the current user see\n surveys = get_surveys\n surveys.select {|el| Authorization.is_authorized?(\"show\", nil, el, current_user)}\n datasets = []\n surveys.each d...
[ { "docid": "1f8e527f6b4fcf65b185978d2d5841ba", "score": "0.60988164", "text": "def index\n # @batches = Batch.index_query(params[:query], params[:page])\n @batches = Batch.es_query(params[:query] ||= '', params[:page])\n # @batches = params[:query].present? ? Batch.es_query(params[:query],\\\n ...
91f8c5d80f08bc35edf61ad40483d0a2
A + or number that shows how many more or less kills a user has than deaths.
[ { "docid": "3a6bb89e4553b934a558d3630f05e3d1", "score": "0.7278492", "text": "def kill_to_death_difference\n difference = total_kills.to_i - total_deaths.to_i\n return \"+#{difference}\" if difference > 0\n \"#{difference}\"\n end", "title": "" } ]
[ { "docid": "f316db3520551e9d1055e15831fbd95c", "score": "0.6581961", "text": "def boss_kill_dkp\n kills.size * 5\n end", "title": "" }, { "docid": "8d194107dbbb823dcb7266580873af33", "score": "0.64904", "text": "def total_kills\n mob_kills + player_kills\n end", "title": ...
a54e65452cc1b832fa4a7bb28caeb0c7
Private: Raises a useful error in case the operation does not exist.
[ { "docid": "30c231aa1d441c60149298dd1c528608", "score": "0.7041746", "text": "def verify_operation_exists!(service_name, port_name, operation_name)\n operations = operations(service_name, port_name)\n\n unless operations.include? operation_name\n raise ArgumentError, \"Unknown operation...
[ { "docid": "8f4343d2d00a4bdbc52d3d5f695370e2", "score": "0.7401953", "text": "def operation(_name)\n raise Orocos::NotFound, \"#operation is not implemented in #{self.class}\"\n end", "title": "" }, { "docid": "01c705f4b4a1ad8438a1e47aba72f9f3", "score": "0.668406", ...
e6a18b09427513a2c3bc356e0a406dcd
reduce 4 omitted reduce 5 omitted
[ { "docid": "40136f927941d1bbbe810e18ec30bced", "score": "0.0", "text": "def _reduce_6(val, _values, result)\n result = self.block_append val[0], val[2]\n\n result\nend", "title": "" } ]
[ { "docid": "22c5faf06a3e77b52730e3d8e793d64a", "score": "0.6671284", "text": "def _reduce_15(val, _values); end", "title": "" }, { "docid": "82915cb5c0203b0cba656d2bf4753af1", "score": "0.66662234", "text": "def _reduce_525(val, _values, result)\n result = nil\n ...
9a7e998109ca9d0a87733e2dd2b064a8
Aggregating Yearly Usage from meter_records
[ { "docid": "e2727277335cd0c8a452e36cc5bb500c", "score": "0.74948895", "text": "def aggregate_yearly_usage\n# Get the date of the first entry in the records\n start_date = get_meter_records_start_date\n end_date = start_date + 1.year - 1.day\n # Calculate the aggregation\n usage = aggregate_u...
[ { "docid": "bbd56098505f5b65821058693e1eaf67", "score": "0.72625816", "text": "def aggregate_yearly_usage_from_daily_aggregation\n# Get the date of the first entry in the records -- we're doing all of them\n start_date = get_meter_records_start_date\n end_date = start_date + 1.year - 1.day\n # ...
5f21f90ca0f2ef9729bed7cec2daaaf3
POST /available_offs POST /available_offs.xml
[ { "docid": "1b068e057abd1cc9fb210f2ceacb98e7", "score": "0.6171652", "text": "def create\n @available_off = AvailableOff.new(params[:available_off])\n\n respond_to do |format|\n if @available_off.save\n format.html { redirect_to(@available_off, :notice => 'AvailableOff was successfully...
[ { "docid": "44bc6f5424bf5f930a59a958a9377ec9", "score": "0.5516097", "text": "def new\n @available_off = AvailableOff.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @available_off }\n end\n end", "title": "" }, { "docid": "aa8d4...
f5a2aa47ede36094fa86177f747264ca
PUT /meet_up_comments/1 PUT /meet_up_comments/1.json
[ { "docid": "bcf990b72b33482a737e1d6c4c37ac87", "score": "0.6956942", "text": "def update\n @meet_up_comment = MeetUpComment.find(params[:id])\n @meet_up_comment.user = current_user\n # We don't need to set @meet_up_comment.conference_confirm\n # because the user will always be set to the cur...
[ { "docid": "4b9a221fad0d7ef810d04554a740bcef", "score": "0.7148148", "text": "def update\n @meetup_comment = MeetupComment.find(params[:id])\n\n respond_to do |format|\n if @meetup_comment.update_attributes(params[:meetup_comment])\n format.html { redirect_to meetup_path(@meetup_commen...
d0bf46d5dd05d98a608d8b941ee5acbf
stores an image locally, by default it store in '/public/smileys'
[ { "docid": "75893b501a6260c163330dcf1a65c162", "score": "0.7547137", "text": "def ImageStore(smiley)\n Net::HTTP.start('www.emoji-cheat-sheet.com') do |http|\n res = http.get('/graphics/emojis/'+smiley+'.png')\n File.open('public/smileys/'+smiley+'.png', 'wb') { |file| file.write(res....
[ { "docid": "e6736b3141a95c75590007c219f6a37c", "score": "0.72448075", "text": "def ImageStore(smiley, animated = false)\n if animated\n Net::HTTP.start(Animated_Smiley_URI) do |http|\n res = http.get('/images/Skype/'+smiley+'.gif')\n File.open('public/smileys/animated/'+smi...
13b0a18b16af08c4ad5f02117924d731
Includes the given modules in the template class. Modules can be specified in different ways. All of the following calls include +FooHelper+: Module, recommended. helper FooHelper String/symbol without the "helper" suffix, camel or snake case. helper "Foo" helper :Foo helper "foo" helper :foo The last two assume that "...
[ { "docid": "7215171996804fc126dd3b2a6837e412", "score": "0.0", "text": "def helper(*args, &block); end", "title": "" } ]
[ { "docid": "8282b38b8da86170318b0f3c056bf365", "score": "0.71574205", "text": "def helper(*args, &block)\n self._helper_serial = AbstractController::Helpers.next_serial + 1\n\n args.flatten.each do |arg|\n case arg\n when Module\n add_template_helper(arg)\n ...
53933c58276247e4ea5fd5c993028ac6
Returns an array of the xyz positions
[ { "docid": "562d024c0465c71da5f396e2e1d79692", "score": "0.629069", "text": "def to_a\n [ x, y, z ]\n end", "title": "" } ]
[ { "docid": "cb0f813aa51a17a2241e5ba2b48fa4a4", "score": "0.7447994", "text": "def xyz\n Coordinate[ x, y, z ]\n end", "title": "" }, { "docid": "a17217e4795321f0349394a5bd80c2ec", "score": "0.7304501", "text": "def coordinates_xy ; return [@ind_x, @ind_y] end", "t...
598154cafb13ab31b4cc1894a850af79
Returns a list of SubmoduleStatus objects, one for each submodule in the parent repository.
[ { "docid": "bb3dffe8f1eeac2ac5a88816f6ca1082", "score": "0.5901447", "text": "def submodule_statuses(options = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "21b0330b0333c95f8d0fde16bd7c9c35", "score": "0.79426986", "text": "def submodule_statuses(options = {})\n flags = '--recursive' if options[:recursive]\n\n `git submodule status #{flags}`.\n scan(SUBMODULE_STATUS_REGEX).\n map do |prefix, sha1, path, describe|\n ...
c166540d3717379f696f2fa6f5575c42
params => projects: array of objects of Project returns => projects: updated array of objects of Project
[ { "docid": "faaa149b96e4c458ab90a41ee4cb8d1b", "score": "0.0", "text": "def add_to(projects)\n ch = \"1\"\n until ch == \"2\" do\n puts \"\\n1 => Add new project\\n2 => Go back\"\n ch = gets.chomp\n case ch\n when \"1\"\n print \" ...
[ { "docid": "fe255e08ece2004656d767469ace3d44", "score": "0.7719321", "text": "def update_projects(projects)\n new_last_edit_users = self.last_edit_users\n new_preferences = self.preferences\n new_result = self.result\n new_last_edit_users.each do |k, v|\n new_last_edit_users.s...
da1aa5c1d68e0ab9986e38b69e3f6251
GET /information_categories GET /information_categories.xml
[ { "docid": "c97c287d5f82b1e35394687ea4dd9b60", "score": "0.74636745", "text": "def index\n @information_categories = InformationCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @information_categories }\n end\n end", "title": "...
[ { "docid": "8fb11c432a8bb2c5fc11d5fb6181b5b5", "score": "0.7558153", "text": "def get_categories\n body = build_request(2935, 1501, \"ACTIVEHEADINGS\")\n response = send_to_localeze(body)\n xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text)\n end", "title": "" }, { "...
49e5a355db2ab95e101264b481bda356
Decodes a scanline of an 8bit, grayscale image into a row of pixels.
[ { "docid": "f35e66ffc68ac4348b87abdaf25d1c4e", "score": "0.7603675", "text": "def decode_png_pixels_from_scanline_grayscale_8bit(stream, pos, width, _decoding_palette); end", "title": "" } ]
[ { "docid": "fa9945d3a64aa9bd867444b15e4ca769", "score": "0.74858373", "text": "def decode_png_pixels_from_scanline_grayscale_8bit(stream, pos, width, _decoding_palette)\n (1..width).map { |i| ChunkyPNG::Color.grayscale(stream.getbyte(pos + i)) }\n end", "title": "" }, { "docid": ...
93e6b07365b9cf7c3c92a779a4a8ff63
POST /micropostaddressees POST /micropostaddressees.json
[ { "docid": "cb4cdc60a0d33c5384314b1061d58fe3", "score": "0.6243278", "text": "def create\n @micropostaddressee = Micropostaddressee.new(params[:micropostaddressee])\n\n respond_to do |format|\n if @micropostaddressee.save\n format.html { redirect_to @micropostaddressee, notice: 'Microp...
[ { "docid": "4123c68a14b366f0ec755dfb9c814e29", "score": "0.62152094", "text": "def create\n @micrppost = Micrppost.new(params[:micrppost])\n\n respond_to do |format|\n if @micrppost.save\n format.html { redirect_to @micrppost, notice: 'Micrppost was successfully created.' }\n fo...
ca4c828267e49bc482c076c88fb85d6e
In production, we don't want to raise an exception when enqueuing jobs because we don't want the user to see the exception, but we do want to see these exceptions in Exceptional.
[ { "docid": "cb8da4a9bf13b3b681a57f3108e756f8", "score": "0.6763743", "text": "def should_raise_enqueuing_exceptions?\n Resque.inline?\n end", "title": "" } ]
[ { "docid": "4da5e608fe9635551bf7aeac1684918d", "score": "0.65365577", "text": "def perform_enqueued_at_jobs; end", "title": "" }, { "docid": "f46848f33bea31627743145a45b19079", "score": "0.6528116", "text": "def queue_job\n begin\n self.created_at = Time.zone.now\n self....
a15fdf08bbf7c1aa4ac12d3c5d68ed95
Idempotent: Add a report reference to a project id: the ID of the report state: value for the reference (e.g. issue number or relative path to crossrepo issue) returns an HackerOne::Client::Report object or raises an error if no report is found.
[ { "docid": "7d2581141795ff6843e50b810450718f", "score": "0.7508697", "text": "def add_report_reference(reference)\n body = {\n type: \"issue-tracker-reference-id\",\n attributes: {\n reference: reference\n }\n }\n\n response_json = make_post_req...
[ { "docid": "6d172b6f2932705658defaecf0133a42", "score": "0.76033777", "text": "def add_report_reference(id, reference)\n body = {\n data: {\n type: \"issue-tracker-reference-id\",\n attributes: {\n reference: reference\n }\n }\n ...
24ee62e1e2ecf3cdfe42d7b3c9a25902
DELETE /appointment_dates/1 DELETE /appointment_dates/1.json
[ { "docid": "9579926b3d89132b2709f95f1bc649df", "score": "0.77448297", "text": "def destroy\n @appointment_date.destroy\n respond_to do |format|\n format.html { redirect_to appointment_dates_url, notice: 'Appointment date was successfully destroyed.' }\n format.json { head :no_content }\n...
[ { "docid": "761cfe19688ad8e3010fa2e15ee3cba3", "score": "0.76616424", "text": "def destroy\n Rails.logger.debug \">>>>>>> entred appointment destroy\"\n @appointment.destroy\n respond_to do |format|\n format.html { redirect_to appointments_url }\n format.json { head :no_content }\n ...
ace361f125396596423b59ab5c5d7649
before_action :home_params, only: [:set_home]
[ { "docid": "a1d7be35d0f6e419d4c145ce930fb43e", "score": "0.0", "text": "def index\n if user_signed_in?\n @neighborhood_post = NeighborhoodPost.new\n #redirect_to users_path\n else\n redirect_to root_url\n end\n end", "title": "" } ]
[ { "docid": "2415ac77671dde4e32551c776962dd7f", "score": "0.80072075", "text": "def home_params\n end", "title": "" }, { "docid": "4966c9cd200908e40ac698058a3b9b2a", "score": "0.75654626", "text": "def home_params\n params[:home]\n end", "title": "" }, { "docid"...
18ccb293ef7c9e85240ee513620dccd0
DELETE /settlements/1 DELETE /settlements/1.json
[ { "docid": "652369f40172f87933ad6f66e7c57af6", "score": "0.0", "text": "def destroy\n @settlement = Settlement.find(params[:id])\n @settlement.destroy\n\n respond_to do |format|\n format.html { redirect_to '/' }\n format.json { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "93a7d025c30868c546b8d7c21d37a255", "score": "0.65800864", "text": "def destroy\n @settlement.destroy\n respond_to do |format|\n format.html { redirect_to settlements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d66e8b055b4d...
92fbdd88b4e4fdeb07a68044eefae43a
Set the current visibility to match what is described in the embargo.
[ { "docid": "44eb190d06961c3c66f36584d387835d", "score": "0.790603", "text": "def embargo_visibility!\n return unless embargo_release_date\n if under_embargo?\n self.visibility_during_embargo = visibility_during_embargo ? visibility_during_embargo : visibility_during_embargo_defaul...
[ { "docid": "fc199a7ca05692dd816c2f04d5b5d190", "score": "0.7835803", "text": "def embargo_visibility!\n if embargo_release_date\n if under_embargo?\n self.visibility_during_embargo = visibility_during_embargo ? visibility_during_embargo : Hydra::AccessControls::AccessRight::VI...
2832a64f29bf4da9297c1319129479c2
GET /trains GET /trains.json
[ { "docid": "b14d8993398047635c7facb227668207", "score": "0.6535814", "text": "def index\n\n if params[:q] || params[:p]\n trains = SearchTrains.new(params).trains\n else\n trains = Train.all\n end\n\n @trains = trains\n end", "title": "" } ]
[ { "docid": "9876bd1aad0e986735284cacd3d41079", "score": "0.69834113", "text": "def current_trains\n @trains\n end", "title": "" }, { "docid": "84c3abb0f63eeedf56d380a44d1a0db7", "score": "0.67815614", "text": "def index\n @strains = Strain.all\n end", "title": "" }, {...
e3c431bac944af713bc4c430ed05c39a
Returns a string representation of the polygon of the form points[0] points[1] points[2] ... where each point is formatted with Pointto_s
[ { "docid": "54f88e64d7d29b66b387d43b491e9860", "score": "0.7311492", "text": "def to_s\n @points.join( ' ' )\n end", "title": "" } ]
[ { "docid": "c914a07b6d517167a37760cb5a094bec", "score": "0.74782085", "text": "def as_string\n (region.rings.first.points.map { |p| \"(#{p.lat},#{p.lng})\" }).join(',')\n end", "title": "" }, { "docid": "f43369d57be675ee09928e2638d5110f", "score": "0.71820915", "text": "def t...
1deef9703b76febb98f433f37aa2d669
This index is required for efficient backlinking, such as when deleting a vertex.
[ { "docid": "6ed23978d0bfa158d80373314e478ea7", "score": "0.0", "text": "def inbound_edges\n @inbound_edges || Redis::ModelSet.new(subordinate_key('inbound_edge_ids'), Edge)\n end", "title": "" } ]
[ { "docid": "0de209eaf1738bfeff06bed085854678", "score": "0.6764173", "text": "def old_index; end", "title": "" }, { "docid": "ed869959595283b70b3d629b95b12f63", "score": "0.6683338", "text": "def unmatched_actual_indexes; end", "title": "" }, { "docid": "5ab1ad19b5bdd81e8...
856dda44780b3fe84b3fc1f0fd3d7519
Once the address verification API is implemented, remove this and have valid_credentials? build the request using that instead.
[ { "docid": "f8bddbaec9956e0b2afaff861ab12fe3", "score": "0.5627003", "text": "def canned_address_verification_works?\n request = \"%3CCarrierPickupAvailabilityRequest%20USERID=%22#{URI.encode(@options[:login])}%22%3E%20%0A%3CFirmName%3EABC%20Corp.%3C/FirmName%3E%20%0A%3CSuiteOrApt%3ESuite%20777%3C/...
[ { "docid": "d5ca6fede07db8296f01126849ae68bf", "score": "0.6293603", "text": "def verify\n request_params = {\n 'apiLoginId' => TaxCloud.configuration.api_login_id,\n 'apiKey' => TaxCloud.configuration.api_key,\n 'uspsUserID' => TaxCloud.configuration.usps_username\n }.mer...
2dc1c6995ca9915cb302d626f7eab4ea
initialize with string input and call instance methods to get result
[ { "docid": "ecf624a3253e4f1035a6cf2e88efef83", "score": "0.0", "text": "def initialize(input)\n @input = input\n split_to_array\n perform_ordered_operations\n end", "title": "" } ]
[ { "docid": "3ef67aeb0befa6f4a022732b5fa1a43c", "score": "0.7465861", "text": "def initialize(string)\n@string_input = string\nend", "title": "" }, { "docid": "6ffca92b531dc831752c165a8152e277", "score": "0.73655146", "text": "def initialize(string); end", "title": "" }, { ...
b3c8afde806b53dc8e1e3301f9e3e8a3
GENERATE A UNIQUE URL FOR GIVEN WEB ADDRESS BEFORE SAVING INTO DATABASE
[ { "docid": "1071784deb59d0c151ff5dd2269bca59", "score": "0.6668727", "text": "def generate_short_url\n url = SecureRandom.uuid[0..5]\n old_url = Link.where(short_url: url).last\n if old_url.present?\n self.generate_short_url\n else\n self.short_url = url\n end\n end", "titl...
[ { "docid": "2a98fb407a9a66460f79266423b2d054", "score": "0.7519441", "text": "def generate_url\n self.url = SecureRandom.hex(8)\n end", "title": "" }, { "docid": "7effaf7a869daf7799a7e2831f9a6342", "score": "0.74750733", "text": "def generate_unique_url_for_chat(record)\n url ...
48fe01be96cbafa3a7b3993cd9b0bbc1
POST /Stores POST /Stores.json
[ { "docid": "93989b747571d2e4662f8249b25fdf55", "score": "0.0", "text": "def create\n @store = current_owner.stores.build(store_params)\n @store.owner = current_owner\n\n # @store = Store.find(params[:id])\n @comment = @store.comments.build\n #tenemos que mostrar todos los comentarios del ...
[ { "docid": "4f1ab5420d5650ec0573582a69545b84", "score": "0.72505176", "text": "def create\n @store = Store.new(params[:store])\n \n respond_to do |format|\n if @store.save\n format.html { redirect_to @store, notice: 'Store was successfully created.' }\n format.json { render j...
8356542df6da8c0600f73bd68acb5840
GET /trophic_interactions/new GET /trophic_interactions/new.json
[ { "docid": "324ee838468749de90caf2266fc45960", "score": "0.7653407", "text": "def new\n @trophic_interaction = TrophicInteraction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trophic_interaction }\n end\n end", "title": "" } ]
[ { "docid": "b4b3a2bbbe9d1e9194269e4f56d0a221", "score": "0.7562426", "text": "def new\n @trophic_interaction_observation = TrophicInteractionObservation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trophic_interaction_observation }\n end\n ...
3422a375e289481f4fb7e709e904a75b
Pass "Nil Town" as name. Method should return location info for Nil Town
[ { "docid": "37cca92f2ba08692b78602a3df74cbb0", "score": "0.71010005", "text": "def test_get_by_name_niltown\n location = @map.get_by_name(\"Nil Town\")\n assert location.loc == \"Nil Town\"\n assert location.max_rubies == 0\n assert location.max_fake_rubies == 3\n assert location.neighbor...
[ { "docid": "1d6b977510ec46d7f19867e9fa6eedfd", "score": "0.66372496", "text": "def location_name\n self.location.nil? ? \"\" : self.location.name\n end", "title": "" }, { "docid": "310abedf1f3ec5a5bbb3e3ebb50f9664", "score": "0.63747805", "text": "def test_get_location_nil_town\n...
486d8e76c0379328135d7ef46a125d64
get all siblings of this node
[ { "docid": "f2f11c72bfdf6dbf0ba61efd9b8d99c1", "score": "0.7774369", "text": "def siblings\n # TODO find a way to return this as a collection?\n # TODO supply filtering-option?\n self_and_siblings.reject{|r| r.key == self.key } # because identitymap is not used in console\n ...
[ { "docid": "5f9b7ed3f273fad284b2920d6dd6afc7", "score": "0.8256394", "text": "def siblings\n return [] if next_sibling.nil?\n [next_sibling] + next_sibling.siblings\n end", "title": "" }, { "docid": "e4d13199da79f3be1401f4572a2f9c0d", "score": "0.8197001", "text": "def sibling...
b9cd96a4ba2db9c32c7e235c3e70651c
The method helps to collect identical chains.
[ { "docid": "2bb279f50bb79456e15b370ed375ef65", "score": "0.0", "text": "def recursive_find_identical(keys, values)\n keys = [keys] unless keys.is_a?(Array)\n\n @identical_predicates.each { |this_key|\n next if keys.include?(this_key)\n temp = PredicatesSimilarity.parse_ke...
[ { "docid": "45d07b3c8eb08ba2fb7a1b3ec7372bed", "score": "0.6050901", "text": "def chain\n @chain ||= build_chain\n end", "title": "" }, { "docid": "fb4df0e32592e89999f9ed5a18778d77", "score": "0.60042757", "text": "def collect() Set.new().collect end", "title": "" }, ...
9718b5ea2a8dd7e76ff0b50be310b7b7
Permissions helper methods Check, are current user has permission to view/perform current action(path)
[ { "docid": "933f8b6527e9686421f0419dd1f34bce", "score": "0.75108165", "text": "def check_perm\n\t\tpath = request.env['PATH_INFO']\n\n\t\tpath[0] = '' # Delete first '/' character\n\t\tpath = path.split(/\\//) # Split path to resource and action\n\n\t\tif path.size > 1\n\t\t\tperm = '_' + path[1]\n\t\t\...
[ { "docid": "ff3ea66b6f4bb3d8290d74080c2fb32c", "score": "0.8097567", "text": "def check_permission\n unless current_user.admin? || (current_user == @user)\n not_found\n end\n end", "title": "" }, { "docid": "9798cd3d1321a00bd6f8069b6762f791", "score": "0.7952452", "text":...
44a3d7228197aa775f498f20c1c8a734
> Upon opening to the room editing menu, save the selected room
[ { "docid": "d9125972cbd53650af0364440dbe1c01", "score": "0.63089675", "text": "def on_room_select\n\t\t@assembly.reprint_object_at\n\t\t\n\t\t@room = @assembly.room_at\n\tend", "title": "" } ]
[ { "docid": "8be7dc4da99fdd09cc667f4a9a7eaf3b", "score": "0.67515767", "text": "def save_room( name, text, vars, exits )\r\n\t\t\t@rooms[ name.to_sym ] = [ text, vars, exits ]\r\n\t\tend", "title": "" }, { "docid": "534937acef57f802fdbff7da5e1b42e0", "score": "0.6557435", "text": "def...
9511159fef1aac53c113859e8cad97c0
Shift all pieces in a column down one location. The top location becomes a blank.
[ { "docid": "7184b5e3f75360ecbe8d586cddea0358", "score": "0.79120636", "text": "def shift_down(column)\n above_saved_spot = BLANK_SPACE\n saved_spot = BLANK_SPACE\n\n @size.times do |x|\n saved_spot = @board[x][column]\n @board[x][column] = above_saved_spot\n above_saved_spot = sa...
[ { "docid": "9b0d981bd0cd0688d7bba123ba7960d9", "score": "0.7029846", "text": "def pop col\n i = 5\n while i > 1\n @board[i][col] = @board[i-1][col]\n i -= 1\n end\n @board[0][col] = nil\n end", "title": "" }, { "docid": "316f61e72d8c37fadbd2939066351824", "score": ...
492ef0c7a6135fc8aeef7a253db7bdf4
query links shared with current account
[ { "docid": "ee81df741c5a483798cd9885382f5fa1", "score": "0.58222187", "text": "def get_followed_links\r\n Link.joins(\r\n 'LEFT JOIN accounts as a on a.id = links.account_id\r\n LEFT JOIN followships as f on a.id = f.following_id')\r\n .where(\"f.follower_id = ?\", current_acco...
[ { "docid": "3306af6364d5c52ee1247433191d8a4c", "score": "0.65716076", "text": "def index\n if params.key?(:my)\n require_oauth!\n @links = Link.where(user: profile['uid'])\n else\n @links = Link.all\n end\n end", "title": "" }, { "docid": "de4ddcec61a69336c521e15bf02...
b2a66feef346287efaf6e12e739edfe9
GET /canvasses/1 GET /canvasses/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "c371f6fe7c87425dc35e9b02583a8be9", "score": "0.65761423", "text": "def Canvas_API_GET(url)\n\t# make sure the Canvas call is within API usage quota\n\tCanvas_API_CALL_check()\n\t$logger.info \"Canvas API GET #{url}\"\n\tbegin\n\t\tresponse = RestClient.get Addressable::URI.escape(url), {:Aut...
d46aa370ef54cc13fb9ea777b1da22b0
GET /profiles/1 GET /profiles/1.xml
[ { "docid": "e4def6fa4bf536924623fa6681402db7", "score": "0.6944826", "text": "def show\n @profile = current_user.profiles.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n format.json { render :json => @profile }\...
[ { "docid": "a6f53e408a2076f75db363f33215b44b", "score": "0.73511946", "text": "def profile\n get('/my/profile')\n end", "title": "" }, { "docid": "93edd2ba7f3c41892d9400fad4224664", "score": "0.731931", "text": "def list_profiles\n # /profiles returns a list of profile...
b41e5a90a93e05c88382243518334801
Returns the value of a key and then deletes it.
[ { "docid": "1eaf566e9461b51ce768b711bab71aac", "score": "0.7425803", "text": "def get_and_clear_key(key)\n if @lua_support\n cmd = <<-EOF\n local str = redis.call('get', KEYS[1])\n redis.call('del', KEYS[1])\n return str\n EOF\n @redis.eval(cmd, [key....
[ { "docid": "c01254132bebc0575a112e8e1321ec90", "score": "0.8557033", "text": "def delete(key)\n if exists?(key)\n value = value(key)\n data(key).delete\n end\n value\n end", "title": "" }, { "docid": "86c1205571e8432371fb0186d255617e", "score": "0.8266569"...
e32b050ffed06f03408af8eccf58b665
before_action :check_user, only: [:show, :edit, :update, :destroy]
[ { "docid": "6f14e66923b93cbd9f705ce6f3fcc5de", "score": "0.0", "text": "def show\n #rescue ActiveRecord::RecordNotFound\n #redirect to root_url\n #存在しないidのページはエラーとしても良さそうとのことでした\n #他の書き方(private>correct_user)\n \n \n # models/task.rbにbelongs_to :userがあるので、下記のように記載すれば、当該taskの作成者が取得できる\n # if ...
[ { "docid": "fc197cd031bca843daf171f95aed44a0", "score": "0.786201", "text": "def show\n check_user\n end", "title": "" }, { "docid": "724c1789f455f9505638ae7618510b66", "score": "0.7463183", "text": "def check_user\n\n end", "title": "" }, { "docid": "5c3cfcbb4209701...