query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
0c84300c4a84c648c3fd6be15126365c
Tedious main handler method.
[ { "docid": "485bdc67e307f07681268afc66629932", "score": "0.0", "text": "def render(root)\r\n\t$dimension = maxdepth(root) * ($DISTANCE + $FONTSIZE)\r\n\t\r\n\t#image junkiness\r\n\t$img = Magick::Image.new($dimension, $dimension) { self.background_color = 'white' }\r\n\t$canvas = Magick::Draw.new\r\n\t$...
[ { "docid": "e95cfad9c46711f2a05857f5bcaad7b7", "score": "0.7589196", "text": "def main\n\n end", "title": "" }, { "docid": "e95cfad9c46711f2a05857f5bcaad7b7", "score": "0.7589196", "text": "def main\n\n end", "title": "" }, { "docid": "efa7967c369e2852cbce412d93...
0b57445b2ea9d4ca69ef00d1a50a4e27
The logo of the application that will be displayed to users that perform a share with it.
[ { "docid": "7db0c7ff97ca4c105a58c5b4d52067a6", "score": "0.7987194", "text": "def logo\n get_attribute(Yoti::Attribute::APPLICATION_LOGO)\n end", "title": "" } ]
[ { "docid": "14fce93f162cb29e057d06128949fd24", "score": "0.77277964", "text": "def get_logo\n Oneclick::Application.config.ui_logo\n end", "title": "" }, { "docid": "804e396d85e495d589d0eb0e50ddb7f4", "score": "0.7170889", "text": "def logo\n\t\ts = image_tag('rails.png', :alt =>...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f33587afbd3fdd398f61c465edabc1c3", "score": "0.0", "text": "def exopto_params\n params.require(:exopto).permit(:exam_id, :status, :optq01, :optq02, :optq03, :optq04, :optq05, :optq06, :optq07, :optq08, :optq09, :optq10, :optq11, :optq12, :optq13, :optq14, :optq15, :optq16)\n end", ...
[ { "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...
d63f18e8be4fede234d926a8c0d5f68a
def tableView(tableView, didEndDisplayingCell:cell, forRowAtIndexPath:indexPath) callback(tableView, indexPath, :on_end_display, cell, true) end TODO: Implement footer/header display callbacks if someone requests it def tableView(tableView, willDisplayHeaderView:view, forSection:section) end def tableView(tableView, wi...
[ { "docid": "6436781a95d9791f235225de88b6da3b", "score": "0.5713901", "text": "def tableView(tableView, heightForRowAtIndexPath:indexPath)\n sections[indexPath.section][:cells][indexPath.row][:height] || default_cell_style[:height] || UITableViewAutomaticDimension\n end", "title": "" } ]
[ { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, h...
503eece9b20f814b06b332a9e78b25ef
DELETE /errors/1 DELETE /errors/1.json
[ { "docid": "8268d044743f95ae4caf09a47b3d2c04", "score": "0.7434295", "text": "def destroy\n @error = Error.find(params[:id])\n @error.destroy\n\n respond_to do |format|\n format.html { redirect_to errors_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "47379be64dc6a4b2e4efd757e41368b9", "score": "0.7503068", "text": "def destroy\n @error = Error.find(params[:id])\n @error.destroy\n\n respond_to do |format|\n format.html { redirect_to errors_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "...
d7a217c2d48987d418c60e5b7487c732
Find the nearest parent node from the specified index. If one or more types are provided, find the nearest node whose type is in the list.
[ { "docid": "ebe6a5c105b8faa8c2439ffe33d0c32d", "score": "0.83032465", "text": "def parent_node_from(index, *types)\r\n arr = tree_at(index)\r\n arr.each { |a|\r\n if a.kind_of?(AST::Node) and (types.empty? or types.include?(a.type))\r\n return a\r\n end\r\n }\r\n ...
[ { "docid": "0205424fd35542983d85e3ef00e7a14a", "score": "0.6496373", "text": "def parent\n parent_index = index - 1\n return nil if parent_index < 0\n parent = at parent_index\n parent = parent.parent if parent.uncommon?\n parent\n end", "title": "" }, { "docid": "5eac58e16fd...
69834046e38f557c4fdc29d8f33cd031
author:Noha hesham Description: finds the project by its id then destroys it params: none success: a pop up appears and makes sure the user wants to delete the project by choosing ok the project is successfully deleted failure: project is not deleted
[ { "docid": "5b5b7c854166091b0c24ed6c6c93dc3c", "score": "0.7633386", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "deaecc62b871f25fda515558e50fe5f1", "score": "0.8473078", "text": "def destroy\n bad_request(\"Missing project key\") unless params[:id].present?\n \n project = Project.by_key(params[:id])\n bad_request(\"Not valid project\") unless project\n access_denied unless is_admin?(pro...
a0fa74c2aabf5499025e6418c6245952
Client proof algorithm implementation.
[ { "docid": "a97b90fe56ec73f5b9750a36042df92d", "score": "0.65482914", "text": "def client_proof(key, signature)\n @client_proof ||= Base64.encode64(xor(key, signature)).gsub(\"\\n\",'')\n end", "title": "" } ]
[ { "docid": "b718a1a74d083c8470fd8aa02f04c5bc", "score": "0.7199365", "text": "def proof_of_work(client)\n value = SecureRandom.hex(16)\n work = Digest::SHA2.hexdigest value\n client.puts \"Please provide proof of work for: SHA2(????#{value[4..-1]}) == #{work}\"\n client.print '? '\n pow = Digest::...
43dbbbb4c503643aa5ba51803960550b
PUT /businessbooks/1 PUT /businessbooks/1.json
[ { "docid": "b2f9d851bc898529f28a6633ae476e4d", "score": "0.69470376", "text": "def update\n @businessbook = Businessbook.find(params[:id])\n\n respond_to do |format|\n if @businessbook.update_attributes(params[:businessbook])\n format.html { redirect_to @businessbook, :notice => 'Busin...
[ { "docid": "872659a166a13bbd04d1cff0026745bc", "score": "0.6816322", "text": "def update\n @api_book = Api::Book.find(params[:id])\n\n if @api_book.update(api_book_params)\n head :no_content\n else\n render json: @api_book.errors, status: :unprocessable_entity\n end\n end", "t...
982f5516152fcba753f7b6947efa5645
lexer rule t__80! (T__80) (in Mig.g)
[ { "docid": "033a3d7a6e943d12989d9daa0d5be801", "score": "0.5660029", "text": "def t__80!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 41 )\n\n\n\n type = T__80\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\...
[ { "docid": "95d4d89e8e03fbc9abefcdef312b032f", "score": "0.74614346", "text": "def t__80!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 58)\n\n type = T__80\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - ...
278bec699decbc381645c2407b2e77c0
if value is a float, will check that it is no more than two decimal places
[ { "docid": "2e3990bd8c88790ed2130e102d4a4b15", "score": "0.6476016", "text": "def validate_2dp(value)\n # turn into string, split by decimal, check length of right hand side.\n string_value = value.to_s\n if string_value.include? '.'\n if string_value.split('.')[1].length > 2\n return i...
[ { "docid": "27240c5a231819b5703e50b64e2eea85", "score": "0.7031489", "text": "def is_float?(number)\n number.include?(\".\") ? true : false\n # if number.include?(\".\")\n # true\n # else\n # false\n # end\nend", "title": "" }, { "docid": "3d77c222f8ee048a9c8c05afd457e4c5", "sc...
e758976ed4a2553c212f26444c976259
gets the match history of the player refered by account_id on region_name server
[ { "docid": "650df06e1c7a6fcaad6123fec1a56cdc", "score": "0.60275525", "text": "def get_recent_games(account_id, region_name)\n client = get_check_client(region_name)\n return client.game.recent(account_id)\n end", "title": "" } ]
[ { "docid": "2d8b303abf01d0dda44935277c5a9de7", "score": "0.6488691", "text": "def history(options = {})\n response = run_request('GetMatchHistory', options)['result']\n History.new(response) if response\n end", "title": "" }, { "docid": "3c411dcd395214469325b22d6e8fec94", "s...
b57b0a4ffb4470da3e7dfbbdc5077400
Insert an value into a subTrie, creating one if necessary. Internal method called by Trie.insert.
[ { "docid": "b58795d831084df2b9a2ae0da1d12343", "score": "0.6586462", "text": "def insert_in_child(key, value)\n (@children[key[0]] ||= self.class.new).insert(key[1..-1], value)\n end", "title": "" } ]
[ { "docid": "adebdfc6f5ecb6db2d6b619a61d78188", "score": "0.668694", "text": "def insert(val)\n if @parent.nil?\n return @parent = ANode.new(val)\n end\n\n # find where the val belongs\n new_node = ANode.new(val)\n recurse_insert(@parent, new_node)\n end", "title": ...
95c4077ac2f7021853fa5358166655ce
Check if object with a given key is stale
[ { "docid": "30f4add61569e8da18c86a35c11c2951", "score": "0.68290895", "text": "def stale?(*args)\n alloc(*args).stale?\n end", "title": "" } ]
[ { "docid": "b33c4b8d4969cd949738acf22dfc48bd", "score": "0.74955994", "text": "def stale?\n unlocked? and item.has_attribute?(:updated_at) and updated_at < item.updated_at\n end", "title": "" }, { "docid": "4b9146ac1f727c5be475d77fe1172f11", "score": "0.7365694", "text": "def sta...
9142587730cce547c877a7b04be9a7e9
GET /resource/sign_in def new super end POST /resource/sign_in def create super end DELETE /resource/sign_out def destroy super end
[ { "docid": "884e0503375bb69c4c1ff0dd3a487efa", "score": "0.0", "text": "def index\n @users = User.all.page(params[:page])\n end", "title": "" } ]
[ { "docid": "f9faf8644d2e0cadf045e870c9943753", "score": "0.73311436", "text": "def signin\n signin_get if request.get?\n signin_post if request.post?\n end", "title": "" }, { "docid": "c18bf8d6db417642bc865363f39bc381", "score": "0.7212876", "text": "def sign_in; end", "ti...
2990c791bb4cb6ca90e9c44102c5c22d
remove input notes. takes a single note or an array of notes
[ { "docid": "dace4c6b947fae04379c79871c92e9a3", "score": "0.7767767", "text": "def remove(notes, options = {})\n notes = [notes].flatten\n notes = sanitize_input_notes(notes, MIDIMessage::NoteOff, options)\n @sequence.remove(notes)\n end", "title": "" } ]
[ { "docid": "025471fe926049b7daabf4aef028ef87", "score": "0.7466605", "text": "def clean_notes\n for note in notes\n if note.comment.blank?\n note.destroy\n end\n end\n\n end", "title": "" }, { "docid": "d3fda5eb2571238bfd7344d26d64ba78", "score": "0.6655864", ...
d3ea9df7ff673ad26e7db76991cb6f23
Returns an array of manufacturer choices to be used with the select view helper
[ { "docid": "f1cbe23bd9e7a3e6a1d80d188c1f05f9", "score": "0.80581945", "text": "def manufacturer_choices\n @list_of_manufacturers ||= Array.new\n\n @manufacturers = Manufacturer.all\n\n @manufacturers.each do |p|\n\n @list_of_manufacturers.push([p.name, p._id])\n end\n\n @l...
[ { "docid": "40c16aa533acafe5470f18bf69789ecc", "score": "0.6475", "text": "def genders_select\n return [['Male', 'm'], ['Female', 'f'], ['Unspecified', 'u']]\n end", "title": "" }, { "docid": "a0bada22e44a72d8854bca85ccff23e9", "score": "0.6320299", "text": "def choices()\n ...
2839561f3cfe8b7e1814d5a9fde35d71
Took 64.685792 seconds => 362879
[ { "docid": "aff8160e3a30e6b13bac03dc30ac2238", "score": "0.0", "text": "def benchmark\n n = 349572681\n oldTime = Time.now\n 50.times do\n n = test(n)\n end\n puts \"1000 Tests took #{Time.now-oldTime}\"\n n = 123456789\n oldTime = Time.now\n 1000.times do\n n = test2(n)\n end\n puts \"1...
[ { "docid": "089f00f53597451ffe6433696e855a58", "score": "0.5737471", "text": "def benchmark\nend", "title": "" }, { "docid": "b3929c54bbce28e89dd83fba60f7b4b0", "score": "0.56845653", "text": "def build_timing; end", "title": "" }, { "docid": "1182dd0594ef4a8eb04bb707a781...
2492ea2c548597ee179dd47de9c97d9b
signs text with this key, base64 encoded by default
[ { "docid": "feac08eee7d1baf37c8f93f3a6911195", "score": "0.79002416", "text": "def sign_and_encode(text_to_sign, base64_encode=true)\n return nil if text_to_sign.nil? || text_to_sign.empty?\n sig = @key.sign(OpenSSL::Digest::SHA256.new, text_to_sign)\n base64_encode ? Base64UrlSafe.encode...
[ { "docid": "0dd84a6988b85ad759905df11ae884c9", "score": "0.7459426", "text": "def sign(string, base64=false)\n sig = @private_key.sign(OpenSSL::Digest.new(\"SHA1\"), string)\n\n base64 ? base64_encode(sig) : sig\n end", "title": "" }, { "docid": "2b2be35379a65d2ed77cbf3023f920a8...
e3ded68faa959d5349ef358cc921528c
The Add Subscription endpoint registers the application to send notifications when the user Fitbit data changes. The endpoint response includes a summary of the subscription
[ { "docid": "c056c6dd39dc331525f6ead3ba20a205", "score": "0.60885394", "text": "def add_subscription(user_id: '-', collection_path: nil, subscription_id: nil)\n raise StandardError if !subscription_id\n if collection_path\n return post(\"#{API_URI}/#{SUBSCRIPTION_API_VERSION}/user/#{user...
[ { "docid": "0e32a468b1ba5f969d8d94570fb20d47", "score": "0.71150523", "text": "def registerSubscription\n require 'json'\n\n if (@role.nil? or !(@role.subscriptions_permissions)) and !current_actor.superadmin\n json_response({ message: \"You don't have permission to register subscriptions in ...
d70e52484e328ff2411a0096a01353f7
Set implicit wait and default_wait to timeout, defaults to 30. if set_wait is called without a param then the second to last wait will be used. ```ruby` set_wait 2 set_wait 3 set_wait 2 ````
[ { "docid": "9d5cc248a6ae9cf69153dd69c3514b66", "score": "0.8285323", "text": "def set_wait timeout=nil\n if timeout.nil?\n # puts \"timeout = @default_wait = @last_wait\"\n # puts \"timeout = @default_wait = #{@last_waits}\"\n timeout = @default_wait = @last_waits.first\n ...
[ { "docid": "830af04f8c796a954f149e8829aeb96f", "score": "0.7200762", "text": "def set_implicit_wait_by_default(wait)\n return if @default_wait.nil?\n\n @driver.manage.timeouts.implicit_wait = wait\n rescue ::Selenium::WebDriver::Error::UnknownError => e\n unless e.message.inclu...
ed4a296c1c73d4449f325c189314bc1a
Set the value of the Sort input for this Choreo.
[ { "docid": "3260352ef52838d0a9f14e20d5200c3e", "score": "0.8527327", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" } ]
[ { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_inp...
ba13e006aff44c9a07478b9600ab7b03
POST /area_editions POST /area_editions.json
[ { "docid": "5de89b8e146ac7f762e06b96e329e9da", "score": "0.7159524", "text": "def create\n @area_edition = @layout.area_editions.new(area_edition_params)\n\n respond_to do |format|\n if @area_edition.save\n format.html { redirect_to main_app.url_for([:edit, @product, @theme, @personali...
[ { "docid": "b7dffee3429c9758b77e266174b304b9", "score": "0.66242385", "text": "def index\n @area_editions = @layout.area_editions.all\n end", "title": "" }, { "docid": "b61379707fe0dd22cd70965250ccb01e", "score": "0.6481441", "text": "def set_area_edition\n @area_edition = @...
d5dce0c417cbfb224f7ff65c46027ba7
array of values in the BST when the BST is traveresed inorder
[ { "docid": "a2fc8bcb3affae659c675147869f768f", "score": "0.6649827", "text": "def inorder\n\t\ttree_data = []\n\t\ttree_data = inorder_traverse(@root, tree_data)\n\tend", "title": "" } ]
[ { "docid": "225eb8f1b0dd93a38f235988930f7516", "score": "0.76707506", "text": "def inorder\n current = @root\n values = []\n if current != nil\n current.inorder(values)\n end\n return values\n end", "title": "" }, { "docid": "f4042a761ccf9b15032270695d0f27b8", "score...
83c4398b46bc51ed07d5e5d5ec699274
used for strong parameters
[ { "docid": "dec1ca8d7e3e35b8b3fee8108819a29b", "score": "0.0", "text": "def user_params\n params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation)\n end", "title": "" } ]
[ { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.8266021", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.72142285", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n ...
7e6c2be143a1283eff583190e5150a4d
Locates the `watchdogs` service.
[ { "docid": "c476ad9ea299db2a512a1d14461252c0", "score": "0.73355365", "text": "def watchdogs_service\n @watchdogs_service ||= VmWatchdogsService.new(self, 'watchdogs')\n end", "title": "" } ]
[ { "docid": "a535ef311b33ccaf621185e76a6168ae", "score": "0.7573211", "text": "def watchdogs_service\n @watchdogs_service ||= InstanceTypeWatchdogsService.new(self, 'watchdogs')\n end", "title": "" }, { "docid": "f351bd7d7169de87a8aa04ae0c7dc73a", "score": "0.7396977", "text":...
ca4f9c9811a385630428fd7ef9b8ce8f
USDT > ETH > BTC > USDT
[ { "docid": "20f1023c66974ee864d1a19113620b9f", "score": "0.0", "text": "def calculate_triangle(fund)\n refresh_balances(@base, @coin1, @coin2)\n print_balances\n\n pairs = [\n find_pair(@coin1, base: @base),\n find_pair(@coin2, base: @coin1),\n find_pair(@base, base: @coin2),\n ...
[ { "docid": "2596915d7c5ca6c0db960f2489f82ae2", "score": "0.5571792", "text": "def usd_profit\n break_even(:usd).abs\n end", "title": "" }, { "docid": "332253c50901c5dc6965ff2a7ea9024d", "score": "0.54490966", "text": "def usd_value\n # CBR.ru may not update exchange rate on ho...
2bbb3a7b59d0fa4c48e5b5871ef4f363
api_hostname is for ingress controller
[ { "docid": "84d3b982cb0b92354665cdd54e1ca593", "score": "0.7957872", "text": "def api_hostname; application.api_hostname end", "title": "" } ]
[ { "docid": "4634ecf2f3aa9030c6d80db9748dd9e8", "score": "0.72369194", "text": "def host\n api['host']\n end", "title": "" }, { "docid": "b34d14530308a3a72e912a6b00242b05", "score": "0.7017119", "text": "def v3_hostname\n unless @server.starts_with?(\"platform-api-\")\n ...
a177ef766ef3ca99d2ccb781ee69d95f
Test 09 & 10
[ { "docid": "389059ddd523cc1724a7469861f768a1", "score": "0.0", "text": "def to_s\n str = \"| \"\n current_item = @first_item\n until current_item.nil?\n str << current_item.payload\n punctuation = current_item.last? ? \" \" : \", \"\n str << punctuation\n current_item = cu...
[ { "docid": "78947974f0b66760c445fa9c50eec611", "score": "0.62204415", "text": "def test_010\n require 't010'\n test(X10, 123, '010 test: X10')\n test(X20, 678, '010 test: X20')\n end", "title": "" }, { "docid": "f308ee36b33172b534fc355fc2913314", "score": "0.61265564", ...
01e60e7c52e9b52c0611bde50c8859d3
String representation of this Link in dotfile syntax.
[ { "docid": "6f8a626b706a7d2922d1fdbdc22bc231", "score": "0.0", "text": "def to_dot(*attrs)\n s = \" \\\"#{nid(@src)}\\\" #{edgesymbol} \\\"#{nid(@dest)}\\\" \"\n s << \"[#{@attrs.join(',')}]\" unless @attrs.empty?\n s << \"[#{attrs.join(',')}]\" unless attrs.empty?\n if block_given?...
[ { "docid": "3633bb74b430cc397ee0e7998eab8fbf", "score": "0.714472", "text": "def to_s\n \"#{self.name} => #{self.link}\"\n end", "title": "" }, { "docid": "788cd51805d996705deacf14c3828141", "score": "0.6956311", "text": "def to_s\n \"#<\" + self.class.name + \": \" + hr...
d34a9a870a4a047b36257afda09c363c
Wrap the update action with Turbolinks support.
[ { "docid": "b9069ef813412cce99058a52813417d9", "score": "0.0", "text": "def update\n super\n response.status = :unprocessable_entity if resource&.errors&.any?\n end", "title": "" } ]
[ { "docid": "a01ff27bec76eef35eece87af255bc7d", "score": "0.6957167", "text": "def update(*args)\n wrap_in_javascript_for(:update, *args)\n end", "title": "" }, { "docid": "dfa8ac7965df1bb4b09ad4597b03fd30", "score": "0.6730909", "text": "def update\n #formats as js since i...
3b81a7878c56cd8a4310f59aa77476e4
How can you ask for both the name and the cohort? What if one of the values is empty? Can you supply a default value? The input will be given to you as a string? How will you convert it to a symbol? What if the user makes a typo?
[ { "docid": "759b0f7ce6718336a153aca5a7063d0d", "score": "0.6234122", "text": "def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n cohorts = ['january','february','march','april','may','june',\n ...
[ { "docid": "4726043e08338c112e9eacd672666ed4", "score": "0.8126306", "text": "def input_cohort\n puts \"Enter their cohort\".center(80)\n cohort = STDIN.gets.chomp.to_sym\n\n if cohort.empty?\n cohort = :none\n end\n cohort\nend", "title": "" }, { "docid": "2ae0b468542038af62b4b0ed84...
208c4fafab380471d5eb461e8bb6ffb9
apply coupon to the cart, adds a new key, value pair to the cart hash called 'ITEM NAME W/COUPON' adds the coupon price to the property hash of couponed item adds the count number to the property hash of couponed item removes the number of discounted items from the original item's count remembers if the item was on cle...
[ { "docid": "08568b8d26083c19341c2d87128def57", "score": "0.82815135", "text": "def apply_coupons(cart, coupons)\n cart = cart.dup\n coupons.each do |coupon|\n item = coupon[:item]\n #cart[item]=if item in cart matches coupon item\n if cart[item] && (cart[item][:count] >=coupon[:num])#amount in ...
[ { "docid": "13ec123086e5bd19104f6e1f54bc8388", "score": "0.83677256", "text": "def apply_coupons(cart, coupons)\n coupons.each do |coupon|\n if cart.keys.include? coupon[:item]\n if cart[coupon[:item]][:count] >= coupon[:num]\n new_name = \"#{coupon[:item]} W/COUPON\"\n if cart[new_name]...
69beaa3e957d1fc356539d0314d703e1
Custom attribute writer method checking allowed values (enum).
[ { "docid": "f392c181864a13ef6567e80e653689de", "score": "0.5698631", "text": "def legal_form=(legal_form)\n validator = EnumAttributeValidator.new('String', ['1000', '1100', '1200', '1300', '1400', '1500', '1600', '1700', '1800', '1900', '2110', '2120', '2210', '2220', '2310', '2320', '2385', '2400...
[ { "docid": "8146b840a980695b919bbb80892fcc0c", "score": "0.6161179", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_DE...
f01a235e7f67e5c864a4aa49fd3af22f
Make me or someone else operator.
[ { "docid": "a1357a9c8ef8c70ad211d5beae705278", "score": "0.6501461", "text": "def chan_op(irc, chan, nick)\n if !caps(irc, 'op', 'owner').any?\n irc.reply \"You don't have the 'op' capability for this channel; go away.\"\n elsif !chan.me.op?\n irc.reply \"I don't appear to be operator on...
[ { "docid": "66aa56d67e78e70dc763eb919fd484a0", "score": "0.6315378", "text": "def set_operator\n OperatorRecordable.operator = current_user\n end", "title": "" }, { "docid": "3608e51948f4077591a036346ba604ec", "score": "0.6195922", "text": "def or(other); end", "title": "...
4eb97be925a49a75f7ff7711864e78ec
Method used by twitter gem to post message to twitter
[ { "docid": "492c79545fe3d803b9abd9f4068ac09a", "score": "0.6663111", "text": "def update\n if $twitter.update(message)\n status, message = 'complete', 'Posted to twitter'\n end\n end", "title": "" } ]
[ { "docid": "a3628e7fd19567b1718fb9abface686b", "score": "0.89443296", "text": "def post(msg)\n @twitter.post msg\n end", "title": "" }, { "docid": "9975947a72c926154cec47e45828a227", "score": "0.79752177", "text": "def post_tweet(message)\n Tweet.new(message, self)\n end", ...
f9b9d892af16b74445548bd53aa5c082
test to check functionality of talk method.
[ { "docid": "61dad9962963a71ff5001b57735934dc", "score": "0.6385089", "text": "def test_talk\n student = Student.new(\"Robbie\", \"E23\")\n assert_equal(\"Hi, my name is Robbie\", student.talk)\n end", "title": "" } ]
[ { "docid": "2140c29e128a99a2ea14798d5e8bf3fd", "score": "0.73256004", "text": "def test_that_neil_can_talk_to_you\n\t\tassert @neil.talk_to('good', 'yes')\n\tend", "title": "" }, { "docid": "b5ae3869272707c8a2b59d591fe9e2a2", "score": "0.7010385", "text": "def talk\n return \"I ca...
3ed890268e35d7778a492d4bb714b68d
Simplify an API value down to a basic term that we can present in a spreadsheet
[ { "docid": "468a4d23b4b0110a6488ded59740441e", "score": "0.0", "text": "def simplify_value(val)\n v = val\n\n if v.is_a?(Hash)\n v = v['@value'] if v['@value']\n v = v['@id'] if v['@id']\n end\n\n v = v.first if v.is_a?(Array)\n\n v\n end", "title": "" } ]
[ { "docid": "ec8ffd7f5f72d240ff2da298fdbbc13f", "score": "0.6083128", "text": "def api_value(val, data)\n case val\n when 'alcoholInteraction'\n data['alcohol_interaction']\n when 'availableGeneric'\n data['available_generic']\n when 'brandNames'\n return [] if data['brand_name...
41217832e5e2e052c8d2ebbd3c814576
Turns "asc" into 1, "desc" into 1, and other values into 1 or 1.
[ { "docid": "51972d196fed8d8fc24643a7a0bfc5c3", "score": "0.6557349", "text": "def sort_value_from_arg(arg) # :nodoc:\n case arg\n when /^asc/i\n arg = 1\n when /^desc/i\n arg = -1\n when Number\n arg.to_i >= 0 ? 1 : -1\n else\n arg ?...
[ { "docid": "b6dcbf10075eb361fd5616f39d0c8fda", "score": "0.66440535", "text": "def switch(direction)\n if direction == 'asc'\n 'desc'\n elsif direction == 'desc'\n 'asc'\n else\n ''\n end\n end", "title": "" }, { "docid": "749a5662a4816379c506e3638eee2fdd", "s...
25425b028d29f4fd71381e5374ee75f9
DELETE /shipments/1 DELETE /shipments/1.json
[ { "docid": "5b0fd8c8f5ba8c5d76a5d5754c0a8363", "score": "0.72164303", "text": "def destroy\n @shipment.destroy\n respond_to do |format|\n format.html { redirect_to shipments_url, notice: 'Shipment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "ti...
[ { "docid": "96d120b91aeb28fa37cbe5e6b1d1dbb1", "score": "0.77830756", "text": "def destroy\n @ship_request.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "d1265d5745c4322a5468dacce4714e35", "score": "0.76457053", "text": "def destroy\n @badgeship = Badgeship...
66a1acbbb673f39e8bb81bde8b5f28d9
This method restarts the task
[ { "docid": "3f1d190230ad8915b4b83440d20b06da", "score": "0.0", "text": "def restart!\n update_attributes(completed_at: nil)\n end", "title": "" } ]
[ { "docid": "89e6fa59464d43a7fa32eb6ffe8ad53f", "score": "0.8153247", "text": "def restart!\n restart(true)\n end", "title": "" }, { "docid": "f3d750a5def32d9ec2fd14ff8ca369fd", "score": "0.7959181", "text": "def restart!\n stop!\n start!\n end", "title": ...
86259b2c50216615ea5a09d264faa3d6
create the stuffix for city and sttate. wiki cities are done in this format "Los_Angeles,_California" basically spaces are converted to underscores states are spelled out. caps for first letter of each word. there is an additional underscrore that prefix the state.
[ { "docid": "065f4a11b1a378fa887605f83a71449e", "score": "0.72027653", "text": "def url_suffix_create(state_code, city_name)\n # fetch state.\n state_name_full = StateUtil.abbv_to_state state_code\n \n # transform the state name.\n # there might be an issue with caps of non proper nouns.\n...
[ { "docid": "3f99b38f902ee97073fef45a8b7efb9a", "score": "0.69528973", "text": "def format_city_name\n # Capitalize first letter of each word\n # Convert remaining letters of each word to lower case\n # Remove leading and trailing white space\n # Reduce internal string of multiple white space...
e29a41b02d78fe0180cddff75a45e2c3
model validation error messages (if !object.valid?)
[ { "docid": "9aa166ba465eb57f5b44deac9ab2fefc", "score": "0.0", "text": "def user_error\n @user_error = @user.errors.full_messages.join(\", \") if @user.errors\n end", "title": "" } ]
[ { "docid": "ef8122c28780bd7e23464a08a327ffc6", "score": "0.7287516", "text": "def form_errors(model_obj)\n render partial: 'layouts/form_messages', locals: {model: model_obj}\n end", "title": "" }, { "docid": "e6facb08cc1d5321fc3b9b0a322daad2", "score": "0.72844267", "text": "...
da94f01095c45155946cd37035ff3d8b
GET /typesobjects/new GET /typesobjects/new.xml
[ { "docid": "a061003c3511d5c4a24a996989b4349d", "score": "0.77001226", "text": "def new\n\t\t@typesobject = Typesobject.new\n\t\t@objectswithtype=Typesobject.get_objects_with_type\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @typesobject }\n\t\tend\n\t...
[ { "docid": "421052e76e62b1fcffcd2a3e99a1ae7c", "score": "0.7467249", "text": "def new\n @object_type = ObjectType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @object_type }\n end\n end", "title": "" }, { "docid": "35ad7c9c2d8...
cf86d6537e12c1b11306217c30e2bcfc
PUT /formats/1 PUT /formats/1.xml
[ { "docid": "54f4af95b15cb6a376fba5bc3f22b0b9", "score": "0.6582662", "text": "def update\n @format = Format.find(params[:id])\n\n respond_to do |format|\n if @format.update_attributes(params[:format])\n format.html { redirect_to(@format, :notice => 'Format was successfully updated.') }...
[ { "docid": "13394c10035cc389a9117b14f69e7d02", "score": "0.622841", "text": "def update\n @format_type = FormatType.find(params[:id])\n\n respond_to do |format|\n if @format_type.update_attributes(params[:format_type])\n format.html { redirect_to @format_type, notice: 'Format type was ...
04eee0db1c2c91ea433766676e0167e2
Smoke Test File! Tests! Test 1: Featured listing, click left arrow
[ { "docid": "005c2c8d3375edac1207c54ff248bdbf", "score": "0.0", "text": "def test01_D1FLT01_TC_24317\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory)\n\t\t$directory_scroll_left.click\n\t\t$directory_scroll_left.click\n\t\t$directory_scroll_left.click\n\t\t$direct...
[ { "docid": "f7b8ee061886816e3224074f8deb1d3f", "score": "0.6844305", "text": "def test_list_page_for_current\n end", "title": "" }, { "docid": "a04fabbef35856a4f31f90bc445c2ced", "score": "0.66253537", "text": "def select_a_new_testcollection_menu\n # First we select projects\n...
3d314f7a2f507095c205230e9172a254
Update CustomerGroup by ID
[ { "docid": "d0fff296b88b1efd557fd75d81ac09e5", "score": "0.6664279", "text": "def update_customer_group_by_id(project_key, id, customer_group_update, opts = {})\n data, _status_code, _headers = update_customer_group_by_id_with_http_info(project_key, id, customer_group_update, opts)\n data\n ...
[ { "docid": "33bb815a38e5abeaf5a8e392a19df2fa", "score": "0.7733331", "text": "def update\n @customer_group = CustomerGroup.find(params[:id])\n @customer_group.update_attributes(params[:customer_group])\n get_data\n end", "title": "" }, { "docid": "328de023dbcf0daf9b6bc38dd230f5e4",...
5c3188755ea9963d99cdd68a9e8c16d1
Called on file(s) modifications that the Guard plugin watches.
[ { "docid": "e9a17ec2b165e5a204785c81992ee1c2", "score": "0.0", "text": "def run_on_modifications(paths)\n results = runner.test_paths(paths)\n throw :task_has_failed if results.failed?\n end", "title": "" } ]
[ { "docid": "f56f8960280e8ca4b07d37ef43930e69", "score": "0.72702163", "text": "def notify(changed_files)\n ::Guard.guards.each do |guard|\n paths = Watcher.match_files(guard, changed_files)\n guard.run_on_change(paths) unless paths.empty?\n end\n end", "title": "" }, {...
6344c4cb2cde200f7a935a734df6eeeb
GET /settings/account def account end PATCH /settings/account
[ { "docid": "43bfc8009ad94b7a809c5e9cab53d861", "score": "0.71110857", "text": "def update_account\n if current_user.update(account_params)\n redirect_to settings_account_path, notice: \"Account successfully updated.\"\n else\n render :account\n end\n end", "title": "" } ]
[ { "docid": "3b31e0d330d14b29b191cdbab3fcd4e9", "score": "0.7423612", "text": "def account\n get('/account')\n end", "title": "" }, { "docid": "f8e530ea3cd510b4ec5c2e1dae391439", "score": "0.73434764", "text": "def account\n get('account')\n end", "title": "" }, ...
e2966f224f7fd9a7871f4bb91ae4e4c7
GET /dmvideos GET /dmvideos.json
[ { "docid": "3f0e8b2109a3c8dbcc8edb9b83f1b549", "score": "0.7501118", "text": "def index\n @dmvideos = Dmvideo.all\n end", "title": "" } ]
[ { "docid": "0d7fadc9ed2f9e2b425b1fa79bc4efca", "score": "0.7283964", "text": "def videos( params={} )\n videos = get_connections(\"videos\", params)\n return map_connections videos, :to => Facebook::Graph::Video\n end", "title": "" }, { "docid": "0d7fadc9ed2f9e2b425b1fa79bc4efca", ...
56e6429ca7a079fb9a27d7d54150d188
Return an instance of Cozy::FluentFixtures::FluentFactory for the base fixture of the receiving module.
[ { "docid": "3c214a15c37752bb648165f869727ad9", "score": "0.7814884", "text": "def factory( *args, &block )\n\t\treturn FluentFixtures::Factory.new( self, *args, &block )\n\tend", "title": "" } ]
[ { "docid": "80ecb106f9d662576c7f98e879ed8c93", "score": "0.5592979", "text": "def build(name, overrides = {})\n FixtureFactory.build(\n name, overrides: overrides, context: self, scope: self.class\n )\n end", "title": "" }, { "docid": "14760c11b88b766b7f2351e9670bf285", ...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "ef8ccfe785be3d78897059af177d59b3", "score": "0.0", "text": "def user_params\n params.require(:user).permit(:name, :email, :phone, :address, :password, :role_id)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.6948149", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.68135875", "text": "def strong_params\n params.require(:listing_member).permi...
ee18535b0c593e2cf01f0fd468bc94f8
Adds support for defining the attribute predicate, while providing compatibility with the default predicate which determines whether anything is set for the attribute's value
[ { "docid": "fac5ba728b1f1f04be7ad4d3e86c8f0c", "score": "0.0", "text": "def define_state_predicate\n name = self.name\n\n # Still use class_eval here instance of define_instance_method since\n # we need to be able to call +super+\n @instance_helper_module.class_eval d...
[ { "docid": "305d457fc19bb18e752e819c2877da17", "score": "0.76535916", "text": "def predicate_attr( *symbols )\n\t\t\tsymbols.each do |attrname|\n\t\t\t\tdefine_method( \"#{attrname}?\" ) do\n\t\t\t\t\tinstance_variable_defined?( \"@#{attrname}\" ) &&\n\t\t\t\t\t\tinstance_variable_get( \"@#{attrname}\" ...
ccf1f2a0a8390da5516d0bfad7f18ad5
Plugin initialization extension point (after a successful ES connection).
[ { "docid": "5bc8ea75cbe137a0fca65155fe1132a8", "score": "0.0", "text": "def finish_register\n end", "title": "" } ]
[ { "docid": "ff1f9e95ddfed1ca3eb98a2ad2529fd2", "score": "0.71061766", "text": "def plugin_setup!; end", "title": "" }, { "docid": "9cfd9c55a5321072672bb8a9e87ff572", "score": "0.6907093", "text": "def after_initialize(plugins); end", "title": "" }, { "docid": "376fcc31ae3...
ce4e7835404a70d3b4f2da95838b8548
Moves Prospector to next Town
[ { "docid": "e540dbf121a1cfa9633d5e65dd1b42bc", "score": "0.6394756", "text": "def move\r\n next_town = @town.next\r\n unless next_town.nil?\r\n puts \"Heading from #{@town.name} to #{next_town.name}.\"\r\n @town = @town.next\r\n end\r\n @visits += 1\r\n end", "title": "" } ]
[ { "docid": "3d48dbea53d953699d081adadaf2c410", "score": "0.5609544", "text": "def move_next\n self.current = self.current&.next\n end", "title": "" }, { "docid": "f948967fa809b4e4ba740ea09bc5e9dc", "score": "0.56023014", "text": "def test_move_nowhere\r\n\t\tdef @t.next; ni...
e79b4d67eafacb59323ddc274e2e4014
Merge Sort End Radix Sort Start
[ { "docid": "228b0bcc321ae7c32882d631ab58eced", "score": "0.67668396", "text": "def radix_sort\n if !self.array_list.empty?\n max_element_length = self.array_list.max.to_s.length\n max_element_length.times do |t|\n index_value = (t + 1)*-1\n temp_array = []\n self.array_...
[ { "docid": "b5ce6778b0ce7a6dc7cb90dbf864736f", "score": "0.714381", "text": "def mergesort(sequence, left = 0, right = sequence.size-1)\n if left < right\n mid = ((left + right) / 2.0).floor\n mergesort(sequence, left, mid)\n mergesort(sequence, mid + 1, right)\n merge(sequence, left, mid, ...
2a30caf9042ba8ac77e7c2b53a206e7f
Trabajare en el mismo archivo, por lo que no sera necesario usar los strings en este metodo
[ { "docid": "593d716c724ba7db0a702731021dffc1", "score": "0.0", "text": "def add_list(array1)\n\tfile = File.open(\"index.html\", 'a') do |file|\n\t\tfile.puts \"<ol>\"\n\t\tarray1.each { |ele| file.puts \"<li> #{ele} </li>\"} if array1.any?\n\t\tfile.puts \"</ol>\"\n\t\tfile.close\n\tend\n\tnil\nend", ...
[ { "docid": "b563e7e0a504f19bca3b4a4968688638", "score": "0.63660467", "text": "def file= string\n end", "title": "" }, { "docid": "ae6d4c8f614705a01b72a53aa2798d06", "score": "0.6301332", "text": "def raw_text\n raw_text = File.read(file_name)\n #raw_text = File.read(\"tmp/in...
2f8f610a37661c557affa9a32aeb5439
method to get a split view
[ { "docid": "d0bbfe85613f6238136f7e3dd562e583", "score": "0.0", "text": "def split(split_name)\n @localhost_mode_features.find { |x| x[:feature] == split_name }\n end", "title": "" } ]
[ { "docid": "faa62838841f69e0a0f02bcbc1fc413a", "score": "0.7230927", "text": "def splitView splitView, constrainMaxCoordinate:proposed_max, ofSubviewAt:divider_index\n\t\t300.0\n\tend", "title": "" }, { "docid": "06051f319bef71ce279aedeed5b84345", "score": "0.7062316", "text": "def s...
3828b6efb2853b685e31a51ea41d337c
`Lynr::Workerqueue_info` Return a String with information about the process where the worker is running and the name of the consumer.
[ { "docid": "a3fda5565d5bc31416aa84ce0adabba7", "score": "0.8086867", "text": "def queue_info\n \"pid=#{Process.pid} queue=#{queue_name}\"\n end", "title": "" } ]
[ { "docid": "f0604fe7882d8ff320795120653f4145", "score": "0.69559497", "text": "def queue_info(queue = nil)\n if queue\n select_hashes('SELECT * FROM pgq.get_queue_info(?)', queue.to_s).first\n else\n select_hashes('SELECT * FROM pgq.get_queue_info()')\n end\n ...
1317322e310cde506d4b2ed323e9a2b1
List of commands that require a device
[ { "docid": "bd71ba2acca52d594d9d5eb148e84c91", "score": "0.7805442", "text": "def device_commands\n @device_commands ||= []\n end", "title": "" } ]
[ { "docid": "cbb0e0146716ca394629feb29999e663", "score": "0.7536319", "text": "def device_commands\n [:sideload, :package, :test, :deeplink, :delete, :navigate, :navigator,\n :text, :monitor, :screencapture, :applist, :profile, :key, :genkey ]\n end", "title": "" }, { "docid": ...
016ff203c9ebf638c017f80b9d1021fc
Returns a string which describes this task.
[ { "docid": "ec69608a9183e0cfed1c645c5fb64e3a", "score": "0.0", "text": "def description\n \"This task hits the Google API and creates an entity for all discovered subdomains.\"\nend", "title": "" } ]
[ { "docid": "5a52fee7fb53a9f27533fbf67cc21188", "score": "0.799827", "text": "def to_s # Method to display completion status and description of Task\n \"#{represent_status} : #{description}\"\n end", "title": "" }, { "docid": "143fa5cee066761ab85fe41555c8eb9f", "score": "0.7680068", ...
3700c095e022f30d2a2a9bfd98a18efe
DELETE /body_materials/1 DELETE /body_materials/1.xml
[ { "docid": "9a660ab411b991c2968fd9cb7189ed73", "score": "0.7715465", "text": "def destroy\n @body_material = BodyMaterial.find(params[:id])\n @body_material.destroy\n\n respond_to do |format|\n format.html { redirect_to(body_materials_url) }\n format.xml { head :ok }\n end\n end"...
[ { "docid": "4a8ec1fab31d3493e8061b3616f76f83", "score": "0.73584646", "text": "def destroy\n @boat_body_material = BoatBodyMaterial.find(params[:id])\n @boat_body_material.destroy\n\n respond_to do |format|\n format.html { redirect_to(boat_body_materials_url) }\n format.xml { head :o...
26aae0123f755dac1c02cfb52a183a55
Central update, that works through all the mixin updates
[ { "docid": "a513af90ab35b92e98dd0aa9f74a8228", "score": "0.0", "text": "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n # All done if we're still moving\n return if movable_moving?\n\n # We've reached the end of our last movement, so ...
[ { "docid": "cb2162d3a1fd3434effd12aa702f250f", "score": "0.6929733", "text": "def update() end", "title": "" }, { "docid": "9f9a41a48a178283b3abec1599c9dcf0", "score": "0.6853206", "text": "def update\r\n super\r\n end", "title": "" }, { "docid": "8c7fce96cd02d1aeaedd...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9a39dc978a432c8df1249d8f6bc47e00", "score": "0.0", "text": "def auto_model_params\n params.require(:auto_model).permit(:name, :auto_model_photo, :auto_brand_id)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
5a6d2b3d69bbb819633e23f415f0fbdb
meth check_parms needs to be called whenever the min_max pRadius have been changed. Normally this is only during reset or initialization could not figure out how to get the constructor to call it or would have done automatically. As it is the constructor sets a flag and any method that may need to have bit_adjusted pRa...
[ { "docid": "0def713c2a4423eb6e3412853a529aeb", "score": "0.78377134", "text": "def check_parms\r\n # - - - - - - - - - - - - - - - - - -\r\n if (@needs_check_parms == false)\r\n return false # didn't need to run\r\n else\r\n @needs_check_parms = false\r\n # reset flag so we don't ...
[ { "docid": "63ec93168720325eb032362ea093219c", "score": "0.5806253", "text": "def initialize(srcMin=0.0, srcMax=1.0, dstMin=0.0, dstMax=1.0, base=0.001)\n \t\tsuper\n @base = base\n \t\trecalc_internals()\n \tend", "title": "" }, { "docid": "ad9ca0c64abb79f1c8429d390164d84b", "sc...
91230130e0ec39e42d18c0ded49536f9
DELETE /hq_envs/1 DELETE /hq_envs/1.xml
[ { "docid": "6403fb8e211d65f9d2ad8792b853e355", "score": "0.7659084", "text": "def destroy\n @hq_env = HqEnv.find(params[:id])\n @hq_env.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_envs_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "e3e6a5228376a77df35936103920ae31", "score": "0.71165645", "text": "def destroy\n @envspecific = Envspecific.find(params[:id])\n @envspecific.destroy\n\n respond_to do |format|\n format.html { redirect_to(envspecifics_url) }\n format.xml { head :ok }\n end\n end", ...
12e1d77c2ede0b4bbefca14f9afa9cb3
POST /slideshows POST /slideshows.xml
[ { "docid": "1b32d7011aa9437df9951ac7e30600ae", "score": "0.70298433", "text": "def create\n @slideshow = Slideshow.new(params[:slideshow])\n\n respond_to do |format|\n if @slideshow.save\n format.html { redirect_to(slideshows_path, :notice => 'Slideshow was successfully created.') }\n ...
[ { "docid": "f4708bdcf659cbe1fc98ce64f90da6c3", "score": "0.71784997", "text": "def upload_slideshow(options={})\n response = get(\"upload_slideshow/\", options)\n end", "title": "" }, { "docid": "ba4eb83b7acc5d1bee5a72be81b855ae", "score": "0.69476676", "text": "def create\n ...
2348c7773dd2340967d4fcd73d43cc04
Fibonacci Numbers (Recursion) F(1) = 1 F(2) = 1 F(n) = F(n1) + F(n2) where n > 2
[ { "docid": "20d23d58c884d4c512e26e74db5ba89e", "score": "0.8642773", "text": "def fibonacci_recursive(n)\n return 1 if n <= 2\n fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\nend", "title": "" } ]
[ { "docid": "05596c0b0cbbc183b81cd3f7f81d6616", "score": "0.8959176", "text": "def nthFibonacci2(n)\r\n if n == 0\r\n return 0\r\n elsif n == 1\r\n return 1\r\n elsif n == 2\r\n return 1\r\n else n > 2\r\n n = nthFibonacci2(n-1) + nthFibonacci2(n-2)\r\n end\r\nend", "title": "" }, ...
a6c972d3b2b03d36df264af4597467cb
here for compatabilty, should not really be used
[ { "docid": "59b47dbf8eb7d67732089687bbfc12dc", "score": "0.0", "text": "def feature_value(name)\n get_feature(name).value\n end", "title": "" } ]
[ { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6658215", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6658215", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",...
9f97368636fefa755bcc6e845a4de6f9
Update the system level whitelist of CVE. This API overwrites the system level whitelist of CVE with the list in request body. Only system Admin has permission to call this API.
[ { "docid": "7014ef0d7ae1bf83ce6c7813f0a17ea2", "score": "0.71528375", "text": "def system_cve_whitelist_put(opts = {})\n system_cve_whitelist_put_with_http_info(opts)\n nil\n end", "title": "" } ]
[ { "docid": "47c93063fa348f3d6483f47887c78c15", "score": "0.61045426", "text": "def update_version_whitelist(component_type, version_list, opts = {})\n update_version_whitelist_with_http_info(component_type, version_list, opts)\n nil\n end", "title": "" }, { "docid": "47c93063fa3...
fac55be8274ae5f4f1dbadfa6cfb6e5a
Create a defined name in Excel. We handle global/workbook level names and local/worksheet names. This method is used to defined a name that can be used to represent a value, a single cell or a range of cells in a workbook. For example to set a global/workbook name: Global/workbook names. workbook.define_name('Exchange_...
[ { "docid": "af175bd3bc8a223c2e3e18d07230678c", "score": "0.76329714", "text": "def define_name(name, formula)\n sheet_index = nil\n sheetname = ''\n full_name = name\n\n # Remove the = sign from the formula if it exists.\n formula.sub!(/^=/, '')\n\n # Local defined name...
[ { "docid": "7aa92dcd6541dcc97c3c3e9673a91a66", "score": "0.77673", "text": "def define_name(name, formula)\n sheet_index = nil\n sheetname = ''\n\n # Local defined names are formatted like \"Sheet1!name\".\n if name =~ /^(.*)!(.*)$/\n sheetname = $1\n name = ...
88669a2b058f289f33ec49ab43b27c73
This Object hast the following connections All of the comments on this photo. Permissions: any valid access_token or user_photos or friend_photos or user_photo_video_tags or friends_photo_video_tags Returns: array of objects containing id, from, message and created_time fields.
[ { "docid": "082b1046d5a03a9417576b5202a8f107", "score": "0.62723804", "text": "def comments( params={} )\n comments = get_connections(\"comments\", params)\n return map_connections comments, :to => Facebook::Graph::Comment\n end", "title": "" } ]
[ { "docid": "2e2328c25057b25191a786896bf8aa3d", "score": "0.6836377", "text": "def comments\n # Hashie array accessed with data attribute\n if @photo.comments\n @comments ||= @photo.comments.data.map {|c| ObjectComment.new(c) }\n end\n end", "title": "" }, { ...
d4a212f0fcfa2aaae7f7b0759160deaf
Calculate volume for the 3D mesh using Tetrahedron volume
[ { "docid": "8fa06e3c09b5ba34f4a838d6a0ef988e", "score": "0.64826584", "text": "def signedVolumeOfTriangle(p1, p2, p3)\n v321 = p3[0]*p2[1]*p1[2]\n v231 = p2[0]*p3[1]*p1[2]\n v312 = p3[0]*p1[1]*p2[2]\n v132 = p1[0]*p3[1]*p2[2]\n v213 = p2[0]*p1[1]*p3[2]\n v123 = p1[0]*p2[1]*p3[2]\n r...
[ { "docid": "7d35ece8a24ade7fd3dfc9773d040fb4", "score": "0.7062643", "text": "def volume\n a, b, c, d = @points\n ((a - d) % ((b - d) * (c - d))) / 6\n end", "title": "" }, { "docid": "a3d9c355655eb449b182e3279c1e2018", "score": "0.68935907", "text": "def volume\n ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "74696eadd54a8e02030e8c0d97842538", "score": "0.0", "text": "def update!(**args)\n @app_id = args[:app_id] if args.key?(:app_id)\n @attribution_model_settings = args[:attribution_model_settings] if args.key?(:attribution_model_settings)\n @category = args[:category]...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012568", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
690ba6dda69bcf23fbea47f51d64b608
Returns a Hash describing the status of the Page.
[ { "docid": "21f0f3e9a7ad41d796e7f27a0fb3740f", "score": "0.0", "text": "def status\n {\n visible: visible?,\n public: public?,\n locked: locked?,\n restricted: restricted?\n }\n end", "title": "" } ]
[ { "docid": "732abcfa91d4113d1fdd83aa0426ba8a", "score": "0.6728321", "text": "def page_status(page_number)\n page_status_array = each_page_status.to_a\n page_status_array[page_number - start_page][1]\n end", "title": "" }, { "docid": "ab5345babf1cbb18ff081620e94523f6", "scor...
3b826b26e95f6641981684ee5ff65358
Provide a user friendly representation
[ { "docid": "2a5443f40e3e0226c846ccdd2851f273", "score": "0.0", "text": "def to_s\n '#<Twilio.FlexApi.V1.InsightsSettingsAnswerSetsList>'\n end", "title": "" } ]
[ { "docid": "8813d23ea53482a215f5e5b971468e2d", "score": "0.75752455", "text": "def representation; end", "title": "" }, { "docid": "dad7e7041772f906c35bc43f5390a274", "score": "0.70985687", "text": "def to_human\n super\n end", "title": "" }, { "docid": "1e72b...
7ff37c54947cc801d38fb4d4042195e5
Get the list of known platforms Parameters:: platform_type (Symbol or nil): Filter only platforms of a given platform type, or nil for all platforms [default: nil] Result:: Array: List of platform handlers
[ { "docid": "ff7a0dc047dff433b095d92ff06bcd89", "score": "0.8716045", "text": "def known_platforms(platform_type: nil)\n (platform_type.nil? ? @platform_handlers.keys : [platform_type]).map { |search_platform_type| (@platform_handlers[search_platform_type] || []) }.flatten\n end", "title": ""...
[ { "docid": "f156c20d91ccd9d85f0b24fa327e4cbc", "score": "0.7074821", "text": "def platform_types\n get(\"platform-types\")[\"types\"]\n end", "title": "" }, { "docid": "27b085f580da85d5235a1f13ddf28e9d", "score": "0.6809869", "text": "def all_platforms\n Msf::Module::Platf...
812d659affce13c5cf808b13aee25c88
returns all the schools with a calification in a given interval,
[ { "docid": "1e6ee40572ef6be4c1a1ca70826d06ab", "score": "0.5454805", "text": "def intervals\n #query = \"SELECT idschool,codesc,nomeesc,bairro,end_esc\"\n #query = query + \",num_esc,ab1em_14,ap3em_14,enem2013,longitude,latitude FROM schoolbs\"\n query = \"SELECT * FROM (SELECT row_number() OVE...
[ { "docid": "6f9dee276641eae193124429f5d592ee", "score": "0.64154047", "text": "def schools\n Rollcall::School.for_user(self).order(:display_name)\n end", "title": "" }, { "docid": "fbf1adbcb972328db851f9bb559bbced", "score": "0.5883386", "text": "def schools(starting_posi...
9e25d24ad2d22c9a41cbf04ec1ff2594
Shrink or expand the size of a file inplace
[ { "docid": "9fa2a2678d53efef809eb245f6079a2e", "score": "0.0", "text": "def truncate(offset=0)\n File.truncate(self, offset) if exists?\n end", "title": "" } ]
[ { "docid": "fb7fe783d6512421b90763291a491531", "score": "0.68733007", "text": "def update_filesize\n self.size = File.size? self.path.to_s\n end", "title": "" }, { "docid": "f4cc95a72a787c9114f2d5fc360e77bc", "score": "0.6281944", "text": "def update_size(size, io)\n resize,...
088e32e3daa246faa3de742a0f4d0942
==== Parameters &blk:: A proc that should get called outside the mutex, and which will return the value to render. ==== Returns Proc:: A block that the server can call later, allowing Merb to release the thread lock and render another request.
[ { "docid": "32ba66e2a8d2fe387e6f2609c6439196", "score": "0.6416428", "text": "def render_deferred(&blk)\n Proc.new do |response|\n response.write(blk.call)\n end\n end", "title": "" } ]
[ { "docid": "ccf694eb6289e0ee8db269d8c20c5905", "score": "0.7333663", "text": "def threaded_render (&block)\n EventMachine.defer block, proc { |result| body result }\n end", "title": "" }, { "docid": "bb29854b4035968dbb11400f38de1300", "score": "0.6048967", "...
08aa51f41e6ca3f6dba9d613da5a54b4
Retrieves fog configuration if it exists
[ { "docid": "3a69ebe5e9ce9ecc0a4f0e54a0ef3246", "score": "0.6962637", "text": "def load_fog_config(path = ENV['HOME'] + '/.fog')\n creds = {}\n if File.exists?(path)\n fog = YAML.load_file(path)\n fog[:default] ||= {}\n creds = {\n :host => fog[:default][:vsphere_s...
[ { "docid": "0e4f2fadf165489f228c70f14c6393a8", "score": "0.6859115", "text": "def fog\n @fog ||= Fogger.new(config[environment])\n end", "title": "" }, { "docid": "043d65db9cf7c515b6dc8c23ba0b9ad5", "score": "0.64209855", "text": "def fog_options\n options = { \n ...
0cd53e7c591f0996710ea232f0b15fb0
Converts a time to a bucket key
[ { "docid": "f3f94c87d8ca69fbc4c93cd1bce0a09f", "score": "0.7657409", "text": "def bucket_key(time)\n id = quantize_time_to_slize_size(time.utc).to_i\n \"online:slice:#{id}\"\n end", "title": "" } ]
[ { "docid": "339b630d004277a4516bf0cf58197abd", "score": "0.7732514", "text": "def get_key_for(time)\n \"#{time.year}/#{time.month}/#{time.day}/#{time.hour}\"\n end", "title": "" }, { "docid": "940e519b416c65811eba5e77b77b0ebe", "score": "0.6533081", "text": "def time_key(time...
94366d8d8418307a9e0fed16694e8349
T1, T2 and T3 are subtrees of the tree rooted with y (on the left side) or x (on the right side). y Right Rotation x / \ > / \ x T3 T1 y / \ < / \ T1 T2 Left Rotation T2 T3 Source:
[ { "docid": "b1d866d924a13dfff6d6d0658888c066", "score": "0.6270242", "text": "def rotate(direction)\n puts \"Rotating node #{value} to the #{direction}...\" if DEBUG\n\n previous_parent = parent\n\n case direction\n when :left\n x = self # Current root.\n y =...
[ { "docid": "2d8237a886b35df3240b1f080d83333d", "score": "0.68639624", "text": "def rotate\n case left.height - right.height\n when 2\n if left.left.height < left.right.height # case b\n @left = left.rotate_left\n end\n root = rotate_right # case a\n when -2\n if right...
773a5d349863f7ce6476e64f20cf5372
Initializes a Triangle with three points and calculates area
[ { "docid": "512d2a178dfb48716fee37cb112337a1", "score": "0.70488703", "text": "def initialize(point1, point2, point3)\n\t\t@point1 = point1\n\t\t@point2 = point2\n\t\t@point3 = point3\n\t\t@area = 0\n\t\tfind_area\n\tend", "title": "" } ]
[ { "docid": "5b1de49cba5794253f0660cde4233dce", "score": "0.69291747", "text": "def area_of_triangle(base, height)\n 0.5*base*height\nend", "title": "" }, { "docid": "6c6144d2fc7aeff62275d8e0baa3aeab", "score": "0.689221", "text": "def initialize(triangle)\n a = 2 * (triangle.p2...
ff50c4bddf845e337786cb65510a3ec4
strictly parse comma separated parameters
[ { "docid": "584ee89c7f63ff6034cfaf90894fd603", "score": "0.0", "text": "def split_parameters(parameters_string)\n\n depth = 0\n prev = 0\n start = false\n\n parameters = []\n\n parameters_string.length.times do |index|\n case parameters_string[index]\n when '\"'\n if star...
[ { "docid": "c7eedd4c973b7f93dfbb49e53b2172fb", "score": "0.7071397", "text": "def on_comma(value); end", "title": "" }, { "docid": "0f31cb871b22a12574e439d799f3cf02", "score": "0.679951", "text": "def split_arg arg\n arry = []\n if arg.is_a?(Array)\n arry += ar...
bf7840e3b013ea250ae4a6bc9ca685a5
Sum all the numbers in the array an_array can contain lots of different things Be sure to only sum the numbers (Hint: the is_a? method might be useful here)
[ { "docid": "da3fd7be17e58ff8f967e35484ebdabb", "score": "0.81169784", "text": "def sum_only_numbers(an_array)\n count = 0\n an_array.map do |array|\n \tif array.is_a? Fixnum or array.is_a? Float\n \t\tcount = count + array\n \tend\n end\t\nend", "title": "" } ]
[ { "docid": "de297d0370ee4a2503be8dd65db7e517", "score": "0.82395583", "text": "def sum_only_numbers(an_array)\n\tsummation = 0\n\tfor item in an_array\n\t\tif item.is_a? Integer\n\t\t\tsummation += item\n\t\tend\n\t\tif item.is_a? Float\n\t\t\tsummation += item\n\t\tend\n\tend\n\treturn summation\nend",...
af458f14b61a11e88f6d96bf186fde60
La fin est 120 => coef_time 120 = PFAWIDTH => coef_time = PFAWIDTH / 120
[ { "docid": "0b031de424cc8899c1e94dd44ef1a5e8", "score": "0.5772327", "text": "def coef_pixels\n @coef_pixels ||= (PFA::PFA_WIDTH - PFA::PFA_LEFT_MARGIN - PFA::PFA_RIGHT_MARGIN).to_f / 120\n end", "title": "" } ]
[ { "docid": "298bfc50cd1b78c74e587bcb3b9a2572", "score": "0.59912276", "text": "def coef_pixels\n @coef_pixels ||= (PFA_WIDTH - PFA_LEFT_MARGIN - PFA_RIGHT_MARGIN).to_f / 120\nend", "title": "" }, { "docid": "abf4bcb37eb66099eef467d1829f030e", "score": "0.5903533", "text": "def coef_...
84fd84fb0553a77f0979a224fc4e7f37
Tricks `kerl` to looking for a `.kerlrc` file in Chef's cache
[ { "docid": "3da73a84cce45698a037f7fe9cdee183", "score": "0.5465498", "text": "def kerl_environment\n { 'HOME' => kerl_path }\n end", "title": "" } ]
[ { "docid": "cb3f2d3fac429823e7738d49e6a91208", "score": "0.6939817", "text": "def file_cache_path\n Chef::Config[:file_cache_path]\n end", "title": "" }, { "docid": "a395b7647f67d1847c3c40b460c8a2f9", "score": "0.61331254", "text": "def chef_config_path\n Berkshelf.roo...
d70e95f55bea2c9234599ead45f2319b
Indicates whether its possible to capture the payment
[ { "docid": "93b3fbad3a3f58dc38c0b85ac77c2645", "score": "0.8574391", "text": "def can_capture?(payment)\n payment.pending? || payment.checkout?\n end", "title": "" } ]
[ { "docid": "4fb9ff43ec51120c3b53c900cf688c91", "score": "0.8421634", "text": "def can_capture?(payment)\n payment.state == 'pending' || payment.state == 'checkout'\n end", "title": "" }, { "docid": "1ca995deac6b4de643135bf2e8128f1e", "score": "0.840692", "text": "def can_capt...
59344cc9299ea0e303a769de047be845
listRegisteredNameServers returns XML containing all name servers xpath: /namesilo/reply/hosts
[ { "docid": "7945aefe3760f099f52c86f24404a0b0", "score": "0.7118314", "text": "def list_name_servers(domain)\n get_request('listRegisteredNameServers?'+get_url_parameters({'domain':domain})).body\n end", "title": "" } ]
[ { "docid": "8c5900c1338208acd230549320c4e4d4", "score": "0.7163343", "text": "def name_servers\n response = @client.rest_get(@data['uri'] + '/nameServers')\n response.body\n end", "title": "" }, { "docid": "cd0d413cf1ccdb4cae151320019a1944", "score": "0.6596209", "text":...
4c88234d7a125e54ee4c69785691b15d
GET /governance_score_yahoos GET /governance_score_yahoos.json
[ { "docid": "4373b1c5621304582ac9caca199a8921", "score": "0.7117656", "text": "def index\n @governance_score_yahoos = GovernanceScoreYahoo.all\n end", "title": "" } ]
[ { "docid": "a31f4db4a7029b1d32384da31014c622", "score": "0.61347705", "text": "def governance_score_yahoo_params\n params[:governance_score_yahoo]\n end", "title": "" }, { "docid": "ac9ba9c42bead6fb94c037723f8b5cfb", "score": "0.6099912", "text": "def set_governance_score_yah...
13a9e3776582edafe0a6e9026056b394
Building Metasploit/Armitage info GUI/CLI
[ { "docid": "c7eec987bfd306f09638f77b4da15a73", "score": "0.5810614", "text": "def initialize(info={})\n super(update_info(info,\n 'Name' => 'Abusing the App Path key for control.exe [sdclt.exe]',\n 'Description' => %q{\n ...
[ { "docid": "bd662d500a4648a04e4a24824a95f479", "score": "0.64808035", "text": "def show\r\n puts \"Showing the setup for #{parent.name}'s iarbuild utility:\"\r\n puts \" Executable: \"\r\n puts \" Installation Offset: \"\r\n puts \" Installation Dir: \"\r\n puts \" ...
b60e44df59abcd8a9477f606e3a0227f
Pseudocode Input: An array of strings containing names of people in my Course. Output: Display the groups along with their members. Steps needed: 1. Define a method which takes an array as its argument 2. Using the length of the array, define several statements which will output the elements of the array accordingly.
[ { "docid": "e3d06c66f0a6f30fca0533fbfe8861ed", "score": "0.5917581", "text": "def create_acct_groups(people)\n\tpeople.shuffle!\n\n\tour_mod = people.length%4\n\t(people.length%4).times do |i|\n\t\tputs \"Group \" + i + \": \" + people[5*i] + \", \" + people[5*i+1] + \", \" + people[5*i+2] + \", \" + pe...
[ { "docid": "2d6383bcd131c793bc0f93645fcbdd39", "score": "0.74134326", "text": "def list_groups(groups)\n i = 1\n groups.each do |array|\n puts \"Group #{i}:\"\n array.each do |student|\n print \"\\t#{student.fname} #{student.lname} - Email: #{student.email}, Section #{student.section}, Majo...
da9cc7a00703e33172c579941aaeff52
PATCH/PUT /event_typologies/1 PATCH/PUT /event_typologies/1.json
[ { "docid": "ead2051867250caf9944711c5e0de8d4", "score": "0.69909203", "text": "def update\n respond_to do |format|\n if @event_typology.update(event_typology_params)\n format.html { redirect_to event_typologies_path, notice: 'La tipologia è stata modificata correttamente.' }\n form...
[ { "docid": "6a3460143b9f0a7dab6772b390343355", "score": "0.60849434", "text": "def pupdate\n @event = Event.find(params[:id])\n respond_to do |format|\n if @event.update_attributes(JSON.parse(params[:event]))\n format.html { redirect_to @event, notice: 'Event was successfully updated.'...
0413524b6529b8d82dfdb3da8547e0b1
POST /client_certifications POST /client_certifications.json
[ { "docid": "d3ce877081b5f9066a08e0885af6c304", "score": "0.7081932", "text": "def create\n @client_certification = ClientCertification.new(client_certification_params)\n\n respond_to do |format|\n if @client_certification.save\n format.html { redirect_to @client_certification.contract,...
[ { "docid": "c696a98169e01873bf18916f489bd70c", "score": "0.6664644", "text": "def create\n @certificacion = Certificacion.new(certificacion_params)\n\n respond_to do |format|\n if @certificacion.save\n format.html { redirect_to @certificacion, notice: 'Certificacion was successfully cr...
9ce75e1e7b04d24d249f853f8e4e1f7f
Find the pair of numbers that are perfectly divisible, sum their difference
[ { "docid": "577540eaa6f1513f373ec6c2d90005a3", "score": "0.6126067", "text": "def find_checksum_pt2(spreadsheet_rows)\n spreadsheet_rows.reduce(0) do |sum, row|\n (divisor, dividend) = row.\n combination(2).\n find do |(val, c_val)|\n case\n when divides_nicely?(val, c_val) ...
[ { "docid": "fb6af3238f062ae1a2ea7e63d90e7151", "score": "0.70175296", "text": "def find_amicables(n)\n pairs = []\n sum = 0\n for i in 0..n do \n next if pairs.include? i\n d = sum_proper_divisors(i)\n next if d == i\n p = sum_proper_divisors(d)\n if p == i \n...
6111c1d72f057c214a31ce8a2c097d86
TODO think about supporting CPKs
[ { "docid": "b7630eb60894db8d497b1f42a305e6e9", "score": "0.0", "text": "def remix_intermediate_model(cardinality, target_relationship_name, target_model_name, options)\n\n source_model = self\n\n default_intermediate_source_key = Extlib::Inflection.foreign_key(source...
[ { "docid": "b12b2859d712055e744b2f8ba047f0e1", "score": "0.66410726", "text": "def generate_key3; end", "title": "" }, { "docid": "000611d81365d36a60b2f1117e89afc7", "score": "0.6505336", "text": "def key_coercions; end", "title": "" }, { "docid": "cb0b728b0f0e1b5fb4c0cd4...
e019e881800069b94a3d847dbc954721
Gets the NotOnOrAfter Condition Element value.
[ { "docid": "be55b91b717abfb77757030fc2a7359d", "score": "0.67555165", "text": "def not_on_or_after\n @not_on_or_after ||= parse_time(conditions, \"NotOnOrAfter\")\n end", "title": "" } ]
[ { "docid": "184c0173bd531a1c7fd0c9af81ec20df", "score": "0.6411609", "text": "def not_after\n return @not_after\n end", "title": "" }, { "docid": "453817aa60838e770ad3d4d535cb5fb9", "score": "0.63126975", "text": "def not_after=(value)\n @not_...
649f40fdb8357a4e343d887ff74e2f11
Complete the pageCount function below.
[ { "docid": "97b09dabbc360be67ae8a3e3432f83c6", "score": "0.0", "text": "def pageCount(total_pages, goal_page)\n #\n # Write your code here.\n #\n half_of_the_book = (total_pages / 2).to_i\n total_swaps = 0\n if goal_page <= half_of_the_book\n i = 2\n while i <= goal_page\...
[ { "docid": "aba10d6eb738add18ce94f464b9b6e40", "score": "0.72508997", "text": "def count_pages\n page_iterator.count.to_i\n end", "title": "" }, { "docid": "4d1e78d89a260065a4f2da41bb5add00", "score": "0.7175977", "text": "def page_count ; @pager.page_count ; end", "tit...
838a4d4674d9e851a6ce5a11a244dcbe
Update info on one organization
[ { "docid": "3f94e878d8bda82efec8d74a0d152acb", "score": "0.0", "text": "def organization_id_put(id, opts = {})\n organization_id_put_with_http_info(id, opts)\n nil\n end", "title": "" } ]
[ { "docid": "9112e583c896ad6881286b8b67546aa0", "score": "0.77424484", "text": "def update\n\n #@organization = Organization.update(organization_params)\n #@project.something_special!\n update!\n end", "title": "" }, { "docid": "bd230d60c3aebe873863c8feb0e4c0bd", "score": "0.761...