Search

7/31/2014

Mac App Store - Sip

Mac App Store - Sip

The refreshingly simple color picker that instantly samples and encodes any color on your screen. Just one quick click to savor the flavor and you're set! See what’s on special with Sip below.

7/28/2014

publicis-indonesia/Waves

publicis-indonesia/Waves

Click effect inspired by Google's Material Design http://publicis-indonesia.github.io/Waves/

How a TED Talk inspired me to leave work to go live on a remote island | TED Blog

How a TED Talk inspired me to leave work to go live on a remote island | TED Blog

By Winston Chen Odysseus…Gauguin…Robinson Crusoe…and me? Many people dream of the ultimate escape: throwing all the baggage of civilization away and taking off to live on a remote island. But few people—particularly professional couples with young kids—actually go through with it. And yet, that’s just what my family did: we left Boston, and my reliable job at a software company, to go live on a tiny island north of the Arctic Circle for a year, unsure of what exactly we’d do there or what we would face upon our return. Stefan Sagmeister: The power of time offStefan Sagmeister: The power of time offThe seed of this idea was planted three years before, when a friend made me watch a TED Talk by graphic designer Stefan Sagmeister. He presented a tantalizing idea: “We spend about 25 years of our lives learning. Then there is about 40 years reserved for working. And then, tucked at the end of it, are about 15 years of retirement. I thought it might be helpful to cut off five of those retirement years and intersperse in between those working years.” It struck a deep chord with me. I was an executive at a small software company, a typical management job where I spent the bulk of my working day in PowerPoint. I’d been working for about 10 years, and felt like I was just going through the motions. We live in a society that celebrates strong work ethics and delayed gratification—all good things, but we’ve taken this cultural mindset to the extreme. We deny ourselves the time to do anything significant outside of work until we’re physically and mentally well past our prime. Ever since watching that talk, my wife and I wanted to take time off to go live in a faraway place. It took us three years to work up the nerve to actually do it. We finally decided to seize the moment when our children were old enough to remember the adventure, but not so old that they’d started elementary school. My wife, a teacher from Norway, was itching to get to back into the classroom and found a teaching job at a small island in Arctic Norway called Rødøy. Our launch sequence began. We rented out our house, furniture and car, and packed four big duffle bags. With loads of anxiety and fear, we took off for an island that we had never set foot on with a population of just 108 people, determined to live on my wife’s teacher salary for a year. While Stefan Sagmeister’s goal for his year off was to rejuvenate his creativity, mine was more loosely planned. I wanted to give myself a year without any concrete goals. I spent a lot of one-on-one time with our children with no objectives other than to be together—very different from before when I only had time to manage the children through daily routines. We communicated in a more relaxed and empathetic way, and I got to know both children in profound ways. The Botnen-Chen family. From left: Marcus, Kristin, Winston and Nora, with the beautiful scenery of Rødøy in the background. Photo: Winston Chen The Botnen-Chen family. From left: Marcus, Kristin, Winston and Nora, with the beautiful scenery of Rødøy in the background. Photo: Winston Chen I hiked and fished. After dropping the kids off at the island school, I would carry on with my backpack and fishing rod and go off. I took photography more seriously, because I could afford the time to think about the picture rather than rushing just to capture something. I learned to play the ukulele and started to paint in oil after a long hiatus. Three months into my island year, I rediscovered an old passion: programming. Just for fun, I started to develop a simple app that would read web articles or PDF files out loud using synthesized speech. I called it Voice Dream Reader. It quickly became a full-blown obsession as I realized that the app had the potential to transform the lives of students and adults with difficulties reading. Fun, passion, excitement—suddenly I knew the “next thing.” I worked on developing it slowly but surely, and kept on with the other activities I was enjoying so much on the island too. In the summer, with the kids and my wife out of school, we let the weather steer our days. Warm days meant taking our skiff to a beach on any of hundreds of nearby islands; cooler days were for hiking; rainy days were reserved for crafts projects and board games. Sometimes we stayed up hiking till midnight, taking in spectacular hours-long sunsets. I think that people hesitate to make bold moves like the one my family did not because it’s hard to leave: leaving is actually the easy part. I think it’s the fear of what happens after re-entry that keeps even the most adventurous families from straying far from home. When we headed home after a year, we had no jobs and no medical insurance waiting for us. And we were immediately up against mortgage and car payments, plus all the costs of living in an expensive city. But strangely, we felt truly at ease on our first evening back in the States as we sat on an outdoor patio with good friends talking about our respective summers. For our friends, summer had been a juggling feat—the careful balancing of their two demanding full-time jobs with their children’s jumbled activity schedules. The logistics of this had been worked out with two other sets of parents months in advance, in a strategy session that required laptops, a projector and plenty of wine. In contrast, our summer had entailed waking up in the late morning every day and making a big breakfast, then exploring an unthinkably beautiful island. A stunning sunset over Rødøy. Photo: Winston Chen A stunning sunset over Rødøy. Photo: Winston Chen Throughout that first evening of our return, I could feel palpable stress coming from our friends, a successful couple with substantial means. But my family, even with no income, felt at peace. That was when it dawned on me: our island year wasn’t just a memorable adventure. It had made us different people. After we returned, I trudged on with the Voice Dream Reader app, even though it was not selling much. Focusing on this, rather than getting a traditional job, was a far bigger risk than any I had taken before. But my wife and I often said, “What’s the worst that can happen? We go back and live on the island?” We were clothed with the armor of confidence forged from the newfound knowledge that our family could be very happy living on very little. I continued to improve the app until it started to generate enough income to sustain us. It wasn’t instantaneous, but today, nearly two years later, Voice Dream Reader is a bigger success than I could have ever imagined. It’s been a Top 10 selling education app in 86 countries. But more importantly, my work is immensely satisfying. With Voice Dream Reader, students who struggled with visual reading are able to listen and learn like everyone else. Adults who had trouble reading all their lives—not knowing that they have dyslexia—are now devouring books. It’s making a difference in people’s everyday lives. So many people who hear my story tell me how much they yearn for a similar experience: to take a big chunk of time off to pursue their heart’s desire. To them I say: have no fear. Most people are far more resilient to lifestyle changes than they think. And careers, which are rarely linear, can be just as resilient too. The upsides of taking a mid-career year of retirement are potentially life changing. By giving yourself time off and away, you’re creating a climate teeming with possibilities. Perhaps you’ll find passion in a new kind of work like I did. For sure, you’ll come back with new confidence and fresh perspectives to fuel your career, plus stories and memories to enrich you and your family for life. And you don’t have waited till you’re 65.

