Search result of: ty so
Total 30 records
Sockets 支持两种事件驱动机制:Linux 里的 epoll 以及 FreeBSD 里的 kqueue 支持异步写操作 灵活的事件定时器 SO_REUSEPORT 端口重用 核心设计多线程/Go 程模型主从多 Reactors 模型 gnet 重新设计开发了一个新内置的多线程/Go 程模型:『主从多 Reactors』,这也是 netty 默认的线程模型,下面是这个模型的原理图: 它的运行流程如下面的时序图: 主从多 Reactors + 线程/Go 程池
Type:指定了 MIME 类型的 HTML(text/html),编码类型是 UTF-8 第三部分:空行,消息报头后面的空行是必须的 第四部分:响应正文,服务器返回给客户端的文本信息。 空行后面的 HTML 部分为响应正文。 状态码 状态代码有三位数字组成,第一个数字定义了响应的类别,共分五种类别: 1xx:指示信息–表示请求已接收,继续处理 2xx:成功–表示请求已被成功接收、理解、接受 3xx:重定向–要完成请求必须进行更进一步的操作
Socket.getaddrinfo(host, nil) return nil if ! ip || ! ip[0] || ! ip[0][2] ip[0][2] rescue => e nil end def test_connect_ip ip = get_ip_of_host(@uri.host) http = Net::HTTP.new(ip, @uri.port) http.use
sounds good in conversation. Really. “Select a Product from products.” And “Order has_many :line_items.” The intent is to bridge programming and conversation by creating a domain language that can be shared by both
最近我发现 RubyGems 以及合并了 Cargo builder 支持的 PR,也就意味着,我们除了可以用 C 来写 RubyGem 扩展之外,也可以用 Rust
type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive
TYPE=Ethernet BOOTPROTO=static #启用静态IP地址 DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_FAILURE_FATAL=no NAME=eno16777736
你还在用 ImageMagick 生成网站的上传图片缩略图吗?其实有更好的方法一部到位,简单有效。 现而今有非常多的云存储服务支持图片空间,并根据设定的规则来生成空间里面的图片缩略图了,例如 UpYun、Aliyun OSS 都支持。 但有时候我们会因为一些其他的考虑(例如:价格因素
type: {in: %w[image/jpeg image/gif image/png], message: "must be a valid image format" }, size: { less_than: 5.megabytes, message: "should be less than 5MB" } # 返回调整尺寸后的图像,供显示 def display_image image.variant(resize_to_limit
开发环境 (Ubuntu Kylin 16.04 LTS) redcarpet 安装失败,找遍 stackoverflow 和 redcarpet git repository issues,尝试了诸多方法后
Software Development Kit)来访问和管理又拍云存储中的数据对象,例如上传和下载文件、删除和复制文件等。 又拍云支持的 S3 API 如下图所示: 签名认证和 API 路径 又拍云存储同时兼容 AWS Signature Version 2 和 AWS Signature Version 4,均实现了请求头签名和参数签名方式。 又拍云存储的路径风格格式为:https://s3.api.upyun.com//,bucket 名字作为路径使用的一部分,类似于又拍云存储目前使用的 RESTful API 路径形式。 虚拟主机风格格式为
type 'test123' sleep 1 id(login).click end Given(/^退出登录$/) do puts '回到主页' id(BUTTON_MAPPING['回到主页']).click if exists { id(BUTTON_MAPPING['回到主页']) } bar_left = BUTTON_MAPPING['左上'] wait do puts '左上
源地址:https://a-wing.top/ruby/2018/09/26/rails_activestorage_backend.html ActiveStorage 是 Rails 5.2 的一个新特性 ,建议你先去读完官方的文档再回看来这个 https://guides.rubyonrails.org/active_storage_overview.html ▾ activestorage-5.2.1
背景 有需求要使用新版本的 rails、puma、sidekiq,今天对升级做一下基础测试。 还有多个使用 systemd 启动的 puma 做一下部署测试,看一下部署过程中会不会产生干扰。 旧项目的 rails、puma
TypeScript 进行编码 良好的团队合作和沟通能力 加分项 有开源项目的经验 有区块链相关经验 开源库维护者优先 高级前端开发工程师 工作内容: 负责相关产品的前端技术方案设计选型 负责将服务端数据与表现层交互渲染 负责区块链周边工具开发 最低要求: 至少三年程序开发经验 熟悉跨平台 UI 框架 熟悉现代前端框架响应模型 拥有良好的工程能力,熟悉前端开发流程中的单元测试, 集成测试, 自动化测试等技术 加分项: 熟悉区块链技术原理,或者有 Dapp 开发经验 有浏览器插件或桌面应用开发经验 了解 Rust 语言 为开源社区有过贡献项或者拥有自己的个人博客 技术文档工程师 工作内容: 研究
type time total %total %time avg controller 08:02.721 2822 39.04 34.29 00:00.171 service 05:56.686 1363 18.86 25.34 00:00.261 model
Type | Collation | Nullable | Default ------------+--------------------------------+-----------+----------+---------------------------------------- id | bigint | | not null | nextval('categories_id_seq'::regclass) name | character varying | | | created_at | timestamp(6) without time zone | | not null | updated_at | timestamp(6) without time zone | | not null
solid; } .header { @include rounded_borders(#336699, 3px); } 实现跨浏览器透明度 //Cross browser Opacity mixin @mixin opacity($opacity) { filter: alpha(opacity=#{$opacity*100}); // IE 5-9+ opacity: $opacity; } .h1 { @include opacity(0.6); } 迭代 (each) 在主流语言中,迭代属于循环实现的一种功能,例如 ruby
so-called middleware) into a single method call. 大意:Rack 是个 api,这个 api 会调用一个方法,它是 call()。 什么是 Rack Application? A Rack application is an Ruby object (not a class) that responds to call
soft link 支持不好,因此需要同时映射 live 和 archive 目录。 更新 nginx 配置,启用 HTTPS: server { listen 80; server_name example.com www.example.com; # 重定向到https location / { rewrite ^ https://$host$request_uri? permanent; } # 高优先级,仅用于更新证书 location ~ /.well-known/acme-challenge { allow all; root
Typhoeus.get(url, timeout: 3) body = resp.body puts "Products result: #{body}" end end end 接口进行了参数验证和 token 方式的权限认证,保证一定的安全性。实际生产环境使用 https 会更好。 鉴权的算法是: str = APP_ID + timestamp.to_s token = OpenSSL::HMAC.hexdigest("SHA1", APP_KEY, str) 然后对 token
source 'http://rubygems.org' gem 'rails', '3.0.6' gem 'rmagick', '1.15.12', :require => 'RMagick' gem 'rspec-rails' /////rake rails:upgrade:gems结果结束///// ②确保 rails2 中使用的 plugin、在 rails3 中有替代方案. 常用的 Plugin 在这里都能找到对应的升级版本。(http://rubygems.orghttp://railsplugins.org、) 例: rails2 /vendor/plugins/will_paginate rails3
somewhat arbitrary. Functions in Javascript create a scope or closure. Variables are only accessible within the closure. However, every function invocation creates a function object which can have methods attached to it. Those function
something went wrong。 QQ 则是授权完毕以后,转到了 sign_up 页面提示提示 Invalid credentials 主要的 code 都是按照 railscasts 上面写的 真的也不知道怎么 debug 了…… 因为我觉得用的代码都是一样的诶……(唯一就是 twitter 站点里面填的 callbacks URL 是 127.0.0.1 这个,QQ 和微博都是填的本身的 heroku 的网站,但是这个应该是没有影响的)。然后就是 weibo
software components together, while imperative code is excellent for expressing business logic. 简单翻译一下,UI 代码适合于用声明式,业务逻辑适合于用命令式代码。 It is a very good idea to decouple DOM manipulation from app logic. This dramatically improves the testability
话说我之前有在 oDesk 注册过,最近收到他们一个邮件,被邀请参加一个 test 什么的,觉得好玩就去了,结果没搞定,大家觉得愉♂悦的话可以帮忙瞧瞧。 如果之前有人发过,就让他沉了吧…… 2 道题目