query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
7ebc1c6dab8f7562dbb511edac670992
Clean up declarative streams when all streams are stopped.
[ { "docid": "c6e2b326f6ac50358d07f6d6e1626293", "score": "0.7607306", "text": "def stop_all_streams\n super\n\n @_declarative_streams.clear\n @_declarative_stream_target = nil\n\n @_declarative_stream_proxies.clear\n end", "title": "" } ]
[ { "docid": "b038bd70e024c431c8c8918a1a32ddad", "score": "0.7263533", "text": "def finalize_streams\n [@stdin, @stdout, @stderr].each { |s| s.close }\n @stdin = nil\n @stdin_io = nil\n @stdout = nil\n @stderr = nil\n end", "title": "" }, { "docid": "54935c2590c6a93b4fce9c057d5...
d2e33197577225f328fdd737e26403cc
Displays matrix of User's Observation's, by date.
[ { "docid": "a8012c1fec9bcad2aeec6d785131a282", "score": "0.646894", "text": "def observations_by_user\n return unless (user = find_or_goto_index(User, params[:id].to_s))\n\n query = create_query(:Observation, :by_user, user: user)\n show_selected_observations(query)\n end", "title": "" }...
[ { "docid": "d0cc712b20cba57e59f709c8d56550a3", "score": "0.6605771", "text": "def list_observations\n query = create_query(:Observation, :all, by: :date)\n show_selected_observations(query)\n end", "title": "" }, { "docid": "a8e66b1d28f606751e219d650f2d8cc1", "score": "0.65439755"...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "f16f735b460d8bad30b25325d2e07287", "score": "0.0", "text": "def update!(**args)\n @managed_zones = args[:managed_zones] if args.key?(:managed_zones)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.730762", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.7263234", "text": "def update(pr...
2303ce0ae492b808a4b66e71ca756799
GET /person_kennels/new GET /person_kennels/new.json
[ { "docid": "418c3981d8d41bb69c5766ad8950db63", "score": "0.80810094", "text": "def new\n @person_kennel = PersonKennel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person_kennel }\n end\n end", "title": "" } ]
[ { "docid": "fe50ec1b4abe50cbacad54a28bc165dc", "score": "0.7688215", "text": "def create\n @person_kennel = PersonKennel.new(params[:person_kennel])\n\n respond_to do |format|\n if @person_kennel.save\n format.html { redirect_to @person_kennel, notice: 'Person kennel was successfully c...
b6b33adbdd1e94f15e06297dd04a2ed5
DELETE /pages/1 DELETE /pages/1.json
[ { "docid": "854b1756569c9f593c30816d27570670", "score": "0.7538846", "text": "def destroy\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "f99f180adb2f1f7640a174213faa8680", "score": "0.75959104", "text": "def destroy\n @page = Page.get(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { ...
f2afee3c6182b1fe43aff6c4351d7d87
def current_user_edit if current_user if is_user_admin?( current_user ) return User.find(params[:id]) end end return current_user end def is_user_admin? usr is_admin?(Role.find(usr.role.id)) end def is_admin? roller roller.name.downcase == "admin" end
[ { "docid": "80c959f3ec1f70c62dccc74ad741b533", "score": "0.0", "text": "def permission_denied\n\t\tflash[:error] = \"You do not have access to view that material.\"\n\t\tredirect_to root_url\n\tend", "title": "" } ]
[ { "docid": "eee9f0b87c2e7d7dc4d8438cfcc6e80f", "score": "0.8097722", "text": "def edit\n if current_user && current_user.role == \"admin\"\n @user = User.find(params[:id])\n else\n redirect_to new_user_session_path\n end \n end", "title": "" }, { "docid": "7b45baf1d0baf23...
43384a71f76d46ff48fb463ec4db8ff2
Will return a URL to the AMQP broker to use. Will get this from the ENV variable AMQP_URL if present.
[ { "docid": "10b48fa1410ab2936cd8b2151f5da769", "score": "0.8313791", "text": "def amqp_url\n @amqp_url ||= (ENV[\"AMQP_URL\"] || \"amqp://localhost/\")\n end", "title": "" } ]
[ { "docid": "7cdfe0618f5c6a548fd47d969ea88459", "score": "0.7723594", "text": "def connection_url\n url = \"amqp://\"\n\n if username\n url += username\n url += ':' + password if password\n url += '@'\n end\n\n url += [ client_id, virtual_host ].join( '/' )\n\n ...
7a55f8ed69e0192df8281196eb3ae1f9
GET /tree_node_ac_rights/1 GET /tree_node_ac_rights/1.xml
[ { "docid": "e18471efee919db11dc4f616260e7079", "score": "0.7292044", "text": "def show\n @tree_node_ac_rights = TreeNodeAcRight.find(params[:id])\n #@tree_node = @tree_node_ac_rights.get_tree_node\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :x...
[ { "docid": "5ed7861f68bb281d19bc9db16f0a5bc4", "score": "0.7328017", "text": "def index\n if params[:tree_node_id]\n @tree_node_ac_rights = TreeNodeAcRight.find(:all, :conditions=>[\"tree_node_id=?\", params[:tree_node_id]])\n else\n @tree_node_ac_rights = TreeNodeAcRight.find(:all)\n ...
09ae6456b2c76c8c34663a1353420517
A user that has two or more posts flagged as inaproppriate by three or more different users (and/or administrators) within a week will fall into a blacklist visible by all site administrators.
[ { "docid": "abd863862f2af67d005ecd9002bd31c7", "score": "0.7569222", "text": "def have_condition_to_blacklist\n my_posts = Post.where(user_id: id)\n num = 0\n my_posts.each do |my_post|\n if my_post.get_diff_reporting_users_within_a_week_num >= 3\n num += 1\n end\n end\n ...
[ { "docid": "4026baee670dd17a0ee3ad6aa2efd95f", "score": "0.63232815", "text": "def is_blacklisted_for?(user)\n user && user.id != self.id && self.is_premium? && self.blacklist_ids.include?(user.id)\n end", "title": "" }, { "docid": "4951d0a575665e68870acf572522ac5a", "score": "0.6059...
ecf14e0601704f908e847cb0c54c33d0
Turn off the specified outlet Example: >> netbooter.toggle_off(2) => true Arguments: +outlet+ Outlet you want to turn off (1based) Returns: boolean The new status of the outlet (should be false)
[ { "docid": "6ed495ac5d883cb4e927b8b27f49282f", "score": "0.8751574", "text": "def toggle_off(outlet = 1)\n toggle(outlet, false)\n end", "title": "" } ]
[ { "docid": "9d027bf76d6ba1427a0de2ad3cdd7393", "score": "0.79143447", "text": "def toggle_on(outlet = 1)\n toggle(outlet, true)\n end", "title": "" }, { "docid": "9709c8dcfd246841d02e7e90d5c35787", "score": "0.76528144", "text": "def toggle(outlet, status)\n current_stat...
6f4e640cc5d4dd94303a62299cc9a060
POST /incidents POST /incidents.json
[ { "docid": "96cee70b54e0eb6f3db3421844de3b34", "score": "0.52862275", "text": "def create\n return if auth2(\"website_administrator\", \"ims_servicedesk\")\n @incident = Incident.new(params[:incident])\n\n respond_to do |format|\n if current_user and current_user.roles.index(\"ims_serviced...
[ { "docid": "6a939f6b79ae292bfa41f8b2425828d4", "score": "0.70676", "text": "def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @incident = @quote.incidents.new(incident)\n @incident.save\n end\n ...
d5481c75b1b49bb9a83c3e9d61a2afa2
deliver drills in random order
[ { "docid": "cd9a60bd245212f5cc6592fa3153cf22", "score": "0.68980074", "text": "def ordered_drills\n drills.shuffle\n end", "title": "" } ]
[ { "docid": "33fe420978a1ba1ff1f75431e9f4cb07", "score": "0.60426277", "text": "def deal\n @cards.sort_by{rand}\n end", "title": "" }, { "docid": "dc8284df7234c9ae77dc2bc8328ecffa", "score": "0.59896535", "text": "def move_merchant\n @merchcount= Merchant.count(:all)-1\n @...
f5ae322d9d1b5b1a768addb9be0c21a0
DELETE /assign_overrides/1 DELETE /assign_overrides/1.json
[ { "docid": "c2bd70335e77251f0861e38572e0a986", "score": "0.75958854", "text": "def destroy\n @assign_override.destroy\n respond_to do |format|\n format.html { redirect_to assign_overrides_url, notice: 'Assign override was successfully destroyed.' }\n format.json { head :no_content }\n ...
[ { "docid": "2b80cc16feafd76d281072ee1c060dad", "score": "0.65625936", "text": "def destroy\n @sentiment_override = SentimentOverride.find(params[:id])\n @sentiment_override.destroy\n\n respond_to do |format|\n format.html { redirect_to sentiment_overrides_url }\n format.json { head :n...
f3208fdb3bd7b1bbf3e024c3c74a9556
DELETE /charity_aoos/1 DELETE /charity_aoos/1.json
[ { "docid": "0831052e48007974d216f46af4d67541", "score": "0.7312857", "text": "def destroy\n @charity_aoo.destroy\n respond_to do |format|\n format.html { redirect_to charity_aoos_url, notice: 'Charity aoo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",...
[ { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.7073753", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "4bf4dbb1d9d9ea3ce10d09ccb64da3be", "score": "0.7047193", "text": "def destro...
5c9ec7460121d3832bf07bee6b320ba3
If all arguements are valid, check_args returns false (no error)
[ { "docid": "f3b918916adc6f2de8635beecde4022c", "score": "0.84916174", "text": "def test_args_valid\n args = [0, 1, 1]\n refute check_args(args)\n end", "title": "" } ]
[ { "docid": "4240a47dad9ebb8b04e7c2c2b9e007fb", "score": "0.835891", "text": "def arguments_valid?\n # No arguments to validate so just return true \n true\n end", "title": "" }, { "docid": "2786f166d0651d33dc727e81edebbd2b", "score": "0.83137447", "text": "def valida...
d7bfa0b537dcce22f3a775a65f1041b6
Recursive postorder traversal left subtree and right subtree followed by root node
[ { "docid": "0b752d02fe7fab1bfc255e0716b86672", "score": "0.73595005", "text": "def postorder(tree)\n if tree\n postorder(tree.leftChild)\n postorder(tree.rightChild)\n p tree.key\n end\nend", "title": "" } ]
[ { "docid": "66575c758ca30ef82bf55bb380f2e6b6", "score": "0.8145139", "text": "def post_order\n order = %w[left right root]\n action = proc { |node, returnable| returnable << node.value }\n root.nil? ? [] : traverse(@root, order, [], action)\n end", "title": "" }, { "docid": "91bce8...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7ea37789884e07ffc766fcfa44939696", "score": "0.0", "text": "def set_owner_invoicing_datum\n @owner_invoicing_datum = OwnerInvoicingDatum.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;...
a626a12faff7837f4d61d1299a4713fe
POST /components POST /components.json
[ { "docid": "1df0b8c64cb8766d0c78e940a17a6da4", "score": "0.6515367", "text": "def create\n\t\tcomponentTypeName = params[:component][:type_name].strip\n\t\tif componentTypeName != '' \n\t\t\tcomponentType = ComponentType.find_by_name(componentTypeName)\n\t\t\tcomponentType = ComponentType.create(:name =...
[ { "docid": "9d2eaec94ef9bbab04f3c90b052bc427", "score": "0.6949873", "text": "def create\n @component = Component.new(component_params)\n\n respond_to do |format|\n if @component.save\n format.html { redirect_to @component, notice: \"Component was successfully created.\" }\n for...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f05c159ee4da51a30ab67039646f6d1b", "score": "0.0", "text": "def listing_photo_params\n params.fetch(:listing_photo, {})\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6978086", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6780264", "text": "def strong_params\n params.requi...
1354b038317d0d7f8669b5ca51c04a60
Normalizes `required` and `optional` fields to the form of Hash with options.
[ { "docid": "dfc1a136f5b296ad82614c6c5de4b4a2", "score": "0.0", "text": "def to_hash arr\n return {} if arr.nil?\n return arr if arr.kind_of?(Hash)\n arr = [ arr.to_sym ] unless arr.kind_of?(Array)\n ret = {}\n arr.each { |key| ret[key.to_sym] = {} }\n ret\n end", ...
[ { "docid": "9b1ec15b48c9788676d6c79fc5f5717f", "score": "0.7271161", "text": "def fields_to_validate\n required_fields = to_hash opts[:required]\n optional_fields = to_hash opts[:optional]\n required_fields.keys.each { |key| required_fields[key][:required] = true }\n optional_fields....
f9c23419e55f3dcc990daf232b7008c9
rubocop:enable Metrics/MethodLength TODO: Make it short and simple Dynamically defining a class is not going to be short or simple rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
[ { "docid": "a786be5823d9312ff04801ca790e8f6f", "score": "0.0", "text": "def generate_fake_linter_class(module_name: nil, class_name: nil, linter_name: nil, finds_problems: nil)\n class_name ||= 'FakeLinter'\n linter_name ||= 'Some Name'\n finds_problems ||= true\n\n if module_...
[ { "docid": "ae32f4a266db6d6dc2cc1873f83c6407", "score": "0.68081003", "text": "def class() end", "title": "" }, { "docid": "0a220fbf09e7373d629ba80934119902", "score": "0.6417927", "text": "def generate_class(yard_class)\n debug_msg(yard_class.path.to_s)\n\n meths = yar...
d66b7f8f471fafbfc33b5ecb7602d4d5
PATCH/PUT /patients/1 PATCH/PUT /patients/1.json
[ { "docid": "4eb41c5d121127b6079b163d8b26d8f3", "score": "0.6697718", "text": "def update\n patient = get_patient(@body[\"token\"])\n if patient != @patient\n render json: {message: \"failed to authenticate\"}, status: :unprocessable_entity\n elsif @patient.update(patient_params)\n ren...
[ { "docid": "c6ed5e4df2838a3e0f982da1aa26b0be", "score": "0.755203", "text": "def update\n @patient = @client.patients.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, notice: 'Patient was successfully u...
8a523727d8041560d8286e17a95ed999
DELETE /root_categories/1 DELETE /root_categories/1.json
[ { "docid": "a723a6a077e09e386d293d9a808e4be4", "score": "0.7603014", "text": "def destroy\n @root_category = RootCategory.find(params[:id])\n @root_category.destroy\n\n respond_to do |format|\n format.html { redirect_to root_categories_url }\n format.json { head :no_content }\n end...
[ { "docid": "701f07ddfc6ee779f7226a25309bba43", "score": "0.73409146", "text": "def destroy\n @root_category.destroy\n respond_to do |format|\n format.html { redirect_to root_categories_url, notice: 'Item Eliminado.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
2059297c702c0b2a30d3447e2dd29e6a
GET /ptdos/1 GET /ptdos/1.xml
[ { "docid": "0ed5bbe2daed501b7391fc5e1dd05c3a", "score": "0.6576358", "text": "def show\n @ptdo = Ptdo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ptdo }\n end\n end", "title": "" } ]
[ { "docid": "7ff5655da3b86d9b360b4af74eb4b593", "score": "0.61510193", "text": "def index\n @ptos = Pto.all_by_date\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ptos }\n end\n end", "title": "" }, { "docid": "ff70506b87adaeac22c...
d723a2d939984a8e68ea5bd29c7b9753
below methods to be used as helpers for the above methods return dates
[ { "docid": "89e7347426e4ba65a2b937d1ba56c87b", "score": "0.0", "text": "def parse_date(stock_data)\n stock_data.map { |date| date.trade_date }\n end", "title": "" } ]
[ { "docid": "75994e35310a9b303aa9960759190077", "score": "0.75941956", "text": "def dates\n end", "title": "" }, { "docid": "e149f8e17f402008a446c38298303ba0", "score": "0.7009889", "text": "def to_date()\n #This is a stub, used for indexing\n end", "title": "" }, {...
5fbbdb70122e0a7b49a7a2546d92b5e3
TODO: Remove the ability to edit or update a link
[ { "docid": "13d9d82b05c59c1d7d22387e67a6f80a", "score": "0.0", "text": "def edit\n end", "title": "" } ]
[ { "docid": "192f2803d8f68ca13b9b6114bc569131", "score": "0.80348635", "text": "def link\n end", "title": "" }, { "docid": "8fad7bdcd0fb2ff424fe4a073c50708c", "score": "0.7660547", "text": "def link?; end", "title": "" }, { "docid": "8fad7bdcd0fb2ff424fe4a073c50708c",...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0e80fb00ce280b188a265c798c418d79", "score": "0.0", "text": "def shoppinglist_params\n params.require(:shoppinglist).permit(:manipulator_type, :total, :time)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74954116", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6956924", "text": "def strong_params\n params.require(:request).permit(param_whit...
2133492446efa99d9c4053b64b5467cb
Filters all htmlentities, for putting text directly on the page (inside another element)
[ { "docid": "dca4218fd6d0947928c6569e90d0d7aa", "score": "0.0", "text": "def say(code)\n \"<?php echo filter_text(#{code}, true); ?>\"\n end", "title": "" } ]
[ { "docid": "54ea8f1b6d37cdf4b232808f5754b491", "score": "0.7413553", "text": "def convert_miscellaneous_html_entities\n stringex_convert do\n translate! :html_entities\n cleanup_html_entities!\n end\n end", "title": "" }, { "docid": "0e58604e728e3366e64c3...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f1be0d92c493d994e6f8b8ac0f19c58b", "score": "0.0", "text": "def pontodetroca_params\n params.require(:pontodetroca).permit(:nome, :endereco, :email)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "fa104f9047777879213cf6a90ddd3d40", "score": "0.0", "text": "def microphone_params\n params.require(:microphone).permit(:make, :serial)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
b697be63863f869e8709695222b6677c
GET /quinielas/new GET /quinielas/new.json
[ { "docid": "3b31c797e01c74dde383fef887608140", "score": "0.7765604", "text": "def new\n @quiniela = Quiniela.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quiniela }\n end\n end", "title": "" } ]
[ { "docid": "61c3fc70a43f7124ba97ed09aa1d5860", "score": "0.7319675", "text": "def new\n @agronomiaquimica = Agronomiaquimica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @agronomiaquimica }\n end\n end", "title": "" }, { "docid"...
2bd5e0d42354ac1015cda25a030c9120
(This method is generated in Translator_defaultbuildImpl)
[ { "docid": "e9d9a4a2814d1802756bc8974ab5bee0", "score": "0.0", "text": "def get_size_mib\n return @m_size_mib\n end", "title": "" } ]
[ { "docid": "6baad5035fa25628b4ef5774fc4b6415", "score": "0.68552214", "text": "def translator; end", "title": "" }, { "docid": "58760b1bb01e1b5ea65ee67bbc45bfa1", "score": "0.68133175", "text": "def __build; end", "title": "" }, { "docid": "b950e132fc856b7d4ea43264bfee0d6...
ccb7cc406b1e7d9dd65fb4dda4ab6205
create the article and submit it to the databse When a form is submitted, the fields of the form are sent to Rails as parameters. These parameters can then be referenced inside the controller actions. The render method here is taking a very simple hash with a key of :plain and value of params[:article].inspect. The par...
[ { "docid": "261f27672bae616c74be1b19fb4064a8", "score": "0.77043813", "text": "def create\n # We have to define our permitted controller parameters to prevent wrongful mass assignment.\n # In this case, we want to both allow and require the title and text parameters for valid use of create.\n ...
[ { "docid": "43c6272e84bc7db8352ae3c250ea0d0a", "score": "0.81441206", "text": "def create\n #render plain: params[:article].inspect #This line straight up shows the entry you submitted on the browser\n @article = Article.new(article_params) #This creates a new article with the parameters you passe...
c719cf509d7157578b4502ab8d680fce
Fired when we find an inverted section. Just like `on_section`, we're passed the inverted section name and the array of tokens.
[ { "docid": "0e8640b09332b06ad7e5cde938d1d23e", "score": "0.46899337", "text": "def on_mustache_invertedsection(name, content)\n content = compile(content)\n\n tmp = unique_name(:mutmp)\n [:multi,\n [:code, \"#{tmp} = _mudict[#{name.to_sym.inspect}]\"],\n [:if, \"!#{t...
[ { "docid": "bf0f6e49c6a47fd5f4868f638faa3510", "score": "0.6610168", "text": "def on_inverted_section(name, offset, content, raw, delims)\n # Convert the tokenized content of this section into a Ruby\n # string we can use.\n code = compile(content)\n\n # Compile the Ruby for this inv...
d374d1f5e4e2c0798b8be674a2bbd8bc
Don't give access to the array directly
[ { "docid": "252ebf92bc9f2a86011771727d1f73bf", "score": "0.0", "text": "def save_hints(hints_array)\n update_attribute(:hints, hints_array.join(','))\n end", "title": "" } ]
[ { "docid": "e57e0f681c7f0b1e46ec99a3ed4708c4", "score": "0.7560538", "text": "def old_array; end", "title": "" }, { "docid": "c875ac6509d4fc29340c115b53b33bb2", "score": "0.7427554", "text": "def array; end", "title": "" }, { "docid": "c875ac6509d4fc29340c115b53b33bb2", ...
42e0e5c8184a917bea92576c0e6183bf
DELETE /externalcolors/1 DELETE /externalcolors/1.xml
[ { "docid": "04f2d1923c5ed09f211b696e0e189da3", "score": "0.7397622", "text": "def destroy\n @externalcolor = Externalcolor.find(params[:id])\n @externalcolor.destroy\n\n respond_to do |format|\n format.html { redirect_to(externalcolors_url) }\n format.xml { head :ok }\n end\n end...
[ { "docid": "18fca1d264a9a7c9ab1321ff47e86d79", "score": "0.67709607", "text": "def destroy\n @color = Color.find(params[:id])\n @color.destroy\n\n respond_to do |format|\n format.html { redirect_to(colores_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { ...
92be00b851138c4efc764643c10a08c5
show and delete pair
[ { "docid": "feabdc484e324e79d02f5c9e0fb7b04c", "score": "0.0", "text": "def show\n @track = Track.find(params[:id])\n render :show\n end", "title": "" } ]
[ { "docid": "e3b3dce067debd9db536e1babb63e0f8", "score": "0.61858284", "text": "def destroy\n @pair.destroy\n respond_to do |format|\n format.html { redirect_to pairs_url, notice: 'Pair was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }...
4542d78760f31f50b37be351ab59bc35
Saves the changes in a Journal Called after_save
[ { "docid": "e4936340379c0e690b9a181a739ffb32", "score": "0.64333934", "text": "def create_journal\n if @current_journal\n # attributes changes\n @attributes_before_change = @attributes_before_change_kanban\n if @attributes_before_change\n ...
[ { "docid": "15a1d83f286a6d8cab7bf7ab6cea871f", "score": "0.70246947", "text": "def save_project_journal\n if @project_journal\n @project_journal.save\n end\n end", "title": "" }, { "docid": "3828171e178e0b766a8d0fdd3afb16fe", "score": "0.69682175", "text": "def save(param...
e3dca41974e3af7d0fb73f17ad511fa4
Combine this code set (a) with another (b), according to an operation: 'i': intersection, a^b 'd': difference, ab
[ { "docid": "e209154fa28806d6c18be36c66f209f8", "score": "0.68345994", "text": "def combine_with(code_set, oper)\n sa = elements\n sb = code_set.elements\n\n i = 0\n j = 0\n combined_elements = []\n\n was_inside = false\n\n while i < sa.length || j < sb.length\n\n ...
[ { "docid": "7f0bcf2f494599377cdc6b69914afc01", "score": "0.64268005", "text": "def intersection(other)\n Operation.new(:and, dup, other.dup).minimize\n end", "title": "" }, { "docid": "762bd5dc29d861b235824da6c30dc23e", "score": "0.6408101", "text": "def set_union(a, ...
88c46e150a693fb8f5221ab07637a9c3
MHP Maximum Hit Points
[ { "docid": "eba4fa1a27fe9d1fbd52cf24bfc36670", "score": "0.0", "text": "def mmp; param(1); end", "title": "" } ]
[ { "docid": "12e1c5b5c56c854fd5f5614956bd0480", "score": "0.7151394", "text": "def native_maxhp\n actor.parameters[0, @level] + @maxhp_plus\n end", "title": "" }, { "docid": "25eaa33508c8956664be961c9a722d4d", "score": "0.7035748", "text": "def hit\n malus_hit = has2w ? C...
b2912051855f5b84fb26fd02fb9d7762
render the target according to this column's layout rules
[ { "docid": "4308de96ced437849d1f03076e688790", "score": "0.63163245", "text": "def render(target)\n align_right? ? Justifier.rjust(target, width) : Justifier.ljust(target, width)\n rescue StandardError => e\n raise \"Column #{name} failed: #{e.message}\"\n end", "title": "" ...
[ { "docid": "19a5ec393af0264c4d9b2d8c6fdc028b", "score": "0.5928397", "text": "def render_layout(output, layout, info); end", "title": "" }, { "docid": "fcbc6e1a387bd028adf53f0fd16e1cc2", "score": "0.56657493", "text": "def draw()\n @vc.content_tag(:table) do\n @left ...
7c7ceaa4d882454394aa28cae4e7d40a
pick another dish from the cart to remove
[ { "docid": "d0622ba53bded93652dc5ef065c4f7ea", "score": "0.752341", "text": "def continue_removing\n user.reload\n system \"clear\"\n OrderHere.header\n\n # ------------new array of dishes after the deletion----------------------\n dishes_hash_2 = user.dishes.map do |d...
[ { "docid": "b68f9e32e643b72326fe2bb5d9fcb5e0", "score": "0.71156484", "text": "def remove_item_from_cart!(other_item)\n shopping_carts.find_by_item_id(other_item.id).destroy\n end", "title": "" }, { "docid": "f7d9bfea03957d07f1f78e6dfe987b32", "score": "0.67907965", "text": "def ...
7aa20a8338b0094318077841de3a7f4f
Yields a RuoteKit::Configuration instance and then immediately starts the engine (unless configuration prohibits it).
[ { "docid": "62bea863400b0ef55d5f3ac146e829cd", "score": "0.73966086", "text": "def configure( &block )\n yield configuration\n\n run_engine!\n end", "title": "" } ]
[ { "docid": "89cd1df4323093bdb2228f4623fd249f", "score": "0.7244054", "text": "def running!\n Initializer.continue!\n\n yield DaemonKit.configuration if block_given?\n end", "title": "" }, { "docid": "51f23e0c0c929bbe6eb01211b9602006", "score": "0.7173352", "text": ...
c1502f1d1692ba0d6e795d189d1473d7
description seems to be the best way to identify an item
[ { "docid": "8e5b4cc9a43a1abc81d76a3c474ad506", "score": "0.0", "text": "def find_item description\n items = find_items\n elem = items.xpath(\".//rasd:Description\").find{ |e| e.content == description }\n raise MissingElement.new(description) if elem.nil?\n elem.parent\n end", ...
[ { "docid": "84123295b5b21e79930ca7e62030f7c5", "score": "0.75130504", "text": "def description_for(item)\n if item.description\n item.description\n elsif item.content\n item.content\n else\n \"\"\n end\n end", "title": "" }, { "docid": "31d2dd429a6b27879dbb02feb63...
5767d4ff632da5dd785b3a0ea572f618
Provides operations to call the cancelMediaProcessing method.
[ { "docid": "0058daaf5f48dcb0910440dbe4956a8a", "score": "0.74522626", "text": "def cancel_media_processing()\n return MicrosoftGraph::Communications::Calls::Item::CancelMediaProcessing::CancelMediaProcessingRequestBuilder.new(@path_parameters, @request_adapter)\n ...
[ { "docid": "954d0a72c2c6a75bcef2587c78e26011", "score": "0.67863894", "text": "def process_cancel\r\n Sound.play_cancel\r\n Input.update\r\n deactivate\r\n call_cancel_handler\r\n end", "title": "" }, { "docid": "d36cf4d99424045dadbddd6c30c2dda3", "score": "0.67580193", ...
ac0087ccc6d156ae3981b5e49c016154
The array will never be empty and the numbers will always be positive integers. Your result should also be an integer.
[ { "docid": "893007b9e87dc7f1dba70f02d431c39b", "score": "0.0", "text": "def average(arr)\n arr.sum / arr.size\nend", "title": "" } ]
[ { "docid": "4bab05bb1580841e7543a8e5f4f416f0", "score": "0.7417678", "text": "def sum_only_numbers(array)\n ll_sum = 0.0\n if array.length > 0\n for idx in array do\n if idx.is_a?(Numeric)\n ll_sum += idx\n end\n ...
f7a9faf96e29893f6dc040976706851a
Verify state of caching of future values :callseq: cached? => bool
[ { "docid": "869f9d4436ba6149aac03379b47fb1e0", "score": "0.7160531", "text": "def cached?\n !(!@cached)\n end", "title": "" } ]
[ { "docid": "d273a637e69cba3a51af48d515f040da", "score": "0.73260194", "text": "def cache?\n caching && true\n end", "title": "" }, { "docid": "51226c30aa47833118d6583aa1b28a7a", "score": "0.72759366", "text": "def cache_value?; end", "title": "" }, { "doci...
372c3dfe1cc47c9ddfd11116299298f0
Shipping rules: For each product in the inventory, find which product has the higher shipping price. That then becomes the shipping price for the whole order. If the total of the order is >= 100.0, then make the shipping free.
[ { "docid": "673f915c85dafac4921b2dea7c900165", "score": "0.73538744", "text": "def shipping\n shipping = self.order_items.max(:shipping)\n \n if products_price >= 100\n shipping = 0\n end\n\n shipping\n end", "title": "" } ]
[ { "docid": "af35561c2d4bbe3fa271482f2e65fe28", "score": "0.7217644", "text": "def apply_free_shippling_rule\n if (@subtotal > 100.00 || @customer[:state] == 'IL') # If subtotal greater than 100 or state is IL\n if !(@line_items.detect { |item| item.sku == '123' }) # If a particular item i...
2664f3ec44d4f87299907aacfdf52e19
PATCH/PUT /mutants/1 PATCH/PUT /mutants/1.json
[ { "docid": "1a94b3cb6a56bb959fb25f8c1e49e277", "score": "0.70078737", "text": "def update\n if @mutant.update(mutant_params)\n render :show, status: :ok, location: api_v1_mutant_url(@mutant)\n else\n render json: @mutant.errors, status: :unprocessable_entity\n end\n end", "title"...
[ { "docid": "2e42f899c2afa33da88f01f19a172011", "score": "0.641704", "text": "def set_mutant\n @mutant = @resource = Mutant.find(params[:id])\n end", "title": "" }, { "docid": "002cc35fbe2047275de4444a8b93c068", "score": "0.6174418", "text": "def set_mutant\n @mutant = Mu...
ab82fe256664644e05294524fc1a8414
+paginate_by_filter+ is the main method used in controllers. Uses the options and parameters passed in, proccesses them and then passes them to will_paginate.
[ { "docid": "41d234ad6644c677ace87da2e68e1cac", "score": "0.8128698", "text": "def paginate_by_filter(opts={})\n paginate(filter_and_sort_options(opts))\n end", "title": "" } ]
[ { "docid": "f427b2504554133dbf0d6926c9ba9014", "score": "0.7759472", "text": "def jqgrid_paginate_by_filter(params={}, options={})\n paginate(jqgrid_filter_and_sort_options(params, options))\n end", "title": "" }, { "docid": "d1a0822af755b97da71639cfcd3f72a4", "score": "0.6681331...
3b826b26e95f6641981684ee5ff65358
Provide a user friendly representation
[ { "docid": "5fae5605ea5b62ced1866d0e45658569", "score": "0.0", "text": "def to_s\n '<Twilio.Verify.V2.VerificationAttemptsSummaryPage>'\n end", "title": "" } ]
[ { "docid": "215f29191080c4bf1c51441e99ca812a", "score": "0.70447654", "text": "def to_display\n raise NotImplementedError\n end", "title": "" }, { "docid": "10e71201c7d33f56a89616b30aa39d6b", "score": "0.7025946", "text": "def to_s; description end", "title": "" }, { ...
5e90e3bbb869b791396c546d56cd789d
REPORTE DE ESTADISTICA DE VENTAS
[ { "docid": "0ffed099851b30d9c7d2fef799a67f57", "score": "0.0", "text": "def build_pdf_header_rpt2(pdf)\n pdf.font \"Helvetica\" , :size => 8\n \n $lcCli = @orden.customer.name \n $lcRucCli = @orden.customer.ruc\n $lcDirCli = \"\" \n \n $lcFecha1= Date.today.strftime(\"%d...
[ { "docid": "356729b36178a06ceb14a98848df5111", "score": "0.61170185", "text": "def vencimentos\n quantidade_de_parcelas = self.plano_de_pagamento.size / 3\n prazo = 0\n i = 0\n vencimentos = []\n\n # Verifica se a data de entrega foi preenchida e regera as duplicatas com base nessa data\n...
b072fd070197ed531f22654087572c90
GET /media_items GET /media_items.json delete this routing
[ { "docid": "470a0a88b199aa2304e8a52e9e55fac5", "score": "0.65999854", "text": "def index\n @media_items = MediaItem.all\n end", "title": "" } ]
[ { "docid": "0c290fdde2d9f4774e870965000490fa", "score": "0.7726081", "text": "def destroy\n @media_item = MediaItem.find(params[:id])\n @media_item.destroy\n\n respond_to do |format|\n format.html { redirect_to media_items_url }\n format.json { head :no_content }\n end\n end", ...
bb973dac6bf656015ce943a8d37f7338
The order of this series in the chart's series. By default the order is the index of the series.
[ { "docid": "40278e08fb54c512aab84265bf76a9e3", "score": "0.7161901", "text": "def order\n @order || index\n end", "title": "" } ]
[ { "docid": "41addd2fe3e43efdef49208877b5038e", "score": "0.7008635", "text": "def order\n self[:order]\n end", "title": "" }, { "docid": "6fb898495cf82829a7d0d4c65af81261", "score": "0.6993051", "text": "def order\n @order ||= set_order\n end", "title": ""...
813a19fe1a56b3941bb3d4a3b826189e
Modifies the Inspec Runner options generated by the kitcheninspec verifier to support the verification of each group's hosts.
[ { "docid": "2dca86388c7e9c0e70503c249593a15f", "score": "0.6063604", "text": "def runner_options(transport, state = {}, platform = nil, suite = nil)\n super(transport, state, platform, suite).tap do |options|\n self.class::ConfigureInspecRunnerBackend.call hostname: state.fetch(:hostname), optio...
[ { "docid": "433658a6c41386c3f94f2c843d2fb220", "score": "0.5854998", "text": "def hosts\n Put.warn \"\\nStarted configuring ansible hosts.......\\n\"\n @ansible.groups.each do |group|\n Put.info \"Adding group [#{group['name']}]\"\n\n response = Rest::SubutaiConsole.comma...
8f72e4da1729e8ab6e13e5da49563d61
Cancel all open option orders
[ { "docid": "ed43799f6b1bb38366c79f6959d9a6e1", "score": "0.81948954", "text": "def cancel_all_open_option_orders\n number_cancelled = 0\n self.option_orders.each do |order|\n if order[\"cancel_url\"]\n cancelled = cancel_option_order(order[\"id\"])\n number_cancelled += 1 if can...
[ { "docid": "84e614ab4170e84f801254dd058f7228", "score": "0.74358714", "text": "def cancel_orders(orders, opt={})\n\t\t\treturn batch_operate_orders(orders, :cancel_orders, :cancel_order, opt)\n\t\tend", "title": "" }, { "docid": "998faaab5d17e42a04bb683153d5d16b", "score": "0.73599267", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f7168c9fa379493689b9eed7e87160a7", "score": "0.0", "text": "def word_params\n params.require(:word).permit(:word)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6981273", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6783789", "text": "def strong_params\n params.requi...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ca7acc162a1ac791245d1a6a706f27ac", "score": "0.0", "text": "def set_medicine\n @medicine = Medicine.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
db32021d61b61534c91c2339527963f3
Views a specific forum. Users can post ideas here.
[ { "docid": "f25190faa779d46bab75c50336cf5228", "score": "0.7127763", "text": "def show\n\n\t\t#check if memeber then enable editing\n\n\t\tsleep 1\n\t\t@forum = Forum.find(params[:id])\n\n\t\t@ideas = []\n\t\tif !Idea.where(forum_id: params[:id]).empty?\n\t\t\t@ideas.concat(Idea.where(forum_id: params[:...
[ { "docid": "144513b07b1bd5e88ea3382dfcb8ce07", "score": "0.788475", "text": "def view_forum\n if !params[:id].nil?\n id = Integer(params[:id])\n @forum = Forum.find(id) #\n else\n render 'index' \n end\n end", "title": "" }, { "docid": "01102f7a055f80b...
af4be11161b75f0c327ce5ec5a0bea78
Runs manipulate_option over a list of lists of 5 elements, corresponding to the arguments to manipulate_option ; see manipulate_option (obviously) for details.
[ { "docid": "b6b9aa6f0fd432271ff02b21557e4c8c", "score": "0.70166445", "text": "def multi_manipulate_option(options)\n if options == nil\n return\n end\n options.each do |manip_type, *args|\n if manip_type != nil\n manipulate_option_raw(manip_type.to_sym, *args )\n print ...
[ { "docid": "5e292e2a2954cb1b292e2e87395e2dde", "score": "0.6096701", "text": "def make_option_list\n end", "title": "" }, { "docid": "5e292e2a2954cb1b292e2e87395e2dde", "score": "0.6096701", "text": "def make_option_list\n end", "title": "" }, { "docid": "d227be332e268c...
292017d96f74b294b3019e7e18452b27
POST /car_images POST /car_images.json
[ { "docid": "8582098eb59b3b2539cce58d077d2be4", "score": "0.7147279", "text": "def create\n @car_image = CarImage.new(car_image_params)\n\n respond_to do |format|\n if @car_image.save\n format.html { redirect_to @car_image, notice: 'Car image was successfully created.' }\n format...
[ { "docid": "ad37f2116ad4f470348cad260100fee4", "score": "0.7331691", "text": "def create\n @car = Car.new(car_params)\n @car.plate = @car.plate.upcase\n @car.owner_id = current_user.owner.id\n if params[:car][:images]\n @car.images.attach(params[:car][:images])\n end\n respond_to ...
4c711d16042c8f41fa09ffe4d8bd69d4
Method for downloading and unziping csv data file packages
[ { "docid": "6c46f757feb2d05351bc86813957b619", "score": "0.70501393", "text": "def download_data_file(url, directory, destination_filename)\n filepath = \"#{directory}/#{destination_filename}\"\n puts \">> Downloading #{filepath}...\"\n IO.copy_stream(open(url), filepath)\n\n Zip::File.open(filepath...
[ { "docid": "7f2d77538587d008a05720aedbbe3287", "score": "0.6200827", "text": "def get_zips\n zips = CSV.read('./zips.csv', :headers => true)\n return zips\nend", "title": "" }, { "docid": "a5abe7953f2a8005d8648930001aaf7f", "score": "0.6134575", "text": "def zip_download\n req...
94647778cd32700b46cd5b6504ce5091
DELETE /articles/1 DELETE /articles/1.json
[ { "docid": "324fb3cebdcc9e4429e92b9e50eb8947", "score": "0.0", "text": "def destroy\n Log.create(user: current_user,\n article: @article,\n action: Action.find(3),\n data: @article.attributes)\n @article.nr = nil\n @article.save\n respond_to do |form...
[ { "docid": "79d4453dce0b67b999f26c6cab481520", "score": "0.7844117", "text": "def destroy\n @article = Article.find(params[:id]) \n @article.destroy\n\n respond_to do |format|\n format.html { redirect_to articles_url }\n format.json { head :no_content }\n end\n end", "title...
0016eab30363cd30c6ca1d995bb5a0a7
POST /restaurants POST /restaurants.json
[ { "docid": "d0c85816220d3c8182428182954ad9a6", "score": "0.0", "text": "def create\n @restaurant = Restaurant.new(restaurant_params)\n params[:restaurant][:tag_ids].each do |tag|\n if !tag.empty?\n @restaurant.hashtags.build(:tag_id => tag, :user_id => current_user.id)\n end\n ...
[ { "docid": "6b8d51d65fa6982ad81944d1824cfcc5", "score": "0.75362545", "text": "def create\n @restaurant = Restaurant.new(restaurant_params)\n\n if @restaurant.save\n render json: RestaurantSerializer.new(@restaurant)\n else\n render json: @restaurant.errors, status: :unprocessable_ent...
dfcf2569ae925b9eb345cb2e3db40273
Does an HTTP GET on a given URL and returns the response body
[ { "docid": "d02c1607b3989310537f7eed7fd9c3b7", "score": "0.79819983", "text": "def http_get(url)\n response=Net::HTTP.get_response(URI.parse(url))\n response.body.to_s\n end", "title": "" } ]
[ { "docid": "920bc5907007d85d998b7425f67eab27", "score": "0.8214771", "text": "def http_get(url)\n puts \"GET: #{url}\" if FLICKR_DEBUG\n Net::HTTP.get_response(URI.parse(url)).body.to_s\n end", "title": "" }, { "docid": "988f7f1ca484eca4b6465bae74920b82", "score": "0.8146122", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5d26c72d78108cbe353ca4b0e650b0aa", "score": "0.0", "text": "def election_candidate_params\n params.require(:election_candidate).permit(:party, :list, :place, :User_id, :Election_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496729", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958585", "text": "def strong_params\n params.require(:request).permit(param_white...
53588163bdc4f1bcafa25bbd5c22470e
Log an +ERROR+ message.
[ { "docid": "067c90cc3eb3399b5d2216a9314952ce", "score": "0.65063727", "text": "def error(*args, &block)\n add_with_options(ERROR, *args, &block)\n end", "title": "" } ]
[ { "docid": "5fe12aefc9dd14c5c44265c1bc69614f", "score": "0.81670934", "text": "def error(message)\n log(\"#{color(\"ERROR:\", :red, :bold)} #{message}\")\n end", "title": "" }, { "docid": "8f45424170051447d2b59e6965f6c070", "score": "0.80862623", "text": "def error(msg)\n...
7b8d238fa205e1b122fe49fc9b47c67b
SCP a file from your local drive to a remote machine. task_for :item, :servers => :server do scp :local => "/tmp/pirate_booty", :remote => "/mnt/app/config/booty.yml" end
[ { "docid": "c22851b1c8ea13b524cdd918998472c4", "score": "0.58653796", "text": "def scp options = {}\n self.__commands << options.merge({:type => :scp})\n end", "title": "" } ]
[ { "docid": "eda4372aef5de6119aa5bd2fd836a62d", "score": "0.68270236", "text": "def scp(file)\n\t\tif pull_request_where == \"jackrabbit\"\n\t\t\tNet::SSH.start(pull_request_host, pull_request_user) do |ssh|\n\t\t\t\t# when testing, make sure to use cedar['upload_test_dir'] - this is the sftp user accoun...
9d2247e038e1393fd2f16051cc521115
Determines the average coffeeshop rating on categories
[ { "docid": "bcda6a7f45dcc0937b4af4774398453a", "score": "0.6492099", "text": "def calculate_average_ratings\n total_reviews = self.reviews.count\n\n quality_total = 0\n study_total = 0\n laptop_total = 0\n hipster_total = 0\n\n self.reviews.each { |review| quality_total += review.qu...
[ { "docid": "ed0f43a91367ea74665042c218ff7afb", "score": "0.71045", "text": "def rating_of(category, item)\n ratings_of = ratings.select{ |r| r.beer.send(category) == item }\n ratings_of.map(&:score).inject(&:+) / ratings_of.count.to_f\n end", "title": "" }, { "docid": "8779f7ab2434...
346b92b761506b0a637ebe5533e89d63
DELETE /papers/1 DELETE /papers/1.json
[ { "docid": "315fc9094f6a85401bff7a21d447c8bc", "score": "0.6496686", "text": "def destroy\n @paper = Paper.find(params[:id])\n @paper.destroy\n\n respond_to do |format|\n format.html { redirect_to writers_desk_url }\n end\n end", "title": "" } ]
[ { "docid": "12a56495e4d31a6ad9a0e6fe2f1b3b48", "score": "0.7640976", "text": "def destroy\n @paper = Paper.find(params[:id])\n @paper.destroy\n\n respond_to do |format|\n format.html { redirect_to(papers_url) }\n format.json { head :ok }\n end\n end", "title": "" }, { ...
5fcd123a670fe083712ab1eef971fa57
Future plans are to add different backgrounds that can be chosen by you =============================================================================== Utility method for setting colors =============================================================================== Useful Hex to 15bit color converter: Add in your own c...
[ { "docid": "aaca21ed73d8979225c7660c16a60176", "score": "0.0", "text": "def colorQuest(color)\n color = color.downcase if color\n return \"7DC076EF\" if color == \"blue\"\n return \"089D5EBF\" if color == \"red\"\n return \"26CC4B56\" if color == \"green\"\n return \"6F697395\" if color == \"cyan\"...
[ { "docid": "97f23c0d60359a357dbcbde346969914", "score": "0.66642207", "text": "def set_custom_color(index, red = 0, green = 0, blue = 0)\n # Match a HTML #xxyyzz style parameter\n if red.to_s =~ /^#(\\w\\w)(\\w\\w)(\\w\\w)/\n red = ::Regexp.last_match(1).hex\n green = ::Regexp....
3fc9de8646e80cf062ebf2da4919d4ca
michigan 50 wins wisconsin 35 wins michigan state 20 wins Indiana 10 wins
[ { "docid": "2511ca38fc527a11f3ef52266725f5af", "score": "0.0", "text": "def menu\n\tputs \"Welcome to My Tournament Generator. Enter a selection:\"\n\tputs \"1. Enter teams\"\n\tputs \"2. List teams\"\n\tputs \"3. List matchups\"\n\tputs \"0. Exit program\"\n\t$input = gets.chomp.to_i\nend", "title"...
[ { "docid": "f88650c19a7b1d6c7a5eb2a7660b9a3c", "score": "0.65888685", "text": "def wins\n determine_stats[:wins]\n end", "title": "" }, { "docid": "cd28165aba00f1c228594815e57bfe81", "score": "0.64880073", "text": "def determine_winner game\n winner = game.max_by {|team| team[...
209c308475fa688432d3d7d89c01ace4
RSpec 2 compatibility: source://carrierwave//lib/carrierwave/test/matchers.rb253
[ { "docid": "f67368ff87c274cfa3d096034c4bb5a6", "score": "0.0", "text": "def negative_failure_message; end", "title": "" } ]
[ { "docid": "bcb66d14aa9a3b9e26c18ca19637d6ef", "score": "0.6633395", "text": "def test_validation_independence\n assert_nothing_raised do\n a = Attachment.new(:file => fixture_file_upload('/attachments/AlexOnBMW#4.jpg', 'image/jpeg', :binary))\n assert a.valid?\n a.save!\n end\n en...
e0545a80d22afbe0fc0797a1086da1b7
Get html nodes created by JavaScript with browsers
[ { "docid": "c3a6bdaa37cc7b201223850f2ad0bbc4", "score": "0.7191054", "text": "def get_nodes\n require 'watir'\n self.export_html(TEMP_NAME)\n path = File.expand_path(\"./\" + TEMP_NAME, Dir.pwd)\n browser = Watir::Browser.start(\"file://\" + path)\n html = browser.html\n br...
[ { "docid": "14900bbd11576542da057cacf2f4d9f2", "score": "0.64797604", "text": "def inner_html \n elem = @dom_element\n `\n var ret = #<elem>.innerHTML;\n return (ret == null) ? #<nil> : ret;`\n end", "title": "" }, { "docid": "3ad7c0802507d4752d1bb6e4f6d9dc7b", "score": "0.6...
c695776019b684f6ce808f211c82e158
GET /workouts/1 or /workouts/1.json
[ { "docid": "bb4540fe91a2c2558ee49b7366b60ee2", "score": "0.0", "text": "def show\n \n end", "title": "" } ]
[ { "docid": "0122a0db5d9b8d8db25d1c47fd22f49a", "score": "0.74302745", "text": "def index\n @workouts = Workout.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workouts }\n end\n end", "title": "" }, { "docid": "29b52b5bae5c0a8fbb0...
8ee72932ef69df11e88b53564d853e59
Returns the object in the form of hash
[ { "docid": "a726f6ef059e20b4868b30a651cc9af0", "score": "0.0", "text": "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.fastly_nullable.include?(attr)\n next if !i...
[ { "docid": "027facb8b195665ceeb78f2c171e2881", "score": "0.8269", "text": "def to_hash\n object\n end", "title": "" }, { "docid": "d730a9ea60df6695b2c6a153d7d3a8b7", "score": "0.7948379", "text": "def hash\n as_hash.hash\n end", "title": "" }, { "docid": "...
9b9ae563dd05acdb19272b3e0063c431
Takes an input and executes a command based on that input.
[ { "docid": "5eac57d4521cc339ddd93b32fa111021", "score": "0.78440714", "text": "def do_command( input )\r\n cmd, args = input.sanitize.split \" \", 2\r\n matches = Game.instance.find_commands( self, cmd )\r\n\r\n if matches.any?\r\n command = matches.last\r\n su...
[ { "docid": "5118f8175d792a5bc96505533ad82b7f", "score": "0.88275814", "text": "def execute_command(input)\n # Grab the first word as the command, the rest as the args\n cmd, args = input.split(/\\s/, 2)\n \n match = self.class.commands.grep(/^#{cmd}/i).first\n match ? send(\"cmd_#...
a817bc5400c782e9c7c837b816bcf2f9
This calls our ItemSelector after obtaining the maximum card value from our Maximizer class below. It returns a Hash of the best items we can choose for two people. If no such pair exists, it returns an empty Hash.
[ { "docid": "225fcefec2c67d1aaef44ba7b56e8d1c", "score": "0.5848273", "text": "def call\n ItemSelector.call(prices, max_card_value)\n end", "title": "" } ]
[ { "docid": "c901dca094d448b363525b956d79d9da", "score": "0.62796247", "text": "def max_take\n if $game_party.multi_storage[$game_variables[Storage::BOX_VAR]][@item] > $game_party.max_item_number(@item) - $game_party.item_number(@item)\n $game_party.max_item_number(@item) - $game_party.item_numbe...
a89f2ad93a59141919ffa1a7909548d1
there are two ways to create a new pattern. 1. load it from a .ptn file. this file is a plain text file, where each line is a line of the pattern, each character being a cell. a '' character indicates the cell should be filled, anything else, empty 2. pass the data in directly. three arguments should be passed: the fir...
[ { "docid": "59abe1f2942242aecf3b6613c9b41082", "score": "0.0", "text": "def initialize(*args)\n if args.size == 1\n load_data(args[0])\n elsif args.size == 3\n @width, @height = args[0], args[1]\n @data = args[2]\n if @data.size != @width * @height\n raise <<-EOM.gsub(/^...
[ { "docid": "f54ba795a7437f361c0ea8b7f1532fd9", "score": "0.5770205", "text": "def from_txt file:\n\t\t\t@mask = []\n\t\t\traise \"#{self.class} has not implemented a text-file constructor\"\n\t\tend", "title": "" }, { "docid": "c1797898d033c38117c68979a55a26b9", "score": "0.5661294", ...
c777a68506942fde586d4d0d7000e4d1
accion en el controlador
[ { "docid": "c08bb2d563409a61f3b2ee25fe17588c", "score": "0.0", "text": "def index\n\t\t@post = Post.all.order(\"created_at DESC\")\t\t\n\tend", "title": "" } ]
[ { "docid": "734ad6c36a1ed58c610047ce43e5adb0", "score": "0.6495926", "text": "def procesar\n \n end", "title": "" }, { "docid": "e3287ad0c24d3e2ebf785144094d865f", "score": "0.646872", "text": "def access\n\n end", "title": "" }, { "docid": "fb02522d93b9bb37cab3256...
1f1228a5f7014a7be711b3a2c8c8cf15
The Bootstrap version is that provided by bootstrapsass
[ { "docid": "34c90cde3b4291f05903b79378f051e0", "score": "0.55119735", "text": "def bootstrap_js_include_tag use_cdn=true\n local_bs = javascript_include_tag 'bootstrap.js'\n if use_cdn\n # The version may include a maintenance release number\n version = Bootstrap::VERSION.split('.')[0..2...
[ { "docid": "2701a1fe04badd6f8c1fd514212ced9b", "score": "0.6847433", "text": "def get_bootstrap_version\n version = self.tags.where('is_bootstrap = ?', true)\n if version.nil? or version.empty?\n return\n else\n b = version.first.name\n v = Bootstrapversion.find_by(:name => b)\n ...
8e5d625ba5d7dcdd17cea2a308dbe492
Update a Hostswitch Profile Modifies a specified hostswitch profile. The body of the PUT request must include the resource_type. For uplink profiles, the put request must also include teaming parameters. Modifiable attributes include display_name, mtu, and transport_vlan. For uplink teaming policies, uplink_name and po...
[ { "docid": "1c41883cfa258acce0dbf64a5537e292", "score": "0.61714303", "text": "def update_host_switch_profile_with_http_info(host_switch_profile_id, base_host_switch_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiNetwor...
[ { "docid": "138dcb5df02fa012e04ec9f1ea869419", "score": "0.65154403", "text": "def update_chassis_profile(moid, chassis_profile, opts = {})\n data, _status_code, _headers = update_chassis_profile_with_http_info(moid, chassis_profile, opts)\n data\n end", "title": "" }, { "docid"...
89c8b314834f951c819bd378b2f43f6c
Convert a value from the view TabularDataWithStrings from the unit represented there to the given unit. We make a bunch of special cases for unit aliases used by EnergyPlus which are not in the default list of OpenStudio conversions We also special case a few conversions for unitless 'units' so that our final display m...
[ { "docid": "4b400488e319c539f0e1f88ce36c4276", "score": "0.0", "text": "def eplus_to_openstudio(unitstr)\n unitstr.gsub('m3', 'm^3').gsub('pa', 'Pa').gsub('m2', 'm^2').gsub(' per ', '/')\n end", "title": "" } ]
[ { "docid": "45d8644176da1e375a552a9bd74bdba5", "score": "0.70124793", "text": "def unit_converter (unit)\n\n # key value pair of key as standarized name, value as alternatives to be converted\n converter_hash = {\n \"tbsp\" => [\"table spoon\", \"table spoons\", \"tablespoon\", \"tablespoons\" ],\n...
7d53b2495567e5cb28836ad4486efd59
token used to encode facet and query name with interaction order (number) as per user interactions
[ { "docid": "99403809f9324c8651ca678aa2a1d3b2", "score": "0.66128135", "text": "def encoding_token\n '_interaction_'\n end", "title": "" } ]
[ { "docid": "3183c218120f23becfba957a6a21fcc1", "score": "0.6309456", "text": "def compound_token; end", "title": "" }, { "docid": "8215287c105d35736c6ffcb316dd6294", "score": "0.6293735", "text": "def token_inputs\n\t { :id => _id, :name => name }\n\t end", "title": "" }, ...
f261ed1d3ad849966c2cb7a65ad7213c
Sending an input to the first Neuron We should do something better to track multiple inputs
[ { "docid": "ac674f98e42c7a438b2232216a9ceace", "score": "0.6411652", "text": "def feedforward(input)\n start = neurons.first\n start.feedforward(input)\n end", "title": "" } ]
[ { "docid": "1f496f1c4df2312ab63a861713146f3a", "score": "0.6655163", "text": "def input(input)\r\n\t\tif @layers[0].neurons.size() != input.size\r\n\t\t\tputs \"Error: the number of inputs must be equal to the number of neurons in the input layer\"\r\n\t\t\treturn -1\r\n\t\tend\r\n\t\t@input = input\r\n...
8797416fc5454ebb682f03073cd51771
Setter and Getter methods for setting and getting the data
[ { "docid": "dd137093e7b2badb9e00c82d991a7868", "score": "0.0", "text": "def rname\n\t\treturn @aname\n\tend", "title": "" } ]
[ { "docid": "d370d30919b2788711612fb42fb554db", "score": "0.7268029", "text": "def data=(data)\n @data = data\n end", "title": "" }, { "docid": "313591e2fba7b36cd125ba181f467286", "score": "0.72338617", "text": "def get_data\n response = proxy.get_data(handle)\n self.upd...
4d22676d823545bdfdba676cbf07a6fb
Attempts to set attributes on the object only if they've been explicitly defined by the class. Note that this will also attempt to interpret any "metadata" properties as additional attributes.
[ { "docid": "ba38bafee5397dd2a4e351c53a2de5a8", "score": "0.59026724", "text": "def attributes=(attributes)\n if attributes\n attributes.each do |attribute, value|\n attribute = attribute.to_s\n if attribute == 'metadata'\n self.attributes = value\n else\...
[ { "docid": "0e180f077fccf00acedf30c39ece394c", "score": "0.6633638", "text": "def attr_accessor(*args)\n check_overwrite_shadow_attrs(*args)\n super\n end", "title": "" }, { "docid": "b749f4c8d48efcea5046fd465ee81619", "score": "0.6587278", "text": "def set_a_attributes\...
7669d1ad8dbfcf97eb7193ae25910a76
CustomFields::NumericField.ceil_to(value, decimal) > decimal Get the smallest decimal number greater than or equal to value. CustomFields::NumericField.ceil_to(10.1, 0.1) => 10.1 CustomFields::NumericField.ceil_to(10.9, 0.1) => 10.9 CustomFields::NumericField.ceil_to(10.01, 0.1) => 10.1 CustomFields::NumericField.ceil_...
[ { "docid": "4baf0fc86030a4abba4dc3a7f7058f5b", "score": "0.6734", "text": "def ceil_to(value, significance)\n round_to_significance(value, significance, :ceil)\n end", "title": "" } ]
[ { "docid": "4f5b0805b06766ce1bdcc96ba34312b5", "score": "0.7392861", "text": "def ceil(value, decimal)\n round_to_significance(value, decimal_to_significance(decimal), :ceil)\n end", "title": "" }, { "docid": "3a3c1d797b8d361edd704d35688f3b75", "score": "0.71565264", "text": ...
79cd0b1cc06f44bd0a9e62ed35863ab7
DELETE /partnerships/1 DELETE /partnerships/1.json
[ { "docid": "10709c3314e865a7332eade7cfe54103", "score": "0.7975766", "text": "def destroy\n @partnership.destroy\n respond_to do |format|\n format.html { redirect_to partnerships_url, notice: 'Partnership was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",...
[ { "docid": "39e1a7e7319c8d4891f09c7913313b92", "score": "0.8190661", "text": "def destroy\n @partnership.destroy\n respond_to do |format|\n format.html { redirect_to partnerships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d2865c73a7d...
bf6cb1e676f40dd68007cfd11cdb4e88
We can keep references to all "belong_to" properties
[ { "docid": "9d02ffe5b9453e46528c2ebd6e111ad7", "score": "0.0", "text": "def references\n @references ||= {}\n end", "title": "" } ]
[ { "docid": "63dc331c694bf6f7d6b288501af2815c", "score": "0.670256", "text": "def references_from_model\n target = target_class.reflect_on_all_associations.select(&:belongs_to?)\n source_names = source_class.reflect_on_all_associations.reject(&:collection?).map(&:name)\n\n target.sel...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "4b15be0be20cab4ab0d70f045c758db2", "score": "0.0", "text": "def capsule_learner_params\n params.require(:capsule_learner).permit(:capsule_class_id, :name, :email, :phone_number, :educational_status, :company_name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74954116", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6956924", "text": "def strong_params\n params.require(:request).permit(param_whit...
513cd614799ce64dbec22872d2173ebb
GET /gym_workouts/new GET /gym_workouts/new.json
[ { "docid": "8a8d94565c698ea6982f7217da035dd2", "score": "0.78425795", "text": "def new\n @gym_workout = GymWorkout.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @gym_workout }\n end\n end", "title": "" } ]
[ { "docid": "2c8a2416def643328867ae6f217748a3", "score": "0.78028053", "text": "def create\n @gym_workout = GymWorkout.new(params[:gym_workout])\n\n respond_to do |format|\n if @gym_workout.save\n format.html { redirect_to @gym_workout, :notice => 'Gym workout was successfully created.'...
84cb8e765fd6ffd7865a3ac4e8dd8e16
if block returns true, the argument passed into yield, will exit loop and will be the return value of the method. if false, continue to next element.
[ { "docid": "0702036fcff58c0514240cb1632f1775", "score": "0.0", "text": "def my_find(collection)\ni = 0\nwhile i < collection.length #while i < 100\n return collection[i] if #if true\nyield(collection[i]) #yield(1)\n i = i + 1\nend\nend", "title": "" } ]
[ { "docid": "526edb2acfd35320b21b8d800c58829c", "score": "0.7130692", "text": "def continue\n and_then do |value|\n value if yield value\n end\n end", "title": "" }, { "docid": "7eccd34a14a549c3d0246b0408f784ad", "score": "0.6831793", "text": "def iterating_block?(...
f27e0d7009e8bf89b137700052596be7
read specific row by id
[ { "docid": "9fdd0a40dcac6f01f1039ad10873a02b", "score": "0.0", "text": "def view_event(id)\n result = CONNECTION.execute(\"SELECT name FROM check_splitter WHERE id = #{id};\")\n result.first[\"name\"]\n # result[0][\"name\"]\nend", "title": "" } ]
[ { "docid": "7e584efa57065751b22ea7f4bfc5630b", "score": "0.77081954", "text": "def get_row_by_id(id)\n require_relative 'datarow'\n DataRow.new(@api, @api.do_request(\"GET\", get_base_api_path() + \"/rows/#{id}\"))\n end", "title": "" }, { "docid": "157f1bb4de25dabe565c90515...
30a3634c8b8eb1b929bd9971b14e613e
sub classes to implement logic of processing hook here Author: Puneet Date: 12/01/2018 Reviewed By:
[ { "docid": "8ed875317acaf0556f9d09a01e04d24f", "score": "0.7478463", "text": "def process_hook\n fail 'sub class to implement'\n end", "title": "" } ]
[ { "docid": "a606ff314b37ba47be08b757ff538b5e", "score": "0.7507942", "text": "def processor; end", "title": "" }, { "docid": "a606ff314b37ba47be08b757ff538b5e", "score": "0.7507942", "text": "def processor; end", "title": "" }, { "docid": "abc1e6e900188ecb8541263ff4688363...
84c66203c7a1e7ea15a695626bbebc5a
DELETE /villas/1 DELETE /villas/1.json
[ { "docid": "27293281dd5881ca4f5ff6eec14f0eec", "score": "0.6948375", "text": "def destroy\n @villa = Villa.find(params[:id])\n @villa.destroy\n\n respond_to do |format|\n format.html { redirect_to villas_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.72441065", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": ...
8dc4fd38897b14b5c0b2d55a1d06bb6a
PATCH/PUT /provider_masters/1 PATCH/PUT /provider_masters/1.json
[ { "docid": "d14c260f3ccd8875cb6f126fcaa3dac4", "score": "0.65308434", "text": "def update\n respond_to do |format|\n if @provider_master.update(provider_master_params)\n @provider_masters = ProviderMaster.all.paginate(:page => params[:page], :per_page => 5).order('id desc')\n forma...
[ { "docid": "f92e7cd0c53f670ebb9fcf0c1bf459d9", "score": "0.6445884", "text": "def update\n respond_to do |format|\n if @service_prov_extra_info.update(service_prov_extra_info_params)\n format.html { redirect_to @service_prov_extra_info, notice: 'Service prov extra info was successfully up...
58ea0f4999b6847d4a869703352bc223
Optimization Hash that maps [x, y] positions to states
[ { "docid": "079d9db8f930db2e16294530de07cff9", "score": "0.0", "text": "def board_hash\n @board_hash ||= create_board_hash\n end", "title": "" } ]
[ { "docid": "745d63298aec8e82d2ff6dc94b903bd2", "score": "0.64578384", "text": "def hash\r\n\t\t[@x,@y].hash\r\n\tend", "title": "" }, { "docid": "226867762a59c5f604e4958d3c1a974d", "score": "0.64569277", "text": "def hash_value\n result = 0\n for i in 0..8 do\n result *= 3...
d9211fb7cce892b63d10f44402bd777f
Delegate validate to the appropriate RuleSet
[ { "docid": "fcdb3a3572f50df616da415d5b1b530e", "score": "0.0", "text": "def validate(resource, context_name = default_context_name)\n context(context_name).validate(resource)\n end", "title": "" } ]
[ { "docid": "c3abef022c34dbd4232f69c1141b4cd7", "score": "0.6916912", "text": "def validation_rules\n @validation_rules ||= ContextualRuleSet.new\n end", "title": "" }, { "docid": "496402777cc0e68a72c5642c20d55679", "score": "0.68199384", "text": "def validate\n @errors...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "fbc97266fcd3d58007ba30b8eb3ca0ea", "score": "0.0", "text": "def update!(**args)\n @medium = args[:medium] if args.key?(:medium)\n end", "title": "" } ]
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.701199", "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", "ti...