query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
10283cab3f99d6c4f75fc8c0fbe64937
Updates user's password with the new one
[ { "docid": "cd72cb82f7a04a94935fe32579c7487c", "score": "0.7776656", "text": "def update\n @user.password = params[:user][:password]\n @user.password_confirmation = params[:user][:password_confirmation]\n if @user.save\n @user.attempts = 0\n @user.save\n flash[:notice] = \"Passwo...
[ { "docid": "1598f7ce0ceedd0577a685dfd7f67f61", "score": "0.8664389", "text": "def update_password(user, new_password)\n user.update_password(new_password)\n end", "title": "" }, { "docid": "9dce7d707885f6caa8eaac2a5379c194", "score": "0.8146962", "text": "def update_password(newp...
deb93659951cf92c01861212aff6e30c
:callseq: get_latest Returns the most recent (TTLwise) value; nil if no values exist.
[ { "docid": "f61a05ed3aeb08f28c15371ff3a1f602", "score": "0.82406044", "text": "def get_latest() \n if self.latest_ttl\n return self.get(self.latest_ttl[1]); \n else\n return nil\n end\n end", "title": "" } ]
[ { "docid": "4112dcff4a88b6e6a97ded8188079ee8", "score": "0.77796805", "text": "def get_latest() self.get(self.latest_ttl[1]); end", "title": "" }, { "docid": "65d132efea2defbfbdb32a035e071f16", "score": "0.7074432", "text": "def get_latest\n latest_num = @sn_vlet_totals.sort[-1]...
e6fe9c1a5fa6bfe23885ebcd6925e90c
DELETE /businesses/1 DELETE /businesses/1.xml DELETE /businesses/1.fxml
[ { "docid": "9ddea7ef3f8c696dbbb832eec086a0d4", "score": "0.6019598", "text": "def destroy\n @business = Business.find(params[:id])\n @business.destroy\n\n respond_to do |format|\n format.html { redirect_to(businesses_url) }\n format.json { render :json => @business }\n format.fxm...
[ { "docid": "78a15618ecd5e84a8116fb8741cd08be", "score": "0.6363372", "text": "def destroy\n @bus = Bus.find(params[:id])\n @bus.destroy\n\n respond_to do |format|\n format.html { redirect_to(buses_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid"...
05359b921f7758864cbb84d578297243
Completely load a title
[ { "docid": "3dae69d1ebb69368998487ea5bec2943", "score": "0.0", "text": "def load!\n fetch_basic_data!\n fetch_images!\n fetch_trailers!\n fetch_review_information!\n fetch_plugged_in_review!\n make_loaded! if fresh?\n end", "title": "" } ]
[ { "docid": "64e2adadbaf5b9f514d91ed0c830f0ed", "score": "0.8298731", "text": "def load_title\n @title = @temp[2]\n end", "title": "" }, { "docid": "99cf3c3c646eb65665d45334fb9ec045", "score": "0.7426034", "text": "def getTitle\n\t\tself.title = Nokogiri::HTML(open(self.long_url))...
1d096b3df5a9a8b2c2c97b3ff15a55ff
TODO Consider refactoring some of this
[ { "docid": "3ab032375f1181e1925b11c9bc486a7f", "score": "0.0", "text": "def name\n return Corporation.corporations[read_attribute(:initials)][\"print_initials\"]\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.6226198", "text": "def desired; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6052148", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", ...
76aeeeaf003dd7630b957efd6ba37dbd
Complete the minTime function below.
[ { "docid": "a34edd3e94c0b2b13f248b53aa0d47b6", "score": "0.0", "text": "def minTime(machines, goal)\n # n = 1, machines[0] =1, goal = 10 ** 9\n start_day = 0\n end_day = 10 ** 18\n\n while start_day <= end_day do\n mid = (end_day + start_day) / 2\n count1 = production(machines, mid - 1)\n c...
[ { "docid": "90bc16da8541dbeffbe5c9785a1a4f13", "score": "0.81571627", "text": "def min() time[1] end", "title": "" }, { "docid": "1ac7f43c93dac9ed10c4f50a165c28bd", "score": "0.7562711", "text": "def min\n return @time.min\n end", "title": "" }, { "docid": "76386ea1d8...
a8ea111577f6f25f068f25be99e70e87
returns the Base64 encoded file contents
[ { "docid": "02a9bb3704bc88b14a382effaf583949", "score": "0.0", "text": "def api_file_get(id)\n Thread.current[:api_conn].api_perform('FileService', 'getFile', id)\n end", "title": "" } ]
[ { "docid": "365dbf588f9cef77ffcb1b36939eb2bf", "score": "0.8523158", "text": "def base64\n Base64.encode64(File.read(@path)).gsub(\"\\n\", '')\n end", "title": "" }, { "docid": "a34071cc1daa43ada0cb30895852e4b0", "score": "0.85230494", "text": "def base64(file)\n Base6...
1c4b0aa91bc5f609af8247f9f8c515a7
allows a user to delete their channel
[ { "docid": "e565812afd3b743b24dd3321946bc1d6", "score": "0.8449293", "text": "def delete\n \t@channel = Channel.find(params[:id])\n \tif session[:user_id] == @channel.user_id\n \t\tChannel.find(params[:id]).destroy\n \t\tredirect_to \"/users/#{session[:user_id]}\"\n \telse\n \t\tredirect_to '/chan...
[ { "docid": "9da83275a31384d8944cf17c4e6df819", "score": "0.8415064", "text": "def destroy_channel\n user = current_user\n user.channels.delete(params[:channel_id])\n render json: { message: \"Channel deleted successfully from user\"}\n end", "title": "" }, { "docid": ...
cfc94fee85ac073ea8433322461be9a6
Confirms the correct user.
[ { "docid": "3bf583ef6e5944b0cc3ce3de4eea6b0b", "score": "0.0", "text": "def correct_user\n @post = Post.find(params[:id])\n @user = User.find_by(id: @post.user_id)\n redirect_to(root_url) unless current_user == @user\n end", "title": "" } ]
[ { "docid": "c96f27a6347be3bc55a20e8450db1ec9", "score": "0.72449994", "text": "def correct_user\n @user = User.find(params[:id])\n unless current_user == @user\n flash[:warning] = \"You are not authorized to do that.\"\n redirect_to root_path\n end\n end", "title": ""...
720fb5bd12fa62c75202e9baac64676b
CHECK N4: UNICITA' RECORD
[ { "docid": "5e1da103e7ef4ad99e45c7cbfbec4679", "score": "0.0", "text": "def unique_record_check(record,row)\n #recupero tutte le info necessarie per memorizzare la chiave primaria\n plot_id = Plot.find(:first,:conditions => [\"numero_plot = ? AND deleted = false\",record.cod_plot]).id\n specie_...
[ { "docid": "7e156e33fc93e87dca708fc8a2d2a8a6", "score": "0.605723", "text": "def validate(record); end", "title": "" }, { "docid": "7e156e33fc93e87dca708fc8a2d2a8a6", "score": "0.605723", "text": "def validate(record); end", "title": "" }, { "docid": "7e156e33fc93e87dca70...
c57322bb227f8c9c3c8d39c2bf827164
GET /schedules/11 GET /schedules/1.json
[ { "docid": "b52d040c1205951688847b7b38874c17", "score": "0.0", "text": "def show\n create\n end", "title": "" } ]
[ { "docid": "b4872d32915c3e82006abc7ccd415404", "score": "0.798052", "text": "def index\n schedules = get_all_schedules\n\n response = {\n schedules: schedules\n }\n\n respond_to do |format|\n format.json { render :json => response}\n end\n end", "title": "" }, { "d...
112a25c4bc454f1ef39f6d77c18cf97c
Works for three different methods. Each has a parameter embedded in its form that allows this controller to discern how to update the listener and where to redirect the user.
[ { "docid": "bb827584741e8d39b2337ca27931427b", "score": "0.58026475", "text": "def update\n @listener = @current_user.listener\n if params[:location]\n respond_to do |format|\n\t if @listener.update_attributes(params[:listener])\n\t format.html {redirect_to merchant_selection_user...
[ { "docid": "77c80309c9604e96c8868ed9ff3be3f0", "score": "0.5936579", "text": "def controller(controller); end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.5735367", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781...
8e3485763c453f5d4693d754d88efe6b
Creates an OpsWorks deployment with specified command on all layers excluding layer_to_exclude
[ { "docid": "9e2a715d075f56cabb9c3c90803b7e1d", "score": "0.77249604", "text": "def create_deployment_exclude(command, layer_to_exclude, timeout)\n all_instances = get_instances\n excluded_instances = get_instances(layer_to_exclude)\n included_instances = all_instances - excluded_instances...
[ { "docid": "a47c804cc692f6e0d3a8d1a69ad0b0ae", "score": "0.713589", "text": "def deploy_exclude(layer_name, timeout = 600)\n puts \"Deploying to all layers except #{layer_name}\".light_white.bold\n create_deployment_exclude({name: 'deploy'}, layer_name, timeout)\n end", "title": "" },...
d4a1edaae4d92d004632cf64501ce2e7
DELETE /users/1 DELETE /users/1.json
[ { "docid": "15bbd6148634eeae1703a9d0983f5a27", "score": "0.0", "text": "def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1", "score": "0.7590564", "text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_nam...
4f5616df4fd7dfa3ecce35856e0e3197
FOR LIMIT AND OFFSET
[ { "docid": "046ea3aa2f025e2fb3f69c03b8a802bd", "score": "0.0", "text": "def offset_and_limit_and_order_params(model_all)\n if params[:offset].present? and params[:limit].present?\n if params[:order].present? and params[:order] === 'date'\n data =model_all.limit(params[:limit]).offset(para...
[ { "docid": "4a8d6174566e0a7790e9dc166aae62ba", "score": "0.7242811", "text": "def limit_and_offset\n r = super\n if r.first == 1\n r\n else\n [1, r[1]]\n end\n end", "title": "" }, { "docid": "33fd8a11f97aa30eee713a282f8d9202",...
45944a9825c56b32f5ddf35929c51c5b
GET /post_ideas/new GET /post_ideas/new.json
[ { "docid": "dd88764768841944632c65a9691a8808", "score": "0.7916058", "text": "def new\n @post_idea = PostIdea.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post_idea }\n end\n end", "title": "" } ]
[ { "docid": "fbc9bbfe7c2d8cf4fb8d11155b86f1f3", "score": "0.7597002", "text": "def new\n @Userideas = Userideas.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @Userideas }\n end\n end", "title": "" }, { "docid": "2204cbc33a2e9c33ba...
d1c7479a91d03acf183dfa47aa4899f0
recursively apply the default proc to all hashes
[ { "docid": "f6664831437535b70dd5ef23ae56a49c", "score": "0.546147", "text": "def recursively_freeze(obj)\n case obj\n when Array\n obj.each { |o| recursively_freeze(o) }\n when Hash\n obj.default_proc = DEFAULT_PROC\n recursively_freeze(obj.val...
[ { "docid": "758fc83a8ed83a9dd3d2f97218e0ff20", "score": "0.7016647", "text": "def set_default_proc_on(hash, default_proc)\n if hash.respond_to?(:default_proc=)\n hash.default_proc = default_proc\n else\n hash.replace(Hash.new(&default_proc).merge(hash))\n end\n ...
72df7367d6908bcc5ba984c3d148e267
register a directory to watch. must be implemented by the subclasses
[ { "docid": "6624bf9ac9c688153b7092431754d16f", "score": "0.7262241", "text": "def watch(directory)\n raise NotImplementedError, \"do whatever you want here, given the directory as only argument\"\n end", "title": "" } ]
[ { "docid": "6bc279c8ba9ead16188eb0773f388409", "score": "0.7488733", "text": "def watch(watched_dirs)\n watched_dirs << @directory\n end", "title": "" }, { "docid": "38ef626cba0152846e4a3bcdd2e721fc", "score": "0.68115956", "text": "def watchable_dirs; end", "...
f5287c999d40bd43e57e88a1f6801d45
Given a hash with numeric values, return the key for the smallest value Think about how to determine which value is the lowest. Do you need to compare each value to something as you iterate? Think about how to collect or store the correct key. Remember that you need your method to return just the key.
[ { "docid": "8ff3186ed34716366ce4489b764b2196", "score": "0.83964825", "text": "def key_for_min_value(hash) \n\n min_value = 0\n min_key = 0\n \n if hash.empty?\n return nil\n end\n \n hash.each do |key, value|\n\n if min_value == 0 || value < min_value \n min_value = value\n ...
[ { "docid": "187165074e32a7573ee53a9cabb44ed4", "score": "0.8879247", "text": "def key_for_min_value(hash)\n lowest_key=nil \n lowest_value= Float::INFINITY\n hash.each do |name,number|\n if number < lowest_value\n lowest_value=number\n lowest_key= name\n end \n end\n lowest_key\nend...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "94874ae63e9f9fe4f297d30a40db8717", "score": "0.0", "text": "def set_review\n @review = Review.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339844", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014297", "text": "de...
a85391ac0051e2263d805b3b3da598c9
Get currently used buffer
[ { "docid": "e58332e0efa36d51cb1b76ca7edd4f08", "score": "0.7728312", "text": "def get_active_buffer()\n Rula.log(Logger::DEBUG,\"Get active buffer: #{@active_buffer}\",self)\n @buffers[@active_buffer]\n end", "title": "" } ]
[ { "docid": "d9bc74bed601c650a37f2622dab70bc0", "score": "0.70235366", "text": "def buffer_info\n @buffer_info ||= BufferInfo.new\n end", "title": "" }, { "docid": "7b97a8f5dd780b0bbe735467691a43e5", "score": "0.6962039", "text": "def get_buffers()\n Rula.log(Lo...
a33fec3b59d75c49c2005c0fa15c720d
Method for only sending mail to the first recipient that is not sent yet
[ { "docid": "ed1adcc24047431f0c133c57b5b0133f", "score": "0.6268068", "text": "def send_new_mail(document)\n recipient = Recipient.where(document: document, sent: false).first\n if recipient.present?\n DocumentMailer.with(user: document.user,\n email: recipient.email,\...
[ { "docid": "35da1bf096c553ff8531367b6048b281", "score": "0.7550628", "text": "def first_email_sent_to(recipient)\n self.current_email = emails_sent_to(recipient).last\n end", "title": "" }, { "docid": "682f1e90bae41ccb09abe08854f0e7e8", "score": "0.6983322", "text": "def mailboxe...
5d25a47169a4ba77ae8126e8e9aaf576
Execute an `:unscheduled` `ScheduledTask`. Immediately sets the state to `:pending` and starts counting down toward execution. Does nothing if the `ScheduledTask` is in any state other than `:unscheduled`.
[ { "docid": "b8f95ffea11457072412391088507464", "score": "0.0", "text": "def execute; end", "title": "" } ]
[ { "docid": "8354e3975221d792a8e69a721a71d1d5", "score": "0.668204", "text": "def unscheduled?; end", "title": "" }, { "docid": "8354e3975221d792a8e69a721a71d1d5", "score": "0.668204", "text": "def unscheduled?; end", "title": "" }, { "docid": "1e4af1db3e91cd7ecffc3d4951b8...
42048d70aa0c0271e1e601c51281e9c9
)( ) Alias: update_other ( )(
[ { "docid": "23d5d4ee864eca50966daa0e4023082f", "score": "0.0", "text": "def update_other\n mrts_qcksnd_update_other\n @sunk = @character.sunk if @character.is_a?(Game_Player)\n end", "title": "" } ]
[ { "docid": "4108f1e46b45f5b9e69136897a5dae4a", "score": "0.6615925", "text": "def update(...)\n end", "title": "" }, { "docid": "22eda1000ed3b1c02fb78042ef410e3e", "score": "0.65383756", "text": "def apply_updates(other)\n apply_updates_title(other.title)\n apply_updat...
aa91f235e240e06c457c4c04c86b18ec
List timestamps of all available Cluster Backups. Returns timestamps for all backup files that are available on the SFTP server.
[ { "docid": "581ff95750a05cf0787d5d3135d835d8", "score": "0.5707342", "text": "def list_cluster_backup_timestamps_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiNsxComponentAdministrationBackupRestoreManagementRest...
[ { "docid": "889240334adb8edefca385326ed2139e", "score": "0.7770778", "text": "def list_cluster_backup_timestamps(opts = {})\n data, _status_code, _headers = list_cluster_backup_timestamps_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "47e2a8a2e0253d726fd85b05b0bf...
eb0c5b215aaebd0ab9eee8e0d6b345b7
Assign block to be called on model class.
[ { "docid": "795c5817490dc843653501b187929204", "score": "0.6149898", "text": "def setup &block\n if @setup_block\n setup_block = @setup_block\n exec_setup_block = method(:exec_setup_block)\n @setup_block = lambda do |attributes, options, backend_class|\n [set...
[ { "docid": "ba314a950318ba6c64841025db33b0ab", "score": "0.70473266", "text": "def initialize(&block)\n @block = block\n end", "title": "" }, { "docid": "ec0d2d07690e20be51d1067cb7e08e6b", "score": "0.6913146", "text": "def initialize(&block)\n @block = block\n en...
9c700ee054c42a2f6dda12a807d60d1c
Public: Returns a json response indicating a 404
[ { "docid": "108a8c3dda67f6160a2fc8509b34ad27", "score": "0.76207465", "text": "def json_not_found(params)\n {\n errors: {\n message: \"Not found with parameter #{params}\"\n }\n }\n end", "title": "" } ]
[ { "docid": "b2167b0ab38ba9a0f9b9f4d3d697c0b2", "score": "0.87090236", "text": "def return_404\n render :json => {:error => \"not-found\"}.to_json, :status => 404\n end", "title": "" }, { "docid": "dc19b17c36400db4bc3ba0926a814307", "score": "0.85299987", "text": "def not_found\n ...
1097a7e7758f08d32addfc88ea3fdcab
GET /users GET /users.json
[ { "docid": "676b346a8480348e6d7bd240b838b0aa", "score": "0.0", "text": "def pro_activate\n set_activate\n end", "title": "" } ]
[ { "docid": "8a29471646191d84def95f7af1e081bf", "score": "0.82095146", "text": "def users(args = {})\n get(\"/users.json\",args)\n end", "title": "" }, { "docid": "fd6f331d604ba2ad8967a7e5ed218329", "score": "0.78731215", "text": "def show\n begin\n user = User.fin...
ef295141d1b23f4daea3e98f367a01d3
TODO payout errors (report)
[ { "docid": "b706f7d02a6dcba9c0e57fc4491b94f6", "score": "0.0", "text": "def paid_out?\n self.payout_batch.present?\n end", "title": "" } ]
[ { "docid": "abda7cdf324c231a6e73db446b76e798", "score": "0.6721631", "text": "def sprintpay\n end", "title": "" }, { "docid": "25f7e53b72f0157245ee3e58604d7838", "score": "0.6532313", "text": "def payer; end", "title": "" }, { "docid": "52b1c496cb9db7beafaa16038a518be1",...
5eca13b34c5cb4c4211e00eb320a4819
Delete a &39;softwarerepository.CategorySupportConstraint&39; resource.
[ { "docid": "3ca3f5420e895c7ae077f7a5bae0fd54", "score": "0.6508955", "text": "def delete_softwarerepository_category_support_constraint_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SoftwarerepositoryApi.delete_softwarerepos...
[ { "docid": "795d91da6a00d185aacbf3989e029004", "score": "0.7384213", "text": "def delete_softwarerepository_category_support_constraint(moid, opts = {})\n delete_softwarerepository_category_support_constraint_with_http_info(moid, opts)\n nil\n end", "title": "" }, { "docid": "66...
1d9f128b6465a41eb8ef3109591503d5
PATCH/PUT /special_device_list_devices/1 PATCH/PUT /special_device_list_devices/1.json
[ { "docid": "995a645ea030180e110553905efe6354", "score": "0.73836124", "text": "def update\n respond_to do |format|\n if @special_device_list_device.update(special_device_list_device_params)\n format.html { redirect_to @special_device_list_device, notice: 'Special device list device was su...
[ { "docid": "7c2cf4881313f7624c38f29f7197d457", "score": "0.7093562", "text": "def set_special_device_list_device\n @special_device_list_device = SpecialDeviceListDevice.find(params[:id])\n end", "title": "" }, { "docid": "10f38d40c34e0c03c34c22640f0ad904", "score": "0.68367314", ...
462c698820931d1c484000ba5e590346
GET /part_types/1 GET /part_types/1.json
[ { "docid": "df2583fde20820c3e952a562daf52a52", "score": "0.734878", "text": "def show\n @part_type = PartType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @part_type }\n end\n end", "title": "" } ]
[ { "docid": "018611ba447a7a5d184abc3ad0cb05e3", "score": "0.6776613", "text": "def index\n @parttypes = Parttype.all\n end", "title": "" }, { "docid": "760af624227a0aab46a5f087c794b11d", "score": "0.66449356", "text": "def index\n @part_types = PartType.paginate(:page => params...
15b4f68e3c98a183f8006b8eaada4822
Open an AMQP channel
[ { "docid": "33ed4ab8b9f44c6aec598232b52cc1ec", "score": "0.54430556", "text": "def channel(id = nil)\n raise ArgumentError, \"Channel ID cannot be 0\" if id&.zero?\n raise ArgumentError, \"Channel ID higher than connection's channel max #{@channel_max}\" if id && id > @channel_max\n\n ...
[ { "docid": "f34024029d3b183d3d52d9f9beaf0079", "score": "0.801575", "text": "def open_channel\n @channel = @connection.create_channel\n\n yield(@channel) if block_given?\n\n @channel\n end", "title": "" }, { "docid": "edb15f80d74f8a74e92cbca90ff19c26", "score": "0.71854...
9e2bdc92609afeeb41eed5ff147017f9
GET /advertisements GET /advertisements.json
[ { "docid": "b3309d8e2b22ad678dd266fabaca3169", "score": "0.61804163", "text": "def index\n if current_user.try(:admin?)\n @advertisements = Advertisement.page(params[:page]).per(10).order(\"updated_at DESC\")\n else\n @advertisements = Advertisement.where(state: \"published\").page(param...
[ { "docid": "08b084142167e533c4f61d246c6ec142", "score": "0.7671461", "text": "def show\n respond_to do |format|\n format.html\n format.json { render json: { advertisements: @advertisements } }\n end\n end", "title": "" }, { "docid": "032f3506b1c3562078418df18497fac2", "s...
4299915cfec2e6dce8ff50aa9f8db7f7
GET /sessions/new GET /sessions/new.json
[ { "docid": "190ba9c3233e9eeb546d7b1b5276e22e", "score": "0.6251531", "text": "def new\n @session = Session.new\n @speakers = active_conference.speakers\n \n respond_to do |format|\n format.html { render layout: 'admin' }\n format.json { render json: @session }\n end\n end", ...
[ { "docid": "06229da16d9d820cded9c2d7e7f8e14c", "score": "0.7868148", "text": "def new\n @session = Session.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @session }\n end\n end", "title": "" }, { "docid": "9c208bd93250730bb1f8d221...
119a7917d228233652501ae6d22e0fec
Check if an object belongs to the user logged in
[ { "docid": "38be5581b3e0291383cdfdeca6b3b95a", "score": "0.0", "text": "def mine?(thing)\n return false if thing.nil?\n return false unless logged_in?\n\n c_id = current_user.id.to_i\n\n case thing\n when User\n return c_id == thing.id\n when Annotation\n return thing...
[ { "docid": "8cd4998e0d0829f62ced9f9a310d4112", "score": "0.8353004", "text": "def i_am?(object)\n if current_user == object\n true\n else\n false\n end\n end", "title": "" }, { "docid": "e5288c4fc2dd30eb955b6bd5a7b03e1d", ...
23563a393fd0e8afaf161bbd133eaee0
expansion module can override this.
[ { "docid": "bdbfd4b56a47de69922d86bfa38b506c", "score": "0.6533701", "text": "def expansion_added(expansion)\n end", "title": "" } ]
[ { "docid": "7a1f37aef8a8a2a14b48390e0a90d389", "score": "0.75734496", "text": "def extend_expansion(expansion)\n extend expansion.module\n end", "title": "" }, { "docid": "d4248303d83e601fedcb6595d7408f7d", "score": "0.71918935", "text": "def expanded; end", "title": "" }, ...
558ab64fdb56d01ed466214879fa8d88
GET /orders GET /orders.json
[ { "docid": "a5deefb34d95ffa3badd3cb5b9d9e5fa", "score": "0.0", "text": "def index\n sort = params[:sort] || \"desc\"\n orders = Order.all.order(created_at: sort).map do |order|\n order.as_json.merge(\n created_at: order.created_at.strftime(\"%b %d, %Y\"),\n edit_url: edit_order_...
[ { "docid": "23052f52af86f70778b67e0afeeea3d4", "score": "0.83267236", "text": "def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end", "title": "" }, { "docid": "758a2f8f96273e5938f621811501d1a3", "score": "0.815406", "text": "def orders\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "21476f44a1fd2e56291704d384663a78", "score": "0.0", "text": "def set_release_gate\n @release_gate = ReleaseGate.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...
623de79dd05ce1b79a0e6a2d165426eb
Returns an array containing the names of the Forums listed on the page.
[ { "docid": "2e88873b4fef1566b189212328340e7d", "score": "0.70771754", "text": "def forum_list\n list = frm.table(:class=>\"forumline\").links.map do |link|\n if link.href =~ /forums\\/show\\//\n link.text\n end\n end\n list.compact!\n return list\n end", "title": "" }...
[ { "docid": "74610c19e6fda0eb46fd84c1e913233a", "score": "0.7377587", "text": "def forum_titles\n forum_titles = []\n forum_links = frm.links.find_all { |link| link.id==\"forumEdit\"}\n forum_links.each { |link| forum_titles << link.text }\n return forum_titles\n end", "title": "" }, ...
96cdfd15a3569fc66e51d8cedb50842c
GET /follow_ups/1 GET /follow_ups/1.xml
[ { "docid": "f043bf41cacdf553339cd520f7a4ace5", "score": "0.73578703", "text": "def show\n @follow_up = FollowUp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @follow_up }\n end\n end", "title": "" } ]
[ { "docid": "0fd36048724102cb36a23f6aeb65b9c2", "score": "0.7326262", "text": "def show\r\n @follow_up = FollowUp.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.rhtml\r\n format.xml { render :xml => @follow_up.to_xml }\r\n end\r\n end", "title": "" }, ...
161bb3217f729a819fbdde74ea7ae94e
Get configuration for a specific network encryption key manager Get configuration for a specific network encryption key manager
[ { "docid": "b088c4395e503bed915f440dc382d210", "score": "0.0", "text": "def get_dne_key_manager_with_http_info(key_manager_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.get_dne_key_manager ...\"\n end\n # verify the re...
[ { "docid": "821e2b1164a9fa25e2076471936814f2", "score": "0.59438103", "text": "def get_config(key)\r\n CONFIG[key]\r\n end", "title": "" }, { "docid": "6441f8329b584cee6af2e2bb3cd76d12", "score": "0.5925922", "text": "def get_config(key)\n Rails.logger.debug(\"Get config f...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0c32153d9415d2dea4c56815ed44e37e", "score": "0.0", "text": "def restaurant_params\n data = params.require(:restaurant).permit :name, :address, :zip_code, :city, :picture, :logo, :css, :picture_display, :slug, :plain_opening_hours, :phone, :email\n data.delete :css if data['css'] and da...
[ { "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...
6932fcb2f2b52995e7df0ab524bb00c6
Check if a user is allowed to see alerts from tags on this object. If user is nil, will return false. This should only be used before an object is saved, thus the category argument.
[ { "docid": "90c1aa0e245157b7d31442fc6cb82a90", "score": "0.79539967", "text": "def can_see_tag_alerts?(user, category)\n return false if user.nil?\n\n args = [:categories, category.id.to_s, :view]\n\n key = 'cached:' + user.id.to_s + ':' + self.class.name + ':can_see_tag_alerts:' + category.id....
[ { "docid": "fb01badf71fd2d3a08e7aaa22ae15123", "score": "0.68110156", "text": "def user_tag?\n @user == true\n end", "title": "" }, { "docid": "557e25aadaa1936e3086912b5b91dd0f", "score": "0.67753637", "text": "def ensure_user_is_tag_owner\n access_denied if current_user.nil? ...
3b9297a00e8ee5a1662c835adfe74e36
PATCH/PUT /internal_settings/1 PATCH/PUT /internal_settings/1.json
[ { "docid": "8a6f12abca9903198630a3e020225713", "score": "0.7391733", "text": "def update\n respond_to do |format|\n if @internal_setting.update(internal_setting_params)\n format.html { redirect_to @internal_setting, notice: 'Internal setting was successfully updated.' }\n format.js...
[ { "docid": "ba84c98c09abdfb827aef482c78c5968", "score": "0.7236474", "text": "def update_settings(settings = {}); JSON[Api::post_settings(settings, self)]; end", "title": "" }, { "docid": "2c314c85e838f6bc5f40c02a1ecb2a31", "score": "0.6825736", "text": "def update\n settings.upda...
e2192e43e9d04d2a796a71b96897d495
interval The sampling interval in seconds. warmup When true, takes a single sample eagerly before entering the sampling loop. This can be useful to ensure that all metrics files exist after `start` returns, since prometheusclientmmap creates them lazily upon first access.
[ { "docid": "b733571950bac2de25d0d7be3e91e2f7", "score": "0.61818564", "text": "def initialize(interval: nil, logger: Logger.new($stdout), warmup: false, **options)\n interval ||= ENV[interval_env_key]&.to_i\n interval ||= self.class::DEFAULT_SAMPLING_INTERVAL_SECONDS\n interva...
[ { "docid": "db432dce9ba3261311b31a2b1a5f7185", "score": "0.6388176", "text": "def set_sampling_interval(interval:)\n {\n method: \"Profiler.setSamplingInterval\",\n params: { interval: interval }.compact\n }\n end", "title": "" }, { "docid": "85acaa5b275a...
bea17b18f51bf4a9ad0c9c60db7485f1
GET /room_resources/1 GET /room_resources/1.json
[ { "docid": "8f517d0b3372e9ee3ba603e82e0c311d", "score": "0.760813", "text": "def show\n @room_resource = RoomResource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room_resource }\n end\n end", "title": "" } ]
[ { "docid": "a50a301ddb195e5540a84adde81a5081", "score": "0.69536257", "text": "def get_room(id)\n JSON.parse(RESTful.get(\"#{ URL_MICROSERVICE_ROOMS }/#{id}\"))\n end", "title": "" }, { "docid": "5646f094698d9bf09a0c98d904c26167", "score": "0.694011", "text": "def new\n @room_...
b76555e6c6cd7a320418373f5f9ec82e
sendmsg Called only from the protocol handler, and called using Objectsend.
[ { "docid": "6bc842cf0d0f3eb7b2843afaa55b0a4a", "score": "0.5708405", "text": "def sendmsg(frame)\n #\n @@log.debug(\"#{frame.headers['session']} QM client SEND Processing, #{frame}\")\n frame.command = \"MESSAGE\"\n dest = frame.headers['destination']\n # Lookup a user willing to handle t...
[ { "docid": "b946a8efabad99c301667efef3bd4e6d", "score": "0.75918674", "text": "def __sendmsg__(socket, address, flag)\n LibXS.xs_sendmsg(socket, address, flag)\n end", "title": "" }, { "docid": "214f479db727327fbf92f99e1b0d68b9", "score": "0.72629595", "text": "def sendmsg ms...
efd43473b32d30e2a42f60039efb3673
for now we assume we only use an algorithm that is available via Ruby's Digest:: in the standard library
[ { "docid": "6b47debaccc3a838a895fb247219914d", "score": "0.6248555", "text": "def digest(path)\n Kernel.const_get(\"Digest::#{self.algorithm.upcase}\").send(:file, File.join(self.version.path, path))\n end", "title": "" } ]
[ { "docid": "6049b31d7efc83a8b8ac322fd3f6bcc8", "score": "0.74779224", "text": "def digest; end", "title": "" }, { "docid": "6049b31d7efc83a8b8ac322fd3f6bcc8", "score": "0.74779224", "text": "def digest; end", "title": "" }, { "docid": "79e668daa8c3b084518f4d6de4b1bc01", ...
f76fd0ede16dbafbc0eecc1ee1242b5c
Does nothing for all commands except Create.
[ { "docid": "623be3074f65790d165c7890e7019a16", "score": "0.0", "text": "def readme(*args)\r\n end", "title": "" } ]
[ { "docid": "9738ba0d086d41a0369559bd81dec2fc", "score": "0.6687825", "text": "def only_create!\n self.operation = :only_create\n end", "title": "" }, { "docid": "faf7070adbce39f745c066c3f1b93d0a", "score": "0.667032", "text": "def create\n # do nothing\n end", "ti...
53ff1f1589fd7cd2ab44ec9214d1df44
Get any xml:base in effect for this element
[ { "docid": "4c8bf72c53e479aea607e95668b36b38", "score": "0.72238374", "text": "def base\n if @base.nil?\n @base = attribute_with_ns(\"base\", RDF::XML.to_s) ||\n (parent && parent.element? && parent.base) ||\n false\n end\n\n @base == false ? n...
[ { "docid": "3c231be3098800a864ff80fbaa712103", "score": "0.7532604", "text": "def base\n @node.attribute(\"base\", \"http://www.w3.org/XML/1998/namespace\") || @node.attribute('xml:base')\n end", "title": "" }, { "docid": "0d6028ebe1faf05b205fbf95d3cc43d1", "score": "0.73...
899ac1cf5b408279c84ac18ead2fdc7e
If the stripe keys were both present, and we had a registered webhook now unregister the webhook
[ { "docid": "c48c953265a7d542ff7a0dc81af18758", "score": "0.84914136", "text": "def unregister_stripe_webhook_if_necessary\n return unless previous_changes.include?(:stripe_secret_key)\n\n # secret key was changed\n\n # if we HAD a secret key\n if previous_changes[:stripe_secret_key][0].prese...
[ { "docid": "a1452ffca42337a1f6a26a77ddf7ed32", "score": "0.73334146", "text": "def unregister_webhook\n\t\t\t\t\trequire \"open-uri\"\n\t\t\t\t\trequire \"net/http\"\n\t\t\t\t\trequire \"openssl\"\n\n\t\t\t\t\treturn if self.add_on.nil? # Can't do it without a token!\n\t\t\t\t\treturn if self.oauth_toke...
94080606364ad66d7404d771390dcb2b
List the last 3 error messages occured Command: .zg error [channel] Params: :channel (optional) Access: open
[ { "docid": "8341c6328d332106a8ea1bf27b0b81e6", "score": "0.73023564", "text": "def cmd_error(m, params)\n if params.has_key? :channel\n channel = params[:channel]\n else\n channel = m.channel.to_s\n end\n\n if not @errorlog.has_key? channel\n m.reply 'no errors logged'\n ...
[ { "docid": "cd4ca5fca4a2a8f587fefa2c187ad2e7", "score": "0.6454575", "text": "def errors\r\n history.select { |cmd| GrassGis.error?(cmd) }\r\n end", "title": "" }, { "docid": "374bbfd18c714fb6460b5a8001223d05", "score": "0.63083404", "text": "def last_error\n @messages.l...
e4db0ac065b68d865af767311b90b78c
modifica del valore d'evasione
[ { "docid": "d6819f7554ed3e449d3f6fc6f5e1fe84", "score": "0.0", "text": "def eva\n [[super, 0].max, 100].min\n end", "title": "" } ]
[ { "docid": "c22f7b8ea26f13585ef759deeeee6a31", "score": "0.65010667", "text": "def atribuirValor\n\t\t@@compras.each do |produto|\n\t\t\ti = @@compras.index(produto)\n\t\t\tcase produto\n\t\t\t\twhen \"par de meias\"\n\t\t\t\t\t@@compras[i] = 11.99\n\t\t\t\twhen \"camiseta\"\n\t\t\t\t\t@@compras[i] = 29...
364c8c4d0356137a8bda406d032f3865
=================================================== New home page function added by Amol ...test purpose for timebeing Get events Make JSON for use with Verite Timeline and then render tl.html
[ { "docid": "f17c2d8e78b7dc73f000f3e731d5f2a1", "score": "0.0", "text": "def myhome\n logger.info(\"EventsController.myhome() started\")\n render :template => \"events/myhome\", :formats => [:html], :handlers => :haml\n end", "title": "" } ]
[ { "docid": "ee61461cdcb7fd9513d2a70ebb0e4b6e", "score": "0.7118846", "text": "def show\n @timeline = Timeline.find(params[:id])\n\n eevents = @timeline.events\n\n date = []\n if eevents || eevents.empty?\n eevents.each do |event|\n date_element = {}\n date_element[\"startD...
8f2c74a0df1292ad4bab31f48af82764
def check_address? [street_address_changed?, city_changed?, state_changed?, postal_code_changed?, country_changed?].any? end
[ { "docid": "af55f93fb52b51b5831b8f92216afe74", "score": "0.0", "text": "def inactive_date\n\t\tif inactive_changed?\n\t\t\tif inactive?\n\t\t\t\tself.inactive_from = Time.now\n\t\t\telse\n\t\t\t\tself.inactive_from = nil\n\t\t\tend\n\t\tend\n\n\t\tdef new_ownership\n\t\t\t@user = User.find(self.created_...
[ { "docid": "57f9bf6dc4ccf7bfaa102affb2330f8d", "score": "0.88526523", "text": "def address_changed?\n \tstreet_changed? || city_changed? || state_changed?\n end", "title": "" }, { "docid": "3786ee1999411b8eb95ae8c460dee7ae", "score": "0.8323529", "text": "def full_hq_address_change...
96e7a6b29ee3e0f84f5605da0a16cfd2
Lists the ships at the location referenced with this object's instantiation Accepts no arguments, only passing the defined argument from instantiation to this method
[ { "docid": "80cf0439b876e8d24d12d66103e3b2a2", "score": "0.6490533", "text": "def ships_where_stored\n list = CONNECTION.execute(\"SELECT * FROM ship_names WHERE ship_locations_id = #{@id};\")\n array_list = []\n \n list.each do |type|\n array_list << ShipName.new(type)\n end\n \n...
[ { "docid": "2d8099e874b328cc69ba57a550898c83", "score": "0.6996775", "text": "def getShips()\n return @ships\n end", "title": "" }, { "docid": "63d72f3a35383d1133bcc27c4cc9f27b", "score": "0.6890914", "text": "def ships\n @ships ||= []\n end", "title": "" }, { "do...
1548928c9249f3b2fb09c13570887a9b
given a location, produces a list of relative locations covered by the piece at this rotation
[ { "docid": "14a6745d43119929da5056460b309941", "score": "0.51316184", "text": "def offsets( location)\n if is_even( location) then\n @even_offsets.collect { | value | value + location }\n else\n @odd_offsets.collect { | value | value + location }\n end\n end", "title": "" } ]
[ { "docid": "bb84fe0db533868ba1b7f400b8cb1146", "score": "0.63994336", "text": "def find_nearby_locations(location)\n row, column = location\n nearby_locations = []\n r = -1\n until r == 2\n c = -1\n until c == 2\n nearby_locations << [row + r, column + c] unless r == 0 && c ...
1ba6675313d08c61bc1b77d2e39f0164
convert a pence value back to a money format
[ { "docid": "8461029bffd62ff41a104ba9de4aeb87", "score": "0.6911756", "text": "def from_pence(value)\n (value / 100.0).to_s\n end", "title": "" } ]
[ { "docid": "f5bb4117af086c4130f2d1ff0136f8ff", "score": "0.7458747", "text": "def to_money(price)\n price = '$%.2f' % [price]\n price.reverse.gsub(/([0-9]{3}(?=([0-9])))/, '\\\\1,').reverse\n end", "title": "" }, { "docid": "1a2603c7a4c02ad8b3ccc3274c825b96", "score": ...
06d308ce6495b6006b0266c334ca7e06
Takes a file and loads the properties in that file
[ { "docid": "d9fad676ae1b20630edc765450b7b81d", "score": "0.704274", "text": "def initialize(file)\n @file = file\n @properties = {}\n File.open(file).each_line do |line|\n @properties[Regexp.last_match(1).strip] = Regexp.last_match(2) if line =~ %r{([^=]*)=(.*)//(.*)} || line =~ /([^=]*)=(...
[ { "docid": "55dfb72ff535bc74b22279e3924fe833", "score": "0.7469464", "text": "def load_properties(properties_filename)\n properties = {}\n File.open(properties_filename, 'r') do |properties_file|\n properties_file.read.each_line do |line|\n line.strip!\n if (line[0] !=...
4d83f7bb27370120f3dafa184333782b
Find the user that owns the access token
[ { "docid": "055375f0d1f78f7e12fc20d69387d7d7", "score": "0.67427266", "text": "def current_resource_owner\n User.find(doorkeeper_token.try(:application).try(:owner_id)) if doorkeeper_token\n end", "title": "" } ]
[ { "docid": "a32ac4f65c6cf1abfbb23dc1f6b1f440", "score": "0.7666929", "text": "def user_from_token(user_token)\n User.joins(:oauth_token).where(oauth_tokens: {access_token: user_token}).first\n end", "title": "" }, { "docid": "d356ced3f24942316fd3f8435db0e755", "score": "0.712...
d83f95cfa32cb62fc05b4fc0758e6d27
Finishes invitation process setting user password
[ { "docid": "8e1ebecdbee222cc69dc1a393bf3c10e", "score": "0.0", "text": "def accept_invitation(params)\n return false unless invitation_token.present?\n\n self.assign_attributes(params)\n\n valid?\n errors.add(:password, :blank) if params[:password].blank?\n errors.add(:invitatio...
[ { "docid": "0cdde76e75184e61631ffe4e1e53ddf5", "score": "0.7217058", "text": "def set_password\n InvitationsMailer.set_password\n end", "title": "" }, { "docid": "a707ffe3b24bcd2049785545676ea118", "score": "0.65578246", "text": "def accept_invitation\n\t\tredirect_to root_path a...
f0a4c5b733a52c42b21a7fe883b7ab08
GET /classrooms/new GET /classrooms/new.json
[ { "docid": "703afab1ecc6ddfefc605192c6f75c65", "score": "0.81232643", "text": "def new\n @classroom = classroom.new\n\n render json: @classroom\n end", "title": "" } ]
[ { "docid": "92da66cd2f941ed95ef39e541521695c", "score": "0.8117621", "text": "def new\n @class_room = ClassRoom.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class_room }\n end\n end", "title": "" }, { "docid": "69c45a0d3573...
c978d5bdfef1aca40ffb8cf52640cbf1
2. get story tags and put them in an array,
[ { "docid": "87341308641d8833ed46409077c4dd9d", "score": "0.78835326", "text": "def get_tags(stories)\n\tcurrent_tags = []\n\tstories.each do |story|\n\t\tcurrent_tags.push(story[\"content\"][\"tags\"].first[\"slug\"])\n\t\t# this code is to get ALL of the current tags, not just the primary tag\n\t\t# ta...
[ { "docid": "c6ba77c4e36910408038f3862128e6f4", "score": "0.7067532", "text": "def tags() []; end", "title": "" }, { "docid": "ef7eea916b099aa5e07a4fe4539d5a05", "score": "0.70587176", "text": "def fetch_tag_shas(tags); end", "title": "" }, { "docid": "becc175...
1f756676c459763fcdb67ac8f6cc29b5
GET /date_apps/1 GET /date_apps/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "39b87d19552b3c951083142f0001ec97", "score": "0.7067377", "text": "def index\n @date_apps = DateApp.all\n end", "title": "" }, { "docid": "39b87d19552b3c951083142f0001ec97", "score": "0.7067377", "text": "def index\n @date_apps = DateApp.all\n end", "title": ""...
795b30dc2e20d112eed99d0d07c08401
O(n) T | O(k) S
[ { "docid": "15df336494ba4fd4f4a4b26ab58f848f", "score": "0.0", "text": "def longest_substring_with_k_distinct(str1, k)\n start_index = 0\n max_length = 0\n char_freq = {}\n\n for end_index in 0..(str1.length - 1)\n right_char = str1[end_index]\n if !char_freq.include?(right_char)\n char_f...
[ { "docid": "7833712840af1ddaaa0e2c9e99deb86a", "score": "0.6373588", "text": "def josephus_survivor(n,k)\n result = [*1..n]\n while result.length > 1\n result.rotate!(k).pop\n end\n result.first\nend", "title": "" }, { "docid": "02b4115734153a85de31250c596da851", "score": "0.63518...
9430a10d4e1baa64547328b6517a42bc
TODO: how often updated?
[ { "docid": "72f126baa23853a7a2201e67327e37be", "score": "0.0", "text": "def worst\n sorted_specs.map do |spec|\n Result.new(\n spec.name,\n owners_of(spec).map { |o| o['email'] }\n )\n end\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.72408974", "text": "def private; end", "title": "" }, { "docid": "cb2162d3a1fd3434effd12aa702f250f", "score": "0.65943617", "text": "def update() end", "title": "" }, { "docid": "5ca2caa1a207739e77f437de35e41cf1",...
b1569be53e608fb68a9d8efce02eb103
POST /training_centers POST /training_centers.json
[ { "docid": "05a2e7cecfb3162a7a91a96cc537a3fe", "score": "0.6954785", "text": "def create\n @training_center = TrainingCenter.new(params[:training_center])\n\n respond_to do |format|\n if @training_center.save\n format.html { redirect_to @training_center, :notice => 'Training center was...
[ { "docid": "539dc840a561d331bcaf4bb3e3e4c51c", "score": "0.5895101", "text": "def create\n @data_center = DataCenter.new(params[:data_center])\n\n respond_to do |format|\n if @data_center.save\n format.html { redirect_to data_centers_path, :notice => 'Data center was successfully creat...
8ee72932ef69df11e88b53564d853e59
Returns the object in the form of hash
[ { "docid": "7f2e5dd34e628cb49304452d2dd73178", "score": "0.0", "text": "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "title...
[ { "docid": "027facb8b195665ceeb78f2c171e2881", "score": "0.8270299", "text": "def to_hash\n object\n end", "title": "" }, { "docid": "3be090c3f17c8013e2dee4d50a9daa36", "score": "0.78767854", "text": "def hash\r\n return to_s.hash\r\n end", "title": "" }, { ...
329cec345c0376c9589c97a85f27acd9
Calls the `dnu` command
[ { "docid": "61d690cc659fd5ee5da239f2549e02f7", "score": "0.79032654", "text": "def dnu(command, project: nil)\n if project\n Dir.chdir project.path do\n run_command 'dnu', command.to_s\n end\n else\n run_command 'dnu', command.to_s\n end\n ...
[ { "docid": "5298e1c7a911bb799d238b6570ed0ee1", "score": "0.577242", "text": "def run_uml(*command)\n options = command.last.is_a?(Hash) ? command.pop : {}\n command = command.dup\n\n # umdir should probably be set to data_dir to prevent zombies sockets\n process = Process.new...
7b1738630b5ecc99c85fd168ac1a254c
Sync files for a running HTTPS app job.
[ { "docid": "db52c1630b5f9b4de57dcff2b0959c43", "score": "0.72667396", "text": "def job_sync_files(job_dxid)\n request(\n \"/jobs/#{job_dxid}/syncFiles\",\n {},\n Net::HTTP::Patch::METHOD,\n )\n end", "title": "" } ]
[ { "docid": "1761b642cc09b937980e0fcd79a3bf6a", "score": "0.64385456", "text": "def sync_files\n service = Jobs::SyncFilesService.call(params[:id], @context)\n raise ApiError, service.message unless service.success?\n\n render json: { message: { type: service.status, text: service.message ...
9f9022d15ebf69a88706ef514cade919
PUT /waste_captures/1 PUT /waste_captures/1.json
[ { "docid": "e347019d579ddbc547f5b6b3ca117340", "score": "0.6859754", "text": "def update\n @waste_capture = WasteCapture.find(params[:id])\n\n respond_to do |format|\n if @waste_capture.update_attributes(params[:waste_capture])\n format.html { redirect_to @waste_capture, notice: 'Waste...
[ { "docid": "bcd7d408b1b8dd87f3d1d18be86fc357", "score": "0.62275064", "text": "def update\n respond_to do |format|\n if @capture.update(capture_params)\n format.html { redirect_to @capture, notice: 'Capture was successfully updated.' }\n format.json { render :show, status: :ok, loc...
37ddbfcd463699fb7eefe1bdb2d990a7
THIS HAS BEEN MOVED TO BASE CONTROLLER
[ { "docid": "59335fe6a51e9eb96d6d5f140d00cd4a", "score": "0.0", "text": "def collection_options(collection)\n if version >= Gem::Version.new('4.0')\n super\n else\n {\n links: collection_links(collection),\n meta: collection_me...
[ { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.67348903", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.67348903", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a...
d6da71a13dbacee3038a48ff2732484a
Public: Updated the first/last indicators of by groups. Returns nothing.
[ { "docid": "2928e575a5e251a6c12bde9fbdb471b2", "score": "0.6444414", "text": "def update_by_groups\n parent_first = false\n parent_last = false\n @by_groups.each do |grp|\n @by_first[grp] = ((self[grp] != self.prev[grp]) or parent_first)\n @by_last[grp] = ((self[grp] != sel...
[ { "docid": "94d9a13fc278b6da3a66d458b74d823f", "score": "0.6083044", "text": "def update_first_group(group)\n @new_arm.visit_groups.first.update_attributes(name: group.name, day: group.day, window_before: group.window_before,\n window_after: group.wind...
71e06d1489a6ea2839fd43b62a59d395
GET /users_carts_conectors/1 GET /users_carts_conectors/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "58588d20e911bc78d82383f0c609e685", "score": "0.73672765", "text": "def index\n @users_carts_conectors = UsersCartsConector.all\n end", "title": "" }, { "docid": "0bad5ba787aee56e9267a37d3a0a9288", "score": "0.69425577", "text": "def carts\n user = User.find(par...
680ef7697e636ccc75a288ada306dbfa
POST /models POST /models.json
[ { "docid": "f6a8ddf5646fe2491a25e55048cce637", "score": "0.6437336", "text": "def create\n @model = Model.new(model_params)\n respond_to do |format|\n if @model.save\n format.html { redirect_to models_path, notice: 'Model was successfully created.' }\n format.json { render :show...
[ { "docid": "28fd88cac0ddc4b856310ce80d994640", "score": "0.7274566", "text": "def create(model)\n response = connection.post url_for(:all), model.to_json\n handle_and_unpack_response(response, 201)\n end", "title": "" }, { "docid": "73a11b657bce801801db09bcce4e04e4", "score"...
26d0b11e7aee19ed4c032b7d62b3d110
Expand construction variable references and paths.
[ { "docid": "5a1002605fe4132dda9d42d4a11a2f2e", "score": "0.6712784", "text": "def expand(expr)\n expand_path(expand_varref(expr))\n end", "title": "" } ]
[ { "docid": "7c4bf13ce54db53835b3edeff11900ff", "score": "0.6207892", "text": "def expand_varref(varref, extra_vars = nil)\n vars =\n if extra_vars.nil?\n @varset\n else\n @varset.merge(extra_vars)\n end\n lambda_args = [env: self, vars: vars]\n vars....
db45c971e665e0b6f76554925a8d3f5b
Get the current state of the staking pool
[ { "docid": "f959e4d4668a11cd3391cf8559455368", "score": "0.0", "text": "def staking_pool_get(opts = {})\n data, _status_code, _headers = staking_pool_get_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "6e73a537b1fa5227b8cedba768fc5a06", "score": "0.72090644", "text": "def get_state\n return state\n end", "title": "" }, { "docid": "6cff55d1e554e658c82ec32020000d35", "score": "0.70437306", "text": "def get_state\n return @state\n end", "title": "" ...
6e3b776f115cee87cfabbaab05aa3b04
Returns hash wrapped as a Git instance
[ { "docid": "532e07aa6aea5b2f08d3453d3f7bdce1", "score": "0.0", "text": "def get_revision(revision_number)\n return Repository::GitRevision.new(revision_number, self)\n end", "title": "" } ]
[ { "docid": "24898cbf29a84655586beab283c21cb6", "score": "0.7805987", "text": "def git_hash_object(path)\n require 'mixlib/shellout'\n begin\n Mixlib::ShellOut.new(\"git hash-object #{path}\").run_command.stdout.chomp\n rescue\n ''\n end\nend", "title": "" }, { "docid": "f7f233130ee...
72cdb198ecb53702eca02daed42b312a
Adds a reference. Optionally adds a +type+ column, if :polymorphic option is provided. references and belongs_to are acceptable. ===== Examples t.references(:goat) t.references(:goat, :polymorphic => true) t.belongs_to(:goat)
[ { "docid": "97afd88ac2634b09bbbb79a4dff724b0", "score": "0.6730797", "text": "def references(*args)\n options = args.extract_options!\n polymorphic = options.delete(:polymorphic)\n args.each do |col|\n @base.add_column(@table_name, \"#{col}_id\", :integer, options)\n ...
[ { "docid": "fae23fcb65d6cc6a2dd1120afc565d98", "score": "0.62196517", "text": "def up\n create_table TABLE_NAME do |t|\n t.references :referencable, polymorphic: true, null: false\n t.references :reference, null: false\n\n t.timestamps\n end\n\n change_table TABLE_NAME do |t|\n ...
cdb764165a7446aaa153725ba99f7a21
Memoize this detection. The information is not critical, but takes some time to evaluate. Values are not expected to change often.
[ { "docid": "4e683fb048db35ccad4fc214c7bcfae7", "score": "0.0", "text": "def free_plan?(service_id, plans = nil)\n @free_plans ||= {}\n return @free_plans[service_id] if @free_plans.key?(service_id)\n plans ||= load_plans(service_id)\n @free_plans[service_id] =...
[ { "docid": "2b8bf85a581a9154c7acc69c2f317e4a", "score": "0.6613236", "text": "def __memoized; end", "title": "" }, { "docid": "ed59fbc562d35907cd5e5cd2538dd8fb", "score": "0.64389884", "text": "def memoize_conditionally; end", "title": "" }, { "docid": "a53959fed10a7510fa...
53cfac639733eed5a50ff5d4563ee411
DELETE /user/1 DELETE /user/1.xml
[ { "docid": "09e1e0c284dabed9ce7429ef805aae1a", "score": "0.0", "text": "def destroy\n @user = current_user.family.users.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" ...
[ { "docid": "d29aa233ddb4837c263e69069aaa2550", "score": "0.7542808", "text": "def user_delete(username)\n make_request(:delete,\"#{user_url(username)}.xml\")\n end", "title": "" }, { "docid": "31be2fbd2b5aedc5e7088866cdb5f8a3", "score": "0.70100963", "text": "def delete_user_...
dedc9722d05be8c7f62e18bc0158f4ec
Query a particular project based on it's id
[ { "docid": "eb9ffb324370f9c70e0b77d912aaa251", "score": "0.0", "text": "def get(project_id)\n Checklister::Sanitizer.symbolize @client.project(project_id).to_hash\n end", "title": "" } ]
[ { "docid": "553a86a87f37737527d505a437429273", "score": "0.8055436", "text": "def find_project_by_id(id)\n projects.find_by_id(id)\n end", "title": "" }, { "docid": "b36bd35586d68dce12ebf75812035724", "score": "0.7897068", "text": "def project(project_id, query={})\n per...
03f5cbace8e2b2eda3d1ce6e2c2f6ac9
set_feed end Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0af5130d12d1763a21574b5429f8c6c3", "score": "0.67010796", "text": "def feed_params\n params.require(:feed).permit(:feed_text, :date, :feed_image)\n end", "title": "" } ]
[ { "docid": "2c72cb576cb750fdf46b36cbd675d251", "score": "0.8227136", "text": "def set_feed\n @feed = Feed.find(params[:id])\n end", "title": "" }, { "docid": "2c72cb576cb750fdf46b36cbd675d251", "score": "0.8227136", "text": "def set_feed\n @feed = Feed.find(params[:id])\...
1c16fbb7e302f05f6cec53ce26d6976d
GET /lactations/1 GET /lactations/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "c9053e6696ed72fcee80805835cdb36e", "score": "0.7246095", "text": "def index\n @lactations = Lactation.all\n end", "title": "" }, { "docid": "3414f1c63db4e4aa38ba8270f383f0ff", "score": "0.67971396", "text": "def index\n @lacs = Lac.all\n\n respond_to do |format|...
47e28e53f9832efc4920163fcd5a5f58
Firewall Expert Rulezz Returns list of rules describing protocols and ports that are allowed to be accessed from listed hosts. All is returned as a single string. Zone needs to be defined.
[ { "docid": "d4ddced19d25d2c63dcbb8f6622ed2e5", "score": "0.6685925", "text": "def GetAcceptExpertRules(zone)\n zone = Builtins.toupper(zone)\n\n # Check for zone\n if !Builtins.contains(GetKnownFirewallZones(), zone)\n Builtins.y2error(\"Unknown firewall zone: %1\", zone)\n ...
[ { "docid": "64ae89b00118f610e3dff1aa9d4c2249", "score": "0.62854135", "text": "def rules\n @@api.get(endpoint: \"rules\")\n end", "title": "" }, { "docid": "cd5929b6085afbccf5169211362f7694", "score": "0.6037944", "text": "def all_rules\n @rules\n end", "title": "...
e2cab1bd5c44f016d1a03f8fcf17c002
Two grids are equal if they are the same size and all blocks are equal by location and corresponding number.
[ { "docid": "4f646a751b4f65931eedecdd0e64faba", "score": "0.7219634", "text": "def ==(other_grid)\n return @id == other_grid.id\n #result = false\n #if other_grid.x == @x && other_grid.y == @y \n # result = true\n # for y in 0...other_grid.y do\n # for x in 0...other_grid.x do\n ...
[ { "docid": "6fd447e83c21cc19b8c8970d2a97972a", "score": "0.75568724", "text": "def eql?(other_grid)\n return @id == other_grid.id\n #return @id == other_grid.id\n #result = false\n #if other_grid.x == @x && other_grid.y == @y \n # result = true\n # for y in 0...other_grid.y do\n #...
a6782f899540a8519a03704203eb92ba
check if self has line of sight to the supplied unit TODO: Create blocked spaces and actually use this
[ { "docid": "1edd183e85cc1bc92bf82063888424e1", "score": "0.55044985", "text": "def los?(unit)\n true \n end", "title": "" } ]
[ { "docid": "eea03ccec46cf6dbbcf0fbef924c7589", "score": "0.5977651", "text": "def diagonal_block?(x,y)\n #if the movement is a valid diagonal move\n if diagonal_move?(x, y) == true\n\n #if the endpoint x,y are both greater than starting x,y\n #NE direction slope\n if x > self.x_pos && y > self.y_po...
8dd263e1fb4b0e8191e98f6335e86913
GET /fillups/new GET /fillups/new.xml
[ { "docid": "bae29dc8f3a2c43b1888a6e543f3bb17", "score": "0.77634585", "text": "def new\n @fillup = Fillup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fillup }\n end\n end", "title": "" } ]
[ { "docid": "6b452061f8ad2c2a200d3b20e6babc57", "score": "0.7045145", "text": "def new\n @fillup = Fillup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fillup }\n end\n end", "title": "" }, { "docid": "2053838ac083a5e1c933288dbe2...
d10413153c6c2f38b4f73f74446f6b6e
End of class definition handler
[ { "docid": "55ce3f3cd470d4659ada9a4e9f49b3f3", "score": "0.0", "text": "def at_end\n return if ignored_file?(file)\n\n processor.at_end\n end", "title": "" } ]
[ { "docid": "281e9a43f3408650bd69047a8fabab55", "score": "0.73227495", "text": "def end; end", "title": "" }, { "docid": "281e9a43f3408650bd69047a8fabab55", "score": "0.73227495", "text": "def end; end", "title": "" }, { "docid": "281e9a43f3408650bd69047a8fabab55", "sc...
398b83eca9537bc36536b0bc2f80eaa8
to check each words in the sentence with frequency, put word frequency
[ { "docid": "b69997da7818c1418c0cff9e9bcc94ee", "score": "0.0", "text": "def what_up(greeting, *friends)\n friends.each { |friend| puts \"#{greeting}, #{friend}!\" }\nend", "title": "" } ]
[ { "docid": "ccf0e7f440288ed0e3e0f52d512fbbba", "score": "0.7852269", "text": "def find_frequency(sentence, word)\n count = Hash.new(0)\n sentence.downcase.split(' ').each{ |i| count[i] += 1 }\n count[word.downcase]\nend", "title": "" }, { "docid": "581ac9be7553515ca226b064354c5cca", "...
d174a13ad886ea05318208ad1baa6b1f
A helper to add a CSS class for each achievement, based on whether the course_user is an admin, course staff, or student. For students, the method also checks whether the course_user has obtained the achievement.
[ { "docid": "cff70d12c66b916d3813e2eb59755f03", "score": "0.7766397", "text": "def achievement_status_class(achievement, current_course_user)\n if current_course_user.nil? || current_course_user.staff?\n []\n elsif achievement.course_users.include?(current_course_user)\n ['granted']\n ...
[ { "docid": "126f915fcf262f78d212d0d2f726e9e5", "score": "0.58813745", "text": "def calc_achievements\n\n #TODO: Use a list of achievements in db with conditions stored in db, iterate and award as necessary. \n if (self.games_won_as_pacman == 10)\n self.user.achievements << Achievement.create(...
0f1f5c3c8aa97d89f896b234f47adc1e
DELETE /buttons/1 DELETE /buttons/1.json
[ { "docid": "9760f582fe20389b20f4d347c735d362", "score": "0.7589046", "text": "def destroy\r\n @button = Button.find(params[:id])\r\n @button.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to buttons_url }\r\n format.json { head :no_content }\r\n end\r\n end", ...
[ { "docid": "90c6af15c0d4a36066f8c0749555610f", "score": "0.7241405", "text": "def destroy\n @button.destroy\n respond_to do |format|\n format.html { redirect_to buttons_url, notice: 'Button was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "...
dae1be686285e7f8c282f48aded5bec0
This method handles 'opening' the disclosure triangle by an artist, album, genre or playlist and displaying the list of subsidiary items.
[ { "docid": "914561109481d03e4253c35108aa5755", "score": "0.5691571", "text": "def open\n case params[:type]\n when 'A'\n theArtist = Artist.find(params[:id])\n artists = Artist.find(:all, :conditions => \"artistName like \\\"#{theArtist.artistName}%\\\"\")\n albums = []\n artis...
[ { "docid": "97676338fa67960436e05bc27d281aa9", "score": "0.5693864", "text": "def answer_disclosure\n show do\n title \"Answer the IDT Biohazard Disclosure\"\n\n check \"Click Add to Order\"\n check \"Answer the disclosure\"\n check \"Sign your name and click add to cart.\"\n e...
8a7e45610b0634d1b529a82e92737129
one off method to load tournaments from quinterest db dump
[ { "docid": "969375b2399c2323ecbe355777b5e546", "score": "0.66195184", "text": "def load_tournaments(filename)\n json_string = File.open(filename).read\n questions = JSON.parse(json_string)\n\n ActiveRecord::Base.transaction do\n questions.each do |q|\n tournament = q[\"Tou...
[ { "docid": "bff4a65d56a7c04e36dd0646ab8b81d3", "score": "0.54639596", "text": "def entries\n tournaments_with_entries.collect{|t|t.entries}.flatten\n # Entry.find_by_sql [\n # \"SELECT e.* from entries e, tournaments t WHERE e.tournament_id = t.id AND t.league_id = ?\",\n # id]\n en...
0e0710588dfdb51a6206d83c76da11ce
Define a association_pks method using the block for the association reflection
[ { "docid": "f88448af570350b88958c705200633d7", "score": "0.79444563", "text": "def def_association_pks_getter(opts, &block)\n association_module_def(:\"#{singularize(opts[:name])}_pks\", &block)\n end", "title": "" } ]
[ { "docid": "a716b6793e76f585875dea07155b782f", "score": "0.74654245", "text": "def def_association_pks_setter(opts, &block)\n association_module_def(:\"#{singularize(opts[:name])}_pks=\", &block) unless opts[:read_only]\n end", "title": "" }, { "docid": "2c9ed3cd8b44432ac8939...
dc6b0a78eb8a5841d8e30eceb059471f
GET /game_round_assets GET /game_round_assets.json
[ { "docid": "745661f1ebc5699eb7c676a4fede20ff", "score": "0.7826672", "text": "def index\n @game_round_assets = GameRoundAsset.all\n end", "title": "" } ]
[ { "docid": "9506ffc114b76251bf2ab5a123ad5ffe", "score": "0.6868133", "text": "def assets(query = {})\n self.class.get(\"/assets.json\", :query => query)\n end", "title": "" }, { "docid": "dff92909e7efb8d4f58e12bdf13a071c", "score": "0.6847285", "text": "def assets\n Chute::G...
37f5a4aa73c985e0c9168c9074d9bb82
This prefix is added to the Rails URL helper names before they're called. By default, it's the underscored list of namespaces of the current controller, or nil if there are no namespaces defined. However, it can be overridden if another prefix is needed. Note that if this is overridden, the new method should return a s...
[ { "docid": "39471ed971b2573ab92d1d78681f6970", "score": "0.83841044", "text": "def url_helper_prefix\n namespaces.empty? ? '' : \"#{namespaces.join('_')}_\"\n end", "title": "" } ]
[ { "docid": "3e8721762277dbb1f1d72cc78751c355", "score": "0.8223744", "text": "def url_helper_prefix\n if defined?(namespace_prefix)\n STDERR.puts <<END.gsub(\"\\n\", ' ')\nDEPRECATION WARNING: \nThe make_resourceful #namespace_prefix accessor\nis deprecated and will be removed in 0.3.0.\...
71a53c14d52f8299320f8ea53d7657be
the number of inputs = the number of message parts complex types are expanded and stored in 'computational_type_details' attribute
[ { "docid": "dec1e81b8915f6cb55188db01c33a3fa", "score": "0.0", "text": "def parse\n message_data ={\"parts\" => [] }\n @message_element.elements.each(@message_type) do |message|\n message_data[\"name\"] = message.attributes['name']\n message.elements.each(\"parts/...
[ { "docid": "4c3a6b6d6ac52c59647464086df26f65", "score": "0.6738869", "text": "def processor_input_field_count\r\n constant_fields = [payer_type, payer, pay_address_one, pay_address_two,\r\n payer_city, payer_state, payer_zip]\r\n fc_ui_fields = [payer_tin]\r\n total_field_array = constant_...
940fe79edcfd483eca00eb0c39bbb927
GET /registration/whitelabels/new GET /registration/whitelabels/new.json
[ { "docid": "0563968df9efe6a19d78a91aa12c3f63", "score": "0.8057462", "text": "def new\n @registration_whitelabel = Registration::Whitelabel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @registration_whitelabel }\n end\n end", "title": "...
[ { "docid": "66d442b2d72127007daf748a36bfb017", "score": "0.77621555", "text": "def create\n @registration_whitelabel = Registration::Whitelabel.new(params[:registration_whitelabel])\n\n respond_to do |format|\n if @registration_whitelabel.save\n format.html { redirect_to @registration_...