text:
// Copyright 2009 The Go Authors.  All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Windows system calls.

package syscall

import (
	"unsafe"
	"utf16"
)

const OS = "windows"

type Handle uintptr

const InvalidHandle = ^Handle(0)

/*

small demo to detect version of windows you are running:

package main

import (
	"syscall"
)

func abort(funcname string, err int) {
	panic(funcname + " failed: " + syscall.Errstr(err))
}

func print_version(v uint32) {
	major := byte(v)
	minor := uint8(v >> 8)
	build := uint16(v >> 16)
	print("windows version ", major, ".", minor, " (Build ", build, ")\n")
}

func main() {
	h, err := syscall.LoadLibrary("kernel32.dll")
	if err != 0 {
		abort("LoadLibrary", err)
	}
	defer syscall.FreeLibrary(h)
	proc, err := syscall.GetProcAddress(h, "GetVersion")
	if err != 0 {
		abort("GetProcAddress", err)
	}
	r, _, _ := syscall.Syscall(uintptr(proc), 0, 0, 0, 0)
	print_version(uint32(r))
}

*/

// StringToUTF16 returns the UTF-16 encoding of the UTF-8 string s,
// with a terminating NUL added.
func StringToUTF16(s string) []uint16 { return utf16.Encode([]int(s + "\x00")) }

// UTF16ToString returns the UTF-8 encoding of the UTF-16 sequence s,
// with a terminating NUL removed.
func UTF16ToString(s []uint16) string {
	for i, v := range s {
		if v == 0 {
			s = s[0:i]
			break
		}
	}
	return string(utf16.Decode(s))
}

// StringToUTF16Ptr returns pointer to the UTF-16 encoding of
// the UTF-8 string s, with a terminating NUL added.
func StringToUTF16Ptr(s string) *uint16 { return &StringToUTF16(s)[0] }

// dll helpers

// implemented in ../runtime/windows/syscall.cgo
func Syscall(trap, nargs, a1, a2, a3 uintptr) (r1, r2, err uintptr)
func Syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
func Syscall9(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr)
func Syscall12(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12 uintptr) (r1, r2, err uintptr)
func loadlibraryex(filename uintptr) (handle uintptr)
func getprocaddress(handle uintptr, procname uintptr) (proc uintptr)

func loadDll(fname string) uintptr {
	m := loadlibraryex(uintptr(unsafe.Pointer(StringBytePtr(fname))))
	if m == 0 {
		panic("syscall: could not LoadLibraryEx " + fname)
	}
	return m
}

func getSysProcAddr(m uintptr, pname string) uintptr {
	p := getprocaddress(m, uintptr(unsafe.Pointer(StringBytePtr(pname))))
	if p == 0 {
		panic("syscall: could not GetProcAddress for " + pname)
	}
	return p
}

func Getpagesize() int { return 4096 }

// Converts a Go function to a function pointer conforming
// to the stdcall calling convention.  This is useful when
// interoperating with Windows code requiring callbacks.
// Implemented in ../runtime/windows/syscall.cgo
func NewCallback(fn interface{}) uintptr

// TODO
func Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int) {
	return -1, ENOSYS
}

// windows api calls

//sys	GetLastError() (lasterrno int)
//sys	LoadLibrary(libname string) (handle Handle, errno int) = LoadLibraryW
//sys	FreeLibrary(handle Handle) (errno int)
//sys	GetProcAddress(module Handle, procname string) (proc Handle, errno int)
//sys	GetVersion() (ver uint32, errno int)
//sys	FormatMessage(flags uint32, msgsrc uint32, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, errno int) = FormatMessageW
//sys	ExitProcess(exitcode uint32)
//sys	CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, errno int) [failretval==InvalidHandle] = CreateFileW
//sys	ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (errno int)
//sys	WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (errno int)
//sys	SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, errno int) [failretval==0xffffffff]
//sys	CloseHandle(handle Handle) (errno int)
//sys	GetStdHandle(stdhandle int) (handle Handle, errno int) [failretval==InvalidHandle]
//sys	FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, errno int) [failretval==InvalidHandle] = FindFirstFileW
//sys	FindNextFile(handle Handle, data *Win32finddata) (errno int) = FindNextFileW
//sys	FindClose(handle Handle) (errno int)
//sys	GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (errno int)
//sys	GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, errno int) = GetCurrentDirectoryW
//sys	SetCurrentDirectory(path *uint16) (errno int) = SetCurrentDirectoryW
//sys	CreateDirectory(path *uint16, sa *SecurityAttributes) (errno int) = CreateDirectoryW
//sys	RemoveDirectory(path *uint16) (errno int) = RemoveDirectoryW
//sys	DeleteFile(path *uint16) (errno int) = DeleteFileW
//sys	MoveFile(from *uint16, to *uint16) (errno int) = MoveFileW
//sys	GetComputerName(buf *uint16, n *uint32) (errno int) = GetComputerNameW
//sys	SetEndOfFile(handle Handle) (errno int)
//sys	GetSystemTimeAsFileTime(time *Filetime)
//sys	sleep(msec uint32) = Sleep
//sys	GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, errno int) [failretval==0xffffffff]
//sys	CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, errno int)
//sys	GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (errno int)
//sys	CancelIo(s Handle) (errno int)
//sys	CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (errno int) = CreateProcessW
//sys	OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, errno int)
//sys	TerminateProcess(handle Handle, exitcode uint32) (errno int)
//sys	GetExitCodeProcess(handle Handle, exitcode *uint32) (errno int)
//sys	GetStartupInfo(startupInfo *StartupInfo) (errno int) = GetStartupInfoW
//sys	GetCurrentProcess() (pseudoHandle Handle, errno int)
//sys	DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (errno int)
//sys	WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, errno int) [failretval==0xffffffff]
//sys	GetTempPath(buflen uint32, buf *uint16) (n uint32, errno int) = GetTempPathW
//sys	CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (errno int)
//sys	GetFileType(filehandle Handle) (n uint32, errno int)
//sys	CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (errno int) = advapi32.CryptAcquireContextW
//sys	CryptReleaseContext(provhandle Handle, flags uint32) (errno int) = advapi32.CryptReleaseContext
//sys	CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (errno int) = advapi32.CryptGenRandom
//sys	GetEnvironmentStrings() (envs *uint16, errno int) [failretval==nil] = kernel32.GetEnvironmentStringsW
//sys	FreeEnvironmentStrings(envs *uint16) (errno int) = kernel32.FreeEnvironmentStringsW
//sys	GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, errno int) = kernel32.GetEnvironmentVariableW
//sys	SetEnvironmentVariable(name *uint16, value *uint16) (errno int) = kernel32.SetEnvironmentVariableW
//sys	SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (errno int)
//sys	GetFileAttributes(name *uint16) (attrs uint32, errno int) [failretval==INVALID_FILE_ATTRIBUTES] = kernel32.GetFileAttributesW
//sys	SetFileAttributes(name *uint16, attrs uint32) (errno int) = kernel32.SetFileAttributesW
//sys	GetCommandLine() (cmd *uint16) = kernel32.GetCommandLineW
//sys	CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, errno int) [failretval==nil] = shell32.CommandLineToArgvW
//sys	LocalFree(hmem Handle) (handle Handle, errno int) [failretval!=0]
//sys	SetHandleInformation(handle Handle, mask uint32, flags uint32) (errno int)
//sys	FlushFileBuffers(handle Handle) (errno int)
//sys	GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, errno int) = kernel32.GetFullPathNameW
//sys	CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, errno int) = kernel32.CreateFileMappingW
//sys	MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, errno int)
//sys	UnmapViewOfFile(addr uintptr) (errno int)
//sys	FlushViewOfFile(addr uintptr, length uintptr) (errno int)
//sys	VirtualLock(addr uintptr, length uintptr) (errno int)
//sys	VirtualUnlock(addr uintptr, length uintptr) (errno int)
//sys	TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (errno int) = wsock32.TransmitFile

// syscall interface implementation for other packages

func Errstr(errno int) string {
	// deal with special go errors
	e := errno - APPLICATION_ERROR
	if 0 <= e && e < len(errors) {
		return errors[e]
	}
	// ask windows for the remaining errors
	var flags uint32 = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_IGNORE_INSERTS
	b := make([]uint16, 300)
	n, err := FormatMessage(flags, 0, uint32(errno), 0, b, nil)
	if err != 0 {
		return "error " + itoa(errno) + " (FormatMessage failed with err=" + itoa(err) + ")"
	}
	// trim terminating \r and \n
	for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- {
	}
	return string(utf16.Decode(b[:n]))
}

func Exit(code int) { ExitProcess(uint32(code)) }

func makeInheritSa() *SecurityAttributes {
	var sa SecurityAttributes
	sa.Length = uint32(unsafe.Sizeof(sa))
	sa.InheritHandle = 1
	return &sa
}

func Open(path string, mode int, perm uint32) (fd Handle, errno int) {
	if len(path) == 0 {
		return InvalidHandle, ERROR_FILE_NOT_FOUND
	}
	var access uint32
	switch mode & (O_RDONLY | O_WRONLY | O_RDWR) {
	case O_RDONLY:
		access = GENERIC_READ
	case O_WRONLY:
		access = GENERIC_WRITE
	case O_RDWR:
		access = GENERIC_READ | GENERIC_WRITE
	}
	if mode&O_CREAT != 0 {
		access |= GENERIC_WRITE
	}
	if mode&O_APPEND != 0 {
		access &^= GENERIC_WRITE
		access |= FILE_APPEND_DATA
	}
	sharemode := uint32(FILE_SHARE_READ | FILE_SHARE_WRITE)
	var sa *SecurityAttributes
	if mode&O_CLOEXEC == 0 {
		sa = makeInheritSa()
	}
	var createmode uint32
	switch {
	case mode&(O_CREAT|O_EXCL) == (O_CREAT | O_EXCL):
		createmode = CREATE_NEW
	case mode&(O_CREAT|O_TRUNC) == (O_CREAT | O_TRUNC):
		createmode = CREATE_ALWAYS
	case mode&O_CREAT == O_CREAT:
		createmode = OPEN_ALWAYS
	case mode&O_TRUNC == O_TRUNC:
		createmode = TRUNCATE_EXISTING
	default:
		createmode = OPEN_EXISTING
	}
	h, e := CreateFile(StringToUTF16Ptr(path), access, sharemode, sa, createmode, FILE_ATTRIBUTE_NORMAL, 0)
	return h, int(e)
}

func Read(fd Handle, p []byte) (n int, errno int) {
	var done uint32
	e := ReadFile(fd, p, &done, nil)
	if e != 0 {
		if e == ERROR_BROKEN_PIPE {
			// NOTE(brainman): work around ERROR_BROKEN_PIPE is returned on reading EOF from stdin
			return 0, 0
		}
		return 0, e
	}
	return int(done), 0
}