7/26/2014

厚生市集

厚生市集

厚生市集產銷革命3力: 1.強調在地食材,半數食材來自30公里內生產者 2.機車車隊配送,早上11點前訂,當天下午到貨 3.與食譜網站、團購網站、農業議題粉絲團串聯

7/17/2014

The Subtle Magic Behind Why the Bootstrap 3 Grid Works | Experience Design at Hello Erik

The Subtle Magic Behind Why the Bootstrap 3 Grid Works | Experience Design at Hello Erik

The Reasoning Behind It Container: The container works this way so that the edges of the container can have that virtual 15px padding around the content, but not require the body tag to have a 15px padding. This was a change in the RC1 of Bootstrap 3. Otherwise, the entire body would have a 15px padding, which would make non-bootstrap divs and such not touch the edges, which is bad for full width divs with colored backgrounds. Rows: Rows have negative margin equal to the containers padding so that they also touch the edge of the container, the negative margin overlapping the padding. this lets the row not be pushed in by the container’s padding. Why? Well… Columns: Columns have the 15px padding again so that they finally truly keep your content 15px away from the edge of the container/browser/viewport, and also provide the 15px + 15px gutter between columns. It is like this so that there doesn’t have to be a special first/last column that doesn’t have padding on the left/right, like in grids of old (960, blueprint, etc). Now, there is a consistent 15px space between the edges of the columns at all times, no matter what. Nested Rows: Nested rows work just as above, only now they overlap the padding of the column they are inside, just like the container. Essentially, the column is acting as the container, which is why you never need a container inside of anything. Nested Columns: Nothing is different here now, works the same as before. Offsets: These essentially split gutter widths to increase the space between columns by however many column units you want. Very, very simple. Push/Pull: These make use of positioning to trick HTML into flipping elements from left to right when going from mobile to desktop sizes. Or, for when you have a special use-case where offsets don’t work.

7/11/2014

Dropbox Tech Blog » Blog Archive » Improving Dropbox Performance: Retrieving Thumbnails

Dropbox Tech Blog » Blog Archive » Improving Dropbox Performance: Retrieving Thumbnails

