浏览模式: 标准 | 列表Tag:wordpress
Submitted by gouki on 2014, October 9, 10:50 PM
儿子开始上小学了,学校里布置了各种各样的小东西让他们做。比如出个小板报什么的,用电脑做。。。
于是这就成了我的工作,所幸以前在部队的时候把word还算玩的比较熟,然后利用百度图片找点图片出来,附上去就成了一份小小的板报
现在最大的问题就是打印,本来资料是老婆整理的,于是打印机就接在PC电脑上了,但打印机放在桌子上太占地方了,于是就想过是不是要买一个支持网络打印的。结果看了一下X东网,带网络打印的打印机最便宜的都是1000开外了。想了想,好象胶囊是支持打印机的,然后找了下资料,真的可以
1、windows下面
安装Benjour print services(下载地址是:http://support.apple.com/kb/DL999),该页面有教程(记得中文不好就选择中文),然后点击桌面的“Benjour 打印机向导”,然后就能搜索得到打印机了
2、MAC下面
直接搜索打印机,如果没有驱动,会提醒你下载驱动。
测试了一下打印,两台机器都可以了,心里灰常舒畅。。。打印机也被我扔到角落里去了,不再放在电脑桌上占地方,黑黑
PS:本来很激动的以为有了这玩意,就也可以直接用手机打印了,结果提示我:找不到airprint打印机,看来不是每个打印机都支持啊。。。
PPS:看到官方的一句话了(http://support.apple.com/kb/HT4356?viewlocale=zh_CN)
XML/HTML代码
- 连接到 Apple AirPort 基站或 AirPort Time Capsule 的 USB 端口的 AirPrint 打印机不支持 AirPrint 功能。通过 Wi-Fi 将 AirPrint 打印机连接到您的网络,或通过以太网将其连接到 AirPort 设备上的 LAN 端口。
心都碎了
Tags: 时间胶囊, 打印机
Flutter | 评论:0
| 阅读:20742
Submitted by gouki on 2012, April 17, 9:26 AM
来源:http://hi.baidu.com/tangly888/blog/item/62948520121870559358074f.html
翻译苹果文档 地址: 翻译:tangly
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW9
推送通知消息负载内容
每个推送通知都带有内容负载,这个负载内容会被应用程序下载并提醒用户收到数据。负载内容最大允许为256个字节,苹果推送通知服务器拒绝任何超过最大负载字节的推送通知。记住,通知的提交是“尽力而为”,它并不能得到保证。
对于每一个通知,供应商组成一个JSON自动对象来严格遵守RFC 4627协议,这个字典必须通过aps键来包含另一个字典的标示,aps键包含一个或多个属性,指定以下操作:
1. 向用户显示一个提示消息
2. 应用程序图标上的一个徽章号码
3. 可播放的声音
警告: 警告你可以将提示消息,徽章图标号码,播放声音结合成一个单一的通知消息,你应该考虑到推送通知的人机界面问题,例如,用户可能受到频繁的提示消息和警告声音,这然人烦。
当通知到达时,如果这时候目标程序没有运行,这提示消息,声音,徽章号码会被播放或被显示;如果应用程序正在运行,ios将它作为一个NSDictionary对象提供给应用程序委托,这个字典收录了相应COcoa属性列表中的对象
供应商可以指定评估命名以外的消息内容,自定义消息负载内容,自定义值必须使用Json结构和基本类型:字典(对象),数组,字符串,数字,boolean。作为定制消息数据,你不应该包含用户的一些信息。相反,为设置上下文(用户界面)或内部指标为目的来使用它。例如,当供应商发送通知的时候,一个自定义通知消息可能会成为一个会话标示符被消息客户端应用或时间戳确认来使用。提示消息的任何行为都不应该具有破坏性,如删除客户设备上的数据
关键:由于传送不能够被保证,所以你不应该依赖远程通知设施提供有效负载消息内容给应用程序,不要再消息负载内容中带有敏感数据,你使用它仅是告诉用户此应用有新的数据可用了
表3-1中列出了有关苹果服务器消息负载内容的键和预期值
Key
|
类型
|
Comment
|
alert
|
字符串或字典
|
如果包含这个这个属性 iOS 将会显示一个标准的提示. 你可用指定一个字符串作为提醒或作为字典的值. 如果你指定了一个字符串, 它会变成有两个按钮的警报消息: 关闭和显示. 如果用户点击查看, 应用程序将会启动
另外, 你可以指定一个字典来作为提示的内容. 对于这类字典,请查看表3-2
|
badge
|
数字
|
这个数字将作为应用程序的的徽章图标显示. 如果此属性不存在, 任何当前显示的徽章号码将会被删除
|
sound
|
字符串
|
它是捆绑再应用程序的声音文件名. 这个声音文件播放声音警报. 如果这个声音文件不存在或指定默认值,这时会播放预设的警报音. 它的音频必须是兼容的系统数据格式之一; 详细信息,请阅读“”准备定义提示音
|
表3-1 alert属性的子属性
Key
|
Value type
|
Comment
|
body
|
string
|
The text of the alert message.
|
action-loc-key
|
字符串或空
|
如果字符串是指定的, 将显示带有两个按钮的警报, 其行为请看表3-1. 然而, ios 用字符串作为键来获得当前本地化的字符串,并将其用于右边按钮的标题,代替了“view”. 如果字符串值为null,系统将显示一个简单的“确定”按钮,当点击时,将会简单的消除按钮. 看 “Localized Formatted Strings” 获得更多消息
|
loc-key
|
字符串
|
本地提示消息的一个字符串钥匙, 字符串钥匙可以格式化这样%@ and %n$ 在loc-args指定参数变量. 看 “Localized Formatted Strings” 可以获得更多信息.
|
loc-args
|
字符串数组
|
变量的字符串值格式化再loc-key出现. 看 “Localized Formatted Strings” 可以获得更多信息 .
|
launch-image
|
字符串
|
图形文件名在应用程序中已经绑定; 它可能包括扩展或省略. 当用户点击动作按钮或移动动作滑块,图片将会被显示出来. I如果这个属性没有指定, 系统会使用以前的图片,通过在应用程序的Info.plist键来使用图像识别, 或返回到默认的png文件
这个属性再ios4.0才被添加的
|
注意:如果你想要iphone,ipad,ipod touch设备将一个通知作为消息文本来显示,那就的有关闭和显示两个按钮
Tags: 推送, budge, json
Flutter | 评论:0
| 阅读:19748
Submitted by gouki on 2011, September 5, 9:33 PM
先不说什么功能,只能说这种功能对我们来说太有用了。
refactor,这种重构,其实在ZS和NETBEANS 中效果并没有现在这个软件(phpstorm)那么明显。看看它的功能就知道了。
官方网址(http://blog.jetbrains.com/webide/2011/05/extract-function-method-refactoring-for-php/)说:
We are working hard on new features for PhpStorm 2.1, and the ‘Extract Function/Method’ refactoring for PHP is one of them. This feature has been available since the first PhpStorm 2.1 EAP(106.444), and we are looking forward for your feedback.

Picture 1b: Select an expression

Invoke the refactoring from the menu ‘Refactor -> Extract Method‘ or using a hotkey. The default hotkey is Ctrl+Alt+M for Windows/Linux and Cmd+Opt+M for Mac.
Depending on the context of the selected code fragment, ‘Extract method’ (the code fragment is inside a method) (Picture 2b) or ‘Extract Function’(the code fragment is inside a function or script) (Picture 2a).
Picture 2a: ‘Extract Function’ dialog

Picture 2b: ‘Extract Method’ dialog

Enter the name of the new function/method. Press OK.
Picture 3a: The code fragment is replaced with a function call statement

Picture 3b: The expression is replaced with a method call expression

Picture 4a: Definition of the extracted function

Picture 4b: Definition of the extracted method

Develop with pleasure!
------------
看完上面的内容,你是否觉 得,原来重构也可以这样简单?
Tags: phpstorm, refactor
Software | 评论:0
| 阅读:16987
Submitted by gouki on 2011, September 4, 9:33 PM
如果到facebook上关注一下yii framework的群组,会发现有人在介绍yiicookbook.org,里面是一本关于1.1的书。
然后去yii framework官方上搜索一下phpstorm,会发现同一个人在说自己用phpstorm,问phpstorm有没有什么支持。结果官网说暂时好象不支持。。。
然后再搜索了一下,发现在yii的官网有一个简单的例子在说如何让项目支持yii framework。看了一下,发现,大多数都用过,只有第一点,说是把yiilite.php过滤掉。这个其实很重要了,否则有些变量就会出现提示两次。
OK,来看官网的wiki吧:http://www.yiiframework.com/wiki/92/configuring-phpstorm-ide-for-yii
Code completion
- Exclude yiilite.php from index:
- File → Settings → IDE Settings → File Types.
- yiilite.php to Ignore files and folders.
- Exclude not used directories, specify resources.
- File → Settings → Project settings → Directories.
- Mark framework/cli/views, protected/runtime and assets as excluded.
- Mark website root as resource root.
- Specify path to your PHP.
- File → Settings → Project settings → PHP → PHP Home.
- If your project uses common Yii framework folder you need to include it.
- File → Settings → Project settings → PHP → PHP Home → Add.
- Specify a path to framework directory.
- If you are writing unit tests you can include PHPUnit to get code completion:
- File → Settings → Project settings → PHP → PHP Home → Add.
- Specify a path to PHPUnit.
- Complete code: Ctrl+Space.
- Show method arguments: Ctrl+Q.
Testing
You should install PHPUnit to run unit tests.
- PHPUnit.
- Follow official PHPUnit installation guide.
- In your IDE: Run → Edit configurations.
- Press "+".
- Name: anything.
- Test: depending on what do you want to test select an appropriate option. Specify path.
- Use XML configuration file: specifying path to phpunit.xml. Often it's path_to_your_webroot/protected/tests/phpunit.xml.
- To run tests use SHIFT+F10.
OK,现在这样就可以简单的支持yii framework了。只是phpstorm还是有点小问题,因为提示的时候不会显示phpdoc的信息。纠结,啥时候会有doc的提示呢?
Tags: phpstorm, yii, facebook
Software | 评论:0
| 阅读:24530
Submitted by gouki on 2011, September 3, 10:44 PM
图片附件(缩略图):

图片附件(缩略图):

图片附件(缩略图):

图片附件(缩略图):

图片附件(缩略图):

Scala & Ruby | 评论:1
| 阅读:15265