Windows 折腾了好几年,Linux 也折腾了好几年,终于可以折腾 Mac 了!
话说前天晚上不小心给我的本本G1S倒了杯水喝,幸亏反应快,在第一时间拔下了电源(从来不插电池),擦干水晾了一天。昨天晚上开机什么毛病没有,窃喜ing
今早一到公司就发现桌上放了台macbook,心情就更好了 ^0^
废话不多说,开机开始折腾!
- 集成搜狗词库的Mac输入法QIM(立即下载按钮的下面)
- Firefox + 插件一大堆
- 赶紧安装传说中的编辑器 TextMate,破解方法 点这里
- 传说中的支持n多协议的IM Adium
- skype 是必不可少滴
- iPhone开发环境 iPhone SDK 2.2.1
- Mac + Apache + MySQL + PHP 环境 MAMP PRO (需要 SN 的话点这里)免费的可以用MAMP免费版或者 XAMPP for Mac
- 版本管理SubVersion Versions 和 SmartSVN 都装上试试看
- QQ for Mac 竟然不支持代理,WTF!
- 虚拟机 VMware Fusion 有时候还是要用到windows的
- FTP ClassicFTP
- Diff文件对比 DiffMerge。Xcode 带的 filemerge 也可以用,但这两个都都比不上windows下的beyond compare -_-#
- Twitter客户端 Tweetie
- Coda Web开发利器
- StuffIt
- 待补充……
Mac 下好软件不少啊
6.2更新
Posted in Tools
|
Tagged Mac, TextMate
|
安装 LAMP
1
| sudo tasksel install lamp-server |
安装 mod_python
1
| sudo apt-get install libapache2-mod-python |
为了开发和调试的方便,我们把apache默认目录改到我们的用户目录下
以下“你的名字”指的是你当前使用的系统用户名
如果你不清楚的话,可以执行命令 whoami 查看你当前的用户名
执行
回到你的用户目录
创建你的工作目录
Continue reading →
实际上我本来根本不知道“原型设计工具”这个词,“草图”倒是画过不少。布局,设计草图,以及表达不清楚的时候,画画图回更直观些。但我郁闷的发现——我竟然找不到纸和笔——我退化的真厉害!
而用电脑软件来画么……
- 我不知道用什么绘图软件
- 我不会用绘图软件
- 我懒得去学
其实我是见过别人用“原型设计工具”软件的,只是当时也没怎么留意,过后就忘记叫什么名字了。最重要的一点是那个软件只能运行在windows上。
直到发现 Balsamiq Mockups 才明白原来世界上有这么神奇的软件

