query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
7d370adac21122f9bdd9ac34c61ad73d
Never trust parameters from the scary internet only allow the white list through.
[ { "docid": "f3834011099aa9fcb4c52ccc6fe7dfdc", "score": "0.0", "text": "def movie_params\n accessible = [:title, :vote_count, :vote_average, :tagline, :status, :poster_path, :original_language, :backdrop_path, :adult, :overview, :popularity, :budget, :release_date, :revenue, :runtime, genre_ids: []]\...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7477261", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69700533", "text": "def strong_params\n params.require(:request).permit(param_whit...
21ce4021c077b0f1700eed40af17a3a0
Log in/sign up with linkedin To configure Linkedin authorization, add the following to config/initializers/generic_api.rb: config.use_linkedin(client_id: '1234567890', client_secret: 'abcdefghij', redirect_uri: '
[ { "docid": "40c2bbe7ef3ac3d1bab9bc1d7e70f092", "score": "0.8136834", "text": "def linkedin\n linkedin_config = GenericApiRails.config.linkedin_hash\n if linkedin_config.nil?\n logger.error('Linkedin login/signup not configured. For configuration instructions see controllers/generic_api_rails/...
[ { "docid": "4e65f6efc64011612c9a2dd9dc3d5497", "score": "0.78645605", "text": "def startLinkedInAuth\n require 'oauth2'\n\n client = OAuth2::Client.new('75yetg1f8atx89', 'le39CGDc1yQLCo9U', :site => 'https://www.linkedin.com/', :authorize_url => '/uas/oauth2/authorization')\n #speci...
9fdddbf8a643792a8382a532871a57cf
Currently assumes that to do anything you have to be able to manage Group TODO: finer controls
[ { "docid": "18f1dda4ec1a5fa9c459c8ec9f98f52d", "score": "0.0", "text": "def auth\n if current_user.nil? \n flash[:notice] = \"You need to login to manage groups\"\n redirect_to new_user_session_path\n elsif cannot? :manage, Admin::Group\n flash[:notice] = \"You do not have permissio...
[ { "docid": "687dded7cd202c9b1252e142312a03c4", "score": "0.7771902", "text": "def groups; end", "title": "" }, { "docid": "687dded7cd202c9b1252e142312a03c4", "score": "0.7771902", "text": "def groups; end", "title": "" }, { "docid": "687dded7cd202c9b1252e142312a03c4", ...
5b35792e3178b0344b53788bfb11f57a
method return course name and batch name
[ { "docid": "2d1885aadc0490356a30bcb045698eee", "score": "0.8375893", "text": "def batch_course_name\n [course.course_name, name].join(' ')\n end", "title": "" } ]
[ { "docid": "14c117d624217b5dd4961de008f70e2a", "score": "0.75629526", "text": "def batch_course_code\n [course.code, name].join(' ')\n end", "title": "" }, { "docid": "154efac5f7091aa7611bd4e72aa187e8", "score": "0.7104742", "text": "def full_name\n [course_name, section_name]...
597f90a3aff39143ce17d3b635d000c9
GET /course_weeks GET /course_weeks.json
[ { "docid": "874d485a958ef9a07312659a30e3650a", "score": "0.7495317", "text": "def index\n @course_weeks = CourseWeek.all\n end", "title": "" } ]
[ { "docid": "d996c9e3dd0327f605002f56c59e84b0", "score": "0.75474465", "text": "def index\n @weeks = Course.find(set_course_id).weeks\n\n render ({\n json: {\n message: \"Success\",\n weeks: @weeks.map do |week|\n {\n id: week.id,\n week_number: wee...
84d01ab5534009fd564c6890618cedba
Gets and deletes message.
[ { "docid": "15a5783a8cbf997ea8dbff79dce41698", "score": "0.0", "text": "def pop(qname)\n q(qname).pop\n end", "title": "" } ]
[ { "docid": "a0bacbc79debf6fd9955abdd6486c186", "score": "0.7764613", "text": "def delete\n client.post('/api/del_msg', id: read_attribute(:name))\n end", "title": "" }, { "docid": "ee3b36d94e9fa9123f5e7ac28e6d7020", "score": "0.771555", "text": "def delete\n @clien...
3189860ae764f5be27733a99c9084c87
method to sum up the rain data into hourly rain sums for that calculate the difference from the rain value at the start and end of the currently checked hour
[ { "docid": "544379d71fae6c6d2a1fe5fa9dc22f8c", "score": "0.82922333", "text": "def calculate_hourly_rainsum\n rain_data = @forecast_data[:rain]\n @hourly_rain = Array.new()\n # when using an offset, start with the current value as delta\n previous_hour = rain_data[0]\n previous_...
[ { "docid": "d0bdce64ba8866d882d6d2503c7a1f7d", "score": "0.7940885", "text": "def calculate_rainsum\n @rain_sum = 0\n @hourly_rain.each { |value|\n @rain_sum += value\n }\n nil\n end", "title": "" }, { "docid": "8e5922b74d03c5c18ac48359eca57fd0", ...
ba4d5db1f7fff65818f97b786f6110f3
PUT /cart_items/1 PUT /cart_items/1.xml
[ { "docid": "7b0578e385c1f6c5673057e739d6c370", "score": "0.62016094", "text": "def update\n @cart_item = CartItem.find(params[:id])\n @direction = params[:direction]\n @items_change_quantity = params[:quantity]\n\n if @direction==\"+\"\n @cart_item.quantity += @items_change_quantity.to_...
[ { "docid": "aabd357abf4c4ad53038a7d3f2b83ffc", "score": "0.68584114", "text": "def update\n @cart_item = CartItem.find(params[:id])\n\n respond_to do |format|\n if @cart_item.update_attributes(params[:cart_item])\n format.html { redirect_to(@cart_item, :notice => 'Cart item was success...
216cd018d947726709a9e2e741a6e8de
Set the value of the NoReboot input for this Choreo.
[ { "docid": "0170fcfc6c5fb5addf7f3d8c605ae62b", "score": "0.7914435", "text": "def set_NoReboot(value)\n set_input(\"NoReboot\", value)\n end", "title": "" } ]
[ { "docid": "7c5542ddf7a19f1f9b47cf9f80209e60", "score": "0.59019536", "text": "def requires_reboot=(value)\n @requires_reboot = value\n end", "title": "" }, { "docid": "68fe161827111e74a04da9d5823f0f5c", "score": "0.57363504", "text": "def reboot=(value)\n ...
5efcbdc84c1342293a6e7149b740770d
GET /sp_earnings/new GET /sp_earnings/new.json
[ { "docid": "74c32613de8549e3d4c4875ffb4c1c95", "score": "0.83910424", "text": "def new\n @sp_earning = SpEarning.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sp_earning }\n end\n end", "title": "" } ]
[ { "docid": "242cb79e1c36f83db3624a0f09c7d311", "score": "0.7816054", "text": "def create\n @sp_earning = SpEarning.new(params[:sp_earning])\n\n respond_to do |format|\n if @sp_earning.save\n format.html { redirect_to @sp_earning, notice: 'Sp earning was successfully created.' }\n ...
e7132d8c385eecab133d97e3faf59bbe
PUT /admin/contacts/1 PUT /admin/contacts/1.xml
[ { "docid": "960a7e7a50b4cefb0973d0ef09a47ffe", "score": "0.5951629", "text": "def update\n @contact = Contact.find(params[:id])\n\n respond_to do |format|\n if @contact.update_attributes(params[:contact])\n flash[:notice] = 'Contact was successfully updated.'\n format.html { red...
[ { "docid": "a21658e8869b48b877bfbe57de8fb717", "score": "0.6777251", "text": "def update_contact\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts/3'\n ).to_s\n\n puts RestClient.put(\n url,\n { Contact: { email: \"wacky_new_email@...
0937f8ae024d5fa74b5bd25424d9a080
GET /data_points/new GET /data_points/new.xml
[ { "docid": "4b7a29f29e889bc3e92fbb31d6347e01", "score": "0.706072", "text": "def new\n \tputs \"making a new data point!\"\n @data_point = DataPoint.new\n \n @data_point_already_exists = DataPoint.data_point_exists(params[:well_id], params[:date])\n\n @data_point.date = params[:date]\n @...
[ { "docid": "b38664a6c3a39fe4a638aa6cc28b6d00", "score": "0.75937897", "text": "def new\n @old_point = OldPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @old_point }\n end\n end", "title": "" }, { "docid": "0ce0a6e41e1e5f03...
71678c1fb86082dd6f04fb06e0d523b0
Returns a CountryInfo instance for the given ISO 31661 alpha2 country code. Raises InvalidCountryCode if the country could not be found or the code is invalid. source://tzinfo//lib/tzinfo/data_source.rb144
[ { "docid": "fd8768e79e81df4aa0cac986ea34f514", "score": "0.65892786", "text": "def load_country_info(code); end", "title": "" } ]
[ { "docid": "7d1db14894cf0666ddb0e31274aaab95", "score": "0.69809604", "text": "def load_country_info(code)\n info = @country_index[code]\n raise InvalidCountryCode.new, 'Invalid country code' unless info\n info\n end", "title": "" }, { "docid": "5aeadd5913d1765786d1b370e2b9...
025b8c6d1ac3b72c27caf1655c4abaa8
Create a new Crunch::Table headers Array of header names for the table block Block evaluated in the context of the instance, for convenience Examples table = Crunch::Table.new(["a", "b"]) do integer("a") date("b") end table.push(['1', '20110101']) Returns an instance of Crunch::Table
[ { "docid": "3b2c7ef19e80249f5f3109e478874672", "score": "0.59887403", "text": "def initialize(headers, &block)\n @transforms = []\n @filters = []\n @table = CSV::Table.new([])\n @headers = headers\n\n if block_given?\n block.arity == 1 ? yield(self) : instance_...
[ { "docid": "6b3274a9a3e0d6896651866ba34bbd27", "score": "0.68610454", "text": "def table_headers\n [\"Description\", \"Qty\", \"VAT\", \"Amount\"]\n end", "title": "" }, { "docid": "7e54b536654dabdbfb5ab7468158fdc3", "score": "0.6718063", "text": "def generate_header\n \"<tabl...
8025cd582b42d14b0801c707e91f0c83
signin form data is submitted via POST request to "/sessions/create", mapped to sessionscreate
[ { "docid": "1770b63201b76be2cb437389a23eece0", "score": "0.0", "text": "def create # receives data submitted in login form, authenticates and logs in a valid user\n @user = User.find_by(name: params[:user][:name])\n\n if @user && @user.authenticate(params[:user][:password])\n session[:user_id...
[ { "docid": "a87d6843786cfe854f7c5f478902b1dc", "score": "0.7455636", "text": "def create\n identity = Identity.authenticate(params[:session][:login],\n params[:session][:password])\n \n if identity.nil?\n logSigninFailure...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "bfb6ff4bbaadec696e2e03332e64b2da", "score": "0.0", "text": "def scholarship_guide_params\n params.require(:scholarship_guide).permit(:program_name, :image_url, :metric_box1, :metric_box2, :metric_box3, :description_short, :description_long, :app_count, :essay_count, :transcript_count, :...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69811666", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782836", "text": "def strong_params\n params.requ...
e95adc25a02938ab375ef147ad7ca610
Converts from a string value (perhaps off the wire) to an instance of this enum type.
[ { "docid": "d43974f6b269787e2dbfb85609bef0e6", "score": "0.67317176", "text": "def from_string(value)\n const_get(value)\n rescue NameError\n TestStatus.send(:new, 'UNKNOWN', value)\n end", "title": "" } ]
[ { "docid": "af3972b63affaa3440a597374c93c1ae", "score": "0.7495569", "text": "def from_string(value)\n const_get(value)\n rescue NameError\n Type.send(:new, 'UNKNOWN', value)\n end", "title": "" }, { "docid": "af3972b63affaa3440a597374c93c1ae", "score": "0...
926fd968a34f912697b0c1a96c47fe95
Set value to nil if val is an empty string
[ { "docid": "7e7abe521a80a9240c73c5338adcbf51", "score": "0.8023174", "text": "def empty_string_to_nil(val)\n return if !val || val == \"\"\n return val\n end", "title": "" } ]
[ { "docid": "182bb5c4051539d1ff1369d904c29881", "score": "0.7906606", "text": "def clear_value_if_empty\n write_attribute(:value, nil) if self.value.is_a?(String) && self.value.empty?\n end", "title": "" }, { "docid": "9c98d11aa1994be8106d85bc6a002ea2", "score": "0.761718", "text"...
ae01684f84fecadc058bf9964780036a
Create a new photo modification in the database.
[ { "docid": "e1e434584557ecc432e87c2c3a9196b0", "score": "0.0", "text": "def create(attributes)\n modification = new(attributes)\n modification.save!\n end", "title": "" } ]
[ { "docid": "2e53d2a3b479e1804f2e2fa7da37407d", "score": "0.69730306", "text": "def create\n @photo = Photo.create(params[:photo])\n end", "title": "" }, { "docid": "4d201cd41f3690816b806417ef669292", "score": "0.69090503", "text": "def create_or_update_photo! file\n if recipe_...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "902f4acc021b5881cf366b29ba0380c3", "score": "0.0", "text": "def set_teacher\n @teacher = Teacher.find(params[:id])\n @title = @teacher.name\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6164095", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6046031", "text": "def action_hook;...
d0df87b1bea9b55706b1c7c4184cdaba
PATCH/PUT /posts/1 PATCH/PUT /posts/1.json
[ { "docid": "0fef7c5e43b365c7d4cb09d256bb46ae", "score": "0.0", "text": "def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @post }\n ...
[ { "docid": "2a642a611c63a85b6ef6e72d09830e50", "score": "0.71867543", "text": "def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end", "title": "" }, { "docid": "e2c68cadce474543233abd080997b452", "score": "0.7042899", "text": "def update\n respond_...
096edd747131ef8156c8d70757c97ad5
Auto generated FRBR relationship Returns all FRBR objects for the relationship sells to which_events?
[ { "docid": "c6353059b6e81ccf391af7bd19c602ba", "score": "0.7143284", "text": "def sold_events\n find_related_frbr_objects( :sells, :which_events?) \n end", "title": "" } ]
[ { "docid": "fd14f1d96dd81de026efba96432454d5", "score": "0.6781465", "text": "def funded_events\n find_related_frbr_objects( :funds, :which_events?) \n end", "title": "" }, { "docid": "c04ad5a9339ecb16f6507f8c442cfd2c", "score": "0.65407526", "text": "def genred_event...
cf9e01ffe5bfbe0c008a81ffd4006ad5
parse json from url data
[ { "docid": "ca7fb5dff8e138c8a77add9421b5db29", "score": "0.6379937", "text": "def open_jsonurl(url)\n data = self.openurl(url)\n if data != '' and data != nil\n json = JSON.parse(data)\n if json.has_key? 'error_messages'\n raise Puppet::Error, 'Error retrieving url data: ' + json[...
[ { "docid": "6e32d72d893db972d77f57422ed8ae78", "score": "0.77736306", "text": "def parse_fetched_json(json_from_url)\n JSON.parse(json_from_url)\n end", "title": "" }, { "docid": "74fa8ac09a033755c88a1826405cf2ba", "score": "0.74011534", "text": "def parse_json( url )\n result =...
328f234f4ec24d35627d50f56d78c545
Set an option string, setting its changed flag in the same blow.
[ { "docid": "fa3f7c932cd288b213cdb1abf7b0dd6f", "score": "0.5923297", "text": "def set(key, newValue)\n newValue = newValue.gsub(/[\\\"\\n\\r]/, \"\") # strips some bad characters\n v = @options[key]\n\n if !v\n v = Value.new\n @options[key] = v\n end\n\n v.setValue(newValue)\n ...
[ { "docid": "f3092a2ea9670c99e2db40bb44e52d0c", "score": "0.79265", "text": "def set(opt, str, value)\n name = long?(str) ? opt_name(str) : opt.name\n value = true if value.nil? && opt.flag?\n args = [opts, opt.type, name, value]\n args = args[-opt.block.arity, opt.block.arity]\n ...
b447513335ac18752977e02960f24283
This initialization routine does nothing unless :active_record is one of the frameworks to load (Configurationframeworks). If it is, this sets the database configuration from Configurationdatabase_configuration and then establishes the connection.
[ { "docid": "7ea7a07b66b855770e88f1f9a029803b", "score": "0.8356228", "text": "def initialize_database\n return unless configuration.frameworks.include?(:active_record)\n ActiveRecord::Base.configurations = configuration.database_configuration\n ActiveRecord::Base.establish_connection(REST...
[ { "docid": "ce15283b18b2a899986a0797080b7c80", "score": "0.8707136", "text": "def initialize_database\n if configuration.frameworks.include?(:active_record)\n ActiveRecord::Base.configurations = configuration.database_configuration\n ActiveRecord::Base.establish_connection\n end\...
3bcd3002235e06368630f8221bcf1565
within 50 moves, there is no movement in pawns, or no capture
[ { "docid": "a9d229ef767e48092b5589041ce28609", "score": "0.64401305", "text": "def fifty_move?\n @between_capture >= 50\n end", "title": "" } ]
[ { "docid": "5ffdaa5e1a824eee68e0317725befe6a", "score": "0.67831045", "text": "def possible_capture_moves\n check_move = []\n x = @x - 1\n y = @y + 1 if @color == \"w\"\n y = @y - 1 if @color == \"b\"\n 2.times do\n if CONDITION.call(x,y)\n check_move << [x,y]\n x += 2\...
1747ab38a424d5205fee232a5e57a608
Helper class method to lookup comments for the mixin commentable type written by a given user. This method is NOT finding all comments for user
[ { "docid": "54c64132c2d8e1129fc2d20730be9021", "score": "0.6669734", "text": "def find_comments_by_user(user) \n # TODO - does this really work with STI ?\n commentable = ActiveRecord::Base.send(:class_name_of_active_record_descendant, self).to_s\n first_item = Comment.roots({...
[ { "docid": "3925ee4d676d8dde04da5cedb35ecbe8", "score": "0.6921446", "text": "def find_comments_by_user(user)\n commentable = self.base_class.name.to_s\n Comment.where(:user_id => user.id, :commentable_type => commentable).order('created_at DESC')\n end", "title": "" }, { "docid...
4dbeadba5785f2c99910c513b4fc8c71
Return an array of pages for this site
[ { "docid": "ecda454618198c72133073ed969c990d", "score": "0.6686427", "text": "def pages\n @pages = Site.find(params[:site_id]).pages\n render\n end", "title": "" } ]
[ { "docid": "6951dd0016ae4193cacc4039d8d27c0d", "score": "0.7685504", "text": "def pages\n return @pages\n end", "title": "" }, { "docid": "6951dd0016ae4193cacc4039d8d27c0d", "score": "0.7685504", "text": "def pages\n return @pages\n ...
1f23349897ce92c25bbf395ee396543a
Wait for all server(s) to enter state. state state to wait for, eg. operational
[ { "docid": "1fd180276a8fb38f5ebdbce711480940", "score": "0.83631676", "text": "def wait_for_all(state, timeout=1200)\n state_wait(@servers, state, timeout)\n end", "title": "" } ]
[ { "docid": "42a9dcbf4b8033b7cc70ff04526e6f4e", "score": "0.7512735", "text": "def wait_for_state(server_name, state)\n (1..60).each do |c|\n srv = find_fog_server(server_name)\n if srv.status == state\n break\n end\n ...
f802e7a015b7de346da0ec601b096fbe
Updates the ICalendarformatted object
[ { "docid": "bf323d69e27e5f08b83e01ee167ba290", "score": "0.0", "text": "def put(_calendar_data)\n fail Dav::Exception::MethodNotAllowed, 'Updating scheduling objects is not supported'\n end", "title": "" } ]
[ { "docid": "a426248e1ebd8db78acedf66c0ac4d16", "score": "0.66930646", "text": "def update_calendar(calendar_id, prop_patch)\n end", "title": "" }, { "docid": "a426248e1ebd8db78acedf66c0ac4d16", "score": "0.66930646", "text": "def update_calendar(calendar_id, prop_patch)\n ...
339bf9de82169bbffa14244e58e30d20
GET /serie_cronologicas GET /serie_cronologicas.xml
[ { "docid": "e80b09bc7d8e426776f0117a7a899c8b", "score": "0.56583303", "text": "def index\n unless params[:busqueda].blank? \n @serie_cronologicas = SerieCronologica.paginate(:per_page => 20, :page => params[:page], :order => 'fechaYear DESC', :conditions => ['fechaYear like ? OR hecho like ...
[ { "docid": "ad9ce7644b240a2f609e4aa6f319b212", "score": "0.66061926", "text": "def show\n @serie_cronologica = SerieCronologica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @serie_cronologica }\n end\n end", "title": ""...
9e035c61a03fae038146462cfe667894
GET /quartets GET /quartets.json
[ { "docid": "eada7494da934563717d179596113776", "score": "0.7249607", "text": "def index\n @quartets = Quartet.all\n end", "title": "" } ]
[ { "docid": "defef149cd8ee5940b7b2e99aedca6b5", "score": "0.68891895", "text": "def show\n @quartet = Quartet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quartet }\n end\n end", "title": "" }, { "docid": "c586701...
7790b0ba302e2a4fc40d90ba34cfb9e0
Create a new model (begin phase)
[ { "docid": "342a662406152150095ab10bd0966137", "score": "0.5674473", "text": "def create_begin\n buffer.allocate(4 + @_model.fbe_size)\n end", "title": "" } ]
[ { "docid": "20cbb35839f2011cdcba6ad5479840ef", "score": "0.6614359", "text": "def createModel(model, trim, km, year, type, driveTrain, trans, id, status, fuel, features)\n @carModel = CarModel.new(model, trim, km, year, type, driveTrain, trans, id, status, fuel, features)\n self.model = model\n ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "0ed8ecb2f29c707654f758006d0e3a5d", "score": "0.0", "text": "def appointment_params\n params.require(:appointment).permit(:id, :client_id, :title, :description, :starting, :ending)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
c81ca1ff1fbea89c19790743d96db126
Returns the value of attribute target
[ { "docid": "6a63e93be3f3c1b3b498b22d4d08d323", "score": "0.0", "text": "def target; end", "title": "" } ]
[ { "docid": "34aa3d523dcaddf11f5844b85788e9e5", "score": "0.83561057", "text": "def target\n attributes.fetch(:target)\n end", "title": "" }, { "docid": "9463eb9650fcd7d4f8ea600df61ad0ab", "score": "0.8251367", "text": "def target\n attributes['target']\n end",...
0f267e340808071e5f45aa620d74f6e9
Synchronize the channels data with that of the received channel state.
[ { "docid": "c524c23a1c02fd0f0d116313c2d9891d", "score": "0.7854391", "text": "def synchronize channel_state\n @name = channel_state.name\n @temporary = channel_state.temporary\n end", "title": "" } ]
[ { "docid": "5a8918e238ca6e9d6ce9517d20ee96ea", "score": "0.59834814", "text": "def sync!\n write_data && reload!\n end", "title": "" }, { "docid": "4d1efb584aa8e8760368d77ba3e8610d", "score": "0.59122026", "text": "def send_data_state(channel)\n data = channel[:io].r...
6d825e4c6c6af2a13925a2bb16ce7bd5
Should admins be notified about this?
[ { "docid": "0ef3a6de34ada8cd074026d94f22bfa2", "score": "0.0", "text": "def student_applied(submission)\n @advisor = submission.project.advisor\n @student = submission.student\n @project = submission.project\n @submission = submission\n @to = @advisor.email\n @title = \"New application...
[ { "docid": "6c084da67fedb347be6a13a811baf1b9", "score": "0.6692006", "text": "def notifies()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "d3e6728db4a80c3d5a57cbe50528d642", "score": "0.6520184", "text": "def already_reported; end", "ti...
a8fb908521d441c56595e4eed6554afb
The Almost brute force method
[ { "docid": "fbd0a8231fb2c8f74b2c3743e7945ff7", "score": "0.0", "text": "def largest_prime_factor_v1(number)\n largest_factor = 0\n\n 2.upto(Math.sqrt(number).floor) do |i|\n if factor?(number, i)\n if prime?(i)\n if largest_factor < i\n largest_factor = i\n end\n en...
[ { "docid": "1edbe81b46c1ca0c4bc5948833c9ed8e", "score": "0.6988922", "text": "def brute_force\n (1..1001).each do |a|\n (a+1..1001).each do |b|\n c2 = a*a + b*b\n c = Math.sqrt(a*a + b*b)\n return [a,b,c.to_i] if (c.to_i == c) && (a + b + c == 1000)\n end\n end\nend", "title":...
667cd945208267606893684bb1efe752
Will be executed when WS connection closed. see close_code, close_reason for details.
[ { "docid": "0b9a4445ccc6db3fcc160b8bd45879a8", "score": "0.6622307", "text": "def on_close\n end", "title": "" } ]
[ { "docid": "918e7adad7dc504e76af48c7b0e5aca7", "score": "0.76164174", "text": "def on_connection_closing(event)\n end", "title": "" }, { "docid": "dab3165ead67c4d1af441de05ca6ecd1", "score": "0.7569357", "text": "def on_connection_closed(event)\n end", "title": "" }, { ...
c406aa45132e0bc915ab5a6e815b681f
Initializes new instance of Richtext with the filter provided. Does not make request to libyuirestapi.
[ { "docid": "0c08fa3d0cbf93ea15320b2b3ff09f4c", "score": "0.76547724", "text": "def richtext(filter)\n Widgets::Richtext.new(@widget_controller, FilterExtractor.new(filter))\n end", "title": "" } ]
[ { "docid": "7c0690c4b9b5ea835edcfee2c22c904b", "score": "0.6334629", "text": "def initialize(text)\n @raw = text\n end", "title": "" }, { "docid": "01fa667f656b5ae07620d769c010b6fe", "score": "0.6245918", "text": "def initialize(text)\n @text = text\n end", "title...
557e040fbcc7588463eea8530c1d01f9
Write from memory to a device
[ { "docid": "7c6bdba49c9efcf9fda88321ebf97daf", "score": "0.6894081", "text": "def call_out(reg_key, addr, i_reg, device_num)\n word = @computer.memory.read( get_mem_addr(addr, i_reg) )\n dev = @computer.get_device(device_num)\n dev.write(word)\n end", "title": "" } ]
[ { "docid": "e0ec8f30eea0167a07f5305587cd0d79", "score": "0.7475091", "text": "def write!\n @dev = File.open(@device, \"w\") if (@dev.nil? || @dev.closed?)\n @dev.write @bytes.pack(\"c*\")\n @dev.flush\n end", "title": "" }, { "docid": "df44ef1ab7a472768bf75fbdd34c3ec7", "score"...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0523f18f99a92252495b95c2dd1f3c4e", "score": "0.0", "text": "def set_lesson_template\n @lesson_template = LessonTemplate.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...
6ff3aabc89b824eea8234508be80c6ac
def get_as_json return quotes_json end
[ { "docid": "2e5603987a32c502a764dafa77ae8761", "score": "0.7222712", "text": "def quotes_json\n conn = Faraday.new(url: ENV['FINANCE_APP'])\n conn.get do |req|\n req.url '/quotes'\n req.headers['Content-Type'] = 'application/json'\n req.headers['Authorization'] = ENV['AUTH_TOKEN'...
[ { "docid": "ca97cef13b7e1633c683c93ce8903959", "score": "0.7658324", "text": "def as_json; end", "title": "" }, { "docid": "ca97cef13b7e1633c683c93ce8903959", "score": "0.7658324", "text": "def as_json; end", "title": "" }, { "docid": "ca97cef13b7e1633c683c93ce8903959", ...
3c04d27177e8156a2f58507f76ff2872
GET /sections/new GET /sections/new.json
[ { "docid": "f035008d1c333a89b623664551f1ab1f", "score": "0.74963415", "text": "def new\n @section = Section.new(:schoolyear_id => Schoolyear.current.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @section }\n end\n end", "title": "" } ]
[ { "docid": "7e6cfb9f0befc407521a57626c131790", "score": "0.7935321", "text": "def new\n @section = Section.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @section }\n end\n end", "title": "" }, { "docid": "7e6cfb9f0befc407521a5762...
9451b3b0e9c634a6a52dd527be637b20
Rewrite the method that creates tables to easily accept extra options
[ { "docid": "296284482a1955b15c164c4b71a14257", "score": "0.7436052", "text": "def create_table(table_name, **options, &block)\n table_name = \"#{options[:schema]}.#{table_name}\" if options[:schema].present?\n\n options[:id] = false if options[:inherits].present? &&\n option...
[ { "docid": "b1627312310835994754a200f5841695", "score": "0.7898763", "text": "def create_tables\n raise \"Need to implement abstract method.\" \n end", "title": "" }, { "docid": "95d5d52f0193687391b65e7eff5ffea0", "score": "0.7856866", "text": "def create_table; end", ...
22b48919c598be4c956c55013bb7ae9d
Returns the value of attribute page. source://mechanize//lib/mechanize/page/link.rb18
[ { "docid": "0085b32535e74992312639a0ed6d2796", "score": "0.0", "text": "def referer; end", "title": "" } ]
[ { "docid": "aa6e68717e4f913521534467a585997e", "score": "0.66235894", "text": "def get_value\n if linked?\n return @link.to.get_value\n end\n return false\n end", "title": "" }, { "docid": "792c5747253fc960fd04ff6efc18db5c", "score": "0.6402619", "text": "def link\n ...
73801d6f2d87ce6c0999160fbdb01ed9
=begin def country=( country_name, dependent = true ) super( country_name ) if dependent country_ref = Country.find_by_name( country_name ) self.country_region_id=( country_ref.fedex_code, !dependent ) unless country_ref.nil? self.send( :country_region_id=, country_ref.fedex_code, false ) unless country_ref.nil? end en...
[ { "docid": "0b71b0a18d00cddb5971f6f168688c96", "score": "0.6644154", "text": "def before_save\r\n=begin\r\n if self.country_region_id.nil? || self.country_region_id.empty?\r\n country = Country.find_by_name( self.country )\r\n self.country_region_id = country.fedex_code unless country.nil?\...
[ { "docid": "48214e4f5c5328fe8948ab7b75b9a550", "score": "0.80276334", "text": "def set_country\n self.country = self.region.country if self.region && self.region.country\n end", "title": "" }, { "docid": "5881421be1d9d417ced6f679c930a61f", "score": "0.74153304", "text": "def set_...
02f1fcce6a6b4069617887b4db1ce221
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.order_notifier.received.subject
[ { "docid": "5f06aac2bf3a11f61af5e510bfd0b189", "score": "0.5640393", "text": "def received(order)\n @order = order\n mail to: order.email, subject: 'Pragmatic Store Order Confirmation'\n end", "title": "" } ]
[ { "docid": "c4a674d85e621eef1f1b8d2584c5ccf4", "score": "0.7227173", "text": "def subject\n I18n.t('flowdock.inbox_message.subject', message_type: I18n.t(\"flowdock.inbox_message.type.#{@type}\"), store_name: current_store.name)\n end", "title": "" }, { "docid": "8928fe4f050d7ebd3e9a...
fa8873daca9b27d87e3133c54c4154d6
This method will also hover over a specific element on a page in the case where there are multiple elements with the same css, xpath, etc.
[ { "docid": "08aadc638046f3d2facec12b485d156c", "score": "0.6779329", "text": "def hoveroverthis(thingtodo,item,number,testname=\"NONE\", snap=\"PIC\")\n\n\tif testname != \"NONE\"\n\t\ttestname = testname + \"_hoveroverthis_\" + thingtodo + \"_\"\n\tend\n\n\toptions = [\"text\",\"partialtext\",\"id\",\"...
[ { "docid": "8c4f91806d020f3a6d589e7a4956a090", "score": "0.7351872", "text": "def hover(*element)\n if element.length == 1 && element[0] !~ /\\A(li|div|button|a|span)\\Z/\n element = ['li', text: element[0]]\n end\n puts \"Hovering over #{element[1][:text].inspect}...\".lig...
f6d04ed6e7ff51976e69c68a52bce656
lista asignaturas no lectivas asignar asignatura los profesores tienen horas no lectivas
[ { "docid": "7e30f13f1ce28810a96fb3cba92456ef", "score": "0.0", "text": "def horas_no_lec\n @asignaturas = Asignatura.where('lectiva=false').order('orden')\n @lectiva = false\n @id_asig = params[:id_asig]\n @id_profe = params[:id_profe]\n @horario = Horario.new\n @horario.professor_id =...
[ { "docid": "bde1c00468d4814849df3223ff4c6195", "score": "0.61354965", "text": "def horarios_disponibles(permitir_cambios=true) \n if permitir_cambios\n if seccion_numero\n seccion = Seccion.where(:idioma_id => idioma_id,\n :tipo_categoria_id => tipo_categoria_id,\n :tipo_n...
ffdb07c5c15f6b1bf493cc248c675af4
num = number of times compounded
[ { "docid": "51d97e41163eb2e91fac62f73ced3721", "score": "0.0", "text": "def compound_interest(name, principal, rate, years, num)\n amount = principal * (1 + rate/num) ** (num * years)\n \"After #{years} years, #{name} will have #{amount} dollars!\"\nend", "title": "" } ]
[ { "docid": "2264c29bc7579742968ca73ad7063815", "score": "0.7115401", "text": "def numbers_off_by_how_many(my_number, bash_numbers)\n x = 0\n count = 0\n my_number.length.times do\n if bash_numbers[x] != my_number[x]\n count += 1\n end\n x += 1\n puts count\nend\n retur...
598aea268e6611402f809c3972751832
Internal: Check if this heuristic matches the candidate languages.
[ { "docid": "84c16a9b8cbd11c44be78ea42edacb08", "score": "0.7214984", "text": "def matches?(candidates)\n candidates.any? && candidates.all? { |l| @languages.include?(l.name) }\n end", "title": "" } ]
[ { "docid": "8c8cf3c177a092040a81d7886ef5cc8d", "score": "0.7106108", "text": "def languages?(candidate)\n raise ArgumentError, 'candidate must have a :languages key' unless candidate.has_key?(:languages)\n candidate[:languages].any? { |language| REQUIRED_LANGUAGES.include? language } ? true : false\ne...
25ed1d23a7a9b086f7b13a7c193f6afd
Return a formatted date Default format: %m/%d/%Y
[ { "docid": "a6a95805f90ef60a1ed99c76d59ed8c2", "score": "0.8358909", "text": "def format_date(date, format = \"%m/%d/%Y\")\n date.respond_to?(:strftime) ? date.strftime(format) : date.to_s\n end", "title": "" } ]
[ { "docid": "2cef1620d0385a97858e674c2a62548f", "score": "0.86650115", "text": "def format_date (date)\n\t\treturn date.strftime(\"%d/%m/%Y\")\n\tend", "title": "" }, { "docid": "57d59902a09b119fb68703994c5e47e4", "score": "0.85469735", "text": "def format_date date\n date.strftime...
4e14414a5adaaeb8a78a851d282d6857
The opts hash should only include symbol keys. The :checksum value, if provided, should be of the format: "sha256:50d858e0985ecc7f60418aaf0cc5ab587f42c2570a884095a9e8ccacd0f6545c"
[ { "docid": "0fb09a88b45c2e9a0047237645e06d08", "score": "0.0", "text": "def initialize(opts)\n opts.each do |opt_name, opt_value|\n raise ArgumentError, \"Invalid option: #{opt_name}\" unless FIELDS.include?(opt_name.to_sym)\n instance_variable_set(\"@#{opt_name}\", opt_value)\n...
[ { "docid": "d96ba4bf198c5c9aa7afc1e344f930a8", "score": "0.63017285", "text": "def set_distribution_hash_option(opts)\n opts = check_params(opts,[:hashing_options])\n super(opts)\n end", "title": "" }, { "docid": "e8e75c9b8fed989183b66e347b8ba90f", "score": "0.61507124", ...
8ab825ebed15f678e4809439251f54c0
TODO: Should require at least 1 destination
[ { "docid": "616ce444a4ee8836c5a285e79eae4390", "score": "0.0", "text": "def end_at\n self.destinations.maximum(:departure_time)\n end", "title": "" } ]
[ { "docid": "603fa60c4ad2d56c73b884466f9753b5", "score": "0.75141084", "text": "def prepare_destination; end", "title": "" }, { "docid": "233a8614b16427ecc5fabe55c0ab62e7", "score": "0.7499619", "text": "def destination\n raise \"no destination (to) defined\"\n end", "title": ...
f3efa739a8dd4f8ff7e854e2ceeca0ac
This is somke test set definition. This smoke test will only run case_001 and case_002
[ { "docid": "c1d674d4ba72bf42464f7b43ab7a5ec7", "score": "0.73474854", "text": "def smoke_test ()\n smoke_test = [\n \"case_001\",\n \"case_002\"\n ]\n return smoke_test\n end", "title": "" } ]
[ { "docid": "fd3002bddc15309761c18ce8e2b2b153", "score": "0.73877984", "text": "def testcase_setup\n end", "title": "" }, { "docid": "a9f4c2a19b80ba89e2afaa1cdd14095b", "score": "0.72477114", "text": "def test_case; end", "title": "" }, { "docid": "a9f4c2a19b80ba89e2afaa1...
a604c401b6f7f0e2145161aa594bd579
given an array of citations, generate the string for their citation e.g. if [10, 11, 12], string should be '1012' e.g. if [4, 13, 12, 17] string should be '4,1213,17'
[ { "docid": "b9a441809b0d5fc4b128953f6f00c1f2", "score": "0.7867697", "text": "def cit_string(cit_num_array)\n # Single citation:\n if cit_num_array.size == 0\n return ''\n elsif cit_num_array.size == 1\n return cit_num_array.first.to_s\n end\n # Multiple citations:\n cit_num_...
[ { "docid": "12940e4c72ee51bd66018ac621ed55db", "score": "0.6352207", "text": "def citation\n a = []\n a << CGI.escapeHTML(coins_authors) unless coins_authors.empty?\n a << CGI.escapeHTML(coins_year.to_s) unless coins_year.nil?\n a << \"'#{CGI.escapeHTML(coins_atitle)}'\" unless coins_atitle....
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "92438f432ca395ee83f48337b51e8237", "score": "0.0", "text": "def work_category_params\n params.require(:work_category).permit(:name, :htmlId)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
eb22d916df13bd9fb4d5fded16427253
log details about the results of indexing
[ { "docid": "6ffcb5ad9e8e1c006abaa3ba3f5d9edd", "score": "0.62457377", "text": "def log_results\n record_count_msgs.each do |msg|\n logger.info msg\n end\n logger.info(\"Avg solr commit time per object (successful): #{(@total_time_to_solr / metrics.success_count).round(2)} seconds\"...
[ { "docid": "3e50ed801ebfa4bdc5681f2ea2cfc5a0", "score": "0.6842519", "text": "def log(line)\n Log.info(\"#{@indexer_name} [#{Time.now}] #{line}\")\n end", "title": "" }, { "docid": "ccd02ebd5c564cb99bcbc21843fc5e90", "score": "0.673046", "text": "def log_info(string)\n index...
94e3c377ec79c572f628d82bd7ce3544
that fieldtrip favorite: "99 Bottles of Beer on the Wall."
[ { "docid": "b42a08c273c9f3d54f6e468c9861b300", "score": "0.0", "text": "def bottles_lyrics bottles\n while bottles != 0\n if bottles > 1\n puts \"#{bottles} bottles of beer on the wall, #{bottles} bottles of beer.\\nTake one down and pass it around, #{bottles - 1} bottles of beer on the wall.\\...
[ { "docid": "ba5201ae20209f12c229c57ebd95886b", "score": "0.63631207", "text": "def forfeit(guest)\n \"#{guest.name} is washing dishes whilst singing #{guest.fave_song}\"\n end", "title": "" }, { "docid": "3915cb3a3b9aeefd591e0e6414b870ce", "score": "0.62360704", "text": "def favo...
880a0499420eb706d0493973a7955e8f
getMapFile: process raw log data
[ { "docid": "967c0960b95157957c0edd169ab4b30e", "score": "0.68430865", "text": "def getMapFile(conf)\n\t\t# Get information config\n\t\tmapConfig = ProcessInputObj.getConfigData(conf)\n\t\t# Declare list final data\n\t\tlistFinal = Array.new\n\t\t# Declare list result data\n\t\tresultData = Array.new\n\t...
[ { "docid": "9a7c2f1f29e777a5a63f00afa6272c4c", "score": "0.6698335", "text": "def process\n File.open @logfile_name do |fp|\n LogParser.parse fp do |entry|\n entry_page = entry.page\n next if entry_page.nil?\n @request_times[entry_page] << entry.request_time\n @db_tim...
479f6d1a404e3622638cd86c04abb26f
Returns whether a front cover (request) path has been specified in the options
[ { "docid": "d1fc1bf99014bdb752b9c084988719e1", "score": "0.7753357", "text": "def show_front_cover?\n front_cover_path.is_a?(::String) && front_cover_path.start_with?('/')\n end", "title": "" } ]
[ { "docid": "907a2fa3f20ba10e3865873ef6dadd8d", "score": "0.733741", "text": "def show_back_cover?\n back_cover_path.is_a?(::String) && back_cover_path.start_with?('/')\n end", "title": "" }, { "docid": "907a2fa3f20ba10e3865873ef6dadd8d", "score": "0.733741", "text": "def show_bac...
9a8f1c115f4e129ac48d4d1071c5bc8c
Respond with raw bytes `status` is 200 by default
[ { "docid": "b11a10995797bb0698a43faf4375f578", "score": "0.60863477", "text": "def respond_raw(status = 200, headers = {}, data)\n @status = status\n headers = @headers.merge(headers)\n body = data.is_a?(IO) ? data : [data]\n throw(:KenjiRespondControlFlowInterrupt, [@status, headers...
[ { "docid": "bee2c10bd8472d7568c407ef5307c203", "score": "0.75622255", "text": "def respond_with(status_code)\n response.status = status_code\n response.write \"\"\n nil\n end", "title": "" }, { "docid": "7fa6278ff9b96799e553675879c7f2fd", "score": "0.74606186", "text": "def...
7d7831991fa75e1ed803bb6372005bdf
This function will set a notification message depending up on the request type (ajax xml http or direct http) Example set_notification("Success", "The message has been sent successfully") set_notification("Success", "Permission denied")
[ { "docid": "fdd6e93b13b2e9c3136a849294ba03d2", "score": "0.6381274", "text": "def set_notification(success, title, message)\n @notification[:success] = success\n @notification[:title] = title\n @notification[:message] = message\n end", "title": "" } ]
[ { "docid": "d902a8f3f4321477bdb45a940aa37744", "score": "0.6391517", "text": "def set_notification_message\n case self.acted_with_type\n when \"Opportunity\"\n if self.anonymous\n self.message = \"An opportunity has been posted\"\n elsif self.targetable_type == 'Network'\n ...
0e8239fa13ca296cb0c323ab43f185ad
create an NI URI for the specified file, authority, using the specified hash algorithm tries to guess the content types and sets the ct query paramter
[ { "docid": "db43b761268b6058392f5865a72dac5a", "score": "0.65256333", "text": "def hashFromFile(file, auth, algo)\n u = URI::NI.buildFromFile(auth, file, nil, algo)\n type=`file --mime-type #{file}`.split[1]\n u.contentType!(type)\n u\nend", "title": "" } ]
[ { "docid": "916a0534d24e72f3bcfc1048c96ff677", "score": "0.56158686", "text": "def file_uri_scheme=(_arg0); end", "title": "" }, { "docid": "bfc204f965131abd21f45858b0f8ee8a", "score": "0.54669297", "text": "def url_for_file(filename, anchor = T.unsafe(nil)); end", "title": "" ...
bf874afe54bb3de9a42585f0b4c918f8
DELETE /user_component_xrefs/1 DELETE /user_component_xrefs/1.xml
[ { "docid": "4a809fbd342692894c909443ad6928bc", "score": "0.7827094", "text": "def destroy\n @user_component_xref = UserComponentXref.find(params[:id])\n @user_component_xref.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_component_xrefs_url) }\n format.xml { head...
[ { "docid": "700bda728359b69e071e496a52609648", "score": "0.686719", "text": "def destroy\n @user_feature_xref = UserFeatureXref.find(params[:id])\n @user_feature_xref.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_feature_xrefs_url) }\n format.xml { head :ok }\n ...
75cf0c887ae28720a63ef7bc17385622
dev:: Device to detach Detaches net block device
[ { "docid": "dff15e98f6aab1898593a41b40e9bf7a", "score": "0.7614113", "text": "def disable_netblockdev(dev)\n res = system \"nbd-client -d #{dev}\"\n raise \"Failed to detach image from network block device server\" unless res\n puts \"Detached net block device: #{dev}\"\nend", "title": "" } ]
[ { "docid": "28a6a8e82204badec295504410956156", "score": "0.73929036", "text": "def detach\n begin\n run_baby_run 'hdiutil', ['detach', '-force', self.dev_node], :err => '/dev/null'\n rescue Exception => ex\n debug \"The disk image at #{@dev_node} could not be detached: #{ex}\"\n ...
6b4b6c80cb60460ab089b2cc3dc19400
Addresses starting with '1' are memory pointers, so take a further step and fetch the byte that the pointer points to.
[ { "docid": "b9facf7edc549d9ecb45a7770fcb8ad6", "score": "0.6170555", "text": "def resolve_pointer(address)\n return address unless address[0] == '1'\n memory_fetch calculate_twos_compliment(address)\n end", "title": "" } ]
[ { "docid": "9f8be43f7454d3875181fb94ad8ec441", "score": "0.6774309", "text": "def byte_pointer; end", "title": "" }, { "docid": "9f8be43f7454d3875181fb94ad8ec441", "score": "0.6774309", "text": "def byte_pointer; end", "title": "" }, { "docid": "ce229ac537324ce77b03df3c51...
c3c8be15bbdc932e2620e660de09b858
Searches for a string using the sidebar search input without logging the search string. To be used for note searches.
[ { "docid": "f6469c75a615305c9161d42290752639", "score": "0.6828027", "text": "def search_note(string)\n logger.info 'Searching for a string within a note'\n search string\n end", "title": "" } ]
[ { "docid": "2a9d4c568be6f949c3c08d513d7490a3", "score": "0.7272716", "text": "def search_non_note(string)\n logger.info \"Searching for '#{string}'\"\n search string\n end", "title": "" }, { "docid": "f683bd54cfbeb88f5fcc68d409e90e07", "score": "0.67671496", "text": "def searc...
1aac1e77700bf4a3d5989749251520d4
Issues get all members API.
[ { "docid": "6ff5a78759d61602515c9f55ccc1194e", "score": "0.7387163", "text": "def get_all_members(params = {})\n room_id = self.room_id || params.delete(:room_id)\n raise ArgumentError.new(\"room_id required\") unless room_id\n res = call_api(:method => :get, :uri => @api_base.merge(\"roo...
[ { "docid": "6ecd2e08a98bf78540a2f6d0bf0ae6a6", "score": "0.77543765", "text": "def list_members\n HTTP.headers(:accept => @@accept, \"content-type\" => @@content_type).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/members\"...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "a4c46bfbf4f0a42ef83c7491aaabc4a0", "score": "0.0", "text": "def update!(**args)\n @grpc_routes = args[:grpc_routes] if args.key?(:grpc_routes)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
e2a8003a469b8989ea83fe49c285cc92
Sets the dead? attribute to true if the link is no longer active
[ { "docid": "b3160340d79f265f4cc798799ab76ebc", "score": "0.7494179", "text": "def set_url_status\n self.update_attribute(:dead, true) unless self.url_active?\n end", "title": "" } ]
[ { "docid": "6d26401d1015c1c849a4135855bb7a39", "score": "0.7991406", "text": "def link_dead!; @dead = true end", "title": "" }, { "docid": "a406f454ef8889d2a0dbfcb879667362", "score": "0.7042694", "text": "def dead\n @alive = false\n on_dead.call(self) if on_dead\n end",...
e8ab722ad0ebfac60f5e6534be18b71a
Get the number of edges
[ { "docid": "8d51376288b2b6ce4280c6a121c49cb8", "score": "0.8896643", "text": "def edge_count\n @loEdges.size\n end", "title": "" } ]
[ { "docid": "76a4422209e17bf3f363aa3b15f7312d", "score": "0.9269611", "text": "def edge_count() @edges.size end", "title": "" }, { "docid": "c7eee36351e07d7b287791cd73c48f07", "score": "0.91316915", "text": "def edge_count\n @edges.size\n end", "title": "" }, { "do...
a5d4a0937608f74b767d6bb2e0840148
GET /post237s/new GET /post237s/new.xml
[ { "docid": "b526985dbf4292573eacf00143d7944e", "score": "0.7500504", "text": "def new\n @post237 = Post237.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post237 }\n end\n end", "title": "" } ]
[ { "docid": "879cb66276bd00e582f27d8e6667c581", "score": "0.7580099", "text": "def new\n @post155 = Post155.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post155 }\n end\n end", "title": "" }, { "docid": "14b8f052f8ca568be11efa...
9cabee88ded53714b855088622c0c7e6
Test that notify correctly sends notification
[ { "docid": "0a0a60af1aaa41bc7574c6b44dd3efa3", "score": "0.7133429", "text": "def test_notify\n growl = Growl.new\n growl.notify(\"Test message 1\", :title => \"Title\")\n if growl.growl_enabled\n puts \"Verify that growl notification with 'Title' and 'Test message 1' appeared on screen.\"...
[ { "docid": "050570825f32b1c4721fbbdc99d2fcf2", "score": "0.751181", "text": "def notify(*params); raise('Stub or mock required.') end", "title": "" }, { "docid": "4e928eab9dc2ce5bc4b01c3cf9e70f14", "score": "0.7462927", "text": "def send_notifications\n notify\n end", "title"...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "804b4ed569fbe70af0ce39ca77e9aeda", "score": "0.0", "text": "def set_band\n @band = Band.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...
ce7e7b4622318ba0faae0559a457992e
Returns `true` if `self` and `other` have the same attributes and values.
[ { "docid": "d32284e1c2505f22ba01917592d484e1", "score": "0.0", "text": "def ==(other)\n super &&\n @address == other.address &&\n @agents == other.agents &&\n @automatic_pm_enabled == other.automatic_pm_enabled &&\n @enabled == other.enabled &&\n @kdump_detection == other.k...
[ { "docid": "d52d1042a4b5533455a8d5852ae59fd7", "score": "0.8746246", "text": "def eql?(other)\n self.class.attributes.each do |attr|\n return false unless send(attr).eql?(other.send(attr))\n end\n end", "title": "" }, { "docid": "6116481353e0f0ca7013e10c66d7d724", "sc...
3bd8aeb6799a9093da4a1501be73eac0
PATCH/PUT /bikestores/1 PATCH/PUT /bikestores/1.json
[ { "docid": "3bc37047e3610e1b2b9b45820be62f5e", "score": "0.67910385", "text": "def update\n respond_to do |format|\n if @bikestore.update(bikestore_params)\n format.html { redirect_to @bikestore, notice: 'Bikestore was successfully updated.' }\n format.json { head :no_content }\n ...
[ { "docid": "2d7400fdc2a64a1e9fad443e862d0351", "score": "0.6330949", "text": "def update\n @my_bike = MyBike.find(params[:id])\n \n if @my_bike.update(my_bike_params)\n render json: @my_bike\n #head :no_content\n else\n render json: @my_bike.errors, status: :unprocessable_enti...
4e9ac264d17d22565f7a39fbc618a8e6
PUT /monthly_interests/1 PUT /monthly_interests/1.json
[ { "docid": "d16a42583049472e538e632b153d1bf2", "score": "0.7670986", "text": "def update\n @monthly_interest = MonthlyInterest.find(params[:id])\n\n respond_to do |format|\n if @monthly_interest.update_attributes(params[:monthly_interest])\n format.html { redirect_to @monthly_interest,...
[ { "docid": "a54a5b4d0a8ba68ecc468dbb77c14ed1", "score": "0.66743267", "text": "def update\n @interest = Interest.find(params[:id])\n \n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.json { head :ok }\n else\n format.json { render :js...
1f8a1356f7eda57c6e535ebe239e481f
GET /gists or /gists.json
[ { "docid": "a4625fbdff486a07f6a9a7317a83f650", "score": "0.6189918", "text": "def index\n @q = Gist.accessible_by(current_ability).ransack(params[:q])\n @pagy, @gists = pagy(@q.result.includes(:user, :files))\n end", "title": "" } ]
[ { "docid": "1489585586e00a36763fb9b1f5c739b6", "score": "0.79787576", "text": "def gists(params={})\n Ghee::API::Gists::Proxy.new(connection,\"#{path_prefix}/gists\", params)\n end", "title": "" }, { "docid": "b0dab4bdc19d7ab3e19895643069cc0b", "score": "0.7948552", "...
0bd47cd2a151de36f24213006d7bf2da
Connect complete: EM::connection_completed() override
[ { "docid": "7ca5b568ecf2619388c0f3141f304636", "score": "0.74499726", "text": "def connection_completed()\n super()\n puts \"#{self} connection_completed done!\"\n end", "title": "" } ]
[ { "docid": "b2beccf065dce640104df534b4d84cc4", "score": "0.9109961", "text": "def connection_completed\n connect @conn_headers # call EM supplied CONNECT method\n @log.debug(\"#{self} connection_completed done\")\n end", "title": "" }, { "docid": "330c88c10db1d37b40c54b3a74380517", ...
74e8bf4a4c3e0f88dc665763ba1a3e84
so that, e.g. "Userd" doesn't eval to "Hobo::User" (Ruby determines this constant lookup scope lexically)
[ { "docid": "9c6263694426e32a7d23c3f40c873e7f", "score": "0.0", "text": "def __top_level_eval__(obj, expr)\n obj.instance_eval(expr)\nend", "title": "" } ]
[ { "docid": "64b118a6890ec99b0e72e8f3c86f6253", "score": "0.6852031", "text": "def constantize(camel_cased_word)\n names = camel_cased_word.split('::')\n names.shift if names.empty? || names.first.empty?\n\n names.reduce(Object) do |constant, name|\n if constant == O...
4aef25e5dd866c4612d8686480e1b55d
:callseq: languages > Array Return the list of languages associated with this Reference.
[ { "docid": "0a9711262bc0bc21a2b7e2c67844d33a", "score": "0.7395809", "text": "def languages\n @fields['languages'].nil? || @fields['languages'].empty? ? [] : @fields['languages'].dup\n end", "title": "" } ]
[ { "docid": "7d5dd2ed1d819dc23e8ce116654020e7", "score": "0.7695716", "text": "def languages\n Language.langs_for(dictionaries, :source_language)\n end", "title": "" }, { "docid": "447e89e38bfbcc163282761afbc7d646", "score": "0.7481674", "text": "def languages\n product.langu...
b9aa5a50789fad1da8e894d46d6cbefb
Mark a job locale as uncompleted. API Path: /api/v2/projects/:project_id/jobs/:job_id/locales/:id/reopen == Parameters: project_id:: project_id job_id:: job_id id:: id params:: Parameters of type PhraseApp::RequestParams::JobLocaleReopenParams == Returns: PhraseApp::ResponseObjects::JobLocale err
[ { "docid": "cea5575b0a85d2755263b7490f80b6bf", "score": "0.78549176", "text": "def job_locale_reopen(project_id, job_id, id, params)\n path = sprintf(\"/api/v2/projects/%s/jobs/%s/locales/%s/reopen\", project_id, job_id, id)\n data_hash = {}\n post_body = nil\n \n if params.present?...
[ { "docid": "2a2d2682f0de485219b0ad317c6ba4d3", "score": "0.79056877", "text": "def job_locale_reopen(project_id, job_id, id, job_locale_reopen_parameters, opts = {})\n data, _status_code, _headers = job_locale_reopen_with_http_info(project_id, job_id, id, job_locale_reopen_parameters, opts)\n ...
303be8e3846e5109a7ddc8410fc61e39
saves a valid result to db. using a string hash.
[ { "docid": "09416e11dd6ed5e01bbabfe6e3d75685", "score": "0.7426556", "text": "def save_to_db(result_hash)\n #final_hash = result_hash\n #puts @table_name\n #puts result_hash.inspect\n \n @db.replace_one(@table_name, result_hash)\n end", "title": "" } ]
[ { "docid": "3b1659a2dd4512305e76d2860074e9c2", "score": "0.74497485", "text": "def save_to_db(result_hash)\r\n #final_hash = result_hash\r\n #puts @table_name\r\n puts \"saving\"\r\n puts result_hash.inspect\r\n \r\n # pad the zip.\r\n #padded_num = sprintf '%05d', final_hash['ZIP']...
d45672023fa3d13a3edc860da82c2247
Modifies the ack deadline for a specific message.
[ { "docid": "49b29391e250d14b64e7019dd402ccc8", "score": "0.6994202", "text": "def modify_ack_deadline subscription, ids, deadline\n subscriber.modify_ack_deadline subscription: subscription_path(subscription),\n ack_ids: Array(ids),\n...
[ { "docid": "dc2a55d1115a0dd499e8603c6d188e8b", "score": "0.5771636", "text": "def ack(msg_info)\n end", "title": "" }, { "docid": "93cec078c14df168f0c81a9bed2b3db5", "score": "0.56750387", "text": "def ack msgid\n send_frame \"ACK\", 'message-id'=> msgid\n end", "t...
d1b3d21d920804189d5852f2fa50df00
PATCH/PUT /offer_users/1 PATCH/PUT /offer_users/1.json
[ { "docid": "9b5c8622d16248b2f1574f1cbe520b9d", "score": "0.71810126", "text": "def update\n respond_to do |format|\n if @offer_user.update(offer_user_params)\n format.html { redirect_to @offer_user }\n format.json { render :show, status: :ok, location: @offer_user }\n else\n ...
[ { "docid": "b99cb75537e758acb4daa9f86df790f4", "score": "0.7279359", "text": "def update\n @offer = UsersToOffer.find(params[:id]).offer\n\n respond_to do |format|\n if @users_to_offer.update(users_to_offer_params)\n format.html { redirect_to @offer, notice: '¡Has canjeado tu Voucher c...
881b40aa4a48d003c61c3dd56e2f2a57
Determine if mode was set
[ { "docid": "31997ce9f674b8680b4f03ab64141faa", "score": "0.6562179", "text": "def mode_set(modes)\n phrase = @string.scan(/~&\\/\\/mode:.+/).flatten[0]\n # Does it look like a mode?\n if phrase.nil? or phrase.empty? then\n return false\n end\n\n # Can the us...
[ { "docid": "a5240840179be08fc09a32c800ed0a0d", "score": "0.8306672", "text": "def mode?\n return @mode\n end", "title": "" }, { "docid": "c933a90654fab298eee4e426aa6bfa80", "score": "0.7756603", "text": "def get_mode\n @mode\n end", "title": "" }, { "docid": "...
8423f80a690ad932fd64016259ca01e1
DELETE /feeds/1 DELETE /feeds/1.xml
[ { "docid": "ec7801da571d8de7c277a6aa8f0ac2c8", "score": "0.72223777", "text": "def destroy\n @feed = Feed.find(params[:id])\n @feed.destroy\n\n respond_to do |format|\n format.html { redirect_to(feeds_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "c3578260df3e5b3e8ee7139de90596a4", "score": "0.7404985", "text": "def destroy\n @feed = Feed.find(params[:id])\n current_user.feeds.delete @feed\n current_user.save!\n\n respond_to do |format|\n format.html { redirect_to(root_path) }\n format.xml { head :ok }\n end\...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "cb3dd7836f77097a63033e6b5ef0922d", "score": "0.0", "text": "def chalie_vice_item_params\n params.fetch(:chalie_vice_item, {})\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...
e4eb82582a97fb7b401efaab0606c340
Get the OS dependant command line for testing interactive processes with a prompt Return:: list: Command line
[ { "docid": "550f4639d63a74a8db0fd936df078e8f", "score": "0.7062107", "text": "def getInteractivePromptCmdLine\n rCmdLine = nil\n\n case os\n when RUtilAnts::Platform::OS_WINDOWS\n rCmdLine = [\"#{$ProcessPilotTest_RootPath}/test/Programs/Windows/InteractivePrompt.bat\"]\n when...
[ { "docid": "adf1b63733f3aae0d6ac446c398a714e", "score": "0.78043306", "text": "def get_cmdline\n #TODO catch IOexception (see Readline website)\n begin\n cmdline = Readline.readline(\"+> \", true)\n rescue Interrupt => e\n puts \"^C\"\n cmdline = \"\"\n end\n\n exit if cmdl...
ab1d0cbcdf74a5be2e7c5f1ee3a0efc5
Validates the block by performing verifications in order: 2. Height and previous block hash 3. Time: Can't be before the previous block. 4. Transactions: Wallets should only spend fund they own. Signatures and IDs should be valid. 5. There should be exactly one mining reward transaction. 6. Merkle tree root: Should be ...
[ { "docid": "1e98da1a50d209c843a54a6cc4a9de8b", "score": "0.81769484", "text": "def validate(new_block)\n previous_block = find_block_by_height(new_block.height - 1)\n\n # 1. Height.\n if previous_block&.height.to_i + 1 != new_block.height.to_i\n raise \"Height isn't valid\"\n end\n\n ...
[ { "docid": "58e08fddc40caab3c5c557d3da95fc52", "score": "0.75947213", "text": "def block_valid?(block, difficulty = 4)\n block.valid?(difficulty) &&\n block.parent_digest == head_digest &&\n balances([block]).none? { |user, balance| balance < 0 }\n end", "title": "" }, { "docid...
18c81aa6db85001ed64781fca2d68f80
saves a specific chart from a specific sheet as image
[ { "docid": "575b5933df3d2691868131127329ce66", "score": "0.6371009", "text": "def get_chart worksheet_name, chart_index, image_format\n begin\n if @filename==''\n raise 'Base file name is not specified'\n end\n str_uri = $product_uri + '/cells/' + @...
[ { "docid": "667c96a998052f4eadfacfaf68ae4f2c", "score": "0.64576614", "text": "def exportPng(sheet, target)\n\t\tif sheet == nil\n\t\t\t`\"#{@ui.oEagleBinaryEdit.text}\" -C 'EXPORT IMAGE #{@tempPath}/#{target} #{@ui.oBoardEdit.text}; QUIT' #{@tempPath}/board.brd`\n\n\t\t\tFileUtils.rm(Dir.glob(\"#{@temp...
448a90acf9f22adcdb4af6b3acf9f315
Public: Remove the authentication token and save Returns the true or false value: did it save successfully?
[ { "docid": "4671ed146f48153f16bdf383f9c52551", "score": "0.70070386", "text": "def invalidate_authentication_token!\n invalidate_authentication_token\n save\n end", "title": "" } ]
[ { "docid": "0850ed2545265114bfd5d19cee571b59", "score": "0.7098676", "text": "def destroy\n\n current_user&.authentication_token = nil\n\n if current_user.save\n head(:ok)\n else\n head(:unauthorized)\n end\n\n end", "title": "" }, { "docid": "0e33d63b437cf11...
62995888b7924273d0e03a3c6cb9830a
Public : Scans the contents to get all the IGC header information (Section H) Returns a hash with all the header keys as indexes and their values.
[ { "docid": "63c66d3d9838966ce8ae9b5086d6b1ea", "score": "0.6770843", "text": "def headers\n\t\t\theaders = @contents.scan(/^[h][f|o|p]([\\w]{3})(.*):(.*)$/i)\n\t\t\theaders_hash = Hash.new\n\t\t\theaders.each do |h|\n\t\t\t\theaders_hash[h.first] = h.last.chomp\n\t\t\tend\n\t\t\treturn headers_hash\n\t\...
[ { "docid": "6d86c38fa9d3b47ddb0842cd7c046155", "score": "0.6978974", "text": "def parse_content\n entries = []\n headers = Hash.new(0)\n\n @doc.css('h1, h2, h3, h4, h5, h6').each do |node|\n text = node.text\n id = text.downcase\n id.gsub!(PUNCTUATION_REGE...
0e8d3643fca9782c97bb66319f3d32d8
.where returns a collection
[ { "docid": "5f67d91d059bc7257ace18671616b73b", "score": "0.0", "text": "def voted_by?(user)\n votes.where(user_id: user.id).exists?\n end", "title": "" } ]
[ { "docid": "7629ff7fa7aec56f0945bdcc0de5a1c6", "score": "0.7608999", "text": "def where\n [find]\n end", "title": "" }, { "docid": "9d162403ab7293a37e934b97a960a1df", "score": "0.7473777", "text": "def apply_where\n collection.where(where_clause, *bindings)\n end"...
2315346cb20670a579d7b05d61198a00
DELETE /blanks/1 DELETE /blanks/1.json
[ { "docid": "9d00142f4e85c710d69bafc597c67585", "score": "0.73471314", "text": "def destroy\n @blank = Blank.find(params[:id])\n @blank.destroy\n\n respond_to do |format|\n format.html { redirect_to blanks_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b7bf36df36ed47bfb27d7b4a8d854800", "score": "0.70428634", "text": "def destroy\n @blank = Blank.find(params[:id])\n @blank.destroy\n\n respond_to do |format|\n format.html { redirect_to(blanks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { ...
9115e477a4985d463d4d63bfda53fda7
Load all cars for the current user. Rails automatically renders the app/views/cars/index.html.erb file.
[ { "docid": "190eb1bf1dad6b77ab079c3bcb5e620f", "score": "0.73537624", "text": "def index\n @cars = current_user.cars.order(:name)\n respond_with(@cars)\n end", "title": "" } ]
[ { "docid": "9259d2c6a19e12b3a02a105b82a2678a", "score": "0.7705894", "text": "def index\n @cars = Car.all\n @user = User.find(session[:user_id])\n\n end", "title": "" }, { "docid": "d5fc6cfa6d18dd64b59f8bd5a9dcdb20", "score": "0.76097083", "text": "def index\n if current_us...
61c622183217a86e47b358b2dfc86043
DELETE /fundations/1 DELETE /fundations/1.xml
[ { "docid": "3c8160eb9e033fb5397e30ea5ee167e5", "score": "0.6934352", "text": "def destroy\n @fundation = Fundation.find(params[:id])\n @fundation.destroy\n resp ={\"resp\" => \"ok\"}\n\n respond_to do |format|\n format.html { redirect_to(fundations_url) }\n format.xml { head :ok }...
[ { "docid": "f9e00b8ca488c57764eada4ddbd29d0b", "score": "0.709418", "text": "def destroy\n @fund.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "f416d0caa9b22f7b449b57d2951a0498", "score": "0.6964013", "text": "def destroy\n @dbs_deposit = DbsDeposit.find(pa...
f3220d681c19260ca3838e6447daaa19
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.kaishi_mailer.2014_kojin_ranking.subject
[ { "docid": "750840d7176f4ca82a702fcff45a03f5", "score": "0.0", "text": "def kaishi2014_kojin_ranking(user, mail_address)\n @user = user\n attachments[\"#{user.name}.png\"] = {\n content: File.read(\"tmp/kaishi2014/#{user.name}.png\", mode: 'rb'),\n transfer_encoding: :binary\n }\n\n ...
[ { "docid": "ea740e704e8f1173fb87b45dfcaaf989", "score": "0.7874829", "text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end", "title": "" }, { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.75866723", "text": "def subject_for\n ActiveSuppor...