query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
9c3c699e5bb0e42b0f7c7afc42e1e7b4
POST /skills_to_profiles POST /skills_to_profiles.json
[ { "docid": "2451d538da01fb9d83fec27f1ce9b6cd", "score": "0.763893", "text": "def create\n @skills_to_profile = SkillsToProfile.new(skills_to_profile_params)\n\n respond_to do |format|\n if @skills_to_profile.save\n format.html { redirect_to @skills_to_profile, notice: 'Skills to profil...
[ { "docid": "ddf80fbf65996a8cf99cf51fae7a29fe", "score": "0.72485954", "text": "def set_skills_to_profile\n @skills_to_profile = SkillsToProfile.find(params[:id])\n end", "title": "" }, { "docid": "d2fb2a56e71452cd7e5241928b56c403", "score": "0.71671367", "text": "def skills_t...
445206b4b4096d4d28bbff584822b4e5
Get cass class by game format
[ { "docid": "131849c10358e7ebca38eb57977e1a7d", "score": "0.0", "text": "def css_class\n result = [self.project.try(:css_class), self.try(:format).try(:css_class)].join(' ')\n result = 'other' unless CSS_CLASSES.include?(result)\n result += ' invisible' unless self.is_visible\n result\n end"...
[ { "docid": "ee8db808787ebe4eba2c49b787cae727", "score": "0.58590084", "text": "def get_css_class_for_season_type\n if object.season_type && object.season_type.code =~ /CSI/i\n 'goggles-meeting-csi'\n elsif object.season_type && object.season_type.code =~ /FIN/i\n 'goggles-meeting-fin'\n ...
d2cd981b42981d6114898501242de89c
Oh, wrong target. But we'll keep watching you.
[ { "docid": "00ab79449db735accf91781be85373f4", "score": "0.0", "text": "def revitalize\n self.update_attribute :killed, false\n self.update_attribute :ignored, false\n self.frontend_user.update_attribute :is_account_cheater, false\n end", "title": "" } ]
[ { "docid": "b582ce5038ecb4c42f3122499275da00", "score": "0.71925956", "text": "def say_target_change_too_fast\n end", "title": "" }, { "docid": "f17068b4d31e0cbafa0c69af5be96d86", "score": "0.7017013", "text": "def stale_target?; end", "title": "" }, { "docid": "6a63e9...
f2abf5f09362d03de6608d6ea6adb9eb
mut_bulk and bg_bulk pileups are compared at selected position of the contig. Empty hash results from position below selected coverage or bases freq below noise and such positions are deleted.
[ { "docid": "cc6c7166849efcc58dcf5bcf4d719140", "score": "0.6283186", "text": "def compare_pileup(pos)\n mut_type, fraction = var_mode_fraction(@mut_bulk[pos])\n return nil if mut_type.nil?\n if @bg_bulk.key?(pos)\n bg_type = var_mode_fraction(@bg_bulk[pos])[0]\n mut_type = c...
[ { "docid": "7fac2bede428e16d95650227c9038950", "score": "0.7168232", "text": "def bulks_compared\n @mut_bulk.each_key do | pos |\n ignore = 0\n unless @masked_regions.empty?\n @masked_regions.each_key do | index |\n if pos.between?(@masked_regions[index][:begin], @...
dc5a93007ffd21b80e574d0f89ca4d79
json reflect (for debugging)
[ { "docid": "081827a3fac92a5cb2100229bcd62606", "score": "0.7186285", "text": "def json_reflect\n @content_type = 'text/plain'\n @render_nothing = true\n @rendered_template = true\n @current_layout = nil\n h = {}\n params.each do |x,y|\n h[x]=y\n end\n write_json h\n end", ...
[ { "docid": "db95fc5c5633b8c9b6ceea229253b539", "score": "0.65253484", "text": "def json\n @obj.get_json_regex\n end", "title": "" }, { "docid": "684993857cea46e4f95cec92c571289f", "score": "0.63705796", "text": "def inspect\n '#<JsonObj>'\n end", "title": "" }, { ...
fd216019380884775081c9282e145b81
Removes a collection of aggregates from the DB given their primary keys.
[ { "docid": "710054682bbbfa922d8e660f8e847c30", "score": "0.0", "text": "def destroy_by_id(ids)\n @engine.destroy_by_id(ids, @domain_class)\n end", "title": "" } ]
[ { "docid": "be816c3b0887d524f38d8e50edb7ecd0", "score": "0.67879415", "text": "def drop_aggregates\n results = ActiveRecord::Base.connection.query(<<-SQL, 'SCHEMA')\n SELECT\n 'DROP AGGREGATE ' || n.nspname || '.' || proname || '(' ||\n CASE WHEN pronargs > 0 THEN oidvectortypes(pr...
106d36f9e67997a24a128525a86d7d7d
Tickling prevocational holorhinal unnicked displease sculptress Arthrodonteae affrication theoretics desmonosology poppable gladdener Ichnography pneumatocele flowerage popularism egomania supernationalism Postsphenoid tervalence microcinematography multitude simiad dyassic Polyspermy immobilize screwage fellowship hae...
[ { "docid": "f03304ef8d9d60b9fd51ba5fc013d50d", "score": "0.0", "text": "def unglazed_evase(iffy_phallodynia, unreducibly, gorkiesque)\n archprototype_recadency(ventrolaterally, harlequinery_macartney)\n rifleman()\n semipurulent(hydrocephalic_phthisiogenesis, ineffulgent)\n end", "...
[ { "docid": "d9d034c7ce715357270537bd870cf956", "score": "0.59683895", "text": "def flesch\n\t\t206.835 - (1.015 * words_per_sentence) - (84.6 * syllables_per_word)\n\tend", "title": "" }, { "docid": "3f5967236d9db623afc2c65a8187df99", "score": "0.5954481", "text": "def virus_effects\...
069ef4fd6cd2b89fc40c34c61c33c158
Check if there are any entries
[ { "docid": "0b13cd105e8807b7240ff7d2657fbd50", "score": "0.8097085", "text": "def empty?\n entries.empty?\n end", "title": "" } ]
[ { "docid": "135567bd64d1b90f28df38137ef91adf", "score": "0.80116516", "text": "def empty?\n entries.empty?\n end", "title": "" }, { "docid": "3de59a324dd707d592332b04b8d4d0ca", "score": "0.7660098", "text": "def exist?\n !entries.empty?\n end", "title": ""...
f5c07da97767eadb4105eadeb3ee6b7e
this method creates a new user if details are entered correctly. and also signs the user in.
[ { "docid": "acf8609c723f2b46f5472803fee3a3e1", "score": "0.0", "text": "def create\n\t\t@user = User.new(params[:user])\n\t\t\n\t\tif @user.save\n\n\t\t\tsign_in @user\n\t\t\tflash[:success] = \"Welcome to Tweet Me My Bus!\"\n\t\t\tredirect_to @user\n\t\telse\n\t\t\t@title = \"Sign up\"\n\t\t\trender 'n...
[ { "docid": "70f76f66576bc9212995c41f9c8911f4", "score": "0.79597867", "text": "def signup\n enterCredentials\n create_new_user\n end", "title": "" }, { "docid": "90e6324bff5983e5c7cb6a1bd071e4b8", "score": "0.7941473", "text": "def createUser\n # this referenc...
e6f407c5fb331066e2e62c5a4d01ad39
Stringfy message to raw IRC message.
[ { "docid": "056cec772f3b01606e3e73876d24b61f", "score": "0.0", "text": "def to_s\n str = \"\"\n\n str << \":#{@prefix} \" unless @prefix.empty?\n str << @command\n\n if @params\n f = false\n @params.each do |param|\n f = !f && (param.empty? || param[0] == ?: || param.include...
[ { "docid": "887b34e9383e66f1ee59ff5519bd9270", "score": "0.67332137", "text": "def sanitized_message\n message.to_s[0,140]\n end", "title": "" }, { "docid": "afa1da995d1a5e1757058130c9682224", "score": "0.62880397", "text": "def raw_message\n @raw_message ||= @md[FIELDS....
b427b342c24d9a54b5ed14f69821bf11
Instantiates a new securityEdiscoverySearch and sets the default values.
[ { "docid": "56e1638a7e8faa8ed6cfb9c5c99499c4", "score": "0.69626373", "text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.ediscoverySearch\"\n end", "title": "" } ]
[ { "docid": "0ad539bfae7f8c4cb716787e523bcd07", "score": "0.62098557", "text": "def initialize\n @query = Com::Endeca::Navigation::ENEQuery.new\n @query.setNavDescriptors(Com::Endeca::Navigation::DimValIdList.new('0'))\n @terms = Com::Endeca::Navigation::ERecSearchList.new\n @num_resu...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "11dfa33b87d97826e882ba55da43e4e3", "score": "0.0", "text": "def attatchment_params\n params.require(:attatchment).permit(:comment, :file, :message_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74954116", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6956924", "text": "def strong_params\n params.require(:request).permit(param_whit...
322fb098803feadfc40029c722d878c1
Return the scene instance for specified SceneID
[ { "docid": "cc27ad9ddec974219e90c81768309f58", "score": "0.7582522", "text": "def scene(scene_id:) @scenes[scene_id] end", "title": "" } ]
[ { "docid": "44fa841421e7a8e1e7de830e9575b49e", "score": "0.76225626", "text": "def scene(scene_identifier)\n if scene_identifier.is_a?(Numeric) || scene_identifier.to_i.to_s == scene_identifier\n # passed in a scene id\n response = get('/scenes{/scene}', :scene => scene_identifier)\n ...
f376b14828aee6faabec2c69294c7352
Raw Authorization Header token (json web token format) JWT's are stored in the Authorization header using this format: Bearer somerandomstring.encodedpayload.anotherrandomstring
[ { "docid": "4c1e9efe1c0f18661ce88d6f8c1be66c", "score": "0.0", "text": "def http_auth_token\n @http_auth_token ||= if request.headers['Authorization'].present?\n request.headers['Authorization'].split(' ').last\n end\n end", "title": "" } ]
[ { "docid": "7d14d3a5e2e983c331f30dd65c5e68a7", "score": "0.76480734", "text": "def unpack_token_from_header\n if request.headers['Authorization'].present?\n header = request.headers['Authorization']\n regex = /^Bearer (.*)/\n encoded_token_string = header[regex, 1]\n\n if encoded_...
00c5ea32294ae4be4e4b809d6ff0e3ca
Called after extract_blanks. Is given the rest of the string and deals with the nonblank parts.
[ { "docid": "02fecb03af367ee584adfd8e89494f4b", "score": "0.7084004", "text": "def extract_nonblanks(str)\n Types.check( binding, { :str => ComposedString } )\n\n str.gsub(/(.*)/) do |text|\n NonBlank.new(text)\n end\n end", "title": "" } ]
[ { "docid": "88ddd505b35593b8801c0d7a9ed52516", "score": "0.7026292", "text": "def extract_blanks(str)\n Types.check( binding, { :str => ComposedString } )\n\n str.gsub(/(__(?:.*?)__)/) do |fragment|\n create_blank(fragment[2..-3])\n end \n end", "title": "" }, { ...
39eb67ed2688280924d69334f3ea68cb
Get the execution of the replication. This endpoint is for user to get one execution of the replication.
[ { "docid": "eb940800e431b43d00ed3194578cc309", "score": "0.54277676", "text": "def replication_executions_id_get(id, opts = {})\n data, _status_code, _headers = replication_executions_id_get_with_http_info(id, opts)\n data\n end", "title": "" } ]
[ { "docid": "4d914809e17496440b557e821fa85dcf", "score": "0.6321857", "text": "def replication_executions_get(opts = {})\n data, _status_code, _headers = replication_executions_get_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "d756253a22674543a2146952f0b03293", ...
19d42bfc659835253059ece570ddeb58
Desde productos show creamos un detalle
[ { "docid": "c4afa9440dc3b17477e9f2eb2a1f19b5", "score": "0.0", "text": "def create\n @detail = Detail.new(detail_params)\n @detail.product_id = params[:product_id]\n \n if @detail.save\n flash[:success] = 'Detalle de Producto agregado exitosamente. '\n redirect_to product_path(para...
[ { "docid": "8081b392b11fb4bab03709b711850a36", "score": "0.7224116", "text": "def index\n @productos_detalles = ProductoDetalle.all\n end", "title": "" }, { "docid": "1338b6fbee6e301fa819afd763374cc8", "score": "0.68280095", "text": "def show\r\n @productos = Producto.where(\"...
e685bf4a2f35d6b8d785944c3e37b769
Checks when the every was cancelled.
[ { "docid": "870b06db1b61e93fc3a87f0621a7f51a", "score": "0.63146484", "text": "def cancelled_at\n\t\tif cancelled?\n\t\t\t@mutex.synchronize {\n\t\t\t\t@at\n\t\t\t}\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "6146b6fb0e7d2dfe2c463d2552cac24c", "score": "0.73892653", "text": "def cancelled?\n @cancelled\n end", "title": "" }, { "docid": "6146b6fb0e7d2dfe2c463d2552cac24c", "score": "0.73892653", "text": "def cancelled?\n @cancelled\n end", "title": "" }, ...
90db1ac5379e97712b8f454b179c9ad5
Find a device from control point's device list by its UDN
[ { "docid": "fcb9cd008ac34142b1725b6b121532e2", "score": "0.82018083", "text": "def find_device_by_udn(udn)\n @devices.find { |d| d.udn == udn }\n end", "title": "" } ]
[ { "docid": "e0c976e5883fb2bcf1441f82f7f700f6", "score": "0.6922333", "text": "def get_device(name); end", "title": "" }, { "docid": "4cf0d5fb21279bc3c0a0d53496e81d69", "score": "0.6432749", "text": "def device(sku)\n get(\"/devices/#{sku}\")['device']\n end", "title": "" ...
f011d57c28bb84401c99ed899886c7fd
Move outer query to first place.
[ { "docid": "d65d4709a227ca6a81e3b4b2bb6fc77f", "score": "0.63392204", "text": "def outer_first\n outer.current_id = get_outer_current_id\n new_inner_if_necessary(outer.first)\n end", "title": "" } ]
[ { "docid": "d1f5199cf434b861dcbefc12f7f62f09", "score": "0.72131133", "text": "def outer\n @outer ||= begin\n if outer_id\n outer = Query.find(outer_id)\n tweak_outer_query.call(outer) if tweak_outer_query\n outer\n end\n end\n end", "title": "" }, { "do...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "15bd8919a0580a0ab138e8d8dda6d28b", "score": "0.0", "text": "def update!(**args)\n @attachment = args[:attachment] if args.key?(:attachment)\n @source = args[:source] if args.key?(:source)\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...
79cd96afb384b28d97ef26f3958d271d
Builds The Example Workspace
[ { "docid": "fea5b7ab81b441e2d37efee0228b1fcf", "score": "0.57966226", "text": "def build_workspace(dir)\n sh \"xcodebuild -workspace #{dir}/OHHTTPStubsDemo.xcworkspace -scheme OHHTTPStubsDemo build CODE_SIGNING_ALLOWED=NO\"\nend", "title": "" } ]
[ { "docid": "7d7907d70120b556d8d0b499bc11c3ab", "score": "0.67767", "text": "def build\n read_definitions_block\n define_examples\n end", "title": "" }, { "docid": "e9bc097ae15c75c060214ae600bf0eb2", "score": "0.6241915", "text": "def build()\n workspace = @configurati...
d7a1ce68d87080f303401741d87cf675
Searches name and prename.
[ { "docid": "4f46908b5204320c85be65e8d74a14dc", "score": "0.70413023", "text": "def name(name)\n @scope.where('name LIKE :n OR prename LIKE :n', n: \"%#{name}%\")\n end", "title": "" } ]
[ { "docid": "4391e7fef4af5c542bb4c6084f7a642e", "score": "0.7107502", "text": "def namesearch\n Podling.namesearch[display_name]\n end", "title": "" }, { "docid": "41dc6c344b13fd5d740e730f7ad064b3", "score": "0.6566366", "text": "def search_by_name(name)\n return nil if...
06cf92c3ba600efa901507de98f1577f
provides a hash, with keys containing the users decisions and values with the pattern for resolutions
[ { "docid": "1b7981b2b7e1bbdd1efd54cb1435f0e5", "score": "0.63669556", "text": "def resolutions_f_pattern_decision(stage)\n cds = @rs.cd_id_by_stage(stage)\n rpc = resolution_by_cd(stage)\n dpc = decisions_by_cd(stage)\n cds.inject({}) {|ac, cd_id|\n patron = dpc[cd_id]\n ac[patron]...
[ { "docid": "1a84762d1aeabbc09bd3789bb3d5e0d9", "score": "0.55658466", "text": "def resolutions\n @resolutions ||= {}\n end", "title": "" }, { "docid": "1bbb836f236b4b7254081d183fc495ec", "score": "0.5545184", "text": "def possible_assignments\n return_value = {}\n regis...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d174e6f435d041c1047da0f5301e0caa", "score": "0.0", "text": "def set_consultorio_n\n @consultorio_n = ConsultorioN.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
7c229fc5d0dd1f8530261ce714e59832
such that the first 2 numbers are 1 by definition, and each subsequent number is the sum of the two previous numbers. Write a method that calculates and returns the index of the first Fibonacci number that has the number of digits specified as an argument. (The first Fibonacci number has index 1.)
[ { "docid": "82d227946347f26a9782941a98a11c86", "score": "0.0", "text": "def find_fibonacci_index_by_length(num)\n first_fibonacci = 1\n second_fibonacci = 1\n index = 2\n\n loop do\n index +=1\n\n fibonacci = first_fibonacci + second_fibonacci\n break if fibonacci.to_s.size >= num\n\n first_fibo...
[ { "docid": "cdc61b422bbdbb1d6811aea895cdd5eb", "score": "0.8288312", "text": "def fibonacci_sequence index\n if index == 0 || index == 1\n return index\n else\n a = 0\n b = 1\n\n for i in 2..index\n c = a + b\n a = b\n b = c\n end\n\n return b\n end\nend", "title"...
82b0f0f34de2da2067b437e556d403f6
GET /image_data/1 GET /image_data/1.json
[ { "docid": "34721b8028de41051827f815bac9d71c", "score": "0.69491374", "text": "def show\n @image_datum = ImageDatum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image_datum }\n end\n end", "title": "" } ]
[ { "docid": "a61545819d2e64fddd8ad59f421caf80", "score": "0.72785777", "text": "def image_data\n response = nil\n\n Net::HTTP.start(SERVICE_HOST) do |http|\n response = http.get(URI.parse(@url).path + ':medium')\n\n if response.code.to_s =~ /\\A3\\d\\d/\n new_location = U...
80eda4c257f7c19fc838f6371beea79c
Read a &39;compute.RackUnitIdentity&39; resource.
[ { "docid": "c6b590e81c772b6efaf0193b7fac2e11", "score": "0.534501", "text": "def get_compute_rack_unit_identity_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ComputeApi.get_compute_rack_unit_identity_list ...'\n end\n ...
[ { "docid": "2adba280088f9e60abfec491da114955", "score": "0.5419608", "text": "def get_compute_rack_unit_identity_list(opts = {})\n data, _status_code, _headers = get_compute_rack_unit_identity_list_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "4199bf34a8321956c3...
5e6807215253c44e44336495619c6a78
GET /dei_categories/1 or /dei_categories/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "86e5d5637eeb2a8cc989235e83e67c7b", "score": "0.7685828", "text": "def get\n payload = {}\n @client.post('categories/get', payload)\n end", "title": "" }, { "docid": "efcb5e10780279c84a4be599091f0268", "score": "0.7565644", "text": "def categories\n call_...
4955e47417945a7a4c0f84164cd87c88
If all the elements of the named column in the source_dataset are numeric (or blank), return nil, indicating this column is not subject to catetory expansion. Otherwise return a set of each distinct value found in the column. This will be used to create multiple binaryvalued columns.
[ { "docid": "fd531a3d8b28008c4cb680599f300f5b", "score": "0.5817385", "text": "def get_categories(feature_column)\n column_values = training_data.map {|instance| instance[feature_column]}\n if column_values.all? {|cell| cell.kind_of?(Numeric) || cell.nil? || cell==''}\n nil\n ...
[ { "docid": "0d99872883332ebe7c1bbed13ba3f9a3", "score": "0.5719246", "text": "def distinct_values_for_column(column) #:nodoc:\n res = column.model_klass.find(:all, :select => 'distinct ' + column.name).collect{|ar| ar.send(column.name) }.reject(&:blank?).map{|i|[i,i]}\n end", "title": "" ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "4ad5630ba9873cb9208358994d1e1c1b", "score": "0.0", "text": "def rescue_params\n params.require(:rescue).permit(:numero_caso, :lugar_incidente, :hora_incidente, :descripcion_incidente, :observaciones, :danos_materiales, :jefe_brigada, :jefe_seguridad, :latitude, :longitude, :emergency_id...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
d563e83b348374d1dbc3cef18da9a077
The method should return a new string where every character of the original is shifted num characters in the alphabet. def caesar_cipher(str, num) encrypted_arr = [] str.each_char.with_index do |char, idx| encrypted_arr alphabet_arr.length) new_index = new_index alphabet_arr.length end return alphabet_arr[new_index] en...
[ { "docid": "073fdb1d2aafa42df56e3a309f33f682", "score": "0.9138948", "text": "def caesar_cipher(str, num)\n new_str = \"\"\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n str.each_char do |char|\n old_index = alphabet.index(char)\n new_index = old_index + num\n new_char = alphabet[new_index % ...
[ { "docid": "bb77f6b59a969961ce2b9c405aea7c08", "score": "0.9277844", "text": "def caesar_cipher(str, num)\n alphabet = 'abcdefghijklmnopqrstuvwxyz'\n\n str.each_char.with_index do |char, i|\n shift = alphabet.index(char) + num # shifting num chars in the alphabet\n if shift > 26 # restart at 0 a...
7b2eab78da319c2ff6d620210b18d575
snippetstart:[ruby.example_code.iam.ListRoles] Lists up to a specified number of roles for the account.
[ { "docid": "3b55728acb4211510953c97fecdd5f95", "score": "0.79260075", "text": "def list_roles(count)\n role_names = []\n @iam_resource.roles.limit(count).each_with_index do |role, index|\n puts(\"\\t#{index + 1}: #{role.name}\")\n role_names.append(role.name)\n end\n rescue Aws::Erro...
[ { "docid": "61f394b57a1edcdf63769df903a5c7a3", "score": "0.75948054", "text": "def list_roles(options={})\n request({\n 'Action' => 'ListRoles',\n :parser => Fog::Parsers::AWS::IAM::ListRoles.new\n }.merge!(options))\n end", "title": "" }, { ...
964b8863e11938524cfd61d63de3e891
12x5 on newsfeed for SINGLE images 16x9 on newsfeed for gallery creation images
[ { "docid": "cf7cd9903ee5b09fbbf47b2f25b3fa6e", "score": "0.6301748", "text": "def news_feed_extra(news_feed, image_type = :twelve_x_5)\n extra = {\n image_url: image.send(image_type).url,\n image_alt: image_alt,\n gallery_id: gallery_id,\n vehicle_id: gallery.try(:vehicle_id)\n ...
[ { "docid": "0d33c32f41d89650e805de8364309a7b", "score": "0.6621713", "text": "def buildThumbnails()\r\n # noImageFiles = %w[baghead.png ghostImage.png NoImageAvailable.png]\r\r\n thumbs = ImageList.new()\r\n @people.each { |p| \r\n if p.photo_uid \r\n thumbs.read(p.photo.thumb('100...
e675ec316987b996c4e8915f9ca7b32e
Publish a message to Pubsub synchronously.
[ { "docid": "3d1ca7317340b38fa30e99a5d6b7131b", "score": "0.0", "text": "def publish_to_pubsub(model, action)\n publish(model, action)\n end", "title": "" } ]
[ { "docid": "d4e568536a849e8ec898f10a41f0e91e", "score": "0.7421657", "text": "def publish_to_pubsub(async = false)\n if async\n @pubsub.topic.publish_async payload\n @pubsub.topic.async_publisher.stop.wait!\n else\n @pubsub.topic.publish payload\n end\n end", "...
83bc1c5f9741433b693fe9cbccfb5c8b
Reload configs from file filename path to file
[ { "docid": "19cf4acb1e434b5c5bf9499ebccdfc12", "score": "0.0", "text": "def load filename = Filename\r\n settings = eval File.read filename\r\n clear\r\n settings.each{|category_name,category_data|\r\n add_category SettingsCategory.new category_name, category_data\r\n }\r\n ...
[ { "docid": "43ecb130806583f5b3e3fed5942bebd1", "score": "0.6905632", "text": "def reload\n load @filename\n end", "title": "" }, { "docid": "29156ed5749c2f85b135706d0b123eed", "score": "0.6795723", "text": "def reload_config\n @config = Configuration.new(@editor.path_to_curr...
31c6061799158db67f7521354621df36
apps:rename NEWNAME rename the app
[ { "docid": "403db9180e7ea7a6d31e04c5f9c55fb8", "score": "0.76334655", "text": "def rename\n name = extract_app\n newname = args.shift.downcase.strip rescue ''\n raise(Heroku::Command::CommandFailed, \"Must specify a new name.\") if newname == ''\n\n heroku.update(name, :name => newname)\n...
[ { "docid": "5539f22911cadee18abfa5c736babdd8", "score": "0.78719515", "text": "def change_app_name!\n end", "title": "" }, { "docid": "574e3134c055235d6c615e3965c8d6c7", "score": "0.69409937", "text": "def set_name\n @appname = \"Bike London\"\n end", "title": "" }, ...
41caafaf1342cea671758557398116b7
POST /tier_fillings POST /tier_fillings.json
[ { "docid": "6b97463ec2c21e2bf99eb039a84c03b4", "score": "0.7471072", "text": "def create\n @tier_filling = TierFilling.new(tier_filling_params)\n\n respond_to do |format|\n if @tier_filling.save\n format.html { redirect_to @tier_filling, notice: 'Tier filling was successfully created.'...
[ { "docid": "412c7248e1ea883089a982aac24656af", "score": "0.7620647", "text": "def tier_filling_params\n params.require(:tier_filling).permit(:tier_id, :filling_id)\n end", "title": "" }, { "docid": "3b4a68d9afdeda9128a16832802bfb61", "score": "0.7151529", "text": "def set_tie...
aef15331dd6fa87c817457580a5b880f
Vertical / Horizontal Graph
[ { "docid": "a1393a2d6811c76fef4fb0a7af5a5b67", "score": "0.0", "text": "def get_vertical_graph_min(type: nil)\n scoped = Fcavgdata.all\n\n his_date = self.uptdate.to_date\n fcavgdata_histories = FcavgdataHistory.where(\"? BETWEEN to_date(his_start_date) AND to_date(his_end_date)\", his_date).or...
[ { "docid": "83e82a2db3c4a05609404c44c929d8e8", "score": "0.62518173", "text": "def horizontal_bar_graph(_data)\n raise NotImplementedError\n end", "title": "" }, { "docid": "80075b225fd75c3ec12ffb802548ee10", "score": "0.59392625", "text": "def axes\n end", "title": "" ...
da96298b8dd8fc8c4b0e0a4f845e75ef
POST /calificacions POST /calificacions.json
[ { "docid": "372cce0a87c606c92a8003c213b7f29b", "score": "0.6140539", "text": "def create\n @client = current_client\n @calificacion = @client.calificacions.new(calificacion_params)\n\n if @client.save\n flash[:notice] = \"Su calificacion a sido guardada\"\n redirect_to client_ca...
[ { "docid": "2ab856f63e7f4c136cef70cbcd27e621", "score": "0.6397964", "text": "def calificacion_params\n params.require(:calificacion).permit(:calificacion_ordinaria, :calificacion_remedial, :calificacion_extraordinaria, :calificacion_final)\n end", "title": "" }, { "docid": "de60793b...
5d5524548a2e0a785bba233dbf2bf8b9
Use channel email domain in case of account email domain is not set for custom message_id and in_reply_to
[ { "docid": "0640b648ea76c08d3f97fbfdff9b0765", "score": "0.7080608", "text": "def channel_email_domain\n return @account.inbound_email_domain if @account.inbound_email_domain.present?\n\n email = @inbox.channel.try(:email)\n email.present? ? email.split('@').last : raise(StandardError, 'Channel...
[ { "docid": "95497a40fd38b4fbd61f85295ede6060", "score": "0.6477025", "text": "def generate_reply_to; end", "title": "" }, { "docid": "269377d294e50eb643b5c4faca4a7781", "score": "0.6476142", "text": "def reply_to_email\n email.presence || username\n end", "title": "" }, {...
720234186e1e539b026cb1673ec0743c
GET /orders/1/cancel GET /orders/1/cancel.json remember a note parameter must be passed with this request (e.g., /orders/1/cancel/?note=test)
[ { "docid": "1c5d27dbd6f219e9f03a94b05e48ac16", "score": "0.80827737", "text": "def cancel\n @order = Order.find(params[:id])\n if((@order.status == \"DRAFT\" || @order.status == \"PLACED\") && params.has_key?(:note))\n @order.cancel_note = params[:note]\n @order.status = \"CANCELLED\"\n ...
[ { "docid": "ef0c5ff4a683a66a62c45c56a4cbb27c", "score": "0.74228567", "text": "def cancel(params)\n request(Resources::RESOURCE_CANCEL, HTTP_METHOD_POST, params)\n end", "title": "" }, { "docid": "eb115c389e3ff47015ceac18b753e9ae", "score": "0.7092439", "text": "def cancel(pa...
107bcb5ad3fd2d7b82be25088f8b69be
Overloading the parent run_in_context
[ { "docid": "eb85c3d46b02b2c4d7543ba4d70bfd25", "score": "0.6953839", "text": "def run_in_context(o={}, &block)\n if o\n context_stack.push self\n set_vars_from_options(o)\n instance_eval &block if block\n context_stack.pop\n else\n super\n end\n end",...
[ { "docid": "15a735aba07c6128d769098c18bf609e", "score": "0.80322605", "text": "def in_context(*args, &blk)\n context.instance_exec(*args, &blk)\n end", "title": "" }, { "docid": "ebcea19bcc01ba5bec4a2da25edc7afc", "score": "0.7229129", "text": "def context(*) end", ...
738b61abfae546dac374969d02908443
Delete row or columns of row === Parameters args(Array):: Key, columns, options === Return (Array):: Mutation map and consistency level
[ { "docid": "f9c7f4d5792c5c8e66471c54597a9569", "score": "0.5676544", "text": "def remove(*args)\n do_op(:remove, column_family, *args)\n end", "title": "" } ]
[ { "docid": "631dda702fa8c2732187190babc327fa", "score": "0.69077027", "text": "def delete_from_row\n @mutations <<\n Google::Bigtable::V2::Mutation.new(delete_from_row: {})\n end", "title": "" }, { "docid": "38305fa16aa89aea4b2d7c1c43ed46a4", "score": "0.657533...
3edb5802dfd0094fd7e03438e2acf0c6
player choose computer chooses The game keeps going until there is either a winner (3 in a row) or all the spaces are filled up > tie
[ { "docid": "460184a0af98f4a878467798ca94d6f3", "score": "0.0", "text": "def initialize_board\n b = {}\n (1..9).each {|position| b[position] = \" \"}\n b\nend", "title": "" } ]
[ { "docid": "5330e2661503aaac7367adefee277044", "score": "0.78196687", "text": "def game_human_vs_computer\n puts\"\"\n print_board\n puts\"\"\n\n until win(@board) || tie(@board)\n if @player_turn == @human_player_name_HVC\n puts \"<= #{@human_player_name_HVC}, Please Enter [0-8]...
8e15214a6502bec00e6b83c83698fefa
If Github already has a version tagged for this commit, use it unless it is smaller. If the commit is after a known tag, bump it once. Othervise bump latest release number.
[ { "docid": "1888ac05b3ada083fe2adfab70c74892", "score": "0.6923249", "text": "def next_release_number\n latest_samson_number = project.releases.last&.number || \"0\"\n next_samson_number = next_number(latest_samson_number)\n return next_samson_number if commit.blank?\n\n return next_samson_n...
[ { "docid": "3bbc85b1a16b0dc5a9dadff8fb70b446", "score": "0.6622191", "text": "def tag_release(tag)\n unless this_version == extract_version\n info \"Committing buildfile with version number #{extract_version}\"\n Git.commit File.basename(version_file), message\n Git.push if Git...
f3edff9e9b80923b4b4d1a8d3ab17dd5
PATCH/PUT /fichas/1 PATCH/PUT /fichas/1.json
[ { "docid": "c0fb2e4292bb5accb28d0c948a357a3d", "score": "0.6599689", "text": "def update\n respond_to do |format|\n if @ficha.update(ficha_params)\n format.html { redirect_to @ficha, notice: 'Ficha was successfully updated.' }\n format.json { render :show, status: :ok, location: @f...
[ { "docid": "303060a263c85fea20750fedc6eae2bb", "score": "0.6730807", "text": "def update\n @ficha = Ficha.find(params[:id])\n\n respond_to do |format|\n if @ficha.update_attributes(params[:ficha])\n format.html { redirect_to @ficha, notice: 'Ficha alterada com sucesso.' }\n form...
b895808352620ebe27067bb5a5667cf1
12. Remove pet by name 1. call previous function with same 2 parameters 2. assign outcome of previous function to pet_found var 3. delete pet_found within pets array.
[ { "docid": "1a4c66012f6f7fa1bc8f3994df77000a", "score": "0.78632444", "text": "def remove_pet_by_name(pet_shop, pet_name)\n pet_found = find_pet_by_name(pet_shop, pet_name)\n pet_shop[:pets].delete(pet_found)\nend", "title": "" } ]
[ { "docid": "37634a41d681017a02deee416ffe62bb", "score": "0.79651326", "text": "def remove_pet_by_name(pet_shop,name)\n pets_array = pet_shop[:pets]\n pet_to_remove = find_pet_by_name(pet_shop,name)\n pets_array.delete(pet_to_remove)\nend", "title": "" }, { "docid": "0193662bc2c3a041808636...
43a2b47dfef411df216c684edc9cb744
Signal that the user is going to be moving the star from the first grid
[ { "docid": "81f8dd6363fce37ac822956146b9ff23", "score": "0.0", "text": "def mouse_over_star?\n inputs.mouse.point.inside_rect?(scale_up(state.star))\n end", "title": "" } ]
[ { "docid": "12891f74657569c400ba113ab0b0a989", "score": "0.65311986", "text": "def notify(start_row, start_col)\n @has_moved = true\n end", "title": "" }, { "docid": "f3e11c7ef31c183a144f6e43c7ac81dc", "score": "0.6442357", "text": "def input_star\n old_star = grid.star.clone\...
130848137f6e9034e87c2ab0b7f3fce6
Configurations texts joins together the contents of each configuration separated by two newlines (`\n\n`).
[ { "docid": "a8f5e9e274702560b6f3148e19537c56", "score": "0.714761", "text": "def to_s\n txt = []\n @configs.each do |c|\n txt << c.to_s #if c.text\n end\n txt.join(\"\\n\\n\")\n end", "title": "" } ]
[ { "docid": "8875b63b5b1966dec8355f0c8203e334", "score": "0.672021", "text": "def to_s\n lines = @config.map { |section, data| render_section(section, data) }\n lines.join(\"\\n\").concat(\"\\n\")\n end", "title": "" }, { "docid": "5c71d7a72f6678f6782f0fdacb83933b", "score": ...
971fae99e92d119a2dfb418b855e6abd
POST /projects POST /projects.xml
[ { "docid": "c683c9ed711b35b9605c619b93efe3a9", "score": "0.59845847", "text": "def create\n @new_project = Project.new(params[:project])\n @new_project.created_by = current_user.login\n\n respond_to do |format|\n if @new_project.save\n flash[:notice] = 'Project was successfully crea...
[ { "docid": "1e2d0724e2981f82777f41548e5f861c", "score": "0.7630163", "text": "def test_should_create_project_via_API_XML\r\n get \"/logout\"\r\n post \"/projects.xml\", :api_key=>'testapikey',\r\n :project => {:user_id => 1,\r\n :url...
b5bc593a5784503558c0cf42d304b411
The path where the templates for this theme will reside
[ { "docid": "4328b7d69c2126924c6ef6ba0aeec085", "score": "0.7667742", "text": "def html_path\n self.path + \"theme\"\n end", "title": "" } ]
[ { "docid": "9b4fee9d2db5523d44a06dbf45985507", "score": "0.8230704", "text": "def templates_path\n File.join(File.dirname(__FILE__), '..', 'templates')\n end", "title": "" }, { "docid": "6193db109320354804d8e80d4a6558bf", "score": "0.8116866", "text": "def template_path\n ...
868a28a67e162e007e0e4deeddb1600f
returns the date and name of the holiday, and optionally, the date adjustedtext if any.
[ { "docid": "ad3d30f4a2ba526990b9b322b1a7e310", "score": "0.5830453", "text": "def to_s(date_adjusted_text = true)\n description = \"#{@date.strftime(\"%a %d %b %Y\")} : #{self.name}\"\n # if date_adjusted_text && @date_adjusted\n # description += \" (#{@date_adjusted_text})\"\n # end\n ...
[ { "docid": "1705f1304d5e43189cead9076b2b4445", "score": "0.7142524", "text": "def holiday\n holidays[date.strftime('%m/%d')]\n end", "title": "" }, { "docid": "278da9fd56f053cbc6a886af7f7815c4", "score": "0.660413", "text": "def holiday\n Holiday.find_by(holiday_date: self.sch...
5d2d61c9b9df5bcad4f83e9b1ad3b554
method takes one argument total number of switches returns an array that identifies which lights are on after n repititions initalize the lights hash
[ { "docid": "74fd9868042653f4f1ae9f2419276f2c", "score": "0.72542745", "text": "def initialize_lights(number_of_lights)\n lights = Hash.new\n 1.upto(number_of_lights) { |number| lights[number] = 'off' }\n lights\nend", "title": "" } ]
[ { "docid": "3620bfdbfd583f0b15e3a4393a088bc6", "score": "0.77671254", "text": "def lights_on(number_of_switches)\n lights_are_on = []\n which_lights_are_on = []\n\n 0.upto(number_of_switches-1) do |switch|\n lights_are_on << false\n end\n\n step_by = 1\n\n while step_by <= number_of_switches\n ...
7dd1c5e9521b14bb2f18b5c7a2bc67f6
GET /exmautorizs GET /exmautorizs.json
[ { "docid": "7c4bde6a682823374cb3c09c95b3e121", "score": "0.7912105", "text": "def index\n @exmautorizs = Exmautoriz.all\n end", "title": "" } ]
[ { "docid": "65db7ec8641ce5a9f0c8de0e52e29c57", "score": "0.6925919", "text": "def index\n @estadisticas = Estadistica.all\n render json: @estadisticas, status: :ok\n end", "title": "" }, { "docid": "cd72c3f3c867733d15b504a35b3f9b3c", "score": "0.68090093", "text": "def index\n...
acdf7e96913ccb298d09b7bef2b00f46
Quick way to highlight active navigation bar areas.
[ { "docid": "d570921192411b8cf8cea32c681580a7", "score": "0.0", "text": "def is_active?(controller_action)\n \"#{params[:controller]}\\##{params[:action]}\" == controller_action ? \"active\" : nil\n end", "title": "" } ]
[ { "docid": "988a010eb4f11bf36c75e837ae40fe2d", "score": "0.66124463", "text": "def active_navbar_class(page_path)\n current_page?(page_path) ? \"active\" : \"\"\n end", "title": "" }, { "docid": "e7e66dd916a36ff35a517baca5a1bbfc", "score": "0.63682055", "text": "def nav_active(ur...
4a8f4afe6d1cf6d49737f57c7285980e
degrees returns the next stop id and location each time that is called
[ { "docid": "ec88fc4a8c9c1594615a41c72fbca1fe", "score": "0.0", "text": "def each_stop\n stops = conn.exec \"SELECT stop_id, location FROM gtf_stops\"\n stops.each do |stop_id, location|\n yield stop_id, location\n end\n end", "title": "" } ]
[ { "docid": "3309837472eb684554d2f367ff119365", "score": "0.69009495", "text": "def next_coordinates\n get_direction\n current_position\n next_step\n end", "title": "" }, { "docid": "afe8e1ba3e961d3ee61d8af6c329148c", "score": "0.65625924", "text": "def set_next_stop\n\t\t@c...
34792602cbd5eb7d066382179ed8e20f
load the flat list of desc records recursively corresponds to _pst_build_desc_ptr record_descriptor
[ { "docid": "37179cd25bcf1619f740160c41ef8db1", "score": "0.6491157", "text": "def load_desc_rec offset, linku1, start_val\n\t\t@desc_offsets << offset\n\t\t\n\t\tbuf = pst_read_block_size offset, Desc::BLOCK_SIZE, false\n\t\titem_count = buf[ITEM_COUNT_OFFSET]\n\n\t\t# not real desc\n\t\tdesc = Desc.new...
[ { "docid": "c8afc1e8b15a56fe67463c626d36014d", "score": "0.7775178", "text": "def load_desc\n\t\t@desc = []\n\t\t@desc_offsets = []\n\t\tif header.version_2003?\n\t\t\t@desc = Desc64.load_chain io, header\n\t\t\t@desc.each { |desc| desc.pst = self }\n\t\telse\n\t\t\tload_desc_rec header.index2, header.i...
f98512b8c00e644c1028636186317c45
GET /clientes/1 GET /clientes/1.json
[ { "docid": "2ca8224b5da0491038b611373e234213", "score": "0.0", "text": "def show\n @cliente = Cliente.find(session[:usuario_id])\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end", "title": "" } ]
[ { "docid": "d144515f40616fcd4071bc6074af11d5", "score": "0.760843", "text": "def index\n @clientes = Cliente.all\n render json: @clientes\n end", "title": "" }, { "docid": "c0ffa931d98d5ce1e2041a93d545d9ea", "score": "0.7303716", "text": "def index\n @clients = Client.all\n...
452a549382a8b8b361188dcb09b0b4e6
SSH Login Scanner Just give it username(s) and password(s) to check and it will look for successful login credentials
[ { "docid": "dcba7d3c42e230a213dec58de7ae05af", "score": "0.75598073", "text": "def ssh_login_scan\n\t\tprint_status(\"SSH Login Scanner\")\n\t\tprint_caution(\"Target IP or IP Range: \")\n\t\tzIP=gets.chomp\n\n\t\tprint_caution(\"Use Standard FTP Port of 22 (Y/N)?\")\n\t\tanswer=gets.chomp\n\t\tif answe...
[ { "docid": "b7b20d51285716b64c6fbc02665d4f32", "score": "0.7219955", "text": "def test_cam_credentials(host,username,password)\n begin\n Net::SSH.start( host, username, :password => password ) do|ssh|\n end\n rescue Exception => e\n puts \"Authentication invalid!\"\n return \"B...
271c9f0de7ecb525170dd118b927055b
read the file. uses +cwd+ set by Schlepp::Burdencd. Returns nil if no file is found.
[ { "docid": "4d14914498759befc6619dd23c49d5d6", "score": "0.0", "text": "def read(file = name)\n return nil unless file && File.exists?(file)\n\n @encoding ||= 'utf-8'\n io = File.open(file)\n io = io.read.encode('utf-8', @encoding, :invalid => :replace, :undef => :replace, :u...
[ { "docid": "d330a458b03d457530c104877dc72c1c", "score": "0.7312404", "text": "def file_read(file)\n path = File.join(Dir.getwd, file)\n return File.file?(path) ? File.read(path) : nil\n end", "title": "" }, { "docid": "5cc1001695f6afbdcf58cde4a7b7a3da", "score": "0.7013853",...
856a658e119dce9234d2a6d4db41ffab
The following solution uses adjacency matrix
[ { "docid": "26cdc05d6e9eba0b270e6981df100f14", "score": "0.0", "text": "def distance_with_bfs(graph, root)\n node_lengths = {}\n\n graph.each_with_index do |_val, index|\n node_lengths[index] = Float::INFINITY\n end\n\n queue = [root]\n node_lengths[root] = 0\n\n while queue.any?\...
[ { "docid": "bb8f4bdf499333160570ed4fc5f24027", "score": "0.7533703", "text": "def adjancy_matrix\n matrix = GraphViz::Math::Matrix.new( @graph.node_count, @graph.node_count )\n\n @graph.each_edge { |e|\n x = @graph.get_node(e.node_one(false, false)).index\n y = @gra...
76f83268d121332b3185a9654677201f
Adds time based on the rate. The assignment doesn't specify what happens with remaining time over maxTime, so we just cap it.
[ { "docid": "67b89ef5acc494b2c4d46befc5aaf11a", "score": "0.575978", "text": "def insertQuarters(numberOfQuarters)\n\t\tif self.remainingTime == self.maxTime:\n\t\t\treturn\n\t\tend\t\n\n\t\tnewTime = [(self.remainingTime + (numberOfQuarters * self.rate)), self.remainingTime].min\n\n\t\tself.remainingTim...
[ { "docid": "880b950a06869d33ab5400bd6754a2a0", "score": "0.6196274", "text": "def put_rate_decay\n return DEFAULT_PUT_RATE unless @last_throughput_exceeded && (Time.now - @last_throughput_exceeded) < 10\n DEFAULT_PUT_RATE * (2 - ((Time.now - @last_throughput_exceeded) / 10))\n end", "ti...
436c92814873e10cb991787d103397d7
PATCH/PUT /reviews/1 PATCH/PUT /reviews/1.json
[ { "docid": "f6f780cf672b6dc4a16826d53ad98488", "score": "0.6451357", "text": "def update\n if @review.update_attribute(:text, params[:text])\n render json: { notice: \"Review was edited successfully\"}\n else\n render json: { alert: \"Please, try again\", errors: @review.errors }\n en...
[ { "docid": "455cbeca2c9c63464a2e59c7d084acd4", "score": "0.73301554", "text": "def update\n @review.update!(review_params)\n\n render json: @review\n end", "title": "" }, { "docid": "4806851221678163d44d95394231929b", "score": "0.7301059", "text": "def update\n review = Rev...
cf27411f31a568f7dc95ac50eaeb3d45
DELETE /carrier_types/1 DELETE /carrier_types/1.json
[ { "docid": "28529995c4c7977078f1156aedc5ae00", "score": "0.8189491", "text": "def destroy\n @carrier_type = CarrierType.find(params[:id])\n @carrier_type.destroy\n\n respond_to do |format|\n format.html { redirect_to carrier_types_url }\n format.json { head :no_content }\n end\n e...
[ { "docid": "1c9c0bd0a5b90d29d62fa81a37eae04b", "score": "0.7996039", "text": "def destroy\n @carrier_type.destroy\n\n respond_to do |format|\n format.html { redirect_to carrier_types_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.carrier_type')) }\n forma...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "f9a7b2f67262b7fdabc6522cdfa584bc", "score": "0.0", "text": "def update!(**args)\n @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)\n @deprecated = args[:deprecated] if args.key?(:deprecated)\n @description = args[:description] if ar...
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.7308486", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72639555", "text": "def update(...
21b27dc8acedb3c62dc2d22cfe83a65f
Creates a new Group. Optionally, you may pass the :mapper option your third party system's group id. This will allow you to find your Group again later using the same identifier as your foreign system. Options: mapper => your foreign group id
[ { "docid": "0614b44d6ac7d0cbf643b24250fa655a", "score": "0.80098015", "text": "def create_group(options={})\n Group.create self, options\n end", "title": "" } ]
[ { "docid": "e0f250d199cedd46657ffd92b4b98cb4", "score": "0.76878506", "text": "def group(mapper)\n create_group(:mapper => mapper)\n end", "title": "" }, { "docid": "e0f250d199cedd46657ffd92b4b98cb4", "score": "0.76878506", "text": "def group(mapper)\n create_group(:mapp...
695780694e71bbb1ccfc9e4d12b94c10
element should be of type REXML:Element
[ { "docid": "f62e308b0185e35e2095072d991f1fe6", "score": "0.0", "text": "def verify_element_has(element, expected_val, links=nil, has_entities=false)\r\n element.class.should == REXML::Element\r\n if has_entities\r\n if links.nil?\r\n XPath.first(element, \"entities/link\").should == ni...
[ { "docid": "b74c41a03e2a31710ea30f143191ba8a", "score": "0.7416951", "text": "def parse_element(element)\r\n raise 'Define me!'\r\n end", "title": "" }, { "docid": "da5a7957d97b66cc73e862a4bebe3e85", "score": "0.7176563", "text": "def element; end", "title": "" }, ...
a98299eaeadc11a25563be86f2021b16
Given the current round number and the to hit roll (value of 4 means 4+ to hit), this method returns an array of numbers to reroll if any dice equal a number in the array. Example usage: reroll misses by returning [1...hit_needed] (... is noninclusive end so result is [1, 2, 3] if hit_needed is 4.
[ { "docid": "55e90a1e35256ae0a0dfff099893af0a", "score": "0.67746943", "text": "def hit_reroll_values(round_number, hit_needed)\n []\n end", "title": "" } ]
[ { "docid": "9dc991a61ca832f7f5738f3a15c864b6", "score": "0.6886115", "text": "def roll_hits(round_number, rolls)\n rolls\n end", "title": "" }, { "docid": "e3d16c641715b00c9bae289370405c1a", "score": "0.6837515", "text": "def hit_needed(round_number, roll_needed)\n roll_needed...
bb148b463f13a22b47d1d8b5e4ecabe1
Retrieve the Avalara tax provider Retrieves the Avalara tax provider.
[ { "docid": "a5341ff1e362d656365038c1113fcfea", "score": "0.73546296", "text": "def get_tax_provider_avalara_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TaxApi.get_tax_provider_avalara ...'\n end\n # resource path\n ...
[ { "docid": "c53323cdb63c327e35cd817e208e457d", "score": "0.6964139", "text": "def get_tax_provider_avalara(opts = {})\n data, _status_code, _headers = get_tax_provider_avalara_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "15a10e79836efbc431c8e0181f18c60b", "...
aa95dba3b017ebc1426335cc45b3444a
DELETE /salaries/1 DELETE /salaries/1.json
[ { "docid": "0c4a46fd246619d4562247dc9cea7449", "score": "0.7082022", "text": "def destroy\n @salary.destroy\n respond_to do |format|\n format.html { redirect_to salaries_url, notice: 'Salary was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": ...
[ { "docid": "9f818a5094e18b55ce170b5efc56c7ef", "score": "0.7209478", "text": "def destroy\n @salary = Salary.find(params[:id])\n @salary.destroy\n\n respond_to do |format|\n format.html { redirect_to(salaries_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, {...
5bf1767152e82eee420db242c894741e
PUT /skill_profiles/1 PUT /skill_profiles/1.xml
[ { "docid": "49993047f4cf2739bb9dc23407e70efc", "score": "0.73699766", "text": "def update\n @skill_profile = SkillProfile.find(params[:id])\n\n respond_to do |format|\n if @skill_profile.update_attributes(params[:skill_profile])\n format.html { redirect_to(@skill_profile, :notice => 'S...
[ { "docid": "b46a9c5ae70c9197ccebd4fba8409506", "score": "0.68695486", "text": "def update\n respond_to do |format|\n if @skills_to_profile.update(skills_to_profile_params)\n format.html { redirect_to @skills_to_profile, notice: 'Skills to profile was successfully updated.' }\n form...
29e588668d6174e714ffb3d1a2494b5f
returns the association based on event name === Parameters: :event_route_name event name === Returns: ChristianMinistrychristian_ministry with validation errors
[ { "docid": "ddd65ba8c3c69f0aa251a2d9d18c80f5", "score": "0.79395056", "text": "def get_event_association(event_route_name)\n case event_route_name.to_sym\n when Event::Route::BAPTISMAL_CERTIFICATE\n baptismal_certificate\n when Event::Route::CHRISTIAN_MINISTRY\n christian_ministry\n ...
[ { "docid": "ec6062b231ae571d6da8e7cfee847fec", "score": "0.5817228", "text": "def find_event(event_name)\n @events.find { |event| event.name.to_s == event_name.to_s }\n # TODO: use a data structure that prevents duplicates\n end", "title": "" }, { "docid": "fe9...
4fc2c26b1fc1ad6b95179c82e511b163
capitalize the first letter in each word of a string, except 'a', 'and' and 'the' unless they come at the start of the start of the string, e.g. 'the lion the witch and the wardrobe' becomes 'The Lion the Witch and the Wardrobe'
[ { "docid": "a1e06b3406f05d9dd48eb04d7b3fa0f8", "score": "0.7975267", "text": "def titleize_a_string(string)\n exceptions = ['a', 'and', 'the']\n string.capitalize!\n array = string.split(' ')\n array.map do | str |\n exceptions.include?(str) ? str : str.capitalize\n end.join(' ')\nend", "tit...
[ { "docid": "97bdad1cc6e44bf98338326f7d179ee8", "score": "0.83259654", "text": "def titleize_a_string(string)\n result = string.split.each do |x|\n if (x != 'a' && x != 'and' && x != 'the')\n x.capitalize!\n end\n end\n result[0].capitalize!\n result.join(' ')\nend", "title": "" }, ...
156768cb93aea079fa3678795f14857c
GET /reviews/1 GET /reviews/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "4c53a23719cec17d6a83a3da03fe2db7", "score": "0.78798026", "text": "def index\n @reviews = reviewable.reviews\n\n respond_to do |format|\n format.html\n format.json { render json: @reviews }\n end\n end", "title": "" }, { "docid": "60c9a13ae9f3beaa84f5d19d8af5f...
852e483c65dde0c532ab9a051ff1a62a
Public members, ordered. Unlike standard show page, we don't have special treatment for representative hero.
[ { "docid": "ec034ed57bc8e1ca99958049a3f35a5b", "score": "0.70429343", "text": "def member_list_for_display\n @member_list_display ||= begin\n members = all_members\n\n unless can_see_unpublished_records?\n members = members.find_all(&:published?)\n end\n\n # omit \"portrait...
[ { "docid": "7e7f1336d0dda17d493bb10c412fdbf1", "score": "0.7203365", "text": "def ordered_viewable_members\n @ordered_members ||= work.ordered_viewable_members(current_user: current_user)\n end", "title": "" }, { "docid": "668a67aba715f426bcd5be6def490562", "score": "0.6998095", ...
e5e76219dcba8149ebd68ba37fb278ed
Must be called when read only attributes are updated externally. Recalculates cached attribute values and links children with parents. Throws if a class invariant is violated.
[ { "docid": "3f86b83feda4c01d3d6592af2be73cdd", "score": "0.0", "text": "def recalculate\n end", "title": "" } ]
[ { "docid": "c75a5976a3047c4e6d22c123d2151d4c", "score": "0.66242415", "text": "def update_cached_attrs!\n bg_color!# if @argument_type_changed\n relation_to_thumb!\n \n return unless children.size > 0\n \n children.each(&:update_cached_attrs!)\n end", "title": "" }, { "doc...
b5b85907d41ad209f4cddec7a1e04360
method get_callbacks Abstracts the details of storing the serialized callback in the session object.
[ { "docid": "a6ca7e38de42011ce2f96c3a41efdbd3", "score": "0.63894194", "text": "def set_callbacks(session, callback)\n return if session.nil?\n session[callback_key] = callback\n end", "title": "" } ]
[ { "docid": "f2bdb76388b0670d3b4e4e4d51791768", "score": "0.75703555", "text": "def get_callbacks(session)\n return nil if session.nil?\n session[callback_key]\n end", "title": "" }, { "docid": "f2bdb76388b0670d3b4e4e4d51791768", "score": "0.75703555", "text": "def get_ca...
0f0797500415b85fc155f367ed943413
Run block inside EM reactor and connected to backup AMQP server
[ { "docid": "d159ac2fc6fec9695bbb1d42fe28c218", "score": "0.6741442", "text": "def run_backup_job(&block)\n MessageQueue.start(MessageQueue.connect_params(AMQP_BACKUP_CONFIG)) do\n block.call\n MessageQueue.stop\n end\n end", "title": "" } ]
[ { "docid": "5c4b3aff4c71e7b869d6fea1493a4fac", "score": "0.6420847", "text": "def init_util(description = \"\", &block)\n\n EM.run do\n\n config_amqp = {\n :host => 'localhost',\n :port => '5672',\n :user => 'guest',\n :pass => 'guest',\n :vhost => '/',\n :frame_max => ...
e351caf8899f8ea5ef3548c047bc62be
Ask the OBS for the build statistics of a package
[ { "docid": "6cc99d479221ac18bb3881f2138df89b", "score": "0.7171648", "text": "def statistics(project, package_name, target, arch)\n cache(\"#{project}@#{package_name}@#{target}@#{arch}.statistics.xml\") do\n puts \"Obtaining build time for #{package_name}\"\n\n Dir.mktmpdir do |dir|\n Dir.ch...
[ { "docid": "a8c640d125c89b8320d983d03918c9a2", "score": "0.62114537", "text": "def collect_stats\n # code callously ripped from statistics.rake !\n folders = STATS_FOLDERS.select{|name, dir| File.directory?(dir) }\n cs = CodeStatistics.new(*folders)\n statz = cs.statistics\n tyme ...
9a682c019a8eaa99c16d98e05f5c6ac5
Public: Gets the path to the directory where repositories and other resources for this Course will be stored. Returns the path to the Course's storage directory.
[ { "docid": "0991f374a9fb311b23a0dd615fcfc743", "score": "0.64575213", "text": "def storage_path\n File.join(department.institution.storage_path, url_part)\n end", "title": "" } ]
[ { "docid": "74a934f3d94941ed510cdb48034a8357", "score": "0.70953226", "text": "def store_dir\n File.join Rails.root, root_dir, model_dir, partition_dir\n end", "title": "" }, { "docid": "96eb2705445e9ae91f77347847ccd0f4", "score": "0.70589596", "text": "def store_dir\n %(#{Rai...
7a9857ed4cf926f51fe15dc145492416
For details on the DSL available within this file, see
[ { "docid": "a404c191d2b689c4a620102f8951113c", "score": "0.0", "text": "def index\n @projects = Project.search(params[:search])\nend", "title": "" } ]
[ { "docid": "d907d5c93ecb25c953b62e1575017932", "score": "0.7006539", "text": "def _dsl(block)\n GoodsDoc.class_exec(*dsl_in) { |method, *args| send(method, *args, &block) }\nend", "title": "" }, { "docid": "bcc43d77786886b76f3423ce42ff145c", "score": "0.6962351", "text": "def dsl\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "07b61bbbc11853159208fef77497c7b5", "score": "0.0", "text": "def second_rip_params\n params.require(:second_rip).permit(:codigo_prestador, :user_id, :admin_user, :tipo_identificacion, :numero_identificacion, :numero_factura, :fecha_expedicion_factura, :fecha_inicio, :fecha_final, :codigo...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74954116", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6956924", "text": "def strong_params\n params.require(:request).permit(param_whit...
ce7e7b4622318ba0faae0559a457992e
Returns `true` if `self` and `other` have the same attributes and values.
[ { "docid": "0c94cd6dd056cad4474f991ac3ffc118", "score": "0.0", "text": "def ==(other)\n super &&\n @name == other.name &&\n @regexp == other.regexp &&\n @value == other.value\n end", "title": "" } ]
[ { "docid": "d52d1042a4b5533455a8d5852ae59fd7", "score": "0.87455165", "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", "s...
efd1f7b72268c34e81ab30f2a5c98115
Get a single user by their name. If the user doesn't exist, return nil.
[ { "docid": "6b0c558b8396bfb2e6211dd9f144e5e2", "score": "0.83260417", "text": "def get_user(name)\n User.where(name:).first\n end", "title": "" } ]
[ { "docid": "e19f59525d7008718520ad8fe9115da6", "score": "0.8407078", "text": "def get_user_by_username(name)\n resp = request('getUserByUsername', {:username => name})['user']\n resp['username'].empty? ? nil : User.new(self, resp)\n end", "title": "" }, { "docid": "76a4d5cf555f0...
10487dd9582709ed18886005a9be0ca4
Make a terminal bell chime
[ { "docid": "32f9276c672446a6f84117fb20804c23", "score": "0.6659771", "text": "def bell(chimes=1, logger=nil)\n chimes ||= 0\n return unless logger\n chimed = chimes.to_i\n logger.print \"\\a\"*chimes if chimes > 0 && logger\n true # be like Rudy.bug()\n end", "title": "" ...
[ { "docid": "f78a6c33dd70bc04a54866b0bf7809ba", "score": "0.65360117", "text": "def game_victory\n \"You made it!!!!!!\\n\".colorize(:blue).each_char { |c| putc c; $stdout.flush; sleep 0.1 }\n sleep(2.0)\n scenic_view\n sleep(0.7)\n \"\\n!You survived the Zombie Apocalypse! Off to the pub ...
2fc042fe6b52f16a310e204651b0507f
another solution still seems redundant even with loops
[ { "docid": "401f5fe88b4e4cf5b98273c009e2bfb5", "score": "0.0", "text": "def dms(float)\n arr = float.divmod(1)\n temp_arr = []\n dms_arr = []\n while temp_arr.size <= 2\n if arr[0] < 1\n arr = (arr[0] * 60).divmod(1)\n end\n temp_arr << arr[0]\n arr.delete_at(0)\n end\n\n while te...
[ { "docid": "54f970ee5768d76a8818f20a25600939", "score": "0.6408002", "text": "def looping", "title": "" }, { "docid": "17966ac7ffda6a58d4fd24706fc4ee23", "score": "0.6267632", "text": "def iterations; end", "title": "" }, { "docid": "354acc44d23902170d18ef50bb27f5b1", ...
903f701991d5feb8953be90739c70782
Lookup a store by an account number
[ { "docid": "35714855994a65d42ea1e8ac79fdcd05", "score": "0.766765", "text": "def lookup\n if !params[:account_number].blank?\n store = Store.find_by_account_number(params[:account_number])\n if store.blank?\n redirect_to search_stores_path(:query => params[:account_number])\n el...
[ { "docid": "ca6917829437a2ee2ce0f5c20e988bb1", "score": "0.6372852", "text": "def by_store_code(code)\n store_account_map[code] || default_account\n end", "title": "" }, { "docid": "e714967a2865da49731434b16bbe1245", "score": "0.62620825", "text": "def retrieve_from_store!(id...
7be28a94cf1ce84cccbd09fe74c5a462
DELETE /transport_hours/1 DELETE /transport_hours/1.json
[ { "docid": "897865b93ef1bd82aefbc585d425711c", "score": "0.75164765", "text": "def destroy\n @transport_hour.destroy\n respond_to do |format|\n format.html { redirect_to transport_hours_url, notice: 'Transport hour was successfully destroyed.' }\n format.json { head :no_content }\n en...
[ { "docid": "6874cc504ca6991d1486076254d333d2", "score": "0.72503316", "text": "def destroy\n @estimated_hour.destroy\n respond_to do |format|\n format.html { redirect_to estimated_hours_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8df9...
afd55ae152dc9bfb7e5bc399abd83346
DELETE /photos/1 DELETE /photos/1.json
[ { "docid": "4657569a66654acb1d27e72a40340bbc", "score": "0.0", "text": "def destroy\n @photo = Photo.find( params[:id])\n @album = @photo.album\n if @photo.destroy\n if params[:bucket_id]\n redirect_to bucket_album_path( params[:bucket_id], @album )\n else\n redirect_to ...
[ { "docid": "263cc237843efa8a720c1b8d4840b44b", "score": "0.7743216", "text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "...
8b78d83649021bccbc87bffbe34a606a
2. Write module methods and register as handlers done in your module scripts 3. listener to handle incoming payload. The handle will call handlers using intent = method name
[ { "docid": "642bec671b5bb4bc008751505409453b", "score": "0.6704601", "text": "def handle(msg)\n to = msg['to']\n intent = msg['intent']\n if to && intent\n begin\n # !Note that the access isn't flexible as in py and js where dotpath can be use\n reply = Module.const_get(to).method(intent...
[ { "docid": "b4d6ba8a60f9457bf96ffc7e3e1d9ea1", "score": "0.6703024", "text": "def handler; end", "title": "" }, { "docid": "b4d6ba8a60f9457bf96ffc7e3e1d9ea1", "score": "0.6703024", "text": "def handler; end", "title": "" }, { "docid": "6bab742ecf47900b74a25496b4caa524", ...
728e911929705fd332783dad9abe218b
Returns the broadcast address
[ { "docid": "32817d6fcc48d686ffbdcd26c274d252", "score": "0.6392265", "text": "def broadcast(ip)\n ip, cidr = ip.split('/')\n cidr_matrix(cidr)[:broadcast] % ip.split('.')\n end", "title": "" } ]
[ { "docid": "37ee9f9329cda24a7aafb72d69f3aa36", "score": "0.88773155", "text": "def broadcast_address\n IPAddress( self.ip ).broadcast\n end", "title": "" }, { "docid": "c8628019b951402fae9a547bc9c06d80", "score": "0.75686526", "text": "def broadcast()\n return from(network(...
d3cf8f99ab66069c0da69756b6bdeb37
set right border of the cell. see set_border() about style.
[ { "docid": "20dd7fd1f9e2677285410bcfa22920db", "score": "0.71369433", "text": "def set_right(style)\n @right = style\n end", "title": "" } ]
[ { "docid": "23af2ac2cd98fcbd2a8232715cf342c7", "score": "0.7998442", "text": "def change_border_right(weight='thin')\n change_border(:right, weight)\n end", "title": "" }, { "docid": "f6c246ef9cee2a86d1e82cb604936273", "score": "0.7559988", "text": "def right_border_width=(wi...
ec30fca1604e1d2e43a6f2f33dff4556
PATCH/PUT /invoices/1 PATCH/PUT /invoices/1.json
[ { "docid": "8d423f76eaa49aaaa126ff754592d18a", "score": "0.0", "text": "def update\n # find the invoice\n rowsParam = params[:invoice][:invoice_rows]\n rows = rowsParam.map do |row|\n data = row[1]\n { desc: data[:desc], units: data[:units], price: data[:price] }\n end\n\n @invo...
[ { "docid": "c17d147ed9e5f14ef9c63e4e6aafaa07", "score": "0.7060372", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n if @invoice.update(invoice_params)\n head :no_content\n else\n render json: @invoice.errors, status: :unprocessable_entity\n end\n end", "title":...
0f6004e83259fec0a7ed1464c5e805e9
I've got a crazy mental illness. I dislike numbers a lot. But it's a little complicated: The number I'm feared of depends on which day of week it is... This a concrete description of my mental illness: Monday > 12 Tuesday > numbers greater than 95 Wednesday > 34 Thursday > 0 Friday > numbers divisable by 2 Saturday > 5...
[ { "docid": "b329402fd4a5595973a787f5cda8646b", "score": "0.80440027", "text": "def am_I_afraid(day,num)\n case day\n when \"Monday\"\n num == 12 ? true : false\n when \"Tuesday\"\n num > 95 ? true : false\n when \"Wednesday\"\n num == 34 ? true : false\n when \"Thursday\"\n num == 0 ? t...
[ { "docid": "6c109333d3859de7fb5fa4fee7dd26af", "score": "0.7129808", "text": "def test_day_num?\n assert_equal(true, day_num?(1))\n assert_equal(true, day_num?(2))\n\n assert_equal(false, day_num?(8))\n assert_equal(false, day_num?('stuff'))\n end", "title": "" }, { "docid": "a2...
9e241fbdb501fba86712485cf35a5440
Called by the galaxy 'clear' command
[ { "docid": "7db47685dd8adf7fd5d4055d6ee02b42", "score": "0.0", "text": "def clear!\n lock\n\n begin\n stop!\n\n @logger.debug \"Clearing core\"\n deployer.deactivate current_deployment_number\n new_deployment = current_deployment_number + 1\n self.current_dep...
[ { "docid": "ec796656cc826cb5154c07657902bf20", "score": "0.79066104", "text": "def clear\n send_cmd \"clear\"\n nil\n end", "title": "" }, { "docid": "823292dbc58d2653e82199eae90b3190", "score": "0.77626294", "text": "def clear() end", "title": "" }, { "docid": "82...
49f7ff62de1489b2f8c973bcc9d07a6a
Creates a new instance.
[ { "docid": "fbe317eecbc611300c2308891585211f", "score": "0.0", "text": "def initialize( time_swam, time_swam_from_start = nil )\r\n # badges data\r\n @time_swam = time_swam\r\n @time_swam_from_start = time_swam_from_start\r\n end", "title": "" } ]
[ { "docid": "8adda1b144e03f06faf1aa28abfdf9b0", "score": "0.7665391", "text": "def new(*args)\n self.class.new(*args)\n end", "title": "" }, { "docid": "5fe6a16420767be6e734a9dbd085a16b", "score": "0.76384115", "text": "def create!(*args, &block)\n instance = new(...
b54a6ff87990d76bbed3aa6436953187
Create a new Mixlib::CLI class. If you override this, make sure you call super! === Parameters args:: The array of arguments passed to the initializer === Returns object:: Returns an instance of whatever you wanted :)
[ { "docid": "ef8a6ce4c62b2b88399eebe8cff79828", "score": "0.0", "text": "def initialize(*args)\n @options = {}\n @config = {}\n @default_config = {}\n @opt_parser = nil\n\n # Set the banner\n @banner = self.class.banner\n\n # Dupe the class options for this instance\n ...
[ { "docid": "ed48caee931ceebadd4f9bf6fb6de564", "score": "0.6979129", "text": "def initialize(args = ARGV)\n args = args.split(\" \") if args.is_a?(String)\n\n opts = Trollop::options(args) do\n banner \"CSS and JavaScript dependency resolution, file concatenation and general utility bel...
c4a292214b1797e28309e9dab0543ef7
Random Number Generator for seed
[ { "docid": "1e9dde15852da5420be930b8f52f5918", "score": "0.7526479", "text": "def gen_rand_num(seed, range)\n seed = seed.to_i\n return nil if seed <= 0\n\n rng2 = Random.new(seed)\n num = rng2.rand(range) + 1\n num\n end", "title": "" } ]
[ { "docid": "1829a0245b86829be6b9dba145385a92", "score": "0.819491", "text": "def random_number_generator; end", "title": "" }, { "docid": "30df763f4a4fea04834128e80cb5288b", "score": "0.8136197", "text": "def seedgen(seed)\r\n\t\t@mt[0] = seed\r\n\t\t1.upto(623) do |i|\r\n\t\t\t@mt[i...
cb8cd96f85c16277607e649c89642fe6
if a template is partial is stored in the Path instance details[:virtual_path] irrespective of how the file is named
[ { "docid": "dda5c1a3655b8868fb8c8e3da6a54e3c", "score": "0.7098458", "text": "def partial?(template)\n !!template.virtual_path.partial? rescue false\n end", "title": "" } ]
[ { "docid": "013fa2745098829e67b834414717b163", "score": "0.73942345", "text": "def partial(name)\n partial_name = \"_#{name}.#{Stache.template_extension}\"\n template_dir = self.virtual_path.split(\"/\")[0..-2].join(\"/\")\n partial_path = File.expand_path(File.join(Stache.template_base_p...