Formatting mysql datetime with php
Very useful, so posting here. Read the php date function page for more details. $mysql_datetime = date("Y-m-d H:i:s"); Ref: http://stackoverflow.com/questions/136782/format-mysql-datetime-with-php
Very useful, so posting here. Read the php date function page for more details. $mysql_datetime = date("Y-m-d H:i:s"); Ref: http://stackoverflow.com/questions/136782/format-mysql-datetime-with-php
A while ago when I tried to stress-test my site on Load Impact, my web server actually couldn’t handle the traffic and hung in the middle of the test… Recently I installed this wordpress plugin called Quick Cache (Speed Without Compromise) and I noticed a huge difference in page response time. Installation was a piece of cake. Then I ran the stress test again from Load Impact. The result is very satisfying. The green line is the number of active client. The blue line is the user load time. From the chart, it shows that the average load time is constant even when the # of active clients increases. Amazing! ...
Sometimes you may need to do a DNS flush, say after a mysterious DNS network issue. Here are the commands. Mountain Lion / Lion sudo killall -HUP mDNSResponder Leopard sudo dscacheutil -flushcache Tiger lookupd -flushcache Windows ipconfig /flushdns Run a nslookup or ping to check if you are indeed getting the correct IP(s) from the DNS server(s).
I notice the Mail application on my Mountain Lion has been running slower and slower. Lately, it’s so slow that the spinning wheel comes out and stays for a while from time to time. It turns out there is a way to speed up Mail. It’s to rebuild the email database. Just go to the Mail menu and click Mailbox, then click Rebuild. Then I suggest you go take a walk. There is really no spinning wheel of any sort to notify you what’s going on, in fact you may not even notice if anything is happening in the background. But from my experience, after you come back, Ctrl-Q your Mail application. Then open it up again, Mail will start indexing your emails. After a while depending on your mailbox size, your mailbox will be a lot faster than before. ...
qtip2 is very handy to show/hide additional information on websites. The qtip content is by default cached to minimize unnecessary fetching. However though, sometimes it’s desirable to fetch for new content every time the tooltip comes up. In that case, use the once : false attribute to force re-fetching of new content. $('#my_dom_element').qtip({ content: { text: 'loading...', ajax: { url: 'my_content.php', once: false // need to re-fetch every time }, title: { text: 'My title', button: true } }, position: { at: 'left center', // Position the tooltip above the link my: 'right bottom', viewport: $(window), // Keep the tooltip on-screen at all times effect: false // Disable positioning animation }, show: { event: 'mouseenter', solo: true // Only show one tooltip at a time }, hide: 'unfocus', style: { classes: 'ui-tooltip-wiki ui-tooltip-light ui-tooltip-shadow', width: '800px' } });
[youtube &w=640&h=360] 是非顛倒,可恥可恥
一位醫生在接到緊急手術的電話之後,以最快的速度趕到醫院,並用最快的速度換上手術服。 當他朝手術室走來時,焦急萬分的男孩的父親失控地對他喊道:「你怎麼這麼晚才來?你難道不知道我兒子的生命正處在危險中嗎?你難道一點責任心都沒有嗎?」 醫生淡然地笑著說:「很抱歉,剛剛我不在醫院。但我一接到電話就以最快的速度趕來了。現在,我希望您能冷靜一下。這樣我也好去做我的工作。」 「冷靜?如果手術室裡是你的兒子,你能冷靜嗎?如果現在你兒子死了,你會怎樣?」男孩的父親憤怒地說。 醫生又淡然地笑了,回答道:「我將會默誦聖經上的一句話:‘我們從塵土中來,也都歸於塵土,祝福是主的名字。‘醫生不能延長生命,我們只是在神的恩典下盡力而為,請為你的兒子祈禱吧。」 「當人漠不關心時才會給出如此輕巧的建議。」男孩的父親嘀咕道。 幾個小時後,手術順利完成,醫生高興地走出來,對男孩的父親說:「謝天謝地,你的兒子得救了!」 然而,還沒有等到男孩的父親答話,他便匆匆離去了,並說:「如果有問題,你可以問護士!」 「他怎麼如此傲慢?連我問問兒子的情況這幾分鐘的時間他都等不了嗎?」父親對護士忿忿不平地說道。 護士的眼淚一下子就流出來了。「他的兒子昨天在一次交通事故中死了。當我們叫他來為你兒子做手術的時候,他正在去墓地的路上。現在,他救活了你兒子,要趕去完成他兒子的葬禮。」 有時候不要這麼快下結論,因為你不知道別人正在面對什麼! Ref link: http://ibook.idv.tw/enews/enews721-750/enews735.html
I did become an engineer, haha.
For some reasons the default highcharts pie chart has no url links. Or at least that feature is not being demo’ed. See their example here: http://www.highcharts.com/demo/pie-basic. After tweaking the code for a while, here is the code that enables URL links in a pie chart. var chart; $(document).ready(function() { chart = new Highcharts.Chart({ chart: { renderTo: 'my_chart_id', plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false }, title: { text: 'my_title' }, tooltip: { formatter: function() { var y = this.y; var p = Math.round(this.percentage*100)/100; return ''+ this.point.name +': ' + y + ' (' + p + '%)'; } }, plotOptions: { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: false }, showInLegend: true } }, series: [{ type: 'pie', name: 'overall', point: { events: { click: function(e) { //this.slice(); //console.log(e); location.href = e.point.url; e.preventDefault(); } } }, data: [ {name: 'Not Tested', color: '#FFA850', y: 87, url: 'http://my_site1.com'}, {name: 'Fail', color: '#FF2929', y: 2, url: 'http://my_site2.com'}, {name: 'Pass', color: '#31FF4F', y: 32, url: 'http://my_site3.com'} ] }] }); }); The part that enables the clicking is the new url key in data, and the event handling. ...
I have signed up for Comcast’s bundle deal for TV and internet a few months ago. After a while I cancelled the TV service. I wasn’t really paying much attention to my bills until today I checked, Comcast is charging me $62.95 for internet service only? Really? Why??? I have done some research and all I can say is the pricing info is very unclear, not until you get your bill. ...