rem

移动端页面适配———多方案解析

久未见 提交于 2019-12-03 10:28:07
移动端页面适配———多方案解析 在移动互联网快速发展的今天,手机的种类和尺寸越来越多,作为前端的小伙伴们可能会越来越头疼,但又不得不去适配一款又一款的新机型。对于移动端适配,不同的公司、不同的团队有不同的解决方案。我在项目中也用了一部分解决方案,也看到了一些解决方案,对比下,总结一些自己的理解,希望对各位有帮助,找到最适合你们项目的适配方案。 下面是一些基础概念的讲解,帮助理解各种适配方案实现。 像素: 1、物理像素(设备像素) 屏幕的物理像素,又被称为设备像素,他是显示设备中一个最微小的物理部件。任何设备屏幕的物理像素出厂时就确定了,且固定不变的。 2、设备独立像素 设备独立像素也称为密度无关像素,可以认为是计算机坐标系统中的一个点,这个点代表一个可以由程序使用的虚拟像素(比如说CSS像素),然后由相关系统转换为物理像素。 3、设备像素比 设备像素比简称为dpr,其定义了物理像素和设备独立像素的对应关系 设备像素比 = 物理像素 / 设备独立像素 以iphone6为例: iphone6的设备宽和高为375pt * 667pt,可以理解为设备的独立像素,而其设备像素比为2.固有设备像素为750pt * 1334pt 通过:window.devicePixelRatio获得。 设备像素比是区别是否是高清屏的标准,dpr大于1时就为高清屏,一般情况下dpr为整数

