query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ebf2b159c2dbc76bdfa95c5fdfcaf720", "score": "0.0", "text": "def loan_registration_params\n params.require(:loan_registration).permit(:financialinstitution_id,:active,:outstanding, :loan_type, :internal_loan,:loan_term, :rationale, :amount, :loan_reference, :drawdown_date, :final_payment...
[ { "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...
a90526ecd150eebca461dbebd9e7694a
Set the value of the WordList input for this Choreo.
[ { "docid": "4cfee35188089eab198179a7705958fe", "score": "0.7618321", "text": "def set_WordList(value)\n set_input(\"WordList\", value)\n end", "title": "" } ]
[ { "docid": "bd1301690467aea10fcf6452d8708123", "score": "0.744694", "text": "def word_list=(list)\n end", "title": "" }, { "docid": "492b4c022c10386ce3b3d2949cdee565", "score": "0.74042976", "text": "def set_word_list\n @word_list = WordList.find(params[:word_list_id])\n e...
c660c01167880ccbd554b497ffcf922e
DELETE /energies/1 DELETE /energies/1.json
[ { "docid": "f4a572f0ea43d9880dc2d5629300c129", "score": "0.74673355", "text": "def destroy\n @energy = Energy.find(params[:id])\n @energy.destroy\n\n respond_to do |format|\n format.html { redirect_to energies_url }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "5c57213bf677b42878297f816da79b14", "score": "0.7122626", "text": "def destroy\n @energy.destroy\n respond_to do |format|\n format.html { redirect_to energies_url, notice: 'Energy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": ...
e54c009fd8b9c037a46063d5d710cff8
allows enviroment variables to be used as a connection option
[ { "docid": "3e58ebdc493aee5d687b02a8d713c1df", "score": "0.0", "text": "def check_env_var(var)\n if var =~ /ENV\\[(.*)/ || var !~ /(:+)|(\\/+)/\n env_var = var.sub(\"ENV[\", \"\").sub(\"]\",\"\")\n var_seq = []\n env_var.split(//).each do |char|\n if char =~ /[0-9a-zA-Z]/\n ...
[ { "docid": "08327a787153eb686fbc5c6cd1a2e130", "score": "0.7505504", "text": "def connection_params_from_env\n @username = ENV['QUMULO_USER'] || \"admin\"\n @password = ENV['QUMULO_PASS'] || \"admin\"\n @addr = ENV['QUMULO_ADDR'] || \"localhost\"\n @port = (ENV['QUMULO_PORT'] || 8000...
b208952259b1fc7225fdd3918a1542fa
DELETE /onboards/1 DELETE /onboards/1.json
[ { "docid": "b9b77ef383cf0c190079d9bc78061d9f", "score": "0.7063917", "text": "def destroy\n redirect_to onboards_path, notice: \"上线信息由系统生成,无法手工删除!\"\n #@onboard.destroy\n #respond_to do |format|\n # format.html { redirect_to onboards_url, notice: 'Onboard was successfully destroyed.' }\n ...
[ { "docid": "850cd8ee8d79db2b3146c67e2d0db17f", "score": "0.766973", "text": "def delete\n render json: CommunityBoards.delete(params[\"id\"])\n end", "title": "" }, { "docid": "97a56fb5701388d9a473f0df48af9fdc", "score": "0.73422533", "text": "def destroy\n @toushikomon_board ...
453e506cc7b5be5bb9c278b828cacdab
GET /pastrecords/1 GET /pastrecords/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f3f7da79e7f9ffdf56eb099b7e0bb4d6", "score": "0.7429227", "text": "def index\n @pastrecords = Pastrecord.all\n end", "title": "" }, { "docid": "74382b08552a6d35c88a71d75eac5426", "score": "0.6347081", "text": "def set_pastrecord\n @pastrecord = Pastrecord.find(par...
9aad0b44accd3fbc13cdeab4e95b1a42
All students who have pinned this project
[ { "docid": "f021949268a04ceb668e53f240c2a8ac", "score": "0.8112857", "text": "def students\n User.includes(:pins).where(pins: { project: self, pinned: true })\n end", "title": "" } ]
[ { "docid": "f306dff1502ba670ce563403e3efe5ad", "score": "0.6249996", "text": "def all_students\n # binding.pry\n student_array = BoatingTest.all.select do |test_info|\n test_info.instructor == self \n end \n student_array.map(&:student)\n end", "title": "" ...
1891102aedef90067df09296a0c15add
PATCH/PUT /billings/1 PATCH/PUT /billings/1.json
[ { "docid": "8a70193b6995585beb38cd6391cebf75", "score": "0.0", "text": "def update\n respond_to do |format|\n if @billing.update(billing_params)\n format.html { redirect_to appointment_path(@appointment) + '#tabs-billing', notice: 'Billing was successfully updated.' }\n format.json...
[ { "docid": "0875f2c6b4df492ca230413aecaa114d", "score": "0.71087205", "text": "def update\n @bill = Bill.find(params[:id])\n\n if @bill.update(bill_params)\n head :no_content\n else\n render json: @bill.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { ...
fcce52949cd1b07a638b108ccd7859b1
Return true if the nonce has not been used before, and store it for a while to make sure someone doesn't try to use the same value again. Return false if the nonce has already been used or if the timestamp is not current. You can use OpenID::Store::Nonce::SKEW for your timestamp window. server_url: URL of the server fr...
[ { "docid": "d1a14e54b2ec224d58e65f4cdc64cc0b", "score": "0.8092724", "text": "def use_nonce(server_url, timestamp, salt)\n return false if (timestamp - Time.now.to_i).abs > Nonce.skew\n ts = timestamp.to_s # base 10 seconds since epoch\n nonce_key = 'N' + server_url + '|' + ts + '|'...
[ { "docid": "470f29fcbf6fcc3268e6a72a9c199223", "score": "0.8339363", "text": "def use_nonce(server_url, timestamp, salt)\n return false if MyNonce.first(:srv_url => server_url, :timestamp => timestamp, :salt => salt)\n return false if (timestamp - Time.now.to_i).abs > OpenID::Nonce.skew\n\n ...
a0eb69d23db4a27e459e95b2b38fc546
Note that for embedded documents this will only check that the field is unique within the context of the parent document, not the entire database. validates_uniqueness_of :dishes
[ { "docid": "cf8cc0ed549c90a88907ad990e455d0d", "score": "0.4204027", "text": "def add_dish(attributes)\n dishes.build(attributes)\n end", "title": "" } ]
[ { "docid": "1b38312832c49f1eacfa6472f24f97ef", "score": "0.5070417", "text": "def require_quantities\n \tunless self.dishes.count > 0\n \t\terrors.add(:order, \"must have dishes\")\n \tend\n end", "title": "" }, { "docid": "f32c4202cf7ae29e9165cea70aa0206b", "score": "0.49858844", ...
df72184fafc0ed6bc14c6efe0fe4e4d8
Retrieve a paginated list of load balancer TCP profiles Retrieve a paginated list of load balancer TCP profiles.
[ { "docid": "4058c7852854543ed689492ef7511b74", "score": "0.74860907", "text": "def list_load_balancer_tcp_profiles(opts = {})\n data, _status_code, _headers = list_load_balancer_tcp_profiles_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "de18d4954904cec2139b6b25c6424eaa", "score": "0.74238497", "text": "def list_load_balancer_tcp_profiles(opts = {})\n data, _status_code, _headers = list_load_balancer_tcp_profiles_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "a1bda413a4773e4ea4...
4970d5b904e6aa9d4b4c952a00ca671a
Returns a gift card payment pin
[ { "docid": "0735ed118d85478e109eae03f3de13ce", "score": "0.8029077", "text": "def gift_card_payment_pin\n $tracer.trace(__method__)\n return ToolTag.new(input.className(create_ats_regex_string(\"ats-giftpin\")),__method__)\n end", "title": "" } ]
[ { "docid": "fe160afc3f746139807ea3580b67488f", "score": "0.75869656", "text": "def getcardpin()\r\n return getvalue(SVTags::CARD_PIN)\r\n end", "title": "" }, { "docid": "bcc8e55c6024cf2d5b089ac119b06fc1", "score": "0.6993437", "text": "def pin\n @pin\n end", "title": "" ...
acee2d44fc78376bf473040e2ec887b7
lexer rule t__103! (T__103) (in Mig.g)
[ { "docid": "5ee0fed0c33538e6c58b2697204f121a", "score": "0.62160397", "text": "def t__103!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 64 )\n\n\n\n type = T__103\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - -...
[ { "docid": "a31665535ad69b4a4f95ffcc62dba933", "score": "0.72736716", "text": "def t__65!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 43)\n\n type = T__65\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - ...
43a71f92e50c3586109ed806302d78d5
DELETE /lights/1 DELETE /lights/1.json
[ { "docid": "2eeaba51e1a54794d52b7efc9c3f4f7a", "score": "0.6971071", "text": "def destroy\n @light.destroy\n respond_to do |format|\n format.html { redirect_to lights_url, notice: 'Light was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "c3e47b4af4a0e546fdfda93fff6bd84d", "score": "0.71831155", "text": "def destroy\n @light = Light.find(params[:id])\n @light.destroy\n respond_to do |format|\n format.html { redirect_to lights_url }\n format.json { head :no_content }\n end\n end", "title": "" }, ...
64df7b10821fa4fca745bc84d603472c
Update the Git submodules to the local registered version
[ { "docid": "132870a4555c71e0913d4a22ec66b660", "score": "0.69540393", "text": "def submodule_update(path = Dir.pwd)\n execute_in_dir(rootdir(path),\n %(\n git submodule init\n git submodule update\n ))\n end", "title": "" }...
[ { "docid": "5fcac26e72076af18042dc898c79ed9f", "score": "0.83232415", "text": "def update_submodules\n VanagonLogger.info \"Attempting to update submodules for repo '#{dirname}'\"\n clone.update_submodules(init: true)\n end", "title": "" }, { "docid": "081b204532bde6...
fbc2c87a862081f16767d5dd4059bea2
coerce values according to the type of their field
[ { "docid": "b4113ad5cc0f5f6d33c7aa102aacae73", "score": "0.63940233", "text": "def coerce(value, field_name)\n type = self.class.attributes[field_name]\n case type\n when :boolean\n case\n when (value.kind_of? TrueClass or value.kind_of? FalseClass); then...
[ { "docid": "9b7e8e43b65e13b1d2475b54e1ce0cd6", "score": "0.7136894", "text": "def value_coercion(value); end", "title": "" }, { "docid": "499b1b80226db4b9e31478421b8760ba", "score": "0.7008303", "text": "def lenient_value_coercions; end", "title": "" }, { "docid": "1fc520...
9ff193adebcba6f8cf2a2f340bf90d45
Repeat n time s Arguments : +n+ > int +s+ > string Returns : The repeated string
[ { "docid": "08f4d206867cf1872b4e189bca113ec4", "score": "0.90966475", "text": "def repeat (n, s)\n\t\tres = \"\"\n\t\tfor i in 0...n\n\t\t\tres << s\n\t\tend\n\t\treturn res\n\tend", "title": "" } ]
[ { "docid": "f5ff5f41de23518b4be8c5042adeb04f", "score": "0.8960768", "text": "def repeat_str n, s\n s * n\nend", "title": "" }, { "docid": "fa8f87513f8300b519273e119c47301a", "score": "0.8862082", "text": "def repeat_str (n, s)\n string = ''\n n.times do\n string << s\n end\n ...
19e44f4401d2d5fc8769f85658a4b275
Export an SMS campaign's recipients It returns the background process ID which on completion calls the notify URL that you have set in the input.
[ { "docid": "c8d26646ef9499a72ebfff52bd8b9f9e", "score": "0.5705377", "text": "def request_sms_recipient_export(campaign_id, opts = {})\n data, _status_code, _headers = request_sms_recipient_export_with_http_info(campaign_id, opts)\n data\n end", "title": "" } ]
[ { "docid": "05f1e107c91b8ae5835e9d93fedba702", "score": "0.6114605", "text": "def recipients\n # load \"app/models/mail_tasks/recipient.rb\"\n load \"app/models/mail_tasks/recipients_conditions.rb\"\n \n if params[:ignore_do_not_contact]\n sql = nil\n else\n sql = \"do_not_conta...
555275e2758f639c3fa36fdc0132d47a
GET /content_providers/plugins/1 GET /content_providers/plugins/1.xml
[ { "docid": "8581ba67782275a14bebb40c90834ade", "score": "0.71787304", "text": "def plugins\n @plugins = @content_provider.plugins(true, @state).select { |p| !p.placeholder?() }\n respond_to do |format|\n format.html { @plugins }\n format.xml { render :xml => @content_provider }\n en...
[ { "docid": "d68355cb3760fbbfe6c26cf49efd14c8", "score": "0.6723447", "text": "def index\n @plugins = get_plugins(@state); \n respond_to do |format|\n format.html \n format.xml { render :xml => @plugins }\n end\n end", "title": "" }, { "docid": "5c8aa79b3b8213dc8143229350...
366b96bcfd5272b01d7cbc1dd07f0a45
reduce 50 omitted reduce 51 omitted
[ { "docid": "0b7e8487d65fb0ae96de2c6092b28427", "score": "0.0", "text": "def _reduce_52(val, _values, result)\n result = logical_op :and, val[0], val[2]\n \n result\nend", "title": "" } ]
[ { "docid": "82915cb5c0203b0cba656d2bf4753af1", "score": "0.6996561", "text": "def _reduce_525(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "8d49d627305e22461417b6e06cdbb201", "score": "0.6919404", "text":...
712ce78a18c4957979c3edee31206003
POST /dspace_collections POST /dspace_collections.json
[ { "docid": "4c9ac9bab51200e09fd8a56986bd27f8", "score": "0.71340877", "text": "def create\n respond_to do |format|\n if @dspace_collection = DspaceCollection.save(dspace_collection_params)\n format.html { redirect_to dspace_collection_path(@dspace_collection.id),\n notice: 'Dspac...
[ { "docid": "0615d3dabf53da39022ab1e28df3eab1", "score": "0.63421977", "text": "def set_dspace_collection\n @dspace_collection = DspaceCollection.find(params[:id],'parentCommunity, items, logo')\n end", "title": "" }, { "docid": "0b01135e92574e72922df3c8a9448019", "score": "0.6308...
2b635117a101537c2e656307e6d6c001
Complexity: O(n) time and O(n) space, where n is the number of scores The highest_possible_score as a constant, we could call it k and say we have O(n + k) time and O(n + k) space. 33. Which appears twice 1. summ all numbers 1...n. use equation || n^2 + n / 2 || because the numbers in 1...n are a triangular series. 2. ...
[ { "docid": "a8f3d91f2bb7dcd115c098a79f611cdb", "score": "0.0", "text": "def split_words input_string\n words = []\n current_word = ''\n (0...input_string.length).each do |i|\n character = input_string[i]\n if character == ' '\n words.push(current_word)\n elsif is_etter(character)\n ...
[ { "docid": "08848278c512d512e04d35c06833e295", "score": "0.6703212", "text": "def solution(a)\n\traise ArgumentError.new(\"a has to be non empty array of max size #{MAX_LEN}\") if !a.is_a? Array or a.empty? or a.length > MAX_LEN\n\tret = 0\n\t#puts a.inspect\n\tmy_h = Hash.new\n\ta.each do |e|\n\t\tif m...
c549207419425319a7026e78d13736b6
Gets the user rights for the user.
[ { "docid": "c6ed14a92535f81b866b9c34c624879d", "score": "0.5929084", "text": "def get_userrights(username = nil)\n if username.nil?\n return false unless @logged_in\n info = get_userlists('rights')\n info['query']['userinfo']['rights']\n else\n ...
[ { "docid": "f6b2ed96d1b672f0f4429de32e0fb958", "score": "0.67519796", "text": "def my_rights\n if is_logged_out?\n return nil\n end\n User.find(session[:user_id]).rights\n end", "title": "" }, { "docid": "10e6a2ecbefc9a25e38347b2fb8a348a", "score": "0.6750058", "text":...
0bfa669f2479ecf5eca448c1157202f9
Public: Indicates whether this syntax highlighter has docinfo (i.e., markup) to insert into the output document at the specified location. location The Symbol representing the location slot (:head or :footer). Returns a [Boolean] indicating whether the docinfo method should be called for this location.
[ { "docid": "2357684ebf1958bfb225ea28039a575a", "score": "0.7286459", "text": "def docinfo? location; end", "title": "" } ]
[ { "docid": "2f766ba6fa09ed8ae09715f98db8e7b4", "score": "0.6055936", "text": "def docinfo location, doc, opts\n raise ::NotImplementedError, %(#{SyntaxHighlighter} subclass #{self.class} must implement the ##{__method__} method since #docinfo? returns true)\n end", "title": "" }, { "doci...
291968c680d007a8e9eb8628a569dad4
GET /cdocuments GET /cdocuments.json
[ { "docid": "75bb70c9d81338de923c14ffbc92f8ae", "score": "0.7705742", "text": "def index\n @cdocuments = Cdocument.all\n end", "title": "" } ]
[ { "docid": "d2a99e8da401980123ae247607b6ca45", "score": "0.7430262", "text": "def documents(params={})\n server.get(\"#{name}/_all_docs\", params)\n end", "title": "" }, { "docid": "daf0bd11c5e7e97d796869f8cdcf1c4b", "score": "0.70668036", "text": "def index\n @documents =...
fed3f35d3fbed61c4b8a014b347ff594
Input: + Logged in as PU admin. + Check editable for the setting of his PU Output: return true
[ { "docid": "f9e92a1d8da9bb632bb24887bbfc8888", "score": "0.0", "text": "def test_ut_t2_ars_arc_013\n # pu admin\n current_user = User.find_by_id(PU_ADMIN_ID)\n # pu ars\n pu_id = PrivilegesUsers.find_all_by_user_id(current_user.id)[0].pu_id\n ars = Pu.find_by_id(pu_id).analyze_rule_config...
[ { "docid": "d3e1097924ca877e1f2ba1066e189ef9", "score": "0.7160208", "text": "def is_admin?\n if login == \"ankit\"\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "c99a780346c7e0c09ad21fb7ede2e3e4", "score": "0.71325934", "text": "def ...
65cc19fcfe9acd6c50c7e13d77cd42c8
Clear the entire cache on all Redis servers. Safe to use on shared servers if the cache is namespaced. Failsafe: Raises errors.
[ { "docid": "4321379509cee73a3b21bbce037dbbac", "score": "0.62896395", "text": "def clear(options = nil)\n failsafe :clear do\n if namespace = merged_options(options)[:namespace]\n delete_matched \"*\", namespace: namespace\n else\n redis.then { |c| c.flushd...
[ { "docid": "ebf194788d7ed0aead5570f77a48c370", "score": "0.7549077", "text": "def reset_cache\n return unless enabled?\n\n connection_pool.with do |redis|\n redis.keys(\"#{KEY_PREFIX}*\").each do |key|\n redis.del key\n end\n end\n end", "title": "" }, { "docid": "...
bda67c6956f3d2d74495df4852711767
Because accessing app instance thru env seems to loose flash access.
[ { "docid": "fa323f04f90c1e5f1c149e562c6f3c42", "score": "0.5640418", "text": "def flash\n request.env['x-rack.flash']\n end", "title": "" } ]
[ { "docid": "6b0c1bde39bac368c3e8eedfc0e6568f", "score": "0.6469874", "text": "def in_app; end", "title": "" }, { "docid": "a5fd5df95bd95d026907eff36eb5767c", "score": "0.63562244", "text": "def flash\n session[CLOUDKIT_FLASH] ||= CloudKit::FlashSession.new\n end", "title"...
6d98c62b9c60736b9bc734c63f001e5e
GET /supplier_masters/1 GET /supplier_masters/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "d14942ad2c7ade9e5c43e67afd509f1a", "score": "0.7118339", "text": "def show\n @admin_supplier = Admin::Supplier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_supplier }\n end\n end", "title": "" }, { ...
60ec6b1594fa68ada15c58b1c8b38811
++ check override of attribute definition. _attribute_:: an Attribute object. _inheritStack_:: stack trace of ihnerit hierarchy. return:: return overrided Attribute, or nil.
[ { "docid": "ef07832a9c59c4621bead6879a59b3bb", "score": "0.8311974", "text": "def checkAttributeOverride(attribute, inheritStack = [])\n inheritStack.each{|pclass|\n overridingAttr = pclass.umlAttributeTable.get(:name, attribute.name) ;\n if(overridingAttr) then\n ove...
[ { "docid": "b8c6aad8fb09a834234c52e4f01b844a", "score": "0.6150732", "text": "def check_attribute!(attribute)\n #raise \"Unexpected attribute #{attribute} used\" unless self.class.attributes && self.class.attributes.include?(attribute)\n end", "title": "" }, { "docid": "b8c6aad8fb09a8342...
cf676755a08814450134d5413c1dfc99
creates a link having a similar appearance as the gloss buttons
[ { "docid": "afafda5f59030e2ec922d73ebcf4bc41", "score": "0.6446082", "text": "def britelink icon, name, time = nil, bg = \"#8c9\", &blk\n flow width: 300, margin: [4, 2, 4, 4] do\n b = background bg, curve: 6, height: 29, hidden: true\n img = image HH::STATIC + \"/\" + icon, margin_top: 3\n...
[ { "docid": "b00ec2051b92ca24eedd97a7e4b73340", "score": "0.7067543", "text": "def button_link_to( title, url, options={} )\n\t\tclasses = ['link']\n\t\tclasses << options[:class]\n\t\ts = \"<a href='#{url_for(url)}' style='text-decoration:none;'>\"\n\t\ts << \"<button type='button'>\"\n\t\ts << title\n...
290f1de91245c76ef3833fd1000f589f
Define your play method below
[ { "docid": "02b4457b5150a6da9457d04ad02566d7", "score": "0.0", "text": "def play(board)\nuntil over?(board) do\n turn(board)\n end\nif won?(board)\n puts \"Congratulations #{winner(board)}!\"\nelsif draw?(board)\nputs \"Cats Game!\"\nend\nend", "title": "" } ]
[ { "docid": "da113481795475a035aed999f253335e", "score": "0.900332", "text": "def play\n end", "title": "" }, { "docid": "da113481795475a035aed999f253335e", "score": "0.900332", "text": "def play\n end", "title": "" }, { "docid": "da113481795475a035aed999f253335e", "...
d809980eb4e61dd9f6bfcfd83c1c4846
Gets the vppTokens property value. List of Vpp tokens for this organization.
[ { "docid": "785a7236946f15ba13bd55d2744041e1", "score": "0.8099518", "text": "def vpp_tokens\n return @vpp_tokens\n end", "title": "" } ]
[ { "docid": "dd4cdf1764b387e7cc0f47c2bf87b869", "score": "0.69974214", "text": "def vpp_tokens=(value)\n @vpp_tokens = value\n end", "title": "" }, { "docid": "c1f12ad65905c1f465aafb59b6d95c06", "score": "0.66363335", "text": "def vpp_tokens()\n ...
651c38e0971f189b32da432de465219b
Crossplatform way of finding an executable in the $PATH. idea taken from which('ruby') => /usr/bin/ruby
[ { "docid": "27b61c7790af540f262d852d38bb4299", "score": "0.82699716", "text": "def which(cmd)\n exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']\n ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|\n exts.each { |ext|\n exe = \"#{path}/#{cmd}#{ext}\"\n return exe if File.execu...
[ { "docid": "1a9f30ed3228ace3bb2fef017fb1cd25", "score": "0.8353601", "text": "def which(cmd)\n # Thanks to http://stackoverflow.com/questions/2108727/which-in-ruby-checking-if-program-exists-in-path-from-ruby\n exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']\n ENV['PATH'].split(File::PATH_SE...
043b0d9e73b47858aaaaf29ec2c75a10
GET /premios/1 GET /premios/1.json
[ { "docid": "a19fb2a167098b23100450d11f3da6d3", "score": "0.53275496", "text": "def show\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @premio }\n end\n end", "title": "" } ]
[ { "docid": "39519da370dbbb79be7df588d59b909f", "score": "0.64763045", "text": "def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @premios }\n end\n end", "title": "" }, { "docid": "fb242b4fb75fe7706...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "581a85b6186173e60b39926b61b55704", "score": "0.0", "text": "def set_catg\n @catg = Catg.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60320485", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6013371", "text": "de...
65d03b61ca69435a6144e77e45fcf339
dealing with the loggedin user
[ { "docid": "2f44e83775c5d95ab18bcc3c5d85cf38", "score": "0.0", "text": "def current_user\n\t\tif (user_id = session[:user_id])\n\t\t\t@current_user ||= User.find_by(id:session[:user_id])\n\t\telsif (user_id = cookies.signed[:user_id])\n\t\t\tuser = User.find_by(id: user_id)\n \t\tif user && user.au...
[ { "docid": "28cea1debc939b2e716ec45ea299894a", "score": "0.76304483", "text": "def logged_in_user\n unless logged_in?\n puts \"=================================================Inside logged_in_user()==========================================================\"\n redirect_to root_path\n en...
f260b0743e3635ff851ba1fb8f391b00
GET /users/1 GET /users/1.json
[ { "docid": "cdf90fdb0619ce01653fbd0793c6c9e5", "score": "0.0", "text": "def show\n @user = User.find_by_id(params[:id])\n @posts = Post.where(user_id: @user.id)\n @follow_relationship_exists = FollowRelationship.where(follower_id: current_user.id, followee_id: @user.id, active: true).exists?\n ...
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.771752", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "a95dfe28d6b386aafc5fb53749e84258", "score": "0.75107867", "text": "def user\n...
9a6a0f02d6d793e578d7f3a6940060d3
GET /acercas/new GET /acercas/new.json
[ { "docid": "76354b93ced0ff12f28e5c169b6d7679", "score": "0.7813174", "text": "def new\n @acerca = Acerca.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @acerca }\n end\n end", "title": "" } ]
[ { "docid": "298ea098f113a68d9dde142a454637ec", "score": "0.7660789", "text": "def new\n @caso = Caso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @caso }\n end\n end", "title": "" }, { "docid": "4e4d65a4e29b65167e9b6cda2fd954f6"...
0041e3736f4f7d57bdeba8af6537cd2b
Return true if a checkout exists. Currently tests for .git in the checkout. === Returns === Boolean:: true if the checkout already exists (and thus incremental updating can occur).
[ { "docid": "a21fa2ed0d01212d4a230c6ef4a60ef8", "score": "0.77850634", "text": "def exists?\n File.exists?(File.join(@repo_dir, '.git'))\n end", "title": "" } ]
[ { "docid": "53725681ba50e948dc88c8683b57e1e7", "score": "0.75528264", "text": "def exist?\n File.exist? File.join(path, '.git/HEAD')\n end", "title": "" }, { "docid": "fb3331fba7da307a972c789bbf5ed930", "score": "0.72171587", "text": "def needs_checkout?\n expected = ref.s...
5da5bdeb677c841a3f79ed4f6e11111a
GET /users/username GET /users/username.json
[ { "docid": "0904e112a4d2495a48d08da9382152fc", "score": "0.65278995", "text": "def show\n @user = User.find_by_username(params[:id])\n @no_replies = true\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }...
[ { "docid": "a1ff36bdc05da2ee18c5263092170696", "score": "0.78074753", "text": "def username\n respond_to do |format|\n format.json { render :ok, json: @user.username.to_json }\n end\n end", "title": "" }, { "docid": "7f132fd4985e6199b7909f28ab132290", "score": "0.77986205", ...
f3344c346006ea02d81cbd1522b8a09c
retun primary/secondary series by :primary_axes flag
[ { "docid": "7af7fa58f756f84d64fc701b0380fb77", "score": "0.74394083", "text": "def axes_series(params)\n if params[:primary_axes] == 0\n secondary_axes_series\n else\n primary_axes_series\n end\n end", "title": "" } ]
[ { "docid": "7e05c30ce00c5b4964e9b2993153a37f", "score": "0.7352265", "text": "def axes_series(params)\n if params[:primary_axes] != 0\n primary_axes_series\n else\n secondary_axes_series\n end\n end", "title": "" }, { "docid": "1abc450dcca9435f532cc429648ac49b...
3821a708447a4075496f535e39268c70
The content method returns the important body text of the web page. It does basic extraction and preprocessing of the page content and then calls the content_processor method for any other more custom processing work that needs doing. Lastly, it does some basic post processing and returns the content as a string. When ...
[ { "docid": "3b0e9f30ac099df4502350710ab43300", "score": "0.76181924", "text": "def content\n return @content if @content\n matches = class_const(:CONTENT_RE).match(page)\n if matches\n @content = class_const(:KILL_CHARS_RE).gsub(matches[1].to_s, '')\n content_processor\n ...
[ { "docid": "87730df6b2aa66bc749a34e636e9b299", "score": "0.6902141", "text": "def parsed_content\n @parsed_content ||= parse_body\n end", "title": "" }, { "docid": "9a13fbeb79526e3d4d75d45ef9b25db4", "score": "0.68238914", "text": "def content\n @content ||= ca...
7903d19c92fd986ab24bd8353e2f80ec
GET /media_categories/new GET /media_categories/new.xml
[ { "docid": "98c8ba306a99add0f7d08d9b1d7d6c7c", "score": "0.7727068", "text": "def new\n @media_category = MediaCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @media_category }\n end\n end", "title": "" } ]
[ { "docid": "18c226de41c99efd14a95c50d4728464", "score": "0.70500994", "text": "def create\n @media_category = MediaCategory.new(params[:media_category])\n\n respond_to do |format|\n if @media_category.save\n format.html { redirect_to(@media_category, :notice => 'Media category was succ...
c5d2e5a71683bf52d3a7e79610ca7b0a
POST /projects POST /projects.json
[ { "docid": "63411872941de5103c9991184f3638b8", "score": "0.0", "text": "def create\n client = params[:client].present? ? Client.new(params[:client]) : Client.find_by_id(params[:project].delete(:client_id))\n unless client.present?\n redirect_to projects_url, notice: \"Client is required.\" an...
[ { "docid": "3987b362caed851c61fc0c13c211f4a8", "score": "0.7338948", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.json { render :json => @project, :status => :created, :location => @project }\n format.html ...
1a05fc689c24e7b4b29efd8ee6ffb56c
GET /auth_tokens/new GET /auth_tokens/new.json
[ { "docid": "cda3b96212538ddceb908ae27fd05778", "score": "0.7691153", "text": "def new\n head :forbidden\n\n # @auth_token = AuthToken.new\n\n # render json: @auth_token\n end", "title": "" } ]
[ { "docid": "fc0a6b2e295366cb9746f6c08889b80a", "score": "0.75285316", "text": "def new\n @auth_token = AuthToken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @auth_token }\n end\n end", "title": "" }, { "docid": "011d759e9a9cc88...
25f11f039f624909dd9868ab7d06fee0
Gosu implementation Inputs: none Outputs: none
[ { "docid": "f0f3473e28b472fbd7ed161a06b8b1c4", "score": "0.0", "text": "def clicked\n @menu_click_sound.play(0.7, 1, false)\n @buttonPvAi.clicked\n @buttonPvP.clicked\n @buttonReturn.clicked\n end", "title": "" } ]
[ { "docid": "64ecf4bb47342c97dbb7efe629dc7867", "score": "0.6552962", "text": "def draw\n \n if @visible > 0 #Draw the Ruby if @visible is a number bigger than 0\n @image.draw(@x - @width / 2, @y - @height / 2, 1)\n end\n \n @hammer_image.draw(mouse_x - 40, mouse_y - 10, 1) #Dr...
5269d2e4dcc727c79635c20d1d70b9a9
Tolerance constructor. The first parameter is the value (magnitude) of the tolerance, and is optional for some tolerances. The next parameter is the kind of tolerance as a symbol. It corresponds to the name of the implementation class minus the Tolerance suffix, and converted to snakecase (lowercase with underscores to...
[ { "docid": "cd30bf7bdf8afe500eff3c6f85d51df9", "score": "0.76447356", "text": "def Tolerance(*args)\n return args.first if args.size == 1 && Tolerance === args.first\n if args.first.is_a?(Symbol)\n value = nil\n else\n value = args.shift\n end\n cls_name = (args.shift || :absolu...
[ { "docid": "5a17ed83e1cf3276284d7dcacb24b176", "score": "0.64736116", "text": "def tolerance=(tolerance)\n @tolerance = tolerance || 0.0001\n raise ArgumentError.new('Invalid tolerance factor') if @tolerance < 0 || @tolerance > 1\n @tolerance\n end", "title": "" }, { "docid...
ed4d2d677229cf4f73e433b43b4e3e0d
This method is used when reconstituting saved networks
[ { "docid": "e59fb98ad8599019dcccb5c03c380538", "score": "0.0", "text": "def add_covariable(covariable) # :nodoc:\n @covariable_children.each {|child| covariable.add_child(child) }\n @covariable_parents.each {|parent| covariable.add_parent(parent) }\n @covariables[covariable.text_to_match]...
[ { "docid": "3371f6b4bb13019665f41221acbd39f7", "score": "0.61345905", "text": "def on_network_create(network)\n rerun_my_noderoles\n end", "title": "" }, { "docid": "535a79db223d5d54dafd9d5920d5e6f7", "score": "0.6123415", "text": "def save\n network_dumper = NetworkDumper.new...
89a4ff2029ebf3aaac6be7fbd8db913f
Stores into a dedicated row of AppParameter the SQL DBdiff contents logged by the specified updater instance. The updater is supposed to respond to the SqlConvertable interface.
[ { "docid": "5adf2acd33646b907a019d493198cf77", "score": "0.6058761", "text": "def serialize_into_app_parameters!( updater, edit_description, req_url )\n# DEBUG\n# puts \"\\r\\nserialize_into_app_parameters for code: #{ 100000 + current_user.id }\"\n app_parameter = AppParameter.find_or_create_by!( ...
[ { "docid": "3965ff5f22deee2b708fc15067b5182a", "score": "0.570757", "text": "def append_to_sql_diff( data_import_session, resulting_row )\n if resulting_row.kind_of?( ActiveRecord::Base )\n # Append also to the session log file:\n append_to_log_file(\n data_import_session,\n \...
55ecbf9db214ebf1db563d0b2197d5ec
Determine the memory footprint of each class and filter out classes that do not meet the configured threshold.
[ { "docid": "6e66b2fcbe4e260eb90748ba397caef0", "score": "0.63917655", "text": "def analyze\n # Signal a new GC to attempt to clear out non-leaked memory\n # TODO investigate ObjectSpace.garbage_collect\n GC.start\n\n classes_stats = {}\n # TODO investigate ObjectSpace.count_objects_size[:...
[ { "docid": "51795faf3746b3e3ffb7559f60141220", "score": "0.5941371", "text": "def trim_classes\n deletions = 1\n while deletions > 0 do\n deletions = 0\n @classes.each do |cls, value|\n next unless value.fetch(:sub_classes, {}).empty? && !value.has_key?(:examples)\n ...
ae6866c7a669b45e48706214623a07f9
Converts a 4x supported value to a 3x value.
[ { "docid": "30dd971b5efac09e4685a7d7a6c32d35", "score": "0.0", "text": "def convert(o, scope, undef_value)\n @convert_visitor.visit_this_2(self, o, scope, undef_value)\n end", "title": "" } ]
[ { "docid": "ab1b0bfd235c8bbeec1c1e58ffef4e3b", "score": "0.59260565", "text": "def convert_price_four_pack_to_one_can_price\n\t\tself.price = price_four_pack/4\n\tend", "title": "" }, { "docid": "c1057a244e407ef98d1ba3fb64e739ed", "score": "0.5806645", "text": "def normalize_value(x)...
76e8ff6aeaf45d2fd36ecde1e6270554
Adds method attributes scraped for the library's module to the library's commands.
[ { "docid": "b1806e90d0a882abf73b9ea6b5b5da4a", "score": "0.6836488", "text": "def add_method_data_to_library(library)\n @commands_hash = library.commands_hash\n @library_file = library.library_file\n MethodInspector.current_module = library.module\n @store = MethodInspector.store\n ...
[ { "docid": "e15f96043c37755f81dd6532ce9107a7", "score": "0.6855527", "text": "def additional_methods\n @additional_methods ||= proc do\n def command_name\n self.class.name.demodulize.underscore\n end\n end\n end", "title": "" }, { "docid": "a66...
ac2d726339331c762a420c98c23bf3a4
Begins a new map entry.
[ { "docid": "1f4a07be3a70bbbb67324fb05e6737ed", "score": "0.0", "text": "def scalar value, tag, quoted, anchor\n if @existing_members.include?(value)\n raise \"Duplicate attribute: #{value}\"\n else\n @existing_members.add(value);\n end\n ...
[ { "docid": "a765b10a5b11509788c66b509920abf1", "score": "0.6254016", "text": "def start_map(size)\n @writer.write(Extension::MapStart.new(size))\n end", "title": "" }, { "docid": "3f9c00843d3a8bc4fd507bdd1d53b565", "score": "0.61530477", "text": "def put_next_entry(entry); en...
47729a25fbf9f99513cb305eda1767f2
DELETE /zone_kinds/1 DELETE /zone_kinds/1.json
[ { "docid": "5ad8117d5ec804437405e6342586abcd", "score": "0.79938036", "text": "def destroy\n @zone_kind = ZoneKind.find(params[:id])\n @zone_kind.destroy\n\n respond_to do |format|\n format.html { redirect_to zone_kinds_url }\n format.json { head :no_content }\n end\n end", "t...
[ { "docid": "b25f18ced048b3b825f1b6d9ef1679b5", "score": "0.7489698", "text": "def destroy\n @zone = Zone.find(params[:id])\n checkaccountobject(\"zones\",@zone)\n @zone.destroy\n\n respond_to do |format|\n format.html { redirect_to zones_url }\n format.json { head :ok }\n end\n ...
d22dd8f63972a0991422fa779653248b
define the arguments that the user will input
[ { "docid": "3bb84bb4874a315a5b2c80422f645564", "score": "0.0", "text": "def arguments\n args = OpenStudio::Measure::OSArgumentVector.new\n\n # this measure does not require any user arguments, return an empty list\n\n return args\n end", "title": "" } ]
[ { "docid": "c62750f6e8d591e4a244028ec8cd5a7a", "score": "0.7418197", "text": "def arguments\n end", "title": "" }, { "docid": "49665d066ffcf52f2c37b2b1c268e6fd", "score": "0.73753476", "text": "def arguments; end", "title": "" }, { "docid": "49665d066ffcf52f2c37b2b1c26...
48092049a9825e9acc1c3d13bed02f3b
for i in ( 1 .. 30 ) if ( isAbandantNum( i ) ) print i, " = > ", getDivisors( i ), "\n" end end
[ { "docid": "d9f14857f74dd1a3c5d8fa6f9341e295", "score": "0.0", "text": "def getAbandantNums()\n\ta = []\n\n\tfor i in ( 1 .. 28123 )\n\t\tif ( isAbandantNum( i ) )\n\t\t\ta += [i]\n\t\tend\n\tend\n\n\treturn a\nend", "title": "" } ]
[ { "docid": "cc3858ca79981490b5a37616fc7d3321", "score": "0.70428675", "text": "def print_factors(number)\n return false if number < 1\n print \"\\nFactors of #{number}: \"\n\n (1..number).each do |i|\n print \" #{i}\" if number % i == 0\n end\n\nend", "title": "" }, { "docid": "96613f...
f8c676f595ee162031c1b99aede711c4
Returns the basic settings template
[ { "docid": "c9465f147b9a61ca29205e1f99ebe0b0", "score": "0.85862744", "text": "def setting_template\n {}\n end", "title": "" } ]
[ { "docid": "a570320f924b8a82b4f2dafa425942fb", "score": "0.6934886", "text": "def settings(key)\n self_settings = super_settings(key)\n return self_settings if self_settings.value?\n\n template&.settings(key)\n end", "title": "" }, { "docid": "1b43371f3ebaf8aa2fb24cd6e40d658f", ...
576e94ab46d0ff2f5dc19f2ff695ba96
Returns a true or false if the userdetail has a a profile pic
[ { "docid": "02be371902052b18fb00564777c9edbe", "score": "0.82967085", "text": "def has_profilepic?\n profile_pic != nil\n end", "title": "" } ]
[ { "docid": "05c469aaf91a6c9bdf61f57c9d57606c", "score": "0.843602", "text": "def has_profile_image?\n @has_profile_image == HASPROFILEIMAGE_YES\n end", "title": "" }, { "docid": "3c92b7ac2606cd7562f99e9cb964a379", "score": "0.82736236", "text": "def has_profile_picture?\n im...
137a10cb23fe93c7454e52ab603200fe
Compare current cell against its row
[ { "docid": "839312ea38d9cfd4b73a6497abd5155f", "score": "0.6226739", "text": "def in_row?(arr,row,value)\n \tfor j in 0..8\n \t\tif @board_arr[row][j] == value\n \t\t\treturn true\n \t\tend\n \tend\n \treturn false\n end", "title": "" } ]
[ { "docid": "1c2f6d03aab39e59ca9411034497db5d", "score": "0.7526956", "text": "def same_row?(row)\n end", "title": "" }, { "docid": "c21cd010eac2657bea9f987b32ddf951", "score": "0.73352665", "text": "def check_row(row)\n _state = state\n x = _state[0][row]\n if !x....
d32d4e4c675cb95f8d40a4661cbff8d7
Retrieve the top 5 users who created the most posts. Retrieve at most 5 rows. Returns a string of the SQL query. The resulting columns names must include (but are not limited to): name name of the user num_posts number of posts the user has created vzhu:For each U.id, get the number of rows (each row corresponds to a p...
[ { "docid": "f4267e169d0455042023133e0ac11e29", "score": "0.8731875", "text": "def top_users_posts_sql\n return \"SELECT U.name AS name,\n COUNT(*) AS num_posts\n FROM users U, posts P\n WHERE U.id = P.user_id\n GROUP BY U.id\n ORDER BY COU...
[ { "docid": "b81431afc517c396b1fb88b84be581b7", "score": "0.85703665", "text": "def top_users_posts_sql\n \"SELECT name, count(*) AS num_posts \n FROM Users u, Posts p \n WHERE u.id = p.users_id \n GROUP BY u.id \n ORDER BY num_posts DESC \n LIMIT 5\n \"\n end", "title...
8b2259e7b5a4fb7e6f510c6082cdf102
remove the attributes that are being updated as part of a state machine event
[ { "docid": "12f08e4e0ee858db9819536ef776824d", "score": "0.6920432", "text": "def clean_attributes\n @changed_attrs.delete('started_on') if @changed_attrs['work_status'] && @changed_attrs['work_status'][1] == ServiceCall::WORK_STATUS_IN_PROGRESS\n @changed_attrs.delete('completed_on') if @changed_...
[ { "docid": "c45ce26e0a98d47286059f10e3de6f55", "score": "0.6895023", "text": "def minus_state_set; h87attr_minus_state_set + custom_minus_state_set; end", "title": "" }, { "docid": "b44e09f1ea971f8e985d2ec7138c3a31", "score": "0.6891493", "text": "def removed\n attributes.fe...
8a17fad03db72e660516340610f99069
asks user if rematch desired
[ { "docid": "5c12c59f6673f0da34082b8e9728b0b1", "score": "0.0", "text": "def play_again\n\t\t\tputs \"\\n Would you like to play again? y/n\"\n\t\t\tanswer = gets.chomp.downcase\n\n\t\t\tif answer == (\"y\" || \"yes\")\n\t\t\t\tGame.new.play\n\t\t\telse\n\t\t\t\tputs \"\\n Thank you for playing!\"\n\t\t\...
[ { "docid": "0a77107ee569c67a3622253ebf5b01ac", "score": "0.7011139", "text": "def match(input); end", "title": "" }, { "docid": "46c1360e2d4ed11061120359128405d8", "score": "0.67534256", "text": "def match(input)\n input \n end", "title": "" }, { "docid": "14f6cf2fa94...
64dbaa7421bfb846f00d8071e56c36d7
Get Invoice By Id
[ { "docid": "c26c05b88f0ad07f09093c44f2cb3941", "score": "0.0", "text": "def finance_invoices_id_get_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: InvoicesApi.finance_invoices_id_get ...\"\n end\n # verify the requir...
[ { "docid": "52a770855f67b999d528dc8a855507bb", "score": "0.8593671", "text": "def get_invoice_by_id(id)\n opts = {\n id: id,\n customer_id: current_customer.id\n }\n\n get(Invoice, opts)\n end", "title": "" }, { "docid": "5e7a716c62073ab786ba7839917bb0d3", "score": "0...
639e59c79e5c1df8cbb14ee9c1472e21
Return an individual response's question and answer coded for Home Exposure questionnaire.
[ { "docid": "9d0a189e7fd0fa00a501f43c90667bd4", "score": "0.6370807", "text": "def q_and_a_codes\n\t\t\tq_code = self.question.data_export_identifier\n\n\t\t\tunless %w( answer string integer float\n\t\t\t\t\ttext datetime\n\t\t\t\t).include?(self.answer.response_class)\n\t\t\t\traise InvalidResponseClas...
[ { "docid": "1a53f6beceed1f375742398584885461", "score": "0.69793487", "text": "def ai_response_description\n case ai_response\n when 0 then \"Unable to respond\"\n when 1 then \"Reception acknowledged\"\n when 2 then \"Response to follow\"\n when 3 ...
9ca41aacdbf44f703e3457a11095d8e5
locale(url) format(url) source(url, :handheld) source(url, :en, :handheld)
[ { "docid": "93bed92f06bf37f34dbd7878b69122e5", "score": "0.6335299", "text": "def source *args\n first = args.shift\n if args.blank? and first.is_a?(String) \n # uri(first).to_s\n url = uri first\n \"#{url.host}#{':'+url.port.to_s unless url.port == 80}\"\n elsif firs...
[ { "docid": "f8d7edfa9ca3108fbba53a4d55d5a08f", "score": "0.64013124", "text": "def source(url); end", "title": "" }, { "docid": "97b925ffb1ff649fe7fb3364617bafc8", "score": "0.6072664", "text": "def url\n STRATEGIES[source].url(path, format)\n end", "title": "" }, { ...
52e669d5b9b7a17b29e313c2da7b563a
Will run Breakpoint in DRb mode. This will spawn a server that can be attached to via the [ TODO: command ] command whenever a breakpoint is executed. This is useful when you are debugging CGI applications or other applications where you can't access debug sessions via the standard input and output of your application....
[ { "docid": "f924efc8f3f8d1300bff6477754148db", "score": "0.5882967", "text": "def activate_drb(uri = 'druby://localhost:42531')\n @use_drb = true\n @drb_service = DRbService.new\n DRb.start_service(uri, @drb_service)\n end", "title": "" } ]
[ { "docid": "6f78123e4e82225fdfb448e5bbb11557", "score": "0.65070313", "text": "def start_drb_server\r\n drb_server = DRb.start_service(\r\n \"druby://#{@drb_server_host}:#{@drb_server_port}\")\r\n @drb_server_uri = drb_server.uri\r\n @log.info(\"Watir Grid started on : #{@drb_serve...
b925c2b742887eb519436f28c7a4b028
Unfortunately we can't override this using a module...
[ { "docid": "cbd6aff4a36cac2ff78013b1b459f51f", "score": "0.0", "text": "def preload_has_and_belongs_to_many_association(records, reflection, preload_options={})\n table_name = reflection.klass.quoted_table_name\n id_to_record_map, ids = construct_id_map(records)\n records.each {|record| record....
[ { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.7308542", "text": "def override; end", "title": "" }, { "docid": "baabe5bb658b17a85353fb66fdbbf873", "score": "0.7142143", "text": "def extended; end", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930",...
fad81df4b477d278a1f3d49f365a4918
This means that it is a prime number with the form 2^x 1, where x is some exponent. For example: 3 is a Mersenne prime because it is prime and 3 = 2^2 1 7 is a Mersenne prime because it is prime and 7 = 2^3 1 11 is not a Mersenne prime because although it is prime, it does not have the form 2^x 1 The first three Mersen...
[ { "docid": "70209d1c095cd8745b50918d2dd52c31", "score": "0.78572243", "text": "def mersenne_prime(num)\nend", "title": "" } ]
[ { "docid": "6aaeb1f95af6e831e63d7e4f2337c03b", "score": "0.82601166", "text": "def mersenne_prime(n)\n count = 0\n i = 2\n mersenne = nil\n while count < n\n count += 1 if prime?(i) && prime?((2**i) - 1)\n mersenne = 2**i - 1\n i += 1\n end\n mersenne\nend", "title": "" }, { "...
dd424794b57e885521e52fdd40801468
POST /comments POST /comments.json
[ { "docid": "a73a2d1fbbc0b08996477a5b77ebc0e7", "score": "0.0", "text": "def create\n @comment = @hotel.comments.build(comment_params)\n \n if @comment.save\n flash[:success] = \"Comment was successfully posted.\" # flash message\n redirect_to hotel_path(@hotel) # redirect to hotel(:id...
[ { "docid": "7b0a68ee4df9cfc8f7cc619d01d2577d", "score": "0.7545618", "text": "def create\n @comment = @post.comments.create!(comment_params)\n json_response(@comment, :created)\n end", "title": "" }, { "docid": "278b898b0e96dc8518cb54546e69f368", "score": "0.7373569", "t...
12f438f582b366e97b91e3a3e215b75a
Story Contributor rubocop: disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
[ { "docid": "a9eef9a62c51ab61989c5325aa693836", "score": "0.57798743", "text": "def update_story_contributor\n return nil unless trello_card_id && trello_member_id\n\n story = ScrumStory.find_by(trello_card_id: trello_card_id)\n contributor = ScrumContributor.find_or_create_by_trello_member_id(t...
[ { "docid": "f49e8963a30f6933168dace107b83978", "score": "0.70454884", "text": "def story; end", "title": "" }, { "docid": "9c6cb5b329e18d3c19dbc9f95626063e", "score": "0.6361716", "text": "def story\n Scheherazade::Story.current\nend", "title": "" }, { "docid": "034b9349...
d31beca7199d744fc39b5b777529a45c
Matrix where each cell stores the pairs of input values (x,y) to use. Consider that x goes top to bottom (=> vertical, height)
[ { "docid": "8ae9f9aeeaacbfdda037a6983b662a1c", "score": "0.71354055", "text": "def inputs_matrix\n x = explicit_range(@x_range, @height)\n y = explicit_range(@y_range, @width)\n\n matrix_X = x.map{|e| [e]*@width}.flatten\n matrix_Y = ([y]*@height).flatten\n\n matrix_X.zip(matrix_Y)\n end...
[ { "docid": "5e3a22da4d63dc47d19263a2ddd920cd", "score": "0.64848334", "text": "def coordinates\n row_values.product(col_values)\n end", "title": "" }, { "docid": "7e27214b11b669fdd22cf90df2c7bc06", "score": "0.6402678", "text": "def create_matrix\n (0...@height).to_a.map {|e...
bc92937467311210212c6820872e6580
Gets or sets the path that the Faraday libs are loaded from.
[ { "docid": "083f581c736bab4851a431408afaa52e", "score": "0.54463077", "text": "def lib_path; end", "title": "" } ]
[ { "docid": "d64ab0d4eb5a0e89a9144aaa817ea7d9", "score": "0.6095749", "text": "def gempath_to_yaypath gem_path\n\t\t\treturn \"#{gem_path}/gems/yay-#{Yay::VERSION}/data/yay\"\n\t\tend", "title": "" }, { "docid": "7ce642129b8f61a597982891aa52ff38", "score": "0.58477986", "text": "def l...
28cfe73544de82559d402c779883e4bf
Checks the current health of the environment in real time. Posts updates as they come in until environment health is OK and status is Ready If error, return false and bomb out.
[ { "docid": "dbdaef859a52d2929da7b407a7e48620", "score": "0.7592903", "text": "def check_health\n healthcheck = false\n error = nil\n status = nil\n health = nil\n request_time = Time.now\n\n until healthcheck or error do\n env_resp = @elasticbeanstalk.describe_environments(\n ...
[ { "docid": "992df5feb87dc64a438c399f91875361", "score": "0.72801423", "text": "def healthy?\n # invalidate cache so the check is fresh\n invalidate!\n health == \"RUNNING\"\n end", "title": "" }, { "docid": "7da0bf80dacd05865da3a4c9d9bf4075", "score": "0.6943743", "...
67360d457360da10c881d9dd236ab7ad
all ships of 3 positions
[ { "docid": "d28c2b9ffe42029b6dd70bb3f29b18aa", "score": "0.5070803", "text": "def populate\n self.start_coordinate_x = rand(11)\n self.start_coordinate_y = rand(11)\n if ship_position == 'vertical'\n self.end_coordinate_x = self.start_coordinate_x\n self.end_coordinate_y = (self.start...
[ { "docid": "c93ac99a2fc82a571214df54006b93d6", "score": "0.69815046", "text": "def place_ships!\n\t\t[\n\t\t\t['T', 2],\n\t\t\t['D', 3],\n\t\t\t['S', 3],\n\t\t\t['B', 4],\n\t\t\t['C', 5]\n\t\t].each do |ship|\n\t\t\tplace_ship(ship[0], ship[1])\n\t\tend\n\tend", "title": "" }, { "docid": "33...
da37e859435e8b71d374228b73c1d7b3
=begin Simple pencil and paper solution, easy to follow reasoning clearly delineated below. (Ruby and/or Python code to follow when I have time) Some of the following reasoning may appear circular at first blush, but a careful reading will reveal that each step follows necessarily if the remaining numbers not in the li...
[ { "docid": "751447cbd1b4c1238e71c984c810808a", "score": "0.0", "text": "def make_array_beta(n)\n arr = []\n (1..n).each { |i| arr.push(i) }\n return arr\nend", "title": "" } ]
[ { "docid": "7f6a3644e1c1763c977121e0efd756df", "score": "0.752091", "text": "def problem5()\n\n\t#list of factors(excluding 20), which contain the set (1..20) as factors\n\tdivisors =*(11..19)\n\tnum = 20\n\n\t#check multiples of 20 for a number that is divisable by all unique factors\n\twhile true\n\t\...
73db802ca8d95cb9832195ed2f96c78d
The queue duration is the time in seconds a job spent in the queue before it was processed. If it has not been enqueued or processing has not yet begun, it will return nil.
[ { "docid": "6eb98c0ccff716c11c3eef48e88856e8", "score": "0.7770367", "text": "def queue_duration\n return nil unless enqueued_at && started_at\n started_at - enqueued_at\n end", "title": "" } ]
[ { "docid": "9c7c8181cf697d47b25b77ca3e895d16", "score": "0.7099354", "text": "def total_duration\n q = queue_duration\n w = working_duration\n return nil unless q && w\n \n queue_duration + working_duration\n end", "title": "" }, { "docid": "abbc0828171608faa1e631a0d9982733",...
f4f20c1765fcf15d3de9d52acd6264e2
PUT /produces/1 PUT /produces/1.json
[ { "docid": "9f1cd2490b1b3432c6aeb7934cf3c089", "score": "0.0", "text": "def update\n if @manifestation and params[:position]\n @produce.insert_at(params[:position])\n redirect_to manifestation_produces_url(@manifestation)\n return\n end\n\n respond_to do |format|\n if @produ...
[ { "docid": "aa0b87a16ede7353758305dbbaf57c22", "score": "0.631923", "text": "def put(*a) route 'PUT', *a end", "title": "" }, { "docid": "ea416b077fa0aa7e84ec3fe2ef9c3772", "score": "0.62766564", "text": "def put\n request_method('PUT')\n end", "title": "" }, { ...
8556881a45f7ffe2d0cde5b00e8a21f7
PUT /templates/import PUT /templates/import.xml Import a template from an XML description and convert it to an actual template model.
[ { "docid": "fa1d61e82e79fd21078f46f168d83892", "score": "0.72550267", "text": "def import\n @template = Template.new\n archive = params[:package]\n\n if @template.import_archive(archive)\n # is_hidden checkbox supercedes xml\n @template.is_hidden = template_params[:is_hidden]\n i...
[ { "docid": "b54fb0f3ca8d8d31f28378d2fc5c7e1e", "score": "0.6872327", "text": "def import_as_template\n @import_as_template\n end", "title": "" }, { "docid": "c3ac4e6d1bfafd5cf55ea128fa087b81", "score": "0.68133295", "text": "def import\n xml_file = params[:xml]\n image_...
817e3c1bfe96f2478983898567bd2950
GET /feedbacks GET /feedbacks.json
[ { "docid": "11e609d060a674d59be2e683d430e530", "score": "0.77483714", "text": "def index\n @feedbacks = Feedback.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @feedbacks }\n end\n end", "title": "" } ]
[ { "docid": "ffcbd5a04d8516168036f18f01bcf640", "score": "0.77493876", "text": "def index\n authorize! :read_feedbacks, @outlet\n @feedbacks = @outlet.get_feedbacks(params)\n render json: @feedbacks\n end", "title": "" }, { "docid": "dee91faab26b22dd7aee9e3bd80fe47a", "score": "...
d707fe846c5052976c51b12045217f03
DELETE /pedidos/1 DELETE /pedidos/1.json
[ { "docid": "4510fa55a5d810072e84ff6e0bed4d56", "score": "0.7277727", "text": "def destroy\n @pedido.destroy\n respond_to do |format|\n format.html { redirect_to pedidos_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "f9b80de404147389d7ab34bd949e6c0c", "score": "0.71451604", "text": "def destroy\n @pedido = Pedido.find(params[:id])\n @pedido.destroy\n\n respond_to do |format|\n format.html { redirect_to pedidos_url }\n format.json { head :no_content }\n end\n end", "title": "" ...
2c70243f20e120df94c3577862eebe87
prepend adds a new node to the start of the list
[ { "docid": "4327c284c5bbfd99a0f215ecb5237b08", "score": "0.7843397", "text": "def prepend(node_value = nil)\n node = Node.new(node_value)\n if @head.nil?\n @tail = node\n else\n node.next_node = @head\n end\n @head = node\n end", "title": "" } ]
[ { "docid": "3f36b304d30f7dba454ae7eab46988db", "score": "0.8383897", "text": "def prepend( value )\n new_node = Node.new value\n\n # Whatever node was at the start of the list, it\n # is now the 'next' node for our newly created node\n new_node.next = @head\n\n # The new head of the list ...
ea90d70bcea38aedcc09dc11c2247693
POST /health_service_typologies POST /health_service_typologies.json
[ { "docid": "e811a0df03b93bc76ce96f3c6f0f1029", "score": "0.7254321", "text": "def create\n @health_service_typology = HealthServiceTypology.new(health_service_typology_params)\n\n respond_to do |format|\n if @health_service_typology.save\n format.html { redirect_to @health_service_typo...
[ { "docid": "92bc158014589bf0d5fdaa32c92fef3e", "score": "0.6857095", "text": "def set_health_service_typology\n @health_service_typology = HealthServiceTypology.find(params[:id])\n end", "title": "" }, { "docid": "16791f2858b34f2158d955bdae3bacfb", "score": "0.6750768", "text...
8c7042b2f4e6282f9590482571704484
and the same integer values in the same exact order
[ { "docid": "41498d6e2400d3368f7ed076e3f13fb4", "score": "0.0", "text": "def array_equals(array1, array2)\n raise NotImplementedError\nend", "title": "" } ]
[ { "docid": "88870e9992037187ecfa9429a6f09388", "score": "0.6013414", "text": "def unique(integers)\r\n\r\n end", "title": "" }, { "docid": "1715dc8be28d342ba2d4d377bd2731b9", "score": "0.58626604", "text": "def same_values?(x,y)\n\t\t@bt[x,y] == @bt[x+1,y] and @bt[x,y] == @bt[x,y+1]...
9fea058be6a6142fc1e32960ba654291
The 'cell' method provided by rspeccells will wrap the rendered string in a Capybara::Node::Simple so that you can test it with matchers like have_selector etc. This is fine, but sometimes a cell renders a really simple string and you just want to test what that string equals. Capybara::Simple::Node.to_s will include a...
[ { "docid": "7861810b2c3ef5e3b8d1828793ed74dd", "score": "0.7122133", "text": "def raw_cell(cell_or_model, *model_and_options)\n body = cell(cell_or_model, *model_and_options).().all('body')[0]\n return '' if body.nil?\n body = body.native\n if body.children.count == 1 && body...
[ { "docid": "6c4215ce889cf7e82bcbc04c21765937", "score": "0.70460474", "text": "def test_render_cell_to_string\n assert_equal render_cell_to_string(:a, :existing_view), render_cell(:a, :existing_view)\n end", "title": "" }, { "docid": "c731c4a295317b7791794311399d6997", "score": "0.69...
0659123b234bd6365b062779ba75e7d1
Search for Users by username
[ { "docid": "de267a4a100b91c983a81cd1dc03c615", "score": "0.0", "text": "def search(query, limit = 10, page = 1, sort = :username)\n uri = '/api/v1/search/users'\n params = {\n q: query,\n limit: limit,\n page: page,\n sort: sort == :pulse_count ? 'pulse_count' : 'us...
[ { "docid": "903ec3f31088e2aa0165be29e1741d99", "score": "0.8294827", "text": "def search_by_username(username)\n path = \"/users/search/find-by-username\"\n\n response, status = BeyondApi::Request.get(@session,\n path,\n ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "05cdaa9d2e40b97f72883d82718a0a43", "score": "0.0", "text": "def update!(**args)\n @defines_geometry_for = args[:defines_geometry_for] if args.key?(:defines_geometry_for)\n @geometry_composition = args[:geometry_composition] if args.key?(:geometry_composition)\n end",...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012677", "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...
108602752c7343b774c1d408908845fc
Store a response inside the cache.
[ { "docid": "ac485520a299a9fdeeb1eed05b5916a3", "score": "0.0", "text": "def write(request, response); end", "title": "" } ]
[ { "docid": "f435117fa461cacaaf77b9c90e20a3c7", "score": "0.78174144", "text": "def cache_response(path, response)\n path = clean(path)\n write_response(path, response)\n response\n end", "title": "" }, { "docid": "e248f16097042235ed2b4a5c6bf7177b", "score": "0.77740526", "t...
7dd4dcaa2dc9a8c09c4f297120316d97
POST /assignments POST /assignments.json
[ { "docid": "94cacb9cb573dba540b31060ffc242c0", "score": "0.719579", "text": "def create\n @assignment = Assignment.new(params[:assignment])\n @anken = session[:currentAnken]\n @anken.assignments.push(@assignment)\n \n respond_to do |format|\n if @assignment.save\n format.html ...
[ { "docid": "9f1704f66cf274f32316b4eafdc7f480", "score": "0.72481257", "text": "def create\n @assignment = Assignment.new(assignment_params)\n @assignment.user_id = current_user.id\n Rails.logger.info \"S\"*100\n Rails.logger.info @assignments\n respond_to do |format|\n if @assignment...
47f4c7caf851cd376c40ee9fdc98deb8
NOTE: Called from BuildGeneratorgenerate
[ { "docid": "0769bccb94fb74815965b88aa1c8a1c9", "score": "0.0", "text": "def template(generator)\n operating_system&.template(generator, self)\n end", "title": "" } ]
[ { "docid": "bb2d3f7409d8a008d0c1853b50bd6e74", "score": "0.76261294", "text": "def generate; end", "title": "" }, { "docid": "6ab8518975e599096dcf2748687aa780", "score": "0.7575281", "text": "def generate\n end", "title": "" }, { "docid": "0f99d03afd36b1bd5bb2e8fce35...
e432b8e3cfd37899d92d8390561b1560
OBJECTS =begin Convient update of the dataset by calling sqlpatch The argument record can be specified as ActiveOrient::Modelinstance or as ridstring( 0:0 ) called from ModelRecordupdate if the update was successful, the updated data are returned as Hash. First the cached object is retrieved Its modified by the paramet...
[ { "docid": "f2f7fdc3007c9d11e9166e4e0e8c985c", "score": "0.7217656", "text": "def update record, attributes , version=0 \n r = ActiveOrient::Model.autoload_object record.rid \n return(false) unless r.is_a?(ActiveOrient::Model)\n\t\traise \"Cannot update the record, version-information missing. p...
[ { "docid": "3fb5ed909bce14c29ec3550cb515ba69", "score": "0.685168", "text": "def patch_record rid\n logger.progname = 'RestChange#PatchRecord'\n content = yield\n if content.is_a? Hash\n begin\n @res[\"/document/#{@database}/#{rid}\"].patch content.to_orient.to_json\n rescue Ex...
e95c9f2a751a7aca20bd742840ff1d1b
POST /enrollments POST /enrollments.json
[ { "docid": "c9dcdd9aeb33b98e651c5315c91faf9e", "score": "0.6383581", "text": "def create\n @enrollment = Enrollment.new(enrollment_params)\n\n respond_to do |format|\n if @enrollment.save\n format.html { redirect_to @enrollment, notice: 'Matrícula criada com sucesso.' }\n format...
[ { "docid": "2f11f522302009ca5faa004f35281c3b", "score": "0.74537086", "text": "def create\n @enrollments = Enrollment.new(enrollment_params)\n\n respond_to do |format|\n if @enrollments.save\n format.html { redirect_to current_user }\n format.json { render :show, status: :create...
cc60e15adcb3277888041e1d64da3d8b
POST /donorvillages POST /donorvillages.json
[ { "docid": "674437328ea95474a8b52f0322811cac", "score": "0.62108606", "text": "def create\n @donorvillage = Donorvillage.new(donorvillage_params)\n\n respond_to do |format|\n if @donorvillage.save\n format.html { redirect_to @donorvillage, notice: 'Donorvillage was successfully created...
[ { "docid": "d3a0829a695857e25762102278b4e49c", "score": "0.63060546", "text": "def create\n donation = current_user.donations.build(donation_params)\n if donation.save\n render json: donation, status: 201, location: [:api, donation]\n else\n render json: { errors: donations.errors }, ...
01eff9f73ea1000691be0c6259e32592
Common method that creates a HIT during processing. Not meant to be called directly. params accepted: item_id, type_id, path, multiple_answer
[ { "docid": "fc1e05ab38a5a61002b48243fd602b73", "score": "0.7898929", "text": "def create_hit(params = {})\n\t\t\t\tputs \"[MacroDeck::TurkEventProcessor] Creating HIT. ItemID=#{params[\"item_id\"]} TypeID=#{params[\"type_id\"]} Path=#{params[\"path\"]}\"\n\n\t\t\t\thit = RTurk::Hit.create do |h|\n\t\t\t...
[ { "docid": "9b949df69c7c2f3bbf606afacce102c1", "score": "0.67877144", "text": "def createHIT\n\n\t # Defining the location of the file containing the QuestionForm and the properties of the HIT\n\t rootDir = File.dirname $0;\n\t #questionFile = \"/home/pkinnair/.rvm/gems/ruby-2.0.0-p247/gems/ruby-aws-...
cc33e7b64005cbbea33c590e4357beb5
Iterates over the parameterized objects currently bound to the parameters.
[ { "docid": "942262d4dc8e699a7a7218a75178c884", "score": "0.64509416", "text": "def each_parameterized\n return to_enum(__callee__) unless block_given?\n @_params.each do |_, param|\n next if param.constant?\n target = param.target\n yield target if target.is_a? Parameteriz...
[ { "docid": "d993db82091226b594199c85c58373cb", "score": "0.67832065", "text": "def each\n @parameters.each { |param,value|\n yield(param,value)\n }\n end", "title": "" }, { "docid": "bf085c04a09e344a9fc49c9c343e55b9", "score": "0.66716605", "text": "def each\n paramete...
f87316effd74ea9233c3adda67267be1
virtual attribute to mimic Course class
[ { "docid": "3ce24178ac7eb85007856891be710515", "score": "0.0", "text": "def section\n @section\n end", "title": "" } ]
[ { "docid": "78bcb018afa6be5b08eccd9e319775d1", "score": "0.6953739", "text": "def course\n self\n end", "title": "" }, { "docid": "78bcb018afa6be5b08eccd9e319775d1", "score": "0.6953739", "text": "def course\n self\n end", "title": "" }, { "docid": "8219953d4573b7...
0a988a2c4885f5bc002cc8cbffecd2b4
DELETE /partner_pageviews/1 DELETE /partner_pageviews/1.json
[ { "docid": "84fdc4c82650ee1777d811e26c914267", "score": "0.76480764", "text": "def destroy\n @partner_pageview.destroy\n respond_to do |format|\n format.html { redirect_to partner_pageviews_url, notice: 'Partner pageview was successfully destroyed.' }\n format.json { head :no_content }\n...
[ { "docid": "452cda20eff20b9b65edec7b1fb2198a", "score": "0.745108", "text": "def destroy\n @page_view = PageView.find(params[:id])\n @page_view.destroy\n\n respond_to do |format|\n format.html { redirect_to page_views_url }\n format.json { head :no_content }\n end\n end", "tit...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "57cbf482863bb9019cd67d9267f1cc2f", "score": "0.0", "text": "def set_playlist\n @playlist = Playlist.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;...
a8dd08a46e7155417ae1ba63c88eb05c
Gets a filtered list of Calendar Events. Only one optional parameter (excluding top, skip and count_total) can be specified. Simple object graphs (excluding EVENTLINKS) are returned if \"brief=true\" is used in the query string.
[ { "docid": "b7025e4649d83773e1320425f8480cea", "score": "0.0", "text": "def get_events_by_search(opts = {})\n data, status_code, headers = get_events_by_search_with_http_info(opts)\n return data\n end", "title": "" } ]
[ { "docid": "92a7c3d2a4ef97db1ef97d03756d2815", "score": "0.6879783", "text": "def list_events(*criteria)\n query = generate_query_params(*criteria)\n http_get('/events' + query).map { |e| Event.new(e) }\n end", "title": "" }, { "docid": "09305a3b9892d5a774ff39885615683d", "s...
8131334ac3e010da876302f46a999653
This looks stupid though.
[ { "docid": "61bf8126aef60f4145b20f6e484ad9f7", "score": "0.0", "text": "def decorate value\n case value\n when BigDecimal\n wrap(value.to_s('F'), @ccode[:number])\n when Numeric\n wrap(value.to_s, @ccode[:number])\n when String\n wrap(value, @ccode[:string])\n when Time, Ja...
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.648202", "text": "def desired; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.647599", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", ...