text:
/*	$NetBSD: conf.c,v 1.64 2012/11/04 20:46:46 christos Exp $	*/

/*-
 * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Simon Burge and Luke Mewburn.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: conf.c,v 1.64 2012/11/04 20:46:46 christos Exp $");
#endif /* not lint */

#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>

#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <glob.h>
#include <netdb.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stringlist.h>
#include <syslog.h>
#include <time.h>
#include <unistd.h>
#include <util.h>

#ifdef KERBEROS5
#include <krb5/krb5.h>
#endif

#include "extern.h"
#include "pathnames.h"

static char *strend(const char *, char *);
static int filetypematch(char *, int);

		/* class defaults */
#define DEFAULT_LIMIT		-1		/* unlimited connections */
#define DEFAULT_MAXFILESIZE	-1		/* unlimited file size */
#define DEFAULT_MAXTIMEOUT	7200		/* 2 hours */
#define DEFAULT_TIMEOUT		900		/* 15 minutes */
#define DEFAULT_UMASK		027		/* rw-r----- */

/*
 * Initialise curclass to an `empty' state
 */
void
init_curclass(void)
{
	struct ftpconv	*conv, *cnext;

	for (conv = curclass.conversions; conv != NULL; conv = cnext) {
		REASSIGN(conv->suffix, NULL);
		REASSIGN(conv->types, NULL);
		REASSIGN(conv->disable, NULL);
		REASSIGN(conv->command, NULL);
		cnext = conv->next;
		free(conv);
	}

	memset((char *)&curclass.advertise, 0, sizeof(curclass.advertise));
	curclass.advertise.su_len = 0;		/* `not used' */
	REASSIGN(curclass.chroot, NULL);
	REASSIGN(curclass.classname, NULL);
	curclass.conversions =	NULL;
	REASSIGN(curclass.display, NULL);
	REASSIGN(curclass.homedir, NULL);
	curclass.limit =	DEFAULT_LIMIT;
	REASSIGN(curclass.limitfile, NULL);
	curclass.maxfilesize =	DEFAULT_MAXFILESIZE;
	curclass.maxrateget =	0;
	curclass.maxrateput =	0;
	curclass.maxtimeout =	DEFAULT_MAXTIMEOUT;
	REASSIGN(curclass.motd, ftpd_strdup(_NAME_FTPLOGINMESG));
	REASSIGN(curclass.notify, NULL);
	curclass.portmin =	0;
	curclass.portmax =	0;
	curclass.rateget =	0;
	curclass.rateput =	0;
	curclass.timeout =	DEFAULT_TIMEOUT;
	    /* curclass.type is set elsewhere */
	curclass.umask =	DEFAULT_UMASK;
	curclass.mmapsize =	0;
	curclass.readsize =	0;
	curclass.writesize =	0;
	curclass.sendbufsize =	0;
	curclass.sendlowat =	0;

	CURCLASS_FLAGS_SET(checkportcmd);
	CURCLASS_FLAGS_CLR(denyquick);
	CURCLASS_FLAGS_CLR(hidesymlinks);
	CURCLASS_FLAGS_SET(modify);
	CURCLASS_FLAGS_SET(passive);
	CURCLASS_FLAGS_CLR(private);
	CURCLASS_FLAGS_CLR(sanenames);
	CURCLASS_FLAGS_SET(upload);
}

/*
 * Parse the configuration file, looking for the named class, and
 * define curclass to contain the appropriate settings.
 */
