text:
/*
   Overview:
   =========

   This module implements advisory file locking in a portable way.
   Due to the problems with POSIX fcntl locking a separate lock file
   is used.  It would be possible to use fcntl locking on this lock
   file and thus avoid the weird auto unlock bug of POSIX while still
   having an unproved better performance of fcntl locking.  However
   there are still problems left, thus we resort to use a hardlink
   which has the well defined property that a link call will fail if
   the target file already exists.

   Given that hardlinks are also available on NTFS file systems since
   Windows XP; it will be possible to enhance this module to use
   hardlinks even on Windows and thus allow Windows and Posix clients
   to use locking on the same directory.  This is not yet implemented;
   instead we use a lockfile on Windows along with W32 style file
   locking.

   On FAT file systems hardlinks are not supported.  Thus this method
   does not work.  Our solution is to use a O_EXCL locking instead.
   Querying the type of the file system is not easy to do in a
   portable way (e.g. Linux has a statfs, BSDs have a the same call
   but using different structures and constants).  What we do instead
   is to check at runtime whether link(2) works for a specific lock
   file.

   How to use:
   ===========

   At program initialization time, the module should be explicitly
   initialized:

      dotlock_create (NULL, 0);

   This installs an atexit handler and may also initialize mutex etc.
   It is optional for non-threaded applications.  Only the first call
   has an effect.  This needs to be done before any extra threads are
   started.

   To create a lock file (which  prepares it but does not take the
   lock) you do:

     dotlock_t h

     h = dotlock_create (fname, 0);
     if (!h)
       error ("error creating lock file: %s\n", strerror (errno));

   It is important to handle the error.  For example on a read-only
   file system a lock can't be created (but is usually not needed).
   FNAME is the file you want to lock; the actual lockfile is that
   name with the suffix ".lock" appended.  On success a handle to be
   used with the other functions is returned or NULL on error.  Note
   that the handle shall only be used by one thread at a time.  This
   function creates a unique file temporary file (".#lk*") in the same
   directory as FNAME and returns a handle for further operations.
   The module keeps track of theses unique files so that they will be
   unlinked using the atexit handler.  If you don't need the lock file
   anymore, you may also explicitly remove it with a call to:

     dotlock_destroy (h, 1);

   To actually lock the file, you use:

     if (dotlock_take (h, -1))
       error ("error taking lock: %s\n", strerror (errno));

   This function will wait until the lock is acquired.  If an
   unexpected error occurs if will return non-zero and set ERRNO.  If
   you pass (0) instead of (-1) the function does not wait in case the
   file is already locked but returns -1 and sets ERRNO to EACCES.
   Any other positive value for the second parameter is considered a
   timeout valuie in milliseconds.

   To release the lock you call:

     if (dotlock_release (h))
       error ("error releasing lock: %s\n", strerror (errno));

   or, if the lock file is not anymore needed, you may just call
   dotlock_destroy.  However dotlock_release does some extra checks
   before releasing the lock and prints diagnostics to help detecting
   bugs.

   If you want to explicitly destroy all lock files you may call

     dotlock_remove_lockfiles ();

   which is the core of the installed atexit handler.  In case your
   application wants to disable locking completely it may call

     disable_locking ()

   before any locks are created.

   There are two convenience functions to store an integer (e.g. a
   file descriptor) value with the handle:

     void dotlock_set_fd (dotlock_t h, int fd);
     int  dotlock_get_fd (dotlock_t h);

   If nothing has been stored dotlock_get_fd returns -1.

   How to build:
   =============

   This module was originally developed for GnuPG but later changed to
   allow its use without any GnuPG dependency.  If you want to use it
   with you application you may simply use it and it should figure out
   most things automagically.

   You may use the common config.h file to pass macros, but take care
   to pass -DHAVE_CONFIG_H to the compiler.  Macros used by this
   module are:

     DOTLOCK_USE_PTHREAD  - Define if POSIX threads are in use.

     DOTLOCK_GLIB_LOGGING - Define this to use Glib logging functions.

     DOTLOCK_EXT_SYM_PREFIX - Prefix all external symbols with the
                              string to which this macro evaluates.

     GNUPG_MAJOR_VERSION - Defined when used by GnuPG.

     HAVE_DOSISH_SYSTEM  - Defined for Windows etc.  Will be
                           automatically defined if a the target is
                           Windows.

     HAVE_POSIX_SYSTEM   - Internally defined to !HAVE_DOSISH_SYSTEM.

     HAVE_SIGNAL_H       - Should be defined on Posix systems.  If config.h
                           is not used defaults to defined.

     DIRSEP_C            - Separation character for file name parts.
                           Usually not redefined.

     EXTSEP_S            - Separation string for file name suffixes.
                           Usually not redefined.

     HAVE_W32CE_SYSTEM   - Currently only used by GnuPG.

   Note that there is a test program t-dotlock which has compile
   instructions at its end.  At least for SMBFS and CIFS it is
   important that 64 bit versions of stat are used; most programming
   environments do this these days, just in case you want to compile
   it on the command line, remember to pass -D_FILE_OFFSET_BITS=64

   Bugs:
   =====

   On Windows this module is not yet thread-safe.

   Miscellaneous notes:
   ====================

   On hardlinks:
   - Hardlinks are supported under Windows with NTFS since XP/Server2003.
   - In Linux 2.6.33 both SMBFS and CIFS seem to support hardlinks.
   - NFS supports hard links.  But there are solvable problems.
   - FAT does not support links

   On the file locking API:
   - CIFS on Linux 2.6.33 supports several locking methods.
     SMBFS seems not to support locking.  No closer checks done.
   - NFS supports Posix locks.  flock is emulated in the server.
     However there are a couple of problems; see below.
   - FAT does not support locks.
   - An advantage of fcntl locking is that R/W locks can be
     implemented which is not easy with a straight lock file.

   On O_EXCL:
   - Does not work reliable on NFS
   - Should work on CIFS and SMBFS but how can we delete lockfiles?

   On NFS problems:
   - Locks vanish if the server crashes and reboots.
   - Client crashes keep the lock in the server until the client
     re-connects.
   - Communication problems may return unreliable error codes.  The
     MUA Postfix's workaround is to compare the link count after
     seeing an error for link.  However that gives a race.  If using a
     unique file to link to a lockfile and using stat to check the
     link count instead of looking at the error return of link(2) is
     the best solution.
   - O_EXCL seems to have a race and may re-create a file anyway.

*/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

/* Some quick replacements for stuff we usually expect to be defined
   in config.h.  Define HAVE_POSIX_SYSTEM for better readability. */
#if !defined (HAVE_DOSISH_SYSTEM) && defined(_WIN32)
# define HAVE_DOSISH_SYSTEM 1
#endif
#if !defined (HAVE_DOSISH_SYSTEM) && !defined (HAVE_POSIX_SYSTEM)
# define HAVE_POSIX_SYSTEM 1
#endif

/* With no config.h assume that we have sitgnal.h.  */
#if !defined (HAVE_CONFIG_H) && defined (HAVE_POSIX_SYSTEM)
# define HAVE_SIGNAL_H 1
#endif

/* Standard headers.  */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#ifdef  HAVE_DOSISH_SYSTEM
# define WIN32_LEAN_AND_MEAN  /* We only need the OS core stuff.  */
# include <windows.h>
#else
# include <sys/types.h>
# include <sys/stat.h>
# include <sys/utsname.h>
#endif
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_SIGNAL_H
# include <signal.h>
#endif
#ifdef DOTLOCK_USE_PTHREAD
# include <pthread.h>
#endif

#ifdef DOTLOCK_GLIB_LOGGING
# include <glib.h>
#endif

#ifdef GNUPG_MAJOR_VERSION
# if GNUPG_MAJOR_VERSION > 1
#  include "libjnlib-config.h"
# else
#  include "../include/util.h"
# endif
#endif
#ifdef HAVE_W32CE_SYSTEM
# include "utf8conv.h"  /* WindowsCE requires filename conversion.  */
#endif

#include "dotlock.h"

/* Define constants for file name construction.  */
#if !defined(DIRSEP_C) && !defined(EXTSEP_S)
# ifdef HAVE_DOSISH_SYSTEM
#  define DIRSEP_C '\\'
#  define EXTSEP_S "."
#else
#  define DIRSEP_C '/'
#  define EXTSEP_S "."
# endif
#endif

/* In GnuPG we use wrappers around the malloc fucntions.  If they are
   not defined we assume that this code is used outside of GnuPG and
   fall back to the regular malloc functions.  */
#ifndef jnlib_malloc
# define jnlib_malloc(a)     malloc ((a))
# define jnlib_calloc(a,b)   calloc ((a), (b))
# define jnlib_free(a)	     free ((a))
#endif

/* Wrapper to set ERRNO.  */
#ifndef jnlib_set_errno
# ifdef HAVE_W32CE_SYSTEM
#  define jnlib_set_errno(e)  gpg_err_set_errno ((e))
# else
#  define jnlib_set_errno(e)  do { errno = (e); } while (0)
# endif
#endif

/* Gettext macro replacement.  */
#ifndef _
# define _(a) (a)
#endif

#ifdef GNUPG_MAJOR_VERSION
# define my_info_0(a)       log_info ((a))
# define my_info_1(a,b)     log_info ((a), (b))
# define my_info_2(a,b,c)   log_info ((a), (b), (c))
# define my_info_3(a,b,c,d) log_info ((a), (b), (c), (d))
# define my_error_0(a)      log_error ((a))
# define my_error_1(a,b)    log_error ((a), (b))
# define my_error_2(a,b,c)  log_error ((a), (b), (c))
# define my_debug_1(a,b)    log_debug ((a), (b))
# define my_fatal_0(a)      log_fatal ((a))
#elif defined (DOTLOCK_GLIB_LOGGING)
# define my_info_0(a)       g_message ((a))
# define my_info_1(a,b)     g_message ((a), (b))
# define my_info_2(a,b,c)   g_message ((a), (b), (c))
# define my_info_3(a,b,c,d) g_message ((a), (b), (c), (d))
# define my_error_0(a)      g_warning ((a))
# define my_error_1(a,b)    g_warning ((a), (b))
# define my_error_2(a,b,c)  g_warning ((a), (b), (c))
# define my_debug_1(a,b)    g_debug ((a), (b))
# define my_fatal_0(a)      g_error ((a))
#else
# define my_info_0(a)       fprintf (stderr, (a))
# define my_info_1(a,b)     fprintf (stderr, (a), (b))
# define my_info_2(a,b,c)   fprintf (stderr, (a), (b), (c))
# define my_info_3(a,b,c,d) fprintf (stderr, (a), (b), (c), (d))
# define my_error_0(a)      fprintf (stderr, (a))
# define my_error_1(a,b)    fprintf (stderr, (a), (b))
# define my_error_2(a,b,c)  fprintf (stderr, (a), (b), (c))
# define my_debug_1(a,b)    fprintf (stderr, (a), (b))
# define my_fatal_0(a)      do { fprintf (stderr,(a)); fflush (stderr); \
                                 abort (); } while (0)
#endif