For our web application, we use the Navigation Timing API to report back performance metrics. The API allows us to collect detailed metrics using JavaScript, for example DNS resolution time, SSL handshake time, page render time, and page load time: Instead of SPDY, we resorted to plain old HTTPS. We used a scheme where clients would send HTTP requests with multiple image urls (batch requests): GET https://photos.dropbox.com/thumbnails_batch?paths= /path/to/thumb0.jpg,/path/to/thumb1.jpg,[...],/path/to/thumbN.jpg The server sends back a batch response: HTTP/1.1 200 OK Cache-Control: public Content-Encoding: gzip Content-Type: text/plain Transfer-Encoding: chunked 1:data:image/jpeg;base64,4AAQ4BQY5FBAYmI4B[...] 0:data:image/jpeg;base64,I8FWC3EAj+4K846AF[...] 3:data:image/jpeg;base64,houN3VmI4BA3+BQA3[...] 2:data:image/jpeg;base64,MH3Gw15u56bHP67jF[...] [...] The response is: 1. Batched: we return all the images in a single plain-text response. Each image is on its own line, as a base-64-encoded data URI. Data URIs are required to make batching work with the web code rendering the photos page, since we can no longer just point an src tag to the response. JavaScript code sends the batch request with AJAX, splits the response and injects the data URIs directly into src tags. Base-64 encoding makes it easier to manipulate the response with JavaScript (e.g. splitting the lines). For mobile apps, we need to base64-decode the images before rendering them. 2. Progressive with chunked transfer encoding: on the backend, we fire off thumbnail requests in parallel to read the image data from our storage system. We stream the images back the moment they’re retrieved on the backend, without waiting for the entire response to be ready; this avoids head-of-line blocking, but also means we potentially send the images back out of order. We need to use chunked transfer encoding, since we don’t know the content length of the response ahead of time. We also need to prefix each line with the image index based on the order of request urls, to make sure the client can reorder the responses. On the client side, we can start interpreting the response the moment the first line is received. For web code we use progressive XMLHttpRequest; similarly for mobile apps, we simply read the response as it’s streamed down. 3. Compressed: we compress the response with gzip. Base64-encoding generally introduces 33% overhead. However, that overhead goes away after gzip compression. The response is no longer than sending the raw image data. 4. Cacheable: we mark the response as cacheable. When clients issue the same request in the future, we can avoid network traffic and serve the response out of cache. This does require us to make sure the batches are consistent however – any change in the request url would bypass the cache and require us to re-issue the network request.

regex - Non capturing group? (?:) - Stack Overflow

regex - Non capturing group? (?:) - Stack Overflow

Let me try to explain this with an example... Consider the following text: http://stackoverflow.com/ http://stackoverflow.com/questions/tagged/regex Now, if I apply the regex below over it... (http|ftp)://([^/\r\n]+)(/[^\r\n]*)? ... I would get the following result: Match "http://stackoverflow.com/" Group 1: "http" Group 2: "stackoverflow.com" Group 3: "/" Match "http://stackoverflow.com/questions/tagged/regex" Group 1: "http" Group 2: "stackoverflow.com" Group 3: "/questions/tagged/regex" But I don't care about the protocol -- I just want the host and path of the URL. So, I change the regex to include the non-capturing group (?:). (?:http|ftp)://([^/\r\n]+)(/[^\r\n]*)? Now, my result looks like this: Match "http://stackoverflow.com/" Group 1: "stackoverflow.com" Group 2: "/" Match "http://stackoverflow.com/questions/tagged/regex" Group 1: "stackoverflow.com" Group 2: "/questions/tagged/regex" See? The first group has not been captured. The parser uses it to match the text, but ignores it later, in the final result.

7/08/2014

【大發現!!!原來我們的都錯了! 科學家揭示真正讓人恢復精力的「休息模式」 ...】 | Giga Circle

【大發現!!!原來我們的都錯了! 科學家揭示真正讓人恢復精力的「休息模式」 ...】 | Giga Circle

