text:
// ==========================================================
// Photoshop Loader
//
// Design and implementation by
// - Hervé Drolon (drolon@infonie.fr)
// - Mihail Naydenov (mnaydenov@users.sourceforge.net)
//
// Based on LGPL code created and published by http://sourceforge.net/projects/elynx/
//
// This file is part of FreeImage 3
//
// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
// THIS DISCLAIMER.
//
// Use at your own risk!
// ==========================================================

#include "FreeImage.h"
#include "Utilities.h"
#include "PSDParser.h"

// --------------------------------------------------------------------------

// PSD signature (= '8BPS')
#define PSD_SIGNATURE	0x38425053
// Image resource block signature (= '8BIM')
#define PSD_RESOURCE	0x3842494D

// PSD color modes
#define PSDP_BITMAP			0
#define PSDP_GRAYSCALE		1
#define PSDP_INDEXED		2
#define PSDP_RGB			3
#define PSDP_CMYK			4
#define PSDP_MULTICHANNEL	7
#define PSDP_DUOTONE		8
#define PSDP_LAB			9

// PSD compression schemes
#define PSDP_COMPRESSION_NONE	0	// Raw data
#define PSDP_COMPRESSION_RLE	1	// RLE compression (same as TIFF packed bits)

#define SAFE_DELETE_ARRAY(_p_) { if (NULL != (_p_)) { delete [] (_p_); (_p_) = NULL; } }

// --------------------------------------------------------------------------

static inline int
psdGetValue(const BYTE * iprBuffer, const int iBytes) {
	int v = iprBuffer[0];
	for (int i=1; i<iBytes; ++i) {
		v = (v << 8) | iprBuffer[i];
	}
	return v;
}

// --------------------------------------------------------------------------

psdHeaderInfo::psdHeaderInfo() : _Channels(-1), _Height(-1), _Width(-1), _BitsPerChannel(-1), _ColourMode(-1) {
}

psdHeaderInfo::~psdHeaderInfo() {
}

