Wednesday, February 2, 2011
Sunday, June 14, 2009
GAE-java: Using the Users Service
package guestbook;
import java.io.IOException;
import javax.servlet.http.*;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
public class GuestbookServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
if (user != null) {
resp.setContentType("text/plain");
resp.getWriter().println("Hello, " + user.getNickname());
} else {
resp.sendRedirect(userService.createLoginURL(req.getRequestURI()));
}
}
}
Saturday, June 13, 2009
GAE-java: Get started
package guestbook;
import java.io.IOException;
import javax.servlet.http.*;
@SuppressWarnings("serial")
public class GuestbookServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/plain");
resp.getWriter().println("Hello, world2");
}
}
Sunday, May 24, 2009
The Keyboard
! exclamation
" double quote
# number sign
$ dollar
% Percent
& ampersand
' apostrophe
() parentheses/round brackets/curved brackets
* asterisk
+ plus
, comma
- hyphen/minus
. full stop/period/dot
/ slash
: colon
; semicolon
< less than
= equals
> greater than
? question
@ at
[] square brackets
\ backslash
^ caret
_ underscore
` grave accent
{} curly brackets/braces
| vertical bar
" double quote
# number sign
$ dollar
% Percent
& ampersand
' apostrophe
() parentheses/round brackets/curved brackets
* asterisk
+ plus
, comma
- hyphen/minus
. full stop/period/dot
/ slash
: colon
; semicolon
< less than
= equals
> greater than
? question
@ at
[] square brackets
\ backslash
^ caret
_ underscore
` grave accent
{} curly brackets/braces
| vertical bar
~ tilde
Wednesday, May 13, 2009
vim, fullscreen, Remove menubar
map:call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0) Link:http://www.vim.org/scripts/script.php?script_id=2596#1.0
if has('gui_running') && has("win32")au GUIEnter * simalt ~xendif
set guioptions-=m "Remove menubar"set guioptions-=T "Remove toolbar"set guioptions-=r "Remove v_scroll bar"
Subscribe to:
Posts (Atom)