void
parse_conf(const char *findclass)
{
	FILE		*f;
	char		*buf, *p;
	size_t		 len;
	LLT		 llval;
	int		 none, match;
	char		*endp, errbuf[100];
	char		*class, *word, *arg, *template;
	const char	*infile;
	size_t		 line;
	struct ftpconv	*conv, *cnext;

	init_curclass();
	REASSIGN(curclass.classname, ftpd_strdup(findclass));
			/* set more guest defaults */
	if (strcasecmp(findclass, "guest") == 0) {
		CURCLASS_FLAGS_CLR(modify);
		curclass.umask = 0707;
	}

	infile = conffilename(_NAME_FTPDCONF);
	if ((f = fopen(infile, "r")) == NULL)
		return;

	line = 0;
	template = NULL;
	for (;
	    (buf = fparseln(f, &len, &line, NULL, FPARSELN_UNESCCOMM |
			    FPARSELN_UNESCCONT | FPARSELN_UNESCESC)) != NULL;
	    free(buf)) {
		none = match = 0;
		p = buf;
		if (len < 1)
			continue;
		if (p[len - 1] == '\n')
			p[--len] = '\0';
		if (EMPTYSTR(p))
			continue;

		NEXTWORD(p, word);
		NEXTWORD(p, class);
		NEXTWORD(p, arg);
		if (EMPTYSTR(word) || EMPTYSTR(class))
			continue;
		if (strcasecmp(class, "none") == 0)
			none = 1;
		if (! (strcasecmp(class, findclass) == 0 ||
		       (template != NULL && strcasecmp(class, template) == 0) ||
		       none ||
		       strcasecmp(class, "all") == 0) )
			continue;

#define CONF_FLAG(Field)						\
	do {								\
		if (none ||						\
		    (!EMPTYSTR(arg) && strcasecmp(arg, "off") == 0))	\
			CURCLASS_FLAGS_CLR(Field);			\
		else							\
			CURCLASS_FLAGS_SET(Field);			\
	} while (0)

#define CONF_STRING(Field)						\
	do {								\
		if (none || EMPTYSTR(arg))				\
			arg = NULL;					\
		else							\
			arg = ftpd_strdup(arg);				\
		REASSIGN(curclass.Field, arg);				\
	} while (0)

#define CONF_LL(Field,Arg,Min,Max)					\
	do {								\
		if (none || EMPTYSTR(Arg))				\
			goto nextline;					\
		llval = strsuftollx(#Field, Arg, Min, Max,		\
		    errbuf, sizeof(errbuf));				\
		if (errbuf[0]) {					\
			syslog(LOG_WARNING, "%s line %d: %s",		\
			    infile, (int)line, errbuf);			\
			goto nextline;					\
		}							\
		curclass.Field = llval;					\
	} while(0)

		if (0)  {
			/* no-op */

		} else if ((strcasecmp(word, "advertise") == 0)
			|| (strcasecmp(word, "advertize") == 0)) {
			struct addrinfo	hints, *res;
			int		error;

			memset((char *)&curclass.advertise, 0,
			    sizeof(curclass.advertise));
			curclass.advertise.su_len = 0;
			if (none || EMPTYSTR(arg))
				continue;
			res = NULL;
			memset(&hints, 0, sizeof(hints));
					/*
					 * only get addresses of the family
					 * that we're listening on
					 */
			hints.ai_family = ctrl_addr.su_family;
			hints.ai_socktype = SOCK_STREAM;
			error = getaddrinfo(arg, "0", &hints, &res);
			if (error) {
				syslog(LOG_WARNING, "%s line %d: %s",
				    infile, (int)line, gai_strerror(error));
 advertiseparsefail:
				if (res)
					freeaddrinfo(res);
				continue;
			}
			if (res->ai_next) {
				syslog(LOG_WARNING,
    "%s line %d: multiple addresses returned for `%s'; please be more specific",
				    infile, (int)line, arg);
				goto advertiseparsefail;
			}
			if (sizeof(curclass.advertise) < res->ai_addrlen || (
#ifdef INET6
			    res->ai_family != AF_INET6 &&
#endif
			    res->ai_family != AF_INET)) {
				syslog(LOG_WARNING,
    "%s line %d: unsupported protocol %d for `%s'",
				    infile, (int)line, res->ai_family, arg);
				goto advertiseparsefail;
			}
			memcpy(&curclass.advertise, res->ai_addr,
			    res->ai_addrlen);
			curclass.advertise.su_len = res->ai_addrlen;
			freeaddrinfo(res);

		} else if (strcasecmp(word, "checkportcmd") == 0) {
			CONF_FLAG(checkportcmd);

		} else if (strcasecmp(word, "chroot") == 0) {
			CONF_STRING(chroot);

		} else if (strcasecmp(word, "classtype") == 0) {
			if (!none && !EMPTYSTR(arg)) {
				if (strcasecmp(arg, "GUEST") == 0)
					curclass.type = CLASS_GUEST;
				else if (strcasecmp(arg, "CHROOT") == 0)
					curclass.type = CLASS_CHROOT;
				else if (strcasecmp(arg, "REAL") == 0)
					curclass.type = CLASS_REAL;
				else {
					syslog(LOG_WARNING,
				    "%s line %d: unknown class type `%s'",
					    infile, (int)line, arg);
					continue;
				}
			}

		} else if (strcasecmp(word, "conversion") == 0) {
			char *suffix, *types, *disable, *convcmd;

			if (EMPTYSTR(arg)) {
				syslog(LOG_WARNING,
				    "%s line %d: %s requires a suffix",
				    infile, (int)line, word);
				continue;	/* need a suffix */
			}
			NEXTWORD(p, types);
			NEXTWORD(p, disable);
			convcmd = p;
			if (convcmd)
				convcmd += strspn(convcmd, " \t");
			suffix = ftpd_strdup(arg);
			if (none || EMPTYSTR(types) ||
			    EMPTYSTR(disable) || EMPTYSTR(convcmd)) {
				types = NULL;
				disable = NULL;
				convcmd = NULL;
			} else {
				types = ftpd_strdup(types);
				disable = ftpd_strdup(disable);
				convcmd = ftpd_strdup(convcmd);
			}
			for (conv = curclass.conversions; conv != NULL;
			    conv = conv->next) {
				if (strcmp(conv->suffix, suffix) == 0)
					break;
			}
			if (conv == NULL) {
				conv = (struct ftpconv *)
				    calloc(1, sizeof(struct ftpconv));
				if (conv == NULL) {
					syslog(LOG_WARNING, "can't malloc");
					continue;
				}
				conv->next = NULL;
				for (cnext = curclass.conversions;
				    cnext != NULL; cnext = cnext->next)
					if (cnext->next == NULL)
						break;
				if (cnext != NULL)
					cnext->next = conv;
				else
					curclass.conversions = conv;
			}
			REASSIGN(conv->suffix, suffix);
			REASSIGN(conv->types, types);
			REASSIGN(conv->disable, disable);
			REASSIGN(conv->command, convcmd);

		} else if (strcasecmp(word, "denyquick") == 0) {
			CONF_FLAG(denyquick);

		} else if (strcasecmp(word, "display") == 0) {
			CONF_STRING(display);

		} else if (strcasecmp(word, "hidesymlinks") == 0) {
			CONF_FLAG(hidesymlinks);

		} else if (strcasecmp(word, "homedir") == 0) {
			CONF_STRING(homedir);

		} else if (strcasecmp(word, "limit") == 0) {
			curclass.limit = DEFAULT_LIMIT;
			REASSIGN(curclass.limitfile, NULL);
			CONF_LL(limit, arg, -1, LLTMAX);
			REASSIGN(curclass.limitfile,
			    EMPTYSTR(p) ? NULL : ftpd_strdup(p));

		} else if (strcasecmp(word, "maxfilesize") == 0) {
			curclass.maxfilesize = DEFAULT_MAXFILESIZE;
			CONF_LL(maxfilesize, arg, -1, LLTMAX);

		} else if (strcasecmp(word, "maxtimeout") == 0) {
			curclass.maxtimeout = DEFAULT_MAXTIMEOUT;
			CONF_LL(maxtimeout, arg,
			    MIN(30, curclass.timeout), LLTMAX);

		} else if (strcasecmp(word, "mmapsize") == 0) {
			curclass.mmapsize = 0;
			CONF_LL(mmapsize, arg, 0, SSIZE_MAX);

		} else if (strcasecmp(word, "readsize") == 0) {
			curclass.readsize = 0;
			CONF_LL(readsize, arg, 0, SSIZE_MAX);

		} else if (strcasecmp(word, "writesize") == 0) {
			curclass.writesize = 0;
			CONF_LL(writesize, arg, 0, SSIZE_MAX);

		} else if (strcasecmp(word, "recvbufsize") == 0) {
			curclass.recvbufsize = 0;
			CONF_LL(recvbufsize, arg, 0, INT_MAX);

		} else if (strcasecmp(word, "sendbufsize") == 0) {
			curclass.sendbufsize = 0;
			CONF_LL(sendbufsize, arg, 0, INT_MAX);

		} else if (strcasecmp(word, "sendlowat") == 0) {
			curclass.sendlowat = 0;
			CONF_LL(sendlowat, arg, 0, INT_MAX);

		} else if (strcasecmp(word, "modify") == 0) {
			CONF_FLAG(modify);

		} else if (strcasecmp(word, "motd") == 0) {
			CONF_STRING(motd);

		} else if (strcasecmp(word, "notify") == 0) {
			CONF_STRING(notify);

		} else if (strcasecmp(word, "passive") == 0) {
			CONF_FLAG(passive);

		} else if (strcasecmp(word, "portrange") == 0) {
			long minport, maxport;

			curclass.portmin = 0;
			curclass.portmax = 0;
			if (none || EMPTYSTR(arg))
				continue;
			if (EMPTYSTR(p)) {
				syslog(LOG_WARNING,
				   "%s line %d: missing maxport argument",
				   infile, (int)line);
				continue;
			}
			minport = strsuftollx("minport", arg, IPPORT_RESERVED,
			    IPPORT_ANONMAX, errbuf, sizeof(errbuf));
			if (errbuf[0]) {
				syslog(LOG_WARNING, "%s line %d: %s",
				    infile, (int)line, errbuf);
				continue;
			}
			maxport = strsuftollx("maxport", p, IPPORT_RESERVED,
			    IPPORT_ANONMAX, errbuf, sizeof(errbuf));
			if (errbuf[0]) {
				syslog(LOG_WARNING, "%s line %d: %s",
				    infile, (int)line, errbuf);
				continue;
			}
			if (minport >= maxport) {
				syslog(LOG_WARNING,
				    "%s line %d: minport %ld >= maxport %ld",
				    infile, (int)line, minport, maxport);
				continue;
			}
			curclass.portmin = (int)minport;
			curclass.portmax = (int)maxport;

		} else if (strcasecmp(word, "private") == 0) {
			CONF_FLAG(private);

		} else if (strcasecmp(word, "rateget") == 0) {
			curclass.maxrateget = curclass.rateget = 0;
			CONF_LL(rateget, arg, 0, LLTMAX);
			curclass.maxrateget = curclass.rateget;

		} else if (strcasecmp(word, "rateput") == 0) {
			curclass.maxrateput = curclass.rateput = 0;
			CONF_LL(rateput, arg, 0, LLTMAX);
			curclass.maxrateput = curclass.rateput;

		} else if (strcasecmp(word, "sanenames") == 0) {
			CONF_FLAG(sanenames);

		} else if (strcasecmp(word, "timeout") == 0) {
			curclass.timeout = DEFAULT_TIMEOUT;
			CONF_LL(timeout, arg, 30, curclass.maxtimeout);

		} else if (strcasecmp(word, "template") == 0) {
			if (none)
				continue;
			REASSIGN(template, EMPTYSTR(arg) ? NULL : ftpd_strdup(arg));

		} else if (strcasecmp(word, "umask") == 0) {
			unsigned long fumask;

			curclass.umask = DEFAULT_UMASK;
			if (none || EMPTYSTR(arg))
				continue;
			errno = 0;
			endp = NULL;
			fumask = strtoul(arg, &endp, 8);
			if (errno || *arg == '\0' || *endp != '\0' ||
			    fumask > 0777) {
				syslog(LOG_WARNING,
				    "%s line %d: invalid umask %s",
				    infile, (int)line, arg);
				continue;
			}
			curclass.umask = (mode_t)fumask;

		} else if (strcasecmp(word, "upload") == 0) {
			CONF_FLAG(upload);
			if (! CURCLASS_FLAGS_ISSET(upload))
				CURCLASS_FLAGS_CLR(modify);

		} else {
			syslog(LOG_WARNING,
			    "%s line %d: unknown directive '%s'",
			    infile, (int)line, word);
			continue;
		}
 nextline:
		;
	}
	REASSIGN(template, NULL);
	fclose(f);
}