/* The object describing a lock.  */
struct dotlock_handle
{
  struct dotlock_handle *next;
  char *lockname;            /* Name of the actual lockfile.          */
  unsigned int locked:1;     /* Lock status.                          */
  unsigned int disable:1;    /* If true, locking is disabled.         */
  unsigned int use_o_excl:1; /* Use open (O_EXCL) for locking.        */

  int extra_fd;              /* A place for the caller to store an FD.  */

#ifdef HAVE_DOSISH_SYSTEM
  HANDLE lockhd;       /* The W32 handle of the lock file.      */
#else /*!HAVE_DOSISH_SYSTEM */
  char *tname;         /* Name of the lockfile template.        */
  size_t nodename_off; /* Offset in TNAME of the nodename part. */
  size_t nodename_len; /* Length of the nodename part.          */
#endif /*!HAVE_DOSISH_SYSTEM */
};

/* A list of of all lock handles.  The volatile attribute might help
   if used in an atexit handler.  */
static volatile dotlock_t all_lockfiles;
#ifdef DOTLOCK_USE_PTHREAD
static pthread_mutex_t all_lockfiles_mutex = PTHREAD_MUTEX_INITIALIZER;
# define LOCK_all_lockfiles() do {                               \
        if (pthread_mutex_lock (&all_lockfiles_mutex))           \
          my_fatal_0 ("locking all_lockfiles_mutex failed\n");   \
      } while (0)
# define UNLOCK_all_lockfiles() do {                             \
        if (pthread_mutex_unlock (&all_lockfiles_mutex))         \
          my_fatal_0 ("unlocking all_lockfiles_mutex failed\n"); \
      } while (0)
#else  /*!DOTLOCK_USE_PTHREAD*/
# define LOCK_all_lockfiles()   do { } while (0)
# define UNLOCK_all_lockfiles() do { } while (0)
#endif /*!DOTLOCK_USE_PTHREAD*/

/* If this has the value true all locking is disabled.  */
static int never_lock;

/* Entirely disable all locking.  This function should be called
   before any locking is done.  It may be called right at startup of
   the process as it only sets a global value.  */
void
dotlock_disable (void)
{
  never_lock = 1;
}

#ifdef HAVE_POSIX_SYSTEM
static int
maybe_deadlock (dotlock_t h)
{
  dotlock_t r;
  int res = 0;

  LOCK_all_lockfiles ();
  for (r=all_lockfiles; r; r = r->next)
    {
      if ( r != h && r->locked )
        {
          res = 1;
          break;
        }
    }
  UNLOCK_all_lockfiles ();
  return res;
}
#endif /*HAVE_POSIX_SYSTEM*/

/* Read the lock file and return the pid, returns -1 on error.  True
   will be stored in the integer at address SAME_NODE if the lock file
   has been created on the same node. */
#ifdef HAVE_POSIX_SYSTEM
static int
read_lockfile (dotlock_t h, int *same_node )
{
  char buffer_space[10+1+70+1]; /* 70 is just an estimated value; node
                                   names are usually shorter. */
  int fd;
  int pid = -1;
  char *buffer, *p;
  size_t expected_len;
  int res, nread;

  *same_node = 0;
  expected_len = 10 + 1 + h->nodename_len + 1;
  if ( expected_len >= sizeof buffer_space)
    {
      buffer = jnlib_malloc (expected_len);
      if (!buffer)
        return -1;
    }
  else
    buffer = buffer_space;

  if ( (fd = open (h->lockname, O_RDONLY)) == -1 )
    {
      int e = errno;
      my_info_2 ("error opening lockfile `%s': %s\n",
                 h->lockname, strerror(errno) );
      if (buffer != buffer_space)
        jnlib_free (buffer);
      jnlib_set_errno (e); /* Need to return ERRNO here. */
      return -1;
    }

  p = buffer;
  nread = 0;
  do
    {
      res = read (fd, p, expected_len - nread);
      if (res == -1 && errno == EINTR)
        continue;
      if (res < 0)
        {
          my_info_1 ("error reading lockfile `%s'\n", h->lockname );
          close (fd);
          if (buffer != buffer_space)
            jnlib_free (buffer);
          jnlib_set_errno (0); /* Do not return an inappropriate ERRNO. */
          return -1;
        }
      p += res;
      nread += res;
    }
  while (res && nread != expected_len);
  close(fd);

  if (nread < 11)
    {
      my_info_1 ("invalid size of lockfile `%s'\n", h->lockname);
      if (buffer != buffer_space)
        jnlib_free (buffer);
      jnlib_set_errno (0); /* Better don't return an inappropriate ERRNO. */
      return -1;
    }

  if (buffer[10] != '\n'
      || (buffer[10] = 0, pid = atoi (buffer)) == -1
      || !pid )
    {
      my_error_2 ("invalid pid %d in lockfile `%s'\n", pid, h->lockname);
      if (buffer != buffer_space)
        jnlib_free (buffer);
      jnlib_set_errno (0);
      return -1;
    }

  if (nread == expected_len
      && !memcmp (h->tname+h->nodename_off, buffer+11, h->nodename_len)
      && buffer[11+h->nodename_len] == '\n')
    *same_node = 1;

  if (buffer != buffer_space)
    jnlib_free (buffer);
  return pid;
}
#endif /*HAVE_POSIX_SYSTEM */

/* Check whether the file system which stores TNAME supports
   hardlinks.  Instead of using the non-portable statsfs call which
   differs between various Unix versions, we do a runtime test.
   Returns: 0 supports hardlinks; 1 no hardlink support, -1 unknown
   (test error).  */
#ifdef HAVE_POSIX_SYSTEM
static int
use_hardlinks_p (const char *tname)
{
  char *lname;
  struct stat sb;
  unsigned int nlink;
  int res;

  if (stat (tname, &sb))
    return -1;
  nlink = (unsigned int)sb.st_nlink;

  lname = jnlib_malloc (strlen (tname) + 1 + 1);
  if (!lname)
    return -1;
  strcpy (lname, tname);
  strcat (lname, "x");

  /* We ignore the return value of link() because it is unreliable.  */
  (void) link (tname, lname);

  if (stat (tname, &sb))
    res = -1;  /* Ooops.  */
  else if (sb.st_nlink == nlink + 1)
    res = 0;   /* Yeah, hardlinks are supported.  */
  else
    res = 1;   /* No hardlink support.  */

  unlink (lname);
  jnlib_free (lname);
  return res;
}
#endif /*HAVE_POSIX_SYSTEM */

#ifdef  HAVE_POSIX_SYSTEM
/* Locking core for Unix.  It used a temporary file and the link
   system call to make locking an atomic operation. */
static dotlock_t
dotlock_create_unix (dotlock_t h, const char *file_to_lock)
{
  int  fd = -1;
  char pidstr[16];
  const char *nodename;
  const char *dirpart;
  int dirpartlen;
  struct utsname utsbuf;
  size_t tnamelen;

  snprintf (pidstr, sizeof pidstr, "%10d\n", (int)getpid() );

  /* Create a temporary file. */
  if ( uname ( &utsbuf ) )
    nodename = "unknown";
  else
    nodename = utsbuf.nodename;

  if ( !(dirpart = strrchr (file_to_lock, DIRSEP_C)) )
    {
      dirpart = EXTSEP_S;
      dirpartlen = 1;
    }
  else
    {
      dirpartlen = dirpart - file_to_lock;
      dirpart = file_to_lock;
    }

  LOCK_all_lockfiles ();
  h->next = all_lockfiles;
  all_lockfiles = h;

  tnamelen = dirpartlen + 6 + 30 + strlen(nodename) + 10 + 1;
  h->tname = jnlib_malloc (tnamelen + 1);
  if (!h->tname)
    {
      all_lockfiles = h->next;
      UNLOCK_all_lockfiles ();
      jnlib_free (h);
      return NULL;
    }
  h->nodename_len = strlen (nodename);

  snprintf (h->tname, tnamelen, "%.*s/.#lk%p.", dirpartlen, dirpart, h );
  h->nodename_off = strlen (h->tname);
  snprintf (h->tname+h->nodename_off, tnamelen - h->nodename_off,
           "%s.%d", nodename, (int)getpid ());

  do
    {
      jnlib_set_errno (0);
      fd = open (h->tname, O_WRONLY|O_CREAT|O_EXCL,
                 S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR );
    }
  while (fd == -1 && errno == EINTR);

  if ( fd == -1 )
    {
      all_lockfiles = h->next;
      UNLOCK_all_lockfiles ();
      my_error_2 (_("failed to create temporary file `%s': %s\n"),
                  h->tname, strerror(errno));
      jnlib_free (h->tname);
      jnlib_free (h);
      return NULL;
    }
  if ( write (fd, pidstr, 11 ) != 11 )
    goto write_failed;
  if ( write (fd, nodename, strlen (nodename) ) != strlen (nodename) )
    goto write_failed;
  if ( write (fd, "\n", 1 ) != 1 )
    goto write_failed;
  if ( close (fd) )
    goto write_failed;

  /* Check whether we support hard links.  */
  switch (use_hardlinks_p (h->tname))
    {
    case 0: /* Yes.  */
      break;
    case 1: /* No.  */
      unlink (h->tname);
      h->use_o_excl = 1;
      break;
    default:
      my_error_2 ("can't check whether hardlinks are supported for `%s': %s\n",
                  h->tname, strerror(errno));
      goto write_failed;
    }

  h->lockname = jnlib_malloc (strlen (file_to_lock) + 6 );
  if (!h->lockname)
    {
      all_lockfiles = h->next;
      UNLOCK_all_lockfiles ();
      unlink (h->tname);
      jnlib_free (h->tname);
      jnlib_free (h);
      return NULL;
    }
  strcpy (stpcpy (h->lockname, file_to_lock), EXTSEP_S "lock");
  UNLOCK_all_lockfiles ();
  if (h->use_o_excl)
    my_debug_1 ("locking for `%s' done via O_EXCL\n", h->lockname);

  return h;

 write_failed:
  all_lockfiles = h->next;
  UNLOCK_all_lockfiles ();
  my_error_2 (_("error writing to `%s': %s\n"), h->tname, strerror (errno));
  close (fd);
  unlink (h->tname);
  jnlib_free (h->tname);
  jnlib_free (h);
  return NULL;
}
#endif /*HAVE_POSIX_SYSTEM*/

#ifdef HAVE_DOSISH_SYSTEM
/* Locking core for Windows.  This version does not need a temporary
   file but uses the plain lock file along with record locking.  We
   create this file here so that we later only need to do the file
   locking.  For error reporting it is useful to keep the name of the
   file in the handle.  */
