query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Time complexity: log10(n) where n is the number Space complexity: constant only a certain number of variables are being saved
def is_palindrome(number) return false if number == nil return true if number == 0 reverse = 0 while number > 0 temp = number # can check if temp = reverse digit = number % 10 reverse = reverse * 10 + digit number = number / 10 # number_even = number * 10 + digit p "temp: #{temp}" p ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def persistence(n, count = 0)\n return count if n < 10\n i = 0\n arr = n.to_s.split('')\n if arr.length > 1\n tot = arr.map(&:to_i).inject(:*)\n i += 1\n count += 1\n tot.to_i >= 10 ? persistence(tot.to_i, count) : count\n end\nend", "def persistence(n)\n array = n.to_s.split('').map(&:to_i)\n\...
[ "0.6290754", "0.5881367", "0.5731116", "0.5460566", "0.5444045", "0.54381984", "0.5346959", "0.5339212", "0.5306365", "0.52947444", "0.5211323", "0.52081925", "0.52062374", "0.5194149", "0.5157503", "0.5111779", "0.5101904", "0.51001024", "0.50771224", "0.50591135", "0.505001...
0.0
-1
Helper method to ensure to create deep clones of our test data. Without it merge_two_lists() will amend the linked node instance passed in which will effect subsequent tests.
def deep_copy(obj) Marshal.load(Marshal.dump(obj)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_copy(list)\n @nodes = @nodes.map { |node|\n node2 = node.clone\n node2.parent = self\n node2\n }\n end", "def deep_clone; end", "def add_to_lists\n\n [1,2,3,4,5,6,7,8].each do |x|\n list1.add(x)\n end\n [22,4,2].each do |x|\n list2.add(x)\n ...
[ "0.6395608", "0.6119971", "0.6096356", "0.60690856", "0.59696376", "0.5912753", "0.5799911", "0.5753044", "0.56623083", "0.563285", "0.5592047", "0.55613375", "0.555311", "0.5530634", "0.5527225", "0.551828", "0.5502058", "0.54789174", "0.547747", "0.5443678", "0.54095644", ...
0.0
-1
Helper method to create our test linked lists
def create_linked_list(values) nodes = [] previous_node = nil values.each do |num| previous_node = ListNode.new(num, previous_node) nodes.push(previous_node) end nodes.reverse end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ll_create()\n return Linked_List.new()\nend", "def test_new_list\n ll = List::LinkedList.new\n assert_equal(nil, ll.head, \"Head should be nil for a new list\")\n end", "def create_list\n list = SinglyLinkedList.new\n list.insert_at_end 1\n list.insert_at_end 2\n list.insert_at_end 3\n list.in...
[ "0.7068897", "0.70168895", "0.6840993", "0.68309844", "0.65460074", "0.6461431", "0.6361582", "0.6277597", "0.6140656", "0.6126031", "0.6119894", "0.6094283", "0.60567427", "0.6053884", "0.6002768", "0.59127384", "0.5889758", "0.5889758", "0.5889758", "0.58318883", "0.5823371...
0.6233272
8
Generates mock RDF data to be validated against SHACL shapes.
def fake_data_generator(query, output_document) ############ # Removed this, as it is not necessary ############ #uris_hash = Hash.new #uris_hash.default_proc = proc {|k| k} #File.foreach(query_document_location) {|line| # case line # when /^PREFIX (\w+:) (<.+)>/i #if the line...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shacl_validator(rdf_graph, shacl_document)\n shacl_shapes = Hash.new\n responsive_endpoints = Array.new\n graph = RDF::Graph.load(rdf_graph)\n File.foreach(shacl_document) {|line|\n case line\n when /^EU/\n @endpoint_url = line.match(\"^EU\\t(.+)\\n\")[1]\n ...
[ "0.59491575", "0.5930994", "0.5670787", "0.5663192", "0.5481332", "0.5453406", "0.5453406", "0.5446053", "0.5368908", "0.5357249", "0.528991", "0.5255429", "0.5255429", "0.5249552", "0.5203612", "0.5176187", "0.51747304", "0.5155507", "0.51543975", "0.51266205", "0.5121678", ...
0.61063415
0
Uses the SHACL and linkeddata gems to validate the fake data against a database of SHACL shapes.
def shacl_validator(rdf_graph, shacl_document) shacl_shapes = Hash.new responsive_endpoints = Array.new graph = RDF::Graph.load(rdf_graph) File.foreach(shacl_document) {|line| case line when /^EU/ @endpoint_url = line.match("^EU\t(.+)\n")[1] when /^SH/ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate\n dataset_hash = {}\n property_hash = {}\n\n assets.each do |asset|\n datasets, properties = asset.prefetch_zfs\n\n datasets.each do |ds|\n dataset_hash[ds] = true\n end\n\n properties.each do |p|\n property_hash[p] = true\n end\n ...
[ "0.5541509", "0.54076433", "0.5364776", "0.52838063", "0.5265693", "0.52607507", "0.52605075", "0.5246392", "0.5240202", "0.5240202", "0.5240202", "0.5209564", "0.51975393", "0.5193047", "0.51369196", "0.5133081", "0.5118421", "0.51069784", "0.5089158", "0.50808334", "0.50706...
0.67853665
0
GET /admin/interviews/1 GET /admin/interviews/1.json
def show @admin_interview = Interview.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @admin_interview } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @interviews = Interview.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end", "def my_interviews\n @interviews = Interview.find(:all, :conditions => ['teacher_id = ?', self.current_user.teacher.id])\n \n res...
[ "0.75892943", "0.7386502", "0.7230198", "0.7196845", "0.7160898", "0.71457744", "0.7088583", "0.69878215", "0.6932509", "0.69013476", "0.688786", "0.68003756", "0.67976975", "0.6737055", "0.66796863", "0.6674815", "0.6631992", "0.65190595", "0.6487266", "0.6461964", "0.645304...
0.76884276
0
GET /admin/interviews/new GET /admin/interviews/new.json
def new @admin_interview = Interview.new respond_to do |format| format.html # new.html.erb format.json { render json: @admin_interview } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @s = Script.find(params[:id])\n @interview = @s.interviews.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interview }\n end\n end", "def new\n @interview = Interview.new\n respond_to do |format|...
[ "0.7793802", "0.7679838", "0.7452258", "0.73235714", "0.72380245", "0.710132", "0.70811754", "0.707889", "0.7063838", "0.69936794", "0.688496", "0.68649256", "0.68272394", "0.6752868", "0.67157596", "0.66808885", "0.667513", "0.6618428", "0.6616309", "0.6615228", "0.6570978",...
0.79113215
0
POST /admin/interviews POST /admin/interviews.json
def create @admin_interview = Interview.new(params[:interview]) respond_to do |format| if @admin_interview.save format.html { redirect_to [:admin, @admin_interview], notice: 'Entrevista criada com sucesso.' } format.json { render json: [:admin, @admin_interview], status: :created, locatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @interview = Interview.new(params[:interview])\n\n @interview.user_id = current_user.id\n\n respond_to do |format|\n if @interview.save\n format.html { redirect_to admin_interviews_path, notice: 'Interview was successfully created.' }\n format.json { render json: @interview...
[ "0.7124914", "0.70181745", "0.68313247", "0.6784429", "0.6719041", "0.66969794", "0.6696921", "0.65586215", "0.65363425", "0.65228575", "0.64347905", "0.6394291", "0.6393086", "0.63792795", "0.633606", "0.6320753", "0.62989616", "0.6289668", "0.6249542", "0.6169992", "0.61426...
0.6626136
7
PUT /admin/interviews/1 PUT /admin/interviews/1.json
def update @admin_interview = Interview.find(params[:id]) respond_to do |format| if @admin_interview.update_attributes(params[:interview]) format.html { redirect_to [:admin, @admin_interview], notice: 'Entrevista atualizada com sucesso' } format.json { head :no_content } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @interview = Interview.find_by_slug(params[:id])\n\n respond_to do |format|\n if @interview.update_attributes(params[:interview])\n format.html { redirect_to admin_interviews_path, notice: 'Interview was successfully updated.' }\n format.json { head :no_content }\n else\n...
[ "0.7406994", "0.68848073", "0.6833547", "0.6794967", "0.6788148", "0.6627882", "0.65965635", "0.6548512", "0.6499188", "0.64745986", "0.6457879", "0.6457124", "0.6457124", "0.6457124", "0.6457124", "0.6454925", "0.64541906", "0.6448637", "0.6382948", "0.63273454", "0.6293811"...
0.69994766
1
DELETE /admin/interviews/1 DELETE /admin/interviews/1.json
def destroy @admin_interview = Interview.find(params[:id]) @admin_interview.destroy respond_to do |format| format.html { redirect_to admin_interviews_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @interview = Interview.find_by_slug(params[:id])\n @interview.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_interviews_path, notice: 'Interview was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @interview.de...
[ "0.78311193", "0.7537294", "0.74492455", "0.7412634", "0.7343516", "0.7295022", "0.72634196", "0.72634196", "0.72601205", "0.7071746", "0.6957982", "0.6945215", "0.6832726", "0.6806007", "0.6770745", "0.6768013", "0.67666626", "0.6740101", "0.67123187", "0.6681724", "0.662505...
0.80169797
0
Mongoid documents on this snapshot.
def documents(name = nil) self.document_classes ||= {} class_name = "#{self.class.name}#{id}#{name}".underscore.camelize key = "#{class_name}-#{name || DEFAULT_COLLECTION_KEY_NAME}" self.document_classes[key] ||= begin document_block = document_blocks[name || DEFAULT_COLLECTION...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all\n documents\n end", "def documents\n @mapped_documents ||= Basecamp3::Document.all(bucket.id, id)\n end", "def documents\n collections.each_with_object(Set.new) do |(_, collection), set|\n set.merge(collection.docs).merge(collection.files)\n end.to_a\n end", "def a...
[ "0.70939493", "0.70834893", "0.6897171", "0.6823713", "0.6807244", "0.66642517", "0.66427886", "0.66407305", "0.66407305", "0.6627026", "0.66165787", "0.65628123", "0.6540502", "0.65325415", "0.64536667", "0.6386951", "0.63767385", "0.6350456", "0.6328198", "0.6281439", "0.62...
0.6903311
2
Since we should always be using the latest instance of this class, this method is called after each save making sure only at most two instances exists should be sufficient to ensure that this data can be rebuilt live without corrupting any existing computations that might have a handle to the previous "latest" instance...
def ensure_at_most_two_instances_exist all_instances = self.class.order_by([[:created_at, :desc]]).to_a return unless all_instances.length > max_collection_snapshot_instances all_instances[max_collection_snapshot_instances..-1].each(&:destroy) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_instance!\n\t\tself.last_attempted = Time.now\n\t\tself.save\n\tend", "def save\n @@all << self\n @@all = @@all.uniq\n end", "def reredisize_instance\n attrs = Redisable.as_json_for(self)\n key = Redisable.key_name_for(self.model_name.name, attrs, \"instance\")\n\n # binding.pr...
[ "0.6212796", "0.59911245", "0.59315395", "0.592137", "0.5898952", "0.5879984", "0.58429825", "0.5817881", "0.5779533", "0.57391524", "0.57228047", "0.57136303", "0.570546", "0.5701094", "0.5698093", "0.5697484", "0.56839764", "0.5647509", "0.5635025", "0.56230783", "0.5608148...
0.5845522
6
Override to supply custom database connection for snapshots
def snapshot_session Mongoid::Compatibility::Version.mongoid5? ? Mongoid.default_client : Mongoid.default_session end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect_to_old_db\n ActiveRecord::Base.establish_connection(\n :adapter => \"postgresql\",\n :host => \"localhost\",\n :username => \"postgres\",\n :password => \"vegpuf\",\n :database => \"affluence_staging_25_june\"\n )\nend", "def setup_connection(conn)\n conn = super(conn)\...
[ "0.6493348", "0.64001685", "0.6361013", "0.62592", "0.6220856", "0.62192947", "0.61600524", "0.6156008", "0.6124448", "0.6124448", "0.6124448", "0.610097", "0.60541415", "0.6050574", "0.603021", "0.6025176", "0.6017122", "0.60167587", "0.60146654", "0.60093135", "0.5999603", ...
0.0
-1
GET /app_requests GET /app_requests.json
def index @app_requests = AppRequest.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_applist\n return get_response(\"applist\", :json)\n end", "def friend_requests\n get(\"users/requests\").requests\n end", "def index\n @requests = Request.all\n\n render json: @requests\n end", "def getApplications(ak)\n uri='https://api.newrelic.com/v2/applications.json'\...
[ "0.6562141", "0.64685744", "0.64669627", "0.6386659", "0.63302726", "0.6241761", "0.6236718", "0.6232599", "0.62183577", "0.6206983", "0.6154279", "0.6133203", "0.60895526", "0.6056589", "0.6056589", "0.6054511", "0.6051918", "0.6049799", "0.60074973", "0.6002356", "0.5990760...
0.69046354
0
GET /app_requests/1 GET /app_requests/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @app_requests = AppRequest.all\n end", "def index\n @requests = Request.all\n\n render json: @requests\n end", "def index\n @requests = Request.all\n\n respond_to do |format|\n format.json { render :json => @requests}\n end\n end", "def index\n @requests = ::Request...
[ "0.6700072", "0.66316175", "0.62819284", "0.6240398", "0.6236686", "0.6236686", "0.620987", "0.6185004", "0.6144979", "0.61367816", "0.61285365", "0.61083436", "0.6106268", "0.60674274", "0.60638636", "0.6047723", "0.603297", "0.6016626", "0.60164624", "0.5951037", "0.5939557...
0.0
-1
POST /app_requests POST /app_requests.json
def create @app_request = AppRequest.new(app_request_params) @app_request.order_uid = SecureRandom.uuid tm_response = faraday.post do |req| req.url uri.path req.headers['Content-Type'] = 'application/json' req.headers['X-API-KEY'] = @app_request.public_key req.body = @app_request.to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app_request_params\n params.require(:app_request).permit(:title, :description, :user_name, :image_url, :amount, :order_uid, :user_uid, :status, :response, :public_key, :app_id)\n end", "def create\n megam_rest.post_appreq(to_hash)\n end", "def post_app_generate(application_id, type, opts={}...
[ "0.6318708", "0.6073466", "0.5833184", "0.5829856", "0.5767368", "0.5749808", "0.5747969", "0.56848955", "0.56050646", "0.55591774", "0.5496488", "0.5490389", "0.5458009", "0.5438665", "0.5431467", "0.54260164", "0.5410148", "0.5407609", "0.54068875", "0.53899646", "0.5375842...
0.65364003
0
PATCH/PUT /app_requests/1 PATCH/PUT /app_requests/1.json
def update respond_to do |format| if @app_request.update(app_request_params) format.html { redirect_to @app_request, notice: 'App request was successfully updated.' } format.json { render :show, status: :ok, location: @app_request } else format.html { render :edit } forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch!\n request! :patch\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update!(**args)\n ...
[ "0.6728816", "0.65197074", "0.6465222", "0.6465222", "0.6465222", "0.6465222", "0.64515305", "0.6327536", "0.6312979", "0.6306376", "0.62526643", "0.6147511", "0.61220556", "0.6099396", "0.6096619", "0.60312027", "0.6030068", "0.602999", "0.60040635", "0.5989069", "0.5989069"...
0.66821694
1
DELETE /app_requests/1 DELETE /app_requests/1.json
def destroy @app_request.destroy respond_to do |format| format.html { redirect_to app_requests_url, notice: 'App request was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_co...
[ "0.70909435", "0.7061845", "0.7061845", "0.7061845", "0.70369166", "0.7010124", "0.6982707", "0.6982707", "0.6982707", "0.6982707", "0.6982707", "0.6982707", "0.69122815", "0.6852682", "0.6850285", "0.68240786", "0.6812502", "0.6798304", "0.67723393", "0.6748194", "0.67365724...
0.7264306
0
Use callbacks to share common setup or constraints between actions.
def set_app_request @app_request = AppRequest.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163754", "0.6045816", "0.5944853", "0.59169096", "0.58892167", "0.58342934", "0.5776148", "0.57057375", "0.57057375", "0.56534296", "0.56209534", "0.54244673", "0.54101455", "0.54101455", "0.54101455", "0.53951085", "0.5378493", "0.53563684", "0.53399915", "0.5338049", "0...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def app_request_params params.require(:app_request).permit(:title, :description, :user_name, :image_url, :amount, :order_uid, :user_uid, :status, :response, :public_key, :app_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
POST /posts POST /posts.json
def create # create post preview # params[:post][:image] = file @post = Post.find(params[:post][:id]) post_params[:image] = parse_image(post_params[:image]) respond_to do |format| if @post.update_attributes(post_params) format.html { redirect_to @post, notice: 'Post was successfully ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n render json: Post.create(params[\"post\"])\n end", "def create\n respond_with Post.create(params[:posts])\n end", "def create\n @post = Post.create(post_params)\n render json: @post, serializer: PostSerializer\n end", "def create\n @post = Post.new(post_params)\n @po...
[ "0.74463975", "0.73221767", "0.73072433", "0.7123966", "0.7015686", "0.701327", "0.69841874", "0.6939327", "0.69313824", "0.69053805", "0.68196476", "0.6812792", "0.6793222", "0.6792862", "0.6779654", "0.6779654", "0.67625546", "0.67602354", "0.67515427", "0.6735786", "0.6698...
0.0
-1
PUT /posts/1 PUT /posts/1.json
def update require 'CanvasToImage' @post = Post.find(params[:id]) post_params[:image] = parse_image(post_params[:image]) respond_to do |format| if @post.update_attributes(post_params) format.html { redirect_to @post, notice: 'Post was successfully updated.' } format.json { head :n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end", "def update\n respond_with Post.update(params[:id], params[:posts])\n end", "def update\n respond_with post.update(params[:id], params[:post])\n end", "def update\n title = params[:title]\n body ...
[ "0.7308219", "0.7123652", "0.68159384", "0.66432106", "0.66181636", "0.6607148", "0.6583982", "0.6564183", "0.6552021", "0.6532697", "0.6511846", "0.64877653", "0.6446283", "0.64321554", "0.64155626", "0.638547", "0.63833165", "0.63661736", "0.63641906", "0.6363359", "0.63632...
0.0
-1
DELETE /posts/1 DELETE /posts/1.json
def destroy @post = Post.find(params[:id]) @post.destroy respond_to do |format| format.html { redirect_to posts_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @post.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n post = Post.find(params[:id])\n if post.destroy\n render json: {status: \"success\", data: {id: param...
[ "0.8046927", "0.76904076", "0.7584888", "0.7580699", "0.7568424", "0.75054324", "0.7504039", "0.74757856", "0.746826", "0.74662447", "0.7464773", "0.7460266", "0.7460266", "0.7460266", "0.7460266", "0.7458692", "0.7458692", "0.7458692", "0.7458692", "0.7458692", "0.7458692", ...
0.74296105
58
This is a makeshift integration testsuite. It is unapologetically pragmatic. Build Jekyll
def build(options={}) if options[:octopress_config] FileUtils.cp options[:octopress_config], '_octopress.yml' end config = ['_config.yml'] << options[:config] cmd = "rm -rf site && bundle exec jekyll build --config #{config.join(',')}" `#{cmd}` `rm _octopress.yml` if options[:octopress_config] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_site\n sh \"bundle exec jekyll build\"\nend", "def publish!\n inform \"Publishing local version to http://chapmanu.github.io/web-components\"\n \n # Production Configuration\n inform \"Building site with production configuration\"\n Jekyll::Site.new(Jekyll.configuration({\n \"sourc...
[ "0.7017783", "0.650636", "0.64922434", "0.63929504", "0.60748243", "0.60523516", "0.60306275", "0.60229546", "0.5979493", "0.5951181", "0.59273785", "0.5874407", "0.5861819", "0.58177227", "0.58031774", "0.58004916", "0.57688916", "0.57286286", "0.572028", "0.570118", "0.5685...
0.5982492
8
Find all files in a given directory
def dir_files(dir) Find.find(dir).to_a.reject!{|f| File.directory?(f) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_files dir = test_dir\n glob file_pattern(dir)\n end", "def find_files_in_dir dir\n unless dir.exist?\n warn \"Can't find files in dir %s as it doesn't exist!\",\n dir.relative_path_from(project.path + '..').to_s\n return []\n end\n Dir.chdir dir ...
[ "0.8331152", "0.8240673", "0.7887335", "0.7754628", "0.7754539", "0.7686412", "0.7657768", "0.7576014", "0.75407636", "0.7519798", "0.74429137", "0.741848", "0.7417882", "0.7326174", "0.7286366", "0.72749156", "0.72688746", "0.72461295", "0.72290295", "0.72250456", "0.7215048...
0.7393999
13
Recursively diff two directories This will walk through dir1 and diff matching paths in dir2
def test_dirs(desc, dir1, dir2) test_missing_files(desc, dir1, dir2) dir_files(dir1).each do |file| file2 = file.sub(dir1, dir2) if File.exist?(file2) if diff = diff_file(file, file2) @failures << { desc: "#{desc}\nDiff of file: #{file.sub(dir1+'/', '')}\n", result: forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diff(other)\n require_cmd! diff_cmd\n out = nil\n\n begin\n this_dir = unpack\n other_dir = other.is_a?(Polisher::Gem) ? other.unpack :\n (other.is_a?(Polisher::Git::Repo) ? other.path : other)\n result = AwesomeSpawn.run(\"#{diff_cmd} -r #{t...
[ "0.6624741", "0.65473133", "0.6228981", "0.61263657", "0.5989251", "0.5959465", "0.59548604", "0.58983207", "0.58076084", "0.5782673", "0.57296693", "0.57036024", "0.55951595", "0.5580223", "0.55594206", "0.5434139", "0.54184353", "0.53967804", "0.5364152", "0.5296669", "0.52...
0.70733756
0
List differences between files in two directories
def test_missing_files(desc, dir1, dir2) files1 = dir_files(dir1).map {|f| f.sub(dir1,'') } files2 = dir_files(dir2).map {|f| f.sub(dir2,'') } missing = [] (files2 - files1).each do |file| missing << File.join(dir1, file) end (files1 - files2).each do |file| missing << File.join(dir2, file) end...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dirs(desc, dir1, dir2)\n\n test_missing_files(desc, dir1, dir2)\n\n dir_files(dir1).each do |file|\n file2 = file.sub(dir1, dir2)\n if File.exist?(file2)\n if diff = diff_file(file, file2)\n @failures << {\n desc: \"#{desc}\\nDiff of file: #{file.sub(dir1+'/', '')}\\n\",\n ...
[ "0.73994696", "0.6979385", "0.6800087", "0.6594987", "0.65707284", "0.6560404", "0.65558606", "0.6535047", "0.64815235", "0.64293736", "0.64161813", "0.6352613", "0.6337029", "0.63219535", "0.6296564", "0.62568873", "0.62531525", "0.6247148", "0.6247148", "0.62377155", "0.622...
0.63017243
14
Print a single character without a newline
def pout(str) print str $stdout.flush end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_char(c)\n chars = %w( nul sch stx etx eot enq ack bel bs tab nl vtab\n ff cr so si dle dcl dc2 dc3 dc4 nak syn etb\n can em sub esc fs gs rs us sp\n )\n return(chars[c.ord])\nend", "def charPrint (line)\n if line\n if line.chomp.to_f > 0...
[ "0.73401654", "0.7114488", "0.6989605", "0.69641304", "0.6857021", "0.6857021", "0.6857021", "0.6857021", "0.68243057", "0.677378", "0.6712038", "0.6654945", "0.6649074", "0.6620677", "0.6563535", "0.65390533", "0.6532054", "0.6333835", "0.63221395", "0.62941676", "0.628304",...
0.0
-1
Ouptut nicely formatted failure messages
def print_results if !@failures.empty? @failures.each do |test| pout "\nFailed: #{test[:desc]}" puts test[:result] # print a newline for easier reading puts "" end abort else puts "All passed!".green end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def failure_message\n actual = prettify_args(@actual)\n matcher = prettify_matcher(@metadata[:name])\n\n if @metadata[:args].count > 0\n args = prettify_args(*@metadata[:args])\n\n \"'#{actual}' should #{matcher} '#{args}'\"\n else\n \"'#{actual}' should #{mat...
[ "0.7450089", "0.740242", "0.73875004", "0.7379986", "0.73239136", "0.72808325", "0.7271744", "0.7253975", "0.7236903", "0.7213801", "0.7160938", "0.71027595", "0.70964634", "0.70800257", "0.7031168", "0.70111877", "0.69894415", "0.69292325", "0.69026625", "0.690029", "0.68871...
0.69895893
16
GET /genotypes GET /genotypes.json
def index @genotypes = Genotype.paginate(:page => params[:page], :per_page => 10) respond_to do |format| format.html # index.html.erb format.json { render json: @genotypes } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @genotype = Genotype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @genotype }\n end\n end", "def new\n @genotype = Genotype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render ...
[ "0.752311", "0.6907363", "0.6516887", "0.6253212", "0.60463625", "0.60332775", "0.60071874", "0.59711707", "0.59517837", "0.59213865", "0.59024435", "0.59024036", "0.587385", "0.58668494", "0.5862647", "0.58599746", "0.5851007", "0.5828915", "0.58158284", "0.5814034", "0.5796...
0.7398953
1
GET /genotypes/1 GET /genotypes/1.json
def show @genotype = Genotype.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @genotype } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @genotype = Genotype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @genotype }\n end\n end", "def index\n @genotypes = Genotype.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.ht...
[ "0.7261204", "0.7180017", "0.6713851", "0.66001344", "0.6411719", "0.61086065", "0.60833174", "0.60087687", "0.59432656", "0.5937902", "0.58860207", "0.5857614", "0.58569396", "0.58360535", "0.58249277", "0.5814832", "0.58036727", "0.58006257", "0.57965744", "0.5796226", "0.5...
0.7854708
0
GET /genotypes/new GET /genotypes/new.json
def new @genotype = Genotype.new respond_to do |format| format.html # new.html.erb format.json { render json: @genotype } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @genotype = Genotype.new(params[:genotype])\n\n respond_to do |format|\n if @genotype.save\n format.html { redirect_to @genotype, notice: 'Genotype was successfully created.' }\n format.json { render json: @genotype, status: :created, location: @genotype }\n else\n ...
[ "0.8013191", "0.7349489", "0.73259366", "0.7238918", "0.70517236", "0.70303667", "0.6988727", "0.69741786", "0.695166", "0.6950832", "0.6942038", "0.6940981", "0.69385016", "0.69336224", "0.69336224", "0.6876676", "0.6875818", "0.68367505", "0.68287116", "0.6828361", "0.68197...
0.84171075
0
POST /genotypes POST /genotypes.json
def create @genotype = Genotype.new(params[:genotype]) respond_to do |format| if @genotype.save format.html { redirect_to @genotype, notice: 'Genotype was successfully created.' } format.json { render json: @genotype, status: :created, location: @genotype } else format.html ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @genotype = Genotype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @genotype }\n end\n end", "def index\n @genotypes = Genotype.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.ht...
[ "0.6676974", "0.60717314", "0.58924747", "0.5888059", "0.57347214", "0.5632866", "0.56112695", "0.55987906", "0.5597687", "0.5577753", "0.5565157", "0.55225813", "0.55186963", "0.5498868", "0.54789203", "0.5461002", "0.5436766", "0.5434363", "0.5433009", "0.5419976", "0.54144...
0.7590582
0
PUT /genotypes/1 PUT /genotypes/1.json
def update @genotype = Genotype.find(params[:id]) respond_to do |format| if @genotype.update_attributes(params[:genotype]) format.html { redirect_to @genotype, notice: 'Genotype was successfully updated.' } format.json { head :ok } else format.html { render action: "edit" } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @genotype = Genotype.new(params[:genotype])\n\n respond_to do |format|\n if @genotype.save\n format.html { redirect_to @genotype, notice: 'Genotype was successfully created.' }\n format.json { render json: @genotype, status: :created, location: @genotype }\n else\n ...
[ "0.6823907", "0.61659634", "0.61518383", "0.61133415", "0.5707914", "0.5675617", "0.5576485", "0.5547783", "0.5475", "0.5465067", "0.5460842", "0.54508036", "0.54282576", "0.53496814", "0.5346226", "0.53284985", "0.52909607", "0.52797866", "0.52717716", "0.5256078", "0.523235...
0.74300104
0
DELETE /genotypes/1 DELETE /genotypes/1.json
def destroy @genotype = Genotype.find(params[:id]) @genotype.destroy respond_to do |format| format.html { redirect_to genotypes_url } format.json { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @gen = Gen.find(params[:id])\n @gen.destroy\n\n respond_to do |format|\n format.html { redirect_to gens_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @genre_type = GenreType.find(params[:id])\n @genre_type.destroy\n\n respond_to do |format|\n ...
[ "0.6897447", "0.67987347", "0.67395383", "0.6709877", "0.6709877", "0.6608084", "0.65707165", "0.6559709", "0.654064", "0.6535016", "0.6525001", "0.6500034", "0.6484143", "0.6478279", "0.6467863", "0.64629036", "0.6455527", "0.6451266", "0.64511085", "0.645101", "0.6447252", ...
0.79775655
0
Use callbacks to share common setup or constraints between actions.
def set_note @note = Note.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Only allow a trusted parameter "white list" through.
def note_params params[:note] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.638045...
0.0
-1
Filter translations according to the specified scope.
def filter(translations, scopes) scopes = scopes.split(".") if scopes.is_a?(String) scopes = scopes.clone scope = scopes.shift if scope == "*" results = {} translations.each do |scope, translations| tmp = scopes.empty? ? translations : filte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter\n translation_ids = params[:translations].to_s.split(',')\n @translations = load_translations.where(id: translation_ids)\n render\n end", "def uhook_filtered_search filters = {}\n create_scopes(filters) do |filter, value|\n case filter\n when :loc...
[ "0.708393", "0.68440586", "0.59015274", "0.5845365", "0.58114994", "0.5800537", "0.576809", "0.57675433", "0.57588196", "0.5512152", "0.5468367", "0.54258156", "0.54239184", "0.54199356", "0.541793", "0.53500754", "0.53220004", "0.5305016", "0.53022015", "0.52794355", "0.5257...
0.7093354
0
Initialize and return translations
def translations ::I18n.backend.instance_eval do init_translations unless initialized? translations end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_translations; end", "def translations; end", "def translations\n @translations ||= {}\n end", "def translations\n raise \"i18n has no load_path(s)\" if ::I18n.load_path.empty?\n ::I18n.backend.instance_eval do\n init_translations unless initialized?\n translations\n en...
[ "0.8662648", "0.8275244", "0.78821176", "0.75941557", "0.7350742", "0.7279201", "0.71360785", "0.71167094", "0.7006746", "0.6895449", "0.6891217", "0.6854467", "0.6854467", "0.685434", "0.6782168", "0.67576194", "0.6752125", "0.673747", "0.66973096", "0.6676449", "0.6645142",...
0.8008066
2
Creates a table in the DB
def create_table(table) raise IMDB::DatabaseExceptions::TableExists.new(table.name) if @tables.has_key? table.name @tables[table.name] = table end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_table(*params)\n connection.create_table(*params) {}\n end", "def create_table\n ActiveRecord::Migration.create_table(table_name) do |t|;end;\n end", "def create\n\t\tsql = \"CREATE TABLE `#{@table}` (\"\n\t\t@columns.each do |column|\n\t\t\tsql += \"`#{column[:name]}` #{column[:type...
[ "0.8575991", "0.8318925", "0.8188716", "0.8077461", "0.80338806", "0.802433", "0.7993852", "0.79891574", "0.7976557", "0.7943529", "0.77716404", "0.7758705", "0.7750842", "0.7648436", "0.76353186", "0.76262885", "0.7607858", "0.75984913", "0.75742584", "0.75636345", "0.755207...
0.7682277
13
Finds a table in the DB.
def find_table(table) raise IMDB::DatabaseExceptions::TableDoesNotExist.new(table) unless @tables[table] @tables[table] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_table(table_name)\n db.execute <<-SQL\n Select * from #{table_name}\n SQL\n rescue SQLite3::SQLException\n false\n end", "def check_table_exists(id, timeout=nil)\r\n find_by_id_and_tag(id, \"table\", timeout)\r\n end", "def find(table,query)\n connection.find(path(table),query)...
[ "0.69742775", "0.68364775", "0.67684907", "0.6669672", "0.66498005", "0.66012305", "0.655244", "0.651209", "0.6511236", "0.62953246", "0.6199241", "0.6043452", "0.6006383", "0.6004135", "0.5969854", "0.59242976", "0.5911125", "0.5893935", "0.58873355", "0.5864879", "0.5837405...
0.77174187
0
Executes a SQL statement agains the DB.
def execute(sql_statement) parse(sql_statement) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(sql)\n @database_handle.execute(sql)\n end", "def execute sql\n db[sql]\n end", "def execute(sql)\r\n\t\t@connection.Execute(sql)\r\n\tend", "def execute(sql)\n @db.send(:_execute, self, sql, :log=>false) \n end", "def execute(*args)\n @db.execute(*args)\n end", ...
[ "0.8343201", "0.8050831", "0.7869256", "0.78490597", "0.78410304", "0.78395367", "0.7792349", "0.7783148", "0.7662619", "0.76616055", "0.7548966", "0.75182277", "0.7476211", "0.7455025", "0.74467117", "0.7358405", "0.7331048", "0.7309401", "0.72984946", "0.72978014", "0.72859...
0.66749585
71
NOTE: We are comparing names in Ruby, since MySQL is not case sensitive. `AuthorName.find_by("BINARY name = ?", name)` also works, but I'm not sure how it handles weird characters.
def call parsed_author_names.map do |name| AuthorName.where(name: name).find { |case_sensitive_name| case_sensitive_name.name == name } || AuthorName.new(name: name, author: Author.new) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_by_name(name)\n end", "def match_author_exact(name, reject = false)\n name = name.downcase || \"\"\n proc = Proc.new { |entry|\n author = entry.author.downcase || \"\"\n author.include?(name)\n }\n reject ? self.entries.reject(&proc) : self.entries.find_all(&proc)\n ...
[ "0.61140907", "0.6087991", "0.6042058", "0.59893197", "0.5830493", "0.58132017", "0.57794964", "0.57450336", "0.5722566", "0.5699318", "0.5690293", "0.56797963", "0.5634062", "0.5564596", "0.55139273", "0.5511831", "0.5500783", "0.54984313", "0.5484312", "0.5454994", "0.54512...
0.531701
29
:callseq: response.should have_text(expected) response.should_not have_text(expected) Accepts a String or a Regexp, matching a String using == and a Regexp using =~. Use this instead of response.should have_tag() when you either don't know or don't care where on the page this text appears. == Examples response.should h...
def have_text(text) HaveText.new(text) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def should_see(text)\n expect(page).to have_content(text)\n end", "def should_render_partial_text(text)\n should \"contain text #{text}\" do\n assert @response.body.include?(text), \"Response did not contain the text '#{text}'\"\n end\n end", "def should_render_partial_text(text)\n should \"...
[ "0.70956004", "0.7089157", "0.7089157", "0.70804405", "0.70804405", "0.6493213", "0.63599217", "0.63471365", "0.6314595", "0.6199141", "0.61990017", "0.6177249", "0.6158308", "0.61517656", "0.61476487", "0.61402285", "0.6134599", "0.6095294", "0.60696334", "0.6054533", "0.604...
0.63577974
7
Delegations Named scopes Triggers before_save :apply_settings
def apply_settings if !self.communicatable.nil? && self.communicatable.respond_to?(:default_communication_settings) then puts 'communicatable settings:'+self.communicatable.send(:default_communication_settings).inspect end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_to_scope(scope)\n scope\n end", "def before_save_hook\n execute_hooks_for(:before, :save)\n end", "def before_save(*); end", "def scoped\n self.default_scopable = true\n apply_default_scope\n end", "def settings\n @scope.settings\n end", "def scope_opt...
[ "0.5946877", "0.56738913", "0.56411487", "0.5529397", "0.5506146", "0.54428583", "0.54428583", "0.53822374", "0.5299407", "0.529128", "0.52673984", "0.5248681", "0.5243408", "0.5231208", "0.5185849", "0.51536787", "0.51508826", "0.5133239", "0.5122193", "0.5122193", "0.510789...
0.0
-1
1 and some other number, and then computes the sum of those multiples. For instance, if the supplied number is 20, the result should be 98 (3 + 5 + 6 + 9 + 10 + 12 + 15 + 18 + 20). You may assume that the number passed in is an integer greater than 1. Examples multisum(3) == 3 multisum(5) == 8 multisum(10) == 33 multis...
def multisum(integer) total = 0 (1..integer).each do |num| total += num if (num % 3 ==0) || (num % 5 == 0) end total end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multisum(number) # number 1..10 determines which numbers are divisible by 3 and 5\n sum = 0\n 1.upto(number) do |num|\n if num % 3 == 0 || num % 5 == 0\n sum += num # this adds the numbers from 1..num that either are multiples of 3 or 5\n end\n end\n sum #...
[ "0.83073133", "0.82226175", "0.8185018", "0.81745386", "0.81724215", "0.8171223", "0.8113775", "0.8104562", "0.8095781", "0.80506146", "0.80090475", "0.79770213", "0.7961031", "0.7932499", "0.7926165", "0.79198056", "0.7901809", "0.78938705", "0.7883232", "0.7876217", "0.7866...
0.8044323
10
Overrides the initialize method to set the default value of the equation_solver_class instance variable for this class.
def initialize super @equation_solver_class = SolitonProject::KDeVEquationSolver end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(equation)\n self.equation = equation\n end", "def initialize_solver(literalExpression)\n\t\t\t# Allocate an expression to solve\n\t\t\t@expression = Solver::Parser.new(Solver::Lexer.new(literalExpression))\n\t\t\t@expression.expressionCache = literalExpression\n\t\t\t@expression.objectCache = ...
[ "0.60215706", "0.58974475", "0.55864435", "0.5309562", "0.5197872", "0.5197872", "0.5192919", "0.513864", "0.5119271", "0.5108885", "0.5062944", "0.5052792", "0.4998538", "0.49947995", "0.49947995", "0.49947995", "0.49548423", "0.49301726", "0.49263436", "0.4914771", "0.49135...
0.77397835
0
Generates a positive half period sine wave as the initial condition using the supplied amplitude, period and spatial_offset parameters.
def generate_initial_condition initial_condition_elements = [] num_wave_points = ( (@parameters[:period]/2) / @parameters[:x_interval] ).to_i num_zero_points_before = ( @parameters[:spatial_offset] * @parameters[:number_of_spatial_points] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sine_wave_point(x)\n return @parameters[:amplitude] * Math.sin(\n (2 * Math::PI / @parameters[:period]) * x\n )\n end", "def wavefunction\n normalization = @@normalize ? n_constant : 1\n basis_functions = @basis_functions.dup\n \n lambda do |pos|\n normalization *...
[ "0.6063624", "0.54318833", "0.539771", "0.53662086", "0.5226023", "0.50586617", "0.49937135", "0.49788234", "0.495289", "0.49242496", "0.4867776", "0.48176587", "0.4693876", "0.46762922", "0.463433", "0.45825812", "0.45227373", "0.43864477", "0.43509933", "0.43389493", "0.432...
0.545914
1
Returns the value of the sine wave at the value of _x_ such that the maximum value of x maps to theta = pi.
def sine_wave_point(x) return @parameters[:amplitude] * Math.sin( (2 * Math::PI / @parameters[:period]) * x ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lsin(x)\n\n ret = 0.0\n i = $TRIG_ITER\n \n while i > 1\n \n i -= 1.0\n\tret += pow(-1, i) * pow(x, (2 * i) + 1) / fact((2 * i) + 1)\n\t\t\n end\n\t\n return ret\n \nend", "def sin(x)\n sin_base(num_class[x])\n end", "def funcion1(x)\n\t y = -x * Math.sin(Math.sqrt(x.abs))\n\t # y = -x ...
[ "0.6280858", "0.6265094", "0.6176316", "0.59534496", "0.5813691", "0.58050734", "0.5796412", "0.5610483", "0.56027794", "0.5579732", "0.5488866", "0.5459475", "0.542597", "0.5406681", "0.5373723", "0.5326951", "0.53267735", "0.5248291", "0.5187333", "0.51028323", "0.50838387"...
0.7386916
0
Setup accessible (or protected) attributes for your model
def to_param username end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_object_attributes; end", "def create_accessible_attributes\n read_inheritable_attribute(:attr_create_accessible)\n end", "def define_accessors\n self.metadata.properties_and_identity.each do |name, _|\n self.model.send :attr_accessor, name.downcase\n end\n end",...
[ "0.74517363", "0.6959349", "0.69563305", "0.6951435", "0.6708269", "0.6615708", "0.66031194", "0.6592642", "0.65891546", "0.65891546", "0.65038455", "0.647073", "0.6392493", "0.638319", "0.63125414", "0.63125414", "0.63125414", "0.63125414", "0.63125414", "0.63125414", "0.631...
0.0
-1
TODO, make controllers and lights available through external object, as opposed to passing it around
def initialize(controllers, lights) #start_scheduler @controllers = controllers @devices = lights # this variable is used to @rh_context ||= {} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sensors\r\n SensorsController.instance\r\n end", "def controller(controller); end", "def index\n\n @led\n @servo\n\n end", "def controller\n MSPhysics::Newton::BallAndSocket.get_controller(@address)\n end", "def lights\n @lights ||= add_all_lights\n end", "def lights\n ...
[ "0.6557182", "0.648806", "0.62026453", "0.61483085", "0.60868895", "0.60868895", "0.60621804", "0.59780306", "0.5937057", "0.5937057", "0.5937057", "0.59152466", "0.58973837", "0.5894614", "0.58819157", "0.5857711", "0.58450735", "0.58277524", "0.57108366", "0.5694503", "0.56...
0.66181916
0
typically used to turn something on/off. This will support the DSL syntax like: turn on kitchen_light
def switch(*args) # first argument should be DeviceCommand. If it's not, simply consider this word syntactic sugar. # (this way, both 'turn on my_light' as well as 'turn my_light on' will work) cmd = args[0] return args if !cmd.is_a?(RubyHome::Executor::DeviceCommand) cmd.device.send(cmd.command) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_on!\n set_power!(:on)\n end", "def turn_on()\n 'Turn on the #{model}<br>' \\\n 'If the thermocycler is off, toggle the power switch in the back of the instrument'\n end", "def turn_on!\n @turned_off = false\n end", "def turn_on\n 'If the thermocycler is off, toggle the powe...
[ "0.7591599", "0.7501574", "0.7414491", "0.73865163", "0.7195287", "0.7080219", "0.7024521", "0.6954643", "0.686656", "0.6757563", "0.6698295", "0.6695655", "0.6638744", "0.6631805", "0.66276354", "0.6604726", "0.6572642", "0.65322465", "0.6482091", "0.64665455", "0.64137286",...
0.6367879
23
GET /api/auth_ip_address_groups GET /api/auth_ip_address_groups.json
def index render json: AuthIpAddressGroup.paginate(page: params[:page], per_page: 25) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n render json: @auth_ip_address_group, status: :ok\n end", "def get_groups_for_ip_address_with_http_info(ip_address, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInventoryGroupsGroupMembersApi.get_groups_for_ip_address ...'\n end...
[ "0.7306406", "0.6850527", "0.6667049", "0.62461084", "0.6094788", "0.59409744", "0.591251", "0.5896432", "0.58698994", "0.57267654", "0.5697694", "0.5688981", "0.5680044", "0.5627683", "0.5590843", "0.55642647", "0.55621374", "0.5555335", "0.5551071", "0.55487895", "0.5530945...
0.6504914
3
GET /api/auth_ip_address_groups/1 GET /api/auth_ip_address_groups/1.json
def show render json: @auth_ip_address_group, status: :ok end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_groups_for_ip_address_with_http_info(ip_address, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInventoryGroupsGroupMembersApi.get_groups_for_ip_address ...'\n end\n # verify the required parameter 'ip_address' is set\n if @api_...
[ "0.7009068", "0.6893216", "0.65237904", "0.65063727", "0.6150362", "0.614314", "0.60814273", "0.60478836", "0.6002903", "0.5955569", "0.5875188", "0.5859314", "0.5807482", "0.57972497", "0.5778086", "0.5760633", "0.57598346", "0.5750527", "0.57203466", "0.5715134", "0.5714967...
0.75512457
0
PATCH/PUT /api/auth_ip_address_groups/1 PATCH/PUT /api/auth_ip_address_groups/1.json
def update if @auth_ip_address_group.update_attributes(auth_ip_address_group_params) render json: @auth_ip_address_group, status: :ok else render_error(@auth_ip_address_group, :unprocessable_entity) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateGroup params = {}\n \n APICall(path: 'groups.json',method: 'PUT',payload: params.to_json)\n \n end", "def set_api_v1_group_update\n @api_v1_group_update = Api::V1::GroupUpdate.find(params[:id])\n end", "def update_nodegroup(nodegroup_json, nodegroup_id)\n nodemgr_re...
[ "0.61735165", "0.60333246", "0.5977528", "0.59117216", "0.58724165", "0.5820875", "0.579429", "0.5756924", "0.5723484", "0.5691565", "0.56874037", "0.56801057", "0.56744826", "0.5672452", "0.56404394", "0.56253976", "0.5621207", "0.5611815", "0.55993134", "0.5583952", "0.5566...
0.7507919
0
DELETE /api/auth_ip_address_groups/1 DELETE /api/auth_ip_address_groups/1.json
def destroy @auth_ip_address_group.destroy head :no_content end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @host_group = HostGroup.find(params[:id])\n @host_group.destroy\n\n respond_to do |format|\n format.html { redirect_to host_groups_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @request_group.destroy\n respond_to do |format|\n format.html { ...
[ "0.6834442", "0.68216157", "0.68112487", "0.6783314", "0.6778871", "0.6773606", "0.6770529", "0.674759", "0.67327017", "0.67187476", "0.66675425", "0.6660738", "0.6642409", "0.663621", "0.66255105", "0.6580287", "0.6529614", "0.65030736", "0.6496982", "0.6496797", "0.6482943"...
0.8367022
0
GET /mispronunciations/1 GET /mispronunciations/1.json
def show @mispronunciation = Mispronunciation.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render :json => @mispronunciation } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @mispronunciation = Mispronunciation.find(params[:id])\n @mispronunciation.destroy\n\n respond_to do |format|\n format.html { redirect_to mispronunciations_url }\n format.json { head :no_content }\n end\n end", "def new\n @mispronunciation = Mispronunciation.new\n\n res...
[ "0.66409147", "0.614813", "0.5897817", "0.5664026", "0.5645214", "0.5598289", "0.5550719", "0.5451877", "0.5441234", "0.5365267", "0.5331891", "0.53036207", "0.52873623", "0.52730364", "0.5261389", "0.5235401", "0.52265906", "0.5198444", "0.51848364", "0.5179605", "0.51761615...
0.6648579
0
GET /mispronunciations/new GET /mispronunciations/new.json
def new @mispronunciation = Mispronunciation.new respond_to do |format| format.html # new.html.erb format.json { render :json => @mispronunciation } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @mispronunciation = Mispronunciation.new(params[:mispronunciation])\n\n respond_to do |format|\n if @mispronunciation.save\n format.html { redirect_to @mispronunciation, :notice => 'Mispronunciation was successfully created.' }\n format.json { render :json => @mispronunciation...
[ "0.6902226", "0.67482674", "0.6595958", "0.646105", "0.6454634", "0.6431567", "0.63853556", "0.63853556", "0.63732475", "0.6357116", "0.6338105", "0.63348126", "0.6300308", "0.6221863", "0.6212533", "0.6196517", "0.6192655", "0.6180875", "0.61796147", "0.6177272", "0.6177138"...
0.7357176
0
POST /mispronunciations POST /mispronunciations.json
def create @mispronunciation = Mispronunciation.new(params[:mispronunciation]) respond_to do |format| if @mispronunciation.save format.html { redirect_to @mispronunciation, :notice => 'Mispronunciation was successfully created.' } format.json { render :json => @mispronunciation, :status =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @mispronunciation = Mispronunciation.find(params[:id])\n @mispronunciation.destroy\n\n respond_to do |format|\n format.html { redirect_to mispronunciations_url }\n format.json { head :no_content }\n end\n end", "def new\n @mispronunciation = Mispronunciation.new\n\n res...
[ "0.65416384", "0.6043392", "0.5467648", "0.5401612", "0.5380822", "0.5372352", "0.5249519", "0.5241639", "0.5199252", "0.5165083", "0.5020607", "0.49524623", "0.49446288", "0.48955622", "0.48667282", "0.4815037", "0.4797426", "0.47832182", "0.47828943", "0.47788483", "0.47678...
0.65886277
0
PUT /mispronunciations/1 PUT /mispronunciations/1.json
def update @mispronunciation = Mispronunciation.find(params[:id]) respond_to do |format| if @mispronunciation.update_attributes(params[:mispronunciation]) format.html { redirect_to @mispronunciation, :notice => 'Mispronunciation was successfully updated.' } format.json { head :no_content ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @mispronunciation = Mispronunciation.find(params[:id])\n @mispronunciation.destroy\n\n respond_to do |format|\n format.html { redirect_to mispronunciations_url }\n format.json { head :no_content }\n end\n end", "def update\n @pronunciation = Pronunciation.find(params[:id])...
[ "0.64619905", "0.6014776", "0.5852025", "0.56265455", "0.5492417", "0.5476065", "0.5472744", "0.5426061", "0.5424839", "0.5319397", "0.5303367", "0.52714556", "0.52240247", "0.5219915", "0.51989824", "0.5189538", "0.5162054", "0.5151052", "0.5134706", "0.512495", "0.5107904",...
0.6662492
0
DELETE /mispronunciations/1 DELETE /mispronunciations/1.json
def destroy @mispronunciation = Mispronunciation.find(params[:id]) @mispronunciation.destroy respond_to do |format| format.html { redirect_to mispronunciations_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @taxon_determination.destroy\n respond_to do |format|\n format.html { redirect_to taxon_determinations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @immunization.destroy\n respond_to do |format|\n format.html { redirect_to immunizations_url, n...
[ "0.68952894", "0.677093", "0.67208767", "0.66925335", "0.6680084", "0.6679252", "0.6644125", "0.6630796", "0.6618537", "0.66076386", "0.66039485", "0.6551038", "0.65489614", "0.6523276", "0.6521899", "0.6521485", "0.6516641", "0.6508593", "0.6508272", "0.6507143", "0.6482129"...
0.79271597
0
DATE : 09/30/2020 FILE : say_goodnight.rb SYNOPSIS : Workthru file for 'Programming Ruby The Pragmatic Programmer's Gudie'.
def sayGoodnight(name) result = "Goodnight, #{name}" # return result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def story_time(thing1, thing2)\n puts \"This is a short story of #{thing1} and #{thing2}. The end.\"\nend", "def mothers_day\n puts \"Happy Mother's Day, Mom!\"\nend", "def meow #teaching the cat how to meow\n puts \"meow!\" \n end", "def print_help\n puts \"I'd cheer for you, if only I knew who ...
[ "0.6541555", "0.64831644", "0.6350296", "0.6336303", "0.62816435", "0.6269989", "0.62672496", "0.62034714", "0.6200728", "0.61098504", "0.6095319", "0.6080079", "0.6061956", "0.6050348", "0.60137117", "0.6006331", "0.5981494", "0.5967971", "0.5966547", "0.59600985", "0.595811...
0.60142577
14
we can replace them with attr_accessor :size, :can_fly, :color, common to have this on top of the page , it's a ruby thing.
def initialize(size=nil, color=nil, can_fly=true) @size = size @color = color @can_fly = can_fly end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def styles; end", "def styles; end", "def styles; end", "def style; end", "def style; end", "def style; end", "def initialize(this_name =\"default name\", height, )\n @name = this_name OR self.name = this name\n #can do this for all other attibutes\n self.height = new_height\n self.hair_col...
[ "0.6545202", "0.6545202", "0.6545202", "0.63585126", "0.63585126", "0.63585126", "0.63131666", "0.629157", "0.62570536", "0.6251723", "0.6251723", "0.6251723", "0.6251723", "0.6251723", "0.6251723", "0.6251723", "0.6251723", "0.6243905", "0.6218048", "0.6142381", "0.6137372",...
0.62334996
18
Builds the enum from string
def build_from_hash(value) constantValues = DocumentFormat.constants.select { |c| DocumentFormat::const_get(c) == value } raise "Invalid ENUM value #{value} for class #DocumentFormat" if constantValues.empty? value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_from_hash(value)\n constantValues = ExchangeStatus.constants.select { |c| ExchangeStatus::const_get(c) == value }\n raise \"Invalid ENUM value #{value} for class #ExchangeStatus\" if constantValues.empty?\n value\n end", "def build_from_hash(value)\n constantValues = NewOrResale....
[ "0.66046983", "0.6548398", "0.65373033", "0.6528928", "0.64598405", "0.6446511", "0.64443517", "0.6443306", "0.6406087", "0.6405894", "0.6379518", "0.6374375", "0.6367104", "0.6359485", "0.63550735", "0.6346857", "0.63404876", "0.6319777", "0.63088304", "0.6306753", "0.630464...
0.6118276
51
Action links for admin listings
def article_action_links( article ) available_actions = [] case current_user.role.downcase.to_sym when :writer if article.status == Article::Status[:unsubmitted] available_actions << :edit available_actions << :destroy if article.user_id==current_user.id end when :edito...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_link\n admin_app_url(:host => CONSTANTS[:base_url_host], :offering => offering, :id => self)\n end", "def admin\n #TODO\n end", "def admin\n end", "def admin\n end", "def admin\n end", "def admin\n end", "def admin\n\n end", "def admin\n authorize! :admin, @listings\n end",...
[ "0.70718855", "0.70392144", "0.69340616", "0.69340616", "0.69340616", "0.69340616", "0.6917836", "0.6898095", "0.68708956", "0.68124676", "0.6782821", "0.67260283", "0.66910857", "0.6685163", "0.6616267", "0.66066796", "0.6590933", "0.6558734", "0.6558734", "0.6558734", "0.65...
0.0
-1
Work out review stars
def indesign_review_stars( article ) if article.review? && (article.review_rating.to_i > 0) text = "<ParaStyle:Reviews\\:Review Rating>" text << (0..article.review_rating.to_i-1).collect{|n| "r"}.join return text.html_safe else return "" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def review_stars(review)\n {\n active: review.rating,\n blank: Review::RATINGS.last - review.rating\n }\n end", "def rating\n rating_calculator.rate(raters)\n end", "def rating\n if reviews.size ==0\n return nil\n end\n rating=0\n reviews.each do |review|\n rating...
[ "0.7389786", "0.7056881", "0.6932001", "0.6880097", "0.67437196", "0.67228067", "0.6710645", "0.6688195", "0.66711646", "0.6671011", "0.6669121", "0.6647663", "0.66464174", "0.6623165", "0.6595912", "0.6592362", "0.65844905", "0.65812993", "0.65644836", "0.6548272", "0.653907...
0.7370245
1
monkey_trouble? We have two monkeys, a and b, and the parameters a_smile and b_smile indicate if each is smiling. We are in trouble if they are both smiling or if neither of them is smiling. Return true if we are in trouble. ==== Attributes a_smile true only if monkey a is smiling b_smile true only if monkey b is smili...
def monkey_trouble?(a_smile, b_smile) (a_smile && b_smile) || ( !a_smile && !b_smile) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def monkey_trouble? (a_smile, b_smile)\n\tif a_smile\n\t\treturn false\n\tend\n\n\tif b_smile\n\t\treturn false\n\tend\n\n\tif a_smile\n\t\tif b_smile\n\t\t\treturn true\n\t\tend\n\tend\n\n\tif !a_smile\n\t\tif !b_smile\n\t\t\treturn true\n\t\tend\n\tend\n\nend", "def monkey_trouble(a_smile, b_smile)\n\t\t(a_smi...
[ "0.8440972", "0.83213586", "0.66680205", "0.58459127", "0.58361083", "0.5816847", "0.5808508", "0.5707357", "0.5637612", "0.56095207", "0.56095207", "0.55888176", "0.55888176", "0.5573209", "0.5573164", "0.5573164", "0.5573164", "0.55692387", "0.5545669", "0.5544776", "0.5531...
0.85138416
0
sum_double Given two int values, return their sum. Unless the two values are the same, then return double their sum. ==== Attributes a an integer b an integer TODO write sum_double
def sum_double(a, b) if (a != b) a+b else 2 * (a + b) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_double (a,b)\n\t\n\tif a != b \n\t\treturn a + b \n\tend \n\n\tif a = b \n\t\treturn 2 * (a + b)\n\tend\n\nend", "def double_sum(a, b)\n a == b ? 2 * (a + b) : (a + b)\nend", "def sum_double(x, y)\n x == y ? (x+y)*2 : x+y\nend", "def get_sum(a, b)\n [a,b].reduce(&:+)\nend", "def sum(a, b = nil...
[ "0.7485876", "0.7087688", "0.675382", "0.62629545", "0.6236776", "0.59011585", "0.5868656", "0.5856261", "0.58420056", "0.58350325", "0.581833", "0.5778816", "0.5777521", "0.5755151", "0.5736105", "0.5734867", "0.5725481", "0.56702363", "0.5661952", "0.5602278", "0.55975467",...
0.80167866
0
allows to sudo a command which require the user input via the prompt
def sudo_and_watch_prompt(cmd, regex_to_watch) sudo cmd, :pty => true do |ch, stream, data| watch_prompt(ch, stream, data, regex_to_watch) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sudo_with_input(shell_command, input_query=/^Password/, response=nil)\n handle_command_with_input(:sudo, shell_command, input_query, response)\n end", "def sudo_with_input(shell_command, input_query=/^Password/, response=nil)\n handle_command_with_input(:sudo, shell_command, input_query, response)\n ...
[ "0.781838", "0.781838", "0.77760893", "0.7733803", "0.75899744", "0.75344366", "0.7514525", "0.7347551", "0.7285308", "0.7122918", "0.7111208", "0.7081864", "0.7056574", "0.703552", "0.70340616", "0.69682574", "0.6951762", "0.69338626", "0.69338626", "0.69338626", "0.69303405...
0.67236644
28
allows to run a command which require the user input via the prompt
def run_and_watch_prompt(cmd, regex_to_watch) run cmd, :pty => true do |ch, stream, data| watch_prompt(ch, stream, data, regex_to_watch) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_command(prompt); end", "def prompt_cmd\n print \"> \"\n input_str = @input.gets.chomp\n Input.str_to_cmd input_str\n end", "def input_command\n\t\tloop do\n\t\t\tputs \"\"\n\t\t\tputs \"What are your commands master #{$account}?\"\n\t\t\t# cmd = ('say \"What are your commands my master?\"')...
[ "0.7689793", "0.7615013", "0.7603834", "0.755908", "0.7415357", "0.7254538", "0.7219164", "0.713626", "0.7043915", "0.70425916", "0.70410746", "0.700587", "0.70019937", "0.69661", "0.6949911", "0.69359916", "0.69183844", "0.69156176", "0.6877411", "0.6875052", "0.6868954", ...
0.0
-1
utility method called by sudo_and_watch_prompt and run_and_watch_prompt
def watch_prompt(ch, stream, data, regex_to_watch) # the regex can be an array or a single regex -> we force it to always be an array with [*xx] if [*regex_to_watch].find { |regex| data =~ regex} # prompt, and then send the response to the remote process ch.send_data(Capistrano::CLI.password_prompt(data) +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sudo_and_watch_prompt(cmd, regex_to_watch)\n sudo cmd, :pty => true do |ch, stream, data|\n watch_prompt(ch, stream, data, regex_to_watch)\n end\nend", "def sudo_prompt\n fetch(:sudo_prompt, \"sudo password: \")\n end", "def prompt; end", "def prompt; end", "def prompt; end", "de...
[ "0.7314646", "0.6613388", "0.65948784", "0.65948784", "0.65948784", "0.65948784", "0.6552553", "0.652318", "0.64185584", "0.639932", "0.6369323", "0.63168114", "0.63100624", "0.6290062", "0.6211461", "0.6211461", "0.6193597", "0.61867243", "0.618627", "0.6185807", "0.61790746...
0.63275564
11
Reactivate sudo session if it has expired.
def sudo_keepalive sudo "ls > /dev/null" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def renew_session\n @authenticator.kill_session\n @authenticator.get_session\n end", "def reactivate(user)\n if !user.account_active?\n user.reactivate!\n end\n end", "def renew_session\n ::ActionController::Base.session_options[:session_expires] ...
[ "0.59841704", "0.5893352", "0.5729342", "0.5688296", "0.5677143", "0.5495051", "0.5468707", "0.53971416", "0.53803927", "0.53397775", "0.5324684", "0.532078", "0.5314957", "0.52988243", "0.52908736", "0.529009", "0.527271", "0.5271574", "0.52570647", "0.5246521", "0.5239807",...
0.5868302
2
Adds 1 or more commands to the cron tab commands can be a string or an array period should be a valid crontab period use_sudo can be set to true if you want to edit the root crontab.
def add_to_crontab(commands,period,use_sudo=false) send_cmd = use_sudo ? :sudo : :run tmp_cron="/tmp/cron.tmp" self.send(send_cmd, "rm -f #{tmp_cron} && touch #{tmp_cron}") run "(#{use_sudo ? 'sudo ' : ''}crontab -l || true) > #{tmp_cron}" cron_lines = [*commands].map{|cmd| "#{period} #{cmd}"} add_to_file(t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sudo_add_to_crontab(commands,period)\n add_to_crontab(commands, period, true)\nend", "def create_cron\n cron_edit = CronEdit.new\n command = cron_edit.add_command create_cron_command, Environment.ruby\n puts \"--> added command to cron\"\n puts \" #{command}\"\n end", "def instal...
[ "0.7614498", "0.63935304", "0.6034136", "0.599685", "0.5883065", "0.5827031", "0.5823122", "0.5818032", "0.5720212", "0.5695396", "0.56687385", "0.56193", "0.55189526", "0.5502897", "0.5462098", "0.54031336", "0.54011863", "0.53917044", "0.5360895", "0.5344041", "0.533641", ...
0.81537384
0
Adds 1 or more commands to the cron tab of root commands can be a string or an array period should be a valid crontab period
def sudo_add_to_crontab(commands,period) add_to_crontab(commands, period, true) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_crontab(commands,period,use_sudo=false)\n send_cmd = use_sudo ? :sudo : :run\n tmp_cron=\"/tmp/cron.tmp\"\n self.send(send_cmd, \"rm -f #{tmp_cron} && touch #{tmp_cron}\")\n run \"(#{use_sudo ? 'sudo ' : ''}crontab -l || true) > #{tmp_cron}\"\n cron_lines = [*commands].map{|cmd| \"#{period} #{cmd}\...
[ "0.73088646", "0.64014316", "0.63333744", "0.6148617", "0.61392576", "0.59396845", "0.5917817", "0.59023696", "0.5871083", "0.5822235", "0.5777282", "0.56876725", "0.5637059", "0.5637059", "0.562529", "0.5568629", "0.5553841", "0.5522639", "0.5522639", "0.5504151", "0.5473194...
0.7203693
1
insert random elements into the Matrix (any single digit) and display it Ask if user wants a new random matrix and display if user said yes generate a matrix of max (30) x max (100), based on user input with values only being " " and 0 Test if cells are alive or dead (" " is dead and 0 is alive) Apply the rules of Conw...
def new_matrix(row_dimension, column_dimension) Array.new(row_dimension) do Array.new(column_dimension) do @cell = [' ', 'X'].sample end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_matrix\n @long.times do |long|\n @matriz.push([])\n @width.times do |_width|\n @matriz[long].push([' . ', ' * '].sample)\n end\n end\n kill_cells_in_borders\n end", "def redesign\n @waiting = []\n @maze_table = Array.new(2*@m+1){Array.new(2*@n+1, \"1\")}\n for ...
[ "0.6882203", "0.6706399", "0.6681829", "0.6439345", "0.64364505", "0.6432892", "0.64115924", "0.6379742", "0.6249922", "0.6188683", "0.6177248", "0.6154255", "0.60992", "0.6085345", "0.60291827", "0.60233015", "0.6022367", "0.5987444", "0.59428245", "0.5940011", "0.59316707",...
0.58380437
28
Never trust parameters from the scary internet, only allow the white list through.
def sub_category_params params.require(:sub_category).permit(:name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
params include :room_id to post in ?
def create @room = Room.find(params[:target_room_id]) @post = @room.posts.create(params[:posts]) @post.user_id = current_user.id if @post.save! flash[:success] = "Post created!" else flash[:failure] = "Failed to create post!" end redirect_to room_path(@room) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def room_params\n params.require(:room).permit(:title, :location, :description, :user_id)\n end", "def room_params\n params.require(:room).permit(:name, :user_id)\n end", "def room_id\n params[\"room_id\"]\n end", "def room_params\n params.require(:room).permit(:user_id, :address_id)...
[ "0.7467741", "0.736939", "0.7340836", "0.7306959", "0.7233407", "0.72098935", "0.72098935", "0.7148334", "0.71325785", "0.7129522", "0.71220624", "0.71019816", "0.7094168", "0.70675075", "0.7025618", "0.7011453", "0.7004181", "0.69831526", "0.6975014", "0.6975014", "0.6921817...
0.6445447
86
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.waitlist_mailer.product_back_in_inventory.subject
def product_back_in_inventory @greeting = "Hi" mail to: "to@example.org" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def translate(mapping, key)\n I18n.t(:\"notifications_subject\", :scope => [:eventifier, :notifications, key],\n :default => [:subject, key.to_s.humanize])\n end", "def subject\n @subject ||= Envelope::MessageTools.normalize(message.subject || '')\n end", "def subject\n self['su...
[ "0.6486041", "0.6442261", "0.6409536", "0.6391367", "0.63717645", "0.63653016", "0.6326072", "0.63195276", "0.6316699", "0.62889284", "0.62740904", "0.6204675", "0.6196723", "0.6160274", "0.6139918", "0.61200225", "0.6107759", "0.6088319", "0.6084757", "0.6065743", "0.6059468...
0.54645455
76
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.waitlist_mailer.product_sold.subject
def product_sold @greeting = "Hi" mail to: "to@example.org" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n end", "def subject (recipient)\n subject_variables = alert_variables[:subject].dup\n...
[ "0.6221863", "0.60784566", "0.6068368", "0.6037344", "0.5926488", "0.59179324", "0.59022635", "0.5899472", "0.5892922", "0.58811444", "0.58745116", "0.58390254", "0.5810353", "0.5803864", "0.57705283", "0.57632285", "0.57369006", "0.5718181", "0.57145494", "0.5695585", "0.568...
0.6116094
1
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.waitlist_mailer.product_sold.subject
def buyer_waitlisted(shop, product, buyer) @shop = shop @product = product @buyer = buyer mail to: buyer.email, subject: "[#{shop.name}] You're in line for #{product.title}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n end", "def product_sold\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end...
[ "0.6223329", "0.61143196", "0.6077342", "0.6068241", "0.60380787", "0.59264606", "0.59193355", "0.5902576", "0.589905", "0.58926564", "0.58808005", "0.58739156", "0.58379626", "0.58090997", "0.5803477", "0.5770154", "0.5763217", "0.5737125", "0.571801", "0.57146174", "0.56973...
0.5206205
75
Moves a forum one space down using an acts_as_list provided method.
def move_down @item.move_lower flash[:notice] = t(:moved_lower, :thing => "item") redirect end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decrement_position\n return unless in_list?\n set_list_position(current_position - 1)\n end", "def move_down\n\t\tmove([0,1])\n\tend", "def move_higher\n return if position_in_list == 1\n move_to(position_in_list - 1)\n end", "def move_to_bottom\n retu...
[ "0.58315223", "0.5828568", "0.56926244", "0.56753796", "0.5652774", "0.5652768", "0.5610842", "0.55705327", "0.55400085", "0.55287516", "0.55241823", "0.55158985", "0.54956055", "0.5493474", "0.5466534", "0.54577863", "0.5451183", "0.544026", "0.54385465", "0.54039735", "0.53...
0.53032196
24
Moves a forum to the top using an acts_as_list provided method.
def move_to_top @item.move_to_top flash[:notice] = t(:moved_to_top, :thing => "item") redirect end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_to_top\n return unless in_list?\n insert_at_position acts_as_list_top\n end", "def move_to_top\n return unless in_list?\n acts_as_list_class.transaction do\n increment_positions_on_higher_items\n assume_top_position\n end\n ...
[ "0.7153966", "0.6688402", "0.66116756", "0.645518", "0.6133422", "0.6133422", "0.6061091", "0.59679383", "0.59445137", "0.5928523", "0.5925897", "0.5898033", "0.57901984", "0.57649505", "0.5634846", "0.56093204", "0.55747867", "0.55166763", "0.54791147", "0.546755", "0.546476...
0.6083418
6
Moves a forum to the bottom using an acts_as_list helper.
def move_to_bottom @item.move_to_bottom flash[:notice] = t(:moved_to_bottom, :thing => "item") redirect end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_to_bottom\n return unless in_list?\n acts_as_list_class.transaction do\n decrement_positions_on_lower_items\n assume_bottom_position\n end\n end", "def move_to_bottom\n # return unless in_list?\n acts_as_list_class.transaction do\n ...
[ "0.6885469", "0.6664554", "0.6379662", "0.6348903", "0.6310712", "0.6302984", "0.6180713", "0.61560786", "0.61013395", "0.60872823", "0.60297436", "0.5853525", "0.5824368", "0.57917595", "0.5785845", "0.57238376", "0.5578163", "0.55539435", "0.5549644", "0.5544256", "0.546018...
0.6146259
8
Should never be called directly, go through EPUBInfo.get
def initialize(node) self.name = node.content self.file_as = node.attribute('file-as').content rescue nil self.role = node.attribute('role').content rescue nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_epub_url\n if self.epub.attachment\n self.epub.key << \".epub\"\n self.epub_url = self.epub.service_url.split(\"?\").first\n end\n end", "def getTitle(book)\n book['volumeInfo']['title']\nend", "def get_title(book)\n book[\"volumeInfo\"][\"title\"]\nend", "d...
[ "0.5751706", "0.57392716", "0.5694744", "0.55699134", "0.5455682", "0.5357393", "0.5357393", "0.5357393", "0.5352489", "0.52583164", "0.523269", "0.5226666", "0.5224264", "0.5217355", "0.52096593", "0.5202586", "0.5201801", "0.51827663", "0.5164212", "0.51631", "0.515687", ...
0.0
-1
Returns Hash representation of a person
def to_hash { :name => @name, :file_as => @file_as, :role => @role } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash\n fullname.hash\n end", "def hash\n [_hash, name, owner].hash\n end", "def hash\n [first_name, last_name, address_one, address_two, city, state, zip, phone, email, country_code].hash\n end", "def to_hash() end", "def hash\n name.hash\n end", "def hash\n name....
[ "0.74726546", "0.7101386", "0.7079829", "0.6964981", "0.692483", "0.69242495", "0.6871508", "0.6858093", "0.67759246", "0.67759246", "0.67759246", "0.67759246", "0.67759246", "0.67759246", "0.67759246", "0.67575884", "0.6744946", "0.67443824", "0.67341685", "0.67315114", "0.6...
0.0
-1
display warnings on stderr, depending on the set warning_level
def warn s,level=0,token=nil,extra=nil if level <= $options.warning_level $stderr.print "\nWarn: #{s} in <#{@input_file_name}> " if token $stderr.print "in line #{token.line_no}, pos #{token.char_no}" # $stderr.print "by name <#{token.name}>" if token and token.name $stderr.print "\n" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def warning(msg) $stderr.puts(\"Warning: #{msg}\") end", "def warning(msg) $stderr.puts(\"Warning: #{msg}\") end", "def warning(msg) $stderr.puts(\"Warning: #{msg}\") end", "def set_warn_level!(level = 2)\n warn_levels = ['0','1','2','no']\n return unless warn_levels.include?(level.to_s.downcase)\n...
[ "0.74677545", "0.74677545", "0.74677545", "0.68709767", "0.6827614", "0.6731125", "0.6718141", "0.67094296", "0.66583407", "0.66520214", "0.6576458", "0.6576458", "0.6546571", "0.65117174", "0.645103", "0.645103", "0.6431566", "0.6413769", "0.6413769", "0.64115256", "0.639914...
0.65144336
13
lookahead returning the next token without popping it
def peek_tk unget_tk(tk = get_tk) tk end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def advance\n @lookahead = next_token()\n end", "def consume()\n la(1)\n return @lookahead.shift\n end", "def next_token; @stack.shift; end", "def next_token\n tokens.shift\n end", "def lookahead(ll_index = 0)\n retun nil if @current + ll_index >= tokens.size\n tokens...
[ "0.7921406", "0.7657198", "0.7443247", "0.732841", "0.7319514", "0.72922564", "0.72364897", "0.6983277", "0.69352394", "0.6932403", "0.69311506", "0.69311506", "0.6922526", "0.6909445", "0.68583494", "0.6854454", "0.6843538", "0.68296033", "0.68222106", "0.6765362", "0.674992...
0.0
-1
push the token +tk+ back onto the stack
def unget_tk(tk) @tokens.unshift tk @unget_readed.unshift @readed.pop end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push_token(tk); end", "def push_token(tk)\n @first_line = tk.line_no if @statement.empty?\n @statement << tk unless @level == 0 && [TkCOMMENT].include?(tk.class)\n end", "def process_token(tk); end", "def unget_tk(tk)\n @tokens.unshift tk\n @unget_read.unshift @read.pop\n\n # ...
[ "0.81789833", "0.6939592", "0.6883885", "0.6839446", "0.6715517", "0.66873646", "0.6499284", "0.64433527", "0.64402777", "0.6050786", "0.5954578", "0.5922492", "0.5879018", "0.58440095", "0.5838479", "0.5797001", "0.5778104", "0.57651436", "0.5740138", "0.5725827", "0.5670841...
0.69291633
2
returns the actual token string as it was read and sets the read buffer to zero length
def get_tkreaded readed = @readed.join("") @readed = [] readed end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_token\n @tokenbuf << read_token if @tokenbuf.length == 0\n return @tokenbuf.shift\n end", "def token\n item = read\n return item['token'] if item['token']\n token_reset\n read['token']\n end", "def peek_token(n=1)\n n.times{|x| @tokenbuf << read_token if @tokenbuf.length == 0 }\n...
[ "0.8118528", "0.6956465", "0.66437817", "0.6634754", "0.64311683", "0.63049173", "0.6295738", "0.62798816", "0.62603927", "0.6238585", "0.6238446", "0.61548144", "0.61461437", "0.61136943", "0.60412186", "0.5997883", "0.5997883", "0.5997883", "0.5997883", "0.5997883", "0.5997...
0.0
-1
The 'grunt' method splits a line into tokens and invokes the basic parsers for class, module, method etc.
def parse_statements(context = nil, single = NORMAL, &block) begin last_seekpos = -1 nest = 1 while tk = get_tk case tk when TkCLASS parse_class(context, single, tk, &block) when TkMODULE parse_module(context, single, tk, &block) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute!\n line_n = 0\n level = 0\n classes = []\n @source.each_line do |line|\n line_n += 1\n line.chomp!\n # indentify scopes\n level = line_level line\n\n # ignore comments!\n next if @comment_lines.include? line_n\n\n [\n [@class...
[ "0.5984471", "0.5952516", "0.5629725", "0.562601", "0.5609808", "0.55861264", "0.55181944", "0.54283637", "0.53965974", "0.53609985", "0.53609985", "0.53609985", "0.53609985", "0.5348511", "0.53254396", "0.53163975", "0.52856463", "0.52771604", "0.5262093", "0.5244533", "0.52...
0.0
-1
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength
def render_exercise(template, digest_component: '') say "Rendering: #{template}" template = full_path(template) current_dir = Dir.pwd content = render(template) File.open(filename(template), 'w') { |f| f.write("#{content}\n#{stamp(digest_component, template)}") } say ok "Finished: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def implementation; end", "def implementation; end", "def refutal()\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def schubert; end", "def strategy; end", "def used?; end", "def offences_by; end", "def custo...
[ "0.7688723", "0.63485044", "0.63171065", "0.63171065", "0.6276333", "0.6209769", "0.6209769", "0.6209769", "0.6209769", "0.6173215", "0.6030849", "0.5963694", "0.5912135", "0.5882012", "0.5882012", "0.586075", "0.5852541", "0.5852541", "0.5840645", "0.57902825", "0.57716626",...
0.0
-1
rubocop:enable Metrics/AbcSize rubocop:enable Metrics/MethodLength
def render_file_path(template) template.gsub(%r{.templates/.*?erb}, File.basename(template)).gsub('.erb', '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def implementation; end", "def implementation; end", "def refutal()\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def schubert; end", "def used?; end", "def strategy; end", "def suivre; end", "def custom; en...
[ "0.77398175", "0.64754474", "0.6350988", "0.6350988", "0.62915206", "0.6278636", "0.6278636", "0.6278636", "0.6278636", "0.6274237", "0.6028028", "0.5989851", "0.59679145", "0.5966948", "0.5966948", "0.59405726", "0.58917296", "0.58917296", "0.5874681", "0.5838789", "0.583383...
0.0
-1
To use this you need to send either a matrix or :sep
def make_table(rows, sep_x = "=", sep_y = "|", sep_i = "x") text_rows = rows.select{ |r| r.is_a?(Array) } count = text_rows.map(&:size).max rows.each{ |r| if r.is_a?(Array) then r << "" while r.size < count end } widths = (0..count - 1).map{ |c| text_rows.map{ |r| r[c].to_s.length }.max } sep = widths.map{ |w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_mat(matrix, delim=nil)\n puts matrix.map{|x| delim ? x.join(delim) : x.inspect}\nend", "def matrix\n end", "def sep; end", "def sep; end", "def separator; end", "def default_separator=(separator); end", "def default_separator; end", "def column_seperator\n self.data.strip.each.first.gs...
[ "0.61936855", "0.576169", "0.55485517", "0.55485517", "0.54634005", "0.5388197", "0.5363792", "0.5327511", "0.5301549", "0.52836794", "0.5262033", "0.5254741", "0.52444315", "0.5242767", "0.5240346", "0.523565", "0.523565", "0.5207802", "0.5197513", "0.5195858", "0.51772213",...
0.45142382
97
get method for individual recipe
def show recipe = Recipe.find(params[:id]) # recipes = Recipe.find_by(params[:id]) # render json: recipe render json: recipe end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipe args=1\n self.summary.recipe args\n end", "def method_missing(meth_name, *args, &block)\n raise \"No method named: #{meth_name}\" unless recipe.respond_to? meth_name\n recipe.send(meth_name, *args, &block)\n end", "def recipe_instance(recipe_name) \n Recipe.find_by name: recipe...
[ "0.741431", "0.72395635", "0.6975831", "0.6805733", "0.68004906", "0.67771816", "0.6662602", "0.6627525", "0.65240264", "0.65240264", "0.65127826", "0.65084845", "0.6408752", "0.6408752", "0.637705", "0.637622", "0.6343912", "0.62417465", "0.6212692", "0.6201702", "0.618229",...
0.0
-1
allows us to get/view all of the recipes associated by user id at this route 'localhost:3000/recipes/:id/ingredients'
def ingredients_by_recipe recipe = Recipe.find(params[:id]) render json: recipe.ingredients end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def userRecipe\n @user_id = params[:id]\n @user = User.find_by(id: @user_id)\n @recipes = Recipe.where(user_id: @user_id)\n end", "def index\n @recipes = Recipe.where(user_id: current_user.id)\n end", "def user\n\t\t@recipes = Recipe.find_by_user_id(params[:id])\n\t\trespond_with @recipes\n\tend"...
[ "0.8133988", "0.79113126", "0.7854806", "0.7827304", "0.76546526", "0.7540002", "0.74429095", "0.73833936", "0.7340013", "0.73337686", "0.7311905", "0.71903497", "0.71758187", "0.7166987", "0.7135947", "0.7131365", "0.7115493", "0.70752794", "0.70666", "0.705531", "0.7008394"...
0.7362995
8
defining the variable recipe_params
def recipe_params params.require(:recipe).permit(:name, :instructions, :image, :user_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipe_params\n params.fetch(:recipe, {})\n end", "def recipe_params\n params.require(:recipe).permit(\n :name, :link, :ingredients_array, :image_url,\n meal_plans_params: [:recipe_id, :user_id, :status],\n likes_params: [:recipe_id, :user_id],\n ingredients_params: [...
[ "0.78200454", "0.7377053", "0.72716177", "0.7233516", "0.7183921", "0.7174411", "0.7170393", "0.71410286", "0.7124557", "0.7107631", "0.7076054", "0.70661986", "0.70652264", "0.7057", "0.70534086", "0.69760454", "0.69681287", "0.69590294", "0.6933795", "0.69265836", "0.690834...
0.65713227
69
| UPDATE STUFF |
def update update_phase end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_update\n do_edit\n update_save\n end", "def update # EXTENSION\n sql = \"UPDATE tickets SET customer_id = $1, film_id = $2, screening_id = $3 WHERE id = $4\"\n values = [@customer_id, @film_id, @screening_id, @id]\n SqlRunner.run(sql, values)\nend", "def update\n p \"UPDATE\"\n end",...
[ "0.68517804", "0.6838884", "0.6809351", "0.6739161", "0.67382485", "0.6693608", "0.6685131", "0.6653031", "0.6652288", "0.66356915", "0.66356915", "0.66356915", "0.66356915", "0.66356915", "0.66356915", "0.66356915", "0.66356915", "0.6604552", "0.65969217", "0.6572028", "0.65...
0.0
-1
| CREATE STUFF |
def create_spriteset @spriteset = Spriteset_GFishing.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create; end", "def create; end", "def create; end", "def create; end", "def create #:doc:\n end", "def create\n # USELESS\n end", "def create\n # USELESS\n end", "def create\n \n end", "def create\n # コードを記述する\n end", "def create\r\n\r\n\r\n end", "def create_table\n puts \...
[ "0.650117", "0.650117", "0.650117", "0.650117", "0.64190364", "0.6370037", "0.6370037", "0.6309694", "0.6307504", "0.62458384", "0.61972594", "0.6189166", "0.6164184", "0.6108525", "0.6099397", "0.6057579", "0.6045708", "0.6043734", "0.60223585", "0.600117", "0.598729", "0....
0.0
-1
| WINDOW FUNCTIONALITY |
def command_cast @command_window.hide.deactivate @cast_window.dispose create_cast_window @cast_window.reset_power @cast_window.show $game_fishing.casting end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def window(id); end", "def min_window\nend", "def windowed_max_range_two(arr,window)\n \nend", "def win_mp\n maxmp * features_sum(:mp_on_win)\n end", "def windows_score\n return @windows_score\n end", "def windowed_max_range(array, w)\nend", "def window_width\n end",...
[ "0.65727353", "0.6505324", "0.6397671", "0.6256856", "0.62417424", "0.6203489", "0.61591023", "0.6110967", "0.6054992", "0.60229886", "0.59826416", "0.5977952", "0.5967835", "0.5967835", "0.5967835", "0.5967835", "0.5967835", "0.5912257", "0.586695", "0.5793155", "0.57661724"...
0.0
-1
| UPDATE STUFF |
def update super @spriteset.update $game_timer.update $game_fishing.update end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_update\n do_edit\n update_save\n end", "def update # EXTENSION\n sql = \"UPDATE tickets SET customer_id = $1, film_id = $2, screening_id = $3 WHERE id = $4\"\n values = [@customer_id, @film_id, @screening_id, @id]\n SqlRunner.run(sql, values)\nend", "def update\n p \"UPDATE\"\n end",...
[ "0.68517804", "0.6838884", "0.6809351", "0.6739161", "0.67382485", "0.6693608", "0.6685131", "0.6653031", "0.6652288", "0.66356915", "0.66356915", "0.66356915", "0.66356915", "0.66356915", "0.66356915", "0.66356915", "0.66356915", "0.6604552", "0.65969217", "0.6572028", "0.65...
0.0
-1