bool psdHeaderInfo::Read(FreeImageIO *io, fi_handle handle) {
	psdHeader header;

	const int n = (int)io->read_proc(&header, sizeof(header), 1, handle);
	if(!n) {
		return false;
	}

	// check the signature
	int nSignature = psdGetValue(header.Signature, sizeof(header.Signature));
	if (PSD_SIGNATURE == nSignature) {
		// check the version
		int nVersion = psdGetValue( header.Version, sizeof(header.Version) );
		if (1 == nVersion) {
			// header.Reserved must be zero
			BYTE psd_reserved[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
			if(memcmp(header.Reserved, psd_reserved, 6) != 0) {
				FreeImage_OutputMessageProc(FIF_PSD, "Warning: file header reserved member is not equal to zero");
			}
			// read the header
			_Channels = (short)psdGetValue( header.Channels, sizeof(header.Channels) );
			_Height = psdGetValue( header.Rows, sizeof(header.Rows) );
			_Width = psdGetValue( header.Columns, sizeof(header.Columns) );
			_BitsPerChannel = (short)psdGetValue( header.Depth, sizeof(header.Depth) );
			_ColourMode = (short)psdGetValue( header.Mode, sizeof(header.Mode) );

			return true;
		}
	}

	return false;
}

// --------------------------------------------------------------------------

psdColourModeData::psdColourModeData() : _Length(-1), _plColourData(NULL) {
}

psdColourModeData::~psdColourModeData() {
	SAFE_DELETE_ARRAY(_plColourData);
}

bool psdColourModeData::Read(FreeImageIO *io, fi_handle handle) {
	if (0 < _Length) {
		SAFE_DELETE_ARRAY(_plColourData);
	}

	BYTE Length[4];
	io->read_proc(&Length, sizeof(Length), 1, handle);

	_Length = psdGetValue( Length, sizeof(_Length) );
	if (0 < _Length) {
		_plColourData = new BYTE[_Length];
		io->read_proc(_plColourData, _Length, 1, handle);
	}

	return true;
}

bool psdColourModeData::FillPalette(FIBITMAP *dib) {
	RGBQUAD *pal = FreeImage_GetPalette(dib);
	if(pal) {
		for (int i = 0; i < 256; i++) {
			pal[i].rgbRed	= _plColourData[i + 0*256];
			pal[i].rgbGreen = _plColourData[i + 1*256];
			pal[i].rgbBlue	= _plColourData[i + 2*256];
		}
		return true;
	}
	return false;
}

// --------------------------------------------------------------------------

psdImageResource::psdImageResource() : _plName (0) {
	Reset();
}

psdImageResource::~psdImageResource() {
	SAFE_DELETE_ARRAY(_plName);
}

void psdImageResource::Reset() {
	_Length = -1;
	memset( _OSType, '\0', sizeof(_OSType) );
	_ID = -1;
	SAFE_DELETE_ARRAY(_plName);
	_Size = -1;
}

// --------------------------------------------------------------------------

psdResolutionInfo::psdResolutionInfo() : _widthUnit(-1), _heightUnit(-1), _hRes(-1), _vRes(-1), _hResUnit(-1), _vResUnit(-1) {
}

psdResolutionInfo::~psdResolutionInfo() {
}

int psdResolutionInfo::Read(FreeImageIO *io, fi_handle handle) {
	BYTE IntValue[4], ShortValue[2];
	int nBytes=0, n;

	// Horizontal resolution in pixels per inch.
	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_hRes = (short)psdGetValue(ShortValue, sizeof(_hRes) );
	// 1=display horizontal resolution in pixels per inch; 2=display horizontal resolution in pixels per cm.
	n = (int)io->read_proc(&IntValue, sizeof(IntValue), 1, handle);
	nBytes += n * sizeof(IntValue);
	_hResUnit = psdGetValue(IntValue, sizeof(_hResUnit) );
	// Display width as 1=inches; 2=cm; 3=points; 4=picas; 5=columns.
	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_widthUnit = (short)psdGetValue(ShortValue, sizeof(_widthUnit) );
	// Vertical resolution in pixels per inch.
	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_vRes = (short)psdGetValue(ShortValue, sizeof(_vRes) );
	// 1=display vertical resolution in pixels per inch; 2=display vertical resolution in pixels per cm.
	n = (int)io->read_proc(&IntValue, sizeof(IntValue), 1, handle);
	nBytes += n * sizeof(IntValue);
	_vResUnit = psdGetValue(IntValue, sizeof(_vResUnit) );
	// Display height as 1=inches; 2=cm; 3=points; 4=picas; 5=columns.
	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_heightUnit = (short)psdGetValue(ShortValue, sizeof(_heightUnit) );

	return nBytes;
}

void psdResolutionInfo::GetResolutionInfo(unsigned &res_x, unsigned &res_y) {
	if(_hResUnit == 1) {
		// convert pixels / inch to pixel / m
		res_x = (unsigned) (_hRes / 0.0254000 + 0.5);
	} else if(_hResUnit == 2) {
		// convert pixels / cm to pixel / m
		res_x = (unsigned) (_hRes * 100.0 + 0.5);
	}
	if(_vResUnit == 1) {
		// convert pixels / inch to pixel / m
		res_y = (unsigned) (_vRes / 0.0254000 + 0.5);
	} else if(_vResUnit == 2) {
		// convert pixels / cm to pixel / m
		res_y = (unsigned) (_vRes * 100.0 + 0.5);
	}
}

// --------------------------------------------------------------------------

psdResolutionInfo_v2::psdResolutionInfo_v2() {
	_Channels = _Rows = _Columns = _Depth = _Mode = -1;
}

psdResolutionInfo_v2::~psdResolutionInfo_v2() {
}

int psdResolutionInfo_v2::Read(FreeImageIO *io, fi_handle handle) {
	BYTE ShortValue[2];
	int nBytes=0, n;

	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_Channels = (short)psdGetValue(ShortValue, sizeof(_Channels) );

	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_Rows = (short)psdGetValue(ShortValue, sizeof(_Rows) );

	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_Columns = (short)psdGetValue(ShortValue, sizeof(_Columns) );

	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_Depth = (short)psdGetValue(ShortValue, sizeof(_Depth) );

	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_Mode = (short)psdGetValue(ShortValue, sizeof(_Mode) );

	return nBytes;
}

// --------------------------------------------------------------------------

psdDisplayInfo::psdDisplayInfo() {
	_Opacity = _ColourSpace = -1;
	for (unsigned n = 0; n < 4; ++n) {
		_Colour[n] = 0;
	}
	_Kind = 0;
	_padding = '0';
}

psdDisplayInfo::~psdDisplayInfo() {
}

int psdDisplayInfo::Read(FreeImageIO *io, fi_handle handle) {
	BYTE ShortValue[2];
	int nBytes=0, n;

	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_ColourSpace = (short)psdGetValue(ShortValue, sizeof(_ColourSpace) );

	for (unsigned i = 0; i < 4; ++i) {
		n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
		nBytes += n * sizeof(ShortValue);
		_Colour[i] = (short)psdGetValue(ShortValue, sizeof(_Colour[i]) );
	}

	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_Opacity = (short)psdGetValue(ShortValue, sizeof(_Opacity) );
	if((_Opacity < 0) || (_Opacity > 100)) {
		throw "Invalid DisplayInfo::Opacity value";
	}

	BYTE c[1];
	n = (int)io->read_proc(&c, sizeof(c), 1, handle);
	nBytes += n * sizeof(c);
	_Kind = (BYTE)psdGetValue(c, sizeof(c));

	n = (int)io->read_proc(&c, sizeof(c), 1, handle);
	nBytes += n * sizeof(c);
	_padding = (BYTE)psdGetValue(c, sizeof(c));
	if(_padding != 0) {
		throw "Invalid DisplayInfo::Padding value";
	}

	return nBytes;
}

// --------------------------------------------------------------------------

psdThumbnail::psdThumbnail() :
_Format(-1), _Width(-1), _Height(-1), _WidthBytes(-1), _Size(-1), _CompressedSize(-1), _BitPerPixel(-1), _Planes(-1), _dib(NULL) {
}

psdThumbnail::~psdThumbnail() {
	FreeImage_Unload(_dib);
}

int psdThumbnail::Read(FreeImageIO *io, fi_handle handle, int iResourceSize, bool isBGR) {
	BYTE ShortValue[2], IntValue[4];
	int nBytes=0, n;

	// remove the header size (28 bytes) from the total data size
	int iTotalData = iResourceSize - 28;

	const long block_end = io->tell_proc(handle) + iTotalData;

	n = (int)io->read_proc(&IntValue, sizeof(IntValue), 1, handle);
	nBytes += n * sizeof(IntValue);
	_Format = psdGetValue(IntValue, sizeof(_Format) );

	n = (int)io->read_proc(&IntValue, sizeof(IntValue), 1, handle);
	nBytes += n * sizeof(IntValue);
	_Width = psdGetValue(IntValue, sizeof(_Width) );

	n = (int)io->read_proc(&IntValue, sizeof(IntValue), 1, handle);
	nBytes += n * sizeof(IntValue);
	_Height = psdGetValue(IntValue, sizeof(_Height) );

	n = (int)io->read_proc(&IntValue, sizeof(IntValue), 1, handle);
	nBytes += n * sizeof(IntValue);
	_WidthBytes = psdGetValue(IntValue, sizeof(_WidthBytes) );

	n = (int)io->read_proc(&IntValue, sizeof(IntValue), 1, handle);
	nBytes += n * sizeof(IntValue);
	_Size = psdGetValue(IntValue, sizeof(_Size) );

	n = (int)io->read_proc(&IntValue, sizeof(IntValue), 1, handle);
	nBytes += n * sizeof(IntValue);
	_CompressedSize = psdGetValue(IntValue, sizeof(_CompressedSize) );

	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_BitPerPixel = (short)psdGetValue(ShortValue, sizeof(_BitPerPixel) );

	n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
	nBytes += n * sizeof(ShortValue);
	_Planes = (short)psdGetValue(ShortValue, sizeof(_Planes) );

	const long JFIF_startpos = io->tell_proc(handle);

	if(_dib) {
		FreeImage_Unload(_dib);
	}

	if(_Format == 1) {
		// kJpegRGB thumbnail image
		_dib = FreeImage_LoadFromHandle(FIF_JPEG, io, handle);
		if(isBGR) {
			SwapRedBlue32(_dib);
		}
		// HACK: manually go to end of thumbnail, because (for some reason) LoadFromHandle consumes more bytes then available!
		io->seek_proc(handle, block_end, SEEK_SET);
	}
	else {
		// kRawRGB thumbnail image
		// ### Unimplemented (should be trivial)

		// skip the thumbnail part
		io->seek_proc(handle, iTotalData, SEEK_CUR);
		return iResourceSize;
	}

	nBytes += (block_end - JFIF_startpos);

	return nBytes;
}

//---------------------------------------------------------------------------

psdICCProfile::psdICCProfile() : _ProfileSize(0), _ProfileData(NULL) {
}

psdICCProfile::~psdICCProfile() {
	clear();
}

void psdICCProfile::clear() { SAFE_DELETE_ARRAY(_ProfileData); _ProfileSize = 0;}

int psdICCProfile::Read(FreeImageIO *io, fi_handle handle, int size) {
	int nBytes = 0, n;

	clear();

	_ProfileData = new (std::nothrow) BYTE[size];
	if(NULL != _ProfileData) {
		n = (int)io->read_proc(_ProfileData, 1, size, handle);
		_ProfileSize = size;
		nBytes += n * sizeof(BYTE);
	}

	return nBytes;
}

//---------------------------------------------------------------------------

/**
Invert only color components, skipping Alpha/Black
(Can be useful as public/utility function)
*/
static
BOOL invertColor(FIBITMAP* dib) {
	FREE_IMAGE_TYPE type = FreeImage_GetImageType(dib);
	const unsigned Bpp = FreeImage_GetBPP(dib)/8;

	if((type == FIT_BITMAP && Bpp == 4) || type == FIT_RGBA16) {
		const unsigned width = FreeImage_GetWidth(dib);
		const unsigned height = FreeImage_GetHeight(dib);
		BYTE *line_start = FreeImage_GetScanLine(dib, 0);
		const unsigned pitch = FreeImage_GetPitch(dib);
		const unsigned triBpp = Bpp - (Bpp == 4 ? 1 : 2);

		for(unsigned y = 0; y < height; y++) {
			BYTE *line = line_start;

			for(unsigned x = 0; x < width; x++) {
				for(unsigned b=0; b < triBpp; ++b) {
					line[b] = ~line[b];
				}

				line += Bpp;
			}
			line_start += pitch;
		}

		return TRUE;
	}
	else {
		return FreeImage_Invert(dib);
	}
}

//---------------------------------------------------------------------------

psdParser::psdParser() {
	_bThumbnailFilled = false;
	_bDisplayInfoFilled = false;
	_bResolutionInfoFilled = false;
	_bResolutionInfoFilled_v2 = false;
	_bCopyright = false;
	_GlobalAngle = 30;
	_ColourCount = -1;
	_TransparentIndex = -1;
	_fi_flags = 0;
	_fi_format_id = FIF_UNKNOWN;
}

psdParser::~psdParser() {
}

bool psdParser::ReadLayerAndMaskInfoSection(FreeImageIO *io, fi_handle handle)	{
	bool bSuccess = false;

	BYTE DataLength[4];
	int nBytes = 0;
	int n = (int)io->read_proc(&DataLength, sizeof(DataLength), 1, handle);
	int nTotalBytes = psdGetValue( DataLength, sizeof(DataLength) );

	BYTE data[1];
	while( n && ( nBytes < nTotalBytes ) ) {
		data[0] = '\0';
		n = (int)io->read_proc(&data, sizeof(data), 1, handle);
		nBytes += n * sizeof(data);
	}

	if ( nBytes == nTotalBytes ) {
		bSuccess = true;
	}

	return bSuccess;
}

bool psdParser::ReadImageResources(FreeImageIO *io, fi_handle handle, LONG length) {
	psdImageResource oResource;
	bool bSuccess = false;

	if(length > 0) {
		oResource._Length = length;
	} else {
		BYTE Length[4];
		int n = (int)io->read_proc(&Length, sizeof(Length), 1, handle);

		oResource._Length = psdGetValue( Length, sizeof(oResource._Length) );
	}

	int nBytes = 0;
	int nTotalBytes = oResource._Length;

	while(nBytes < nTotalBytes) {
		int n = 0;
		oResource.Reset();

		n = (int)io->read_proc(&oResource._OSType, sizeof(oResource._OSType), 1, handle);
		if(n != 1) {
			FreeImage_OutputMessageProc(_fi_format_id, "This file contains damaged data causing an unexpected end-of-file - stop reading resources");
			return false;
		}
		nBytes += n * sizeof(oResource._OSType);

		if( (nBytes % 2) != 0 ) {
			return false;
		}

		int nOSType = psdGetValue((BYTE*)&oResource._OSType, sizeof(oResource._OSType));

		if ( PSD_RESOURCE == nOSType ) {
			BYTE ID[2];
			n = (int)io->read_proc(&ID, sizeof(ID), 1, handle);
			nBytes += n * sizeof(ID);

			oResource._ID = (short)psdGetValue( ID, sizeof(ID) );

			BYTE SizeOfName;
			n = (int)io->read_proc(&SizeOfName, sizeof(SizeOfName), 1, handle);
			nBytes += n * sizeof(SizeOfName);

			int nSizeOfName = psdGetValue( &SizeOfName, sizeof(SizeOfName) );
			if ( 0 < nSizeOfName ) {
				oResource._plName = new BYTE[nSizeOfName];
				n = (int)io->read_proc(oResource._plName, nSizeOfName, 1, handle);
				nBytes += n * nSizeOfName;
			}

			if ( 0 == (nSizeOfName % 2) ) {
				n = (int)io->read_proc(&SizeOfName, sizeof(SizeOfName), 1, handle);
				nBytes += n * sizeof(SizeOfName);
			}

			BYTE Size[4];
			n = (int)io->read_proc(&Size, sizeof(Size), 1, handle);
			nBytes += n * sizeof(Size);

			oResource._Size = psdGetValue( Size, sizeof(oResource._Size) );

			if ( 0 != (oResource._Size % 2) ) {
				// resource data must be even
				oResource._Size++;
			}
			if ( 0 < oResource._Size ) {
				BYTE IntValue[4];
				BYTE ShortValue[2];

				switch( oResource._ID ) {
					case 1000:
						// Obsolete - Photoshop 2.0
						_bResolutionInfoFilled_v2 = true;
						nBytes += _resolutionInfo_v2.Read(io, handle);
						break;

					// ResolutionInfo structure
					case 1005:
						_bResolutionInfoFilled = true;
						nBytes += _resolutionInfo.Read(io, handle);
						break;

					// DisplayInfo structure
					case 1007:
						_bDisplayInfoFilled = true;
						nBytes += _displayInfo.Read(io, handle);
						break;

					// (Photoshop 4.0) Copyright flag
					// Boolean indicating whether image is copyrighted. Can be set via Property suite or by user in File Info...
					case 1034:
						n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
						nBytes += n * sizeof(ShortValue);
						_bCopyright = (1 == psdGetValue(ShortValue, sizeof(ShortValue)));
						break;

					// (Photoshop 4.0) Thumbnail resource for Photoshop 4.0 only
					case 1033:
					// (Photoshop 5.0) Thumbnail resource (supersedes resource 1033)
					case 1036:
					{
						_bThumbnailFilled = true;
						bool bBGR = (1033==oResource._ID);
						nBytes += _thumbnail.Read(io, handle, oResource._Size, bBGR);
						break;
					}

					// (Photoshop 5.0) Global Angle
					// 4 bytes that contain an integer between 0 and 359, which is the global
					// lighting angle for effects layer. If not present, assumed to be 30.
					case 1037:
						n = (int)io->read_proc(&IntValue, sizeof(IntValue), 1, handle);
						nBytes += n * sizeof(IntValue);
						_GlobalAngle = psdGetValue(IntValue, sizeof(_GlobalAngle) );
						break;

					// ICC profile
					case 1039:
						nBytes += _iccProfile.Read(io, handle, oResource._Size);
						break;

					// (Photoshop 6.0) Indexed Color Table Count
					// 2 bytes for the number of colors in table that are actually defined
					case 1046:
						n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
						nBytes += n * sizeof(ShortValue);
						_ColourCount = (short)psdGetValue(ShortValue, sizeof(ShortValue) );
						break;

					// (Photoshop 6.0) Transparency Index.
					// 2 bytes for the index of transparent color, if any.
					case 1047:
						n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
						nBytes += n * sizeof(ShortValue);
						_TransparentIndex = (short)psdGetValue(ShortValue, sizeof(ShortValue) );
						break;

					default:
					{
						// skip resource
						unsigned skip_length = MIN(oResource._Size, nTotalBytes - nBytes);
						io->seek_proc(handle, skip_length, SEEK_CUR);
						nBytes += skip_length;
					}
					break;
				}
			}
		}
  }

  if (nBytes == nTotalBytes) {
	  bSuccess = true;
  }

  return bSuccess;

}

FIBITMAP* psdParser::ReadImageData(FreeImageIO *io, fi_handle handle) {
	if(handle == NULL)
		return NULL;

	bool header_only = (_fi_flags & FIF_LOAD_NOPIXELS) == FIF_LOAD_NOPIXELS;

	WORD nCompression = 0;
	io->read_proc(&nCompression, sizeof(nCompression), 1, handle);

#ifndef FREEIMAGE_BIGENDIAN
	SwapShort(&nCompression);
#endif

	if((nCompression != PSDP_COMPRESSION_NONE && nCompression != PSDP_COMPRESSION_RLE))	{
		FreeImage_OutputMessageProc(_fi_format_id, "Unsupported compression %d", nCompression);
		return NULL;
	}

	const unsigned nWidth = _headerInfo._Width;
	const unsigned nHeight = _headerInfo._Height;
	const unsigned nChannels = _headerInfo._Channels;
	const unsigned depth = _headerInfo._BitsPerChannel;
	const unsigned bytes = (depth == 1) ? 1 : depth / 8;

	// channel(plane) line (BYTE aligned)
	const unsigned lineSize = (_headerInfo._BitsPerChannel == 1) ? (nWidth + 7) / 8 : nWidth * bytes;

	if(nCompression == PSDP_COMPRESSION_RLE && depth > 16) {
		FreeImage_OutputMessageProc(_fi_format_id, "Unsupported RLE with depth %d", depth);
		return NULL;
	}

	// build output buffer

	FIBITMAP* bitmap = NULL;
	unsigned dstCh = 0;

	short mode = _headerInfo._ColourMode;

	if(mode == PSDP_MULTICHANNEL && nChannels < 3) {
		// CM
		mode = PSDP_GRAYSCALE; // C as gray, M as extra channel
	}

	bool needPalette = false;
	switch (mode) {
		case PSDP_BITMAP:
		case PSDP_DUOTONE:
		case PSDP_INDEXED:
		case PSDP_GRAYSCALE:
			dstCh = 1;
			switch(depth) {
				case 16:
				bitmap = FreeImage_AllocateHeaderT(header_only, FIT_UINT16, nWidth, nHeight, depth*dstCh);
				break;
				case 32:
				bitmap = FreeImage_AllocateHeaderT(header_only, FIT_FLOAT, nWidth, nHeight, depth*dstCh);
				break;
				default: // 1-, 8-
				needPalette = true;
				bitmap = FreeImage_AllocateHeader(header_only, nWidth, nHeight, depth*dstCh);
				break;
			}
			break;
		case PSDP_RGB:
		case PSDP_LAB:
		case PSDP_CMYK	:
		case PSDP_MULTICHANNEL	:
			// force PSDP_MULTICHANNEL CMY as CMYK
			dstCh = (mode == PSDP_MULTICHANNEL && !header_only) ? 4 : MIN<unsigned>(nChannels, 4);
			if(dstCh < 3) {
				throw "Invalid number of channels";
			}

			switch(depth) {
				case 16:
				bitmap = FreeImage_AllocateHeaderT(header_only, dstCh < 4 ? FIT_RGB16 : FIT_RGBA16, nWidth, nHeight, depth*dstCh);
				break;
				case 32:
				bitmap = FreeImage_AllocateHeaderT(header_only, dstCh < 4 ? FIT_RGBF : FIT_RGBAF, nWidth, nHeight, depth*dstCh);
				break;
				default:
				bitmap = FreeImage_AllocateHeader(header_only, nWidth, nHeight, depth*dstCh);
				break;
			}
			break;
		default:
			throw "Unsupported color mode";
			break;
	}
	if(!bitmap) {
		throw FI_MSG_ERROR_DIB_MEMORY;
	}

	// write thumbnail
	FreeImage_SetThumbnail(bitmap, _thumbnail.getDib());

	// @todo Add some metadata model

	if(header_only) {
		return bitmap;
	}

	// Load pixels data

	const unsigned dstChannels = dstCh;

	const unsigned dstBpp =  (depth == 1) ? 1 : FreeImage_GetBPP(bitmap)/8;
	const unsigned dstLineSize = FreeImage_GetPitch(bitmap);
	BYTE* const dst_first_line = FreeImage_GetScanLine(bitmap, nHeight - 1);//<*** flipped

	BYTE* line_start = new BYTE[lineSize]; //< fileline cache

	switch ( nCompression ) {
		case PSDP_COMPRESSION_NONE: // raw data
		{
			for(unsigned c = 0; c < nChannels; c++) {
				if(c >= dstChannels) {
					// @todo write extra channels
					break;
				}

				const unsigned channelOffset = c * bytes;

				BYTE* dst_line_start = dst_first_line;
				for(unsigned h = 0; h < nHeight; ++h, dst_line_start -= dstLineSize) {//<*** flipped

					io->read_proc(line_start, lineSize, 1, handle);

					for (BYTE *line = line_start, *dst_line = dst_line_start; line < line_start + lineSize;
						line += bytes, dst_line += dstBpp) {
#ifdef FREEIMAGE_BIGENDIAN
							memcpy(dst_line + channelOffset, line, bytes);
#else
						// reverse copy bytes
						for (unsigned b = 0; b < bytes; ++b) {
							dst_line[channelOffset + b] = line[(bytes-1) - b];
						}
#endif // FREEIMAGE_BIGENDIAN
					}
				} //< h
			}//< ch

			SAFE_DELETE_ARRAY(line_start);

		}
		break;

		case PSDP_COMPRESSION_RLE: // RLE compression
		{

			// The RLE-compressed data is preceeded by a 2-byte line size for each row in the data,
			// store an array of these

			// later use this array as WORD rleLineSizeList[nChannels][nHeight];
			WORD *rleLineSizeList = new (std::nothrow) WORD[nChannels*nHeight];

			if(!rleLineSizeList) {
				FreeImage_Unload(bitmap);
				SAFE_DELETE_ARRAY(line_start);
				throw std::bad_alloc();
			}

			io->read_proc(rleLineSizeList, 2, nChannels * nHeight, handle);

			WORD largestRLELine = 0;
			for(unsigned ch = 0; ch < nChannels; ++ch) {
				for(unsigned h = 0; h < nHeight; ++h) {
					const unsigned index = ch * nHeight + h;

#ifndef FREEIMAGE_BIGENDIAN
					SwapShort(&rleLineSizeList[index]);
#endif
					if(largestRLELine < rleLineSizeList[index]) {
						largestRLELine = rleLineSizeList[index];
					}
				}
			}

			BYTE* rle_line_start = new (std::nothrow) BYTE[largestRLELine];
			if(!rle_line_start) {
				FreeImage_Unload(bitmap);
				SAFE_DELETE_ARRAY(line_start);
				SAFE_DELETE_ARRAY(rleLineSizeList);
				throw std::bad_alloc();
			}

			// Read the RLE data (assume 8-bit)

			const BYTE* const line_end = line_start + lineSize;

			for (unsigned ch = 0; ch < nChannels; ch++) {
				const unsigned channelOffset = ch * bytes;

				BYTE* dst_line_start = dst_first_line;
				for(unsigned h = 0; h < nHeight; ++h, dst_line_start -= dstLineSize) {//<*** flipped
					const unsigned index = ch * nHeight + h;

					// - read and uncompress line -

					const WORD rleLineSize = rleLineSizeList[index];

					io->read_proc(rle_line_start, rleLineSize, 1, handle);

					for (BYTE* rle_line = rle_line_start, *line = line_start;
						rle_line < rle_line_start + rleLineSize, line < line_end;) {

						int len = *rle_line++;

						// NOTE len is signed byte in PackBits RLE

						if ( len < 128 ) { //<- MSB is not set
							// uncompressed packet

							// (len + 1) bytes of data are copied

							++len;

							// assert we don't write beyound eol
							memcpy(line, rle_line, line + len > line_end ? line_end - line : len);
							line += len;
							rle_line += len;
						}
						else if ( len > 128 ) { //< MSB is set

							// RLE compressed packet

							// One byte of data is repeated (–len + 1) times

							len ^= 0xFF; // same as (-len + 1) & 0xFF
							len += 2;    //

							// assert we don't write beyound eol
							memset(line, *rle_line++, line + len > line_end ? line_end - line : len);
							line += len;

						}
						else if ( 128 == len ) {
							// Do nothing
						}
					}//< rle_line

					// - write line to destination -

					if(ch >= dstChannels) {
						// @todo write to extra channels
						break;
					}

					// byte by byte copy a single channel to pixel
					for (BYTE *line = line_start, *dst_line = dst_line_start; line < line_start + lineSize;
						line += bytes, dst_line += dstBpp) {

#ifdef FREEIMAGE_BIGENDIAN
							memcpy(dst_line + channelOffset, line, bytes);
#else
							// reverse copy bytes
							for (unsigned b = 0; b < bytes; ++b) {
								dst_line[channelOffset + b] = line[(bytes-1) - b];
							}
#endif // FREEIMAGE_BIGENDIAN
					}
				}//< h
			}//< ch

			SAFE_DELETE_ARRAY(line_start);
			SAFE_DELETE_ARRAY(rleLineSizeList);
			SAFE_DELETE_ARRAY(rle_line_start);
		}
		break;

		case 2: // ZIP without prediction, no specification
			break;

		case 3: // ZIP with prediction, no specification
			break;

		default: // Unknown format
			break;

	}

	// --- Further process the bitmap ---

	if((mode == PSDP_CMYK || mode == PSDP_MULTICHANNEL)) {
		// CMYK values are "inverted", invert them back

		if(mode == PSDP_MULTICHANNEL) {
			invertColor(bitmap);
		} else {
			FreeImage_Invert(bitmap);
		}

		if((_fi_flags & PSD_CMYK) == PSD_CMYK) {
			// keep as CMYK

			if(mode == PSDP_MULTICHANNEL) {
				//### we force CMY to be CMYK, but CMY has no ICC.
				// Create empty profile and add the flag.
				FreeImage_CreateICCProfile(bitmap, NULL, 0);
				FreeImage_GetICCProfile(bitmap)->flags |= FIICC_COLOR_IS_CMYK;
			}
		}
		else {
			// convert to RGB

			ConvertCMYKtoRGBA(bitmap);

			// The ICC Profile is no longer valid
			_iccProfile.clear();

			// remove the pending A if not present in source
			if(nChannels == 4 || nChannels == 3 ) {
				FIBITMAP* t = RemoveAlphaChannel(bitmap);
				if(t) {
					FreeImage_Unload(bitmap);
					bitmap = t;
				} // else: silently fail
			}
		}
	}
	else if ( mode == PSDP_LAB && !((_fi_flags & PSD_LAB) == PSD_LAB)) {
		ConvertLABtoRGB(bitmap);
	}
	else {
		if (needPalette && FreeImage_GetPalette(bitmap)) {

			if(mode == PSDP_BITMAP) {
				CREATE_GREYSCALE_PALETTE_REVERSE(FreeImage_GetPalette(bitmap), 2);
			}
			else if(mode == PSDP_INDEXED) {
				if(!_colourModeData._plColourData || _colourModeData._Length != 768 || _ColourCount < 0) {
					FreeImage_OutputMessageProc(_fi_format_id, "Indexed image has no palette. Using the default grayscale one.");
				} else {
					_colourModeData.FillPalette(bitmap);
				}
			}
			// GRAYSCALE, DUOTONE - use default grayscale palette
		}

#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
		if(FreeImage_GetImageType(bitmap) == FIT_BITMAP) {
			SwapRedBlue32(bitmap);
		}
#endif
	}

	return bitmap;
}

FIBITMAP* psdParser::Load(FreeImageIO *io, fi_handle handle, int s_format_id, int flags) {
	FIBITMAP *Bitmap = NULL;

	_fi_flags = flags;
	_fi_format_id = s_format_id;

	try {
		if (NULL == handle) {
			throw("Cannot open file");
		}

		if (!_headerInfo.Read(io, handle)) {
			throw("Error in header");
		}

		if (!_colourModeData.Read(io, handle)) {
			throw("Error in ColourMode Data");
		}

		if (!ReadImageResources(io, handle)) {
			throw("Error in Image Resource");
		}

		if (!ReadLayerAndMaskInfoSection(io, handle)) {
			throw("Error in Mask Info");
		}

		Bitmap = ReadImageData(io, handle);
		if (NULL == Bitmap) {
			throw("Error in Image Data");
		}

		// set resolution info
		if(NULL != Bitmap) {
			unsigned res_x = 2835;	// 72 dpi
			unsigned res_y = 2835;	// 72 dpi
			if (_bResolutionInfoFilled) {
				_resolutionInfo.GetResolutionInfo(res_x, res_y);
			}
			FreeImage_SetDotsPerMeterX(Bitmap, res_x);
			FreeImage_SetDotsPerMeterY(Bitmap, res_y);
		}

		// set ICC profile
		FreeImage_CreateICCProfile(Bitmap, _iccProfile._ProfileData, _iccProfile._ProfileSize);
		if ((flags & PSD_CMYK) == PSD_CMYK) {
			short mode = _headerInfo._ColourMode;
			if((mode == PSDP_CMYK) || (mode == PSDP_MULTICHANNEL)) {
				FreeImage_GetICCProfile(Bitmap)->flags |= FIICC_COLOR_IS_CMYK;
			}
		}

	} catch(const char *text) {
		FreeImage_OutputMessageProc(s_format_id, text);
	}
	catch(const std::exception& e) {
		FreeImage_OutputMessageProc(s_format_id, "%s", e.what());
	}

	return Bitmap;
}


text:
Nix Wadden Blog
Bus Tour to Italy
A kind invitation to join in a military-sponsored bus tour to Italy in 1987 proved a delightful adventure shared with closest family members. Brothers Mike and Ed Davis were serving with Canadian Forces in Lahr, Germany so they gladly booked passage for wives Peggy (Madeline's sister) and Miriam, and asked us to go along.
It was a top notch itinerary – busing through Germany and Switzerland to a first stop in Florence, moving on to Pisa, then Rome, and further south to Pompeii. Breaking up the homeward run was a few days resting at Lake Garda in the northern Italy lake district.
We flew to Frankfurt, Germany and went from there by train to Lahr.
Borrowing a car for a few days we got to see parts of Germany and the Alsace-Lorraine area of France. A highlight was driving up a steep and scary hill to enjoy spectacular views from a nunnery perched on Mont Ste-Odile, and see Stations of the Cross etched into the rock face.
An offbeat point of interest along the homeward journey was a memorial marking the infamous Maginot Line, a massive defence system erected by the French after the First World War but totally overridden by German tanks in the early days of World War Two.
Our two week bus tour took us through Switzerland, traversing the extremely long St Gotthard tunnel, and landing us in the beautiful and exciting city of Florence.
Memorial Day at Ypres
On November 11, 1987, we had the extremely emotional experience of attending a Memorial Day service at the iconic Menin Gate in the Flanders Fields town known as Ieper in Belgian and as Ypres in French. It was from this spot that the thousands of World War One soldiers set off to battle in what was known as the Ypres Salient.
Old Soldiers marched proudly while bands played and crowds surged to share in remembrance of all who had fallen.
Built in 1927 in the form of a Roman triumphal arch, it stone walls are engraved with the names of nearly 55,000 British and Commonwealth soldiers lost in the field of battle but with no known graves.
Canadian names were prominent but none were seen from Newfoundland although the Nfld Regiment – including Madeline's father, Richard Roche, also fought there.
Buglers have played the Last Post on this site at 8 p.m. every day since the Memorial Gate was erected.
Poignant moments marked the showering of poppy petals into the Memorial.
A nearby site of special interest to Canadians is the St. Julien Memorial and park located in the village of Saint-Julien, Langemark.
It commemorates the Canadian First Division's participation in the Second Battle of Ypres of World War 1 which included fighting in the face of the first poison gas attack along the Western Front. The tall imposing structure is surmounted by Frederick Chapman Clemesha's sculpture, The Brooding Soldier.
Driving through that whole area and the valley of the Somme was a sad and sobering experience, seeing almost countless numbers of headstones in huge memorial parks, honouring those who had fought and died in what was supposed to be the war to end all wars.
(Note: This is a re-posting of an earlier blog because of some technical problems.)
Mailing is Failing
Canada Post boxes
As a medium of communications, the old fashioned snail mailing of letters can be worth trying, but here's one example of how unproductive it can be.
Keen to promote awareness of the booklet "The Waddens: A Family History" which I self published early this year, I decided to try a mail out to every Wadden name I could find in Canada Post listings. It came to just over 100, for all of which I included postal codes. They were scattered across the country, with the largest single block in Cape Breton. One full month later, here is the score: four positive responses, all of which resulted in a booklet sale, for which I am most grateful; but as many as 19 have been returned to date by Canada Post. Some were indicated as moved or unknown, while many addresses were shown as incomplete. Returned letters trickled in, one as late as yesterday.
Lessons to be learned from this exercise :
1) my booklet is no best seller
2) Waddens aren't great readers
2) Canada Post address listings are sadly out of date
3) Snail mailing of letters is a lot more obsolete than I ever imagined.
On November 11, 1997, we had the extremely emotional experience of attending a Memorial Day service at the iconic Menin Gate in the Flanders Fields town known as Ieper in Belgian and as Ypres in French. It was from this spot that thousands of World War One soldiers set off to battle in what was known as the Ypres Salient.
Built in 1927 in the form of a Roman triumphal arch, its stone walls are engraved with the names of nearly 55,000 British and Commonwealth soldiers lost in the field of battle but with no known graves.
Canadian names were prominent but none were seen from Newfoundland although the Newfoundland Regiment – including Madeline's father Richard Roche – also fought there. Buglers have played The Last Post on this site at 8 p.m. every day since the Memorial Gate was erected.
A nearby site of special interest to Canadians is the St. Julien Memorial and park located in the village of Saint-Julien, Langemark. It commemorates the Canadian First Division's participation in the Second Battle of Ypres of World War I which included fighting in the face of the first poison gas attacks along the Western Front. The tall imposing structure is surmounted by Frederick Chapman Clemesha's sculpture, the Brooding Soldier.
Driving through that whole area, and the valley of the Somme, was a sad and sobering experience, seeing almost countless numbers of headstones in huge memorial parks honouring those who had fought and died in what was supposed to be the war to end all wars.
Lost Weekend – Without TV
blank TV Set
Memories of olden days when family grouped around the fire place, digesting supper and listening to evening news on the standup cabinet radio, came flooding back on Hallowe'en weekend. Just idle thoughts really, brought on by an unexpected and quite unprecedented event – we had no TV to watch.
Think of it! Five nights running with no television to while away those leisure hours, reclining snugly in lazy boy comfort before images of nightly news, serial drama (Chicago Fire, Midsomer Murder, Paradise Island, Murdoch Mystery), and humour (Still Standing, Doc Martin, Stephen Colbert).
Daytime TV is rarely viewed in our house, except maybe for golf, CNN and Canadian news channels. Computers get far more attention. But evening hours are TV times, so a blank screen is seldom seen.
Doing without it, while strange, has its compensations. More time for reading – books, that is, not just crosswords and sudokus.
Even dug out the old Scrabble Game and kept at it all one evening.
Cause of it all was apparently some fatal disorder in a Bell Fibe wireless receiver. Consultation with knowledgeable and courteous Bell staff tracked down the source and an order was placed for delivery of a replacement unit. Thankfully received Monday and skillfully installed by my 80 plus wonder woman spouse, it did the trick, and our wide screen TV is back in business.
Beautiful Bruges
Bruges Guildhalls
Once a port of international standing, Bruges was founded as early as the 7th century on the banks of the Zwin River, growing up around the Burg fortress built by the Counts of Flanders. Economic decline began with silting up of the river in the 15th century, but the city soon regained its former splendour as the seat of the Dukes of Burgundy. Its ancient architecture and superb collections of works of art are only part of its rich heritage.
Bruges canal
From the 14th century onward its mastery of wrought ironwork, tapestry weaving, embroidery and lace making has been world famous.
Unlike other European cities, Bruges was spared from destruction during two world wars.
The 20th century building of the Zeebruges canal re-opened access to the sea, further ensuring its continued prosperity. A network of canals winding through the city adds greatly to its many charms.
The Belfry and Market Hall and the market square in front of it have been the hub of city life since the 14th century.
The colourful corbie-stepped gable topped buildings were originally guildhalls, identified by their rooftop symbols.
Michelangelo's wonderful Carrera marble sculpture, "Our Lady and the Child Jesus" is one of the artist's few works to leave Italy. Reposing in the Church of our Lady, it was donated to the church by a Bruges merchant in 1506.
A memorable macaroni and cheese dish featuring four most delectable cheeses – first consumed on an earlier Bruges visit – drew us back for seconds to this fine eatery.
Belgium By Ways
Winding up our 1997 dream trip to Greece with a leisurely driving trip from Holland to Belgium couldn't have been more enjoyable. We had seen much of the Netherlands some years earlier and just had to return to Bruges, our favourite European city.
After stopping inside the Dutch border at Amersfoort and Breda, we made a sight seeing visit to Ghent, a city noted for its medieval buildings and rich history. In the early middle ages it was the second largest and richest city in Europe. Notable buildings included the 12th century Belfry Tower, offering fabulous views of the city centre, and St. Bavo's Cathedral.
Ghent is a city and a municipality in the Flemish Region of Belgium. It is the capital and largest city of the East Flanders province, and the third largest municipality in Belgium. Its architecture ranges from medieval to modern. It is regarded as one of Belgium's most beautiful communities.
Most rewarding was our leisurely four days in Bruges, relishing fine weather which allowed ample time to explore its splendid medieval treasures.
We were told that, for all the destruction German armies inflicted upon cities in two world wars, it left Bruges virtually untainted because of its remarkably well preserved medieval heritage.
Mennin Gate
An especially poignant side trip brought us to Remembrance Day ceremonies at the Mennin Gate in Ieper (better known by its French name, Ypres), Belgium. Thousands of Canadian names are etched into the hallowed walls of this extraordinary Great War monument.
And, just because it was so near, we had to drive a few kilometres over the French border to stop by the signpost to Armentières. But no such luck. Nary a mademoiselle to be seen!
Flying from Amsterdam to Montreal we did it really in style as Business Class seats were at the last minute confirmed. First, we each got a personal toiletries bag. Next, a choice of orange juice or a glass of champagne. I took the champagne. A delicious seafood meal was accompanied by top quality red or white wine. And as a final KLM touch, a gift to take home: Bols gin in a blue delft model of a typical Dutch dwelling. Ahhh, luxury indeed!
A Taste of Turkey
Extending a cruise among the Greek Islands to sail into Turkeys' capital, Istanbul, added an exciting dimension to our 1997 tourist visit to Greece. Along the way, our ship made one stop on the Turkish coast to allow tour groups to explore the ancient Greek city of Ephesus. We bowed out of that visit while I did some sight seeing in the attractive port of Kusadasi.
One notable structure was a colourful monument dedicated to long time Turkish ruler Kemal Ataturk. He was the founder and first president (1923-38) of the Republic of Turkey. He modernized the country's legal and educational systems and led a secular government which encouraged a European way of life.
Arriving in Istanbul was an outstanding experience in viewing its numerous religious and commercial centres. Visiting the Grand Bazaar was hectic at times because of so many young people selling souvenirs of all kinds. We watched a carpet sale and were taken on tours of major Muslim sites, including the Sultan Ahmed Mosque, known as the Blue Mosque because of the blue tiles adorning its interior. Much larger and older was the so-called Red Mosque, Hagia Sophia, which was built originally in 360 A.D. and functioned for more than a thousand years as a Christian church, St. Sophia's.
The Topkapi Palace, once centre of the Ottoman empire and now a museum, was also of much interest. This was partly because of the charming 1960s heist movie of the same name, starring among others Melina Mercouri, Maximilian Schell and Peter Ustinov.
An entertaining evening at a restaurant-night club introduced us to the exotic charms of Turkish folk music and belly dancing.
The Greek Isles Mykonos and Patmos
Mykonos, perhaps the most popular of the Greek islands, was pleasantly short of tourists on our late season visit in 1997, allowing us plenty of time to meander through its colourful walkways.
A brief interlude brought us to Patmos, famed among biblical scholars as the site where Saint John the Evangelist wrote the Book of Revelations, though we resisted the temptation to explore the site of his domain high above the town.
Aboard the comfortably sized Stella Oceanis, carrying just a few hundred passengers, time for sight seeing was limited, as sailing was done mostly at night.
One sunny day, however, brought out the sun bathers.
Who To Vote For
It should be a simple answer – turf out the present government if you don't like it, or keep it going if you do, and vote for it accordingly. This time around though, a lot of people don't much like the government we have, so they want to make sure it's on the way out. Question is – what is the smart way to make that happen?
So much of this year's campaigning has been low blow skirmishing, trading of insults and fulminating about personalities that basic electoral aims have somehow gone all askew. Greedy appetites are showered with grandiose promises of billions here and billions there, and nary a mention that grandkids only will have to pay for them. The political cycle rolls merrily on – only those who promise the most can get elected; those daring to cut back costs of services gain only instant vilification.
Whether party leaders have sunk or shone in the public eye, the ultimate voting decision should come down to the basics that matter most: Do I want the Liberals to stay in office, or do I not?
Only the Conservatives, despite their share of blemishes, offer any real alternative. NDP has strong but limited support. Greens even more so. Scattering votes too broadly lessens the chance of turfing out the incumbents.
Keep your eye on the endgame, please!
That 1959 St. John's Blizzard
The John Crosbie Roast of 1986
Taking Down the Tree
A Step Away From Facebook
Nix on Winning The Big One
Carolyn Molson on Winning The Big One
Barbara (Brown) Todd on Winning The Big One
Robert Duncan on Bye Bye To Plastic
Nix on World Fishing Exhibition in Marseilles
rants a little

