[公告] 痞客邦「應用市集」新 App 上架-iFontCloud Professional[公告] 痞客邦後台發表文章提供插入多張圖片新功能[公告]痞客邦新服務上線 部落客商店聚集就在《痞市集》[公告] 部落格「快捷功能BAR」改版介紹[公告] 痞客邦「快捷功能BAR」6月4日改版通知

想要知道眼前的迷霧裡到底有什麼?

在原地猜呀猜,等人先去看再告訴你?

最快的方法還是往前走過去探索。

 

解決問題也是一樣,深入了解問題才能找到解決方法。

 

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()

人生應該多勇敢挑戰困難的事、不懂的事

而不是一直做自己會的事而沾沾自喜

 

 

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()

 

Mr. Crowley - Ozzy Osbourne

Mr. Crowley, what went on in your head?
Oh, Mr. Crowley, did you talk to the dead?
Your life style to me seemed so tragic
With the thrill of it all
You fooled all the people with magic
Yeah, you waited on Satan's door

Mr. Charming, did you think you were pure?
Mr. Alarming, in nocturnal rapport
Uncovering things that were sacred
Manifest on this Earth
Conceived in the eye of a secret
And they scattered the afterbirth

Mr. Crowley, won't you ride my white horse?
Mr. Crowley, it's symbolic, of course
Approaching a time that is classic
I hear that maiden's call
Approaching a time that is drastic
Standing with their backs to the wall

Was it polemically sent
l want to know what you meant
I want to know, I want to know what you meant, yeah

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()

如果程式沒有把參數用設定檔寫好的話,這個參數值可能就會用在很多程式碼中

突然參數值要改的話,就必需個檔一個檔開起來改很費時間

下面這個指令可以幫你找出所有副檔名是.php的檔,其中有包含 "要被取代的字" 的檔名有哪些,最後針對這些檔案做文字取代:

 

find . -name "*.php" | xargs grep "要被取代的字" | awk -F: '{print $1}' | uniq | xargs sudo sed -i "s/要被取代的字/取代後的字/g"

, , , , , , , , ,

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()

有時候在command line打包好一個檔,卻又懶的用 ftp 或 sftp抓的時候,可以直接用mail指令寄到信箱

先看看用法

Usage: mail -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users

 

簡單寄檔案:

> echo "As Attached" | mail -s "標題哥" -a "/檔案路徑/檔名.tar" receiver@mail.com

, , , , , , , , , ,

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()

有時候PDO物件連線,然後程式在處理大量資料時,Mysql等太久最後timeout斷線了

這時執行query就會需到Mysql Server has gone away的錯誤 (uncaught exception)

一昧的加大timeout,不如直接Catch這個Exception

範例程式如下:

失敗後重連線一次

 /** 
截取我的程式的一部分
$this->Connect是我的PDO物件*/

function executeQuery($query) {
$sth = $this->Connect->prepare($query); try {
$sth->execute($params);//執行query
} catch (PDOException $e) {

/** 這邊會抓到PDO的Exception */ $this->connect(); //重新連線
/** 這邊也可以用遞迴 $this->executeQuery($query)*/ $sth=$this->Connect->prepare($query); $sth->execute($params);

}
.
(略)
.
.
}

補充,你可以判斷Exception的種類看是不是真的是Mysql Server has gone away,然後做是否重連線執行query的決定。

當然你也可以設retry,用遞迴的方式把retry的次數繼續往下帶:

 

 /** 
遞廻方式
*/

function executeQuery($query, $retry = 3) {

if ($retry == 0) {
return false;
}
$sth = $this->Connect->prepare($query); try {
$sth->execute($params);//執行query
} catch (PDOException $e) {

/** 這邊會抓到PDO的Exception */
$this->connect(); //重新連線
$sth=$this->executeQuery($query, $retry--);

}
.
(略)
.
.
}

 

, , , , , , , , , , ,

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()

此範例來自

http://www.php.net/manual/en/function.pcntl-fork.php

通常用在需要大量呼叫SOAP API或RestfulAPI時使用

比方說我有1000張照片,我要用API取得這1000張照片的資訊,每呼叫一次api就需要1秒

1000張就約需要1000秒

如果用multi-process,一次送25個request,相當於速度提升25倍(不考慮其他因素如cpu、memory、api端的loading)

 

<?php 
declare(ticks=1); 
//A very basic job daemon that you can extend to your needs. 
class JobDaemon

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()

