2010年9月28日

Gmail Pop3 implementation

Before you dash off to try the example code, a warning though. Talking to mail servers even with JavaMail has pitfalls even with the FAQ to hand. For example, when I was writing this article, I decided initially to use GMail, Google's mail service and its POP3 support. Strangely though, Google's POP3 service is not RFC compliant which means as soon as you read a message from it, not matter what you do, that message will disappear from the message queue. With another mail server, the version of the server interpreted the RFC standard on authentication slightly differently causing a login error. How do you track down problems like this? One big help is turning on JavaMail debugging; when you get the Session, you can call the setDebug method to turn on debugging which in turn dumps everything that goes up or down the wire to the console. Be warned, when you are getting attachments, this can be some rather large sections of base 64 encoded text. Another way to flip the debug on is to set the system property "mail.debug" to true.

JavaMail has a whole range of properties which can affect the behaviour of providers. For example, with POP3, the standard provider has properties which control timeouts, authentication and how the provider actually interacts with the mail server. This in turn may resolve those compatibility issues mentioned above. These properties are provider implementation specific. Take the standard POP3 provider though; some POP3 providers automatically delete read messages when you disconnect, but the POP3 RSET command can reset the mailbox to its original read state. The property mail.pop3.rsetbeforequit set to true can enable that behaviour in the POP3 provider; the "pop3" part of the property name reflecting the provider's name, so change it to "pop3s" if you are using secure POP3. Here's code from the example which enables that for both and turns debugging on:

Properties props=System.getProperties();
props.setProperty("mail.pop3s.rsetbeforequit","true");
props.setProperty("mail.pop3.rsetbeforequit","true");
session=Session.getInstance(props,null);
session.setDebug(true);

And if you are wondering, no, this has no effect on Google Mail's POP3 implementation; once you've read it, it's gone. Next month, we'll look at using the MailRetriever as a servlet, complete with displaying those attachments, and look at handling some other types of mail beyond simple attachments.

2010年8月29日

The webkitTransform problem of iPhone 4G

On iPhone 4G
this.element.style.webkitTransform = translate(...) is very slow.

You should use
this.element.style.webkitTransform = translate3d(...)

2010年8月9日

NSData dataWithContentsOfURL has memory leak problem

NSData dataWithContentsOfURL has memory leak problem.

Should use it like below.

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

// ** Your Operations **

NSData *data = [NSData dataWithContentsOfURL:someURL];

// ** Your Operation **

[pool release];

2010年6月1日

有空想研究一下NMEA

有空想研究一下NMEA.
看来不需要了,无法定位是因为越狱,已找到解决方法。

I have released a Cydia package that fixes the location services issue caused by the Spirit jailbreak.

1. In Cydia, add the source http://cydia.pushfix.info/

2. Install the package "iPad Location Services Fix"

That's it. It restarts locationd on install and on every boot after the SpringBoard finishes loading. You should have no more problems with location services after install.

2010年5月18日

测试IAP时需要使用Developer证书。

测试IAP时需要使用Developer证书。

2010年4月30日

ActionScript 3 使用相对路径读入外部图片时,需注意的问题。

http://www.actionscript.org/forums/archive/index.php3/t-124859.html

loader.load(new URLRequest((root.loaderInfo.url.substring(0, (root.loaderInfo.url).lastIndexOf("/") + 1 ) ) + "trefle.png"));

2010年4月14日

VMware上安装Snow Lepard出现风火轮无法启动

解决方法:

for all people who have ACPI_SMC timeout, open your vmx file et change smc.present = “TRUE” to smc.present = “FALSE” and normaly the sytem will boot, and even you can shutdown et reboot without hang up ! (it works for me)

2010年3月22日

Oracle数据库sys被锁定的解决方法

C:>sqlplus / as sysdba
alter user sys account unlock;
alter user sys identified by 123;
conn sys/123 as sysdba

