Thursday, July 18, 2013
Music app and channels
1) Blue Rock from ROCKRADIO.com plays the likes of Buddy Guy, Stevie Ray Vaughan, Freddie King... etc. That's my favourite Blues sub-genre
2) Thrash Metal from ROCKRADIO.com plays my favourite Metal sub-genre. Death Angel, Testament, Slayer all played thrash. I've also heard Shadows Fall on it! And I "discovered" the German Thrash band Cripper featuring female vocalist Britta Görtz (another metal goddess after Angela Gossow)
3) Hair Bands from ROCKRADIO.com plays my guilty-pleasure Metal sub-genre. One of the first songs I heard was "Every Rose has its Thorn." Hard to not like it!
5) CLASSIC METAL RADIO plays a lot of mainstream/pop metal. I heard Aerosmith's Angel on it. Love that ballad! Also heard "Don't Look Back" from the "new" Queensryche (the one without original singer Geoff Tate but the vocal still sounds like him)
6) Guitar Jazz from JAZZRADIO.com. Jazz guitarists gotta love it!
7) Sax4Love (Smooth Jazz.) Another guilty-pleasure sub-genre :P
8) Jazz Radio Network
BTW, TuneIn listed both JAZZRADIO.com and ROCKRADIO.com with a Palo Alto address! Maybe it's the epicenter of internet radio.
Wednesday, July 17, 2013
Italian CamJazz
Monday, July 15, 2013
Sports highlight: auto racing
Another interesting story has to do with Danica Patrick, again. I wrote about her current boyfriend, Ricky Stenhouse Jr caused a big crash that collected Danica at Talledega 2 months ago and the story was not mentioned a lot in the media. Well, it's the other way around this race: Danica wrecked Stenhouse. And it caught a lot of attentions! Sexism? This time most reports mentioned the Talledega crash and I found out Danica was actually not happy with Stenhouse last time (Well, she tended to be angry with anyone involved after every crash from her IndyCar days) This time she apologized on TV and admitting her fault. Nice! BTW, the third car involved in the crash was #93 Travis Kvapil, who was so mad with Danica after the crash. Guess what team he was with? BK Racing, a team formed with some remaining personnel and equipments from the now-defunct Red Bull team!
There were also 2 IndyCar races, at Toronto. As I mentioned before, I have been rooting for Verizon/Penske driver Will Power for the past few years. He lost his road course qualification magic for the first race and didn't start from the pole. And once again, when his car finally got to the front and started looking promising to win the race, it faded and he finished outside the podium.
Wednesday, July 03, 2013
Tuesday, July 02, 2013
The Galileo affair
Tuesday, June 04, 2013
愛民族及民俗
Wednesday, May 29, 2013
Jazz playlist
- Todd Marcus: Inheriance
The current issue of JazzTime magazine has a special on bass clarinet: its history in jazz and its players, Todd Marcus being one of them. He led a group that included guests Don Bryon (another famous jazz clarinetist) and Warren Wolf on Inheriance.
- Bob James and David Sanborn: Quartette Humaine
David Sanborn is probably more well-known for his "smooth jazz" efforts like his album "Close-Up" from 1988. Indeed, I picked it up because it's supposed to sound like Kenny G from around the same time. Of course, in the music circle, Sanborn is much higher regarded than Mr. G. In fact, Sanborn isn't a smooth jazzer. His more mainstream stuff sounded that way because of the R&B elements. He could play "real" jazz too. You could hear that from "Another Hand", the 1991 album he released after "Close-Up." It has my favorite version of Charlie Haden's composition, "First Song." Bob James was another musician(pianist) known for his smooth jazz work. He was an original member of the smooth jazz supergroup Fourplay. He collaborated with David Sanborn before and produced a smooth jazz classic, Double Vision, that included popular tunes like Maputo. Again, he played more than smooth jazz, as evident on this latest (2nd) collaboration with Sanborn, which is an acoustic tribute to Brubeck and Desmond.
- Wayne Krantz: Two Drink Minimum
This was recommended by my teacher at Berklee for the interesting stuff he did with rhythms.
Last but not least, it's a sad sad day for jazz fans as pianist Mulgrew Miller passed away today because of a stroke. I still remember my first time visiting Yoshi's (in the old Oakland Claremont location) was to see him perform. The DJs at KCSM have been playing many of his works as a tribute. RIP.
Friday, May 24, 2013
ExtJS tips
1) You cannot create a separate store class in which you define a REST proxy with the URL of the aforementioned webservice. Instead, the proxy must be defined within the model class. Stores for customers and magazines are implicitly created. To load these stores, call Ext.ModelManager.getModel to obtain the model object and call load(<id>) on it.
2) Query of your customer REST-ful webservice could return magazines subscribed by the customer as a JSON array, named the same as the hasMany relationship. The implicitly created store for magazines associated with the customer will be populated properly. However, when you call customer.save(), the payload to the REST proxy's URL will not include the array of subscribed magazine. To make this happen, you have to override the default JSON writer of the proxy. See the second part of this post for a generic implementation that works for all associations. Alternatively, you could just implement a customer JSON writer that handles your customer/magazine relationship only, which is much simpler: basically you implement the getRecordData function. Add the fields of customer to the data object to be returned. Also loop through the associated magazine stores and add the fields to an array inside that data object.
3) Let's say you implement a drag-and-drop UI that allows user to drag magazines between the 'subscribed' and 'not subscribed' lists. Check out this example from Sencha. Each of such list is actually an ExtJS grid panel defined with its store. However, you want the 'subscribed' grid to use the implicitly created associated magazine store at run time. The name of the method to use is not that obvious. It is 'reconfigure.' I learned that from this post.
Thursday, May 23, 2013
Implementing RESTful Webservice using Wicket
mountPage("/order/${orderId}", Order.class);
More tips:
1) PUT and POST
One of the key features of REST is using the "verb" (i.e., the method of the servlet request) to determine which of the CRUD (create, read, update, destroy) action is to be performed. It took me a while to figure out how to extract this "method" value:
HttpServletRequest servletReq = (HttpServletRequest) getRequest().getContainerRequest();
String method = servletReq.getMethod();
if ("GET".equals(method))
{
// logic to read the object
...
}
2) the payload
To create or update an object via RESTful Webservice, the payload includes a serialized form of the object (e.g., in JSON format) Again, it took me a while to figure out how to extract the payload:
HttpServletRequest servletReq = (HttpServletRequest) getRequest().getContainerRequest();
BufferedReader br = servletReq.getReader();
String payload = null;
if ((payload = br.readLine()) != null)
{
// process payload
...
}
3) HTTP Status code
The page should return a meaningful code to the user. I found this table quite useful. Set it in renderPage() like this:
public final void renderPage()
{
WebResponse response = (WebResponse) getResponse();
response.setStatus(200); // for OK
}
4) Return a download file
This is not RESTful but I just want to mention it here. Sometimes you want to provide a URL that would serve the browser content not in a browser window but in a download file. HTTP actually supports this using the Content-Disposition value (set to 'attachment') in the header. Let's say my page/class that extends WebPage create a zip file to be downloaded by the browser. Implement renderPage() like this:
public final void renderPage()
{
WebResponse response = (WebResponse) getResponse();
response.setHeader("Content-Type", "application/zip");
response.setAttachmentHeader(fileName);
}
BTW, don't rely on overriding the getMarkupType() method to set Content-Type in the header. It doesn't work that way for some reason. Set it explicitly like the above.
Wednesday, May 22, 2013
The Amazingly Flexible Jackson
What I ended up doing is "hacking" the pretty printing support of Jackson. Jackson allows you to set a pretty printer to the JsonGenerator (or perform no pretty printing by setting it to null) Jackson also provided a full-blown pretty printer (the default) and a minimal one (that basically print as if no pretty printing and expect you to override some of its method to customize its behavior) I needed the JsonGenerator to add newlines surrounding the comma when writing array separators. However, this should only happen before the first { of the object, i.e., for the arrays nested within the object, it must not add newlines. Otherwise it violates the requirement of getting everything on one line! My subclass that inherits the minimal pretty printer has a boolean flag to control adding newlines so that it only adds the first time. Sounds tricky, right? Yes, it is.
Tuesday, May 21, 2013
Jackson and polymorphism
Monday, May 20, 2013
Running a daemon using Tomcat
a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user.Anyone who know Java could write a standalone one easily. My main concern is ease of management and deployment. Since I am using Tomcat as app server already, I decided to find out how to have a daemon running inside and managed by Tomcat. It turns out to be a popular choice. I've found quite a few links (1, 2) about it. Basically the daemon class needs to implement ServletContextListener. Then mention the class in web.xml like this:
<listener>
<listener-class>MyDaemonServletContextListener</listener-class>
</listener>
For deployment, I use the Maven tomcat plugin and simply specify the server URL in the pom.xml.
Sunday, May 19, 2013
Open another browser from a hyperlink using Javascript
Then use it in the A HREF like this:
<a href="javascript:void(0)" onclick="javascript:openInNewTab('blog.00zine.com'); return false;">00zine</a>
BTW, I have also just learned the above way of publishing code on Blogger from this post, which is linked to the useful HTML encoder (turns your angle brackets to < and >)
Tuesday, May 14, 2013
Phil Humber's perfect game from 2012
If Buehrle throws one, everybody can throw one — with respect to Buehrle. I say that about Buehrle because Buehrle is a contact pitcher. That’s what I think is one of the most amazing things I ever see – he has both, he has a no hitter and perfect game. That’s hard to come from Buehrle because Buehrle’s game is (pitching to) contact.Fast forward one year though, Humber ended the 2012 season with a 5-5 record. The Sox put him on the waiver and he was claimed by the Houston Astros (which switched from NL Central to AL West!) He started the season in the Astros' rotation and lost all 7 games he started. Then he was moved to the bullpen, appeared as reliever twice and lost 1 more game (overall record: 0-8 record after less than 1.5 month into the season) Houston has designated him for assignment. It's sad sad sad to see him falling from glory so fast, just like a one-hit wonder in music. Still, he is in the record book for good for one game in which he did not give up any hit. (How ironic!) Not something a lot of great pitchers had achieved in their careers! I don't mind being a one-hit wonder. (I think I kinda qualified already with our band's song being kinda popular in the HK indie scene)
Monday, May 13, 2013
雨中的浪漫
...心只好 只好恨透絲絲雨線
微雨的天 總像是個謊言
靜靜地 垂淚 漸漸地 別去
忘掉當天不再追
垂著頭暗暗對我說清楚
曾說過愛我卻不可
像火的心窩心裡是痛楚
從未忘妳最愛聽那些歌
微雨裡暖透妳心窩
怎麼不是我
之前剛好見到阿Miu的母親節post,記得她喜歡哼落雨擔遮想起媽媽:)跟著想到雨夜的浪漫和Rainy Days and Monday都不應景(雖然是星期一但雨不夠大:P)想起有首雨中的浪漫但不記得誰唱,還是留待FB朋友解答吧。
Monday, May 06, 2013
Sports highlight: auto racing
Back to the States, both NASCAR series were racing at Talladega, which I considered one of the tracks with most exciting races. To be honest, they are exciting for the "wrong" reason: the "big one", i.e., a big crash that almost always happened, once or more, especially near the end of the race. Both the Nationwide and Sprint Cup race ended with last lap passes (also multiple crashes though) The former was enough to make the races interesting. I was happy to see "underdog" drivers on lower-budget teams did well: Regan Smith won the Nationwide race while David Ragan did it at the Sprint Cup race (with his teammate finished 2nd)
More drama from Talladega: During her career Danica Patrick usually did better on longer tracks like Talladega but her day was ruined by none other than her current boyfriend, Ricky Stenhouse Jr, who is a talented driver but with few experience at the Sprint Cup level. He drove too aggressively and caused a big crash that collected Danica. I was surprised this story was not mentioned a lot in the media.
I was so glad I didn't miss the IndyCar race at Sao Paulo because it featured yet another exciting finish! I have been rooting for Verizon/Penske driver Will Power for the past few years. He was almost invincible at road races but seemed to have lost his magic this year. He didn't qualify well but was making his way through the field. Just when things started looking promising, his car was on fire and forced him out of the race. There were a ton of cautions but the last dozen laps were really close with 3 drivers fighting it out. Takuma Sato, the winner of the previous race, was leading but challenged by Joseph Newgarden and James Hinchcliffe. He was accused of violating IndyCar's rule by blocking both. It didn't matter much though 'coz he was eventually passed by Hinchcliffe. The young guns are doing well in this series (Will Power and former champ Dario Franchitti are 18th and 15th in the current standing, respectively) For a sports that couldn't gain enough fan support here due to lack of success of American drivers, it's moving in the right direction.
Tuesday, April 30, 2013
The 19 inning game and Loyalty
Monday, April 29, 2013
"Breaking up" with the SF Giants
Sunday, April 28, 2013
Free Your Mind!
"Free Your Mind" is the title of a series of lectures about improvisation presented by the Institute for Diversity in the Arts and The Department of Theater and Performance Studies at Stanford University. It includes a wide variety of topics such as food, comedy, dance, visual art and of course music(jazz) which I'm most interested in. The lectures are actually open to public (also streaming online) and I attended the one with jazz pianist Vijay Iyer as the guest.
Dr. Iyer has a very interesting background. Check out this well-written article on him. His parents were immigrated from India. He double-majored in Math and Physics at Yale and then got accepted to the PhD program at UC Berkeley. He also started learning violin at 3. So, that sounds like your typical Asian American kid, right? Wrong! He studied violin 'til he entered college, when he realized he did not have enough time for the highly demanding classical violin training. (The amount of time high-level violinists put into practicing was incredible!) After he came to Berkeley, he got involved in the big musician community in the Bay Area but playing jazz piano (which he taught himself mostly) instead. At the same time, his research focus had also switched from physic to music and technology and eventually earned a PhD in such an interdisciplinary program.
Enough about his background, there were quite a few things they pointed out during the lecture: they talked about improvising during a performance as taking risk, which makes a lot of sense. As a performer, you could always "play it safe" but then if you played something different (e.g. musical or comedy ideas) that worked for the audiences, it would be even more rewarding. Of course it might not work so that's the element of risk.
They also talked about improvisation occurs more often then we think. In fact people improvise all the time during daily routine instead of planning/thinking ahead. Again, it makes sense. Just that most people won't think of that.
They pointed out music is highly related to motions of human. Musical beats mimic human movement (our pulses, our walking paces) In face, the same area in our brain is activated when we hear music or when we move. Finally, they mentioned empathy when hearing music, i.e., the player and listeners would fire similar nerves in the brain. When it comes to our brain and music, there are still a whole lot of unknowns (see the books "This is Your Brain on Music" and "Guitar Zero")