jpg在线合并jpg_JPG如何运作
jpg在线合并jpg
by Colt McAnlis
通过Colt McAnlis
JPG如何运作 (How JPG Works)
The JPG file format was one of the most technologically impressive advancements to image compression to come on the scene in 1992. Since then, it’s been a dominant force in representation of photo quality images on the internet. And for good reason. Much of the technology behind how JPG works is exceptionally complex, and requires a firm understanding of how the human eye adjusts to the perception of colors and edges.
JPG文件格式是1992年出现的最先进的图像压缩技术之一。从那时起,它就成为Internet上代表照片质量图像的主导力量。 并且有充分的理由。 JPG的工作原理背后的许多技术异常复杂,需要对人眼如何适应颜色和边缘的感知有深刻的了解。
And since I’m into that kinda stuff (and you are too, if you’re reading this), I wanted to break down how JPG encoding works, so we can better understand how to make smaller JPG files.
而且由于我喜欢这种东西(如果您正在阅读本文,您也是如此),我想细分JPG编码的工作方式,以便我们更好地了解如何制作较小的JPG文件。
要点 (THE GIST)
The JPG compression scheme is broken down into several phases. The image below describes them at a high level, and we’ll walk through each phase below.
JPG压缩方案分为几个阶段。 下图从高层次描述了它们,我们将逐步介绍下面的每个阶段。
色彩空间转换 (Colorspace Conversion)
One of the key principles of lossy data compression, is that human sensors are not as accurate as computing systems. Scientifically, the human eye only has the physical ability to distinguish about 10 million different colors. However, there’s lots of things that can influence how the human eye perceives a color; perfectly highlighted with color illusions, or the fact that this dress broke the internet. The gist is that the human eye can be nicely manipulated with respect to the colors that it perceives.
有损数据压缩的关键原理之一是人体传感器不如计算系统准确。 从科学上讲,人眼仅具有分辨大约一千万种不同颜色的物理能力。 但是,有很多因素会影响人眼对颜色的感知方式。 色彩错觉完美突显出来,或者这件衣服打破了互联网的事实。 要点是,人眼可以感知到的颜色得到很好的控制。
Quantization is a form of this effect in lossy image compression, however JPG takes a different approach to this : color models. A color space is a specific organization of colors, and its color model represents the mathematical formula for how those colors are represented (e.g. triples in RGB, or quadruples in CMYK).
量化是这种效果在有损图像压缩中的一种形式,但是JPG采用了另一种方法: 颜色模型 。 颜色空间是颜色的特定组织,其颜色模型表示这些颜色表示方式的数学公式(例如RGB中的三倍或CMYK中的四倍)。
What’s powerful about this process is that you can convert from one color model, to another , meaning you can change the mathematical representation of a given color, with a completely different set of numerical values.
此过程的强大功能是,您可以从一种颜色模型转换为另一种颜色模型,这意味着您可以使用一组完全不同的数值来更改给定颜色的数学表示。
For example, below is a specific color, and it’s representation in RGB and CMYK color models, they are the same color to the human eye, but can be represented with a different set of numerical values.
例如,下面是一种特定的颜色,它以RGB和CMYK颜色模型表示,它们与人眼是相同的颜色,但是可以用一组不同的数值表示。
JPG converts from RGB to Y,Cb,Cr color model; Which comprises of Luminance (Y), Chroma Blue (Cb) and Chroma Red (Cr). The reason for this, is that psycho-visual experiments (aka how the brain works with info the eye sees) demonstrate that the human eye is more sensitive to luminance than chrominance, which means that we may neglect larger changes in the chrominance without affecting our perception of the image. As such, we can make aggressive changes to the CbCr channels before the human eye notices.
JPG从RGB转换为Y,Cb,Cr颜色模型; 其中包括亮度(Y),色度蓝(Cb)和色度红(Cr)。 原因是,心理视觉实验(也就是大脑如何利用眼睛看到的信息进行工作)表明,人眼对亮度的敏感度要高于色度 ,这意味着我们可以忽略色度的较大变化而不会影响色度。对图像的感知。 因此,我们可以在人眼察觉之前对CbCr通道进行积极的更改。
下采样 (Downsampling)
One of the interesting results of the YCbCr color space, is that the resulting Cb/Cr channels have less fine-grained details; they contain less information than the Y channel does.
YCbCr颜色空间有趣的结果之一是,生成的Cb / Cr通道具有较少的细粒度细节。 它们包含的信息少于Y频道。
As a result, the JPG algorithm resizes the Cb and Cr channels to be about ¼ their original size (note, there’s some nuance in how this is done that I’m not covering here…), which is called downsampling.
结果,JPG算法将Cb和Cr通道的大小调整为它们原始大小的1/4(请注意,在此方面有一些细微差别,我在此不做介绍……),这称为缩减采样 。
What’s important to note here is that downsampling is a lossy compression process ( you won’t be able to recover the exact source colors, but only a close approximation), but it’s overall impact on the visual components of the human visual cortex is minimal. Luma(Y) is where the interesting stuff is and since we’re only downsampling the CbCr channels, the impact on the visual system is low.
这里需要注意的重要一点是,下采样是有损的压缩过程(您将无法恢复确切的源颜色,而只能恢复近似值),但是对人类视觉皮层的视觉组件的总体影响很小。 Luma(Y)是有趣的地方,并且由于我们仅对CbCr通道进行下采样,因此对视觉系统的影响很小。
图像分为8x8像素块 (Image divided into 8x8 blocks of pixels)
From here on out, JPG does all operations on 8x8 blocks of pixels. This is done because we generally expect that there’s not a lot of variance over the 8x8 blocks, even in very complex photos, there tends to be some self similarity in local areas; this similarity is what we’ll take advantage of during our compression later.
从现在开始,JPG会在8x8像素块上执行所有操作。 这样做是因为我们通常期望8x8块之间没有太大差异,即使在非常复杂的照片中,局部区域也往往存在一些自我相似之处。 这种相似性是我们稍后压缩时将要利用的优势。
It’s worth noting that at this point, we’re introducing one of the first common “artifacts” of JPG encoding. “Color bleeding” is where colors along sharp edges can “bleed” onto the other side. This is because the chrominance channels, which express the color of pixels, have had each block of 4 pixels averaged into a single color, and some of these blocks cross the sharp edge.
值得注意的是,在这一点上,我们正在介绍JPG编码的第一个常见“工件”。 “颜色渗色”是指尖锐边缘的颜色可以“渗出”到另一侧。 这是因为表示像素颜色的色度通道已将每个4像素的块平均为一种颜色,并且其中一些块穿过了锐利的边缘。
离散余弦变换 (Discrete Cosine Transform)
Up to this point, things have been pretty tame. Colorspaces, downsampling, and blocking is simple stuff in the world of image compression. But now… now the real math shows up.
到现在为止,事情已经相当温和了。 在图像压缩领域,色彩空间,下采样和分块是很简单的事情。 但是现在……现在出现了真正的数学运算。
The key component of the DCT transform, is that it assumes that any numeric signal can be recreated using a combination of cosine functions.
DCT变换的关键组成部分是,它假定可以使用余弦函数的组合来重新创建任何数字信号。
For example, if we have this graph below:
例如,如果下面有此图:
You can see that it’s actually a sum of cos(x)+cos(2x)+cos(4x)
您可以看到它实际上是cos(x)+ cos(2x)+ cos(4x)的总和
Perhaps a better display of this, is the actual decoding of an image, given a series of cosine functions over a 2D space. To show this off, I present one of the most amazing GIFs on the internet: encoding of a 8x8 block of pixels using cosines in a 2D space:
考虑到二维空间上的一系列余弦函数,对此的更好显示可能是图像的实际解码。 为了证明这一点,我展示了互联网上最令人惊叹的GIF之一:在2D空间中使用余弦对8x8像素块进行编码:
What you’re watching here is the reconstruction of an image (leftmost panel). Each frame, we take a new basis value (right panel) and multiply it by a weight value (right panel text) to produce the contribution to the image (center panel).
您在这里看到的是图像的重建(最左侧的面板)。 在每一帧中,我们采用一个新的基准值(右侧面板),然后将其乘以权重值(右侧面板文本)以产生对图像的贡献(中央面板)。
As you can see, by summing various cosine values against a weight, we can reconstruct our original image (pretty well...)
如您所见,通过将各种余弦值与权重相加,我们可以重建原始图像(非常好...)
This is the fundamental background for how the Discrete Cosine Transform works. The idea is that any 8x8 block can be represented as a sum of weighted cosine transforms, at various frequencies. The trick with this whole thing, is figuring out what cosine inputs to use, and how they should be weighted together.
这是离散余弦变换如何工作的基本背景。 这个想法是, 任何 8x8块都可以表示为各种频率下的加权余弦变换之和。 整件事的窍门是弄清楚要使用哪些余弦输入,以及如何将它们加权在一起。
Turns out the “what cosines to use” problem is pretty easy; After a lot of testing, a set of cosine values were chosen to produce the best results, they are our basis functions and visualized in the image below.
事实证明,“ 使用什么余弦”问题非常简单; 经过大量测试,选择了一组余弦值以产生最佳结果,它们是我们的基本函数,并在下图中可视化。
As far as the “how they should be weighted together” problem, simply (HA!) apply this formula.
对于“如何将它们加权在一起”问题,只需简单地使用(HA!)这个公式即可。
I’ll spare you what all those values mean, you can look them up on the wikipedia page.
我将保留所有这些值的含义,您可以在Wikipedia页面上查找它们。
The basic result is that for an 8x8 block of pixels in each color channel, applying the above formula and basis functions will generate a new 8x8 matrix, which represents the weights to be used during reconstruction. Here’s a graphic of the process:
基本结果是,对于每个颜色通道中的8x8像素块,应用上述公式和基函数将生成一个新的8x8矩阵,该矩阵表示重建期间要使用的权重。 这是过程的图形:
This matrix, G, represents the basis weights to use to reconstruct the image (the small decimal value in the lower right side of the animation above). Basically, for each basis, we multiply it by the weight in this matrix, sum the whole thing together, and get our resulting image.
该矩阵G表示用于重建图像的基本权重(上方动画右下角的小十进制值)。 基本上,对于每个基础,我们将其乘以该矩阵中的权重,将整个事物相加在一起,得到最终的图像。
At this point, we’re no longer working in color spaces, but rather directly with the G Matrix (basis weights), all further compression is done on this matrix directly.
此时,我们不再在色彩空间中工作,而是直接使用G矩阵(基本权重),所有进一步的压缩都直接在此矩阵上完成。
The problem here though, is that we’ve now converted byte-aligned integer values into real numbers. Which effectively bloats our information (moving from 1 byte to 1 float (4 bytes)). To solve this, and start producing more significant compression, we move onto the quantization phase.
但是这里的问题是,我们现在已经将字节对齐的整数值转换为实数。 有效地膨胀了我们的信息(从1个字节移动到1个浮点(4个字节))。 为了解决这个问题,并开始产生更重要的压缩,我们进入量化阶段。
量化 (Quantization)
So, we don’t want to compress the floating point data. This would bloat our stream, and not be effective. To that end, we;d like to find a way to convert the weights-matrix back to values in the space of [0,255]. Directly, we could do this by finding the min/max value for the matrix (-415.38, and 77.13, respectively) and the dividing each number in this range to give us a value between [0,1] to which we multiply by 255 to get our final value.
因此,我们不想压缩浮点数据。 这将使我们的工作流程膨胀,并且无效。 为此,我们想找到一种方法来将权重矩阵转换回[0,255]空间中的值。 直接地,我们可以通过找到矩阵的最小/最大值(分别为-415.38和77.13)并将该范围内的每个数字相除,得到[0,1]之间的值,然后乘以255,来做到这一点获得我们的最终价值。
For example : [34.12- -415.38] / [77.13 — -415.38] *255= 232
例如:[34.12- -415.38] / [77.13 — -415.38] * 255 = 232
This works, but the tradeoff is a significant precision reduction. This scaling will produce an uneven distribution of values, the result of which is significant visual loss to the image.
这是可行的,但要权衡是大大降低了精度。 这种缩放将产生值的不均匀分布,其结果是图像的明显视觉损失。
Instead, the JPG takes a different route. Rather than using the range of values in the matrix as it’s scaling value, it instead, uses a precalculated matrix of quantization factors. These QFs don’t need to be part of the stream, rather they can be part of the codec itself.
而是,JPG采用不同的路线。 与其使用矩阵中的值范围作为缩放值,不如使用预先计算的量化因子矩阵。 这些QF不必成为流的一部分,而可以成为编解码器本身的一部分。
This example shows a commonly used matrix of quantization factors , one for each basis image,
本示例显示了一种常用的量化因子矩阵,每个基本图像一个,
We now use the Q and G matrices, to compute our quantized DCT coefficient matrix:
现在,我们使用Q和G矩阵来计算量化的DCT系数矩阵:
For example, using the G[0,0]=−415.37 and Q[0,0]=16 values:
例如,使用G [0,0] = − 415.37和Q [0,0] = 16值:
Resulting in a final matrix of :
最终矩阵为:
Observe how much simpler the matrix becomes — it now contains a large number of entries that are small or zero, making it much easier to compress.
观察矩阵变得多么简单-它现在包含大量的条目,这些条目很小或为零,从而使其更容易压缩。
As a quick aside, we apply this process to Y, CbCr channels independently, and as such we need two different matrices: one for Y, and the other for the C channels:
顺便说一句,我们将此过程分别应用于Y,CbCr通道,因此我们需要两种不同的矩阵:一种用于Y,另一种用于C通道:
Quantization compresses the image in two important ways: one, it limits the effective range of the weights, decreasing the number of bits required to represent them. Two, many of the weights become identical or zero, improving compression in the third step, entropy coding.
量化以两种重要方式压缩图像:一种是,它限制了权重的有效范围,减少了表示权重所需的位数。 两个权重中的许多权重变为相同或为零,从而在第三步(熵编码)中提高了压缩率。
As such quantization is the primary source of JPEG artifacts. Because the images in the lower-right tend to have the largest quantization divisors, JPEG artifacts will tend to resemble combinations of these images. The matrix of quantization factors can be directly controlled by altering the JPEG’s “quality level”, which scales its values up or down (we’ll cover that in a minute)
因此,量化是JPEG伪像的主要来源。 由于右下角的图像倾向于具有最大的量化因子,因此JPEG伪像将倾向于类似于这些图像的组合。 可以通过更改JPEG的“质量级别”来直接控制量化因子矩阵,此过程可以将其值向上或向下缩放(我们将在稍后介绍)
压缩 (Compression)
By now, we’re back in the world of integer values, and can move forward with applying a lossless compression stage to our blocks. When looking at our transformed data though, you should notice something interesting :
现在,我们回到了整数值的世界,并且可以通过对我们的块应用无损压缩阶段来向前迈进。 不过,在查看转换后的数据时,您应该注意到一些有趣的事情:
As you move from the upper left to the bottom right, the frequency of zeros increases. This looks like a prime-suspect for Run Length Encoding. But row-major and column-major orders are not ideal here, since that would interleave these runs of zeros, rather than packing them all together.
当您从左上方移动到右下方时,零的频率会增加。 这看起来像是运行长度编码的主要怀疑。 但是这里的行优先顺序和列优先顺序都不理想,因为这会交错这些零行程,而不是将它们打包在一起。
Instead, we start with the top-left corner and zig-zag in a diagonal pattern across the matrix, going back and forth until we reach the lower-right corner.
取而代之的是,我们从矩阵的对角线开始,以左上角和锯齿形来回移动,直到到达右下角为止。
The result of our luma matrix, in this order, becomes :
我们的亮度矩阵的结果按此顺序变为:
−26,−3,0,−3,−2,−6,2,−4,1,−3,1,1,5,1,2,−1,1,−1,2,0,0,0,0,0,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
−26,−3,0,−3,−2,−6,2,−4,1,−3,1,1,5,1,2,−1,1,−1,2,0,0 ,0,0,0,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Once the data is in this format, the next steps are straightforward : execute RLE on the sequence, and then apply some statistical encoder (Huffman / Arithmetic / ANS) on the results.
一旦数据采用这种格式,接下来的步骤将很简单:对序列执行RLE,然后对结果应用一些统计编码器( 霍夫曼 / 算术 / ANS)。
And Boom. Your block is now JPG encoded.
和繁荣。 您的图块现在已被JPG编码。
了解质量参数 (Understanding the quality parameter)
Now that you understand how JPG files are actually created, it’s worth revisiting the concept of the quality parameter that you normally see when exporting JPG images from Photoshop (or whatnot).
现在您已经了解了JPG文件是如何实际创建的,值得重新审视从Photoshop(或其他方式)导出JPG图像时通常看到的质量参数的概念。
This parameter, which we’ll call q, is an integer from 1 to 100. You should think of q as being a measure of the quality of the image: higher values of q correspond to higher quality images and larger file sizes.
该参数称为q,它是1到100的整数。您应该将q视为衡量图像质量的指标:q的值越高,表示图像质量越高,文件大小越大。
This quality value is used during the quantization phase, to scale the quantization factors appropriately. So that per basis weight, the quantization step now resembles round(Gi,k / alpha*Qi,k)
在量化阶段使用此质量值来适当缩放量化因子。 因此,每基重的量化步骤现在类似于舍入(Gi,k / alpha * Qi,k)
Where the alpha symbol is created as a result of the quality parameter.
由于quality参数而创建的alpha符号的位置。
When either alpha or Q[x,y] is increased (remember that large values of alpha correspond to smaller values of the quality parameter q), more information is lost, and the file size decreases.
当增加alpha或Q [x,y](记住,较大的alpha值对应于质量参数q的较小值)时,会丢失更多信息,并且文件大小会减小 。
As such, if you want a smaller file, at the cost of more visual artifacts, you can set a lower quality value during the export phase.
因此,如果您想要一个较小的文件,而需要更多的视觉假象,则可以在导出阶段设置较低的质量值。
Notice above, in the lowest-quality image, how we see clear signs of the blocking stage, as well as the quantization stage.
请注意,在质量最低的图像中,我们如何看到清晰的信号,包括阻塞阶段以及量化阶段。
Probably most important, is that the quality parameter varies depending on the image. Since each image is unique, and presents different types of visual artifacts, the Q value will be unique as well.
可能最重要的是质量参数根据图像而变化 。 由于每个图像都是唯一的,并且呈现不同类型的视觉伪像,因此Q值也将是唯一的。
结论 (Conclusion)
Once you understand how the JPG algorithm works, a few things become apparent:
了解了JPG算法的工作原理后,就会发现一些事情:
- Getting the quality value right, per image, is important to find the tradeoff between visual quality and file size.为每个图像获取正确的质量值对于找到视觉质量和文件大小之间的折衷至关重要。
- Since this process is block-based, artifacts will tend to occur in blockyness, or “ringing”由于此过程是基于块的,因此伪影将倾向于出现块状或“振铃”
- Since processed blocks don’t intermingle with each other, JPG generally ignores the opportunity to compress large swaths of similar blocks together. Addressing that concern is something the WebP format is good at doing.由于已处理的块不会相互混合,因此JPG通常会忽略将大量类似块压缩在一起的机会。 WebP格式擅长解决此问题。
And if you want to play around with all this by yourself, all this madness can be boiled down to a ~1000 line file.
而且,如果您想自己玩弄所有这些事情,可以将所有这些疯狂归结为〜1000行文件 。
嘿! (HEY!)
Want to know how to make your JPG files smaller?
是否想知道如何缩小JPG文件 ?
Want to know how PNG files work, or how to make them smaller?
是否想知道PNG文件是如何工作的 ,或者如何使它们更小 ?
Want more data compression goodness? Buy my book!
是否需要更多的数据压缩优势? 买我的书 !
翻译自: https://www.freecodecamp.org/news/how-jpg-works-a4dbd2316f35/
jpg在线合并jpg
相关文章:

革命就是请客吃饭(案例分析吧)
前不久路过南京, 拜会了本科同学. 刚好他要见个青年才俊谈些事情, 于是就神神秘秘地把我拉了过去. 一路高谈阔论, 指点江山, 忆往昔峥嵘岁月之后, 此次"拜访"的目的也渐渐清晰起来. 我们所要见的人是位年轻的创业者, 他有些移动互联网的点子, 想和我们分享下, 并尝试…

TextView-- 测量文字宽度
https://my.oschina.net/lengwei/blog/637380; http://blog.csdn.net/mare_blue/article/details/51388403; http://blog.csdn.net/baidu_31093133/article/details/52413893; --1,Android中调用Paint的measureText()方法取得字符串显示的宽度值: public static float GetTextW…

swift 简单风格的Toaster
简单风格的Toaster Toaster //1 弹出文本 "Hello World" 延迟时间 2 展示时间 1 Toast(text: "Hello World", delay: 2, duration: 1).show();//2 初始化toast 方法 let toast Toast(text: "你好世界"); toast.show(); toast.cancel();// 3 …

工业革命前数千年人口经济_我们已经进行了数千年的编程
工业革命前数千年人口经济by Tautvilas Mečinskas由TautvilasMečinskas 我们已经进行了数千年的编程 (We have been programming for thousands of years) Computer programs are all around us. We interact with them every day. It looks as if software is becoming mor…