这是采用操作系统认证的方式, 如果楼主也是你这种方式,不会存在他的问题,所以它和你的认证方式是不一样的. sys应该不会被锁定的,真是奇怪. 忘记密码的话,可以用命令orapwd重置sys密码,没必要重装. 用法如下: orapwd file=e:/oracle/ora90/database/pwdfox.ora password=sssssss entries=10; 如果你sys用户能登录数据库,其它的用户问题都好办了,它可以对所有用户进行设置.

2010年2月25日

ipa和deb制作

制作ipa和deb包时可以删除
_CodeSignature
CodeResources
embedded.mobileprovision

制作deb是需要改权限755和更新icon.png和default.png。

2010年2月23日

How to make or compile a DEB in Windows

Tools:
iPhone or iPod touch
SSH (OpenSSH installed on device)
WinSCP (4.2.5 or higher)


1. Setup
First of all you would want to make a folder on your desktop. For this tutorial "X" is being used as a folder.

2. Control File
You will need a control file so you are able to package the DEB and for it to be viewable in Cydia/Rock.

To do this make a folder called "DEBIAN" (ALL CAPS) inside the folder "X".
Inside of the folder DEBIAN, make a file called "control" all lowercase and without an extension.

Here is a brief description of the fields in a control file
You need to add the below inside your control file except with your information. Make sure you add an extra space at the bottom of the control file


Code:
Package: com.yourcompany.yourapp
Name: YourAppNameHere
Version: Number
Architecture: iphoneos-arm
Description: Small Desc. about your app.
Homepage: Your Website
Maintainer: YourName 
Author: YourName
Sponsor: YourWebSiteName 
Section: System
Here is one of my own control file I use in Advanced Preferences

Code:
Package: com.csdev.advpreferences2
Name: Advanced Preferences 2
Version: B3-2
Architecture: iphoneos-arm
Description: This hack will give you more settings and tweaks. 
Homepage: http://www.csdev.2x.nu
Maintainer: CS Dev 
Author: CS Dev
Sponsor: CS Dev 
Section: System

3. File Structure
Inside your "X" folder, it's going to be like the iPhone File System. Like if you want to add a file to the root partition, just put the file in "X".

A. Application Structure
To install apps with DEBs, inside of "X", make a folder called "Applications". Then inside of Applications, make your app folder (EX: Cydia.app)

B. Theme Structure
To install themes wth DEBs, inside of "X", make a folder called "Library". Then inside of Libary, make another folder called "Themes" . After that inside of themes make your theme folder (EX: Cydia.theme)

Add your files using the structure above

4. WinSCP and SSH.

Open up WinSCP and connect to your Device. Navigate on your Device to
Code:
/var/root
Copy the X Folder to your device. File Structure should be below
Code:
/var/root/X
Inside the X Folder change the permissions of the DEBIAN folder and its files to 755
Navigate to var/root/ and open up the terminal im WinSCP. Do this by clicking the black box in one of the toolbars.

5. Terminal

Inside of Terminal type the following command in the "Enter Command" Box.
Code:
dpkg -b X.deb

It will pop-up some error and this is okay.

The DEB file will be located in var/root/
Code:
var/root/X.deb

2010年2月22日

All About Bikini Girl 被下线

周六晚开始进行“All About Bikini Girl”的免费促销,一时间盛况空前,服务器不堪重负。
周日下午改回收费时,不到一天时间被下载了5000左右,最高冲到US》Photography》Free的第8名,KR的第2名。光广告收入大概就有30多美元。真是好风光,好威风。
周一一早收到AppStore的邮件,看标题是“。。。Change Status”,本以为是某个程序又通过审核了呢,感叹了一下Apple居然周日(美国还是周日)还在上班,就兴冲冲地打开邮件。没想到居然是All About Bikini Girl被“Remove from sale”了,SHOCK!!!
联想到Apple今日打击色情软件的报道,看来自己是撞到枪口上了。杯具了。。。

