query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
9ff2c84c4833b20840bf68698748610e
set all the files to be unprocessed
[ { "docid": "69857e3d11ddf170d8deeaf0f8d325db", "score": "0.61127335", "text": "def reset_files files_id = nil\n sql = \"UPDATE #{@table_files} SET processed = 0 \" \n sql += \"WHERE file_id IN (#{RubyUtil::sqlize(files_id,no_parenthesis: true)})\" if files_id\n ...
[ { "docid": "2fc4ff857a0e7fccb7c0b08dea086dc5", "score": "0.7120525", "text": "def remove_all_files\n @files = {}\n end", "title": "" }, { "docid": "375e59f4b6a2118e49c434681492d2fa", "score": "0.64599204", "text": "def reset\n # absolute_path => SourceFile\n @source...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e08e58eb2787d5ca7764d66530dba026", "score": "0.0", "text": "def set_search_date\n if params[:commit]\n params[:end] = Date.today.strftime('%Y-%m-%d') if params[:end].blank?\n\n # spreader 只能查看前一天的数据\n if current_user.role?(:spreader) && Date.parse(params[:end]) >= D...
[ { "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...
5bac82fb7406217f4053d90fed0db8cd
Generate a signature for a sequence of [key, value] pairs source://rubyopenid//lib/openid/association.rb96
[ { "docid": "2fac205911067422e65df4b5d30ae1eb", "score": "0.0", "text": "def sign(pairs); end", "title": "" } ]
[ { "docid": "6f4a24e2d56da7a9d20134c07a9b78c4", "score": "0.6847823", "text": "def generate_signature_from_params params\n sorted_keys = params.keys.sort {|x,y| x.to_s <=> y.to_s }\n string_to_sign = @episodic_secret_key\n sorted_keys.each do |key|\n string_to_sign += \"#{ke...
e9f950e8c49b7262d5fdf8adfc42e049
Return 20 which are around the timestamp
[ { "docid": "75571dd83fe4abf16eca254b9b4332f8", "score": "0.0", "text": "def get_tracks\n html_tracks.map do |html_track|\n track(html_track)\n end\n end", "title": "" } ]
[ { "docid": "0525a4ad21f3624e90e44402c6c1de4e", "score": "0.6077187", "text": "def find_offsets\n offsets = []\n\n 0.upto(weblogs.count / DEFAULT_OFFSET) do |i|\n offsets << i * 20\n end\n\n offsets\n end", "title": "" }, { "docid": "192438f759b3e3f5ed624505dadf8747", "s...
b9b48668c308426dee74e0b79b8faa64
Tests that 6 location value returns 1 EDGE CASE
[ { "docid": "114fa6b115cbde80a3fab2223cf167b2", "score": "0.0", "text": "def test_seven_location_mine\n mock_map = Minitest::Mock.new('Mock Map')\n mock_map_finder = Minitest::Mock.new('Mock Map Finder')\n joe = Prospector.new(mock_map, mock_map_finder)\n assert_equal 1, joe.mine(1, 6)\n end...
[ { "docid": "0fff5c04058be956bd6624a029694035", "score": "0.67348313", "text": "def test_count_nodes_of_fourth_ave\n\t\tassert_equal 1, @location2.nodes.count\n\tend", "title": "" }, { "docid": "bae9d56a457e3b23c6bc5375aea475ee", "score": "0.65705514", "text": "def test_location_conne...
2eac40fed44d5c987745396dbbb474b0
Devise is going to do some operations in its controllers that require writing to a User object in the database. For example, it handles the signup and forgot password forms itself. So, it needs to know about any special parameters we added onto those forms so that Rails' strong parameters feature won't prevent those fr...
[ { "docid": "dfd4c982f5c03143e9a0ed73e9a4c7c4", "score": "0.0", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up) do |user|\n user.permit(:email, :password, :password_confirmation, :remember_me, :first_name, :last_name)\n end\n devise_parameter_saniti...
[ { "docid": "3fee48549dabe3c3f11b150ebaaa766c", "score": "0.7476909", "text": "def configure_permitted_parameters\n # sign up\n devise_parameter_sanitizer.for(:sign_up) << :username\n devise_parameter_sanitizer.for(:sign_up) << :birthday\n devise_parameter_sanitizer.for(:sign_up) << :phone\n ...
8d4fe8dc6b52f31b4966e877f0c87a37
Creates a copy of this machine in addition to copies of each associated event/states/callback, so that the modifications to those collections do not affect the original machine.
[ { "docid": "19de7e8e8f51aa3c53dbc38640fc7c7f", "score": "0.7143445", "text": "def initialize_copy(orig) #:nodoc:\n super\n\n @events = @events.dup\n @events.machine = self\n @states = @states.dup\n @states.machine = self\n @callbacks = {before: @callbacks[:before].dup, afte...
[ { "docid": "c00a93e6951b044ffd981db20495174f", "score": "0.7311297", "text": "def initialize_copy(orig) #:nodoc:\n super\n \n @states = @states.dup\n @events = @events.inject({}) do |events, (name, event)|\n event = event.dup\n event.machine = self\n ...
24abf606d8b108fa6944dff834242913
attr_accessible :user_id, :title, :episode, :ongoing, :date
[ { "docid": "0c8f50441c531d5c95441fa89ba9967c", "score": "0.0", "text": "def change(option, params)\n if self.user_id != params[:user_id]\n false\n elsif option == 'next'\n update_attributes(episode: self.episode.next, date: Time.now)\n elsif option == 'completed'\n update_attribu...
[ { "docid": "e33bf260935ed610f4053b3a486ab24c", "score": "0.6998988", "text": "def episode_params\n params.require(:episode).permit(:title, :is_completed)\n end", "title": "" }, { "docid": "a82fffabcfbcbeb4614e4f7dcabd044a", "score": "0.6888159", "text": "def episode_params\n p...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "4500ba84c89d43b2cb410e2ecfb2e51d", "score": "0.0", "text": "def semente_params\n params.require(:semente).permit(:kenia)\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...
01e84321390239ff69275308ff67c72b
This method's main use is to advance the read head to the actual records.
[ { "docid": "bd8da4d6d9aca5277dd24c9370672dc0", "score": "0.0", "text": "def read_header\n header_size = @file.read(2).unpack('n').first\n @version = @file.read(2).unpack('n').first + 1\n @offset += 4 + header_size\n @header = @file.read header_size\n @format_switching = true # archiveDif...
[ { "docid": "f1e3192accb569027fad1e56f852160b", "score": "0.6571265", "text": "def reading_order; end", "title": "" }, { "docid": "60c8e43141128740e7febf63c35d1790", "score": "0.64321274", "text": "def next_record\n @line_count += 1\n @fin.gets\n end", "title": ...
c71de3fbf6367573939dbaf1c01492a9
GET /scrapers/1 GET /scrapers/1.xml
[ { "docid": "9fd4771b93172e47b29d091c9f5b9000", "score": "0.6979717", "text": "def show\n @scraper = Scraper.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @scraper }\n end\n end", "title": "" } ]
[ { "docid": "2aee7b4423785691680a305f27f41d78", "score": "0.6145677", "text": "def new\n @scraper = Scraper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @scraper }\n end\n end", "title": "" }, { "docid": "b401b7e93576478d6b9dc4...
6c3b9c39729a607a8cadb05ea61c3829
Records whose spans include the query date. If no query date is given, the current date is the query date. Date span is _inclusive_: if the query date is equal to the span start or end date, that span counts as current.
[ { "docid": "2aebc7e3cd647aee7f3317d3fb817029", "score": "0.5037162", "text": "def current(query_date = Date.current)\n klass.where(\n current_condition(query_date: query_date, table: arel_table),\n )\n end", "title": "" } ]
[ { "docid": "472b35940d8e4b71ab0b3a8243006341", "score": "0.57778597", "text": "def buil_must_query_filter\n query_filter = [{ 'range' => date_range_filter }]\n query_filter | @raw_query\n end", "title": "" }, { "docid": "250b4a3d84f4e332c3378dcccd668e34", "score": "0.57264894", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "daba4fc26382f56e218ad4c5d28c901d", "score": "0.0", "text": "def set_documentos_empresa_perfil\n @documentos_empresa_perfil = DocumentosEmpresaPerfil.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...
a88b136a2fad4107d3b254b63766b261
Which statement most accurately describes why the the last line of the code below outputs "hi"?
[ { "docid": "bec7d62b417be8dc47f34c55e114572a", "score": "0.0", "text": "def extend_greeting(greeting)\n greeting + \" there\"\nend", "title": "" } ]
[ { "docid": "cea2fa62c924c90ed9f32f563d9775e8", "score": "0.63695717", "text": "def say_hi \n expression = \"I am a genius\"\n puts expression\n end", "title": "" }, { "docid": "afbb3fa258e80683ffa152119f7e2baa", "score": "0.5966066", "text": "def screams(words)\n words ...
0426a048bd2790466b4bb7f43dd91bbc
State transition tables end reduce 0 omitted reduce 1 omitted
[ { "docid": "3ab0a0ffb22d7977c8f5b4d3f8717f52", "score": "0.0", "text": "def _reduce_2(val, _values, result)\n result = 0 \n result\nend", "title": "" } ]
[ { "docid": "d2362715c0c3f16e1ed729405858e4b3", "score": "0.6313535", "text": "def transitions; TRANSITIONS end", "title": "" }, { "docid": "d2362715c0c3f16e1ed729405858e4b3", "score": "0.6313535", "text": "def transitions; TRANSITIONS end", "title": "" }, { "docid": "e033...
9e25d4440ab1999386d911d16791a823
The deserialization information for the current model
[ { "docid": "8b15efd0b108e73c1f3c2a48a8ca99ad", "score": "0.0", "text": "def get_field_deserializers()\n return super.merge({\n \"baseType\" => lambda {|n| @base_type = n.get_string_value() },\n \"properties\" => lambda {|n| @properties = n.get_collect...
[ { "docid": "613f62eeb3655523fae5d548dc6e7875", "score": "0.6580273", "text": "def get_field_deserializers()\n return {\n \"downloadUrl\" => lambda {|n| @download_url = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_val...
1e3698850d92a03534218508b6e4eba6
get_student converts the student_id given by the routing
[ { "docid": "aae4192d6b6738231cc01d3218776f27", "score": "0.79553074", "text": "def get_student\n @student = Student.find(params[:student_id])\n end", "title": "" } ]
[ { "docid": "bfdfc4ed08b682d6cbf316277cd2a57e", "score": "0.7572624", "text": "def find_student\n Student.find(params[:id])\n end", "title": "" }, { "docid": "668b3661f202f8b80602f6d63da8d16f", "score": "0.7522453", "text": "def show\n @student = find_student # Load the s...
1f625bcb0c75a6f087c0c8a12eedc028
first word in the simon says
[ { "docid": "5ecacd9a0b139d5b5184d1981662cc0b", "score": "0.71592087", "text": "def start_word(word)\n splitted = word.split(' ')\n return splitted[0]\nend", "title": "" } ]
[ { "docid": "46d3ec4d7aa96582074a9128c9518ab2", "score": "0.8025185", "text": "def first_word(mot)\n\treturn mot.split[0]\nend", "title": "" }, { "docid": "2a5995e5f58a86ff0753686f585fef2d", "score": "0.79925656", "text": "def first_word(mot5)\n mot5.split.first\nend", "title": "...
93a312006a690368307a838582dc9c56
Public: Create an Registrant object. Throws an exception if not valid
[ { "docid": "8df80ce174ca42515cd99b459f17edce", "score": "0.0", "text": "def build_and_save_imported_result(registrant_hash, user)\n registrant = find_existing_registrant(registrant_hash)\n registrant.gender = if registrant_hash[:gender] == \"m\"\n \"Male\"\n ...
[ { "docid": "4fd2dba4bf96b12297b132836d49b9d8", "score": "0.6410934", "text": "def create_registration\n @secret = random_password(500)\n Chef::FileCache.store(File.join(\"registration\", @safe_name), @secret)\n @rest.post_rest(\"registrations\", { :id => @safe_name, :password => @secret, ...
ffb878e3cad5c48c924f4569936efbb8
GET /tasks GET /tasks.json
[ { "docid": "05ce91a09405806620c8755939069d07", "score": "0.0", "text": "def index\n filter_all\n \n @tasks = Task.roots\n end", "title": "" } ]
[ { "docid": "b98d6e0f037b424760a46e9092d2ff7c", "score": "0.79928607", "text": "def my_tasks(params = {})\n get('my/tasks', params)\n end", "title": "" }, { "docid": "88cbd84bae17a5c5274ceb1f679ab64f", "score": "0.78916883", "text": "def get(params = {})\n response = cl...
14e823410a4de710a0f9cec5151af34e
Runs after the app's initializer
[ { "docid": "6608cce492e39a825e117f2361b251b7", "score": "0.71918833", "text": "def after_initializer!\n # puts 'after initializer'\n end", "title": "" } ]
[ { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.7694897", "text": "def after_setup\n end", "title": "" }, { "docid": "23f6862fb617ce457a90a5703d749367", "score": "0.7570079", "text": "def after_configure; end", "title": "" }, { "docid": "5edac9eb313dd2d82c...
dece24a40ae05bf280ba05be541b7a30
Takes one aurgument as the index No input validations
[ { "docid": "cdc61b422bbdbb1d6811aea895cdd5eb", "score": "0.0", "text": "def fibonacci_sequence index\n if index == 0 || index == 1\n return index\n else\n a = 0\n b = 1\n\n for i in 2..index\n c = a + b\n a = b\n b = c\n end\n\n return b\n end\nend", "title": "" ...
[ { "docid": "da2070a92ed7c9b176814ee3ac6ce157", "score": "0.673143", "text": "def index=(_arg0); end", "title": "" }, { "docid": "4e93d3498c60fd278f76dd1d401c15df", "score": "0.6557429", "text": "def simple_index\n end", "title": "" }, { "docid": "756e6550d02ef192e7f66aed...
f78f8756fea456a75826d4a1ffd1b221
Input: User selects a chair by number (user_select_product)
[ { "docid": "0a963646ed43b930cbb0b8748e41bc30", "score": "0.64929295", "text": "def user_selects_chair(chosen_chair)\r\n if valid_input(chosen_chair, @chairs)\r\n show_information_for(chosen_chair)\r\n else\r\n puts \"***************************\"\r\n puts \"Please enter a valid inpu...
[ { "docid": "cfb5f40e0d6bb0e35e20278b8f93ac32", "score": "0.7186817", "text": "def select_product\n puts Rainbow(' > ').black.underline.bg(:yellow) + 'Type your choice:'\n choice = ''\n coins = false\n while choice\n choice = gets.chomp\n @machine.check_for_product(choice) == 1 ? bu...
fc02f0e586a4d32f23f8e99bd5c4e352
Parse a log file (markdown) into html
[ { "docid": "8c1aaa7b5426121761c1307c9f6451a6", "score": "0.61588657", "text": "def parse_file(file_name)\n markdown_file = File.open(file_name).read\n doc = RDiscount.new(markdown_file)\n doc.to_html\nend", "title": "" } ]
[ { "docid": "c5196e91752183d4b860ee6c41f8ee9c", "score": "0.6588317", "text": "def readHtml(file, logkey='')\n filecontents = File.read(file)\n return filecontents\nrescue => logstring\n return ''\nensure\n Mcmlln::Tools.logtoJson(@log_hash, logkey, logstring)\nend", "title": "" }, { "doc...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "ae234a93c24600b86706e82957f02753", "score": "0.0", "text": "def update!(**args)\n @permissions = args[:permissions] if args.key?(:permissions)\n end", "title": "" } ]
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
610bf1a2d49acdddd26d4561c02a6bce
make a .install with all the bits and peices.
[ { "docid": "236bf883dc2a13d956f7df3b051a430e", "score": "0.0", "text": "def make_installer\n gtkv = APP['GTK']== 'gtk+-3.0' ? '3' : '2'\n arch = 'armhf'\n appname = \"#{APP['name'].downcase}\"\n rlname = \"#{appname}-#{APP['VERSION']}-gtk#{gtkv}-#{arch}\"\n #puts \"Creating Pkg...
[ { "docid": "2f861fd7e811efb7c91937ca9fbf2cad", "score": "0.79937863", "text": "def install\n end", "title": "" }, { "docid": "8e9711709a5d55e9845272876fb1f2fa", "score": "0.7939478", "text": "def install\n #python executable files\n end", "title": "" }, { "docid": ...
0ad1f93443f7f7a1242ef2cee6fb2eea
POST /carries POST /carries.json
[ { "docid": "de290156a56c31fd6e966a2da7cf857d", "score": "0.62297857", "text": "def create\n @carry = current_user.carries.new(carry_params)\n\n respond_to do |format|\n if @carry.save\n format.html { redirect_to @carry, notice: 'Carry was successfully created.' }\n format.json {...
[ { "docid": "b6824ac82a00454302a1d6854d5b390b", "score": "0.611348", "text": "def create\n @riesgo = Riesgo.new(riesgo_params)\n\n respond_to do |format|\n if @riesgo.save\n format.html { redirect_to @riesgo, notice: 'Riesgo was successfully created.' }\n format.json { render :sh...
f0ac08566f384faff67504f638189da1
Returns the gravtiational_parameter (GM) of the planetoid.
[ { "docid": "dddac8e9c591ff8204ded1c58e101adf", "score": "0.74910545", "text": "def gravitational_parameter\n Constants::G * self.mass\n end", "title": "" } ]
[ { "docid": "1aecadfcf164c5a829e9ae463eee8691", "score": "0.6489784", "text": "def getG\r\n return @g\r\n end", "title": "" }, { "docid": "72dab691902c0b7b669ecf3a27071e67", "score": "0.60087675", "text": "def gravitational_parameter=(mu)\n self.send(:mass=, mu / Constants::G...
ca9544cdcd4ce868b6ad50893b61889c
POST /log_items POST /log_items.json
[ { "docid": "fe02bdbee8e3cf7219fe3648bcbdba5c", "score": "0.71615815", "text": "def create\n @log_item = LogItem.new(params[:log_item])\n\n respond_to do |format|\n if @log_item.save\n format.html { redirect_to @log_item, notice: 'Log item was successfully created.' }\n format.js...
[ { "docid": "fbc5a73044f0b32d87446ea1fff587b6", "score": "0.6747223", "text": "def log\n item = RoastLogItem.new\n item.roast_id = params[:rid]\n item.t = params[:t]\n item.bt = params[:bt]\n item.et = params[:et]\n item.save\n\n # 1 = success\n render json: {result: 1}\n end", ...
91819d8dd9ff222a37e10e223318fad1
Called when page parsing starts
[ { "docid": "0b6042fafad952ac27bdb4da1e33a36d", "score": "0.56570464", "text": "def begin_page(arg = nil)\n @content << \"\"\n end", "title": "" } ]
[ { "docid": "6f5ad96a16721845c7d43b6126886367", "score": "0.7179471", "text": "def page_load; end", "title": "" }, { "docid": "8396b371b931608cf5b8648312b7e935", "score": "0.71573514", "text": "def after_parse; end", "title": "" }, { "docid": "8396b371b931608cf5b8648312b7e...
3651d0778fce5e10ac63119c9c69f7e5
Final submission button, creator will no longer be able to edit submission
[ { "docid": "3e14d164af05877bd5a04ed81680f0b5", "score": "0.0", "text": "def code_search\n @submission = Submission.find_by_data_directory(params[:id])\n puts \"Hello from code search\"\n authorize! :manage, @submission \n if !(params[:commit] =~ Regexp.new(/Submit Data for De...
[ { "docid": "0413240815854fc0bef6c6a0f2da97a1", "score": "0.7289349", "text": "def confirm_submission\n end", "title": "" }, { "docid": "129d76b8ab541f6b9698f3603c444b7c", "score": "0.69619006", "text": "def submission; end", "title": "" }, { "docid": "129d76b8ab541f6b969...
89a523dad1dadda1414dc4fd64f9297e
creates entire html page with stylesheet and table
[ { "docid": "b34f98d0568d944bb2e65d054a99e26b", "score": "0.0", "text": "def cut_htmlpage(title, form_name, form_action, script='', append_body='')\n html = %Q{\n <html>\n <head>\n <title>#{title}</title>\n <style type=\"text/css\">\n #{cut_htmlstyl...
[ { "docid": "5bd24a23167457cb3ed6ca23b3f312ba", "score": "0.72217256", "text": "def generate_table_of_contents\n setup\n\n template_file = @template_dir + 'table_of_contents.rhtml'\n return unless template_file.exist?\n\n debug_msg \"Rendering the Table of Contents...\"\n\n out_file = @out...
1e9e23e9c13e2eb0be873a19cda01fd6
parameters: string string to search for returns: => Array[Item], an array of all items that matched the search string
[ { "docid": "7f2509228300ad2472f46a8100680878", "score": "0.0", "text": "def query( string )\n self.parser.query(string)\n end", "title": "" } ]
[ { "docid": "f2a61d99d9f5aac1bb082c33dd5a5a42", "score": "0.6803643", "text": "def search_items(name, options = {})\n\t\t\tif (name.is_a?(Hash))\n\t\t\t\toptions = name\n\t\t\telse\n\t\t\t\toptions.merge!(:search => name)\n\t\t\tend\n\t\t\t\n\t\t\toptions.merge!(:type => @@search_types[:item])\n\t\t\tret...
e6271f65f4e496baab45ac936328a634
Spreadsheet feed URL of the spreadsheet.
[ { "docid": "29db0fbbc9f2469b65467c65aafa4f30", "score": "0.84430563", "text": "def spreadsheet_feed_url\n 'https://spreadsheets.google.com/feeds/spreadsheets/private/full/' + id\n end", "title": "" } ]
[ { "docid": "b6e7bfce7c868a02e05d914d92bf6222", "score": "0.86434966", "text": "def worksheet_feed_url\n return '%s/%s' % [spreadsheet.worksheets_feed_url, worksheet_feed_id]\n end", "title": "" }, { "docid": "1a5e1ef316bcf4f58045270674635243", "score": "0.8575447", "text": "d...
c0b46601f6b690076510f071ebc6d5f3
Clear information about routes
[ { "docid": "b4c5bf10db34ec690b3777e92580ffd7", "score": "0.83212584", "text": "def reset_routes\n @routes = {}\n end", "title": "" } ]
[ { "docid": "2caf4ee950066203d7bcc557fdf431ef", "score": "0.8120443", "text": "def purge_routes! \n @routes = [] \n end", "title": "" }, { "docid": "8a7b202f97ae366f49dcbabce3dead87", "score": "0.80516124", "text": "def reset_routes!\n endpoints.each(&:reset_routes!)\...
26bfc826e46c4c5e183ff9df88604b2d
Returns the current loggedin admin (if any).
[ { "docid": "89c886f81a682cd34d4696a33d73ec46", "score": "0.8256033", "text": "def current_admin\n @current_admin ||= Admin.find_by(id: session[:admin_id])\n end", "title": "" } ]
[ { "docid": "b876092875309045eacbe22bb5b33427", "score": "0.8582084", "text": "def current_admin\n if session[:admin_id]\n Admin.find(session[:admin_id])\n else\n false\n end\n end", "title": "" }, { "docid": "c766a8fcf8843e9d097f2542be611a4f", "score": "0.85249394", ...
bda012c5fd388eb5188e056eb929b69d
GET /users_teams/1 GET /users_teams/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "ca01de74c7cb33ac9bebb8c5c75ea4b7", "score": "0.7911688", "text": "def teams\n @title = \"Teams\"\n @user = User.find(params[:id])\n @teams = @user.teams\n render 'show_teams'\n end", "title": "" }, { "docid": "e74d505b5c71002c142c07cab5f6a95d", "score": "0.776518...
65022c3a0e86e47e63919c049b5cc044
Create a &39;fabric.PortOperation&39; resource.
[ { "docid": "fe29a821841a4fa239e3e99802ed4a9d", "score": "0.69712895", "text": "def create_fabric_port_operation_with_http_info(fabric_port_operation, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FabricApi.create_fabric_port_operation ...'\n ...
[ { "docid": "54e6475fbd3a8866706914523a2ce8d3", "score": "0.67144364", "text": "def create_fabric_port_operation(fabric_port_operation, opts = {})\n data, _status_code, _headers = create_fabric_port_operation_with_http_info(fabric_port_operation, opts)\n data\n end", "title": "" }, {...
b78eeb1d3f20b0dc5e588c6f253a2a9d
Create an array with key as the name of the items and x,y coordinate as value of the items
[ { "docid": "6ff5fb4720cf3add09e9f3d78daeb31f", "score": "0.0", "text": "def array_to_hash2(map)\r\n h = Hash.new # key: item, value: 1D array of [row, column]\r\n for r in 0...map.length\r\n for c in 0...map[r].length\r\n item = map[r][c]\r\n if item!= nil\r\n h[item] = [r, c]\r\n ...
[ { "docid": "9d731a53958a22dee3d1a04733da73ec", "score": "0.6836517", "text": "def make_new_xy_hash_keys\n x = $game_map.loop_horizontal? ? @x.round % $game_map.width : @x.round\n y = $game_map.loop_vertical? ? @y.round % $game_map.height : @y.round\n return [x,y]\n end", "title": "" }, ...
23f48a1b93f40893eee67e2ac82139e2
Test invalid input > 7 for current_city
[ { "docid": "68f6db20303dd97e7adbb901f08d1692", "score": "0.0", "text": "def test_next_location_invalid_city\n mock_map = Minitest::Mock.new('Mock Map')\n mock_map_finder = Minitest::Mock.new('Mock Map Finder')\n pete = Prospector.new(mock_map, mock_map_finder)\n def mock_map_finder.get_city_...
[ { "docid": "3307c76d75a286bee9ea2cc9516d634c", "score": "0.6754196", "text": "def city_isValid?(city)\n if(city.length < 3)\n false\n else\n true\n end\nend", "title": "" }, { "docid": "52dcd6917c978f87c835fe749f766770", "score": "0.663027", "text": "def city\r\n # raise ...
20cdf3e5ffc0f9e96e045304ce520187
reduce 518 omitted reduce 519 omitted
[ { "docid": "6bddb8c9d017173cd213e1aa9ebfd947", "score": "0.0", "text": "def _reduce_520(val, _values, result)\n result = \"&#{value(val[1])}\".to_sym\n \n result\nend", "title": "" } ]
[ { "docid": "dd458ee5bd7f974c08686357ef463ece", "score": "0.7527432", "text": "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "a72ccd2cf9eac3ad24d997538b04c62e", "score": "0.752555", "text": "def...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "518b4fd6ab05bfdf31bf8932b6f7bb00", "score": "0.0", "text": "def set_user\n @user = User.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310465", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60152966", "text": "d...
465747bac84b3ceb690cef05b2e3d1ee
[String] the end of the label source://syntax_tree//lib/syntax_tree/node.rb7105
[ { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.0", "text": "def value; end", "title": "" } ]
[ { "docid": "261c750d1bc74dd120b1013851c6024e", "score": "0.76769775", "text": "def visit_label_end(node); end", "title": "" }, { "docid": "0095d7199003dead881d419c166ee4d3", "score": "0.6903405", "text": "def LabelEnd(value); end", "title": "" }, { "docid": "d85399f454d4f...
198cb88cc008aba302888c99586615be
finds the index of target in a, returns nil if target does not exist in a
[ { "docid": "26f7aeddc69e034ff9f6e3ec50d856aa", "score": "0.6568508", "text": "def find_index(a, target) # this is where returning directly from withing block is ok!\n a.each_with_index do |e, index|\n return index if e == target # returns to caller on line 19. This is exactly what we want\n end\n ...
[ { "docid": "ce718f30becd3ecfd454de709ef75c00", "score": "0.76978654", "text": "def find(array, target)\n array.each_with_index do |element,index|\n return index if (element == target)\n end\n nil\nend", "title": "" }, { "docid": "705e205e342ea22238113baea8b1e428", "score": "0.75931...
53aee9ef0d2e0ab9d48b075cd647b460
Allows for multiple key deeply nested hash[:item][:measurement][:day][:hour] = val
[ { "docid": "8befea8b3d900cf6fe8cd749e3b45adb", "score": "0.0", "text": "def nested_hash_data_structure\n Hash.new { |hash, key| hash[key] = Hash.new(&hash.default_proc) }\n end", "title": "" } ]
[ { "docid": "74b27b458fdc165a85b9fdf19a582ddb", "score": "0.5459742", "text": "def dayhour\n days = {}\n Array(0..23).each do |a|\n days[a] = {}\n end\n @api_user.meta_logs.all.each do |poo|\n days[poo.time_of_passage.hour][poo.time_of_passage.wday] ||= 0 # init\n days[poo.time...
dfff5351c76f64467e729272d6071645
Execute the file through the REPL loop, noninteractively.
[ { "docid": "dc0de63afaddd6c17804ff143ff246e1", "score": "0.0", "text": "def load_file_through_repl(file_name); end", "title": "" } ]
[ { "docid": "1c24a81737d4009146f3f728d6073244", "score": "0.6703511", "text": "def run(file)\n # ...\n end", "title": "" }, { "docid": "2d9d65f6bc54dc081737b787093eb43c", "score": "0.6689086", "text": "def run(filename)\n # This is possibly the most evil Ruby I've written...
d50abe03a5b87e874fe8feb50c56dace
Renders an error with given title, text for closebutton and content given in a block.
[ { "docid": "beb04bbc7321218eb889819de5fbcfe1", "score": "0.78059083", "text": "def error_box title, close_text=\"\", &block\n render_flash 'application/error', title, close_text, &block\n end", "title": "" } ]
[ { "docid": "7ad02059d13a7e69a20815b334d0920e", "score": "0.6609057", "text": "def error_dialog(message:)\n return if message.nil?\n dialog(body_root) { |dialog_proxy|\n row_layout(:vertical) {\n center true\n }\n \n text 'Error Launching'\n \n styled_text(:bo...
64179924075ac81a1862258979620dcf
end : registrations start : users
[ { "docid": "b9b1d67662d47c5db9add6601b2fe892", "score": "0.0", "text": "def users_show\n current_user = User.find_by_id(params[:user_id])\n render json: AuthorizedUserPresenter.new(current_user)\n end", "title": "" } ]
[ { "docid": "da4a0caec79d6c5ddcbbe141d7135bb2", "score": "0.75740546", "text": "def registrations; end", "title": "" }, { "docid": "da4a0caec79d6c5ddcbbe141d7135bb2", "score": "0.75740546", "text": "def registrations; end", "title": "" }, { "docid": "da4a0caec79d6c5ddcbbe1...
c43b8741b289a04ec4b455057a05a0b7
repeat word based on num
[ { "docid": "8f065277df217c20dcd22fbeb2c50e2f", "score": "0.85029054", "text": "def repeat( word , num = nil )\n\n\tif num == nil\n\n\t\tword + \" \" + word\n\n\telse\n\n\t\t\"#{word} \" * ( num-1 ) + word\n\n\tend\n\nend", "title": "" } ]
[ { "docid": "3a97bd613ce43b8463bbeca169418495", "score": "0.8358254", "text": "def repeat(word, num=2)\n result = \"\"\n counter = 0\n num.times do |value|\n if value+1 == num\n result += word\n else\n result += word + \" \"\n end\n end\n return result\nend", "title": "" }, ...
0762474de518481df209dadb4ce3802e
Runs a script file
[ { "docid": "d2ed16f2f700f32933f1b9097f640c8e", "score": "0.7386452", "text": "def run_script(file, out = handler.interface, verbose=false)\n interface = ScriptInterface.new(File.expand_path(file), out)\n processor = ControlCommandProcessor.new(interface)\n processor.process_commands(verbo...
[ { "docid": "23fbfc491cd6bbc363ddd494a15e9b3a", "score": "0.7966749", "text": "def run_script(file=nil)\n\tif file == nil\n\t\tfile = $screen.ask(\"run script file: \",[\"\"],false,true)\n\t\tif (file==nil) || (file==\"\")\n\t\t\t$screen.write_message(\"cancelled\")\n\t\t\treturn\n\t\tend\n\tend\n\tif Fi...
59750e70f8dc87cbbf9cf61ac45944a3
Converts a JSON string into a Ruby object.
[ { "docid": "ad79a9130acd12fbabc0c4657eacc463", "score": "0.0", "text": "def decode(json)\n if !json.respond_to?(:read)\n json = StringIO.new(json)\n end\n data = ::Yajl::Parser.parse(json)\n if Crack.parse_json_times\n convert_dates_from(data)\n ...
[ { "docid": "c5e730f6761a54ca3f653da514410ece", "score": "0.8399703", "text": "def json_to_obj json_str\n hash_to_obj(parse_json(json_str))\n end", "title": "" }, { "docid": "a63974b22f867273ed33949d16d0bf21", "score": "0.74528253", "text": "def json_to_object(json)\n JSO...
80c34fd6318e21c57ad492ecd1717391
O mongo criptografa a senha com o tipo md5 com essa biblioteca conseguimos criptografar a string da senha
[ { "docid": "a8151531bd112da802e4dba5a129ffb4", "score": "0.7126533", "text": "def to_md5(pass) # recebo a senha no formato string\n return Digest::MD5.hexdigest(pass) # e retorna no formato md5\nend", "title": "" } ]
[ { "docid": "7e438bf378cdc1069df7631d5c66b639", "score": "0.67310303", "text": "def upload_auth_string\n Digest::SHA1.hexdigest( self.email + \"nomad\" ) \n end", "title": "" }, { "docid": "7e4d3038c2f44a3eb95d3915a8ef71a5", "score": "0.66222525", "text": "def hash_password(userna...
be396bdce6bbdc7d0e8d0d8f3fe6a759
Add parameter point instance to myself.
[ { "docid": "8a0239dc7bec4021c0db193580b238b6", "score": "0.58137274", "text": "def add!(point)\r\n @x += point.x\r\n @y += point.y\r\n end", "title": "" } ]
[ { "docid": "4853ee7413e750527226bab0499235f2", "score": "0.68533796", "text": "def add_parameter(id,handle,deriv_method) \n @params[id] = AmpParam.new(handle,deriv_method)\n end", "title": "" }, { "docid": "cc23e279a7ed10be1340fda212480756", "score": "0.66591126", "text": "de...
be3f0a3fc68fc3d900e4777ab0037f61
Clone or update the given Git environment. If the environment is being created for the first time, it will automatically update all modules to ensure that the environment is complete.
[ { "docid": "c58a3e4e809cd9b9be3f0e1f074f0aab", "score": "0.0", "text": "def sync\n @repo.sync(@ref)\n end", "title": "" } ]
[ { "docid": "82c8e8a2bb7df6fe05610390c0bd05c0", "score": "0.64734733", "text": "def update\n return self.clone unless File.exist? File.join(self.repo_path, '.git')\n\n FileUtils.cd(self.repo_path) {\n system('git', 'fetch', 'origin')\n\n if `git merge-base origin/master master`.empty?\n ...
26ddaca784eba782de66b3d43bc7360a
Calculates STATS Value for Mail Class
[ { "docid": "63c115b44786402f1f9d4b1986366bba", "score": "0.56887835", "text": "def statsClass(value)\n\t\tif value == 'FC'\n\t\t\treturn '10' #Code for First Class Mail\n\t\telsif value == 'PM' or value == 'CM'\n\t\t\treturn '20' #Code for Priority Mail\n\t\telsif value == 'S2'\n\t\t\treturn '40' #Code ...
[ { "docid": "96ac48a729dde6d3996ed134d8037bc1", "score": "0.6416169", "text": "def parse_stats(stats)\n @stats = stats\n mail\n end", "title": "" }, { "docid": "76e8e08900c9d5ca6c25c0910e7257f6", "score": "0.6284271", "text": "def statistics\n return stats_data if old? and !...
d6b1305eee1b3e0b94b379a27368ac04
Request GET GET KEY=xxx
[ { "docid": "b76f7990600ef9623918fea947fa45df", "score": "0.6844464", "text": "def get_request(req)\n m = /GET\\s+KEY=(?<key>\\S+)\\s*/i.match(req)\n return $database[ m[:key] ]\nend", "title": "" } ]
[ { "docid": "fbcd8e5b602f5a7a6cba362264c1d4e9", "score": "0.8189242", "text": "def get(url, key)\n _request(url, :GET, key)\n end", "title": "" }, { "docid": "dc9e093bfef4f238f99b64473d68b2f2", "score": "0.7698853", "text": "def key\n Net::HTTP.get(@uri.host, \"#{@uri...
de346bcbe4129e8a2cf2a5a9abea3f77
this is where the result gets returned
[ { "docid": "c6be462445db6c8d1357b8f1dc24dde6", "score": "0.0", "text": "def call\n if user\n session = Session.create(user: user)\n JsonWebToken.encode({user_id: user.id, uid: session.uid})\n end\n end", "title": "" } ]
[ { "docid": "f08d07e5dae8099bbf64a6863af3e087", "score": "0.76831484", "text": "def result ; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.7680875", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", ...
84a7a40352718e94edc2240e8fcfa6e5
This has to be done after parsing the Snapfile (iOS version)
[ { "docid": "28b8210dcd0acc8c77ec6fa660f1202d", "score": "0.0", "text": "def set_default_simulators\n self.devices ||= [\n \"iPhone 6\" + version_suffix(self.ios_version),\n \"iPhone 6 Plus\" + version_suffix(self.ios_version),\n \"iPhone 5\" + version_suffix(self.ios_version),\...
[ { "docid": "b5194492c867f4218239a653703480a4", "score": "0.5520702", "text": "def ios; end", "title": "" }, { "docid": "aebbca20990651f95019dae5db646fac", "score": "0.5385052", "text": "def parse_map_file()\n File.open(@options.map_file).each_line do |line| \n parts = li...
d39b80fb7a842633dc8a17b4ae806c29
Manual activation by the administrator Pass a block for behavior when a user fails to save
[ { "docid": "cb7923ad18b463551208fbc5ea971e27", "score": "0.67939687", "text": "def register_manually_by_administrator(user, &block)\n if user.save\n # Sends an email to the administrators\n Mailer.deliver_account_activation_request(user)\n account_pending\n else\n yield if bloc...
[ { "docid": "66e9be9874d2e20424cb103e0febdfd1", "score": "0.72837216", "text": "def register_automatically(user, &block)\n # Automatic activation\n user.activate\n user.last_login_on = Time.now\n if user.save\n self.logged_user = user\n send_notice l(:notice_account_activated)\n ...
c0b5a3a981b1d90064f2589c27aa7808
=begin def search_params search_params = 'Search Parameters:' search_params += ', Contract Id:' + params[:contract_id_s] if params[:contract_id_s].present? search_params += ', Received After Date:' + params[:received_after_date_s] if params[:received_after_date_s].present? search_params += ', Received Before Date:' + p...
[ { "docid": "355e2322ec6137f865fdd6a0c71aa939", "score": "0.0", "text": "def load_contract\n @contract = Projectx::Contract.find_by_id(params[:contract_id]) if params[:contract_id].present? && params[:contract_id].to_i > 0\n end", "title": "" } ]
[ { "docid": "71962e184db4de24a112df9c73fde460", "score": "0.69005495", "text": "def index\n if params[:text].present?\n @payments = Payment.joins(:user).where(\"(CAST(payment_code AS TEXT) LIKE '%#{params[:text]}%' OR LOWER(users.email) LIKE '%#{params[:text].downcase}%' OR LOWER(users.name) LIKE...
243d5be58c82ce640a890822478bc3ec
true if the second letter of the first name is a vowel
[ { "docid": "aecbe24e5a8ed940ac9c38ba7fa61981", "score": "0.8734473", "text": "def first_name_second_letter_vowel\n @@VOWELS.include?(first_name[1])\n end", "title": "" } ]
[ { "docid": "8e28abfc8513509ef00502f2bc4ed605", "score": "0.8259501", "text": "def is_vowel?(letter)\n \"aeiou\".include?(letter)\n end", "title": "" }, { "docid": "06d2874a49990233021054d711013f25", "score": "0.799197", "text": "def vowel(letter)\n if (letter==\"a\" || letter=...
7eb0cfc52c8d7f64cc7ef6354be44ad4
Restores saved screen state from the top of the stack
[ { "docid": "681c277c67286522caee91e0380864ce", "score": "0.861825", "text": "def restore_screen_state\n @screen.put(@saved_screen_state.pop, 0, 0)\n @screen.update_rect(0, 0, 0, 0)\n end", "title": "" } ]
[ { "docid": "4000a8dc0b57a6b5e66d3bdadae6ee91", "score": "0.76788735", "text": "def revert_state\n\t\t\t@stack = @saved_stack\n\t\tend", "title": "" }, { "docid": "e67e3a881d17cfa8625bda954a12668b", "score": "0.7294832", "text": "def restore; set_window_state :SW_RESTORE; end", ...
5c89b54c275d763b0b19c7e460b6dcd9
Comprueba que se especifica la sala de streaming, en caso de que vaya a haberlo
[ { "docid": "4209ec62b0da51b36304756c5f1f02a6", "score": "0.62248635", "text": "def streaming_room_is_valid\n if self.streaming_live\n if !self.stream_flow_id\n errors.add :streaming_room, \"está sin especificar. Debes elegir la sala.\"\n else\n # Comprobar la sala\n if ...
[ { "docid": "feac5eedb116027d2ea6ff7b8dbf93c2", "score": "0.73025525", "text": "def streaming?\n !stream.nil?\n end", "title": "" }, { "docid": "feac5eedb116027d2ea6ff7b8dbf93c2", "score": "0.73025525", "text": "def streaming?\n !stream.nil?\n end", "title": "" }...
f6a2a9b8e6836f59d485fa70a3955416
Initialize method: initializes tokens atributtes. Parameters: type: token name, it refers to key dictionary. value: it refers to some tokens (string, interger, identifier, bitsexpression) take. line: where the token is. column: where the token is.
[ { "docid": "bdef91ce0f37c9998737f596aa2747d6", "score": "0.7573102", "text": "def initialize(type, value=nil, line=0, column=0)\n\t\t@type = type\n\t\t@value = value\n\t\t@locationinfo = {\n\t\t\tline: line,\n\t\t\tcolumn: column\n\t\t}\n\t\t@tokenswithvalue = [\"string\", \"integer\", \"identifier\", \...
[ { "docid": "fb3c0167ea5ef003a0b1d02da228dea0", "score": "0.7863559", "text": "def initialize(type, value, line, column)\n @value = value\n @type = type\n @line = line\n @column = column\n @next_token = nil\n @prev_token = nil\n @next_code_token = nil\n ...
3b7456e57a41e120669f9d2c2e8c200d
Are the results in this reader a preview from an unfinished search? Returns: +true+ or +false+, or +nil+ if the stream is empty.
[ { "docid": "f80c8409e62a479438812adb2b1c9842", "score": "0.5872653", "text": "def is_preview?\n return @is_preview\n end", "title": "" } ]
[ { "docid": "0dad0f3892c7912fe6f0432c8c392a48", "score": "0.66239876", "text": "def stream_results?\n (@opts[:stream] || db.stream_all_queries) && streamable?\n end", "title": "" }, { "docid": "79921b663906827dc255386cbd863da3", "score": "0.64756316", "text": "def results?\n ...
424525750fcef1e64946bff4ea872104
Feel free to google "how to generate a random number in ruby"
[ { "docid": "bd4085c1f3be5a6efd3fb0d1e73081e1", "score": "0.0", "text": "def roll\n rand(1..6)\nend", "title": "" } ]
[ { "docid": "794db8d94fb6d82d6da040ab33447650", "score": "0.85596156", "text": "def get_random_number()\n return rand(0x7fffffff).to_s\n end", "title": "" }, { "docid": "64cd186fbbba838a5356ef0035eb8174", "score": "0.85422206", "text": "def get_random_number()\n rand(0x7fffffff...
6ef70fc516c7f40d05e38874e47b8d3e
Calculated postfix notation given a space delimited expression
[ { "docid": "3a1d44cbad2b8d2b535c65dcb2981907", "score": "0.6996846", "text": "def calculate_postfix_expression(expression)\n counter = 0\n stack = []\n expression_array = expression.split(' ')\n while counter != expression_array.length\n input = expression_array[counter]\n flag = f...
[ { "docid": "9617b38ad55954533c399f3a0f1e3eee", "score": "0.80434996", "text": "def evaluate_postfix(postfix_expression)\n\nend", "title": "" }, { "docid": "1fc89516453f80805a5d09ddbd9ec994", "score": "0.7856842", "text": "def evaluate_postfix(postfix_expression)\n stack = Stack.new\...
65b3ba83165b3af7b2961c6399bd6b67
GET /contacts/1 GET /contacts/1.xml
[ { "docid": "29ff24303de10da227c3bcc1d02eddbf", "score": "0.6978007", "text": "def show\n @contact = Contact.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @contact }\n end\n end", "title": "" } ]
[ { "docid": "680464823216e7f4871a0a4894b924aa", "score": "0.751213", "text": "def contacts()\n get('contactsList')\n end", "title": "" }, { "docid": "8eea3a2e86364d38226af95d61abd66e", "score": "0.7464368", "text": "def contacts\n get('contacts')\n end", "title": "" ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "08fb6df8e001a932d267367ae3f94b06", "score": "0.0", "text": "def tqrdc_job_params\n params.require(:tqrdc_job).permit(:object_name, :objectid, :email, :job_owner, :job_params, :job_class, :job_action, :job_flag, :job_start_time, :job_run_time, :job_end_time, :comment)\n end", "tit...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496205", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957069", "text": "def strong_params\n params.require(:request).permit(param_white...
42102a43da130305967df3e95495112c
Sets the amount of storage. Provide a block which will lazily set the storage curve.
[ { "docid": "04232dcdb67f1001348967a7d21c8e2f", "score": "0.6604712", "text": "def inject_storage(volume, &curve)\n storage = @node.dataset_get(:storage)\n storage.send(:volume=, volume)\n\n @node.dataset_lazy_set(:storage_curve, &curve)\n\n nil\n end", "title": "" ...
[ { "docid": "0aa7745fe6045362536125569ccd263e", "score": "0.6137604", "text": "def storage_block_removable_storage=(value)\n @storage_block_removable_storage = value\n end", "title": "" }, { "docid": "0c9430b7c20ab1d1ff18f19bf5d0eba3", "score": "0.6100957", "...
69f8bd8b55a42ed837ba421f6c1008c9
Si le fichier "naturel" n'existe pas, on cherche le premier fichier ruby. Cela se produit par exemple avec le gem rubyzip dont le main a pour nom zip.rb
[ { "docid": "7a3bc8e0c618d0104ef3101149686e39", "score": "0.0", "text": "def real_main_file_name\n @real_main_file_name ||= File.basename( main_file_path )\n end", "title": "" } ]
[ { "docid": "460885c30e42ac010f1e04e97886c87f", "score": "0.5727444", "text": "def zipfile; end", "title": "" }, { "docid": "fbc58f618a0b3b1eeacf6631a0a2ff72", "score": "0.5658618", "text": "def package_code(files)\n fname2 = \"package.zip\"\n File.delete(fname2) if File.exi...
1b2604f0a655edb520e780ddb9867408
transform a PDF into the data we want to extract
[ { "docid": "a1b9715e88fd7be0485bd03ae6eeac64", "score": "0.6989268", "text": "def parse_pdf(pdf, pdf_basename, pct=nil)\n tmp_dir = File.join(Dir::tmpdir, DEFAULT_NAME)\n Dir.mkdir(tmp_dir) unless Dir.exist?(tmp_dir)\n\n open( pdf_path = File.join(tmp_dir, pdf_basename) , 'wb'){|f| f << pdf} # ...
[ { "docid": "e751e2c0c64da6828280e5cec1ce669c", "score": "0.7155493", "text": "def transformPDFGem\n #Get pdf size\n reader = PDF::Reader.new(PDF_FILE)\n lastPage = reader.page_count - 1\n\n out = open(\"output.csv\", 'w')\n\n extractor = Tabula::Extraction::ObjectExtra...
f0162c90e40be22eafc46b78af14a285
Returns +true+ if this table is empty.
[ { "docid": "673fd549db417f2f1e9508560276e85d", "score": "0.0", "text": "def empty?\n @a_set.empty? and @h_set.empty?\n end", "title": "" } ]
[ { "docid": "de35a06e51ec8fdac465a43345ecb730", "score": "0.89898825", "text": "def empty?\n @table.empty?\n end", "title": "" }, { "docid": "a35bab9303221973bee5cece5107347d", "score": "0.8922532", "text": "def empty?\n @table.empty?\n end", "title": "" }, ...
746355f057c71bbf29e6155e20527df4
Save ticket Optional argument is what to update if the ticket object is not altered
[ { "docid": "e21e8222ccee36bd951c55b7b9098982", "score": "0.7420109", "text": "def save(update = nil)\n update = self.to_hash.to_xml(:root => \"ticket\") unless update\n Unfuddler.put(\"projects/#{self.project_id}/tickets/#{self.id}\", update)\n end", "title": "" } ]
[ { "docid": "15a8a856d78d77e0a8ec1d2181aa73e2", "score": "0.7523838", "text": "def save\n if self.id == \"ticket/new\"\n self.create\n else\n self.update\n end\n end", "title": "" }, { "docid": "9da566e4fe978af447a630f2ffd81cd7", "score": "0.72061926", ...
8727f61fdfc4697c8e6cc3b3f0125ee8
Iterates over all possible paths.
[ { "docid": "6a60b225e90c6f0b213ba82ace191147", "score": "0.70858425", "text": "def each(&block)\n @path.each(&block)\n end", "title": "" } ]
[ { "docid": "d7a81df15d6ec59ed26cfa570427f20c", "score": "0.7112433", "text": "def each_path\n iter = iterator\n iter.enable_path\n if block_given?\n g = graph\n while item = iter.next\n path = iter.path.map do |e|\n e.graph ||= g rescue nil\...
a78b9ac5838dc27f5e888769053922cc
Create a list of Works
[ { "docid": "e6dd0fe892351bf823643cae22af689f", "score": "0.0", "text": "def create_worksv3(orcid, opts = {})\n data, _status_code, _headers = create_worksv3_with_http_info(orcid, opts)\n data\n end", "title": "" } ]
[ { "docid": "29d95a3c330396a9d25651777a608bc9", "score": "0.7066374", "text": "def work_list\n Work.all_ordered.map {|w| [w.title, w.id]}\n end", "title": "" }, { "docid": "89fbf42bef1291135f97d0096ff3bff0", "score": "0.6983173", "text": "def creatable_works\n all_works.select ...
163126c27965ff43c7dd77ef894ec208
GET /user_skill_assignments/1 GET /user_skill_assignments/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "e5b913dbaf2348adad034487d81d1c2a", "score": "0.67877907", "text": "def set_user_skill_assignment\n @user_skill_assignment = UserSkillAssignment.find(params[:id])\n end", "title": "" }, { "docid": "e92fd8e8d30ed8ee8e97c960483cc763", "score": "0.65485066", "text": "...
3ed4459f78c9e0f53130e25f5484e263
Returns the name of the plugin at the given path.
[ { "docid": "d44d521937ebb5f29b05f6d0c2b402fb", "score": "0.89688104", "text": "def plugin_name(path)\r\n File.basename(path)\r\n end", "title": "" } ]
[ { "docid": "c7e7d098d8b207e297e784789a614f71", "score": "0.8867664", "text": "def plugin_name_from_path(path)\n path = Pathname.new(path).expand_path.cleanpath\n each do |plugin|\n if path.to_s =~ /^#{plugin.root}/\n return plugin.name\n end\n end\n ...
4362ea06d2f067856c6ee8bf813ec0ae
create hash of space types and generic ratios of building floor area currently no reason to split apart doe and deer inputs here
[ { "docid": "13459605ae94879e6ab556a6398586ce", "score": "0.67478323", "text": "def get_space_types_from_building_type(building_type, template, whole_building = true)\n hash = {}\n\n # TODO: - Confirm that these work for all standards\n # DOE Prototypes\n if building_type == 'SecondarySchool'...
[ { "docid": "ecfa9d7b27a80cc3edadd377c9fb4de7", "score": "0.6999078", "text": "def building_form_defaults(building_type)\n hash = {}\n\n # DOE Prototypes\n\n # calculate aspect ratios not represented on Table 4.2\n primary_footprint = 73958.0\n primary_p = 619.0 # wrote measure using calcu...
9337ef2866c7ca7545d11c4f9f37a766
returns the index of a winning position or nil if there isn't such position
[ { "docid": "dceadf064aa8928224375cddfc4dc8e8", "score": "0.0", "text": "def two?(array, symbol)\n array.count(symbol) == 2 ? array.find_index(' ') : nil\nend", "title": "" } ]
[ { "docid": "cf555a86afd56f38ec8307b3b6ea07f4", "score": "0.7409971", "text": "def find_winning_position(player)\n rows.each_with_index do |row, index|\n # returns an array of index values for ' ' in @board\n if Board.two_in_scope(row, player) && Board.space_in_scope(row)\n re...
14460205ccd6f3fe1e56913c208cbed1
Check whether the indian mobile number entered is valid or not. Here valid means mobile no. will have the prefix 9, 8 or 7. It will not tell whether that number exists or not. For e.g valid_indian_mobile_number?(9123456789) will return false(and print message 'Mobile no. should be a String.') puts valid_indian_mobile_n...
[ { "docid": "acf3c9ef3742c0e9f4b2f1248e67ce70", "score": "0.87381357", "text": "def valid_indian_mobile_number?(mobile_no)\n is_valid_mobile_no?(mobile_no) ? is_valid_data_with_format?(mobile_no, /^([9]{1}|[8]{1}|[7]{1})([0-9]{9})$/, \"Mobile no.\") : false\nend", "title": "" } ]
[ { "docid": "e9305940437b8513f9b116ab2ef0f5df", "score": "0.7877726", "text": "def is_valid_mobile_no?(mobile_no)\n (mobile_no.to_i > 0) ? valid_mobile_no_length?(mobile_no) : false\nend", "title": "" }, { "docid": "1bbbe53df0e2c48bd875f61d2a9599f4", "score": "0.7495285", "text": "de...
6e5ac5d674a2eaf1664e36bb139c37e8
Gets the principalName property value. Name of the principal.
[ { "docid": "ef2294f5754a21e7de1062c0ad584a65", "score": "0.8124705", "text": "def principal_name\n return @principal_name\n end", "title": "" } ]
[ { "docid": "723fd1da6b6cd417b010811362509d4c", "score": "0.769689", "text": "def principal_name=(value)\n @principal_name = value\n end", "title": "" }, { "docid": "723fd1da6b6cd417b010811362509d4c", "score": "0.769689", "text": "def principal_name=(value)\n...
f76573b53d28ae912ad8e263de7b52dd
Apply inherited attributes (as defined by inherited_attributes) from an older version from the package's package branch and unit
[ { "docid": "feef2ea7085855f5a309a869659ad911", "score": "0.69848186", "text": "def apply_previous_version_attributes(package)\n previous_version = Package.where(:package_branch_id => package.package_branch_id, :unit_id => package.unit_id).order('version DESC').first\n if previous_version.p...
[ { "docid": "5bb846e9f49dd03272c172fa2a036cdb", "score": "0.69695866", "text": "def apply_previous_version_attributes(package)\n previous_version = Package.where(package_branch_id: package.package_branch_id, unit_id: package.unit_id).order(\"version DESC\").first\n if previous_version.prese...
7485f26b8fe3683ccd8d88bc2f6fddec
read given file and create a list of views
[ { "docid": "97d9b0671f27ae9a512eea0142227373", "score": "0.5416937", "text": "def list\n file_correct?(@file_path)\n file = File.open(@file_path)\n file.map { |row| row.split(' ') }\n end", "title": "" } ]
[ { "docid": "a37801816e01de74e82efb858cfec8ae", "score": "0.68189627", "text": "def create_views file_name\n %W(list_item main_item).each do |view|\n create_file \"app/views/#{file_name.pluralize}/_#{view}.html.#{options.views.downcase}\", File.read(File.join(File.expand_path('../templates', __FI...
f1dc95b5a1177702afcf53fa78000119
Add a ticket to the cart.
[ { "docid": "6972d4f465771a141b8aa0eb65ddec9d", "score": "0.7425344", "text": "def add(ticket_id)\n @items << ticket_id\n end", "title": "" } ]
[ { "docid": "84321075adb819d1a4c00c3d4b32038a", "score": "0.68967026", "text": "def add_ticket(name, trips, prices, opts = {})\n data, _status_code, _headers = add_ticket_with_http_info(name, trips, prices, opts)\n return data\n end", "title": "" }, { "docid": "0f9fde0bf2c0ad5f46...
70388bab1384303d217a88f53e2ebea4
Args : Returns : Raises :
[ { "docid": "af2b3dc0742a738663e3c8935ceb9f79", "score": "0.0", "text": "def description\n res = (@package.short_description ? @package.short_description : \"Description not available\") + \"\\n\"\n return res unless @package.long_description\n @package.long_description.each_line do |line|...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.73723006", "text": "def private; end", "title": "" }, { "docid": "fe4579a8b911d5f578c266d6a8013be2", "score": "0.6925589", "text": "def exceptions; end", "title": "" }, { "docid": "f5cc358536014ae4f00727558d578b6f...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ceee29a556672022b164bbd2c954de5c", "score": "0.0", "text": "def events_parser_params\n params.require(:events_parser).permit(:eventName_xpath, :eventLocation_xpath, :eventDateTime_xpath, :eventDescription_xpath, :eventPrice_xpath, :eventImage_xpath)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7498391", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958937", "text": "def strong_params\n params.require(:request).permit(param_white...
f2153a58aa7eceaa24685690f595813b
Create or Update current instance to QuickBook
[ { "docid": "3b1c4b830ed4ec6910ba84dba1f76994", "score": "0.6830131", "text": "def save!\n new_record = self.is_new_record\n \n before_save\n before_create if new_record\n before_update unless new_record\n \n params = {}\n params[:operation] = :update unless(self.i...
[ { "docid": "c02a8e1e047e02b981879dff39c51e4a", "score": "0.63666904", "text": "def update\n create\n end", "title": "" }, { "docid": "c02a8e1e047e02b981879dff39c51e4a", "score": "0.63666904", "text": "def update\n create\n end", "title": "" }, { "docid": "c02a8e1e...
7d135cc0d8b1db2898bee55414b19861
GET /providers GET /providers.xml
[ { "docid": "d7581220aefb4d925ae91223ed36fe68", "score": "0.70664036", "text": "def index\n @providers = Provider.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @providers }\n end\n end", "title": "" } ]
[ { "docid": "4911d9bd2d5fde87cf11a11428709a56", "score": "0.7171377", "text": "def index\n @providers = Provider.all\n\n respond_to do |format|\n format.json { render json: @providers }\n format.xml { render xml: @providers }\n end\n end", "title": "" }, { "docid": "d92c6f...
833b3789f1a7095a0f71f3f301268130
get post by cpid
[ { "docid": "6b7b5a3288ca2d44ae85d005222bc4a3", "score": "0.72599536", "text": "def cms_get_post cpid = 1, tpl = :cms_body_post\n\t\t@res = {}\n\t\tds = DB[:cms_post].filter(:cpid => cpid.to_i)\n\n\t\tunless ds.empty?\n\t\t\t@title \t\t\t= ds.get(:title) + \" - \" + @title\n\t\t\t@res \t\t\t= ds.first\n\...
[ { "docid": "0ff534779eb3e55db1e9840689e5c36e", "score": "0.6876706", "text": "def post(postid)\n request(:id => postid).posts.first\n end", "title": "" }, { "docid": "f268fce11a588e9cd56f0087a1d09ba4", "score": "0.65695196", "text": "def read_post(post_list, id)\n post =...
d19d18f5252e066a5f000dcd5e7bbd76
Used for PRIVATE applications where the AccessToken uses the token/secret from Xero which would normally be used in the request. No request authorisation necessary. For PUBLIC/PARTNER applications this is used to recreate a client from a stored AccessToken key/secret.
[ { "docid": "8ba450737f7916471e6c7c180d3039a7", "score": "0.63573974", "text": "def authorize_from_access(atoken, asecret)\n @atoken, @asecret = atoken, asecret\n end", "title": "" } ]
[ { "docid": "c15f7fc12771cf43fb9ef8f8d3f8d64b", "score": "0.7187269", "text": "def oauth2_request_token_client_credentials\n if request_param(:client_secret).blank?\n return render_response(:error_description => \"Application secret must be provided\", :error => :invalid_request)\n end\n\n ...
a06879521725f249a8580050d542005d
Is the device a 3x device? (e.g. iPhone 6 Plus, iPhone X)
[ { "docid": "104046d096958aa4bc39f766cf3049a2", "score": "0.65656966", "text": "def triple_density?\n (screen_size == Deliver::AppScreenshot::ScreenSize::IOS_55 || screen_size == Deliver::AppScreenshot::ScreenSize::IOS_58)\n end", "title": "" } ]
[ { "docid": "e54b6775a247cdd9cc76751ab31853ba", "score": "0.6306413", "text": "def physical_device?\n arches.any? do |arch|\n arch[/arm/, 0]\n end\n end", "title": "" }, { "docid": "61cf305bbf412903bbc55d67eae8e299", "score": "0.6283061", "text": "def iphone_4?\n ...
2c691f59e7208597289e249dc16ee6d8
TEMP ADD FOR DEV ONLY!
[ { "docid": "1c94297d837c615df891e9b6c54ee900", "score": "0.0", "text": "def destroy\n\t\t@addressing.destroy\n\t\tredirect_to study_subject_contacts_path(@addressing.study_subject)\n\tend", "title": "" } ]
[ { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.68068933", "text": "def in_use; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.68068933", "text": "def in_use; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", ...
554718a9eab32ee5423e28a4feb0cd84
Delete Subscription by ID
[ { "docid": "7bbd9b4c93f8a9bccfd0108b08dd94de", "score": "0.0", "text": "def delete_subscription_by_id_with_http_info(project_key, id, version, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.delete_subscription_by_id ...'\n end\n ...
[ { "docid": "342618a88de0a281c507efba46fd98fc", "score": "0.88797635", "text": "def delete_subscription(subscription_id); end", "title": "" }, { "docid": "4e016e2cde6e5c2f99ec7b4c6ec284c5", "score": "0.8357995", "text": "def delete_subscription(subscription_id)\n request :delete,\n...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "13d1e72ff185d21fbf078f7a592e211f", "score": "0.0", "text": "def plano_params\n params.require(:plano).permit(:preco, :desconto, :inicio, :fim, :empresa_id, :licencas, :transaction_code, :estados=>[], :user_ids=>[])\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7493595", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6954758", "text": "def strong_params\n params.require(:request).permit(param_white...
ed1938868470da7d2007ae58d06b97f4
Calculate "human" age from birthdate
[ { "docid": "d5d67906e79d0f4f046df8e9b0734369", "score": "0.7788516", "text": "def age\n now = DateTime.now\n age = now.year - birthdate.year\n if((now.month < birthdate.month) or\n (now.month == birthdate.month and now.day < birthdate.day))\n age -= 1 \n end\n age\n end", ...
[ { "docid": "6a1a073ff751b269637dbb4655a013be", "score": "0.8434004", "text": "def age\n Date.today.year - birthdate[/\\d+$/].to_i\n end", "title": "" }, { "docid": "dbe48aa6f55ba2a388bc60f3838a21ef", "score": "0.83608705", "text": "def age\n return \"-\" if birthday.blank?...
c367cb3be4ae6e5497f333d786d1d171
Returns a channel class for this kind
[ { "docid": "b98db4d77b6ae29f2a1cc8f2a43891c7", "score": "0.71704483", "text": "def to_channel\n \"#{self}_channel\".camelize.constantize\n end", "title": "" } ]
[ { "docid": "797873127b545e382d960d8ec6a84231", "score": "0.8080198", "text": "def channel_class\n Channel\n end", "title": "" }, { "docid": "2d6eec58b74641ba2e1414c299c50217", "score": "0.70323974", "text": "def channel\n '%s_%d' % [self.class.name.downcase, self.id]\n end", ...
5bd034e4ab8829776f341f9f97c37a80
GET /jam_circles GET /jam_circles.json
[ { "docid": "4c29a04105e079880d4c18449f8ed88e", "score": "0.71492434", "text": "def index\n @jam_circles = @user.jam_circles\n #@jam_circle = JamCircle.new\n end", "title": "" } ]
[ { "docid": "333411677aa6e165628506527df82afa", "score": "0.6859654", "text": "def index\n @circle = current_user.circle\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @circle }\n end\n end", "title": "" }, { "docid": "a91f666272a...
170f26007ff62c93dd8266d1dba18078
GET /measurement_units/1 GET /measurement_units/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "cd7ff55289853a19e84920d7673336c1", "score": "0.78815347", "text": "def get_unit_of_measure\n url = \"#{BASE_URL}/unitsofmeasure/v1/active\"\n res = RestClient.get(url, HEADERS)\n JSON.parse(res.body)\n end", "title": "" }, { "docid": "348ce2ff3cf3bcb96508266e224...
9ad46af780370c90f58acd5c2c98d5b5
If a table has two column names ending in _id, it's probably a join and should be indexed for join lookups in either direction.
[ { "docid": "02515fbe7145ef81a5acecf20f72d311", "score": "0.6016374", "text": "def joins_needing_indexes(table_name)\n results = columns_needing_indexes(table_name).reject { |name| name == :id }\n results.size == 2 ? [results.map(&:to_sym)] : []\nend", "title": "" } ]
[ { "docid": "8049bd8ef32e4134809d3b48ffde8f17", "score": "0.6438321", "text": "def col_id; end", "title": "" }, { "docid": "91e7854b634356187dbd40f3db907b61", "score": "0.63131386", "text": "def columns_needing_indexes(table_name)\n results = []\n DATABASE.columns(table_name).each d...