/*
 * Show file listed in curclass.display first time in, and list all the
 * files named in curclass.notify in the current directory.
 * Send back responses with the prefix `code' + "-".
 * If code == -1, flush the internal cache of directory names and return.
 */
void
show_chdir_messages(int code)
{
	static StringList *slist = NULL;

	struct stat st;
	struct tm *t;
	glob_t	 gl;
	time_t	 now, then;
	int	 age;
	char	 curwd[MAXPATHLEN];
	char	*cp, **rlist;

	if (code == -1) {
		if (slist != NULL)
			sl_free(slist, 1);
		slist = NULL;
		return;
	}

	if (quietmessages)
		return;

		/* Setup list for directory cache */
	if (slist == NULL)
		slist = sl_init();
	if (slist == NULL) {
		syslog(LOG_WARNING, "can't allocate memory for stringlist");
		return;
	}

		/* Check if this directory has already been visited */
	if (getcwd(curwd, sizeof(curwd) - 1) == NULL) {
		syslog(LOG_WARNING, "can't getcwd: %s", strerror(errno));
		return;
	}
	if (sl_find(slist, curwd) != NULL)
		return;

	cp = ftpd_strdup(curwd);
	if (sl_add(slist, cp) == -1)
		syslog(LOG_WARNING, "can't add `%s' to stringlist", cp);

		/* First check for a display file */
	(void)display_file(curclass.display, code);

		/* Now see if there are any notify files */
	if (EMPTYSTR(curclass.notify))
		return;

	memset(&gl, 0, sizeof(gl));
	if (glob(curclass.notify, GLOB_BRACE|GLOB_LIMIT, NULL, &gl) != 0
	    || gl.gl_matchc == 0) {
		globfree(&gl);
		return;
	}
	time(&now);
	for (rlist = gl.gl_pathv; *rlist != NULL; rlist++) {
		if (stat(*rlist, &st) != 0)
			continue;
		if (!S_ISREG(st.st_mode))
			continue;
		then = st.st_mtime;
		if (code != 0) {
			reply(-code, "%s", "");
			code = 0;
		}
		reply(-code, "Please read the file %s", *rlist);
		t = localtime(&now);
		age = 365 * t->tm_year + t->tm_yday;
		t = localtime(&then);
		age -= 365 * t->tm_year + t->tm_yday;
		reply(-code, "  it was last modified on %.24s - %d day%s ago",
		    ctime(&then), age, PLURAL(age));
	}
	globfree(&gl);
}

int
display_file(const char *file, int code)
{
	FILE   *f;
	char   *buf, *p;
	char	curwd[MAXPATHLEN];
	size_t	len;
	off_t	lastnum;
	time_t	now;

	lastnum = 0;
	if (quietmessages)
		return (0);

	if (EMPTYSTR(file))
		return(0);
	if ((f = fopen(file, "r")) == NULL)
		return (0);
	reply(-code, "%s", "");

	for (;
	    (buf = fparseln(f, &len, NULL, "\0\0\0", 0)) != NULL; free(buf)) {
		if (len > 0)
			if (buf[len - 1] == '\n')
				buf[--len] = '\0';
		cprintf(stdout, "    ");

		for (p = buf; *p; p++) {
			if (*p == '%') {
				p++;
				switch (*p) {

				case 'c':
					cprintf(stdout, "%s",
					    curclass.classname ?
					    curclass.classname : "<unknown>");
					break;

				case 'C':
					if (getcwd(curwd, sizeof(curwd)-1)
					    == NULL){
						syslog(LOG_WARNING,
						    "can't getcwd: %s",
						    strerror(errno));
						continue;
					}
					cprintf(stdout, "%s", curwd);
					break;

				case 'E':
					if (! EMPTYSTR(emailaddr))
						cprintf(stdout, "%s",
						    emailaddr);
					break;

				case 'L':
					cprintf(stdout, "%s", hostname);
					break;

				case 'M':
					if (curclass.limit == -1) {
						cprintf(stdout, "unlimited");
						lastnum = 0;
					} else {
						cprintf(stdout, LLF,
						    (LLT)curclass.limit);
						lastnum = curclass.limit;
					}
					break;

				case 'N':
					cprintf(stdout, "%d", connections);
					lastnum = connections;
					break;

				case 'R':
					cprintf(stdout, "%s", remotehost);
					break;

				case 's':
					if (lastnum != 1)
						cprintf(stdout, "s");
					break;

				case 'S':
					if (lastnum != 1)
						cprintf(stdout, "S");
					break;

				case 'T':
					now = time(NULL);
					cprintf(stdout, "%.24s", ctime(&now));
					break;

				case 'U':
					cprintf(stdout, "%s",
					    pw ? pw->pw_name : "<unknown>");
					break;

				case '%':
					CPUTC('%', stdout);
					break;

				}
			} else
				CPUTC(*p, stdout);
		}
		cprintf(stdout, "\r\n");
	}

	(void)fflush(stdout);
	(void)fclose(f);
	return (1);
}

/*
 * Parse src, expanding '%' escapes, into dst (which must be at least
 * MAXPATHLEN long).
 */
void
format_path(char *dst, const char *src)
{
	size_t len;
	const char *p;

	dst[0] = '\0';
	len = 0;
	if (src == NULL)
		return;
	for (p = src; *p && len < MAXPATHLEN; p++) {
		if (*p == '%') {
			p++;
			switch (*p) {

			case 'c':
				len += strlcpy(dst + len, curclass.classname,
				    MAXPATHLEN - len);
				break;

			case 'd':
				len += strlcpy(dst + len, pw->pw_dir,
				    MAXPATHLEN - len);
				break;

			case 'u':
				len += strlcpy(dst + len, pw->pw_name,
				    MAXPATHLEN - len);
				break;

			case '%':
				dst[len++] = '%';
				break;

			}
		} else
			dst[len++] = *p;
	}
	if (len < MAXPATHLEN)
		dst[len] = '\0';
	dst[MAXPATHLEN - 1] = '\0';
}

/*
 * Find s2 at the end of s1.  If found, return a string up to (but
 * not including) s2, otherwise returns NULL.
 */
static char *
strend(const char *s1, char *s2)
{
	static	char buf[MAXPATHLEN];

	char	*start;
	size_t	l1, l2;

	l1 = strlen(s1);
	l2 = strlen(s2);

	if (l2 >= l1 || l1 >= sizeof(buf))
		return(NULL);

	strlcpy(buf, s1, sizeof(buf));
	start = buf + (l1 - l2);

	if (strcmp(start, s2) == 0) {
		*start = '\0';
		return(buf);
	} else
		return(NULL);
}

static int
filetypematch(char *types, int mode)
{
	for ( ; types[0] != '\0'; types++)
		switch (*types) {
		  case 'd':
			if (S_ISDIR(mode))
				return(1);
			break;
		  case 'f':
			if (S_ISREG(mode))
				return(1);
			break;
		}
	return(0);
}

/*
 * Look for a conversion.  If we succeed, return a pointer to the
 * command to execute for the conversion.
 *
 * The command is stored in a static array so there's no memory
 * leak problems, and not too much to change in ftpd.c.  This
 * routine doesn't need to be re-entrant unless we start using a
 * multi-threaded ftpd, and that's not likely for a while...
 */
