https://www.cnblogs.com/yanjie-java/p/8329631.html

  1 package com.java.connect.poi;
2
3 import java.io.FileOutputStream;
4 import java.io.IOException;
5
6 import org.apache.poi.ss.usermodel.Cell;
7 import org.apache.poi.ss.usermodel.CellStyle;
8 import org.apache.poi.ss.usermodel.IndexedColors;
9 import org.apache.poi.ss.usermodel.Row;
10 import org.apache.poi.ss.usermodel.Sheet;
11 import org.apache.poi.ss.usermodel.Workbook;
12 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
13
14 public class POIFillAndColorExample {
15 public static void main(String[] args) throws IOException {
16 // Create a workbook object
17 Workbook workbook = new XSSFWorkbook();
18 // Create sheet
19 Sheet sheet = workbook.createSheet();
20
21 // Create a row and put some cells in it.
22 Row row = sheet.createRow((short) 1);
23
24 // Aqua background
25 CellStyle style = workbook.createCellStyle();
26 style.setFillForegroundColor(IndexedColors.AQUA.getIndex());
27 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
28 Cell cell = row.createCell((short) 1);
29 cell.setCellValue("X1");
30 cell.setCellStyle(style);
31
32 // Orange "foreground", foreground being the fill foreground not the
33 // font color.
34 style = workbook.createCellStyle();
35 style.setFillForegroundColor(IndexedColors.AUTOMATIC.getIndex());
36 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
37 cell = row.createCell((short) 2);
38 cell.setCellValue("X2");
39 cell.setCellStyle(style);
40
41 style = workbook.createCellStyle();
42 style.setFillForegroundColor(IndexedColors.BLUE.getIndex());
43 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
44 cell = row.createCell((short) 3);
45 cell.setCellValue("X3");
46 cell.setCellStyle(style);
47
48 style = workbook.createCellStyle();
49 style.setFillForegroundColor(IndexedColors.BLUE_GREY.getIndex());
50 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
51 cell = row.createCell((short) 4);
52 cell.setCellValue("X4");
53 cell.setCellStyle(style);
54
55 style = workbook.createCellStyle();
56 style.setFillForegroundColor(IndexedColors.BRIGHT_GREEN.getIndex());
57 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
58 cell = row.createCell((short) 5);
59 cell.setCellValue("X5");
60 cell.setCellStyle(style);
61
62 // Create a row and put some cells in it.
63 Row row2 = sheet.createRow((short) 2);
64
65 style = workbook.createCellStyle();
66 style.setFillForegroundColor(IndexedColors.BROWN.getIndex());
67 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
68 cell = row2.createCell((short) 1);
69 cell.setCellValue("X6");
70 cell.setCellStyle(style);
71
72 style = workbook.createCellStyle();
73 style.setFillForegroundColor(IndexedColors.CORAL.getIndex());
74 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
75 cell = row2.createCell((short) 2);
76 cell.setCellValue("X7");
77 cell.setCellStyle(style);
78
79 style = workbook.createCellStyle();
80 style.setFillForegroundColor(IndexedColors.CORNFLOWER_BLUE.getIndex());
81 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
82 cell = row2.createCell((short) 3);
83 cell.setCellValue("X8");
84 cell.setCellStyle(style);
85
86 style = workbook.createCellStyle();
87 style.setFillForegroundColor(IndexedColors.DARK_BLUE.getIndex());
88 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
89 cell = row2.createCell((short) 4);
90 cell.setCellValue("X9");
91 cell.setCellStyle(style);
92 style = workbook.createCellStyle();
93 style.setFillForegroundColor(IndexedColors.DARK_GREEN.getIndex());
94 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
95 cell = row2.createCell((short) 5);
96 cell.setCellValue("X10");
97 cell.setCellStyle(style);
98
99 // Create a row and put some cells in it.
100 Row row3 = sheet.createRow((short) 3);
101
102 style = workbook.createCellStyle();
103 style.setFillForegroundColor(IndexedColors.DARK_RED.getIndex());
104 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
105 cell = row3.createCell((short) 1);
106 cell.setCellValue("X11");
107 cell.setCellStyle(style);
108 style = workbook.createCellStyle();
109 style.setFillForegroundColor(IndexedColors.DARK_TEAL.getIndex());
110 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
111 cell = row3.createCell((short) 2);
112 cell.setCellValue("X12");
113 cell.setCellStyle(style);
114
115 style = workbook.createCellStyle();
116 style.setFillForegroundColor(IndexedColors.DARK_YELLOW.getIndex());
117 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
118 cell = row3.createCell((short) 3);
119 cell.setCellValue("X13");
120 cell.setCellStyle(style);
121 style = workbook.createCellStyle();
122 style.setFillForegroundColor(IndexedColors.GOLD.getIndex());
123 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
124 cell = row3.createCell((short) 4);
125 cell.setCellValue("X14");
126 cell.setCellStyle(style);
127
128 style = workbook.createCellStyle();
129 style.setFillForegroundColor(IndexedColors.GREEN.getIndex());
130 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
131 cell = row3.createCell((short) 5);
132 cell.setCellValue("X15");
133 cell.setCellStyle(style);
134
135 // Create a row and put some cells in it.
136 Row row4 = sheet.createRow((short) 4);
137 style = workbook.createCellStyle();
138 style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
139 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
140 cell = row4.createCell((short) 1);
141 cell.setCellValue("X16");
142 cell.setCellStyle(style);
143
144 style = workbook.createCellStyle();
145 style.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex());
146 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
147 cell = row4.createCell((short) 2);
148 cell.setCellValue("X17");
149 cell.setCellStyle(style);
150 style = workbook.createCellStyle();
151 style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
152 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
153 cell = row4.createCell((short) 3);
154 cell.setCellValue("X18");
155 cell.setCellStyle(style);
156
157 style = workbook.createCellStyle();
158 style.setFillForegroundColor(IndexedColors.GREY_80_PERCENT.getIndex());
159 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
160 cell = row4.createCell((short) 4);
161 cell.setCellValue("X19");
162 cell.setCellStyle(style);
163 style = workbook.createCellStyle();
164 style.setFillForegroundColor(IndexedColors.INDIGO.getIndex());
165 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
166 cell = row4.createCell((short) 5);
167 cell.setCellValue("X20");
168 cell.setCellStyle(style);
169
170 // Create a row and put some cells in it.
171 Row row5 = sheet.createRow((short) 5);
172
173 style = workbook.createCellStyle();
174 style.setFillForegroundColor(IndexedColors.LAVENDER.getIndex());
175 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
176 cell = row5.createCell((short) 1);
177 cell.setCellValue("X21");
178 cell.setCellStyle(style);
179
180 style = workbook.createCellStyle();
181 style.setFillForegroundColor(IndexedColors.LEMON_CHIFFON.getIndex());
182 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
183 cell = row5.createCell((short) 2);
184 cell.setCellValue("X22");
185 cell.setCellStyle(style);
186
187 style = workbook.createCellStyle();
188 style.setFillForegroundColor(IndexedColors.LIGHT_BLUE.getIndex());
189 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
190 cell = row5.createCell((short) 3);
191 cell.setCellValue("X23");
192 cell.setCellStyle(style);
193 style = workbook.createCellStyle();
194 style.setFillForegroundColor(IndexedColors.LEMON_CHIFFON.getIndex());
195 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
196 cell = row5.createCell((short) 4);
197 cell.setCellValue("X24");
198 cell.setCellStyle(style);
199
200 style = workbook.createCellStyle();
201 style.setFillForegroundColor(IndexedColors.LIGHT_BLUE.getIndex());
202 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
203 cell = row5.createCell((short) 5);
204 cell.setCellValue("X25");
205 cell.setCellStyle(style);
206
207 // Create a row and put some cells in it.
208 Row row6 = sheet.createRow((short) 6);
209 style = workbook.createCellStyle();
210 style.setFillForegroundColor(IndexedColors.LIGHT_CORNFLOWER_BLUE
211 .getIndex());
212 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
213 cell = row6.createCell((short) 1);
214 cell.setCellValue("X26");
215 cell.setCellStyle(style);
216
217 style = workbook.createCellStyle();
218 style.setFillForegroundColor(IndexedColors.LIGHT_GREEN.getIndex());
219 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
220 cell = row6.createCell((short) 2);
221 cell.setCellValue("X27");
222 cell.setCellStyle(style);
223 style = workbook.createCellStyle();
224 style.setFillForegroundColor(IndexedColors.LIGHT_ORANGE.getIndex());
225 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
226 cell = row6.createCell((short) 3);
227 cell.setCellValue("X28");
228 cell.setCellStyle(style);
229
230 style = workbook.createCellStyle();
231 style.setFillForegroundColor(IndexedColors.LIGHT_TURQUOISE.getIndex());
232 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
233 cell = row6.createCell((short) 4);
234 cell.setCellValue("X29");
235 cell.setCellStyle(style);
236
237 style = workbook.createCellStyle();
238 style.setFillForegroundColor(IndexedColors.LIGHT_YELLOW.getIndex());
239 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
240 cell = row6.createCell((short) 5);
241 cell.setCellValue("X30");
242 cell.setCellStyle(style);
243
244 // Create a row and put some cells in it.
245 Row row7 = sheet.createRow((short) 7);
246 style = workbook.createCellStyle();
247 style.setFillForegroundColor(IndexedColors.LIME.getIndex());
248 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
249 cell = row7.createCell((short) 1);
250 cell.setCellValue("X31");
251 cell.setCellStyle(style);
252 style = workbook.createCellStyle();
253 style.setFillForegroundColor(IndexedColors.MAROON.getIndex());
254 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
255 cell = row7.createCell((short) 2);
256 cell.setCellValue("X32");
257 cell.setCellStyle(style);
258
259 style = workbook.createCellStyle();
260 style.setFillForegroundColor(IndexedColors.OLIVE_GREEN.getIndex());
261 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
262 cell = row7.createCell((short) 3);
263 cell.setCellValue("X33");
264 cell.setCellStyle(style);
265 style = workbook.createCellStyle();
266 style.setFillForegroundColor(IndexedColors.ORANGE.getIndex());
267 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
268 cell = row7.createCell((short) 4);
269 cell.setCellValue("X34");
270 cell.setCellStyle(style);
271
272 style = workbook.createCellStyle();
273 style.setFillForegroundColor(IndexedColors.ORCHID.getIndex());
274 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
275 cell = row7.createCell((short) 5);
276 cell.setCellValue("X35");
277 cell.setCellStyle(style);
278
279 // Create a row and put some cells in it.
280 Row row8 = sheet.createRow((short) 8);
281
282 style = workbook.createCellStyle();
283 style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
284 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
285 cell = row8.createCell((short) 1);
286 cell.setCellValue("X36");
287 cell.setCellStyle(style);
288
289 style = workbook.createCellStyle();
290 style.setFillForegroundColor(IndexedColors.PINK.getIndex());
291 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
292 cell = row8.createCell((short) 2);
293 cell.setCellValue("X37");
294 cell.setCellStyle(style);
295 style = workbook.createCellStyle();
296 style.setFillForegroundColor(IndexedColors.PLUM.getIndex());
297 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
298 cell = row8.createCell((short) 3);
299 cell.setCellValue("X38");
300 cell.setCellStyle(style);
301
302 style = workbook.createCellStyle();
303 style.setFillForegroundColor(IndexedColors.RED.getIndex());
304 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
305 cell = row8.createCell((short) 4);
306 cell.setCellValue("X39");
307 cell.setCellStyle(style);
308 style = workbook.createCellStyle();
309 style.setFillForegroundColor(IndexedColors.ROSE.getIndex());
310 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
311 cell = row8.createCell((short) 5);
312 cell.setCellValue("X40");
313 cell.setCellStyle(style);
314
315 // Create a row and put some cells in it.
316 Row row9 = sheet.createRow((short) 9);
317
318 style = workbook.createCellStyle();
319 style.setFillForegroundColor(IndexedColors.ROYAL_BLUE.getIndex());
320 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
321 cell = row9.createCell((short) 1);
322 cell.setCellValue("X41");
323 cell.setCellStyle(style);
324 style = workbook.createCellStyle();
325 style.setFillForegroundColor(IndexedColors.SEA_GREEN.getIndex());
326 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
327 cell = row9.createCell((short) 2);
328 cell.setCellValue("X42");
329 cell.setCellStyle(style);
330
331 style = workbook.createCellStyle();
332 style.setFillForegroundColor(IndexedColors.SKY_BLUE.getIndex());
333 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
334 cell = row9.createCell((short) 3);
335 cell.setCellValue("X43");
336 cell.setCellStyle(style);
337 style = workbook.createCellStyle();
338 style.setFillForegroundColor(IndexedColors.TAN.getIndex());
339 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
340 cell = row9.createCell((short) 4);
341 cell.setCellValue("X44");
342 cell.setCellStyle(style);
343
344 style = workbook.createCellStyle();
345 style.setFillForegroundColor(IndexedColors.TEAL.getIndex());
346 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
347 cell = row9.createCell((short) 5);
348 cell.setCellValue("X45");
349 cell.setCellStyle(style);
350
351 // Create a row and put some cells in it.
352 Row row10 = sheet.createRow((short) 10);
353
354 style = workbook.createCellStyle();
355 style.setFillForegroundColor(IndexedColors.TURQUOISE.getIndex());
356 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
357 cell = row10.createCell((short) 1);
358 cell.setCellValue("X46");
359 cell.setCellStyle(style);
360
361 style = workbook.createCellStyle();
362 style.setFillForegroundColor(IndexedColors.VIOLET.getIndex());
363 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
364 cell = row10.createCell((short) 2);
365 cell.setCellValue("X47");
366 cell.setCellStyle(style);
367 style = workbook.createCellStyle();
368 style.setFillForegroundColor(IndexedColors.WHITE.getIndex());
369 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
370 cell = row10.createCell((short) 3);
371 cell.setCellValue("X48");
372 cell.setCellStyle(style);
373
374 style = workbook.createCellStyle();
375 style.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
376 style.setFillPattern(CellStyle.SOLID_FOREGROUND);
377 cell = row10.createCell((short) 3);
378 cell.setCellValue("X49");
379 cell.setCellStyle(style);
380
381 // Write the output to a file
382 FileOutputStream fileOut = new FileOutputStream(
383 "POIFillAndColorExample.xlsx");
384 workbook.write(fileOut);
385 fileOut.close();
386
387 }
388 }