redpajama_set_name: RedPajamaCommonCrawl


New laws have been passed within the EU that, quite frankly, make no sense and are wholly unenforceable. If you haven't heard of them, they're called Article 11 and Article 13. Each is as ridiculous as the other.
So, what are they are what do they mean for you?
Let's start with Article 11. Article 11 is something that newspaper barons, like Rupert Murdoch, have been demanding for many years. Article 11 relates to links to newspaper reports on their website from news aggregators, such as Google News. When Google News features a title, a snippet of text and an image linking to a news source, such as the Telegraph or Daily Mail, then that is covered by Article 11. It has decreed that payment, renumeration, should be made by the aggregator (Google) to the publisher.
In short, if a news publisher's content is used by a news aggregator, they should be paid. Now, as I said at the time Rupert Murdoch first moaned about this, it shows a basic lack of understanding of how the internet works. If a news publisher, such as the Daily Mail, expects Google to PAY them money for using a snippet of their content that then sends them traffic, they must have completely lost the plot.
I realise the printed media is dying in terms of the press, and everything is going online, but they need to find a better way to monetise their content than by expecting Google to pay them for sending them traffic.
Isn't that more likely to be the other way round? If the Daily Mail earns money for adverts placed on its website, adverts which are seen when people land on the website to read its content, where do they think these people are coming from in the first place?
If I was Google I would simply remove them from their index. Problem solved. I fully expect that to happen to any publisher who attempts to force payment for their content being seen in Google.
Additionally, a content aggregator could also be seen as a social media website, such as Facebook or Twitter. Does this mean anyone sharing links from news sites to their own social media would also be expected to pay for republishing part of it? The directive for Article 11 does apply an exemption to "legitimate private and non-commercial use of press publications by individual users", so that should mean you or I sharing content on social media should be OK, but what about influencers? What about those people who have hundreds of thousands of followers and receive money for sponsored posts? They're not 'non-commercial'. They could be forced to pay under these new ridiculous rules.
OK, now let's look at Article 13 – as that's even more crazy.
Article 13, at its heart, makes sense. It's aiming to stop copyrighted material being shared on social media. This, in turn, ensures the creators of the content get paid for their work.
In theory this all sounds great. However, in practice, it's an absolute nightmare.
Article 13 states that websites that allow users to upload content are responsible for the content being uploaded, and can be held financially liable for any content added. On the large scale, this applies to websites such as YouTube, where 400 hours of video footage are uploaded every 60 seconds by its users. YouTube would be responsible for policing every second of that footage to ensure it doesn't contain copyrighted material, or face the consequences.
This, as you can imagine, is impossible. YouTube does have automated systems in place to identify copyrighted material and allow the rights holders to either force its removal, or monetise with adverts. However this doesn't work very well. I, myself, had a video flagged for copyrighted material because it apparently contained the sound of a helicopter that was taken from a sound effects CD – even though the sound was recorded by me at the time.
As I say, it doesn't work properly.
At the other end of the scale, the owner of any website where people can upload content would be held liable for the content uploaded. This includes comments on blogs, forums, image sharing websites and essentially anywhere that a person can upload something – which is pretty much anywhere on the Internet.
I can immediately see the potential situation where someone with a grudge could deliberately and maliciously upload a copyrighted photo or video to a website owned by a company or person just to get them into trouble.
There is another issue – memes. Memes all use copyrighted material, therefore they're included in Article 13. Posting memes to social media, such as Twitter and Facebook, and posting them in forums, would be in breach of Article 13.
Fear not, as memes may actually be OK. There is no clear word as yet on whether or not memes would be outlawed as they are parodies and, if they are considered parodies, they may well escape the attention of Article 13, but who's going to take that risk?
I hope that's cleared everything up for you regarding the EU and the internet, and how Articles 11 and 13 will, or won't, affect you.


