-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatom.xml
More file actions
541 lines (449 loc) · 40.1 KB
/
atom.xml
File metadata and controls
541 lines (449 loc) · 40.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[AndyHsu's Blog]]></title>
<link href="/atom.xml" rel="self"/>
<link href="http://freemanhsu.github.io/"/>
<updated>2015-05-22T13:13:45.653Z</updated>
<id>http://freemanhsu.github.io/</id>
<author>
<name><![CDATA[Andy Hsu]]></name>
<email><![CDATA[andy.xu1994@gmail.com]]></email>
</author>
<generator uri="http://zespia.tw/hexo/">Hexo</generator>
<entry>
<title><![CDATA[Review of Database]]></title>
<link href="http://freemanhsu.github.io/Review-of-Database/"/>
<id>http://freemanhsu.github.io/Review-of-Database/</id>
<published>2015-05-22T11:13:49.000Z</published>
<updated>2015-05-22T13:11:43.000Z</updated>
<content type="html"><![CDATA[<p>Database Systems Course Review.</p>
<h1 id="Introduction">Introduction</h1>
<p>Aspects of studying (questions to answer):</p>
<ul>
<li>Modeling and design of databases.<br>(How is the information structured?)</li>
<li>Programming: queries and DB operations like update.<br>(How does one express queries and other operations on the database?)</li>
<li>DBMS implementation.<br>(How to build a DBMS?)</li>
</ul>
<a id="more"></a>
<h1 id="Relational_Database_Modeling">Relational Database Modeling</h1>
<h2 id="The_Relational_Model_of_Data">The Relational Model of Data</h2>
<ul>
<li>Data Model = Structure of the data + Operations on data + Constraints</li>
<li>Schemas<br> Relation schema = relation name + attribute list<br> Database = collection of relations<br> Database schema = set of all relation schemas in the database</li>
<li>Relation instances<br> is current set of rows for a relation schema</li>
<li>Key of Relations</li>
<li>Three kinds of table<ul>
<li>Stored relations<br> real, stored</li>
<li>Views<br> relations defined by a computation, virtual, not really exists</li>
<li>Temporary tables<br> constructed by SQL processor, thrown away, not stored</li>
</ul>
</li>
<li>Table Declarations<ul>
<li>Most common types<ul>
<li>INT / INTEGER</li>
<li>REAL / FLOAT</li>
<li>CHAR(n)</li>
<li>VARCHAR(n)</li>
<li>BOOLEAN: true, false, unknown</li>
<li>DATE</li>
<li>TIME</li>
</ul>
</li>
<li>NULL , NOT NULL , DEFAULT value</li>
<li>PRIMARY KEY , UNIQUE<br> There can be only one PRIMARY KEY for a relation, but several UNIQUE attributes.<br> No attribute of a PRIMARY KEY can ever be NULL in any tuple. But attributes declared UNIQUE may have NULL’s and there may be several tuples with NULL.</li>
</ul>
</li>
<li>Core Relational Algebra:<ul>
<li>Union, intersection, difference<br> Usual set operations, but both operands must have the same relation schema.</li>
<li>Selection<br> Picking certain rows</li>
<li>Projection<br> Picking certain columns</li>
<li>Products and joins<br> Compositions of relations<ul>
<li>Theta Join</li>
<li>Natural Join</li>
</ul>
</li>
<li>Renaming<br> of relations and attributes</li>
</ul>
</li>
<li>Relational Algebra on Bags<br> A bag (or multiset) is like a set, but an element may appear more than once.<ul>
<li>Operations on Bags</li>
</ul>
</li>
<li>Constraints on Relations<ul>
<li>The ability to restrict the data that may be stored in a database.</li>
<li>Relational algebra: used as a constraint language abstractly.</li>
</ul>
</li>
</ul>
<h2 id="Design_Theory_for_Relational_Databases">Design Theory for Relational Databases</h2>
<h2 id="High-Level_Database_Models">High-Level Database Models</h2>
<h1 id="Relational_Database_Programming">Relational Database Programming</h1>
<h2 id="Algebraic_and_Logical_Query_Languages">Algebraic and Logical Query Languages</h2>
<h2 id="The_Database_Language_SQL">The Database Language SQL</h2>
<h2 id="Constraints_and_Triggers">Constraints and Triggers</h2>
<h2 id="Views_and_Indexes">Views and Indexes</h2>
<h2 id="SQL_in_a_Server_Environment">SQL in a Server Environment</h2>
<h2 id="Advanced_Topics_in_Relational_Databases">Advanced Topics in Relational Databases</h2>
<h1 id="Modeling_and_Programming_for_Semistructured_Data">Modeling and Programming for Semistructured Data</h1>
<h2 id="The_Semistructured-Data_Model">The Semistructured-Data Model</h2>
<h2 id="Programming_Languages_for_XML">Programming Languages for XML</h2>
]]></content>
<summary type="html">
<![CDATA[<p>Database Systems Course Review.</p>
<h1 id="Introduction">Introduction</h1>
<p>Aspects of studying (questions to answer):</p>
<ul>
<li>Modeling and design of databases.<br>(How is the information structured?)</li>
<li>Programming: queries and DB operations like update.<br>(How does one express queries and other operations on the database?)</li>
<li>DBMS implementation.<br>(How to build a DBMS?)</li>
</ul>
]]>
</summary>
<category term="Database" scheme="http://freemanhsu.github.io/tags/Database/"/>
<category term="Course Review" scheme="http://freemanhsu.github.io/categories/Course-Review/"/>
</entry>
<entry>
<title><![CDATA[Test Scripts for LeetCode JS]]></title>
<link href="http://freemanhsu.github.io/Test-Scripts-for-LeetCode-JS/"/>
<id>http://freemanhsu.github.io/Test-Scripts-for-LeetCode-JS/</id>
<published>2015-05-08T03:53:40.000Z</published>
<updated>2015-05-08T03:59:45.000Z</updated>
<content type="html"><![CDATA[<p>LeetCode in Javascript. <a href="https://github.com/FreemanHsu/LeetCodeJS" target="_blank" rel="external">Repo here</a></p>
<p>Tool scripts for testing are added.</p>
<a id="more"></a>
<p>The reason for doing this is that I am poor at thinking of valuable test cases, thus I always relied on leetcode judging system to remind me of boundary conditions, which is not decent at all.</p>
<p>Besides, it is not so interesting to write test scripts but I think the ability of automatic testing is of importance for front-end developers.</p>
<h3 id="Let’s_Leet">Let’s Leet</h3>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">npm</span> run leet</div></pre></td></tr></table></figure>
<p>Automatically setup a new leetcode according to current progress, including:</p>
<ul>
<li>A directory named like 001-Two-Sum</li>
<li>index.js</li>
<li>test.js</li>
<li>input</li>
<li>output</li>
</ul>
<h3 id="Test">Test</h3>
<p>Complete the test.js and test cases (input and output files) and</p>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm <span class="keyword">test</span></div></pre></td></tr></table></figure>
]]></content>
<summary type="html">
<![CDATA[<p>LeetCode in Javascript. <a href="https://github.com/FreemanHsu/LeetCodeJS" target="_blank" rel="external">Repo here</a></p>
<p>Tool scripts for testing are added.</p>
]]>
</summary>
<category term="Javascript" scheme="http://freemanhsu.github.io/tags/Javascript/"/>
<category term="LeetCode" scheme="http://freemanhsu.github.io/categories/LeetCode/"/>
</entry>
<entry>
<title><![CDATA[Add Schedule Counter in Kernel]]></title>
<link href="http://freemanhsu.github.io/Add-Schedule-Counter-in-Kernel/"/>
<id>http://freemanhsu.github.io/Add-Schedule-Counter-in-Kernel/</id>
<published>2015-05-04T15:03:31.000Z</published>
<updated>2015-05-05T04:55:46.000Z</updated>
<content type="html"><![CDATA[<h4 id="Objective">Objective</h4>
<p>Add a feature to the linux kernel, which records the total times a process is scheduled to be executed on CPU.</p>
<a id="more"></a>
<h4 id="Basic_Idea">Basic Idea</h4>
<p>Add a counter varible to the struct <b>task_struct</b>, init the counter varible to 0 when a process is created/forked. Every time the process is scheduled to be executed, increase the counter and write the number to a proc file.</p>
<h4 id="Details_of_how_to_modify_the_kernel">Details of how to modify the kernel</h4>
<h5 id="0-_Environment">0. Environment</h5>
<ul>
<li>VMware Fusion 7</li>
<li>Ubuntu 12.04.5</li>
<li>Kernel Version 3.18.8</li>
</ul>
<h5 id="1-_/include/linux/sched-h">1. /include/linux/sched.h</h5>
<h6 id="line#1234">line#1234</h6>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">struct</span> task_struct{</div><div class="line">+ <span class="keyword">unsigned</span> <span class="keyword">long</span> ctx;</div><div class="line"> ...</div><div class="line">}</div></pre></td></tr></table></figure>
<h5 id="2-_/kernel/fork-c">2. /kernel/fork.c</h5>
<h6 id="line#1622">line#1622</h6>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">long</span> do_fork(<span class="keyword">unsigned</span> <span class="keyword">long</span> clone_flags,</div><div class="line"> <span class="keyword">unsigned</span> <span class="keyword">long</span> stack_start,</div><div class="line"> <span class="keyword">unsigned</span> <span class="keyword">long</span> stack_size,</div><div class="line"> <span class="keyword">int</span> __user *parent_tidptr,</div><div class="line"> <span class="keyword">int</span> __user *child_tidptr){</div><div class="line"> </div><div class="line"> ...</div><div class="line"> </div><div class="line"> p = copy_process(clone_flags, stack_start, stack_size,</div><div class="line"> child_tidptr, NULL, trace);</div><div class="line"></div><div class="line"> + p->ctx = <span class="number">0</span>;</div><div class="line"> </div><div class="line"> ...</div><div class="line"> </div><div class="line"> }</div></pre></td></tr></table></figure>
<h5 id="3-_/kernel/sched/core-c">3. /kernel/sched/core.c</h5>
<h6 id="line#2864">line#2864</h6>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line">asmlinkage __visible <span class="keyword">void</span> __sched schedule(<span class="keyword">void</span>)</div><div class="line">{</div><div class="line"> <span class="keyword">struct</span> task_struct *tsk = current;</div><div class="line"></div><div class="line">+ tsk->ctx = tsk->ctx + <span class="number">1</span>;</div><div class="line"></div><div class="line"> sched_submit_work(tsk);</div><div class="line"> __schedule();</div><div class="line">}</div></pre></td></tr></table></figure>
<h5 id="4-_/fs/proc/base-c">4. /fs/proc/base.c</h5>
<h6 id="line_#319">line #319</h6>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line">+ <span class="comment">/*</span></div><div class="line">+ * Provides /proc/PID/ctx</div><div class="line">+ */</div><div class="line">+ <span class="keyword">static</span> <span class="keyword">int</span> proc_pid_ctx(<span class="keyword">struct</span> seq_file *m, <span class="keyword">struct</span> pid_namespace *ns,</div><div class="line">+ <span class="keyword">struct</span> pid *pid, <span class="keyword">struct</span> task_struct *task)</div><div class="line">+ {</div><div class="line">+ <span class="keyword">return</span> seq_printf(m, <span class="string">"%llu\n"</span>, (<span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="keyword">long</span>)task->ctx);</div><div class="line">+ }</div></pre></td></tr></table></figure>
<h6 id="line_#2603">line #2603</h6>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">+ ONE(<span class="string">"ctx"</span>, S_IRUGO, proc_pid_ctx),</div></pre></td></tr></table></figure>
<h6 id="line_#2949">line #2949</h6>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">+ ONE(<span class="string">"ctx"</span>, S_IRUGO, proc_pid_ctx),</div></pre></td></tr></table></figure>
<h5 id="5-_Compile">5. Compile</h5>
<h4 id="Results">Results</h4>
<h5 id="1-Test_Code">1.Test Code</h5>
<figure class="highlight C"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line"><span class="comment">// block.c</span></div><div class="line"><span class="preprocessor">#<span class="keyword">include</span> <stdio.h></span></div><div class="line"><span class="keyword">int</span> main(){</div><div class="line"> <span class="keyword">while</span>(<span class="number">1</span>) getchar();</div><div class="line"> <span class="keyword">return</span> <span class="number">0</span>;</div><div class="line">}</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">gcc block.c -o block</div><div class="line">./block</div></pre></td></tr></table></figure>
<h5 id="2-Find_the_process_id">2.Find the process id</h5>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">ps <span class="operator">-e</span> | grep block</div></pre></td></tr></table></figure>
<h5 id="3-Observe_the_counter">3.Observe the counter</h5>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">cd</span> /proc/[PID]</div><div class="line">cat ctx</div></pre></td></tr></table></figure>
<h5 id="4-Increse_the_counter">4.Increse the counter</h5>
<p>Type anything to the block process to make it scheduled to be executed and check the content of ctx file again.</p>
<h5 id="5-End">5.End</h5>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">kill [PID]</div></pre></td></tr></table></figure>
]]></content>
<summary type="html">
<![CDATA[<h4 id="Objective">Objective</h4>
<p>Add a feature to the linux kernel, which records the total times a process is scheduled to be executed on CPU.</p>
]]>
</summary>
<category term="Linux Kernel" scheme="http://freemanhsu.github.io/tags/Linux-Kernel/"/>
<category term="Operating System" scheme="http://freemanhsu.github.io/categories/Operating-System/"/>
</entry>
<entry>
<title><![CDATA[File Transfer Server & Client]]></title>
<link href="http://freemanhsu.github.io/File-Transfer-Server-Client/"/>
<id>http://freemanhsu.github.io/File-Transfer-Server-Client/</id>
<published>2015-04-20T16:37:09.000Z</published>
<updated>2015-04-20T17:02:53.000Z</updated>
<content type="html"><![CDATA[<h3 id="Socket_Programming_Practice">Socket Programming Practice</h3>
<ul>
<li>File Transfer Server & Client </li>
<li>Ftp Client</li>
</ul>
<h3 id="File_Transfer_Server_&_Client">File Transfer Server & Client</h3>
<p><a href="https://github.com/FreemanHsu/socketFTP" target="_blank" rel="external">repo here</a></p>
<a id="more"></a>
<p>In this part, I implemented a pair of file transfer server and client without reading the ftp protocol, which turned out to be naive compared to the ftp. Still I learned much from this experience, about socket programming and pit falls.</p>
<p>Here is a brief introduction of my implementation.</p>
<h4 id="Screenshot">Screenshot</h4>
<p><img src="../images/screenshot.png" alt="screentshot"></p>
<h4 id="Commands">Commands</h4>
<ul>
<li>help</li>
<li>ls</li>
<li>cd remote-dir</li>
<li>append local-file [remote-file]</li>
<li>get remote-file [local-file]</li>
<li>delete remote-file</li>
<li>pwd</li>
<li>bye</li>
</ul>
<p>The server starts on a specified port, waiting for the clients to connect.<br>When clients successfully connect to the server, try the given commands to view, cd into or out of the server folders, to upload or download the files, to indicate the current working directory or delete files on the server, or just say goodbye to the server.</p>
<h4 id="Here_are_some_features_supported:">Here are some features supported:</h4>
<ul>
<li>Varied length of message delivery by indication with a prefix.</li>
<li>Multiple clients connection.</li>
<li>If necessary, create the base directory for the file transfer server.</li>
<li>Clients can never go out of the range of the base directory, spoiling the files on the server.</li>
<li>Show process of uploading and downloading.</li>
<li>Prompts for append/get commands.</li>
</ul>
<h3 id="Ftp_Client">Ftp Client</h3>
<p>Currently a prototype, connecting to an existing ftp server.</p>
<p>Todo: fully-fledged ftp client.</p>
]]></content>
<summary type="html">
<![CDATA[<h3 id="Socket_Programming_Practice">Socket Programming Practice</h3>
<ul>
<li>File Transfer Server & Client </li>
<li>Ftp Client</li>
</ul>
<h3 id="File_Transfer_Server_&_Client">File Transfer Server & Client</h3>
<p><a href="https://github.com/FreemanHsu/socketFTP" target="_blank" rel="external">repo here</a></p>
]]>
</summary>
<category term="socket" scheme="http://freemanhsu.github.io/tags/socket/"/>
<category term="networking" scheme="http://freemanhsu.github.io/categories/networking/"/>
</entry>
<entry>
<title><![CDATA[阿里面试小结]]></title>
<link href="http://freemanhsu.github.io/Alibaba-Interview/"/>
<id>http://freemanhsu.github.io/Alibaba-Interview/</id>
<published>2015-04-20T13:39:45.000Z</published>
<updated>2015-04-20T15:40:28.000Z</updated>
<content type="html"><![CDATA[<p>阿里前端实习生,上海招聘点。第一次求职面试经历欢乐多。</p>
<h3 id="正经话">正经话</h3>
<h6 id="第一轮_技术面">第一轮 技术面</h6>
<p>自我介绍的时候扫一遍简历,问题基本上是基于简历上的内容,偏向语言特性、框架原理等较基础的部分。例如:<br><a id="more"></a></p>
<ul>
<li>解释一下JS的闭包</li>
<li>比较一下你用过的动态语言</li>
<li>评价一下JS,它有哪些优势劣势</li>
<li>Angular框架的原理</li>
<li>实际项目中Angular给你带来哪些好处?坏处?</li>
<li>诸如grunt,less等工具你是怎么使用的?</li>
<li>Python和JS更喜欢哪个?</li>
<li>前端学习路线</li>
</ul>
<p>项目经历稍加提问,关于技术选型的考虑,项目过程中遇到的困难等。面试过程中开着作品网站、github,可能开着blog,有种囊中羞涩的感觉……<br>有趣的一个问题是当场翻译一篇不知是论文还是技术报告中的两个段落,关于数据可视化的内容,应该因为是我把四六级成绩写在了简历上……上下文信息有限的情况下,还有点小紧张呢LOL…<br>总体来说,作为上海招聘点第一个进去面试(提前20分钟…)的同学,处于“啊哈哈,我是第一个”的自信(哪门子自信…)和“我了个去,来得好突然啊”的发懵的叠加态中,花了点时间才进入状态,所幸面试官非常Nice,节奏不快。第二轮的时候不小心瞄到了第一轮的成绩,似乎是A…… ^0^</p>
<h6 id="第二轮_技术面">第二轮 技术面</h6>
<p>第二轮面得超开心!<br>二面来到了二楼小包间,面试官我猜是资深的前端工程师,然而甚有设计师的感觉……<br>在面试官浏览简历的过程中作自我介绍,讲一两个实践过程中遇到的困难或收获,要求不讲简历上写的东西。于是我就把操作系统课设和最近的socket编程搬出来了……<br>接着就来到了今天最愉快的部分!大约30-40分钟的时间,对着我的网站作品,逐次分析探讨实现的方法和可能改进的部分,点评甚至给与一些建议,包括:</p>
<ul>
<li>整个网站的技术架构选型和由来,优劣分析</li>
<li>Restful API的设计</li>
<li>HTTP请求数据大小和请求数之间是否需要tradeoff和解决方案</li>
<li>网站响应式布局处理得不是很到位,实现响应式布局的设计和实现思路</li>
<li>其中举例三栏布局的响应式处理,考虑SEO</li>
<li>前端框架下的SEO处理</li>
</ul>
<p>嗯,我是去学习的……<br>整个面试过程基本围绕项目展开,唯一的程序题是实现getElementByClass的实现思路和优化思路。<br>之后介绍了一些我想加入事业部的情况,聊了一些关于hybrid开发相关的内容。总之,整个过程轻松愉快,获益匪浅。开心的。</p>
<h6 id="第三轮_HR面">第三轮 HR面</h6>
<p>HR姐姐自始至终笑得都好开心!我也好开心……<br>聊天/提问由果及因,从现在来应聘前端工程师,一点点挖掘我的成长经历,怎么就想<del>不开</del>来做前端了呢。直至追溯至“那一年,我高一……”嗯,我也吃了一惊呢2333……</p>
<h6 id="小结">小结</h6>
<p>综合小伙伴们的情况,第一轮技术面可能侧重语言层面,第二轮技术面可能侧重项目相关,毫无疑问至少一开始不会脱离简历提问。HR面的情况就迥异得多。<br>总之,诚实、诚恳,展现思考的过程很重要;有项目比没项目好得多;我凑不出第三句来了。</p>
<h3 id="Fun_Facts">Fun Facts</h3>
<ul>
<li>我是第一个来到上海招聘点的同学…</li>
<li>我是第一个面试的同学,并且提前了20分钟,面试官说:我就是按了一下测试…算了我们开始吧…</li>
<li>所以可能有那么十五二十分钟,呼叫大屏幕上只有孤零零的我的名字?</li>
<li>面试之后认识了一个致远数学的哥们:他的同学是我高中的好基友,他的女朋友的室友的男朋友是我高中的另一个好基友,他的好基友是我高中的好球友……嗯,我们怎么才认识?</li>
<li>大约9点左右的时候,在调试呼叫大屏幕,可能想在候场室放音乐所以打开了百度fm,随机的第一首歌是——《青春再见》…</li>
<li>嗯,再见……</li>
</ul>
]]></content>
<summary type="html">
<![CDATA[<p>阿里前端实习生,上海招聘点。第一次求职面试经历欢乐多。</p>
<h3 id="正经话">正经话</h3>
<h6 id="第一轮_技术面">第一轮 技术面</h6>
<p>自我介绍的时候扫一遍简历,问题基本上是基于简历上的内容,偏向语言特性、框架原理等较基础的部分。例如:<br>]]>
</summary>
<category term="Interview" scheme="http://freemanhsu.github.io/tags/Interview/"/>
<category term="Andy's Notes" scheme="http://freemanhsu.github.io/categories/Andy-s-Notes/"/>
</entry>
<entry>
<title><![CDATA[Failing to Connect to Rails Server on VM]]></title>
<link href="http://freemanhsu.github.io/Failing-to-Connect-to-Rails-Server-on-VM/"/>
<id>http://freemanhsu.github.io/Failing-to-Connect-to-Rails-Server-on-VM/</id>
<published>2015-04-07T11:24:40.000Z</published>
<updated>2015-04-07T11:52:36.000Z</updated>
<content type="html"><![CDATA[<p>I’ve been using vagrant to set up ruby on rails project environment, which is best practice in my opinion. One can perfectly and easily have a clean envrionment, in my case, ubuntu64 to put the whole rails server in while coding in familiar platform using favourite editor.</p>
<p>Usually, I would type in shell the following commands</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">vagrant up</div><div class="line">vagrant ssh</div><div class="line"><span class="built_in">cd</span> <project folder></div><div class="line">rails s</div></pre></td></tr></table></figure>
<a id="more"></a>
<p>the server is up and I can open Chrome on MacOS and type in <a href="#">[project-name].dev:3000</a> to have a look at the website under development. <a href="#">[project-name].dev</a> is an alias to the IP address of the virtual machine. It’s all beautiful.</p>
<p>However, when I set up a new project today as usual and open up a browser, the server did not respond.</p>
<p>At first I thought it was the rails’s problem. So I tried to connect to the server locally with telnet.</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">telnet localhost <span class="number">3000</span></div><div class="line">GET / HTTP/<span class="number">1.0</span></div><div class="line">Content-Type:text/html; charset=UTF-<span class="number">8</span></div></pre></td></tr></table></figure>
<p>which performed perfectly.</p>
<p>It turns out that when I http request <a href="#">[project-name].dev:3000</a>, the server received nothing at all. Though I still don’t get what’s different from the previous ones, I forced the server listen to the ip address on start up and the problem is solved.</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">rails s -b <span class="number">192.168</span>.<span class="number">34.34</span></div></pre></td></tr></table></figure>
<p>The server listens to <a href="#">http://localhost:3000</a> by default, then the problem is how the previous ones worked… LOL</p>
]]></content>
<summary type="html">
<![CDATA[<p>I’ve been using vagrant to set up ruby on rails project environment, which is best practice in my opinion. One can perfectly and easily have a clean envrionment, in my case, ubuntu64 to put the whole rails server in while coding in familiar platform using favourite editor.</p>
<p>Usually, I would type in shell the following commands</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">vagrant up</div><div class="line">vagrant ssh</div><div class="line"><span class="built_in">cd</span> <project folder></div><div class="line">rails s</div></pre></td></tr></table></figure>
]]>
</summary>
<category term="Ruby on Rails" scheme="http://freemanhsu.github.io/tags/Ruby-on-Rails/"/>
<category term="Ruby on Rails" scheme="http://freemanhsu.github.io/categories/Ruby-on-Rails/"/>
</entry>
<entry>
<title><![CDATA[Compiling Linux Kernel]]></title>
<link href="http://freemanhsu.github.io/Compiling-Linux-Kernel/"/>
<id>http://freemanhsu.github.io/Compiling-Linux-Kernel/</id>
<published>2015-03-06T03:20:02.000Z</published>
<updated>2015-03-30T13:01:58.000Z</updated>
<content type="html"><![CDATA[<p>To be prepared to make changes to the kernel, it’s necessary to give it a try to compile the linux kernel successfully.</p>
<h3 id="Environment">Environment</h3>
<ul>
<li>VMware Fusion 7</li>
<li>Ubuntu 12.04.5</li>
<li>Root permission</li>
</ul>
<a id="more"></a>
<h3 id="Objective">Objective</h3>
<p>Initially, the kernel version of the Ubuntu 12.04.5 is 3.13.0-32-generic according to </p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">uname -r</div></pre></td></tr></table></figure>
<p>If you wanna check your ubuntu version, use</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">cat /etc/issue</div></pre></td></tr></table></figure>
<p>Our goal is to update the version of kernel to newer one, in this case, 3.18.</p>
<h3 id="Compile_the_Linux_Kernel">Compile the Linux Kernel</h3>
<h5 id="1-_Download_the_kernel_from_here-">1. Download the kernel from <a href="http://www.kernel.org" target="_blank" rel="external">here</a>.</h5>
<h5 id="2-_Copy_to_a_directory_and_extract-">2. Copy to a directory and extract.</h5>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">cp linux-<span class="number">3</span>.X.X.tar.xz /usr/src</div><div class="line"><span class="built_in">cd</span> /usr/src</div><div class="line">xz <span class="operator">-d</span> linux-<span class="number">3</span>.X.X.tar.xz</div><div class="line">tar -xf linux-<span class="number">3</span>.X.X.tar</div><div class="line"><span class="built_in">cd</span> linux-<span class="number">3</span>.X.X</div></pre></td></tr></table></figure>
<h5 id="3-_If_not_the_first_time_to_compile">3. If not the first time to compile</h5>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">make clean</div><div class="line">make mrproper</div></pre></td></tr></table></figure>
<h5 id="4-_Configuration">4. Configuration</h5>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">make menuconfig</div></pre></td></tr></table></figure>
<p>There might be a tiny prob here saying</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">fatal error: curses.h: No such file or directory</div></pre></td></tr></table></figure>
<p>Solution under Ubuntu:</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">sudo</span> apt-get install libncurses5-dev libncursesw5-dev</div></pre></td></tr></table></figure>
<h5 id="5-_Compile">5. Compile</h5>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">make</div><div class="line">make modules_install</div><div class="line">make install</div></pre></td></tr></table></figure>
<p>Suggestion here: enlarge the memory size of your virtual system, which may help reduce the compiling time dramatically.</p>
<p>It takes hours to compile with 1 core and 1-GB memory with GUI turned on…</p>
<h5 id="6-_Update_GRUB">6. Update GRUB</h5>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">cd</span> /boot</div><div class="line">mkinitramfs <span class="number">3.18</span>.<span class="number">8</span> -o initrd.img-<span class="number">3.18</span>.<span class="number">8</span></div><div class="line">cp /usr/src/linux-<span class="number">3.18</span>.<span class="number">8</span>/arch/x86_64/boot/bzImage /boot/vmlinuz-<span class="number">3.18</span>.<span class="number">8</span></div><div class="line">ln <span class="operator">-s</span> /boot/System.map-<span class="number">3.18</span>.<span class="number">8</span> /boot/System.map</div><div class="line"><span class="built_in">sudo</span> update-grub2</div></pre></td></tr></table></figure>
<h5 id="7-_Reboot_and_Check!">7. Reboot and Check!</h5>
]]></content>
<summary type="html">
<![CDATA[<p>To be prepared to make changes to the kernel, it’s necessary to give it a try to compile the linux kernel successfully.</p>
<h3 id="Environment">Environment</h3>
<ul>
<li>VMware Fusion 7</li>
<li>Ubuntu 12.04.5</li>
<li>Root permission</li>
</ul>
]]>
</summary>
<category term="Linux Kernel" scheme="http://freemanhsu.github.io/tags/Linux-Kernel/"/>
<category term="Operating System" scheme="http://freemanhsu.github.io/categories/Operating-System/"/>
</entry>
<entry>
<title><![CDATA[Start a Rails Project]]></title>
<link href="http://freemanhsu.github.io/Start-a-Rails-Project/"/>
<id>http://freemanhsu.github.io/Start-a-Rails-Project/</id>
<published>2015-02-19T15:25:48.000Z</published>
<updated>2015-03-30T13:03:28.000Z</updated>
<content type="html"><![CDATA[<h2 id="Step_by_Step">Step by Step</h2>
<h3 id="Step_1">Step 1</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">mkdir <project name> </div><div class="line"><span class="built_in">cd</span> <project name></div><div class="line">vagrant init ubuntu/trusty64</div><div class="line">vagrant up</div></pre></td></tr></table></figure>
<a id="more"></a>
<h3 id="Step_2">Step 2</h3>
<p>Change the memory size, which is necessary for developing.<br>We also give the virtual machine a fixed IP address for convenience.<br>Modify Vagrantfile with your favourite editor, adding the following lines.</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">config.vm.provider <span class="string">"virtualbox"</span> <span class="keyword">do</span> |v|</div><div class="line"> v.memory = <span class="number">2048</span></div><div class="line">end</div><div class="line">config.vm.network :private_network, ip: <span class="string">"192.168.33.33"</span></div></pre></td></tr></table></figure>
<p>and then </p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vagrant reload</div></pre></td></tr></table></figure>
<p>More for IP address,</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">sudo</span> vim /etc/hosts</div></pre></td></tr></table></figure>
<p>and add</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="number">192.168</span>.<span class="number">33.33</span> <project name>.dev</div></pre></td></tr></table></figure>
<h3 id="Step_3">Step 3</h3>
<p>Time for installing rails.</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vagrant ssh</div></pre></td></tr></table></figure>
<p>and type in following lines one by one</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">sudo</span> apt-get update</div><div class="line"><span class="built_in">sudo</span> apt-get install -y git-core curl zlib1g-dev build-essential \</div><div class="line"> libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 \</div><div class="line"> libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common</div></pre></td></tr></table></figure>
<p>Install rbenv, which is a tool for installing ruby and version control of ruby.</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">cd</span> </div><div class="line">git clone git://github.com/sstephenson/rbenv.git .rbenv</div><div class="line"><span class="built_in">echo</span> <span class="string">'export PATH="$HOME/.rbenv/bin:$PATH"'</span> >> ~/.bashrc</div><div class="line"><span class="built_in">echo</span> <span class="string">'eval "$(rbenv init -)"'</span> >> ~/.bashrc</div><div class="line">git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build</div><div class="line"><span class="built_in">echo</span> <span class="string">'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"'</span> >> ~/.bashrc</div><div class="line"><span class="keyword">exec</span> <span class="variable">$SHELL</span></div></pre></td></tr></table></figure>
<p>Now is ruby</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">rbenv install <span class="number">2.1</span>.<span class="number">2</span></div><div class="line">rbenv global <span class="number">2.1</span>.<span class="number">2</span></div></pre></td></tr></table></figure>
<p>Next is rails</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">echo</span> <span class="string">"gem: --no-ri --no-rdoc"</span> > ~/.gemrc</div></pre></td></tr></table></figure>
<p>This is for simplicity.</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">gem install rails -v <span class="number">4.1</span>.<span class="number">2</span></div><div class="line">rbenv rehash</div></pre></td></tr></table></figure>
<p>Now database.</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">sudo</span> apt-get install mysql-server mysql-client libmysqlclient-dev</div></pre></td></tr></table></figure>
<p>Environment ready!</p>
<p><a href="http://happypeter.github.io/rails10/" target="_blank" rel="external">Reference</a></p>
]]></content>
<summary type="html">
<![CDATA[<h2 id="Step_by_Step">Step by Step</h2>
<h3 id="Step_1">Step 1</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">mkdir <project name> </div><div class="line"><span class="built_in">cd</span> <project name></div><div class="line">vagrant init ubuntu/trusty64</div><div class="line">vagrant up</div></pre></td></tr></table></figure>
]]>
</summary>
<category term="Ruby on Rails" scheme="http://freemanhsu.github.io/tags/Ruby-on-Rails/"/>
<category term="Ruby on Rails" scheme="http://freemanhsu.github.io/categories/Ruby-on-Rails/"/>
</entry>
<entry>
<title><![CDATA[Hello Hexo]]></title>
<link href="http://freemanhsu.github.io/Hello-Hexo/"/>
<id>http://freemanhsu.github.io/Hello-Hexo/</id>
<published>2015-02-04T15:50:31.000Z</published>
<updated>2015-03-30T13:00:59.000Z</updated>
<content type="html"><![CDATA[<p>After going through blog systems as wordpress, jekyll, farbox, etc. Downloading, configuring, deploying, writing one episode or two and turn to another one…</p>
<a id="more"></a>
<p>Okay, here I am, with Hexo! Why Hexo? I finally realized that what’s important is keep blogging when I happened to try Hexo… </p>
<h3 id="LOL">LOL</h3>
<h3 id="Keep_Blogging-">Keep Blogging.</h3>
]]></content>
<summary type="html">
<![CDATA[<p>After going through blog systems as wordpress, jekyll, farbox, etc. Downloading, configuring, deploying, writing one episode or two and turn to another one…</p>
]]>
</summary>
</entry>
</feed>