text:
#include <stdio.h>
#include "NSPredicate.h"
#include "NSComparisonPredicate.h"
#include "NSCompoundPredicate.h"
#include "NSExpression.h"
#include "NSValue.h"
#include "NSException.h"
#include "NSDictionary.h"
#include "NSNull.h"
#include "NSCalendarDate.h"
#include "common.h"

//#define USE_DESCRIPTION_FOR_AT 1

static int qDebug = 0;
static NSMutableDictionary *NSPredicateParserTypeMappings = nil;

/*
   The literals understood by the value parser.

   NOTE: Any literal used here can never be used as a key ! So add as little
   as possible.
*/
typedef struct {
  const unsigned char *token;
  id  value;
  int scase;
} NSQPTokEntry;

static NSQPTokEntry toks[] = {
  { (const unsigned char *)"NULL",  nil, 0 },
  { (const unsigned char *)"nil",   nil, 1 },
  { (const unsigned char *)"YES",   nil, 0 },
  { (const unsigned char *)"NO",    nil, 0 },
  { (const unsigned char *)"TRUE",  nil, 0 },
  { (const unsigned char *)"FALSE", nil, 0 },
  { (const unsigned char *)NULL,    nil, 0 }
};

static inline void _setupLiterals(void) {
  static BOOL didSetup = NO;
  if (didSetup) return;
  didSetup = YES;
  toks[0].value = [[NSNull null] retain];
  toks[1].value = toks[0].value;
  toks[2].value = [[NSNumber numberWithBool:YES] retain];
  toks[3].value = [[NSNumber numberWithBool:NO]  retain];
  toks[4].value = toks[2].value;
  toks[5].value = toks[3].value;
}

/* cache */
static Class  StringClass = Nil;
static Class  NumberClass = Nil;
static NSNull *null       = nil;

/* parsing functions */

static NSPredicate *_parseCompoundPredicate(id _ctx, const char *_buf,
                                            unsigned _bufLen, unsigned *_predLen);
static NSPredicate *_testOperator(id _ctx, const char *_buf,
                                  unsigned _bufLen, unsigned *_opLen,
                                  BOOL *_testAnd);
static NSPredicate *_parsePredicates(id _ctx, const char *_buf,
                                     unsigned _bufLen, unsigned *_predLen);
static NSPredicate *_parseParenthesisPredicate(id _ctx,
                                               const char *_buf, unsigned _bufLen,
                                               unsigned *_predLen);
static NSPredicate *_parseNotPredicate(id _ctx, const char *_buf,
                                       unsigned _bufLen, unsigned *_predLen);
static NSPredicate *_parseKeyCompPredicate(id _ctx, const char *_buf,
                                           unsigned _bufLen, unsigned *_predLen);
static NSString *_parseKey(id _ctx, const char *_buf, unsigned _bufLen,
                           unsigned *_keyLen);
static id _parseValue(id _ctx, const char *_buf, unsigned _bufLen,
                      unsigned *_keyLen);
static inline unsigned _countWhiteSpaces(const char *_buf, unsigned _bufLen);
static NSString *_parseOp(const char *_buf, unsigned _bufLen,
                          unsigned *_opLen);

@interface NSPredicateParserContext : NSObject
{
  NSMapTable *predicateCache;
}

- (NSDictionary *)resultForFunction:(NSString *)_fct
  atPos:(unsigned long)_pos;
- (void)setResult:(NSDictionary *)_dict forFunction:(NSString *)_fct
  atPos:(unsigned long)_pos;
- (id)getObjectFromStackFor:(char)_c;

@end

@interface NSPredicateVAParserContext : NSPredicateParserContext
{
  va_list    *va;
}
+ (id)contextWithVaList:(va_list *)_va;
- (id)initWithVaList:(va_list *)_va;
@end

@interface NSPredicateEnumeratorParserContext : NSPredicateParserContext
{
  NSEnumerator *enumerator;
}
+ (id)contextWithEnumerator:(NSEnumerator *)_enumerator;
- (id)initWithEnumerator:(NSEnumerator  *)_enumerator;
@end

@implementation NSPredicateVAParserContext

+ (id)contextWithVaList:(va_list *)_va {
  return [[[NSPredicateVAParserContext alloc] initWithVaList:_va] autorelease];
}

- (id)initWithVaList:(va_list *)_va {
  if ((self = [super init])) {
    self->va = _va;
  }
  return self;
}

- (id)getObjectFromStackFor:(char)_c {
  id obj = nil;

  if (StringClass == Nil) StringClass = [NSString class];
  if (NumberClass == Nil) NumberClass = [NSNumber class];
  if (null == nil)        null        = [NSNull null];

  if (_c == 's') {
    char *str = va_arg(*self->va, char*);
    obj = [StringClass stringWithCString:str];
  }
  else if (_c == 'd') {
    int i= va_arg(*self->va, int);
    obj = [NumberClass numberWithInt:i];
  }
  else if (_c == 'f') {
    double d = va_arg(*self->va, double);
    obj = [NumberClass numberWithDouble:d];
  }
  else if (_c == '@') {
    id o = va_arg(*self->va, id);
#if USE_DESCRIPTION_FOR_AT
    obj = (o == nil) ? (id)null : (id)[o description];
#else
    obj = (o == nil) ? (id)null : (id)o;
#endif
  }
  else {
    [NSException raise:@"NSInvalidArgumentException"
                 format:@"unknown conversation char %c", _c];
  }
  return obj;
}

@end /* NSPredicateVAParserContext */

@implementation NSPredicateEnumeratorParserContext

+ (id)contextWithEnumerator:(NSEnumerator *)_enumerator {
  return [[[NSPredicateEnumeratorParserContext alloc]
                                      initWithEnumerator:_enumerator] autorelease];
}

- (id)initWithEnumerator:(NSEnumerator *)_enumerator {
  if ((self = [super init])) {
    ASSIGN(self->enumerator, _enumerator);
  }
  return self;
}

- (void)dealloc {
  [self->enumerator release];
  [super dealloc];;
}

- (id)getObjectFromStackFor:(char)_c {
  static Class NumberClass = Nil;
  id o;

  if (NumberClass == Nil) NumberClass = [NSNumber class];

  o = [self->enumerator nextObject];
  switch (_c) {
    case '@':
#if USE_DESCRIPTION_FOR_AT
      return [o description];
#else
      return o;
#endif

    case 'f':
      return [NumberClass numberWithDouble:[o doubleValue]];

    case 'd':
      return [NumberClass numberWithInt:[o intValue]];

    case 's':
      // return [NSString stringWithCString:[o cString]];
      return [[o copy] autorelease];

    default:
      [NSException raise:@"NSInvalidArgumentException"
                   format:@"unknown or not allowed conversation char %c", _c];
  }
  return nil;
}

@end /* NSPredicateEnumeratorParserContext */

@implementation NSPredicateParserContext

- (id)init {
  if (StringClass == Nil) StringClass = [NSString class];

  if ((self = [super init])) {
    self->predicateCache = NSCreateMapTable(NSObjectMapKeyCallBacks,
                                            NSObjectMapValueCallBacks,
                                            200);
  }
  return self;
}

- (void)dealloc {
  if (self->predicateCache) NSFreeMapTable(self->predicateCache);
  [super dealloc];
}

- (NSDictionary *)resultForFunction:(NSString *)_fct atPos:(unsigned long)_p
{
  NSDictionary *r;
  NSString *k;

  k = [[StringClass alloc] initWithFormat:@"%@_%ld", _fct, _p];
  r = NSMapGet(self->predicateCache, k);
  [k release];
  return r;
}

- (void)setResult:(NSDictionary *)_dict forFunction:(NSString *)_fct
  atPos:(unsigned long)_pos
{
  NSString *k;

  k = [[StringClass alloc] initWithFormat:@"%@_%ld", _fct, _pos];
  NSMapInsert(self->predicateCache, k, _dict);
  [k release];
}

- (id)getObjectFromStackFor:(char)_c {
  [self doesNotRecognizeSelector:_cmd];
  return nil;
}

@end /* NSPredicateParserContext */

@implementation NSPredicate(Parsing)

+ (void)registerValueClass:(Class)_valueClass forTypeName:(NSString *)_type {
  if (NSPredicateParserTypeMappings == nil)
    NSPredicateParserTypeMappings = [[NSMutableDictionary alloc] init];

  if (_type == nil) {
    NSLog(@"ERROR(%s): got passed no type name!", __PRETTY_FUNCTION__);
    return;
  }
  if (_valueClass == nil) {
    NSLog(@"ERROR(%s): got passed no value-class for type '%@'!",
          __PRETTY_FUNCTION__, _type);
    return;
  }

  [NSPredicateParserTypeMappings setObject:_valueClass forKey:_type];
}

+ (NSPredicate *)predicateWithFormat:(NSString *)_format,... {
  va_list     va;
  NSPredicate *qualifier;
  unsigned    length = 0;
  const char  *buf;
  unsigned    bufLen;
  char        *cbuf;

  _setupLiterals();
  if (StringClass == Nil) StringClass = [NSString class];

  bufLen = [_format cStringLength];
  cbuf   = malloc(bufLen + 1);
  [_format getCString:cbuf]; cbuf[bufLen] = '\0';
  buf = cbuf;

  va_start(va, _format);
  qualifier =
    _parsePredicates([NSPredicateVAParserContext contextWithVaList:&va],
                     buf, bufLen, &length);
  va_end(va);

  if (qualifier != nil) { /* check whether the rest of the string is OK */
    if (length < bufLen)
      length += _countWhiteSpaces(buf + length, bufLen - length);

    if (length < bufLen) {
      NSLog(@"WARNING(%s): unexpected chars at the end of the "
            @"string(class=%@,len=%i) '%@'",
            __PRETTY_FUNCTION__,
            [_format class],
            [_format length], _format);
      NSLog(@"  buf-length: %i", bufLen);
      NSLog(@"  length:     %i", length);
      NSLog(@"  char[length]: '%c' (%i) '%s'", buf[length], buf[length],
	    (buf+length));
      qualifier = nil;
    }
    else if (length > bufLen) {
      NSLog(@"WARNING(%s): length should never be longer than bufLen ?, "
	    @"internal parsing error !",
	    __PRETTY_FUNCTION__);
    }
  }
  free(cbuf);
  return qualifier;
}

+ (NSPredicate *)predicateWithFormat:(NSString *)_format
  argumentArray:(NSArray *)_arguments
{
  NSPredicate *qual  = nil;
  unsigned    length = 0;
  const char  *buf   = NULL;
  unsigned    bufLen = 0;
  NSPredicateEnumeratorParserContext *ctx;

  _setupLiterals();
  if (StringClass == Nil) StringClass = [NSString class];

  ctx = [NSPredicateEnumeratorParserContext contextWithEnumerator:
					      [_arguments objectEnumerator]];

  //NSLog(@"qclass: %@", [_format class]);
  buf    = [_format cString];
  bufLen = [_format cStringLength];
  qual   = _parsePredicates(ctx, buf, bufLen, &length);

  if (qual != nil) { /* check whether the rest of the string is OK */
    if (length < bufLen) {
      length += _countWhiteSpaces(buf + length, bufLen - length);
    }
    if (length != bufLen) {
      NSLog(@"WARNING(%s): unexpected chars at the end of the string '%@'",
            __PRETTY_FUNCTION__, _format);
      qual = nil;
    }
  }
  return qual;
}