生成的excel文件看起来像下面的图片。

color org.apache.poi.hssf.util.HSSFColor$GREY_80_PERCENT@1aadbf7
color org.apache.poi.hssf.util.HSSFColor$INDIGO@4f4458
color org.apache.poi.hssf.util.HSSFColor$PLUM@100c56
color org.apache.poi.hssf.util.HSSFColor$BROWN@19a1fae
color org.apache.poi.hssf.util.HSSFColor$OLIVE_GREEN@1960c9e
color org.apache.poi.hssf.util.HSSFColor$DARK_GREEN@168f39
color org.apache.poi.hssf.util.HSSFColor$SEA_GREEN@11525cd
color org.apache.poi.hssf.util.HSSFColor$DARK_TEAL@164e67f
color org.apache.poi.hssf.util.HSSFColor$GREY_40_PERCENT@158cfda
color org.apache.poi.hssf.util.HSSFColor$BLUE_GREY@1b613c0
color org.apache.poi.hssf.util.HSSFColor$ORANGE@cae1b3
color org.apache.poi.hssf.util.HSSFColor$LIGHT_ORANGE@1a7e798
color org.apache.poi.hssf.util.HSSFColor$GOLD@55d1ef
color org.apache.poi.hssf.util.HSSFColor$LIME@49b9ad
color org.apache.poi.hssf.util.HSSFColor$AQUA@3d0f0e
color org.apache.poi.hssf.util.HSSFColor$LIGHT_BLUE@a7624e
color org.apache.poi.hssf.util.HSSFColor$TAN@1271218
color org.apache.poi.hssf.util.HSSFColor$LAVENDER@150b2d
color org.apache.poi.hssf.util.HSSFColor$ROSE@190c9dc
color org.apache.poi.hssf.util.HSSFColor$PALE_BLUE@b4bc8e
color org.apache.poi.hssf.util.HSSFColor$LIGHT_YELLOW@1c74456
color org.apache.poi.hssf.util.HSSFColor$LIGHT_GREEN@15783a2
color org.apache.poi.hssf.util.HSSFColor$LIGHT_TURQUOISE@830993
color org.apache.poi.hssf.util.HSSFColor$SKY_BLUE@e99642
color org.apache.poi.hssf.util.HSSFColor$BLUE@187f194
color org.apache.poi.hssf.util.HSSFColor$TEAL@55f9f
color org.apache.poi.hssf.util.HSSFColor$DARK_RED@c8e08f
color org.apache.poi.hssf.util.HSSFColor$VIOLET@edd19
color org.apache.poi.hssf.util.HSSFColor$TURQUOISE@1d5c7a1
color org.apache.poi.hssf.util.HSSFColor$YELLOW@252119
color org.apache.poi.hssf.util.HSSFColor$PINK@19ff062
color org.apache.poi.hssf.util.HSSFColor$DARK_BLUE@15eb4d0
color org.apache.poi.hssf.util.HSSFColor$LIGHT_CORNFLOWER_BLUE@b0e84b
color org.apache.poi.hssf.util.HSSFColor$ROYAL_BLUE@62a19d
color org.apache.poi.hssf.util.HSSFColor$CORAL@16075b3
color org.apache.poi.hssf.util.HSSFColor$ORCHID@1cf46c2
color org.apache.poi.hssf.util.HSSFColor$LIGHT_TURQUOISE@12e8a41
color org.apache.poi.hssf.util.HSSFColor$LEMON_CHIFFON@76ec7a
color org.apache.poi.hssf.util.HSSFColor$PLUM@19f7952
color org.apache.poi.hssf.util.HSSFColor$CORNFLOWER_BLUE@d60cdd
color org.apache.poi.hssf.util.HSSFColor$GREY_50_PERCENT@e6bc11
color org.apache.poi.hssf.util.HSSFColor$GREY_25_PERCENT@452267
color org.apache.poi.hssf.util.HSSFColor$TEAL@d5b614
color

