<%@ page errorPage="myerror.jsp" %>
<%@ page import="com.foo.bar" %>
<html>
<head>
<%! int serverInstanceVariable = 1;%>
...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{func Hello(d *HelloData)}} | |
<h1>{{fmt.Sprintf("Hi, %s", d.Name)}} {{d.MyEmail()}}</h1> | |
<ul> | |
{{ for _, e := range d.Entries }} | |
<li>{{EntryItem(e, d.Lang)}}</li> | |
{{ end }} | |
</ul> | |
{{end}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package templates | |
import ( | |
"fmt" | |
"io" | |
) | |
type HelloData struct { | |
Name string | |
Email string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (mp *mailProcessor) ProcessData(r io.Reader) (err error) { | |
tr := textproto.NewReader(bufio.NewReaderSize(r, 4096)) | |
var headers textproto.MIMEHeader | |
headers, err = tr.ReadMIMEHeader() | |
if err != nil { | |
return | |
} | |
contentType := headers.Get("Content-Type") | |
d, params, err := mime.ParseMediaType(contentType) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: Felix Sun <[email protected]> | |
Content-Type: multipart/alternative; boundary="Apple-Mail=_640F32F6-F161-451D-B6CD-56C6430A4FE4" | |
Subject: eeeee | |
Message-Id: <[email protected]> | |
Date: Wed, 23 Jan 2013 21:05:44 +0800 | |
To: "myasics.theplant.jp@localhost" <myasics.theplant.jp@localhost> | |
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) | |
X-Mailer: Apple Mail (2.1499) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"code.google.com/p/go.net/websocket" | |
// "io" | |
"log" | |
"net/http" | |
) | |
type Room struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int MACAddr(TCHAR* buf) { | |
IP_ADAPTER_INFO info[16]; | |
DWORD len = sizeof(info); | |
int i = 0; | |
int printed = 0; | |
int return_code = GetAdaptersInfo(info, &len); | |
if (return_code != ERROR_SUCCESS) { | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import( | |
"fmt" | |
"reflect" | |
) | |
func main() { | |
mapArray := []interface{}{ | |
map[string]interface{}{"key1": 1}, | |
map[string]interface{}{"key2": "2"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fcoder | |
/* | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include "libavformat/avformat.h" | |
*/ | |
import "C" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream app { | |
server unix:/home/app/app/current/tmp/sockets/unicorn.sock fail_timeout=0; | |
} | |
upstream memcached { | |
server 127.0.0.1:11211; | |
} | |
server { | |
listen 80; |