static dotlock_t
dotlock_create_w32 (dotlock_t h, const char *file_to_lock)
{
  LOCK_all_lockfiles ();
  h->next = all_lockfiles;
  all_lockfiles = h;

  h->lockname = jnlib_malloc ( strlen (file_to_lock) + 6 );
  if (!h->lockname)
    {
      all_lockfiles = h->next;
      UNLOCK_all_lockfiles ();
      jnlib_free (h);
      return NULL;
    }
  strcpy (stpcpy(h->lockname, file_to_lock), EXTSEP_S "lock");

  /* If would be nice if we would use the FILE_FLAG_DELETE_ON_CLOSE
     along with FILE_SHARE_DELETE but that does not work due to a race
     condition: Despite the OPEN_ALWAYS flag CreateFile may return an
     error and we can't reliable create/open the lock file unless we
     would wait here until it works - however there are other valid
     reasons why a lock file can't be created and thus the process
     would not stop as expected but spin until Windows crashes.  Our
     solution is to keep the lock file open; that does not harm. */
  {
#ifdef HAVE_W32CE_SYSTEM
    wchar_t *wname = utf8_to_wchar (h->lockname);

    if (wname)
      h->lockhd = CreateFile (wname,
                              GENERIC_READ|GENERIC_WRITE,
                              FILE_SHARE_READ|FILE_SHARE_WRITE,
                              NULL, OPEN_ALWAYS, 0, NULL);
    else
      h->lockhd = INVALID_HANDLE_VALUE;
    jnlib_free (wname);
#else
    h->lockhd = CreateFile (h->lockname,
                            GENERIC_READ|GENERIC_WRITE,
                            FILE_SHARE_READ|FILE_SHARE_WRITE,
                            NULL, OPEN_ALWAYS, 0, NULL);
#endif
  }
  if (h->lockhd == INVALID_HANDLE_VALUE)
    {
      all_lockfiles = h->next;
      UNLOCK_all_lockfiles ();
      my_error_2 (_("can't create `%s': %s\n"), h->lockname, w32_strerror (-1));
      jnlib_free (h->lockname);
      jnlib_free (h);
      return NULL;
    }
  return h;
}
#endif /*HAVE_DOSISH_SYSTEM*/

/* Create a lockfile for a file name FILE_TO_LOCK and returns an
   object of type dotlock_t which may be used later to actually acquire
   the lock.  A cleanup routine gets installed to cleanup left over
   locks or other files used internally by the lock mechanism.

   Calling this function with NULL does only install the atexit
   handler and may thus be used to assure that the cleanup is called
   after all other atexit handlers.

   This function creates a lock file in the same directory as
   FILE_TO_LOCK using that name and a suffix of ".lock".  Note that on
   POSIX systems a temporary file ".#lk.<hostname>.pid[.threadid] is
   used.

   FLAGS must be 0.

   The function returns an new handle which needs to be released using
   destroy_dotlock but gets also released at the termination of the
   process.  On error NULL is returned.
 */

dotlock_t
dotlock_create (const char *file_to_lock, unsigned int flags)
{
  static int initialized;
  dotlock_t h;

  if ( !initialized )
    {
      atexit (dotlock_remove_lockfiles_reclaim);
      initialized = 1;
    }

  if ( !file_to_lock )
    return NULL;  /* Only initialization was requested.  */

  if (flags)
    {
      jnlib_set_errno (EINVAL);
      return NULL;
    }

  h = jnlib_calloc (1, sizeof *h);
  if (!h)
    return NULL;
  h->extra_fd = -1;

  if (never_lock)
    {
      h->disable = 1;
      LOCK_all_lockfiles ();
      h->next = all_lockfiles;
      all_lockfiles = h;
      UNLOCK_all_lockfiles ();
      return h;
    }

#ifdef HAVE_DOSISH_SYSTEM
  return dotlock_create_w32 (h, file_to_lock);
#else /*!HAVE_DOSISH_SYSTEM */
  return dotlock_create_unix (h, file_to_lock);
#endif /*!HAVE_DOSISH_SYSTEM*/
}

/* Convenience function to store a file descriptor (or any any other
   integer value) in the context of handle H.  */
void
dotlock_set_fd (dotlock_t h, int fd)
{
  h->extra_fd = fd;
}

/* Convenience function to retrieve a file descriptor (or any any other
   integer value) stored in the context of handle H.  */
int
dotlock_get_fd (dotlock_t h)
{
  return h->extra_fd;
}

#ifdef HAVE_POSIX_SYSTEM
/* Unix specific code of destroy_dotlock.  */
static void
dotlock_destroy_unix (dotlock_t h, int reclaim)
{
  if (h->locked && h->lockname)
    unlink (h->lockname);
  if (h->tname && !h->use_o_excl)
    unlink (h->tname);
  if (reclaim)
    jnlib_free (h->tname);
}
#endif /*HAVE_POSIX_SYSTEM*/

#ifdef HAVE_DOSISH_SYSTEM
/* Windows specific code of destroy_dotlock.  */
static void
dotlock_destroy_w32 (dotlock_t h)
{
  if (h->locked)
    {
      OVERLAPPED ovl;

      memset (&ovl, 0, sizeof ovl);
      UnlockFileEx (h->lockhd, 0, 1, 0, &ovl);
    }
  CloseHandle (h->lockhd);
}
#endif /*HAVE_DOSISH_SYSTEM*/

/* Destroy the locck handle H and release the lock.  */
void
dotlock_destroy (dotlock_t h, int reclaim)
{
  dotlock_t hprev, htmp;

  if ( !h )
    return;

  /* First remove the handle from our global list of all locks. */
  LOCK_all_lockfiles ();
  for (hprev=NULL, htmp=all_lockfiles; htmp; hprev=htmp, htmp=htmp->next)
    if (htmp == h)
      {
        if (hprev)
          hprev->next = htmp->next;
        else
          all_lockfiles = htmp->next;
        h->next = NULL;
        break;
      }
  UNLOCK_all_lockfiles ();

  /* Then destroy the lock. */
  if (!h->disable)
    {
#ifdef HAVE_DOSISH_SYSTEM
      dotlock_destroy_w32 (h);
#else /* !HAVE_DOSISH_SYSTEM */
      dotlock_destroy_unix (h, reclaim);
#endif /* HAVE_DOSISH_SYSTEM */
      if (reclaim)
	jnlib_free (h->lockname);
    }
  if (reclaim)
    jnlib_free (h);
}

#ifdef HAVE_POSIX_SYSTEM
/* Unix specific code of make_dotlock.  Returns 0 on success and -1 on
   error.  */
static int
dotlock_take_unix (dotlock_t h, long timeout)
{
  int wtime = 0;
  int sumtime = 0;
  int pid;
  int lastpid = -1;
  int ownerchanged;
  const char *maybe_dead="";
  int same_node;

 again:
  if (h->use_o_excl)
    {
      /* No hardlink support - use open(O_EXCL).  */
      int fd;

      do
        {
          jnlib_set_errno (0);
          fd = open (h->lockname, O_WRONLY|O_CREAT|O_EXCL,
                     S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR );
        }
      while (fd == -1 && errno == EINTR);

      if (fd == -1 && errno == EEXIST)
        ; /* Lock held by another process.  */
      else if (fd == -1)
        {
          my_error_2 ("lock not made: open(O_EXCL) of `%s' failed: %s\n",
                      h->lockname, strerror (errno));
          return -1;
        }
      else
        {
          char pidstr[16];

          snprintf (pidstr, sizeof pidstr, "%10d\n", (int)getpid());
          if (write (fd, pidstr, 11 ) == 11
              && write (fd, h->tname + h->nodename_off,h->nodename_len)
              == h->nodename_len
              && write (fd, "\n", 1) == 1
              && !close (fd))
            {
              h->locked = 1;
              return 0;
            }
          /* Write error.  */
          my_error_2 ("lock not made: writing to `%s' failed: %s\n",
                      h->lockname, strerror (errno));
          close (fd);
          unlink (h->lockname);
          return -1;
        }
    }
  else /* Standard method:  Use hardlinks.  */
    {
      struct stat sb;

      /* We ignore the return value of link() because it is unreliable.  */
      (void) link (h->tname, h->lockname);

      if (stat (h->tname, &sb))
        {
          my_error_1 ("lock not made: Oops: stat of tmp file failed: %s\n",
                      strerror (errno));
          /* In theory this might be a severe error: It is possible
             that link succeeded but stat failed due to changed
             permissions.  We can't do anything about it, though.  */
          return -1;
        }

      if (sb.st_nlink == 2)
        {
          h->locked = 1;
          return 0; /* Okay.  */
        }
    }

  /* Check for stale lock files.  */
  if ( (pid = read_lockfile (h, &same_node)) == -1 )
    {
      if ( errno != ENOENT )
        {
          my_info_0 ("cannot read lockfile\n");
          return -1;
        }
      my_info_0 ("lockfile disappeared\n");
      goto again;
    }
  else if ( pid == getpid() && same_node )
    {
      my_info_0 ("Oops: lock already held by us\n");
      h->locked = 1;
      return 0; /* okay */
    }
  else if ( same_node && kill (pid, 0) && errno == ESRCH )
    {
      /* Note: It is unlikley that we get a race here unless a pid is
         reused too fast or a new process with the same pid as the one
         of the stale file tries to lock right at the same time as we.  */
      my_info_1 (_("removing stale lockfile (created by %d)\n"), pid);
      unlink (h->lockname);
      goto again;
    }

  if (lastpid == -1)
    lastpid = pid;
  ownerchanged = (pid != lastpid);

  if (timeout)
    {
      struct timeval tv;

      /* Wait until lock has been released.  We use increasing retry
         intervals of 50ms, 100ms, 200ms, 400ms, 800ms, 2s, 4s and 8s
         but reset it if the lock owner meanwhile changed.  */
      if (!wtime || ownerchanged)
        wtime = 50;
      else if (wtime < 800)
        wtime *= 2;
      else if (wtime == 800)
        wtime = 2000;
      else if (wtime < 8000)
        wtime *= 2;

      if (timeout > 0)
        {
          if (wtime > timeout)
            wtime = timeout;
          timeout -= wtime;
        }

      sumtime += wtime;
      if (sumtime >= 1500)
        {
          sumtime = 0;
          my_info_3 (_("waiting for lock (held by %d%s) %s...\n"),
                     pid, maybe_dead, maybe_deadlock(h)? _("(deadlock?) "):"");
        }

      tv.tv_sec = wtime / 1000;
      tv.tv_usec = (wtime % 1000) * 1000;
      select (0, NULL, NULL, NULL, &tv);
      goto again;
    }

  jnlib_set_errno (EACCES);
  return -1;
}
#endif /*HAVE_POSIX_SYSTEM*/

#ifdef HAVE_DOSISH_SYSTEM
/* Windows specific code of make_dotlock.  Returns 0 on success and -1 on
   error.  */
static int
dotlock_take_w32 (dotlock_t h, long timeout)
{
  int wtime = 0;
  int w32err;
  OVERLAPPED ovl;

 again:
  /* Lock one byte at offset 0.  The offset is given by OVL.  */
  memset (&ovl, 0, sizeof ovl);
  if (LockFileEx (h->lockhd, (LOCKFILE_EXCLUSIVE_LOCK
                              | LOCKFILE_FAIL_IMMEDIATELY), 0, 1, 0, &ovl))
    {
      h->locked = 1;
      return 0; /* okay */
    }

  w32err = GetLastError ();
  if (w32err != ERROR_LOCK_VIOLATION)
    {
      my_error_2 (_("lock `%s' not made: %s\n"),
                  h->lockname, w32_strerror (w32err));
      return -1;
    }

  if (timeout)
    {
      /* Wait until lock has been released.  We use retry intervals of
         50ms, 100ms, 200ms, 400ms, 800ms, 2s, 4s and 8s.  */
      if (!wtime)
        wtime = 50;
      else if (wtime < 800)
        wtime *= 2;
      else if (wtime == 800)
        wtime = 2000;
      else if (wtime < 8000)
        wtime *= 2;

      if (timeout > 0)
        {
          if (wtime > timeout)
            wtime = timeout;
          timeout -= wtime;
        }

      if (wtime >= 800)
        my_info_1 (_("waiting for lock %s...\n"), h->lockname);

      Sleep (wtime);
      goto again;
    }

  return -1;
}
#endif /*HAVE_DOSISH_SYSTEM*/