const char **
do_conversion(const char *fname)
{
	struct ftpconv	*cp;
	struct stat	 st;
	int		 o_errno;
	char		*base = NULL;
	char		*cmd, *p, *lp;
	char	       **argv;
	StringList	*sl;

	o_errno = errno;
	sl = NULL;
	cmd = NULL;
	for (cp = curclass.conversions; cp != NULL; cp = cp->next) {
		if (cp->suffix == NULL) {
			syslog(LOG_WARNING,
			    "cp->suffix==NULL in conv list; SHOULDN'T HAPPEN!");
			continue;
		}
		if ((base = strend(fname, cp->suffix)) == NULL)
			continue;
		if (cp->types == NULL || cp->disable == NULL ||
		    cp->command == NULL)
			continue;
					/* Is it enabled? */
		if (strcmp(cp->disable, ".") != 0 &&
		    stat(cp->disable, &st) == 0)
				continue;
					/* Does the base exist? */
		if (stat(base, &st) < 0)
			continue;
					/* Is the file type ok */
		if (!filetypematch(cp->types, st.st_mode))
			continue;
		break;			/* "We have a winner!" */
	}

	/* If we got through the list, no conversion */
	if (cp == NULL)
		goto cleanup_do_conv;

	/* Split up command into an argv */
	if ((sl = sl_init()) == NULL)
		goto cleanup_do_conv;
	cmd = ftpd_strdup(cp->command);
	p = cmd;
	while (p) {
		NEXTWORD(p, lp);
		if (strcmp(lp, "%s") == 0)
			lp = base;
		if (sl_add(sl, ftpd_strdup(lp)) == -1)
			goto cleanup_do_conv;
	}

	if (sl_add(sl, NULL) == -1)
		goto cleanup_do_conv;
	argv = sl->sl_str;
	free(cmd);
	free(sl);
	return (void *)(intptr_t)argv;

 cleanup_do_conv:
	if (sl)
		sl_free(sl, 1);
	free(cmd);
	errno = o_errno;
	return(NULL);
}

/*
 * Count the number of current connections, reading from
 *	/var/run/ftpd.pids-<class>
 * Does a kill -0 on each pid in that file, and only counts
 * processes that exist (or frees the slot if it doesn't).
 * Adds getpid() to the first free slot. Truncates the file
 * if possible.
 */
void
count_users(void)
{
	char	fn[MAXPATHLEN];
	int	fd;
	size_t	i, last, count;
	ssize_t	scount;
	pid_t  *pids, mypid;
	struct stat sb;
	struct flock fl;

	(void)strlcpy(fn, _PATH_CLASSPIDS, sizeof(fn));
	(void)strlcat(fn, curclass.classname, sizeof(fn));
	pids = NULL;
	connections = 1;
	fl.l_start = 0;
	fl.l_len = 0;
	fl.l_pid = 0;
	fl.l_type = F_WRLCK;
	fl.l_whence = SEEK_SET;

	if ((fd = open(fn, O_RDWR | O_CREAT, 0600)) == -1)
		return;
	if (fcntl(fd, F_SETLK, &fl) == -1)
		goto cleanup_count;
	if (fstat(fd, &sb) == -1)
		goto cleanup_count;
	if ((pids = malloc(sb.st_size + sizeof(pid_t))) == NULL)
		goto cleanup_count;
/* XXX: implement a better read loop */
	scount = read(fd, pids, sb.st_size);
	if (scount == -1 || scount != sb.st_size || scount < 0)
		goto cleanup_count;
	count = (size_t)scount / sizeof(pid_t);
	mypid = getpid();
	last = 0;
	for (i = 0; i < count; i++) {
		if (pids[i] == 0)
			continue;
		if (kill(pids[i], 0) == -1 && errno != EPERM) {
			if (mypid != 0) {
				pids[i] = mypid;
				mypid = 0;
				last = i;
			}
		} else {
			connections++;
			last = i;
		}
	}
	if (mypid != 0) {
		if (pids[last] != 0)
			last++;
		pids[last] = mypid;
	}
	count = (last + 1) * sizeof(pid_t);
	if (lseek(fd, 0, SEEK_SET) == -1)
		goto cleanup_count;
/* XXX: implement a better write loop */
	scount = write(fd, pids, count);
	if (scount == -1 || (size_t)scount != count)
		goto cleanup_count;
	(void)ftruncate(fd, count);

 cleanup_count:
	fl.l_type = F_UNLCK;
	(void)fcntl(fd, F_SETLK, &fl);
	close(fd);
	REASSIGN(pids, NULL);
}


In April 2016 higher rates of taxes on dividends were introduced but with a £5,000 'tax-free' Dividend Allowance to compensate. Despite the rise in rates, many taxpayers, particularly higher rate taxpayers, found themselves better off. For example, for an individual with a £150,000 share portfolio yielding 3%, no tax would be payable on the £4,500 income produced whereas in the pre April 2016 regime there would have been a tax liability of 25%. The announcement by the current Chancellor, Philip Hammond, to reduce the Dividend Allowance to £2,000 from April 2018 will put paid to that amount of benefit.
Your existing shares can be sold and bought back again within the ISA wrapper but one needs to choose carefully which shares will be sold as the transactions will be disposals for capital gains tax (CGT). There are also two lots of annual exemption from CGT to potentially make use of – this year and next. The current annual exemption is £11,300. Married couples and civil partners also have the added facility to make transfers to the other partner prior to selling into an ISA. Any share transfer between such couples is at a 'no gain no loss' price with the result that the transferee will effectively acquire the shares at the transferor's base cost and so will make the gain in selling the shares.


text:
Q: JQuery resizable with three divs does not work I have used Jquery resizable for one of my projects. I want three divs side by side with two separators and resize each one accordingly. I was able to resize the first two divs without an issue. However I can't get to work the third one.
and one more issue that I have is when you move the splitter one it also moves the last-splitter and div.
JSFiddle

 $(".panel-left").resizable({
   handleSelector: ".splitter",
   resizeHeight: false
 });

  $(".panel-right").resizable({
   handleSelector: ".splitter-right",
   resizeHeight: false
 });
html,
body {
  height: 100%;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
  padding: 0;
  margin: 0;
  overflow: auto;
}

.page-container {
  margin: 20px;
}

/* horizontal panel*/

.panel-container {
  display: flex;
  flex-direction: row;
  border: 1px solid silver;
  overflow: hidden;
  /* avoid browser level touch actions */
  xtouch-action: none;
}

.panel-left {
  flex: 0 0 auto;
  /* only manually resize */
  padding: 10px;
  width: 300px;
  min-height: 200px;
  min-width: 150px;
  white-space: nowrap;
  background: #838383;
  color: white;
}