func Write(fd Handle, p []byte) (n int, errno int) {
	var done uint32
	e := WriteFile(fd, p, &done, nil)
	if e != 0 {
		return 0, e
	}
	return int(done), 0
}

func Seek(fd Handle, offset int64, whence int) (newoffset int64, errno int) {
	var w uint32
	switch whence {
	case 0:
		w = FILE_BEGIN
	case 1:
		w = FILE_CURRENT
	case 2:
		w = FILE_END
	}
	hi := int32(offset >> 32)
	lo := int32(offset)
	// use GetFileType to check pipe, pipe can't do seek
	ft, _ := GetFileType(fd)
	if ft == FILE_TYPE_PIPE {
		return 0, EPIPE
	}
	rlo, e := SetFilePointer(fd, lo, &hi, w)
	if e != 0 {
		return 0, e
	}
	return int64(hi)<<32 + int64(rlo), 0
}

func Close(fd Handle) (errno int) {
	return CloseHandle(fd)
}

var (
	Stdin  = getStdHandle(STD_INPUT_HANDLE)
	Stdout = getStdHandle(STD_OUTPUT_HANDLE)
	Stderr = getStdHandle(STD_ERROR_HANDLE)
)

func getStdHandle(h int) (fd Handle) {
	r, _ := GetStdHandle(h)
	return r
}

func Stat(path string, stat *Stat_t) (errno int) {
	if len(path) == 0 {
		return ERROR_PATH_NOT_FOUND
	}
	// Remove trailing slash.
	if path[len(path)-1] == '/' || path[len(path)-1] == '\\' {
		// Check if we're given root directory ("\" or "c:\").
		if len(path) == 1 || (len(path) == 3 && path[1] == ':') {
			// TODO(brainman): Perhaps should fetch other fields, not just FileAttributes.
			stat.Windata = Win32finddata{}
			a, e := GetFileAttributes(StringToUTF16Ptr(path))
			if e != 0 {
				return e
			}
			stat.Windata.FileAttributes = a
			return 0
		}
		path = path[:len(path)-1]
	}
	h, e := FindFirstFile(StringToUTF16Ptr(path), &stat.Windata)
	if e != 0 {
		return e
	}
	defer FindClose(h)
	stat.Mode = 0
	return 0
}

func Lstat(path string, stat *Stat_t) (errno int) {
	// no links on windows, just call Stat
	return Stat(path, stat)
}

const ImplementsGetwd = true

func Getwd() (wd string, errno int) {
	b := make([]uint16, 300)
	n, e := GetCurrentDirectory(uint32(len(b)), &b[0])
	if e != 0 {
		return "", e
	}
	return string(utf16.Decode(b[0:n])), 0
}

func Chdir(path string) (errno int) {
	return SetCurrentDirectory(&StringToUTF16(path)[0])
}

func Mkdir(path string, mode uint32) (errno int) {
	return CreateDirectory(&StringToUTF16(path)[0], nil)
}

func Rmdir(path string) (errno int) {
	return RemoveDirectory(&StringToUTF16(path)[0])
}

func Unlink(path string) (errno int) {
	return DeleteFile(&StringToUTF16(path)[0])
}

func Rename(oldpath, newpath string) (errno int) {
	from := &StringToUTF16(oldpath)[0]
	to := &StringToUTF16(newpath)[0]
	return MoveFile(from, to)
}

func ComputerName() (name string, errno int) {
	var n uint32 = MAX_COMPUTERNAME_LENGTH + 1
	b := make([]uint16, n)
	e := GetComputerName(&b[0], &n)
	if e != 0 {
		return "", e
	}
	return string(utf16.Decode(b[0:n])), 0
}

func Ftruncate(fd Handle, length int64) (errno int) {
	curoffset, e := Seek(fd, 0, 1)
	if e != 0 {
		return e
	}
	defer Seek(fd, curoffset, 0)
	_, e = Seek(fd, length, 0)
	if e != 0 {
		return e
	}
	e = SetEndOfFile(fd)
	if e != 0 {
		return e
	}
	return 0
}

func Gettimeofday(tv *Timeval) (errno int) {
	var ft Filetime
	GetSystemTimeAsFileTime(&ft)
	*tv = NsecToTimeval(ft.Nanoseconds())
	return 0
}

func Sleep(nsec int64) (errno int) {
	sleep(uint32((nsec + 1e6 - 1) / 1e6)) // round up to milliseconds
	return 0
}

func Pipe(p []Handle) (errno int) {
	if len(p) != 2 {
		return EINVAL
	}
	var r, w Handle
	e := CreatePipe(&r, &w, makeInheritSa(), 0)
	if e != 0 {
		return e
	}
	p[0] = r
	p[1] = w
	return 0
}

func Utimes(path string, tv []Timeval) (errno int) {
	if len(tv) != 2 {
		return EINVAL
	}
	h, e := CreateFile(StringToUTF16Ptr(path),
		FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil,
		OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
	if e != 0 {
		return e
	}
	defer Close(h)
	a := NsecToFiletime(tv[0].Nanoseconds())
	w := NsecToFiletime(tv[1].Nanoseconds())
	return SetFileTime(h, nil, &a, &w)
}

func Fsync(fd Handle) (errno int) {
	return FlushFileBuffers(fd)
}

func Chmod(path string, mode uint32) (errno int) {
	if mode == 0 {
		return EINVAL
	}
	p := StringToUTF16Ptr(path)
	attrs, e := GetFileAttributes(p)
	if e != 0 {
		return e
	}
	if mode&S_IWRITE != 0 {
		attrs &^= FILE_ATTRIBUTE_READONLY
	} else {
		attrs |= FILE_ATTRIBUTE_READONLY
	}
	return SetFileAttributes(p, attrs)
}

// net api calls

//sys	WSAStartup(verreq uint32, data *WSAData) (sockerrno int) = wsock32.WSAStartup
//sys	WSACleanup() (errno int) [failretval==-1] = wsock32.WSACleanup
//sys	WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (errno int) [failretval==-1] = ws2_32.WSAIoctl
//sys	socket(af int32, typ int32, protocol int32) (handle Handle, errno int) [failretval==InvalidHandle] = wsock32.socket
//sys	setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (errno int) [failretval==-1] = wsock32.setsockopt
//sys	bind(s Handle, name uintptr, namelen int32) (errno int) [failretval==-1] = wsock32.bind
//sys	connect(s Handle, name uintptr, namelen int32) (errno int) [failretval==-1] = wsock32.connect
//sys	getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (errno int) [failretval==-1] = wsock32.getsockname
//sys	getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (errno int) [failretval==-1] = wsock32.getpeername
//sys	listen(s Handle, backlog int32) (errno int) [failretval==-1] = wsock32.listen
//sys	shutdown(s Handle, how int32) (errno int) [failretval==-1] = wsock32.shutdown
//sys	Closesocket(s Handle) (errno int) [failretval==-1] = wsock32.closesocket
//sys	AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (errno int) = wsock32.AcceptEx
//sys	GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) = wsock32.GetAcceptExSockaddrs
//sys	WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (errno int) [failretval==-1] = ws2_32.WSARecv
//sys	WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (errno int) [failretval==-1] = ws2_32.WSASend
//sys	WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32,  from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (errno int) [failretval==-1] = ws2_32.WSARecvFrom
//sys	WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32,  overlapped *Overlapped, croutine *byte) (errno int) [failretval==-1] = ws2_32.WSASendTo
//sys	GetHostByName(name string) (h *Hostent, errno int) [failretval==nil] = ws2_32.gethostbyname
//sys	GetServByName(name string, proto string) (s *Servent, errno int) [failretval==nil] = ws2_32.getservbyname
//sys	Ntohs(netshort uint16) (u uint16) = ws2_32.ntohs
//sys	DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status uint32) = dnsapi.DnsQuery_W
//sys	DnsRecordListFree(rl *DNSRecord, freetype uint32) = dnsapi.DnsRecordListFree
//sys	GetIfEntry(pIfRow *MibIfRow) (errcode int) = iphlpapi.GetIfEntry
//sys	GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode int) = iphlpapi.GetAdaptersInfo

// For testing: clients can set this flag to force
// creation of IPv6 sockets to return EAFNOSUPPORT.
var SocketDisableIPv6 bool

type RawSockaddrInet4 struct {
	Family uint16
	Port   uint16
	Addr   [4]byte /* in_addr */
	Zero   [8]uint8
}

type RawSockaddr struct {
	Family uint16
	Data   [14]int8
}

type RawSockaddrAny struct {
	Addr RawSockaddr
	Pad  [96]int8
}

type Sockaddr interface {
	sockaddr() (ptr uintptr, len int32, errno int) // lowercase; only we can define Sockaddrs
}

type SockaddrInet4 struct {
	Port int
	Addr [4]byte
	raw  RawSockaddrInet4
}

func (sa *SockaddrInet4) sockaddr() (uintptr, int32, int) {
	if sa.Port < 0 || sa.Port > 0xFFFF {
		return 0, 0, EINVAL
	}
	sa.raw.Family = AF_INET
	p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))
	p[0] = byte(sa.Port >> 8)
	p[1] = byte(sa.Port)
	for i := 0; i < len(sa.Addr); i++ {
		sa.raw.Addr[i] = sa.Addr[i]
	}
	return uintptr(unsafe.Pointer(&sa.raw)), int32(unsafe.Sizeof(sa.raw)), 0
}

type SockaddrInet6 struct {
	Port   int
	ZoneId uint32
	Addr   [16]byte
}

func (sa *SockaddrInet6) sockaddr() (uintptr, int32, int) {
	// TODO(brainman): implement SockaddrInet6.sockaddr()
	return 0, 0, EWINDOWS
}

type SockaddrUnix struct {
	Name string
}

func (sa *SockaddrUnix) sockaddr() (uintptr, int32, int) {
	// TODO(brainman): implement SockaddrUnix.sockaddr()
	return 0, 0, EWINDOWS
}

func (rsa *RawSockaddrAny) Sockaddr() (Sockaddr, int) {
	switch rsa.Addr.Family {
	case AF_UNIX:
		return nil, EWINDOWS

	case AF_INET:
		pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
		sa := new(SockaddrInet4)
		p := (*[2]byte)(unsafe.Pointer(&pp.Port))
		sa.Port = int(p[0])<<8 + int(p[1])
		for i := 0; i < len(sa.Addr); i++ {
			sa.Addr[i] = pp.Addr[i]
		}
		return sa, 0

	case AF_INET6:
		return nil, EWINDOWS
	}
	return nil, EAFNOSUPPORT
}

func Socket(domain, typ, proto int) (fd Handle, errno int) {
	if domain == AF_INET6 && SocketDisableIPv6 {
		return InvalidHandle, EAFNOSUPPORT
	}
	h, e := socket(int32(domain), int32(typ), int32(proto))
	return h, int(e)
}

func SetsockoptInt(fd Handle, level, opt int, value int) (errno int) {
	v := int32(value)
	return int(setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&v)), int32(unsafe.Sizeof(v))))
}