/* Take a lock on H.  A value of 0 for TIMEOUT returns immediately if
   the lock can't be taked, -1 waits forever (hopefully not), other
   values wait for TIMEOUT milliseconds.  Returns: 0 on success  */
int
dotlock_take (dotlock_t h, long timeout)
{
  int ret;

  if ( h->disable )
    return 0; /* Locks are completely disabled.  Return success. */

  if ( h->locked )
    {
      my_debug_1 ("Oops, `%s' is already locked\n", h->lockname);
      return 0;
    }

#ifdef HAVE_DOSISH_SYSTEM
  ret = dotlock_take_w32 (h, timeout);
#else /*!HAVE_DOSISH_SYSTEM*/
  ret = dotlock_take_unix (h, timeout);
#endif /*!HAVE_DOSISH_SYSTEM*/

  return ret;
}

#ifdef HAVE_POSIX_SYSTEM
/* Unix specific code of release_dotlock.  */
static int
dotlock_release_unix (dotlock_t h)
{
  int pid, same_node;

  pid = read_lockfile (h, &same_node);
  if ( pid == -1 )
    {
      my_error_0 ("release_dotlock: lockfile error\n");
      return -1;
    }
  if ( pid != getpid() || !same_node )
    {
      my_error_1 ("release_dotlock: not our lock (pid=%d)\n", pid);
      return -1;
    }

  if ( unlink( h->lockname ) )
    {
      my_error_1 ("release_dotlock: error removing lockfile `%s'\n",
                  h->lockname);
      return -1;
    }
  /* Fixme: As an extra check we could check whether the link count is
     now really at 1. */
  return 0;
}
#endif /*HAVE_POSIX_SYSTEM */

#ifdef HAVE_DOSISH_SYSTEM
/* Windows specific code of release_dotlock.  */
static int
dotlock_release_w32 (dotlock_t h)
{
  OVERLAPPED ovl;

  memset (&ovl, 0, sizeof ovl);
  if (!UnlockFileEx (h->lockhd, 0, 1, 0, &ovl))
    {
      my_error_2 ("release_dotlock: error removing lockfile `%s': %s\n",
                  h->lockname, w32_strerror (-1));
      return -1;
    }

  return 0;
}
#endif /*HAVE_DOSISH_SYSTEM */

/* Release a lock.  Returns 0 on success.  */
int
dotlock_release (dotlock_t h)
{
  int ret;

  /* To avoid atexit race conditions we first check whether there are
     any locks left.  It might happen that another atexit handler
     tries to release the lock while the atexit handler of this module
     already ran and thus H is undefined.  */
  LOCK_all_lockfiles ();
  ret = !all_lockfiles;
  UNLOCK_all_lockfiles ();
  if (ret)
    return 0;

  if ( h->disable )
    return 0;

  if ( !h->locked )
    {
      my_debug_1 ("Oops, `%s' is not locked\n", h->lockname);
      return 0;
    }

#ifdef HAVE_DOSISH_SYSTEM
  ret = dotlock_release_w32 (h);
#else
  ret = dotlock_release_unix (h);
#endif

  if (!ret)
    h->locked = 0;
  return ret;
}

/* Remove all lockfiles.  This is called by the atexit handler
   installed by this module but may also be called by other
   termination handlers.

   When RECLAIM == 0, it doesn't reclaim memory allocated.
   This is useful calling by signal handlers.
*/

void
dotlock_remove_lockfiles (int reclaim)
{
  dotlock_t h, h2;

  /* First set the lockfiles list to NULL so that for example
     dotlock_release is ware that this fucntion is currently
     running.  */
  LOCK_all_lockfiles ();
  h = all_lockfiles;
  all_lockfiles = NULL;
  UNLOCK_all_lockfiles ();

  while ( h )
    {
      h2 = h->next;
      dotlock_destroy (h, reclaim);
      h = h2;
    }
}

void
dotlock_remove_lockfiles_reclaim (void)
{
  dotlock_remove_lockfiles (1);
}

redpajama_set_name: RedPajamaGithub


To receive news and publication updates for Depression Research and Treatment, enter your email address in the box below.
Copyright © 2011 John E. Zeber et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
John E. Zeber, Jodi M. Gonzalez, Richard Van Dorn, and Alejandro Interian, "Ethnicity and Cultural Issues," Depression Research and Treatment, vol. 2011, Article ID 195084, 3 pages, 2011. https://doi.org/10.1155/2011/195084.


Sensory integration is the neurological process that allows our brain to combine the sensations from our bodies and our world into meaningful and useful information. When this process is efficient we are provided with the necessary information to allow us to participate and engage in our world so that we can interact, learn and develop. We are able to receive, interpret, process and adapt information in a meaningful and purposeful way.
As children develop, the ability to perform this process should become more efficient, thus enabling us to gradually utilize increasingly complex, multi-sensory information. For some children though, this process is not automatic. Their brain and therefore their body, has to work harder to complete the same tasks. This additional challenge inhibits their ability to fully engage in their world and their environment. Problems in learning, development or behavior may be evident.
Occupational therapists use sensory integration therapy, which includes the use of therapeutic techniques as well as the creation of a playful environment. This then facilitates activities to encourage an adaptive response and promote quality participation in tasks in which we find meaning and value. For children, this means the ability to engage in family activities, participate in school based settings, socialize with friends, enjoy play and leisure activities and perform developmentally appropriate self-care skills.
Please click here for additional information regarding sensory integration.


