Luosky's Playground

It's better to burn out than to fade away.

Mary and Max

Permalink

@caoxg 推荐的治愈系电影,周六的午后边吃着披萨,边把它看完了.虽然疗的不是我的伤,看了还是感觉很温暖.五星级.

Quotes:

When I was young, I wanted to be anybody but myself.

Max Mary and Max

Love yourself first.

Max Mary and Max

Whatever will be , will be.

Max Mary and Max

最后Max给Mary的信的全文:

Dear Mary

Please find enclosed my entire Noblet collection as a sign that I forgive you.

When I received your book, the emotions inside my brain felt like they were in a tumble dryer, smashing into each other. The hurt felt like when I accidentally stapled my lips together.

The reason I forgive you is because you are not perfect.
You are imperfect and so am I.
All humans are imperfect, even the men outside my apartment who litters.

When I was young, I wanted to be anybody but myself.
Dr. Bernard Hazelhof said if I was on a desert island then I would have to get used to my own company, just me and the coconuts. He said I would have to accept myself, my warts and all, and that we don’t get to choose our warts. They are a part of us and we have to live with them.

We can, however, choose our friends and I am glad I have chosen you.

Dr. Bernard Hazelhof also said that everyone’s lives are like a very long sidewalk. Some are well paved. Others, like mine, have cracks, banana skins and cigarette butts. Your sidewalk is like mine but probably not as many cracks. Hopefully, one day, our sidewalk will meet and we can share a can of condensed milk.

You are my best friends.
You are my only friend.

Your American penpal, Max Jerry Horowitz.

Max Mary and Max

我的第二个iOS应用 爱折客 更新了

Permalink

我做的第二个iOS应用[爱折客][]更新了,上海地区的iPhone用户欢迎试用:

显示你附近的优惠券:

优惠券页面:

你关注的店的动态:

放入口袋的优惠券:

评论箱:

iOS App内发送短信

Permalink

iOS4.0新加入了MFMessageComposeViewControllerMFMessageComposeViewControllerDelegate,提供了发送短信的接口,可以像发送邮件那样不用跳出程序来发送短信. 介绍可参阅Message UI Framework Reference

一些笔记:

MFMessageComposeViewController

  • 提供了操作界面
  • 使用前必须检查canSendText方法,若返回NO则不应将这个controller展现出来,而应该提示用户不支持发送短信功能.
  • 界面不能自行定制
  • 要发送的短信的内容(body)和收件人(recipients)在展现这个controller前需初始化好,展现了之后短信内容不能通过程序来进行修改.不过用户仍然可以手工修改短信内容和选择收件人
  • 用户点了发送或者取消,或者发送失败时,MFMessageComposeViewControllerDelegate 的- messageComposeViewController:didFinishWithResult:方法都能得到通知,在这里进行相应的处理

若在iOS3.0上运行的话,会提示dyld: Symbol not found: _OBJC_CLASS_$_MFMessageComposeViewController 解决方案:

  1. MessageUI.framework的引入类型应选择weak(在target -> Get Info -> General -> Linked Libraries -> MessageUI.framework -> Type 里修改)
  2. 不要在.h文件里直接import MessageUI/MFMessageComposeViewController.h,改为import <MessageUI/MessageUI.h>

具体的发送代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
    
    #pragma mark -
    #pragma mark SMS

    -(IBAction)showSMSPicker:(id)sender {
      // The MFMessageComposeViewController class is only available in iPhone OS 4.0 or later.
      // So, we must verify the existence of the above class and log an error message for devices
      //     running earlier versions of the iPhone OS. Set feedbackMsg if device doesn't support
      //     MFMessageComposeViewController API.
      Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));

      if (messageClass != nil) {
          // Check whether the current device is configured for sending SMS messages
          if ([messageClass canSendText]) {
              [self displaySMSComposerSheet];
          }
          else {
              [UIAlertView quickAlertWithTitle:@"设备没有短信功能" messageTitle:nil dismissTitle:@"关闭"];
          }
      }
      else {
          [UIAlertView quickAlertWithTitle:@"iOS版本过低,iOS4.0以上才支持程序内发送短信" messageTitle:nil dismissTitle:@"关闭"];
      }
    }

    -(void)displaySMSComposerSheet
    {
      MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
      picker.messageComposeDelegate = self;

      NSMutableString* absUrl = [[NSMutableString alloc] initWithString:web.request.URL.absoluteString];
      [absUrl replaceOccurrencesOfString:@"http://i.aizheke.com" withString:@"http://m.aizheke.com" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [absUrl length])];

      picker.body=[NSString stringWithFormat:@"我在爱折客上看到:%@ 可能对你有用,推荐给你!link:%@"
                                          ,[web stringByEvaluatingJavaScriptFromString:@"document.title"]
                                          ,absUrl];
      [absUrl release];
      [self presentModalViewController:picker animated:YES];
      [picker release];
    }

    - (void)messageComposeViewController:(MFMessageComposeViewController *)controller
                   didFinishWithResult:(MessageComposeResult)result {

      switch (result)
      {
          case MessageComposeResultCancelled:
              LOG_EXPR(@"Result: SMS sending canceled");
              break;
          case MessageComposeResultSent:
              LOG_EXPR(@"Result: SMS sent");
              break;
          case MessageComposeResultFailed:
              [UIAlertView quickAlertWithTitle:@"短信发送失败" messageTitle:nil dismissTitle:@"关闭"];
              break;
          default:
              LOG_EXPR(@"Result: SMS not sent");
              break;
      }
      [self dismissModalViewControllerAnimated:YES];
    }