Why does the cmd.exe shell on Windows fail with paths using a forward-slash ('/'') path separator?

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Just when I'd thought I'd seen it all with Windows path issues, I've now encountered a case that only fails when '/' (forward-slash) is used as the path separator is used: C:\temp\tcbugs>mkdir "dir1 with spaces" C:\temp\tcbugs>echo hi > "dir1 with spaces"\foo.txt C:\temp\tcbugs>type "dir1 with spaces\foo.txt" hi C:\temp\tcbugs>type "dir1 with spaces/foo.txt" The system cannot find the file specified. What is particularly interesting about this is that it appears to be specific to the cmd.exe shell and doesn't occur in PowerShell (nor

Six seconds warmup time for the first entity framework 6 nonquery

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: From my integration test: // Act Stopwatch w = new Stopwatch(); w.Start(); userService.Create(userDTO); w.Stop(); public void Create(UserDTO userDTO) { var user = userDTO.ToEntity(); _context.Entry(user).State = EntityState.Added; _context.SaveChanges(); } 6,2 seconds to do an "sql insert" is crazy. I already see the application users complaining when they first open a project which they use the whole year. So everyday they have to wait 6 seconds... I thought the warm up time in EF6 has improved? Is there anything I can do to improve this

Can producer find the additions and removals of brokers in Kafka 0.8?

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: We knowthat, in kafka 0.7, we can specify zk.connect for producer, so producer can find the additions and removals of broker. But in kafka 0.8, we can't specify zk.connect for producer. Can producer in kafka 0.8 find that? If not, the scalability of the system is not worse than the 0.7 version? 回答1: You can still use a ZooKeeper client to retrieve the broker list: ZkClient zkClient = new ZkClient ( "localhost:2108" , 4000 , 6000 , new BytesPushThroughSerializer ()); List < String > brokerList = zkClient . getChildren ( "/brokers

rem 适配布局 + LESS + 媒体查询

三世轮回 提交于 2019-12-03 07:39:24
1. rem 基础  rem 是一个相对单位,类似于 em ,em 是父元素字体大小。  em 是相对于父元素 的字体大小来说的  rem 是相对于 html 元素 字体大小来说的  rem 优点 就是可以通过修改 html 里面的文字大小来改变页面中元素的大小可以整体控制  比如:根元素(html )设置的 font-size=12px;非根元素设置 width:2rem;则换成px 表示 24px(12px*2rem) 2. 媒体查询(@media)  @media 可以针对不同的屏幕尺寸设置不同的样式  语法规范:   @media mediatype and | not | only (media feature){     CSS - Code;   } 用 @media 开头 mediatype 媒体类型     all:用于所有设备,     print:用于打印机和打印预览,     screen:用于电脑屏幕,平板电脑,手机等 关键字 and not only     and:可以将多个媒体特性连接到一起,相当于“且”的意思     not:排除某个媒体类型,相当于“非”的意思,可以省略     only:指定某个特定的媒体类型,可以省略 media feature 媒体特性 必须有小括号包含     width:定义输出设备中页面可见区域的宽度     max

前端开发入门到实战:通过 rem 和 vw 实现页面等比例缩放自适应

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 04:16:18
一、rem 和 vw 简介 1. rem rem 是相对长度单位,是指相对于根元素(即html元素)font-size(字号大小)的倍数。 浏览器支持: Caniuse 示例 若根元素 font-size 为 12px html { font-size: 12px; } h1 { font-size: 2rem; /* 2 × 12px = 24px */ } p { font-size: 1.5rem; /* 1.5 × 12px = 18px */ } div { width: 10rem; /* 10 × 12px = 120px */ } 若根元素 font-size 为 16px html { font-size: 16px; } h1 { font-size: 2rem; /* 2 × 16px = 32px */ } p { font-size: 1.5rem; /* 1.5 × 16px = 24px */ } div { width: 10rem; /* 10 × 16px = 160px */ } 2. vw vw 是相对长度单位,相对于浏览器窗口的宽度,浏览器窗口宽度被均分为100个单位的vw 浏览器支持: Caniuse Opera Mini不支持该属性 示例 当浏览器窗口宽度为320px时,1vw = 3.2px p { font-size: 5vw; /

Iterating through folders and files in batch file?

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here's my situation. A project has as objective to migrate some attachments to another system. These attachments will be located to a parent folder, let's say " Folder 0 " (see this question's diagram for better understanding), and they will be zipped/compressed. I want my batch script to be called like so: BatchScript.bat "c:\temp\usd\Folder 0" I'm using 7za.exe as the command line extraction tool. What I want my batch script to do is to iterate through the " Folder 0 "'s subfolders, and extract all of the containing ZIP files into their

MySQL ODBC 32 vs 64 bit

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a 32-bit application that must run on a Windows x64 server using a 64-bit version of MySQL. Should I use a 32-bit ODBC driver or a 64-bit ODBC driver? Or should I install a 32-bit version of MySQL too? 回答1: You would need to install a 32-bit SQL and ODBC driver seeing as how your application is in 32-bit. For compatibility reasons. I am still searching, will edit. ** EDIT To work around this problem, use the appropriate version of the ODBC Administrator tool. If you build and then run an application as a 32-bit application on a 64-bit

Automount EBS volume in Amazon EC2 Windows Instance

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Does anyone know how to auto-mount an Elastic Block Storage (EBS) volume when starting a Windows 2003 instance in Amazon's Elastic Compute Cloud (EC2)? 回答1: Setup: Make sure the EBS volume is formatted and labeled (in the example I used the label PDRIVE). Setup a drive mapping using Ec2ConfigServiceSettings.exe Install Java on the instance Install the EC2 API command line tools Install a copy of your cert and private key Install a copy of curl.exe (open source tool) You can use the group policy editor to set this script as your

Search for a list of words in a file, then find those words on another replacing the whole line with Class=ShipDummy,replacing the 2 lines below it

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'd like to search for a list of words from an external list (simple each word on a line) which we'll call "List.txt", and search for them in a file (C:\Users\P Ditty\Documents\SH3\data\cfg\Backups_SCR*.clg) (matching the whole word, even if it's inside another, and matching case) , then if they are there find those words on another file(Campaign_SCR.mis.tmp) (matching the whole word even if its inside another, matching case) replacing the whole line in (Campaign_SCR.mis.tmp) with Name=ShipDummy ONLY if the line starts with "Name=". After