1-flutter 安装步骤
flutter 安装步骤 1 下载SDK SDK 下载地址 2 解压压缩包 将sdk 文件夹丢进系统的应用程序(Application)的目录 3 配置环境变量 命令行 open ~/.bash_profile ,然后在bash 文件中写入下面配置 export PATH$PATH:/Applications/flutter/bi…

codevs1258 关路灯(☆区间dp)
1258 关路灯 时间限制: 1 s空间限制: 128000 KB题目等级 : 大师 Master题目描述 Description多瑞卡得到了一份有趣而高薪的工作。每天早晨他必须关掉他所在村庄的街灯。所有的街灯都被设置在一条直路的同一侧。 多瑞卡每晚到早晨5点钟都在晚会上,然后他开始关灯。开…

BroadcastReceiver自学笔记
1. 使用步骤: 1.1 声明Intent Intent intent new Intent("name");------静态常用 IntentFilter filter new IntentFilter("name");--------动态常用 1.2 注册 1.3 接收:利用action或者Bundle 在OnReceive()中,接收信息…

小狗钱钱_小狗设计
小狗钱钱by Patryk Adaś通过PatrykAdaś 小狗设计 (Design for doggies) Education should be universal and free for everyone.教育应该是普及的,对所有人来说都是免费的。 When I first entered the field, designers were patient with me. They gave me fee…