Whatever the scale of change, we believe good design supports and enriches the experiences of people who use the place. One of our key areas of work is to provide advice on design. A&DS supports investment in homes and public buildings, and everything in between. Our work involves advice on small learning spaces and community gardens, through to the major hospitals and the Queensferry Crossing. Our experience helps us share approaches that work. We aim to help you get the best from your project. We use the learning we gain from our advice work to help build wider professional capacity.
Supporting public sector clients in their approach to the market. This aims to help them attract the right partners or skills for the project.
Providing advice during the design development stage to help clients, design team and the planning authority to recognise and prioritise the benefits for people.
Pre-design Advice for Housing: support to Local Authorities and Housing Associations in promoting sites for housing and approaching the market.
Place Standard support: support for public authorities and communities in using the Place Standard tool to establish priorities for change in an area.
Design Advice on Housing: working with housing developers and public authorities to create more and better homes.
Design Advice on Schools and Learning Spaces: supporting pupils and teachers to develop briefs for new schools, then assisting the client and design team to test the design to ensure the qualities sought are realised.
Tests of Change: working with children and teachers to co-design alterations to existing school environments to make better places for learning for that school, and to provide models of learning environments for future schools.
Design Advice on Health: supporting patients, public and healthcare professionals to develop briefs for new NHS facilities. Assisting the client and design team to test the design to ensure the qualities sought are realised and providing advice to government on the extent to which this will be achieved so that can inform investment. This work is delivered in partnership with Health Facilities Scotland.


