<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Val Petruchek on Web-Development &#187; email</title>
	<atom:link href="http://petruchek.com/tag/email/feed/" rel="self" type="application/rss+xml" />
	<link>http://petruchek.com</link>
	<description>PHP, JavaScript, MySQL, Apache, CSS</description>
	<lastBuildDate>Sun, 13 Sep 2020 18:58:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>It&#8217;s not my birthday, it&#8217;s a NEW YEAR, dumbass.</title>
		<link>http://petruchek.com/2015/01/its-a-new-year-dumbass/</link>
		<comments>http://petruchek.com/2015/01/its-a-new-year-dumbass/#comments</comments>
		<pubDate>Fri, 02 Jan 2015 12:14:32 +0000</pubDate>
		<dc:creator>val</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[null]]></category>
		<category><![CDATA[timestamp]]></category>

		<guid isPermaLink="false">http://petruchek.com/?p=193</guid>
		<description><![CDATA[On the January 1st this year I got one very odd email from online store I purchased something from couple of years ago (BTW, it was the worst online shopping experience ever: it worked like a soviet hospital, not an &#8230; <a href="http://petruchek.com/2015/01/its-a-new-year-dumbass/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img src="http://petruchek.com/wp-content/uploads/2015/01/happy-birthday-and-happy-new-year.png" alt="happy-birthday-and-happy-new-year" width="300" height="350" class="alignnone size-full wp-image-199" align="left" style="margin:10px !important" />On the January 1st this year I got one very odd email from online store I purchased something from couple of years ago (<em>BTW, it was the worst online shopping experience ever: it worked like a soviet hospital, not an internet shop</em>).</p>
<p>Anyway, it was a &#8216;<strong>Happy Birthday</strong>&#8216; email, and no, my birthday is not the January, 1st.</p>
<p>It&#8217;s very unlikely that I entered 01/01 as my DOB: I try not to tell it to online stores when the field is not required; even when it is I prefer to enter 02/29 to minimize the number of such automated HB congratulations.</p>
<p>So it got me thinking: <strong>why on earth would their database contain 01/01 as my DOB? </strong></p>
<p>My best guess is that they are storing date of birth as a <a href="unixtimestamp.com">unix timestamp</a>. And at some point the value I provided (NULL) got converted to 0 (zero).</p>
<p>And zero seconds since the Epoch means 01/01/1970: so, their software decided I just turned 45 and sent me a happy birthday email (I didn&#8217;t think it was possible, but my opinion about that particular store got worse).</p>
<p><u>What lessons should developers learn from this story?</u></p>
<ol>
<li>Never use TIMESTAMP when you can use DATE data type. They are different, and <strong>date</strong> of birth is definitely a DATE.</li>
<li>Do not confuse NULL and zero (or empty string). NULL is a special value, meaning &#8216;NOTHING&#8217;. There are cases, when it&#8217;s the same as zero (e.g.: number of items purchased), but generally it&#8217;s not the same (as in my example with non-entered DOB).</li>
<li>Use DEFAULT values properly. 0 and NULL are not necessary the same.</li>
<li>Treat data carefully during upgrades/conversions. I&#8217;m not sure if the DOB field was there when I was registering at the website, but it could be introduced in the database later &#8211; and all old records may have got their values for DOB field set to 0 instead of NULL. </li>
</ol>
<p>In my last guess is true, I&#8217;m not the only one who got that stupid &#8216;Happy Birthday&#8217; notification when we should have received &#8216;Happy New Year&#8217; notification instead.</p>
<p><strong>Happy New Year to all (if any) readers of this blog!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://petruchek.com/2015/01/its-a-new-year-dumbass/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excessive resource usage</title>
		<link>http://petruchek.com/2014/09/excessive-resource-usage/</link>
		<comments>http://petruchek.com/2014/09/excessive-resource-usage/#comments</comments>
		<pubDate>Wed, 24 Sep 2014 12:34:14 +0000</pubDate>
		<dc:creator>val</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[hosting]]></category>

		<guid isPermaLink="false">http://petruchek.com/?p=188</guid>
		<description><![CDATA[Just got an email from one of servers warning me about excessive resource usage: Time: Wed Sep 24 05:21:12 2014 -0500 Account: val Resource: Process Time Exceeded: 1844 > 1800 (seconds) Executable: /bin/bash Command Line: -bash PID: 21234 (Parent PID:21233) &#8230; <a href="http://petruchek.com/2014/09/excessive-resource-usage/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Just got an email from one of servers warning me about excessive resource usage:</p>
<blockquote><pre><code>Time:         Wed Sep 24 05:21:12 2014 -0500
Account:      val
Resource:     Process Time
Exceeded:     1844 > 1800 (seconds)
Executable:   /bin/bash
Command Line: -bash
PID:          21234 (Parent PID:21233)
Killed:       No</code></pre>
</blockquote>
<p>I was confused, because everything I was doing there ran smoothly and quickly &#8211; no scripts hanging or something like that.</p>
<p>Then I realized I could run `top` to see whether the process (I had its PID) is still there. </p>
<p>It was. It was my bash session. <strong>Server was notifying me that my terminal session was using resources excessively &#8211; by simply staying connected to the server.</strong></p>
<p>Okay.</p>
]]></content:encoded>
			<wfw:commentRss>http://petruchek.com/2014/09/excessive-resource-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test before you send</title>
		<link>http://petruchek.com/2010/10/test-befor%d1%83-you-send/</link>
		<comments>http://petruchek.com/2010/10/test-befor%d1%83-you-send/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 15:18:43 +0000</pubDate>
		<dc:creator>val</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[support]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://petruchek.com/?p=41</guid>
		<description><![CDATA[This summer was really hot for my hosting provider. Here is summary of emails I&#8217;ve received from them: Jun 11: On June 27, 2010, between 06:00am and 10:00am CST, our Development and Database teams will be performing several upgrades of &#8230; <a href="http://petruchek.com/2010/10/test-befor%d1%83-you-send/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This summer was really hot for my hosting provider. Here is summary of emails I&#8217;ve received from them:<br />
<strong>Jun 11:</strong></p>
<blockquote><p>On <u>June 27, 2010</u>, between 06:00am and 10:00am CST, our Development and Database teams will be performing several upgrades of the infrastructure that support Orbit.</p></blockquote>
<p><strong>Jun 16:</strong> </p>
<blockquote><p>On <u>June 13, 2010</u>, between 01:00am and 02:00am CST, our Product Support team will perform a reboot of ******.**.***** which provides load balancing services to you.</p></blockquote>
<p><strong>1 hour later:</strong> </p>
<blockquote><p>Today you received a maintenance notification dated for June 13, 2010. The <u>incorrect message was sent out</u> and the correct will be sent at approximately 2pm CST.</p></blockquote>
<p><strong>5 minutes later:</strong> </p>
<blockquote><p>On <u>June 20, 2010</u>, between 06:00am and 10:00am CST, our Networking group will be performing code upgrades on ******.***** to resolve several bugs.</p></blockquote>
<p><strong>3 hours later:</strong> </p>
<blockquote><p>We apologize for the <u>recent notifications which have had incorrect information</u>. The correct change window for this maintenance is from 00:01 to 05:00 CT rather than 6:00 to 10:00 CST as previously sent.</p>
<p>The correct text should have read: </p>
<p>On <u>June 20, 2010</u>, between 00:01am and 05:00am CT, our Networking group will be performing code upgrades on *****.***** to resolve several bugs. </p></blockquote>
<p><strong>Jun 18:</strong> </p>
<blockquote><p>On <u>June 27, 2010</u>, between 06:00am and 10:00am CST, our Development and Database teams will be performing several upgrades of the infrastructure that support Orbit.</p></blockquote>
<p><strong>Jun 25:</strong> </p>
<blockquote><p>On <u>June 27, 2010</u>, between 06:00am and 10:00am CST, our Development and Database teams will be performing several upgrades of the infrastructure that support Orbit.</p></blockquote>
<p><strong>Jul 9 and Jul 15:</strong> </p>
<blockquote><p>Scheduled Maintenance<br />
<u>June 24, 2010</u></p></blockquote>
<p><strong>Jul 19:</strong> </p>
<blockquote><p>Emergency Maintenance<br />
<u>July 20, 2010</u></p></blockquote>
<p>Well, my first CRM emailing script sent same email to couple of customers 5 times before I realized something is wrong in my coding. Since that, I have extremely strict testing policy for every application which sends out mass emails. </p>
<p>The easiest way to do a quick test is replacing actual customer&#8217;s email address with special test accounts in the test mode and counting number of emails received as well as validating their contents (proof reading + %username% quick tag replacements and such). </p>
<p>It doesn&#8217;t take much time but prevents you from annoying your customers &#8211; &#8220;hey, what kind of IT company are they if they can&#8217;t even handle their own mass mailing properly?&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://petruchek.com/2010/10/test-befor%d1%83-you-send/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