@end /* NSPredicate(Parsing) */

static NSPredicate *_parseSinglePredicate(id _ctx, const char *_buf,
                                            unsigned _bufLen,
                                            unsigned *_predLen)
{
  NSPredicate *res = nil;

  if ((res = _parseParenthesisPredicate(_ctx, _buf, _bufLen, _predLen))  != nil) {
    if (qDebug)
      NSLog(@"_parseSinglePredicate return <%@> for <%s> ", res, _buf);

    return res;
  }
  if ((res = _parseNotPredicate(_ctx, _buf, _bufLen, _predLen)) != nil) {
    if (qDebug)
      NSLog(@"_parseSinglePredicate return <%@> for <%s> ", res, _buf);

    return res;
  }
  if ((res = _parseKeyCompPredicate(_ctx, _buf, _bufLen, _predLen)) != nil) {
    if (qDebug) {
      NSLog(@"_parseSinglePredicate return <%@> for <%s> length %d",
	    res, _buf, *_predLen);
    }
    return res;
  }
  return nil;
}

static NSPredicate *_parsePredicates(id _ctx, const char *_buf, unsigned _bufLen,
                                     unsigned *_predLen)
{
  NSPredicate *res = nil;

  if ((res = _parseCompoundPredicate(_ctx, _buf, _bufLen, _predLen))) {
    if (qDebug)
      NSLog(@"_parsePredicates return <%@> for <%s> ", res, _buf);
    return res;
  }

  if ((res = _parseSinglePredicate(_ctx, _buf, _bufLen, _predLen))) {
    if (qDebug)
      NSLog(@"_parsePredicates return <%@> for <%s> ", res, _buf);
    return res;
  }

  if (qDebug)
    NSLog(@"_parsePredicates return nil for <%s> ", _buf);

  return nil;
}

static NSPredicate *_parseParenthesisPredicate(id _ctx, const char *_buf,
                                               unsigned _bufLen,
                                               unsigned *_predLen)
{
  unsigned    pos     = 0;
  unsigned    qualLen = 0;
  NSPredicate *qual   = nil;

  pos = _countWhiteSpaces(_buf, _bufLen);

  if (_bufLen <= pos + 2) /* at least open and close parenthesis */ {
    if (qDebug)
      NSLog(@"1_parseParenthesisPredicate return nil for <%s> ", _buf);

    return nil;
  }
  if (_buf[pos] != '(') {
    if (qDebug)
      NSLog(@"2_parseParenthesisPredicate return nil for <%s> ", _buf);

    return nil;
  }
  pos++;
  if (!(qual = _parsePredicates(_ctx, _buf + pos, _bufLen - pos,
                                &qualLen))) {
    if (qDebug)
      NSLog(@"3_parseParenthesisPredicate return nil for <%s> ", _buf);

    return nil;
  }

  pos += qualLen;
  if (_bufLen <= pos) {
    if (qDebug)
      NSLog(@"4_parseParenthesisPredicate return nil for <%s> qual[%@] %@ bufLen %d "
            @"pos %d", _buf, [qual class], qual, _bufLen, pos);

    return nil;
  }
  pos += _countWhiteSpaces(_buf + pos, _bufLen - pos);
  if (_buf[pos] != ')') {
    if (qDebug)
      NSLog(@"5_parseParenthesisPredicate return nil for <%s> [%s] ", _buf, _buf+pos);

    return nil;
  }
  if (qDebug)
    NSLog(@"6_parseParenthesisPredicate return <%@> for <%s> ", qual, _buf);

  *_predLen = pos + 1; /* one step after the parenthesis */
  return qual;
}

static NSPredicate *_parseNotPredicate(id _ctx, const char *_buf,
                                       unsigned _bufLen, unsigned *_predLen)
{
  unsigned    pos, len   = 0;
  char        c0, c1, c2 = 0;
  NSPredicate *qual      = nil;

  pos = _countWhiteSpaces(_buf, _bufLen);

  if (_bufLen - pos < 4) { /* at least 3 chars for 'NOT' */
    if (qDebug)
      NSLog(@"_parseNotPredicate return nil for <%s> ", _buf);

    return nil;
  }
  c0 = _buf[pos];
  c1 = _buf[pos + 1];
  c2 = _buf[pos + 2];
  if (!(((c0 == 'n') || (c0 == 'N')) &&
        ((c1 == 'o') || (c1 == 'O')) &&
        ((c2 == 't') || (c2 == 'T')))) {
    if (qDebug)
      NSLog(@"_parseNotPredicate return nil for <%s> ", _buf);
    return nil;
  }
  pos += 3;
  qual = _parseSinglePredicate(_ctx, _buf + pos, _bufLen - pos, &len);
  if (qual == nil) {
    if (qDebug)
      NSLog(@"_parseNotPredicate return nil for <%s> ", _buf);

    return nil;
  }
  *_predLen = pos +len;
  if (qDebug)
    NSLog(@"_parseNotPredicate return %@ for <%s> ", qual, _buf);

  return [NSCompoundPredicate notPredicateWithSubpredicates:
				[NSArray arrayWithObjects:&qual count:1]];
}

static SEL operatorSelectorForString(NSString *_str)
{
  // TODO: fix for NSPredicate
  static NSMapTable *operatorToSelector = NULL; // THREAD
  SEL s;

  if (operatorToSelector == NULL) {
    operatorToSelector = NSCreateMapTable(NSObjectMapKeyCallBacks,
                                          NSIntMapValueCallBacks,
                                          10);
    NSMapInsert(operatorToSelector, @"=",
		(void *)NSEqualToPredicateOperatorType);
    NSMapInsert(operatorToSelector, @"==",
		(void *)NSEqualToPredicateOperatorType);
    NSMapInsert(operatorToSelector, @"!=",
		(void *)NSNotEqualToPredicateOperatorType);
    NSMapInsert(operatorToSelector, @"<>",
		(void *)NSNotEqualToPredicateOperatorType);
    NSMapInsert(operatorToSelector, @"<",
		(void *)NSLessThanPredicateOperatorType);
    NSMapInsert(operatorToSelector, @">",
		(void *)NSGreaterThanPredicateOperatorType);

    NSMapInsert(operatorToSelector, @"<=",
		(void *)NSLessThanOrEqualToPredicateOperatorType);
    NSMapInsert(operatorToSelector, @">=",
                (void *)NSGreaterThanOrEqualToPredicateOperatorType);

    NSMapInsert(operatorToSelector, @"like",
		(void *)NSLikePredicateOperatorType);
    NSMapInsert(operatorToSelector, @"LIKE",
		(void *)NSLikePredicateOperatorType);

#if 0 // TODO
    // TODO: need to have options here
    NSMapInsert(operatorToSelector, @"caseInsensitiveLike",
                NSLikePredicateOperatorType);
#endif
  }

  if ((s = NSMapGet(operatorToSelector, _str)))
    return s;

  return NSSelectorFromString(_str);
}

static NSPredicate *_parseKeyCompPredicate(id _ctx, const char *_buf,
                                           unsigned _bufLen,
					   unsigned *_predLen)
{
  NSExpression *lhs, *rhs;
  NSString     *key       = nil;
  NSString     *op        = nil;
  NSString     *value     = nil;
  NSPredicate  *qual      = nil;
  NSDictionary *dict      = nil;
  SEL          sel        = NULL;
  unsigned     length     = 0;
  unsigned     pos        = 0;
  BOOL         valueIsKey = NO;

  dict = [_ctx resultForFunction:@"parseKeyCompPredicate"
	       atPos:(unsigned long)_buf];
  if (dict != nil) {
    if (qDebug)
      NSLog(@"_parseKeyCompQual return <%@> [cached] for <%s> ", dict, _buf);

    *_predLen = [[dict objectForKey:@"length"] unsignedIntValue];
    return [dict objectForKey:@"object"];
  }
  pos = _countWhiteSpaces(_buf, _bufLen);

  if ((key = _parseKey(_ctx , _buf + pos, _bufLen - pos, &length)) == nil) {
    if (qDebug)
      NSLog(@"_parseKeyCompPredicate return nil for <%s> ", _buf);

    return nil;
  }
  pos += length;
  pos += _countWhiteSpaces(_buf + pos, _bufLen - pos);

  if (!(op = _parseOp(_buf + pos, _bufLen - pos, &length))) {
    if (qDebug)
      NSLog(@"_parseKeyCompPredicate return nil for <%s> ", _buf);
    return nil;
  }

  sel = operatorSelectorForString(op);
  if (sel == NULL) {
    NSLog(@"WARNING(%s): possible unknown operator <%@>", __PRETTY_FUNCTION__,
          op);
    if (qDebug)
      NSLog(@"_parseKeyCompPredicate return nil for <%s> ", _buf);
    return nil;
  }
  pos       +=length;
  pos       += _countWhiteSpaces(_buf + pos, _bufLen - pos);
  valueIsKey = NO;

  value = _parseValue(_ctx, _buf + pos, _bufLen - pos, &length);
  if (value == nil) {
    value = _parseKey(_ctx, _buf + pos, _bufLen - pos, &length);
    if (value == nil) {
      if (qDebug)
	NSLog(@"_parseKeyCompPredicate return nil for <%s> ", _buf);
      return nil;
    }
    else
      valueIsKey = YES;
  }
  pos      +=length;
  *_predLen = pos;

  lhs = [NSExpression expressionForKeyPath:key];
  rhs = valueIsKey
    ? [NSExpression expressionForKeyPath:value]
    : [NSExpression expressionForConstantValue:value];

  qual = [NSComparisonPredicate predicateWithLeftExpression:lhs
				rightExpression:rhs
				customSelector:sel];
  if (qDebug)
    NSLog(@"_parseKeyCompPredicate return <%@> for <%s> ", qual, _buf);

  if (qual != nil) {
    id keys[2], values[2];
    keys[0] = @"length"; values[0] = [NSNumber numberWithUnsignedInt:pos];
    keys[1] = @"object"; values[1] = qual;
    [_ctx setResult:
            [NSDictionary dictionaryWithObjects:values forKeys:keys count:2]
          forFunction:@"parseKeyCompPredicate"
          atPos:(unsigned long)_buf];
    *_predLen = pos;
  }
  return qual;
}