现在正在思考对策
1.向Apple申述。(估计无效)
2.地下化,发非官方版本。

2010年2月12日

情人节免费促销

快到情人节了,今天把999 Roses和All About Valentine's Day给免费了。平时一天也不见得有一个下载的,免费后5个小时被下了300多个。不知是否能够上榜,等着看明天的日报了。

2010年2月8日

iPhone应用推广网站

日本:
http://www.appbank.net/
http://www.iphone-quality.com/
http://www.iphone-girl.jp/

App Store 排行榜

"All About Bikini"昨天被一个Review网站宣传,今天已经冲到了日本的Photography的Top Paid Apps的48位。赶紧提交了1.01的升级版,提高一下用户体验度,只是不知道Apple何时能够通过审批。
PC: http://www.sinoai.com/photomosaic/Result.action?tag=16
iPhone:http://itunes.apple.com/us/app/id352064189?mt=8


"All About Michael Jordan"也神奇的回到了日本的Sports的Top Paid Apps的78位。
PC:http://www.sinoai.com/photomosaic/Result.action?tag=2
iPhone: http://itunes.apple.com/us/app/id350702129?mt=8

2010年2月7日

“All About Bikini”被宣传了

这两天一直再用Google的Adwords做广告,广告费到今天应该用光。因为没有在其它地方做广告,本以为流量会减到0,下午回来看了一下,居然还有流量。查了一下来源,发现是有一个日本的网站写了一篇“All About Bikini”的评论,真是活雷锋啊。
http://www.macotakara.jp/blog/index.php?ID=6675

直接后果就是上了日本的Photography的Top Paid Apps,目前结果是97位。

2010年2月4日

合众地图KLMaps排名

IDP帐号被无缘无故停了一周之后,终于正常了。
合众地图KLMaps在中国的排名由第2跌到了第18位,为了快速提高排名,打开了强制检测1.xx版的功能。

2010/02/04 13:00 排名回升到15
2010/02/04 16:00 排名回升到13
2010/02/04 20:30 排名回升到9
2010/02/05 1:30 排名回升到7
2010/02/06 15:30 排名回升到4
2010/02/07 15:30 排名回升到3

All About Tiger Woods和All About Obama今天都上线了

All About Tiger Woods和All About Obama第一次申请是被拒,理由是含有“令人反感的内容”。无奈抱着试试看的心情写信给Apple申述,强调程序是图像搜索引擎,正如希拉里所说网络是自由的,我们不会过滤搜索结果。也没有修改程序就又提交了,只是说为了尊重Apple的意见,我们将会删除所提到的内容(实际没有删除)。今天居然全部通过了,真是神奇的苹果啊。
既然如此,过两天再试试重新提交一下杰克逊的,说不定也能过。

http://itunes.apple.com/us/app/all-about-obama/id350796143?mt=8
http://itunes.apple.com/us/app/all-about-tiger-woods/id351339948?mt=8

Apple to me
Thank you for submitting All About Tiger Woods 1.0 & All About Obama 1.0 to the App Store. We've reviewed All About Tiger Woods 1.0 & All About Obama 1.0 and determined that we cannot post these versions of your iPhone application to the App Store because it contains content that ridicules public figures and is in violation of Section  3.3.14 from the iPhone Developer Program License Agreement which states:

"Applications may be rejected if they contain content or materials of any kind (text, graphics, images, photographs, sounds, etc.) that in Apple's reasonable judgement may be found objectionable, for example, materials that may be considered obscene, pornographic, or defamatory."

A screenshot of where this behavior can be found within your application is attached.

If you believe that you can make the necessary changes so that All About Tiger Woods 1.0 & All About Obama 1.0 do not violate the iPhone Developer Program License Agreement, we encourage you to do so and resubmit it for review.

My reply
Dear iPhone Developer Program

