之前在电影院看别的电影时 看到了这个电影的预告… 觉得很感兴趣, 但是电影6月份才会上映, 为了解馋, 在网上搜了个剧本, 拿出来分享下.
剧本下载地址: http://www.k4ng.com/The_Happening.pdf
预告:
之前在电影院看别的电影时 看到了这个电影的预告… 觉得很感兴趣, 但是电影6月份才会上映, 为了解馋, 在网上搜了个剧本, 拿出来分享下.
剧本下载地址: http://www.k4ng.com/The_Happening.pdf
预告:
Google Android项目的用IDE开发时通常是Eclipse + Android SDK + Android plugin for Eclipse. Eclipse因为有IBM撑腰, 前几年一直是Java IDE的首选..不过现在Sun公司经过多年的摸黑和偷窥(..-_-|||) 从NetBeans 5.5开始 就已经让很多的JAVA开发者开始接受Sun自己的Java IDE, 目前又新推出了NetBeans 6.0.1, 无论从哪方面讲, 都已经是可以和Eclipse相提并论甚至很多方面也已经强过了Eclipse (尤其是俺学校做作业开始要求用NetBeans了….) 所以俺一直在找寻在NetBeans下开发Android的方法… 写作业用NetBeans , 做Android用Eclipse 那我不是吃饱了没事闲的给自己找罪受么… 于是, 答案被俺在NetBeans的wiki上找到.. 下面就分享下..
*****插播刚看的新闻(April 3rd, 2008): 美国最大的通信公司AT&T 已经同意将推出运行Google Android操作系统的手机*****
首先需要下载以下的程序
Android plugins for NetBeans (Undroid)
1. 安装Undroid(为Netbeans设计的Android 开发插件)
下载插件并安装, Tools-> Plugins -> Downloaded
确定你安装了Platform Support 和Project Support模块. 再装个Examples看看例子也不错..
2. 填加 Android Platform
装完插件后, 你需要从Tools-> Java Platforms中填加Android Platform
指向你的Android SDK目录
3. 创建新的Android项目
从Files-> New Projects. 你可以看到分类里有一个新项目叫Android
换不换默认程序名随你便…
新Android项目的结构应该是下面这样的
MainActivity.java的代码如下
package org.me.androidapplication1;
import android.app.Activity;
import android.os.Bundle;
/**
*
* @author amit
*/
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
// ToDo add your GUI initialization code here
}
}
4. 运行项目
现在就可以试着运行一下了, 运行成功的话, Android模拟器就会跳出来
5. NetBeans中Android 的Hello World
填加一行
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
在这一行的上面
// ToDo add your GUI initialization code here
然后你会发现Netbeans告诉你"Cannot find symbol". 这是因为还需要导入TextView…(-_-|||..)
Netbeans里导个这东西很简单.
代码现在应该看起来是这样的
package org.me.androidapplication1;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
/**
*
* @author amit
*/
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}
再次运行, 俺们的Hello World 就出来了.
附: Android SDK M5-rc15 发布后 Netbeans的Android开发插件Undroid无法运行的解决方案:
http://abhrajit.blogspot.com/2008/03/undroid-and-android-sdk-m5-rc15.html
NOT “Vi vs. Emacs” — Despite twenty or thirty years of abuse thrown at each other by adherents of the Church of Vi vs the Church of Emacs, I feel the two editors are complementary, rather than antagonistic. They have a very different “look and feel”, but that’s not a real reason for choosing one over the other. They were designed for different jobs, they are better at different things, and I use both of them, depending on the job.
Specifically, I use GNU Emacs and Vim, and every time I say “Emacs” or “Vi”, assume these programs unless proven otherwise.
emacs will start in either TTY or GUI mode, depending on where it is invoked. Use emacs -nw to force the program to use an Xterm window in text mode instead of starting its own.vi[m] always starts in TTY mode, even in an Xterm session; use gvim or vi[m] -g to start the graphical version.bash shell can be configured for either style through the commands set -o emacs (the default) or set -o vi
Here are a few typical commands, showing the differences between “mode” style and “modeless” style:
VI EMACS
-- -----
Right one column k ^f
Right one word w Esc,f
Left one word b Esc,b
Next sentence ) Esc,e
Previous sentence ( Esc,a
Save file :w ^x,^s
Delete paragraph d} Esc,x,kill-p[TAB],[RET]
Edit a new file :ename ^x,^f,name
RegEx search for "foo" /foo Esc,^sfoo
Repeat search n ^s,[RET]
Exit :q or QQ ^x,^c
Save and Exit :x ^x,^s,^x,k,[RET]
Repeat last search n ^s,[RET]
Paste from clipboard p ^y
Delete 7 lines 7dd ^a,Esc,7,^k
Undo u ^x,u or ^/
Change a letter to "x" rx ^d,x
Go to line 6 :6[RET] Esc,<,Esc,5,^n
..or 6G Esc,x,goto-l[TAB][RET],6[RET]
You can easily see Vi tends to have simpler commands (in command mode) because it has all the “ordinary” letters and numbers available for navigational use.
Note that the Emacs documentation makes frequent mention of the “Meta” key, including key sequences like M-a, etc. Since most keyboards do not have such a key, M-a, for example, can be done two different ways:
Emacs actually consists of a LISP interpreter executing a few pre-compiled primitive routines written in C plus about 200,000 lines of LISP code to implement all the functions of the editor. This makes Emacs extremely flexible, since an experienced LISP programmer can change anything and everything, as well as create new actions the program’s author never thought of.
Emacs can be made into an e-mail client, a web browser, a chess opponent, etc. by simply adding the proper code. A single keystroke can be mapped to execute an entire LISP program, which uses the file being edited as its subject matter. For example, here is a segment of my .emacs file, which defines a function called lookat-file and then “binds” it to the CTRL-F key.
(defun lookat-file ()
"Edit file with name delimited by colon at beginning of current line."
(interactive)
(save-excursion
(save-match-data
(beginning-of-line)
(search-forward-regexp "^\\(.*\\):")
(find-file (match-string 1)))))
(define-key global-map "^F" 'lookat-file)
LISP functions are all defined the same way:
(funcname arg1 arg2 …)
The last line in the example calls the function define-key with three arguments: the variable global-map, the literal ^F (the CTRL-F key), and the function name lookat-file, previously defined.
All built-in functions (like define-key and variables (like global-map) are fully documented in the extensive Emacs help system. In the definition of lookat-file shown above, every single keyword is a built-in LISP function.
Note that Emacs is fairly easy to port to a new architecture, because the “look and feel” is entirely defined by the LISP code, and that is unchanged whether Emacs is running on Solaris, Linux, Win98, or whatever. The only code that has to be modified is the LISP interpreter itself plus the primitives that handle platform-dependent stuff like file i/o and the other interfaces to the OS.
LISP is actually very simple, because everything has the same form, namely a list of items enclosed in parentheses, and all program operations are function calls. Variables are untyped. For example:
(+ 2 3) ; add 2 and 3, return 5 as the value of the function.
(setq foo "John") ; store the string "John" into the variable foo.
(setq foo (+ 2 3)) ; store 5 into foo
(setq foo (and huey dewey louie))
; set foo true if all three are true, else false
(setq bar (* (+ 2 3) (- 6 2) (* 2 2) (sqrt 9)))
; store 240 into bar.
(setq ans (if (< foo bar) 1 2))
; ans is 1 if foo is less than bar, 2 otherwise
(defun myfun (arglist) statements)
; define function myfun
From these examples, it is easy to see why it’s a standard joke that LISP (which really stands for LISt Processor) is an acronym for “Lots of Irritating Silly Parentheses”. BTW, Vi enthusiasts tend to claim that Emacs is an acronym for “Eight Meg and Continuously Swapping”. Note that this joke has been around since the days when eight MB was a lot of memory. On the other hand, Emacs bigots will refer to Vi as “six”. (In which case Vim would be what, 994?)
I have to correct one statement I made earlier. Actually, Emacs also has a command-line. Typing Alt-x (or Esc,x) puts the cursor into what Emacs calls the “mini-buffer” at the bottom of the screen, where the user can execute thousands of built-in or user-defined LISP routines. For example, I could execute my lookat-file function by typing Alt-x lookat-file[ENTER]. (Emacs has tab completion just like bash or zsh, so in practice I would have typed Alt,x loo[TAB][ENTER], there being no other LISP function on my machine that starts with those three letters.)
I use both editors regularly. Sometimes the choice is random, but for some tasks I will always use either Vi or Emacs.
emacs Makefile *.[ch] to edit the whole project at the same time. Both editors can issue the actual “make” from within the editor, capture and parse the error messages, and position the cursor on the correct line in the correct file.My .emacs customization
My .vimrc customization
Vim Home Page
Gnu Emacs Home Page
Win32 Emacs precompiled binary
Win32 Vim precompiled binaries You need files gvim70.exe and vim70d32.zip.
Cygwin Unix Utilities for Win32 (rm, ls, egrep, etc.) Click on “Install Now”
O’Reilly & Associates, publisher of full books and pocket references for both GNU Emacs and Vi (including Vim).
New Riders, publisher of Vi Improved, by Steve Oualline.