static NSString *_parseOp(const char *_buf, unsigned _bufLen,
                          unsigned *_opLen)
{
  unsigned pos = 0;
  char     c0  = 0;
  char     c1  = 0;

  if (_bufLen == 0) {
    if (qDebug)
      NSLog(@"_parseOp _bufLen == 0 --> return nil");
    return nil;
  }
  pos = _countWhiteSpaces(_buf, _bufLen);
  if (_bufLen - pos > 1) {/* at least an operation and a value */
    c0 = _buf[pos];
    c1 = _buf[pos+1];

    if (((c0 >= '<') && (c0 <= '>')) || (c0 == '!')) {
      NSString *result;

      if ((c1 >= '<') && (c1 <= '>')) {
        *_opLen = 2;
        result = [StringClass stringWithCString:_buf + pos length:2];
	if (qDebug)
	  NSLog(@"_parseOp return <%@> for <%s> ", result, _buf);
      }
      else {
        *_opLen = 1;
        result = [StringClass stringWithCString:&c0 length:1];
	if (qDebug)
	  NSLog(@"_parseOp return <%@> for <%s> ", result, _buf);
      }
      return result;
    }
    else { /* string designator operator */
      unsigned opStart = pos;
      while (pos < _bufLen) {
        if (_buf[pos] == ' ')
          break;
        pos++;
      }
      if (pos >= _bufLen) {
        NSLog(@"WARNING(%s): found end of string during operator parsing",
              __PRETTY_FUNCTION__);
      }

      if (qDebug) {
	NSLog(@"%s: _parseOp return <%@> for <%s> ", __PRETTY_FUNCTION__,
	      [StringClass stringWithCString:_buf + opStart
			   length:pos - opStart], _buf);
      }

      *_opLen = pos;
      return [StringClass stringWithCString:_buf + opStart length:pos - opStart];
    }
  }
  if (qDebug)
    NSLog(@"_parseOp return nil for <%s> ", _buf);
  return nil;
}