func Bind(fd Handle, sa Sockaddr) (errno int) {
	ptr, n, err := sa.sockaddr()
	if err != 0 {
		return err
	}
	return bind(fd, ptr, n)
}

func Connect(fd Handle, sa Sockaddr) (errno int) {
	ptr, n, err := sa.sockaddr()
	if err != 0 {
		return err
	}
	return connect(fd, ptr, n)
}

func Getsockname(fd Handle) (sa Sockaddr, errno int) {
	var rsa RawSockaddrAny
	l := int32(unsafe.Sizeof(rsa))
	if errno = getsockname(fd, &rsa, &l); errno != 0 {
		return
	}
	return rsa.Sockaddr()
}

func Getpeername(fd Handle) (sa Sockaddr, errno int) {
	var rsa RawSockaddrAny
	l := int32(unsafe.Sizeof(rsa))
	if errno = getpeername(fd, &rsa, &l); errno != 0 {
		return
	}
	return rsa.Sockaddr()
}

func Listen(s Handle, n int) (errno int) {
	return int(listen(s, int32(n)))
}

func Shutdown(fd Handle, how int) (errno int) {
	return int(shutdown(fd, int32(how)))
}

func WSASendto(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to Sockaddr, overlapped *Overlapped, croutine *byte) (errno int) {
	rsa, l, err := to.sockaddr()
	if err != 0 {
		return err
	}
	errno = WSASendTo(s, bufs, bufcnt, sent, flags, (*RawSockaddrAny)(unsafe.Pointer(rsa)), l, overlapped, croutine)
	return
}

// Invented structures to support what package os expects.
type Rusage struct{}

type WaitStatus struct {
	Status   uint32
	ExitCode uint32
}

func (w WaitStatus) Exited() bool { return true }

func (w WaitStatus) ExitStatus() int { return int(w.ExitCode) }

func (w WaitStatus) Signal() int { return -1 }

func (w WaitStatus) CoreDump() bool { return false }

func (w WaitStatus) Stopped() bool { return false }

func (w WaitStatus) Continued() bool { return false }

func (w WaitStatus) StopSignal() int { return -1 }

func (w WaitStatus) Signaled() bool { return false }

func (w WaitStatus) TrapCause() int { return -1 }

// TODO(brainman): fix all needed for net

func Accept(fd Handle) (nfd Handle, sa Sockaddr, errno int) { return 0, nil, EWINDOWS }
func Recvfrom(fd Handle, p []byte, flags int) (n int, from Sockaddr, errno int) {
	return 0, nil, EWINDOWS
}
func Sendto(fd Handle, p []byte, flags int, to Sockaddr) (errno int)       { return EWINDOWS }
func SetsockoptTimeval(fd Handle, level, opt int, tv *Timeval) (errno int) { return EWINDOWS }

type Linger struct {
	Onoff  int32
	Linger int32
}

const (
	IP_ADD_MEMBERSHIP = iota
	IP_DROP_MEMBERSHIP
)

type IPMreq struct {
	Multiaddr [4]byte /* in_addr */
	Interface [4]byte /* in_addr */
}

type IPv6Mreq struct {
	Multiaddr [16]byte /* in6_addr */
	Interface uint32
}

func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (errno int)        { return EWINDOWS }
func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (errno int)     { return EWINDOWS }
func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (errno int) { return EWINDOWS }
func BindToDevice(fd Handle, device string) (errno int)                        { return EWINDOWS }

// TODO(brainman): fix all needed for os

func Getpid() (pid int)   { return -1 }
func Getppid() (ppid int) { return -1 }

func Fchdir(fd Handle) (errno int)                        { return EWINDOWS }
func Link(oldpath, newpath string) (errno int)            { return EWINDOWS }
func Symlink(path, link string) (errno int)               { return EWINDOWS }
func Readlink(path string, buf []byte) (n int, errno int) { return 0, EWINDOWS }

func Fchmod(fd Handle, mode uint32) (errno int)        { return EWINDOWS }
func Chown(path string, uid int, gid int) (errno int)  { return EWINDOWS }
func Lchown(path string, uid int, gid int) (errno int) { return EWINDOWS }
func Fchown(fd Handle, uid int, gid int) (errno int)   { return EWINDOWS }

func Getuid() (uid int)                  { return -1 }
func Geteuid() (euid int)                { return -1 }
func Getgid() (gid int)                  { return -1 }
func Getegid() (egid int)                { return -1 }
func Getgroups() (gids []int, errno int) { return nil, EWINDOWS }

// TODO(brainman): fix all this meaningless code, it is here to compile exec.go

func read(fd Handle, buf *byte, nbuf int) (n int, errno int) {
	return 0, EWINDOWS
}

func fcntl(fd Handle, cmd, arg int) (val int, errno int) {
	return 0, EWINDOWS
}

const (
	PTRACE_TRACEME = 1 + iota
	WNOHANG
	WSTOPPED
	WUNTRACED
	SYS_CLOSE
	SYS_WRITE
	SYS_EXIT
	SYS_READ
)


Weather is controlled by a variety of factors. One of the most important is Earth's air masses. Air masses are huge parcels of air with specific characteristics. What's interesting about the characteristics of an air mass is that, not only do they describe the air mass, but they also tell you where you can find that air mass on Earth.
Let's look at the different types of air masses found on Earth to see how this works. Air masses can be divided into two main categories based on whether they are found over land or water. If the air mass is found over land, this is a continental air mass. If the air mass is found over water, this is a maritime air mass. This makes sense: continental air masses occur over the continents, maritime air masses occur over the water, or marine environments. These categories are represented by a lowercase 'c' for continental or 'm' for maritime.
The source region of the air mass helps us classify it even further, and for this, we have three categories. Arctic air masses occur over arctic regions, like Greenland and Antarctica. Polar air masses occur a little bit farther from the poles, like in Siberia, Canada and the northern Atlantic and Pacific Oceans.
Finally, tropical air masses occur in the tropics, so along the equator and over Mexico and the Southwest U.S. Makes sense, right? These categories are represented by the first letter of the source region, but this time we use an uppercase letter. So, 'A' stands for arctic, 'P' for polar and 'T' for tropical. That's pretty easy to remember!
Each source region can also be either continental or maritime, and to represent this, we simply combine the category letters. This gives us six total types of air masses on Earth: maritime arctic (mA), maritime polar (mP), maritime tropical (mT); and continental arctic (cA), continental polar (cP) and continental tropical (cT).
You can understand a lot about weather from air masses just by looking at the name. Maritime air masses are going to produce moist weather because they occur over oceans, and oceans are filled with water! The air blowing over the ocean regions, either arctic, polar or tropical, picks up that moisture as it travels along. In maritime arctic and polar regions, this moist air is cool (as you probably expected), and the maritime tropical air mass produces the warm, humid conditions you would expect along the tropics, like Florida and the Caribbean.
In contrast, continental air masses produce dry weather. This is because the continents just can't compete with the oceans when it comes to moisture! The continental arctic and polar air masses produce dry, cold weather in the winter and pleasant weather conditions in the summer.
If you've ever been to the Northeast U.S., you know what this weather is like. If you can make it through the bitter, dry winter, you get heavily rewarded with a wonderfully cool and beautiful summer! Continental tropical air masses produce hot, dry conditions like you see in the Southwest U.S. and Mexico.
Just because air masses are found over a region of Earth doesn't mean that they stay put. In fact, they can move both horizontally and vertically! When air masses move, we can have some drastic changes in weather.
One way that air can move vertically is through convectional lifting. Convection is the cyclical process of warm air rising and cool air sinking. This happens because, just like your black t-shirt absorbs sunlight better than your white t-shirt, some spots on Earth absorb solar radiation better than others. When air comes in contact with these unusually warm spots, it heats up and rises. As it rises, it expands and cools and then sinks back down to the ground. Thus, we have the convection cycle.
If there is moisture in the air, it creates a cumulus cloud when it rises. These are the big, fluffy clouds you can identify different shapes and objects in. As the air sinks, the cloud dissipates, which is what creates all that empty sky between cumulus clouds. Think about it - you usually see a bunch of cumulus clouds in the same area, but not one large, continuous one.
The cloud is where the air is rising and releasing moisture. The space in between is where it's sinking back down to the ground. Each cloud is a convection cycle! If a cumulus cloud grows tall enough, it can turn into a thunderstorm cloud. So, you can see that convectional lifting has the power to change the weather - just by air rising or falling in the same place.
Another way that air masses affect weather is when the air is lifted up over an obstacle, like a mountain. This type of lifting is called orographic lifting. Orographic lifting is responsible for the different weather conditions you see on opposite sides of a mountain. As the air rises up over the mountain, it cools and expands, and any moisture in the air is pushed out.
You now know that this forms a cloud, and if there's enough moisture, the cloud may produce rain. The rain occurs on the windward side of a mountain because this is the side the wind is traveling up. The leeward side of the mountain is the opposite. The air falling back down is dry because it left all its water in the cloud on the other side!
Finally, when air masses meet, they create fronts. Fronts are the contact zone between two different air masses. They may differ in pressure, temperature, density and moisture, but usually it's a combination of all these factors. Air masses are like people with differing opinions - one may eventually win over the other, but the disagreement itself creates storms and changes along the zone of contact as the air masses fight it out.
Air masses are large parcels of air with distinct characteristics, and they occur all over Earth. They are classified based on where they're found. Continental air masses are found over land (like the continents), and maritime air masses are found over water (like marine environments). We can also classify air masses based on their source region: arctic, polar or tropical.
When these two classifications are put together, we get very specific descriptions of the type of air and weather that are produced. Continental air masses produce dry conditions, while maritime air masses produce wet conditions because they can draw water from the oceans they blow over. Similarly, you would probably expect arctic and polar air masses to be cold and tropical air masses to be hot. Put together, you can have dry, cool air (cA or cP); moist, cool air (mA or mP); dry, warm air (cT); or moist, warm air (mT).
Air masses are not stationary, and their movement affects weather. When air masses experience convectional lifting, or the rising of warm air and sinking of cool air, we get cumulus clouds. If they grow large enough, cumulus clouds can turn into thunderstorm clouds and produce some pretty intense storms.
Orographic lifting is when an air mass is lifted over an obstacle, usually something like a mountain. The warm air is lifted, and as it rises, it cools and expands. The water in the air creates a cloud and rain over the windward side of the mountain (where the wind initially blows up) and dry conditions on the leeward side.
Fronts occur where two different air masses meet. The type of front depends on which air mass is advancing onto the other. Along the zone of contact, we get changes in weather, such as storms, rain and clouds. Fronts are very much like a disagreement between two people with opposing viewpoints. One may eventually win over the other, but the argument itself can create some serious friction between the two!


Interested in Department of Management Science and Information Systems? Admissions officers are waiting to hear from you!
Oklahoma State University / Department of Management Science and Information Systems is located in Stillwater, OK.