org.apache.poi.hssf.util.HSSFColor$VIOLET@a4e3ae

color org.apache.poi.hssf.util.HSSFColor$DARK_YELLOW@15fd4a3
color org.apache.poi.hssf.util.HSSFColor$DARK_BLUE@8137c9
color org.apache.poi.hssf.util.HSSFColor$GREEN@1757596
color org.apache.poi.hssf.util.HSSFColor$DARK_RED@7ad4d5
color org.apache.poi.hssf.util.HSSFColor$TURQUOISE@2aee3f
color org.apache.poi.hssf.util.HSSFColor$PINK@7f788b
color org.apache.poi.hssf.util.HSSFColor$YELLOW@c311d5
color org.apache.poi.hssf.util.HSSFColor$BLUE@c7e580
color org.apache.poi.hssf.util.HSSFColor$BRIGHT_GREEN@1ac55ac
color org.apache.poi.hssf.util.HSSFColor$RED@12cc460
color org.apache.poi.hssf.util.HSSFColor$WHITE@10ad7e
color

org.apache.poi.hssf.util.HSSFColor$BLACK@ee336f

 
 

POI IndexedColors 编码 与 颜色 对照的更多相关文章

  1. C#颜色对照使用表

    这篇文章来来源于C# Color Table,这里是我翻译的中文版本,其中已经加上了我的一些理解和注释.翻译这篇文章的原因是我在写C#程序的时候发现,C#自带的颜色种类极多(详见下表),如果没有直观的 ...

  2. android 颜色对照

    <table><tbody> <tr> <td bgcolor="#ffffff" width="30" height ...

  3. RGB颜色对照图

  4. 利用poi,jxl将Excel数据导入数据库

    需求:‘需要将本地的Excel中的数据经过验证之后导入数据库,在导入数据库之前在页面上展示出来 思路:将Excel导入存到session里面 去判断有没有不合法数据  如果有阻止提交 工具类: imp ...

  5. WEBGL学习【十三】鼠标点击立方体改变颜色的原理与实现

    // PickFace.js (c) 2012 matsuda and kanda // Vertex shader program var VSHADER_SOURCE = 'attribute v ...

  6. POI3的资料整理

    转自http://aman.cao.blog.163.com/blog/static/32951336201010823557408/ POI3的资料整理一.POI简介 Jakarta POI 是ap ...

  7. 老男孩Day15作业:商城列表页面(静态)

    一. 一.作业需求: 1.完成商城列表静态页面的抒写 二.博客地址:https://www.cnblogs.com/catepython/p/9205636.html 三.运行环境 操作系统:Win1 ...

  8. 个人永久性免费-Excel催化剂功能第92波-地理地址与经纬度互转功能

    GPS设备和手机LBS的兴起,在地理信息存储过程中,在程序.应用级别是需要用经纬度去定位,而在数据分析的级别,特别是省市区镇街的分析,用到的是人可识别的文本类型存储,从设备中采集下来的数据和人工维护的 ...

  9. .net提交HTML元素到后台,遇到Request报错 解决方案

    对于.NET MVC 项目来说,在Controller中对应的Action方法上打上标签: [ValidateInput(false)] 在MSDN上:HttpRequest 类使用输入验证标志来跟踪 ...