Our application is an image search engine. What we do is just like
other image search engine.
We search the images from internet with some keywords. You can find
the same image in google image search with the same keywords. The
screenshots are attached(we use the iPhone with google image search ).

As Hillary Clinton said, we don't want to filter the search results,
too. But, We will delete the search result to show our good faith.
Please review it again. Thank you very much.

"We stand for a single Internet where all of humanity has equal access
to knowledge and ideas. And we recognize that the world's information
infrastructure will become what we and others make of it. Now, this
challenge may be new, but our responsibility to help ensure the free
exchange of ideas goes back to the birth of our republic."

IDP帐号终于正常了。

IDP帐号被无缘无故停了一周之后,终于正常了。
合众地图KLMaps在中国的排名由第2跌到了第17位,真是倒霉透了。

2010年2月3日

希望该死的Apple早日解决问题!

因为这两天IDP帐号又出问题了,导致用户无法在App Store上下载1.01版,已经有用户开始直接给我写信了,看来还是有一定需求和用户基础的,呵呵。

希望该死的Apple早日解决问题!

2010年2月1日

ADC 全球各地的联络电话

ADC 全球各地的联络电话。帐号又出问题了,由要打电话联络该死的Apple。

http://developer.apple.com/contact/phone.html

苹果的日本IDC支持态度极其恶劣,相比之下香港的就要客气的多。

2010年1月31日

Google的搜索排名

一直在关注“klmaps”和“合众地图”等关键字的搜索排名,发现了一些规律。网站如果几天不更新排名马上会掉下去,更新一下又会提上来。有趣的是我更新的不是一个域名下的内容,只是两个站放在了一台服务器上。

2010年1月28日

iPad 发布(转)

图片:




图片:




图片:




图片:




图片:




图片:




图片:




图片:




图片:




图片:



主要指标:
24.28厘米高
18.97厘米宽
1.34厘米厚
0.68公斤(不带3G模块)
0.73公斤(带3G模块)
9.7英寸1024*786多点触摸屏幕
缺省支持WiFi,蓝牙,可以加3G模块支持GSM、UMTS、HSDPA
带GPS
1G的CPU
带3.5mm耳机插口,麦克风,喇叭
这个大家最关心:
不带3G模块,16G的499$, 32G的599$,64G的699$。
带3G模块,16G的629$, 32G的729$,64G的829$。都是美国价格,其他国家价格随后公布。3G和运营商捆绑套餐价格随后公布。

下面这个跟我们最有关系:
最新的SDK3.2 Beta已经支持iPad开发,带iPad模拟器。

图片:




图片:




另外,所有的现有App可以在上面运行。

不过屏幕分辨率差太远,感觉是硬拉上去了。

2010年1月27日

All About 系列终于通过审核,开始上线了。

经过千辛万苦,中间和Apple的评审人员交涉了无数次,All About系列终于有通过评审的了,今天开始上线。也就是说可以开始批量生产了,哈哈。
关于名人的几个还没有通过,有点遗憾,不过是不会放弃的,还会继续和Apple交涉。

2010年1月21日

两个Java的html客户端

HtmlUnit
http://htmlunit.sourceforge.net/
Firefox3 + Javascript有问题。
Firefox2 + Javascript没问题。


HttpUnit
http://httpunit.sourceforge.net/
好像已经不更新了。


很容易搞混,做个记号。

2010年1月20日

刷屏计划受阻

今天接连收到两封aplle来到邮件,一封是因为使用私有API被拒,一封是review时间要延长。

哎~~想刷屏也不容易啊。

We are currently reviewing an app that you submitted for inclusion on the App Store, and want to let you know that the review process will require additional time. We apologize for the delay and will provide you with an update on the status of your app as soon as possible.

2010年1月15日

Difference between Hibernate's get() and load()

If load() can’t find the object in the cache or database, an exception is
thrown. The load() method never returns null. The get() method returns
null if the object can’t be found.