We are registered Merit Badge Counselors who are also Park Naturalists by profession which teach a variety of Boy Scout and Girl Scout badges.
We teach the following Boy Scout Badges as a intensive one day course: Bird Study, Environmental Science, Fish and Wildlife Management, Forestry, Geology, Indian Lore, Mammal Study, Nature, Soil and Water Conservation, and Weather.
The scouts are not guaranteed to earn the badge if they take the course, but only if they successfully complete the requirements.
We also conduct Webelos courses for the Cub Scouts.
In addition we teach an array of nature related Girl Scout Badges from all ranks, Brownie, Junior, Cadet, and Senior.
Our goal is to help your scout progress to the rank of Eagle Scout or Gold Award Scout.
Sign up for the opportunity to earn one to two merit badges a day. Join us as we delve into these topics during our hands-on, interactive, interpretive merit badge sessions.
All of these classes are taught by our BSA registered merit badge counselors.
Prices: $45/course/scout/day $85/two courses/scout/day .
Contact: Park Naturalist Brian Kristal, at (410) 374-0336 to register for a course.


text:
Home»Posts Tagged "GNA"
Browsing: GNA
Libya is fertile ground for terrorism promoted by the West
4 Mins Read June 1, 2021
Steven Sahiounie, journalist and political commentator The relative settlement between the Government of National Accord (GNA) and the Libyan National…
The UN is failing in Libya. Who is to blame?
Steven Sahiounie, journalist and political commentator The Acting Special Representative of the UN Secretary-General for Libya, Stephanie Williams, continues attempts…
The Libyan Political Dialogue Forum: Will it save Libya or destroy the country?
Steven Sahiounie, journalist and political commentator The Libyan Political Dialogue Forum (LPDF), organized by the UN Support Mission in Libya…
Libyan oil export agreement between GNA and LNA the first step toward peace
5 Mins Read September 23, 2020
Steven Sahiounie, journalist and political commentator Vice-Chairman of the Presidential Council of Libya, Ahmed Maiteeq announced that he had reached…
Pinpoint Libyan Airstrikes Destroyed Turkish Air-Defense System in AL-WATIYA Air Base
2 Mins Read July 5, 2020
The Libyan Air Force has destroyed a Turkish MIM-23 Hawk air-defense system in al-Watiya Air Base in the western Libya,…
GNA and TURKEY Primed For Offensive on Sirte , But There Appears To Be No RUSH
On June 10th, the offensive on Sirte by the Government of National Accord (GNA) and its Turkish support are on-going.…
Turkish Advanced Anti-aircraft GNA Spotted Near Libya's TRIPOLI
1 Min Read June 10, 2020
On June 9, Twitter user Aldin shared satellite images showing what appears to be a Turkish-made KORKUT self-propelled anti-aircraft gun (SPAAG) in…
Libyan Army shoots down 2 Turkish drones near strategic city
The Libyan National Army (LNA) announced on Saturday that their air defense forces shot down two Turkish unmanned aerial vehicles…
How Are The Latest Changes On The Battlefield in Libya Affecting International Diplomatic Efforts?
13 Mins Read June 7, 2020
After 14 months and hundreds of lives lost, military commander of the 'Libyan National Army' (LNA) Khalifa Haftar's attempt to…
Libyan government forces retake Haftar's last stronghold in west
Libya's government forces have regained control of the strategic town of Tarhuna in the southeast of the capital Tripoli, the…


Are You Protecting Your Teeth from the Causes of Toothaches?
Are you protecting your teeth from the causes of toothaches? A toothache refers to an increase in sensitivity produced when nerves within your pulp, located in the roots of your teeth, are damaged. This can be the result of an infection, an oral accident or injury, bad oral hygiene, or tooth loss including extractions, and in some situations, the pain may be felt in the mouth, face, ear, and jaw.
– Wisdom teeth continue to cause aches when erupting above the gum line, causing inflammation.
– Aches are felt even after using over-the-counter medications.
– High fevers or chills that linger may be an indication of a toothache.
– Facial rashes that cannot be easily explained or linked to another problem.
– You have soreness in your face or have a fever which may be the result of an abscess or noticeable discharge that can be seen or felt around a tooth.
– Severe pain continues for longer than 24 hours after a tooth has been removed.
– A tooth has been forcibly knocked out from an accident or blunt trauma.
If you are looking to restore damaged teeth, or enhance your smile further, contact Dr. Kinney, Musser and Kinney and our team at Art & Science Family Dentistry. We can be reached by calling us at 651-739-1894 to book a reservation to see us at our dentist office in Woodbury, Minnesota. We will be glad to help you achieve the results you are looking for.


