<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6256145082126410735</id><updated>2024-09-02T14:40:34.235+08:00</updated><title type='text'>Angus</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-1055648153550137231</id><published>2023-01-02T18:34:00.001+08:00</published><updated>2023-01-10T10:33:59.334+08:00</updated><title type='text'>Create calendar with Excel formula and conditional formatting Part 2</title><content type='html'>&lt;p&gt;It is 2023 and I made an improved version of the &lt;a href=&quot;https://angusdev.blogspot.com/2022/09/create-calendar.html&quot; target=&quot;_blank&quot;&gt;Excel Calendar&lt;/a&gt; with a neat design and highlight the holidays.&lt;/p&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;384&quot; data-original-width=&quot;600&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAZZIBJ59MjuDMvkwwxgSeN45dCM4bhbDkz1b7YSju-xV37ap-4zrgqIkpgbRuDD73bZr0Di9C8tqGL3A9vG6pV0f1Ff-RQfPagw936SrYHj0K3T9R3fl0xW3_7Jfsev32QMa5wjIva6vo_OkuA5GG23N2Z1xQYpNoPjZshaZVnWem9u2OBtKrvUv-/s600/calendar2.gif&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;Day of Week Header&lt;/h2&gt;
&lt;p&gt;Firstly, input the year in cell &lt;code&gt;$B$1&lt;/code&gt; and create the day of week header.  The day of week header only apply in row 2 and we use &lt;code&gt;ROW()&lt;/code&gt; to ensure this.&lt;/p&gt;
&lt;p&gt;In cell &lt;code&gt;B1&lt;/code&gt;, type the below formula and copy to &lt;code&gt;B1:H1&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;=IF(ROW()=2,TEXT(COLUMN(),&quot;ddd&quot;))&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;151&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv7tjwfj0lDGtJmLq5d2AILsBWv73z-cGbJbZfnL2Vlb578tyzMjO5G5Ac-Fp3bsq7nuS32fx-vj_Bqh-OB4mswyNcepdYIr_uBGfHuKlnBBe9YDSxI7IVW4HUFQG41IxFhQl9G-lB72tuskhfJLklaXPonoq4wsIb1d5bVXNRrMih2fl0LAhe4fH2/s838/calendar2-a.png&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;Day of the year&lt;/h2&gt;
&lt;p&gt;To construct the calendar, we fill up the cells with the day of the year (0-365). We need to offset by &lt;code&gt;WEEKDAY(DATE($B$1, 1, 1)&lt;/code&gt; so day 0 fit in the correct day of week. It may not be easily noticed ince 1-Jan of 2023 is Sunday. It will be more clear if change the year to 2022.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;=IF(ROW()=2,TEXT(COLUMN(),&quot;ddd&quot;),&lt;span style=&quot;color: red;&quot;&gt;(ROW()-3)*7+COLUMN()-WEEKDAY(DATE($B$1,1,1))&lt;/span&gt;)&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;151&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqd9cukjc9e_c5HsobFGF_bfqYkDSIW83hxCoL-lTujS_1BOFHMEKn3EHq_S55hF9rNuk5kDAe_Jx-f1BFmJBwLnejsvYUHGU8KyKfrK128MX7if6fGWmWgCOj2a-3KPs8mn-kW0g6HDt-pQeR0qjKIzlslBATj8AB0uwFjXQGtQcYr3AW3K-KLuMf/s838/calendar2-b.png&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;151&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjel6iXYgqiaf2U9qAZRCakLVWzWRLUBKhNWk0Zu_HefSVNrj83R9Xa30XV-471L3QwqpLU6hLMtBg3YlzJMeEvEvPrHYCZLzLmus7UJfC4X7il1jQhXHWVDgnP8CJi_1K_eqs0apXR4MaFPMEo62heFRKAqtsUc8uuS-k5rXrarFr0UouDNfQqw094/s838/calendar2-c.png&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;Date Value&lt;/h2&gt;
&lt;p&gt;Now we add the first day of the year to to make it a date value so we can use conditional formatting to format it. Here we use &lt;code&gt;TEXT()&lt;/code&gt; to format the date for verification only. This will be removed in actual formula.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;=IF(ROW()=2,TEXT(COLUMN(),&quot;ddd&quot;),&lt;span style=&quot;color: #3d85c6;&quot;&gt;TEXT(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;DATE($B$1,1,1)+&lt;/span&gt;(ROW()-3)*7+COLUMN()-WEEKDAY(DATE($B$1,1,1))&lt;span style=&quot;color: #3d85c6;&quot;&gt;,&quot;yy-mm-dd&quot;)&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;151&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIZdRBbhLc7QY1JmubloeAY2VIZVjS1VLeoM6fbNT9PZTYI0Oq6k49qBok1CnU5_bLZkufHlpMIq0V08P5aXQMfQD-ciias82XaGdrlHRjvjK5_eS_KaF4KIK2S4MdzW_mfBq3POCHEUz5MLEdUohc9Ukhp0TRQiwLBy4lIK8HePVCFYxcRoRyToPC/s838/calendar2-d.png&quot; /&gt;&lt;/div&gt;

&lt;p&gt;Hide the date that does not match the input year.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;=IF(ROW()=2,TEXT(COLUMN(),&quot;ddd&quot;),&lt;span style=&quot;color: red;&quot;&gt;IF(YEAR(DATE($B$1,1,1)+(ROW()-3)*7+COLUMN()-WEEKDAY(DATE($B$1,1,1)))=$B$1,&lt;/span&gt;DATE($B$1,1,1)+(ROW()-3)*7+COLUMN()-WEEKDAY(DATE($B$1,1,1))&lt;span style=&quot;color: red;&quot;&gt;,&quot;&quot;)&lt;/span&gt;)&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;289&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaRyj7ypkGv_pcZ2qRXOJ73S-aJifoM6eS5Q8vHlJenxJyHYKYhV9wXrhN4Tpal--QZz0x2tTDr2XWq4Ejrt5N0yGhhtB17VzZeODM0KAiZBbmqlPNoKUB7SexFhLNVFarrMWHkyCUC6XU0lqtqujNg_ezaPx92bMOqL2OKTeLNC-5efXSz2X_UcNr/s838/calendar2-e.png&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;Fill up the worksheet&lt;/h2&gt;
&lt;p&gt;Copy the formula to cell &lt;code&gt;A2:G55&lt;/code&gt; to fill up the whole year&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;Format the calendar with Conditional Formatting&lt;/h2&gt;

&lt;p&gt;We then apply conditional formatting to format the calendar.  Since the cell value is already a &lt;code&gt;Date&lt;/code&gt;.  We can use the date format to show the month name or day of month number.&lt;/p&gt;
&lt;p&gt;Select column &lt;code&gt;A:G&lt;/code&gt; and apply below Conditional Formatting:&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;Show month name&lt;/h3&gt;
&lt;p&gt;Use custom format &lt;code&gt;mmm&lt;/code&gt; to show the month name in the first day of the month&lt;/p&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;Formula:&lt;/h4&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;=AND(ROW()&amp;gt;2,DAY(A1)=1)&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;Format:&lt;/h4&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Number -&amp;gt; Custom -&amp;gt; &quot;mmm&quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;573&quot; data-original-width=&quot;600&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAex8E0ZoNnF3rvUnzL08XPm2aY5zEqygpI1D2Fc6jyJlGXJDyUui8Q2AfHJi2qkvMVA3aCD6Qns1BFC0s62niFeK9FiIgscGNCYU9fnBh-dGmdV1Uj7fzC3S7giXjegRTpzUojTX2e_qR1SKT2XZmrqMnoKidHquRzRpiU3f_D9SRx1N0XhHRONmL/s600/calendar2-f.png&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;298&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxJmogXqKONcCogY7ETF9Bj8hFui5Mid7F7XTHFdvglrz2miSIJGmfLvKafhCICqbwZ6j4t6VTaH4OZuAnfdzHI2rOoaLqj0u7MMKTkTeFo-hFTWwrO00BjXG64-Il-ZPO-hCqniRi8g9gUI3eANnbOpctjUqQspAogJXWj2A7S-mIavIs3B4Ht7S5/s838/calendar2-g.png&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h3&gt;Day number&lt;/h3&gt;
&lt;p&gt;Use custom format &lt;code&gt;d&lt;/code&gt; to show the day number of remaining days of the month&lt;/p&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;Formula:&lt;/h4&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;=AND(ROW()&amp;gt;2,DAY(A1)&amp;gt;1)&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;Format:&lt;/h4&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;Number -&amp;gt; Custom -&amp;gt; &quot;d&quot;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;573&quot; data-original-width=&quot;600&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWJdImP08EqwqOa7MufQQ-sGFcGaXFEVHoGFCx5EI_XptAjA37xoiYYwGHilYF9q-c2p4Ns-ch-iz7rjYQ-dC_gVUQLn_Jq2iKOaQUfGgpTEg3DOJaC3MjDwLimKQeC66UlrTgbokBuemaKsfDaxeNceu5u4Ga-L_ydofEFJqQ0VC8ahUDOcc-Hxp_/s600/calendar2-h.png&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;298&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinsBDVExS4CiDfhEAPp5AqfHUAV-N3RkwHiIkofIh2tRmsKWhF2xJEdYC7JuEAUQjO-WjNmllQIdviDhn2j9tb0r4xurPXjBwYepREnLO5CKaL_G0RR7UWDY-BsWruwi8flYiPzXzJrYJoI3LB3WpySFDwVVbUC1qs-lpwCUMZvOFo9BW4ch_LIwE3/s838/calendar2-i.png&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;Border of month&lt;/h3&gt;
&lt;p&gt;Add a bottom border if reach end of the month (i.e. the day of month of next row is smaller than current cell&lt;/p&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;Formula&lt;/h4&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;=IF(ROW()&amp;lt;=2,TRUE,IF(A1=&quot;&quot;,A2&amp;lt;&amp;gt;&quot;&quot;,IF(A2=&quot;&quot;,TRUE,DAY(A1)&amp;gt;DAY(A2))))&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;Format:&lt;/h4&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Border -&amp;gt; Bottom border&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;298&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfeSKxPx1k24tc73lmYvWVpKm0CNLyAtDCzwdbt5foFHt7I0_Zw2PlWbtW9vadU6hdeVsDyO0OhBO5GuhRsOFcOyKVH-6R2ZlHYS-sVu-dWY8GUzfuvfcocABb0dzMbwIPUb8XCVQcuAW73_cLBkH08Bl0dbFu3AGF9ELhe8go94uowLGGkH-J-svi/s838/calendar2-j.png&quot; /&gt;&lt;/div&gt;

&lt;p&gt;Add a right border for the last day of the month (i.e. the cell in the right is &quot;1&quot;)&lt;/p&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;Formula&lt;/h4&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;=AND(ROW()&amp;gt;2,IF(AND(COLUMN()&amp;lt;7,B1=&quot;&quot;),A1&amp;lt;&amp;gt;&quot;&quot;,DAY(B1)=1))&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;Format&lt;/h4&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;Border -&amp;gt; Right border&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;298&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHMK0ipXa_2QGyw1AnsM_CU_YaqFtcYbyBKUd7Uwk-06JkHiFbOIsd3t22vDNRzk0RvwkWQSTmsqTQaF_-ytOp-y4K_UxXLcgEa-y6rDrJuAKPPiPycDKYOtvrz5-ehWpmlqyxPGYNcfN1w0itcSJ94_Oafnh1cR4Y6POjjkVNv5UIz7C3-y6siHkW/s838/calendar2-k.png&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;Holiday&lt;/h3&gt;
&lt;p&gt;We highlight Saturday and Sunday in red.  Also we can input the holiday and use &lt;code&gt;Vlookup&lt;/code&gt; to mark the day as holiday as well.&lt;/p&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;Formula&lt;/h4&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;=AND(ROW()&amp;gt;1,A1&amp;lt;&amp;gt;&quot;&quot;,OR(COLUMN()=1,COLUMN()=7,NOT(ISNA(VLOOKUP(A1,$J:$J,1,FALSE)))))&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;Format&lt;/h4&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;Font -&amp;gt; Color -&amp;gt; Red&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;298&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhygG9EmiI0Y71gCDv9IJtcDpEcA8rV4GlCCJKmDpxcXVne221qDNwvISW-GvDPK8qWTkEvBSk8NkqGGt6OMqAPS_JNqOGYLu-DbwcaxpCssAYCvpcnRrq8qK_CQKZCvHPNS5-wdf6IOMv5J83vo1tpuaE96t2Nfec0Gih-nGtuQ_zqiEfqQbBtlsxj/s838/calendar2-l.png&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
  
&lt;/h2&gt;&lt;h2&gt;Protect Sheet&lt;/h2&gt;
&lt;p&gt;In last step, we unlock the cell &lt;code&gt;$B$1&lt;/code&gt; for input the year, and protect the worksheet&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;533&quot; data-original-width=&quot;600&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2cn9g03Aes0Pga_mnX3f0nF10WEv5Tz7rT1lAQcr1i6Rp4tLw76AowmTbzms_hz0jGhJsTZC_OB3KkvTnEMqO6DlPQZrB3m_SXyPmXvrWh-feMsU-_hhVFZxTJyaMfXJXbRL1lgOl7pw3aeJc9CCt69Qm5DGO-OI5K_QdkyQ-CL9vUb7kJotbkSU2/s600/calendar2-m.png&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;344&quot; data-original-width=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW31ca4WSB6WwG9PulPolMz678L-CrjgK5yu0ddbUkcS2VRh7XpxZSOLOk8TIFZ8i5B5dcSkiMa4SjGnsTMK3sN9xuSUJACV-DOKDQ0YCPXW8BXMtVq0LWZ9aUsm9kowwAMqV_mNJLnL9QNqwl768gatj9IGza0ijxZL_aCt2U0V3K2AHNmF3iXHur/s300/calendar2-n.png&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;384&quot; data-original-width=&quot;600&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAZZIBJ59MjuDMvkwwxgSeN45dCM4bhbDkz1b7YSju-xV37ap-4zrgqIkpgbRuDD73bZr0Di9C8tqGL3A9vG6pV0f1Ff-RQfPagw936SrYHj0K3T9R3fl0xW3_7Jfsev32QMa5wjIva6vo_OkuA5GG23N2Z1xQYpNoPjZshaZVnWem9u2OBtKrvUv-/s600/calendar2.gif&quot; /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/1055648153550137231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/1055648153550137231' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/1055648153550137231'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/1055648153550137231'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2023/01/create-calendar-with-excel-formula-and.html' title='Create calendar with Excel formula and conditional formatting Part 2'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAZZIBJ59MjuDMvkwwxgSeN45dCM4bhbDkz1b7YSju-xV37ap-4zrgqIkpgbRuDD73bZr0Di9C8tqGL3A9vG6pV0f1Ff-RQfPagw936SrYHj0K3T9R3fl0xW3_7Jfsev32QMa5wjIva6vo_OkuA5GG23N2Z1xQYpNoPjZshaZVnWem9u2OBtKrvUv-/s72-c/calendar2.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-3230208292327560695</id><published>2022-12-18T01:30:00.005+08:00</published><updated>2022-12-20T01:48:04.512+08:00</updated><title type='text'>Revisit Microsoft Style Guide in 2022</title><content type='html'>&lt;p&gt;&lt;img border=&quot;0&quot; class=&quot;float&quot; data-original-height=&quot;1020&quot; data-original-width=&quot;806&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJmr4n2aFiOB5IQBhKMe3Wiex_cUDEQbjIZ1-KPlvWNr6YUdPgY8TPm0ju6NSHSGSc7E8G2RlVONjoXkFBlcd1tZ0EUXuzqzN4B41IyZ5XnLa9pIiWFt7RuBJInMilF8aI6VFdR1wzZFHggyupAYZisyeeOLGnK5wEaKmppzE8RHZJ3G-i0L5jGe-a/w158-h200/manual-of-style.png&quot; width=&quot;158&quot; /&gt;In 2009 I &lt;a href=&quot;https://angusdev.blogspot.com/2009/05/microsoft-manual-of-style.html&quot;&gt;blogged&lt;/a&gt; about&amp;nbsp;Microsoft Manual of Style (now is called &lt;a href=&quot;https://learn.microsoft.com/en-us/style-guide/welcome/&quot; target=&quot;_blank&quot;&gt;Microsoft Style Guide&lt;/a&gt;) and list some interesting terms.&amp;nbsp; At that time I were referring to the 3rd edition which was published in 2004.&amp;nbsp; Today at 2022, let&#39;s revisit the list to see what terms are added, what are removed to have a quick review on how computing technology changes in past 18 years.&lt;/p&gt;&lt;div style=&quot;clear: both; padding-top: 15px;&quot;&gt;&lt;p&gt;New:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;New&amp;nbsp;technology (AI, Bluetooth, Blu-ray Disc, big data)&lt;/li&gt;&lt;li&gt;Social Media (chatbot, emoji, instant message, invite, profile)&lt;/li&gt;&lt;li&gt;Cloud related&lt;/li&gt;&lt;li&gt;Mobile related (touch-, wearable, mixed reality,&amp;nbsp;notification, rotate, swipe, tap)&lt;/li&gt;&lt;li&gt;Gaming (achievement, badge, e-sports)&lt;/li&gt;&lt;li&gt;Security (honeypot, malicious-, malware, multifactor authentication,&amp;nbsp; spyware, trojan)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Removed:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Legacy technology (CD (burn, rip), COM port, DOS, modem, diskette, push-to-talk, PCMCIA, VCR, VGA)&lt;/li&gt;&lt;li&gt;Low level computing (assembly language, DWORD, interrupt, linefeed, machine language)&lt;/li&gt;&lt;li&gt;Obseleted Microsoft products /technologies (COM, DOS, Front Page, NT, OLE, Winsock)&lt;/li&gt;&lt;li&gt;Early internet terms (webzine, net-, newsgroup, sitemap, Usenet, Weblication)&lt;/li&gt;&lt;li&gt;Pre-cloud (scale-up, virtual)&lt;/li&gt;&lt;li&gt;Intel (IA32, Itanium, Intel-based, x86)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Details:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;

&lt;table class=&quot;blog-table vertical-align-top&quot; style=&quot;vertical-align: top;&quot;&gt;
  &lt;tbody&gt;&lt;tr&gt;&lt;th&gt;New&lt;/th&gt;&lt;th&gt;Removed&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;achievement &lt;i&gt;(gaming)&lt;/i&gt;&lt;/li&gt;&lt;li&gt;active player&amp;nbsp;&lt;/li&gt;&lt;li&gt;AI&lt;/li&gt;&lt;li&gt;antimalware&lt;/li&gt;&lt;li&gt;antispyware&lt;/li&gt;&lt;li&gt;app&lt;/li&gt;&lt;li&gt;audiobook&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;access privileges&lt;/li&gt;&lt;li&gt;action bar&lt;/li&gt;&lt;li&gt;alt text&lt;i&gt; (html)&lt;/i&gt;&lt;/li&gt;&lt;li&gt;assembly language&lt;/li&gt;&lt;li&gt;audit trail&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;badge &lt;i&gt;(gaming)&lt;/i&gt;&lt;/li&gt;&lt;li&gt;big data&lt;/li&gt;&lt;li&gt;bio&lt;/li&gt;&lt;li&gt;Bluetooth&lt;/li&gt;&lt;li&gt;Blu-ray Disc&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;backward&lt;/li&gt;&lt;li&gt;bitmask&lt;/li&gt;&lt;li&gt;bitplane&lt;/li&gt;&lt;li&gt;bitwise&lt;/li&gt;&lt;li&gt;black hole&lt;i&gt; (networking)&lt;/i&gt;&lt;/li&gt;&lt;li&gt;bulleted&lt;/li&gt;&lt;li&gt;burn&lt;i&gt; (CD)&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;cell phone, cellular phone&lt;/li&gt;&lt;li&gt;cellular&lt;/li&gt;&lt;li&gt;center on&lt;/li&gt;&lt;li&gt;chatbot&lt;/li&gt;&lt;li&gt;check in&lt;/li&gt;&lt;li&gt;cloud&lt;/li&gt;&lt;li&gt;cloud platform&lt;/li&gt;&lt;li&gt;cloud services&lt;/li&gt;&lt;li&gt;community cloud&lt;/li&gt;&lt;li&gt;company vs. organization&lt;/li&gt;&lt;li&gt;compute&lt;/li&gt;&lt;li&gt;conversation as a platform (CaaP)&lt;/li&gt;&lt;li&gt;conversational user interface (CUI)&lt;/li&gt;&lt;li&gt;-core&lt;/li&gt;&lt;li&gt;cyber&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;caller ID&lt;/li&gt;&lt;li&gt;card&lt;/li&gt;&lt;li&gt;carrage return/line feed (CR/LF)&lt;/li&gt;&lt;li&gt;CBT &lt;i&gt;(computer-based training, now is called e-learning)&lt;/i&gt;&lt;/li&gt;&lt;li&gt;CD, CD case, CD key, CD Plus&lt;/li&gt;&lt;li&gt;certificate&lt;/li&gt;&lt;li&gt;channel&lt;/li&gt;&lt;li&gt;client area&lt;i&gt; (now is&amp;nbsp;desktop or workspace)&lt;/i&gt;&lt;/li&gt;&lt;li&gt;code signing&lt;/li&gt;&lt;li&gt;COM&lt;i&gt; (Component Object Model)&lt;/i&gt;&lt;/li&gt;&lt;li&gt;communication port &lt;i&gt;(COM port)&lt;/i&gt;&lt;/li&gt;&lt;li&gt;comprise&lt;/li&gt;&lt;li&gt;critical process monitor&lt;/li&gt;&lt;li&gt;critical section object&lt;/li&gt;&lt;li&gt;cursor&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;dark mode&lt;/li&gt;&lt;li&gt;deceptive software&lt;/li&gt;&lt;li&gt;DevOps&lt;/li&gt;&lt;li&gt;dynamic service capacity&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;data modem&lt;/li&gt;&lt;li&gt;diskette&lt;/li&gt;&lt;li&gt;Distributed File System&lt;/li&gt;&lt;li&gt;DOS&lt;/li&gt;&lt;li&gt;double word&lt;i&gt; (DWORD)&lt;/i&gt;&lt;/li&gt;&lt;li&gt;downlevel&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;e-discovery&lt;/li&gt;&lt;li&gt;elastic service capacity&lt;/li&gt;&lt;li&gt;e-learning&lt;/li&gt;&lt;li&gt;emoticons, emoji&lt;/li&gt;&lt;li&gt;End-User License Agreement (EULA)&lt;/li&gt;&lt;li&gt;e-sports&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;Editor&lt;/li&gt;&lt;li&gt;e-zine, webzine&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;family&lt;/li&gt;&lt;li&gt;fitness band&lt;/li&gt;&lt;li&gt;flick&lt;/li&gt;&lt;li&gt;flyout&lt;/li&gt;&lt;li&gt;freeze, frozen&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;facsimile&lt;/li&gt;&lt;li&gt;firewall&lt;/li&gt;&lt;li&gt;Fortran&lt;/li&gt;&lt;li&gt;Front Page&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;General Data Protection Regulation (GDPR)&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;Gantt chart&lt;/li&gt;&lt;li&gt;gateway&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;hang&lt;/li&gt;&lt;li&gt;hard-of-hearing&lt;/li&gt;&lt;li&gt;HDMI&lt;/li&gt;&lt;li&gt;hierarchical menu&lt;/li&gt;&lt;li&gt;high-level-language compiler&lt;/li&gt;&lt;li&gt;honeypot&lt;/li&gt;&lt;li&gt;hybrid cloud&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;hardware&lt;/li&gt;&lt;li&gt;high-level&lt;/li&gt;&lt;li&gt;highlight&lt;/li&gt;&lt;li&gt;hotfix&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;infrastructure as a service (IaaS)&lt;/li&gt;&lt;li&gt;instant message, IM&lt;/li&gt;&lt;li&gt;Internet of Things (IoT)&lt;/li&gt;&lt;li&gt;invite&lt;/li&gt;&lt;li&gt;IT pro, IT professional&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;IA-32-based&lt;/li&gt;&lt;li&gt;I-beam&lt;/li&gt;&lt;li&gt;independent content provider (ICP)&lt;/li&gt;&lt;li&gt;insertion point&lt;/li&gt;&lt;li&gt;Intel-based&lt;/li&gt;&lt;li&gt;Interrupt&lt;/li&gt;&lt;li&gt;inverse video&lt;/li&gt;&lt;li&gt;Itanium-based &lt;i&gt;(Intel CPU&amp;nbsp;architecture)&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;jwewl case&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;kludge&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;leading&lt;/li&gt;&lt;li&gt;license terms&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;line feed&lt;/li&gt;&lt;li&gt;localhost&lt;/li&gt;&lt;li&gt;look up&lt;/li&gt;&lt;li&gt;low-level&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;machine learning&lt;/li&gt;&lt;li&gt;malicious code, malicious user&lt;/li&gt;&lt;li&gt;malware, malicious software&lt;/li&gt;&lt;li&gt;mission critical&lt;/li&gt;&lt;li&gt;mixed reality&lt;/li&gt;&lt;li&gt;multifactor authentication&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;MAC (media access control)&lt;/li&gt;&lt;li&gt;machine language&lt;/li&gt;&lt;li&gt;Macro Assembler (MASM)&lt;/li&gt;&lt;li&gt;memory models&lt;/li&gt;&lt;li&gt;movement keys&lt;/li&gt;&lt;li&gt;MS-DOS&lt;/li&gt;&lt;li&gt;My Computer&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;natural user interface, NUI&lt;/li&gt;&lt;li&gt;.NET&lt;/li&gt;&lt;li&gt;newsreader&lt;/li&gt;&lt;li&gt;noncontinguous selection&lt;/li&gt;&lt;li&gt;notification&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;NET &lt;i&gt;(net-)&lt;/i&gt;&lt;/li&gt;&lt;li&gt;new line&lt;/li&gt;&lt;li&gt;newsgroup&lt;/li&gt;&lt;li&gt;nonadjacent selection&lt;/li&gt;&lt;li&gt;non-Windows application&lt;/li&gt;&lt;li&gt;NT&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;off-premises, on-premises&lt;/li&gt;&lt;li&gt;onboarding&lt;/li&gt;&lt;li&gt;online services&lt;/li&gt;&lt;li&gt;open source, open-source&lt;/li&gt;&lt;li&gt;opt in, opt out&lt;/li&gt;&lt;li&gt;org, organization&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;Object Linking and Embedding (OLE)&lt;/li&gt;&lt;li&gt;online Help&lt;/li&gt;&lt;li&gt;on/off switch&lt;/li&gt;&lt;li&gt;overtype&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;page&lt;/li&gt;&lt;li&gt;pan&lt;/li&gt;&lt;li&gt;passwordless&lt;/li&gt;&lt;li&gt;pin, unpin&lt;/li&gt;&lt;li&gt;pinch&lt;/li&gt;&lt;li&gt;platform as a service (PaaS)&lt;/li&gt;&lt;li&gt;playlist&lt;/li&gt;&lt;li&gt;please&lt;/li&gt;&lt;li&gt;private cloud&lt;/li&gt;&lt;li&gt;profile&lt;/li&gt;&lt;li&gt;public cloud&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;panorama&lt;/li&gt;&lt;li&gt;patch&lt;/li&gt;&lt;li&gt;PC Card vs PCMCIA&lt;/li&gt;&lt;li&gt;pixel&lt;/li&gt;&lt;li&gt;Preface&lt;/li&gt;&lt;li&gt;prohibition sign&lt;/li&gt;&lt;li&gt;pull quote&lt;/li&gt;&lt;li&gt;push-to-talk&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;quarter inch&lt;span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;quick key&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;relationship chatbot&lt;/li&gt;&lt;li&gt;reverse video&lt;/li&gt;&lt;li&gt;rotate&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;radix, radixes&lt;/li&gt;&lt;li&gt;release notes&lt;/li&gt;&lt;li&gt;Restore button&lt;/li&gt;&lt;li&gt;rip&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;server&lt;/li&gt;&lt;li&gt;service-level agreement (SLA)&lt;/li&gt;&lt;li&gt;service-oriented architecture (SOA)&lt;/li&gt;&lt;li&gt;ship&lt;/li&gt;&lt;li&gt;single-sign-on (SSO)&lt;/li&gt;&lt;li&gt;smb&lt;/li&gt;&lt;li&gt;social chatbot&lt;/li&gt;&lt;li&gt;software as a service (SaaS)&lt;/li&gt;&lt;li&gt;software-plus-services&lt;/li&gt;&lt;li&gt;sorry&lt;/li&gt;&lt;li&gt;spyware&lt;/li&gt;&lt;li&gt;stretch&lt;/li&gt;&lt;li&gt;swipe&lt;/li&gt;&lt;li&gt;sync&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;scale up&lt;/li&gt;&lt;li&gt;Screen Tip&lt;/li&gt;&lt;li&gt;search engine&lt;/li&gt;&lt;li&gt;site map&lt;/li&gt;&lt;li&gt;software update&lt;/li&gt;&lt;li&gt;speed key&lt;/li&gt;&lt;li&gt;spider&lt;/li&gt;&lt;li&gt;stand-alone&lt;/li&gt;&lt;li&gt;Super VGA, SVGA&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;tab, double-tab, tab and hold&lt;/li&gt;&lt;li&gt;target drive, target file&lt;/li&gt;&lt;li&gt;terminate&lt;/li&gt;&lt;li&gt;text, text message&lt;/li&gt;&lt;li&gt;tile, Live Tile&lt;/li&gt;&lt;li&gt;toast&lt;/li&gt;&lt;li&gt;to-do&lt;/li&gt;&lt;li&gt;touchpad&lt;/li&gt;&lt;li&gt;touchscreen&lt;/li&gt;&lt;li&gt;touch-sensitive&lt;/li&gt;&lt;li&gt;trackball&lt;/li&gt;&lt;li&gt;trojan&lt;/li&gt;&lt;li&gt;turnkey&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;time bomb&lt;/li&gt;&lt;li&gt;title bar&lt;/li&gt;&lt;li&gt;titled vs. entitled&lt;/li&gt;&lt;li&gt;toolbar&lt;/li&gt;&lt;li&gt;toolbox&lt;/li&gt;&lt;li&gt;tooltip&lt;/li&gt;&lt;li&gt;topic&lt;/li&gt;&lt;li&gt;tutorial&lt;/li&gt;&lt;li&gt;two-dimensional, 2-D&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;Ultrabook&lt;/li&gt;&lt;li&gt;unwanted software&lt;/li&gt;&lt;li&gt;UPnP&lt;/li&gt;&lt;li&gt;URL&lt;/li&gt;&lt;li&gt;USB&lt;/li&gt;&lt;li&gt;use terms&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;Universal Naming Conversion (UNC)&lt;/li&gt;&lt;li&gt;unprintable&lt;/li&gt;&lt;li&gt;Usenet&lt;/li&gt;&lt;li&gt;utilize&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;video call, videoconference&lt;/li&gt;&lt;li&gt;video card&lt;/li&gt;&lt;li&gt;video driver&lt;/li&gt;&lt;li&gt;video game&lt;/li&gt;&lt;li&gt;virtual agent&lt;/li&gt;&lt;li&gt;voice user interface&lt;/li&gt;&lt;li&gt;voice-activated device&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;VCR &lt;i&gt;(videocassette recorder)&lt;/i&gt;&lt;/li&gt;&lt;li&gt;VGA&lt;/li&gt;&lt;li&gt;virtual root&lt;/li&gt;&lt;li&gt;virtual server&lt;/li&gt;&lt;li&gt;virtualize&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;wearable, wearable device&lt;/li&gt;&lt;li&gt;web services&lt;/li&gt;&lt;li&gt;wellbeing&lt;/li&gt;&lt;li&gt;white hat hacker&lt;/li&gt;&lt;li&gt;whitelist&lt;/li&gt;&lt;li&gt;wireless&lt;/li&gt;&lt;li&gt;work style&lt;/li&gt;&lt;li&gt;workstream&lt;/li&gt;&lt;li&gt;worldwide vs. international&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;Weblication&lt;/li&gt;&lt;li&gt;Windows Installer&lt;/li&gt;&lt;li&gt;Winsock&lt;/li&gt;&lt;li&gt;worksheet&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;x86&lt;/li&gt;&lt;li&gt;Xbase&lt;/li&gt;&lt;li&gt;zero character&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/3230208292327560695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/3230208292327560695' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/3230208292327560695'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/3230208292327560695'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2022/12/revisit-microsoft-style-guide-in-2022.html' title='Revisit Microsoft Style Guide in 2022'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJmr4n2aFiOB5IQBhKMe3Wiex_cUDEQbjIZ1-KPlvWNr6YUdPgY8TPm0ju6NSHSGSc7E8G2RlVONjoXkFBlcd1tZ0EUXuzqzN4B41IyZ5XnLa9pIiWFt7RuBJInMilF8aI6VFdR1wzZFHggyupAYZisyeeOLGnK5wEaKmppzE8RHZJ3G-i0L5jGe-a/s72-w158-h200-c/manual-of-style.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-5821770431797048875</id><published>2022-11-17T04:26:00.001+08:00</published><updated>2022-11-19T23:15:48.136+08:00</updated><title type='text'>Improve logging with DevTools console object</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;Every developer uses &lt;code&gt;console.log()&lt;/code&gt; to debug in Chrome browser. However it may be difficult to locate your log messages in console window with lots of other messages.&amp;nbsp; For example:&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;

&lt;div style=&quot;background: rgb(39, 40, 34); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;event.key=&quot;&lt;/span&gt; &lt;span style=&quot;color: #f92672;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;event&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;isHomeKey=&quot;&lt;/span&gt; &lt;span style=&quot;color: #f92672;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;isHomeKey&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;isEndKey=&quot;&lt;/span&gt; &lt;span style=&quot;color: #f92672;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;isEndKey&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;532&quot; data-original-width=&quot;704&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhrI-B8NeJ56BsA8gyzGEmw_l6zL_3HoyTTrer7AXx-wesy7Nd20UVhT2Kpw5HOg9g5D3TF3llwBOXJ74a2jKHl4MH0qzVddMjRosNmic_bB0XU627tGApGFe-hqVJxWJ86gvGKPEm6MXP3iG_9RKrsCR2PPYF7_qBPXm4lAdGori7ZX4OzwyWdjo5/s16000/console1b.png&quot; /&gt;&lt;/div&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;Separator&lt;/h2&gt;

&lt;p&gt;Traditionally we can add a separator to make us easier to locate what we want.&lt;/p&gt;

&lt;div style=&quot;background: rgb(39, 40, 34); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;===========================&quot;&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;event.key=&quot;&lt;/span&gt; &lt;span style=&quot;color: #f92672;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;event&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;isHomeKey=&quot;&lt;/span&gt; &lt;span style=&quot;color: #f92672;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;isHomeKey&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;isEndKey=&quot;&lt;/span&gt; &lt;span style=&quot;color: #f92672;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;isEndKey&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;===========================&quot;&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;235&quot; data-original-width=&quot;704&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjy-7wShYtg7hT0FLCC8690_qp8qLfoeLbBJPXVEwPaW8C6AJKmMbYEIIH0un-gs_3hpdWW7i7pGgPXHj-GD9xE-NcVP7qVa3MBihyEqtRidtGrMTDoGVM62LWzhu5UobtEibO3B8E2xwTCv0KV9cmjTInfZSprS-u7gPB6x7G2oI-dKPgce2JOXc_M/s16000/console2b.png&quot; /&gt;&lt;/div&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;CSS&lt;/h2&gt;

&lt;p&gt;Or we can use custom css to make the log messages stand out.&amp;nbsp; Notice the &lt;code&gt;&quot;%c&quot;&lt;/code&gt; in the message as the placeholder of the css.&lt;/p&gt;

&lt;div style=&quot;background: rgb(39, 40, 34); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;%cevent.key=&quot;&lt;/span&gt; &lt;span style=&quot;color: #f92672;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;event&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;font-size:1.5em; color:red&quot;&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;%cisHomekey=&quot;&lt;/span&gt; &lt;span style=&quot;color: #f92672;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;isHomekey&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;font-size:1.5em; color:red&quot;&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;%cisEndKey=&quot;&lt;/span&gt; &lt;span style=&quot;color: #f92672;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;isEndKey&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;font-size:1.5em; color:red&quot;&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;228&quot; data-original-width=&quot;704&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAZlUbIEFaHCym5HnoG78sFJoWfZ-brUPrgjQje5Jd9MRsaWk5btJsZ0DxKnQi3uxHMyUUvj2kqGV2k4cQx1OtPLe9xTVu3NGezwLZnhq2B3LQgcPh6bXGaky4eIntxNw3Fv1YLXtxdQeIC-N6hWUOs5hj37H9T3xhZyL1n2wAh9WxPF_eVKqE1NsF/s16000/console3b.png&quot; /&gt;&lt;/div&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;console.warn()&lt;/h2&gt;

&lt;p&gt;On the other hand, w can use &lt;code&gt;console.warn()&lt;/code&gt; to log the messages. It is displayed with different background color.&amp;nbsp; We can also use the filter buttons to show warning message only.&amp;nbsp; Notice that we should use &lt;code&gt;console.warn()&lt;/code&gt; in ad-hoc debug only and should not be used in production code for debug purpose.&lt;/p&gt;

&lt;div style=&quot;background: rgb(39, 40, 34); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;warn&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;event.key=&quot;&lt;/span&gt; &lt;span style=&quot;color: #f92672;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;event&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;warn&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;isHomeKey=&quot;&lt;/span&gt; &lt;span style=&quot;color: #f92672;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;isHomeKey&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;warn&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e6db74;&quot;&gt;&quot;isEndKey=&quot;&lt;/span&gt; &lt;span style=&quot;color: #f92672;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;isEndKey&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;202&quot; data-original-width=&quot;704&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVcpy84kbWvTillA6OSXbClpoITlj9OO2VPCNaWINzVeYTeAm3bTMpMAjIr5pVTCqhWp2twk4wuWhg-6i9cqDsMOq4padei6gDJDKsmTmnETE-rBWuGI_bm7AHVJ8tJNp8-nAPjW2mHasRyEC5Zz1FopBUyHub7LTw_AAt5D9xZEF5mVE6wrTXzsT5/s16000/console4b.png&quot; /&gt;&lt;/div&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;Object&lt;/h2&gt;

&lt;p&gt;We can further simplify by code by creating a ad-hoc object.&amp;nbsp; Chrome can nicely display key-value pair.&lt;/p&gt;

&lt;div style=&quot;background: rgb(39, 40, 34); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;warn&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;({&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #f92672;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;event&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;isHomeKey&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;isEndKey&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;175&quot; data-original-width=&quot;704&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc-8rr8DwdBNF62l7d2Bs-YFZtsBuYz_w96IayN0V2p-35jBwgqaWIQbi60_oMdlTgsCDDX9GCuLyhDQHR9vkOqHn-ZKrdmfnPX7goQ59cUBixFugYVVEI0n5WkJ0rbzbaLL1TWk0RtLz6-xnYAWf45fInj0SrfgarlNafJZ4oi7CcO87G1atpboRe/s16000/console6b.png&quot; /&gt;&lt;/div&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;console.table()&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;console.table()&lt;/code&gt; is another powerful tool for logging. It displays the values in a nicely formatted table.&lt;/p&gt;

&lt;div style=&quot;background: rgb(39, 40, 34); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;console&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;({&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #f92672;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;event&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;isHomeKey&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #a6e22e;&quot;&gt;isEndKey&lt;/span&gt;&lt;span style=&quot;color: #f8f8f2;&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;249&quot; data-original-width=&quot;702&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic93Io9nowIIxrYA5Ax3uBG6vhHVkSpilqudW18eawKl8G0fa6Kdx0Byf_5SRjD2_BIhqUhOsImc7DKqHv6VbMHiLXZeyzmygzrsh1PJRA8ECFW24qt9aU1cm7klvTGpTohOvfC4y1EqMFLs30XMQW-bdgQAqgQdigScNZy1wU6QnD4cw261fUHB5n/s16000/console7b.png&quot; /&gt;&lt;/div&gt;

&lt;p&gt;You can check out the &lt;a href=&quot;https://developer.chrome.com/docs/devtools/console/api/&quot; target=&quot;_blank&quot;&gt;Console API reference&lt;/a&gt; for other powerful functions of the console object.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/5821770431797048875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/5821770431797048875' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/5821770431797048875'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/5821770431797048875'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2022/11/improve-logging-with-devtools-console.html' title='Improve logging with DevTools console object'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhrI-B8NeJ56BsA8gyzGEmw_l6zL_3HoyTTrer7AXx-wesy7Nd20UVhT2Kpw5HOg9g5D3TF3llwBOXJ74a2jKHl4MH0qzVddMjRosNmic_bB0XU627tGApGFe-hqVJxWJ86gvGKPEm6MXP3iG_9RKrsCR2PPYF7_qBPXm4lAdGori7ZX4OzwyWdjo5/s72-c/console1b.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-888230262498887822</id><published>2022-11-14T06:38:00.006+08:00</published><updated>2022-12-19T03:07:17.126+08:00</updated><title type='text'>When hardware is cheaper than programmer</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; class=&quot;float&quot; data-original-height=&quot;558&quot; data-original-width=&quot;1024&quot; height=&quot;174&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxjkDz4fx_g9Ke7-bDT2swBrpBCXFRKLc6nh_gM5KMk9p9s-rk5Sl9qjSHechlC3rCHmQETce8Oh_EbU9Kbv5xppp174A3zhhrMOmRbezRgJLFbvkauXcVGgBNQPGrI0eB4gOMI7gUMww0X3IRDoWQAhoYFqL1p8GiqqRObXA-I0L5REh6vEoWm-IX/w320-h174/pragramming.jpg&quot; width=&quot;320&quot; /&gt;&lt;/div&gt;I read an article &quot;Learn From Google’s Data Engineers: Don’t Optimize Your SQL&quot;. The article is now offline and you can find it in &lt;a href=&quot;https://web.archive.org/web/20220128144246/https://scribe.rip/m/global-identity?redirectUrl=https%253A%252F%252Fblog.devgenius.io%252Flearn-from-googles-data-engineers-don-t-optimize-your-sql-43f0da30701&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;archive.org&lt;/a&gt;.&lt;p&gt;&lt;/p&gt;&lt;p&gt;The article is talking about Google engineers made snapshots of tables every few minutes to track dimension history instead of spending time to write complex SQL MERGE statements which seems to be more proper. The author concluded that it makes more sense for Google as the cost of storage of those snapshots is much lower than the salary of the engineers.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;mighty Data Engineer’s time is more valuable to move fast and create business value, than to waste their valuable time writing MERGE statements&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;In recent years, especially in the cloud era, more people prefer to buy bigger machines or add more instances over spending time to optimise the code. I saw new programmers always use simple data structure like array or map in all&amp;nbsp;scenario. They don&#39;t have the concept of Big O notation and use brute force to solve problems. I still remember the good old days that we need to optimize the C program with&amp;nbsp;&lt;a href=&quot;https://en.wikipedia.org/wiki/Data_structure_alignment&quot; target=&quot;_blank&quot;&gt;byte alignment&lt;/a&gt;, memory pool, and use ++i instead of i++ for the little gain of performance.&lt;/p&gt;&lt;p&gt;Time flies. Now it may not bt economically efficient to spend time to optimize your code. But we need to consider sustainable engineering and carbon friendly coding. Think about that your bad code may exist for 10 years and keep consuming extra energy which can be reduce if you spend some time to optimise it in first place. In addition, optimizing code is fun.&amp;nbsp; Identifying and fixing performance issues in a program is a challenging and rewarding process. It requires us to use analytical and critical thinking skills to find creative solutions, which can be a satisfying experience. I will spend hours in &lt;a href=&quot;https://leetcode.com/&quot; target=&quot;_blank&quot;&gt;LeetCode&lt;/a&gt;&amp;nbsp;in order to beat 100% of submissions, which I don&#39;t need to, but is fun.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/888230262498887822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/888230262498887822' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/888230262498887822'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/888230262498887822'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2022/11/when-hardware-is-cheaper-than-programmer.html' title='When hardware is cheaper than programmer'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxjkDz4fx_g9Ke7-bDT2swBrpBCXFRKLc6nh_gM5KMk9p9s-rk5Sl9qjSHechlC3rCHmQETce8Oh_EbU9Kbv5xppp174A3zhhrMOmRbezRgJLFbvkauXcVGgBNQPGrI0eB4gOMI7gUMww0X3IRDoWQAhoYFqL1p8GiqqRObXA-I0L5REh6vEoWm-IX/s72-w320-h174-c/pragramming.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-2139335006608687153</id><published>2022-11-11T05:21:00.044+08:00</published><updated>2023-01-08T18:13:21.836+08:00</updated><title type='text'>Create calendar with Excel formula and conditional formatting</title><content type='html'>We can build a calendar in Excel with only formula and conditional formatting.&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;600&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQzCjZ4FnMXE4cD3Uigv4Cpv8kF2-FUy5REiRr8PEl-ZXowtgajO74QtNIuhusxpk8dmZ_BcdBprtEd0iwUxiqZj3VadpAnkWWV-ryCaL4qW4pHL01idB7mw0YHtp4D18-ovVL7O0PMFHi7uaNbhuD8UJc03T0BJLtDSTSgWF-rtzAmx3C_W1aXBv6/s16000/excel-calendar.gif&quot; /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Year&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Firstly type the year &quot;2022&quot; in cell A1.&amp;nbsp; You can type any year and the calendar will automatic update.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Day of Week Header&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We use COLUMN() to get the day of week numeric value.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In cell B1, type the below formula and copy to B1:H1.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;code&quot;&gt;=TEXT(COLUMN()-1, &quot;ddd&quot;)&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6qOesmACCOuqFW0nOS3l8O836dMy6KOqhAQEOI-Wfcbvhah4onnLZZHj7AuLqdUsNNgaPs2p6MzpmnAtyYtn-EEb73DJIl4D4qzmbTI5xcXAcGsQ4QoV-AWCu6d3jAnT95dAKyT3aJTSKby3-p7ent4reW9Qrx7c8ZrWjY7QWR7ZjquUxZsbCC9y7/s838/excel-cal-02.png&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;146&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6qOesmACCOuqFW0nOS3l8O836dMy6KOqhAQEOI-Wfcbvhah4onnLZZHj7AuLqdUsNNgaPs2p6MzpmnAtyYtn-EEb73DJIl4D4qzmbTI5xcXAcGsQ4QoV-AWCu6d3jAnT95dAKyT3aJTSKby3-p7ent4reW9Qrx7c8ZrWjY7QWR7ZjquUxZsbCC9y7/s16000/excel-cal-02.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Calendar Body&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then we fill the cells with the days count.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In cell B2, type the below formula and copy to B2:H55.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;code&quot;&gt;=(ROW()-2)*7+COLUMN()-1&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6M7rG17QoxYnnhUgoP9LNIgWoHXn6cT8liifJX6EKqzNUEL8jNlq5eJFAa8i2bLWr9oVhn04G5uEMe4-XilOYTc7WBKZpzTx7MQ7B3ivRPocri99tEaAPV6ZZFeU3BUpKnqaAh5XxrdclvoV6cXSFUgPrdTivczYySEC-bOe4HXt_PpSROgcOUWTm/s838/excel-cal-03.png&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;166&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6M7rG17QoxYnnhUgoP9LNIgWoHXn6cT8liifJX6EKqzNUEL8jNlq5eJFAa8i2bLWr9oVhn04G5uEMe4-XilOYTc7WBKZpzTx7MQ7B3ivRPocri99tEaAPV6ZZFeU3BUpKnqaAh5XxrdclvoV6cXSFUgPrdTivczYySEC-bOe4HXt_PpSROgcOUWTm/s16000/excel-cal-03.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;and offset with day of week of 1-Jan, so &quot;0&quot; is 1-Jan, &quot;1&quot; is 2-Jan and so on.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;code&quot;&gt;=(ROW()-2)*7+COLUMN()-1&lt;span style=&quot;color: red;&quot;&gt;-WEEKDAY(DATE($A$1,1,1))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYyYs2qwkBtxDNBp8QdTjRi82SsnR4UmHc5BG-NuJwrxHxKEA2RPP5M0mQ-FgHUTxV0GKOkoo36AT2T1OGNWOpsYeKDho_WWnNPoWOyHF9s282tRYiANwWcXMeiS0rg2Sydz3D4elfJMPOdEwX_XXfzw2StAj4n1eAFj44kr7Nmp8cNtw6RNHb1hmj/s838/excel-cal-04.png&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;166&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYyYs2qwkBtxDNBp8QdTjRi82SsnR4UmHc5BG-NuJwrxHxKEA2RPP5M0mQ-FgHUTxV0GKOkoo36AT2T1OGNWOpsYeKDho_WWnNPoWOyHF9s282tRYiANwWcXMeiS0rg2Sydz3D4elfJMPOdEwX_XXfzw2StAj4n1eAFj44kr7Nmp8cNtw6RNHb1hmj/s16000/excel-cal-04.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now we can construct the date by adding 1-Jan to the days count. Format the date to verify the formula is correct.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;code&quot;&gt;=&lt;span style=&quot;color: red;&quot;&gt;TEXT(DATE($A$1,1,1)+&lt;/span&gt;(ROW()-2)*7+COLUMN()-1-WEEKDAY(DATE($A$1,1,1))&lt;span style=&quot;color: red;&quot;&gt;,&quot;yy-mm-dd&quot;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju7_nPN3bO-K85eWlpMh60mQgqOeuXMXO2Elpay2oHcOOjnqwSFxJPbeJhfIdG8xzq1RP9gbXUYGDf9WK-FIozgVXWSU9G8-RbC_JNnRPwvkEEjHhKZoB-4dXCVMjgeSLRRbsAO5rM4JlvFxyp_c9uCnYKtSMBlC69d4FpwxaHNAxWiIu-dbgs-3sb/s837/excel-cal-04a.png&quot; style=&quot;clear: left; float: left; font-family: monospace; margin-bottom: 1em; margin-right: 1em; text-align: center; white-space: pre;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;166&quot; data-original-width=&quot;837&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju7_nPN3bO-K85eWlpMh60mQgqOeuXMXO2Elpay2oHcOOjnqwSFxJPbeJhfIdG8xzq1RP9gbXUYGDf9WK-FIozgVXWSU9G8-RbC_JNnRPwvkEEjHhKZoB-4dXCVMjgeSLRRbsAO5rM4JlvFxyp_c9uCnYKtSMBlC69d4FpwxaHNAxWiIu-dbgs-3sb/s16000/excel-cal-04a.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally, we should only show date of current year, and the day of month instead of full date.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In cell B2, type the below formula and copy to B2:H55.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;code&quot;&gt;=&lt;span style=&quot;color: red;&quot;&gt;IF(YEAR((DATE($A$1,1,1)+(ROW()-2)*7+COLUMN()-1-WEEKDAY(DATE($A$1,1,1))))=$A$1&lt;/span&gt;,&lt;span style=&quot;color: red;&quot;&gt;DAY(&lt;/span&gt;(DATE($A$1,1,1)+(ROW()-2)*7+COLUMN()-1-WEEKDAY(DATE($A$1,1,1))&lt;span style=&quot;color: red;&quot;&gt;)),&quot;&quot;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjafUimVP7yErG-8wvDrj_JcmsaWDP5dHdbOJGMk3GPXUZ_oEKCnzTCRCVlFlQOkfIOZ0Dt-1GH-JCToQVJDRiSAMnwdd5WtI2xMxD478qdWaLUupX3tAW9blv1_iFx6XJR9vXaMUgfetkQ0ROOiCF2eP2rz97WDz4Yi6ZxmP3Dg3Jj1MNgbIqVqu3x/s838/excel-cal-05.png&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;166&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjafUimVP7yErG-8wvDrj_JcmsaWDP5dHdbOJGMk3GPXUZ_oEKCnzTCRCVlFlQOkfIOZ0Dt-1GH-JCToQVJDRiSAMnwdd5WtI2xMxD478qdWaLUupX3tAW9blv1_iFx6XJR9vXaMUgfetkQ0ROOiCF2eP2rz97WDz4Yi6ZxmP3Dg3Jj1MNgbIqVqu3x/s16000/excel-cal-05.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Month Header&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next need to show the month in column A. If the row contains first day (&quot;1&quot;) means it is a new month.&amp;nbsp; We can use MIN()=1 to determine if the row contains 1 instead of VLOOKUP(). And use TEXT(..., &quot;mmm&quot;) to get the month name.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In cell A2, type the below formula and copy to A2:A55.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;code&quot;&gt;=&lt;span style=&quot;color: red;&quot;&gt;IF(MIN(B2:H2)=1,TEXT(&lt;/span&gt;DATE($A$1,1,1)+(ROW(H2)-2)*7+COLUMN(H2)-1-WEEKDAY(DATE($A$1,1,1))&lt;span style=&quot;color: red;&quot;&gt;,&quot;mmm&quot;),&quot;&quot;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt7kxGIRkC30_oX4biKsR-agd7VsM_Gi_PdOxhmm9Q_ZNj9admlumj6RQYdQxAnUrr8B6fvQn9ofZXMirCmC_Jl2jmKkrGiLr854O8KEvR1gtUMFb9kJdC82uXXN2bvQfv_8h_Hi4UrreAlyCE9tMJT56tbfNwZuTax4bK-dvVpTkMS0rJUb0LnKDh/s837/excel-cal-07.png&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;246&quot; data-original-width=&quot;837&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt7kxGIRkC30_oX4biKsR-agd7VsM_Gi_PdOxhmm9Q_ZNj9admlumj6RQYdQxAnUrr8B6fvQn9ofZXMirCmC_Jl2jmKkrGiLr854O8KEvR1gtUMFb9kJdC82uXXN2bvQfv_8h_Hi4UrreAlyCE9tMJT56tbfNwZuTax4bK-dvVpTkMS0rJUb0LnKDh/s16000/excel-cal-07.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Put everything together&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We can put all three formula together. Apply the day of week formula in row 1, the month name formula in column 1. Also show a message in cell $A$2 if the year is not a number.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In cell A1, type the following formula and copy to A1:H55.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;code&quot;&gt;=&lt;span style=&quot;color: #3d85c6;&quot;&gt;IF(ADDRESS(ROW(),COLUMN())=&quot;$A$1&quot;,&quot;&quot;,&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;IF(NOT(ISNUMBER($A$1)),IF(ADDRESS(ROW(),COLUMN())=&quot;$B$1&quot;,&quot;&amp;lt;- Year&quot;,&quot;&quot;),&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;IF(ROW()=1,TEXT(COLUMN()-1, &quot;ddd&quot;),&lt;/span&gt;&lt;span style=&quot;color: #800180;&quot;&gt;IF(COLUMN()=1,IF(MIN($B1:$H1)=1,TEXT(DATE($A$1,1,1)+(ROW($H1)-2)*7+COLUMN($H1)-1-WEEKDAY(DATE($A$1,1,1)),&quot;mmm&quot;),&quot;&quot;),&lt;/span&gt;IF(YEAR((DATE($A$1,1,1)+(ROW()-2)*7+COLUMN()-1-WEEKDAY(DATE($A$1,1,1))))=$A$1,DAY((DATE($A$1,1,1)+(ROW()-2)*7+COLUMN()-1-WEEKDAY(DATE($A$1,1,1)))),&quot;&quot;)&lt;span style=&quot;color: #800180;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Format&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The calendar if half done now.&amp;nbsp; We need to add some format.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Select column A:H, apply the below formula in Conditional Formatting.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Add the bottom border as month separator if it is the first row (header) or the below is smaller that itself (i.e. next month)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;code&quot;&gt;=IF(ROW(A1)=1,TRUE,AND(COLUMN(A1)&amp;gt;1,A1&amp;lt;&amp;gt;&quot;&quot;,A2&amp;lt;&amp;gt;&quot;&quot;,A1&amp;gt;A2))&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFrzk9aqQwWY0JQDoqmAbpWeBf3qAW9Uqu7UbJuoYtFgvC_A4njmOqJxGA8lnwqRaxiDwH2CZ3Z2-5czDiLtw45uohMtRUlFePuAcSnUOUKlANnY63vKrzxvsqwuPbU1COWqGRU40tWzefwFpEfpIUZTIRof3s5vM3FMz078MXmqPwCKJomeJJTE7r/s838/excel-cal-08.png&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;261&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFrzk9aqQwWY0JQDoqmAbpWeBf3qAW9Uqu7UbJuoYtFgvC_A4njmOqJxGA8lnwqRaxiDwH2CZ3Z2-5czDiLtw45uohMtRUlFePuAcSnUOUKlANnY63vKrzxvsqwuPbU1COWqGRU40tWzefwFpEfpIUZTIRof3s5vM3FMz078MXmqPwCKJomeJJTE7r/s16000/excel-cal-08.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. Add the right border as month separator in same row&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;code&quot;&gt;=AND(COLUMN(A1)&amp;gt;1,ROW(A1)&amp;gt;1,A1&amp;lt;&amp;gt;&quot;&quot;,B1=1)&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjcST-1q5pn80Of1P8i09zqN5Wry8EyLB5GQ95ZDnjfpd_HJ9LwnXKzGkHdY1GcMSyUPG3MDlh1JHwGbjvhGbPNFC1_HY4P96fnNtDM4TgaxP1U3LzRadGrCYlujG51QNcnODRfi2kNwcp6beV9itiCGT-rFjAls2HVqUf-LvcVNc1LTli_HVxyYp5/s838/excel-cal-09.png&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;261&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjcST-1q5pn80Of1P8i09zqN5Wry8EyLB5GQ95ZDnjfpd_HJ9LwnXKzGkHdY1GcMSyUPG3MDlh1JHwGbjvhGbPNFC1_HY4P96fnNtDM4TgaxP1U3LzRadGrCYlujG51QNcnODRfi2kNwcp6beV9itiCGT-rFjAls2HVqUf-LvcVNc1LTli_HVxyYp5/s16000/excel-cal-09.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;3. Highlight Sat and Sunday to be red&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;code&quot;&gt;=OR(COLUMN(A1)=2,COLUMN(A1)=8)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9RZ9uupEZ1uU9GRPNKkrxRiOeA8loHODhGNocjZnX1ikOsa2wFzINGIwLaUptv2XnYmSsY6kOQNng8xBv2rHGlM7ltxaFL6GfNi5KVZ0IyqBIZ82PnypCdnRzXbj33oQFly394oTkGPpgUDceZJQPRfBzUUrETmGfdDlexUnK9KoPUBLkV8tVaNS8/s838/excel-cal-10.png&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;261&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9RZ9uupEZ1uU9GRPNKkrxRiOeA8loHODhGNocjZnX1ikOsa2wFzINGIwLaUptv2XnYmSsY6kOQNng8xBv2rHGlM7ltxaFL6GfNi5KVZ0IyqBIZ82PnypCdnRzXbj33oQFly394oTkGPpgUDceZJQPRfBzUUrETmGfdDlexUnK9KoPUBLkV8tVaNS8/s16000/excel-cal-10.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally , center align column A:H.&amp;nbsp; The calendar is done.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8-ScJ-5NETnB54vi_N1PFxv3-yeu2rltTSWajzjZnNOBKKbE7l3SXBLPO8cYpiY5JcuWSVRZEfnh0OIsDWjtVbtk3ttPQHPZnMm1joJxjQcB6ygrPHOYUChGwCrWaMQk1yBtbSiXCg38Xlfbj0B8kxrhzvjsFmhPRabPLK20b9FrAVWSD4gNwIbEx/s838/excel-cal-11.png&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;261&quot; data-original-width=&quot;838&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8-ScJ-5NETnB54vi_N1PFxv3-yeu2rltTSWajzjZnNOBKKbE7l3SXBLPO8cYpiY5JcuWSVRZEfnh0OIsDWjtVbtk3ttPQHPZnMm1joJxjQcB6ygrPHOYUChGwCrWaMQk1yBtbSiXCg38Xlfbj0B8kxrhzvjsFmhPRabPLK20b9FrAVWSD4gNwIbEx/s16000/excel-cal-11.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;In addition, we can protect the worksheet and only allow to input the year.&amp;nbsp; Right click the cell A1, select &quot;Format Cell&quot;, uncheck the &quot;Locked&quot; check box.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikcn8ghjy0Nz9ckbyOQNNY85PuA1RxpEFWhxn-T1YYVtt_Qiu6HyCHlw72q0chWaWWQzn7NuJmiObNLhL58BTS9I6V2LNjk8Upiyc_y4ijs5nVBohlbALVhXxDLhQ5xw674nCeQ_cBWCyXt0MGuLPzPuwtThh2fL5U3uvFiKEh2Q09cnpOKbqy6GF8/s898/excel-cal-12.png&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;576&quot; data-original-width=&quot;898&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikcn8ghjy0Nz9ckbyOQNNY85PuA1RxpEFWhxn-T1YYVtt_Qiu6HyCHlw72q0chWaWWQzn7NuJmiObNLhL58BTS9I6V2LNjk8Upiyc_y4ijs5nVBohlbALVhXxDLhQ5xw674nCeQ_cBWCyXt0MGuLPzPuwtThh2fL5U3uvFiKEh2Q09cnpOKbqy6GF8/s16000/excel-cal-12.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;In menu &quot;Review&quot; -&amp;gt; &quot;Protect Sheet&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicoTEFX_d9yhpwVZnA1jm5jAQHef5bgeAZNxOCuRFtAC1wLBo-qFOAuOP9S5ue879FzwlyrAIkSd5icGmUShZQ84lO1YVXB-apdW8whAg5oTP4queLpSFDxjdY1GQ_j_xThXR0FBc_Fp8QNGf_AV_IwWX4r9M4RhRkY4xx7wl9kAWJAeBPcZu6l_G7/s886/excel-cal-13.png&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;364&quot; data-original-width=&quot;886&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicoTEFX_d9yhpwVZnA1jm5jAQHef5bgeAZNxOCuRFtAC1wLBo-qFOAuOP9S5ue879FzwlyrAIkSd5icGmUShZQ84lO1YVXB-apdW8whAg5oTP4queLpSFDxjdY1GQ_j_xThXR0FBc_Fp8QNGf_AV_IwWX4r9M4RhRkY4xx7wl9kAWJAeBPcZu6l_G7/s16000/excel-cal-13.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/2139335006608687153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/2139335006608687153' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/2139335006608687153'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/2139335006608687153'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2022/09/create-calendar.html' title='Create calendar with Excel formula and conditional formatting'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQzCjZ4FnMXE4cD3Uigv4Cpv8kF2-FUy5REiRr8PEl-ZXowtgajO74QtNIuhusxpk8dmZ_BcdBprtEd0iwUxiqZj3VadpAnkWWV-ryCaL4qW4pHL01idB7mw0YHtp4D18-ovVL7O0PMFHi7uaNbhuD8UJc03T0BJLtDSTSgWF-rtzAmx3C_W1aXBv6/s72-c/excel-calendar.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-4271212481880533830</id><published>2010-02-05T10:19:00.009+08:00</published><updated>2022-11-16T07:56:59.434+08:00</updated><title type='text'>Fix the XPath problem in Firefox 3.6</title><content type='html'>In Greasemonkey development, it is a common practice to use GM_xmlhttpRequest + DOM Document Wrapper + XPath to process cross-origin content.  However in Firefox 3.6, the XPath query stop working.  Here is the fix:&amp;nbsp;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Firefox 3.5&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;brush: js&quot;&gt;var doc = document.implementation.createDocument(&quot;&quot;, &quot;&quot;, null);
div.innerHTML = html;
doc.appendChild(div);
var res = doc.evaluate(&quot;//p[@class=&#39;content&#39;]/span&quot;, div, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
// res is null
&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
Firefox 3.6&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;brush: js&quot;&gt;var isFF36up = false;
if (navigator.userAgent) {
  var ffver = navigator.userAgent.match(/Firefox\/3\.(\d+)/);
  isFF36up = ffver &amp;amp;&amp;amp; parseInt(ffver[1], 10) &amp;gt;= 6;
}

var nsResolver = {
  lookupNamespaceURI:function (prefix) {
    if (isFF36up &amp;amp;&amp;amp; prefix == &quot;ns&quot;) {
      return &quot;http://www.w3.org/1999/xhtml&quot;;
    }
    else {
      return &quot;&quot;;
    }
  }
};

var doc = document.implementation.createDocument(&quot;&quot;, &quot;&quot;, null);
div.innerHTML = html;
doc.appendChild(div);
var res = doc.evaluate(&quot;//ns:p[@class=&#39;content&#39;]/ns:span&quot;, div, nsResolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/4271212481880533830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/4271212481880533830' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/4271212481880533830'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/4271212481880533830'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2010/02/fixing-xpath-problem-in-firefox-36.html' title='Fix the XPath problem in Firefox 3.6'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-5708258833604622261</id><published>2009-05-17T20:24:00.000+08:00</published><updated>2022-11-17T04:45:51.913+08:00</updated><title type='text'>Microsoft Manual of Style</title><content type='html'>





Microsoft Manual of Style is a bible for programmers to write more accurate, neutral, objective and end-user-friendly documents.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It covers everying we need to know when writing technical documents including writing style, page layout, grammer, punctuation, tone and rhetoric formatting style for number, measurements, date etc.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The best part to me is the &quot;Usage Dictionary&quot;.&amp;nbsp; It lists over 1,000 common words, terms, acronyms and state the proper way to use them, the dos and don&#39;t with examples.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Below are some examples I found is very useful and interesting.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;active vs. current&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Use &lt;i&gt;active&lt;/i&gt; or &lt;i&gt;open&lt;/i&gt;, not current, to refer to open and operating windows, programs, documents, files, devices, or portions of the screen (such as an “open window” or “active cell”). However, use current to refer to a drive, directory, folder, or other element that does not change in the context of the discussion.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;boot&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Do not use &lt;i&gt;boot&lt;/i&gt; as a verb; use &lt;i&gt;start&lt;/i&gt; or &lt;i&gt;restart&lt;/i&gt; instead, and make clear that &lt;i&gt;start&lt;/i&gt; refers to the computer, not to a program. Use &lt;i&gt;turn on&lt;/i&gt; to refer to turning on the computer.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;crash&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Jargon. Do not use in content for home users and information workers, and avoid in content for software developers and information technology professionals. Use &lt;i&gt;fail&lt;/i&gt; for disks or &lt;i&gt;stop responding&lt;/i&gt; for programs or the operating system.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;debug&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Debug is a valid technical term in content for software developers. Do not use debug in any context as a synonym for troubleshoot. Use &lt;i&gt;troubleshoot&lt;/i&gt; or a more accurate word or phrase instead.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;default&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Many home users and information workers do not understand that default refers to something that happens if the user does not take an action or does not supply a required value. Consider whether you need to explain the meaning of default in your content or even whether your content can dispense with default altogether.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;dialog box&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Always use &lt;i&gt;dialog box&lt;/i&gt;, not just &lt;i&gt;dialog&lt;/i&gt;, and not &lt;i&gt;pop-up window&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;e-mail&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Always hyphenate. Do not use as a verb; use &lt;i&gt;send&lt;/i&gt; instead.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;execute, run&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Do not use &lt;i&gt;execute &lt;/i&gt;in content for home users or information workers except to follow the user interface. Use &lt;i&gt;run&lt;/i&gt; instead.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;illegal&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Use &lt;i&gt;illegal&lt;/i&gt; only in specific situations, such as notices on software that say “Do not make illegal copies of this disk”.&amp;nbsp; Do not use to mean&lt;i&gt; invalid&lt;/i&gt; or &lt;i&gt;not valid&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;input&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Avoid in all content as a verb; use&lt;i&gt; type&lt;/i&gt; or another appropriate verb instead.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;interface&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Use as a noun only, as in “user interface” and “application programming interface.” &lt;i&gt;Interface&lt;/i&gt; as a verb is jargon. Use &lt;i&gt;interact&lt;/i&gt; or &lt;i&gt;communicate&lt;/i&gt; instead.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;log on, log off, logon, logoff&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Use&lt;i&gt; log on&lt;/i&gt; or log on to (not&lt;i&gt; log onto&lt;/i&gt;) to refer to creating a user session on a computer or a network. Use&lt;i&gt; sign in&lt;/i&gt; and &lt;i&gt;sign out&lt;/i&gt; to refer to creating and ending a user session on the Internet.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;navigate&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Do not use to refer to the act of going from place to place on the World Wide Web or need on an intranet Web. Use &lt;i&gt;browse &lt;/i&gt;instead.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;overwrite&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Use only to refer to replacing new data with existing data. Use &lt;i&gt;replace&lt;/i&gt; to refer to replacing an existing file with a new one with the same name.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;patch&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Do not use; use &lt;i&gt;update&lt;/i&gt; instead.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;plaintext vs. plain text&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Use&lt;i&gt; plaintext&lt;/i&gt; only to refer to nonencrypted or decrypted text in material about encryption. Use&lt;i&gt; plain text&lt;/i&gt; to refer to ASCII files.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;pop-up&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Do not use as a noun. Avoid as a verb; instead, use a term that more accurately describes the action, such as &lt;i&gt;open&lt;/i&gt; or &lt;i&gt;appear&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;power down, power up; power off, power on&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Do not use; use&lt;i&gt; turn off&lt;/i&gt; and &lt;i&gt;turn on&lt;/i&gt; instead. Do not use&lt;i&gt; shut down&lt;/i&gt; to refer to turning off a computer.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;prompt&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Do not use&lt;i&gt; prompt&lt;/i&gt; as a synonym for message. A prompt is a signal, which may or may not be a message, that a program or the operating system is waiting for the user to take some action. Use &lt;i&gt;prompt&lt;/i&gt; as a verb to describe the act of requesting information or an action from the user.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;purge&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Do not use because of negative associations in ordinary English usage. Use&lt;i&gt; delete&lt;/i&gt;,&lt;i&gt; clear&lt;/i&gt;, or&lt;i&gt; remove&lt;/i&gt; instead.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;quit&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Avoid. Use&lt;i&gt; exit&lt;/i&gt; instead to refer to the user action of closing a program. Use &lt;i&gt;close&lt;/i&gt; to refer to the user action of closing a document or a window. Use &lt;i&gt;close &lt;/i&gt;to refer to the action a program takes to close itself. Use&lt;i&gt; log off&lt;/i&gt; to refer to ending a user session on a computer or on a network or Internet connection.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;read-only&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Always hyphenate.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;read/write&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Use read/write, not read-write, as in “read/write permission.”&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;real time, real-time&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Two words as a noun. Hyphenate as an adjective.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;reboot&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Do not use; use&lt;i&gt; restart&lt;/i&gt; instead, and take care to establish that it is the computer, not a program, that is restarting.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;stop&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Acceptable to use to refer to hardware operations, as in “&lt;i&gt;stop&lt;/i&gt; a print job.” Use&lt;i&gt; exit&lt;/i&gt; with programs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/5708258833604622261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/5708258833604622261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/5708258833604622261'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/5708258833604622261'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2009/05/microsoft-manual-of-style.html' title='Microsoft Manual of Style'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-3741576810951678606</id><published>2008-12-16T13:17:00.010+08:00</published><updated>2022-11-16T08:03:39.844+08:00</updated><title type='text'>Chrome 1.0 (not Chromium) supports Greasemonkey now</title><content type='html'>&lt;img alt=&quot;Chromonkey&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis2hscYl5O8NtGCu3I4VX_2O3ibw3XPaMe5SLmdUJ4D_av7dbopIchTE5PYmEvNGhsj6AdEKtwlISzrvXcdwhy11gg9nCJD76WsX5XGZCzYOF9QgA44h8bAj5RZtCZNPIz9yZHAOYcfL0/s800/chromonkey.png&quot; style=&quot;border: none; float: left; height: 62px; margin: 0px 10px 10px 0px; width: 156px;&quot; /&gt;Google Chrome 1.0 supports Greasemonkey. &amp;nbsp;You can use &lt;a href=&quot;https://angusdev.blogspot.com/2008/11/greasemonkey-script-to-show-actual.html&quot;&gt;Google Reader Unread Count&lt;/a&gt; and &lt;a href=&quot;https://angusdev.blogspot.com/2008/11/better-mobile-twitter-user-script.html&quot;&gt;Better Mobile Twitter&lt;/a&gt; in Chrome now.&lt;div&gt;
&lt;/div&gt;&lt;div&gt;To enable Greasemonkey in Chrome, download and install the latest &lt;a href=&quot;http://www.google.com/chrome&quot;&gt;Chrome&lt;/a&gt;. Right click your Chrome shortcut, add &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;--enable-greasemonkey&lt;/span&gt;&quot; to the end of the &quot;Target&quot; box (see below). &amp;nbsp;Finally, you have to put the scripts in the folder &quot;&lt;span style=&quot;font-weight: bold;&quot;&gt;C:\scripts\&lt;/span&gt;&quot; and the script files&#39; extension must be &quot;&lt;span style=&quot;font-weight: bold;&quot;&gt;.user.js&lt;/span&gt;&quot;.&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2wPLkvSCsStQefHVrVCNHLCrs4Lx6T39gRTuzeekOBBxU15ArmUFMtvqPuATs4tGlD0gMPvs_HQkpueKllXjVl__oHybxrDF1255XvFHt1kSDoTLbBCdejKYmX6YrZGUiju9LKj2esjQ/s800/chrome-enable-greasemonkey.png&quot; style=&quot;display: block; height: 502px; margin: 0px auto 10px; text-align: center; width: 367px;&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/3741576810951678606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/3741576810951678606' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/3741576810951678606'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/3741576810951678606'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2008/12/chrome-10-not-chromium-supports.html' title='Chrome 1.0 (not Chromium) supports Greasemonkey now'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis2hscYl5O8NtGCu3I4VX_2O3ibw3XPaMe5SLmdUJ4D_av7dbopIchTE5PYmEvNGhsj6AdEKtwlISzrvXcdwhy11gg9nCJD76WsX5XGZCzYOF9QgA44h8bAj5RZtCZNPIz9yZHAOYcfL0/s72-c/chromonkey.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-3801391664047946320</id><published>2008-12-05T09:49:00.002+08:00</published><updated>2022-11-16T08:02:51.940+08:00</updated><title type='text'>Google Reader has new look</title><content type='html'>&lt;div&gt;
&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsUh3jqRcSPrS-IrYWAvSiH8w8WbNjjd8AezwYZjT00XRaD3Zwk1ali0MEQxF78kXxL6yNynM0m0Hoylw-MP2ZmInmTRvJy8W-sxTLe-6BuaPHRU7uYfipF6sQaNeRJnL4rmwStJbDAzU/s800/google-unread-081205.png&quot; /&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://googlereader.blogspot.com/2008/12/square-is-new-round.html&quot;&gt;Google Reader has new look&lt;/a&gt;. &amp;nbsp;I like the collapsible section so I can free more space for the feed list. &amp;nbsp;And I&#39;m please to tell you that my&amp;nbsp;&lt;a href=&quot;https://angusdev.blogspot.com/2008/11/greasemonkey-script-to-show-actual.html&quot;&gt;Google Reader Unread Count&lt;/a&gt; greasemonkey script still works for new look. &amp;nbsp;Enjoy it.
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/3801391664047946320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/3801391664047946320' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/3801391664047946320'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/3801391664047946320'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2008/12/google-reader-has-new-look.html' title='Google Reader has new look'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsUh3jqRcSPrS-IrYWAvSiH8w8WbNjjd8AezwYZjT00XRaD3Zwk1ali0MEQxF78kXxL6yNynM0m0Hoylw-MP2ZmInmTRvJy8W-sxTLe-6BuaPHRU7uYfipF6sQaNeRJnL4rmwStJbDAzU/s72-c/google-unread-081205.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-6014842378578294215</id><published>2008-10-13T01:38:00.001+08:00</published><updated>2022-11-04T05:58:35.380+08:00</updated><title type='text'>Better Mobile Twitter user script</title><content type='html'>I always keep a tab in Firefox opening Twitter and I prefer the mobile version instead of the standard one for speed and simplicity.

Despite the simplicity, one thing I would like to have is automatically load next page when the mouse scroll to bottom (just like what Google Reader does).   As a result I come up with the Better Mobile Twitter user script.

You can install in &lt;a href=&quot;http://userscripts.org/scripts/show/35396&quot;&gt;http://userscripts.org/scripts/show/35396&lt;/a&gt;.

Below is showing how it works, or you can &lt;a href=&quot;http://hk.youtube.com/watch?v=X3M5otYVq8k&amp;amp;fmt=18&quot;&gt;watch in high quality&lt;/a&gt;.
&lt;div&gt;&lt;br/&gt;
&lt;object height=&quot;344&quot; width=&quot;425&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/X3M5otYVq8k&amp;amp;hl=en&amp;amp;fs=1&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/X3M5otYVq8k&amp;amp;hl=en&amp;amp;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; height=&quot;344&quot; width=&quot;425&quot;&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/6014842378578294215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/6014842378578294215' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/6014842378578294215'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/6014842378578294215'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2008/11/better-mobile-twitter-user-script.html' title='Better Mobile Twitter user script'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-4862462236197240105</id><published>2008-04-22T01:46:00.006+08:00</published><updated>2022-11-04T03:35:17.670+08:00</updated><title type='text'>From EeePC to SLC/MLC SSD</title><content type='html'>&lt;p&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;276&quot; data-original-width=&quot;415&quot; height=&quot;276&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg1A1E0a5H5WpDZ3uQxyF30e6sGuAKCoHb9ZIZgpE8CTrgsDbJeE9zeG21ErUUW3VdjKHXSAPo7zLVvn8x5NhuBV-6u4CdGWhzktba9w3wP2JeiHt0y0BcNOGHQggIM3GTW7Q2pkd4GdPdN0amJ_VKeoAzEa8p4GcbxIYakRJOpfFhaNtmWWYSdMSsg&quot; width=&quot;415&quot; /&gt;&lt;/p&gt;&lt;p&gt;Recently the 9 inch EeePC catches everyone&#39;s eye because of the price (under HKD 4,000) and the large 20G SSD. However it raises a big concern after people discovered that the 20GB SSD is made up of 4G SLC + 16G MLC.&amp;nbsp; Since the life-span of MLC is much lower than SLC and can only survives for 10,000 writes. Someone in a forum even claim that &quot;the SSD will die after 1 month if write to the disk 30 times a day&quot;.&lt;/p&gt;&lt;p&gt;I did some research on this.&lt;/p&gt;&lt;p&gt;The smallest unit of SSD is &quot;page&quot;, which is usually 2KB in size. Each time SSD write s data to a page, it will need to erase the data first.&amp;nbsp; This is called erase/write cycle. It is also why writing is SSD is slower because it needs two operations.&amp;nbsp; When SSD erases data, it is in the unit of &quot;block&quot;, which is 64 pages or 128KB data.&amp;nbsp; So the 10,000 write cycles means each block can be written 10,000 times. Assuming writing 1GB of data every day, a 8GB MLC SSD can last for 219 years (8 * 10000 / 365).&lt;br /&gt;&lt;/p&gt;&lt;p&gt;There may be case that it keep writing on the same block and used up the limit of that block.&amp;nbsp; To solve this, there is a technique called &quot;wear leveling&quot; to balance the erase count of each block.&amp;nbsp; For example, when there is need to write to a block with high erase count, it will swap the data in this block with another block with lower erase count (this is done by the SSD chips in background).&amp;nbsp; Note that a swapping is also counted as erase/write and impact the write speed.&amp;nbsp; Another technique is to reserve some blocks which didn&#39;t count as capacity.&amp;nbsp; When a block&#39;s erase count reaches the limit, The reserved block will step it.&amp;nbsp; This method can reduce the swapping overhead.&lt;/p&gt;&lt;p&gt;After all the life of SSD should not be a concern to for you to buy a EeePC.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/4862462236197240105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/4862462236197240105' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/4862462236197240105'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/4862462236197240105'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2008/04/from-eeepc-to-slcmlc-ssd.html' title='From EeePC to SLC/MLC SSD'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEg1A1E0a5H5WpDZ3uQxyF30e6sGuAKCoHb9ZIZgpE8CTrgsDbJeE9zeG21ErUUW3VdjKHXSAPo7zLVvn8x5NhuBV-6u4CdGWhzktba9w3wP2JeiHt0y0BcNOGHQggIM3GTW7Q2pkd4GdPdN0amJ_VKeoAzEa8p4GcbxIYakRJOpfFhaNtmWWYSdMSsg=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-8236269565117099729</id><published>2007-11-24T02:33:00.001+08:00</published><updated>2022-11-16T07:59:12.995+08:00</updated><title type='text'>Howto install Firefox 3 to co-exists with Firefox 2</title><content type='html'>Mozilla just release &lt;a href=&quot;http://www.mozilla.com/en-US/firefox/all-beta.html&quot;&gt;Firefox 3 Beta 1&lt;/a&gt;. Review said it is much faster and consume less memory.  It definitely worth a try but for the obvious reason you have to keep your Firefox 2.  Here is the steps show you how to install Firefox 3 and make it co-exists with Firefox 2.

1. Right click the shortcut of the Firefox 2, click &quot;Properties&quot;.  Add &quot;&lt;span style=&quot;font-weight: bold;&quot;&gt;-profilemanager&lt;/span&gt;&quot; at the end of the shortcut path.  Click OK.  Then run this shortcut to launch Firefox Profile Manager.

&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyUul7oH0e6fs5_iyUUD9mOI7wO3KRnMWvG5l11xYEF8ASCeebIt-Rd6zfsMa3HFIjECe1F2VWtUsHJGn3kRlJhVnoaIuk3zPlwuHC7AtmvXzwL5ZKmShAYkcEfm79lkytTgFopnt1-O4/s1600/firefox3-1-profilemanager.png&quot; border=&quot;0&quot; /&gt;
2. Create a new profile, name it &quot;&lt;span style=&quot;font-weight: bold;&quot;&gt;firefox3&lt;/span&gt;&quot;.  And uncheck the &quot;&lt;span style=&quot;font-weight: bold;&quot;&gt;Don&#39;t ask at startup&lt;/span&gt;&quot;

&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-Hg8Jnokl_aeVdaj0jTDZZ6N-6Ox05UYEcY13q-VM4KLZcG8hm6XAfdZWgwiIXa0yOeJnakxSjlJ_pUpEN-NDfXzzFWejnZ5t4orL33lhNF0N7pTOov9j9GgHMev8JQO84ec-lTWHxgM/s1600/firefox3-2-createprofile.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;
3. Go to Properties of the Firefox 2 shortcut again, remove the &quot;-profilemanager&quot; and add &quot;&lt;span style=&quot;font-weight: bold;&quot;&gt;-p default&lt;/span&gt;&quot; at the end of the path.  This forces Firefox 2 to open the original profile.

&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTtkjjsfOoejBTe2dDhKxhdNwuXch5XSTdw7ysX23gTZzrWHUuC0eUDckdEGphCj8y_h9lPylzUwt5ZlpaZ0OxcwJX_tVH8g8S5lv52s6nRMevYtnNPP7yWkq64L473mBjQyAn7JpBG-c/s1600/firefox3-3-2shortcut.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;
4. Start install Firefox 3.  Choose &quot;&lt;span style=&quot;font-weight: bold;&quot;&gt;Custom&lt;/span&gt;&quot; when you are asked.

&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl8eNPup9Kbuir_Tsi9xKQNf4bF7wTPyYmr9p9-2X2xxmQcVy6UjI5H5DXVoUcvun8_3ZjmZGKXDobbJ6AY0zTqwz-fBItMMdxGggYNpZGqNe3YAfHFB0ET1vqZ8YWms5ADUa09og6TTM/s1600/firefox3-4-custom.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;
5. The default Destination Folder is &quot;Mozilla Firefox 3 Beta 1&quot;, which is stupid when you later update to Beta 2, Beta 3 or even 3.0.1.  So change it to &lt;span style=&quot;font-weight: bold;&quot;&gt;Mozilla Firefox 3&lt;/span&gt;

&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3Q9UgECGKibKVfjPNgxOxJStcGVtoDzPdHCCcqou7LPrrDRxGZRc7zvUOEqLDSlVMXNai2YZpWFWlujWmIvKW9RMxspf0IP-h4__TciqgWsaRFjFXl6wXxkGTmYcWNPYUN096Z1t4K-0/s1600/firefox3-5-path.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;
6. Same in Start Menu Folder name.

&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFf2JYda_JQCaMCWivHYFaH9vnOsOII7_100tS5yaddfiPbkclPOyk8POahjOU4BvTwniftWPMy0x2BqxnfwBbhnxmTAzEaybHqCXisQIwaynsXUs3uvHpo8JyL7j8yiKXLxLq1dGulgQ/s1600/firefox3-6-group.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;
7.  When installation completed, uncheck the &quot;&lt;span style=&quot;font-weight: bold;&quot;&gt;Launch Firefox now&lt;/span&gt;&quot;.  You still have something to do before you can run it.

&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAyA84wyTPUr-V913FumHionhdJ4DesWbzdO9QT8Qy_8jmNaCjl6T0IuT3I0XlDMDbWus5u7W5fvC9ulYsf3hMkpMbKFI2h-4yvi2BzB8acf2fYmnmH00OQWgIFkMV3QarKV7141fII3s/s1600/firefox3-7-nolaunch.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;
8. Go to the Properties of the Firefox 3 shortcut.  Append &quot;&lt;span style=&quot;font-weight: bold;&quot;&gt;-no-remote -p firefox3&lt;/span&gt;&quot; to the Target.  The &quot;-no-remote&quot; will let Firefox run a separate instance.  The &quot;-p firefox3&quot; will force your Firefox 3 to run the newly clean profile.

&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfpRcZxVy8Ld-6lJONmdXU9xlQzrqXQJbMG-twHnOfDBT6i722iQmyYtdJhLdJddV_Ij6fS27M9WHJG8dtsjOrM6N9zwNH2r3k9TEu6Z1M5nPTInN4lZA-e4GcyyJurtzETgjaQoIe84w/s1600/firefox3-8-3shortcut.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;
9. Run the Firefox 3, and you will be prompted  that your Firefox is not the default browser.  &lt;b&gt;DON&#39;T&lt;/b&gt; click Yes.  Firefox 3 is not stable and you won&#39;t like to use it as your default browser.  Simple uncheck the &quot;Always perform this check when starting Firefox&quot; and click No.

&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8vxL3ppFZ3hFsjKE8qBjuCe7HxcaLeGkNuV-s9WZXb7RfD4J_zryqLiA2fbSbelkCGJhQJS4jBaUbbTssJR9WBMwRLr3S9qk60Yhf1IUVZY7kmSLlHV46CrtWuT_t_XXS4DKWZzqEPr8/s1600/firefox3-9-nodefault.png&quot; border=&quot;0&quot; /&gt;
10. Now you can run Firefox 2 and Firefox 3 at the same time.  Enjoy it.
&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/8236269565117099729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/8236269565117099729' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/8236269565117099729'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/8236269565117099729'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2007/11/howto-install-firefox-3-co-exists-with.html' title='Howto install Firefox 3 to co-exists with Firefox 2'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyUul7oH0e6fs5_iyUUD9mOI7wO3KRnMWvG5l11xYEF8ASCeebIt-Rd6zfsMa3HFIjECe1F2VWtUsHJGn3kRlJhVnoaIuk3zPlwuHC7AtmvXzwL5ZKmShAYkcEfm79lkytTgFopnt1-O4/s72-c/firefox3-1-profilemanager.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-3111071259279130799</id><published>2007-09-29T03:15:00.001+08:00</published><updated>2023-01-10T10:44:41.181+08:00</updated><title type='text'>Greasemonkey script to show actual unread count in Google Reader</title><content type='html'>&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_3gqLLaIDpd83wMo1XjyP4x2YHstSQovcPbG_lrySRq9ia79WsfhO9HC4KXMNb4SlgZt6t9nmdbzUQ5UHWn9UFiWeorH-WQlnySM-CpK2vjIH-zEbxBhNkkXF1d8bq7vhRUobT4ARHeU/s1600/greader-unread-2.png&quot; /&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
I subscribed over 200 feeds in &lt;a href=&quot;http://reader.google.com/&quot;&gt;Google Reader&lt;/a&gt;. And for some reason I did not login for a week, guess what? I have thousands of unread items. At the old days, Google Reader displayed &quot;100+&quot; unread items which is absolutely not enough for most users. After upgrading, it improved. Now it displays &quot;1000+&quot; as unread items count. It is enough for most cases, but not this one.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
I start clearing the articles. After a few hours I loss the motivation. The unread count is always &quot;1000+&quot; and I don&#39;t know when can I finish. I don&#39;t know the target. I need to know the exact unread items count. So I wrote a Greasemonkey script to &lt;a href=&quot;https://sites.google.com/site/angusdev/projects/google-reader-unread-count&quot; target=&quot;_blank&quot;&gt;calculate the actual unread count&lt;/a&gt;.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
&lt;a href=&quot;http://userscripts.org/scripts/show/12601&quot; target=&quot;_blank&quot;&gt;Install the script in userscripts.org&lt;/a&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
After installed the script, you can see a button (the Google Reader icon) besides the unread count, click on it will do the calculation and update the unread count with the actual number. Note that it will ignore any duplicated entries.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
This is not the best solution. It doesn&#39;t auto-update, you have to click it every time. But at least you can get the count and you shouldn&#39;t use it every day.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/3111071259279130799'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/3111071259279130799'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2008/11/greasemonkey-script-to-show-actual.html' title='Greasemonkey script to show actual unread count in Google Reader'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_3gqLLaIDpd83wMo1XjyP4x2YHstSQovcPbG_lrySRq9ia79WsfhO9HC4KXMNb4SlgZt6t9nmdbzUQ5UHWn9UFiWeorH-WQlnySM-CpK2vjIH-zEbxBhNkkXF1d8bq7vhRUobT4ARHeU/s72-c/greader-unread-2.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-7067464703932358717</id><published>2007-04-04T00:00:00.003+08:00</published><updated>2022-11-04T06:22:44.291+08:00</updated><title type='text'>Learn from PNG file header</title><content type='html'>When you designing your own file format, you should consider to use the &lt;a href=&quot;http://www.libpng.org/pub/png/spec/1.2/PNG-Structure.html&quot; target=&quot;_blank&quot;&gt;PNG file header&lt;/a&gt;.&amp;nbsp; This is the smartest file header.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is the first 8 bytes of a PNG file:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
 
&lt;table cellpadding=&quot;4&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; border: 1px solid grey; text-align: center;&quot;&gt;
  &lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;137&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;80&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;78&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;71&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;13&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;10&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;26&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;10&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;P&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;N&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;G&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;\r&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;\n&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;Ctrl-Z&lt;/td&gt;&lt;td style=&quot;border: 1px solid grey;&quot;&gt;\n&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div&gt;

  Each byte has it&#39;s own usage:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;137&lt;/div&gt;&lt;div style=&quot;padding-left: 20px;&quot;&gt;This is a non-ASCII character to serve two purposes:&lt;/div&gt;&lt;div style=&quot;padding-left: 40px;&quot;&gt;- Text editor will treat it as binary file&lt;/div&gt;&lt;div style=&quot;padding-left: 40px;&quot;&gt;- To catch the error on FTP ASCII transfer types&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;80 78 71 (PNG)&lt;div style=&quot;padding-left: 20px;&quot;&gt;Human readable file type&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;13 10 (\r \n)&lt;/div&gt;&lt;div style=&quot;padding-left: 20px;&quot;&gt;To catch the the file is converted from Windows line encoding to Unix line encoding&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;26 (Ctrl-Z)&lt;/div&gt;&lt;div style=&quot;padding-left: 20px;&quot;&gt;This is end-of-file marker to prevent dispalying lots of garbage characters if user &quot;type&quot; file in DOS&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;10&lt;/div&gt;&lt;div style=&quot;padding-left: 20px;&quot;&gt;To catch the the file is converted from unix Line encoding to Windows line encoding&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The PNG file header can detect common transfer errors and is readable if type the file in DOS terminal.&lt;/div&gt;
&lt;br/&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/7067464703932358717'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/7067464703932358717'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2007/04/learn-from-png-file-header.html' title='Learn from PNG file header'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-7558185534940841220</id><published>2007-02-13T23:27:00.004+08:00</published><updated>2022-11-16T08:07:23.392+08:00</updated><title type='text'>A bug that is easily overlooked</title><content type='html'>Today I found a bug at work. The program is simple but the bug is easily overlooked. Here is the program (Java):

&lt;pre class=&quot;code&quot;&gt;long timeSpan = 90 * 24 * 3600 * 1000;
System.out.println(timeSpan);
&lt;/pre&gt;

What is the result of execution?&lt;br /&gt;&lt;br /&gt;

This line is to calculate the total milliseconds of 90 days.  The correct result shoudl be 7776000000, but the above program prints -813934592. We all know that it is numerical overflow. But why it is overflowed even I am already using long?
&lt;br /&gt;&lt;br /&gt;
The problem is Java uses integer to store the intermediate result before assigning to the final variable. The correct syntax should be:

&lt;pre class=&quot;code&quot;&gt;long timeSpan = 90&lt;span style=&quot;color: red;&quot;&gt;L&lt;/span&gt; * 24 * 3600 * 1000;
System.out.println(timeSpan);&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/7558185534940841220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/7558185534940841220' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/7558185534940841220'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/7558185534940841220'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2007/02/a-bug-that-is-easily-overlooked.html' title='A bug that is easily overlooked'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-3714170784178271908</id><published>2007-02-07T03:58:00.000+08:00</published><updated>2022-11-16T06:43:52.653+08:00</updated><title type='text'>Preserve directory when change drive in cygwin</title><content type='html'>In &lt;a href=&quot;http://www.cygwin.com/&quot;&gt;cygwin&lt;/a&gt;,  you can use &quot;cd c:&quot; or &quot;cd d:&quot; to change to different drives.  However, it always change to the root directory of the drive.  In Windows command prompt you have a nice feature that the c: or d: will change to the directory that you previous stayed in that drive.  For example:&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;div class=&quot;commandprompt&quot;&gt;C:\Program Files\Mozilla Firefox\extensions&amp;gt;d:&lt;br /&gt;
D:\&amp;gt;c:&lt;br /&gt;
C:\Program Files\Mozilla Firefox\extensions&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
However, in bash, you just can&#39;t do this&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&lt;div class=&quot;commandprompt&quot;&gt;extensions&amp;gt;cd d:&lt;br /&gt;
d&amp;gt;cd c:&lt;br /&gt;
c&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
Here I add some aliases to implement this feature in bash.  Add the following lines in $HOME/.bashrc:&lt;div&gt;&amp;nbsp; &amp;nbsp;&lt;div class=&quot;code&quot;&gt;export PWD_c=c:/&lt;br /&gt;
export PWD_d=d:/&lt;br /&gt;
export PWD_e=e:/&lt;br /&gt;
alias c:=&#39;export PWD_`expr substr &quot;$PWD&quot; 11 1`=&quot;$PWD&quot;;cd &quot;$PWD_c&quot;&#39;&lt;br /&gt;
alias d:=&#39;export PWD_`expr substr &quot;$PWD&quot; 11 1`=&quot;$PWD&quot;;cd &quot;$PWD_d&quot;&#39;&lt;br /&gt;
alias e:=&#39;export PWD_`expr substr &quot;$PWD&quot; 11 1`=&quot;$PWD&quot;;cd &quot;$PWD_e&quot;&#39;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
You may need to add more PWD_x environment variables and alias in case you have more drive.  Make sure you have the quotes (&quot;) because of the spaces in long file name.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/3714170784178271908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/3714170784178271908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/3714170784178271908'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/3714170784178271908'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2007/02/preserve-directory-when-change-drive-in.html' title='Preserve directory when change drive in cygwin'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6256145082126410735.post-3470904160364209748</id><published>2006-11-03T00:17:00.004+08:00</published><updated>2022-11-16T08:06:37.372+08:00</updated><title type='text'>Use Executors to create thread pool in JavaSE 5</title><content type='html'>JavaSE 5 introduces the Executors makes creating Thread Pool much simplier:

&lt;pre class=&quot;code&quot;&gt;import java.util.concurrent.Executor;  
import java.util.concurrent.Executors;  
  
public class TestExecutor {  
    public static class Command implements Runnable {  
        private int id;  
  
        public Command(int id) {  
            this.id = id;  
        }  
  
        public void run() {  
            System.out.println(id + &quot; Begin &quot; + Thread.currentThread().getName());  
            try {  
                Thread.sleep(3000);  
            }  
            catch (InterruptedException ex) {  
                ex.printStackTrace();  
            }  
            System.out.println(id + &quot; End   &quot; + Thread.currentThread().getName());  
        }  
    }  
  
    public static void main(String[] args) {  
        Executor tp = Executors.newFixedThreadPool(3);  
        tp.execute(new Command(1));  
        tp.execute(new Command(2));  
        tp.execute(new Command(3));  
        tp.execute(new Command(4));  
        tp.execute(new Command(5));  
    }  
}  
&lt;/pre&gt;

And below is the result:&amp;nbsp; &amp;nbsp;&lt;div&gt;&lt;pre class=&quot;commandprompt&quot;&gt;1 Begin pool-1-thread-1
2 Begin pool-1-thread-2
3 Begin pool-1-thread-3
1 End   pool-1-thread-1
4 Begin pool-1-thread-1
2 End   pool-1-thread-2
5 Begin pool-1-thread-2
3 End   pool-1-thread-3
4 End   pool-1-thread-1
5 End   pool-1-thread-2
&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://angusdev.blogspot.com/feeds/3470904160364209748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/6256145082126410735/3470904160364209748' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/3470904160364209748'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6256145082126410735/posts/default/3470904160364209748'/><link rel='alternate' type='text/html' href='https://angusdev.blogspot.com/2006/11/use-executors-to-create-thread-pool-in.html' title='Use Executors to create thread pool in JavaSE 5'/><author><name>Angus</name><uri>http://www.blogger.com/profile/04572573943214646766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNWxDs__yIohD-Vd3H5tDyjEoBCSdshKmHe2CVeFhr9-gNb7sJL8ghLBP2Yiykh_nGi_mlW6CAGXZHc2oXXuoFcDz4IlfsTdiPH9_UfXH8Th6G5K89wcozrKvHhGbnLg/s113/angusdev-logo-400.jpg'/></author><thr:total>0</thr:total></entry></feed>