query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
83142ae676532ed2bad93c4eb67c8be3
VIF output Kbits/s xenapi: VIF_metrics.get_io_read_kbs
[ { "docid": "36b4f2fe5e448a947666aa103763d67d", "score": "0.70355594", "text": "def io_write_kbs\n ref_call :get_io_write_kbs\n end", "title": "" } ]
[ { "docid": "3434c0e78e07d93b9f0ce2ddacc9478a", "score": "0.78358155", "text": "def io_read_kbs\n ref_call :get_io_read_kbs\n end", "title": "" }, { "docid": "543164fa201315d5cbee3f797c35ceaf", "score": "0.5476362", "text": "def io_stats\n @vm[:netrx] = 0\n @vm[:...
8c6d0ff679938916832f9735d4664e2c
This method is called once for each application and is used to initialize anything that needs to be ready before the application is run, but after the application is setup, i.e. after the user has defined the application class.
[ { "docid": "12a4d3891ee3e24dd54b443572972741", "score": "0.0", "text": "def init\n return if @initialized\n\n @current_command = nil\n @current_param = nil\n @current_global_param = nil\n\n hook :pre_init\n\n debug_flag\n help_command\n ...
[ { "docid": "386f4d4da00237a0c343aef9d475dd5a", "score": "0.7896058", "text": "def init_application\n puts \"Override init_application\"\n end", "title": "" }, { "docid": "b55fc72d72dbce475b1d6cff4a205e9a", "score": "0.75698125", "text": "def init!\n @logger = @config = @...
de3f4c2260e651e37274bc143edc36f0
16.1 Write a function to swap a number in place (without a temp variable)
[ { "docid": "ca6e7d14677755f6815e97471be058f4", "score": "0.7048062", "text": "def num_swapper(num1,num2)\n\tnum1 = num2 + num1\n\tnum2 = num1 - num2\n\tnum1 = num1 - num2\n\t[num1, num2]\nend", "title": "" } ]
[ { "docid": "39fe2091baa2acf8d1b628c84d888706", "score": "0.79215026", "text": "def swap_num(a,b)\n a = a + b\n b = a - b\n a = a - b\n return a, b\nend", "title": "" }, { "docid": "a313eb5f38ac4d3adb63a5e2b432a49b", "score": "0.7791944", "text": "def swap(new_value); end", "...
27239d6d545cc411fe04d18c5adf4b5d
Return the AMEE::Admin::ItemDefinition object associated with self
[ { "docid": "62bb8b1b79c515ed6108b299ad5cb27f", "score": "0.66612786", "text": "def amee_item_definition\n @amee_item_definition||=amee_data_category.item_definition\n end", "title": "" } ]
[ { "docid": "cebb6e8c2be86e38f3e481731f6a047d", "score": "0.60064477", "text": "def item\n @item ||= item_class.where(id: item_id).first if item_class\n end", "title": "" }, { "docid": "097e6ef514f6bc8fa64e2e4838fbbb00", "score": "0.58305216", "text": "def item\n IITEQPre...
28e3e066062cec272cb6181ff7565079
PATCH/PUT /results/1 PATCH/PUT /results/1.json
[ { "docid": "9a7102590b0620d78e37dbdb1a112cc5", "score": "0.0", "text": "def update\n respond_to do |format|\n if @result.update(result_params)\n @@newest_updated_at = @result.updated_at.to_i ### update when there is an updated Result\n @@newest_id = @result.id\n format.h...
[ { "docid": "2a16f2ae6293c98101e58fc71c9d95db", "score": "0.6633545", "text": "def update!(**args)\n @results = args[:results] if args.key?(:results)\n end", "title": "" }, { "docid": "2a16f2ae6293c98101e58fc71c9d95db", "score": "0.6633545", "text": "def update!(**args...
2573138fa3d7affb1d2957cf27618e51
PUT /login_users/1 PUT /login_users/1.json
[ { "docid": "61cdea6ab3f787ba0b59a1afc17cf97c", "score": "0.65465045", "text": "def update\r\n @login_user = LoginUser.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @login_user.update_attributes(params[:login_user])\r\n format.html { redirect_to @login_user, notice: 'Login use...
[ { "docid": "0b4c2960540c3a0c5e7102619705473d", "score": "0.68488556", "text": "def update_user( name, data )\n response = put(\"#{@config['url']}/api/2.1/rest/users/#{name}\", data, {accept: :json, :cookies => cookies})\n return response.code\n end", "title": "" }, { "docid": "b...
6b6f267b4d7610ed9a4bb7ccb9f8e2de
Convience for getting element blueprints
[ { "docid": "64aa48762d960c7b4cea266aee8bcae6", "score": "0.70227385", "text": "def element_blueprints(composite_object = nil)\n composite_object ||= self\n\n # Traverse!\n return composite_object.elements[element_name] if composite_object.hash[:elements].is_a?(Hash)\n\n ...
[ { "docid": "0ba94c3af3716e1cb0272232d9e6da97", "score": "0.6136598", "text": "def blueprint(attributes)\n attributes.each do |attribute, value|\n blueprint_attribute attribute, value\n end\n end", "title": "" }, { "docid": "6fecbbc16e9d4232a4e5ecfc3c550c2f", "score": ...
9712ccef46f792eaac70fd5a59db2c07
Build an instance of SubscribeRulesInstance
[ { "docid": "ba2a6542ff7bfbf71ddc03ae993f238d", "score": "0.69717485", "text": "def get_instance(payload)\n SubscribeRulesInstance.new(\n @version,\n payload,\n room_sid: @solution[:room_sid],\n participant_sid: @s...
[ { "docid": "74b48416122fd211c622c5cb21c59dce", "score": "0.6817416", "text": "def get_instance(payload)\n SubscribeRulesInstance.new(@version, payload, room_sid: @solution[:room_sid], participant_sid: @solution[:participant_sid])\n end", "title": "" }, {...
fb28b3464f9ba2a5ba6270cfe4eb7845
Nasconde tutte le finestre informative
[ { "docid": "12cbb02cf6c16a51a378868997178a72", "score": "0.0", "text": "def hide_all_windows\n @help_window.visible = false\n @c_help_window.visible = false\n @overview_window.visible = false\n @role_window.visible = false\n @params_window.visible = false\n @states_window.visible = fal...
[ { "docid": "f7583c8e0bedf2c9cc858efcc677fca6", "score": "0.65361387", "text": "def autocomplexes_ensnare()\n unverifiedness_acception(disacquaintance, thule_convulsionism, arracach_fantigue)\n end", "title": "" }, { "docid": "4b4c31d84039944c5df3f5b1cc980d79", "score": "0.6218978...
89ef831d51c081d914a4807770d639da
Removes the weird unicode character from the MediaElement source files.
[ { "docid": "6f05e38cc2779e0e333af5d4f51f2d7f", "score": "0.65094095", "text": "def remove_weird_characters(content)\n content.force_encoding('utf-8').gsub //, ''\n end", "title": "" } ]
[ { "docid": "f8502ff0b2690ec37a5f47bd20eaf893", "score": "0.6769328", "text": "def sanitized\n @filename.encode(Encoding::UTF_8, invalid: :replace, undef: :replace, replace: \"�\").strip.tr(\"\\u{202E}%$|:;/\\t\\r\\n\\\\\", \"-\")\n end", "title": "" }, { "docid": "ec5247252bcaaabbbfa099d...
5d217b3077f3ae55c097befe043f34d1
create a new list or subject
[ { "docid": "d18231217006d43b95a653ae147042e9", "score": "0.60022366", "text": "def new\n @subject = Subject.new(:name => 'default')\n end", "title": "" } ]
[ { "docid": "f91fe8f0be89c1c26200096509f8d0fe", "score": "0.7022618", "text": "def create_personal_list\n list_name = \n if self.name; \"#{self.name}'s list\"\n elsif self.crsid; \"#{self.crsid}'s list\"\n else; \"Your personal list\"\n end\n list = List.create! :name => list_name...
0660a5a1f84111c1c3db813b841d0bd9
The key to this is finding out where to stop the search. I first tried the first 50,000 of each number but there were no more solutions. There is with 100,000, however.
[ { "docid": "a21bf5c8860f9e38965d7d02349b8d08", "score": "0.0", "text": "def triPentHexFinder\n\n#Using sets makes this brute force solution -- ridiculously slow using \n#arrays -- extremely fast -- finds solution in 2.9 seconds.\n\nrequire 'set'\n\ntriangulars = (1..100000).map { |n| n*(n+1)/2}.to_set\n...
[ { "docid": "fdc0ed5a4d24128225ab0238dbf4bebd", "score": "0.7188839", "text": "def search( num_to_find )\n $n.each do |num|\n $o_count += 1\n\n $n.each do |another_num|\n $o_count += 1\n break if another_num == num_to_find\n end\n\n break if num == num_to_find\n end\nend", "ti...
e3ac3931343ff2a153d921b7e0fcd5bb
Change colors of the tree and its subtrees
[ { "docid": "1527dd144f4d78c21a76ed63ff49b2c8", "score": "0.0", "text": "def flip_colors(x)\n x.flip\n x.childs[0].flip\n x.childs[1].flip\n end", "title": "" } ]
[ { "docid": "09d2f83b6308641928629c746731ac3e", "score": "0.6962152", "text": "def recolor(grandfather)\n grandfather.left.color = :BLACK\n grandfather.right.color = :BLACK\n if @root != grandfather\n grandfather.color = :RED\n end\n\n try_rebalance grandfather\n end", "title": "...
148cb45c583a6a256648d463c447903c
gets status of appliance
[ { "docid": "76c15aea4a48a0ea461bb1c3031a51b1", "score": "0.7855293", "text": "def status\n my_status = Status#.dup FIXME this doesn't work well with AciveResource :(\n my_status.studio_connection = self.class.studio_connection\n #rails is so smart, that it ignores prefix for calls. At lea...
[ { "docid": "d820409351faffa3ecccaeb6d588ec44", "score": "0.713851", "text": "def xaui_status; get(9); end", "title": "" }, { "docid": "fa3f827f2aea20d3c40062e5b880fc37", "score": "0.708267", "text": "def application_status\n self[:status]\n end", "title": "" }, { "doc...
3152309e6dadde007ad869bdd007278a
We're converting to a string here because postgres will return the aliased association key in a habtm as a string (for whatever reason)
[ { "docid": "dceca2fc38cd7c9c039ef2f0cf95fb96", "score": "0.0", "text": "def owners_by_key\n @owners_by_key ||= owners.group_by do |owner|\n key = owner[owner_key_name]\n key && key.to_s\n end\n end", "title": "" } ]
[ { "docid": "3458a71aaec781f30787622dca003bde", "score": "0.67163616", "text": "def association_key_name; end", "title": "" }, { "docid": "3458a71aaec781f30787622dca003bde", "score": "0.67163616", "text": "def association_key_name; end", "title": "" }, { "docid": "10f23351...
845694f52a6bc8687ddd68ffcd3cf348
List all account types List all account types defined for your firm.
[ { "docid": "9d471c0df550051eb4879a4e139a601c", "score": "0.63022816", "text": "def get_account_type_all_using_get(opts = {})\n data, _status_code, _headers = get_account_type_all_using_get_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "75aa23b4e8a75c6d5ca259c14333a3d7", "score": "0.7107877", "text": "def list_account_types\n\treturn if authorise_for_web(program_name?,'read') == false \n\n \tif params[:page]!= nil \n\n \t\tsession[:account_types_page] = params['page']\n\n\t\t render_list_account_types\n\n\t\t return \n\tels...
84e8ac9fca6fe9eba6680b1ea7c60626
[0, 10, 43, 2] [0, 10], [43, 2] [0], [10], [43], [2] [0, 10], [2, 43] [0], [10], [2, 43] [0, 2], [10], [43] [0, 2, 10], [43] [0, 2, 10, 43]
[ { "docid": "3ddfd08665bb302403ea33b4fd7f4590", "score": "0.0", "text": "def merge_sort(array_of_ints)\n \n array_length = array_of_ints.length \n \n return array_of_ints if array_length === 1\n\n right_array = array_of_ints[0..(array_length/2-1)]\n left_array = array_of_ints[array_length/2..(arra...
[ { "docid": "e9d21a50077a6c87c62722527d7d338f", "score": "0.6202866", "text": "def subsets(arr)\n return [[]] if arr.empty?\n\n result = []\n subs = subsets(arr[0..-2])\n number = arr[-1]\n subs.each do |el|\n result << el.dup + [number]\n end\n subs + result\nend", "title": "" }, { ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8398946da5506f99650481bb8a7e9b22", "score": "0.0", "text": "def set_admin_device\n @utility_id = City.find(session[:current_city_id]).utility.id\n @admin_device = Device.find(params[:id])\n @device_type = @admin_device.device_type\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...
69beaa3e957d1fc356539d0314d703e1
Custom attribute writer method checking allowed values (enum).
[ { "docid": "a27dad5a5efac2afdabaf7cbdf88fd9e", "score": "0.0", "text": "def privacy=(privacy)\n validator = EnumAttributeValidator.new('String', [\"private\", \"friends\", \"public\"])\n unless validator.valid?(privacy)\n fail ArgumentError, \"invalid value for 'privacy', must be one of...
[ { "docid": "af6d0e33773bc681443214ce777b13e1", "score": "0.7088127", "text": "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "title": "" }, { "docid": "85eec95603dc239e3d18923b2c672b31", "score": "0.6482...
1b8eb7abffa9864e8936812afefa77a6
sprawdza czy projekt jest aktywny, zwraca(true|false)
[ { "docid": "9c0e9dfc8ee5d94a22df3a7801318a00", "score": "0.0", "text": "def active?\n return self.status == STATUSES[:active] ? true : false\n end", "title": "" } ]
[ { "docid": "b5ca9d3e752c1a52bc9a38c9a5049b9a", "score": "0.7163666", "text": "def nalezy_do_pytania_wielokrotnego_wyboru?\r\n pytanie.wielokrotnego_wyboru?\r\n end", "title": "" }, { "docid": "a9715d428bfdb7e668645240f282d1fa", "score": "0.70747876", "text": "def estTerritoire\n\...
65f010c971fb651a8cc65210423b8a66
Creates a new angle using the sexagesimal system.
[ { "docid": "663d776924f83f0a6c4fd708b9382e92", "score": "0.0", "text": "def initialize(degree, arcminute=0, arcsecond=0)\n @degree = degree\n @arcminute = arcminute\n @arcsecond = arcsecond\n end", "title": "" } ]
[ { "docid": "d7855895aa092937caec6fac92c7dcb3", "score": "0.5547934", "text": "def angle(x1, y1, x2, y2)\n end", "title": "" }, { "docid": "1a1a8e78e782afda0f9b9c160a458386", "score": "0.5501689", "text": "def angle_a\n Angle.new(\n self,\n :a,\n (\n...
2ce3788b51f9acf59f8d9d53d695ad9f
Assign an identifier from the model sequence to the invoice if the invoice state is not pending.
[ { "docid": "44c10929d47e716687637afb192da83c", "score": "0.0", "text": "def assign_identifier\n if generated?\n super\n end\n true\n end", "title": "" } ]
[ { "docid": "8f558589c2a6ccc7c3279bcc37dc64c9", "score": "0.73228467", "text": "def assign_invoice_number\n \t\t# wrap in a transaction to prevent race conditions\n Invoice.transaction do\n if draft\n self.number = nil\n elsif self.number.nil?\n self.number = series....
47a3fc732fb3a210e59855ad6c25cfc8
A short version of a long path
[ { "docid": "fd4c5922603294a04c88f4b2b662dccd", "score": "0.71536213", "text": "def shortpath(fullpath)\n components = Pathname(fullpath).each_filename.to_a\n return fullpath if components.size <= 2\n\n File.join(\"...\", components[-3..-1])\n end", "title": "" } ]
[ { "docid": "8edccda20a250ba9350bfac8741c768d", "score": "0.81111926", "text": "def long_path_to_short_path(long_path)\n return long_path\n end", "title": "" }, { "docid": "8edccda20a250ba9350bfac8741c768d", "score": "0.81111926", "text": "def long_path_to_short_path(long_...
122dacf01d0f1bf45afcee69ac6453b2
For all buckets for all dates in the configured range download the available log files. After downloading, merge the log files and convert the format from Amazon Log Format to Apache Common Log Format.
[ { "docid": "35f22d81e5caa5a0ae933e20bedb49b3", "score": "0.58135784", "text": "def run(output_file = nil)\n config.output_file = output_file unless output_file.nil?\n \n raise ArgumentError.new(\"--output-file required\") if config.output_file_missing?\n raise ArgumentError.new(\"--output-fi...
[ { "docid": "f4e471dd860595d4a144a74f37d0d537", "score": "0.6750687", "text": "def get_logs(from_prefix_date: nil)\n batch_user = User.use_batch_user(Settings.bulk_msg_app) if Settings.bulk_msg_app\n m = Settings.bulk_msg_master\n m.current_user = batch_user\n\n bucket = Settings::Def...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "dbb13ab69a693af058195b62e4bab004", "score": "0.0", "text": "def cartao_params\n params.fetch(:cartao, {}).permit(:proxy, :pin, :time, :numero, :validade, :cvv)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "...
f1f5baa8b45c66ead1e8e0bbb2f509e3
IP Addresses are obscured when they are saved to VCR. This may fail on the first recording.
[ { "docid": "f79557426fd5dea8a685fab7fa8a2663", "score": "0.0", "text": "def check_obscured_ip(resource, method, address)\n expected = address.match?(/127.0.0/) ? address : \"127.0.0.#{address.split('.')[-1]}\"\n actual = resource.send(method.to_sym)\n expect(actual).to eq(expected), \"Obscured ...
[ { "docid": "9b78b569c55e41733a65397bdb466fbd", "score": "0.6740358", "text": "def ip_addresses; end", "title": "" }, { "docid": "9b78b569c55e41733a65397bdb466fbd", "score": "0.6740358", "text": "def ip_addresses; end", "title": "" }, { "docid": "429706e5bbb99496b02d841422...
c23ac1c7295a9da7f6e48b97a49e21fa
GET /node_group_node_assignments GET /node_group_node_assignments.xml
[ { "docid": "88831de7668acf1d9b1a806be00ce1b0", "score": "0.0", "text": "def index\n ## BUILD MASTER HASH WITH ALL SUB-PARAMS ##\n allparams = {}\n allparams[:mainmodel] = NodeGroupNodeAssignment\n allparams[:webparams] = params\n results = Search.new(allparams).search\n\n flash[:error]...
[ { "docid": "b53aa5bbaeaea589489e5317580fd9d3", "score": "0.6098222", "text": "def assignments\n begin\n display_options = {:except =>[:user_id], :include => {:user => {:except => [:undoable_date]}}}\n user = User.find(params[:id])\n result = user.get_assignments\n generate_respons...
9e7cfae34cbd9587071ac244e6b3fbeb
Remembers a user in the database for use in persistent sessions.
[ { "docid": "bca35c7993389739562d684900f1cf1b", "score": "0.0", "text": "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "title": "" } ]
[ { "docid": "2851e427c467049c7639c468daea3c35", "score": "0.672182", "text": "def reload_user\n @user = User.find(session[:user][:id])\n end", "title": "" }, { "docid": "96a75f37098f9b5db8b7c451f485268e", "score": "0.6602522", "text": "def check_new_or_reseted_user\n begin\n ...
8ec0c118c065365f0cfb17e9b101afaa
Redo the last action that was undone.
[ { "docid": "73471ad8005781fc8399ac308bc98adb", "score": "0.77208585", "text": "def redo\n raise \"Can't redo if there are no commands in the future\" unless can_redo?\n\n @last_done += 1\n @actions[@last_done].do\n\n nil\n end", "title": "" } ]
[ { "docid": "04f39168357b8fdbb23b53732ec203d5", "score": "0.77955145", "text": "def redo\n $log.debug \"UNDO GOT REDO call #{@pointer}, #{@actions.size} \"\n return if @pointer >= @actions.size\n @reject_update = true\n edit = @actions[@pointer]\n perform_redo edit\n @sourc...
a8e52bdce21b390755a13b3972b6ba0b
Make sure the owner's name is present.
[ { "docid": "f40838a6de9bd99808cf6f2c93caddad", "score": "0.0", "text": "def extension\n File.extname(file.to_s)\n end", "title": "" } ]
[ { "docid": "361bf0054945c1ca014c5eb86fc41a01", "score": "0.7372517", "text": "def set_owner=(owner_name)\n\t\t@owner_name = owner_name\n\tend", "title": "" }, { "docid": "361bf0054945c1ca014c5eb86fc41a01", "score": "0.7372517", "text": "def set_owner=(owner_name)\n\t\t@owner_name = o...
3a64f29f35cbace38e80754ebb5c6078
Test to ensure that valid method returns true if the object is valid and false, if not
[ { "docid": "8179eff557358b89076e40fe48d76845", "score": "0.0", "text": "def test_valid\n pasta = Food.new\n\n assert_equal(false, pasta.valid?)\n\n pasta.name = \"pasta\"\n assert_equal(false, pasta.valid?)\n\n pasta.category_id = 4\n assert_equal(true, pasta.valid?)\n\n pasta.name ...
[ { "docid": "7052c0036facae7492c10b9f00badf2e", "score": "0.8270148", "text": "def valid?\n @object.validate! rescue false\n end", "title": "" }, { "docid": "3ee19b5fe46408415f06a6b9b6c61b25", "score": "0.8143405", "text": "def valid?\n end", "title": "" }, { "d...
80af7a54b9b08349cd1398dbe40fc122
Returns a http URI path to the cloudcmd api link
[ { "docid": "e3be16cc05b9b536b82668811a94c406", "score": "0.0", "text": "def api(path)\n OodAppkit.files.api(path: path).to_s\n end", "title": "" } ]
[ { "docid": "5d947742959cf5474f63953a7c94243c", "score": "0.71716213", "text": "def command_uri\n return \"/api_#{@command_name}.php\"\n end", "title": "" }, { "docid": "8db98b914f27b6bafaaeab47ede84eef", "score": "0.7091585", "text": "def url(path)\n \"#{API}/#{p...
e24a1c282e5905a05264dec8abc67981
Element reference operator returns the ith element of the quaternion.
[ { "docid": "ecd9ae98f9a86147edc2cc523318f2b2", "score": "0.59325564", "text": "def [](i)\n @elem[i]\n end", "title": "" } ]
[ { "docid": "27b4f6dc52099100cab97cb6baea0e7d", "score": "0.6160445", "text": "def element\n @collection[index]\n end", "title": "" }, { "docid": "ff47222dc04832e9a2d07431b437f7b6", "score": "0.5977753", "text": "def [](i)\n @elements[i]\n end", "title": "" }, { "d...
f43fe1ac99313ea79e5ac430950ff07c
Wrapper function for delete requests, just provide a uri and it will return you a hash with the result data. For authenticated transactions a token can be provided. Implemented using the do_request method.
[ { "docid": "03259ca6b330b836f028099080e8488b", "score": "0.76764524", "text": "def delete_request(uri, token = nil, manage_errors = true)\n request = Net::HTTP::Delete.new(uri.request_uri, initheader = build_headers(token))\n return do_request(uri, request, manage_errors)\n end", "title...
[ { "docid": "d1ff548ed3e9718773ea22feed24a042", "score": "0.8070062", "text": "def do_delete(uri = '')\n build_request(:delete, uri)\n end", "title": "" }, { "docid": "c0f838ca4f15f99419e0f75c957c442b", "score": "0.7785954", "text": "def delete(uri, params = {}, env = {}, &blo...
a5a581b897d6b7ce92482bab8b4715c4
GET /broadcaster/avatars GET /broadcaster/avatars.json
[ { "docid": "1abfcff440ed66051bbbbd51d385ae57", "score": "0.78233296", "text": "def index\n @broadcaster_avatars = Broadcaster::Avatar.all\n end", "title": "" } ]
[ { "docid": "5a3a94116dcb9a6b12651f2f4cee9fc3", "score": "0.7145223", "text": "def avatars\n Hashie::Mash.new(@profile['avatars'])\n end", "title": "" }, { "docid": "f29fab41b09ef3e25aeb9e552e1ebecb", "score": "0.70332205", "text": "def avatars\n # has_many_attached :avat...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ec7f6a4e6ebdb5172c5a27eaf14d135d", "score": "0.0", "text": "def iso_params\n params.require(:iso).permit(:title, :tage)\n end", "title": "" } ]
[ { "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...
78b4a743f33016081af0e76c966fa910
POST /stars POST /stars.json
[ { "docid": "e6d2e5c93c0221b1600c61d9b3f6f736", "score": "0.7397493", "text": "def create\n @star = Star.new(star_params)\n \n respond_to do |format|\n if @star.save\n format.html { redirect_to @star, notice: 'Star was successfully created.' } \n format.json { render :show, st...
[ { "docid": "81eb377c0f11f7254cb6b028cf682697", "score": "0.7615747", "text": "def create\n @star = Star.new(star_params)\n\n respond_to do |format|\n if @star.save\n format.html { redirect_to @star, notice: 'Starred post was successfully created.' }\n format.json { render :show,...
90a92ea04b04f6204f4686b195c9f4e4
sends password reset email
[ { "docid": "1008405eff6cc9b8520be790a23719e9", "score": "0.8285711", "text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver_now\n end", "title": "" } ]
[ { "docid": "9386648226fa7a852de05c6bc29cd4a1", "score": "0.8636564", "text": "def send_reset_password_instructions\n token = set_reset_password_token\n send_reset_password_instructions_email(token)\n end", "title": "" }, { "docid": "cc5d17d3ec081198f09212efdf4cae75", "score": "0.8...
71dee59b40cada414713b601890c8d38
This function renders a list of Current ClubcOfficers.
[ { "docid": "f5a580f5b40b4b0e6660d30cbf3a4723", "score": "0.5980574", "text": "def render_offices(officers)\n if !officers.empty?\n render :partial => \"member_officers\",\n :locals => { :member_officers => officers }\n end\n end", "title": "" } ]
[ { "docid": "aabeb07ec3e9e63563dd9316fef09312", "score": "0.71963066", "text": "def render_officer_list(officers)\n (officers.map { |o| render_officer_entry(o,edit_club_officer_path(o))}).join\n end", "title": "" }, { "docid": "ad89c51d0fe1a12659bf933c40c39134", "score": "0.6667064", ...
2dd3133dd80e0663534ec217951d99fb
Create a pdf file of a job's details.
[ { "docid": "345db0073d4440cf58894c82a591d728", "score": "0.61404043", "text": "def create_pdf_file\n pdf = Prawn::Document.new(:page_size => \"LETTER\", :margin => 50)\n font_dir = \"#{Rails.root.to_s}/public/fonts\"\n pdf.font_families.update( \"olb_font\" =>\n { :nor...
[ { "docid": "3e6b42db9a84522e7a59c3bd85e7da85", "score": "0.76334363", "text": "def print_job_details\n @jobs = Job.all\n html = render_to_string(:layout => false, :action => \"print_job_details.html.erb\")\n kit = PDFKit.new(html)\n send_data(kit.to_pdf, :filename => 'Help_List.pdf', :type =...
81274a274984ece6d5e828d721be9591
note that xcoord corresponds to the column idx note that ycoord corresponds to the row idx
[ { "docid": "26651f4ddbb8a6c60fb28b6d6f6a1015", "score": "0.0", "text": "def draw_grid_cells\n x_iter.each do |column_id|\n y_iter.each do |row_idx|\n field = @game.map.field_at(column_id, row_idx)\n if field.drawable?\n x0 = (column_id - 1)*cell_size\n y0 = (row_i...
[ { "docid": "a17217e4795321f0349394a5bd80c2ec", "score": "0.7834964", "text": "def coordinates_xy ; return [@ind_x, @ind_y] end", "title": "" }, { "docid": "ed2e497f2c31005231092f1ea166b2c2", "score": "0.72707903", "text": "def pos(x,y)\n (x*@cols)+y\n end", "title": "" }, ...
8b2d3d610922ebd954d04af030afbdbd
Check if a move is valid
[ { "docid": "0167adbb07ec81aa7df8399efbbb23aa", "score": "0.7954308", "text": "def valid_move? move\n @board[move] == PIECE[:blank]\n end", "title": "" } ]
[ { "docid": "5e5c96edd08bc6e063d1409a699bf0fb", "score": "0.8495058", "text": "def invalid_move?\n @move.nil? && @moves.blank?\n end", "title": "" }, { "docid": "4afe6e2aa8fb73a13a8885f993404d0e", "score": "0.84726477", "text": "def check_validmove\n unless self.piece.v...
0787e546030858ae887a57b75716b480
fires an user event
[ { "docid": "61b9a750f3da7abebd752dc7786a8aa5", "score": "0.0", "text": "def event(name, payload = nil, coalesce = true)\n event = {\n 'Name' => name,\n 'Coalesce' => coalesce\n }\n event['Payload'] = payload unless payload.nil?\n request(:event, event)\n end", "t...
[ { "docid": "6282f5f82210b1978b2c5fc3f64c1f78", "score": "0.75094956", "text": "def userEvent(event)\n end", "title": "" }, { "docid": "9b27ac407cd2748db0014b2d92afbe44", "score": "0.68420947", "text": "def record_event\n event = {\n type: 'user',\n USER_ID: self.id\n ...
4b70242a4f9afc93f73bd29b5e8d48b0
POST /enginemodels POST /enginemodels.json
[ { "docid": "ed14f094e640ebaf594894ef88333a02", "score": "0.680565", "text": "def create\n @enginemodel = Enginemodel.new(enginemodel_params)\n\n respond_to do |format|\n if @enginemodel.save\n format.html { redirect_to @enginemodel, notice: 'Enginemodel was successfully created.' }\n ...
[ { "docid": "785a4c142e19dfa59d4cf5c7b3ea1f2e", "score": "0.7030358", "text": "def create\n @engine_model = EngineModel.new(params[:engine_model])\n\n respond_to do |format|\n if @engine_model.save\n format.html { redirect_to @engine_model, notice: 'Engine model was successfully created...
050f95a49890e2f700575a58bc12b05a
the problem here is that we need deciders to differentiate between contexts (e.g. signed_in?) that we actually already know, e.g. Create::SignedIn knows it is signed in. Idea: Thing::Policy::Update.()
[ { "docid": "88e67a4d8b8ab788358b8ebe31adea7f", "score": "0.0", "text": "def update?\n edit?\n end", "title": "" } ]
[ { "docid": "6b96f053240ac57a7cfe806eb6a87ebd", "score": "0.6270871", "text": "def policy_class\n UserPolicy\n end", "title": "" }, { "docid": "1d682b9a076f9e6ccdbd44154e14a119", "score": "0.62164277", "text": "def policy_scope(*args)\n super\n end", "title": "" }, ...
09dad3a21d6ae9c19b7f3a01db08a098
Encode URI while leaving slashes intact
[ { "docid": "33ff2617ce7e4f9d5dd1934791592c6c", "score": "0.86663556", "text": "def encodeURI(uri)\n encodeURIComponent(uri).gsub('%2F', '/')\n end", "title": "" } ]
[ { "docid": "00be1c553ec108a81149e36f85b9a433", "score": "0.82711196", "text": "def escape_uri(s); Rack::Utils.escape(s); end", "title": "" }, { "docid": "9ec7813ded1a6e14f778e58e3a06fef2", "score": "0.826515", "text": "def escape_uri(str)\n str = str.dup\n str = binary_enco...
d04dcc681d7ae074c35807e307a9177e
melee attack apply used with invoked tools
[ { "docid": "684afbd3397a39b6f19b57aa8dd4d1df", "score": "0.76861924", "text": "def melee_attack_apply(user, item_id)\n item_apply(user, $data_skills[item_id])\n end", "title": "" } ]
[ { "docid": "817ea5dccecfd8e055fdc1a67eb0134f", "score": "0.7313902", "text": "def attack_apply(attacker, item)\n item_apply(attacker, $data_skills[attacker.attack_skill_id], item)\n end", "title": "" }, { "docid": "436e10cbbb099c45d66f86a29925d4c6", "score": "0.7088257", "text": ...
a0d9cbe254fe438932f80674a8a93211
Time to display this frame, in seconds
[ { "docid": "9d0b89fcab87e5788273802755130dc8", "score": "0.0", "text": "def delay\n return @delay unless @delay.nil?\n @delay = (delay_num / (delay_den == 0 ? 100.0 : delay_den))\n @delay\n end", "title": "" } ]
[ { "docid": "e2c8640b22e796167a6685dc1964bf4e", "score": "0.78694993", "text": "def playtime\r\n Graphics.frame_count / Graphics.frame_rate\r\n end", "title": "" }, { "docid": "8af80381fafcfeaee8b17737dfd1a4c6", "score": "0.73860586", "text": "def frames_per_second; 1 / frame_time...
69e3803c17a033b8898cb440d472fc00
callseq: conn.escape_bytea( string ) > String Connection instance method for versions of 8.1 and higher of libpq uses PQescapeByteaConn, which is safer. Avoid calling as a class method, the class method uses the deprecated PQescapeBytea() API function. Use the instance method version of this function, it is safer than ...
[ { "docid": "11369cb0b4df9400fba45f6cdc9ae2f0", "score": "0.8428743", "text": "def escape_bytea(str)\n from_len = str.length\n to_len = FFI::MemoryPointer.new(:int)\n\n to = Libpq.PQescapeByteaConn(pg_conn, str, from_len, to_len)\n\n ret = to.get_bytes(0, to_len.read_int - 1)\n L...
[ { "docid": "c0c1e5bc53776f1ae6083ce91ba400df", "score": "0.8667788", "text": "def escape_bytea(str)\n- PGconn.escape_bytea(str)\n+ PG::Connection.escape_bytea(str)\n end", "title": "" }, { "docid": "2c9e0f782e9f26db7e5f872909039a21", "score": "0.7814516", ...
b33e8ba043dc6a77b4423b3af67ae194
Builds the object from hash
[ { "docid": "d14938d63ed3d118e3cf7c35df449ae9", "score": "0.0", "text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /\\AArray<(.*)>/i\n # check to ensure the input is an array given ...
[ { "docid": "e2e77e3d4692b97a7841734d5d35a0ec", "score": "0.75690323", "text": "def from_hash(hash); end", "title": "" }, { "docid": "e2e77e3d4692b97a7841734d5d35a0ec", "score": "0.75690323", "text": "def from_hash(hash); end", "title": "" }, { "docid": "e2e77e3d4692b97a78...
b7c971dbacf0b82dd8c4c11bd4c15976
Returns an array of events that are permitted for this item in the context of a given order
[ { "docid": "98c2eb7c61854243a22876b60bdc9985", "score": "0.7722414", "text": "def available_events_for_order(order_id)\n item_order = item_orders.where(order_id: order_id).first\n events = []\n if item_order && !obsolete\n order = item_order.order\n\n if (order.open || order...
[ { "docid": "3bc685f33f3729ef3daa427f563ef437", "score": "0.6008843", "text": "def events(order_id, params = {})\n response, status = BeyondApi::Request.get(@session, \"/orders/#{order_id}/events\", params)\n\n handle_response(response, status)\n end", "title": "" }, { "docid": "...
a5113789129433bd5736c019efcd0bb8
supported types are: :array :hash :date :time :time_of_day :null :float :integer :decimal :boolean :string :symbol
[ { "docid": "d1a43d7f99390053cef9e0cbcf01dd39", "score": "0.0", "text": "def klass(type)\n # wonderful world of Ruby - get a class from its name\n Module.const_get(\"CX::CSV::Field::#{type.to_s.camel_case}\")\n end", "title": "" } ]
[ { "docid": "4632da9ae10430344edf33212a6d558f", "score": "0.65689325", "text": "def value_types; end", "title": "" }, { "docid": "c5bb048b72f91c12536b8bd478baa8e0", "score": "0.63726836", "text": "def convert_to_ruby_types(hash) \n hash.keys.each do |key|\n value = hash[key]\n ...
b4770886eea52b50fd1fc1529a6a345b
GET /competition_interaction_observations/new GET /competition_interaction_observations/new.json
[ { "docid": "3df545302e17d6bd4f3061f76dcc87b2", "score": "0.7967428", "text": "def new\n @competition_interaction_observation = CompetitionInteractionObservation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @competition_interaction_observation }...
[ { "docid": "22394725fbd12ef7691da65e9538c747", "score": "0.70133495", "text": "def new\n @interaction_log = InteractionLog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interaction_log }\n end\n end", "title": "" }, { "docid": "...
ee370ac90c01c2862b69b4f45f27554c
Deregisters the supplied session object with the framework.
[ { "docid": "2180a2a3e937f154f974740612da1850", "score": "0.7314774", "text": "def deregister(session, reason='')\n\n\t\tif (session.dead? and not self[session.sid.to_i])\n\t\t\treturn\n\t\tend\n\n\t\t# Tell the framework that we have a parting session\n\t\tframework.events.on_session_close(session, reas...
[ { "docid": "247cfe96736c11b558f0461d46c9b365", "score": "0.81539243", "text": "def unregister(session)\n @registry.delete(session)\n end", "title": "" }, { "docid": "5e54d2d40db3c4bebab8cbd0ee56f779", "score": "0.7757923", "text": "def deregister(session)\n\t\t# Tell the framewor...
38723ac10d6d9eac3e4ca8fb34ff4cea
Get a random French SIREN number. See more here
[ { "docid": "86c03df464321eef06615c0642327e3f", "score": "0.0", "text": "def siren\n base = FFaker.numerify('########')\n base + luhn_check(base).to_s\n end", "title": "" } ]
[ { "docid": "864d4b1de71e137159adbf01354cf78f", "score": "0.69792724", "text": "def random\n %w[sí no].sample\nend", "title": "" }, { "docid": "bedae1cb4923997d7419f27b533de4ed", "score": "0.68184376", "text": "def french_insee_number\n num = [\n [1, 2].sample(random:...
2690623fb249621712425f242debdd40
GET /voters/1 GET /voters/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b6f32c3dbfce31da8983225b53526d72", "score": "0.7624258", "text": "def index\n @voters = Voter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @voters }\n end\n end", "title": "" }, { "docid": "d96a7b3e154da39d14c2c87f...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "9a580c29dbb177c2651da8670ff007ca", "score": "0.0", "text": "def vehiclebrand_params\n params.require(:vehiclebrand).permit(:name)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "...
ab6c7da398b76057300b96031a9d8bd0
The preamble assigns all the ignored variables to an escaped version of the variable name itself, e.g. $foo: \$foo; This makes Sass replace occurences of the variable with the escaped name. Afterwards, the escaped names can be unescaped, yielding a CSS file with the ignored variables intact. Returns a String preamble.
[ { "docid": "6454590c7c23ca106180f9577a14fabb", "score": "0.811491", "text": "def preamble\n @ignored_variables.\n map {|name| escape_variable(name) }.\n join(\"\\n\")\n end", "title": "" } ]
[ { "docid": "087094f6a3e6bd80f8e2c1819095d200", "score": "0.642645", "text": "def static_preamble\n preamble = []\n\n unless ONLY_ASCII_IDENTS\n preamble << \"#![feature(non_ascii_idents)]\"\n end\n\n preamble.join(\"\\n\")\n end", "title": "" }, { "docid": "c7da72c6d6fadb7b...
39b8abe05203c633242c707e978be19f
Allows the setting of the foreground colour by coercing the given value into a Vedeu::Colours::Foreground colour.
[ { "docid": "1e06cfad5060f0f270a8f6f28745acf7", "score": "0.8709519", "text": "def foreground=(value)\n @colour = attributes[:colour] = Vedeu::Colours::Colour.coerce(\n background: colour.background,\n foreground: Vedeu::Colours::Foreground.coerce(value))\n end", "title"...
[ { "docid": "5010938fa10e19736803dbc17f7fe6ee", "score": "0.88630617", "text": "def foreground=(value)\n @foreground = Vedeu::Colours::Foreground.coerce(value)\n end", "title": "" }, { "docid": "e9fe4150b09b24fee41d58f80c83d7d3", "score": "0.8799674", "text": "def foregrou...
d448801ad5816c5b92bb3a6ad203a534
Introduces a registration step whenever the +registration_step+ preference is true.
[ { "docid": "daaaeb631769688fe45ede7e6d3142a0", "score": "0.6261021", "text": "def check_registration\n return unless Spree::Auth::Config[:registration_step]\n return if current_user or current_order.email\n store_location\n redirect_to checkout_registration_path\n end", "title": "" } ...
[ { "docid": "1c31e5122b1b50c88c76b78ca3bd142e", "score": "0.75595844", "text": "def process_registration_steps(step)\n steps_session step\n end", "title": "" }, { "docid": "1efa9ebd6e240bd400d2136f80744067", "score": "0.6856393", "text": "def registration_start(node_name, co...
ef8fdceaeffef23d4ebb633d58f7819c
lexer rule cr! (CR) (in sql_splitter.rb.g)
[ { "docid": "0114b45f9504afab8c1bceb1e76670ef", "score": "0.65967464", "text": "def cr!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 7 )\n\n \n # - - - - main rule block - - - -\n # at line 83:5: ( '\\\\n' )+\n # at file 83:5: ( '\...
[ { "docid": "0ec873d798764139c007e452bee206eb", "score": "0.68422306", "text": "def sql_separator_2!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n \n # - - - - main rule block - - - -\n # at line 78:5: CR ( SPACE )* '/' ( SPACE )...
1e128a33551bd9f973972cfa9b4950c1
Shorthand for running iptables through sudo.
[ { "docid": "cf1020ec3509fb2f95cdaf56a3e28b4d", "score": "0.5793372", "text": "def iptables(args, &config)\n register_source Solanum::Source::IPTables.new(args), config\nend", "title": "" } ]
[ { "docid": "ec61144e2c1eac2c86cf2aeb5e5865cd", "score": "0.6940053", "text": "def sudo *args\n args = if args.length > 1\n args.unshift \"/usr/bin/sudo\"\n else\n \"/usr/bin/sudo #{args}\"\n end\n system *args\nend", "title": "" }, { "docid": "433d3690dc4c58c43724ab00a6286f77", ...
1ac58d51a49bd649bf13c16a917238e2
virtual attribute in admin/events form for removing category
[ { "docid": "21d92284ff764290f6dceebd984ecb4a", "score": "0.0", "text": "def should_destroy?\n should_destroy.to_i == 1\n end", "title": "" } ]
[ { "docid": "e546f9d32e8c2fd7cc7a1df1744a58b2", "score": "0.6657292", "text": "def uhook_destroy_category(category)\n category.destroy\n end", "title": "" }, { "docid": "deaf872c487d690db09b9be3b912845a", "score": "0.65589565", "text": "def uhook_category_form form...
efc20f88db6bbdb0e84570db90b17ddb
get closest other users, if radius given, then only get ppl close enough
[ { "docid": "719256b0ef2aa30d840b464e0fcb77d9", "score": "0.8241968", "text": "def get_closest(radius = nil)\n \n users = User.all.select{|usr| constraints(usr,radius)}\n return users\n #move this\n #users.sort_by{|usr| self.distance_to(usr)}[0..(users.length < 25 ? users.length - 1 : 24)]...
[ { "docid": "ddad9094153c9d25ac63a37ae5b92c5d", "score": "0.68272656", "text": "def filter_for_radius\n if params[:radius].present?\n # @users = @users.within(params[:radius].to_i, :units => :kms, origin: [52.154778, 9.9579652])\n @users = @users.near([current_user.latitude, current_user.lon...
3d180ff7016c91526ec80afb3b968140
This method is used to get the value of property with the given name. The given property can be something spcified when the client is created If the message is of type WSMessage, the propery may be specified in the message and in which case, that value gets the priority
[ { "docid": "5967dfb909cf9dcfb2888030ff6363f9", "score": "0.8005922", "text": "def message_property(property_name, message)\n\t if message.kind_of? WSMessage then\n\t msg_property = message.property(property_name)\n\t return msg_property unless msg_property.nil?\n\t end\n\t\n\t return ...
[ { "docid": "cb174d3f1dfead0a9b98c9490823a146", "score": "0.6998053", "text": "def get_property(name)\n @props[name]\n end", "title": "" }, { "docid": "aa71e8fa57d7d3c2536c0f095791a36e", "score": "0.69319403", "text": "def property(name)\n prop = properties.find...
b3c7fee6b7278e2b15dc67ccff6d4868
Returns the root node for the graph
[ { "docid": "5f1eba39250850c9166f711c1b88ea2a", "score": "0.6371152", "text": "def root\n @root ||= Related::Root.new\n end", "title": "" } ]
[ { "docid": "c7934f03a32971e6d8ad56b100b1236f", "score": "0.79424155", "text": "def root_node\n @root_node ||= Node.new(@root)\n end", "title": "" }, { "docid": "539c44d8aa36b598de155ed11afd1d0e", "score": "0.76460963", "text": "def root_graph\n return( (self.pg.nil?) ? nil :...
a381cc50141b0ad5af04a8748722d8ac
Create an OAuth Client Creates an OAuth Client managed by the user
[ { "docid": "68921c1fa9e7d0d2c69fdb199cab9a02", "score": "0.6454949", "text": "def create_o_auth_client(name, redirect_uri, opts = {})\n data, _status_code, _headers = create_o_auth_client_with_http_info(name, redirect_uri, opts)\n return data\n end", "title": "" } ]
[ { "docid": "6482cd433663b3e5fa38e97ad613ccf4", "score": "0.7813374", "text": "def create\n @oauth_client = OAuthClient.new(oauth_client_params)\n\n respond_to do |format|\n if @oauth_client.save\n format.html { redirect_to @oauth_client, notice: 'OAuth client was successfully created.'...
d55147b1cda60750200b35dd64504365
Uninstall the application from connected android device Params: +apk_package+:: Package of installed application on connected android device +serial+:: Serial number of connected device
[ { "docid": "0a30921b87aa3ae62470eedef70c242c", "score": "0.838857", "text": "def uninstall(apk_package,serial=nil)\n\tcheck_devices\n\tif multiple_devices? && serial.nil?\n\t\traise \"Multiple devices connected, call again with serial argument\"\n\tend\n\tcommand= (serial.nil?) ? \"uninstall #{apk_packa...
[ { "docid": "9d1eb91c70cada85ab81ae10d1abfdf8", "score": "0.67158186", "text": "def uninstallApp\n \tresult =`ideviceinstaller --udid #{$firstDeviceUDID} --uninstall com.woow.woowapp`\n \tif ($?.exitstatus != 0)\n \treturn \"not removed\"\n end\nend", "title": "" }, { "docid": "77...
68a0b8ef08280775dd44d5c222ea5a2f
GET /local_leagues/new GET /local_leagues/new.json
[ { "docid": "2f13931e1b6330b59b65c0d587fc97f1", "score": "0.77618283", "text": "def new\n @local_league = LocalLeague.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @local_league }\n end\n end", "title": "" } ]
[ { "docid": "73b48cf5b7e48db3b50780be40885871", "score": "0.7322539", "text": "def new\n @colleague = Colleague.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @colleague }\n end\n end", "title": "" }, { "docid": "73b48cf5b7e48db3b5...
4d1d05771f58dff9f05c2c917126915b
POST /student_correspondences POST /student_correspondences.xml
[ { "docid": "26db00d29813781bbaf5f36fffe1b628", "score": "0.7355393", "text": "def create\n @student_correspondence = StudentCorrespondence.new(params[:student_correspondence])\n\n respond_to do |format|\n if @student_correspondence.save\n format.html { redirect_to(@student_corresponden...
[ { "docid": "bbb312d3f2e61bfb5f88d3bdc670a39c", "score": "0.6280401", "text": "def new\n @student_correspondence = StudentCorrespondence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student_correspondence }\n end\n end", "title": "" ...
67df127f55063da29a69532156c3622e
DELETE /offer_logs/1 DELETE /offer_logs/1.json
[ { "docid": "3f0f04b5bb2709626453a4198030eabd", "score": "0.7839732", "text": "def destroy\n @offer_log = OfferLog.find(params[:id])\n @offer_log.destroy\n\n respond_to do |format|\n format.html { redirect_to offer_logs_url }\n format.json { head :no_content }\n end\n end", "ti...
[ { "docid": "b61bf55f6e43cc270f32f360f965c0f6", "score": "0.6842054", "text": "def destroy\n @offer = Offer.find(params[:id])\n @offer.destroy\n add_to_log(t('Destroyed offer no') + @offer.order_number,\"offers\",\"destroy\")\n respond_to do |format|\n format.html { redirect_to(offers_ur...
7441d6f8efa6bad1fa745e489ce70304
Get a file within the tmpdir.
[ { "docid": "b9a55c122b09488db546f05f748befe2", "score": "0.57875407", "text": "def f(name)\n tmpdir + name\n end", "title": "" } ]
[ { "docid": "ecea5be73c2cf5c4a2c5e5eb0777eacd", "score": "0.6173829", "text": "def tmp_file(file)\n File.expand_path(file, tmp)\n end", "title": "" }, { "docid": "9d9d280b6ec1ee9d3d935b378ce25551", "score": "0.61381906", "text": "def get_file(path)\n server.api.server_get_f...
3bd59c231242495e11d44936187cddd3
You can't delete prices, but you can transfer the lookup key to a new price
[ { "docid": "67af1e186fc84f8e77900a9bdf1a3a4c", "score": "0.0", "text": "def reset!\n object = @stripe_class.create(reset_options)\n puts \"[RESET] - #{@stripe_class}:#{object}\" unless Stripe::Engine.testing\n end", "title": "" } ]
[ { "docid": "bd69d071510daf8deb137d984d4484f7", "score": "0.60330564", "text": "def change_price(price_amount , employee )\n if price_amount.nil?\n return nil\n end\n old_price = self.active_price \n \n self.prices.create( :amount => price_amount , :creator_id => employee.id )\n # ...
b23afb279e192f5ad85d7fd70bd179ff
Get a hash of all unresolved problem triggers
[ { "docid": "c9f86503228f8355993039ab18c69422", "score": "0.0", "text": "def get_active( min_severity = 2, maint = 0, lastack = 0, priority_list = '' )\n request = {\n 'method' => 'trigger.get',\n 'params' => {\n 'sortfield' => ['priority', 'lastchange'],\n 'sortorder...
[ { "docid": "037b241e086bc7d18b8d12ba6f773f30", "score": "0.6221345", "text": "def trigger_keys\n self.triggers.collect { |e| e.key }\n end", "title": "" }, { "docid": "ef2cf2cd6d7e2e79188010bf18ec0512", "score": "0.6123029", "text": "def issue_hashes\n issues.collect do |iss...
59a4b69cd783620c9fdae86a4659716e
Assumes active threads will be closed by themselves
[ { "docid": "4ca4d5973cf1aabd5fb0d2bea485f5ae", "score": "0.0", "text": "def clear\n LOCK.synchronize do\n @queue.each { |_, jes| jes.each(&:close) }\n @queue.clear\n end\n end", "title": "" } ]
[ { "docid": "6683aa69efd54297fe5a3b33d19380c8", "score": "0.69218874", "text": "def alive?; @locker.synchronize { !! @threads }; end", "title": "" }, { "docid": "31444e8418f3d6b83e13a9f2413fed63", "score": "0.67596287", "text": "def close\n @threads.size.times do\n @queue....
b661da5794f5f41cadf462cea2eb0c1e
End Post adding logic All of the pagination logic
[ { "docid": "958ca48e64294d4dcf195648f405390b", "score": "0.0", "text": "def pages\n\t (@posts.length / @posts_per_page).ceil\n\tend", "title": "" } ]
[ { "docid": "9e416762c92907672b35ecb5ab650dc9", "score": "0.6910018", "text": "def auto_paginate; end", "title": "" }, { "docid": "1c1d8a2397d80198dde923f9cfb160bb", "score": "0.6851157", "text": "def paginate; false; end", "title": "" }, { "docid": "35421cc37f028aaf2d8c6a...
f6ecb2bb031f8ce060b8eac14ece8322
GET /admin/users/1 GET /admin/users/1.json
[ { "docid": "68cda111e4849430202539234bd3be3e", "score": "0.0", "text": "def show\n respond_with(:admin, @admin_user)\n end", "title": "" } ]
[ { "docid": "430706e49237e520d33d6c2eaffa95b2", "score": "0.74659705", "text": "def index\n set_users_for_admin\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end", "title": "" }, { "docid": "9f7c735ace683c5c2b12c914...
8e73d91c07223e0a8918fc2d00083f7d
GET /buses/1/edit POST /buses POST /buses.json
[ { "docid": "4798b10b1c2d050a3f5d57caabe64539", "score": "0.0", "text": "def create\n @bus = Bus.new(bus_params)\n @bus.bus_owner = current_bus_owner\n respond_to do |format|\n if @bus.save\n format.html { redirect_to root_path, notice: 'Bus was successfully created.' }\n form...
[ { "docid": "a03525cd875849caec76cfef36499434", "score": "0.61677206", "text": "def update\n @bus = Bus.find(params[:id])\n if current_user.has_permission?(:buses)\n @bus.accessible = :all\n end\n\n respond_to do |format|\n if @bus.update_attributes(params[:bus])\n ...
d508ef6dd609081a4a4a51f888ba488e
Returns true if the script is "OP_ ... OP_ OP_CHECKMULTISIG" where N is up to 15. Scripts with up to 15 signatures are considered standard and relayed quickly, but you are allowed to create more complex ones.
[ { "docid": "91db4434b934e621ca7dc6ae4571a850", "score": "0.7536094", "text": "def standard_multisig_script?\n return false if !multisig_script?\n\n # Check chunks directly so we make sure OP_<N> are used, not pushdata.\n # Bitcoin allows encoding multisig N and M parameters as pushdata\n ...
[ { "docid": "0e25559954f46eef19754f1522032f9d", "score": "0.6709248", "text": "def standard?\n return false if features > MAX_STANDARD_VERSION\n inputs.each do |i|\n # Biggest 'standard' txin is a 15-of-15 P2SH multisig with compressed keys (remember the 520 byte limit on redeemScript si...
64dba02230997fb469909ccefe12ec13
Sets the value of the `windows_license_key` attribute.
[ { "docid": "9157cb8f6cb87cc01abf1fe3c4c0a797", "score": "0.88013715", "text": "def windows_license_key=(value)\n @windows_license_key = value\n end", "title": "" } ]
[ { "docid": "6a35a1f640d36054368e1ce6db6c4153", "score": "0.7345586", "text": "def windows_license_key\n @windows_license_key\n end", "title": "" }, { "docid": "bae050a45ef7028625fe812abf82dfba", "score": "0.5919425", "text": "def set_license(input_license)\n @license_n...
156908c0402dba3a9f3b55e9e1ad16f7
GET /modern_references/1 GET /modern_references/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "bee69995210d911eba781a9b5341b959", "score": "0.7320588", "text": "def index\n @modern_references = ModernReference.all\n end", "title": "" }, { "docid": "9a67374a8200a122d44fbc0384472fab", "score": "0.6869372", "text": "def index\n @references = Reference.all\n\n ...
ed1448e227ebfa3d825439efd6398d72
visually represent the adjacency list
[ { "docid": "87e30f1bea747038bb6d2e5c0dc507e2", "score": "0.7062845", "text": "def display_adj_list\n @adjacency_list.each do |data|\n puts \"#{data}\"\n end\n end", "title": "" } ]
[ { "docid": "869c45e72bade300b0fdd73f26cb0995", "score": "0.6977899", "text": "def to_adjacency_lists\n if @nodes.empty?\n \"Empty graph\"\n else\n @nodes.collect{|node| node.to_adjacency_list}.join(\"\\n\")\n end\n end", "title": "" }, { "docid":...
43bcac38016ca9a67093bca75ab3ac5e
Assert that +object+ responds to +messages+. Returns +object+.
[ { "docid": "2dfcd3fc7320e11f01bcdf07f4eee45c", "score": "0.8307305", "text": "def assert_respond_to(object, *messages)\n messages.each do |message|\n assert(object.respond_to?(message))\n end\n assert(yield(object)) if block_given?\n object\n end", "title": "" } ]
[ { "docid": "c718506619aa6181dadb2beb9eae3caf", "score": "0.68413866", "text": "def assertRespondTo object, method, message = nil\n __assert (object.respond_to? method), ASSERT_RESPOND_TO_ERROR, message, {:object=>object, :method=>method}\n end", "title": "" }, { "docid": "40ebe48...
955e6ec76c6efa09cda13af29971dfa4
Perform an HTTP redirect.
[ { "docid": "de9c98f97a8418d6cda073a43c338e83", "score": "0.0", "text": "def redirect(uri = @request.referer)\n raise SeeOther.new(uri)\n end", "title": "" } ]
[ { "docid": "40acb253304421be5bef381f49f083d1", "score": "0.80988455", "text": "def redirect(location, status = '302'); request.redirect(location, status); end", "title": "" }, { "docid": "40acb253304421be5bef381f49f083d1", "score": "0.80988455", "text": "def redirect(location, status...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "8de2432aa3311e71fb2c510e232aa68f", "score": "0.0", "text": "def pegawai_params\n params.require(:pegawai).permit(:nama, :alamat)\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...
870d59712ae9acbde16eef685ee53945
Calling a new Game redirect to show
[ { "docid": "a550d8562726b280b669c5abfb3204fb", "score": "0.0", "text": "def new\n\t\t# TODO\n\tend", "title": "" } ]
[ { "docid": "d190564c59138a7911b662de4920a204", "score": "0.74345076", "text": "def index\n find_game\n redirect_to game_url(@game)\n end", "title": "" }, { "docid": "583abf88cee8f4ff02fdb22bbbe29a1c", "score": "0.72704005", "text": "def index\n redirect_to play_game_path(@c...
1cfbe9041425b7dc7fd761948f45dca3
Returns whether the subpod contains a plaintext element.
[ { "docid": "73f8fb4f9856e97307699434b6fa75a3", "score": "0.6466711", "text": "def plaintext?\r\n not plaintext.nil?\r\n end", "title": "" } ]
[ { "docid": "e9ec40bbe2f16ab29bbb84afc798d79f", "score": "0.66242236", "text": "def text?\n child_of? 'text/plain'\n end", "title": "" }, { "docid": "378fbcc36974f3a1e301d7d847c4ec9a", "score": "0.6516203", "text": "def plaintext?\n raise(TypeError, \"Can not test multipa...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "1e93665817d7df00a6c939cf318ecc59", "score": "0.0", "text": "def room_category_params\n params.require(:room_category).permit(:name, :description, :price)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6981537", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.67835593", "text": "def strong_params\n params.requ...
f26a8453e32662825eb96f571ccf6c42
Create file Args : +path+ > the path in which the file will be written +content+ > the content to be written
[ { "docid": "a9b2725efde0238f1d63ce58b935fae3", "score": "0.815017", "text": "def writeFile(path, content)\n File.open(path, 'w+') do |f|\n puts \"... writing #{path}\"\n f.write(content)\n end\n end", "title": "" } ]
[ { "docid": "ada64cdf5929b7f8d9ef88702c9d0a26", "score": "0.8507612", "text": "def to_file(path, content)\n\tif content\t\t\n\t\tFile.open(path, File::WRONLY|File::TRUNC|File::CREAT) do |file|\n\t\t\tfile << content\n\t\tend\n\tend\nend", "title": "" }, { "docid": "c2f24151f32a0cc214ffab0cba4...
603e2897be25bbdb5c469c61f8c2f514
POST /audios POST /audios.json
[ { "docid": "5195e542e021f923523e54edbff3b0f9", "score": "0.6077059", "text": "def create\n \n catids = params[:catid] \n \n @audio = @user.audios.create(audio_params)\n @audio.published = 1\n if @audio.price.blank? or @audio.price.to_i.eql?(0)\n @audio.is_free = 1\n @a...
[ { "docid": "2f4c75c3ff00f56363bc5b2595c6eb8b", "score": "0.7282278", "text": "def create\n audios = manager.create_pending_audios(params[:transloadit])\n json_success audios_data(audios)\n end", "title": "" }, { "docid": "ed9af7c3a20ee761c3f540d7ab48a127", "score": "0.70164853", ...
c82f467bcd6eb1ad5f300c4c59125e3a
Giftable points, including both daily and bonus points.
[ { "docid": "9d0eafab35ecd5d250f2b6ea24f5a937", "score": "0.6788542", "text": "def total_giftable_points_count\n giftable_points_count + bonus_points_count\n end", "title": "" } ]
[ { "docid": "619d699e9a490d7776383983e31d48fa", "score": "0.62078494", "text": "def points\n begin\n @points = exercise_type.point_base * duration.num_quarter_hours * intensity.point_adjustment\n rescue\n 0\n end\n end", "title": "" }, { "docid": "f8088a7eb98ad8c357af71562...
d1fb4bf9c9f14d0e97a995a1b547364f
Allows you to open a module namespace to add constants
[ { "docid": "5ecc6edb8507cf5a8b5c00569d912c21", "score": "0.0", "text": "def namespace(context, **class_or_module, &block)\n manager = Manager.for(context)\n\n case class_or_module\n in { module: Symbol => _creating_module, class: Symbol => _creating_class }\n raise ArgumentError, \"You mus...
[ { "docid": "76692d89a43820ea110f3ec832c05729", "score": "0.6204314", "text": "def def_module(module_name, constant_values)\n mod = Module.new do\n extend ModuleHelper\n\n def_constants(constant_values)\n end\n\n const_set(module_name, mod)\n end", "title": "" }, {...
c6a1c38fd11d0d62c897a9a999bebff5
PUT /interpros/1 PUT /interpros/1.xml
[ { "docid": "218e2064be3a95580eb0316c48565300", "score": "0.69438237", "text": "def update\n @interpro = Interpro.find(params[:id])\n\n respond_to do |format|\n if @interpro.update_attributes(params[:interpro])\n format.html { redirect_to(@interpro, :notice => 'Interpro was successfully...
[ { "docid": "e631b376ae2ccb776680432bf94b01cc", "score": "0.62163913", "text": "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "title": "" }, { "docid": "99d24a74bc96db3bd...
0f18554da286fc3728ae75435863131a
Register jsonrpc handler with dispatcher
[ { "docid": "3c45e4e45bd1ab46eea4936e723a2d51", "score": "0.0", "text": "def handle(signature, callback = nil, &bl)\n if signature.is_a?(Array)\n signature.each { |s| handle(s, callback, &bl) }\n return self\n end\n @handlers[signature] = callback unless callback.nil?\n @handlers[si...
[ { "docid": "b698d6419055be3d3c6f9c30324ce987", "score": "0.6206507", "text": "def register_rest(handler, &block)\n @register_rest ||= (handler || block)\n end", "title": "" }, { "docid": "77afe9d3aa7d6e974ada071f9d76d5e2", "score": "0.61452997", "text": "def setup_xmlrpc_...
e3eb872418373e33cd7624fe90a91cf9
These are test cases for KERN1896
[ { "docid": "76eda16196c6291148b82a46dd539f2a", "score": "0.0", "text": "def setup\n super\n @fm = FileManager.new(@s)\n @um = UserManager.new(@s)\n end", "title": "" } ]
[ { "docid": "4174182e7f293923cd7cca0294a4dd1b", "score": "0.610136", "text": "def test_uts_at_m_018 # Bug\n assert !AnalyzeTool.tool_name(1000)\n end", "title": "" }, { "docid": "0258123d1e95c51404c45560b987bd9e", "score": "0.60764176", "text": "def welch_ttest\n end", "title...
3bf9209c761daaec41523d0f14fb57dc
Returns true if +comparison_object+ is the same exact object, or +comparison_object+ is of the same type and +self+ has an ID and it is equal to +comparison_object.id+. Note that new records are different from any other record by definition, unless the other record is the receiver itself. Besides, if you fetch existing...
[ { "docid": "00d3d25bc1a2d8eee3bda7ca8a232d41", "score": "0.74460065", "text": "def ==(comparison_object)\n super ||\n comparison_object.instance_of?(self.class) &&\n id.present? &&\n comparison_object.id == id\n end", "title": "" } ]
[ { "docid": "f7496f2fe76ae795a44dff11e8938162", "score": "0.84110516", "text": "def ==(comparison_object)\n comparison_object.equal?(self) ||\n (self.class.to_s == comparison_object.class.to_s &&\n comparison_object.id == id && !comparison_object.new_record?)\n end", "title": ...
6034450e341e1135d6dbf2b4bd325b85
versions that are not applied yet but need to get applied to get up the target version | 0 (stop) | a (target) | b | c
[ { "docid": "e07bff883370c25ea62012e281b7d23b", "score": "0.63554066", "text": "def missing_versions_before(last_rollback)\n return [] unless last_rollback\n\n rollback_index = applied_versions.index(last_rollback)\n\n stop = if rollback_index == applied_versions.length - 1\n # roll...
[ { "docid": "061fdc94c08e9418f36ec01faaf77163", "score": "0.73018503", "text": "def rollback_versions\n applied_versions.select{ |a| a > target_version && a <= current_version }\n end", "title": "" }, { "docid": "5b5195f4f5e57b02b70ffb5d395f6838", "score": "0.66162807", "text"...
954c4aabb89df981fc9c8075ceac74ec
returns the players card_total whether they hit or stay
[ { "docid": "5d01fedda3afa09f698f6c105e2c5f17", "score": "0.0", "text": "def hit?(card_total)\n choice = nil\n while choice == nil\n prompt_user\n choice = get_user_input\n if choice == 'h'\n card_total += deal_card\n elsif choice == 's'\n break\n else\n invalid_command\n ...
[ { "docid": "5d99ac56b82c2a01b9dd6748de292e72", "score": "0.7589265", "text": "def total_cards_ok\n \ttotal = (@player_a.count + @player_b.count + @limbo_stack.count)\n \treturn total == 52\n end", "title": "" }, { "docid": "70e27d914692ff6f1b9367671ce408be", "score": "0.72201735", ...
8a28c7f685d5d00fe8d2ec14e3e730dc
Every time user puts in a character, we want to see if it's present in that string.
[ { "docid": "6260ab7409730d70726bdccc50c34708", "score": "0.0", "text": "def fill_blank_space\n guess = 0\n index = 0\n while guess != @number_guesses\n p \"guess a letter\"\n \n @user_input = gets.chomp\n @blank_space = @blank_space.chars\n @name = name\n# Iterate through the string to ...
[ { "docid": "7d2dbb37a50743ffdb0c63d3cffc59fd", "score": "0.77834237", "text": "def check_word_for_char(char)\n @word.include?(char) ? true : false\n end", "title": "" }, { "docid": "f3028bc7d7b258b9c61fead95174ba80", "score": "0.7635219", "text": "def strig_char (st,ch)\n return...
214cf9005e0ccf9ac1a9b4772caa1643
Run the app overriden to set the process name to something interesting.
[ { "docid": "a1a61f7839ef00f215e3e545c054471c", "score": "0.0", "text": "def run\n\t\tprocname = \"%s %s: %p %s\" % [ RUBY_ENGINE, RUBY_VERSION, self.class, self.conn ]\n\t\t$0 = procname\n\n\t\tsuper\n\tend", "title": "" } ]
[ { "docid": "617f8e9a64eb473fc2339d10569e77f8", "score": "0.68559283", "text": "def on_app_running(_event)\n setproctitle('running')\n end", "title": "" }, { "docid": "e9029645765cb96bb3825560eccde8a0", "score": "0.6672901", "text": "def run(app)\n raise '@run already...