随机推荐

  1. Python - Django - 中间件 process_response

    process_response 函数是执行完 views.py 后执行的函数 process_response 函数有两个参数,一个是 request,一个是 response,response 是 ...

  2. 数学黑洞:卡普雷卡尔常数的php算法实现

    首先看一篇文章: 英国广播公司报道,6174乍看没什么奇特之处,但是,自从1949年以来,它一直令数学家.数字控抓狂.痴迷. 不管你挑的四位数是什么,早早晚晚你都会遇到6174:而且,遇到6174就只 ...

  3. 服务器系统启动之所以比PC慢很多

    服务器系统启动之所以比PC慢很多, 第一个是:服务器底层还有一套硬件和固件,叫做IPMI系统,这套系统需要时间来引导和载入.载入IPMI后,它才会载入BIos来继续引导.这个占主要时间,尤其是冷启动的 ...

  4. PHP- 如何在终端输出带颜色的字体?

    转自: http://www.neatstudio.com/show-2568-1.shtml 终端显示颜色,在以前的想法当中,都是因为有了.profile的配色方案.而我一般也都是 采用默认的(sn ...

  5. PHP设计模式 - 备忘录模式

    备忘录模式又叫做快照模式(Snapshot)或 Token 模式,备忘录模式的用意是在不破坏封装性的前提下,捕获一个对象的内部状态,并在该对象之外保存这个状态,这样就可以在合适的时候将该对象恢复到原先 ...

  6. AntV设置Chart高度

    AntV在使用柱状图时不能单独设置一个柱状图的宽度,但可以设置整体高度,宽度,代码如下 const chart = new F2.Chart({ id: 'c1', // 指定图表容器 ID widt ...

  7. vs 远程调试

    程序在vs安装目录: D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Remote Debugge ...

  8. Codeforces Round #249 (Div. 2) C. Cardiogram

    C. Cardiogram time limit per test 1 second memory limit per test 256 megabytes input standard input ...

  9. STL源码剖析——序列式容器#4 Stack & Queue

    Stack stack是一种先进后出(First In Last Out,FILO)的数据结构,它只有一个出口,元素的新增.删除.最顶端访问都在该出口进行,没有其他位置和方法可以存取stack的元素. ...

  10. 【数据结构】6.java源码ArrayList

    关于ArrayList的源码关注点 1.从底层数据结构,扩容策略2.ArrayList的增删改查3.特殊处理重点关注4.遍历的速度,随机访问和iterator访问效率对比 1.从底层数据结构,扩容策略 ...