New York St Patrick's Day Parade 2017 Grand Marshal Michael Dowling.
The New York City St. Patrick's Day parade will host its annual installation ceremony for grand marshal Michal J. Dowling and the aides to the grand marshal on Sunday, February 26, at 3 p.m. at Antun's, 96-43 Springfield Boulevard in Queens Village.
Dowling, president and chief executive officer of Northwell Health, and is believed to be the first head of a hospital to lead the 256-year-old parade.
Aides to the grand marshal are chosen by the Parade's participating organizations in recognition of outstanding service to the Irish American Community of New York. Selection of an aide is acknowledgement of years of unselfish, dedicated and distinguished service to the New York and Irish communities and for their contribution to Irish faith, culture and heritage.
Aides for 2017 are aide-at-large, Monsignor Kevin Sullivan, executive director, Catholic Charities of the Archdiocese of New York; aide-at-large, Colonel Patricia Groeber, New York State Police; Knights of St. Patrick, Michael Cremin; Westchester County, Kevin Ellis; Orange County, Therese (Terry) Meyer; Richmond County, Ann Clarke; United Irish Counties, Garrett Doyle; Suffolk County, Tom McKenna; New York County, Edward C.J. Meehan; Nassau County, Peter Begley; Bronx County, Daniel Donovan; Kings County, Tom Crockett; Queens County, Thomas Brendan Jones; Rockland County, Helen Kilgallen Murphy; Grand Council of Emeralds, Brian Coughlan.
Tickets to the installation ceremony and dinner are $100.
Visit NYCStPatricksParade.org for more information.


text:
Investment, Delegation of Authority to the University of Toronto Asset Management Corporation (UTAM)
DELEGATION OF AUTHORITY made as of the 25th day of June, 2010
(hereinafter called the "University")
UNIVERSITY OF TORONTO ASSET MANAGEMENT CORPORATION
(hereinafter called "UTAM") OF THE SECOND PART
WHEREAS the University wishes to invest such of the money, investments and investment funds and the pension funds that come into the hands or are under the administration of the University (the "University Assets" and "Pension Assets" respectively;)
AND WHEREAS the University sets investment risk and return targets and specifies other requirements in its investments policies, and their regulations, of or approved by the University, its Business Board or a committee to which it delegates authority, as amended from time to time (the "Investment Policies"), for funds in which it wishes to invest;
AND WHEREAS UTAM was incorporated pursuant to the Corporations Act (Ontario) by Letters Patent dated April 25, 2000, for the following objects, inter alia:
"(a) to manage, or see to and supervise the management of, the money, investments, investment funds and pension funds that come into the hands or are under the administration of The Governing Council of the University of Toronto, subject to and in accordance with the applicable policies from time to time approved by or on behalf of the Council; and
(b) to carry out such other duties and responsibilities on behalf of the said Council as may be properly delegated or assigned to the Corporation;"
AND WHEREAS the University wishes to delegate authority to UTAM to permit it to act as agent for the University in respect of the matters hereinafter set out;
NOW THEREFORE THIS DELEGATION OF AUTHORITY
WITNESSETH the terms of such delegation are as follows:
DELEGATION OF AUTHORITY
Terms of Delegation: The University hereby delegates to UTAM, with permitted delegation by the UTAM Board to UTAM staff, should the UTAM Board so desire, the power and authority to take all such actions and execute all such documents as may be necessary or desirable to:
recommend the investment strategy from time to time for the University Assets and the Pension Assets including, without limitation, making asset allocation recommendations concerning the University Assets and Pension Assets for consideration and approval by the University;
execute the investment strategy for the University Assets and the Pension Assets, subject to such terms, conditions and limitations as are specified from time to time by the University; and
undertake such additional activities concerning the University Assets and the Pension Assets as may be specified from time to time by the University;
which collectively are referred to as the "Services".
Authorization to act: Any matter with respect to which UTAM is authorized to act as the University's agent may be undertaken by such officer or officers of UTAM as are authorized to take such action in accordance with a resolution of the directors of UTAM. All agreements and other documents executed by UTAM as agent for the University shall be executed by such officer or officers of UTAM as are authorized to execute same in accordance with resolutions of the directors of UTAM (in force from time to time) in the following manner, and if so executed, the University acknowledges that such agreement or document is binding upon the University:
"UNIVERSITY OF TORONTO
ASSET MANAGEMENT CORPORATION
as agent on behalf of the GOVERNING COUNCIL OF
THE UNIVERSITY OF TORONTO
Per_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ "
Other services: As permitted by regulation and subject to the prior approval of the senior officer of the University responsible for financial matters as so designated by the President of the University (the "senior university officer") on behalf of the University in each instance, and upon such terms and conditions as the senior university officer may prescribe, UTAM may also, as provided in its said Letters Patent, and provided that the quality, level and timeliness of the Services provided to the University are not impaired in any way:
manage, or see to and supervise the management of, the money, investments, investment funds and pension funds that come into the hands or are under the administration of any university, college or institution that is federated or affiliated with the University; and
manage, or see to and supervise the management of, the money, investments, investment funds and pension funds that come into the hands or are under the administration of other charitable or non-charitable, philanthropic and not-for-profit organizations, institutes and associations;
which collectively are referred to as "Other Services".
Examples of institutions falling under (a) above are the universities federated and colleges affiliated with the University, its affiliated teaching hospitals and The Toronto School of Theology and its member institutions. Examples of organizations falling under (b) above are other universities, community colleges and educational and research institutes.
GENERAL RESTRICTIONS
Investment Management Agreement: UTAM shall enter into an investment management agreement (the "IMA") with the University, to be amended from time to time, and pursuant to which it will exercise the power and authority delegated to it under this Delegation of Authority in providing investment management services to the University as agent of the University.
Other Instructions: UTAM will also be subject to and act in accordance with any other instructions issued by the University pursuant to the IMA from time to time, including, without limitation, specifications of permitted and prohibited investments that may arise from University policy or from other means.
Limitation on Authority: Nothing contained in this Agreement shall be construed to give UTAM or any of its officers, directors or employees the power to take any action on behalf of the University which is outside the scope of its authority hereunder or under the IMA, or shall constitute the parties as joint venturers, partners, co-owners or otherwise as participants in a joint undertaking.
Termination by University: The University may terminate this Delegation of Authority pursuant to the then current IMA executed by the University of Toronto and UTAM.
Indemnity: The University, hereby agrees to Indemnify the directors and officers of UTAM from and against all costs, charges, and expenses for which the directors and officers of UTAM are entitled to indemnity under By-law No. 1 of UTAM.
Invalid Provisions: The invalidity of any particular provision of this Delegation of Authority shall not affect the validity of any other provision and in such event, the Delegation of Authority shall be construed as if the invalid provision had been omitted.
Governing Law: This Delegation of Authority shall be construed and interpreted in accordance with and governed by the laws of the Province of Ontario and the laws of Canada applicable therein.
Notices: Any notice required or permitted to be given hereunder by one party to the other shall be in writing and hand-delivered, in the case of notice to the University, to it in care of the Office of the Vice-President, Business Affairs, Simcoe Hall, 27 King's College Circle, Toronto, M5S 1A1, marked for the attention of that officer, and in the case of notice to UTAM, to it at MaRS Centre, Heritage Building, 101 College Street, Suite 350 Toronto, Ontario, Canada M5G 1L7, marked for the attention of its President, with a copy similarly delivered and marked for the attention of its Chair of the Board, and any notice so delivered shall be deemed to have and become effective on the second business day following the day of delivery.
IN WITNESS WHEREOF the University has caused this Delegation to be executed and sealed under the hands of its officers, duly authorized.
Amendments to sections 4, 6, 7 and 8 of the University of Toronto Asset Management Corporation By-Law Number 1, approved by Business Board, June 17, 201O


Whiteline Front & Rear Sway Roll Bar Kit. Engineered to'Activate More Grip', BFK004 is a packaged solution designed to improve performance and enhance the driving experience of your vehicle. Boasting a 26mm 3 point adjustable front sway bar and 24mm rear sway bar, the kit is completed with high quality sway bar links and mounting accessories that ensure optimum performance and ease of installation.
Achieve perfect balance and precise tuning with this Whiteline Sway Bar Kit. Massive reduction in body roll when driving fast through bends.
Made from cold formed, high strength aircraft grade steel for precision performance. Decreases load shift between inside wheel to outer wheel.
Reduces under steer to over steer characteristics on most vehicles. General increase in corner speeds can be achieved.
Polyurethane up-rated bushes included in the kit. Whiteline Anti Roll Bars are designed to reduce body roll. By reducing body roll, lateral loads are spread more evenly across the tyres thereby increasing cornering grip and improving outright performance. We try to respond to messages within 24 hours. If you do not receive a response within 24 hours please send us another message.
Please be aware that some of our items are made to order and can carry up to a 14 day lead time. Information on lead times for all made to order items will be included in the Product Description. Upon receipt of your order you will be asked to sign for the goods received in good condition. The item "Ford Focus Mk2 LV RS (2009-2012) Whiteline Front & Rear Sway Roll Bar Kit" is in sale since Friday, February 16, 2018. This item is in the category "Vehicle Parts & Accessories\Car Tuning & Styling\Performance Suspension\Performance Sway Bars".


text:
Two Defensive Linemen Done
By AndyPanda Aug 24, 2010, 5:42pm PDT
Share All sharing options for: Two Defensive Linemen Done
On the heels of the dismissal of Tyler Thomas, Oregon St. head Coach Mike Riley had to announce today the end of two defensive linemen's playing careers. Junior defensive tackle Tonu Tuimalealiifano and senior defensive end Mitchel Hunt have both had to hang up the gear, due to knee injuries.
Tonu T. and Hunt both players went to extraordinary lengths to try and keep playing football, according to Riley.
"They worked hard to get back, to give it another shot. But eventually they kind of came to their own conclusion. … truly, this is kind of a lifetime decision."
Both players will retain their scholarships, staying at Oregon St. this year, and help out any way they can. They remain good standing members of the team, just unable to play.
Hunt has undergone two surguries, and though Tonu has only had one, his was a microfracture surgery, after a significant injury.
Riley said Oregon St. will appeal to the NCAA the possibility of doing something with at least one of the scholarships. By rule, once camp starts, players can't be replaced, even those that are out for medical reasons, for a year. The NCAA can allow an additional scholarship over the limit on appeal, however.
In that case, OSU can immediately grant an additional scholarship. Oregon St. may find out in a few weeks, in which case Riley can "reward'' a walk-on senior that will graduate.
"If I can get that done,' it would be great.''
Riley emphathized with both players' unfortunate injuries.
"Nobody tried harder. Both of them were really, really tremendous rehab guys."
Riley also addressed the Thomas situation.
"Now the other thing, it's totally wasted. It's a tragic thing, and we can't make rhyme or reason to bad decisions sometimes. ... we like every program, continually talk about those choices that you make.
I said it Saturday afternoon when we broke camp; somebody across America tonight in a college football camp, coming out with their first night off of camp, is going to make a decision that changes their life. And then I had to tell the team last night that it happened to our team. ... I hate it, but it was not a hard decision.
Somebody did indeed change the course of their life. We just hope it's not a life sentence."
The loss of defensive players further increases the likelihood that true freshman Scott Crichton will be in the rotation at defensive end.


Five-Year Graduate Follow-Up Study: A Survey of the Long-Term Successes of 1981 Graduates.
John Tyler Community Coll., Chester, VA. Office of Institutional Research.
Authoring Institution: John Tyler Community Coll., Chester, VA. Office of Institutional Research.


text:
Shin Getter Robot – manga del 1997 di Ken Ishikawa
Shin Getter Robot – serie OAV del 2004

redpajama_set_name: RedPajamaWikipedia


