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
Support functions Run the jekyll command, with arguments (symbols are long options, hashes are long options with arguments)
def jekyll(*directives) directives.map! do |x| case x when Symbol "--#{x}" when Hash x.map { |k, v| "--#{k}=#{v}" }.join(' ') else x end end sh "jekyll #{directives.join(' ')}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jekyll(options = '')\n system(\"bin/jekyll #{options}\")\nend", "def jekyll(opts = '')\n if ENV['dev']=='on'\n dev = ' --plugins=_plugins,_plugins-dev'\n else\n dev = ''\n end\n sh \"bundle exec jekyll #{opts}#{dev} --trace\"\nend", "def build_site\n sh \"bundle exec jekyll bu...
[ "0.80927277", "0.7410157", "0.6836247", "0.6233287", "0.6165086", "0.6102838", "0.60718995", "0.5725411", "0.566027", "0.55965084", "0.55664337", "0.55242765", "0.5434422", "0.5385596", "0.53424096", "0.53060234", "0.52977204", "0.5263145", "0.5238425", "0.52285326", "0.52063...
0.7589127
1
has to be called after refresh, or with hash_values passed in
def associate hash_values=nil @rally_hash = hash_values if hash_values if @rally_hash.has_key?("Project") project = Project.find_or_create_by(:rally_uri => @rally_hash["Project"]["_ref"]) project.iterations << self end self.save end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _refresh_set_values(hash)\n @deserialized_values.clear if @deserialized_values\n super\n end", "def _refresh_set_values(h)\n @values = h\n end", "def _refresh_set_values(h)\n @values = h\n end", "def _refresh_set_values(hash)\n reset_initial_values\n ...
[ "0.71478915", "0.70189935", "0.70189935", "0.6993846", "0.68671066", "0.6440674", "0.63669115", "0.630551", "0.62919927", "0.62919927", "0.62773556", "0.61513376", "0.6142", "0.61366457", "0.6125929", "0.6044741", "0.6044741", "0.60333294", "0.60333294", "0.60152805", "0.5949...
0.0
-1
Automatically shorten URL's found in messages Using the tinyURL API
def create_bot(opts) Cinch::Bot.new do configure do |c| c.server = opts[:server] c.channels = opts[:channels] c.nick = opts[:name] c.plugins.plugins = [Seen, Hello, TopicHistory, Memo] end helpers do def shorten(url) url = open("http://tinyurl.com/api-create.php?url=#{URI.escape(url)}").rea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shorten_urls\n @status = (@status.split(\" \").collect do |word|\n if word =~ URI::regexp and word.length > 30 then\n # using tinyurl\n # NOTE: look into retwt.me, they have a simple api (w/o auth) and provide analysis\n (Net::H...
[ "0.7836109", "0.72094464", "0.6987298", "0.6972863", "0.69470274", "0.68740964", "0.686972", "0.6858323", "0.6858323", "0.68049747", "0.67434156", "0.6733004", "0.6725587", "0.6721919", "0.6721696", "0.67162895", "0.66990507", "0.66531676", "0.6649935", "0.6630715", "0.660453...
0.0
-1
Returns true if the format is compatible with the request.
def match?(_request) fail NotImplementedError end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_request?\n request.format.json? || request.format.js? || request.format.xml? || request.format.fbtab?\n end", "def valid?\n valid_format? @format\n end", "def supported?\n if is_simple_format?\n return true\n elsif is_advanced_format?\n return is_supported_advanced_format?\...
[ "0.740956", "0.72072196", "0.71073836", "0.7099259", "0.70763385", "0.70394677", "0.6995136", "0.6861017", "0.67506844", "0.6710312", "0.6658473", "0.66120905", "0.6594572", "0.65910286", "0.6570716", "0.65319556", "0.64721066", "0.645837", "0.6455793", "0.6454077", "0.645078...
0.0
-1
Returns true if the format is compatible with the request.
def match?(request) request.content_type =~ %r{^application/json.*} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_request?\n request.format.json? || request.format.js? || request.format.xml? || request.format.fbtab?\n end", "def valid?\n valid_format? @format\n end", "def supported?\n if is_simple_format?\n return true\n elsif is_advanced_format?\n return is_supported_advanced_format?\...
[ "0.74071974", "0.7205271", "0.7106237", "0.7098738", "0.70754445", "0.7038768", "0.6993981", "0.68613726", "0.6749574", "0.6709443", "0.6658076", "0.6611499", "0.6593686", "0.65888673", "0.65700245", "0.65303874", "0.64698374", "0.6455498", "0.645291", "0.64527124", "0.644964...
0.6319554
39
Always matches. This is why this format needs to be the last to be registered so more specific formats are before it.
def match?(_request) true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process_format(format); end", "def _process_format(format); end", "def format_regex\n callback.options[:live_validator] || callback.options[:with]\n end", "def is_format?(); @type == GRT_FORMAT; end", "def _process_format(format) # :nodoc:\n end", "def formats; end", "def formats; e...
[ "0.6311319", "0.6311319", "0.5991302", "0.5917165", "0.5873941", "0.5853508", "0.5853508", "0.5838249", "0.5810381", "0.5775825", "0.5751575", "0.5711792", "0.56921726", "0.5679681", "0.564781", "0.5601195", "0.5601195", "0.55796075", "0.5553737", "0.5508502", "0.5498242", ...
0.0
-1
GET /login GET /sessions/new
def new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @session = Session.new\n\n render 'sessions/login'\n #respond_to do |format|\n # format.html # new.html.erb\n #format.json { render json: @session }\n # end\n end", "def new #login page\n end", "def new\n if !session[:id] && !session[:token]\n redirect_to({controller:'user...
[ "0.73042536", "0.71991426", "0.7178651", "0.7175112", "0.71671367", "0.6840327", "0.68087745", "0.6801599", "0.6727936", "0.6726871", "0.67041373", "0.6687035", "0.66818374", "0.6632659", "0.66037893", "0.6593621", "0.6584824", "0.65643495", "0.6563939", "0.65023017", "0.6500...
0.0
-1
GET /sessions/oauth GET /auth/:provider/callback
def oauth profile = OAuthProfile.from_omniauth(env['omniauth.auth']) # TODO check for error # temp_password = SecureRandom.hex if !profile.user oauth_custom_params = request.env["omniauth.params"] || {} session[:oauth_reason] = oauth_custom_params.fetch("dbdesigner_action", "") session...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def oauth\n session[:return_to_url] = params[:redirect_after_login] if params[:redirect_after_login]\n login_at(auth_params[:provider])\n end", "def oauth\n login_at(auth_params[:provider])\n end", "def oauth\n login_at(auth_params[:provider])\n end", "def authorize_callback\n @request_...
[ "0.7347758", "0.7256924", "0.7256924", "0.68790096", "0.66832656", "0.66559714", "0.66321594", "0.662259", "0.65520257", "0.6530762", "0.651418", "0.64893365", "0.6476555", "0.6438987", "0.64315593", "0.64171696", "0.64035076", "0.6383108", "0.6383108", "0.6377728", "0.637514...
0.5854426
69
GET /logout POST /logout DELETE /sessions
def destroy if session[:was_admin] session[:user_id] = session[:was_admin] session.delete :was_admin else session[:user_id] = nil end redirect_to login_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_out\n get '/sessions/destroy'\nend", "def log_out\n get '/sessions/destroy'\nend", "def log_out \n get '/sessions/destroy'\nend", "def log_out \n get '/sessions/destroy'\nend", "def log_out \n get '/sessions/destroy'\nend", "def log_out \n get '/sessions/destroy'\nend", "def log_out \n g...
[ "0.8507462", "0.8507462", "0.84587246", "0.84587246", "0.84587246", "0.84587246", "0.84587246", "0.7791404", "0.7781273", "0.7657879", "0.76436865", "0.76216614", "0.7470535", "0.74669594", "0.74576277", "0.7456397", "0.7453288", "0.7436295", "0.7436295", "0.7404582", "0.7390...
0.0
-1
GET /auth/failure OAuth failure callback path
def auth_failure logger.warn "[SESS] auth failure: #{params[:message]}" redirect_to new_session_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fail\n render :text => request.env[\"omniauth.auth\"].to_yaml\n end", "def failure\n flash.alert = 'Failed to authorize Twitter account.'\n redirect_to twitter_accounts_url\n end", "def default_oauth_fail\n auth = request.env['omniauth.auth']\n session.delete(\"devise.#{auth.provider.to_s...
[ "0.7027069", "0.69553906", "0.693479", "0.69245285", "0.68982655", "0.6872639", "0.6752903", "0.6724927", "0.67187095", "0.6699484", "0.6669118", "0.6665188", "0.6655913", "0.6637903", "0.6634109", "0.6630609", "0.65993834", "0.6584897", "0.6575338", "0.6517949", "0.6475175",...
0.6582985
18
GET /passwordrecovery/remindersent The success page after the user enters email for password recovery
def reminder_sent end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remind\n @title = \"Password Reminder\"\n if param_posted?(:user)\n email = params[:user][:email]\n user = User.find_by_email(email)\n if user\n UserMailer.reminder(user).deliver\n flash[:success] = \"Login information sent to #{email}\"\n redirect_to root_path\n ...
[ "0.7406359", "0.7377437", "0.71772474", "0.7158029", "0.71422815", "0.7114576", "0.7055552", "0.70383835", "0.70267326", "0.70266116", "0.7014469", "0.7010182", "0.6998817", "0.69758505", "0.6960167", "0.6954683", "0.69166106", "0.69119704", "0.6910484", "0.6874601", "0.68427...
0.650398
86
GET /passwordrecovery/recover/:token The page where the user lands coming from the password recovery email
def recover @user = User.find_by password_reset_digest: params[:token] if !@user flash[:alert] = 'Invalid link' redirect_to '/password-recovery/remind-password' return end @token = params[:token] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_recover\n redirect_to lato_core.root_path unless core_getRecoveryPasswordPermission\n if user = LatoCore::Superuser.find_by(email: params[:email].downcase)\n # genero il codice da salvare come session code\n code = \"RECPSW-#{SecureRandom.urlsafe_base64}\"\n # ...
[ "0.7462621", "0.7343085", "0.7154333", "0.7150844", "0.70899653", "0.6937087", "0.69230616", "0.6896216", "0.6651413", "0.6637898", "0.66059184", "0.6569683", "0.6552999", "0.65236306", "0.6519975", "0.6487537", "0.6470082", "0.6465917", "0.6448562", "0.64428467", "0.6429536"...
0.792576
0
puts "please inter a number" n =gets.strip counter = 1 sum=0 while counter <=n.to_i if counter % 3==0 || counter % 5==0 sum += counter counter +=1 end end puts sum
def guess_the_number prog_num=rand(1..20) counter=0 while counter < 10 number=user_guessing counter+=1 if number>prog_num if number-(prog_num)>5 puts "too large try no.#{counter}" else number-(prog_num)>5 puts "bit large try no.#{counter}" end elsif number<prog_num if (prog_num)-number>5 puts "too s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adding some_number\ni = 0\nsum = 0\n while i < some_number\n if i % 5 == 0 or i % 3 == 0\n sum += i\n end\n i += 1\n end\n puts sum\nend", "def sum_multiples_three_five\n sum = 0\n n = 0\n while n < 1000\n if(((n%3) == 0) || ((n%5) == 0))\n sum +...
[ "0.82282525", "0.7856457", "0.77275616", "0.7721888", "0.77003556", "0.76893055", "0.7681333", "0.7619648", "0.7585935", "0.7550421", "0.7539804", "0.7534963", "0.7524533", "0.7501719", "0.7501187", "0.7486206", "0.7471756", "0.74596924", "0.7447688", "0.73945844", "0.7388843...
0.0
-1
Checks if current recipient able to receive freeform text
def able_to_send_freeform_text? last_inbound_message = messages.inbound.last return false unless last_inbound_message last_inbound_message.created_at + 24.hours >= Time.zone.now end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipient_available?(current_recipient)\n if current_recipient.nil?\n puts \"No current recipient selected.\"\n else\n puts \"What message would you like to send?\"\n current_recipient.send_message(gets.chomp)\n end\nend", "def receive_recipient rcpt\n true\n end", "def receive_reci...
[ "0.67116827", "0.6551628", "0.6551628", "0.6551628", "0.639441", "0.6319106", "0.6124252", "0.61182696", "0.60949963", "0.6088107", "0.60835266", "0.6025747", "0.5957783", "0.59218585", "0.5919245", "0.59189445", "0.5888836", "0.58698213", "0.58676255", "0.5857659", "0.585522...
0.66995835
1
Checks for messaging platform based on their `number` column whatsapp 'whatsapp:+60123456789' sms '+60123456789' messenger 'messenger:123456789'
def platform case number when /whatsapp/ 'whatsapp' when /messenger/ 'messenger' else 'sms' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_extension_phone_number_detect_sms_feature()\n begin\n endpoint = \"/restapi/v1.0/account/~/extension/~/phone-number\"\n resp = $platform.get(endpoint)\n for record in resp.body['records'] do\n for feature in record['features'] do\n if feature == \"SmsSender\"\n # If user has...
[ "0.6133845", "0.58666766", "0.5720551", "0.56871295", "0.5615994", "0.5611103", "0.5572347", "0.55648994", "0.55512226", "0.5486782", "0.5485437", "0.5461072", "0.54113466", "0.53517085", "0.53516674", "0.53315014", "0.52528274", "0.5250304", "0.52291155", "0.5209644", "0.519...
0.68543506
0
GET /stuk_todo_tasks GET /stuk_todo_tasks.json
def index @to_do = current_user.stuk_todo_tasks.where(state: 'to_do') @doing = current_user.stuk_todo_tasks.where(state: 'doing') @done = current_user.stuk_todo_tasks.where(state: 'done') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tasks\n @todos = Todo.all\n render json: @todos\n end", "def todo\n @tasks = TaskDecorator.decorate_collection Task.getReadyToDoTasks\n render \"v1/tasks/index\"\n end", "def index\n # GET /tasks\n @tasks = Task.all\n end", "def index\n @tasks = Task.all\n\n render json: @tasks\...
[ "0.81217694", "0.7636453", "0.7396693", "0.7364092", "0.7293267", "0.7235082", "0.72077256", "0.7199321", "0.7199321", "0.7199321", "0.71991354", "0.7126991", "0.7101131", "0.708493", "0.7073694", "0.70497805", "0.70496905", "0.7030475", "0.7016339", "0.70067847", "0.7004523"...
0.6669953
76
GET /stuk_todo_tasks/1 GET /stuk_todo_tasks/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tasks\n @todos = Todo.all\n render json: @todos\n end", "def show\n @todo_task = TodoTask.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @todo_task }\n end\n end", "def todo\n @tasks = TaskDecorator.decorate_collection T...
[ "0.7875715", "0.74037445", "0.728949", "0.7257148", "0.72104645", "0.7192503", "0.7191644", "0.7178334", "0.71064097", "0.71064097", "0.71064097", "0.71005887", "0.7095654", "0.70947605", "0.70753324", "0.7060501", "0.7054734", "0.7032845", "0.7001317", "0.6951112", "0.693971...
0.0
-1
POST /stuk_todo_tasks POST /stuk_todo_tasks.json
def create @stuk_todo_task = current_user.stuk_todo_tasks.new(stuk_todo_task_params) respond_to do |format| if @stuk_todo_task.save format.html { redirect_to @stuk_todo_task, notice: 'Stuk todo task was successfully created.' } format.json { render :show, status: :created, location: @stuk...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n #@task = Task.new(task_params)\n task = @task_list.tasks.create!(task_params)\n render json: task\n end", "def create\n @todo_task = TodoTask.new(params[:todo_task])\n\n respond_to do |format|\n if @todo_task.save\n format.html { redirect_to @todo_task, notice: 'Todo task...
[ "0.72900796", "0.71089965", "0.70728654", "0.7051348", "0.70033", "0.6977859", "0.6906729", "0.6902627", "0.6896549", "0.68596447", "0.68373394", "0.6836748", "0.6828704", "0.68118685", "0.680485", "0.6779569", "0.67759764", "0.67681193", "0.6761551", "0.6726276", "0.67132014...
0.7319497
0
PATCH/PUT /stuk_todo_tasks/1 PATCH/PUT /stuk_todo_tasks/1.json
def update respond_to do |format| if @stuk_todo_task.update(stuk_todo_task_params) format.html { redirect_to @stuk_todo_task, notice: 'Stuk todo task was successfully updated.' } format.json { render :show, status: :ok, location: @stuk_todo_task } else format.html { render :edit ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_user_task\n task = Task.find(params[:id])\n \n if task.update(task_params)\n render json: {task: task, status: 201} \n else\n render json: {errors: task.errors.full_message , status: 422}\n end\n end", "def edit_user_task\n task = Task.find(params[:id])\n \n if task.up...
[ "0.7310608", "0.7310608", "0.72766966", "0.7259013", "0.72390825", "0.71821845", "0.71490127", "0.7102158", "0.70138824", "0.6976567", "0.6962186", "0.6892012", "0.68757683", "0.6843228", "0.68249494", "0.6823082", "0.6803263", "0.6800385", "0.67952967", "0.67766404", "0.6749...
0.6876605
12
DELETE /stuk_todo_tasks/1 DELETE /stuk_todo_tasks/1.json
def destroy @stuk_todo_task.destroy respond_to do |format| format.html { redirect_to stuk_todo_tasks_url, notice: 'Stuk todo task was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @api_v1_todo.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @todo = Todo.find(params[:todo][:id])\n if @todo.destroy\n render json: {status: 200, message: \"Task with id \" + @todo.id.to_s + ': removed'}\n else\n re...
[ "0.74707884", "0.7441007", "0.7402256", "0.73672616", "0.734848", "0.72698444", "0.72510093", "0.72186166", "0.7213502", "0.7208336", "0.7202074", "0.71816134", "0.7160859", "0.71098125", "0.70953465", "0.70824504", "0.70814055", "0.70814055", "0.70775956", "0.70692325", "0.7...
0.72640824
6
Use callbacks to share common setup or constraints between actions.
def set_stuk_todo_task @stuk_todo_task = StukTodoTask.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
Never trust parameters from the scary internet, only allow the white list through.
def stuk_todo_task_params params.require(:stuk_todo_task).permit(:content, :state) 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
a method that allows a configuration block to be passed to AllscriptsApi::Configurationnew
def configure self.configuration ||= AllscriptsApi::Configuration.new yield(configuration) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config(&block)\n instance_eval(&block) if block_given?\n end", "def configure( &block )\n @configuration = block\n end", "def configure(&block)\n @configure_blocks ||= []\n @configure_blocks << block\n end", "def configure(&block)\n block.call Configuration\n end"...
[ "0.7935178", "0.7839995", "0.77569425", "0.77410275", "0.7706136", "0.76580226", "0.76416916", "0.756991", "0.7536546", "0.7536546", "0.75340384", "0.7498787", "0.7444692", "0.7444692", "0.7425834", "0.74217546", "0.7404463", "0.7403692", "0.73708516", "0.7351402", "0.7349272...
0.7527689
11
Checks the passedin password against the saved admin salt and hash.
def admin_authenticate?(password) salt = get_setting(:admin_pass_salt, "") hash = get_setting(:admin_pass_hash, "") hash == BCrypt::Engine.hash_secret(password, salt) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def match_password_hash\n\n evaluated_password_e = Admin.get_encrypted_password(@password, @login_salt_d)\n return incorrect_login_error('am_l_pa_5') unless (evaluated_password_e == @admin.password)\n\n success\n end", "def password_match?(password=\"\")\n hashed_password == AdminUse...
[ "0.769719", "0.7437058", "0.7437058", "0.741785", "0.7398052", "0.72857696", "0.7268918", "0.7190211", "0.71522725", "0.7132809", "0.7114226", "0.70729923", "0.70544493", "0.7022992", "0.69982386", "0.6994294", "0.69464236", "0.6921369", "0.6857899", "0.6852244", "0.6849744",...
0.7565166
1
Saves all of the settings using the passedin params.
def save(params) save_admin_pass(params[:admin_pass]) save_setting(:site_name, params[:site_name]) save_setting(:navbar_bg_color, params[:navbar_bg_color]) save_setting(:navbar_font_color, params[:navbar_font_color]) save_setting(:navbar_border_color, params[:navbar_border_color]) save_set...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_settings\n (params[:setting] || []).each do |key, val|\n setting = Setting.find_by_key(key)\n setting = Setting.create!(key: key) unless setting\n if val.is_a?(ActionDispatch::Http::UploadedFile) # image setting value\n setting.update(image: val)\n else # text set...
[ "0.7590652", "0.73559767", "0.6841639", "0.6654382", "0.65896815", "0.65478325", "0.6514156", "0.6493019", "0.64362705", "0.6330308", "0.63055104", "0.6266877", "0.6252989", "0.6231826", "0.61786515", "0.6168354", "0.6162905", "0.6148051", "0.6091877", "0.60746914", "0.606607...
0.7825897
0
Admin page is public until a password is saved.
def is_admin_pass get_setting(:is_admin_pass, IS_ADMIN_PASS) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_user\n\t\tunless admin? \n\t\t\tflash[:danger] = \"Only administrators have access to this page\"\n\t\t\tredirect_back_or(root_url) \n\t\tend\n\tend", "def admin_user\n redirect_to root_url, notice: \"You do not have permission to view or edit this information.\" unless current_user.admin?\n en...
[ "0.705954", "0.7042855", "0.6955912", "0.6931952", "0.6917277", "0.68907887", "0.68770546", "0.6867176", "0.6864896", "0.68407977", "0.68304807", "0.6828889", "0.6819817", "0.68056494", "0.68033725", "0.67977357", "0.67951494", "0.67951494", "0.67905617", "0.6786056", "0.6784...
0.0
-1
Gets the value of the setting with the passedin key, otherwise, default.
def get_setting(key, default) setting = Setting.where(key: key).first setting && !setting.value.blank? ? setting.value : default end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_setting_value(key, hash_setting = nil)\n hash_setting ||= get_setting\n \n hash_setting[key] || self.class.default_value(key)\n end", "def get(key)\n settings.find_by_key(key).try(:value)\n end", "def [](key)\n setting_obj = setting(key)\n setting_obj ? setting_obj.value : n...
[ "0.82567984", "0.779489", "0.77867734", "0.7385333", "0.7326429", "0.73019946", "0.72514933", "0.72428375", "0.7231807", "0.7206626", "0.72030574", "0.7148321", "0.7117809", "0.7058934", "0.7033194", "0.70088047", "0.7007596", "0.69341326", "0.69001806", "0.6856759", "0.68560...
0.82835025
0
Saves the settings with the passedin key and val.
def save_setting(key, val) # Check for nil, since unchecked checkboxes don't send a value. # Check for whether a boolean, since .blank? returns true for false. # Check for a blank string. if val == nil || !!val == val || !val.blank? setting = Setting.where(key: key).first_or_create set...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_settings\n (params[:setting] || []).each do |key, val|\n setting = Setting.find_by_key(key)\n setting = Setting.create!(key: key) unless setting\n if val.is_a?(ActionDispatch::Http::UploadedFile) # image setting value\n setting.update(image: val)\n else # text set...
[ "0.65049446", "0.64630955", "0.6442019", "0.6379647", "0.6346737", "0.6198693", "0.6194307", "0.6174642", "0.6109541", "0.6098306", "0.6091826", "0.6089523", "0.60892266", "0.6073278", "0.6063142", "0.6054539", "0.6030947", "0.5986636", "0.59849757", "0.5968679", "0.5918444",...
0.7639786
0
Saves the admin password salt, hash, and whether the password exists.
def save_admin_pass(val) if val != ADMIN_PASS pass_salt = BCrypt::Engine.generate_salt pass_hash = BCrypt::Engine.hash_secret(val, pass_salt) save_setting(:admin_pass_salt, pass_salt) save_setting(:admin_pass_hash, pass_hash) save_setting(:is_admin_pass, true) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_password\n @admin.password = Admin.get_encrypted_password(@new_password, @login_salt_d)\n @admin.save!\n end", "def create_hashed_password\n\t\t#if :password has a value\n\t\t#\t-indicates we want to update the passowrd\n\t\t#\t-before_save: encrypt value with salt\n\t\t#\t-Save has...
[ "0.69242066", "0.6907935", "0.6779018", "0.6631843", "0.651768", "0.65106", "0.648056", "0.6426778", "0.6382841", "0.6331234", "0.6310939", "0.63054407", "0.6302917", "0.63028574", "0.62918323", "0.62731266", "0.62249255", "0.6209997", "0.61880714", "0.6187574", "0.6185089", ...
0.7605614
0
def index if user_signed_in? if current_user.legal_name.present? user_session_path(current_user) else edit_user_registration_path(current_user) end end end
def configure_permitted_parameters devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:company_name, :email, :password, :password_confirmation, :current_password)} # devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:password, :email)} devise_parameter_sanitizer.for(:account_update) { |u| u.permi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n \tif user_signed_in?\n \t\tname = current_user.name(false)\n# TODO: Investigate if this is even relevant anymore. The name var will never be blank here because the logic in\n# User says to return the email if the firstname and surname are empty regardless of the flag passed in\n \t\tif name.bl...
[ "0.81672263", "0.7306332", "0.72463214", "0.70591635", "0.70591635", "0.7022086", "0.69894564", "0.6962173", "0.6940778", "0.69293", "0.6886878", "0.6879392", "0.6874846", "0.68659586", "0.68659586", "0.6854447", "0.68541944", "0.68356895", "0.6829055", "0.6798437", "0.678745...
0.0
-1
the recommendations made by some user
def user recommendations 'user' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recommendations\n check_preference_setup \n check_last_played_time\n add_personality_recommendations\n\n @recommendations\n end", "def recommended_by_current_user\n if current_user\n extract = Csvarchive.find(params[:id])\n e_rec = extract.recommendations\n u_rec = current_user...
[ "0.781104", "0.764283", "0.7367639", "0.7309262", "0.7185015", "0.71237814", "0.70941293", "0.7024433", "0.69872284", "0.6975372", "0.6952374", "0.6946477", "0.69447094", "0.69369817", "0.68893766", "0.6883884", "0.6842288", "0.68398297", "0.68184286", "0.6811445", "0.6805568...
0.7848443
0
the recommendations made about some location
def location recommendations 'location' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recommendations\n check_preference_setup \n check_last_played_time\n add_personality_recommendations\n\n @recommendations\n end", "def recommendation\n return @recommendation\n end", "def recommendations\n @recommendations = []\n @connection.response_data.map do...
[ "0.6895317", "0.64271694", "0.61626726", "0.61371845", "0.6095805", "0.6088224", "0.6049037", "0.60365665", "0.6002279", "0.5947189", "0.59232193", "0.5922127", "0.5903396", "0.5897451", "0.5890264", "0.58837897", "0.58737075", "0.5868922", "0.5841194", "0.5817728", "0.579175...
0.7703625
0
Create a new logger.
def initialize(label = nil, &block) @label = label block.call(self) if block end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(name = nil)\n logger_name = name || caller(1..1).first[/`(.+)'/, 1]\n Logger.new(logger_name)\n end", "def create_logger\n raise \"You should create your own `create_logger` method\"\n end", "def create_logger\n raise \"You should create your own `create_logger` method\"\n ...
[ "0.79765797", "0.794848", "0.794848", "0.78039277", "0.75099957", "0.7403024", "0.73947096", "0.7295929", "0.72065526", "0.7194099", "0.7097616", "0.6976701", "0.6976701", "0.6968951", "0.6941117", "0.69383436", "0.6933682", "0.69134665", "0.68358564", "0.68244165", "0.680466...
0.0
-1
The cached formatter instance. If there's none, one will be created.
def formatter @formatter ||= Formatters::Default.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize\n @formatter = method(:default_formatter)\n end", "def formatter\n @formatter.formatter\n end", "def formatter()\n @formatter\n end", "def formatter=(formatter)\n @formatter =\n if formatter.nil?\n respond_to?(:call) ? self : default_formatter\n ...
[ "0.6976056", "0.66532505", "0.6622581", "0.65775734", "0.6514169", "0.6495601", "0.64901483", "0.64893776", "0.64805293", "0.6469977", "0.63685036", "0.6346911", "0.6346911", "0.6291584", "0.62146187", "0.6171398", "0.6147943", "0.61447847", "0.6122132", "0.6077509", "0.60711...
0.7393584
0
def add_commissions(account, amount) redis.hset pk(account), "total_commissions", total_commissions(account) + amount end
def balance(account) net_deposits(account) - net_withdraws(account) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_or_remove_cash(cash, amount)\n return cash[:admin][:total_cash] += amount\nend", "def add_or_remove_cash(cash, amount)\n return cash[:admin][:total_cash] += amount\nend", "def add(cash)\n @current_balance = @current_balance + cash\n end", "def add_or_remove_cash(shop, amount)\n shop[:admin][:t...
[ "0.6433548", "0.6433548", "0.6316251", "0.6292813", "0.62759715", "0.62539375", "0.6241147", "0.61344224", "0.6132019", "0.6083905", "0.6048235", "0.60365194", "0.60347515", "0.6031226", "0.6020373", "0.6015895", "0.60047907", "0.59966534", "0.59648144", "0.59648144", "0.5947...
0.0
-1
GET /gigapans GET /gigapans.json
def index @gigapans = Gigapan.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n format.html {render json: @gig, status: :ok}\n format.json { render json: @gig, status: :ok }\n end\n end", "def index\n @gakkas = Gakka.all\n end", "def index\n @garnishes = Garnish.where(\"LOWER(name) like ?\", \"...
[ "0.7172506", "0.6659971", "0.6642913", "0.6595735", "0.65871245", "0.65791607", "0.6527109", "0.64854366", "0.64815277", "0.64590824", "0.6453193", "0.63492286", "0.63449687", "0.6342909", "0.6331624", "0.62757236", "0.6259193", "0.62442195", "0.62335265", "0.6215515", "0.620...
0.74949664
0
GET /gigapans/1 GET /gigapans/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n format.html {render json: @gig, status: :ok}\n format.json { render json: @gig, status: :ok }\n end\n end", "def index\n @gigapans = Gigapan.all\n end", "def show\n @gig_request = GigRequest.find(params[:id])\n\n ...
[ "0.7457587", "0.7255503", "0.6782684", "0.6748193", "0.6728249", "0.6545615", "0.6517136", "0.65053946", "0.649888", "0.6469542", "0.646225", "0.64499056", "0.64369404", "0.64118344", "0.64106995", "0.6396985", "0.6395171", "0.63889813", "0.6385452", "0.6383362", "0.63814896"...
0.0
-1
POST /gigapans POST /gigapans.json
def create @gigapan = Gigapan.new(gigapan_params) respond_to do |format| if @gigapan.save format.html { redirect_to @gigapan, notice: 'Gigapan was successfully created.' } format.json { render :show, status: :created, location: @gigapan } else format.html { render :new } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @gang = Gang.new(gang_params)\n\n respond_to do |format|\n if @gang.save\n format.html { redirect_to @gang, notice: 'Gang was successfully created.' }\n format.json { render :show, status: :created, location: @gang }\n else\n format.html { render :new }\n fo...
[ "0.6331206", "0.6269475", "0.60883754", "0.60736394", "0.6058379", "0.6015301", "0.60093653", "0.5913532", "0.5912147", "0.5908234", "0.5886577", "0.5848796", "0.58117175", "0.58074707", "0.57898474", "0.5749476", "0.5709044", "0.57076526", "0.5680967", "0.56791526", "0.56687...
0.64743775
0
PATCH/PUT /gigapans/1 PATCH/PUT /gigapans/1.json
def update respond_to do |format| if @gigapan.update(gigapan_params) format.html { redirect_to @gigapan, notice: 'Gigapan was successfully updated.' } format.json { render :show, status: :ok, location: @gigapan } else format.html { render :edit } format.json { render json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n if update_gig(@gig)\n format.html { redirect_to @gig, notice: 'Gig was successfully updated.' }\n format.json { render json: @gig, status: :ok, location: @gig }\n else\n format.html { render action: \"edit\"...
[ "0.6654686", "0.64530367", "0.64485854", "0.6409269", "0.6276356", "0.6251555", "0.6227445", "0.62250435", "0.6216419", "0.6193928", "0.6120833", "0.6115311", "0.6106076", "0.6100362", "0.6099361", "0.6074797", "0.6061791", "0.6045284", "0.60261714", "0.6011834", "0.60048956"...
0.60503423
17
DELETE /gigapans/1 DELETE /gigapans/1.json
def destroy @gigapan.destroy respond_to do |format| format.html { redirect_to gigapans_url, notice: 'Gigapan was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @gig = Gig.find(params[:id])\n @gig.destroy\n\n respond_to do |format|\n format.html { redirect_to gigs_url }\n format.json { render json: nil, status: :ok }\n end\n end", "def destroy\n @gig_request = GigRequest.find(params[:id])\n @gig_request.destroy\n\n respond_t...
[ "0.7378508", "0.7195424", "0.7167964", "0.71067554", "0.71051896", "0.70740837", "0.7054732", "0.7044149", "0.7029028", "0.7013696", "0.6999828", "0.6961992", "0.69596744", "0.6950693", "0.6922792", "0.69133353", "0.6901223", "0.6886419", "0.68813634", "0.6881043", "0.6874507...
0.7088292
5
Use callbacks to share common setup or constraints between actions.
def set_gigapan @gigapan = Gigapan.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
Never trust parameters from the scary internet, only allow the white list through.
def gigapan_params params.require(:gigapan).permit(:name, :project, :gig_id, :description) 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
TODO: deprecate TODO: parametrize to include gazetteer i.e. geographic_areas_geographic_items.where( gaz = 'some string') !! avoid loading the whole GeographicItem, just grab the bits we need.
def collecting_event_to_simple_json_feature(collecting_event) base = { 'type' => 'Feature', 'properties' => { 'target' => { 'type' => 'CollectingEvent', 'id' => collecting_event.id }, 'label' => label_for_collecting_event(collecting_event) } } if collecting...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_geographic_item\n @geographic_item = GeographicItem.find(params[:id])\n end", "def items_as_geojson\n @model.fields.each do |field|\n next unless field.is_a?(Field::Geometry)\n\n geometry_aware_items = unpaginaged_items.reject { |it| it.data[field.uuid].blank? }\n\n return geome...
[ "0.6307753", "0.58931917", "0.5825621", "0.5756756", "0.57546854", "0.5720181", "0.5705993", "0.5687131", "0.5607812", "0.5595643", "0.5549623", "0.5535058", "0.5487573", "0.5468664", "0.5452024", "0.5427229", "0.5416999", "0.53658175", "0.5336284", "0.53353095", "0.5326164",...
0.0
-1
GET /comics GET /comics.json
def index #debugger notNull = Comic.where("#{sort_column} IS NOT NULL").order(sort_column + " " + sort_direction) nulled = Comic.where("#{sort_column} IS NULL").order(sort_column + " " + sort_direction) @comics = notNull + nulled print @comics #@comics = Comic.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @comic = Comic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comic }\n end\n end", "def show\n @comic = Comic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render...
[ "0.7236975", "0.7236975", "0.6939306", "0.6939306", "0.68235606", "0.66751975", "0.64431655", "0.6433644", "0.6351882", "0.63086104", "0.62734175", "0.62734175", "0.6270068", "0.62038803", "0.6201327", "0.61778396", "0.61769277", "0.61021703", "0.6085176", "0.6068778", "0.606...
0.0
-1
GET /comics/1 GET /comics/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @comic = Comic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comic }\n end\n end", "def show\n @comic = Comic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render...
[ "0.7378391", "0.7378391", "0.6780417", "0.6573603", "0.6573603", "0.65449303", "0.65449303", "0.64161086", "0.63522905", "0.63431585", "0.6235143", "0.62133604", "0.62133604", "0.6204769", "0.618791", "0.6186452", "0.61771953", "0.61668", "0.6146813", "0.6114282", "0.6106884"...
0.0
-1
POST /comics POST /comics.json
def create #ok = true @comic = Comic.new(comic_params) #@comic.url = @comic.check_and_fix_url # #if Comic.pluck(:name).include? @comic.name if comicExists?#(@comic) CU_ExistingComic(@comic) #format.html { redirect_to '/comics/new', alert: "Error: Comic \"#{@comic....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @comic = Comic.new(comic_params)\n\n respond_to do |format|\n if @comic.save\n format.html { redirect_to root_path, notice: 'Comic was successfully created.' }\n format.json { redirect_to root_path, status: :created }\n else\n format.html { render :new }\n f...
[ "0.6854384", "0.6840256", "0.6473725", "0.61243963", "0.61214525", "0.60706306", "0.5967187", "0.5889738", "0.5839897", "0.5839897", "0.58372587", "0.5784615", "0.5749311", "0.57228714", "0.5711935", "0.5707214", "0.56768405", "0.5671031", "0.56709206", "0.56571716", "0.56376...
0.6116212
5
PATCH/PUT /comics/1 PATCH/PUT /comics/1.json
def update #@comic.url = @comic.check_and_fix_url if comicExists? #@comic CU_ExistingComic(@comic) else updateNonExistingComic(@comic) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @comic = Comic.find(params[:id])\n\n respond_to do |format|\n if @comic.update_attributes(params[:comic])\n format.html { redirect_to @comic, notice: 'Comic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit...
[ "0.668917", "0.6463799", "0.63469845", "0.6231888", "0.6213887", "0.61955446", "0.6161654", "0.61585414", "0.61549085", "0.61464256", "0.61313397", "0.61264193", "0.6097296", "0.60876584", "0.6035381", "0.60324466", "0.6027002", "0.6010319", "0.6002323", "0.60018146", "0.5996...
0.0
-1
I left this in here just in case, but it shouldn't be called. DELETE /comics/1 DELETE /comics/1.json
def destroy @comic.destroy respond_to do |format| format.html { redirect_to '/', notice: "Comic \"#{@comic.name}\" was successfully deleted." } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @comic = Comic.find(params[:id])\n @comic.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_comics_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @comic = Comic.find(params[:id])\n @comic.destroy\n\n respond_to do |format|\n...
[ "0.73250973", "0.7099454", "0.67854434", "0.6762957", "0.6698964", "0.668944", "0.66808695", "0.6679415", "0.6630194", "0.6586703", "0.6567807", "0.65508217", "0.65375453", "0.65301454", "0.6514614", "0.6507122", "0.65011066", "0.6487368", "0.64795387", "0.64296573", "0.64279...
0.6795894
2
Use callbacks to share common setup or constraints between actions.
def set_comic @comic = Comic.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
Never trust parameters from the scary internet, only allow the white list through.
def comic_params params.require(:comic).permit(:name, :author, :url, :synopsis, :genre, :rating_art, :rating_story, :rating_overall, :update_schedule, :page_layout) 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
Initialize with _name_ and _options_.
def initialize(name = nil, options = {}) super options.each { |k,v| send :"#{k}=", v } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize name, *options\n @name = name\n @options = options\n end", "def initialize(options = {})\n require_options(options, [:name])\n @name = options[:name]\n end", "def initialize(name)\n @name = name\n @options = Hash.new\n end", "def initialize n...
[ "0.88206035", "0.87214524", "0.8697182", "0.86448467", "0.8200587", "0.81056595", "0.8034961", "0.7955008", "0.7900337", "0.78600705", "0.7849325", "0.7830291", "0.7818841", "0.78030527", "0.78000236", "0.7771051", "0.77616984", "0.7704742", "0.7690857", "0.7690857", "0.76908...
0.8440349
4
Quoted github issue name and number.
def to_s "#%-3s %s" % [ number, name] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def github_issue_for(author)\n github_issues[author.gh_issue_number]\n end", "def identifier\n issue.identifier\n end", "def issue_url(api_url)\n # \"https://api.github.com/repos/typed-ember/ember-cli-typescript/issues/322\"\n api_index = api_url.index(\"api\")\n repos_index = api_url.index(\"...
[ "0.61163807", "0.59911776", "0.57983696", "0.5769806", "0.5714341", "0.565807", "0.5641154", "0.5533708", "0.5528854", "0.54950106", "0.54816645", "0.5480701", "0.5479317", "0.5468885", "0.5450055", "0.5449838", "0.54305357", "0.5413904", "0.5410304", "0.5407806", "0.54021114...
0.0
-1
Output verbose task information.
def verbose_output(format) super(format) say format % ['labels', labels.join(', ')] if labels and not labels.empty? say format % ['project', [username, project].join('/')] say format % ['url', url ] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verbose(*args)\n if @verbose\n $stderr.puts args\n end\n end", "def verbose(tf=true)\n @verbose = tf\n end", "def verbose\n \"-q\"\n end", "def verbose( text )\n $stderr.puts text if $params[ :verbose ]\nend", "def verbose(m)\n $stderr.puts(m) if $verbose\nend", "def ver...
[ "0.6805797", "0.6682833", "0.6673702", "0.6655492", "0.6652425", "0.6562772", "0.65565604", "0.6542497", "0.65342176", "0.65135455", "0.648419", "0.64723253", "0.6364623", "0.6355578", "0.63549256", "0.6345793", "0.6345793", "0.6331571", "0.6331177", "0.62952346", "0.62781775...
0.5835528
57
PATCH/PUT /nsts/1 remove 'template' from returned parameters because nonnumeric hashkeys there cause "Unpermitted parameters" errors and prohibit saving any permission records (RoR 4.1.6) Note: 'template' entry may not exist in test environment, hence try is inserted
def update respond_to do |format| params[ :network_station ][ :network_stops_attributes ].try( :delete, 'template' ) if @network_station.update( network_station_params ) format.html { redirect_to @network_station, notice: t( 'network_stations.msg.edit_ok' )} else format.html ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template_params\n params.require(:template).permit(:name, :description, :template_type, :accounting_plan, :accounting_plan_id)\n end", "def template_params\n params.require(:cms_template).permit(:title, :section_id, :layout_id, :path,\n :content_type, :tag_list, :system_name, :liquid_enabled, :ha...
[ "0.6794625", "0.6715387", "0.6703962", "0.6687731", "0.6676661", "0.6643516", "0.6575711", "0.65139043", "0.64831734", "0.6481081", "0.647267", "0.64623845", "0.643813", "0.6415583", "0.6404235", "0.63733083", "0.63363975", "0.6301192", "0.62853247", "0.6284641", "0.6277641",...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_network_station @network_station = NetworkStation.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.6162554", "0.60452986", "0.5945278", "0.59169763", "0.58877826", "0.5834763", "0.5775349", "0.5704972", "0.5704972", "0.56543803", "0.5621491", "0.5427202", "0.54093206", "0.54093206", "0.54093206", "0.53975695", "0.53776276", "0.53562194", "0.5340594", "0.5337824", "0.532...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def network_station_params params.require( :network_station ).permit( :code, :alt_code, :curr_name, :prev_name, :transfer, :note, network_stops_attributes: [ :id, :_destroy, :stop_no, :code, :location_code_id, :note, :network_line_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
Override in your plugin if needed
def txn_id authorization end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom; end", "def custom; end", "def plugin_setup!; end", "def overrides; end", "def plugin(ref)\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tend", "def plugins; end", "def plugins; end", "def plugins; end", "def plugins; end", "def extended( hooked_instance )\n\n super if defined?( super )\n \n en...
[ "0.7252171", "0.7252171", "0.7214979", "0.7039693", "0.68865967", "0.6809317", "0.6809317", "0.6809317", "0.6809317", "0.6734289", "0.66869515", "0.66867787", "0.6679561", "0.6537663", "0.6526972", "0.6526972", "0.6521493", "0.6478853", "0.6440719", "0.6440674", "0.6419345", ...
0.0
-1
Override in your plugin if needed
def first_reference_id nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom; end", "def custom; end", "def plugin_setup!; end", "def overrides; end", "def plugin(ref)\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tend", "def plugins; end", "def plugins; end", "def plugins; end", "def plugins; end", "def extended( hooked_instance )\n\n super if defined?( super )\n \n en...
[ "0.7252171", "0.7252171", "0.7214979", "0.7039693", "0.68865967", "0.6809317", "0.6809317", "0.6809317", "0.6809317", "0.6734289", "0.66869515", "0.66867787", "0.6679561", "0.6537663", "0.6526972", "0.6526972", "0.6521493", "0.6478853", "0.6440719", "0.6440674", "0.6419345", ...
0.0
-1
Override in your plugin if needed
def second_reference_id nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom; end", "def custom; end", "def plugin_setup!; end", "def overrides; end", "def plugin(ref)\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tend", "def plugins; end", "def plugins; end", "def plugins; end", "def plugins; end", "def extended( hooked_instance )\n\n super if defined?( super )\n \n en...
[ "0.72522223", "0.72522223", "0.721495", "0.7039866", "0.68866545", "0.6809293", "0.6809293", "0.6809293", "0.6809293", "0.67343366", "0.6686862", "0.6686709", "0.6679598", "0.65377825", "0.6527068", "0.6527068", "0.6521526", "0.64788234", "0.64407295", "0.6440593", "0.6419472...
0.0
-1
Override in your plugin if needed
def effective_date created_at end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom; end", "def custom; end", "def plugin_setup!; end", "def overrides; end", "def plugin(ref)\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tend", "def plugins; end", "def plugins; end", "def plugins; end", "def plugins; end", "def extended( hooked_instance )\n\n super if defined?( super )\n \n en...
[ "0.7252171", "0.7252171", "0.7214979", "0.7039693", "0.68865967", "0.6809317", "0.6809317", "0.6809317", "0.6809317", "0.6734289", "0.66869515", "0.66867787", "0.6679561", "0.6537663", "0.6526972", "0.6526972", "0.6521493", "0.6478853", "0.6440719", "0.6440674", "0.6419345", ...
0.0
-1
Override in your plugin if needed
def gateway_error message end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom; end", "def custom; end", "def plugin_setup!; end", "def overrides; end", "def plugin(ref)\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tend", "def plugins; end", "def plugins; end", "def plugins; end", "def plugins; end", "def extended( hooked_instance )\n\n super if defined?( super )\n \n en...
[ "0.7252171", "0.7252171", "0.7214979", "0.7039693", "0.68865967", "0.6809317", "0.6809317", "0.6809317", "0.6809317", "0.6734289", "0.66869515", "0.66867787", "0.6679561", "0.6537663", "0.6526972", "0.6526972", "0.6521493", "0.6478853", "0.6440719", "0.6440674", "0.6419345", ...
0.0
-1
Override in your plugin if needed
def gateway_error_code nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom; end", "def custom; end", "def plugin_setup!; end", "def overrides; end", "def plugin(ref)\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tend", "def plugins; end", "def plugins; end", "def plugins; end", "def plugins; end", "def extended( hooked_instance )\n\n super if defined?( super )\n \n en...
[ "0.7252171", "0.7252171", "0.7214979", "0.7039693", "0.68865967", "0.6809317", "0.6809317", "0.6809317", "0.6809317", "0.6734289", "0.66869515", "0.66867787", "0.6679561", "0.6537663", "0.6526972", "0.6526972", "0.6521493", "0.6478853", "0.6440719", "0.6440674", "0.6419345", ...
0.0
-1
authorization was the old name (reserved on PostgreSQL) make sure we support both column names for backward compatibility
def authorization=(auth) write_attribute(column_for_attribute('authorization').name, auth) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_column\n end", "def database_field_names\n [\"user_id\", \"assignment_id\"]\n end", "def quote_column_name(name) #:nodoc:\n name.to_s =~ /[A-Z]/ ? \"\\\"#{name}\\\"\" : quote_oracle_reserved_words(name)\n end", "def apply_devise_schema(name, type, options={})\n column name,...
[ "0.5971746", "0.57667255", "0.57075953", "0.5650925", "0.56270224", "0.5616921", "0.55897886", "0.55709803", "0.5557525", "0.555246", "0.5485987", "0.54859143", "0.5479747", "0.5457133", "0.5437254", "0.5431934", "0.5423345", "0.5406831", "0.53949785", "0.53318673", "0.528920...
0.5549644
10
The Game Initializing variables
def new_game set_player if human_player? start_message(:welcome) set_grid puts set_bombs else #non-human start_message(:robot_game) @robot = Robot.new() @grid_size = @robot.grid_size @num_bombs = @robot.num_bombs end @play_again = true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def game_setup\n end", "def game_init\r\n state(0)\r\n @game_deck.create_new_deck\r\n @player_deck = {}\r\n @dealer_deck = {}\r\n @player.points = 0\r\n @dealer.points = 0\r\n end", "def initialize\n @game_settings = GameSettings.new\n super 920, 480\n self.caption = GAME_TITLE\n...
[ "0.75058055", "0.72825646", "0.70464706", "0.69853884", "0.6897375", "0.68816274", "0.6853908", "0.68532187", "0.67991763", "0.67762667", "0.6768738", "0.6742645", "0.67201793", "0.6716709", "0.669451", "0.66864234", "0.668188", "0.6669605", "0.66691023", "0.6663216", "0.6648...
0.0
-1
Checks if the value of the resource placeholder has been set yet.
def set_yet? !!@resource_lock.synchronize { defined? @resource } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_defined_resource?\n nil\n end", "def is_placeholder?(fieldname)\n self.class.placeholders.include?(fieldname.to_sym)\n end", "def resource_exists?\n reload!\n @exists = true\n rescue Google::Cloud::NotFoundError\n @exists = false\n end", "def valida...
[ "0.6281598", "0.59835535", "0.5972937", "0.59416115", "0.58103603", "0.5802725", "0.57957435", "0.5691157", "0.56776327", "0.56732917", "0.5642177", "0.5588255", "0.5586867", "0.552094", "0.5505273", "0.5489662", "0.5489662", "0.5480142", "0.5452378", "0.5446339", "0.5435332"...
0.6769206
0
Checks if the attempt to read the resource has been terminated.
def terminated? !!@resource_lock.synchronize { @terminated } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def closed_read?() end", "def ready_for_read?\n begin\n connected? && IO.select([socket], nil, nil, 0.1)\n rescue Exception\n triggered_close $!.message, :terminated\n raise\n end\n end", "def closed_read?\n end", "def terminated?\n terminated\n end", "def closed_read?()\n...
[ "0.69412136", "0.683393", "0.6718201", "0.66746604", "0.6557179", "0.64754516", "0.645448", "0.6434888", "0.64260674", "0.6363099", "0.6356087", "0.6356087", "0.6356087", "0.6344195", "0.6330458", "0.6299704", "0.62796926", "0.6244833", "0.6233195", "0.6221297", "0.621574", ...
0.7574514
0
Sets the value for the resource, making it available for all waiting and following reads. Resource values can only be set once. Calling this method on a terminated resource is ineffective.
def resource=(resource) set_or_terminate do @resource = resource end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_resource value\n instance_variable_set(resource_name, value)\n end", "def set!(resource, value)\n resource.instance_variable_set(instance_variable_name, value)\n end", "def set_value(*args)\n raise ReadOnlyRecord if readonly?\n resource.set_value(*args)\n end", "def resource=...
[ "0.72403574", "0.68676233", "0.6639322", "0.66252065", "0.66252065", "0.66252065", "0.66252065", "0.66252065", "0.66252065", "0.65304106", "0.6301355", "0.6183286", "0.617703", "0.6166355", "0.61495435", "0.60249215", "0.599486", "0.5960514", "0.59299654", "0.5875267", "0.586...
0.6815968
2
Terminates the attempt to read the resource early, causing those waiting and any following reads to raise a FutureResource::Terminated exception. Subsequently calling this method again is ineffective.
def terminate set_or_terminate do @terminated = true end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_operation_finished!(retval, resource)\n return unless resource.class.is_protectable?\n Thread.current[:performing_get] = false\n end", "def stop_read\n return self if @closed\n error = check_result ::Libuv::Ext.read_stop(handle)\n reject(error) i...
[ "0.6313525", "0.6302894", "0.5948366", "0.5670646", "0.56399935", "0.5611662", "0.5587354", "0.54236096", "0.53959966", "0.53703856", "0.5328364", "0.53035897", "0.53035897", "0.53035897", "0.52897453", "0.5253308", "0.52225", "0.52181906", "0.5212663", "0.5163929", "0.513821...
0.49876937
29
Syntax: [[id]] .Name [align=left|center|right,alt=alt_text,type] (optional) .... literal ....
def literal(node) artwork_attributes = { align: node.attr("align"), type: node.attr("type"), name: node.title, alt: node.attr("alt"), } # NOTE: html escaping is performed by Nokogiri artwork_content = "\n" + node.lines.join("\n") + "\n" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def termdef(name)\n element(name, {:name => name, :class => 'object_type'}, 'a')\n end", "def termdef(name)\n element(name, {:name => name, :class => 'object_type'}, 'a')\n end", "def termdef(name)\n element(name, {:name => name, :class => 'object_type'}, 'a')\n ...
[ "0.57412064", "0.57412064", "0.57412064", "0.56997204", "0.56843936", "0.567324", "0.5632415", "0.5589984", "0.5535927", "0.55332196", "0.54671764", "0.5391818", "0.5376751", "0.5333054", "0.5301582", "0.5292479", "0.5283695", "0.5283695", "0.526049", "0.5246276", "0.5226997"...
0.0
-1
stem is treated as literal, but with center alignment
def stem(node) artwork_attributes = { align: node.attr("align") || "center", type: node.attr("type"), name: node.title, alt: node.attr("alt"), } # NOTE: html escaping is performed by Nokogiri artwork_content = "\n" + node.lines.join("\n") + "\n" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def basic_stem\n # undo some euphonic changes so that we can recover\n # the basic stem\n form = @first_form.sub(/(?:μμαι)$/,'πμαι') # palatal\n form = form.sub(/(?:σμαι)$/,'τμαι') # dental\n form = form.sub(/(?:ουμαι)$/,'εομαι') # future contracted deponents\n\n # now remove the ending\n form...
[ "0.6699699", "0.60383385", "0.59679097", "0.5814321", "0.5809986", "0.55365324", "0.5517084", "0.5498824", "0.5474269", "0.543687", "0.5369819", "0.529048", "0.5272716", "0.5222548", "0.5206372", "0.5190653", "0.5181427", "0.51806927", "0.51749367", "0.5174347", "0.5164812", ...
0.58835864
3
Syntax: = Title Author :HEADER ABSTRACT NOTE: note [NOTE] .Title (in preamble) ==== Content ==== [NOTE] (in preamble) [NOTE,source=name] (in body) .Title ==== Content ====
def admonition(node) result = [] if node.parent.context == :preamble note_attributes = { # default title provided: title is mandatory title: (node.title.nil? ? "NOTE" : node.title), } note_contents = HTMLEntities.new.decode([paragraph1(node)].flatte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_doxy_header\n r = @remark.dup\n # Change the remark init for Doxygen\n r[0] = \"/*!\"\n r.insert(1,\"@defgroup #{@filename} #{@style} #{@filename}\")\n if @style == :emboss\n r = removeDoubleAt(r)\n end\n\n buf = r.join(\"\\n\")+\"\\n\"\n buf\n end", "def parse_footnote_defin...
[ "0.6261203", "0.61933917", "0.6066417", "0.60462946", "0.6005541", "0.59782726", "0.59782726", "0.59782726", "0.59782726", "0.59782726", "0.59782726", "0.59782726", "0.59782726", "0.59782726", "0.59782726", "0.59782726", "0.59782726", "0.59782726", "0.59782726", "0.59782726", ...
0.0
-1
Syntax: [[id]] .Title [align,alt,suppresstitle] ==== Example ====
def example(node) figure_attributes = { anchor: node.id, align: node.attr("align"), alt: node.alt, title: node.title, 'suppress-title': node.attr("suppress-title"), # TODO: is 'suppress-title' the correct attribute name? } # TODO iref ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def title(*args)\n @title = args[0] if args.present?\n @title\n end", "def title\n [id, name].join(' ')\n end", "def title(title=\"\")\n self.tag('title', title)\n end", "def title=(_arg0); end", "def title=(_arg0); end", "def title=(_arg0); end", "def handle_title(name, attrs) ...
[ "0.6894373", "0.68846774", "0.6882232", "0.68730336", "0.68730336", "0.68730336", "0.6825738", "0.6797054", "0.6765199", "0.67333245", "0.67333245", "0.67314374", "0.67284244", "0.67284244", "0.67284244", "0.67284244", "0.67284244", "0.67284244", "0.67284244", "0.67284244", "...
0.0
-1
Syntax: .name [source,type,src=uri] (src is mutually exclusive with listing content) (v3) [source,type,src=uri,align,alt] (src is mutually exclusive with listing content) (v2) code
def listing(node) sourcecode_attributes = { align: node.attr("align"), alt: node.alt, name: node.title, type: node.attr("language"), src: node.attr("src"), } # NOTE: html escaping is performed by Nokogiri sourcecode_content = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def src; end", "def src; end", "def src; end", "def source_name\n 'Archives & Manuscripts'\n end", "def src_verb\n @src\n end", "def set_name(name, source: :custom)\n @name = name\n @source = SOURCES.include?(source) ? source.to_sym : :custom\n end", "def formatted_file_list(title,...
[ "0.5884463", "0.5884463", "0.5884463", "0.5857464", "0.5756046", "0.573369", "0.5717702", "0.5715123", "0.5586649", "0.55852306", "0.5555276", "0.5536255", "0.5463415", "0.54070485", "0.536807", "0.53174645", "0.5281589", "0.5281589", "0.5281589", "0.5281589", "0.5281589", ...
0.53896815
14
Increments win Used for winkeeping after game ends Inputs: none Outputs: none
def increment_win_score PlayerModelContracts.invariant(self) @score = @score + 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def increment_win\n self.games_won += 1 \n increment_games_played\n end", "def player_win\n @player_win += 1\n end", "def win?\n if won_game?\n @games_won += 1\n won_set\n return true\n end\n end", "def win\n @streak += 1\n end", "def win\n @score += 1\n ...
[ "0.7681577", "0.75918454", "0.7335115", "0.73269624", "0.73058426", "0.73058426", "0.7224948", "0.7085366", "0.7077967", "0.7058915", "0.7056516", "0.70169574", "0.69771343", "0.6951223", "0.6947319", "0.6934118", "0.6929806", "0.6914083", "0.6828248", "0.6826664", "0.6797343...
0.6958537
13
Decides move for player Used for game processes Inputs: none Outputs: none
def set_move(x) PlayerModelContracts.invariant(self) @move = x end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_player_turn\n\t\tself.current_player = \"Computer\"\n\t\tindicate_player_turn\n\t\tplayer_good_move= self.get_good_move\n\t\tchange_state(player_symbol, player_good_move)\n\t\tplayer_good_move\n\tend", "def player_move(player)\n if player_one == player\n player_one_move\n elsif player_two ...
[ "0.750346", "0.74568945", "0.7428433", "0.74217033", "0.73897845", "0.73579556", "0.7349643", "0.73016775", "0.72183794", "0.7216171", "0.72144985", "0.721321", "0.7207159", "0.71711147", "0.7113225", "0.70810413", "0.70735765", "0.7042229", "0.6987059", "0.69794863", "0.6973...
0.0
-1
A peak is an array element which is larger than its neighbours. More precisely, it is an index P such that 0 A[P + 1]. For example, the following array A: ``` A[0] = 1 A[1] = 5 A[2] = 3 A[3] = 4 A[4] = 3 A[5] = 4 A[6] = 1 A[7] = 2 A[8] = 3 A[9] = 4 A[10] = 6 A[11] = 2 ``` has exactly four peaks: elements 1, 3, 5 and 10...
def solution(a) peaks = find_peaks(a) return 0 if peaks.empty? min_flags = 1 max_flags = Math.sqrt(a.length).ceil + 1 while min_flags != max_flags mid_flags = min_flags + ((max_flags-min_flags)/2.0).ceil if check(peaks, mid_flags) min_flags = mid_flags else max_flags = mid_flags-1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solution(a)\n nexxt = next_peak(a)\n f = 1 # can we set f flags?\n max_flags = 0\n # (f-1) * f = max distance between first and last flags\n while (f - 1) * f <= a.size\n pos = 0\n flags_so_far = 0\n while pos < a.size && flags_so_far < f\n pos = nexxt[pos]\n break if pos == -1\n f...
[ "0.72533923", "0.66104174", "0.6574849", "0.63505656", "0.62534386", "0.6224907", "0.6141785", "0.6076366", "0.59294224", "0.58392936", "0.58202827", "0.57658553", "0.5696571", "0.5521911", "0.5462099", "0.540951", "0.5368209", "0.5274806", "0.52329034", "0.5222797", "0.52077...
0.7654614
0
helper functions could refactor into mixins, but meh.
def sum roll roll.reduce &:+ end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def helpers; end", "def helpers; end", "def helpers; end", "def custom; end", "def custom; end", "def private; end", "def wrapper; end", "def common\n \n end", "def define_helpers; end", "def overrides; end", "def mixins(*scopes); end", "def macro; raise NotImplementedError; end", "def ...
[ "0.6485137", "0.6485137", "0.6485137", "0.6479026", "0.6479026", "0.62635756", "0.62088186", "0.6166786", "0.61273384", "0.61226386", "0.6112465", "0.6062371", "0.6062371", "0.6062371", "0.6041702", "0.60400856", "0.60400856", "0.60001475", "0.5954442", "0.5954442", "0.595444...
0.0
-1
callseq: File.mime( string ) > string or array See also: File::magic and File::type
def mime(path) magic(path, Magic::MIME) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mime_type file\n FileMagic.new(FileMagic::MAGIC_MIME).file(file).split(';').first\n end", "def mimetype; @mimetype ||= `file -b --mime-type '#@fname'`.strip; end", "def magic_mime_type\n return if new_record?\n return unless File.exists? io_stream.path\n FileMagic.mime.file(io_st...
[ "0.7542645", "0.74431837", "0.74249846", "0.7394399", "0.73165077", "0.72394323", "0.72394323", "0.72394323", "0.72394323", "0.72184753", "0.7176577", "0.7176577", "0.7176577", "0.71424216", "0.71355206", "0.7130608", "0.7127985", "0.7120794", "0.7098829", "0.70859224", "0.70...
0.77118236
0
callseq: File.type( string ) > string or array See also: File::magic and File::mime
def type(path) magic(path, Magic::MIME_TYPE) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filetype\n `file --mime-type -b #{@file_path}`.chomp\n end", "def ftype() File.ftype(path) end", "def type\n stype = \"file\"\n stype = \"atom\" if @filepath.nil? and !@metadata.empty?\n stype = \"multipart\" if !@filepath.nil? and !@metadata.empty?\n stype\n end", "def type t\n @...
[ "0.7810919", "0.7664052", "0.7617552", "0.7554582", "0.7528531", "0.74807364", "0.7411001", "0.73469263", "0.73169863", "0.7284074", "0.72270966", "0.7192171", "0.71877134", "0.7185103", "0.7174584", "0.70732903", "0.7056606", "0.7052238", "0.70429844", "0.70163965", "0.69958...
0.7004709
20
callseq: File.magic > string or array See also: Filemime and Filetype
def magic self.class.magic(self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filemagic\n @filemagic ||= FileMagic.new(FileMagic::MAGIC_MIME_TYPE)\n end", "def filemagic\n @filemagic ||= FileMagic.new(FileMagic::MAGIC_MIME_TYPE)\n end", "def _extract_mime_type_with_filemagic(io)\n filemagic = FileMagic.new(FileMagic::MAGIC_MIME_TYPE)\n data = io...
[ "0.8050705", "0.79735523", "0.7314728", "0.6879629", "0.6850248", "0.6607502", "0.6577473", "0.6484097", "0.6313551", "0.6275934", "0.62666005", "0.6253369", "0.6248617", "0.62164223", "0.62084174", "0.61802435", "0.6175531", "0.61569625", "0.6151903", "0.6148018", "0.6120878...
0.0
-1
callseq: File.mime > string or array See also: Filemagic and Filetype
def mime self.class.mime(self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filetype\n `file --mime-type -b #{@file_path}`.chomp\n end", "def get_mime_type file\n FileMagic.new(FileMagic::MAGIC_MIME).file(file).split(';').first\n end", "def mimetype; @mimetype ||= `file -b --mime-type '#@fname'`.strip; end", "def magic_mime_type\n return if new_record?\n ...
[ "0.7563617", "0.74829465", "0.74785864", "0.74753207", "0.73759013", "0.73037463", "0.73037463", "0.73037463", "0.72820413", "0.72820413", "0.72820413", "0.72820413", "0.7242281", "0.7200188", "0.7178128", "0.71707565", "0.7161022", "0.71564525", "0.71232355", "0.7103876", "0...
0.0
-1
callseq: File.type > string or array See also: Filemagic and Filemime
def type self.class.type(self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ftype\n :file\n end", "def filetype\n `file --mime-type -b #{@file_path}`.chomp\n end", "def type\n stype = \"file\"\n stype = \"atom\" if @filepath.nil? and !@metadata.empty?\n stype = \"multipart\" if !@filepath.nil? and !@metadata.empty?\n stype\n end", "def mimetype; @mim...
[ "0.7380949", "0.721798", "0.7198722", "0.7054854", "0.70208824", "0.70204157", "0.7010009", "0.7002336", "0.7000757", "0.70005023", "0.696111", "0.69410896", "0.6927309", "0.6914402", "0.6897258", "0.6879546", "0.6879546", "0.6879546", "0.68399996", "0.67951524", "0.6784325",...
0.0
-1
Override the directory where uploaded files will be stored. This is a sensible default for uploaders that are meant to be mounted:
def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_dir\n 'file_uploads'\n end", "def store_dir\n 'uploads'\n end", "def store_dir\n \"uploads\"\n end", "def store_dir\n if Rails.env == \"production\"\n ENV['CONFIG_FILE_UPLOAD_PATH']\n else\n \"uploads\"\n end\n end", "def store_dir\n '%suploads/peopl...
[ "0.7866728", "0.7627961", "0.7622453", "0.7617947", "0.75755876", "0.7489533", "0.7486212", "0.745419", "0.745419", "0.745419", "0.7400106", "0.7400106", "0.7400106", "0.7400106", "0.7400106", "0.7384553", "0.73647314", "0.73579544", "0.7357193", "0.7348791", "0.73412323", ...
0.0
-1
Add a white list of extensions which are allowed to be uploaded. For images you might use something like this:
def extension_whitelist %w[jpg jpeg png] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w[jpg jpeg gif png]\n end", "def extension_whitelist\n %w[jpg jpeg gif png]\n end", "def extension_whitelist\n %w[jpg jpeg gif png]\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", ...
[ "0.815735", "0.81485915", "0.81485915", "0.81485915", "0.81240284", "0.81240284", "0.81240284", "0.81240284", "0.81240284", "0.81240284", "0.81240284", "0.81240284", "0.81240284", "0.81240284", "0.81240284", "0.81240284", "0.81240284", "0.8091994", "0.8091994", "0.8091994", "...
0.81230646
17
Sum of two points
def bbpAdd(first_point, second_point) cxp(first_point.x + second_point.x, first_point.y + second_point.y) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_values\n points.sum\n end", "def accumulate_points(points)\n points.map{|point| point.value}.reduce(0, :+)\n end", "def sum(x,y)\r\n\t x + y\r\n\tend", "def sum(x, y)\n\nend", "def getSum ( x , y )\n\tsum = x + y\n\treturn sum\nend", "def distCalc(point1, point2)\n first = ((poin...
[ "0.70840424", "0.7049677", "0.70164245", "0.69328505", "0.6901057", "0.6747664", "0.668223", "0.6625355", "0.658151", "0.657161", "0.6542451", "0.65013677", "0.6471253", "0.6466453", "0.6465137", "0.63754845", "0.6365447", "0.6365235", "0.63542783", "0.63294595", "0.632331", ...
0.6542036
11
Difference of two points
def bbSub(first_point, second_point) bbp(first_point.x - second_point.x, first_point.y - second_point.y) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diff((x1, y1), (x2, y2))\n [x1 - x2, y1 - y2]\nend", "def getDiff ( x , y )\n\tdiff = x - y\n\treturn diff\nend", "def -(other)\n raise TypeError, \"Subtract between Point and #{ other.class } is not defined\" unless other.is_a?(Point)\n Point.new(self.x - other.x, self.y - other.y)\n e...
[ "0.7477098", "0.7296633", "0.71629554", "0.7102015", "0.69926345", "0.6833792", "0.67878914", "0.6768763", "0.6748308", "0.6662865", "0.6645195", "0.66310036", "0.6612947", "0.6609563", "0.65847516", "0.6561378", "0.6554383", "0.65494126", "0.6448317", "0.643624", "0.6423279"...
0.0
-1
Point multiplied by factor
def bbpMult(first_point, factor) bbp(first_point.x * factor, first_point.y * factor) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scale(factor)\n Point.new(self.x * factor, self.y * factor)\n end", "def scale(factor)\n x = x2 - x1\n y = y2 - y1\n Line.new(p1, Point.new(x1 + (x * factor), y1 + (y * factor)))\n end", "def *(coef)\n Point.new(@x * coef, @y * coef)\n end", "def mul( val )\n @x.scale( val )\...
[ "0.71792924", "0.6601084", "0.6558638", "0.64490765", "0.6261095", "0.6114768", "0.59567356", "0.59541464", "0.5940515", "0.58077586", "0.578164", "0.5767612", "0.5767228", "0.57645124", "0.57616186", "0.576158", "0.57607454", "0.5730416", "0.5685717", "0.56726146", "0.564188...
0.6186709
5
Midpoint between two points
def bbpMidPoint(first_point, second_point) bbpMult(bbpAdd(first_point, second_point), 0.5) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def midpoint\n Point.new((x1 + x2) / 2, (y1 + y2) / 2)\n end", "def midpoint(other)\n raise TypeError, \"Midpoint between Point and #{ other.class } is not defined\" unless other.is_a?(Point)\n\n Point.new(\n (self.x + other.x) / 2,\n (self.y + other.y) / 2\n )\n e...
[ "0.8508576", "0.80477166", "0.7704671", "0.7538842", "0.7477937", "0.73577017", "0.7282672", "0.72093225", "0.70915", "0.6840581", "0.6816888", "0.6744878", "0.6712868", "0.6542915", "0.63738495", "0.63495123", "0.62969947", "0.61883813", "0.6124088", "0.6112509", "0.60887444...
0.737605
5
Product of two points
def bbpDot(first_point, second_point) first_point.x * second_point.x + first_point.y * second_point.y end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getProd ( x , y )\n\tprod = x * y\n\treturn prod\nend", "def prod(x,y)\n x*y\nend", "def producto (other)\n\t\tprod=Fraccion.new(0,0)\n\t\tprod.x= @x * other.x\n\t\tprod.y= @y * other.y\n\treturn prod\t\t\t\n\tend", "def dot(other)\n raise TypeError, \"Scalar (dot) product between Point and #{ ot...
[ "0.7308916", "0.7084603", "0.69739026", "0.6577019", "0.64812785", "0.6440238", "0.64103115", "0.63741994", "0.6356592", "0.6330616", "0.6283095", "0.62825435", "0.62636197", "0.6260396", "0.62590814", "0.6253562", "0.6214709", "0.6209915", "0.6187029", "0.6185448", "0.617923...
0.0
-1
Cross product of two points
def bbpCross(first_point, second_point) first_point.x * second_point.y - first_point.y * second_point.x end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_product(vector)\n x * vector.y - y * vector.x\n end", "def cross(v)\n (@x * v.y) - (@y * v.x)\n end", "def cross(v)\n (v.y * x) - (v.x * y)\n end", "def cross(o, p)\n ((p.x - o.x) * (self.y - o.y) - (p.y - o.y) * (self.x - o.x)).round(CROSS_PRODUCT_ROUNDING)\n end", ...
[ "0.7621995", "0.74743664", "0.7448689", "0.7314974", "0.7309704", "0.7298706", "0.7286029", "0.7272254", "0.7260169", "0.71171284", "0.708602", "0.69460326", "0.6912055", "0.68573916", "0.68549883", "0.6843125", "0.67658925", "0.67485726", "0.6732876", "0.6725993", "0.672469"...
0.7336678
3
Perpendicular of point, rotated 90 degrees counterclockwise
def bbpPerp(point) bbp(-point.y, point.x) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perpendicular\n Vector2d.new(-@y, @x)\n end", "def perpendicular\n Vector2d.new(-y, x)\n end", "def unit_perpendicular_vector(options={})\n return [self[1], -self[0]].unit_vector if options[:counter_clockwise]\n [-self[1], self[0]].unit_vector\n end", "def perpendicular_line(point)\n ...
[ "0.84725606", "0.8445147", "0.79070705", "0.7387362", "0.726888", "0.6961713", "0.69616884", "0.69308436", "0.6876227", "0.6759432", "0.6744622", "0.65205276", "0.6508336", "0.62611634", "0.6167133", "0.5951923", "0.5915763", "0.5875389", "0.57905275", "0.57902783", "0.578663...
0.0
-1
Perpendicular of v, rotated 90 degrees clockwise
def bbpRPerp(point) bbp(point.y, -point.x) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perpendicular\n Vector2d.new(-@y, @x)\n end", "def perpendicular\n Vector2d.new(-y, x)\n end", "def unit_perpendicular_vector(options={})\n return [self[1], -self[0]].unit_vector if options[:counter_clockwise]\n [-self[1], self[0]].unit_vector\n end", "def perpdot v\n (@x * v.y) -...
[ "0.80740994", "0.7921457", "0.7710163", "0.7406525", "0.7062313", "0.67770284", "0.6703746", "0.6518436", "0.6511605", "0.6462271", "0.64549756", "0.6437465", "0.6342875", "0.6322139", "0.6322139", "0.62588733", "0.625105", "0.6206751", "0.61886746", "0.61436343", "0.612333",...
0.0
-1
Projection of first point over second point
def bbpProject(first_point, second_point) bbpMult(second_point, bbpDot(first_point, second_point) / bbpDot(second_point, second_point)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def projection_point(p)\n Point.project(p - p1, self.direction.to_point) + p1\n end", "def transform(otherProjection, point)\r\n transform!(otherProjection, point.dup)\r\n end", "def projection(vect1, vect2)\n d = vect2.dot(vect2)\n\n if 0 < d\n dp = vect1.d...
[ "0.71671396", "0.6883531", "0.6843567", "0.65219986", "0.60979176", "0.5991589", "0.5902495", "0.5902256", "0.58893216", "0.5751809", "0.5713495", "0.5713495", "0.57067436", "0.57019544", "0.5699881", "0.56900525", "0.56885576", "0.5681423", "0.56781316", "0.56781316", "0.564...
0.6280238
4
Square lenght of a CGPoint
def bbpLengthSQ(point) bbpDot(point, point) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def length; Math.sqrt((@x*@x)+(@y*@y)); end", "def length\n Math.sqrt(@x * @x + @y * @y)\n end", "def length\n Math.sqrt(x ** 2 + y ** 2)\n end", "def length\n Math.sqrt(((x2 - x1) ** 2) + ((y2 - y1) ** 2))\n end", "def size\n (@x2-@x1)*(@y2-@y1)\n end", "def length_squared\n ...
[ "0.7409897", "0.72579277", "0.7218393", "0.69195276", "0.6914367", "0.67361933", "0.66142017", "0.6611512", "0.6589725", "0.6496464", "0.64735883", "0.645389", "0.64361906", "0.64270884", "0.6369374", "0.6327771", "0.62927", "0.62927", "0.6279864", "0.62714934", "0.6251782", ...
0.5976291
37
Square distance between two points
def bbpDistanceSQ(first_point, second_point) bbpLengthSQ(bbpSub(first_point, second_point)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(point1, point2)\n # square root of (x2-x1) squared + (y2-y1) squared\n Math.sqrt(((point2[0]-point1[0])**2)+((point2[1]-point1[1])**2))\nend", "def distance(x1, y1, x2, y2)\n Math.sqrt((y2 - y1)**2 + (x2 - x1)**2)\n end", "def distCalc(point1, point2)\n first = ((point2[:x] - point1[:x]) **...
[ "0.7857533", "0.7705691", "0.7662858", "0.76358485", "0.7634523", "0.74363464", "0.74174345", "0.7409409", "0.73717475", "0.73520947", "0.7294831", "0.7280314", "0.7223777", "0.72069377", "0.7191483", "0.71781117", "0.7171579", "0.71433353", "0.71143216", "0.70488894", "0.703...
0.0
-1
Distance between point an origin
def bbpLenght(point) Math.sqrt(bbpLengthSQ(point)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance\n self.distance_from(@origin) * 1.609344\n end", "def distance_from_origin(origin)\n calculate_distance_from_origin(origin)\n end", "def distance point\n dx = @x - point.x\n dy = @y - point.y\n Math.sqrt(dx**2 + dy**2)\n end", "def distance_to(coord)\n @vector.cross_vector...
[ "0.8327852", "0.8308164", "0.7671068", "0.7415899", "0.7370578", "0.7354797", "0.73235816", "0.724875", "0.72459793", "0.72086984", "0.7202859", "0.71280086", "0.7115314", "0.71111023", "0.70862114", "0.7076062", "0.7064262", "0.70288336", "0.70276225", "0.6999836", "0.698593...
0.0
-1
Distance between two points
def bbpDistance(first_point, second_point) bbpLenght(bbpSub(first_point, second_point)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(p0, p1)\n a = factory.point(p0.x, p0.y)\n b = factory.point(p1.x, p1.y)\n\n a.distance(b) / 1000.0\n end", "def points_distance(x1, y1, x2, y2)\n Math.sqrt((x1 - x2).abs2 + (y1 - y2).abs2)\n end", "def point_point_distance(a, b)\n (((a.x - b.x) ** 2 + (a.y - b.y) ** 2)...
[ "0.8387065", "0.8352606", "0.83338624", "0.8330848", "0.81032133", "0.8074107", "0.80103105", "0.80089635", "0.79939014", "0.7987748", "0.7984435", "0.79826033", "0.7951611", "0.7946804", "0.7929356", "0.7848368", "0.7841648", "0.78271395", "0.7824876", "0.7789454", "0.777142...
0.0
-1
Point multiplied to a lenght of 1
def bbpNormalize(point) bbpMult(point, 1.0 / bbpLenght(point)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multiply\n inject(1) { |p,x| p * x }\n end", "def multiply_els\n\t\tself.my_inject(:*, self[0])\n\tend", "def multiply_els(arr)\n arr.my_inject(1, '*')\nend", "def *(scalar)\n raise TypeError, \"Multiplication between Point and #{ scalar.class } is not defined\" unless scalar.is_a?(Numeri...
[ "0.60749066", "0.60199714", "0.5937578", "0.57926774", "0.5753992", "0.57525074", "0.57525074", "0.5703181", "0.56583667", "0.56503755", "0.56345004", "0.562874", "0.56202465", "0.56202465", "0.56202465", "0.5612643", "0.5612643", "0.5589589", "0.5557254", "0.55523044", "0.55...
0.0
-1
Converts radians to a normalized vector
def bbpForAngle(angle) bbp(Math.cos(angle), Math.sin(angle)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize\n mag = self.magnitude\n Vector.new @x/mag, @y/mag, @z/mag\n end", "def normalize\n f = 1.0 / length\n Vector2.new(@x * f, @y * f)\n end", "def normal_vector\n return @nv unless @nv.nil? \n\n nv = self.area_vector\n length = nv.abs\n\n nvv=nv.map { |e| e/le...
[ "0.7094535", "0.6945394", "0.688879", "0.6802745", "0.6721968", "0.6713653", "0.6513767", "0.6475846", "0.644692", "0.64419466", "0.64011836", "0.638333", "0.6312412", "0.61939144", "0.6152047", "0.612614", "0.6024708", "0.595478", "0.59516764", "0.5936181", "0.5890293", "0...
0.0
-1
Converts vector to radians
def bbpToAngle(point) Math.atan2(v.y, v.x) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle_rads \n\t\t\t2.0 * Math.atan2( self.vec.mag, self.scalar ) \n\t\tend", "def angle_deg_with( vector )\n angle_with(vector) * RAD_TO_DEG\n end", "def angle_with( vector )\n Math.acos( max(min(udot(vector),MAX_UDOT_PRODUCT), MIN_UDOT_PRODUCT) )\n end", "def convertToRadians(val)\n return val...
[ "0.74495894", "0.74213165", "0.7354134", "0.7046398", "0.7046398", "0.6977072", "0.6959348", "0.6939245", "0.6914868", "0.6886231", "0.68710935", "0.6794048", "0.6677482", "0.6672009", "0.6632231", "0.6607892", "0.6607892", "0.6569656", "0.6531188", "0.6523248", "0.64998186",...
0.0
-1