text:
Publications [#341045] of Jenny Tung
Papers Published
Vilgalys, TP; Rogers, J; Jolly, CJ; Mukherjee, S; Tung, J, Evolution of DNA Methylation in Papio Baboons., Molecular Biology and Evolution, vol. 36 no. 3 (March, 2019), pp. 527-540
(last updated on 2019/07/15)
Changes in gene regulation have long been thought to play an important role in primate evolution. However, although a number of studies have compared genome-wide gene expression patterns across primate species, fewer have investigated the gene regulatory mechanisms that underlie such patterns, or the relative contribution of drift versus selection. Here, we profiled genome-scale DNA methylation levels in blood samples from five of the six extant species of the baboon genus Papio (4-14 individuals per species). This radiation presents the opportunity to investigate DNA methylation divergence at both shallow and deeper timescales (0.380-1.4 My). In contrast to studies in human populations, but similar to studies in great apes, DNA methylation profiles clearly mirror genetic and geographic structure. Divergence in DNA methylation proceeds fastest in unannotated regions of the genome and slowest in regions of the genome that are likely more constrained at the sequence level (e.g., gene exons). Both heuristic approaches and Ornstein-Uhlenbeck models suggest that DNA methylation levels at a small set of sites have been affected by positive selection, and that this class is enriched in functionally relevant contexts, including promoters, enhancers, and CpG islands. Our results thus indicate that the rate and distribution of DNA methylation changes across the genome largely mirror genetic structure. However, at some CpG sites, DNA methylation levels themselves may have been a target of positive selection, pointing to loci that could be important in connecting sequence variation to fitness-related traits.

redpajama_set_name: RedPajamaCommonCrawl


Cannabis in São Tomé and Principe is illegal, but is trafficked illicitly. In the 1890s, Portuguese Angolans sold "notable quantities" to Angolan laborers in São Tomé, despite cannabis growing prolifically in the vicinity of the laborers' quarters.
^ Chris Duvall (15 November 2014). Cannabis. Reaktion Books. pp. 98–. ISBN 978-1-78023-386-4.
This São Tomé and Príncipe-related article is a stub. You can help Wikipedia by expanding it.
This page was last edited on 13 February 2017, at 03:49 (UTC).


Featuring a restaurant and bar, Hotel BanjaLuka offers rooms with air conditioning and heating. Free WiFi access is provided in all areas of the hotel. The modern rooms are all equipped with satellite TV.
Hotel Hotel Banja Luka cost depends on the season and prices can be much different basing on selected dates. The diagram below illustrates price changing dynamic for Hotel Banja Luka hotel by months. For example, the lowest prices - on the average $67 - are in May, and by December hotel Hotel Banja Luka cost grows on the average up to $77.


Erica has boomed this last month by simply being "Erica". Since September, her sideline picture with Justin James Watt at AT&T Stadium, followed immediately with a Dallas Cowboy's Hype Video, she has become a "Mystery" to the public eye. The next day her Social Media (which was already impressive because of her personal background) exploded, and she was getting requested by teams (High-School, College, NFL, MLB, NBA) to cover their games. She has what we call now, "The Erica Flare",and it shows in her publications, and how she conducts herself around Agents, Athletes, Coaches and Mass Media Entities. Her quirky personality airs on ESPN Radio from time to time, and her Public Relations work with Coaches, Athletes,Organizations, and many other Institutions have been distributed on many media outlets.
Erica has also been asked to attend schools as a "Motivational Speaker" with NFL players, Co-Host on ESPN Radio, Promos with ESPN, CBS, and USA Sports Today with the Coaches Poll, Promote Clothing Lines, Health/Fitness Products, and many others.
Her Twitter, Instagram, Facebook Page, and Snap Chat have been continuously growing since the end of September. She has almost 15k followers on Twitter, over 24k on Instagram, and the Evolve With Erica Snap Chat gets over 2k plus views daily. Let us all remember, this was a hobby, a passion, and then September of 2015 Football Season came along.
One of the many stand-out qualities about Erica is that her passion is helping others, and putting them first; This was not intended for fame or fortune. She receives many requests, Her supporters believe in her, Her cause, and what she does for the community and others is highly respected. The hard work she puts into everything is duly noted, personable, and genuine- This is hard to come across in any profession.


text:
Home Latest News Apple sees huge market potential in India
Apple sees huge market potential in India
Apple sees a huge market potential for its products in India and the technology giant is really putting energy in the country which will begin rolling out high-speed wireless networks this year, CEO Tim Cook said.
Tim Cook said in emerging markets like India, LTE (wireless) penetration is currently zero but as LTE begins to roll out this year in the country
According to a report in PTI: "This is another huge one. India will be the most populous country in the world in 2022. India today has about 50 per cent of their population at 25 years of age or younger. It's a very young country. People really want smartphones there," Cook said in an interview.
He said in emerging markets like India, LTE (wireless) penetration is currently zero but as LTE begins to roll out this year in the country, the dynamics will change.
"And so that's changing. Huge market potential," he said in response to a question about the Indian market for Apple. Cook said the company has got great innovation in the pipeline and new iPhones that will attract people in markets like India. He added that in countries like India, Apple penetration has been less since there is no LTE networks.
"What I see is that countries like India, no LTE, so 0 per cent penetration. They are selling smartphones, and we sell iPhone there. But arguably you can't get the full value from it," he said adding that retailers in markets like India are not huge national kind of retailers. "And the carriers don't sell phones in India. So there's a lot of work to do," he said.
While sales for Apple in China, its second-largest market after the United States, fell 11 per cent in the latest quarter, in India iPhone sales were up 56 per cent from a year ago. Noting the growth registered by Apple in India, Cook said this is pretty big.
He said Apple is now…really putting energy in India as well as in other markets across the world where I think that people sitting here in this country look at it through just a lens of what's happening in the United States. And but there are a lot of people in the world who don't have the pleasure of owning an iPhone yet.
Apple had last week announced financial results for its fiscal 2016 second quarter ended March 26, 2016.
The company posted quarterly revenue of $50.6 billion, down from $58 billion in the year-ago quarter. Its quarterly net income stood at $10.5 billion, a decline from $13.6 billion in the same period last year.
In a conference call following the results, Cook had said network infrastructure and retail remain among Apple's main challenges in India, with the market there today being where China was seven to ten years ago.
Cook had said while India is the third-largest smartphone market in the world, it is dominated by low-end smartphones primarily because of the network and the economics due to which the market potential has not been as great there.
Competitive Brands
While Xiaomi and LeEco have also submitted proposals to open single-brand retail outlets in the country, their proposals have not been taken up so far.
The government allows 100 per cent FDI in the segment but companies are required to seek approval if overseas holding exceeds 49 per cent.
Apple in India
India has emerged as one of the fastest growing markets for Apple, with the company notching up over $1-billion (around Rs 7,000-crore at current exchange rate) sales revenue in 2015. Its sales grew 76 per cent during the quarter ended December 2015 even as its global sales growth slowed to 0.4 per cent. In recent months, the Steve Jobs-founded company has identified India along with China as its top markets.
At present, Apple sells through its distributors in India. It indicated in the presentation that it would open several stores but would rely on other retailers as well.
Previous articleMobikwik raises $50 million in Series C funding
Next articleEagle Boys to open 300 stores in 4 years
Apple sets September quarter record in India: Tim Cook
Apple online store to transform how Indians buy products online
Apple says happy Diwali with 1st India online store on Sep 23


A fantastic gift of good quality cane, this basket will be used for years to come. This picnic basket is made for two. . . . . . the premium celebration gift for your favourite couple.
A fantastic gift of good quality cane, this basket will be used for years to come.
This picnic basket is made for two...... the premium celebration gift for your favourite couple.


text:
Heads Up! Copperas Cove School Finds Dead Bat With Rabies on Campus
Tamme Taylor Published: March 27, 2022
It's springtime, and I know I've seen more wildlife out and about lately while driving around. Have there been any wild animals in your neighborhood acting strangely? Well, be on the lookout, especially in Copperas Cove, Texas.
A dead bat was found at a Central Texas school and tested positive for rabies. Now area officials are asking everyone to report any wild animal sightings, especially if close contact was made with people or pets.
KWTX is reporting that the bat was found at Taylor Creek Elementary School on 2096 Big Divide Road in Copperas Cove last week. Taylor Creek Elementary is in the Lampasas Independent School District. The animal was sent to Austin for rabies testing at the Texas Department of Health Laboratory, and Copperas Cove Animal Control was notified that the bat was rabies-positive.
Signs of Rabies Infection
Animals that are more likely to be infected with rabies include bats, coyotes, raccoons, skunks, and foxes.
In pets, rabies infection symptoms may include weakness, paralysis, seizures, difficulty breathing or swallowing, abnormal behavior, aggression, and self-mutilation.
According to the Centers for Disease Control and Prevention (CDC), signs of rabies infection in a human may be similar to the flu, with weakness, discomfort, fever, or headache. There also may be prickling or itching at the site of the bite. These symptoms may last for days, then progress to confusion and agitation.
Who to Contact if You Find a Rabid Animal
Anyone in the area who has or may have come into contact with a bat or other wild animal in the Central Texas area should immediately contact Copperas Cove Animal Control at (254) 547-5584.
They are open 9 a.m. - 5 p.m. Monday through Friday, and 9 a.m. to noon on Saturdays.
Check Out These Tornado Pictures From Killeen, Round Rock and Temple, Texas
Texas had a few tornadoes on Monday, March 21. Thankfully there haven't been reports of deaths or major injuries in our area, but there was plenty of damage.
We asked listeners from Central Texas to send us your storm photos, and this is what we've got so far! If you've like to send us more to share with the rest of the community, head to our Facebook page or tap the Chat feature in our free app.
Filed Under: Copperas Cove, Local News, News


Lucy is having slight difficulties meeting the deadlines for her summer games tasks. Give her a hand! Added as part of the 26 Jul 2012 Game Update.
↑ 1,0 1,1 1,2 Se Train Sets siden for mere information omkring opbygningen af togsæt.
Lucy gives the following train sets as rewards for completing his contracts.
The number before the name of the set is the contract number that awards the final piece of the set.
Splash screen from collection of Lucy's final contract.
Certificate from Lucy granting you the use of her station and explaining the final bonus associated with completion of her contracts.


I agree with Taniwha... Why do the New Zealand mobile operators offer their new plans with contract (12 and 24 month contracts) only?
To lock you in? How bad of them. They not only lock you in, but lock you out.
I am really, really trying to port my Vodafone New Zealand number over to Telecom New Zealand. I have been a Vodafone New Zealand customer for almost ten years now, and I don't have a contract, so I am free to move to another operator.
But there's no way to move to another operator on their new plans without signing up for at least a 12 month contract. And I am on account, which means a good amount of money every month for those operators.
It means Telecom New Zealand is not getting my business, as much as I want to leave the Vodafone New Zealand ranks.
It is the same if you are on Telecom New Zealand and want to move to Vodafone New Zealand, as Taniwha found out.


Infusion Devices A Bleeding Vein Of Clinical Negligence?
The development and impact of technology has never been more apparent than in today's health care environment. This is particularly evident in the nursing and midwifery professions. Sophisticated procedures, techniques and risk management requirements have led to the continued development of all types of devices.
There has been an emphasis shift whereby many device functions have moved from being one of supporting clinical practice to that of being an integral requirement in treatment delivery. The ability to reduce hospital mortality is associated with the amount of technology available (Bastos et al 1996). Clinicians are at a stage that without the use of the many available devices procedures could not be carried out safely. "Remarkable progress in improved outcomes from some conditions, particularly when severely ill patients, are treated in well equipped and well managed intensive care units (ICU) which have clear directorship and comprehensive management guidelines and protocols" (Zimmermann et al, 1993).
This however, is a double edged sword because as devices become more complex the associated risks also increase and as such also need to be managed. It is clear that improved training is an integral part of any good risk management strategy (Cooper 1994; Orser & Oxorn 1994). How many nurses or doctors can claim that they have had comprehensive competency based training on the devices they use, the author suspects not many. It is also increasingly evident that unless NHS Trusts start to address risk management issues significant financial penalties may be incurred through an ever increasing trend towards medical negligence claims ( Bourn 1997).
This article focuses on the steps taken by one Trust to minimise the risks associated with the use of intravenous infusion devices through the development and introduction of a quality training strategy.
Infusion devices facilitate the administration of both simple and complex pharmacological regimes. The evolving complexity of these devices and a need for training is highlighted in the Health Equipment Information document HEI 98, the "Management of Medical Equipment And Devices", from the Medical Devices Agency (MDA), an arm of the Department Of Health. Evidence suggests from the adverse incident reports that the MDA receive that many incidents occur as a result of inadequate training of the user, or service personnel. In the financial year ending March 1996 over 4,000 adverse incidents were reported to the Medical Devices Agency with over 400 relating to infusion devices ( MDA DB 9701, 1997). This report indicates that a significant portion of these adverse incidents are related to syringe pumps and that nationally there has been a steady increase in the numbers of incidents reported over the preceding five years. The worrying aspect of these figures is that the MDA estimate that only around 10 - 20% of incidents get reported. This figure is based on anecdotal evidence obtained by MDA personnel asking people during field visits and manufacturers perceptions when they do a recall on equipment and start asking people if they've been having problems. If this is correct then it represents a gross under reporting. It is the authors belief that under reporting is possibly related to the "fear factor" experienced by staff who may be wary of disciplinary action, a pathway traditionally used by many Trusts. Another consideration is that many device related errors are attributable to "human error" and are dealt with at local level and as such do not need to be reported to the MDA.
One of the main areas where human error is common is during the drug calculation process. A study by Rolfe and Harper (1995) found that out of 42 clinicians who felt that they were adequately prepared to calculate drug doses, only 19 answered all the questions correctly during a calculation test. This study concludes that "drills and experience in clinical practice have an important effect on clinicians to calculate drug doses accurately". Baldwin (1995), reviewing the above article, also writes that many undergraduates despite having passed 'A' level math's could not perform simple calculations. Adams and Duffield (1991) also concluded that drills and experience in clinical practice have an important effect on nurses ability to calculate doses accurately and that after a relatively short break from this practice nurses skills deteriorated rapidly. The frequent recurrence of similar incidents is also a worrying trend for the MDA, " A particularly disturbing feature has been the recurrence of accidents with similar causes, in spite of earlier warnings describing such accidents in considerable detail and containing suggestions on how they may be avoided" (Health Equipment Information Bulletin No.98 ,HEI 98, 1991).
There is no doubt in the authors mind that one of the main reasons for accident recurrence is related to the general lack of ownership at management level to ensure that the many safety action bulletins and hazard warnings issued by the MDA are followed through appropriately. The information related to the financial cost of clinical negligence related to infusion device error is not readily available although a report from the National Audit Office (Bourn J: Comptroller and Auditor General, 1997) estimates that overall; "the cost of clinical negligence to health authorities and NHS Trusts was approximately £200 million, in cash terms, in 1995 - 96, and the cost of claims was likely to rise by 25% p.a. over the next 5 years. The NHS summarised accounts for this period contain provision totaling £80 million and identify contingent liabilities of some £1.6 billion". High risk procedures, such as in the use of infusion devices, will probably provide an increasing focus for negligence claims when things go wrong. These escalating figures cannot go unchecked and should prompt urgent action to develop management strategies that minimise clinical risks to patients, clinicians and Trusts. The likelihood of litigation against health service organisations and individuals increasing is very real, "an increase in medical negligence litigation,.... as patients come to expect more of their health care and are at the same time becoming more aware of their legal rights patients will want a full explanation and very often the possibility of compensation, but often a desire for the allocation of blame will provide the motivation to approach a solicitor" (Spring & Price 1995).
Contributing factors that lead to the reporting of adverse incidents are inadequate training or knowledge, lack of awareness, inferior quality equipment, inadequate servicing arrangements, use of unsuitable equipment and inadequate documentation and record keeping ( MDA DB 9504, 1995). Health Equipment Information bulletin No. 98 (MDA 91) highlights where the responsibility for addressing the issues rests; "The importance of ensuring safety in the use of equipment is stipulated in the Health And Safety At Work Act (1974) and the Consumer Protection Act (1987) which places a clear obligation upon all employers and employing authorities to safeguard the health, safety and welfare of patients and employee's who may be working or, visiting the premises". As well as statute there is a myriad of recommendation made by the Medical Devices Agency on the management of medical devices. These are available free of charge to NHS organisations. Examples of Infusion Device information can be found in the documents, The management of infusion systems (MDA DB 9504) , Infusion Systems (MDA DB 9503) and The Management of Medical Equipment and Devices (HEI 98), these contain all the information required to develop appropriate risk management strategies in the use of medical devices. It is the authors view that the information above may not be receiving as much attention as it should . This view is supported by the continued increase in the reporting of adverse incidents and increasing litigation costs.
Because of the limiting time scale a Medical Devices Project Group was established, led by the author, to facilitate the process. This group comprised nursing membership from the seven directorates within the Trust.
As part of the process the following activities were facilitated; the supply of device information packs to all wards; risk assessment of at least three wards and departments in each directorate; the adaptation of nursing practice to meet national recommendations; the training of project group members to cascade and continue the awareness sessions within their directorates at the end of the project period; and, most importantly the piloting of a national training scheme for infusion and monitoring devices, called "Finger On The Button" (FOTB).
Very early on in the project it became evident that Training would become the biggest issue in addressing the problems above. The awareness sessions identified that staff knowledge was limited regarding device management, and that they had received little or no training in using infusion or monitoring devices. Other areas for concern that were highlighted were that many staff could not perform simple drug calculations. It was clear that national trends relating to the above were reflected within the authors organisation.
It was also clear that any training undertaken needed to be comprehensive and should include the deficits highlighted. The design of the national pilot training scheme "Finger On The Button ", appeared to meet these needs.
This training program was developed, launched autumn 1996, following three years preparatory work by pharmacists, clinical staff, scientists and trainers working in the health service, experienced training consultants and equipment manufacturers from the private sector. The program design comprises, open learning, study days, skills training and competence assessment.
Preparation : this covers basic theory and operation, self assessment (diagnostic) and preparatory knowledge e.g. drug calculations and interactions.
Study day : this includes an assessment to test self directed learning, universal housekeeping and safety issues and Device function issues.
Equipment Training : this again includes demonstrations, supervised assembly, practice and assessment of learning.
An on the ward assessment (OTWA) : Staff competencies are assessed in individuals' areas of work.
In evaluating the pilot at the Royal Victoria Infirmary, Newcastle, all participating staff found the learning process to be positive, in particular the design of the packs, which provide instant feedback and remedial suggestions. It was described as "user friendly" and "non threatening", apart from the evaluatory test on the study day, and was said to be "a very useful resource". Following the Pilot evaluation the Trust has decided to implement the FOTB training for all staff as part of a risk management drive.
There is no doubt that the FOTB training helped focus staff on a number of issues. Staff were unaware of the various classifications of IV devices, e.g. Neonatal, High and Low Risk Devices, and the significance of such. Devices are still appearing in circulation that are obsolete, and have had to be removed. The use of such devices would certainly increase the risk to patients if used inappropriately e.g. low risk classification devices used for high risk drug applications. Training has raised the awareness of staff in this respect. During the company training element of the FOTB training it became evident that staff did not fully understand the functions of one particular volumetric pump and the effect that it had on a pressure occlusion alarm. One nurse did not understand the anti free flow function on another, they thought that it was just a simple line clamp and in practice did not fit it to the pump. There is no doubt that these sessions highlighted that staff knowledge prior to training was incomplete.
The fact that a focus has been given to staff through training has led them to question other aspects of their practice in relation to national and local guidelines. Listed are some of the initiatives that the project group are addressing in relation to the recommendations being made. Medical Devices Agency DB 9504 (The Scottish Office Home and Health Department) "The Management of Infusion Systems" Appendix 7 of this report summarises the recommendations of details to be recorded at the start of an infusion, and at each check. The project group looking at how best to address this, agreed that where possible current practice should be adapted rather than introducing new practices. To this end the current additive label was redesigned with the introduction of a carbon copy top piece which can be placed in the patient records as an auditable record of both device and drug.
Clinical negligence is costing the NHS over £2m per year and will increase by 25% per year over the next 5 years ( Bourn 1997). The risks associated with the use of high tech devices, in the presence of poor training, are great. The medical devices agency received over 4,000 adverse incident reports in the year 1995-96, this figure has increased every year for the past 5 years ( MDA DB 9701, 1997).
Lack of training is identified as a significant cause of infusion device related adverse incidents. Training in many areas is either little or non existent and tends to be experiential and not competency based. The need to develop appropriate training strategies is needed if the 'bleeding vein' of clinical negligence payments is to be arrested.
This author believes that training should be facilitated, structured, coordinated and competency based otherwise it runs the risk of fragmentation and becoming ineffective. The appointment of a Medical Devices Officer is a cost effective way of addressing the issues highlighted in this paper as well as implementing local and national issues and should be explored in other similarly sized Trusts.
Adams A. Duffield C. (1991), The value of drills in developing and maintaining numeracy skills in an undergraduate nursing program. Nurse Education Today 1991 :11:213-9.
Adverse Incidents Reports 1996, MDA DB 9701, Medical Devices Agency Publication, DOH, London.
Bastos PG; Knaus WA et al. (1996), The importance of technology for achieving superior outcomes from intensive care, Intensive Care Medicine, 22(7): 664-9.
Bourn J, (1997), Report by the comptroller general : NHS (England) summarised accounts 1995-96, National Audit Office Publication, HC 127.
Cooper JB (1994), Towards patient safety in anaesthesia,, Annals of the Academy of Medicine, Singapore. 23(4):552-7.
Delve. M, Equipment Resource Nurse, Oxford Radcliffe Hospital NHS Trust, Information pack for the John Radcliffe Equipment Library (unpublished).
Doing No Harm, (1995), Medical Devices Agency Publication. DOH, London.
Orser BA, Oxorn DC, (1994), An Anesthetic Drug Error: Minimising the Risks, Canadian Journal of Anaesthesia. 41(2):120-4.
Rolfe S, Harper NJN (1995), Ability of hospital doctors to calculate drug doses, British Medical Journal, Volume 310.
Spring T. Price F, (1995), The legal implications of using intravenous drug infusion, British Journal of Intensive Care, February Supplement.
The Management of Infusion Systems MDA DB 9504, (1995), Medical Devices Agency, DOH, London.
The Management of Medical Equipment and Devices, HEI 98 (1991, currently due for reprint summer 1997), Medical Devices Agency, DOH, London.
Zimmermann et al, (1993) Critical Care Medicine; 21:1443 -1451 quoted in Morgan CJ et al (1996), Definition and Detection of alarms in critical care. Comput Methods Programms Biomed, 51(1-2):5-11.


You may wonder why we occasionally post and comment about music, music videos, and the latest musical acts. No Doubt and Lana del Rey have been two musical acts on our radar lately.
Little do most people know, we used to program boarding music for our former airline. What? That's right, program boarding music. You may think, oh there's nothing to that. Well, let us tell you, there was plenty of thought and consideration that went in to it.
Einstein used a formula E = mc2. So did we! We used the bell-shaped curve to guide us in our musical selection (more on this later). And we also had the good fortune of collaborating with a lovely woman named Danette Christine who is founder and president of SoundTrack Marketing. As a musician and singer, she has a way with music. As a entrepreneur, she understands the ins and outs of the music business. We connected on so many levels.
You can't deny the transformative nature of music. Music has a way of influencing people, places, and situations. Think about the last time you were at a bar, restaurant, club, or store. Did you take the time to listen to the music in the background/foreground? Chances are it wasn't haphazardly put together. Lots of consideration is given to creating the "right" atmosphere. The right ambiance.
When programming music for boarding we were considerate of the atmosphere we were creating. In years past many airlines had no boarding music at all or used classical music. The thought behind using classical music was that it had a calming effect. Where this may be true, it's not very contemporary in today's environment to play classical boarding music. Our assignment was to make a difference in the boarding experience. We were given creative license to create the best boarding experience for the customer through music. So, we chose contemporary tunes (Gwen Stefani, Luther Vandross, Beyonce, Celine, Jason Mraz, etc), oldies-but-goodies (Spinners, Jackson 5, etc), as well as an "ambient mix" of groovy sounds.
During our assignment we constantly, and still do, listen for new music. The app Shazam has become our friend. Each month we would add songs to our list for possible boarding music choices. On our monthly conference calls with Danette we would discuss the selections for a possible playlist. We would present our list and suggestions and Danette would present hers. Each song would then be reviewed for sound, lyrics, and placement in the lineup. Each playlist lasted between 30 and 45 minutes. Here's where the bell-shaped curve came in. The "science" was to begin the boarding music with a mid-tempo. The mid-tempo would welcome on the first class and elite customers. Once general boarding began the tempo would increase a bit. The rationale was that as the majority of customers boarded the boarding the music would get them moving expeditiously to their seats. As boarding came to an end the songs in the boarding playlist would return to a mid-tempo.
Besides creating an experience for the customer, we also had to be cognizant of the cabin crew; they would be listening to the music playlist for a complete month. So, we made sure to choose tunes that didn't grate or irritate them. The term that we used to describe this condition was "music fatigue"; hearing the same tune over and over again to the point of exhaustion. Definitely not the experience we wanted to create for our fellow cabin crew.
Our collaboration with SoundTrack Marketing proved very popular and lasted for 1 and 1/2 years. We received (and still do receive) positive comments from flight crews and from customers on a consistent basis. They really enjoyed the "freshness" of the music, the selections we chose, and the diversity of those selections. On occasion we're asked by cabin crew to come back and program the music again. We'd gladly do it all over again!
This entry was posted in Uncategorized and tagged airlines, airplanes, avgeek, aviation, customer service, flight attendants, music. Bookmark the permalink.
Thanks Jeanene! We appreciate your comments and always like to hear what you have to say.


text:
Climate Justice: The Financing Of Environmental Projects Affects Latin America
Ironically, the countries that pollute the most are the ones that suffer the least from the effects of global warming, in addition to being the ones that would be assuming the least responsibility in the face of this situation, according to a study by the University of Sussex .
Photo: Freepik
LatinAmerican Post | Christopher Ramírez
Leer en español: Justicia Climática: la financiación de proyectos ambientales afecta a América Latina
Climate change, more than a simple thesis managed by "desperate environmentalists" is a reality that the United Nations (UN) itself has assumed for more than 30 years, with most of the world powers as the most responsible for this crisis. environmental.
"Many people think that climate change mainly means warmer temperatures. But the rise in temperature is only the beginning of the story. Since the Earth is a system, in which everything is connected, changes in one area can influence changes in all the others , "explains the UN, ensuring that the increase in heat is only one of the many self-destructive consequences that the human being has exerted on the planet in the last two centuries.
According to information from this international organization, "the consequences of climate change now include, among others, intense droughts, water shortages, severe fires, rising sea levels, floods, melting of the poles, catastrophic storms and a decrease in biodiversity. ".
However, this situation, more than complaints, requires real political, economic and social action with which to be able to withstand the changes that the Intergovernmental Panel on Climate Change (IPCC) detailed in the Sixth Assessment Report developed in 2021 , in which, although, in summary, global warming is confirmed, it also gives hope that it is time to achieve a real change.
Climate injustice
Now, to counteract the catastrophic effects of global warming, it is not only necessary to adopt a change of mentality, but also a much more realistic position of who or who are the most responsible for this world crisis and the way in which they are contributing to the fight against polluting activities on the planet.
According to a new study by the Business School of the University of Sussex (United Kingdom) , of the more than 2,200 million dollars destined for more than a thousand environmental projects, at least 36% were destined for adaptation to climate change, while climate mitigation through energy systems, as well as transportation and mobility received 28% and 13%, respectively. For its part, geoengineering received 12% of this budget and industrial decarbonization 11%.
However, although the money is there and has been invested to counteract the negative effects of global warming, as well as the actions that have led to it, the truth is that these investments have not been made fairly throughout the planet. The Suxxes University report, developed by the Science Policy Research Unit (SPRU), confirmed that "climate research funding over the last three decades has been distributed asymmetrically with the UK ( 40%), the European Union (27%) and the United States (11%) receiving nearly four-fifths of all funds disbursed for a sample of 1,000 projects analyzed by the researchers."
Thus, the study also adds that developing countries (Latin America and Africa) barely appear on the list of territories that receive part of the investment for the fight against climate change.
"The vastly disproportionate funding given to the UK, the US and the European Union adversely affects low-income countries disproportionately in achieving just transitions (…) it is clear that this is a significant failure to support a truly global response. to the world's biggest challenge," said Benjamin Sovacool, Professor of Energy Policy at SPRU, University of Sussex Business School.
It may interest you: What Are Carbon Bonds and Why Are They So Criticized?
Latin America, a discriminated area?
The worst thing about this situation is that the so-called Climate Justice is not only not visible in economic terms, but also in social terms. The NGO Ayuda en Acción explains that "climate change (...) is a political and ethical issue", which unfortunately is not addressed as such by the world powers.
According to the World Bank, although only one-sixth of the world's population lives in high-income countries, they emit 44 times more carbon dioxide (CO2) than the low-income countries in which most of the world's population live. Humans.
For its part, the International Resource Panel (IRP) indicates that the countries with the highest Gross Domestic Product (GDP) are also the ones that consume the most resources: at least ten times more than the poorest countries in the world.
And this is what the Germanwatch Global Climate Risk Index (CRI) reflects , which through a map developed in 2020 shows, precisely, that they are the countries that have been invested the most money for climate change, the who least need it. The list of countries most affected in the last 20 years by climatic events of great destruction, derived from global warming, is led by Puerto Rico, Myanmar and Haiti; that is, two of the Top 3 nations are in the Latin American zone.
"The most impoverished people and countries are the ones that are suffering the most from this crisis (that of climate change), despite being precisely the ones that bear the least responsibility", concludes Ayuda en Acción.


Millie's Digest: An early spring clean, a special 58kg rescue dog and Lickimats!
Hey all – hope you've been having your own Sunday Funday and found time to enjoy that gorgeous sunshine!
The feedback on this week's fursday blog has been amazing! So many people saying they didn't realise how many places to eat in Carnoustie are dog-friendly too. You can find the blog and list of places to eat in Carnoustie over HERE on the blog. Do let me know if we've missed someone out or if you have a favourite too.
we are now booking 2 weeks in advance and our next available appointment is now on Saturday 17th February. Do just hit reply or give us a call on 01241 857893. If we have any changes, I'll make sure we post those dates over on Facebook HERE.
#4 Have you let us know what you love about your furiend?
#5 Have you let us know what you love about your furiend?
We all know a dog can change your life and so I always love reading other people's stories. Find out how a 58 kg rescue dog changes Jo's over HERE in this fab Sunday Times article. n.b you'll need to enter your email to read the full story.
On a similar theme, there was a great article in the metro (HERE) on how adopting a dog can help strengthen a relationship. Now we don't suggest that relationship issues can be solved by adding a dog to the mix (for those suddenly worrying) but this is a lovely article with lots of great insight into the challenges that a rescue dog can be but also how rewarding it can be too.
We are big DogFit fans having taken a couch 2 5k canicross course with them before our move back home to Scotland. Every month, they are giving away a prize to a dog rescue charity which you can nominate. Just head over to their Facebook page HERE and you'll see a post pinned to the top where you can nominate a local charity.
I've been talking A LOT about interactive toys and treats over the last few months. Chewers, lickers, indoor game ideas and games, we all recognise how important it is to work with your dog to tire them out mentally as well as physically.
So in my hunt for new products in this space, we've come across Lickimat and have one at home to try out as a sample.
It's been a success so far, so keep an eye out for our stock coming soon. They are available in three different formats and suitable for cats and dogs too (from £3.89).
With January being a popular month for booking holidays, it s not surprise that we've been asked more and more for boarding and kennel recommendations.
Personally, we've always home boarded due to Millie's personality and our own preference and so have found myself recommending Boarding Buddy's who are based in Carnoustie. Fully checked, insured and more importantly, a fab family, who you will love.
Do check out their Facebook page HERE and get in touch if you are planning holidays. Spaces in all boarders and kennels can book out up to a year in advance, so don't leave it to the bottom of the holiday planning list!


We feel it's imperative that you take time for a pre-trip camera-gear check out. I suggest that you set up the cameras just as you would when you arrive at your destination. This means batteries in strobes, sync cords – the works. You might find that your strobe head has been damaged on the way home from its last trip, and you definitely do not want to find yourself halfway around the world with a strobe that won't flash, or missing an "O" ring from the main port of your camera housing.
Don't flood your camera. Make sure that things like cable ties or lanyards can't get closed into your camera housing or your Nikonos, which would jeopardize their integrity. Even an eyelash can cause water to get inside your precious photographic gear. Before closing your housing, visually inspect it and gently run a clean toothbrush over the O-ring to ensure a watertight fit. When changing lenses or ports, always lightly grease your O-rings, and run that toothbrush in the O-ring grove to make sure no foreign objects are going to ruin your photography for the rest of your diving adventure.
If you have a rechargeable battery pack on your strobe, plug it in between dives. Doing so won't harm the battery pack, and will save you from needless frustration on your next dive.
Here are some pros and cons of flash photography: Although we all know how dazzlingly the colors of some fantastic marine subject can be enhanced by a properly used strobe, sometimes-ambient light is a better choice. Backscatter can ruin that perfect whale shark or humpback shot, and – let's face it – not all your subjects are going to stick around for repeated strobe flashes in their eyes. Sometimes a shark will permit multiple shots, whereas if a strobe were used, the shark would be spooked and gone after just one opportunity.
I like MDX-D3 underwater camera from Nikon , pictures are really great and it's very comfortable to use, but it's quite expensive.
* To assure proper strobe alignment, always point the lens of the camera at your face and you will be surprised at what dramatic adjustments need to be made.
* In the make-up section of a good department store they sell little plastic Q-tips, but the ends are foam rubber which, unlike the cotton variety, they leave no dangerous fibers behind. Get some of these for cleaning o-ring grooves.
* When charging your strobe batteries, put a few clothespins on the strobe head to remind yourself to replace your fully charged batteries prior to your next dive.
* Always take back-up gear, such as an extra strobe, sync cord, and maybe even an extra camera body. That way, if something goes wrong, you're still in business.
* Take a good tool box with little screw drivers, a wrench, pliers, O-ring grease, and extra O-rings of all sizes.
* Spend as much time underwater as possible, and shoot as many photos as possible, varying exposure and strobe position. I shoot four to six shots on a good subject. It's a numbers game.
* Always slightly underexpose your shots for richer colors.
* Listen to and follow the dive guides. They know the dive sites much better than you do and can point out the best subjects.
* Sea and Sea has a great little cordless TTL slave strobe (YS30) and it's fantastic. It allows the photographer to eliminate shadows without all the weight of a normal-sized strobe. This wonderful piece of equipment removes the need for T connectors and additional sync cords and all the maintenance and electrical problems that go with a second strobe. Buy one!
* Maintain your equipment meticulously after each dive. You can save many a flood or frozen sync cord if you spend just five to ten minutes during the film-change, cleaning and looking for droplets.


text:
The Commute: Homecoming, Bosch and Orphan X
I used to commute on my bike, but I live too far away from the city now, so unfortunately the train it is. I would love to write on the train, J.K. style, but she must have lived on a quiet route. As much as a standing up desk is recommended, I cannot bring myself to jot one word down in vertical position.
Normally I don't mind the train, but British trains, are dirty, slow, and how to say this? Weird. My husband, who commutes everyday, comes back every night with a new tale. Yesterday in the packed rush hour train a women grabbed on to his water bottle that was strapped to his bag. Not for a sec, no, she held on, for the whole trip.
Anyway, I have become dependent on entertainment to get me through.
This is what I listened, watched and read on the train this week:
ORPHAN X
Gregg Hurwitz
To distract me, books should be simple and engaging. The title gives it all away, in this case. Even if you never heard about it, I think you can guess the story. In the vein of Nikita, or an episode in Alias, or even the Americans, Evan Smoak, the orphan, was raised in a secret government program to become a killer. After struggling with his conscience Evan manages to get out. Now he freelances as The Nowhere Man, a saviour of people in need. When he gets a call, he knows an innocent is in danger. When his new client contacts him, on the run from the mob, they have kidnapped her father and want her to pay off gambling debts, his very orderly live starts to crumble. Bullets start to fly, the girl is sexy and doesn't seem to be trustworthy, and with mayhem about rain down on him, Evan's neighbour makes him babysit her kid (that was my favorite bit).
Aside from a small thing, (I hate it when the story gets interrupted by chapters from the bad guys point of vue) it's a fast paced and not very complicated ride. The reviews were ecstatic and I was late to the party, Bradley Cooper is going to play Evan and the sequel Nowhere man just came out this week, but if you haven't read it yet, don't expect anything earth-shattering, just uncomplicated fun, a bit of pretentiousness, and enough action to keep the pages turning.
Eli Horowitz, Micah Bloomberg and Mark Phillips
Now this is exciting. A podcast going back to old school radio. Bringing fiction, a play, such a simple concept, but for some reason not often done. Homecoming is about a government facility in Florida who welcomes soldiers, helps them with their reintroduction in to society. Al least that is what they claim to be. With flash back and forwards, it centers on caseworker Heidi Bergman, Catherine Keener, who after being let go by the facility, works as a waitress. Oscar Isaacs plays Walter Cruz the soldier she invested most of her time in, David Schwimmer plays her asshole boss Colin Belfast. It's mysterious, funny, nicely structured, very naturalistic, I loved it and it made the time fly by.
This is a great article about it.
BOSCH on Amazon Prime
Again late to the show. It's renewed for a third season, one of Amazon Prime most popular shows, but I was convinced it would be any good. I read all of Connelly's books, and was reluctant to see them change the iconic police detective. But you gotta love TV. In movies a drunken British lush will morph into Emily Blunt. Always trying to make characters commercial, appealing and bland. Amazon let Connelly produce, and even if Titus Welliver is not how I imagine Bosch at all, he is believable, like Jamie 'Marlo' Hector as his partner and Annie Wershing as his lover, and kind of a loser rookie cop. Reviewers have complained that the show was formulaic, but that's missing the point. Connoly is the master of formulaic, a good thriller always has to be at once comforting and scary. His style does that seamlessly. It's impossible to pay attention to Connelly's writing, it's invisible. It is just story. It seems so easy, and extremely hard to do. Dazzling with stylistic flourishes, incredible sentences, original word play, is easier. For anyone with talent, it is so much harder to just disappear and tell a story. So, is the show the same? Again it is hard to know. So you just have to compare it to something as Major Crimes, a show that covers much of the same ground. Bosch it is much more gripping, smooth, well acted, fast paced. Effective.
Labels: Books, TV
THE COMMUTE: My new novel, Hollywood Daze & craze
THE COMMUTE: The hate watch and how sad Keanu made...
Check this: Uma, Sofia, and Lizzie Lovett
The Commute: Amanda Knox, three pilots, and Histor...
Check this: Walter White on stage, an unlucky vill...


text:
Muslimah Montage
Platform for Muslim Women
Changing the Muslim Women Narrative
Forgotten Heroines
Asma T. Uddin
I am a daughter, a wife, a mother of two – and also a lawyer and a writer and an editor!
Give us your favorite quote and tell us why it means so much to you:
"You may not control all the events that happen to you, but you can decide not to be reduced by them." – Excerpted from Letter to My Daughter, a book of essays (2009)
This quote captures precisely my take on life's hardships. My goal is to always use tribulations as a way to make myself better – stronger, more spiritually refined – rather than let them break me down. And that's a very conscious approach to hardships, something that doesn't just happen without a plan.
Islamic Perspective:
What Ayah of the Quran do you hold close to your heart? Why
"They (your wives) are your garment [to protect your modesty] and you are a garment for them." Quran 2:187
To me it reflects peace, tranquillity, intimacy, and gender equity.
What Hadith do you wish more non-Muslims knew about? Why?
All of the hadiths that emphasize the prized role of a mother, and remind believers that "paradise is at her feet." I think those hadiths capture perfectly the selflessness and limitless love inherent in the act of mothering, and more people – not just non-Muslims – need to more fully appreciate the significance of mothers and parents generally.
The "Ten":
1. What is your favorite book?
I love most anything by Gabriel Garcia Marquez, specifically "Love In the Time of Cholera." I went to a workshop recently and was told that my writing reminded them of his writing. His writing must have an impact on way I think and write as a writer.
I've also recently discovered Ann Patchett. When I read her memoir, I felt like I could've written it (if my craft was so honed!). In between Patchett and Marquez, you will find me.
2. Who inspires/inspired you?
A wide range of people inspire me. Mostly, people who have accomplished tremendous spiritual feats such as Hifz (Quran memorization) or Tajweed. I've always found that somehow out-of-reach for myself, and so idealize it.
3. What is the best lesson your mother/mother figure taught you?
My mother taught a lot of things. In the age of Instagram and Pinterest, where we pour over presentation, admire well-plated meals and chic outfits put together craftily, I am reminded of my mother who taught me how to not just appreciate beauty but to also create it. Through my mother I learned how to think beyond mediocrity and envision something extraordinary.
4. What advice would you give your 13 year old self?
I would tell myself to let go of self-doubt. I was bold when I was young, but at 13 and ever since, grew incredibly self-conscious. I am sure that is an ailment not just of age, but also of my being female—always too hard on myself, internalizing societal messages of what is "right" or "possible" for female attainment. I think 13 is probably the age when I started allowing that external message to seep in. So my message to myself at 13 is to NOT let it in!
5. What are your hopes for your daughter and son?
I have a seven-year-old daughter and a two-year-old son. I want them both to be free of doubt and be confident of their abilities. But the most critical thing is to be respectful of others and to treat others well.
6. What is the biggest trial you went through in your life and how has that changed you?
My biggest trial has been my father's passing when he was 56. He passed away a couple of months after my wedding, when I was just learning how to live apart from my family and be truly independent. The break that happened with my past, with my safety net, was altogether too hard. He was a symbol of strength and a source of support for the family and community, both Muslim and non-Muslim, and the impact of his death reverberated widely.
7. Any regrets? What's something that you wish you'd thought about more before you did it?
I definitely have lots of regrets and most of them are rooted in my constant self-doubt. I sometimes don't do things for fear that I will fail. I am trying to get past that now, as reflected in my return to creative writing, which I abandoned some time ago.
8. How do you stay grounded in your work and/or spiritually grounded?
I stay grounded because everything I am doing are things I am passionate about- being a mom, working for a non-profit, and running altMuslimah.com, which readers tell us has had a significant impact on their spiritual life – all positive, as far as we know!
9. How do you bring about real change?
I think reformers need to understand their audience, be open to the audience's feedback and criticism. Reformers also need to approach their work without an agenda and in a quest for truth, and for what is right. I also think real change is often – though not always – incremental, and has to be done slowly, without pushing people too far outside their comfort zone.
10. What do you hope to be remembered for?
I hope to be remembered as someone who juggled many things but didn't allow the juggling act to make her mediocre. I want to be great at one thing, whatever that may be.
Video from Asma about Muslim Women
More about Asma:
www.altmuslimah.com
www.becketfund.org
www.altmuslimah.com/a/b/c_auddin
Twitter: @altmuslimah
September 9, 2014 by muslimahmontage	AltMuslimah, Asma T Uddin, attorney, editor, muslim women, Muslimah, non-profit
Welcome to Muslimah Montage
Salaams All, Thank you all for subscribing to the Muslimah Montage Newsletter, where you will learn about our featured Muslimah, latest media mention, Twitter conversations, and upcoming events iA. Stay tuned for more!
Sylvia Chan-Malik
Reem Faruqi
Ameena Khan
Eren Cervantes-Altamirano- Youth Muslimah
OUR VOICES, EPISODE 2: CONVERSATION ON #HIJABANDMIHRAB
Muslimah Montage Files
Muslimah Montage Files Select Month September 2015 August 2015 March 2015 January 2015 November 2014 October 2014 September 2014 August 2014 July 2014 May 2014 April 2014 March 2014 February 2014 January 2014 December 2013 November 2013 January 2013 August 2000 June 2000 January 2000 January 1900 January 200


HomeKnife SharpenersKleva Sharp Platinum The Worlds Best 2 in 1 Knife Sharpener!
Kleva Sharp Platinum The Worlds Best 2 in 1 Knife Sharpener!
We are so sure the Kleva Sharp Platinum™ is the best knife sharpener you will ever buy and use, that we are giving you a 30 day money back satisfaction guarantee.
Do you have a drawer full of old knives that just don't cut any more? Well struggle no longer with the Kleva Sharp Platinum. Sharpens any and all knives back to their original sharpness, the Kleva Sharp Platinum even sharpens bread knives.
The fantastic V shaped sharpening blades sharpen both sides of the knife in one pull through saving you time while the professionaly inspired pro-ceramic barrel hones the edge to perfect sharpness giving you the perfect edge every single time.
Forget using traditional sharpening steels and stones that, unless you are professional are dangerous and never seem to work. With the Kleva Sharp Platinum in just 3 easy steps you will have a blade sharper than a professional!
The Kleva Sharp platinum is designed with the exclusive twist and stick system designed to secure the Platinum to almost any smooth surface meaning your hand will never go near the blade making it totally safe!
Whether you're slicing meat, dicing vegetables, or carving the Sunday Roast, a sharp blade makes cutting effortless. Kleva Sharp Platinum restores a super sharp cutting edge to blunt knife blades that have dulled with use.
Delivery prompt, product is excellent. Delivers results as advertised.


2019 Jeep Cherokee SRT Release Date Review – Adjusting to America's developing enthusiasm for SUVs and hybrids has been a test for a few automakers. Jeep, in any case, hasn't generally had that issue. Without a car in its lineup, vehicles, for example, the Wrangler and the Grand Cherokee have established Jeep's picture as in excess of a brand that offers SUVs. It's the SUV mark. In any case, that long history of working wilderness rompers and developing interest for high-riding, all-wheel-drive vehicles hasn't ensured accomplishment for Jeep in more standard portions incorporating the one in which the recently revived 2019 Cherokee contends. So in spite of the fact that the 2019 Jeep Cherokee SRT rapidly destroyed Jeep Liberty deals, it's never been as mainstream as portion deals pioneers including the Honda CR-V, Nissan Rogue, and Toyota RAV4.
In 2017, for instance, the Toyota RAV4 and the Nissan Rogue each sold in excess of 400,000 units in the U.S. Jeep. Then again, sold just shy of 170,000 Cherokees. That is not something to be embarrassed about, but at the same time it's insufficient for Jeep. The automaker needs a greater offer of the reduced hybrid fragment, and that is the place the refreshed 2019 Cherokee comes in. As should be obvious, the most remarkable switch for 2019 is in advance, where the polarizing, best case scenario front lamp design is at long last gone. That look may have helped the 2019 Jeep Cherokee SRT emerge from the group, however even Jeep lets it out likely killed potential purchasers. Planning to maintain a strategic distance from that going ahead, the new Cherokee's headlights presently have a substantially more ordinary look. At the point when combined with a more upright hood and changed front clasp, the new fog light plan coordinates with whatever remains of the front end surprisingly well.
Planners likewise changed the backside, refreshing the taillights and fumes tips, and additionally moving the back tag from the guard to the liftgate. None of those progressions are especially uncommon, yet they complete a great job of keeping the 6-year-old plan new. With the fog light issue dealt with, the new 2019 Jeep Cherokee SRT is a genuinely gorgeous hybrid. Dissimilar to with the outside, the inside didn't have an especially eminent imperfections that required settling. As we found with our long haul Jeep Cherokee Trailhawk, the Jeep's lodge was exceptionally agreeable, with steady seats, admirable ride quality, a decent stereo, and comfort highlights, for example, versatile voyage control that made it an amazing street tripper. Rather than endeavoring to settle what wasn't broken, Jeep's inside originators centered the greater part of their endeavors around giving the lodge a more premium feel. Hard plastics are as yet utilized as a part of a couple of spots, yet the regions that got overhauled materials do enhance the general understanding. That is particularly valid in the event that you spring for the best level Overland trim.
A standout amongst the most essential updates Jeep gave the 2019 Jeep Cherokee SRT was to the infotainment framework. Accessible with a 7.0-or 8.4-inch touchscreen, the most up to date age of Uconnect looks more keen and feels like it reacts more rapidly than the past adaptation. It additionally comes standard with Apple CarPlay and Android Auto, which means most purchasers won't have to pay for a route framework.
In the engine, 2019 Jeep Cherokee SRT added another motor to the lineup, giving purchasers the choice of a 2.0-liter turbo-four notwithstanding the 3.2-liter V-6 and 2.4-liter normally suctioned inline-four. With 270 hp on tap on the turbo-four, the 271-hp V-6 has a slight edge in the power division, yet the turbo is a considerable amount torquier, making 295 lb-ft rather than 239. The base 2.4-liter, in the mean time, makes 180 hp and 170 lb-ft of torque.
Obviously, at the 2019 Jeep Cherokee SRT Price, the Overland better be truly swanky. The base, front-drive Jeep Cherokee Latitude begins at $25,190, yet the Jeep all-wheel-drive Overland will set you back $38,970. All of a sudden, the Jeep Trailhawk's $34,415 cost doesn't appear to be so grandiose.