query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
3271f5350122e1773ce0fbf91576741d
POST /investments POST /investments.json
[ { "docid": "b0e50e5e4a009108b8d696fe75308ba5", "score": "0.68701905", "text": "def create\n @user = current_user\n @business = Business.find params[:investment][:business_id]\n @investment = @user.investments.build params[:investment]\n\n respond_to do |format|\n if @investment.save\n ...
[ { "docid": "1e9a6235098dfdbbdb859e4e77cef976", "score": "0.76335293", "text": "def create(options)\n API::request(:post, 'investments', options)\n end", "title": "" }, { "docid": "d00c39afcfaeacc9287bdd4a0b7c811c", "score": "0.73285675", "text": "def create\n @investme...
956d69b1239791d2a7849245ac829f7a
Instance Methods Permission Methods
[ { "docid": "deab52a5ccd8d00d0a7e5c1f2e22265c", "score": "0.0", "text": "def can_be_edited?\n published? or unpublished?\n end", "title": "" } ]
[ { "docid": "75cfc3b2181e3d642de252a19d8b06f7", "score": "0.8150802", "text": "def permission; end", "title": "" }, { "docid": "89cb1849101eaf5614248e8c9b6f3080", "score": "0.7921537", "text": "def permissions; end", "title": "" }, { "docid": "e7fa55c996c89a154f6ff748543f9...
f4d7d2d5a6f921f04058015bd00df20a
Forcefully define a property, even if it already exists.
[ { "docid": "f33047f691521e266b8d410cf84d27c6", "score": "0.6895692", "text": "def property!(property, default=NoDefaultValue)\n property(property, default, overwrite: true)\n end", "title": "" } ]
[ { "docid": "d51e20bc23eb763cd023f35ea848d744", "score": "0.67076635", "text": "def assert_property_exists!(property)\n super unless Plaid.relaxed_models? ||\n self.class.property_ignored?(property)\n end", "title": "" }, { "docid": "58fa94ae5f8793926afe8b29649...
11ea07dfa52b15116524f871b5c7a922
=> 9 Frequent Letters Write a method frequent_letters that takes in a string and returns an array containing the characters that appeared more than twice in the string.
[ { "docid": "7df4a52c31690bd01209b7b771c1ea4e", "score": "0.87520695", "text": "def frequent_letters(string)\n count = []\n freq = Hash.new(0)\n string.each_char { |char| freq[char] += 1 }\n\n freq.each do |k, v|\n count << k if v > 2\n end\n count\nend", "title": "" } ]
[ { "docid": "5a068d5b7989959eeea3ee5ba41f19c5", "score": "0.89116025", "text": "def frequent_letters(string)\n\tcharacters = []\n \tlettersCount = Hash.new(0)\n \n \tstring.each_char { |letter|\n \tlettersCount[letter] += 1\n \tif lettersCount[letter] > 2 && !characters.include?(letter)\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6721ee8c8fc7c68d7db5fd0ca8a5f826", "score": "0.0", "text": "def set_product\n @product = Product.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...
7475a2f168a72743972418f05ac99e1e
Retorna true si el usuario es administrador de una cuenta
[ { "docid": "1e41e4da95d5bd23f752054d98478445", "score": "0.0", "text": "def jefe_tecnico?\n return self.tipo_usuario== JEFE_TECNICO\n end", "title": "" } ]
[ { "docid": "bbb502944fe2f5d847fc24a59ba1110f", "score": "0.80806094", "text": "def admin?\n (current_user.class.to_s==\"Administrador\")? true : false\n end", "title": "" }, { "docid": "3fa692f0e2bfc76c38e68a15ef20ebea", "score": "0.7954798", "text": "def administrador?\n self...
bb59d70a710b3173721fd186eab31195
API required to get travel time
[ { "docid": "60926a19a2433d590b163c303f60c974", "score": "0.6544972", "text": "def travel_time(origin, destination)\n url = \"https://maps.googleapis.com/maps/api/distancematrix/xml?units=imperial&origins=\" + origin + \"&destinations=\" + destination + \"&key=\" + ENV[\"GOOGLE_MAPS_API\"]\n parse_page...
[ { "docid": "a329cc80d05c6b27bb7ab9d6020b9b7e", "score": "0.716468", "text": "def trip_time_resolution\n method = \"tripTimeResolution\"\n post_request(method)\n end", "title": "" }, { "docid": "a329cc80d05c6b27bb7ab9d6020b9b7e", "score": "0.716468", "text": "def trip_time_reso...
0fd6cb738c6d1a7b83d3c568e122d859
Initializes the exception instance. message:: The exception message. details:: An object with details about the exception.
[ { "docid": "96bb0e35540cc1571bdf941a8c6240dc", "score": "0.73815966", "text": "def initialize(message = nil, details = nil)\n @details = details\n super(message)\n end", "title": "" } ]
[ { "docid": "c076824b340fd86ff4ff5bc0d76239e4", "score": "0.6780305", "text": "def initialize\n @message = 'Unknown Exception'\n end", "title": "" }, { "docid": "3ed36f1cb2be9bfafce7ec79ef24ae66", "score": "0.66228783", "text": "def initialize(status_code, details)\n ...
30e42c54a38d60b6c4584564a75317f1
atom = CFWS? atext+ CFWS?
[ { "docid": "13fbb915ce426bafeb2fe6183a031c32", "score": "0.6094951", "text": "def _atom\n\n _save = self.pos\n while true # sequence\n _save1 = self.pos\n _tmp = apply(:_CFWS)\n unless _tmp\n _tmp = true\n self.pos = _save1\n end\n unless _tmp\n self.p...
[ { "docid": "56bb412c24a994d82121ac027da7ff32", "score": "0.6200111", "text": "def atom() puts \"ATOM\" end", "title": "" }, { "docid": "86780583ecdaa7506b4a40ea7fb96091", "score": "0.5860611", "text": "def quote_atom(str); end", "title": "" }, { "docid": "510...
706b6d3753ea7441639632ab6da475ea
List gets a list of Resources matching a given set of criteria.
[ { "docid": "e35e292833e5b6c38bb712359f9a504c", "score": "0.70522237", "text": "def list(\n filter,\n *args,\n deadline: nil\n )\n return @resources.list(\n filter,\n *args,\n deadline: deadline,\n )\n ...
[ { "docid": "37547c676524d82e5c9a0bdab28e3e8f", "score": "0.6932504", "text": "def list(\n filter,\n *args,\n deadline: nil\n )\n return @account_resources.list(\n filter,\n *args,\n deadline: deadline,\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2c2049f975bd00dbff2f6fc577b0d6a7", "score": "0.0", "text": "def credential_params\n params.require(:credential).permit(:name, :cer_number, :score, :cer_type, :start_date, :end_date, :identity_number)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6979893", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781746", "text": "def strong_params\n params.requi...
9146452ffd23e02c2eb5de0656fbc327
The phrases to be assembled in to a string representation.
[ { "docid": "9eb3bcd7be692d59c7e7fe69ddbc3113", "score": "0.63887286", "text": "def phrases\n [context, weeks, days, hm].reject &:nil?\n end", "title": "" } ]
[ { "docid": "eda9215770628c3f529629a1bc465cef", "score": "0.7699456", "text": "def to_string(phrases, separator = \"\\n\")\n phrases.join(separator).inspect\n end", "title": "" }, { "docid": "0f48bc31b1901f5914c03654ae363d74", "score": "0.72413564", "text": "def phrases; e...
55387877fa7e59cddf4dae32e6e23567
coloca en mayuscula la primera letra de nombre y apellido
[ { "docid": "72eb2d452ed875956501c2bfa760c561", "score": "0.0", "text": "def second_name=(n)\n write_attribute(:second_name, n.to_s.titleize)\n end", "title": "" } ]
[ { "docid": "a0521ad71f5f2183654d57e694ff68cf", "score": "0.6757766", "text": "def apellido\n self.usuario_sput.apellido\n end", "title": "" }, { "docid": "349e2ca0c2ad652d62c00867e838c155", "score": "0.6686209", "text": "def nombre_y_apellido \n primer_nombre + ' ' + prime...
039332f9d956b6622442c16a487fcded
this action is triggered on selecting cluster(s) to get the cluster's livians & their skills
[ { "docid": "72c09cafb5c984c5bdc740a3ab4d3a0e", "score": "0.6287507", "text": "def get_livians_and_skills\n cluster_ids = params[:clusters]\n clusters_livian_users = []\n livians_skills = []\n cluster_ids.each do |cluster_id|\n cluster = Cluster.find cluster_id\n clusters_livian_use...
[ { "docid": "d1eea7e8034ea1bacd7f885c72208954", "score": "0.6528774", "text": "def cluster_list\n super\n end", "title": "" }, { "docid": "83257b1016f8e7ea1b8c05c099cda4ec", "score": "0.63763195", "text": "def select(cluster, tags = nil)\n\n end", "title": "" }, {...
13a25936c2741d8f5701758f15cd1777
State transition tables end reduce 0 omitted
[ { "docid": "a99068f7be295a226c12197165f7ebc0", "score": "0.0", "text": "def _reduce_1(val, _values, result)\n self.lexer.lex_state = :expr_beg\n \n result\nend", "title": "" } ]
[ { "docid": "4a7c9864b4f194fb7c65c825195e6ada", "score": "0.64042956", "text": "def transitions; end", "title": "" }, { "docid": "0d2e863a19c863a84c1d98b365e36bbf", "score": "0.6064393", "text": "def closure! \n cstart = new_state\n cend = new_state\n\n add_transition(c...
0ebf33273975bd2aeb4112f77b3c03dd
For backwards compatibility removing in 1.0
[ { "docid": "5f1b8c5c400e6a73c3f60ce0dec6d568", "score": "0.0", "text": "def current_page #:nodoc:\n page = OpenStruct.new\n page.url = @current_url\n page.http_method = @http_method\n page.data = @data\n page\n end", "title": "" } ]
[ { "docid": "ae835b718242a27843cf0b0934dec1a4", "score": "0.7205462", "text": "def legacy_deprecations; end", "title": "" }, { "docid": "d1b856784af0feb1cac827a81be20c9d", "score": "0.7028347", "text": "def deprecation; end", "title": "" }, { "docid": "77b0c109415e0f3e761f...
b72747ae5b9453b652cf0c19bcb75d31
PATCH/PUT /goalies/1 PATCH/PUT /goalies/1.json
[ { "docid": "f898d3b8b7ba0339f741d559119d4f3e", "score": "0.68035483", "text": "def update\n respond_to do |format|\n if @goalie.update(goaly_params)\n format.html { redirect_to @goalie, notice: 'Goalie was successfully updated.' }\n format.json { render :show, status: :ok, location...
[ { "docid": "c1ce37391efb1725d5ad8dfc631e0c25", "score": "0.68725854", "text": "def update\n @goal = Goal.find(params[:id])\n\n respond_to do |format|\n if @goal.update_attributes(params[:goal])\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n forma...
f37792ac7d97988807fde68cf10d33ca
Does database support the nowait clause? Values are :nw_supported and :nw_unsupported
[ { "docid": "f60f1dbfcf0d0f781d777972d241495a", "score": "0.7302862", "text": "def nowait_support\n case __ub1(OCI_ATTR_NOWAIT_SUPPORT)\n when 0; :nw_supported\n when 1; :nw_unsupported\n end\n end", "title": "" } ]
[ { "docid": "1538e27fd748a97cc44dff0ab14a5990", "score": "0.6441089", "text": "def nowait?\n attr_get_ub1(OCI_ATTR_CONN_NOWAIT) != 0\n end", "title": "" }, { "docid": "1538e27fd748a97cc44dff0ab14a5990", "score": "0.6441089", "text": "def nowait?\n attr_get_ub1(OCI_ATTR_CO...
dc18d91ef5701e8be5b24dd575ce7e10
get current page's resource by template.current_piece
[ { "docid": "71248535fd947ca4adc0c826ba9cd254", "score": "0.0", "text": "def resources()\n objs = []\n data_source = self.template_tag.current_piece.data_source\n if data_source.present?\n if data_source == 'gpvs'\n #objs = menu.products\n #copy from taxons_control...
[ { "docid": "6fd991f620a6b60db760b41592cd3ec3", "score": "0.68942505", "text": "def current_resource\n return nil unless current_path\n sitemap.find_resource_by_destination_path(current_path)\n end", "title": "" }, { "docid": "79f412256c413e798b20d311dd430a16", "score":...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "adc61a3c687f6ad83551f0c570f19b44", "score": "0.0", "text": "def update!(**args)\n @contexts = args[:contexts] if args.key?(:contexts)\n @details = args[:details] if args.key?(:details)\n @type = args[:type] if args.key?(:type)\n end", "title": "" } ]
[ { "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...
178a0304cfe1572ff90982c7dc16a764
Attaches the SPS client to the web browser. The SPS broker must be started before the code can be attached. see start_broker()
[ { "docid": "a71d45b43e750616c4e7bfc5a687a6a3", "score": "0.0", "text": "def attach_console(autohide: true)\n\n @window.activate()\n open_web_console(); sleep 1\n\n clipboard = Clipboard.paste\n Clipboard.copy javascript(); sleep 1\n ctrl_v(); sleep 0.5; carriage_return()\n\n close_web_...
[ { "docid": "f2b730f37f18ecc5ea3d87dd6c02c2b3", "score": "0.5207853", "text": "def acknowledgements\n self.acknowledgements_link\n sleep 1\n wait_for_ajax\n Acknowledgements.new @browser\n end", "title": "" }, { "docid": "0190e03133e8f32ef84e3af72846d266", "score": "0.5193957...
c98341bc5686ea91c3d0e663a9ac8819
Updates an employee's salary and wages record
[ { "docid": "a8f6e074b0f8c942aba07ff331e2b2f9", "score": "0.7276916", "text": "def update_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id, salary_and_wage, opts = {})\n data, _status_code, _headers = update_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id...
[ { "docid": "e3316e101372966331f956446cbcf6c9", "score": "0.7709596", "text": "def associate_salary_to_employee\n payroll_employee.update_attribute(:salary,new_salary.to_f.round(2))\n payroll_employee.update_value_salary_to_fixed_concept\n end", "title": "" }, { "docid": "429ffbc5bc93c...
a791f9d5801e4d5abfd2c152c60717a8
......................................................................................................... process chat messages .........................................................................................................
[ { "docid": "660a737924d5d668adabfe3e2ab2a3bf", "score": "0.0", "text": "def on_message_chat(pipe, stanza)\n params = {:xmlns => 'message:chat', :to => stanza.from.to_s, :from => stanza.from.to_s, \n :id => stanza.id, :body => stanza.body}\n AgentXmpp.logger.info \"RECEIVED...
[ { "docid": "5da1fd32d706ba3772e0c8ae4830e3a1", "score": "0.7299133", "text": "def on_chat_message(data)\n begin\n message = data['attrs']['text']\n user = @userlist[data['attrs']['name']]\n $logger.info \"<#{user.name}> #{message}\"\n @handlers[:message].each { |handler|...
44470526b2447181da763f215e3bf339
DELETE /programations/1 DELETE /programations/1.json
[ { "docid": "e553ba467bb25a42868338dd61b5f3ba", "score": "0.72044355", "text": "def destroy\n @programation.destroy\n respond_to do |format|\n format.html { redirect_to programations_url, notice: 'Programation was successfully destroyed.' }\n format.json { head :no_content }\n end\n e...
[ { "docid": "3999aa12378683cfad98840a115d1720", "score": "0.76333356", "text": "def destroy\n @program.destroy\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3999aa12378683cfad...
06d30e67306d24a00e28c7c257dc4fc3
determine if there is a safe path to a captive
[ { "docid": "6c301c5714bd9764f2c7e3c09f7291e3", "score": "0.7511023", "text": "def safePathToCaptive?(look)\n s0 = look[0]\n s1 = look[1]\n s2 = look[2]\n if (s0.captive? or s1.captive? or s2.captive?)\n if (!(s1.enemy? or s2.enemy? or s0.enemy?))\n return true\n end\n els...
[ { "docid": "6f2b73c79cb514248d2c4640da550268", "score": "0.6536076", "text": "def secured_path?(path)\n path_match? secured_paths, path\n end", "title": "" }, { "docid": "5b2c94c128a930c82454a712a05f68ca", "score": "0.63925934", "text": "def dead?\n !Pathname.new(@path...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "56a25f7bc06a544925a952569a230803", "score": "0.0", "text": "def set_question_response\n @question_response = QuestionResponse.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310465", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60152966", "text": "d...
d18298b841ab84b98b88989d1623d648
Passes if actual's attribute values match the expected attributes hash. This works no matter how you define your attribute readers.
[ { "docid": "683ec70587d245407e64741331824f6c", "score": "0.7339407", "text": "def have_attributes(expected); end", "title": "" } ]
[ { "docid": "d0d8719239c51e90fc279f3f3c0f9e88", "score": "0.7259978", "text": "def attribute_match(attributes, expected)\n attributes.each do |attribute, value|\n assert (expected[attribute.intern] - value).abs <= 1\n end\n end", "title": "" }, { "docid": "70614cca...
ceadcdd6414ef282b538cb6bb3ba56aa
containing values (integers) and operations must be performed in order they appear in the string OUTPUT: the result of the operations only if the print command is given in the input string this is a stand alone program, the register would not be passed to anything else RULES: this program is a minilanguage running from...
[ { "docid": "09a74dbcd2f1d7c436191140b1d38942", "score": "0.0", "text": "def number?(string)\n string.to_i.to_s == string \nend", "title": "" } ]
[ { "docid": "66a288cbb0562d1cb65c3406952a256d", "score": "0.6688904", "text": "def run_program(intcode_program)\n program = intcode_program.clone.map(&:clone)\n\n i = 0\n until program[i] == 99\n puts program[i]\n instruction = program[i].to_s.rjust(4, '0').split('')\n\n res...
ed4a8fa90011b6cbc6dded569a7f1dfa
Add a breakpoint for when application control flow enters a class.
[ { "docid": "803e721f4496579687a8be1b4f2a2fd7", "score": "0.7017796", "text": "def add_class_entry_breakpoint(class_filter)\n return if @class_entry_breakpoints[class_filter]\n\n bp = @mgr.createMethodEntryRequest\n bp.setSuspendPolicy(EventRequest.SUSPEND_ALL);\n ...
[ { "docid": "cff4c3352fd1507b03f64ffb27cd5aed", "score": "0.6614684", "text": "def add_breakpoints(klass, method)\n return if klass.respond_to?(\"_before_breakpoint_#{method}\")\n klass.send(:alias_method, :\"_before_breakpoint_#{method}\", method)\n klass.send(:define_method, method) do |...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "285704ea745949a567033b65a9b34434", "score": "0.0", "text": "def set_country\n @country = Country.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163754", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045816", "text": "def action_hook;...
e0c13d5a41ce8a04c6e0a9917706000a
Format a CSS background setting value based on this product family's custom settings
[ { "docid": "44a6c4618ab19ffcde09546083382c54", "score": "0.67239255", "text": "def custom_background\n css = \"\"\n css += \"background-color: #{self.background_color};\" unless self.background_color.blank?\n if self.background_image_file_name.blank?\n css += \"background-image: none; \"\n...
[ { "docid": "2c3009da563dcc785c7c0a5c9cffc145", "score": "0.65425295", "text": "def background(value = nil)\n return options[:background] unless value\n\n bg = Vedeu::Colours::Background.coerce(value)\n\n options[:background] = colour_attributes(background: bg)\n ...
f484bee157c99e50e2596b6ee72b6b7b
Generate IM Group Chat podspec.
[ { "docid": "8415c2bed9c058ee0ec63f085e43b1a3", "score": "0.8295817", "text": "def generateAVOSCloudIMGroupChat()\n header_files = header_files('AVOSCloudIMGroupChat')\n source_files = source_files('AVOSCloudIMGroupChat')\n public_header_files = public_header_files('AVOSCloud...
[ { "docid": "3db7351d795ebe7c168b2d841e6e8de1", "score": "0.54835427", "text": "def groupme_to_peribot(message)\n {\n service: :groupme,\n group: \"groupme/#{message['group_id']}\",\n text: message['text'] || '',\n user_name: message['name'],\n ...
b2135831ec0e164206cafd655e483de4
GET /groups/1 GET /groups/1.json
[ { "docid": "0dac5fdb6ba7f930cbcce51b533ab18a", "score": "0.0", "text": "def show\n unless @group.users.include?(current_user)\n respond_to do |format|\n format.html { redirect_to root_url }\n end\n end\n\n @messages = @group.messages.paginate(page: params[:page], per_page:5)\n ...
[ { "docid": "7761dcbf8079fbe8d9838f059e843811", "score": "0.80164665", "text": "def groups\n @page = 'groups'\n respond_to do |format|\n format.html {\n @groups = Group.find(:all)\n }\n format.json { }\n end\n end", "title": "" }, { "docid": "1f843b01e13360c014...
677c35597228ede7bf55d5489334fca8
GET /nota_fiscais/1 GET /nota_fiscais/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "7ea7510aa05da425868e3a57dcc57290", "score": "0.6811436", "text": "def show\n @filo = Filo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @filo }\n end\n end", "title": "" }, { "docid": "e11e7a0a54783f313...
cc17e7574eb0f2fd6e08f4e871eab722
Create transactions Create transactions for the supplied account or the account whose id is given with form parameters. It requires an array of transaction dictionaries.
[ { "docid": "92c68c914b5bd061c2ea8f02f5a28731", "score": "0.0", "text": "def users_id_user_transactions_post_with_http_info(id_user, original_wording, value, date, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BanksApi.users_id_user_transactions_...
[ { "docid": "8498d2ad0f78786564be7d3956b82e96", "score": "0.69439673", "text": "def create\n account = Account.find(params[:account_id])\n @transaction = account.transactions.create(params[:transaction])\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to ac...
8e17c674778318f6d056237bf4a92d01
Method to move the player upwards
[ { "docid": "7d8180604fbd252c567414c64c0fe210", "score": "0.80596083", "text": "def move_up\r\n @y -= 1\r\n end", "title": "" } ]
[ { "docid": "74dce63c2e5abd218687c9987db80a0c", "score": "0.8102935", "text": "def moveUp\n end", "title": "" }, { "docid": "4ce2bd2b01fed0cfefcc149168da5d34", "score": "0.807113", "text": "def move_up!\n @posx -= 1\n end", "title": "" }, { "docid": "a700cca67bf...
ecab10ddd6df24b44f04699c071ee53d
GET /loan_histories GET /loan_histories.json
[ { "docid": "904ea91abe958d0e7441cf73fc3ff6d0", "score": "0.0", "text": "def index\n @loan_histories = PackageRequest.where(:user_id => current_user.id)\n @loan_histories = if params[:loan_history]\n PackageRequest.joins(:item).where('item_name LIKE ? OR loan_date LIKE ?', \"...
[ { "docid": "e10e1e19ef6b0927b20fcbc5e1326efb", "score": "0.7526698", "text": "def index\n @loan_histories = LoanHistory.where(user_id: current_user.id)\n end", "title": "" }, { "docid": "06f1ec0735f80bfd83fd8dd18e24f5de", "score": "0.7277848", "text": "def show\n @loan_history...
19ebba5a5cc49eaa0d71e661d0baa14d
GET /accountabilities GET /accountabilities.json
[ { "docid": "150158c25f22a4038cb24995a631d09b", "score": "0.6871437", "text": "def index\n @user = User.all\n @accountabilities = Accountability.all\n end", "title": "" } ]
[ { "docid": "b32ad550e81e2b6784d3bcfb0dfecf53", "score": "0.7099316", "text": "def index\n @abilities = @user.abilities\n end", "title": "" }, { "docid": "3b4c4eabe0f28bbccfd168e544c4b696", "score": "0.7049832", "text": "def available_achievements\n render json: achievements\n ...
bf35dc0bda767608fef64532da760727
Get refs for the repo
[ { "docid": "d8d9f32619878f868ea7b5a5494fc284", "score": "0.7492922", "text": "def refs(ref=nil)\n prefix = ref ? \"#{path_prefix}/refs/#{ref}\" : \"#{path_prefix}/refs\"\n Ghee::API::Repos::Git::Refs::Proxy.new(connection, prefix)\n end", "title": "" } ]
[ { "docid": "1e4e8eab1cd48ec801ba06f66f6c35f0", "score": "0.80192816", "text": "def refs(repo)\n repo.refs_hash[id]\n end", "title": "" }, { "docid": "04b8b39c08b9198a7df30283970a90e9", "score": "0.7855158", "text": "def refs\n select_branches(git.grit.refs)\n end"...
ed71d460f011b781cbb8fd36d7b718c0
This method has the in_regions column display the name of the region in which that location existed.
[ { "docid": "cb35ebce09fcdd2d55d682692e1abd5f", "score": "0.81665444", "text": "def in_regions_column(record)\n record.in_regions.map do |ir|\n ir.region.name\n end.join(', ')\n end", "title": "" } ]
[ { "docid": "7df98444f6964a15a6cab31f36a77bbb", "score": "0.7047329", "text": "def subregion_names\n subregions.pluck(:name) if has_subregions?\n end", "title": "" }, { "docid": "78afb21426f4bbc7997396d6ff5f7f16", "score": "0.70401156", "text": "def region_name\n\t\tcustom_region ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4e66f44c595640c199beedade2a86918", "score": "0.0", "text": "def set_tarefa\n @tarefa = Tarefa.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...
1e66dacc38d2ce55630aeb046ece0702
Get a list of the passive servers in the cluster.
[ { "docid": "ad023971aae36342a8a8e456c75c9c7d", "score": "0.0", "text": "def passives\n @passives ||= (config[PASSIVES] || []).map { |s| s.downcase }\n end", "title": "" } ]
[ { "docid": "4d2e0bd8939c79becffac26f506e9ae8", "score": "0.6734244", "text": "def list_servers\n connection.get do |req|\n req.url \"agent/servers\"\n end\n end", "title": "" }, { "docid": "dea5d247074ba4eb0b2acc1a55086891", "score": "0.6699199", "text": "...
6fe87ff203662720f0508066940988bb
Construct a multi expression.
[ { "docid": "47eed30d7e52dfda0805d11c513e1fb0", "score": "0.5943055", "text": "def expression(type = 0)\n # Defer to unary on UNARY precedence.\n if type == ExpressionType::LEFT_TERMINAL_UNARY\n return leftTerminalUnaryExpression()\n end\n \n # Read all avail...
[ { "docid": "c1b05e68fe2d4a5677f70a03d91af30e", "score": "0.6490256", "text": "def to_expression(*args)\n Expression.new([self, *args])\n end", "title": "" }, { "docid": "863c2037fc620ab18a0250971ba105ce", "score": "0.60522664", "text": "def many\n Rexp.new(parenthesized_enco...
3dd37587456f1f7a230530c92de0ce75
convert the json txaction data to csv currently used options are: :tag => scope output to a tag
[ { "docid": "a9bba22d3ab318e5a028ee2bdba1c4c7", "score": "0.7281621", "text": "def convert\n options = @options.dup\n tag = options.delete(:tag)\n return CSV.generate(options) do |csv|\n csv << HEADERS\n @data[\"transactions\"].each do |txaction|\n csv << convert_txaction(txacti...
[ { "docid": "fa04cbeaf6d193637630feb0e4b5e0a9", "score": "0.6732726", "text": "def txactions_to_csv(txactions, options = {})\n txactions.sort! {|a,b| a.date_posted <=> b.date_posted}\n csv_text = CSV.generate(options) do |csv|\n csv << [\"Account Id\", \"Account Name\", \"Financial Institution...
b94a01f26a31ca90d5f5548fdd151e39
Frequency to attempt to get articles
[ { "docid": "f3c4648e26f169400665d26cad3745fe", "score": "0.61433965", "text": "def get_articles?(tick)\n tick % @query_frequency == 0\n end", "title": "" } ]
[ { "docid": "a1301e1f300eb1df214e723ef94d2d5e", "score": "0.6797138", "text": "def frequency; end", "title": "" }, { "docid": "7960938be6f6a4ef1ca858e62d1e24b1", "score": "0.6651185", "text": "def article_recommended_count\n article_recommended_count = 0\n self.articles.each do ...
ce1185997c08d466703dc9545182766a
Use this to protect error messages which are intended to go in the flash from causing a ActionDispatch::Cookies::CookieOverflow error (the session cookie has a limit of 4k) or making the web UI look ugly.
[ { "docid": "af524e78c771f492f8e9768954cd749f", "score": "0.0", "text": "def truncate(message)\n return message if message.size < 80\n message.slice(0, 80) + '...'\n end", "title": "" } ]
[ { "docid": "95f2a950e9757f56ba72ccc6f43d0b19", "score": "0.65349543", "text": "def set_flash_now_error(message)\n @controller.flash.now[flash_key(:error)] = message\n end", "title": "" }, { "docid": "3a6abaaec819cc1f8b7c130a745fbfe7", "score": "0.6460811", "text": "de...
3f1354babcd44b166c21925595196f8d
POST /user_stocks POST /user_stocks.json
[ { "docid": "2192b436cf1fb155f7744531fb074a25", "score": "0.7600134", "text": "def create\n @user = User.find(params[:user_id])\n @stock = Stock.where(symbol: params[:user_stock][:symbol]).first_or_create\n params[:user_stock].merge!(stock_id: @stock.id)\n @user_stock = UserStock.new(params[:...
[ { "docid": "650667075d05ed0b75a183e6ced2e346", "score": "0.79482275", "text": "def create\n @user = User.find_by(id: params[:user_id])\n if @user.id == current_user.id\n @stock = @user.stocks.new(stock_params)\n if @user.stocks << @stock\n render 'stocks/stock.json.jbuilder', stoc...
423659dcdc25f77adf2afe705c60b560
Initialize a command from arguments. Returns an instance of Command.
[ { "docid": "23d13d7612f5f220cd0cb5c7f06b656b", "score": "0.0", "text": "def action_command\n Command.new(serverside_command_path, @serverside_version, *task) do |cmd|\n given_applicable_options = given_options & applicable_options\n given_applicable_options.each do |option...
[ { "docid": "f290606fcde90decf87b1c8629960095", "score": "0.7660639", "text": "def initialize(*args)\n raise ArgumentError, \"Must pass arguments to Command.new\" if args.empty?\n @options = default_options.merge(args.extract_options!)\n @command = sanitize_command(args.shift)\n @args...
3eef8933c11b003709f3fe0c0a3b9547
Returns floating point percentage of how much object HP is gone.
[ { "docid": "4664e5215c9730638175a90c1bf7f614", "score": "0.7831695", "text": "def damaged_percentage\n 1 - alive_percentage\n end", "title": "" } ]
[ { "docid": "39fa8b0196247bc55534a282f4cd4f7c", "score": "0.74563724", "text": "def alive_percentage\n hp.to_f / hit_points\n end", "title": "" }, { "docid": "cb23ea50aeff517f75ec226e6e6cd9f2", "score": "0.6902058", "text": "def pct()\n\t (self.wins()==0) ? 0 : self.wins(...
f04c6f62ab47a5531cd2085b76eca8a4
=begin MASTER DATA: create supplier =end
[ { "docid": "ded65e0cd1cd5cd7c791120aeec34397", "score": "0.6336635", "text": "def create_supplier( employee, supplier_params) \n supplier = Supplier.new(supplier_params)\n if not employee.has_role?(:admin)\n supplier.errors.add( :authentication , \"Wrong Role: No admin role\")\n return ...
[ { "docid": "fbadce10d22b0da27599eae3ec49fccb", "score": "0.6574977", "text": "def generate_warehouse\n return true if type!=\"Supplier\"\n Warehouse.create(:company_id=>self.id,\n :name=>self.name,\n :managed=>false,\n :address=>self.addr...
8e0d0a3e8447aab58d0fda89a1f6e8c5
PATCH/PUT /system_organ_classes/1 PATCH/PUT /system_organ_classes/1.json
[ { "docid": "97dd93cca388798b8eea57847eed2379", "score": "0.76575136", "text": "def update\n respond_to do |format|\n if @system_organ_class.update(system_organ_class_params)\n format.html { redirect_to @system_organ_class, notice: 'System organ class was successfully updated.' }\n ...
[ { "docid": "40ffdc4b484c12a3fdfffc4f540ed0dd", "score": "0.6664275", "text": "def update\n @sclass = Sclass.find(params[:id])\n\n respond_to do |format|\n if @sclass.update_attributes(params[:sclass])\n format.html { redirect_to admin_orgs_url, notice: t('admin.orgs.update_class_succes...
bfd7859020e54f4bb722804d969bee64
PUT /type_decisions/1 PUT /type_decisions/1.xml
[ { "docid": "ff88aaf4e4ee1fc5605eafd817083dd9", "score": "0.6218553", "text": "def update\n @type_decision = TypeDecision.find(params[:id])\n\n respond_to do |format|\n if @type_decision.update_attributes(params[:type_decision])\n format.html { redirect_to(@type_decision, :notice => 'Ty...
[ { "docid": "470369b7ff586fc5881b51a88bb20440", "score": "0.6150468", "text": "def update\n authorize! :update, CompetenceType\n @competence_type.update!(competence_type_params)\n render json: {status: :ok}\n end", "title": "" }, { "docid": "fd7c5f545c4eff73294c760ac7057ca2", "s...
19c8e9b6177a835ee195f325ff7e086a
Push a message down one or more channels.
[ { "docid": "77c53654e591c5041657b51cffcac673", "score": "0.76464576", "text": "def push(msg, *channels)\n delegate.push(msg, *channels)\n end", "title": "" } ]
[ { "docid": "46e293959c929cb6ec6de80bcf78b181", "score": "0.75110584", "text": "def push(msg, *channels)\n channels = Array.ensure(channels).flatten\n raise ArgumentError if channels.empty?\n delegate.push(msg, channels)\n end", "title": "" }, { "docid": "02a9ab1455a...
147a080bafe9b47824d6875c2829979b
Implement a method merge_sort that sorts an Array:
[ { "docid": "6178c7da6f253581656883d2d9ea49b9", "score": "0.7760206", "text": "def merge_sort(arr)\n return arr if arr.length <= 1 \n\n mid = arr.length/2\n left_arr = arr[0...mid]\n right_arr = arr[mid..-1]\n\n sorted_left_arr = merge_sort(left_arr)\n sorted_right_arr = merge_sort(right_arr)\n\n ...
[ { "docid": "159bc4d733fabfb3e2a4030d1a47a913", "score": "0.8998524", "text": "def merge_sort array\nend", "title": "" }, { "docid": "b4cfc7e651465c8c64d2dc6c7a9f8663", "score": "0.8945444", "text": "def merge_sort(array)\nend", "title": "" }, { "docid": "b4cfc7e651465c8c6...
61a0ea52c54430bec8ecfb0818fe0adc
From the page 534 int.ord > int The ord method was added to assist in the migration from Ruby 1.8 to 1.9. It allows ?A.ord to return 65. If ?A returns a string, ord will be called on that string and return 65; if ?A returns an integer, then Numericord is called, which is basically a noop
[ { "docid": "fa24462c05afd6a2ca3f359d2a8485fa", "score": "0.8315257", "text": "def test_Integer_InstanceMethods_ord\n\t\tassert_equal(1, 1.ord)\n\t\tassert_equal(65, ?A.ord)\n\t\tassert_equal(66, ?B.ord)\n\tend", "title": "" } ]
[ { "docid": "7abbca8d0bdad926549dd44490d0d2ea", "score": "0.76072174", "text": "def ord(string)\nstring.ord\nend", "title": "" }, { "docid": "054ca0a3a960e9150ab2687e2a2cfafb", "score": "0.7451224", "text": "def ord()\n #This is a stub, used for indexing\n end", "title":...
036b378617b6f9f7654554d01ff2a784
currently getting wrong score because it is adding in te else at the very end to the strikes when they should not be getting added in.
[ { "docid": "e5bb3ddefdcd30b6e2fe33067bb02758", "score": "0.0", "text": "def last_three_throws_are_strikes(number_of_rolls, roll, current_roll, nextroll1, nextroll2 )\n if (3 == number_of_rolls - roll) && strike?(current_roll) && strike?(nextroll1) && strike?(nextroll2)\n true\n else\n f...
[ { "docid": "b8cf86479c54c6cc1de7ac5cf3f3e68c", "score": "0.70949405", "text": "def score_strikes(scores, strike_locs)\n score = 0\n # perfect game\n return 300 if strike_locs.length == 10\n\n strike_locs.each do |loc|\n next unless loc <= 8\n # does not add score for a strike frame if the last...
b3d4043e068d832cd69f68ba49f301bb
Returns all payments from the system that the user has access to
[ { "docid": "23e9746ac7d271b629ea10708ffe740d", "score": "0.0", "text": "def get_payments(opts = {})\n data, _status_code, _headers = get_payments_with_http_info(opts)\n return data\n end", "title": "" } ]
[ { "docid": "5616caa5d8287e369bc051502720c0ac", "score": "0.78880185", "text": "def index\n @payments = current_user.payments\n end", "title": "" }, { "docid": "0c6d2cabae214a4fa53deed440ddf015", "score": "0.7845758", "text": "def index\n @payments = Payment.where(user_id: curr...
2f6b014e1a12494e0046aeb333663509
Convert a field_predicate (field_op format), a value and a SQL field name using the set of predicates, to something convertible to a Sequel expression. field_predicate:: is a key from the parameter hash. Usually name_pred, eg birth_year_gt value:: is the value from the parameter hash. Could be a collection. field:: is ...
[ { "docid": "1083789c1dbeb9c53fe937d22ed9ae74", "score": "0.68094826", "text": "def define_name_predicate( field_predicate, value, field = nil )\n splitter = PredicateSplitter.new field_predicate, value\n\n # the default / else / fall-through is just an equality\n default_proc = ->{:eq}\n\...
[ { "docid": "3e30cb73096d5e90fd7972c2f10a5e78", "score": "0.70152456", "text": "def call( field_predicate, value, field = nil )\n unless respond_to? field_predicate\n define_name_predicate field_predicate, value, field\n end\n send field_predicate, value\n end", "title": "" ...
7a4e0b93671432b6acb6da67035c3da8
Remove blank lines and comments ()
[ { "docid": "d518c68916bf365f0dd67a0d9865a0fa", "score": "0.0", "text": "def compress\n delete_if { |l| l =~ /^\\s*$/ || l =~ /^#/ }\n end", "title": "" } ]
[ { "docid": "9f2168014c6fff8c848b160d361e5608", "score": "0.7863325", "text": "def strip_comments_and_newlines(text)\n text.gsub(/(\\/\\*.*?\\*\\/)|\\r\\n|\\n/, \"\") \n end", "title": "" }, { "docid": "f53131b9bf7df83ad7da0e3ab3467edd", "score": "0.76302654", "text": "def remove_...
1492b1c4d0456e1ecef06f35ca183ced
Reset the license count (System API)
[ { "docid": "e5d6e30f6819f4c45e98cda8e659e50d", "score": "0.85045177", "text": "def reset_license_count(headers=default_headers)\n @logger.info(\"Resetting License Count\")\n put(\"#{@api_url}/license/reset\", {}, headers)\n end", "title": "" } ]
[ { "docid": "84f48ef14863124d2795c9d1d77e4e2b", "score": "0.62636644", "text": "def reset\n @count = 0\n end", "title": "" }, { "docid": "ca3b02098bde6cd4acccddd4ef58cf72", "score": "0.5940462", "text": "def destroy\n @license.destroy\n end", "title": "" }, { "...
e2999c934ed8975dc2b1ab5615f35aa6
end JOB CREATE JOB DETAIL
[ { "docid": "466904a8eac14ff41434f038241aa936", "score": "0.0", "text": "def distance_from_user(user)\n return \"Unavailable\" unless user && user.latitude && self.latitude\n distance = distance_from([user.latitude, user.longitude])\n value = distance.to_s[0..3] if distance >= 1000\n value = ...
[ { "docid": "c03049b055e02f76ea9cb1e66d3b6370", "score": "0.6953204", "text": "def create_job\n\n end", "title": "" }, { "docid": "63155aae69c18fd47c7f9efc4e5a3e69", "score": "0.6619196", "text": "def create\n\t\t@job = @resume.jobs.new({\n\t\t\t:title\t\t\t=> 'Job Title',\n\t\t\t:co...
0dd89bc56841a2a2442ce7fc986e60c8
Deliver all leaflets for specified periodity
[ { "docid": "9dc75ef013096af6e0d5bd151870d7d2", "score": "0.7984575", "text": "def deliver_with_periodity(periodity)\n\n # Find suitable leaflets\n leaflets = Leaflet.with_periodity(periodity).populating\n \n puts \"[INFO] no leaflets found, skipping\" unless leaflets.any?\n\n leaflets.eac...
[ { "docid": "c27eb3beb8c88c310c930aa03e4e26dd", "score": "0.5302031", "text": "def schedule_plenaries\n\t\t@plenaries = Plenary.all\n\tend", "title": "" }, { "docid": "c27eb3beb8c88c310c930aa03e4e26dd", "score": "0.5302031", "text": "def schedule_plenaries\n\t\t@plenaries = Plenary.al...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a0cd71d2c195c45a09fe60fcc3d9df0a", "score": "0.0", "text": "def user_params\n params.require(:user).permit(:username,:email,:password)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74939764", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6955084", "text": "def strong_params\n params.require(:request).permit(param_whit...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "2543ec723b41e21685397d689d00ed8c", "score": "0.0", "text": "def update!(**args)\n @config = args[:config] if args.key?(:config)\n @expanded_config = args[:expanded_config] if args.key?(:expanded_config)\n @id = args[:id] if args.key?(:id)\n @imports = args...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
8bd0bb61a89236131da7ef5e5f31c2a9
The player adds a card to his side of the board, fails if he does not have enough mana.
[ { "docid": "3412d412c01fa09e2bfee5da7804f6a0", "score": "0.67811495", "text": "def playCard (card)\n\t\tif card.cost > @remaining_mana\n\t\t\tp \"Not enough mana!\"\n\t\telse\n\t\t\t@board.addToBoard(self, card)\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "4d9b96adf2e3e751f9003c43f922d1a1", "score": "0.7081044", "text": "def addToBoard(player, card)\n\t\tif player.side == 1\n\t\t\t@p1Board.push(card)\n\t\telse\n\t\t\t@p2Board.push(card)\n\t\tend\n\tend", "title": "" }, { "docid": "ebedfedd2e9b8b304e215a64895ee6c4", "score": "0....
1cbe3c089721f9c6fc92967449983a23
E: time = O(n), mem = O(1) Special case if alphabet <= 64 (for 64 bits systems), and alphabet is continuous
[ { "docid": "8d610d8feece5453196e881a46955ab5", "score": "0.0", "text": "def all_uniq_e?(str)\n bits = 0\n\n str.each_char do |c|\n bit = 2 ** (c.ord - 'a'.ord)\n\n if bits & bit == 1\n return false\n else\n bits |= bit\n end\n end\n\n true\nend", "title": "" } ]
[ { "docid": "eae14b764de7d7dbc97c41085560bcba", "score": "0.69608915", "text": "def fourth_anagram?(string,target)\n letters_hash = Hash.new(0)\n\n string.chars.each do |letter| # O(N)\n letters_hash[letter] += 1 # O(1)\n end\n p letters_hash\n target.chars.each do |letter| # O(N)\n letters_...
6d849009323e56429fc7b0bd31d43b6f
Return the selected photo with some extra data to render a preview quiclky from the grid.
[ { "docid": "1ba786289f1108fe0dee64e94c19ddfc", "score": "0.7048752", "text": "def selected_photo\n photo = current_photo\n\n photo.then do |photo|\n if photo\n # Scale the photo to fit into the window\n window_width = `$(window).width()`\n window_height = `$(w...
[ { "docid": "5793f4e0007b443f18013c524d43681d", "score": "0.72561806", "text": "def preview_photo\n photos.first\n end", "title": "" }, { "docid": "88c82cb38a6e5f6afb161ad3ce2303b1", "score": "0.649841", "text": "def show\n # @photo\n end", "title": "" }, { "docid"...
6515e9e9063863c4f7a83db0dd41de39
This method adds a method _reference_ (:whatever) to the hash defined above.
[ { "docid": "2cd3da9c1b468c08aa42496b555b2ed8", "score": "0.0", "text": "def register(hook, method)\n @hooks[hook].push method\n end", "title": "" } ]
[ { "docid": "d87c09bc61fa1aaab1633c36bbb62219", "score": "0.6904698", "text": "def method_reference; end", "title": "" }, { "docid": "ae7631590c91080dbc6af7a3ebf80fef", "score": "0.6839621", "text": "def method_reference=(_arg0); end", "title": "" }, { "docid": "7edb50c12b...
6451a89c6d4a12fcb16e4c31861ad3fb
lexer rule whitespace! (WHITESPACE) (in Pohua.g)
[ { "docid": "e1b04cb11cf2ec8047ca3786836853c0", "score": "0.79073405", "text": "def whitespace!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 7 )\n\n type = WHITESPACE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule b...
[ { "docid": "a2754ca666a5b8c8fc4ecc35a388bb74", "score": "0.7828548", "text": "def whitespace!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 50 )\n\n\n\n type = WHITESPACE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initializatio...
bf74e855d44a31ceb982e6d9621504cd
returns a map from section to the users in that section
[ { "docid": "de898fb4a9c6f52b73b55ac01b1f8dd5", "score": "0.70358676", "text": "def students_by_section\n class_map = Hash.new{ |h,k| h[k] = [] }\n self.followers.includes([:section, :student_user]).each do |f|\n class_map[f.section] << f.student_user\n end\n class_map\n end", "titl...
[ { "docid": "031202ea29fb689fffe5e43da03a41ec", "score": "0.67438775", "text": "def users\n result_hash['usr']\n end", "title": "" }, { "docid": "454e38732a402fa8470169905f11ea13", "score": "0.6412522", "text": "def users\n Section.find_roles.pluck(:name).inject(Array.new) ...
c4eda072a6b3519b02e58bbea37785df
Create a new user
[ { "docid": "a80debea1e3e43d82eb9c485b7e910e7", "score": "0.7980625", "text": "def create\n @user = User.new(user_attributes)\n if @user.save\n created(@user)\n else\n validation_errors(@user)\n end\n end", "title": "" } ]
[ { "docid": "542b142dd9e7366ef81150fc7aaeb808", "score": "0.82948214", "text": "def create\n\t\t\t\t@user = User.create!(create_user_params)\n\t\t\tend", "title": "" }, { "docid": "71d4ce23424967b5aa36dcaa1b2da993", "score": "0.8284585", "text": "def create_user\n User.create nam...
1b32779ea2fc6873be7b73d4b9af1c42
============================================================================== validate_args() ============================================================================== validate options hash
[ { "docid": "04d5fac35e6c93d3b5ea0d75b25aa48c", "score": "0.0", "text": "def validate_args(to_validate,known_args)\n to_validate.each do |x|\n raise ArgumentError, \"Unrecognized argument '#{x}'. Valid arguments are \" +\n \"#{known_args.join(', ')}\" if (!known_args...
[ { "docid": "af629eba5e95ab39f4f54b82e277d605", "score": "0.7741315", "text": "def validate_options(opts); end", "title": "" }, { "docid": "0a2f649dbdf2e12ace1b025f6698bca1", "score": "0.7726384", "text": "def validate_options(options); end", "title": "" }, { "docid": "0a2...
63447379aeffd12d290bb633d4669862
functions (also called METHODS) javascript... this would be function square(a) '(a)' is the INPUT....
[ { "docid": "ebc9a978d3f3a583cf65fc78fa0a0825", "score": "0.8114164", "text": "def square(a)\n\ta * a\nend", "title": "" } ]
[ { "docid": "6e2260f9ff927c161628808947e2e997", "score": "0.8196796", "text": "def square(a)\n a * a\nend", "title": "" }, { "docid": "b0b364fe5141fc44d36fbe7a43a80402", "score": "0.81543964", "text": "def square(x)\nend", "title": "" }, { "docid": "b8c0ffa4868b84d9bd4b9a7...
133bd599b439aab48778c8a93fd336f8
Given a URL that points to somewhere on the Drupal site (according to is_internal_url), looks for a node or file attachment at that URL If nothing is found, returns nil, else returns the absolute URL of the object
[ { "docid": "8be7bc7e664c9af5c76499cee05a3a9f", "score": "0.7184249", "text": "def get_internal_object_url_from_url(parent_url, url)\r\n # Compute the URL of this content relative to the base URL of the site\r\n relative_url = get_url_relative_to_base(parent_url, url)\r\n @logger.log...
[ { "docid": "1fc320057a5ef746846496d2239dc5da", "score": "0.6310374", "text": "def url\n file.try(:url)\n end", "title": "" }, { "docid": "c0af853cc858243fb772441bf8621b79", "score": "0.62360305", "text": "def href_is_local_link(href)\n file_uri = href.to_s.sub(/(#|\\?).*/,'')\...
3f92157c5defbbe3ba7d9f8f1e31d490
Checks if the stack is empty
[ { "docid": "ddb139ab2cdb07d024bfa816136dd30d", "score": "0.89308864", "text": "def empty?\n\t\t@stack.empty?\n\tend", "title": "" } ]
[ { "docid": "a33cdbd34d0831e1368d6d3d9e84e45f", "score": "0.9192175", "text": "def is_empty?\n return @stack.length == 0\n end", "title": "" }, { "docid": "2fd3e24a7a81e331e11d7b96f057ba56", "score": "0.9045652", "text": "def empty?\n @stack.length == 0\n end", "titl...
39308470b746211981c85ae5e615af08
Returns the median grade for this assessment, using all grades in self.completed_result_marks. If +points+ is true, this returns the raw median point grade for this assessment. Otherwise, the median percentage grade for this assessment is returned.
[ { "docid": "596fdbd67d021a52673923d9dee9902c", "score": "0.7868807", "text": "def results_median(points: false)\n return 0 if self.max_mark.zero?\n\n marks = self.completed_result_marks\n if marks.empty?\n 0\n else\n point_median = DescriptiveStatistics.median(marks)\n points ...
[ { "docid": "a6d4d0d11739812d82fd9b96942b192d", "score": "0.6726727", "text": "def median\n return 0 if self.max_mark.zero?\n\n marks = grades_array\n marks.empty? ? 0 : DescriptiveStatistics.median(marks)\n end", "title": "" }, { "docid": "a7608d6e45d247cad8e112c031d09a3a", "sc...
4cf31c047573636878ceffe51c4c792d
Closes a Ruby block.
[ { "docid": "515c7393540e03c7864a4b8fe3f11cb5", "score": "0.0", "text": "def close_script(_1, _2, push_end = true)\n push_silent(\"end\", true) if push_end\n @template_tabs -= 1\n end", "title": "" } ]
[ { "docid": "09bef5a2fa3bff01d0ecb5fc646660f7", "score": "0.81262", "text": "def close( &block )\n compile!( :close!, &block )\n end", "title": "" }, { "docid": "cf10bcfe077feaed88fc1abfe93e956e", "score": "0.6873272", "text": "def close\n if !block_given?\n ...
69d3da863ea4c150befdbd07203469c9
this does an extra lookup but may be more straightforward than guess_for_game
[ { "docid": "8b4ac8af0e31529c81bd1ba274a70b51", "score": "0.68292284", "text": "def guess_for_user(user)\n if user.class == User\n game = Game.find_by(user: user, deck: deck)\n Guess.find_by(game: game, user: user)\n elsif user.class == Fixnum\n game = Game.find_by(user_id: user.id, ...
[ { "docid": "cd528d79e1f0be18b6cab5421fb91751", "score": "0.7150322", "text": "def guess\n get_input\n check_letter\n if word_done?\n win_game\n end\n if !more_tries?\n lose_game\n end\n end", "title": "" }, { "docid": "4da650783c524da8ec2111e260b05fd1", "scor...
93825a4a77db99dae3be5215134b2698
Finish initializing this object
[ { "docid": "53084b651e2b22cfb847c4cf7f490842", "score": "0.0", "text": "def init_before_save\n self.turn = 1\n self.number = 1\n self.intro = (Intro).all.sample(1).first.name\n end", "title": "" } ]
[ { "docid": "bf8ea5e63f2bc7a5d02fc23a055fdd69", "score": "0.75705355", "text": "def finalize!\n end", "title": "" }, { "docid": "18e90880774cce12790c59daeb7b5b56", "score": "0.7530723", "text": "def finalize\n end", "title": "" }, { "docid": "18e90880774cce12790c...
7d707720909e98643e3997de93d6e0f5
apis for workorder status 1
[ { "docid": "ee8d0176d0cf909900836cd5dd8de53a", "score": "0.6248158", "text": "def pending_workorders\n @emp_id = params[:employee_id]\n\n @emp_work = EmployeesWorkorder.where([\"employee_id = ? and status = ?\",@emp_id,\"Pending\"])\n @w = @emp_work.all.map{|e| e.workorder_id}\n if @emp_work.presen...
[ { "docid": "5ebef10fdb179cffea85a2d0f20eff64", "score": "0.6751241", "text": "def order_status order_id\n path = \"/v1/order/orders/#{order_id}\"\n request_method = 'GET'\n params = { 'order-id' => order_id }\n perform(path, params, request_method)\n end", "title": "" }, { "doci...
680ef7697e636ccc75a288ada306dbfa
POST /models POST /models.json
[ { "docid": "1b11698776381fd5dd29096f80d2454f", "score": "0.0", "text": "def create\n @answer = Answer.new(answer_params)\n\n respond_to do |format|\n if @answer.save\n format.html { redirect_to model_customer_path(@model, @customer), notice: 'Model was successfully created.' }\n ...
[ { "docid": "a759ad6cc10168d036cc34fbc49b10f4", "score": "0.64328593", "text": "def create\n @model = @project.models.new(model_params)\n\n respond_to do |format|\n if @model.save\n format.html { redirect_to @model, notice: 'The model was successfully created.' }\n format.json { ...
d26492d022572419fef2500ee336440a
GET /crowd_data/new GET /crowd_data/new.json
[ { "docid": "d94405ef3cbf3814868e428c7b692ae5", "score": "0.76349324", "text": "def new\n @crowd_datum = CrowdDatum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @crowd_datum }\n end\n end", "title": "" } ]
[ { "docid": "d89d88dcb488b2acf0e3af27a9893512", "score": "0.70536685", "text": "def new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: ''}\n end\n end", "title": "" }, { "docid": "078673f1e016a5aa84e95947043a779c", "score"...
55ce7e9f03fa3854c239a76c746115fc
GET /live_clients GET /live_clients.json
[ { "docid": "3eb68ab2c0f574ec664404d1c343a041", "score": "0.7674752", "text": "def index\n @live_clients = LiveClient.all\n end", "title": "" } ]
[ { "docid": "11367d36e4c90c8a0de89176b3b870a4", "score": "0.75353515", "text": "def index\n @clients = current_user.clients\n render json: @clients\n end", "title": "" }, { "docid": "29fcc7c3bee7428121799f8973e4c715", "score": "0.72217035", "text": "def index\n @clients ...
6d6da27e335909ce70cc98b71432d422
Delete Metadata Proxy Config API will delete Metadata Proxy Config with ID profileid
[ { "docid": "7eb3193baf4c4aec0bca2e2a051af873", "score": "0.687189", "text": "def delete_metadata_proxy_config(metadata_proxy_id, opts = {})\n delete_metadata_proxy_config_with_http_info(metadata_proxy_id, opts)\n nil\n end", "title": "" } ]
[ { "docid": "3b6b405eef19ad323108301331ed840a", "score": "0.6884308", "text": "def delete_metadata_proxy_config_0(metadata_proxy_id, opts = {})\n delete_metadata_proxy_config_0_with_http_info(metadata_proxy_id, opts)\n nil\n end", "title": "" }, { "docid": "09d8ed2c62cbac8372f603...
a74f975e793b3d8d537368db9068eb99
Updates the contribution's state according to it's actual state within the gateway, based on each gateway's implementation of state_on_gateway.
[ { "docid": "871ee8dab90b2501d97d814e51e2e88f", "score": "0.728692", "text": "def update_state_from_gateway!\n return unless gateway_state = self.state_on_gateway\n if self.state_name != gateway_state\n transition = self.transition_by_state(gateway_state)\n self.send(\"#{t...
[ { "docid": "48b927a1ab33465b470fadd51713b67f", "score": "0.7599669", "text": "def update_state_on_gateway!(state)\n end", "title": "" }, { "docid": "deff5294f8dab12e6747b5e90e85f9c1", "score": "0.616038", "text": "def update_state\n state.update\n end", "title": "" }, ...
cd5521e3a770904871358e56a328c6fe
PATCH/PUT /testimonial_answers/1 PATCH/PUT /testimonial_answers/1.json
[ { "docid": "d8d03b1b1edea38cb089d6b7b2e3aa9b", "score": "0.7520011", "text": "def update\n respond_to do |format|\n if @testimonial_answer.update(testimonial_answer_params)\n format.html { redirect_to @testimonial_answer, notice: 'Testimonial answer was successfully updated.' }\n f...
[ { "docid": "438bfed9098190c5614fe4825d35d155", "score": "0.7290032", "text": "def update\n respond_to do |format|\n if @testimonial_question.update(testimonial_question_params)\n format.html { redirect_to @testimonial_question, notice: 'Testimonial question was successfully updated.' }\n ...
8187e7a42b4b76e24b2d0cd019977f44
POST /weather_records POST /weather_records.json
[ { "docid": "344b13dfdfd86fa51ce8a2277c4b953f", "score": "0.6904025", "text": "def create\n @weather_record = WeatherRecord.new(weather_record_params)\n\n respond_to do |format|\n if @weather_record.save\n format.html { redirect_to @weather_record, notice: 'Weather record was successful...
[ { "docid": "481220eff7a1ad709510fef8448927a6", "score": "0.6910035", "text": "def create\n @weather_record = WeatherRecord.new(params[:weather_record])\n\n respond_to do |format|\n if @weather_record.save\n format.html { redirect_to @weather_record, notice: 'Weather record was successf...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "bc19873dc8b53d82ca6a7a824fb26a91", "score": "0.0", "text": "def castle_params\n params.require(:castle).permit(:name, :kingdom_id, stocks_attributes: [:qte, :ressource_id, :id, :_destroy], garrisons_attributes: [:qte, :soldier_type_id, :id, :_destroy], tile_attributes: [:x, :y, :id, :...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
d2329cff1b05c6e443ce6eed108d06b0
Write a method that takes an Array, and returns a new Array with the elements of the original list in reverse order. Do not modify the original list. the only difference is that a new array is allowed! much easier
[ { "docid": "0ce8b8b60ae0202d075470bbfc526b60", "score": "0.7959489", "text": "def reverse(arr)\n\nnew_arr = []\n\n arr.each do |element|\n new_arr.unshift(element)\n end\n new_arr\n\nend", "title": "" } ]
[ { "docid": "6099aa9232219b789b6355da476705af", "score": "0.8596462", "text": "def reverse_array(array_new)\n array_new.reverse \n end", "title": "" }, { "docid": "299f6ab0d49c96cc3e4285a4a650a609", "score": "0.8587202", "text": "def reverse_array(array)\n array.reverse!\n arr...
880fb94924c04f78b134069a2bc5d6ce
Apply the new autoprefix and autodsid extraction mechanism.
[ { "docid": "3e8e49be4700ba6e52895f96c9064168", "score": "0.0", "text": "def refresh_form #:nodoc:\n params = self.params\n\n prefpat = params[:prefix_auto_comp] || \"\"\n dsidpat = params[:dsid_auto_comp] || \"\"\n return \"\" if prefpat.blank? && dsidpat.blank? # nothing to do\n\n file...
[ { "docid": "789319fb69e500578ef11c423ab628ad", "score": "0.56563026", "text": "def run(content, params={})\n require \"autoprefixer-rails\"\n AutoprefixerRails.process(content, from: @item[:filename]).css\n end", "title": "" }, { "docid": "d18925812200e29173b685745af85c31", "score...
adee5ef44f126436072ec5b3ab0051d5
params to create group, append current logined user id as creator and append self group tag to false
[ { "docid": "5075f9909127f17327b390c43e40d44a", "score": "0.6650494", "text": "def group_params\n params.require(:group).permit(:name, :description).merge(creator: current_user.id, self: false)\n end", "title": "" } ]
[ { "docid": "7e57142322cee2f05597e685f532dae7", "score": "0.7118808", "text": "def create\n\n @user = User.new(user_params)\n if @user.save\n # adding a self group\n name = 'Me (' + params[:user][:username] + ')'\n @user.groups.create(name: name, description: 'Assign task/bills to th...
40e70bdc809e40e45c3359fdbc83ffc8
Closes connection if it is active
[ { "docid": "41db9a2276bb5734911882e1a89e5d3e", "score": "0.0", "text": "def teardown\n logger.debug \"Connection teardown\"\n @connection.finished? or disconnect\n not @connection.finished?\n end", "title": "" } ]
[ { "docid": "776ee5a7c18e2a60ef65c97d5e542a5e", "score": "0.7967537", "text": "def close_connection\n @connection.finish if connected?\n end", "title": "" }, { "docid": "c084455d33be63bf4a5bb7b328a7152d", "score": "0.7898774", "text": "def close\n @active.value = false\n ...
5f743864315704fb9e397cffbc7afa4a
Normalize urls, allowing you to use "google.com" instead of "
[ { "docid": "304cb869985e53b533cba52934aa5f5b", "score": "0.79572046", "text": "def normalize_url url\n unless url.match(/https?:\\/\\//)\n url = \"http://#{url}\"\n end\n\n url\n end", "title": "" } ]
[ { "docid": "40b26bbfac2d6a431c9d6bbc7db4361b", "score": "0.8307119", "text": "def normalize_url(url); end", "title": "" }, { "docid": "94f8f3b4f56f349a6f5902348d3476eb", "score": "0.8004657", "text": "def clean_url\n url = self.original_url\n url = url.gsub(' ', '')\n url = ...
03fb4796fc68e9328c1d82321152fe58
Permite que se escolha o layout conforme a action chamada
[ { "docid": "a968fc3d9e4866e4ea3d573a79fe6cf6", "score": "0.0", "text": "def get_layout\n case action_name\n when \"index\", \"hero\", \"fluid\", \"starter_template\"\n \"application\"\n else\n \"application\"\n end\n end", "title": "" } ]
[ { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.79892313", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "b5b44f3d3154fff27ca28652cb6689bb", "score": "0.72754747", "text": "def action_has_layout?\n false\n end", "title": "" }, { "...
a4f4118b597184e73b705a860b1d698f
Returns the sum of the first n prime numbers ==== Attributes +n+ How many primes will be generated and summed. ==== Examples Sum the first 1000 prime numbers increment the action_count by 1 sum_of_primes(1000) => 3_682_913
[ { "docid": "d700a95cbb6814fe5cfd362b3293f593", "score": "0.82358795", "text": "def sum_of_primes(n)\n Prime.first(n).inject(0, :+)\nend", "title": "" } ]
[ { "docid": "b88f0abd01813c8cec30628f66e6b02d", "score": "0.78341544", "text": "def sum_prime(n)\n\ti = 0\n\tp = 1\n\tsum = 0\n#\tprimes = []\n\n\tuntil p == n\n\t\tp += 1\n\t\tif is_prime?(p)\n#\t\t\tprimes << p\n\t\t\tsum += p\n\t\t\ti += 1\n\t\tend\n\tend\n\n\treturn sum\n\t#return primes.reduce(:+)\n...
3a0ff1eb9f246b478221b3f9e779b67e
Config[] returns the value matching the specified environment variable name.
[ { "docid": "06e52d3aadc7fc04e872821e05f8e057", "score": "0.0", "text": "def test_brackets\n set_env('VALUE', 'value')\n assert_equal(Config[:value], 'value')\n assert_equal(Config['VALUE'], 'value')\n end", "title": "" } ]
[ { "docid": "f2746c9620115bd78f99397c357fc4eb", "score": "0.66816145", "text": "def [](name)\n @configs[name]\n end", "title": "" }, { "docid": "f2746c9620115bd78f99397c357fc4eb", "score": "0.66816145", "text": "def [](name)\n @configs[name]\n end", "title"...
cc6514c5b7b9516bef56551765ac0061
Return aggregation counts of the grouped documents. This will count by the first field provided in the fields array.
[ { "docid": "dd6047275a2ef30c88a5181adc870cf9", "score": "0.5856966", "text": "def aggregate\n {}.tap do |counts|\n group.each_pair { |key, value| counts[key] = value.size }\n end\n end", "title": "" } ]
[ { "docid": "9929e8a77629c4c562cca3bef3eb37dd", "score": "0.700089", "text": "def aggregate\n collection.group(options[:fields], selector, { :count => 0 }, AGGREGATE_REDUCE, true)\n end", "title": "" }, { "docid": "f7459189e773a9135d8d859ca0f0ccd0", "score": "0.6880292", "...
446968444e195a94b1f49e502910318e
POST /faculties POST /faculties.json
[ { "docid": "1998a8d585bbf3243abcdd5ac11f926f", "score": "0.5553223", "text": "def create\n @faculty = Faculty.new(faculty_params)\n\n respond_to do |format|\n if @faculty.save\n format.html { redirect_to microposts_path, notice: 'Faculty was successfully created.' }\n else\n ...
[ { "docid": "d907a53f73e255db227e72cd3a8bb5c9", "score": "0.7901842", "text": "def create\n @faculties = Faculty.create!(faculty_params)\n json_response(@faculties, :created)\n end", "title": "" }, { "docid": "5ed4a13f4b0585f9542ef2845cba5dff", "score": "0.69751865", "text": "d...
0e2154c74334f69b745d5174f918eeeb
Conversion celcius en faranheit
[ { "docid": "be0cfabf0ae278c07d8234238a1de6f8", "score": "0.0", "text": "def ctof(tp_c)\n\tf = (tp_c * 9.0/5.0) + 32.0\n f = f.to_f\n return f\nend", "title": "" } ]
[ { "docid": "4d6181ecc680ed8e35995f1ffa5dfa91", "score": "0.7894791", "text": "def convert(fahrenheit)\n celsius = (5 * (fahrenheit - 32))/9\nend", "title": "" }, { "docid": "f2ba21bc32f65210880ef5b3e4a1b33b", "score": "0.78083", "text": "def convert(degrees_fahrenheit)\n celsius = ...
069335d97ff281eed436ada2ec996a30
Copying Identifiers is not allowed.
[ { "docid": "7c512ae532fc426894583c9d088d4216", "score": "0.57103425", "text": "def initialize_copy(other)\n raise TypeError, \"copy of #{self.class} is not allowed\"\n end", "title": "" } ]
[ { "docid": "56952e5210638a2b238a29fe4dfc7ea9", "score": "0.69145817", "text": "def copy\n end", "title": "" }, { "docid": "6d02131462d8b9390c2f4026f6fd311e", "score": "0.6568707", "text": "def copy\n self.public_send('|', 'copy')\n self\n end", "title": "" }, { "d...