query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
2e02a274e79f9545458b8982477c2ec0
GET /leagues/1 GET /leagues/1.xml
[ { "docid": "45b275c8f414217be92c2a0c08890bdb", "score": "0.6966477", "text": "def show\n @league = League.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @league }\n end\n end", "title": "" } ]
[ { "docid": "33c50efe232bdfe4edc361f49e26ef97", "score": "0.6575818", "text": "def index\n @leagueplayers = Leagueplayer.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @leagueplayers }\n end\n end", "title": "" }, { "docid"...
3b282e28ee3af6a2918e483ac671d957
Configure channel catalog column mappings
[ { "docid": "c9a4b6757beb820feb5c06f43119fa2c", "score": "0.6253583", "text": "def map_channel_catalog_columns_with_http_info(channel_catalog_id, request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: V2UserChannelCatalogsApi.map_channel_catalog...
[ { "docid": "54da3097bcc3319dd44faf802c2bcee2", "score": "0.64424527", "text": "def map_channel_catalog_columns(channel_catalog_id, request, opts = {})\n map_channel_catalog_columns_with_http_info(channel_catalog_id, request, opts)\n return nil\n end", "title": "" }, { "docid": "...
0e47da1a63b6f64bb37be1b0884e8741
Initializes a BaculaHandler instance. Sets `host` and `templates` attributes. Sets the temporal files that contain the client's configuration
[ { "docid": "ee596f09154e405a87c22f3048c2eb1b", "score": "0.60178214", "text": "def initialize(host)\n @host = host\n @templates = host.job_templates.includes(:fileset, :schedule)\n\n @client = get_client_file\n @jobs = get_jobs_file\n @schedules = get_schedules_file\n @filesets = get_f...
[ { "docid": "3a273ad214135cb32de5371d96701bc0", "score": "0.62093496", "text": "def initialize\n \n # Load server info file.\n info = load_settings_from_all_domains(\"server.yml\")\n if info.empty?\n raise \"Could not load server.yml. Server not configured.\"\n end #if\n ...
f09b8cd93e0a9edc3ac5e0309bbc3fde
getter methods convention is you don't inlude "get" in the method name def holder_name
[ { "docid": "6dcebf66a1b17b851cbbd1ed6edda0b6", "score": "0.0", "text": "def pay_in(deposit_amount)\n @balance += deposit_amount\n end", "title": "" } ]
[ { "docid": "bb0248716260c65a83f44f30454502c9", "score": "0.73888284", "text": "def name_getter\n\n end", "title": "" }, { "docid": "b2b9d699dd51721ce997f1143ec103d4", "score": "0.73319083", "text": "def name # This was renamed from \"get_name\"\n @name\nend", "...
354423375d00477975e0a756d09d128e
Collects and caches hash data for the current SiteElement. Caching here helps speed up caching the same data for multiple users with different access when both users can access this SiteElement.
[ { "docid": "538906fac4e0f29460068975c34927fc", "score": "0.0", "text": "def details_hash\n Rails.cache.fetch(\"#{cache_key_with_version}/#{I18n.locale}/details_hash\", expires_in: 6.days) do\n {\n param_name: hash_key,\n name: doctype_name,\n downloads: [download_details_has...
[ { "docid": "24338d6e5504a6ff63127dc1ce6b1568", "score": "0.645786", "text": "def cached_hash_values\n\t\t\t@cached_hash_values ||= {}\n\t\tend", "title": "" }, { "docid": "60e59519e33c14ce9ea2bf5cbb1e320e", "score": "0.62207866", "text": "def cache\n # Unserialize the data\n ca...
6e517d69943bc5ba22f7569be3ecc94d
shows further details of that event
[ { "docid": "5c70b21ae51212652c069e63f989a688", "score": "0.0", "text": "def show\n\t\t@event = Event.find(params[:id])\n\t\t#tells Rails to find only the event that has the id defined in params\n\tend", "title": "" } ]
[ { "docid": "ebe6873dcf4da93d0f9d2f5e6ed38b12", "score": "0.78185505", "text": "def event_detail\n return @event_detail\n end", "title": "" }, { "docid": "ebe6873dcf4da93d0f9d2f5e6ed38b12", "score": "0.78185505", "text": "def event_detail\n ret...
d62dbf1f7e3978ecb709978666320469
Returns IO object used by logger internally. Normally, we would have never needed it, but we want to use it as IO object for all child processes to ensure their output is redirected there. It is only used in debug level, in other cases output is suppressed.
[ { "docid": "c83ef2c3516f62369dcc1d01f8b26f74", "score": "0.0", "text": "def io; end", "title": "" } ]
[ { "docid": "6760429776180ec6f465cfee0b896344", "score": "0.7585652", "text": "def io\n @io ||= :stdout\n end", "title": "" }, { "docid": "cc5689a1f8cec16097e99ad17f3171a8", "score": "0.72704196", "text": "def default_logger_io\n STDOUT\n end", "title": "" }, { ...
bc828629601eddc967626ed947856fc2
Define a primeira data de vencimento das faturas
[ { "docid": "5bbadc5160936c5aee10222dfa9c34fc", "score": "0.0", "text": "def get_primeira_data_vencimento(dia_vencimento_fatura)\n\t\t\thoje = Date.today\n if dia_vencimento_fatura <= hoje.mday\n hoje = hoje.next_month\n end\n ...
[ { "docid": "9409a7e8585cebbefa3243e87bbd8eed", "score": "0.6308797", "text": "def set_fatura\n @fatura = Fatura.find(params[:id])\n end", "title": "" }, { "docid": "51675bfa906269fba7755677fbdb90cd", "score": "0.604165", "text": "def medir_indicador_otro_tipo_33(mind, fini, f...
9994aa2f1f25105e001d6c21834ab150
=begin Return the number of hits in the past 5 minutes.
[ { "docid": "dddfdc4c19d5ffabf5c6acdd7bd1b0b0", "score": "0.5717154", "text": "def get_hits(timestamp)\n clear_queue(@queue, timestamp)\n @queue.size\n end", "title": "" } ]
[ { "docid": "81b4220b0cbee29bb55bde31d68d03bd", "score": "0.65016323", "text": "def refresh_interval\n x = self.entries.where('published > ?', 6.hours.ago).where('published < ?', 1.hour.ago).count / 5.0\n \n if x <= 0.001\n time = 120.minutes\n else\n time = ((-20 * x) + 120).to_i.m...
9374033720b701936ff0e8fd02fe9c9d
The result set will contain exactly the specified set of devices. For unknown devices the returned information will be incomplete. handle_set may be empty. XXX using multiple copies of the exact same SDK is presently unsupported
[ { "docid": "dcd99e6c9965390033157c4214302d5e", "score": "0.6347562", "text": "def get_exact_set(handle_set)\n sdkmap = get_all_as_map\n handle_set.map do |handle|\n sdk = sdkmap[handle]\n if sdk\n sdk\n else\n DevKit.new(:handle => handle)\n end\n ...
[ { "docid": "19678eabaee5c48bb36800aafc8b545b", "score": "0.68455976", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetDevicesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "38013732b61ed22ca4be69a23c42797b", ...
e4d60d645276b587be143c7f81a282f7
GET /raffles/1 GET /raffles/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "58e5e1fda9dca7c615c827a54cea1d54", "score": "0.64294124", "text": "def show\n @recruiter = Recruiter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recruiter }\n end\n end", "title": "" }, { "docid": "8...
5c0fa2a0895d2bd85d3f96c509098bca
Ask the user for a list of numbers. The user enters them separated by commas, e.g.: `10,4,2,7,5,1`. Print a horizontal bar graph of the numbers in order. Bar should be made up of ``s. Example output from running the program: ``` Enter some numbers to graph 10,4,2,7,5,1 ``` Note: You can assume the user will only enter ...
[ { "docid": "74b85b0cd29b16bed1f928b99676c346", "score": "0.0", "text": "def number_to_dash(int)\n if int == 10\n puts \"----------\"\n elsif int == 9\n puts \"---------\"\n elsif int == 8\n puts \"--------\"\n elsif int == 7\n puts \"-------\"\n elsif int == 6\n puts \"------\"\n el...
[ { "docid": "ea942ab729598e76054ce60ccb697b92", "score": "0.5832102", "text": "def display_numbers\r\n puts \"1 | 2 | 3\"\r\n puts \"------------\"\r\n puts \"4 | 5 | 6\"\r\n puts \"------------\"\r\n puts \"7 | 8 | 9\"\r\n end", "title": ...
9412645b3c01189bbadca3e095b390ec
puts ghappy("gagagaa") puts ghappy("ggaggagga")
[ { "docid": "1df5cfda264705323e1b1d97ca2b7e89", "score": "0.0", "text": "def merge(list1,list2)\n list = []\n list = list1 + list2\n return list.sort\nend", "title": "" } ]
[ { "docid": "2fd99d1db97e501d156482effbae9e5b", "score": "0.6863805", "text": "def joke1\n puts \"A peanut was walking down the street. He was a-salt-ed.\"\nend", "title": "" }, { "docid": "a994478d565fd3e274f376261a2c3094", "score": "0.6797767", "text": "def hail_the_king\n\tputs \"...
db7e365113c8e53391632d530afa517a
Get the OpenNebula hybrid section of the template. With more than one section the HOST element is used and matched with the host
[ { "docid": "90b057eff42c5785cd626a89cda6f625", "score": "0.46502087", "text": "def get_deployment_info(host, xml_text)\n xml = REXML::Document.new xml_text\n\n one = nil\n\n all_one_elements = xml.root.get_elements('//USER_TEMPLATE/PUBLIC_CLOUD')\n\n # First, let's see if we ...
[ { "docid": "09f922b3755067dca1198a9f9cad86bc", "score": "0.53782815", "text": "def section\n @section ||= @hash[@default]\n end", "title": "" }, { "docid": "76abfb9ca6e18ffed712deded5e384d9", "score": "0.52656364", "text": "def get_host_template_conn(host)\n co...
30812dc683c96e3693590c4d870c2ee5
Returns code for a from_SON and to_SON method
[ { "docid": "498f231deacf31a65ede1de85fd55344", "score": "0.46178693", "text": "def generate_from_and_to_methods(classname, attributes)\n\t\tcase @language\n\t\twhen :java, :java_lombok\n\t\t\treturn generate_java_from_and_to_methods(classname, attributes)\n\t\twhen :ruby\n\t\t\treturn generate_ruby_from...
[ { "docid": "36c0750ab73c436df161ef4c33f54c99", "score": "0.57578784", "text": "def generate_ruby_from_and_to_methods(classname, attributes)\n\t\tcode = []\n\t\tnames = []\n\t\tattributes.each {|att| names << att[:name].snakecase}\n\n\t\t# from_hash method\n\t\tcode << \"\"\n\t\tcode << \" def self.from...
a9e8172ce59c6b74794144f263b69e4e
Sets the trace level to error.
[ { "docid": "042d41836ed7de5087a50dd42d289e82", "score": "0.7787328", "text": "def traces_error\n TRACES.level = Logger::ERROR\n end", "title": "" } ]
[ { "docid": "74d37c096c697b81e5b8914bfd89f802", "score": "0.71398914", "text": "def error_level=(level)\n @stderr_logger.level = level\n end", "title": "" }, { "docid": "6c6b1c078cb04dff7142d4888293907a", "score": "0.6893337", "text": "def error!\n self.level = ERROR\n ...
dddb266b6547f4ff02c64e75572706a5
PUT /model_comments/1 PUT /model_comments/1.json
[ { "docid": "5f9f67a43506c86c42ab6d361b9aad09", "score": "0.7328295", "text": "def update\n @model_comment = ModelComment.find(params[:id])\n\n respond_to do |format|\n if @model_comment.update_attributes(params[:model_comment])\n format.html { redirect_to @model_comment, notice: 'Model...
[ { "docid": "626e1bf15e614b383e351c0d902c42be", "score": "0.6996447", "text": "def update\n respond_to do |format|\n if @model_comment.update(model_comment_params)\n format.html { redirect_to @model_comment, notice: 'Model comment was successfully updated.' }\n format.json { render ...
b56def45ec081c44986ca466b52d6538
POST /spreadapedia_games POST /spreadapedia_games.json
[ { "docid": "8db1098e5db455cb638bb31e5c743fa3", "score": "0.75974715", "text": "def create\n g = SpreadapediaGames.new(params[:spreadapedia_games])\n g.line_result(params[:spreadapedia_games][:lresult])\n g.overunder_result(params[:spreadapedia_games][:ouresult])\n g.save()\n\n respond_to ...
[ { "docid": "643d073094feaee606374cfbe52650c4", "score": "0.7093104", "text": "def add_game\n HTTParty.post(\"http://localhost:9292/games/\", body: {name: @name, geekId: @geekId, image: @image, scrape_date: @scrape_date, weight: @weight, playtime: @playtime, description: @description, designer: ...
609ce6b2daceb923ca65cf615e9c2573
Check if priority is High/Highest
[ { "docid": "8055461f648e6cc85a870eb58c672214", "score": "0.8272906", "text": "def is_high_priority(priority)\n priority.downcase.include?(\"high\")\n end", "title": "" } ]
[ { "docid": "905d25672c67368aff6551b246f01b87", "score": "0.851538", "text": "def is_high?\n self.priority == 2\n end", "title": "" }, { "docid": "188ef571e7a08f0d6427994eace8bba5", "score": "0.74141103", "text": "def priority?\n @pri\n end", "title": "" }, { ...
dd8c317717d90050c20d55562683341a
GET /goals/1 GET /goals/1.json
[ { "docid": "9711509b10ada80e31e9d17fc53ce90b", "score": "0.7390843", "text": "def show\n @goal = Goal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @goal }\n end\n end", "title": "" } ]
[ { "docid": "f00ae4266a9a3f58815f0b1fc73f7070", "score": "0.7752522", "text": "def index\n @goals = Goal.all\n render json: @goals\n end", "title": "" }, { "docid": "de74e25a31dcc4628b9e7b58cd1c0adc", "score": "0.77226025", "text": "def index\n\t\t@goals = current_user.goal\n\t...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9afdbc7a4d7b9755e123d92dab6eebbc", "score": "0.0", "text": "def ivr_service_params\n params.require(:ivr_service).permit(:body)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496205", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957069", "text": "def strong_params\n params.require(:request).permit(param_white...
e7316fa4c5b0fef6dbc3145031617011
Spree Handles adding all the "From" and overriding "To" for Dev Envs
[ { "docid": "0fff1988313b9bed4d9573cc9925764c", "score": "0.0", "text": "def contact_email(params)\n\t\t@params = params\n message_id = \"ID%0#{8}d\" %[rand(99999999)]\n\t\tmail(:to => I18n.t('contact_email'),\n :from => from_address,\n :subject => \"SoulPad Contact Message #{message_i...
[ { "docid": "e32ef15d7d40cc4116eb9a07edb6ada6", "score": "0.55436486", "text": "def activate\n Address.class_eval do\n belongs_to :user\n has_many :shipments\n\n if Spree::Version::Major.to_i > 0 || Spree::Version::Minor.to_i > 8\n has_many :checkouts, :foreign_key => \"bill_addr...
135bb6f4e6a34db622970a936218c161
this code tells tiny_mce where its main library files are located and that it was loaded via a combined file.
[ { "docid": "dcbb39e6e56240d3ab37a74b815498bd", "score": "0.0", "text": "def init_content\n @content = <<-JS\n window.tinyMCEPreInit = {\n base : '#{Tinymce::Hammer.install_path}',\n suffix : '', \n query : ''\n }\n window.tinyMCE_GZ = { loaded : true };\n JS\n ...
[ { "docid": "d111d3c3665b69e0008d0f1e3a8ba0a3", "score": "0.5965003", "text": "def extension_paths; end", "title": "" }, { "docid": "48d42868df5542087c0bcb6f5af93a57", "score": "0.594557", "text": "def gem_loaders_by_root_file; end", "title": "" }, { "docid": "d2f8e68abacd...
2a2dacf47245ec03f862d5f3d8975d29
GET /revarticles GET /revarticles.json
[ { "docid": "6836443e2671faef6950301b94f5bbe8", "score": "0.6137728", "text": "def index\n # show approved articles only\n # @revarticles = Revarticle.where(\"approved = ?\" , true)\n @revarticles = (params[:term].blank?) ? Revarticle.where(\"approved = ?\" , true) : Revarticle.where(id: params[...
[ { "docid": "1d84ed6b150d660ec5b6dff8d0b93646", "score": "0.67328924", "text": "def set_revarticle\n @revarticle = Revarticle.find(params[:id])\n end", "title": "" }, { "docid": "2cbd1b1f92d9c52243a208d33de3e4d7", "score": "0.66458744", "text": "def get_articles()\n exec_ge...
6c9de93ebcce97d544a773072259cafa
show your own profile
[ { "docid": "0a06eb9dd412511b083d5a93fb86464e", "score": "0.0", "text": "def show_your_profile\n if params[:id] != session[:user_id].to_s\n redirect_to user_path\n end\n end", "title": "" } ]
[ { "docid": "b6ce894116d251a4f9522a2c835d0a0f", "score": "0.76131827", "text": "def show\r\n jump_to(\"/profiles/#{session[:account_id]}/basic\")\r\n end", "title": "" }, { "docid": "f281a4753162ac3b8b3877653870c16e", "score": "0.7513544", "text": "def profile\n end", "title"...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "665af247a5507d7f00594b4df1463abc", "score": "0.0", "text": "def email_template_params\n params.require(:email_template).permit(:title, :content)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "4b7c51ce101e810c586f4bf2d8a45749", "score": "0.0", "text": "def ticket_params\n params.require(:ticket).permit(:body, :user_id, :admin_user_id, :important)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d16f75f245b695eebc240dc187eb1f44", "score": "0.0", "text": "def set_creator_metric\n @creator_metric = CreatorMetric.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
67e148a5b01e596a8171476df12962ad
Compile and evaluate the template's code (if necessary)
[ { "docid": "0db3c0aab864f9630e115b3d682ce476", "score": "0.6302568", "text": "def compile(local_assigns)\n render_symbol = method_name(local_assigns)\n\n if !CompiledTemplates.method_defined?(render_symbol) || recompile?\n compile!(render_symbol, local_assigns)\n end\n end", ...
[ { "docid": "d692a12bc2ab68bb4c02da2f3c303a65", "score": "0.78217936", "text": "def compile\n template.compile(compilation_context)\n end", "title": "" }, { "docid": "c00e30ba106211535a3e778fb19459a4", "score": "0.77221584", "text": "def evaluate(compiled_template)\n inst...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "518b4fd6ab05bfdf31bf8932b6f7bb00", "score": "0.0", "text": "def set_user\n @user = User.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "85b13cc733de7a7e287446f7e1f4385d", "score": "0.0", "text": "def set_arriendo\n @arriendo = Arriendo.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
dc0881fdbe146a5b741acef3997aaaad
GET /tools/1 GET /tools/1.json
[ { "docid": "73f8cd522a6710871a33f4a50e96b3c9", "score": "0.71223795", "text": "def show\n @tool = Tool.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tool }\n end\n end", "title": "" } ]
[ { "docid": "f29387eeb1a7f17f8f7d20cdd156045a", "score": "0.72756517", "text": "def index\n @tools = Tool.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tools }\n end\n end", "title": "" }, { "docid": "b7b2d9751b860a43c09521fc96...
7c62f581ced5ee63380fcbc95c9155a0
Returns the fact at the specified index, cast into an appropriate Fact.
[ { "docid": "d5238b018bc8701ee4c7c4c9709c6b03", "score": "0.62282526", "text": "def [](index)\n cast get(index)\n end", "title": "" } ]
[ { "docid": "5bdb4506b34d77b89ee63efb6bcd83ea", "score": "0.6029785", "text": "def from_index(index)\n self.class.from_index(index)\n end", "title": "" }, { "docid": "1f20f1441e61078f708f04d05d032ab4", "score": "0.59590644", "text": "def retrieve_fact(fact_name)\n\n facts = e...
83d3131d948284a082809818793fe125
PUT /feedbacks/1 PUT /feedbacks/1.json
[ { "docid": "557c841bd7cab336c361d5bed6d78075", "score": "0.6292006", "text": "def update\n @feedback = Feedback.find(params[:id])\n if params[:submit_final_button]\n @feedback.submitted = true\n end\n\n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n ...
[ { "docid": "d7e3523b3cfdad8e224ae64bf8cbd5a9", "score": "0.7388445", "text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.json { head :no_content }\n else\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n ...
2f3b0b051d0f322357ead0c0b6a5f991
Prints out a message to the console == Parameters
[ { "docid": "3f27960781f76cef060020a827da06da", "score": "0.64698505", "text": "def message(string)\n puts\n puts \"[#{colorize(\"--\", \"blue\")}] #{ string }\"\nend", "title": "" } ]
[ { "docid": "9e0e5fbd42f751393d95464c3f982a07", "score": "0.7489778", "text": "def display(msg)\n puts\n puts msg\n end", "title": "" }, { "docid": "b21cb774886327514549d7c82763c25c", "score": "0.73108625", "text": "def show_message(message)\n puts message\nend", "title": ...
336feffd81d6453099adc5fcc2e3407c
deck 52 card, clubs, diamonds, spades, heart 2 > 10, J, Q, K, A can't go over 21
[ { "docid": "916afc6e6e5c554519d94968ab864240", "score": "0.0", "text": "def method_name\n def value\n 5\n end\nend", "title": "" } ]
[ { "docid": "ddbba2241e01f48fbfcb2abc3f5c9227", "score": "0.7207227", "text": "def get_cards_above_10\n return ['V', 'Q', 'K', 'A']\nend", "title": "" }, { "docid": "a74f7f9cf6f88282b1db7f1ff317e655", "score": "0.7086744", "text": "def deal5cards (n)", "title": "" }, { "d...
353c05fd01afa381cfcb6e83e84cca4f
GET /deeds/1 GET /deeds/1.json
[ { "docid": "7cef658895850986e4fd05d37e29160c", "score": "0.0", "text": "def show\n @deed = Deed.find(params[:id])\n @deed_score = DeedVote.group('deed_id').sum(:votes, :conditions =>['deed_id = ?', params[:id]])\n render :json => @deed.attributes.merge(@deed_score)\n #render json: @deed\n e...
[ { "docid": "2a7bf53cf8b23be199f179e2fd24cfd0", "score": "0.7078842", "text": "def show\n @deed = Deed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deed }\n end\n end", "title": "" }, { "docid": "850f8ccc3d764a4f9...
f097570b35f0264610f369013ef11d27
accessing the array inside the module puts Bond::MOVIE_DATA targets title "Skyfall" puts Bond::MOVIE_DATA[0][:title] ============================ MISSION 1 ============================
[ { "docid": "e25dbd156388c90ccce2704916cb3f88", "score": "0.0", "text": "def get_gross_for(title, movies)\n movie = movies.find{|movie| movie[:title] == title}\n movie = movie[:gross].gsub(/[$,]/, '').to_i\nend", "title": "" } ]
[ { "docid": "0ce4d94814839e04606285fd8efee2a2", "score": "0.6839018", "text": "def get_titles()\n puts @arr_of_titles\n end", "title": "" }, { "docid": "67476c9661abbaadb0ed2bc8be0ea0ef", "score": "0.6651858", "text": "def bond_movies(array)\n #the variable will be a new array...
902c7be5d2e5d98cecbe6cdb62a30689
Create a match. Used by tournament systems. Specially handles byes, swapping home/away if required.
[ { "docid": "a4175b8af337f37151031d8823825c85", "score": "0.7816417", "text": "def create_match(home_team, away_team)\n home_team, away_team = away_team, home_team unless home_team\n raise 'Invalid match' unless home_team\n\n build_match(home_team, away_team)\n end", "title": "" }...
[ { "docid": "558b151ba464d25cb65a42e34060b8fb", "score": "0.7455368", "text": "def create_matches(matches)\n matches.each do |home_team, away_team|\n create_match(home_team, away_team)\n end\n end", "title": "" }, { "docid": "8175b00f82b80109824c2e0894cc0a3d", "score":...
1c02b379d0108502ffc6022097408423
Method for rerendering 'edit' if an error was found.
[ { "docid": "3542551ef1870afa653d2c3c7b7d12d4", "score": "0.0", "text": "def failed_form_create_edit\n @columns = view_context.array_set\n @state = @tracker.state\n @state_videos = @state.trackers.where(\"impact_uid IS NULL AND uid NOT\n LIKE '%_i...
[ { "docid": "8489243d55956951a2ada1b70835eceb", "score": "0.7128924", "text": "def edit\n # if this didn't work it will display an error 404. (page not found) error by default.\n end", "title": "" }, { "docid": "9d604ce40b9950b4bff44f27a0dec483", "score": "0.7075447", "text": "d...
1c8a576b4dacd89c098f1e6a95def346
Returns ' if this is an SSL request and ' otherwise. req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' req.protocol => " req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com', 'HTTPS' => 'on' req.protocol => "
[ { "docid": "411ff0f218d479b6ea8b522704177c05", "score": "0.7580505", "text": "def protocol\n @protocol ||= ssl? ? \"https://\" : \"http://\"\n end", "title": "" } ]
[ { "docid": "8a33f737a2928503b93c668da3dec232", "score": "0.788693", "text": "def protocol\n ssl? ? 'https://' : 'http://'\n end", "title": "" }, { "docid": "ead2edec80ccf31c7205193f7a74576f", "score": "0.78640753", "text": "def protocol\n ssl? ? 'https://' : 'http://'\n e...
27a4c66df8322ebba6e76684b753051c
Does nothing, just for making the DSL easier to read (maybe).
[ { "docid": "e93f554a95cfd2c86d38a0438c997151", "score": "0.0", "text": "def match(*)\n self\n end", "title": "" } ]
[ { "docid": "e6672e24111f509d32e35d2178a50eaa", "score": "0.63032347", "text": "def no_commands(&block); end", "title": "" }, { "docid": "3fa5f31930797c6010629425a7e37ec6", "score": "0.6264914", "text": "def build; {}; end", "title": "" }, { "docid": "51051bd5cf5ffa4316547...
b54ee9a78010bcb0319c81032065da4a
should return an array of places a Piece can move to
[ { "docid": "08a5c605ee62fa0783350f26febdd28e", "score": "0.0", "text": "def moves\n\n HORIZONTAL_DIRS.each do |direction|\n x,y = direction\n grow_unblocked_moves_in_dir(x,y)\n end\n\n #call grow_unblocked_ele \n# RIGHT HERE!!!\n \n #1 call move_d...
[ { "docid": "c509740437707f8698a27ac88e4ab665", "score": "0.7898405", "text": "def possible_moves(side)\n possible_moves = []\n # initialize an 8x8 array of coordinates 1-8\n coords = Array.new(8) { [*1..8] }\n coords.each_with_index do |i, j|\n i.each do |t|\n # t is the x, i[j] ...
889b0798400e0d018f73a84aac1ffaf6
================================================= = Returns an array of source IDs for the target = =================================================
[ { "docid": "6fd39a569991295c534235d3c176ed71", "score": "0.6789608", "text": "def targetSourceIDs(plist, targetName)\n root = xcodeObject(plist, nil)\n targetIDs = root['targets']\n \n # Get the target by name, if no name get the first one\n if targetName\n for targetID in targetIDs\n targe...
[ { "docid": "61e9f3cf5f7be48bf6ae23b22f7090d3", "score": "0.77214855", "text": "def source_ids\n source.send(source_attribute) || Set.new\n end", "title": "" }, { "docid": "b78d31e700da81c69f8822635e1572b2", "score": "0.7654114", "text": "def source_ids_list\n data.so...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c4947073c30420f65ac98c63632ba140", "score": "0.0", "text": "def set_moral_hazard\n @moral_hazard = MoralHazard.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60328794", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6017492", "text": "de...
2f4662d42c89db4eb1eea5b0fd5a5512
Write a recursive method that returns the first "num" factorial numbers. Note that the 1st factorial number is 0!, which equals 1. The 2nd factorial is 1!, the 3rd factorial is 2!, etc.
[ { "docid": "3e74394ef03133009cdbdd5a22ba9561", "score": "0.7665782", "text": "def factorials_rec(num)\n return [1] if num == 1\n factorials_rec(num-1) + [(1...num).to_a.reduce(:*)]\nend", "title": "" } ]
[ { "docid": "e26264ac9b91f8b00d19a353ec5d7357", "score": "0.8540283", "text": "def first_factorial(num)\n if num < 2\n return 1\n else\n return num * first_factorial(num - 1)\n end\nend", "title": "" }, { "docid": "23ab8aa755d4291f71460a1a1eba3cee", "score": "0.83699584", "te...
0046ba0c93c2b2700cf16c71ef50cd25
I worked on this challenge by myself 1. Solution Write your comments on what each thing is doing. If you have difficulty, go into IRB and play with the methods. Also make sure each step is necessary. If you don't think it's necessary Try implementing the code without it.
[ { "docid": "10691aa3cbca581bf5550d4553ac6d95", "score": "0.0", "text": "def translate_to_cipher(sentence) #defines a variable that accepts a sentence as an argument\n alphabet = ('a'..'z').to_a #defines a variable that contains an array with all the letters of the alphabet\n cipher = Hash[alphabet...
[ { "docid": "60396d976360a20a80b14f177c291c57", "score": "0.64475816", "text": "def solution(s, p, q)\n # write your code in Ruby 2.2\n g = s.length + 1\n a = (s.length + 1)**3\n c = (s.length + 1)**2\n tmp = []\n res = []\n tmp.push 0\n o = 0\n s.split('').each do |i|\n o += if i == 'T'\n ...
b96ed8f234e3319ed41189663e655233
Scans for an identifier. ID ::= LETTER (LETTER | DIGIT) the next identifier Token in the InputStream
[ { "docid": "989105f3a15a9aba81b703cba3ea4287", "score": "0.5843414", "text": "def id\n temp = \"\"\n while System::Char.IsWhiteSpace(@lookAhead)\n self.nextChar\n end\n while System::Char.IsLetterOrDigit(@lookAhead)\n temp = temp + @lookAhead\n self.nextChar\n ...
[ { "docid": "fd5aae97be84239ad93fe64a41d3ffa3", "score": "0.7534117", "text": "def scan_identifier(id)\n @infile.each_char do |c|\n if c =~ /[a-zA-Z0-9\\_\\?]/\n id += c\n else\n # rewind the file 1 character so the lexer doesn't miss anything\n @infile.seek(-1, IO::SEEK_C...
f5ab16ce56a761c1164b1033ea6dc4ad
This Methode use For Chats
[ { "docid": "70b39c3d620a2cb1539a80f4fa02af2f", "score": "0.0", "text": "def load_tailors\n\t\t@shop_name=params[:shop_name]\n\t\t@title=params[:title]\n\t\tuser = User.where(:user_type => \"tailor\", :shop_name => @shop_name, :title => @title).select(\"id\",\"username\",\"email\")\n\t\tif user.nil?\n\t\...
[ { "docid": "3b495cbccc6280c961c2a87b5aee900a", "score": "0.6537965", "text": "def chats\n follower_follows + followee_followers\n end", "title": "" }, { "docid": "f601b7c1cfe833927389d91b025ea4d5", "score": "0.646716", "text": "def event_incoming_chat(client, msg)\nend", ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "7b24ccb3ac2b1ec0a350dc773e5f4021", "score": "0.0", "text": "def job_period_params\n params.require(:job_period).permit(:job_id, :period_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "fe010a67d3604437471af3dde2d32696", "score": "0.0", "text": "def update!(**args)\n @deidentify_config = args[:deidentify_config] if args.key?(:deidentify_config)\n @inspect_config = args[:inspect_config] if args.key?(:inspect_config)\n @items = args[:items] if args....
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
15f6b4a7b64b2db567c58bbc5f64ec9d
t.string "role" t.text "bio" t.string "username" t.text "image" t.string "user_image"
[ { "docid": "14c45d5537864fe4c59644d6a4ab5e1f", "score": "0.0", "text": "def sign_up_params\n params.require(:user).permit(:email, :password, :password_confirmation, :role, :bio, :username, :profile_photo)\n end", "title": "" } ]
[ { "docid": "9ea83cc5fce950c81b47bdc2bfd559d7", "score": "0.60336095", "text": "def role_avatar\n \"/assets/#{role}_profile_pics/thumb/missing.png\"\n end", "title": "" }, { "docid": "8ed69bdfe2a31090fdc8a59f972bf84a", "score": "0.5970705", "text": "def user_params\n params.req...
6b09ddcd1e3be9a38d2f114e3130ae1d
no exit handler called % fail : (?String) > t % fail : (Exception, ?String, ?Array) > t % fail : ([exception : () > Exception], ?String, ?Array) > t
[ { "docid": "4626982990c9bb6c8b8477baeedb8b81", "score": "0.73241067", "text": "def fail(*rest) end", "title": "" } ]
[ { "docid": "09e571b3fa0476fa9e2e9b41834c403f", "score": "0.67519796", "text": "def failures=(_arg0); end", "title": "" }, { "docid": "09e571b3fa0476fa9e2e9b41834c403f", "score": "0.67519796", "text": "def failures=(_arg0); end", "title": "" }, { "docid": "fadc46717dcf162f...
544990cafb6b20fc56edcd883dd94c16
GET /propiedades GET /propiedades.json
[ { "docid": "a758d26f7e1c15b7e1c0eae5976d9f5e", "score": "0.0", "text": "def index\n @propiedades = Pmc::Propiedad.all.order(ancestry: :asc)\n\n render 'peces/propiedades/index'\n end", "title": "" } ]
[ { "docid": "da1250c175a948dbe35c30638172ecdb", "score": "0.72209334", "text": "def show\n @propietario = Propietario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @propietario }\n end\n end", "title": "" }, { "doci...
ff6208623fc869acd0061780e06ba32d
A lookup for finding a Slice module's path
[ { "docid": "8f5aab66d15b72d7a7ac37444804ecff", "score": "0.0", "text": "def paths\n @paths ||= {}\n end", "title": "" } ]
[ { "docid": "ef8d3fc13a8fc9758cdf18f331046901", "score": "0.6140533", "text": "def lookup_path_direct(namespace, path, type); end", "title": "" }, { "docid": "ebc42bbe1a5223086e2c04dd7c9216c3", "score": "0.61230135", "text": "def dir_for(type) self.slice_paths[type].first end", "t...
5827084c513cf476a0ed236bb94839a7
PUT /lores/1 PUT /lores/1.json
[ { "docid": "67305e09e17128fa885e69d1250cdcb4", "score": "0.0", "text": "def update\n @lore = Lore.find(params[:id])\n\n if params[:operation] == 'up'\n @lore.ranking = @lore.ranking + 1\n @lore.save\n return render :json => {ranking: @lore.ranking}\n elsif params[:operation] == '...
[ { "docid": "855f81d29ee8ff100cfefb3479cedcdd", "score": "0.631394", "text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "title": "" }, { "docid": "5ba1e573fca43b27ce353ecaf4ea1445", "score": "0.5971361", "text": "def rest_edit(path, options={}, &...
798f6041e69a959bedb33e4743639c1d
All the methods below can be called only in the context of the object and are accessible from the outside (driver code) Uses control flow to determine the number of deaths and prints that as a statement
[ { "docid": "146218d4c7601c6db55cc5d8b8ef9240", "score": "0.0", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n if @population_density >= 200\n population_factor = 0.4\n elsif @population_density >= 150\n population_factor = 0.3\n elsif @po...
[ { "docid": "509af7ff627749744c24fe97b79b273d", "score": "0.69466734", "text": "def kills()\n @death\n end", "title": "" }, { "docid": "2336414b6dca050908702e25f8695b18", "score": "0.67604697", "text": "def killed; end", "title": "" }, { "docid": "d6b23ef7efa7afb6ace2...
5e1c90f6c5739b3e7e3f766ea2acfa0b
GET /firstnames/1 GET /firstnames/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "515230e4af1d1c6e95cd7b1680dd6252", "score": "0.68609416", "text": "def show\n @firstname = Firstname.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @firstname }\n end\n end", "title": "" }, { "docid": "9...
2d44a1678b05e30e0ab1714d1c698f9c
Viewrelated methods View with a list of all current site admins, and a form to add additional admins
[ { "docid": "c92ee9d54a0e8fdd03e13c3784074577", "score": "0.0", "text": "def admins\n @admins = Employee.where(:site_admin => true).order(:last_name, :first_name)\n @not_admins = Employee.order(:last_name, :first_name) - @admins\n end", "title": "" } ]
[ { "docid": "33d1e406cd6a057944b8ee7e2a5f6fe1", "score": "0.7550697", "text": "def index\n if @logged_administrator.is_admin?\n @administrators = Administrator.all\n else\n redirect_to edit_administrator_url(@logged_administrator)\n end\n end", "title": "" }, { "docid": "4...
0534e7568a4db9ff2a635855fafc7ae8
Maps an association to the attribute its data will be tied
[ { "docid": "0af6f2af2bb85a6fdea1413831035441", "score": "0.61617124", "text": "def translate_association(assoc)\n attribute = attribute_lookup(assoc)\n return unless attribute\n\n # Make sure we properly handle destroyed values by forcing them to an\n # empty association. We keep th...
[ { "docid": "cd92d07622c3fcdc4a9035e3e0459141", "score": "0.6617736", "text": "def association_attribute_map(association)\n @attribute_map.association_attribute_map(association)\n end", "title": "" }, { "docid": "2e8a860f19f3234a2b6f9c52f444b1a5", "score": "0.6548615", "te...
091146041515e8afaaead026bf765e65
PUT /massmails/1 PUT /massmails/1.xml
[ { "docid": "c1bc0ffcdcd97ba4b73728dcbef62786", "score": "0.6454216", "text": "def update\n @massmail = Massmail.find(params[:id])\nabcd\n respond_to do |format|\n if @massmail.update_attributes(params[:massmail])\n flash[:notice] = 'Massmail was successfully updated.'\n format.h...
[ { "docid": "038e3860de581728a2ebd1e8aa2259c8", "score": "0.62272704", "text": "def update\n respond_to do |format|\n if @massmail.update(massmail_params)\n format.html { redirect_to @massmail, notice: 'Massmail was successfully updated.' }\n format.json { render :show, status: :ok,...
5ca8018785b9d6d86e7bf30149a3f493
GET /developer_skills/new GET /developer_skills/new.json
[ { "docid": "1efffb8018e6023bf93cbfde3f3d8da5", "score": "0.744615", "text": "def new\n @employee = Employee.find_by_id(params[:employee_id])\n # @developer_skill = @employee.developer_skill.new\n @developer_skill = DeveloperSkill.new \n\n respond_to do |format|\n format.html # new.html....
[ { "docid": "0e6cf6d7c9e19581754557c299faef3f", "score": "0.7882059", "text": "def new\n @desired_skill = DesiredSkill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @desired_skill }\n end\n end", "title": "" }, { "docid": "52bfa14...
ee8e0bf6b1923196b504f594a057b72c
Set the ancestors array from a pipedelimited string
[ { "docid": "e741671961f8dab9d1455ea763e66943", "score": "0.7887041", "text": "def ancestors_string= str\n @ancestors = str.split(\"|\")\n end", "title": "" } ]
[ { "docid": "7a07dec9d83b3e2d388337b7acdf1bef", "score": "0.59079987", "text": "def ancestors_string\n @ancestors.join(\"|\")\n end", "title": "" }, { "docid": "025b4b6158c78fb3bc7bf6c63f66a2f9", "score": "0.546026", "text": "def explode_hierarchical_strings(array_of_strings, deli...
4d8ea842b39be6db9d70953dd16d8886
GET /user_informations/1 GET /user_informations/1.json
[ { "docid": "85bfa2db2f395bd3c9cfb13d808ae2e5", "score": "0.7118121", "text": "def show\n @user_information = UserInformation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_information }\n end\n end", "title": "" } ]
[ { "docid": "d2bfde05fbfcf236a669e10c4641084b", "score": "0.7530059", "text": "def index\n @user_informations = UserInformation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_informations }\n end\n end", "title": "" }, { "d...
9b49cc42acdf82a92db16b5479de1d82
Do normal/classical switching and match capitalization in +inflected+ by examining the +original+ input.
[ { "docid": "023be9f3dfa4e383a654b797bc95833e", "score": "0.7867829", "text": "def postprocess( original, inflected )\n\n\t\t# If there's a classical variant, use it instead of the modern one if\n\t\t# classical mode is on.\n\t\tinflected.sub!( /([^|]+)\\|(.+)/ ) do\n\t\t\tLinguistics::EN.classical? ? $2...
[ { "docid": "4efa5a4c9623f6bda2145ce0e666a5c2", "score": "0.7925837", "text": "def postprocess( original, inflected )\n\t\tinflected.sub!( /([^|]+)\\|(.+)/ ) {\n\t\t\tLinguistics::classical? ? $2 : $1\n\t\t}\n\n\t\tcase original\n\t\twhen \"I\"\n\t\t\treturn inflected\n\t\twhen /^[A-Z]+$/\n\t\t\treturn i...
fd664a01551fe299bb91fd6c86fd60ee
ActiveModel API (for serialization)
[ { "docid": "4ccb2be3d0fcab4275a5bfbcc38956f9", "score": "0.0", "text": "def attributes\n @attributes ||= HashWithIndifferentAccess.new\n end", "title": "" } ]
[ { "docid": "185a0d09a1c524f5036189b12c2aa6d3", "score": "0.74365526", "text": "def serialize_as; end", "title": "" }, { "docid": "ad75a298d7cc9868bf7bbd4ca2f42cd1", "score": "0.7323542", "text": "def serializer; end", "title": "" }, { "docid": "ad75a298d7cc9868bf7bbd4ca2f...
4c289bd8dee75de0e12e2e2f2a3874f9
GET /object_names GET /object_names.json
[ { "docid": "0e4d946b47afa4c275ac9771347bc3b9", "score": "0.7688001", "text": "def index\n @object_names = ObjectName.all\n end", "title": "" } ]
[ { "docid": "f66494c9a43f85771cd00b11ecf86e3d", "score": "0.7379802", "text": "def names\n objects.map(&:name)\n end", "title": "" }, { "docid": "b8a498052af4e901c793df4e00b5e604", "score": "0.7088021", "text": "def objects(params = {})\n path = \"/#{ERB::Util.url_encode(...
d0080a5cc7ca169c5f5ff194654eb141
list the ingredients that do not appear in any of the allergene list
[ { "docid": "3c40aa920c6219363b29d171645347fa", "score": "0.7725423", "text": "def possible_allergene_free_ingredients\n\t\t@pafi ||= begin\n\t\t\tiba = ingredients_by_allergene\n\t\t\t@all_ingredients.filter do |i|\n\t\t\t\tiba.all? {|a,ii| !ii.include?(i)}\n\t\t\tend\n\t\tend\n\tend", "title": "" ...
[ { "docid": "10bad9713336f6ae0d2c08595b38bc02", "score": "0.78052676", "text": "def allergens\n bad_food = Allergen.all.map do |allergen|\n allergen.ingredient\n end\n\n self.ingredients.select do |ingredient|\n bad_food.include?(ingredient)\n end\n end", "title": "" }, { ...
51b6552a7f28fc23c6f776deb54de281
return the id of the vote after it's confirmed that a user has already voted on a post
[ { "docid": "5d3bc369d45640d8e05b3635bc5df941", "score": "0.6530932", "text": "def vote_object(the_user)\n post_vote_array(the_user).first.id\n end", "title": "" } ]
[ { "docid": "911566e4996d33de46a4be1e9748adfb", "score": "0.6863271", "text": "def voted_relationship_id(user_id, post_id)\n\t\treturn Vote.find_by(user_id: user_id, post_id: post_id).id\n\tend", "title": "" }, { "docid": "9e7cc7eaaef2b446a66b7509d4b3053f", "score": "0.65596074", "tex...
9c2f02748540f23ffce6d1d29b5c2d98
Remove a node from the graph.
[ { "docid": "9ab0139846bab78ab1b354c244323906", "score": "0.80904514", "text": "def remove_node(node)\n\t\t\tif has_node?(node)\n\t\t\t\tpull_edges_of(node)\n\t\t\t\t@nodes.delete(node)\n\t\t\t\t@order -= 1\n\t\t\tend\n\t\t\tself\n\t\tend", "title": "" } ]
[ { "docid": "e8a974710931b48700db9cb4fb19c773", "score": "0.79457825", "text": "def remove_node(node)\n @nodes_being_worked_on.delete(node)\n @nodes.delete(node)\n # the last edge keeps getting ignored when you remove this, so handling the final case\n assign_node(@edges[0][1]) if @edges.size...
0e2e07990cc9ccf35923e3476b2bccc9
DELETE /sport_centers/1 DELETE /sport_centers/1.json
[ { "docid": "b9f292eae4eae6e62173cabeeea58c89", "score": "0.79339963", "text": "def destroy\n @sport_center = SportCenter.find(params[:id])\n @sport_center.destroy\n\n respond_to do |format|\n format.html { redirect_to sport_centers_url }\n format.json { head :no_content }\n end\n ...
[ { "docid": "217a39ca81fa911a0f8b854dd3996e16", "score": "0.77516896", "text": "def destroy\n @sport_center.destroy\n respond_to do |format|\n format.html { redirect_to sport_centers_url, notice: 'Sport center was successfully destroyed.' }\n format.json { head :no_content }\n end\n e...
69a18a2da01848b3c1063aa4d48d9c78
PATCH/PUT /profile_functionalities/1 PATCH/PUT /profile_functionalities/1.json
[ { "docid": "dadd52d569ae4ce0b1ff7d11442a5d84", "score": "0.7184918", "text": "def update\n respond_to do |format|\n if @profile_functionality.update(profile_functionality_params)\n format.html { redirect_to @profile_functionality, notice: 'Profile functionality was successfully updated.' ...
[ { "docid": "3935665bab1d6e325ac5599ec3ad70b5", "score": "0.66042024", "text": "def update\n respond_to do |format|\n if @personal_feature.update(personal_feature_params)\n format.html { redirect_to @personal_feature, notice: 'Personal feature was successfully updated.' }\n format.j...
80baead9f99ade95ab1b671738fc5e24
requires user to use nested array in argument
[ { "docid": "b6c4c2467a3255a5af5d555592b2ce46", "score": "0.0", "text": "def [](pos)\n x, y = pos\n \n @grid[x][y]\n end", "title": "" } ]
[ { "docid": "df5285145b2d2639a0e985501de250b1", "score": "0.68407094", "text": "def test_nested_array\n\t\t['It', ['also'], 'works']\n\tend", "title": "" }, { "docid": "18f1c2221d35032283795f55f7d67579", "score": "0.6609014", "text": "def has_nested_array?(array)\n false\nend", "...
5874c61220c3502a008617bc576ac0fb
Search for a full key name in the metrics hash.
[ { "docid": "1ad7cbf9d77fab0b8ea128dd8b3ed40b", "score": "0.5785122", "text": "def get_metrics_key(raw_metrics, type, key)\n raise NoMetricsFoundError, \"no #{type} metrics found for [#{@target.name}]\" unless raw_metrics[type]\n\n # each object has only one metrics with some key/group_id ( e.g...
[ { "docid": "6ab4f1ac565778edfa5dcdd7cbadcead", "score": "0.6496916", "text": "def find_by_key(key)\n find { |r| r.key.to_s =~ /#{key}/}\n end", "title": "" }, { "docid": "4ae573cf29e931c63f0f0f02db366701", "score": "0.64896643", "text": "def fetch_key(key)\n string_key = key...
00199b099d1cfd474fdbd70acd4438eb
This function create a line with antialias
[ { "docid": "45e4fb72e159ce4f6d9b94074fe9c5dc", "score": "0.6830461", "text": "def draw_line(x1,y1,x2,y2,r,g,b,graph_function=false)\r\n if ( @line_dot_size > 1 )\n self.draw_dotted_line(x1,y1,x2,y2,@line_dot_size,r,g,b,graph_function)\n else\n r = 0 if ( r < 0 ) \n r = 255 if (...
[ { "docid": "a7ba3bdba637b2d198e0f24aaa817d34", "score": "0.6753873", "text": "def line x1, y1, x2, y2, c\n screen.draw_line x1, y1, x2, y2, color[c], :antialiased\n end", "title": "" }, { "docid": "3bd70a4d37c012436362344c661979a2", "score": "0.6684953", "text": "def draw_line(x1...
2db308c12c8d5deed9d9a011d881c0d9
Sets the installState property value. Possible values for install state.
[ { "docid": "e771cc2a80025a27b8ce003956393835", "score": "0.8495673", "text": "def install_state=(value)\n @install_state = value\n end", "title": "" } ]
[ { "docid": "b06c2e7975e44af3caa75c0a2bd47852", "score": "0.60222214", "text": "def install_state\n return @install_state\n end", "title": "" }, { "docid": "014f3681f8b7958553e55a8f7fe8667d", "score": "0.55238783", "text": "def install_dir=(value)\r\n @ins...
d9ea7e0ed3f9aee5ba7408f035a57551
~ example for usage: i[0] is the value in the 1st column, i[1] is the value in the 2st column ~ for i in read_excel("zzz") ~ puts i[0] ~ puts i[1].to_s.to_i.to_s ~ end
[ { "docid": "e4bf7b0c7d8662085239f0e6c6f9519d", "score": "0.64233667", "text": "def read_excel(filename)\n\t @@myDir = File.expand_path(File.dirname(__FILE__)+\"/../\")\n\t excel = WIN32OLE.new(\"excel.application\") \n\t excel.Visible = false\n\t excel.WorkBooks.Open(@@myDir+\"/data/#{filename}\...
[ { "docid": "2d151beb67a646bc3f5c74280c2287ae", "score": "0.6753324", "text": "def getData\n# Parsing an existing workbook\nworkbook = RubyXL::Parser.parse(\"C:/Grace/Automation/CucumberRuby/MyTest/test-data/data.xlsx\")\n#Define working sheet\nworksheet = workbook['SG']\n\n#Table reading\nworksheet.each...
90ae4dc1fb1844cee343bfb61a959b5f
configure how to compute class names for events.
[ { "docid": "10e53fb3d4c2a9d0e24e82830ae9f5a0", "score": "0.715607", "text": "def compute_event_class_name(event)\n # User::EventStore => User::CreatedEvent\n self.class.name.gsub(/::EventStore/, \"::#{event.to_s.camelize}Event\") \n end", "title": "" } ]
[ { "docid": "73e089d8e638468e82c5d27f01c3aba4", "score": "0.6488249", "text": "def event_name(event)\n \"#{self.class.name.underscore}_#{event}\"\n end", "title": "" }, { "docid": "ac387a8fe17812fdfab8e92d3a50379f", "score": "0.61467", "text": "def set_resource_class_name\...
e1c3a7f46786f63cef25898369b6c9a6
DELETE /patients/1 DELETE /patients/1.json
[ { "docid": "7f56021282a772e650161bb73a4f1665", "score": "0.6998446", "text": "def destroy\n authorize! :destroy, Patient\n @patient.destroy\n respond_to do |format|\n format.html { redirect_to patients_url, notice: 'Patient was successfully destroyed.' }\n end\n end", "title": "" ...
[ { "docid": "c77f2ae848e9dc4375e05fe68defe689", "score": "0.7820231", "text": "def destroy\n @patient = Patient.find(params[:id])\n @patient.destroy\n\n respond_to do |format|\n format.html { redirect_to patients_url }\n format.json { head :ok }\n end\n end", "title": "" }, ...
d0dccf67d412245ac2cfac86c02d89db
returns pruned array of 2 element arrays, like [[display, code], [display, code]], first element is the default
[ { "docid": "13c8912c9d2586598497826efdb73d12", "score": "0.0", "text": "def getOrderedOptions(item, loinc = false)\n options = pruneOptions(getRawOptions(item, loinc))\n prepop = getFromSession(item.linkId)\n return options if prepop.empty?\n\n i = options.index{ |arr| arr[1]...
[ { "docid": "80b1ff3196cd4718073e5d34b58455b4", "score": "0.6558726", "text": "def prune\n []\n end", "title": "" }, { "docid": "93f3ce2cb31fe043887a11bf76312ffb", "score": "0.6101787", "text": "def custom_compact_1(array)\n final=[]\n array.each {|element| final << element ...
fddf86b7995d36af4bd8412ec4aa609e
GET /player_round_factories/new GET /player_round_factories/new.json
[ { "docid": "994a8bd5416ef6996e38e1523e62936c", "score": "0.8088602", "text": "def new\n @player_round_factory = PlayerRoundFactory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player_round_factory }\n end\n end", "title": "" } ]
[ { "docid": "283cb26b93d481179c94f92ac78e53c2", "score": "0.8022193", "text": "def create\n @player_round_factory = PlayerRoundFactory.new(params[:player_round_factory])\n\n respond_to do |format|\n if @player_round_factory.save\n format.html { redirect_to @player_round_factory, notice:...
d39a220c1a381dc318eab8e99302435a
Reload the project's metadata
[ { "docid": "d513bce53e003c909495ec240a1dd4fa", "score": "0.67814463", "text": "def reload_project\n l_say(2, 'Reloading project')\n project.load\n end", "title": "" } ]
[ { "docid": "bec6efe5635452fb2b4d3480ed1fca6f", "score": "0.68955135", "text": "def reload\n UI.info \"Reloading project config\"\n @builder.build_project\n end", "title": "" }, { "docid": "ee2db12bf74e75e33f67e1ad9bce4e6b", "score": "0.66674703", "text": "def reload_proj...
52a099750892381636cbd035a95773d5
coordinates given will place the toy robot onto a spot on the table
[ { "docid": "43456659588cf82b53737d551e90e8c6", "score": "0.0", "text": "def chk_safe_coords(x, y)\n # If x or y is negative or greater than 4\n if x < 0 || x > 4 || y < 0 || y > 4\n return false # Return \"unsafe\"\n else\n return true # Return \"safe\"\n end\nend", "title": "" } ]
[ { "docid": "8c0d7c1a34892366b78b750341a03664", "score": "0.71342576", "text": "def place(x, y)\n self.robot_position = {\n x: x,\n y: y\n } if valid_coordinates?(x, y)\n end", "title": "" }, { "docid": "ef9e9865ac73ad5b395a8c1e6988a32d", "score": "0.7044622", "text...
3ba657f7a98f03641116cab81a9118c0
Most common tasks run before each test (now in a nice package). === Parameters: ::__url__ The url for the browser to open
[ { "docid": "23a57b2781e30aa447aa9704c16ade99", "score": "0.58297515", "text": "def setup_before_each_scenario(url)\n $tracer.trace(\"GameStopMobileDSL : #{__method__}, Line : #{__LINE__}\")\n # Some of the stuff in this method would be a more natural fit in the after(:each) but\n # we can't use...
[ { "docid": "4e903e847c4c035388b36be8e6f6b69b", "score": "0.71313167", "text": "def setup_before_each_scenario(url)\n $tracer.trace(\"PowerUpRewardsDSL : #{__method__}, Line : #{__LINE__}\")\n $tracer.report(\"Should #{__method__}.\")\n # Some of the stuff in this method would be a more natural ...
2397767b7a670aca0d6dd585e553aa5a
Setup events for running Vedeu. This method is called by Vedeu.
[ { "docid": "4fbba751f4eeabaa4606235104199873", "score": "0.59980416", "text": "def setup!\n Vedeu::Events::Repository.reset!\n\n Vedeu::Bindings::Application.setup!\n Vedeu::Bindings::Document.setup!\n Vedeu::Bindings::Visibility.setup!\n Vedeu::Bindings::Movement.setup!\n ...
[ { "docid": "1f31a758d91f22d36dbf432a839133bf", "score": "0.74457884", "text": "def set_up_events\n set_up('events')\n end", "title": "" }, { "docid": "fd60b970cd7c2d86f425aba11c9e29ef", "score": "0.65070105", "text": "def setup()\n \n # validates the hook token\n b...
4a8768a11b928f774baf9f73d9a87010
return true or false if we're done bidding done bidding if there are the same number of valids bids as there are players in the game
[ { "docid": "b594afa78d2aa96e06583609a3756023", "score": "0.77335405", "text": "def done_bidding? state\n return player_size_and_nil_check(state[:bids], state)\n end", "title": "" } ]
[ { "docid": "ada9166222b10249ce5d416502b6d42b", "score": "0.76812166", "text": "def bid_posible?(bid)\n\n # if not in bid list can't be bidded \n if @@BIDS.include?(bid) == false and @more_bid_game == false\n return false\n end\n # if no bids before anything can be bidded\n if @bids.s...
f6534d4a826598052a64e2f829a9820b
Add the child assertions which were nested to this instance.
[ { "docid": "462db0798fbbe56fc59ebf326db5bab6", "score": "0.7916324", "text": "def add(assertions)\n\t\t\t# All child assertions should be resolved by this point:\n\t\t\traise \"Nested assertions must be fully resolved!\" if assertions.deferred?\n\t\t\t\n\t\t\tif assertions.append?\n\t\t\t\t# If we are i...
[ { "docid": "da0ab7e3eca43e0ce5a93fa33dc391b4", "score": "0.5704313", "text": "def add_assertion\n @assertion_count += 1\n notify_listeners(PASS_ASSERTION, self)\n notify_changed\n end", "title": "" }, { "docid": "69badf89c2d853267b5521557943700c", "score": "0.56...
b9fe2688f23e4d0a4b446c705e9f2bac
GET /seasons/1 GET /seasons/1.json
[ { "docid": "d646faf69237194f6742ae147441fa53", "score": "0.82116115", "text": "def show\n @season = Season.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @season }\n end\n end", "title": "" } ]
[ { "docid": "4a5f0e40dd6351123e3c9337ae0140d2", "score": "0.8027006", "text": "def show\n @app_season = AppSeason.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app_season }\n end\n end", "title": "" }, { "docid": "...
023c38262c2ad7a1ee34f0c455b23d28
FIXME: need to revisit array vs nonarray proxy, to_a/to_ary semantics, etc.
[ { "docid": "8abd89ce490a8e2bfe8c85a91fef7b08", "score": "0.0", "text": "def size; length; end", "title": "" } ]
[ { "docid": "a1cc159c28fd2e0e041a90fec25652ce", "score": "0.7143081", "text": "def to_ary()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "a1cc159c28fd2e0e041a90fec25652ce", "score": "0.7143081", "text": "def to_ary()\n #This is a stub, used f...
19ef2abab0baac6407d3b718ba712e69
PATCH/PUT /couts/1 PATCH/PUT /couts/1.json
[ { "docid": "9954b5a3187efdae56347e18337134c7", "score": "0.58365566", "text": "def update\n\n @company = Company.find(1)\n @puntos = @company.get_puntos()\n @employees = @company.get_employees2() \n@trucks = @company.get_trucks\n\n respond_to do |format|\n if @cout.update(cout_para...
[ { "docid": "7cbcb2cda6e100042f124dacd474f3be", "score": "0.6459338", "text": "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "5c3c0f7e2084b089609614ed5348b04a", "score": "0.6411834", "text": "def update\n ...
9995f343685c359391fc502b0f9b6e78
Returns an enumerator that iterates over each subnode of this node in DFS order.
[ { "docid": "36295220492b1e557b293ab3240f7053", "score": "0.7630851", "text": "def dfs_enumerator\n Enumerator.new do |g|\n dfs do |node|\n g.yield node\n end\n end\n end", "title": "" } ]
[ { "docid": "30e79a738d3f1b0929ba94ffff39feb7", "score": "0.6147832", "text": "def each\n self.traverse_down { |node| yield(node) }\n end", "title": "" }, { "docid": "aec2471065837c04724481d9fca452cd", "score": "0.6123819", "text": "def traverse\n nodes = [self]\n ...
b892df334565160e532cef84f8da3ae9
Returns a string representing the opening of the form tag for serializers that support opening tags.
[ { "docid": "3b55277bfae4a0515d0152642a3c9bd8", "score": "0.68026936", "text": "def open(attr)\n serializer.serialize_open(_tag(:form, attr)) if serializer.respond_to?(:serialize_open)\n end", "title": "" } ]
[ { "docid": "9ce8457245a52683cc1dded75b52e73e", "score": "0.7028827", "text": "def render_open_tag(tag)\n tag_string = \"<\"\n tag_string << tag.type\n tag_string << \" name= \" << tag.name unless tag.name = \"\"\n tag_string << \" id= \" << tag.id unless tag.id = \"\"\n tag_string << \" c...
00b5731330e0a8cb58d0f2a7fc2498d8
PATCH/PUT /topics/1 or /topics/1.json
[ { "docid": "94e089a7b46636486a893b3cd627a071", "score": "0.7253718", "text": "def update\n if @topic.update(topic_params)\n render json: @topic\n else\n render json: @topic.errors, status: :unprocessable_entity\n end\n end", "title": "" } ]
[ { "docid": "611999ec9d4d1b804366afb5b95e605c", "score": "0.75671554", "text": "def update\n json_update(topic,topic_params, Topic)\n end", "title": "" }, { "docid": "389a0746a929f8e1b381e2d3e726c1f2", "score": "0.7219475", "text": "def update\n\n respond_to do |format|\n ...
ff97bdaf6182c9a994f5ef55aa892740
Creates a Zipcode Territory if one does not already exist. A zipcode territory is the first 2 digits of the zipcode for the firm. It then assigns the organization to the territory It then checks all the fields, if any are blank, it registers as an incomplete profile.
[ { "docid": "8564bb6669344c4bc8b2b2034e39a754", "score": "0.64824766", "text": "def process_before_save\n zipcode = organization_zipcode.split('')[0..1].join('') if organization_zipcode.present?\n teriitory = Territory.find_by_territory_identifier(zipcode)\n unless teriitory\n teriitory = T...
[ { "docid": "1cffd22791db5c9530df74551bf83f34", "score": "0.5473488", "text": "def define_postal_code\n @postal_code = Faker::Address.zip_code(state_abbreviation: @state)\n @postal_code = '' unless @set_blank == false\n end", "title": "" }, { "docid": "969c0ecd6fe64ea69e09edfa40a...
2c4522e79cad7efc834706a5aaf87dd8
Does the heavy lifting of properly reading the larger body requests in
[ { "docid": "d6a08a3f01bb3206ab088eff4435acd3", "score": "0.6418262", "text": "def read_body(remain, total)\n begin\n # write the odd sized chunk first\n @params.http_body = read_socket(remain % Const::CHUNK_SIZE)\n\n remain -= @body.write(@params.http_body)\n\n update_re...
[ { "docid": "a8ea35b21f9761cc2f240805143a2477", "score": "0.701691", "text": "def request_body\n # rewind in case anything in the past has left this un-rewound \n request.body.rewind\n request.body.read.tap do\n # rewind in case anything in the future expects this to have been left ...
6521fa3e347aca0e45aa14fefae56684
The collection of a entry
[ { "docid": "dcb3bdd2e9a0c098cbf145b21daae684", "score": "0.69654495", "text": "def collection\n self.class.collection\n end", "title": "" } ]
[ { "docid": "da066b51e0e2c6b4b20e22aab495e117", "score": "0.72590506", "text": "def collection\n @collector.collection\n end", "title": "" }, { "docid": "82e551feeb492f9cdf612129ce4d35f3", "score": "0.7235432", "text": "def _collection\n collection\n end", "title":...
117f07254ab23c7f958971c01e2be096
GET /workflow_components/1 GET /workflow_components/1.json
[ { "docid": "7fe3b78bbd062f180f531427e3055c39", "score": "0.7391104", "text": "def show\n @workflow_component = WorkflowComponent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @workflow_component }\n end\n end", ...
[ { "docid": "df2715bf6143c805e09dd262c1aea9bf", "score": "0.66453975", "text": "def new\n @workflow_component = WorkflowComponent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @workflow_component }\n end\n end", "title": ""...
f1dcd2d7ad27bba23fcd860c8706231a
We transform different payload formats into a unified structure. These methods should be extracted into their own services as we support more formats and complexity increases.
[ { "docid": "6c182f45806d334f90e279a7055b8b4b", "score": "0.0", "text": "def create_reservation(request)\n payload = request.payload\n\n reservation = if payload[\"reservation\"]\n process_format_1(payload[\"reservation\"])\n else\n process_for...
[ { "docid": "5ec8c6a3d616cc77dc574b2a28938a25", "score": "0.6352199", "text": "def format_payload(shellcode)\n case format.downcase\n when \"js_be\"\n if Rex::Arch.endian(arch) != ENDIAN_BIG\n raise IncompatibleEndianess, \"Big endian format selected for a non big endian p...
96162d201094a9a30026d9ec63cd60aa
calls the population number from the retrieved API
[ { "docid": "ff37b9e706db8b640cd63f27a4f164f7", "score": "0.6972336", "text": "def population\n\tresponse = @parsed_response['data'][0][1].to_i\n\tcomma_numbers(response)\nend", "title": "" } ]
[ { "docid": "5649dde08290d9775e673779f223f2ca", "score": "0.677013", "text": "def show\n\n\n @populationresponse = @country.retrievePopulation(2017)\n\n\n end", "title": "" }, { "docid": "7cf4c95c37c2ecdb3b07f1c4b9ff7995", "score": "0.61121786", "text": "def set_population\n ...
04a758f0b3c751124fa79d7385919332
Compare the two images referenced by this object, and return `true` if they are different, and `false` if they are the same. Return `nil` if the old file does not exist or if the image dimensions do not match.
[ { "docid": "9efde121eaa3d7ef118bc279042e5ae5", "score": "0.7671112", "text": "def different?\n return nil unless old_file_exists?\n\n old_file, new_file = load_image_files(@old_file_name, @new_file_name)\n\n return not_different if old_file == new_file\n\n images = lo...
[ { "docid": "1cfbb0552a257571c82ce8a316d935b0", "score": "0.75412464", "text": "def quick_equal?\n return nil unless old_file_exists?\n return true if new_file_size == old_file_size\n old_file, new_file = load_image_files(@old_file_name, @new_file_name)\n return true i...