看了下官方的演示,理解的特点如下
- 基于 Flex + Adobe Air,意味着跟平台无关,linux/windows/mac 都可以用
- 提供了很多控件元素
- 灵活的配置选项
- 导出PNG
- 和 xmind 一样用XML保存数据
- 耳目一新的手绘风格(我灰常稀饭!)
- ……
默认不支持中文,要使用中文的话要勾选菜单里的”Use System Font”
这款软件收费挺高,要79美元,但是你可以通以下方法免费获得序列号key
To get a free license key, you can do one of the following:
- If your company bought Mockups for Confluence, JIRA or XWiki, ask your IT admin for your company’s license information and use it FREE of charge.
- If you are a do-gooder of any sort (non-profit, charity, open-source contributor, you get the idea), email Mariah with a short blurb and she’ll send you a license, FREE of charge.
- If you are a blogger / journalist / maven willing to write us up (honest reviews are the most useful to us) email Mariah a short blurb with the link to your blog and she’ll send you a license, FREE of charge, so that you can evaluate Mockups properly.
- If you are willing to demo Mockups to an audience of at least 15 people (at a user group, a conference, a BarCamp), email Mariah your info and she’ll give you two licenses, one for you to keep and one to give away at the event, FREE of charge.
- If you teach a high-school class, email Mariah the name of your school and your class, plus the number of students in your class. Mariah will send you a license for all of them.
- A note to university students and professors: we currently do not offer free licenses to universities, but we’ll be happy to offer you an additional 50% off any orders of 10 or more licenses. Let us know if you’re interested and we’ll set up a discount code for you.
If you don’t fit in any of the five buckets above, you can buy a single-user license of Mockups for Desktop for $79 below.
IMPORTANT: due to the large volume of requests we have been receiving lately, we cannot promise we’ll answer every email. We try our best, but please be understanding if you don’t hear back from us.
Update 2009-05-21
补充一个key
Organization name: leexij@gmail.com
Serial Key: eNrzzU/OLi0odswsqslJTa3IzHJIz03MzNFLzs+tMTQyNrcwsTQyAIEa5xpDAIFxDy8=
文章页面 article.php?id=5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| <?php
$id = $_GET['id'];
// 查询文章内容
$article_sql = "SELECT * FROM `article` WHERE `id` = {$id}";
// 略
// 查询上一篇文章的ID
$prev_id_sql = "SELECT `id` FROM `article` WHERE `id` < {$id} limit 1";
// 略
echo "<a href=\"article.php?id={$prev_id}\">上一篇</a>";
// 查询下一篇文章的ID
$next_id_sql = "SELECT `id` FROM `article` WHERE `id` > {$id} limit 1";
// 略
echo "<a href=\"article.php?id={$next_id}\">下一篇</a>";
?> |
这样需要3次查询,但实际上我们不需要知道上一篇/下一篇文章的具体ID是多少
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| <?php
$id = $_GET['id'];
$go = $_GET['go'];
switch($go) {
case 'prev':
$symbol = '>';
break;
case 'next':
$symbol = '<';
break;
default:
$symbol = '=';
break;
}
// 查询文章内容
$article_sql = "SELECT * FROM `article` WHERE `id` {$symbol} {$id} LIMIT 1";
// 略
echo "<a href=\"article.php?id={$id}&go=prev\">上一篇</a>";
echo "<a href=\"article.php?id={$id}&go=next\">下一篇</a>";
?> |
减少了两次查询,MYSQL会感谢你大爷的
Posted in Technologies
|
Tagged php
|
装一堆东西先
1
| sudo apt-get install build-essential gnustep gobjc gnustep-make libgnustep-base-dev gnustep-devel |
编辑 .bashrc 加入
1 2 3 4
| #set GNUstep
GNUSTEP_ROOT=/usr/share/GNUstep
export GNUSTEP_ROOT
source /usr/share/GNUstep/Makefiles/GNUstep.sh |
写段小程序测试下:
建个目录 test
创建文件hello.m,内容如下
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
| #include <stdio.h>
/*
* The next #include line is generally present in all Objective-C
* source files that use GNUstep. The Foundation.h header file
* includes all the other standard header files you need.
*/
#include <Foundation/Foundation.h>
/*
* declare the Test class implements the class method (classStringValue).
*/
@interface Test
+ (const char *) classStringValue;
@end
/**
* Define the Test class and the class method (classStringValue).
*/
@implementation Test
+ (const char *) classStringValue;
{
return "this is the string value of the Test class";
}
@end
/**
* main() function: pass a message to the Test class and print the returned string
*/
int main(void)
{
printf("%s\n", [Test classStringValue]);
return 0;
} |
当然还有很重要的GNUmakefile
1 2 3 4 5 6 7
| include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME = LogTest
#LogTest 将会是生成的可执行文件的文件名
LogTest_OBJC_FILES = hello.m
#LogTest_OBJC_FILES 里的 LogTest 必须同上文 LogTest 相同
#hello.m 就是刚编辑的Objective-C源文件
include $(GNUSTEP_MAKEFILES)/tool.make |
然后执行 make
如果成功就会出现obj目录
使用 ./obj/LogTest 执行
搞定