原文地址:http://u.10-tips-designing-your-mobile
在移动开发中,客户端通常需要一个基于Web云的API服务(Service)来实现C/S通信。最简化这些API的用例通常是获取(Read/Retrieve)云端数据,但并非局限于此,向云端发送数据、用户认证与管理等都可以基于该Web云服务实现。
你若想在你的移动端应用程序中,使用Web云API服务的话,下面10个坑是你应该知道的:
/* | |
* code来自《深入理解计算机系统》Page-52 | |
* The below function which called within sum_element(arr, 0) will occur a RAM's trouble to you | |
* should be invoked within 2 arguments, an array and a unsigned integer "length". | |
* | |
* Analysis: | |
* If the argument length is assigned with ZERO, namely return 0.0 under human's comprehension. | |
* As an opposite ending, however in fact, length is unsigned. Such that length-1 will be treated | |
* as length+((unsigned)(-1)), UMax. Even worse is the logical operator "<", whose operands are the | |
* unsigned integer UMax and an integer i, it always return true - ! |
// 来自 @颜闽辉 | |
int bitmap(unsigned in, char out[]) | |
{ | |
unsigned count = 0; | |
unsigned size = sizeof(in) * 8; | |
out[size] = '\0'; | |
do { | |
if (in & 1) { |
#include "stdio.h" | |
int main(int argc, char const *argv[]) | |
{ | |
int i = 1; | |
int sum = 0; | |
while (i <= 100) { | |
if (i % 7 == 0) sum += i; |
原文地址:http://u.10-tips-designing-your-mobile
在移动开发中,客户端通常需要一个基于Web云的API服务(Service)来实现C/S通信。最简化这些API的用例通常是获取(Read/Retrieve)云端数据,但并非局限于此,向云端发送数据、用户认证与管理等都可以基于该Web云服务实现。
你若想在你的移动端应用程序中,使用Web云API服务的话,下面10个坑是你应该知道的:
This JoelOnSoftware thread asks the age old question of what and how to log. The usual trace/error/warning/info advice is totally useless in a large scale distributed system. Instead, you need to log everything all the time so you can solve problems that have already happened across a potentially huge range of servers. Yes, it can be done.
To see why the typical logging approach is broken, imagine this scenario: Your site has been up and running great for weeks. No problems. A foreshadowing beeper goes off at 2AM. It seems some users can no longer add comments to threads. Then you hear the debugging deathknell: it's an intermittent problem and customers are pissed. Fix it. Now.
So how are you going to debug this? The monitoring system doesn't show any obvious problems or errors. You quickly post a comment and it works fine. This won't be easy. So you think. Commenting involves a bunch of servers and networks. There's the load balancer, spam filter, web server, database server, caching server, file server, a
ENOENT error code explaination
It would appear that ECONNRESET means that the other side has closed the connection without reading outstanding data that has been sent to it, and can be triggered on both read() and write(). But the exact behavior depends on the operating system.
tail -f [logpath]
BEGIN:VCALENDAR | |
PRODID:-//SeedMail Inc//SeedMail Calendar 70.9054//EN | |
VERSION:2.0 | |
CALSCALE:GREGORIAN | |
METHOD:REQUEST | |
BEGIN:VEVENT | |
DTSTART:20130826T153000Z | |
DTEND:20130826T163000Z | |
DTSTAMP:20130826T150411Z | |
ORGANIZER;CN=Yorkie Neil:mailto:[email protected] |