From Night to Day to Night Again (by NASACrewEarthObs)
Author Archives: speters
Your time is limited…
Your time is limited, so don’t waste it living someone else’s life. Don’t be trapped by dogma – which is living with the results of other people’s thinking. Don’t let the noise of other’s opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.
Droid 3 Rant
I got my phone ( #Droid3 ) 2-3 weeks after it came out in the expectation that it would be supported with featured updates for my whole contract. It has been stated by #motorolamobility [3,4] that it is no longer getting updates only 10 months after it was released.
+Google announced #ics on May 10th, 2011 [1] and the Droid 3 was announced on July 7th [2]. That is plenty of time after ICS to assume the D3 will support ICS in the future.
I want to know what +Verizon Wireless is doing or can do to support my phone with updates beyond bug fixes. Waiving the ETF, ending the contact after a year would be my preferred outcome so I can get a phone that is actually going to supported for its full ‘life’.
[1] http://arstechnica.com/information-technology/2011/05/google-announces-android-ice-cream-sandwich-will-merge-phone-and-tablet-oses/
[2] http://news.vzw.com/news/2011/07/pr2011-07-06a.html
[3] http://www.gottabemobile.com/2012/05/21/motorola-droid-3-and-droid-x2-wont-get-ice-cream-sandwich/
[4] https://community.verizonwireless.com/thread/773933
Growing Up
Why is it that when I see ‘adults’ get toys or do grown up things it cool but nothing I would do. But then when I see one of my friends my own age do something adult I’m like wtf. Case in point, one of my friends just got a motor cycle, tho I do have to say I’m the only one that’s married.
[PHP] PDO Function – Pastebin.com
[PHP] PDO Function – Pastebin.com
I think I may have just simplified PDO into the ground… It could use a little error catching but you can add that yourself.
304 Not Modified Header and PHP
This is a nice little snipet that I use when serving dynamic images so the client will cache them properly. It uses a 304 Not Modified header to tell the client to not re-download the file. This mostly saves on TCP overhead however a connection must still be made to the server. I’m sure that somewhere out there is a header to make it so the client won’t even send the request in the first place see edit.
$info = $result->fetch_assoc(); // They have the current version if (strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == strtotime($info['updated'])) { header('Last-Modified: '.gmdate("D, d M Y H:i:s", strtotime($info['updated'])) . " GMT", true, 304); exit(); // Sent them the file } else { // Headers header("Content-type: image/jpeg"); header("Last-Modified: " . gmdate("D, d M Y H:i:s", strtotime($info['updated'])) . " GMT"); header("Expires: " . gmdate("D, d M Y H:i:s", strtotime(time() + 3600) . " GMT"); # 1h header("Cache-Control: public, maxage=3600"); # 1h header("Content-Length: ".strlen($info['image'])); echo $info['image']; exit(); }
The only issue with this code is 99% of the server side work is alredy done. If it isn’t a mission critical image you can do this at the top of the file instead to save a lot of back end time.
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) { header('Last-Modified: '.gmdate("D, d M Y H:i:s", strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])) . " GMT", true, 304); exit(); }
Edit: Changing Cache-Control to public will make the browser just send a hello packet and not wait for a reply before showing the photo.
To Much Crap
No mater what I do, how much work I get done, there is always more! Tomorrow I have 2 doctors appointment starting at 8:30 and going through probably noon. After that I have a client meeting at 1 then I think I can finally go to work, but I need to run right back out to the bank! I am also expecting at some point tomorrow to get another call from a client asking me to go over there stuff yet again. My day will end up consisting of about 3 hours of actual work and the rest is just stuff thrown in.
On a side note, I made a page that is so 1995 its not even funny. Its still vary much a work in progress tho, I wanted to get the technical aspects out of the way first before I start really designing it. http://test.charliesdeals.com/
ps. I really need to figure out if this site is slow as shit because my webhost is still having issues or I have a bad WP setting.
304 Not Modified Header and PHP
This is a nice little snipet that I use when serving dynamic images so the client will cache them properly. It uses a 304 Not Modified header to tell the client to not re-download the file. This mostly saves on TCP overhead however a connection must still be made to the server. I’m sure that somewhere out there is a header to make it so the client won’t even send the request in the first place see edit.
$info = $result->fetch_assoc(); // They have the current version if (strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == strtotime($info['updated'])) { header('Last-Modified: '.gmdate("D, d M Y H:i:s", strtotime($info['updated'])) . " GMT", true, 304); exit(); // Sent them the file } else { // Headers header("Content-type: image/jpeg"); header("Last-Modified: " . gmdate("D, d M Y H:i:s", strtotime($info['updated'])) . " GMT"); header("Expires: " . gmdate("D, d M Y H:i:s", strtotime(time() + 3600) . " GMT"); # 1h header("Cache-Control: public, maxage=3600"); # 1h header("Content-Length: ".strlen($info['image'])); echo $info['image']; exit(); }
The only issue with this code is 99% of the server side work is alredy done. If it isn’t a mission critical image you can do this at the top of the file instead to save a lot of back end time.
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) { header('Last-Modified: '.gmdate("D, d M Y H:i:s", strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])) . " GMT", true, 304); exit(); }
Edit: Changing Cache-Control to public will make the browser just send a hello packet and not wait for a reply before showing the photo.