层化(stratification)的方法
有时候我们会遇到调整后的模型反而不如调整前表现好的情况,这可能和数据的随机分割有关系。在这个不平衡的数据情况下,最好用层化(stratification)的方法,比如: from sklearn.cross_validation import Stra…

零基础入门jQuery视频教程
零基础入门jQuery最新版开发.NET富客户端应用(选择器、DOM操作、事件和动画、Ajax应用、插件、Mobile)课程分类:.NETJquery适合人群:初级课时数量:35课时用到技术:javascript,ajax,jquery,handler涉及项目:各知识点的项…

2-flutter 之HelloWorld
widget 在flutter 中,几乎所有的东西都是widget,本身是用户界面的基本构建快,将widget组成一个层次结构, 调用widget树。每一个窗口widget都嵌套在父窗口widget中,并且从其父窗口中继承属性。甚至应用程序对象本身也…

浏览器获取浏览历史_浏览器历史的未来
浏览器获取浏览历史by Patryk Adaś通过PatrykAdaś 浏览器历史的未来 (The Future of Browser History) I am really unsatisfied with the current state of Browser History. I think that this is the most underestimated feature of every modern web browser. Let’s t…

【水】JSOI完美的对称
完美的对称 题目描述 在峰会期间,必须使用许多保镖保卫北约组织的各国代表。代表们除了由他自己的随身保镖保护外,组委会还指派了一些其他的特工和阻击手保护他们。为了使他们的工作卓有成效,使被保卫的人的安全尽可能得到保障,保…