static NSString *_parseKey(id _ctx, const char *_buf, unsigned _bufLen,
                           unsigned *_keyLen)
{
  id           result   = nil;
  NSDictionary *dict    = nil;
  unsigned     pos      = 0;
  unsigned     startKey = 0;
  char         c        = 0;

  if (_bufLen == 0) {
    if (qDebug)
      NSLog(@"%s: _bufLen == 0 --> return nil", __PRETTY_FUNCTION__);
    return nil;
  }
  dict = [_ctx resultForFunction:@"parseKey" atPos:(unsigned long)_buf];
  if (dict != nil) {
    if (qDebug) {
      NSLog(@"%s: return <%@> [cached] for <%s> ", __PRETTY_FUNCTION__,
	    dict, _buf);
    }
    *_keyLen = [[dict objectForKey:@"length"] unsignedIntValue];
    return [dict objectForKey:@"object"];
  }
  pos      = _countWhiteSpaces(_buf, _bufLen);
  startKey = pos;
  c        = _buf[pos];

  if (c == '%') {
    if (_bufLen - pos < 2) {
      if (qDebug) {
	NSLog(@"%s: [c==%%,bufLen-pos<2]: _parseValue return nil for <%s> ",
	      __PRETTY_FUNCTION__, _buf);
      }
      return nil;
    }
    pos++;
    result = [_ctx getObjectFromStackFor:_buf[pos]];
    pos++;
  }
  else {
    /* '{' for namspaces */
    register BOOL isQuotedKey = NO;

    if (c == '"')
      isQuotedKey = YES;
    else if (!(((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')) ||
             c == '{')) {
      if (qDebug) {
	NSLog(@"%s: [c!=AZaz{]: _parseKey return nil for <%s> ",
	      __PRETTY_FUNCTION__, _buf);
      }
      return nil;
    }

    pos++;
    while (pos < _bufLen) {
      c = _buf[pos];
      if (isQuotedKey && c == '"')
	break;
      else if
	((c == ' ') || (c == '<') || (c == '>') || (c == '=') || (c == '!') ||
         c == ')' || c == '(')
        break;
      pos++;
    }
    if (isQuotedKey) {
      pos++; // skip quote
      result = [StringClass stringWithCString:(_buf + startKey + 1)
			    length:(pos - startKey - 2)];
    }
    else {
      result = [StringClass stringWithCString:(_buf + startKey)
			    length:(pos - startKey)];
    }
  }
  *_keyLen = pos;
  if (qDebug)
    NSLog(@"%s: return <%@> for <%s> ", __PRETTY_FUNCTION__, result, _buf);

  if (result != nil) {
    id keys[2], values[2];

    keys[0] = @"length"; values[0] = [NSNumber numberWithUnsignedInt:pos];
    keys[1] = @"object"; values[1] = result;

    [_ctx setResult:
            [NSDictionary dictionaryWithObjects:values forKeys:keys count:2]
          forFunction:@"parseKey"
          atPos:(unsigned long)_buf];
    *_keyLen = pos;
  }
  return result;
}

static id _parseValue(id _ctx, const char *_buf, unsigned _bufLen,
                      unsigned *_keyLen)
{
  NSString     *cast = nil;
  NSDictionary *dict = nil;
  id           obj   = nil;
  unsigned     pos   = 0;
  char         c     = 0;

  if (NumberClass == Nil) NumberClass = [NSNumber class];
  if (null == nil) null = [[NSNull null] retain];

  if (_bufLen == 0) {
    if (qDebug) NSLog(@"_parseValue _bufLen == 0 --> return nil");
    return nil;
  }

  dict = [_ctx resultForFunction:@"parseValue" atPos:(unsigned long)_buf];
  if (dict != nil) {
    if (qDebug) {
      NSLog(@"_parseKeyCompPredicate return <%@> [cached] for <%s> ",
	    dict, _buf);
    }
    *_keyLen = [[dict objectForKey:@"length"] unsignedIntValue];
    return [dict objectForKey:@"object"];
  }

  pos = _countWhiteSpaces(_buf, _bufLen);
  c   = _buf[pos];

  if (c == '$') { /* found NSPredicateVariable */
    unsigned startVar = 0;
    NSString *varKey;

    pos++;
    startVar = pos;
    while (pos < _bufLen) {
      if ((_buf[pos] == ' ') || (_buf[pos] == ')'))
        break;
      pos++;
    }

    varKey = [StringClass stringWithCString:(_buf + startVar)
                          length:pos - startVar];
    obj = [NSExpression expressionForVariable:varKey];
  }
  else {
    /* first, check for CAST */
    BOOL parseComplexCast = NO;

    if (c == 'c' && _bufLen > 14) {
      if (strstr(_buf, "cast") == _buf && (isspace(_buf[4]) || _buf[4]=='(')) {
	/* for example: cast("1970-01-01T00:00:00Z" as 'dateTime') [min 15 #]*/
	pos += 4; /* skip 'cast' */
        while (isspace(_buf[pos])) /* skip spaces */
          pos++;
        if (_buf[pos] != '(') {
          NSLog(@"WARNING(%s): got unexpected cast string: '%s'",
                __PRETTY_FUNCTION__, _buf);
        }
        else
          pos++; /* skip opening bracket '(' */

	parseComplexCast = YES;
	c = _buf[pos];
      }
    }
    else if (c == '(') { /* starting with a cast */
      /* for example: (NSCalendarDate)"1999-12-12" [min 5 chars] */
      unsigned startCast = 0;

      pos++;
      startCast = pos;
      while (pos < _bufLen) {
        if (_buf[pos] == ')')
          break;
        pos++;
      }
      pos++;
      if (pos >= _bufLen) {
        NSLog(@"WARNING(%s): found end of string while reading a cast",
              __PRETTY_FUNCTION__);
        return nil;
      }
      c    = _buf[pos];
      cast = [StringClass stringWithCString:(_buf + startCast)
                          length:(pos - 1 - startCast)];
      if (qDebug)
	NSLog(@"%s: got cast %@", __PRETTY_FUNCTION__, cast);
    }

    /* next, check for FORMAT SPECIFIER */
    if (c == '%') {
      if (_bufLen - pos < 2) {
	if (qDebug)
	  NSLog(@"_parseValue return nil for <%s> ", _buf);

        return nil;
      }
      pos++;
      obj = [_ctx getObjectFromStackFor:_buf[pos]];
      pos++;
    }

    /* next, check for A NUMBER */
    else if (((c >= '0') && (c <= '9')) || (c == '-')) { /* got a number */
      unsigned startNumber;

      startNumber = pos;
      pos++;
      while (pos < _bufLen) {
        c = _buf[pos];
        if (!((c >= '0') && (c <= '9')))
          break;
        pos++;
      }
      obj = [NumberClass numberWithInt:atoi(_buf + startNumber)];
    }

    /* check for some text literals */
    if ((obj == nil) && ((_bufLen - pos) > 1)) {
      unsigned char i;

      for (i = 0; i < 20 && (toks[i].token != NULL) && (obj == nil); i++) {
	const unsigned char *tok;
	unsigned char toklen;
	int rc;

	tok = toks[i].token;
	toklen = strlen((const char *)tok);
	if ((_bufLen - pos) < toklen)
	  /* remaining string not long enough */
	  continue;

	rc = toks[i].scase
	  ? strncmp(&(_buf[pos]),     (const char *)tok, toklen)
	  : strncasecmp(&(_buf[pos]), (const char *)tok, toklen);
	if (rc != 0)
	  /* does not match */
	  continue;
	if (!(_buf[pos + toklen] == '\0' || isspace(_buf[pos + toklen])))
	  /* not at the string end or folloed by a space */
	  continue;

	/* wow, found the token */
	pos += toklen; /* skip it */
	obj = toks[i].value;
      }
    }

    /* next, check for STRING */
    if (obj == nil) {
      if ((c == '\'') || (c == '"')) {
	NSString *res                  = nil;
	char     string[_bufLen - pos];
	unsigned cnt                   = 0;

	pos++;
	while (pos < _bufLen) {
	  char ch = _buf[pos];
	  if (ch == c)
	    break;
	  if ((ch == '\\') && (_bufLen > (pos + 1))) {
	    if (_buf[pos + 1] == c) {
	      pos += 1;
	      ch = c;
	    }
	  }
	  string[cnt++] = ch;
	  pos++;
	}
	if (pos >= _bufLen) {
	  NSLog(@"WARNING(%s): found end of string before end of quoted text",
		__PRETTY_FUNCTION__);
	  return nil;
	}
	res = [StringClass stringWithCString:string length:cnt];
	pos++; /* don`t forget quotations */
	if (qDebug) NSLog(@"_parseValue return <%@> for <%s> ", res, _buf);
	obj = res;
      }
    }

    /* complete parsing of cast */
    if (parseComplexCast && (pos + 6) < _bufLen) {
      /* now we need " as 'dateTime'" [min 7 #] */

      /* skip spaces */
      while (isspace(_buf[pos]) && pos < _bufLen) pos++;

      //printf("POS: '%s'\n", &(_buf[pos]));
      /* parse 'as' */
      if (_buf[pos] != 'a' && _buf[pos] != 'A')
	NSLog(@"%s: expecting 'AS' of complex cast ...", __PRETTY_FUNCTION__);
      else if (_buf[pos + 1] != 's' && _buf[pos + 1] != 'S')
	NSLog(@"%s: expecting 'AS' of complex cast ...", __PRETTY_FUNCTION__);
      else {
	/* skip AS */
	pos += 2;

	/* skip spaces */
	while (isspace(_buf[pos]) && pos < _bufLen) pos++;

	/* read cast type */
	if (_buf[pos] != '\'') {
	  NSLog(@"%s: expected type of complex cast ...", __PRETTY_FUNCTION__);
	}
	else {
	  const unsigned char *cs, *ce;

	  //printf("POS: '%s'\n", &(_buf[pos]));
	  pos++;
	  cs = (const unsigned char *)&(_buf[pos]);
	  ce = (const unsigned char *)index((const char *)cs, '\'');
	  cast = [NSString stringWithCString:(const char*)cs length:(ce - cs)];
	  if (qDebug) {
	    NSLog(@"%s: parsed complex cast: '%@' to '%@'",
		  __PRETTY_FUNCTION__, obj, cast);
	  }
	  pos += (ce - cs);
	  pos++; // skip '
	  pos++; // skip )
	  //printf("POS: '%s'\n", &(_buf[pos]));
	}
      }
    }
  }

  if (cast != nil && obj != nil) {
    Class class = Nil;
    id orig = obj;

    if ((class = [NSPredicateParserTypeMappings objectForKey:cast]) == nil) {
      /* no value explicitly mapped to class, try to construct class name... */
      NSString *className;

      className = cast;
      if ((class = NSClassFromString(className)) == Nil) {
        /* check some default cast types ... */
        className = [cast lowercaseString];

        if ([className isEqualToString:@"datetime"])
          class = [NSCalendarDate class];
        else if ([className isEqualToString:@"datetime.tz"])
          class = [NSCalendarDate class];
      }
    }
    if (class) {
      obj = [[[class alloc] initWithString:[orig description]] autorelease];

      if (obj == nil) {
	NSLog(@"%s: could not init object '%@' of cast class %@(%@) !",
	      __PRETTY_FUNCTION__, orig, class, cast);
	obj = null;
      }
    }
    else {
      NSLog(@"WARNING(%s): could not map cast '%@' to a class "
	    @"(returning null) !",
	    __PRETTY_FUNCTION__, cast);
      obj = null;
    }
  }

  if (qDebug) {
    NSLog(@"%s: return <%@> for <%s> ", __PRETTY_FUNCTION__,
	  obj != nil ? obj : (id)@"<nil>", _buf);
  }

  if (obj != nil) {
    id keys[2], values[2];

    keys[0] = @"length"; values[0] = [NSNumber numberWithUnsignedInt:pos];
    keys[1] = @"object"; values[1] = obj;

    [_ctx setResult:
            [NSDictionary dictionaryWithObjects:values forKeys:keys count:2]
          forFunction:@"parseValue" atPos:(unsigned long)_buf];
    *_keyLen = pos;
  }
  return obj;
}

static NSPredicate *_testOperator(id _ctx, const char *_buf,
                                  unsigned _bufLen, unsigned *_opLen,
                                  BOOL *isAnd)
{
  NSPredicate *qual       = nil;
  char        c0, c1, c2  = 0;
  unsigned    pos, len    = 0;

  pos = _countWhiteSpaces(_buf, _bufLen);

  if (_bufLen < 4) {/* at least OR or AND and somethink more */
    if (qDebug)
      NSLog(@"_testOperator return nil for <%s> ", _buf);
    return nil;
  }
  c0 = _buf[pos + 0];
  c1 = _buf[pos + 1];
  c2 = _buf[pos + 2];

  if (((c0 == 'a') || (c0  == 'A')) &&
        ((c1 == 'n') || (c1  == 'N')) &&
        ((c2 == 'd') || (c2  == 'D'))) {
      pos    += 3;
      *isAnd  = YES;
  }
  else if (((c0 == 'o') || (c0  == 'O')) && ((c1 == 'r') || (c1  == 'R'))) {
      pos    += 2;
      *isAnd  = NO;
  }
  pos += _countWhiteSpaces(_buf + pos, _bufLen - pos);
  qual = _parseSinglePredicate(_ctx, _buf + pos, _bufLen - pos, &len);
  *_opLen = pos + len;
  if (qDebug)
    NSLog(@"_testOperator return %@ for <%s> ", qual, _buf);

  return qual;
}

static NSPredicate *_parseCompoundPredicate(id _ctx, const char *_buf,
                                            unsigned _bufLen,
					    unsigned *_predLen)
{
  NSPredicate    *q0, *q1 = nil;
  NSMutableArray *array   = nil;
  unsigned       pos, len = 0;
  NSPredicate    *result;
  BOOL           isAnd;

  isAnd = YES;

  if ((q0 = _parseSinglePredicate(_ctx, _buf, _bufLen, &len)) == nil) {
    if (qDebug)
      NSLog(@"_parseAndOrPredicate return nil for <%s> ", _buf);

    return nil;
  }
  pos = len;

  if (!(q1 = _testOperator(_ctx, _buf + pos, _bufLen - pos, &len, &isAnd))) {
    if (qDebug)
      NSLog(@"_parseAndOrPredicate return nil for <%s> ", _buf);
    return nil;
  }
  pos  += len;
  array = [NSMutableArray arrayWithObjects:q0, q1, nil];

  while (YES) {
    BOOL newIsAnd;

    newIsAnd = YES;
    q0       = _testOperator(_ctx,  _buf + pos, _bufLen - pos, &len, &newIsAnd);

    if (!q0)
      break;

    if (newIsAnd != isAnd) {
      NSArray *a;

      a = [[array copy] autorelease];

      q1 = (isAnd)
	? [NSCompoundPredicate andPredicateWithSubpredicates:a]
	: [NSCompoundPredicate orPredicateWithSubpredicates:a];

      [array removeAllObjects];
      [array addObject:q1];
      isAnd = newIsAnd;
    }
    [array addObject:q0];

    pos += len;
  }

  *_predLen = pos;
  result = (isAnd)
    ? [NSCompoundPredicate andPredicateWithSubpredicates:array]
    : [NSCompoundPredicate orPredicateWithSubpredicates:array];

  if (qDebug)
    NSLog(@"_parseAndOrPredicate return <%@> for <%s> ", result, _buf);

  return result;
}

static inline unsigned _countWhiteSpaces(const char *_buf, unsigned _bufLen) {
  unsigned cnt = 0;

  if (_bufLen == 0) {
    if (qDebug)
      NSLog(@"_parseString _bufLen == 0 --> return nil");
    return 0;
  }

  while (_buf[cnt] == ' ' || _buf[cnt] == '\t' ||
	 _buf[cnt] == '\n' || _buf[cnt] == '\r') {
    cnt++;
    if (cnt == _bufLen)
      break;
  }
  return cnt;
}

redpajama_set_name: RedPajamaGithub


We Care & We Know, at MyAdvo, We Understand You!
You are important to us and we make sure to build MyAdvo as the legal services company that can help you in resolving all kinds of legal issues and queries. That is because we care and we know how to do so effectively. Read ahead to find out how MyAdvo looks at its clients!
Our laws were created to protect and empower us. However, many of us don't get the help they need because of costly legal fees and various other complexities.
Thus, most of us just run away at the thought of legal. When in fact, we should be doing just the opposite of it.
We at MyAdvo understand the needs of its clients and looks into their requirements thoroughly, so as to reach a fair conclusion.
So if you may wonder at any stage why go to MyAdvo?
We have talked about our services at length about how much we believe in keeping a transparent system.
MyAdvo offers 24x7 support to you via mail and call.
At MyAdvo, we make sure that our case managers are there to keep you in the loop of progress.
MyAdvo has a fixed pricing criterion throughout the case proceedings.
Since you know how we work, well, even we would want you to research thoroughly about every option and then come to us.
Well, that's because we believe in our services and exactly know how to resolve your legal problems effectively. We know that MyAdvo will pop-up first in your mind, no matter what!
We're in the business of providing clarity. Whether you use our simplified legal services or educate yourselves with all the legal topics at your disposal through our blogs. For any legal issue, you can rely on us!
We're just a call or an email away to give you all the support you need in the tough times. Legal situations can be challenging and we will be there with you standing upright.
We are working towards things by making legal-tech services affordable, simple and available to more people than ever before.
In a short period, we've been able to build a service that many people can count on and depend to resolve legal issues.
At MyAdvo, we spend our time making legal simple and easier for people. As we know it's not something that people generally look up unless facing troubles with the law.
We take care of all the legal requirements and prerequisites at MyAdvo, while you can focus on your families and other important things like work, business and more.
We combine free legal information with great accessibility to affordable & best representation by licensed lawyers and good attorneys near you.
With MyAdvo, you can stay assured to deal with every situation with a strong legal companion, guiding you all the way.
From providing the ground knowledge of Indian Law to making sure having timely lawyer consultations, we have got you covered on the MyAdvo App!
Our commitment to affordable and accessible legal services is at the heart of everything we do. Most lawyers and bar associations also agree, that much can and should be done to improve accessibility to the law. But doing this at a less cost and complexity is a challenge.
This is where MyAdvo steps in!
So, let us help you because at MyAdvo we know how to help you.
Think legal, think simple! Visit MyAdvo!


Syria conflict escalated when chemical weapon was used in Douma on April 7.
WHO information: 70 casualties, 500 injured.
U.S. State Department information: 85 casualties.
International community accuses Assad's Government.
Syria and Russia claim there was no chemical attack, the evidence was faked by the USA and they are ready to support OPCW.
UNSC held meeting on Syria conflict twice.
Russia vetoed the U.S. resolution, it was rejected.
Trump said Washington will react to chemical attack, but Russia and Iran pose danger.
He announced a missile attack today.
Russia regarded claim as an attempt to destroy evidence in Douma.
Law enforcers' information: chemical weapon was used in Syria more than 200 times.


text:
The dynamics of legged locomotion: models, analyses, and challenges. (2006)
by P Holmes, R Full, D Koditschek, J Guckenheimer
Venue: SIAM Review,
Add To MetaCart
Sorted by: Citation Count Year (Descending) Year (Ascending) Recency
Central pattern generators for locomotion control in animals and robots: a review
by Auke Jan Ijspeert - NEURAL NETWORKS , 2008
"... The problem of controlling locomotion is an area in which neuroscience and robotics can fruitfully interact. In this article, I will review research carried out on locomotor central pattern generators (CPGs), i.e. neural circuits capable of producing coordinated patterns of high-dimensional rhythmic ..."
The problem of controlling locomotion is an area in which neuroscience and robotics can fruitfully interact. In this article, I will review research carried out on locomotor central pattern generators (CPGs), i.e. neural circuits capable of producing coordinated patterns of high-dimensional rhythmic output signals while receiving only simple, lowdimensional, input signals. The review will first cover neurobiological observations concerning locomotor CPGs and their numerical modelling, with a special focus on vertebrates. It will then cover how CPG models implemented as neural networks or systems of coupled oscillators can be used in robotics for controlling the locomotion of articulated robots. The review also presents how robots can be used as scientific tools to obtain a better understanding of the functioning of biological CPGs. Finally, various methods for designing CPGs to control specific modes of locomotion will be briefly reviewed. In this process, I will discuss different types of CPG models, the pros and cons of using CPGs with robots, and the pros and cons of using robots as scientific tools. Open research topics both in biology and in robotics will also be discussed. 1
(Show Context)
Citation Context
...anization of animal locomotor systems (Bizzi, Tresch, Saltiel, & d'Avella, 2000; Dickinson et al., 2000; Loeb, 2001; Grillner, 2006), and the modelling of animal locomotion (Full & Koditscheck, 1999; =-=Holmes, Full, Koditschek, & Guckenheimer, 2006-=-). Also interesting collections of articles on biologically inspired robot locomotion can be found in (Beer, Ritzmann, & McKenna, 1993; Beer, Chiel, Quinn, & Ritzmann, 1998; Ayers, Davis, & Rudolph, 2...
A simply stabilized running model
by R. M. Ghigliazza, Richard Altendorfer, Philip Holmes, Daniel E. Koditschek - SIAM JOURNAL ON APPLIED DYNAMICAL SYSTEMS , 2003
"... The spring-loaded inverted pendulum (SLIP), or monopedal hopper, is an archetypal model for running in numerous animal species. Although locomotion is generally considered a complex task requiring sophisticated control strategies to account for coordination and stability, we show that stable gaits ..."
Abstract - Cited by 72 (17 self) - Add to MetaCart
The spring-loaded inverted pendulum (SLIP), or monopedal hopper, is an archetypal model for running in numerous animal species. Although locomotion is generally considered a complex task requiring sophisticated control strategies to account for coordination and stability, we show that stable gaits can be found in the SLIP with both linear and "air " springs, controlled by a simple fixed-leg reset policy. We first derive touchdown-to-touchdown Poincaré maps under the common assumption of negligible gravitational effects during the stance phase. We subsequently include and assess these effects and briefly consider coupling to pitching motions. We investigate the domains of attraction of symmetric periodic gaits and bifurcations from the branches of stable gaits in terms of nondimensional parameters.
...tensions. Our work has two main goals: to better understand animal locomotion and to stimulate and enable the creation of "bio-inspired" robots. The former is the subject of an extensive survey paper =-=[28]-=- (currently in press for this journal), to which we refer the interested reader. With regard to the second goal, a significant part of robotics research is driven by the desire to exploit the advantag...
DASH: A Dynamic 16g Hexapedal Robot
by P. Birkmeyer, K. Peterson, R. S. Fearing
"... Abstract—DASH is a small, lightweight, power autonomous robot capable of running at speeds up to 15 body lengths per second (see video). Drawing inspiration from biomechanics, DASH has a sprawled posture and uses an alternating tripod gait to achieve dynamic open-loop horizontal locomotion. The kine ..."
Abstract—DASH is a small, lightweight, power autonomous robot capable of running at speeds up to 15 body lengths per second (see video). Drawing inspiration from biomechanics, DASH has a sprawled posture and uses an alternating tripod gait to achieve dynamic open-loop horizontal locomotion. The kinematic design which uses only a single drive motor and allows for a high power density is presented. The design is implemented using a scaled Smart Composite Manufacturing (SCM) process. Evidence is given that DASH runs with a gait that can be characterized using the spring-loaded inverted pendulum (SLIP) model. In addition to being fast, DASH is also well suited to surviving falls from large heights, due to the uniquely compliant nature of its structure. I.
...round reaction forces during running seen in almost all legged systems with the relative 10 cm Fig. 1. DASH: a power autonomous hexapedal robot. stiffness being nearly uniform across all species [4], =-=[5]-=-. The SLIP model has also been shown to impart dynamic stability to horizontal running. Possessing SLIP-like behavior may benefit the mobility of any legged robotic system. Much work has been done in ...
Design of a Bio-inspired Dynamical Vertical Climbing Robot
by Jonathan E. Clark, Daniel I. Goldman, Pei-chun Lin, Goran Lynch, Tao S. Chen, Haldun Komsuoglu, Robert J. Full, Daniel Koditschek
"... Abstract — This paper reviews a template for dynamical climbing originating in biology, explores its stability properties in a numerical model, and presents empirical data from a physical prototype as evidence of the feasibility of adapting the dynamics of the template to robot that runs vertically ..."
Abstract — This paper reviews a template for dynamical climbing originating in biology, explores its stability properties in a numerical model, and presents empirical data from a physical prototype as evidence of the feasibility of adapting the dynamics of the template to robot that runs vertically upward. The recently proposed pendulous climbing model abstracts remarkable similarities in dynamic wall scaling behavior exhibited by radically different animal species. The present paper's first contribution summarizes a numerical study of this model to hypothesize that these animals ' apparently wasteful commitments to lateral oscillations may be justified by a significant gain in the dynamical stability and, hence, the robustness of their resulting climbing capability. The paper's second contribution documents the design and offers preliminary empirical data arising from a physical instantiation of this model. Notwithstanding the substantial differences between the proposed bio-inspired template and this physical manifestation, initial data suggest the mechanical climber may be capable of reproducing both the motions and ground reaction forces characteristic of dynamical climbing animals. Even without proper tuning, the robot's steady state trajectories manifest a substantial exchange of kinetic and potential energy, resulting in vertical speeds of 0.30 m/s (0.75 bl/s) and claiming its place as the first bio-inspired dynamical legged climbing platform. I.
...ically stable. A. Power stroke modeling and analysis The Full-Goldman template's counterparts for level ground running — the SLIP and LLS templates — have generated a more-than-decade long literature =-=[52]-=- and remain an active area of research in legged locomotion. Early analysis [53] of the first dynamical running machines [54] demonstrated that a poorly tuned actuation subsystem could be responsible ...
3D bipedal robotic walking: Models, feedback control, and open problems
by J. W. Grizzle, Christine Chevallereau, Aaron D. Ames, Ryan W. Sinnet - PROCEEDINGS OF THE IFAC SYMPOSIUM ON NONLINEAR CONTROL SYSTEMS , 2010
"... The fields of control and robotics are contributing to the development of bipedal robots that can realize walking motions with the stability and agility of a human being. Dynamic models for bipeds are hybrid in nature. They contain both continuous and discrete elements, with switching events that ..."
The fields of control and robotics are contributing to the development of bipedal robots that can realize walking motions with the stability and agility of a human being. Dynamic models for bipeds are hybrid in nature. They contain both continuous and discrete elements, with switching events that are spatially driven by unilateral constraints at ground contact and impulse-like forces that occur at foot touchdown. Control laws for these machines must be hybrid as well. The goals of this paper are threefold: highlight certain properties of the models which greatly influence the control law design; present two control design approaches; and indicate some of the many open problems.
The Spring Loaded Inverted Pendulum as the Hybrid Zero Dynamics of an Asymmetric Hopper
by Ioannis Poulakakis, J. W. Grizzle - SUBMITTED TO THE IEEE TRANSACTIONS ON AUTOMATIC CONTROL AS A REGULAR PAPER , 2007
"... A hybrid controller that induces provably stable running gaits on an Asymmetric Spring Loaded Inverted Pendulum (ASLIP) is developed. The controller acts on two levels. On the first level, continuous within-stride control asymptotically imposes a (virtual) holonomic constraint corresponding to a de ..."
Abstract - Cited by 25 (7 self) - Add to MetaCart
A hybrid controller that induces provably stable running gaits on an Asymmetric Spring Loaded Inverted Pendulum (ASLIP) is developed. The controller acts on two levels. On the first level, continuous within-stride control asymptotically imposes a (virtual) holonomic constraint corresponding to a desired torso posture, and creates an invariant surface on which the two-degree-of-freedom restriction dynamics of the closed-loop system (i.e., the hybrid zero dynamics) is diffeomorphic to the center-of-mass dynamics of a Spring Loaded Inverted Pendulum (SLIP). On the second level, event-based control stabilizes the closed-loop hybrid system along a periodic orbit of the SLIP dynamics. The controller's performance is discussed through comparison with a second control law that creates a one-degreeof-freedom non-compliant hybrid zero dynamics. Both controllers induce identical steady-state behaviors (i.e. periodic solutions). Under transient conditions, however, the controller inducing a compliant hybrid zero dynamics based on the SLIP accommodates significantly larger disturbances, with less actuator effort, and without violation of the unilateral ground force constraints.
Biologically-Inspired Locomotion of a 2g Hexapod Robot
by Andrew T. Baisch, Student Member, Pratheev S. Sreetharan, Robert J. Wood
"... Abstract — Here we present the design, modeling, and fabrication of a 2g mobile robot. By applying principles from biology and existing meso-scale fabrication techniques, a 5.7cm hexapod robot with sprawled posture has been created, and is capable of locomotion up to 4 body-lengths per second using ..."
Abstract — Here we present the design, modeling, and fabrication of a 2g mobile robot. By applying principles from biology and existing meso-scale fabrication techniques, a 5.7cm hexapod robot with sprawled posture has been created, and is capable of locomotion up to 4 body-lengths per second using the alternating tripod gait at 20Hz actuation frequency. Furthermore, this work proves the viability of a new mechanical linkage design, fabricated using the smart composite microstructure process, to provide desirable leg trajectories for successful ambulation at the insect-scale. I.
.... Parameter Selection Robot parameters were selected by integrating models of hexapod locomotion, SFB kinematics, and piezoelectric bimorph actuators. Numerous mathematical models exist in literature =-=[20]-=- that form a basis for selecting appropriate inputs and body morphology parameters for insect-scale hexapod locomotion. However, the simplest of these models [21], which deals exclusively with the hor...
Templates and anchors for antenna-based wall following in cockroaches and robots
by Jusuk Lee, Simon N. Sponberg, Owen Y. Loh, Andrew G. Lamperski, Robert J. Full, Noah J. Cowan - IEEE Trans. Robot , 2008
"... Abstract—The interplay between robotics and neuromechanics facilitates discoveries in both fields: nature provides roboticists with design ideas, while robotics research elucidates critical fea-tures that confer performance advantages to biological systems. Here, we explore a system particularly wel ..."
Abstract—The interplay between robotics and neuromechanics facilitates discoveries in both fields: nature provides roboticists with design ideas, while robotics research elucidates critical fea-tures that confer performance advantages to biological systems. Here, we explore a system particularly well suited to exploit the synergies between biology and robotics: high-speed antenna-based wall following of the American cockroach (Periplaneta americana). Our approach integrates mathematical and hardware modeling with behavioral and neurophysiological experiments. Specifically, we corroborate a prediction from a previously reported wall-following template—the simplest model that captures a behavior— that a cockroach antenna-based controller requires the rate of approach to a wall in addition to distance, e.g., in the form of a proportional-derivative (PD) controller. Neurophysiological ex-periments reveal that important features of the wall-following con-troller emerge at the earliest stages of sensory processing, namely in the antennal nerve. Furthermore, we embed the template in a robotic platform outfitted with a bio-inspired antenna. Using this system, we successfully test specific PD gains (up to a scale) fitted to the cockroach behavioral data in a "real-world " setting, lending further credence to the surprisingly simple notion that a cockroach might implement a PD controller for wall following. Finally, we embed the template in a simulated lateral-leg-spring (LLS) model using the center of pressure as the control input. Importantly, the same PD gains fitted to cockroach behavior also stabilize wall fol-lowing for the LLS model. Index Terms—Bio-inspiration, biological system modeling, biomimicry, insect antenna, legged locomotion, wall following.
...ur research program, which includes modeling, robotic development, and experimental biology, is depicted in Fig. 1. Central to this program is a modeling hierarchy known as templates and anchors [4], =-=[5]-=-. A template is the simplest model that captures a desired behavior, while an anchor is a more complex, representative model of the behavior. Templates and anchors are not just "simple models" and "co...
Modular Neuroevolution for Multilegged Locomotion
by Vinod K. Valsalam, Risto Miikkulainen
"... Legged robots are useful in tasks such as search and rescue because they can effectively navigate on rugged terrain. However, it is difficult to design controllers for them that would be stable and robust. Learning the control behavior is difficult because optimal behavior is not known, and the sear ..."
Legged robots are useful in tasks such as search and rescue because they can effectively navigate on rugged terrain. However, it is difficult to design controllers for them that would be stable and robust. Learning the control behavior is difficult because optimal behavior is not known, and the search space is too large for reinforcement learning and for straightforward evolution. As a solution, this paper proposes a modular approach for evolving neural network controllers for such robots. The search space is effectively reduced by exploiting symmetry in the robot morphology, and encoding it into network modules. Experiments involving physically realistic simulations of a quadruped robot produce the same symmetric gaits, such as pronk, pace, bound and trot, that are seen in quadruped animals. Moreover, the robot can transition dynamically to more effective gaits when faced with obstacles. The modular approach also scales well when the number of legs or their degrees of freedom are increased. Evolved non-modular controllers, in contrast, produce gaits resembling crippled animals that are much less effective and do not scale up as a result. Hand-designed controllers are also less effective, especially on an obstacle terrain. These results suggest that the modular approach is effective for designing robust locomotion controllers for multilegged robots.
...lly designed manually, to ensure that the legs are properly coordinated and the robot is stable. This process typically requires analyzing the sensor-motor systems and body-limb dynamics of the robot =-=[5, 14, 16, 24]-=-, which is generally difficult and brittle because it is hard to anticipate all possible terrains. Therefore, it is desirable to automate the controller design using learning techniques. One particula...
Dimensional reduction in sensorimotor systems: a framework for understanding muscle coordination of posture.
by Lena H Ting - in Computational Neuroscience: Theoretical Insights into Brain Function, Progress in Brain Research 165 , 2007
"... Abstract: The simple act of standing up is an important and essential motor behavior that most humans and animals achieve with ease. Yet, maintaining standing balance involves complex sensorimotor transformations that must continually integrate a large array of sensory inputs and coordinate multipl ..."
Abstract: The simple act of standing up is an important and essential motor behavior that most humans and animals achieve with ease. Yet, maintaining standing balance involves complex sensorimotor transformations that must continually integrate a large array of sensory inputs and coordinate multiple motor outputs to muscles throughout the body. Multiple, redundant local sensory signals are integrated to form an estimate of a few global, task-level variables important to postural control, such as body center of mass (CoM) position and body orientation with respect to Earth-vertical. Evidence suggests that a limited set of muscle synergies, reflecting preferential sets of muscle activation patterns, are used to move task-variables such as CoM position in a predictable direction following postural perturbations. We propose a hierarchal feedback control system that allows the nervous system the simplicity of performing goal-directed computations in task-variable space, while maintaining the robustness afforded by redundant sensory and motor systems. We predict that modulation of postural actions occurs in task-variable space, and in the associated transformations between the low-dimensional task-space and high-dimensional sensor and muscle spaces. Development of neuromechanical models that reflect these neural transformations between low-and highdimensional representations will reveal the organizational principles and constraints underlying sensorimotor transformations for balance control, and perhaps motor tasks in general. This framework and accompanying computational models could be used to formulate specific hypotheses about how specific sensory inputs and motor outputs are generated and altered following neural injury, sensory loss, or rehabilitation.

redpajama_set_name: RedPajamaCommonCrawl


text:
Manicurist accuses Steve Wynn of inappropriate behavior in 2015
Wynn confronts salon employees after first story
According to the complaint, the woman was an employee for The Claude Baruk Salon in 2015 when she began giving manicures and pedicures to Wynn.
By: Joyce Lupiani
A new complaint has been filed against casino owner Steve Wynn.
The complaint was filed by a woman identified only as "Jane Doe." According to the complaint, the woman was an employee for The Claude Baruk Salon in 2015 when she began giving manicures and pedicures to Wynn.
She says that Wynn would require her to position herself in certain ways during the services that would put her in direct contact with body parts other than his hands or feet. When she would attempt to withdraw, he would become irritated.
According to the complaint, Jane Doe went to Claude Baruk and other members of management. She says that Baruk ignored her complaints but she was told by other members of management that it would stop.
Jane Doe says she also shared what happened with her coworkers and heard similar stories. The woman says that she feared that she would lose her job if she kept complaining.
After the story broke in the Washington Post, the woman says that Wynn visited the salon twice to speak with salon employees.
The first time was on Jan. 27. Wynn reportedly requested the employees to be gathered and then asked them to raise their hands if they felt he had ever assaulted them.
The second time was on Feb. 1 during a birthday party for a salon employee. Jane Doe says Wynn brought a video crew with him that time and demanded that employees give video statements saying he did nothing wrong.
The complaint also says that Wynn is still receiving manicures and pedicures in the salon or in his on-site villa.
The lawsuit was filed on Tuesday with the Clark County District Court. Two lawsuits were filed last week by massage therapists who also accused Wynn of inappropriate conduct.
Wynn resigned as CEO of Wynn Resorts last month. He is denying all allegations but said that he did not believe he could be an effective company leader.
He also resigned as chairman for the Republican National Committee.


A research paper cannot be complete without a literature review. This is one of the most prolific sections of your paper that will draw a lot of attention from your teacher. At this point, there are a number of things that your teachers are looking at while they are marking your work. It is also at this point where so many students end up failing because they do not take their work seriously.
So many students who do not know what to do will often plagiarize the work of others and paste it on this chapter. Due to the amount of work that is contained here, so many of them assume that the teacher will not go through it and find this out. Sadly, teachers are trained properly and their experience in the learning environment over the years also makes it easier for them to crack down on such students.
There are so many students who innocently fail to make the best grades because they do not know what to do. The teaching fraternity however considers this to be ignorance. When you are working on this paper, you must not use citations that go beyond a particular timeframe. Some institutions might set guidelines on this, but others might not, and you only realize so when you get penalized. In most cases, make sure that your references do not date back more than 5-8 years.
The literature review section must have a very good conceptual framework. Based on the work that you are presenting, the conceptual framework must borrow ideas from the main objectives of your paper. This way you will be able to convince your teacher that you really did the work. Besides, the conceptual framework must be presented alongside a diagrammatic representation.
Everything that you do in this paper must be properly cited. You should make sure you do not make any claims that cannot be substantiated by all means possible. If you raise a claim, make sure you support it.
The literature that you choose to review needs to be relevant to the title that you are working on, or the entire section will be irrelevant.


Title: Light on the book trade. Essays in honour of Peter Isaac.
Description: .New Castle, Delaware: Oak Knoll Press; London: The British Library, 2004. 8vo,, 20.7cm. Pp. xvi,224, frontisp. portr., few illustr. in text, notes & refs., index. Hardbound, orig. pict. lamin. boards. Fine, as new.


text:
Q: Forward a port with modem (with built-in but disabled router) + a separate router I have a Motorola SBG6580 that is a modem and a wireless router in one. However, the wireless router part was bad so I disabled it and got a separate wireless router. I can go into the configuration pages of both the modem and the router now, and I'm confused as to which device needs to be configured for port-forwarding. I have a raspberry pi that I want to set up as a webserver.
Do I configure the router, the modem, or both?
Right now, the SBG6580's 1st LAN is connected to the wireless router's WAN, and the internet is working well. Note that the SBG6580 only has 4 ports, and I'm assuming they're LAN,as they are not labeled.

A: Your SBG6580 needs configuring for internet access.
Assuming that you've plugged one LAN port from your SBG6580 into one LAN port on your WiFi device, then you're good to go.
If you have a WiFi device that also has a WAN port, and you've plugged the LAN of your SBG6580 into the WAN of your WiFi, then that's a different story (and you shouldn't do this unless you have a good reason).

A: it depends... If the router is connected to the modem via the 'internet' or 'wan' port on the router, you would need to change the modem to 'bridge' mode, which hands off the public IP to your router.  Then in the router configuration you would set up port forwarding.
If the router is connected to the modem via one of the router's LAN ports (no NATting going on) then you would set up the modem to do port forwarding.
Personally I recommend that the modem be bridged, and let the router do all the work, including PPPoE authentication if you are on AT&T DSL.  This is a simpler config.
Search for instructions or call your ISP to determine how to put your modem in bridge mode.  NOTE: bridged modems are no longer accessible via web interface.  The modem just becomes an invisible 'forwarder' sending all packets to the router.

redpajama_set_name: RedPajamaStackExchange


text:
Nagaland Chief Minister Neiphiu Rio has said that the Centre is working hard to resolve the Naga political issue.
Press Trust of India | Kohima October 25, 2020 Last Updated at 20:37 IST
Neiphiu Rio Nagaland CM (centre) with Assam CM Sarbananda Sonowal and Manipur CM N. Biren Singh
The state government has also approached Prime Minister Narendra Modi and Union Home Minister Amit Shah for an early solution to the problem, he said.
"The central government is working hard to bring a solution to the Naga issue. The Naga people also want peace and unity to come through a permanent solution so that we can have development and open up avenues for youths," the chief minister said while addressing a rally in Kohima district on Saturday night ahead of the November 3 by-elections to two assembly segments.
Rio criticised Governor R N Ravi for describing the Naga political problem as a law and order issue and Naga nationalist workers as "extortionists" and "anti-social elements" in a recent letter.
In a damning indictment of Rio's government, Ravi had in a letter on June 16 said that armed gangs were brazenly running their own governments in the state challenging the legitimacy of its elected authority and creating a "crisis of confidence" in the system.
Ravi, a retired IPS officer who was a special director in the Intelligence Bureau and the Centre's interlocutor for the Naga peace talks, had warned that he would promulgate Article 371A(1)(b) of the Constitution, which gives the Nagaland governor special responsibility with respect to law and order if things did not improve.
Chief Minister Rio said the state government is having several discussions with Naga groups to "make sincere efforts for a solution to the Naga issue" and urged them not to indulge in wrongful activities.
Elucidating that the Naga movement was started by the Naga National Council (NNC), Rio said, "The NNC movement was not a failure, it may not have been 100 per cent to the expectation of the people but was a success because the Centre recognised Naga history, tradition and culture as unique."
It also accepted that the "Naga issue is not a law and order problem but a political", and therefore political talks are being held to resolve it, he said.
The talks are in the "final stage", except for the NSCN(IM) demand for a separate flag and Constitution, the chief minister said.
Rio said he met the Union home minister, home secretary, IB director, and constitutional and legal experts during his recent visit to Delhi, where it was informed that the Nagas cannot be given total freedom.
"The central government is trying to find out ways constitutionally to allow Nagas to use a separate flag," he said.
On having a 'Naga Yezahbo' (constitution), Rio said the Article 371(A) of the Constitution grants special provisions, but to frame a separate constitution for the Nagas, a committee would be set up.
He also said that the 16-Point Agreement, signed between the Naga People's Convention (NPC) and the government of India in 1960, had brought about statehood to Nagaland but it needs to be upgraded by increasing the number of its seats in Parliament and in the state assembly.
"All these issues have been discussed," Rio said.
The recent consultative meeting on the Naga issue organised by the state government in Kohima has resolved that "Nagas are one, the issue is one, and so we need one solution", he said.
The chief minister also informed that the state government would go ahead with the implementation of the delimitation exercise so that justice would be delivered to the electorates for equal representation in the state assembly.
"The exercise has been pending, but now we want to implement it. The present government is serious about finding a solution to the Naga issue, implementing delimitation exercises and improving the economic condition of the people," Rio said.
He appealed to the electorates to vote for the NDPP nominees to win the upcoming by-elections.


There is a very popular idea being pushed in America right now that success is really just being lucky. The idea claims that LeBron James was just lucky he has his genes… Not that he trained hard every day for a lifetime. The idea also claims a successful entrepreneur just got lucky to have perfect circumstances to lead to where they are.
I think this idea is clearly false. But I can debate that another day.
Previous Previous post: Happy Birthday Ben!


text:
Q: Android: CardView Coming On Action Bar I have used recycler View to display CardView. I have done this in the navigation drawer Main Activity. But my card View is being displayed on Action Bar.
app_bar_main
<RelativeLayout xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="kb.niranjan.tvseries.MainActivity">

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    app:popupTheme="@style/AppTheme.PopupOverlay" />

    <include layout="@layout/content_main" />

</RelativeLayout>

content_menu
<android.support.v7.widget.CardView android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/cv"
card_view:cardCornerRadius="4dp"
card_view:cardElevation="5dp"
android:layout_margin="08dp"
xmlns:android="http://schemas.android.com/apk/res/android"
card_view:cardBackgroundColor="#263238"
>

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="06dp"
    >

    <ImageView
        android:layout_width="41dp"
        android:layout_height="58dp"
        android:id="@+id/person_photo"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginRight="16dp"
        />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/person_name"
        android:layout_toRightOf="@+id/person_photo"
        android:layout_alignParentTop="true"
        android:textSize="30sp"
        />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/person_age"
        android:layout_toRightOf="@+id/person_photo"
        android:layout_below="@+id/person_name"
        />

</RelativeLayout>

</android.support.v7.widget.CardView>

I want to display my cards below ActionBar

A: Change your app_bar_main
<LinearLayout xmlns:android=
    "http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layout_height="match_parent">

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary" />

<include layout="@layout/content_main" />

</LinearLayout>

A: First add include layout id: For Example
<include  android:id="@+id/card_layout layout="@layout/content_main" />"

and in Toolbar add layout_above
<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:layout_above="@+id/card_layout"
    android:background="?attr/colorPrimary"/>


Join us at the Original Strength Pressing RESET Certification in Sydney, Australia at The Cube in Brookvale on Saturday, November 30, 2019. We will teach you how to help your clients restore and rebuild their Original Strength and improve the results they experience when working with you. The OS Pressing RESET Certification is the introduction to the OS system.


text:
Q: sql - how to add a rank column to an existing table I have the following table:
my_table = sa.sql.table('my_table',
    sa.Column('id', sa.BigInteger),
    sa.Column('employee_id', sa.BigInteger)
)

and I want to add a 'rank' column using alembic.
The addition itself is pretty straight forward using add_column but I also need to populate that column using sqlalchemy based on existing information (each employee_id has its own rank ordered by the id).
For example, the following table:

id    employee_id    rank
--    -----------    ----
1          1          1
2          1          2
5          1          3
3          2          1
4          3          1
6          3          2

The problem is similar to this one.
The only difference is that I need it working for sqlalchemy on top of both mysql and oracle (a more generic solution is needed).
How can I populate the rank column using engine.update?
EDIT 1:
This question is not about how to insert or update records through alembic. It's about finding a query that will do a specific thing and running this query using engine.update


text:
Slovenska Bistrica (en ) est le nom d'une ville du Nord-Est de la Slovénie, située dans la région de Basse-Styrie.

Géographie

La commune est localisée dans la région traditionnelle de Basse-Styrie (Spodnja Štajerska), à environ 20 kilomètres au sud-est de Maribor sur la route menant à Ljubljana (l'actuelle autoroute A1). Slovenska Bistrica est entourée d'une région montagneuse dénommée Pohorje comprenant les contreforts orientaux des Alpes juliennes. Le point le plus élevé est le sommet du mont Rogla, à  d'altitude, dans la partie la plus au nord-ouest.

Villages
Les villages qui composent la commune sont Bojtina, Brezje pri Slovenski Bistrici, Bukovec, Cezlak, Cigonca, Devina, Dolgi Vrh, Drumlažno, Črešnjevec, Farovec, Fošt, Frajhajm, Gabernik, Gaj, Gladomes, Hošnica, Ješovec, Jurišna vas, Kalše, Kebelj, Klopce, Kočno ob Ložnici, Kočno pri Polskavi, Korplje, Kostanjevec, Kot na Pohorju, Kovača vas, Križni Vrh, Laporje, Leskovec, Levič, Lokanja vas, Lukanja, Malo Tinje, Modrič, Nadgrad, Ogljenšak, Ošelj, Planina pod Šumikom, Podgrad na Pohorju, Pokoše, Pragersko, Preloge, Prepuž, Pretrež, Razgor pri Žabljeku, Rep, Ritoznoj, Sele pri Polskavi, Sevec, Slovenska Bistrica, Smrečno, Spodnja Ložnica, Spodnja Nova vas, Spodnja Polskava, Spodnje Prebukovje, Stari Log, Šentovec, Tinjska Gora, Trnovec pri Slovenski Bistrici, Turiška vas na Pohorju, Urh, Veliko Tinje, Videž, Vinarje, Visole, Vrhloga, Vrhole pri Laporju, Vrhole pri Slovenskih Konjicah, Zgornja Bistrica, Zgornja Brežnica, Zgornja Ložnica, Zgornja Nova vas, Zgornja Polskava, Zgornje Prebukovje, Šmartno na Pohorju et Žabljek.

Histoire

Bistrica, l'une des plus anciennes villes de Slovénie, fut fondée au  sur un carrefour commercial reliant les villes de Maribor et Celje. Autrefois, la localité ne comportait qu'une église et un petit nombre d'habitants jusqu'à ce qu'elle devienne une ville commerciale en 1313. Jusqu'à aujourd'hui, la ville est appelée Slovenska Bistrica (Windisch-Feistritz) depuis 1565 de façon à la distinguer de Deutschfeistritz dans la Haute-Styrie.

La ville offre plusieurs sites intéressants tels qu'un château, deux églises, une route et un fort, Ančnikovo, datant de l'époque romaine entre autres. La ville contient également une aire de randonnée, le Mont Boč culminant à 978 mètres.

Démographie
Entre 1999 et 2006, la population de la commune de Slovenska Bistrica était proche de  habitants mais depuis 2007 le nombre d'habitants est proche de  à la suite d'une réorganisation territoriale de la commune.

Évolution démographique

Personnalités
 Anton Ingolič (1907-1992), écrivain ;
 Jože Pučnik (1932-2003), homme politique ;
 René Mlekuz (né en 1975), skieur alpin ;
 Urška Žigart (née en 1996), coureuse cycliste.

Voir aussi

Liens externes
  Municipalité de Slovenska Bistrica
   Informations sur Slovenska Bistrica

Notes et références

Commune en Slovénie

redpajama_set_name: RedPajamaWikipedia


text:
Monthly Mail Contact Us
HOME > PICKS
Picks is a monthly sampling of Japan's art scene, offering commentary by a variety of reviewers about current or recent exhibitions at museums and galleries around the country.
Note: As of 1 October, Japan is no longer under a state of emergency. Most museums and galleries are open, but some may still require reservations or have other anti-Covid measures in place. If you are planning a visit, please check the venue's website beforehand.
The Bonbonnière Story
Gakushuin University Museum of History
(Tokyo)
Bonbonnière is the name for a type of small lidded box or jar (they take many forms) whose function is not obvious at first glance. In fact, these are containers for candy, particularly of the sort dispensed at official events for royalty or government dignitaries. Their use originates with the Western custom of offering sugar candies at weddings, birthdays and other celebrations, which led to the production of highly ornamental containers for confections. This practice was adopted by Japan's imperial household during the Meiji era (1868-1912). Though the style remained indubitably Western, Japan developed its own unique bonbonnière designs and production techniques, as the examples in this show demonstrate.
Today's Miscellany
13 November 2021 - 6 March 2022
Tomonotsu Museum
(Hiroshima)
A presentation of the miscellaneous objects that emerge in the course of creative activities as well as daily life in support facilities for people with disabilities. These endeavors consist not only of paintings, drawings, sculptures and the like, but all manner of handmade items, as well as computer-generated creations. The care workers at these facilities, or artists in the community and elsewhere, sometimes serve as co-creators who help bring these efforts to fruition. Their contributions are often instrumental in giving the artistic expressions of people with disabilities a wider audience.
100 Years of Mingei: The Folk Crafts Movement
26 October 2021 - 13 February 2022
The National Museum of Modern Art, Tokyo
The religious philosopher Muneyoshi (Soetsu) Yanagi pioneered the new aesthetic known as Mingei, as well as establishing the three pillars of the movement he co-founded: a museum, a publishing house, and a distribution network. This voluminous presentation of Mingei works follows the movement's trajectory over six decades from the 1910s to the 1970s. Ceramics are in plentiful supply, ranging from Karatsu and Imari to Old Takeo ware. There is much to look at, and all of it is worth checking out. One also leaves with a clearer appreciation of the accomplishments of the Mingei movement itself. (For a detailed review, see this issue's Focus.)
Ways of Telling
9 October - 26 December 2021
Tokyo Shibuya Koen-dori Gallery
An assemblage of works by eight Japanese artists that give visual form to the diversity of means by which we perceive and "tell" about the world. Strolling through the exhibit space designed by architect Hideyuki Nakamura, one gains a visceral grasp of how we all have multiple modes of apprehending the world pre-installed inside us, and how these different modes shift with the stimulus. Rinko Kawauchi's presentation, through words and 3D images, of the experience of reading a picture book as shared by sighted and sight-impaired people is especially compelling.
Kazuyo Sejima + Ryue Nishizawa / SANAA: Architecture & Environment
22 October 2021 - 20 March 2022
Toto Gallery Ma
SANAA is on a roll these days. The architect team of Sejima and NIshizawa has been winning accolade upon accolade for work that consistently seeks to address the question of how architecture relates to its environment. In this presentation of models and photos of their recent projects, a number of designs do indeed make plain a concern with harmony with their surroundings -- topography, natural setting, and general ambience. Like it or not, architecture has the power to transform its environment, and Sejima and Nishizawa seem profoundly aware of this potentially overwhelming, even violent aspect of their profession. It would appear to behoove all architects to give serious thought to the impact of their works on the environment.
I'm Scared! The Horror of the Museum
Contemporary Art Museum, Kumamoto
(Kumamoto)
People become worn down by stress when they must live with fear and anxiety in their daily lives due to long-term disasters like the Covid pandemic, or the devastating Kumamoto Earthquake of 2016 and its aftermath. On the other hand, fear is a natural human emotion, and many artists have been inspired to creative heights by taking it as their theme. This unusual show features six such artists: Chimei Hamada, Keiichi Tanaami, Yoko Koda, Shinji Ishii, Namuthunder, and Odilon Redon. The curators hope that the humor in these diverse artistic expressions of fear will help give viewers an alternative outlook on the emotion, as well as the energy and initiative to deal with it.
Shell Art Award Exhibition 2021
8 - 20 December 2021
The National Art Center, Tokyo
The Shell Art Award is known for its prescient recognition of young artists who will go on to represent the next generation of leaders in the art world. This year's exhibition, the 50th since the award's competition began in 1956, additionally offers Artists Selection 2021, a display of new and recent works by four promising artists chosen by last year's judges from among past award winners. (Note: The show opens on 8 December, a week after this issue goes online.)
Yoichi Umetsu: Pollinator
16 September 2021 - 16 January 2022
The Watari Museum of Contemporary Art (Watari-um)
Among contemporary artists active today, Umetsu (b. 1982) is an especially hard one to pin down, so broad are his horizons. His oeuvre ranges from miniature-like drawings, pointillist paintings, and ceramic works to performance videos featuring himself -- not to mention his activities as a curator and the operator of a nonprofit gallery. This show's title was chosen as an apt metaphor for Umetsu's role as an artist. In its delicacy and fragility, art resembles nothing so much as pollen, and Umetsu is certainly scattering his far and wide.
M's Gift of the Sea: Auto-Mythology
Artizon Museum
The second in a series of "jam sessions" between the museum's Ishibashi Foundation Collection and various contemporary artists, this one features Yasumasa Morimura, who has long expressed a fascination with the work of the short-lived Meiji-era painter Shigeru Aoki (1882-1911). Here he revisits Aoki's celebrated Gift of the Sea (1903) in a series of inimitable "M-style" paintings that use Aoki's masterpiece as a springboard for commentary on the cultural, political, and philosophical changes Japan underwent during and after the Meiji era.
The Genealogy of Light: Impressionist Masterworks from The Israel Museum, Jerusalem
15 October 2021 - 16 January 2022
Mitsubishi Ichigokan Museum, Tokyo
Among its over 500,000 holdings, Jerusalem's Israel Museum boasts a superb collection of Impressionist and Post-Impressionist art. Of the 69 works selected for this show, 59 are appearing in Japan for the first time. The treats include works by Courbet, Monet, Renoir, Cezanne, Van Gogh, and Gauguin, as well as later Impressionist-influenced painters like the Nabis Bonnard and Vuillard.
Just Passing Through: The Existential World of Saburo Murakami
The Architecture of Kazuyo Sejima and Ryue Nishizawa / SANAA: Challenging Boundaries between Building and Context
Put Me on That Mystery Train: Ichihara Art x Mix 2020+
Ohmori Akio: Sculpture Works
Mingei Revisited: Looking at Japan's Folk Art Movement Nearly a Century On
Taking the Woodblock Print into the 20th Century: Hasui Kawase
How Edo Became Tokyo: Time-Tripping at the Hibiya Library & Museum
>> Back Issues
artscape is the registered trademark of DAI NIPPON PRINTING Co., Ltd.


The Karnataka government has allotted 50 acres of land to GlaxoSmithKline (GSK) which plans to set up a formulation development unit, investing Rs.994 crore. The government has also acquired 3,232 acres of land at Yadgir for the setting of a Pharma Park.
The Karnataka Industrial Area Development Board (KIADB) cleared the formalities of land for GSK and the Karnataka Udyog Mitra (KUM) facilitated the investment for the UK drug multinational. For the Pharma Park, KIADB will now develop the land before it is handed over to KUM, which is the single contact point for all investors who are looking at setting up units in Karnataka.
The GSK's 50 acres of land is located at the Vemgal Industrial Area in Kolar to manufacture tablets and capsules. The facility is expected to generate jobs for 232 personnel. The manufacturing activity will need 2,600 KVA power.
Andrew Witty, Chief Executive Officer, GSK, while sharing his expansion plans stated that to increase its presence in India it would invest Rs.864 crore for a facility and the lead site would be Bengaluru. The unit is to be operational in 2017 and would have a production capacity of eight billion tablets and one billion capsules annually.
GSK had indicated to the state government that the new plant would be engaged in formulation of tablets and capsules besides packaging of the final product.


Enviar solicitação de disponibilidade com as datas desejadas para Fairmont Sonoma Mission Inn & Spa.
Features a Queen bed, flat-screen TV, full bathroom, complimentary wine/wine tasting, complimentary fitness classes and hikes. This is a non-smoking room.
Features a King bed, flat-screen Tv, full bathroom, complimentary wine/winetasting, high speed internet, complimentary fitness classes and hikes. This is a non-smoking room.
Features a King bed, flat-screen TV and is wheelchair accessible.
This deluxe room features a King bed and is wheelchair accessible. This is a non-smoking room.
Features a King bed, shower only, complimentary wine/wine tasting, flat-screen TV.
Features a King bed, complimentary wine/winetasting, coffee/tea, flat-screen TV, high speed internet and elevator.
Accessible Vineyard Suite with a King bed.
Features a King bed and is wheelchair accessible.
Features a Queen bed, full bathroom, complimentary wine/wine tasting, flat-screen TV.
Features a Queen bed and is wheelchair accessible. This is a non-smoking room.
This spacious room features two Queen beds, full bathroom, complimentary wine/wine tasting, flat-screen TV, high speed internet and elevator.
Suite with King bed, fireplace, jacuzzi tub, shower, sitting area, sofabed, Wi-Fi internet and complimentary wine/wine tasting.
Suite with King bed, flat-screen TV, sofabed, wet bar.
Luxury suite with King bed.
Accessible suite features a King bed.
Features a King bed, jacuzzi tub, balcony, fireplace, twin sofabed, Wi-Fi internet and complimentary wine/wine tasting.


text:
B safe 1st always... that is the message
Failed by the system
Welcome to B safe 1st always
WOW its been 10 years that I have run the site thanks for coming and finding the site helpful, thats all I ever wanted, I'll be doing some editing and upgrading on the website soon to make it even better.
Hello, here's an important message first: IF you HAVE BEEN struggling, are RIGHT NOW or may in the FUTURE, or know someone like that, then PLEASE take a look at this page with information about HELPLINES and words from someone who HAS used one.
Please be in a safe place and safe state of mind when viewing this website.
Be one more to say: "I SURVIVED"
My last edit on this website was March 2019
All material on this site are under copyright conditions of the source: John Harrison. If you wish to use ANY material from this site, YOU MUST have MY permission. Thank You. But let me say: I am always happy for my work to be used elsewhere, as long as I am shown as the author.
There are organisations and numbers here for YOU
Please reach out to that someone TODAY.
But whatever happens, keep trying.
There are other numbers and other people.
It will take as long as it takes, to get the right help.
BUT YOU'RE WORTH IT.
Please take a look to the the right,
or on the links page for details of some who are here.
Hope, its just one word, and it may seem a small one
but its why many are still here.
Grasp it when ever you can. Cling to it. Do what you have to.
And when there seems like there is no hope... HANG ON IN THERE
so you're still with us, when it does return.
An introduction to the site:
My names John Harrison and this site has been going for 10 years now (as of 2019). Originally failings in the system that I encountered led me to speak out and have to speak publicly from the 1990's. The core content of the website is around child abuse and mental health and there has always been a combination of things that I wanted the website to do. I wanted others to be aware of the rest of us with the same issues, to at least let them know that they are not alone in what they go through or have gone through. I wanted the website to expose some of the wrongdoings too which it did.
There is no content on this site, nor has there ever been any, that is in any way inappropriate. BUT some people are more vulnerable than others and that's why there are links in the right sidebar on this website and the links page to show some organisations that may be able to help OR show that for every issue there may well be a helpline, charity or organisation out there for you, they don't always work for everybody, this I know. All links to them here are not put there for the organisations or charities, they are ONLY put here by me in the hope that they may help someone. IF they don't, please hang on in there.
IF you are someone who wants to learn more about the failings in the system I encountered and about the campaigning I did, then take a look at the 'FAILED by the System' page to start to find out more. IF not, you can have a general look around the rest of the site for help or some important information and insight it to it all. Changes I made and will make, help people more easily make a choice as to what they want to look at.
B safe 1st always... that IS the message.
'Raising awareness of the consequences of child abuse in later life'
'WHISPERS FROM WITHIN' is once again available #kindle UK £3.25 / US $5.04 #Paperback #book from £3.99 ALL links here http://t.co/F6IYrnkhRv
— Whispers From Within (@TheBookWHISPERS) August 12, 2015
A helpful index and guide to this website for newcomers:
Here's a little guide to what to expect on each page of this website:
'TALK' this is a brief introduction on what options may be there for you when you want to know: WHO & HOW can I TALK & TELL someone abuse my abuse?
'HELPLINES' I know it explains itself, but its a very important page to mention. This page shows why helplines are so needed. PLEASE share them online, you never know who may see it, and need it.
'Books' a selection of just a few books on child abuse mainly by survivors themselves.
'Child Abuse Monument' the monument is in Canada, it gives more info about it.
'Raising Awareness' talks and shows some videos about raising awareness of child abuse and its consequences in later life.
'FAILED by the system' this page links to several very detailed pages on the failings in the system I endured, including within and by healthcare professionals. It also links to several detailed pages on the campaign and raising awareness that I then did, about these failings. I started Writing to MP's, PM, the Queen and more. I have recently separated all these relating pages, so they can be accessed by this one page. It helps to keep it away from you, IF you're in a vulnerable place, and you can avoid all this if you need to. All the pages this one links to, are VERY IMPORTANT to me. And where a very big part of me speaking out.
A Bsafe1stalways Donation
If you would like to help, and can afford to, please consider making a small donation to help with the B safe 1st always running costs by using the PayPal button or link below. Its now been 10 years since I set up this website and from 2009 up to 2019 I have always funded it and the other things I have done through my Bsafe1stalways campaigning myself but any help now would be so appreciated. Thank you https://www.paypal.me/Bsafe1stalways
To ALL the ABUSED:
"As someone being abused OR who was, YOU have the RIGHT to be away from people (ANYONE) making it worse for you, despite how some may act or what they may say"
John Harrison. B safe 1st always... that is the message.
Samaritans HELPLINE
Samaritans HELPLINE is here 24 / 7
Are you vulnerable? Feeling low?
Then why not call:
UK & ROI: 116 123
PLEASE call or reach out to
that someone... TODAY
NAPAC (click on icon)
www.napac.org.uk
For Children: Childline:
Are you a child who
needs to talk to someone?
ChildLine is here for YOU
Call ChildLine on UK 0800 1111
or visit the website.
Child Exploitation and Online Protection Centre below:
expansionThe Child Exploitation and Online Protection (CEOP) Centre is dedicated to eradicating the sexual abuse of children.
Part of UK policing about tracking and bringing offenders to account either directly or in partnership with local and international forces.
A list of worldwide Helplines (click on icon):
Links to Befrienders website for a
WORLDWIDE list of Helplines.
Citizens Advice Bureau (UK)
The Citizens Advice Bureau
provide FREE advice in the UK
Visit their website to find out more.
http://www.citizensadvice.org.uk/
CLICK HEREslight to see more details on
how the system FAILED me and the
campaigning and exposure of this
I have done for over a decade
Queens response to my letter
The "Reaching out" Child Abuse Monument in Canada...
expansionnetnetnet Navy
To find out more use this link
My video poem below 'Our Silence'
that will be inside the monument
COPYRIGHT © JOHN HARRISON 2019