- 浏览: 109689 次
- 性别:
- 来自: 上海
文章列表
重温ruby tap用法
- 博客分类:
- Rubyist
ball = 5
seeds = [].tap{|s| (0..19).to_a.each{|i| s << 10*i + ball}}
p seeds
s 是 seeds的self
stat = {}.tap{|s| (01..33).to_a.each{|i| s[i] = 0 }}
puts stat
自定义的ruby struct怎么重载方法
- 博客分类:
- Rubyist
set_1 = (01..11).to_a
set_2 = (12..22).to_a
set_3 = (23..33).to_a
# 23合并,随机取出3个
# 随机20次
# 20个结果做Comfirm
# 不能都属于set_2 也不能都属于set_3
set = set_2 + set_3
Comfirm = Struct.new("Comfirm", :is_legal, :data) do
def inspect
"#{data.inspect} Comfirmed #{is_legal}" ...
ls
ls | foreach-object {echo $_.LastWriteTime}
ls | foreach-object {$_.LastWriteTime = $_.LastWriteTime.AddDays(1)}
ls | foreach-object {$_.LastWriteTime = '09/24/2018 17:13:36'}
在mysql中存在着各种utf8编码格式,如下表:
1)utf8_bin
utf8_bin将字符串中的每一个字符用二进制数据存储,区分大小写。
2)utf8_general_ci
utf8_genera_ci不区分大小写,ci为case insensitive的缩写,即大小写不敏感。
3)utf8_general_cs
utf8_general_cs区分大小写,cs为case sensitive的缩写,即大小写敏感。
执行如下命令:
create table test_bin (
name varchar(32) not null prim ...
很明显,php不支持$_PUT
PUT方法提交的简单form可以
parse_str(file_get_contents('php://input'), $data);
Content-Type:multipart/form-data; 这样的form通过put方法提交就很尴尬了
解决这个问题得有思路
先去找找开源代码
https://stackoverflow.com/questions/9464935/
实际使用发现有bug,贴一下修改后的
// 解析 http 请求类型是 multipart/form-data 的数据
function ...
很久以前,form的post需要刷新页面。后来有人发明了ajax,又有人开源了jquery,我们的form可以ajax post而无须刷新页面。 var url, method, data, element = $('form'); url = element.attr('action'); method = element.attr('method'); data = $(element[0].elements).serializeArray(); $.ajax({ url:url, type:method, data:data });但存在 ...
server {
listen 80;
server_name qianguo.com www.qianguo.com;
rewrite ^(.*)$ https://$host$1 permanent;
}
https://www.cnblogs.com/yun007/p/3739182.html
更新新的语法
server {
listen 80;
server_name qianguo.com www.qianguo.com;
return 301 https://$server_na ...
跟着闾丘露薇认识
http://news.ifeng.com/a/20180317/56828895_0.shtml
http://www.china.com.cn/chinese/2003/Apr/323313.htm
破旧立新这个词很性感
http://www.chinadaily.com.cn/interface/toutiao/1120783/cd_18445602.html
框架 ->MVW Angular
组件 ->DTD <brand new>
API ->Service
js语法 ->阅读简易教程::Q&A
sample_4.0
------pages/index/index.wxml------
<button bindtap='kaka'>{{r_count}}</button>
------pages/index/index.js------
var obj={
//默认数据结构data,初始化DTD的变量
data:{r_ ...
https://github.com/RubaXa/Sortable
http://rubaxa.github.io/Sortable/ ListB
# dism /get-wiminfo /wimfile:install.wim
dism /mount-wim /wimfile:install.wim /name:"Windows 7 ULTIMATE" /mountdir:new_wim
dism /image:new_wim /add-package /packagepath:Windows6.1-KB2670838-x64.msu
IE11-Windows6.1-x64-zh-cn.exe /x:ie11
dism /image:new_wim /add-package /packagepath: ...
1.网络和共享中心 - 【左边】更改高级共享设置
2.启动网络发现+启动文件和打印机共享+关闭密码保护共享
其他选项默认,保存
3.在D盘随便建一个文件夹,右键属性,点共享,点共享。
4.添加everyone,设置读写,选共享即可。
1K = 1024
1M = 1048576
1G = 1073741824
4G = 4294967296
fsutil file createnew blank_space_4G4.bs 4294967296
Access to Font at 'http://honor.xxx.com/DIST/bootstrap/fonts/glyphicons-halflings-regular.woff2' from origin 'http://rlfund.yyy.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://rlfund.yyy.com' is therefore not allowed ...