Aaand we're back! All thanks to the find folks at DreamHost support. Or if you're reading this on Tumblr, EVERYTHING IS FINE AND NOTHING WAS EVER WRONG. Anyway, another Reddit prompt, from this post.
Prompt: A person has come to realize that each time they die they reincarnate further backwards in time.


text:
Fitriana Nur Indah S
Triyono Lukmantoro
Wiwid Noor Rakhmad
M Bayu Widagdo
Home > Vol 3, No 2 >	Indah S
Kontruksi Agama dan Identitas dalam film Cinta Tapi Beda (Analisis Semiotika Film Cinta Tapi Beda)
Fitriana Nur Indah S, Triyono Lukmantoro, Wiwid Noor Rakhmad, M Bayu Widagdo
Cinta Tapi Beda (2012) that produced by Hestu Saputra and Hanung Bramantyo is one example of the film with the theme of love story of different religions and ethnicities. When released in theaters, December 2012, the film has some pros and cons in the society. Many people found this movie humiliate Minangkabau ethnic group as native of Padang. However, it also had many positive comments because the film is considered to be able to describe the complexity of the love story of different religions and ethnicities in Indonesia. The purpose of this study was to examine how religion and identity construction carried out and communicated in Cinta Tapi Beda (2012). This study uses theory of social construction of Peter L. Berger and Thomas Luckmann in konstrutivis paradigm. The method used in this research is the analysis of semiotic codes of television technical analysis of John Fiske (in Fiske, 1987: 5), which is divided into three levels, namely reality, representation, and ideology.
From this research, the findings, which are syntagmatic Islam and Christian is displayed in a simple, not overdone, and obedient to the teachings of his religion. There is a difference between the portrayal of women by men who are Muslims. Munawaroh, Cahyo's mother and Retno , Cahyo's sister as Muslim women are described as soft and solehah. They wear veils as evidence of obedient on religion. While the appearance of Cahyo and Fadholi use man's clothes in general, but they use the peci when pray. They are also described as personal hard and adamant, but still obey to the teachings of religion. As for players who are Christians, the appearance of men and women there was no significant difference. They look like in general. The use of accessories such as necklaces cross only Diana and David.
The second finding is based on paradigmatic analysis performed is the myth of religion is presented, which is considered both religion is intolerant of other religions. Other findings is the truth claims made interreligious conflict. Understanding of different religions romantic relationship with all the obstacles. Finally, the attitude of tolerance towards religious pluralism and identity.
Cinta Tapi Beda, construction of religion and identity, semiotics


One of the seven north eastern states of India, Tripura is a developing state which is undergoing various stages of progress in order to become an advanced place. Health, which is a very important sector in a state is looked after by the government of Tripura with due care. Steps are being taken in order to set up the best hospitals here and provide the best schemes to the people. According to data of 1999-2000, the number of doctors in Tripura stands at 32 per 100,000 persons, 32.9 nurses ber 3.6 persons and 30 midwives per 100,000 persons.
Of the eight districts in Tripura, 5 are RNTCP reporting districts of TB. The districts also have sub-districts for better execution of the programme.
In order to prevent some of the vector botrne diseases such as Malaria, Dengue, Lymphatic Filariasis, Kala-azar, Japanese Encephalitis and Chikungunya, the National Vector Borne Disease Control Programme (NVBDCP) was started by the Government of India.
A bacterial disease, the government has taken necessary steps in order to prevent Leprosy amongst the masses as well. The programmes aims at providing the best treatment to the already affected and preventing the spreading of the disease any further.
Tripura, one of the northeastern states in India, has several hospitals located in the major towns and cities here. There are also ambulance and blood bank facilities in case for dealing with any emergency health cases. Hospitals are being set up with the latest technologies so that the locals get the best of treatment for themselves.
The Agartala Medical college was established in the year 2005, whose foundation stone was laid by none other than, the then Prime Minister of India, Dr. Manmohan Singh. The college is entirely run by the Tripura Government and is affiliated to the Tripura University.
The Tripura Medical College is located at Hapania in the West Tripura district. Established in the year 2005 by the Government of Tripura and Global Education Net, it is the first kind of venture in India. From 2009 onwards however, due to the inability of Global Education Net to run the college, the college has been since then running through a registered society under the Government of Tripura.


text:
Holjapyx humidus är en urinsektsart som beskrevs av Smith 1959. Holjapyx humidus ingår i släktet Holjapyx och familjen Japygidae. Inga underarter finns listade i Catalogue of Life.

Källor

Larvborstsvansar
humidus


Hi Electrical Engineering friends, here is a complete collection of lecture notes & ebooks for fourth year engineering students of Electrical/EE branch. All these notes/eBooks will help you study and prepare well for your semester exams. These eBooks present the topics in easy and concise manner and are suitable for almost any AICTE accredited engineering college/university in India.
We keep updating Electrical/EE fourth year eBooks on this website from time to time and will add the links here as we go along. Please feel free to post any specific request below. Our team our several seniors on this website will be glad to help you out with your requirement of notes. Happy studying!
Admin Team - Can you please add this to the above list? Thanks.


Google's Street View is an excellent way to tour our home planet without leaving the comfort of your home. Now, you can break free of Earth's gravity and soar to the heavens with a virtual tour of the International Space Station.
NASA for years has provided the curious among us with a steady diet of YouTube videos highlighting what life is like on the International Space Station but thanks to Google, it's now possible to get an unprecedented look at the ISS (and do so at your own pace).
Zipping around in the ISS in 360-degrees with Street View can be a little disorienting but trust me, it's an absolutely fascinating experience that's well worth the effort. One could easily spend hours studying everything strapped down to the walls, reading hand-written notes and so forth. I highly recommend it.


text:
Ченозеро, Чернозеро — озеро на территории Сумпосадского сельского поселения Беломорского района Республики Карелии.

Общие сведения
Площадь озера — 1 км², площадь водосборного бассейна — 20 км². Располагается на высоте 81,0 метров над уровнем моря.

Форма озера лопастная, продолговатая: вытянуто с севера на юг. Берега сильно изрезанные, каменисто-песчаные.

Из юго-восточного залива озера вытекает безымянный ручей, втекающий с левого берега в реку Цепцу, которая втекает в реку Колежму, впадающую в Онежскую губу Белого моря (Поморский берег).

В озере расположены семь безымянных островов различной площади.

К северной оконечности озера подходит лесная дорога.

Код объекта в государственном водном реестре — 02020001411102000009070.

См. также
 Озёра Карелии

Примечания

Дополнительная литература

Бассейн Колежмы
Озёра Беломорского района


text:
Home » Soccer » Jesse Marsch admits Mateusz Klich's 'personality' will be difficult for Leeds to replace
Jesse Marsch admits Mateusz Klich's 'personality' will be difficult for Leeds to replace
Sign up to Miguel Delaney's Reading the Game newsletter sent straight to your inbox for free
Sign up to Miguel's Delaney's free weekly newsletter
Thanks for signing up to the
Football email
Jesse Marsch feels Mateusz Klich's personality will be the hardest thing to replace following the Polish midfielder's departure from Elland Road.
Klich bade Leeds United an emotional farewell after stepping off the bench in Wednesday night's 2-2 home draw with fellow Premier League strugglers West Ham.
The hard-running 32-year-old, integral to Leeds' Premier League return under Marcelo Bielsa in 2020, is expected to join Wayne Rooney's DC United in Major League Soccer.
Marsch, wearing a farewell T-shirt in tribute to Klich in his post-match press conference, said: "Well we have enough quality in the team, but his personality, his courage, his bravado, you know that that part will be tough to replace.
"And I even said to the team, we have to find a way to find our inner Klichy in all of us to make sure that we're ready to perform in every match."
Marsch could not guarantee Klich game time following the arrivals last summer of Brenden Aaronson, Tyler Adams and Marc Roca and said the Poland international had opted for longer-term stability in MLS.
Klich revealed in a statement on Twitter late on Wednesday night that he had been reluctant to leave and that his four-and-a-half-year spell at Elland Road had "been a dream".
He said: "I wish I could stay, but I've never enjoyed being on the bench and I want to play as much as I can in the coming years and that is why I'm closing this chapter, but I will never forget my time in Yorkshire."
Fellow midfielder Adam Forshaw's absence against West Ham has raised concerns among Leeds fans over his fitness issues.
Forshaw has been dogged by injury during his time at Elland Road and underwent career-saving hip surgery in the US in 2020.
Marsch said: "We had a little procedure done with him (on Wednesday) that we think is a couple of days and then we'll see how he recovers.
"It's his hip that is causing him some issues. But we're hopeful that, it's like a little shot that can help loosen things up and hopefully help him with the pain."
West Ham halted a five-game losing run and the point against Leeds lifted them out of the bottom three on goal difference.
Under-pressure boss David Moyes paid tribute to joint-chairman David Gold, who died on Wednesday aged 86, and insisted he still had the London club's full support.
When asked if Gold had been a stabilising influence, Moyes said: "Yeah, but David Sullivan has been equally as good, if not better.
"I've been speaking to him regularly and he has been fantastic in his support and his backing.
"They have been really, really good and encouraging me and the team, want us to get back in form and move up the table, that's the plan.
"We've got a European campaign, we're set for that when we get to March.
"There are a lot of things that have happened in the last two-and-a-half years that probably give them the confidence to think they've got a manager they can trust and they can work with."
Frenkie de Jong to Man Utd '95 per cent done' as Erik ten Hag to seal blockbuster reunion
Liverpool can target four Yves Bissouma transfer alternatives if Arsenal land Brighton ace
Tottenham transfer target urged to snub move after Bournemouth make £30m call
Cooper admits Forest could make ANOTHER signing before Leicester game
Emma Raducanu unhappy with 'slippery' court after ankle injury