我是同步控

Permalink

我的同步方案:

同步照片:

主入口:

旧入口:

同步微薄:

  • qq签名
    • follow5
      • sina微博
      • twitter
      • digu
        • kaixin001(via 嘀神)
        • douban (via 嘀神)

2012-11-13 updated: 换用path作为同步照片的主入口.另外去掉了几个已经失效的渠道: follow5已经关闭了;digu已经从微博转到LBS又转到pinterest了- - ;而renjian也早已停止更新了…

2011-04-09 updated: 图片同步方式中换用WordPress连接微博 来同步到几个微博

SD2.0大会笔记

Permalink

理性的设计

by 西乔

  • 一个设计只有一个重心
  • 利用视觉习惯引导用户行为
  • 人们喜欢数据,哪怕用不同的字号将其突出出来
  • 空白是好设计的肺部
  • 好的设计并非源于审美,而是源于对受众的理解

LBS应用之道

by 大众点评

  • 超过100万商家,16million评论
  • 80个开发者,手机团队10几个
  • geocoding
  • recerse geocoding
  • local business solution
  • app 10年1月上线 170万装机量
  • lesson learned
    • 数据协议在各种网络和硬件的情况下表现不佳 - 序列化和压缩
    • 定位偏移 - 辅助定位,反向偏移 各城市非线性偏移
    • 地图和政策问题 - 内嵌web地图
    • 多机型兼容问题 -
  • 各个页面定义私有url
  • 遵循规范,比如维度在前,精度在后

搞定了wordpress同步到qzone

Permalink

Posted on 2010-11-06 by luosky

由于封闭的腾讯从不开放其API,因此无法通过常规的方法同步到qzone.唯一通过外部发表文章的途径只有通过qq邮箱来进行发布.

post2qzone这个插件就是利用这个途径来进行同步.

但很多虚拟主机提供商因为垃圾邮件的关系,都屏蔽了邮件发送的25端口.我用的dreamhost也是如此,ssh上去telnet smtp.qq.com 25 一直都是connection refused.但是ssl加密的端口 587和465端口却可以telnet上去.因此可以利用这点来发布.

看了下post2qzone的源代码,是用的PHPMailerl来发邮件.只需对post2qzone.php 做如下修改即可通过ssl加密来发布邮件了:

在sendPostByPhpMailer函数里加上

$mail->SMTPSecure = "ssl";
 $mail->Port       = 587;

iOS Notification 学习笔记

Permalink

分类

  1. 本地notification

    • 4.0才开始支持
    • 无需网络,无需走和Apple推送服务器的整个推送流程,一切都在本地发生
  2. push notification

    • 3.0开始支持
    • 对于因为网络原因未发送到用户手机上的notification ,APNs会保留起来,待该device联网后发送.但对每台机器的每个应用只会保留一条,后来的覆盖之前的.
    • payload大小不超过256byte
    • 每次应用程序启动时都需向APNs注册,获得device token后将其传回应用的provider(application的server端)
    • provider要发送notification时,需附带这个device token
    • APNs会反馈持续发送失败的device 列表给provider,provider应停止向这些device发送notification
    • icon budge上显示的数字就是provider发过来的数字,不会累加.

接收到notification时的处理

本地notification和push notification对用户来讲没什么不同,当用户接收到一个notification时:

  • 若应用在后台运行,或者没有运行时
    • 展现这个notification(提醒,声音和icon badge).若用户点了这个提醒(或是划动解锁了屏幕),则以notification带的payload作为参数调用application:didFinishLaunchingWithOptions:方法启动应用
  • 若正在前台运行
    • 若是push notification,则application:didReceiveRemoteNotification:被调用
    • 若是本地的notification,则 application:didReceiveLocalNotification: 会被调用

建立推送服务器

要发送notification的provider需先获取SSL证书.一个证书只能用于一个应用.且有测试(sandbox)证书和正式证书之分:

iOS Develop Program的用户有三种角色:

  1. team agent
  2. team admin
  3. team member.

只有team agent可以创建SSL证书
team agent 和team admin可以创建provisioning profile
team member只能下载和安装证书及profile

建筑

Permalink

Singing Like Nobody’s Listening

建筑

2007/3/22 21:25:24

Tuesday, 6. March 2007, 13:43:05

厦门 -巴巴变免费相册

更多照片请入内观看。厦门 -巴巴变免费相册
厦门 -巴巴变免费相册
厦门 -巴巴变免费相册
厦门 -巴巴变免费相册
厦门 -巴巴变免费相册
厦门 -巴巴变免费相册
厦门 -巴巴变免费相册

Comments

蔡 明 - 2007/4/4 14:14:42

好像上次去厦门是99年的事情了,当时就觉得厦门很干净很漂亮。今天看了照片,感觉比我去的时候更加好了,希望有机会能够在去。如果去的话,L猪记得请客。

张 吟 - 2007/4/28 12:39:23

你什么时候又开始喜欢摄影了?呵呵,没来过厦门,不过在你的镜头下厦门好漂亮!

骆 仕恺 - 2007/5/6 12:53:32

呵呵,啥时候叫上阿酷,巴斯,A他们一起来玩吧:)

小西 - 2008/11/14 16:26:28

o(∩_∩)o…