.splitter {
  flex: 0 0 auto;
  width: 18px;
  background: url(https://raw.githubusercontent.com/RickStrahl/jquery-resizable/master/assets/vsizegrip.png) center center no-repeat #535353;
  min-height: 200px;
  cursor: col-resize;
}

.splitter-right {
  flex: 0 0 auto;
  width: 18px;
  background: url(https://raw.githubusercontent.com/RickStrahl/jquery-resizable/master/assets/vsizegrip.png) center center no-repeat #535353;
  min-height: 200px;
  cursor: col-resize;
}

.panel-center {
  flex: 1 1 auto;
  /* resizable */
  padding: 10px;
  width: 100%;
  min-height: 200px;
  min-width: 200px;
  background: #eee;
}

.panel-right {
  flex: 1 1 auto;
  /* resizable */
  padding: 10px;
  width: 100%;
  min-height: 200px;
  min-width: 200px;
  background: #eee;
}

      left panel

      center panel

      center panel

A: A correct answer for the horizontal three panels consists of

*

*resizing panel-center instead of panel-right

*setting it's flex-shrink to 0

    $(".panel-left").resizable({
        handleSelector: ".splitter",
        resizeHeight: false
    });

    $(".panel-center").resizable({
        handleSelector: ".splitter-right",
        resizeHeight: false
    });
html,
body {
  height: 100%;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
  padding: 0;
  margin: 0;
  overflow: auto;
}

.page-container {
  margin: 20px;
}

/* horizontal panel*/

.panel-container {
  display: flex;
  flex-direction: row;
  border: 1px solid silver;
  overflow: hidden;

  /* avoid browser level touch actions */
  xtouch-action: none;
}

.panel-left {
  flex: 0 0 auto;  /* only manually resize */
  padding: 10px;
  width: 150px;
  min-height: 200px;
  min-width: 150px;
  white-space: nowrap;
  background: #838383;
  color: #ffffff;
}

.splitter,
.splitter-right {
  flex: 0 0 auto;
  width: 18px;
  background: url(https://raw.githubusercontent.com/RickStrahl/jquery-resizable/master/assets/vsizegrip.png) center center no-repeat #535353;
  min-height: 200px;
  cursor: col-resize;
}

.panel-center{
  flex: 1 0 auto;
  padding: 10px;
  width: 30%;
  min-height: 200px;
  min-width: 200px;
  background: #eee;
  color: #000;
}

.panel-right {
  flex: 0 0 auto;  /* only manually resize */
  padding: 10px;
  width: 30%;
  min-height: 200px;
  min-width: 200px;
  background: #838383;
  color: #ffffff;
}
}

    <title>Simple Split Panels - jquery-resizable</title>
    <meta charset="utf-8"/>

                left panel

                center panel

                right panel

A: Here is the working code:

 $(".panel-left").resizable({
   handleSelector: ".splitter",
   resizeHeight: false
 });

  $(".panel-right").resizable({
   handleSelector: ".splitter-right",
   resizeHeight: false
 });
html,
body {
  height: 100%;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
  padding: 0;
  margin: 0;
  overflow: auto;
}

.page-container {
  margin: 20px;
}

/* horizontal panel*/

.panel-container {
  display: flex;
  flex-direction: row;
  border: 1px solid silver;
  overflow: hidden;
  /* avoid browser level touch actions */
  xtouch-action: none;
}

.panel-left {
  flex: 0 0 auto;
  /* only manually resize */
  padding: 10px;
  width: 30%;
  min-height: 200px;
  white-space: nowrap;
  background: #838383;
  color: white;
}

.splitter {
  flex: 0 0 auto;
  width: 5%;
  background: url(https://raw.githubusercontent.com/RickStrahl/jquery-resizable/master/assets/vsizegrip.png) center center no-repeat #535353;
  min-height: 200px;
  cursor: col-resize;
}

.splitter-right {
  flex: 0 0 auto;
  width: 5%;
  background: url(https://raw.githubusercontent.com/RickStrahl/jquery-resizable/master/assets/vsizegrip.png) center center no-repeat #535353;
  min-height: 200px;
  cursor: col-resize;
}

.panel-center {
  flex: 1 1 auto;
  /* resizable */
  padding: 10px;
  width: 30%;
  min-height: 200px;
  background: #eee;
}

.panel-right {
  flex: 1 1 auto;
  /* resizable */
  padding: 10px;
  width: 30%;
  min-height: 200px;
  background: #eee;
}

      left panel

      center panel

      right panel

You Errors :
you gave left-panel width static and after that you gave it min-width, it was over-ridding the width attribute and after that you gave width:100% to both center and right , using display flex the total width that page was using as
100% + 100% + 300px + 18px + 18px (your splitter width)

redpajama_set_name: RedPajamaStackExchange


On Aug. 1, 1862, the Lincoln administration enacted a recently passed tax of $1 per 31-gallon barrel on "all beer, lager beer, ale, porter and other similar fermented liquors, by whatever name such liquors may be called." It was the first national excise tax on beer, and it had perhaps the furthest-reaching effect on the drink during the Civil War, which ended 150 years ago this spring.
The war in mid-1862 was one of grinding attrition. The optimism both sides held at its start in April 1861 was long gone. The decisive Union victories of Vicksburg and Gettysburg were almost a year away, and the Emancipation Proclamation was months off. France wanted to recognize the Confederacy; Britain, the other great power of the day, sat on the sidelines. It wasn't clear which side, the North or the South, would win.
Simply put, by August 1862, it looked like it was going to be a long war, and the U.S. needed money to pay for it. Enter the tax.
By 1865, the last year of the war, the federal government was able to tax 3,657,181 barrels and yet collect $3,734,928, totals much higher than those amassed in 1863 and 1864. Those numbers—taxable production and amount collected—would only rise, too, both cresting 10 million for the first time in 1879. In 1919, the last year before Prohibition, the tax was up to $6 a barrel and the government collected $117,503,895.
By the end of the Civil War in 1865, the federal government was collecting much more on beer taxes than it had in previous years.
These precise statistics come from the United States Brewers' Association, a group formed in August 1862 in response to the initial tax (it would adopt its formal name two years later). The association marked the largest marshaling of trade muscle in the nation's brewing history, muscle meant to modify the tax or at least to keep it low.
Though the group's influence would wane in the coming decades, and the group disappeared altogether in 1986, the USBA served as the conceptual godfather for subsequent brewing-industry trade groups such as the Brewers Association and its forerunners, the Association of Brewers and the Brewers Association of America.
The USBA would not have been possible without the German immigrants and their progeny who started and nurtured it. Much of brewing in America by the time of the Civil War, in fact, would not have been possible without the Germans and their lust for lager.
That beer style had grown by leaps and bounds in popularity before the war, as more Germans arrived in the U.S., fleeing revolutions and counter-revolutions in their patchwork quilt of homelands; the nation's nascent temperance movement even preferred lager to the harder stuff, especially whiskey, that Americans had been inhaling since the Revolution.
Germans started dozens of breweries in the two decades before the war, most in cities with heavy German populations. Milwaukee alone saw 10 open in the 1850s, according to Maureen Ogle's Ambitious Brew. The beer-soaked German community of St. Louis played an especially large role in the conflict of the early 1860s, given the civil war within the Civil War that rived Missouri, a slave state that stuck with the Union. The Germans helped keep it there.
The Civil War only boosted demand for lager, as German and German-American soldiers fanned out into regiments and posts throughout the country—they accounted for almost 10 percent of the Union army—and more non-Germans developed a taste for the style, too. As Ogle put it of St. Louis during the war, "Everyone needed beer." The drink relieved the tedium and terror between combat, as soldiers' letters attest; and their returns home after the war ensured that lager's reach would only extend further and further.
This demand, coupled with greater automation in the brewing industry, drove the number of breweries in America to a peak in the 1870s that has only recently been matched, with most of them churning out the lager so popular during the war that changed so much.
Tom Acitelli is the author of The Audacity of Hops: The History of America's Craft Beer Revolution. His new book, American Wine: A Coming-of-Age Story, is available for pre-order. Reach him on Twitter @tomacitelli.
Great article…it is going to help me a lot in my speech to inform project over at South Texas College. Thank you so much.


A special edition of the Tweet-based podcast as Tony Groves interviews economist Constantin Gurdgiev in a car travelling to last weekend's Kilkenomics festival in Kilkenny.
Constantin offers his insights into the relationship between mainstream and social media, the difference between RTÉ and BBC and what we didn't learn from the financial crisis.
Posted in Misc and tagged Constantin Gurdgiev, The Echo Chamber at 1:53 pm on November 14, 2017 by Bodger.
There is a simple matter of arithmetic.
Recall that the current Government came into power at the end of 1Q 2011. Let us suppose the Government really got down to 'creating jobs' by 1Q 2012. Which means the Government has been at its jobs game for roughly 14-15 quarters through 3Q 2015 or, at the lower end 3 years and a half.
That means that the Government should have created "over" 182,000 jobs in that period. This benign to the Minister claim, because if we are to look at the record of the entire duration of the Government, his claim would have equated to roughly 221,000 jobs created.
… Keep the two numbers in your mind: we are told that the Government has 'created' either more than 182,000 or more than 221,000 jobs over its tenure, depending on where one starts to count.
Now, consult CSO QNHS database – the source of official counts for numbers in employment.
Between the end of 1Q 2012 and 3Q 2015 (the latest for which we have data), total employment rose 158,000. But wait, these are not all jobs. 4,500 of that increase is in the category of Assisting Relative. And 121,200 of these additions are employees, including schemes. Beyond this, the above increase also includes 30,100 new (added) self-employed with no employees.
It is hard to assume that the Government can claim it 'created' self-employment jobs where there is not enough activity to hire staff, or that it increased the need to help relatives.
Numbers speak for themselves. By the very best metric, Government is more than 1/2 year shy of the lowest end of the claim of 'more than 1,000 jobs created per week'. It is more than 1/2 year shy of the claim that there were '1,000 jobs created per week'.
Posted in Misc and tagged Constantin Gurdgiev, Ireland, jobs at 12:21 pm on January 27, 2016 by Broadsheet.
Posted in Misc and tagged Constantin Gurdgiev at 5:34 pm on May 28, 2012 by Broadsheet.
Richard Bruton with economist (and chairman of the Ireland Russia Business Association) Constantin Gurdgiev at a breakfast briefing on Russia this morning, part of the Dublin Festival of Russian Culture 2012.
Natallia Kabiak from Rathmines wearing traditional Belarus dress, Inna Tykhovod from Lucan wearing traditional Ukrainian dress, Inna Karimova from Balbriggan wearing traditional Russian dress and Galyna Dubey from Tyrrelstown wearing Moldavian traditional dress.
The week long festivities culminate in a family day on Sunday February 26th (traditionally celebrated in Russia as Maslenitsa or Pancake Day), where entertainment will take place in and around Cow's Lane and Essex Street, Temple Bar. The centrepiece concert of the festival at the Olympia Theatre, featuring renowned Russian performer Oleg Pogudin, also takes place on Sunday at 2:30pm and 5pm.
Posted in Misc and tagged Constantin Gurdgiev at 12:19 pm on February 24, 2012 by Broadsheet.


text:
Don't you know that a man being rich is like a girl being pretty? You wouldn't marry a girl just because she's pretty, but my goodness, doesn't it help?
Marilyn Monroe reunites with Howard Hawks a year after her supporting role in Monkey Business, but this time sharing leading lady duties with Jane Russell. But it's Russell's show to command, really, as testified by her impersonation of Monroe's Lorelei Lee during the courtroom climax. Complete with a second, vigorous, run-through of Diamonds are a Girl's Best Friend (Marilyn famously sings it the first time).
Neither star steps on the other's toes, since they're playing complete opposites; Russell, the deadpan, world-wise one in search of love, Monroe the airhead gold-digging bimbo. Monroe's is like no character you've ever seen, both in manner and delivery, but you completely buy into her heightened, almost abstract performance (Fox allegedly wanted her voice dubbed, which goes some way to illustrate how out-there she seemed). It helps too that her suitors her are played by actors with great comic timing. The starlet reportedly drove Hawks to distraction with her demands for retakes (although not so much that he didn't have plans for a third film together); while they may have been unnecessary, at least this is one of her performances that works, and is rightly celebrated.
Showgirls Lorelei and Dorothy Shaw (Russell) travel on a ship to Paris; Lorelei is spied upon by private detective Ernie Malone (Elliott Reed), under the employ of the rich parents of her fiancée Gus Esmond Jr (Tommy Noonan). Before long Lorelei, obsessed with diamonds, is flirting with wealthy mine-owner "Piggy" Beekman (Charles Coburn), while Malone has fallen for Dorothy.
The plot is wafer-thin, and it is punched-up accordingly with a series of show tunes of variable quality (the aforementioned Diamonds… being the highlight). But, with Howard Hawks at the helm, the result is never less than energetic; he also pulls of a couple of comedy coups. Both Charles Coburn and child actor George Winslow featured in Hawks' previous picture, Monkey Business. Coburn is sublime as silly old fart Piggy, attempting to carry on with Lorelei while avoiding his wife's scrutiny. Winslow, meanwhile, plays diminutive tycoon Henry Spofford III and all three appear in the funniest scene. Monroe, wedged in a porthole and draped in a blanket, has Winslow play her body while a bemused Piggy remarks on her tiny hands.
Reid's a bit of a wet blanket as Russell's love interest, and is consigned to playing straight man for most of the proceedings. His presence does at least advance the action, which is more of a means to get from song to song than any attempt at coherent narrative. Which is perhaps surprising, given that the property had already been a novel and a play by the time Hollywood came calling. Perhaps it's just the fate of films set aboard ships (see also the Marx Brothers' haphazard Monkey Business (no connection with Hawks' film, other than title).
If it sounds like I'm damning what is generally regarded as a classic with faint praise, it's rather the case that musicals have an uphill struggle to win me over in the first place. It takes really special entries in the genre to successfully combine songs with story, and Gentlemen Prefer Blondes is unable to reach that plateau. So, for fans of the genre, that I found it agreeable for the most part should be a fair indication of its virtues.
***1/2
Have you betrayed us? Have you betrayed me?!
If I'm going to make a fake movie, it's going to b...
We need to remember where we met. It's been naggin...
Things will go on, and then one day it will all be...
She never gets old! Marcee can't be real; she neve...
There are times when I miss the darkness. It is ha...
What then must we do?
You nicknamed my daughter after the Loch Ness Mons...
What a regrettably large head you have.
How'd you feel if someone broke your dinosaur?
The plan is we stay here and hold up... for good!
It's a trip I won't forget, Avon.
The answer is me and dead owls don't give a hoot.
Power resides where men believe it resides. It's a...
Yowza! Yowza! Yowza!
VSF, man. VSF!
Fortune and glory, kid. Fortune and glory.
Oh, I travel... a sort of licensed troubleshooter.
My presence lay over the hospital like a pall - I ...
That's a lot of cash.
Better luck next time. Only not with me, of course.
And man, a grain of sand, nameless and lost, blows...
I don't mind playing games, but I do object when t...
Well, well... a British agent in love with a Russi...
Van Helsing, I don't want to go to Transylvania!
All right, then he's not infallible. It's just tha...
Don't you know that a man being rich is like a gir...
The truth is, no one knows about me. I feel like I...
I wonder if I may be having a very quiet nervous b...
I don't imagine them. They're quite real. They're ...
Is it possible a man blinded by love might not see...
Strange how an unpleasant child can make a decent ...
Mankind is now mastered by the fruits of his lustf...
Land shark!
I'm the kind of guy who doesn't like to turn aroun...
I tried to imagine a fella smarter than myself. Th...
What you get is what you get. What you do with wha...
The price of a conscience is death. None of us can...
You don't see us, now you do, but only if we want ...
You sure this is the right blind Voodoo lady who l...
Og. I mean no harm, Og. I want to help. I am your ...
Speed is the key.
I meant what I said and I said what I meant. An el...
It's a story that happened yesterday, but I know i...
How're you gonna round up a rattlesnake?
I am the Super Mother Bug!
Don't go in the pimped-out fridge, Jack.
Somewhere, some lucky guy's having a heart attack.
What we have so far is one dead cat and a man who ...
The password is asstastic.
Damn! Where'd ya'll confiscate these rims from, man?
And your garbage, Mr. Valentine. Well, from my exp...
If it's so easy, how come everybody doesn't do it?
There was a great deal of confusion when the High ...
You have a fetching way with women.
I'm living in America. And in America, you're on y...
And that's why, in a straight fight, a shark would...

redpajama_set_name: RedPajamaCommonCrawl


Do You Need Help With Your Pensions or Investments?
If you have any questions and would like to book an appointment with an adviser, please get in touch.
Bespoke Retirement Planning, Investment Management and Financial Planning Advice.
An experienced team of financial advisers providing financial advice to individuals and businesses in Leicestershire and the surrounding areas.
Since its beginnings in 2001, our business has grown largely as a result of recommendations and referrals from existing clients. We hope to maintain this in the years to come through excellent client relationships.
Our core values ensure we act with the utmost degree of integrity and professionalism. We aim to be open and ethical and strive to put our clients' best interests at heart.
With regular meetings over the years, I have been kept abreast of the performance of my pensions, and where they are invested. This is just part of GP3's overall service. It is always a pleasure to visit their office. I would never consider going anywhere else for financial advice.
GP3 explained and laid out the information in such a way that it was really easy for us to understand. We have talked to a lot of people about pensions and haven't learned as much from them as we did from GP3 in an hour. Would recommend them to anyone.
Investing your hard-earned savings for the future can be quite bewildering, especially in the current economic climate. However, the friendly advice given by GP3 was honest, professional and above all, independent, giving unbiased information to a much wider range of investment options and products.
I have known the people at GP3 for many years, and cannot thank them enough for the advice and help over this time. Highly recommended for offering sound advice.


text:
Tag: Oldboy
*NEW* GUARDIANS OF THE GALAXY VOL. 2 REVIEW *NEW*
July 20, 2017 by pmbayobale, posted in Action, Animation, Best and worst films, Blockbuster, CGI, Cinema, Comedy, Fantasy, Film essay, Hollywood, Movie review, Science Fiction, Sequels, Uncategorized
They're back BUT bigger and better?
The Guardians must fight to keep their newfound family together as they unravel the mystery of Peter Quill's (Chris Pratt) true parentage.
Mad fun BUT it falls short of its predecessor.
The silly opening was entertaining enough as the adorable Baby Groot danced around to the beat of ELO's Mr Blue Sky while a violent battle ensued in the background.
I felt the banter and chemistry between the dysfunctional team was all over the place. Writer/director James Gunn tried too hard with the laughs that it hampered the piece in places with the cast just shouting flat insults at each other.
I know a good portion of the story was about the team having teething problems after the events of the first film. BUT the squabbling and yelling really grated against me.
A gag involving the name of a villain drew a laugh BUT it soon overstayed its welcome as the name kept getting brought up.
I felt Vol 1 had the right balance. Each dysfunctional member bringing something to the fold.
This time around, it felt a lot sillier with Rocket and Groot spending too much time in the background.
No one expected anything from Vol 1. It was one of my favourite films of the year. I think I even went to the cinema twice to see it and I never do that for a movie.
Such a strong first movie that it was going to take something special to top it.
Henry Braham's incredibly colourful palette and visual effects were a feast for the eyes. The set pieces were exhilarating and fun to watch.
Kurt Russell was brilliant as Ego. He worked well with Pratt and made their relationship an interesting angle BUT the only problem was that the pace tragically lagged as Quill discovered his true origins.
Even if Laura Haddock's talents (Transformers: The Last Knight) were wasted yet again. I wondered when she got the role as Star-Lord's mother if there was going to be more of her BUT what we got was unnecessary and offered new.
Bradley Cooper's Rocket (Easy now) stole the show with his insults and crazy antics ("Don't call me a raccoon! Trash panda? *PAUSE* Is that worse?").
Vin Diesel had the easiest job going yet again delivering his helium induced phrases to the tiny tree root. You couldn't resist the little rebel.
Elizabeth Debicki (The Night Manager) was completely wasted in her role as Ayesha.
However, there was one character that stole the show for me and that was Yondu. Michael Rooker (The Walking Dead) was fantastic. I loved how we actually got a little depth to the space pirate and explored his past. An unexpected surprise.
Pom Klementieff (Oldboy) was a memorable addition to the mad (and increasingly top heavy) squad as Mantis. Her emotion sensing abilities was a party trick that helped create all sorts of cringe inducing laughs.
Especially on "the thing that nobody's talking about" between Gamora and Quill (Yawwnnnn . . . ).
The only problem was that Gunn expanded on story lines that were already explored in Vol 1. It made things a little repetitive and predictable.
Gamora and Nebula's sibling sparring got on my nerves. Especially when the pair kept kicking off. It was almost as ridiculous as Peter Griffin fighting the Giant Chicken! We had all that in the first one!
Don't get me wrong, there was still fun to be had and I enjoyed the majority of the madness with another fantastic soundtrack that I will no doubt purchase.
Not every wrestling star can make the jump to the big screen BUT Dave Bautista was still on scene stealing form as the deluded Drax with his random outlook and bizarre stories.
The final act redeemed a lot of the problems with an action packed closer that threw in a few unexpected twists and turns along the way. Don't worry, no spoilers here.
So despite its shortcomings, it was still crazy fun and fans won't be disappointed.
P.S. I'm sure you're bored of me saying this BUT don't walk out on the credits. There are several different teasers that pop up. Definitely worth waiting for.
Tagged Bradley Cooper, Chris Pratt, Dave Bautista, Elizabeth Debicki, ELO, Family Guy, Guardians of the Galaxy Vol 1, Guardians of the Galaxy Vol 2, Henry Braham, James Gunn, Kurt Russell, Laura Haddock, Michael Rooker, Oldboy, Peter Griffin, Pom Klementieff, The Night Manager, The Walking Dead, Transformers: The Last Knight, Vin Diesel, Zoe Saldana
OLDBOY REVIEW
June 5, 2014 June 5, 2014 by pmbayobale, posted in Action, Best and worst films, Cinema, Controversial, Crime movies, Drama, Film essay, Foreign films, Hollywood, Movie review, Remakes, Spike Lee, Uncategorized, Violence
Oh Boy!
Now firstly, I am a huge fan of Park Chan-wook's 2004 original cult classic, and was devastated to hear a remake was in the pipeline. However, I felt somewhat assured knowing that Spike Lee (Do The Right Thing and Inside Man) was at the helm, with Josh Brolin and Samuel L (The L stands for Motherfucker) Jackson in the cast.
But what I just watched was a travesty, everything I feared in a Hollywood remake by the bucket load. The opening half hour did pay homage and pretty much covered the same set up as the original, which did not bother me in the slightest, with Brolin with his Southern drawl playing the part to perfection and establishing early on that the character is asking for trouble. For those unaware of the original plot, I will try not to spoil too much but I'm so riled up after watching this, I cannot promise anything.
Basically, the main gist is that Joe Doucett (Brolin) is kidnapped and held prisoner in a hotel room for 20 years, until one day he is released thus putting him on a murderous vengeance-seeking path with a hammer in tow. (That's right. A hammer). Original fans – I'll get to that. What I liked was the little touches. The fact that Lee included the mystery umbrella woman. However, he focuses, if a little too much, more on Doucett's entrapment. Although it allowed the scenes to provide more depth and encapsulate (Word of the day!) his vulnerability and ever-growing psychosis, it could have been condensed a lot quicker.
(Plus was I the only one thinking, Jesus Brolin, put on some pants son?). The Cast Away-inspired pillow companion was a nice touch.
Oldboy was always a strange and violent film but what I loved about Chan-wook's original was that it was suspenseful, intriguing and hypnotic, I couldn't take my eyes off the screen (and no! Not because it was in subtitles!). But once Doucett is freed from his motel confines, Lee seems to throw away everything that made the original a classic for me, leaving a big, bloody mess. This is settled in one ridiculously unnecessary violent scene, in which Brolin pretty much kills a high school football team for getting in his way. And with that very moment, went all logic and interest.
The cast do their utmost to provide a dimension to their wafer thin characters. A notable exception being the beautiful Elizabeth Olsen (I didn't realise the Olsen twins had another sister, my goodness, steady now). You know you're onto a losing streak when even Samuel L Jackson can't save the day (he was the Spirit bad. Bad). Jackson just come across as a whiny, cross dressing weirdo with a stupid blonde Mohican, not even his motherfuckery was funny. Just plain irritating.
The lines fall flat, Brolin the powerhouse actor that he is, can only grumble and pull stupid faces. The dumpling scene, my God! At one point, in an attempt to find his captors, he knows that the food he was given was from a Chinese restaurant. So what does he do? Go to every restaurant and literally fill his face with dumplings until he recognizes the taste.
The whole thing borders on self-parody. At one point, Josh Brolin is riding a tiny Chinese bicycle while chasing after a Jeep frantically waving a hammer and Sharlto Copley (District 9) as the villain. Oh my word! What was the deal with his accent? Now, the villain was always an eccentric and a flamboyant dresser. But Copley's portrayal comes off as a really naff Bond villain from the 70s Moore era. It was laughable. There was genuine suspense when the two protagonists finally meet but with Brolin and Copley, it was comical.
The hammer scene, the infamous hammer scene. Terrible. Lee films it all in one take, like the original, but instead of leaving the camera static and the action unfolding around it, the camera pans around, following Brolin. He only uses the hammer for thirty seconds, then swaps to every possible weapon. The violence is OTT, ridiculous and stupid. He's running around with a knife in his back while being slapped about with 2×4's! One big Saturday Night Live piss take.
No squid eating, just a passing reference. And the umbrella woman, just disappears. My friend who has not seen the original did not get the point to her at all and frankly there wasn't one in this rehash. Oh and the twist. Well, there is a twist for those unfamiliar but for those familiar, it's different, they stay true but go a little bit more messed up.
It is difficult not to draw comparisons, especially to a film that was, and still is good. It did not need to be remade.
On it's own merit, it's a stupidly gory and OTT watchable mess that is so-so at best, and I mean best. Worth a gander if you're a gore nut but the tone is all over the place, just like everything else with this movie. A real mess, a beautifully shot mess but oh boy 1.5/5
Currently ranked 176 out of 178!
Tagged Bad remakes, cast, Cast Away, cult, District 9, Do The Right Thing, Elizabeth Olsen, Hollywood mess, Inside Man, James Bond, Jesus Brolin, Joe Doucett, Josh Brolin, Oldboy, Park Chan-wook, realise the Olsen twins, Remakes, Roger Moore, Samuel L, Samuel L Jackson, Saturday Night Live, Sharlto Copley, Spike Lee, The Spirit


Click picture to email Miss Katie O.
Katie has been a part of the Black Bear team since 2011 and serves as the Director of Therapeutic Programs. She is a native to the Chicagoland area, and grew up in the northwest suburbs. She received her BA from the University of Iowa, where she majored in Speech and Hearing Science. She then attended Rockhurst University in Kansas City, MO, where she pursued her Master's Degree in Speech Pathology. Katie greatly enjoys working with the pediatric population and has gained clinical experience in the schools, outpatient clinics, developmental preschool, the Neonatal Intensive Care Unit, as well as in an acute/rehab hospital setting. She also completed service projects in the field including volunteering as a camp counselor at an overnight camp for children with Autism Spectrum Disorders and tutoring children with reading disorders.
During her time at Black Bear, Katie has had the opportunity to work in each of the therapeutic classrooms offered in the program. She has experience working with a variety of diagnoses including autism spectrum disorders, apraxia of speech, hearing impairments/cochlear implants, genetic/chromosomal syndromes, brain injuries, as well as expressive and receptive language delays and disorders. She has facilitated various feeding groups, social/pragmatic language groups, as well as provided in-class consults across programs. She feels passionate about taking a whole-child approach and working collaboratively in order to maximize outcomes for each child.
Over the past five years, she has been heavily involved in the Kids in Transition (KIT) program. The KIT program supports children and their families as they transition out of Black Bear and into their new academic settings. She has supported the program by providing on-site consults with academic teachers, and on-site and off-site therapies, maintaining communication about progress, and providing additional classroom materials that cater to individualized learning styles. Katie is excited to start another great year at Black Bear!


At the Sultanbeyli Community Center of Refugees Association, workshops in several fields are being carried out for both Turks and Syrians. These studies, aiming to increase social cohesion, proficiency and to teach Turkish, are listed below. In order to be registered, it is necessary to come to our community center in person.
The 6-month long construction workshop is funded by German Ministry for Economic Cooperation and Development. Course module of the workshop is determined by Vesbe, a German organization for vocational training. Trainees are taking their hands-on training in the Construction workshop class at the Refugees Association. Turkish citizens and Syrians between the ages of 16-36 can attend this workshop.
At the computer workshop, realizing with the cooperation of İşkur and Sultanbeyli Public Education Center, basic computer knowledge and Microsoft Office programs are being taught to the participants. The workshop is available to Turkish and Syrian participants. Applications for registration should be done in person at the Refugees Association.
Trainings are given for 4 months at the sewing workshop with the curriculum of the Public Education Center. Participants improve their vocational skills by putting into practice with the materials in the workshop. Since there is a high need for staff in the textile sector at both local and national labor market, demand for this workshop is considerably high. Applications for registration should be done in person at the Refugees Association.
The coiffeur workshop that is planned to open under the partnership of İşkur and Publich Education Center are available to Turks and Syrians. For registration, please visit our office in person.
At the workshop, guitar is taught as an instrument collectively. In addition to guitar, trainees can also exercise with other musical instruments in the workshop.


text:
Byron Thames
Byron Thames has Michael Landon to thank for his career; after a chance meeting with the "Little House on the Prairie" star, Thames was cast on Landon's frontier drama "Father Murphy" as Matt Sims, a young orphan who escapes a life in the workhouse. After the series ended in 1983, Thames landed a recurring role on "Silver Spoons," centered on the relationship between a too-serious child ...
Saving Grace B. Jones (2012)
Chronicle (2012)
Brand New Life: The Honeymooners (1989)
Byron Thames has Michael Landon to thank for his career; after a chance meeting with the "Little House on the Prairie" star, Thames was cast on Landon's frontier drama "Father Murphy" as Matt Sims, a young orphan who escapes a life in the workhouse. After the series ended in 1983, Thames landed a recurring role on "Silver Spoons," centered on the relationship between a too-serious child and his immature father, and was cast as Michael Keaton's younger self in the campy gangster film "Johnny Dangerously." He portrayed a bullied teen who runs away from his family in the romantic comedy "Seven Minutes in Heaven" and a free-spirited teen in the short-lived "A Brand New Life," about the chaos that ensues when a working-class waitress (Barbara Eden) marries a millionaire businessman (Don Murray). In 2001 he played the title diner owner in the largely improvised indie movie "Don's Plum," which starred Leonardo DiCaprio and Tobey Maguire, among others, as aimless L.A. teens. Thames wrote, directed, produced, and acted in the short 2003 film "Love Songs" and appeared as himself in an episode of the HBO series "Californication."
Second Son (1989)
84 Charlie Mopic (1988)
A Father's Homecoming (1988)
Seven Minutes In Heaven (1986)
Jeff Moran
Blame It on the Night (1984)
Johnny Dangerously (1984)
Heart Like A Wheel (1983)
Sound (Feature Film)
Call of the Wild (2020)
Adr Voice Casting
The Longest Ride (2015)
The East (2013)
Stoker (2013)
Marmaduke (2010)
Post Production (Feature Film)
Looping Coordinator
Misc. Crew (Feature Film)
What They Had (2018)
The Maze Runner: The Scorch Trials (2015)
Diary of a Wimpy Kid: Dog Days (2012)
Just Pals (1982)


What role, if any, do you feel that online gaming plays in inquiry based learning and what are some best practices associated with gaming?
I think we first need to ask ourselves some questions about placing gaming into our classrooms.
Where could it fit in a lesson? Why are you using the particular game? Are you using the game as a hook to the lesson? Is it inquiry based or "drill and kill"? Is the game collaborative? Once we can answer these questions, I think we will have a better idea of the game itself and if it will fit into the best practices of online gaming.
I believe that gaming can truly be influential to inquiry based learning. One of the drawbacks we encountered in some of our research in class was that much of the current games we discovered were not directly strategy or inquiry based games. However, this should not deter us from incorporating their use into our lessons. There is a need for the drill, basic skills type knowledge for students to start with before they can even begin to move on to inquiry based learning; therefore, why not make this time of learning just as fun and enjoyable as the inquiry time with online games. We know that students are immediately attracted to the world of online games, it is just up to us as instructors to monitor appropriate use of these tools. Games can be used as that hook to spark students interest at the beginning of a lesson, a much needed review and polish up on those fundamental skills, or as a type of continued exploration of a topic or subject. All this to say, I believe that with the appropriate use of gaming, we can help our students enjoy learning at an even greater level.
Games need to have an accountability piece. We can't just say to students, "Go play this game until lunchtime." Instead we need to have a purpose and an assessment of student learning. Many software companies will give you built in assessment, but that really assesses knowledge based understanding vs. deeper inquiry based understandings. These understandings need to assessed using an authentic method. So, games within inquiry based learning experiences need to have assessments that can gauge student understanding with higher level thinking.
Here is a resource that I found on some of the best practices.
Games, I feel, are definitely a vital asset in learning more about specific subjects. However, they definitely have their place in the classroom. It's important to remember if a game is truly inquiry based or if it's going to be a input/output situation. Collaboration is definitely an important role that games need to have. Using strategy to solve a problem that's not a simple question would be the ideal game for a classroom learning environment.
Incorporating gaming into lessons has the potential for being very beneficial to enhancing those lessons. While most of the online gaming sites seem to be based on "drill" rather than inquiry, these sites can be useful in developing the core knowledge that may be needed in order to proceed further with the inquiry lesson. Student excitement will be increased with the additional use of games and may promote their ability to ask questions or strive to get the higher scores, which is often impossible to achieve using traditional teaching methods.
I think gaming definitely has a place in classrooms, with the correct amount of teacher moderation and the right type of game. There is great potential for problem solving and collaboration in gaming. Students enjoy playing games and many are valuable tools for reinforcing skills. For example, Lure of the Labyrinth provides plenty of opportunity for students to reinforce their Math skills in Pre-Algebra through solving puzzles, which encourages the use of critical thinking skills and also by playing a game, which allows for collaboration. Gaming is definitely a valuable tool if used wisely and I would recommend it as one of many tools to be used in the classroom.