« EasyAnt's website migration !
The output is interesting. Ant scans and lists quite a few helpful setup and environment bits, including the ant version, Ant libraries, a number of system properties etc. Such information is quite helpful when troubleshooting setup or environment issues. But – what if problems being faced are actually problems with the scripts themselves?
Would debugging be more useful in such cases? So there is an effort to build a debugger, that can be driven from the command line itself.
The debugger is built into a separate jar, that you can add to the Ant classpath (use the -lib argument). The debugger library essentially contains a simple build listener that pauses build execution at breakpoints, that you can specify through a debug prompt (that you get when you run the build with the debug listener). There are a list of debug commands that you can issue from this prompt and inspect the state of your build.
An initial POC is in place and can be found here: https://svn.apache.org/repos/asf/incubator/easyant/tasks/trunk/command-line-debugger. You should find a README file at this location with instructions on how to try it out. Currently, it does not have any step through functionality. The build may be paused – you may inspect as much as you wish, and you can then resume the build.
While there are Ant debuggers in IDEs (I dont have much personal experience using them), hopefully this one will help some command line users.
Apache EasyAnt 0.9-incubating released !


We believe you deserve to shop in a relaxed, inviting environment where every question can be answered, and every need satisfied.
That's why we offer a unique appointment only model. This enables our experienced diamond experts to work with you, one-on-one, in a casual, comfortable setting.
We're dedicated to helping you find the right piece at the right price. We'll provide you with detailed information, and present numerous high-quality pieces for you to review at your own pace.
At Washington Diamond, we value privacy, integrity, and attentiveness - and when you schedule your appointment with one of our diamond experts, that's precisely what you will receive.


Yogurt is made using fermented milk created by the lactic acid bacteria, which often is lactobacillus bulgarius and Streptococcus thermophilus.
To make sure that yogurt is safe to eat, the milk is heat treated, homogenized and then cooled. As the milk cools, a bacteria or starter culture is added. If the right temperature and moisture are provided, the fermented milk produces lactic acid. After which the milk ferments and sets to form yogurt. As the milk ferments, it forms a colorless liquid, called acetaldehyde, which gives yogurt its distinctive taste.
To form yogurt, manufacturers use different types of milk from skimmed, semi-skimmed, whole, evaporated or powdered forms.
Apart from these varieties, yogurt now comes in a variety of textures from smooth to set and luxury to fat-free. Manufacturers have also added flavors like natural, fruit, cereal and created frozen yogurt cups, which compete with ice cream on the supermarket shelves.
There are also other fermenting yogurts with different microorganisms, that provide good bacteria for your gut. These include live yogurts, which have live harmless bacteria and probiotic yogurts, which contain live probiotic microorganisms.
Scientists now say that yogurt is a great way to include calcium and maintain a healthy weight. In addition, yogurt's bacteria can help to ease stomach indigestion and to promote a healthy digestive tract. Therefore, pick up a white paper cup of this healthy, tasty, super food and make it part of your daily meal plan.
Gelato Products has everything you need for your ice cream parlor, including frozen yogurt cups and other ice cream shop supplies.
Recently, Pierre Zarokian of Submit Express sat down with DealCrunch writer Sean Garrity to look at some of the big trends coming to Internet marketing in 2017. Since 1998, Submit Express has helped thousands of businesses improve their reputation and search engine rankings online.
In this brief guide, you'll learn which trends will bring the biggest impact to your efforts throughout the new year.
The importance of reviews cannot be understated. Reviews directly affect your search engine standing, and have a huge impact on what potential customers think about you before they come to your store. Restaurants and retailers stand to gain the most from having a positive review score in Google, but really anyone benefits.
Zarokian's approach is twofold: monitor reviews, looking for (and addressing) negatives and promoting positives, while creating your own feedback loop. This way, you control the flow of information on your Yelp page, and you're better equipped to handle challenges as they occur. Customers will think it's better to use your system since the feedback goes directly to you.
Submit Express also utilizes SEO, but it doesn't just mean search anymore. Zarokian's team performs a full site audit, updates your content and then performs offsite work to help improve your site's standing in search. This can include pitching to unique blogs to host content about you, or working on social media to improve your follower count.
Mobile optimization is another important component to 2017, as more and more of your customers switch to mobile devices to find stores in their local area.
Local search, and local businesses, can gain a lot in 2017. If you're savvy, and you can stay on top of Google's changes, you can improve your ranking and get better reviews.


dissection done by Dr.G.V.S Rau at hands on 52nd cadaver temporal bone dissection workshop in 2009. Dr.G.V.S Rau is a renowned otologist in India with experience of more than 25years. he has done thousands of ear surgeries during this period and even holds a record on his name. he specialises in facial nerve decompression and work on cochlea and vestibule./nvisit www.raosentcare.com. also write to [email protected] if u r interested in attending future hands on workshops.


text:
class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  protected

  def pdf_with_redirect
    redirect_to to_path url: Learn::Pdf.print(url_for params.merge format: :html)
  end
end

redpajama_set_name: RedPajamaGithub