一、腦力勞動者,補瞌睡對你沒什麽用 你寫了一天的文案,主持了一天的會議,當一切都結束了,你嘆到:太累了,這一天我要睡個好覺。我們的常識使得我們對疲勞的第一反應就是“去躺躺吧”。但這是一個陷阱。 睡眠的確是一種有效的休息方式,但它主要對睡眠不足或體力勞動者適用。對體力勞動者來說,“疲勞”主要是由體內產生大量酸性物質引起,如果十分疲勞,應采取靜的休息方式。通過睡覺,可以把失去的能量補充回來,把堆積的廢物排除出去。如果不是很累,也可以在床上先躺一躺,閉目靜息,讓全身肌肉和神經完全放鬆後,再起來活動活動。 但如果你是坐辦公室的,大腦皮層極度興奮,而身體卻處於低興奮狀態,對待這種疲勞,睡眠能起到的作用不大,(除非你是熬夜加班,連正常睡眠時間都達不到)因為你需要的不是通過“靜止”恢覆體能,而是要找個事兒把神經放松下來。這樣你可以理解為什麽你周末兩天不出門依舊無精打采,而只需下班後遊泳半小時就神采奕奕。 二、不必停下來,只是換一下 既然睡覺不能幫助我們休息大腦,那什麽辦法才可以?答案是不停止活動,而只是改變活動的內容。大腦皮質的一百多億神經細胞,功能都不一樣,它們以不同的方式排列組合成各不相同的聯合功能區,這一區域活動,另一區域就休息。 所以,通過改換活動內容,就能使大腦的不同區域得到休息。心理生理學家謝切諾夫做過一個實驗,為了消除右手的疲勞,他采取兩種方式——一種是讓兩只 手靜止休息,另一種是在右手靜止的同時又讓左手適當活動,然後在疲勞測量器上對右手的握力進行測試。結果表明,在左手活動的情況下,右手的疲勞消除得更 快。這證明變換人的活動內容確實是積極的休息方式。 比如你星期五寫了5個小時的企劃案,最好第二天去給你的盆栽們剪枝而不是睡到太陽曬屁股。還有一點,當你無法選擇由腦力勞動轉入體力勞動時,你不妨在腦力勞動內部轉換。 法國傑出的啟蒙思想家盧梭就講過他的心得:“我本不是一個生來適於研究學問的人,因為我用功的時間稍長一些就感到疲倦,甚至我不能一連半小時集中精力於一個問題上。 但是,我連續研究幾個不同的問題,即使是不間斷,我也能夠輕松愉快地一個一個地尋思下去,這一個問題可以消除另一個問題所帶來的疲勞,用不著休息一 下腦筋。於是,我就在我的治學中充分利用我所發現的這一特點,對一些問題交替進行研究。這樣,即使我整天用功也不覺得疲倦了。”所以,這天你要是有好幾個 問題要處理,最好交替進行,而不要處理完一個再開始的二個,那樣會很快被耗盡。 三、最好的休息,是讓你重燃生活的熱情 我們的疲憊主要來自對現有的一層不變的生活的厭倦。所以最好的休息項目就是那些讓我們重新找到生活和工作熱情的活動。如果你幹完一件事,能夠幸福地感嘆“明天又是新的一天。”那這件事對你來說就是最好的恢覆熱情,調節情緒的方法。但可惜,我們缺乏對“休息”的想象力。我們能想出來的休息方法不是癡睡就是傻玩。 我們給你開了下面一些活動清單,基本思路是以“做”來解決“累”,用積極休息取代消極放縱。當然,最適合你的方法還是要你自己探索。事實上如果你覺得打掃衛生比坐過山車是更好的放松,那麽就去吧,別管世界上的其他人都在玩什麽。 也許你可以: 1.用看兩小時讓你開懷的漫畫或小說代替去KTV唱那些一成不變的口水歌。 2.試著放棄在周六晚上去酒吧,10點入睡,然後在7點起床,去沒有人的街上走走,或是看看你從來沒有機會看到的早間劇場,你會發現這一天可以和過去的千萬個周末都不相同。 3.不要再去你已經去過無數次的度假村找樂子了。找一條你你從沒去過的街道,把它走完。你會發現這個你感到膩味的城市結果你並沒有完全體會到它的妙處。 4.旅行,而不是換個地方消遣。去一個地方對那個地方本身心存好奇,對自己這趟行程心存美意,感受自己經驗範圍以外的人生樣貌。而不是坐了5小時飛機,只是換個地方打麻將,換個地方遊泳,換個地方打球…… 5.從這個周末起學習一項新的技藝,比如彈電子琴,打鼓……每周末練習1小時以上。 6.去社交。不要以為它總是令人疲憊的。雖然和看書比起來,它稍有點令人緊張,但也能讓你更興奮,更有認同感。你必須每周有兩三天是和工作圈子和親 戚外的人打交道。它讓你在朝九晚五的機械運行中不至失去活潑的天性。女性朋友們尤為需要走出去和朋友聚會,這些時刻你不再是滿臉寫著“效率”的中性人,而 是一個裙裾飛揚的魅力焦點。 7.做點困難的事,如果你是精神超級緊張的人。心理學家發現解除神經緊張的方法,是去處理需要神經緊張才能解決的問題。曾經一位精神即將崩潰的總經理找到一位醫師給出治療建議,結果他得到的處方是去動物園當馴獅師。一個月以後完全康覆。所以壓力特別大的時候你可以為自己再找分工作,但不要是和你職業類似的。比如去孤兒院做義工,或者去一個覆雜的機械工廠從學徒幹起,或者做一道超級覆雜的數學題。 往往珍惜生命的人,會不顧任何代價,去求得一個休息。休息十天、半個月,他們回來了。再看呀,是多麽神奇的一種變化!他們簡直是一個新生的人了。生機勃勃,精神飽滿,懷著新的希望,新的計劃,新的生命憧憬,他們己消除疲勞,獲得了從新起航的動力---燃料。 花些時間休息,可以使你獲得大量的精力、體力,使你取得從事任何工作,應付各種問題的力量,使你對於生命,能有一個愉快正確的認識,天下還能有其它時間的投資對於你更加有利嗎? 當我聽到有人說,他工作太忙,沒有時間去休息,我覺得這個人有些反常。或是他的能力不夠應付他的業務,他的工作缺乏系統性;或是他不善於支配他的員工,以致自己離開時事業就無法運行;或是他生性就太吝嗇,沒有部下或團隊。 連上廁所的時間都不肯犧牲。當然,假如他工作沒有計劃、沒有系統,本人一離開崗位,一切事務就要無法運行的話,他自然不能休息了。但是假如他是一個有組織協調能力的人,假如他的工詐有系統、有計劃,適度休息,這正是業務中的有利投資,因為休息回來,他的精力會更加集中、精神會更加飽滿。由此他的生命會延續的更長。人生的價值才能得到更加充分的體現與發揮。 每一個人都應該拋棄只顧工作不顧休息的念頭。那種“生命不止,奮鬥不休”的觀念是錯誤的,應立刻從腦海中消除掉。否則,你還沒有走完你應走完的生命旅程你就長眠於地下了。到那時你的理想、前途、事業不就都成了泡影了嗎?因此舍不得時間休息的人,絕對不是一個聰明人。 從人性的立場上來說,休息一事,利大於弊。古語說得好:“在患病的時候,任何人都是壞人。”即使是心底最善良的人,在身體疲憊不堪、神精衰弱的時 候,也會變得不通情理、脾氣暴噪。因此,當需要休息的候,你應該休息。不然的話,你的行為正如革命導師列寧同志所指出的那樣:“不會休息就不會工作。” 目前不論你是學生還是從事各種職業的男女老少,都不能忽視自然的警告,命令你適當延長你的休息時間,暫時停止你的學習或工作,否則你將受到自然規律的嚴厲處罰。無論你的地位有多高、金錢有多少、還是平頭百姓,在生命面前是一律平等的。這是蒼天賦與自然法官的權力。是人類無法改變的自然法則。 有一種感覺我們叫它無聊,這幾天不經意間我就在體驗無聊。 成年累月忙碌的節奏造就了頑固、可笑的生物節律,它總是讓我無法享受休息時的些許寧靜,閑暇時總覺得生活中缺了什麽、無所事事,甚至還以為知道了什麽是空虛? 前些天偶然看了一篇文章,破天荒知道了還有一種說法叫“享受無聊”。 傳統的教育告誡我們“無聊”是一種消極的情緒,一個奮發向上的人絕對不該有這種情緒,甚至不應該留給自己產生這種情緒的機會。 背負了太多的責任,於是我們活得好累,冠冕堂皇的說壓力來自外界,但我覺得更多的壓力是我們自找,因為在這個充滿壓力的社會我們沒有學會給自己減壓。 看看那些靜靜躺在海灘休假的人們,我們應該懂得無聊是一種難得的境界,或許比兢兢業業、勤勤懇懇的工作更難得。因為它需要你有好的心態、長遠的眼 光,要先接受它,讓自己的心靜下來,然後你才會真正的享受它。它絕不是一種頹廢,它是一種休整、一種積蓄,它會讓我們戒除“只會工作”的毒癮。 很早以前就有人告訴過我們:不會休息的人就不會工作。可我們由於功利的原因,早已將這一說法忘記。於是我們忙碌,我們努力,於是也就害怕無聊、害怕無事可做,甚至會因為閒暇而幾乎惶惶不可終日。 工作不應該成為生活的全部,工作只是為了更好的生活。我們應該是工作的主人,絕不是工作的奴隸。千萬不要以為無聊是消極、是不敬業。 所以忙碌的人們應該去學會享受生活、去習慣感受無聊,習慣這一種新奇的美妙的感受!悠哉樂哉!