3-flutter 项目结构 资源 依赖
1 项目的名称 android 安卓相关工程文件 build 项目的构建输出目录 ios ios 相关的部分工程文件 lib 项目中的dart 源文件 src 包含其他的源文件main.dart 自动生成的项目入口文件 test 测试相关的文件 pubspec.ymal 项目依赖配置文件 3 归档图片资源和处理不同的分辨率…

python简史_命令行简史
python简史by Gitter通过吉特 命令行简史 (A Brief History of the Command Line) This post by Andy Trevorah, Engineer at Gitter, has been adapted from a talk that he originally gave at codebar, a non-profit initiative that facilitates the growth of a diverse …

4- flutter - Widget
Widget Flutter 中的view 就是widget 1 无状态和有状态的Widget StateslessWidgets 适用于用户界面不依赖于用户的信息的时候 StatesfulWidgets 有状态的,例如HTTP 网络请求或者用户交互之后收到数据动态表更新UI 这就是一个无状态的Widget Text("we like…

第一讲SQL命令的DDL和DML操作讲解
知识点: 一、sql命令DDL(结构化操作) 二、sql命令DML操作(增删改查) 1.sql命令DDL(结构化操作) 1.1表添加字段: alter table 表名 add 列定义 如: alter table Student add email varchar(128); 1.2 修改字段ÿ…
基于Tkinter利用python实现颜色空间转换程序
主要基于colorsys实现,例子是从hls转换到rgb,假设要换颜色空间非常easy仅仅须要改动一个函数 用到了Scale和Canvas组件 代码例如以下: from Tkinter import * import colorsys #操作后的响应函数 def update(* args):colorr,g,b colorsys.hl…

react 时刻表插件_React“啊哈”的时刻
react 时刻表插件As a teacher, one of my main goals is to maximize people’s “aha” moments.作为一名老师,我的主要目标之一是最大限度地利用人们的“哈哈”时刻。 An “aha” moment is a moment of sudden insight or clarity, where the subject starts t…

同样在JavaScript中
ES6有三个内置决定一些设施x和一些y是“相同的”。 它们是:平等或“双等于”(),严格平等或平等“三重”(),Object.is。 (注意,Object.is在ES6补充道。 等于两倍和三倍等于存在ES6之前,和他们的行为没有改变。) 概述 演示,下面是三个同样使用的比较: x y x y Object。是(x,…

5-flutter 布局和列表
布局和列表 类型作用特点Container只有一个子 Widget。默认充满,包含了padding、margin、color、宽高、decoration 等配置。Padding只有一个子 Widget。只用于设置Padding,常用于嵌套child,给child设置padding。Center只有一个子 Widget。只…

shell awk实战
一、文本处理 1、按行提取关键字频次(如取第5列) awk BEGIN{FS"|"} {a[$5]1;} END {for(i in a) print i ":" a[i];} OPT.ForumLogicNewServer_action_20161107.log | sort -nrk 2 -t : 2、日志用户每分钟访问量统计 这里我们统计日…

pix怎么抚养另一只猫_在工作和抚养两个孩子的同时,我如何在一年内获得第二学位并获得了5个开发人员认证...
pix怎么抚养另一只猫“The standard pace is for chumps. The system is designed so anyone can keep up. If you’re more driven than ‘just anyone’ — you can do so much more than anyone expects. And this applies to ALL of life — not just school.” — Derek S…

Wireshark网络抓包(三)——网络协议
一、ARP协议 ARP(Address Resolution Protocol)地址解析协议,将IP地址解析成MAC地址。 IP地址在OSI模型第三层,MAC地址在OSI第二层,彼此不直接通信; 在通过以太网发生IP数据包时,先封装第三层&a…

实现Java中的ArrayList
最近深受轮子哥影响,觉得造一些轮子应该会对自己的技术功底有一定的帮助,就决定先从简单的容器开始实现。废话不多说,就先实现一个Java中的ArrayList。 ArrayList是我们在Java中使用非常多的一个类,它是顺序表的数组实现ÿ…

6-flutter 状态管理
1 StatelessWidget 不需要状态改变的widget,它没有要管理的内部状态。 Text,CircleAvator 都是其子类 其传递的参数别final 修饰,不可变的 无状态的widget build 方法在以下三种情况下进行调用 当widget 插入到数中去当widget 父级更改配置的时候当…

大二上学数据结构和操作系统_毕业后的工作比上学要重要得多。 这是数据。...
大二上学数据结构和操作系统by Aline Lerner通过艾琳勒纳(Aline Lerner) 毕业后的工作比上学要重要得多。 这是数据。 (What you do after you graduate matters way more than where you went to school. Here’s the data.) The first blog post I published that got any r…

关于C#中编译器保证变量必须初始化规则猜想
现在两种情况: 第一种情况: using System; namespace Wrox {public class Program{static void Main(string[] args){int index; if(true){ index 100; } Console.WriteLine(index); Cons…

Bootstrap table表格
Bootstrap table 使用类 Class"table" 既可让table美化样式 table 相关的Class 隔行换色 : table-striped 鼠标悬停效果: table-hover 表格的边框 : table-bordered 垂直居中 : vertical-align 表头颜色:c…

flutter报错Could not connect to lockdownd, error code -
关于 flutter 报错信息解决方案 第一步: cmdshiftg 前往 /var/db 文件夹,找到lockdown文件夹,修改读写权限 第二步 : 打开命令行,依次执行 brew update brew uninstall --ignore-dependencies libimobiledevice brew uninstall…