text:
Rating by odds
Rating by lines
Rating on In-Play Betting
All bookmakers
Cash bonus
Risk free bet
Extra Place Offers
Early Payout Offers
According to sportsbooks
BoyleSports
Geoff Banks
mrplay.com
BetVictor
Fitzdares
Virgin Bet
32Red Sport
Matchbook
SponsioBet
Betting center
Today's matches
Tomorrow's matches
Experts about betting
Betting school
Betfair articles
How to withdraw from Betfair
How to Withdraw from Betfair: How Long Does It Take in 2023
Betfair Withdrawal methods
Betfair began life as a revolutionary concept and they would go on to transform the gambling market. Since their launch at the turn of the Millennium they have gone from strength to strength and today boast a whole suite of services, including a Sportsbook, Casino, Games Room, Bingo Hall, and Poker Site as well. As you would expect from such a market leading player they have a whole suite of ways for you to transfer money, including PaddyPower highstreet shops after the two companies merger a few years ago. There are also some niche alternative ways to withdraw funds, which we shall explain in detail below.
Betfair Withdrawal Options and limits
Withdrawal Method
Min limit
Max limit
(Visa or Mastercard)
ApplePay*
Prize Out Free 10 minutes £5 £500
Bank Transfer Free
£10 £100,000
"Express" Bank Transfer £6
1 Working day
PaddyPower Shops Free
*Available on iOS mobile apps only
Betfair Withdrawal Methods – Debit Card
Betfair accept all four types of debit card, namely Visa Delta, Solo, Visa Electron, and MasterCard. The deposit limit with these methods is just £5 and it is credited to your balance instantly. Withdrawals can take a little longer than other available methods but they are free and can be processed for as little as £1.
(Note that as is standard at UK bookmakers you can not use credit cards to deposit with)
Bookmakers who accept Debit Card
Betfair Withdrawal Method – Skrill
Skrill is an E-Wallet popular with UK sports bettors, allowing a degree of privacy and more often than not swifter withdrawal times than other methods. The minimum deposit limit here is a low £5 and the withdrawal limit an even lower £1, so you have a great amount of flexibility. Skrill is one of the quicker ways to withdraw, potentially taking as little as 4 hours.
Bookmakers who accept Skrill
Betfair Withdrawal Method – Neteller
Neteller is a Sister company of Skrill, both coming under the PaySafe Group umbrella company. They share a large number of features but interestingly Neteller has a slightly higher deposit limit of £2, which is still lower than the industry average but higher than Skrill. To compensate for this there is also a higher maximum limit, with Neteller allowing a massive £37,500 per withdrawal.
Betfair Withdrawal Method – PayPal
PayPal is probably the most well known E-Wallet in the UK due to its previous association with Ebay. It has branched out from the online auction site in recent years and now it is used for a broad range of online transactions, gambling transactions being one of them. The withdrawal time is very good, being as little as 4 hours to receive your money, but bear in mind that the £1 minimum withdrawal limit is good but there is also a relatively low maximum of £5,500 which could be restrictive for some people.
Bookmakers who accept PayPal
Betfair Withdrawal Method – MuchBetter
MuchBetter is the dark horse of the online E-Wallets used by gambling companies, they are new to the game but making a name for themselves in a good way. It prides itself on its ease of use and is one of the most convenient methods to use, although payouts potentially can take longer than other methods such as PayPal, Neteller, and Skrill, but this will vary from case to case. Betfair do not impose any limits on MuchBetter transactions so any limits set will be by MuchBetter on your individual account.
Betfair Withdrawal Method – Apple Pay
Apple Pay is available to users of Apple products using a mobile device to access Betfair. It is said to provide a safe and easy way to make payments through Apple iOS apps, Apple watchOS apps, and websites in Safari. By using Face ID, Touch ID, or double-clicking on the Apple Watch, users can quickly and securely transfer funds. Payments are authorized by using credentials that are stored on the Apple device in question.
Bookmakers who accept Apple Pay
Betfair Withdrawal Method - Prizeout
Prizeout is a withdrawal method available for Betfair customers in the UK and Ireland where winnings are paid via a Gift Card (instead of withdrawing to your bank or to another payment method). Prizeout are an independent company separate from Betfair who offer exclusive deals and offers to users in the form of digital Gift Cards and will often have attractive offers with great brands such as Amazon, UBER Eats, Dominoes Pizza, and more.
BetFair - Bank Transfer
Bank Transfer is always an option to withdraw from a UK online bookmaker and can sometimes be seen as the method of last resort. For example if you are having problems with another method for example your debit card has expired, or been lost or stolen, then a bank transfer can be used to return your funds to you. There is a fairly high minimum limit for a bank transfer of £10 but similarly the maximum amount that can be transferred in one go is £100,000, which is a lot more than most other methods.
BetFair - Fast Funds withdrawals
Fast Funds is the quickest withdrawal time when getting your funds from your Betfair wallet back into your bank account. Fast Funds is currently available to customers in the UK who deposited with a Visa Debit or Prepaid card. The withdrawal must be made back to this Visa card you deposited with. Fast Funds is not a withdrawal "method" in itself, but it is a system an increasing number of banks are using to speed up money transfers for their customers.
BetFair - High Street Cash withdrawals
In 2016 PaddyPower merged with Betfair and as they are the same company now PaddyPower shops on the UK highstreet can be used to withdraw cash from your Betfair balance. The money is paid to you straight away but you must remember to take official Government issued ID with you to confirm your identity. The withdrawal limit is advertised as being a minimum of just 1p and in practice the maximum limit will be decided by how much cash is held in the shop at the time of your visit.
How Long Does A Betfair Withdrawal Take?
How long a Betfair withdrawal takes will depend on a number of different things and there is not one fixed answer. Variables will include what method you use, when you submitted the request, how much the amount was for and was this your first withdrawal are but a few of the things which may make a difference. The quickest method is likely to be via debit card if your bank has "Fast funds" enabled as these are nearly instant. You could also say the payout time from going into a PaddyPower shop is quickest as they hand over cash there and then BUT… you do have to travel to the shop first!
How to make a Betfair Deposit
To deposit into Betfair firstly make sure that you are logged in, then you will see in the top right of the screen a large grey "Deposit" button, click on this.
On the following screen you will be able to select you deposit method, the default being "Debit Card". On this screen you can input
A) The amount you want to deposit.
B) Select either a previous card which you have used before or enter the details of a new card if it is your first deposit.
C) Enter your card security number.
Finally click the large yellow "Deposit" button at the bottom and your funds should be credited instantly.
If you wish to deposit with an "Alternative Method" then you need to select this box at the top of your screen, and you will be shown a different set of deposit options.
A) Check which alternative method you wish to use
B) Enter your account details for this method
C) Enter the amount you wish to deposit
D) You are also given other helpful information such as deposit limits, time frames, and fees.
When you are done click the large yellow "Deposit" button at the bottom of your screen and money will be transferred. (Depending on the method chosen there may be one more screen to fill for that method, but at Betfair, you are finished).
How to make a Betfair Withdrawal
To withdraw from Betfair you should make sure that you are logged into your account and then open the "My Betfair Account" tab.
Once you have opened this the following screen will show a large amount of account details, you simply want to choose from the three transaction options, "Withdraw Funds"
You will notice on the next page that you can again select to either use Debit Cards or "Alternative methods" depending on how yo initially deposited. The alternative methods will only be available to you if you have deposited with them before.
You will similarly only be able to withdraw to a card which has had more withdrawals than deposits, once ALL cards have also got a positive balance. In the example below you can see that.
A) This Visa card has a negative balance of £530.46
B) This Mastercard has deposited £854 MORE than has been withdrawn.
C) Until £854 has been withdrawn back onto card B, no money can be withdrawn onto card A
It is however always possible to withdraw money using the "Prizeout" scheme, just check the Email address which you have registered is correct, enter the amount you wish to claim, and click "Withdraw"
Full rating of bookmakers with mobile app for iOS and Android
How can I view my withdrawal history?
To view your Betfair withdrawal history you must be logged into your Betfair account and then select "Account Statement" from the drop down menu of the "My Account" section.
Once you have opened the Account Statement then you will have the option to view all of your account movements, which can be refined furthermore to show just financial transactions.
What are the minimum deposit and withdrawal amounts?
The minimum deposit limit to add funds into Betfair is just £5, and this is the limit for most methods. The maximum deposit limit from the E-Wallets is £99,999. Debit cards may have a higher limit but this is likely to be set by yout own bank, not Betfair.
How can I cancel a withdrawal?
It is not possible to cancel a withdrawal at Betfair once it has been submitted into the system. This is a standard policy across all UK regulated bookmakers and is part of their licence conditions.
I am having problems with my withdrawal, what can I do?
If you are having problems with your withdrawal then there are a number of possible reasons why and the best way to figure out what the reason is would be to contact the Betfair customer service. They will be able to help identify if you have met all the payout rules, and if there is a problem with the withdrawal meaning there is something for you to do, or perhaps the withdrawal is just pending and you need to keep waiting a bit longer.
Is Paypal accepted?
Yes PayPal is an accepted deposit method at Betfair, funds are credited instantly and there is no fee to use it for both deposits and withdrawals.
Post by:
Andy Heaford
Previous: Betfair Acca Edge – What It Is & How Does It Work?
Betfair Acca Edge – What It Is & How Does It Work?
The "Sponsored" icon means that the position of the bookmaker in this list is determined on a commercial basis.
The ratings on Legalbet are compiled as honestly and objectively as possible, so we indicate "Not for sale" on them to make it clear which are based on merit.
Review Bet
E-Sports rating
User's choice
© 2019 - 2023 WebMediaNet OU. All rights reserved.
For persons
over 18 years old


text:
import json
import os

from ..globals import *
from .utils import *

class Settings:

    def getSettingsFile(self):
        return "%s/%s" % (GlobalVariables.CLIPWDMGR_DATA_DIR,CLIPWDMGR_SETTINGS_FILE_NAME)

    def readSettingsFile(self):

        #read JSON file and return dictionary
        settingsFile=self.getSettingsFile()
        if os.path.isfile(settingsFile):
            jsonDict=json.load(open(settingsFile,'r'))
        else:
            jsonDict={}
            #file does not exist
            #get defaults and save
            settingNames=list(SETTING_DEFAULT_VALUES.keys())
            for name in settingNames:
                jsonDict[name]=SETTING_DEFAULT_VALUES[name]
            self.saveSettingsFile(jsonDict)

        return jsonDict

    def resetSettings(self):
        jsonDict={}
        #set settings to defaults
        settingNames=list(SETTING_DEFAULT_VALUES.keys())
        for name in settingNames:
            jsonDict[name]=SETTING_DEFAULT_VALUES[name]
        self.saveSettingsFile(jsonDict)

    def saveSettingsFile(self,jsonDict):

        #save json to settings file
        settingsFile="%s/%s" % (GlobalVariables.CLIPWDMGR_DATA_DIR,CLIPWDMGR_SETTINGS_FILE_NAME)
        jsonDict=json.dump(jsonDict,open(settingsFile,'w'), sort_keys=True, indent=4)

    def getInt(self,settingName):
        return int(self.get(settingName))

    def getBoolean(self,settingName):
        stringValue=str(self.get(settingName))
        return stringValue.lower() in ("yes","y","true", "on", "t", "1")

    def get(self,settingName):
        settingsDict=self.readSettingsFile()

        #TODO: if seting is columnwidth and another setting autowidth then calculate column
        #width from terminal size

        return settingsDict[settingName]

    def set(self,settingName,settingValue):
        settingsDict=self.readSettingsFile()
        settingsDict[settingName]=settingValue
        self.saveSettingsFile(settingsDict)

redpajama_set_name: RedPajamaGithub


This inspection was prompted as part of on-going monitoring of the service.
The inspection team was aware of previous Fixed Penalty Notices which had been issued to the service for not displaying their CQC rating and not notifying us of deaths within the service. We also reviewed previous breaches of regulations where the provider had informed us that action had been taken.
This inspection took place on 21 March 2018 and was unannounced.
The inspection team consisted of three inspectors from the Care Quality Commission and an expert by experience. An Expert by Experience is a person who has personal experience of using or caring for someone who uses this type of care service.
We reviewed information we held about the service, including the notifications they had sent us. A notification is information about important events which the provider is required to send to us. We also reviewed information that had been sent to us from the local authority and members of the public.
During the inspection we spoke with 10 people who used the service and one visiting relative. We spoke with the provider and the registered manager, as well as five care staff, the domestic staff, cook and maintenance staff. We also spoke with two visiting professionals. We looked at the care records of four people using the service and the recruitment and training records for four staff employed by the service. We reviewed information on how the provider managed complaints, and assessed the quality of the service, as well as information relating to the administration of medicines.


Apart from the publishing of the cruise ship lists present and future on the marine services website orkneyharbours.com, there is no other central point of pre arrival information for cruise ship passengers and crew arriving in Orkney . To put this right, we are today launching www.cruise-orkney.com.
This aim of this site is to provide passengers and crew and cruise line representatives with pre arrival information on the destination, in particular on shuttle bus operations, shopping and local transport information and other useful points about which we constantly receive email and telephone call enquiries.
Michael Morrison, Business Development Manager with OIC Marine Services said, 'The website will be an evolving site, and we will react positively to comments and feedback on how it can be improved and developed and therefore feedback is important to us at the Harbour Authority.