相信有用PHP輸出CSV報表的人都有遇過中文亂碼的問題吧

有的人開起來正常,有的人開起來亂碼

解法就是把檔案輸出成XLS的格式就沒問題了-使用套件PHPExcel (http://phpexcel.codeplex.com/)

程式邏輯想像你今天用Office Excel做CSV轉檔成XLS,就是用Excel打開一個CSV檔並另存新檔成XLS

 

, , , , ,

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()

國內的虛擬主機價格過高,又不能自己ssh進去coding (我用VIM)

朋友推薦這個國外主機就自由多了,可以ssh進去,又便宜又有固定IP

而且還是SSD : https://www.digitalocean.com/?refcode=08b0aaf45cc4

Digital Ocean, 一個月最便宜的專案是 5美金/月

 

 

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()



譜請按繼續閱讀 

 Google幫你找: https://www.google.com.tw/search?q=filetype%3Apdf+while+my+guitar+gently+weeps+jake
 

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()

When I was playing in Los Angeles a few years ago I remember a jazz saxophonist telling me that rockabilly was too simple, it usually only had three chords. Then he listened to more of it and agreed with me that yes it has three chords but the feel and groove of how you play those three chords is not nearly as simple as it may seem. 

Rockabilly comes from a time in which music had a big swing feel which was necessary for the dancers who wished to "dance to the bop", and has a kind of hillbilly approach to playing swing that gives it its own special rhythm. Let's try this in the key of E over standard 12-bar blues changes. 

I have two basic rhythms to get started with. This one is an arpeggio style and the other in the following lesson is single 8th notes on low strings.

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()

Now we will use different types of pick-style approaches to "stylize" the previous video's "upper-register common-tone" progressions. This video focuses on picking techniques inspired by Dave Matthews and Neil Young, and features some other arpeggiation approaches.

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()

If I had to use one word to describe the overall sound of Gilmour's lead playing it would be "epic". He has played many great and original solos over the years, but in my opinion "epic" is what come to mind for most people. In this lesson I'll break down a solo in his style that incorporates many of the elements that make his soloing "epic".

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()


Welcome to the wonderful world of acoustic fingerpicking! We are going to start right at the beginning with a simple pattern, and move all the way on through up to some techniques of the pros!
Let's start from the top, with a simple 4-step pattern.

This four-step fingerpicking pattern is a super-powerful building block for fingerstyle guitar.

For this pattern, play the sixth string (Low E) with a downward pluck of your thumb. Next, pluck upwards on the first string (high E string) with your middle finger. Next, pluck downwards on the third string (G string) with your thumb. Lastly, pluck upwards on the second string (B string) with your index finger.

This pattern of four steps constitutes one half measure of music in 4/4 time. The count is: One And Two And. To complete a full measure, simply play the pattern again, with this count: Three And Four And.

Repeat this pattern over and over, trying to maintain a consistent rhythm, and gradually building up your speed.

In the next lesson, we'll take a look at how to apply this pattern to a variety of chords.

COMMONLY ASKED FINGERPICKING QUESTIONS:

Q: I see you are using only your thumb, index, and middle fingers? I've seen some players use three fingers, plus the thumb. Which is correct?

A: There is no absolute right or wrong to this. You'll hear opinions on both sides of the aisle. My personal preference is based on the tradition called "Travis Picking" named for guitarist Merle Travis. I personally feel this pattern of finger moves, which uses the thumb twice within the pattern, opens up more rhythmic possibilities as you get into more advanced techniques.

Q: What is "TRAVIS PICKING?"

A: The signature "Travis" move is that alternating thumb beat - the fact that your thumb does double-duty, alternating between the bass note, and the third string (or a variation of that) of the guitar. That provides a steady rhythm against which you can then add ornamentations, syncopation, melody, etc. Some students ask why they can't do these same patterns using three fingers, and the thumb on the bass note only. Technically you may be able to, but in so doing you compromise that steady "thump thump" of the Travis-style thumb beats.

Q: Is it necessary to have long fingernails to play fingerstyle guitar?

A: No. My personal preference is to have long-ish nails on the thumb, index, and middle fingers of my right hand. However, many players prefer to play with short nails. There is a difference in tone when using nails vs. not using nails. With nails, the tone is a bit crisper, without nails, it is a bit more muted. It's a matter of personal preference.

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()

狗狗不見的人或是撿到狗狗的人,現在有一個新的平台可以把消息公佈出去

尋狗網: http://www.findingdog.com.tw/

Posted by Oscar at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()