Ruled by the despotic Darkseid, Apokolips is a fascist wasteland of ugly machinery and fire pits. A psychic vampire that feeds on despair, Darkseid put his people to work building weapons of war and giant statues honoring their master. Despite his "achievements," Darkseid is still vexed by the presence of New Genesis, and will not rest until it is crushed under his heel.
Darkseid's right hand and chief torturer, the sadistic Desaad was once his friend as well. That friendship ended, however, when Desaad poisoned Suli, Darkseid's beloved wife. Frequently obliterated by his Omega Beams, Darkseid keeps restoring Desaad to life in order to take advantage of his technological and tactical knowledge.
It is worth noting that, while Rene Auberjonois replaces Robert Morse (who voiced Desaad in the Superman episode Father's Day), he is also reprising the role that he originally played on Superfriends.
Appointed to the position of general by his nephew Darksied, Steppenwolf leads the military forces of Apokolips during their bloody campaigns.
I am many things, Kal-El, but here I am God.
The return of Darkseid necessitates the presence of his main agents as well. They are pretty much as they were in Superman, with minor exceptions (Rene Auberjonois replacing Robert Morse as the voice of Desaad, Corey Burton filling in for Sherman Howard as the voice of Steppenwolf). Finally, those concerned about the fates of Desaad and Steppenwolf can rest easy: Darkseid can always resurrect them with his Omega Beams should he need them again.
Images courtesy of Toon Zone and the New Batman/Superman Adventures Homepage.


In the field of Sports and Games our vidyalaya students have been selected for various events in the Nationals and School Games Federation of India.
01. Master. Ravindra P.N. of Class-XI who has topper in Class X by securing 97% for the year 2006-07 has been selected to visit Japan under JENESYS programme.
02. Master. H. Aravind of Class-XI (2007-08) selected for Dakshana Foundation Scholars Division who is imparting IIT coaching classes at JNV Bangalore Urban District.


text:
The Inglorius Padre Steve's World
Aircraft & Air Power
Baseball & Life
Padre Steve's Music
PTSD, Moral Injury & Mental Illness
Shipmates, Veterans & Friends
The Church of Baseball
TLC Book Tour Reviews
Warship & Naval Battles
Weimar & Nazi Germany
Welcome to my World & a Disclaimer
WWII in Europe
WWII in the Pacific
Tag Archives: william bainbridge
February 16, 2018 · 00:02
"The Most Bold and Daring Act of the Age" Stephen Decatur and the Defeat of the Barbary Pirates
Friends of Padre Steve's World,
Anyone who has followed my writings on this site knows that I love Naval history, especially that of the United States Navy. It was one of those subjects that I began reading about in grade school. Since I grew up as a Navy brat it is unsurprising that even after a detour of seventeen and a half years in the Army that I ended up in the Navy.
In 1803 the still very young United States Navy was two years into its campaign against the Barbary Pirates who sailed from Algiers, Tunis, Tripoli and Morocco. The Navy, which had been disestablished after the Revolution was reestablished by Congress to protect American merchant sailors who were constantly being accosted by British, French, and Barbary ships, on March 27th 1793.
For years the United States like other nations had paid tribute to the rulers of the Rulers of the Barbary states for free passage of its ships in the Mediterranean, as well as hefty ransoms to free the sailors that were enslaved following the capture of their ships. By 1800 tens of millions of dollars had been paid and in that year the amount of tribute paid was 20% of the government's total revenue.
In 1801 the Pasha of Tripoli, Yusuf Karamanli demanded the payment of $225,000 tribute from the new President of the United States President Thomas Jefferson. In years past Jefferson had advised against payment of tribute believing that such payment only encouraged the Barbary States to continue their actions as he had when the French demanded similar tribute in 1797. The anti-naval partisans and even his Republican allies had blocked his recommendations even though Secretary of State John Jay and President John Adams agreed with him.
These partisans insisted that tribute be paid irregardless of the effect on European trade or the fate of American seamen because they believed that the Atlantic trade and involvement in the "Old World" detracted from the westward expansion by diverting money and energy away from the west. When Jefferson refused to pay tribute, Karmanli declared war on the United States by cutting down the flag at the US Consulate in Tripoli.
Jefferson sent a Naval small force to defend protect American ships and sailors and asked Congress to authorize him to do more as he did not believe that he had the Constitutional power to do more without Congressional approval. Despite the fact that Tripoli had declared war on the United States, Congress did not issue a declaration of war, but instead authorized Jefferson to "employ such of the armed vessels of the United States as may be judged requisite… for protecting effectually the commerce and seamen thereof on the Atlantic Ocean, the Mediterranean and adjoining seas."
Jefferson sent the best of the United States Navy to deal with the situation and US Navy ships soon began to take a toll on the pirate vessels. The squadron was composed of ships and commanded by officers that would become legend in the history of the Navy. Commanded by Commodore Edward Preble and included the Brig USS Argus, the Frigates USS Chesapeake, Constellation, Constitution, Enterprise, Philadelphia, Schooner Enterprise and Brig Syren. Numerous young officers who would distinguish themselves in the following years served aboard the ships of the squadron.
One of the young officers was the 24 year old Captain of the 12 Gun Schooner USS Enterprise Stephen Decatur the son of a Navy Captain who had entered the Naval service as a Midshipman in 1798 and who had risen rapidly through the ranks due to his abilities and leadership. He was among the few officers selected to remain in service following the end of the Quasi-War with France. By the time that he took command of Enterprise Decatur had already served as the First Lieutenant of the Frigates USS Essex and USS New York. After an altercation with British officer while wintering in Malta he was sent home to command the new Brig of War USS Argus. He was ordered to bring her to Europe where he handed over command to Lieutenant Isaac Hull who would achieve fame in the War of 1812 as Commanding Officer of the USS Constitution. Decatur was given command of Enterprise on when he detached from the Argus.
On December 23rd 1803 while operating with the Constitution Decatur and the Enterprise captured the small Tripolitan ketch Mastico which was sailing under Turkish colors. The small ship was taken to Syracuse where Commodore Edward Preble condemned her as a prize of war, renamed her Intrepid and placed Decatur in command.
Normally such a transfer would be considered a demotion for an officer of Decatur's caliber; but events at Tripoli had forced Preble to make a bold strike at the heart of the enemy. On October 31st 1803 the Frigate USS Philadelphia one of the most powerful ships in the squadron, under the command of Captain William Bainbridge was lured into shoal water and ran aground on an uncharted shoal and was captured. Her crew was taken prisoner an imprisoned while the ship was floated off the reef by the Tripolitans. The ship was partially repaired and moored as a battery in the harbor. For the moment the powerful frigate was out of action until her foremast which had been cut down by Bainbridge in his unsuccessful attempt to float the ship off the shoal could be replaced.
Burning the Philadelphia
The threat posed by such a powerful ship in the hands of the enemy was too great to ignore. Preble ordered Decatur to man the Intrepid with volunteers and make a plan to destroy the Philadelphia while the ship was at anchor and unable to put to sea. Decatur took 80 men from the Enterprise and was joined by eight more volunteers from USS Syren including Lieutenant Thomas McDonough who had recently served aboard Philadelphia and knew the ship well. The Intrepid was re-rigged with the
Under the cover of night of February 16th 1804 Decatur took the former Tripolitan ship into the harbor beneath the dim light of the new moon. The ship was able to slip past the guns of the forts overlooking the harbor using an Arabic speaking Sicilian sailor to request permission to enter the harbor under the ruse that she was a merchant ship that had lost her anchors in a storm.
The request was granted the and Decatur sailed the Intrepid to bring her alongside the Philadelphia without Securing permission from the Tripitolan watch standers aboard Philadelphia to tie up alongside the frigate. When he drew alongside the massive ship Decatur ordered his crew to board the Frigate. After a brief skirmish with the small contingent of sailors aboard he took control, and after ensuring that the ship was unseaworthy, he and his sailors set the frigate ablaze. When he was sure that the fire could not be extinguished he ordered his men back aboard Intrepid and sailed out of the harbor under the fire of Tripolitan shore batteries and gunboats.
The mission complete Decatur sailed Intrepid back to Syracuse where he was greeted as a hero and became one of the Navy's legends. Pope Pius VII publicly proclaimed that "the United States, though in their infancy, had done more to humble the anti-Christian barbarians on the African coast, than all the European states had done for a long period of time." Admiral Horatio Nelson, one of the most heroic sailors that ever lived and no stranger to daring, said that Decatur's accomplishment was "the most bold and daring act of the Age."
Decatur leading American Sailors in hand to hand combat against Barbary Pirates at Tripoli 1804 his younger brother Lieutenant James Decatur was killed aboard another gunboat in the action
Decatur would return to command the Enterprise in 1804 and would prove himself again against the forces of Tripoli. He distinguished himself in the years to come against the Royal Navy in the War of 1812 and later in the Second Barbary War.
In that final Barbary war, Decatur's squadron decisively defeated the Algerian fleet capturing the Frigate Mashouda and killing the highly successful and chivalrous commander of the Algerian raiding squadron, Rais Hamidu.
Following the defeat of the Algerian fleet, the Pashas of Algiers, Tunis and Tripoli all made peace and reimbursed the Americans for the financial damage that they had done. His victory ended the terror that the Barbary States had inflicted on Europeans for centuries and helped bring peace to the Mediterranean. More than any one man Stephen Decatur was responsible for the end their reign of piracy and terror in the Mediterranean.
Padre Steve+
Filed under History, Military, national security, Navy Ships, US Navy
Tagged as algiers, barbary pirates, dey of algiers, edward preble, first barbary war, horatio nelson, john adams, john jay, malta, mashouda frigate, morocco, navy birthday, pasha of tripoli, pope pius vii, quasi-war with france, rais hamidu, second barbary war, stephen decatur, thomas jefferson, thomas macdonough, tripoli, tunis, united states navy, uss argus, uss chesapeake, uss constellation, uss constitution, uss enterprise sloop, uss essex frigate, uss intrepid ketch, uss new york frigate, uss philadelphia frigate, uss syren, william bainbridge, Yusuf Karamanli
October 12, 2013 · 23:43
A Global Force for Good: Happy 238th Birthday to the US Navy
http://www.navy.mil/viewVideo.asp?id=17676
"A good Navy is not a provocation to war. It is the surest guaranty of peace." Theodore Roosevelt
For me anything to do with the United States Navy is historical as well as decidedly personal. Sunday is the 238th anniversary of the founding of the United States Navy, actually the founding of the Continental Navy but let's not get too technical.
The fact is that back in 1775 most people and political leaders in the revolting colonies felt that founding a Navy was quite foolish. After all, who in their right mind would ever dare to challenge the might of the British Royal Navy? Even revolting colonies. But like when King George III was told that "the Colonies are revolting" he reportedly said "tell me something I don't know." But I digress…
In fact had General George Washington not sent a letter to the Continental Congress say that he had taken some vessels in hand to disrupt the supplies of the the British Army a Navy might not have ever been established. Timing is everything and in this case it was pretty good timing.
Since that fortuitous day in 1775 the United States Navy went from being a piss ant annoyance to the Royal Navy to the premier naval power in the world. Men like John Paul Jones, Edward Preble Stephen Decatur, Thomas Truxtun, William Bainbridge, Oliver Hazard Perry, David Farragut, David Dixon Porter, George Dewey and many more blazed a path of glory which others, great and small would continue to build on the legacy of the iron men who sailed wooden ships into harm's way. Men like Arleigh Burke, Howard Gilmore, John C. Waldron, Maxwell Leslie, Bull Halsey, Richard O'Kane, Daniel Callahan, Raymond Spruance, Ernest Evans built upon that legacy in the Second World War. Others would do so in the Cold War, Vietnam and the Global War on Terrorism.
Great ships like the USS Constitution, USS Monitor, USS Kerasarge, USS Olympia, USS Enterprise, USS Hornet, USS Yorktown, USS Growler, USS Tang, USS Hoel, USS Johnston, USS Samuel B Roberts, USS Laffey, USS San Francisco, USS Houston and USS Arizona, USS Nevada, USS West Virginia and USS California helped build a legacy of valiant sacrifice and service often at great cost in the defense of freedom.
But over those 238 years it all it came down to the men and now the men and women who served in every clime and place, many times outnumbered and facing certain defeat who through their courage, honor and commitment helped secure the liberty of their countrymen and others around the world. Most of these men and women served in obscurity in war and peace but all had the distinction of serving in the United States Navy.
As President John F Kennedy said: "I can imagine no more rewarding a career. And any man who may be asked in this century what he did to make his life worthwhile, I think can respond with a good deal of pride and satisfaction: 'I served in the United States Navy.'"
Like my father before me I can say that I am proud to have served and continue to serve in the United States Navy, because we are no matter what some may say or think, a global force for good.
Filed under History, Navy Ships, US Navy
Tagged as A Global Force for Good, Arleigh Burke, Bull Halsey, Daniel Callahan, David Dixon Porter, david farragut, Edward Preble Stephen Decatur, Ernest Evans, George Dewey, george washington, Howard Gilmore, John C. Waldron, john f kennedy, john paul jones, king george iii, Maxwell Leslie, oliver hazard perry, Raymond Spruance, Richard O'Kane, Thomas Truxtun, US Navy, uss california, uss constitution, uss enterprise, uss growler, uss hoel, uss hornet, USS Houston and USS Arizona, uss johnston, USS Kerasarge, uss laffey, uss monitor, USS Nevada, uss olympia, USS Samuel B Roberts, uss san francisco, USS Tang, uss west virginia, uss yorktown, william bainbridge
"The most bold and daring act of the age" Stephen Decatur and the Burning of the USS Philadelphia at Tripoli
"Our Country! In her intercourse with foreign nations may she always be in the right; but right or wrong, our country!" Stephen Decatur
This is the latest of a series of articles that I am writing this month in celebration of the brave men and proud ships of the United States Navy on its 236th Anniversary. Thursday October 13th is that day and I ask my readers to wish any United States Navy Sailor that you know a "Happy Birthday" and thank them for their service in this time of war.
In 1803 the United States Navy was two years into its campaign against the Barbary Pirates who sailed from Algiers, Tunis, Tripoli and Morocco. For years the United States like other nations had paid tribute to the rulers of these states for free passage of its ships and hefty ransoms to free the sailors that were enslaved following the capture of their ships. By 1800 tens of millions of dollars had been paid and in that year the amount of tribute paid was 20% of the government's total revenue.
In 1801 the Pasha of Tripoli Yusuf Karamanli demanded the payment of $225,000 tribute from the new President of the United States President Thomas Jefferson. In years past Jefferson had advised against payment of tribute believing that such payment only encouraged the Barbary States to continue their actions. The anti-naval partisans and even his Republican allies had blocked his recommendations even though Secretary of State John Jay and President John Adams agreed with him. These partisans insisted that tribute be paid irregardless of the effect on European trade or the fate of American seamen because they believed that the Atlantic trade and involvement in the "Old World" detracted from the westward expansion by diverting money and energy away from the west. When Jefferson refused the demand and put his beliefs into practice Karmanli declared war on the United States by cutting down the flag at the US Consulate in Tripoli.
Jefferson sent a small force to defend protect American ships and sailors and asked Congress to authorize him to do more as he did not believe that he had the Constitutional power to do more. Congress did not issue a declaration of war but authorized Jefferson to "employ such of the armed vessels of the United States as may be judged requisite… for protecting effectually the commerce and seamen thereof on the Atlantic Ocean, the Mediterranean and adjoining seas."
Jefferson sent the best of the United States Navy to deal with the situation and US Navy ships soon began to take a toll on the pirate vessels. The squadron was composed of ships that would become legend in the history of the Navy. Commanded by Commodore Edward Preble and included the USS Argus, Chesapeake, Constellation, Constitution, Enterprise, Intrepid, Philadelphia and Syren. Numerous young officers who would distinguish themselves in the following years served aboard the ships of the squadron.
On December 23rd 1803 while operating with the Constitution Decatur and the Enterprise captured the small Tripolian ketch Mastico which was sailing under Turkish colors. The small ship was taken to Syracuse where Commodore Edward Preble condemned her as a prize of war, renamed her Intrepid and placed Decatur in command.
Normally such an event would be considered a demotion for an officer of Decatur's caliber but events at Tripoli had forced Preble to make a bold strike at the heart of the enemy. On October 31st 1803 the Frigate USS Philadelphia one of the most powerful ships in the squadron under the command of Captain William Bainbridge ran aground on an uncharted shoal and was captured. Her crew was taken prisoner and the ship floated off by the Tripolians partially repaired and moored as a battery in the harbor until her foremast could be remounted having be cut away by Bainbridge in his unsuccessful attempt to float the ship off the shoal.
The threat posed by such a powerful ship in the hands of the enemy was too great to ignore. Preble order Decatur to man the Intrepid with volunteers to destroy the Philadelphia at anchor. Decatur took 80 men from the Enterprise and was joined by eight more volunteers from USS Syren including Lieutenant Thomas McDonough who had recently served aboard Philadelphia and knew the ship well.
Under the cover of night of February 16th 1804 Decatur took the former Tripolian ship into the harbor beneath the dim light of the new moon. Posing as a Tripolian ship he was able to slip past the guns of the forts overlooking the harbor using a Sicilian sailor who spoke Arabic to request permission. This was granted and Intrepid approached Philadelphia and when close enough ordered his crew to board the Frigate. After a brief skirmish with the small contingent of sailors aboard he took control of the vessel and set it ablaze. When he was sure that the fire could not be extinguished he ordered his men back aboard Intrepid and sailed out of the harbor under the fire of the shore batteries and gunboats.
Decatur sailed Intrepid back to Syracuse where he was greeted as a hero and became one of the Navy's legends. Pope Pius VII publicly proclaimed that "the United States, though in their infancy, had done more to humble the anti-Christian barbarians on the African coast, than all the European states had done for a long period of time." Admiral Lord Horatio Nelson, one of the most heroic sailors that ever lived and no stranger to daring said that Decatur's accomplishment was "the most bold and daring act of the Age."
Decatur would return to command the Enterprise in 1804 and would prove himself again against the forces of Tripoli. He distinguished himself in the years to come against the Royal Navy in the War of 1812 and later in the Second Barbary War. Decatur's squadron decisively defeated the Algerian fleet capturing the Frigate Mashouda and killing the highly successful and chivalrous commander of the Algerian raiding squadron Rais Hamidu. The Pashas of Algiers, Tunis and Tripoli all made peace and reimbursed the Americans for the financial damage that they had done. His victory ended the terror that the Barbary States had inflicted on Europeans for centuries and helped bring peace to the Mediterranean. Stephen Decatur more than any one man ended their reign of terror against Christian Europe.
Filed under History, leadership, Military, national security, Navy Ships, US Navy
Tagged as 236th navy birthday, algiers, barbary pirates, dey of algiers, edward preble, first barbary war, horatio nelson, john adams, john jay, malta, mashouda frigate, morocco, navy birthday, pasha of tripoli, pope pius vii, quasi-war with france, rais hamidu, second barbary war, stephen decatur, thomas jefferson, thomas macdonough, tripoli, tunis, united states navy, uss argus, uss chesapeake, uss constellation, uss constitution, uss enterprise sloop, uss essex frigate, uss intrepid ketch, uss new york frigate, uss philadelphia frigate, uss syren, william bainbridge, Yusuf Karamanli
October 5, 2011 · 23:59
1812: The Year of the Frigates
This is the second of a series of articles I will write commemorating the 236th anniversary of the founding of the United States Navy. This article discusses the actions of the USS Constitution and USS United States at the outbreak of hostilities in which they defeated three British Frigates in battles that are legend in the annals of Naval History. I grew up reading the stories of naval actions during the War of 1812 with rapt fascination. I could describe the battles, the ships and the brave Captains in detail even at a young age. I can close my eyes and see the paintings, drawings and the diagrams of the ships, their sailors and the battles that they fought. I guess that I was destined to end up in the Navy. But then how could I not? My birthday falls on March 27th, the anniversary of the founding of the current United States Navy.
On March 27th 1794 the Congress of the United States appropriated funds to establish a Navy built around six powerful Frigates, the 44 Gun USS Constitution, USS President and USS United States and the 38 Gun USS Congress, USS Constellation and USS Chesapeake. The 44 gun ships were larger and had a heavier armament than the majority of their British, French or Spanish counterparts. Although rated as 44 Guns they mounted 56 guns, 30 of which were the heavy 24 pound cannons and 22 were the short range but powerful 32 pound carronades. They were built of oaken timbers that were of the size used to build Ships of the Line in other navies. In comparison the standard Royal Navy Frigate of the day was the 38 gun ship mounting 18 pound cannons. The ships would serve during the Quasi-War withFrance from 1798-1800 and the First Barbary War from 1801-1805.
Chase of the Constitution
When the United Stateswent to war with Britainin 1812 neither side was well prepared. The British were deeply engaged in the Napoleonic Wars and the bulk of the Royal Navy was engaged in blockade operations against Franceand its allies on Europe's Atlanticand Mediterranean coasts. Deployed the Western Atlantic was a 64 Gun Ship of the Line HMS Africa 9 Frigates and assorted and about 75 smaller vessels. The United States Navy was minuscule even compared with the forces deployed by the Royal Navy to the Western Atlantic.
Captain Isaac Hull
When the Federalist administration of John Adams left office the Navy was on the ascendant. Built around a nucleus of 13 Frigates with six 74 gun Ships of the Line under construction the Navy was reduced to just 8 Frigates, most of which were laid up in dry dock at any given time. There was an anti-Navy sentiment in the Republican administrations of Thomas Jefferson and James Madison. The building program was ended and replaced with a program of gunboat construction. About 174 of these were built between 1805 and 1812 but only 62 were in service at the time of the war. They were particularly unsuited to engaging any substantial British ship as they were too lightly built and were poor sea boats with a light armament and it would take 40 gunboats to match the firepower of a single British Frigate. Likewise instead of being cheap to build and maintain the cost per gunboat came out to $10,000 each instead of the budgeted cost of $5000 and their cost to maintain one gunboat per year was more than that of a Frigate.
Captain Stephen Decatur
The reduction of the "blue water" Navy was a move of political ideology. Despite the obvious need to protect commerce as was displayed during the Quasi-War and the First Barbary War the Jefferson administrations was intent on a coastal defense strategy to which the gunboats were key. However it was poor naval policy because there was no way to determine where any actual British strike would take place and the dispersion of the gunboats meant that there would never be enough at any port to repel the Royal Navy.
Captain William Bainbridge
When war was declared the United States Navy comprised of just 8 Frigates and 14 smaller Sloops and Brigs and the worthless gunboats. Since the build program was stopped the Navy had no Ships of the Line. The Secretary of the Navy was an incompetent named Paul Hamilton and the Jeffersonian strategy of coastal defense was embraced by Albert Gallatin who recommended that all the Navy's large ships be turned into floating batteries for harbor defense.
USS Constitution vs. HMS Guerrière
The Navy was fortunate to have bold officers with the combat experience of the Quasi-War and the Barbary War under their belt. The ships had fine crews of well trained professional sailors who excelled at seamanship and gunnery. Taking advantage of the thinly stretched Royal Navy a squadron under Commodore John Rodgers was already at sea when the administration decided on the coastal defense strategy and forced the Royal Navy to divert many ships that could have decimated the merchant marine of the time allowing many American flagged ships to safely reach port with their cargo.
The USS Constitution under the command of Captain Isaac Hull sailed from Boston at the outbreak of hostilities and nearly met disaster when it ran into a Royal Navy squadron comprised of the HMS Africa and 5 Frigates. Becalmed Hull and his crew used every device known to escape in an epic 57 hour close quarter chase. He returned to Boston, replenished his stores and set sail again. On August 19th some 600 miles out of Boston Constitution came across the 38 Gun Frigate HMS Guerrière. The Captain of Guerrière was James Dacres who had a low opinion of the United States Navy. Hull directed the fire of his powerful 24 pounders into Guerrière shredding her rigging and smashing her hull. Two hours after the fight began Dacres struck Guerrière's colors. Guerrière was so badly damaged that she was burned and sunk with her crew taken back to Boston as prisoners. During the action a sailor aboard Constitution noted that Guerrière's shot was bouncing harmlessly off of the thick oaken sides of the ship. He is quoted as shouting "Huzza, her sides are made of iron," which provided the ship her nickname Old Ironsides. Constitution lost 7 men killed and 7 wounded in the battle while Guerrière lost 15 killed and 78 wounded of her 272 member crew.
USS United States vs. HMS Macedonian
The USS United States under the command of Captain Stephen Decatur found the 38 Gun HMS Macedonian under the command of Captain John S. Carden 600 miles west of the Canary Islands. The battle commenced at 0920 and firing from long range Decatur's gunners partially dismasted Macedonian leaving her hard to maneuver. Decatur then positioned United States on the quarter of Macedonian and pounded the helpless British ship into submission. Macedonian surrendered about 1200. Damage to the United States was light and 7 sailors were killed and 5 wounded. Macedonian lost over one-third of her 301 man crew killed or wounded. The Americans took over the British vessel and after temporary repairs at sea the United States and the newly christened USS Macedonian sailed for New York arriving on December 4th 1812. The ship would serve in the U.S. Navy until 1828 when she was broken up at Norfolk.
USS Constitution vs HMS Java
In late October 1812 the Constitution now under the command of Captain William Bainbridge sailed from Boston. This time she encountered the 38 Gun Frigate HMS Java under the command of Captain Richard Lambert off the coast of Brazil on December 29th 1812. Java was a fine ship with a well drilled crew and brave Captain and she was faster than Constitution. Though she was rated as 38 Guns she had 49 mounted making her a far tougher opponent than Guerrière or Macedonian. In addition to her own crew she had on board 100 additional sailors to reinforce ships inIndia. She was carrying Lieutenant General Thomas Hislop who was to command British forces inIndia, officers from his staff and several other high ranking Royal Navy officers enroot to commands inIndia.
The action commenced about 1410 and Lambert was able to maneuver across Constitution's stern 3 times shooting away her helm at 1430 and wounding Bainbridge. Constitution was able to close with Java and the ships became fouled which took away the advantage Java had temporarily acquired. Java had her bowsprit and jib boom shot away at 1500 and in the next 55 minutes Constitution dismasted Java with the exception of part of her mainmast which went over the side at 1620. The gallant Captain Lambert was mortally wounded at 1530 and command was assumed by Lieutenant Henry D. Chads. At 1725 Constitution took up a raking position and Lieutenant Chads after consulting with his surviving officers struck the colors. The battered Java was not salvageable and was burned and sunk the next day but not before Java's helm was salvaged and installed on Constitution. In an ironic twist Commodore Henry Chads in command of a British squadron at Singapore in 1845 provided medical assistance to Constitution when her crew suffered an outbreak of Dysentery and fevers during her around the world cruise.
Within the space of four months the Royal Navy lost three Frigates and forbade their Frigate Captains not to engage the American "Super-Frigates" one on one. Only Ships of the Line or squadrons would be allowed to engage the American ships.
Over the next two years the British tightened their blockade of American ports bottling up most of the Navy. The Navy lost two of the Super-Frigates to the British during the war, the 36 gun USS Chesapeake which was captured by HMS Shannon on June 1st 1813 and the USS President on January 15th 1815.
Neither was a fair fight, Chesapeake's Captain James Lawrence was new to the ship which had a new and poorly trained crew and Shannon was one of the most combat effective ships in the Royal Navy whose Captain was Philip Broke had been her skipper for 7 years and trained the crew into a well drilled machine. Lawrencewas mortally wounded but uttered the cry which immortalized him "Don't give up the ship, fight her until she sinks." Lawrence's friend Commodore Oliver Hazard Perry would name his flagship on Lake Erie the USS Lawrence and fly a flag that read "Don't give up the Ship." The USS President under the command of Stephen Decatur was lost after she was badly damaged in a winter gale and snowstorm when pilots navigated her onto a sand bar. Although Decatur was able to move the ship off the bar she was badly damaged and caught by a superior British squadron and captured.
The exploits of the small force of Frigates and smaller ships on the high seas and Perry's squadron onLake Erie proved to be the only real military successes of the war. But even more it was the three engagements in the closing months of 1812 that defined the spirit of the United States Navy for generations.
Filed under History, Military, Navy Ships, US Navy
Tagged as albert gallatin, battle of lake erie, don't give up the ship, federalist party, first barbary war, frigates, henry d chads, hms africa, hms guerriere, hms java, hms macedonian, hms shannon, isaac hull, james dacres, jefferson's gunboats, john rodgers, john s carden, oliver hazard perry, paul hamilton, philip broke, quasi-war with france, republican party, richard lambert, Royal Navy, ships of the line, stephen decatur, thomas jefferson, US Navy, uss chesapeake, uss congress, uss constellation, uss constitution, uss lawrence, uss macedonian, uss president, uss united states, war of 1812, william bainbridge
Friends of Padre Steve's World I welcome comments, even those which disagree with my positions and articles. I have done this for years, but recently I have been worn out by some people. I have just a couple of rules for comments. First, be respectful of me and other commentators. If you are even if I disagree with you your comment will be posted and I will respond accordingly. That being said I will not allow people to hijack the comment section to push their religious or ideological views. Unless the comment deals with the meat of the article, don't expect me to allow you to preach. Nor will I allow spam comments. Most of those are automatically blocked by Wordpress but some do get through. Peace Padre Steve+
Padre Steve's World Season Attendance
7,618,305 Manic Moderates
Subscribe to Padre Steve's World
Steven Dundas
The Astros Sign Stealing Scandal and the Importance of Baseball to American Life
"A Mind Ready to Stand Alone" Intellectual Freedom in the Age of Trump and After
The Continuum of History and Memory: The Example of the American Civil War Today
The Horror of Evil is that it Does Not Deviate from Human Norms: the Eternal Precedent of the Holocaust
Silent Witnesses of Evil Deeds… Are We Still of Any Use? Trump's Christian Advocates
Padre Steve's World on Facebook
The Unexplained and Tragic Death of David Wilkerson
Cheaters and the Baseball Hall of Fame: The Hypocrisy and Arrogance of the Baseball Writers of the BBWAA
Pearl Harbor, the Missing Carriers: USS Enterprise, USS Lexington and USS Saratoga
French Firepower Forward: The unrealized potential of the Dunkerque and Richelieu Class Battleships
The Vault: Padre Steve's Archives
armored fighting vehicles
Batlimore Orioles
counterinsurency in afghanistan
ecology and energy
economics and financial policy
enteratinment
ER's and Trauma
hampton roads and tidewater
iraq,afghanistan
Korean Conflicts
Lies of World Net Daily
Loose thoughts and musings
pro-life anti-abortion
purely humorous
remembering friends
shipmates and veterans
sports and life
state government agencies
televsion
things I don't get
to iraq and back
Tour in Iraq
traumatic national events
US Army Air Corps
Veterans and friends
World War II at Sea
world war two in europe
world war two in the pacific
ALL ARTICLES THAT I POST ON THIS SITE REFLECT MY PERSONAL VIEWS, OR IF I POST ANOTHER WRITER'S WORK ARE VIEWS THAT I FIND INTERESTING OR INFORMATIVE. LINKS TO OTHER SITES ARE PROVIDED BECAUSE I FIND THEM INTERESTING, INFORMATIVE, INSPIRATIONAL, FUNNY, OR BECAUSE I KNOW THE AUTHORS, AND NOT BECAUSE THEY REFLECT MY VIEWS OR BECAUSE I NECESSARILY AGREE WITH THEM, ALTHOUGH THERE ARE SOME THAT I DO AGREE WITH, THOUGH HALF THE TIME I CAN'T REMEMBER WHICH ONES THAT I OR AGREE OR DISAGREE.
THE VIEWS EXPRESSED BY ME ON THIS SITE DO NOT REFLECT THE VIEWS OF ORGANIZATIONS TO WHICH I BELONG NOW OR THAT I EVER IN MY LIFE HAVE BELONGED; INCLUDING THE UNITED STATES GOVERNMENT, THE DEPARTMENT OF DEFENSE, THE UNITED STATES NAVY, THE JOINT FORCES STAFF COLLEGE, THE APOSTOLIC CATHOLIC ORTHODOX CHURCH, MY WIFE JUDY, MY DOGS, MY MOM, MY DRINKING BUDDIES, OR ANY OTHER GROUP THAT I BELONG TO, PAST AND PRESENT, INCLUDING COLLEGE AND HIGH SCHOOL ALUMNI ASSOCIATIONS, SPORTS FAN CLUBS, OR FACEBOOK GROUPS. SUCH EXTENDS TO ANY TRACE OF MYSELF IN THIS UNIVERSE, PAST LIVES, OR IN PARALLEL/ ALTERNATE UNIVERSES.
ANY REBROADCAST, RETRANSMISSION, REBROADCAST , OR ACCOUNT OF THIS BLOG, WITHOUT THE EXPRESS WRITTEN CONSENT OF MAJOR LEAGUE BASEBALL, IS PROHIBITED.
OKAY, THAT LAST SECTION WAS A JOKE. BUT THE REST IS IS TRUE.
A Tangled Mass of Musings
Baseball Batlimore Orioles christian life civil rights civil war ethics faith film Foreign Policy Gettysburg History holocaust iraq,afghanistan laws and legislation leadership Loose thoughts and musings middle east Military national security Navy Ships nazi germany News and current events philosophy Political Commentary PTSD Religion Tour in Iraq US Navy world war two in europe world war two in the pacific
Padre Steve'sTweets
RT @JoeKoffee: Very good. @burningcrusade7 @LindaCollins11 @RenZelen @andreafed @zaswadosaze @therealzanetta @tspj22 @Kalaax008 @havewhatus… 5 hours ago
My latest, please read. Though not directly related to politics and Trump, it explains a lot about our culture. Tha… twitter.com/i/web/status/1… 22 hours ago
The Astros Sign Stealing Scandal and the Importance of Baseball to American Life padresteve.com/2020/01/16/the… 22 hours ago
@Stonekettle Me too 1 day ago
@DavidCornDC Maybe she didn't "know" him in the Biblical sense of the word, but she did know him. 1 day ago
Bus Leagues Baseball
Dodgers-Giants: Baseball's greatest Rivalry
Negro Leagues Baseball Hall of Fame
Norfolk Tides Baseball Club
The Baseball Cube
A Frank Angle
Abbey Normal Abbess's Blog
Atheistic in Alabama
Blog Maverick
Over the Hedge Blog
padredavid's blog
Pearls Before Swine: The Website of Stephan Pastis
Rob Akers Blog
Saepe Nihil Cogitamus
Sean Munger
Stephan Pastis Pearls Before Swine Blog
The Dixie Flatline
The Groovy Historian
The Herald Dispatch
The Militant Negro
Translate this page with Google Translator
Windy City Wonderer
Father Andrew Greeley's Website
Mercy Not Sacrifice: The Blog of Morgan Guyton
Patheos Blog
Red Letter Christianity
Religion News Blog
Sarah Posner on Religion Dispatches
Sojouners
The Apostolic Catholic Orthodox Church
The Christian Left
The Gospel According to Hate
The Official Website of Frank Schaffer
To Stir a Movement: Christian Social Justice: The Blog of Jeremy Affeldt
Touchstone Magazine
Unsettled Christianity
Army Historical Foundation
Naval History and Heritage Command
Navsource Photo Index
Southern Campaign in NC
US Naval Institute
9 Chickweed Lane
Daily Fun Lists
Dilbert Classics
Doonesbury Comic
Get Fuzzy
The Farting Preacher
The Grizzwells Comic
The Other Coast Comic
The Shameful Chaplain
Local News and Weather
Jacksonville (NC) Daily News
KCRA (Sacramento Stockton)
Virginia Pilot
WAVY TV 10 (Portsmouth, Norfolk VA)
Weather bug for Virginia Beach
Armed Forces News Service
Iraq and Afghanistan Veterans of America
John Ismay
Ship Bucket
The United States Navy
Padre Steve on the Daily Kos
Padre Steve's Facebook Page
Padre Steve's Photo of the Day
Padre Steve's View from 102
NBC News (MSNBC)
SF Gate (San Francisco Chronicle)
Compare Stances
Hardball Chris Matthews
Huffington Post Politics
John Fugelsang's Official Website
Lincoln Walks at Midnight
Rachel Maddow Show
That's So Takei: The Blog of George Takei
The Last Word Lawrence O'Donnell
The Lipstick Liberal Show
The Stephanie Miller Show
National Center on PTSD
National Intrepid Center of Excellence
Real Warriors
Der Spiegel English
Kyodo News (Japan)
Reuters World News
Sidney Morning Herald (Australia)
The Guardian (UK)
The Telegraph (UK)
Yonhap News Korea
The Inglorius Padre Steve's World · Musings of a Progressive Realist in Wonderland

redpajama_set_name: RedPajamaCommonCrawl


text:
Petrevene (în ) este un sat în comuna Lukovit, regiunea Loveci,  Bulgaria.

Demografie

La recensământul din 2011, populația satului Petrevene era de  locuitori. Din punct de vedere etnic, majoritatea locuitorilor (%) erau bulgari, cu o minoritate de romi (%). Pentru % din locuitori nu este cunoscută apartenența etnică.

Note

Sate din regiunea Loveci

redpajama_set_name: RedPajamaWikipedia


text:
$1,400 gold coin dropped in Mesa Salvation Army red kettle
2 others found in red kettles in Apache Junction, Goodyear
The coin donated in Mesa for The Salvation Army.
The coin donated in Goodyear for The Salvation Army.
Maj. Terry Suarez of The Salvation Army in Apache Junction.
The coin donated in Apache Junction for The Salvation Army.
Posted Thursday, December 19, 2019 12:33 pm
Independent Newsmedia
The Salvation Army reports that three of its signature red kettles in the Valley received an anonymous donation of a one-ounce American Eagle gold bullion coin over the last 10 days --- including in Mesa.
The coins, each believed to have a value of $1,400-$1,500, were donated at red kettles in Mesa, Apache Junction, and most recently, on Wednesday in Goodyear, according to a release.
"We feel very blessed to have received these very generous gifts," Maj. David Yardley, The Salvation Army metro Phoenix program coordinator, said in the release. "These donations will help The Salvation Army provide vital local services year-round, such as food for the hungry, clothing and shelter for the homeless, disaster and heat relief, senior activity and outreach, adult rehabilitation, and opportunities for underprivileged children."
Maj. Yardley added that even with the gold coin donations, with most red kettles only out through Christmas Eve, The Salvation Army is at just over 52% of its goal to raise $1.6 million to help neighbors in need in the Valley this coming year.
In addition to red kettles located at storefronts across the Valley, donations can also be made online at SalvationArmyPhoenix.org. You can even ask Alexa to, "Make a donation to The Salvation Army," the release states.
Many red kettles also have the Army's easy new Kettle Pay option that allows a person to donate from his or her smartphone right at the kettle.
"People in The Valley of the Sun are very giving, and we are grateful for the community's support of The Salvation Army. Anything you can spare as the holiday season winds down can help our neighbors in need who struggle with poverty every day," added Maj. Yardley. "But, if you are unable to give monetarily, volunteering is also a great way to give back, and we are always in need of volunteers at our Red Kettles. Volunteering at a Red Kettle for just one hour can raise enough money to help The Salvation Army feed 13 people. That is a huge impact."
Visit SalvationArmyPhoenix.org to find out how you can volunteer at a red kettle.
Eighty-two cents of every dollar donated to The Salvation Army are used to support local programs and services. That is one of the highest percentages of any nonprofit in the world, according to the release.
Red kettle collections comprise 21% of gifts to The Salvation Army in the Valley for the entire year, so the Red Kettle Campaign is a vital initiative.
The Salvation Army's signature red kettle was introduced in San Francisco in 1891 to provide a free holiday dinner to the poor.
The Salvation Army has been helping Arizonans overcome poverty, addiction and economic hardships through a range of social services for more than 125 years. The Salvation Army is doing the most good at more than 50 centers of operation across the state, the release states.
The Salvation Army,	Apache Junction,	Mesa,	Goodyear
Eastbound U.S. 60 narrowed to 2 lanes Loop 101 to Crismon Road nights Jan. 19-24
The Arizona Department of Transportation advises drivers who use the eastbound US 60 (Superstition Freeway) in Mesa to plan for nightly lane restrictions scheduled to begin Sunday, Jan. 19, for a …
Construction to begin soon on Falcon Field Airport aviation development
Pauline Carol Francis
Franklin E. (Gene) Urbany
Ray Kirwan


text:
Curucu, Beast of the Amazon is a 1956 American adventure/monster film, directed and written by Curt Siodmak and starring John Bromfield, Beverly Garland and Tom Payne. The title creature is pronounced "Koo-Ruh-SOO" (). The film was distributed in the United States as a double feature with The Mole People.

Plot
Plantation owner Rock Dean (Bromfield) travels up the Amazon River to investigate why the workers have left in panic. Dean's guide, Tupanico (Payne) warns him of Curucu, a birdlike monster who is said to live up the river where no white man has ever been. Accompanying him is Dr. Andrea Romar (Garland), in search of a drug which (in this story) the natives use to shrink heads. She hopes this drug will be effective in reducing cancerous tissue.

Tupanico guides the couple through the jungle, where they see a strange shimmering form in the river which drives the bearers away. After Rock shoots an animal, Tupanico offers to clean his rifle for him. Rock reluctantly agrees.

Later, Curucu attacks. Rock shoots at it, with no effect. The monster is revealed to be Tupanico, who is trying to drive "his" people away from the plantations, where he can lead them in the old ways, before white men brought civilization and disease. Tupanico used the excuse of cleaning Rock's rifle to load it with blanks.

Before they can be killed, Rock and Andrea are rescued by natives friendly to the local missionary. After wandering lost in the jungle in the commotion, Andrea wakens to find herself and Rock at the mission. A grateful native, whom she treated earlier, gives her some gifts: the shrinking drug she was searching for, and the shrunken head of Tupanico.

Cast
 John Bromfield as Rock Dean
 Beverly Garland as Dr. Andrea Romar
 Tom Payne as Tupanico
 Harvey Chalk as Father Flaviano
 Larri Thomas as Vivian, the Dancer
 Sergio de Oliveria as Captain of Police
 Wilson Viana as Tico
 Andrea Bayard
 Luz Del Fuego

Production

Curucu, Beast of the Amazon was shot in Eastmancolor, on location at the Amazon River in rural Brazil, with an estimated budget of $155,000.

Rudolph Icey handled cinematography, Raoul Kraushaar composed the score and Terry Morse served as editor.

After filming, Siodmak had 10,000 feet of color film left over that he could not export. Love Slaves of the Amazons was the result, and used some of the same cast members.

Reynold Brown, painter of numerous iconic Hollywood film posters, designed a poster for the film depicting a giant claw and a creature's glowering eye.

Release
Curucu, Beast of the Amazon was released to theaters by Universal Studios in December 1956, with The Mole People.

The film is now extremely rare, since it has never been officially released on either VHS or DVD.

On January 6, 2023, film restoration and distribution company Vinegar Syndrome announced they would be releasing a limited edition blu-ray of the film.

Reception
Author and film critic Leonard Maltin awarded the film 1.5 out of 4 stars, calling it "one of the most infamous disappointments for monster-loving kids of the 1950s".
On his website Fantastic Movie Musings and Ramblings, Dave Sindelar gave the film a negative review, criticizing the film for using too much talking and exploring scenes just to fill its running time. Sindelar also noted that the only thing the film had going for it was Garland's "tough girl" character, but also wrote, "Unfortunately, the movie decides to punish her for her toughness; the last 30 minutes of the movie seems designed solely to frighten this woman into realizing that it''s arrogant of her to think of herself as being as tough as a man".
TV Guide awarded the film 1 out of 5 stars, calling it "a moderately amusing jungle adventure".

See also
 List of American films of 1956

References

External links

1956 films
American adventure films
Jungle adventure films
Films set in Brazil
Films shot in Belém
Films shot in Brazil
Films shot in Argentina
1956 adventure films
Films directed by Curt Siodmak
Universal Pictures films
Films scored by Raoul Kraushaar
1950s English-language films
1950s American films


text:
Les ammophiles (Ammophila du grec "ammos", sable et philo "qui aime") désignent deux genres dans la classification phylogénique des espèces vivantes :
 le genre Ammophila Kirby, 1798 : (Ammophile en français) d'insectes hyménoptères de la famille des Sphecidae ;
 le genre Ammophila Host, 1809 : (Ammophile en français) de plantes à fleurs de la famille des Poaceae ;
et une espèce d'insectes :
 Podalonia hirsuta (Ammophile hérissée en français), une espèce d'insectes hyménoptères.

Homonymie en biologie


text:
Q: Complex query (django ORM or SQL) I'm getting stuck on a complex query, trying to use Django's ORM.
models.py
class Product(models.Model):
    deprecated = models.ForeignKey(SpecialVersion, null=True)

class Version(models.Model):
    compatible_from = models.ForeignKey(SpecialVersion)
    product = models.ForeignKey(Product)

class SpecialVersion(models.Model):
    version = models.ForeignKey(Version, null=True)
    order = models.IntegerField()

The gist of this is, Products have multiple Versions. Some of these Versions are 'special' - we keep track of this by making a SpecialVersion object pointing to the 'special' Version object. When we create a non-special version, it must indicate a compatibility with a SpecialVersion. That is, starting at the SpecialVersion indicated by compatible_from. A Product can become deprecated at a certain special version.
Now, I want to be able to find appropriate Products given a certain SpecialVersion. In other words, I want to get all Product objects where there is a Version available that has a SpecialVersion below my given SpecialVersion. Furthermore, the Product's deprecated SpecialVersion must be either null, or below the given SpecialVersion if not null.
TL;DR:
Select all Products where the given SpecialVersion is in the range between the lowest compatible_from SpecialVersion in the product, and the deprecated SpecialVersion (if this exists).
EDIT: Example.
Products
id | deprecated
0  | None
1  | 2
Versions
id | prd | compat
0  | 0   | 1
1  | 0   | 2
2  | 1   | 2
SpecialVersions
id | ver | ord
0  | Null | 1
1  | Null | 2
2  | Null | 3
3  | Null | 4
A query for compatibility w/ SpecialVersion would return no products, because none of the products have versions that specify a compatibility as low as that. A query for compat w/ SpecialVersion would return all of the Products because they both have compatibility starting at SpecialVersion id=1 and id=2, respectively. Finally, a query for compat w/ SpecialVersion would return ONLY the product id=0 because though both products have a SpecialVersion compat low enough, the second product has been deprecated for SpecialVersions and upwards.

A: I believe that what you are looking for is the Django Q Object. This allows you to use complex lookups such as "OR" statements in your query. If I understand your question correctly, something along the lines of this should work just fine:
from django.db.models import Q
models.Product.objects.filter(Q(deprecated__isnull=True) | Q(version__compatible_from__order__lte=GIVENSPECIALVERSION)).all()

Where GIVENSPECIALVERSION is the version order that you received from somewhere else in your code.

A: Here is what I ended up using:
products = Product.objects.annotate(min_version=Min(version_set__compatible_from__order)).filter(min_version__lte = given_special_version).filter(Q(deprecated__isnull = True) | Q(deprecated__order__gt = given_special_version))

redpajama_set_name: RedPajamaStackExchange


Featherweight has lengthy been one in every of Bellator's most stacked divisions. And now it's going to get the annual event therapy.
Bellator president Scott Coker introduced formally Tuesday at a London press convention that the promotion will launch a featherweight grand prix in October. The event will function 16 of the very best 145-pound fighters in Bellator, the most important tourney thus far in promotion historical past.
Coker had beforehand teased the information, however made it official Tuesday at a press convention to announce the slate for Bellator 222 in London on June 22. Coker mentioned the featherweight event will start someday in October with the total first spherical — eight fights — on a single card. It's going to air on DAZN. The plan, he mentioned, is to complete up the grand prix inside a calendar yr.
The event winner will obtain $1 million, Coker mentioned. It's unclear if the Bellator featherweight champion, presently Patricio Freire, might be within the draw. Freire is shifting as much as light-weight to battle champion Michael Chandler in the principle occasion of Bellator 221 on Could 11 in Rosemont, Ailing.
Bellator was as soon as a promotion solely primarily based on tournaments with the winners in every weight class getting title pictures. When Coker took over as promoter from founder Bjorn Rebney in 2014, Bellator moved away from the total event construction. However in 2018, tournaments as soon as once more turned a part of the format, starting with the Bellator Heavyweight World Grand Prix, which was gained by Ryan Bader — who additionally turned heavyweight champion — in January.
At the moment, Bellator is operating a welterweight grand prix with champion Rory MacDonald defending his title all through the bracket. MacDonald will face Jon Fitch in a first-round matchup at Bellator 220 on April 27 in San Jose, Calif. Douglas Lima, Michael Web page and Neiman Gracie are already within the tourney semifinals.