text:
package org.scalajs.linker.backend.emitter

import org.scalajs.ir._
import Position._
import Transformers._
import org.scalajs.ir.Trees._
import Types._

import org.scalajs.linker._
import org.scalajs.linker.standard._
import org.scalajs.linker.backend.javascript.{Trees => js}

import CheckedBehavior.Unchecked

/** Emitter for the skeleton of classes. */
private[emitter] final class ClassEmitter(jsGen: JSGen) {

  private val functionEmitter = new FunctionEmitter(jsGen)

  import ClassEmitter._
  import functionEmitter._
  import jsGen._

  def buildClass(tree: LinkedClass, ctor: WithGlobals[js.Tree],
      memberDefs: List[WithGlobals[js.Tree]], exportedDefs: WithGlobals[js.Tree])(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {

    WithGlobals.list(ctor +: memberDefs :+ exportedDefs).flatMap { allDefs =>
      val className = tree.name.name
      val allDefsBlock = js.Block(allDefs)(tree.pos)

      val entireClassDefWithGlobals = if (useClasses) {
        val allDefs = allDefsBlock match {
          case js.Block(allDefs) => allDefs
          case js.Skip()         => Nil
          case oneDef            => List(oneDef)
        }
        genES6Class(tree, allDefs)
      } else {
        WithGlobals(allDefsBlock)
      }

      if (!tree.kind.isJSClass) {
        assert(tree.jsSuperClass.isEmpty, className)
        entireClassDefWithGlobals
      } else {
        // Wrap the entire class def in an accessor function
        import TreeDSL._
        implicit val pos = tree.pos

        val genStoreJSSuperClass = tree.jsSuperClass.map { jsSuperClass =>
          for (rhs <- desugarExpr(jsSuperClass, resultType = AnyType)) yield {
            js.VarDef(envField("superClass").ident, Some(rhs))
          }
        }

        for {
          optStoreJSSuperClass <- WithGlobals.option(genStoreJSSuperClass)
          entireClassDef <- entireClassDefWithGlobals
          createStaticFields <- genCreateStaticFieldsOfJSClass(tree)
        } yield {
          tree.jsClassCaptures.fold {
            val createClassValueVar =
              envFieldDef("b", className, js.Undefined(), mutable = true)

            val createAccessor = {
              val classValueVar = envField("b", className)

              val body = js.Block(
                  js.If(!classValueVar, {
                    js.Block(
                        optStoreJSSuperClass.toList :::
                        entireClassDef ::
                        createStaticFields :::
                        (classValueVar := envField("c", className)) ::
                        genStaticInitialization(tree)
                    )
                  }, {
                    js.Skip()
                  }),
                  js.Return(classValueVar)
              )

              envFunctionDef("a", className, Nil, body)
            }

            js.Block(createClassValueVar, createAccessor)
          } { jsClassCaptures =>
            val captureParamDefs = for (param <- jsClassCaptures) yield {
              implicit val pos = param.pos
              val ident =
                envFieldIdent("cc", param.name.name, param.name.originalName)
              js.ParamDef(ident, rest = false)
            }

            assert(!hasStaticInitializer(tree),
                s"Found a static initializer in the non-top-level class $className")

            val body = js.Block(
                optStoreJSSuperClass.toList :::
                entireClassDef ::
                createStaticFields :::
                js.Return(envField("c", className)) ::
                Nil
            )

            envFunctionDef("a", className, captureParamDefs, body)
          }
        }
      }
    }
  }

  /** Generates an ECMAScript 6 class for a linked class. */
  def genES6Class(tree: LinkedClass, members: List[js.Tree])(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {

    require(useClasses)

    val className = tree.name.name
    val classIdent = encodeClassVar(className)(tree.name.pos).ident

    val parentVarWithGlobals = for (parentIdent <- tree.superClass) yield {
      implicit val pos = parentIdent.pos
      if (!tree.kind.isJSClass) {
        if (shouldExtendJSError(tree))
          WithGlobals(js.VarRef(js.Ident("Error")))
        else
          WithGlobals(encodeClassVar(parentIdent.name))
      } else if (tree.jsSuperClass.isDefined) {
        WithGlobals(envField("superClass"))
      } else {
        genJSClassConstructor(parentIdent.name,
            keepOnlyDangerousVarNames = true)
      }
    }

    for (parentVar <- WithGlobals.option(parentVarWithGlobals))
      yield js.ClassDef(Some(classIdent), parentVar, members)(tree.pos)
  }

  /** Extracts the inlineable init method, if there is one. */
  def extractInlineableInit(tree: LinkedClass)(
      implicit globalKnowledge: GlobalKnowledge): (Option[Versioned[MethodDef]], List[Versioned[MethodDef]]) = {

    if (globalKnowledge.hasInlineableInit(tree.encodedName)) {
      val (constructors, otherMethods) = tree.methods.partition { m =>
        m.value.flags.namespace == MemberNamespace.Constructor
      }
      assert(constructors.size == 1,
          s"Found ${constructors.size} constructors in class " +
          s"${tree.encodedName} which has an inlined init.")
      (Some(constructors.head), otherMethods)
    } else {
      (None, tree.methods)
    }
  }

  /** Generates the JS constructor for a class. */
  def genConstructor(tree: LinkedClass, initToInline: Option[MethodDef])(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {

    assert(tree.kind.isAnyNonNativeClass)
    assert(tree.superClass.isDefined || tree.name.name == Definitions.ObjectClass,
        s"Class ${tree.name.name} is missing a parent class")

    if (useClasses)
      genES6Constructor(tree, initToInline)
    else
      genES5Constructor(tree, initToInline)
  }

  /** Generates the JS constructor for a class, ES5 style. */
  private def genES5Constructor(tree: LinkedClass,
      initToInline: Option[MethodDef])(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {
    import TreeDSL._
    implicit val pos = tree.pos

    val className = tree.name.name
    val isJSClass = tree.kind.isJSClass
    val typeVar = encodeClassVar(className)

    def makeInheritableCtorDef(ctorToMimic: js.Tree, field: String) = {
      js.Block(
        js.DocComment("@constructor"),
        envFieldDef(field, className, js.Function(false, Nil, js.Skip()),
            keepFunctionExpression = isJSClass),
        envField(field, className).prototype := ctorToMimic.prototype
      )
    }

    val ctorFunWithGlobals =
      if (!isJSClass) genJSConstructorFun(tree, initToInline)
      else genConstructorFunForJSClass(tree)

    val chainProtoWithGlobals = tree.superClass.fold[WithGlobals[js.Tree]] {
      WithGlobals(js.Skip())
    } { parentIdent =>
      val (inheritedCtorDefWithGlobals, inheritedCtorRef) = if (!isJSClass) {
        if (shouldExtendJSError(tree)) {
          val inheritableCtorDef =
            makeInheritableCtorDef(js.VarRef(js.Ident("Error")), "hh")
          (WithGlobals(inheritableCtorDef), envField("hh", className))
        } else {
          (WithGlobals(js.Skip()), envField("h", parentIdent.name))
        }
      } else {
        val superCtor = if (tree.jsSuperClass.isDefined) {
          WithGlobals(envField("superClass"))
        } else {
          genJSClassConstructor(parentIdent.name,
              keepOnlyDangerousVarNames = true)
        }
        (superCtor.map(makeInheritableCtorDef(_, "h")), envField("h", className))
      }

      for (inheritedCtorDef <- inheritedCtorDefWithGlobals) yield {
        js.Block(
            inheritedCtorDef,
            typeVar.prototype := js.New(inheritedCtorRef, Nil),
            genAddToPrototype(className, js.StringLiteral("constructor"), typeVar)
        )
      }
    }

    for {
      ctorFun <- ctorFunWithGlobals
      chainProto <- chainProtoWithGlobals
    } yield {
      val docComment = js.DocComment("@constructor")
      val ctorDef = envFieldDef("c", className, ctorFun,
          keepFunctionExpression = isJSClass)

      val inheritableCtorDef =
        if (isJSClass) js.Skip()
        else makeInheritableCtorDef(typeVar, "h")

      js.Block(docComment, ctorDef, chainProto, inheritableCtorDef)
    }
  }

  /** Generates the JS constructor for a class, ES6 style. */
  private def genES6Constructor(tree: LinkedClass,
      initToInline: Option[MethodDef])(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {
    implicit val pos = tree.pos

    if (tree.kind.isJSClass) {
      for (fun <- genConstructorFunForJSClass(tree)) yield {
        js.MethodDef(static = false, js.Ident("constructor"), fun.args,
            fun.body)
      }
    } else {
      val jsConstructorFunWithGlobals =
        genJSConstructorFun(tree, initToInline)

      for (jsConstructorFun <- jsConstructorFunWithGlobals) yield {
        val js.Function(_, args, body) = jsConstructorFun

        def isTrivialCtorBody: Boolean = body match {
          case js.Skip()                 => true
          case js.Apply(js.Super(), Nil) => true
          case _                         => false
        }

        if (args.isEmpty && isTrivialCtorBody)
          js.Skip()
        else
          js.MethodDef(static = false, js.Ident("constructor"), args, body)
      }
    }
  }

  /** Generates the JavaScript constructor of a class, as a `js.Function`.
   *
   *  For ECMAScript 2015, that `js.Function` must be decomposed and reformed
   *  into a `js.MethodDef` afterwards.
   *
   *  The generated function performs the following steps:
   *
   *  - Create the fields of the current class, initialized to the zero of
   *    their respective types
   *    - In ECMAScript 5.1, all the fields in the parent chain are directly
   *      created, avoiding expensive super calls
   *    - In ECMAScript 2015, calling the super constructor is mandatory, so we
   *      first call it then create the fields directly declared in this class
   *  - Executes the body of the `init` method to inline, if any
   *
   *  Note that we know that a super JS constructor never contains an inlined
   *  init (which the above ES 5.1 treatment would throw away), because classes
   *  that have instantiated subclasses are not eligible for the inlined init
   *  optimization.
   *
   *  @param tree
   *    The `LinkedClass` for which we generate a JS constructor.
   *
   *  @param initToInline
   *    The `init` method to inline in the JS constructor, if any.
   */
  private def genJSConstructorFun(tree: LinkedClass,
      initToInline: Option[MethodDef])(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Function] = {

    implicit val pos = tree.pos

    val superCtorCallAndFieldDefs = if (useClasses) {
      val fieldDefs = genFieldDefsOfScalaClass(tree.fields)
      if (tree.superClass.isEmpty)
        fieldDefs
      else
        js.Apply(js.Super(), Nil) :: fieldDefs
    } else {
      val allFields =
        globalKnowledge.getAllScalaClassFieldDefs(tree.encodedName)
      genFieldDefsOfScalaClass(allFields)
    }

    initToInline.fold {
      WithGlobals(
          js.Function(arrow = false, Nil, js.Block(superCtorCallAndFieldDefs)))
    } { initMethodDef =>
      val generatedInitMethodFunWithGlobals = {
        implicit val pos = initMethodDef.pos
        val initMethodBody = initMethodDef.body.getOrElse {
          throw new AssertionError("Cannot generate an abstract constructor")
        }
        assert(initMethodDef.resultType == NoType,
            s"Found a constructor with type ${initMethodDef.resultType} at $pos")
        desugarToFunction(tree.encodedName, initMethodDef.args, initMethodBody,
            resultType = NoType)
      }

      for (generatedInitMethodFun <- generatedInitMethodFunWithGlobals) yield {
        val js.Function(arrow, args, initMethodFunBody) = generatedInitMethodFun
        js.Function(arrow, args,
            js.Block(superCtorCallAndFieldDefs ::: initMethodFunBody :: Nil))
      }
    }
  }

  private def genConstructorFunForJSClass(tree: LinkedClass)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Function] = {
    implicit val pos = tree.pos

    require(tree.kind.isJSClass)

    tree.exportedMembers.map(_.value) collectFirst {
      case MethodDef(flags, StringLiteral("constructor"), params, _, body)
          if flags.namespace == MemberNamespace.Public =>
        desugarToFunction(tree.encodedName, params, body.get, resultType = NoType)
    } getOrElse {
      throw new IllegalArgumentException(
          s"${tree.encodedName} does not have an exported constructor")
    }
  }

  /** Generates the creation of fields for a Scala class. */
  private def genFieldDefsOfScalaClass(fields: List[FieldDef])(
      implicit globalKnowledge: GlobalKnowledge): List[js.Tree] = {
    for {
      field @ FieldDef(flags, name, ftpe) <- fields
      if !flags.namespace.isStatic
    } yield {
      implicit val pos = field.pos
      val jsIdent = (name: @unchecked) match {
        case Ident(name, origName) => js.Ident(name, origName)
      }
      js.Assign(js.DotSelect(js.This(), jsIdent), genZeroOf(ftpe))
    }
  }

  /** Generates the creation of the static fields for a Scala class. */
  def genCreateStaticFieldsOfScalaClass(tree: LinkedClass)(
      implicit globalKnowledge: GlobalKnowledge): List[js.Tree] = {
    for {
      field @ FieldDef(flags, Ident(name, origName), ftpe) <- tree.fields
      if flags.namespace.isStatic
    } yield {
      implicit val pos = field.pos
      val fullName = tree.encodedName + "__" + name
      envFieldDef("t", fullName, genZeroOf(ftpe), origName, flags.isMutable)
    }
  }

  /** Generates the creation of the static fields for a JavaScript class. */
  private def genCreateStaticFieldsOfJSClass(tree: LinkedClass)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[List[js.Tree]] = {
    val className = tree.encodedName
    val statsWithGlobals = for {
      field @ FieldDef(flags, name, ftpe) <- tree.fields
      if flags.namespace.isStatic
    } yield {
      implicit val pos = field.pos
      val classVar = envField("c", className)
      for (propName <- genPropertyName(name)) yield {
        val select = genPropSelect(classVar, propName)
        val zero =
          if (ftpe == CharType) js.VarRef(js.Ident("$bC0"))
          else genZeroOf(ftpe)
        js.Assign(select, zero)
      }
    }
    WithGlobals.list(statsWithGlobals)
  }

  /** Generates the static initializer invocation of a class. */
  def genStaticInitialization(tree: LinkedClass): List[js.Tree] = {
    import Definitions.StaticInitializerName
    implicit val pos = tree.pos
    if (hasStaticInitializer(tree)) {
      val fullName = tree.encodedName + "__" + StaticInitializerName
      js.Apply(envField("sct", fullName, Some("<clinit>")), Nil) :: Nil
    } else {
      Nil
    }
  }

  private def hasStaticInitializer(tree: LinkedClass): Boolean = {
    tree.methods.exists { m =>
      m.value.flags.namespace == MemberNamespace.StaticConstructor
    }
  }

  /** Generates a method. */
  def genMethod(className: String, method: MethodDef)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {
    val methodBody = method.body.getOrElse(
        throw new AssertionError("Cannot generate an abstract method"))

    implicit val pos = method.pos

    val namespace = method.flags.namespace

    val methodFun0WithGlobals = {
      if (namespace != MemberNamespace.Constructor &&
          namespace != MemberNamespace.Private) {
        desugarToFunction(className, method.args, methodBody, method.resultType)
      } else {
        desugarToFunctionWithExplicitThis(className, method.args, methodBody,
            method.resultType)
      }
    }

    methodFun0WithGlobals.flatMap { methodFun0 =>
      val methodFun = if (namespace == MemberNamespace.Constructor) {
        // init methods have to return `this` so that we can chain them to `new`
        js.Function(arrow = false, methodFun0.args, {
          implicit val pos = methodFun0.body.pos
          js.Block(
              methodFun0.body,
              js.Return(methodFun0.args.head.ref))
        })(methodFun0.pos)
      } else {
        methodFun0
      }

      if (namespace != MemberNamespace.Public) {
        method.name match {
          case Ident(methodName, origName) =>
            val field = namespace match {
              case MemberNamespace.Private           => "p"
              case MemberNamespace.PublicStatic      => "s"
              case MemberNamespace.PrivateStatic     => "ps"
              case MemberNamespace.Constructor       => "ct"
              case MemberNamespace.StaticConstructor => "sct"
            }
            WithGlobals(envFieldDef(field, className + "__" + methodName,
                methodFun, origName))

          case methodName =>
            if (useClasses) {
              for (propName <- genPropertyName(methodName)) yield {
                js.MethodDef(static = true, propName, methodFun.args,
                    methodFun.body)
              }
            } else {
              genAddToObject(className, encodeClassVar(className), methodName,
                  methodFun)
            }
        }
      } else {
        if (useClasses) {
          for (propName <- genPropertyName(method.name)) yield {
            js.MethodDef(static = false, propName, methodFun.args,
                methodFun.body)
          }
        } else {
          genAddToPrototype(className, method.name, methodFun)
        }
      }
    }
  }

  /** Generates a default method. */
  def genDefaultMethod(className: String, method: MethodDef)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {
    implicit val pos = method.pos

    val methodFunWithGlobals = desugarToFunctionWithExplicitThis(
        className, method.args, method.body.get, method.resultType)

    for (methodFun <- methodFunWithGlobals) yield {
      val Ident(methodName, origName) = method.name
      envFieldDef("f", className + "__" + methodName, methodFun, origName)
    }
  }

  /** Generates an instance method of a hijacked class. */
  def genHijackedMethod(className: String, method: MethodDef)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {
    // We abuse `genDefaultMethod` as it does everything the way we want
    genDefaultMethod(className, method)
  }

  /** Generates a property. */
  def genProperty(className: String, property: PropertyDef)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {
    if (useClasses)
      genPropertyES6(className, property)
    else
      genPropertyES5(className, property)
  }

  private def genPropertyES5(className: String, property: PropertyDef)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {
    import TreeDSL._
    implicit val pos = property.pos

    // defineProperty method
    val defProp =
      genIdentBracketSelect(js.VarRef(js.Ident("Object")), "defineProperty")

    // class prototype
    val classVar = encodeClassVar(className)
    val targetObject =
      if (property.flags.namespace.isStatic) classVar
      else classVar.prototype

    // property name
    val propNameWithGlobals = genPropertyName(property.name)

    // optional getter definition
    val optGetterWithGlobals = property.getterBody map { body =>
      desugarToFunction(className, Nil, body, resultType = AnyType)
    }

    // optional setter definition
    val optSetterWithGlobals = property.setterArgAndBody map {
      case (arg, body) =>
        desugarToFunction(className, arg :: Nil, body, resultType = NoType)
    }

    for {
      propName <- propNameWithGlobals
      optGetter <- WithGlobals.option(optGetterWithGlobals)
      optSetter <- WithGlobals.option(optSetterWithGlobals)
    } yield {
      val name = propName match {
        case value: js.StringLiteral => value
        case js.ComputedName(tree)   => tree

        case id: js.Ident =>
          // We need to work around the closure compiler. Call propertyName to
          // get a string representation of the optimized name
          genCallHelper("propertyName",
              js.ObjectConstr(id -> js.IntLiteral(0) :: Nil))
      }

      // Options passed to the defineProperty method
      val descriptor = js.ObjectConstr(
        optGetter.map(js.StringLiteral("get") -> _).toList :::
        optSetter.map(js.StringLiteral("set") -> _).toList :::
        (js.StringLiteral("configurable") -> js.BooleanLiteral(true)) ::
        Nil
      )

      js.Apply(defProp, targetObject :: name :: descriptor :: Nil)
    }
  }

  private def genPropertyES6(className: String, property: PropertyDef)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {
    implicit val pos = property.pos

    val static = property.flags.namespace.isStatic

    genPropertyName(property.name).flatMap { propName =>
      val getterWithGlobals = property.getterBody.fold {
        WithGlobals[js.Tree](js.Skip())
      } { body =>
        for (fun <- desugarToFunction(className, Nil, body, resultType = AnyType))
          yield js.GetterDef(static, propName, fun.body)
      }

      val setterWithGlobals = property.setterArgAndBody.fold {
        WithGlobals[js.Tree](js.Skip())
      } { case (arg, body) =>
        for (fun <- desugarToFunction(className, arg :: Nil, body, resultType = NoType))
          yield js.SetterDef(static, propName, fun.args.head, fun.body)
      }

      for {
        getter <- getterWithGlobals
        setter <- setterWithGlobals
      } yield {
        js.Block(getter, setter)
      }
    }
  }

  /** Generate `classVar.prototype.name = value` */
  def genAddToPrototype(className: String, name: js.PropertyName, value: js.Tree)(
      implicit globalKnowledge: GlobalKnowledge, pos: Position): js.Tree = {
    import TreeDSL._

    genAddToObject(encodeClassVar(className).prototype, name, value)
  }

  /** Generate `classVar.prototype.name = value` */
  def genAddToPrototype(className: String, name: PropertyName, value: js.Tree)(
      implicit globalKnowledge: GlobalKnowledge,
      pos: Position): WithGlobals[js.Tree] = {
    for (propName <- genPropertyName(name))
      yield genAddToPrototype(className, propName, value)
  }

  /** Generate `obj.name = value` */
  def genAddToObject(obj: js.Tree, name: js.PropertyName,
      value: js.Tree)(implicit pos: Position): js.Tree = {
    js.Assign(genPropSelect(obj, name), value)
  }

  /** Generate `obj.name = value` */
  def genAddToObject(className: String, obj: js.Tree, name: PropertyName,
      value: js.Tree)(
      implicit globalKnowledge: GlobalKnowledge,
      pos: Position): WithGlobals[js.Tree] = {
    for (propName <- genPropertyName(name))
      yield genAddToObject(obj, propName, value)
  }

  def genPropertyName(name: PropertyName)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.PropertyName] = {
    name match {
      case Ident(nameStr, origName) =>
        WithGlobals(js.Ident(nameStr, origName)(name.pos))

      case StringLiteral(value) =>
        WithGlobals(js.StringLiteral(value)(name.pos))

      case ComputedName(tree, _) =>
        implicit val pos = name.pos
        desugarExpr(tree, resultType = AnyType).map(js.ComputedName(_))
    }
  }

  def needInstanceTests(tree: LinkedClass): Boolean = {
    tree.hasInstanceTests || {
      tree.hasRuntimeTypeInfo &&
      ClassesWhoseDataReferToTheirInstanceTests.contains(tree.encodedName)
    }
  }

  def genInstanceTests(tree: LinkedClass): js.Tree = {
    import Definitions._
    import TreeDSL._

    implicit val pos = tree.pos

    if (tree.kind.isClass || tree.kind == ClassKind.Interface ||
        tree.name.name == Definitions.BoxedStringClass) {
      val className = tree.name.name
      val displayName = decodeClassName(className)

      val isAncestorOfString =
        NonObjectAncestorsOfStringClass.contains(className)
      val isAncestorOfHijackedNumberClass =
        NonObjectAncestorsOfHijackedNumberClasses.contains(className)
      val isAncestorOfBoxedBooleanClass =
        NonObjectAncestorsOfBoxedBooleanClass.contains(className)
      val isAncestorOfBoxedCharacterClass =
        NonObjectAncestorsOfBoxedCharacterClass.contains(className)

      val objParam = js.ParamDef(js.Ident("obj"), rest = false)
      val obj = objParam.ref

      val createIsStat = {
        envFunctionDef("is", className, List(objParam), js.Return {
          className match {
            case Definitions.ObjectClass =>
              js.BinaryOp(JSBinaryOp.!==, obj, js.Null())

            case Definitions.BoxedStringClass =>
              js.UnaryOp(JSUnaryOp.typeof, obj) === js.StringLiteral("string")

            case _ =>
              var test = {
                genIsScalaJSObject(obj) &&
                genIsClassNameInAncestors(className,
                    obj DOT "$classData" DOT "ancestors")
              }

              def typeOfTest(typeString: String): js.Tree =
                js.UnaryOp(JSUnaryOp.typeof, obj) === js.StringLiteral(typeString)

              if (isAncestorOfString)
                test = test || typeOfTest("string")
              if (isAncestorOfHijackedNumberClass) {
                test = test || typeOfTest("number")
                if (useBigIntForLongs)
                  test = test || genCallHelper("isLong", obj)
              }
              if (isAncestorOfBoxedBooleanClass)
                test = test || typeOfTest("boolean")
              if (isAncestorOfBoxedCharacterClass)
                test = test || (obj instanceof envField("Char"))

              !(!test)
          }
        })
      }

      val createAsStat = if (semantics.asInstanceOfs == Unchecked) {
        js.Skip()
      } else {
        envFunctionDef("as", className, List(objParam), js.Return {
          className match {
            case Definitions.ObjectClass =>
              obj

            case _ =>
              js.If(js.Apply(envField("is", className), List(obj)) ||
                  (obj === js.Null()), {
                obj
              }, {
                genCallHelper("throwClassCastException",
                    obj, js.StringLiteral(displayName))
              })
          }
        })
      }

      js.Block(createIsStat, createAsStat)
    } else {
      js.Skip()
    }
  }

  def genArrayInstanceTests(tree: LinkedClass): js.Tree = {
    import Definitions._
    import TreeDSL._

    implicit val pos = tree.pos

    val className = tree.name.name
    val displayName = decodeClassName(className)

    val objParam = js.ParamDef(js.Ident("obj"), rest = false)
    val obj = objParam.ref

    val depthParam = js.ParamDef(js.Ident("depth"), rest = false)
    val depth = depthParam.ref

    val createIsArrayOfStat = {
      envFunctionDef("isArrayOf", className, List(objParam, depthParam), {
        className match {
          case Definitions.ObjectClass =>
            val dataVarDef = genLet(js.Ident("data"), mutable = false, {
              obj && (obj DOT "$classData")
            })
            val data = dataVarDef.ref
            js.Block(
              dataVarDef,
              js.If(!data, {
                js.Return(js.BooleanLiteral(false))
              }, {
                val arrayDepthVarDef = genLet(js.Ident("arrayDepth"), mutable = false, {
                  (data DOT "arrayDepth") || js.IntLiteral(0)
                })
                val arrayDepth = arrayDepthVarDef.ref
                js.Block(
                  arrayDepthVarDef,
                  js.Return {
                    // Array[A] </: Array[Array[A]]
                    !js.BinaryOp(JSBinaryOp.<, arrayDepth, depth) && (
                      // Array[Array[A]] <: Array[Object]
                      js.BinaryOp(JSBinaryOp.>, arrayDepth, depth) ||
                      // Array[Int] </: Array[Object]
                      !genIdentBracketSelect(data DOT "arrayBase", "isPrimitive")
                    )
                  })
              }))

          case _ =>
            js.Return(!(!({
              genIsScalaJSObject(obj) &&
              ((obj DOT "$classData" DOT "arrayDepth") === depth) &&
              genIsClassNameInAncestors(className,
                  obj DOT "$classData" DOT "arrayBase" DOT "ancestors")
            })))
        }
      })
    }

    val createAsArrayOfStat = if (semantics.asInstanceOfs == Unchecked) {
      js.Skip()
    } else {
      envFunctionDef("asArrayOf", className, List(objParam, depthParam), {
        js.Return {
          js.If(js.Apply(envField("isArrayOf", className), List(obj, depth)) ||
              (obj === js.Null()), {
            obj
          }, {
            genCallHelper("throwArrayCastException",
                obj, js.StringLiteral("L"+displayName+";"), depth)
          })
        }
      })
    }

    js.Block(createIsArrayOfStat, createAsArrayOfStat)
  }

  private def genIsScalaJSObject(obj: js.Tree)(implicit pos: Position): js.Tree = {
    import TreeDSL._
    obj && (obj DOT "$classData")
  }

  private def genIsClassNameInAncestors(className: String, ancestors: js.Tree)(
      implicit pos: Position): js.Tree = {
    import TreeDSL._
    ancestors DOT className
  }

  def genTypeData(tree: LinkedClass)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {
    import Definitions._
    import TreeDSL._

    implicit val pos = tree.pos

    val className = tree.name.name
    val kind = tree.kind

    val isObjectClass =
      className == ObjectClass
    val isHijackedClass =
      HijackedClasses.contains(className)
    val isAncestorOfHijackedClass =
      isObjectClass || AncestorsOfHijackedClasses.contains(className)
    val isJSType =
      kind.isJSType

    val isJSTypeParam =
      if (isJSType) js.BooleanLiteral(true)
      else js.Undefined()

    val parentData = if (globalKnowledge.isParentDataAccessed) {
      tree.superClass.fold[js.Tree] {
        if (isObjectClass) js.Null()
        else js.Undefined()
      } { parent =>
        envField("d", parent.name)
      }
    } else {
      js.Undefined()
    }

    val ancestorsRecord = js.ObjectConstr(
        tree.ancestors.map(ancestor => (js.Ident(ancestor), js.IntLiteral(1))))

    val isInstanceFunWithGlobals: WithGlobals[js.Tree] = {
      if (isAncestorOfHijackedClass || className == BoxedStringClass) {
        /* java.lang.String and ancestors of hijacked classes, including
         * java.lang.Object, have a normal $is_pack_Class test but with a
         * non-standard behavior.
         */
        WithGlobals(envField("is", className))
      } else if (isHijackedClass) {
        /* Other hijacked classes have a special isInstanceOf test. */
        val xParam = js.ParamDef(js.Ident("x"), rest = false)
        WithGlobals(genArrowFunction(List(xParam), js.Return {
          genIsInstanceOf(xParam.ref, ClassRef(className))
        }))
      } else if (isJSType) {
        /* Native JS classes have an instanceof operator-based isInstanceOf
         * test dictated by their jsNativeLoadSpec.
         * Non-native JS classes have something similar, based on their
         * constructor.
         * Other JS types do not have any instanceof operator, so the test
         * cannot be performed and must throw.
         */
        if (kind != ClassKind.JSClass && kind != ClassKind.NativeJSClass) {
          WithGlobals(envField("noIsInstance"))
        } else {
          for {
            jsCtor <- genJSClassConstructor(className, tree.jsNativeLoadSpec,
                keepOnlyDangerousVarNames = true)
          } yield {
            genArrowFunction(List(js.ParamDef(js.Ident("x"), rest = false)), js.Return {
              js.VarRef(js.Ident("x")) instanceof jsCtor
            })
          }
        }
      } else {
        // For other classes, the isInstance function can be inferred.
        WithGlobals(js.Undefined())
      }
    }

    val isArrayOfFun = {
      if (isObjectClass) {
        // Object is the only class that has a special $isArrayOf_O.
        envField("isArrayOf", className)
      } else {
        // For other classes, the isArrayOf function can be inferred.
        js.Undefined()
      }
    }

    for (isInstanceFun <- isInstanceFunWithGlobals) yield {
      val allParams = List(
          js.ObjectConstr(List(js.Ident(className) -> js.IntLiteral(0))),
          js.BooleanLiteral(kind == ClassKind.Interface),
          js.StringLiteral(semantics.runtimeClassNameMapper(tree.fullName)),
          ancestorsRecord,
          isJSTypeParam,
          parentData,
          isInstanceFun,
          isArrayOfFun
      )

      val prunedParams =
        allParams.reverse.dropWhile(_.isInstanceOf[js.Undefined]).reverse

      val typeData = js.Apply(js.New(envField("TypeData"), Nil) DOT "initClass",
          prunedParams)

      envFieldDef("d", className, typeData)
    }
  }

  def genSetTypeData(tree: LinkedClass): js.Tree = {
    import TreeDSL._

    implicit val pos = tree.pos

    assert(tree.kind.isClass)

    encodeClassVar(tree.name.name).prototype DOT "$classData" :=
      envField("d", tree.name.name)
  }

  def genModuleAccessor(tree: LinkedClass): js.Tree = {
    import TreeDSL._

    implicit val pos = tree.pos

    val className = tree.name.name
    val tpe = ClassType(className)

    require(tree.kind.hasModuleAccessor,
        s"genModuleAccessor called with non-module class: $className")

    val createModuleInstanceField =
      envFieldDef("n", className, js.Undefined(), mutable = true)

    val createAccessor = {
      val moduleInstanceVar = envField("n", className)

      val assignModule = {
        moduleInstanceVar := {
          if (tree.kind == ClassKind.JSModuleClass) {
            js.New(
                genNonNativeJSClassConstructor(className),
                Nil)
          } else {
            js.New(encodeClassVar(className), Nil)
          }
        }
      }

      val initBlock = semantics.moduleInit match {
        case CheckedBehavior.Unchecked =>
          js.If(!(moduleInstanceVar), assignModule, js.Skip())
        case CheckedBehavior.Compliant =>
          js.If(moduleInstanceVar === js.Undefined(),
            js.Block(
                moduleInstanceVar := js.Null(),
                assignModule
            ),
            js.Skip())
        case CheckedBehavior.Fatal =>
          js.If(moduleInstanceVar === js.Undefined(), {
            js.Block(
                moduleInstanceVar := js.Null(),
                assignModule
            )
          }, js.If(moduleInstanceVar === js.Null(), {
            // throw new UndefinedBehaviorError(
            //     "Initializer of $className called before completion of its" +
            //     "super constructor")
            val decodedName = Definitions.decodeClassName(className).stripSuffix("$")
            val msg = s"Initializer of $decodedName called before completion " +
              "of its super constructor"
            val obj = js.New(encodeClassVar("sjsr_UndefinedBehaviorError"), Nil)
            val ctor = obj DOT js.Ident("init___T")
            js.Throw(js.Apply(ctor, js.StringLiteral(msg) :: Nil))
          }, js.Skip()))
      }

      val body = js.Block(initBlock, js.Return(moduleInstanceVar))

      envFunctionDef("m", className, Nil, body)
    }

    js.Block(createModuleInstanceField, createAccessor)
  }

  def genExportedMembers(tree: LinkedClass)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {
    val exportsWithGlobals = tree.exportedMembers map { member =>
      member.value match {
        case MethodDef(flags, StringLiteral("constructor"), _, _, _)
            if flags.namespace == MemberNamespace.Public && tree.kind.isJSClass =>
          WithGlobals(js.Skip()(member.value.pos))
        case m: MethodDef =>
          genMethod(tree.encodedName, m)
        case p: PropertyDef =>
          genProperty(tree.encodedName, p)
        case tree =>
          throw new AssertionError(
              "Illegal exportedMember " + tree.getClass.getName)
      }
    }

    for (exports <- WithGlobals.list(exportsWithGlobals))
      yield js.Block(exports)(tree.pos)
  }

  def genTopLevelExports(tree: LinkedClass)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[List[js.Tree]] = {
    val exportsWithGlobals = tree.topLevelExports.map { versionedTopLevelExport =>
      val topLevelExport = versionedTopLevelExport.value
      implicit val pos = topLevelExport.pos

      topLevelExport match {
        case TopLevelJSClassExportDef(exportName) =>
          genConstValueExportDef(
              exportName, genNonNativeJSClassConstructor(tree.name.name))
        case TopLevelModuleExportDef(exportName) =>
          genConstValueExportDef(exportName, genLoadModule(tree.name.name))
        case e: TopLevelMethodExportDef =>
          genTopLevelMethodExportDef(tree, e)
        case e: TopLevelFieldExportDef =>
          genTopLevelFieldExportDef(tree, e)
      }
    }

    WithGlobals.list(exportsWithGlobals)
  }

  private def genTopLevelMethodExportDef(cd: LinkedClass,
      tree: TopLevelMethodExportDef)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {
    import TreeDSL._

    val MethodDef(flags, StringLiteral(exportName), args, resultType, Some(body)) =
      tree.methodDef

    assert(flags.namespace == MemberNamespace.PublicStatic, exportName)

    implicit val pos = tree.pos

    val methodDefWithGlobals = desugarToFunction(cd.encodedName, args, body,
        resultType)

    methodDefWithGlobals.flatMap { methodDef =>
      genConstValueExportDef(exportName, methodDef)
    }
  }

  private def genConstValueExportDef(exportName: String,
      exportedValue: js.Tree)(
      implicit pos: Position): WithGlobals[js.Tree] = {
    moduleKind match {
      case ModuleKind.NoModule =>
        genAssignToNoModuleExportVar(exportName, exportedValue)

      case ModuleKind.ESModule =>
        val field = envField("e", exportName)
        val let = js.Let(field.ident, mutable = true, Some(exportedValue))
        val export = js.Export((field.ident -> js.ExportName(exportName)) :: Nil)
        WithGlobals(js.Block(let, export))

      case ModuleKind.CommonJSModule =>
        val exportsVarRef = js.VarRef(js.Ident("exports"))
        WithGlobals(js.Assign(
            genBracketSelect(exportsVarRef, js.StringLiteral(exportName)),
            exportedValue))
    }
  }

  private def genAssignToNoModuleExportVar(exportName: String, rhs: js.Tree)(
      implicit pos: Position): WithGlobals[js.Tree] = {
    val dangerousGlobalRefs: Set[String] =
      if (GlobalRefUtils.isDangerousGlobalRef(exportName)) Set(exportName)
      else Set.empty
    WithGlobals(
        js.Assign(js.VarRef(js.Ident(exportName)), rhs),
        dangerousGlobalRefs)
  }

  private def genTopLevelFieldExportDef(cd: LinkedClass,
      tree: TopLevelFieldExportDef)(
      implicit globalKnowledge: GlobalKnowledge): WithGlobals[js.Tree] = {
    import TreeDSL._

    val TopLevelFieldExportDef(exportName, field) = tree

    implicit val pos = tree.pos

    moduleKind match {
      case ModuleKind.NoModule =>
        /* Initial value of the export. Updates are taken care of explicitly
         * when we assign to the static field.
         */
        genAssignToNoModuleExportVar(exportName,
            genSelectStatic(cd.encodedName, field))

      case ModuleKind.ESModule =>
        val staticVarIdent = genSelectStatic(cd.encodedName, field).ident
        WithGlobals(
            js.Export((staticVarIdent -> js.ExportName(exportName)) :: Nil))

      case ModuleKind.CommonJSModule =>
        // defineProperty method
        val defProp =
          genIdentBracketSelect(js.VarRef(js.Ident("Object")), "defineProperty")

        val exportsVarRef = js.VarRef(js.Ident("exports"))

        // optional getter definition
        val getterDef = {
          js.StringLiteral("get") -> js.Function(arrow = false, Nil, {
            js.Return(genSelectStatic(cd.encodedName, field))
          })
        }

        // Options passed to the defineProperty method
        val descriptor = js.ObjectConstr(
            getterDef ::
            (js.StringLiteral("configurable") -> js.BooleanLiteral(true)) ::
            Nil
        )

        WithGlobals(js.Apply(defProp,
            exportsVarRef :: js.StringLiteral(exportName) :: descriptor :: Nil))
    }
  }

  // Helpers

  private def envFunctionDef(field: String, subField: String,
      args: List[js.ParamDef], body: js.Tree, origName: Option[String] = None)(
      implicit pos: Position): js.FunctionDef = {

    val globalVar = envField(field, subField, origName)
    val globalVarIdent = globalVar.ident
    js.FunctionDef(globalVarIdent, args, body)
  }

  private def envFieldDef(field: String, subField: String, value: js.Tree,
      origName: Option[String] = None, mutable: Boolean = false,
      keepFunctionExpression: Boolean = false)(
      implicit pos: Position): js.Tree = {
    val globalVar = envField(field, subField, origName)
    val globalVarIdent = globalVar.ident

    if (esFeatures.useECMAScript2015) {
      genLet(globalVarIdent, mutable, value)
    } else {
      value match {
        case js.Function(false, args, body) =>
          // Make sure the function has a meaningful `name` property
          val functionExpr = js.FunctionDef(globalVarIdent, args, body)
          if (keepFunctionExpression)
            js.VarDef(globalVarIdent, Some(functionExpr))
          else
            functionExpr
        case _ =>
          js.VarDef(globalVarIdent, Some(value))
      }
    }
  }

  /** Gen JS code for an [[ModuleInitializer]]. */
  def genModuleInitializer(moduleInitializer: ModuleInitializer): js.Tree = {
    import TreeDSL._
    import Definitions.BoxedStringClass

    implicit val pos = Position.NoPosition

    moduleInitializer match {
      case ModuleInitializer.VoidMainMethod(moduleClassName, mainMethodName) =>
        js.Apply(genLoadModule(moduleClassName) DOT mainMethodName, Nil)

      case ModuleInitializer.MainMethodWithArgs(moduleClassName, mainMethodName,
          args) =>
        val stringArrayTypeRef = ArrayTypeRef(BoxedStringClass, 1)
        js.Apply(genLoadModule(moduleClassName) DOT mainMethodName,
            genArrayValue(stringArrayTypeRef, args.map(js.StringLiteral(_))) :: Nil)
    }
  }

}

private[emitter] object ClassEmitter {
  // TODO We should compute all of those from the Class Hierarchy

  private val CharSequenceClass = "jl_CharSequence"
  private val SerializableClass = "Ljava_io_Serializable"
  private val ComparableClass = "jl_Comparable"
  private val NumberClass = "jl_Number"

  private val NonObjectAncestorsOfStringClass =
    Set(CharSequenceClass, ComparableClass, SerializableClass)
  private val NonObjectAncestorsOfBoxedCharacterClass =
    Set(ComparableClass, SerializableClass)
  private val NonObjectAncestorsOfHijackedNumberClasses =
    Set(NumberClass, ComparableClass, SerializableClass)
  private val NonObjectAncestorsOfBoxedBooleanClass =
    Set(ComparableClass, SerializableClass)

  private[emitter] val AncestorsOfHijackedClasses = Set(
      Definitions.ObjectClass,
      CharSequenceClass,
      SerializableClass,
      ComparableClass,
      NumberClass
  )

  private val ClassesWhoseDataReferToTheirInstanceTests =
    AncestorsOfHijackedClasses + Definitions.BoxedStringClass

  private final val ThrowableClass = "jl_Throwable"

  def shouldExtendJSError(linkedClass: LinkedClass): Boolean = {
    linkedClass.name.name == ThrowableClass &&
    linkedClass.superClass.exists(_.name == Definitions.ObjectClass)
  }
}


Using APKPure App to upgrade Running Wallpapers, fast, free and save your internet data.
Looking for fantastic running photographs to decorate your tablet or phone's home screen or lock screen as background images or wallpaper.
These great photos will inspire you to run and keep up your favorite sport.
We have created a virtual tour of running. You can save these remarkable photos as wallpaper on your mobile device.
We have some beautiful photographs of the exciting sport of running that everyone will love.
You can save these photos or crop them and place them as background wallpaper onto your mobile device.


Together with our new website Tugun Theatre have decided to rebrand our logo. Our new logo was designed by the talented Lachlan Mitcherson of Trademark Creatives. Our previous yellow and red logo has gotten us through 45 successful years of bringing plays and musicals to the local Tugun community. Here's to another successful 45 (and more) years with our brand new logo!


text:
Transcription regulation of restriction-modification system Esp1396I
Ekaterina Bogdanova, Marina Zakharova, Simon Streeter, James Taylor, Tomasz Heyduk, Geoff Kneale, Konstantin Severinov
Waksman Inst of Microbiology
Inst Quantitative Biomedicine
The convergently transcribed restriction (R) and methylase (M) genes of the Restriction-Modification system Esp1396I are tightly regulated by a controller (C) protein that forms part of the CR operon. We have mapped the transcriptional start sites from each promoter and examined the regulatory role of C.Esp1396I in vivo and in vitro. C-protein binding at the CR and M promoters was analyzed by DNA footprinting and a range of biophysical techniques. The distal and proximal C-protein binding sites at the CR promoter are responsible for activation and repression, respectively. In contrast, a C-protein dimer binds to a single site at the M-promoter to repress the gene, with an affinity much greater than for the CR promoter. Thus, during establishment of the system in a naïve host, the activity of the M promoter is turned off early, preventing excessive synthesis of methylase. Mutational analysis of promoter binding sites reveals that the tetranucleotide inverted repeats long believed to be important for C-protein binding to DNA are less significant than previously thought. Instead, symmetry-related elements outside of these repeats appear to be critical for the interaction and are discussed in terms of the recent crystal structure of C.Esp139I bound to the CR promoter.
https://doi.org/10.1093/nar/gkp210
10.1093/nar/gkp210
Dive into the research topics of 'Transcription regulation of restriction-modification system Esp1396I'. Together they form a unique fingerprint.
DNA Restriction-Modification Enzymes Medicine & Life Sciences 100%
Protein Binding Medicine & Life Sciences 62%
DNA Footprinting Medicine & Life Sciences 54%
Binding Sites Medicine & Life Sciences 48%
DNA-Binding Proteins Medicine & Life Sciences 35%
Operon Medicine & Life Sciences 34%
Microsatellite Repeats Medicine & Life Sciences 33%
Bogdanova, E., Zakharova, M., Streeter, S., Taylor, J., Heyduk, T., Kneale, G., & Severinov, K. (2009). Transcription regulation of restriction-modification system Esp1396I. Nucleic acids research, 37(10), 3354-3366. https://doi.org/10.1093/nar/gkp210
Bogdanova, Ekaterina ; Zakharova, Marina ; Streeter, Simon ; Taylor, James ; Heyduk, Tomasz ; Kneale, Geoff ; Severinov, Konstantin. / Transcription regulation of restriction-modification system Esp1396I. In: Nucleic acids research. 2009 ; Vol. 37, No. 10. pp. 3354-3366.
@article{3a1de1f51ff6430d895293ed7fb87a29,
title = "Transcription regulation of restriction-modification system Esp1396I",
abstract = "The convergently transcribed restriction (R) and methylase (M) genes of the Restriction-Modification system Esp1396I are tightly regulated by a controller (C) protein that forms part of the CR operon. We have mapped the transcriptional start sites from each promoter and examined the regulatory role of C.Esp1396I in vivo and in vitro. C-protein binding at the CR and M promoters was analyzed by DNA footprinting and a range of biophysical techniques. The distal and proximal C-protein binding sites at the CR promoter are responsible for activation and repression, respectively. In contrast, a C-protein dimer binds to a single site at the M-promoter to repress the gene, with an affinity much greater than for the CR promoter. Thus, during establishment of the system in a na{\"i}ve host, the activity of the M promoter is turned off early, preventing excessive synthesis of methylase. Mutational analysis of promoter binding sites reveals that the tetranucleotide inverted repeats long believed to be important for C-protein binding to DNA are less significant than previously thought. Instead, symmetry-related elements outside of these repeats appear to be critical for the interaction and are discussed in terms of the recent crystal structure of C.Esp139I bound to the CR promoter.",
author = "Ekaterina Bogdanova and Marina Zakharova and Simon Streeter and James Taylor and Tomasz Heyduk and Geoff Kneale and Konstantin Severinov",
note = "Funding Information: National Institutes of Health (RO1 grant GM59295); National Institutes of Health (FIRCA research grant R03 TW07145); Presidium of Russian Academy of Sciences Molecular and Cellular Biology Program grant (to K.S.) in part. Charles and Johanna Busch Foundation postdoctoral fellowship (to E.B.) in part. BBSRC (BB/E000878/1 to G.K.). Funding for open access charge: National Institutes of Health (grant GM59295 to KS).",
doi = "10.1093/nar/gkp210",
journal = "Nucleic Acids Research",
Bogdanova, E, Zakharova, M, Streeter, S, Taylor, J, Heyduk, T, Kneale, G & Severinov, K 2009, 'Transcription regulation of restriction-modification system Esp1396I', Nucleic acids research, vol. 37, no. 10, pp. 3354-3366. https://doi.org/10.1093/nar/gkp210
Transcription regulation of restriction-modification system Esp1396I. / Bogdanova, Ekaterina; Zakharova, Marina; Streeter, Simon; Taylor, James; Heyduk, Tomasz; Kneale, Geoff; Severinov, Konstantin.
In: Nucleic acids research, Vol. 37, No. 10, 2009, p. 3354-3366.
T1 - Transcription regulation of restriction-modification system Esp1396I
AU - Bogdanova, Ekaterina
AU - Zakharova, Marina
AU - Streeter, Simon
AU - Taylor, James
AU - Heyduk, Tomasz
AU - Kneale, Geoff
AU - Severinov, Konstantin
N1 - Funding Information: National Institutes of Health (RO1 grant GM59295); National Institutes of Health (FIRCA research grant R03 TW07145); Presidium of Russian Academy of Sciences Molecular and Cellular Biology Program grant (to K.S.) in part. Charles and Johanna Busch Foundation postdoctoral fellowship (to E.B.) in part. BBSRC (BB/E000878/1 to G.K.). Funding for open access charge: National Institutes of Health (grant GM59295 to KS).
N2 - The convergently transcribed restriction (R) and methylase (M) genes of the Restriction-Modification system Esp1396I are tightly regulated by a controller (C) protein that forms part of the CR operon. We have mapped the transcriptional start sites from each promoter and examined the regulatory role of C.Esp1396I in vivo and in vitro. C-protein binding at the CR and M promoters was analyzed by DNA footprinting and a range of biophysical techniques. The distal and proximal C-protein binding sites at the CR promoter are responsible for activation and repression, respectively. In contrast, a C-protein dimer binds to a single site at the M-promoter to repress the gene, with an affinity much greater than for the CR promoter. Thus, during establishment of the system in a naïve host, the activity of the M promoter is turned off early, preventing excessive synthesis of methylase. Mutational analysis of promoter binding sites reveals that the tetranucleotide inverted repeats long believed to be important for C-protein binding to DNA are less significant than previously thought. Instead, symmetry-related elements outside of these repeats appear to be critical for the interaction and are discussed in terms of the recent crystal structure of C.Esp139I bound to the CR promoter.
AB - The convergently transcribed restriction (R) and methylase (M) genes of the Restriction-Modification system Esp1396I are tightly regulated by a controller (C) protein that forms part of the CR operon. We have mapped the transcriptional start sites from each promoter and examined the regulatory role of C.Esp1396I in vivo and in vitro. C-protein binding at the CR and M promoters was analyzed by DNA footprinting and a range of biophysical techniques. The distal and proximal C-protein binding sites at the CR promoter are responsible for activation and repression, respectively. In contrast, a C-protein dimer binds to a single site at the M-promoter to repress the gene, with an affinity much greater than for the CR promoter. Thus, during establishment of the system in a naïve host, the activity of the M promoter is turned off early, preventing excessive synthesis of methylase. Mutational analysis of promoter binding sites reveals that the tetranucleotide inverted repeats long believed to be important for C-protein binding to DNA are less significant than previously thought. Instead, symmetry-related elements outside of these repeats appear to be critical for the interaction and are discussed in terms of the recent crystal structure of C.Esp139I bound to the CR promoter.
U2 - 10.1093/nar/gkp210
DO - 10.1093/nar/gkp210
JO - Nucleic Acids Research
JF - Nucleic Acids Research
Bogdanova E, Zakharova M, Streeter S, Taylor J, Heyduk T, Kneale G et al. Transcription regulation of restriction-modification system Esp1396I. Nucleic acids research. 2009;37(10):3354-3366. https://doi.org/10.1093/nar/gkp210

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: Directly writing to stdout of different process Is it possible to write directly to stdout of another process?
We have two separated processes A and B.
Process B should write to its stdout information from process A. I was looking into that and found the pipes... but the problem is that i don't really like the need to write from A and read from B at the same time (amount of information can be very big and pipes by itself are limited by system?) mostly because it can be too complex. And maybe it could be easier to write into file from A and then print this file into stdout from B...
UPDATE:
Process A is expected to be running constantly starting from system start-up(Unix)
Process B is expected to be executed from console and get information from process A.
Communication between processes are easy to implement in our environment. But since amount of information can be very big i wanted to make high-efficient way to get infromation from A to stdout of B

A: You may send STDOUT file descriptor (1) from B to A over UNIX domain socket connection.
You can do it manually. Or you can use portable library.
In either case process A will receive file STDOUT descriptor of B. Then A can write() to it.

redpajama_set_name: RedPajamaStackExchange


Our First Lady of Edna's Edibles seeks herbal assistance with a feminine problem. The conversation lends itself to a revelation or two from Debra. Valentine's Day makes it's mark on Debra's drug store crush. Listen to this episode for a surprise ending to this call! The NSA has nothing on Debra's sneaky abilities.
The loss from the death of Debra's dog a few years ago finds it's way back into her life when the stuffing of her deceased canine pops out. She calls through tears to seek help from an expert.
Debra makes a nervous call to her favorite Chinese place because, once again, she has lost an important heirloom. Unfortunately for The both of them, the language barrier causes a few issues.
Debra's life-long strange addiction comes to the surface for all to see. She can't take anymore so she calls for guidance. Tune in to find out her secrets!
COD28-Little Debbie Little Justin Bieber!


Vilas Light Charcoal 6-drawer Dresser. This Bedroom Furniture Features A Solid And Durable Wood Construction. Each Drawer Offers Ample Space For All Of Your Clothing Or Other Bedding And Linen. Tie The Decor Of Your Room Together With This Piece.


text:
Home Technology Samsung ready to work with telcos for secure 5G roll out in...
Samsung ready to work with telcos for secure 5G roll out in India
By Md Waquar Haider
Seoul– With India readying itself for 5G roll out, South Korean tech giant Samsung on Monday said providing secure network is the priority for them, expressing hope of working with various telecom operators to soon launch the fifth-generation cellular network technology in the country.
The Indian market is expected to give Samsung a big opportunity to improve its 5G presence. Samsung said it would be launching 5G in India once telecom operators are ready to work with the company.
"The company is working over the past 10 years on development of the 5G and the main focus is on how to provide secure and efficient network and for the same we are working with different carriers, network providers of various countries across the world," June Hee Lee, Senior Vice President and Head of Technology Strategy Team, Samsung Electronics, told IANS.
Samsung has 5G network in US as well as in South Korea in both millimetre wave and sub six-GHz spectrum.
The company launched the world's first 5G smartphone, the Galaxy S10 5G, in early April and has promoted its 5G solutions that can be used in a host of new businesses, including self-driving vehicles, smart factories and Internet of Things.
"The price of a device depends upon the price of components, there are various reasons behind the pricing of 5G devices. The firm is focused on rolling out 5G right now and in future we would work for availability of the quality product in the market with the advancement of technology," informed Lee.
5G is the fifth-generation cellular network technology, which can boast speeds up to 20 times faster than your current 4G LTE cell phone and has latency as little as one millisecond.
"The availability of 5G is focused on two main principles — the first one is amount of data and second one is the speed. Therefore, it becomes very important to provide both of them in a proper manner," Lee added.
With speeds up to roughly 20 times faster than 4G networks, consumers on a 5G network can download a full season of a TV show in minutes, play graphics-rich cloud games, stream 4K video with virtually no lag and enjoy enhanced virtual reality (VR) and augmented reality (AR) experiences.
In addition, 5G could unite more than one million devices per square km, transforming how consumers live, communicate and work by connecting not only smartphones but vehicles, factories, offices and cities as well. (IANS)
Previous articleTata Tele mobile biz merges with Airtel from July 1
Next articleICC partnership has been phenomenal for us: GoDaddy
Facebook sues 2 developers for scraping users' data
Amazon Ring's Neighbors app leaked users' data: Report
Microsoft increases OneDrive file size limit to 250GB
Safety rests on both Uber and riders: Top executive
Free wifi services launched at 74 UP bus stations
Equities record mega intra-day gain in 2 years
Father-son arrested for routing international VOIP calls illegally
IndUS Business Journal - September 17, 2016
Boston Entrepreneur Al Kapoor Moves Companies to Optics Cluster in Rochester, NY
IndUS Business Journal - March 1, 2017


text:
An unnecessary operation or two
Mrs R, aged 40, was referred to consultant general surgeon, Mr P, complaining of long-standing abdominal pain, abdominal distension and severe hiccups. Mr P performed an upper gastrointestinal endoscopy and found a small sliding hiatus hernia, but no oesophagitis. Mrs R had already been treated with proton pump inhibitors by her GP, but had experienced no improvement in her symptoms.
According to the medical notes, Mrs R was keen to consider surgical treatment of her hiatus hernia. Mr P subsequently undertook a laparotomy and Nissen fundoplication. A naso-gastric (NG) tube was inserted at the time of surgery, but this was removed during the early postoperative period as it was not tolerated. Mrs R made an otherwise uneventful recovery and was discharged home symptom-free. A few months later Mrs R experienced a recurrence of her symptoms and saw Mr P again.
A barium swallow demonstrated a recurrence of the hiatus hernia. A new operation was discussed. Mrs R was agreeable, but warned Mr P that she did not want an NG tube whatever the circumstances. Mr P agreed, and a further laparotomy and revision Nissen fundoplication was carried out. Mrs R experienced abdominal distension post-operatively, but refused an NG tube.
Following discharge, the patient complained of epigastric pain and difficulty in swallowing. A chest x-ray revealed a large irreducible hiatus hernia. Eventually, Mrs R required further major thoraco-abdominal surgery for correction of a large hiatus hernia and subsequently made a complaint against Mr P.
Experts agreed that the first operation was not indicated. The patient's symptoms were not classical of gastro-oesophageal reflux (GORD) and the finding of a small hiatus hernia at the time of endoscopy did not require surgical intervention. The lack of any response to protein pump inhibitors and the absence of any oesophagitis should have prompted further investigation in the form of oesophageal manometry and 24-hour pH monitoring.
Questions were also raised about the reasons for performing an open operation (via a laparotomy) when minimally invasive (laparoscopic) Nissen fundoplication can be carried out with decreased morbidity, shorter hospital stay and faster return to normal activities. There was also criticism regarding the consent for both the first and second operations, specifically relating to the documentation of the risks of surgery and the long-term results.
Experts were in agreement that primary and revisional anti-reflux surgery are complex procedures which should only be undertaken by appropriately specialised and experienced upper GI surgeons. Although NG tubes are not routinely required, all upper GI procedures carry the risk that they might be required. Patients should be counselled accordingly. The claim was settled for a moderate sum.
Most common elective procedures have a requisite list of appropriate pre-operative tests (often supported by guidelines from learned societies). Preoperative oesophageal physiology investigation can confirm or refute GORD and help identify patients unsuitable for surgery.
It is imperative to ensure that there are clear indications for surgery before proceeding.
The options for medical versus surgical management of their problem must be discussed with patients.
All discussions regarding treatment options must be recorded, including any differences of opinion. In this particular case, it was unclear how much pressure the patient had put on the surgeon to perform the first operation.
If an operation may require a particular intervention, eg, an NG tube, it needs to be made clear to the patient that this is a possibility.
Show oldest on top Show newest on top Leave a comment


text:
Renesas Moves to Acquire Intersil
By Chris Lange	September 13, 2016 11:10 am EDT
Shares of Intersil Corp. (NASDAQ: ISIL) saw a handy gain on Tuesday after Japanese chip maker Renesas Electronics announced that it will acquire the company for roughly $3.2 billion. This breaks down to $22.50 per share.
The transaction was unanimously approved by both boards of directors, and it is expected to close in the first half of 2017. Although, it is still subject to shareholder and regulatory approval.
Renesas anticipates near-term and long-term revenue expansion opportunities, combined with the modest anticipated cost efficiencies associated with greater scale, eventually will generate synergies of $170 million. Ultimately, the transaction is expected to immediately increase both gross and operating margins and be accretive to Renesas's earnings and free cash flows after closing.
Bunsei Kure, representative director, president and chief executive of Renesas, commented:
Renesas is accelerating its focus of resources in automotive, industrial, infrastructure, and the rapidly growing IoT segments to aggressively grow its global business and maintain its position as a leading provider. Intersil's extensive portfolio of analog and power devices as well as its strength in the automotive, industrial, and broad-based segments complement many of Renesas' initiatives in these areas. We believe that this compelling and complementary combination will bring significant synergies and cross selling opportunities as well as a system solution proposition which will pave the way for Renesas to strengthen its position as a leader in the global semiconductor market while delivering value to its customers with a unique product offering.
Excluding Tuesday's move, Intersil has outperformed the broad markets, with the stock up nearly 60% year to date. Over the past 52 weeks, the stock has nearly doubled up 95%.
Intersil shares hit a new 52-week high of $21.85 Tuesday morning. The consensus analyst price target is $16.78, and the 52-week low is $10.67.
By Chris Lange
« Freeport-McMoRan, Anadarko in $2 Billion Offshore Deal
Why iPhone 7 Orders Are Soaring at T-Mobile and Sprint »
Read more: Technology, Mergers and Acquisitions, semiconductors, Intersil Corp (NASDAQ:ISIL)


The search you have just made resulted in the the following items on Ebay and other online vendors. Ebay has a huge selection at cheap prices. Many unique items are for sale at rock bottom prices. We are listing the results for you below. Scroll to the bottom of this page to find items from different online merchants.


I am a teacher and the walls of my classroom are cinderblock that have been painted with Semi-Gloss latex paint. I would like to paint a design on my wall (a big tree) but do not know what paint to use. I am not able to sand or prime the wall first since I will just be painting a design over the existing paint and not repainting the whole wall. Any suggestions would be greatly appreciated!
You'll need to make sure that the wall you will paint is first clean so that any paint can successfully go over it. Using products like TSP (Trisodium Phosphate) is an effective and safe way to prepare the wall for whatever top coat will go over it.
Since you can't sand the wall, I still recommend you placing an oil or shellac-based primer over it. Without it, the new paint will not bond correctly, and can easily peel and fail within a short amount of time.
Luckily, primer comes in small sizes (like quarts) and can dry within 1 hour so your new top coat can go over it. I HIGHLY recommend you do not skip this step, as peeled paint will not only look unsightly, but can and will lead to bigger problems further down the road.
As for a top coat of paint, using Behr's Marquee line of coatings in semi-gloss form have enough durability to withstand kid's handprints and not too shiny to show every brush or roller mark. They come in sizes as small as 8 ounce testers, which can make them great for projects like this.
Let us know if you have any further questions regarding your project, and if possible, upload an image of your finished design! We would love to see it here!


After all possible ways of controlling the noise at the source are tried, the next defense is to set up devices in the transmission path to block or reduce the flow of sound energy. This noise control can be done in several ways: (a) absorbing the sound along the path, (b) deflecting the sound in some other direction by placing a reflecting barrier in its path, or (c) containing the sound by placing the source inside a sound-insulating box or enclosure.
Selection of the most effective technique depends upon various factors, such as the size and type of source, the intensity and frequency range of the noise, and the nature and type of environment.


The Artist's Mentorship programme is designed to support the development of Leitrim based emerging and established professional artists from any arts discipline who have identified particular gaps in their knowledge and expertise. The programme achieves this by providing funding to a leading professional to help the applicant make the next steps in their development.
Leitrim County Council is currently seeking interest from artists interested in taking part in SPARK, a 6-month artist-in-residence programme which this year will be based in Merenda, a company in Manorhamilton that produces wood veneer products for clients worldwide.
SPARK is a partnership project of Leitrim County Council's Arts Office and Local Enterprise Office and is supported by the Arts Council. It is aimed at artists who are interested in working in new environments and companies who are interested in collaborating with artists and promoting creativity within their organisations.
Artists wishing to apply for Spark should email ckelly@leitrimcoco.ie to declare their interest in the programme before Monday 13th May. Interested artists will then be invited to a site visit where they will have the opportunity to meet with management and staff, leading to a better understanding of the programme and the company before submitting a proposal towards the end of June. The residency takes place over 35 days between July and December.
The Creative Ireland Open Call is a countywide open call to everyone involved in the culture and creative sectors to develop high quality projects and programmes that enable groups and individuals to explore their creativity and develop and encourage greater access, knowledge and appreciation of the arts, culture and heritage. We particularly welcome project proposals that involve groups that have had little or no previous involvement in creative projects for any reason such as economic, geographic, or just having lacked awareness or opportunity. In such instances we will endeavour to give whatever advice and assistance we can to ensure your project can achieve the best possible experience for everyone involved. In order to help applicants, a series of three public meetings are being held to provide advice and assistance to help ensure projects being planned can achieve the best possible experience for everyone involved. Whether you are a member of a community or youth group interested in developing a project, or a practicioner who would like to work with a group, these meetings will be of interest to you.
Do you have an idea for Culture Night?
Culture Night is an annual all-island public event that celebrates culture, creativity and the arts. This year, it will take place on Friday 20th September 2019. On Culture Night, arts and cultural organisations and venues of all shapes and sizes extend their opening hours and organise special and unique events and workshops which are available to the public free of charge.
Culture Night is particularly suited to venues seeking to encourage new patrons and organisations such as choirs, theatre companies or book clubs who might like to host an open night with novel or exciting activities designed to enlist new members. So if you are interested in organising or hosting a Culture Night event we would like to hear from you.
Cruinniú na nÓg 2019 - the national day of creativity for children and young people - will take place on Saturday 15th June this year. The model is similar to Culture Night except that events are held during the day, making them much more accessible to children and young people. Events will take place all over the county so see what's happening and plan your day. While all events are free. numbers are limited for most events soadvance booking will be neccessary.
2019 filmmakers bursaries - call for applications.
Sligo, Leitrim and Roscommon County Councils work together with filmmakers from the three counties to enable the film sector here to grow and develop. Each of the three local authorities involved in this project recognise the value of film as an artform and the contribution that film can make to the region - socially, culturally and economically. In adopting a regional approach, we recognise that we can achieve a lot more by harnessing the capacity, resources and energy of agencies and practitioners of all three counties. As part of that, for 2019, we are providing two bursary programmes for filmmakers based in Sligo, Leitrim or Roscommon.


Dissolve the contents of one stick pack in 1–2 oz pure water and consume one to three times daily, or take as directed by your healthcare practitioner.
Consult your healthcare practitioner prior to use, especially if you have severe immune suppression. Individuals taking antifungal or other medication should discuss potential interactions with their healthcare practitioner. Do not use if stick pack is damaged.
To protect the bacteria from light and moisture, each flavoring- and sweetener-free serving of ProbioMax 350 DF comes in an opaque, foil-lined stick pack.
Dissolve the contents of one stick pack (350 billion CFU‡)†† into 2-4 oz of pure water and consume once daily, or take as directed by your healthcare practitioner.
Consult your healthcare practitioner prior to use. Individuals taking medication should discuss potential interactions with their healthcare practitioner. Do not use if stick pack is damaged.
Wheat, gluten, soy, animal or dairy products, fish, shellfish, peanuts, tree nuts, egg, artificial colors, artificial sweeteners, or artificial preservatives.
Potato maltodextrin, calcium silicate, and magnesium stearate.
HOWARU®, FLORAFIT® and the HOWARU® logo are registered trademarks of DuPont or its affiliates.
HN001® and HN019® are registered trademarks of Fonterra™Limited and are licensed to DuPont Nutrition Biosciences.
Take two capsules twice daily with cold water, or as directed by your healthcare practitioner.
Consult your healthcare practitioner prior to use. Individuals taking medication should discuss potential interactions with their healthcare practitioner, and individuals with egg allergies should not consume this product. Do not use if tamper seal is damaged.
HPMC (capsule), medium-chain triglyceride oil, silica, dicalcium phosphate, and sweet potato maltodextrin.
IgY Max™ is a trademark of IgY Nutrition, LLC and is used under license.
LactoSpore® is a registered trademark of Sabinsa Corp.
Take one capsule daily, or as directed by your healthcare practitioner. Consult your healthcare practitioner prior to use. Individuals taking medication should discuss potential interactions with their healthcare practitioner.
Capsule (hypromellose, gellan gum, and water), microcrystalline cellulose, hydroxypropyl cellulose, ascorbyl palmitate, and silica.
Microcrystalline cellulose, acid-resistant capsule (hypromellose, gellan gum, and water), ascorbyl palmitate, and silica.
Potato maltodextrin, acid-resistant capsule (hypromellose, gellan gum, and water), hydroxypropyl cellulose, magnesium stearate, and calcium silicate.
HN001® and HN019® are registered trademarks of Fonterra™ Limited and are licensed to DuPont Nutrition Biosciences.
Toddlers 12 months through 3 years: 2 scoops, or take as directed by your healthcare practitioner. Mix thoroughly with food or liquid; do not mix with hot food or hot liquids.
Wheat, gluten, soy, fish, shellfish, peanuts, tree nuts, egg, ingredients derived from genetically modified organisms (GMOs), artificial colors, artificial sweeteners, or artificial preservatives.
HN001® is a registered trademark of Fonterra™ Limited and is licensed to DuPont Nutrition Biosciences.
†Percent Daily Values are based on a 1,000 calorie diet.


text:
Q: Возможно ли стилизовать картинку загруженную через свойства content в css Slick slider использую для сайта.
У него есть свои базовые кнопки изменить слайд влево или вправо вот стили для кнопки
.slick-prev,
.slick-next {
    position: absolute;
    font: normal normal normal 22px/0 FontAwesome;
    top: 50%;
    width: 1.5em;
    height: 1.5em;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.2);
    color: transparent;
    transition: all 0.3s ease;
}

я загрузил свою картинку в CSS используя content но не могу его стилизовать.
Возможно ли стилизовать картинку который я загружаю через content в css?
Вот тут
.slick-prev:before {
    content: url("https://cdn2.iconfinder.com/data/icons/arrows-line-1/100/v_arrow_left-right-512.png");
}

Хочу отменить эти кнопки и положить свои картину вместо скучных кнопок

/*Slider function [It is recommended to place a function in a separate JS file, such as "functions.js"]*/
function myCoolSlider() {
        $('#featured-content').slick({
            dots: true,
            infinite: true,
            speed: 300,
            slidesToShow: 3,
            slidesToScroll: 3,
            responsive: [{
                breakpoint: 1200,
                settings: {
                    slidesToShow: 3,
                    slidesToScroll: 3,
                    infinite: true,
                    dots: true
                }
            }, {
                breakpoint: 992,
                settings: {
                    slidesToShow: 3,
                    slidesToScroll: 3
                }
            }, {
                breakpoint: 768,
                settings: {
                    slidesToShow: 3,
                    slidesToScroll: 3
                }
            }, {
                breakpoint: 480,
                settings: {
                    slidesToShow: 2,
                    slidesToScroll: 2
                }
            }]
        });
    }
    /*End of Slider function*/

$(document).ready(function() {

/*Calling the function [It is recommended to call a function in a separate JS file, such as "scripts.js"]*/
    myCoolSlider();
/*.................End of call*/

});
.slick-prev,
.slick-next {
    position: absolute;
    font: normal normal normal 22px/0 FontAwesome;
    top: 50%;
    width: 1.5em;
    height: 1.5em;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.2);
    color: transparent;
    transition: all 0.3s ease;
}
.slick-prev:hover,
.slick-prev:focus,
.slick-next:hover,
.slick-next:focus {
    background-color: rgba(0, 0, 0, 0.8)
}

.slick-prev:before,
.slick-next:before {
    font-family: inherit;
    font-size: inherit;
    display: inline-block;
    opacity: 1;
    color: rgba(255, 255, 255, 0.8);
}

.slick-prev {
    left: 0;
}
.slick-prev:before {
    content: url("https://cdn2.iconfinder.com/data/icons/arrows-line-1/100/v_arrow_left-right-512.png");
}
.slick-next {
    right: 0;
}
.slick-next:before {
    content: '>'
}
/* Slick slider: Content */

.slick-slide a {
    position: relative;
    display: block;
    text-decoration: none;
}
.slick-slide h2 {
    font-size: 22px;
    font-weight: bold;
    margin: 0 auto;
    background-color: #fff;
    position: relative;
    overflow: hidden;
    color: #333;
    padding: 0.5em;
    width: 60%;
    margin-top: -7%;
}

/* Dots */

.slick-slider {
    margin-bottom: 30px;
}
.slick-dots {
    position: absolute;
    bottom: -45px;
    display: block;
    width: 100%;
    padding: 0;
    list-style: none;
    text-align: center;
}
.slick-dots li {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    margin: 0 5px;
    padding: 0;
    cursor: pointer;
}
.slick-dots li button {
    font-size: 0;
    line-height: 0;
    display: block;
    width: 20px;
    height: 20px;
    padding: 5px;
    cursor: pointer;
    color: transparent;
    border: 0;
    outline: none;
    background: transparent;
}

.slick-dots li button:hover,
.slick-dots li button:focus {
    outline: none;
}

.slick-dots li button:hover:before,
.slick-dots li button:focus:before {
    opacity: 1;
}

.slick-dots li button:before {
    font-family: 'slick';
    font-size: 6px;
    line-height: 20px;
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    content: '•';
    text-align: center;
    opacity: .25;
    color: black;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.slick-dots li.slick-active button:before {
    opacity: .75;
    color: black;
}

/* main -  */

.slider {
    height: 100%;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

figure {
    cursor: auto;
    display: flex !important;
    justify-content: center;
    padding: 1em 20px;
    margin: 0 !important;
}

.slick-prev {
    left: -60px;
}
.slick-next {
    right: -60px;
}
.slick-slide img {
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    border-radius: 50%;
}
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.slick/1.4.1/slick.css"/>

<link rel="stylesheet" type="text/css" href="css/style.css">

[#1]The greatest breakthroughs in gaming history of the past 25 years

Best game reboots

[#3]The greatest breakthroughs

[#4]The greatest breakthroughs

[#5]The greatest breakthroughs in gaming

[#6]The greatest breakthroughs in gaming history of

[#7]The greatest breakthroughs in gaming history of the past

[#8]The greatest breakthroughs in gaming history of the past 25 years

[#9]The greatest breakthroughs in gaming history of the past 25 years

A: button.slick-prev {
  border: 0;
  background: #fff url('arrow-left.png') 100% 100% no-repeat;
  background-size: cover;
  width: 100px;
  height: 100px;
}

button.slick-next {
  border: 0;
  background: #fff url('arrow-right.png') 100% 100% no-repeat;
  background-size: cover;
  width: 100px;
  height: 100px;
}

С позиционированием и изменением картинки думаю разберётесь, размеры указаны чтобы сработало background: 100% 100%, возможно есть более элегантное решение.
Увидел что надо через content а тут вот возник затык.


Stamos told ET that he's grateful for everything he's experienced in life and was ready to start a family.
The pair, who got hitched in February, announced in December that they were expecting their first child together. Stamos told ET that he was "not nervous at all" about having a baby.
"I'm not nervous about having a kid, I'm not nervous about having a kid with her," he said.


The Planning Forum, St. Stephen's College, brings to you the 11th Edition of St. Stephen's Model United Nations.
The St. Stephen's Model United Nations is a conference which is interactive, demanding and educational. With an interesting line-up of committees, combined with the qualified Executive Board, delegates will be introduced to relatively unexplored political, socio-economic and legal frameworks of governance.
The NITI Aayog is the premier policy 'Think Tank' of the Government of India, providing both directional and policy inputs, and relevant technical advice to the Centre and the States.
It acts as the quintessential platform to bring States to act together in national interest, and thereby fosters Cooperative Federalism. It is also developing itself as a state of the art Resource Centre, by promoting research and innovation, providing strategic policy vision, and dealing with contingent issues.
The UNDP works to fight poverty, reduction of inequalities and exclusion. It supports governments to develop policies, leadership skills, partnering abilities, institutional capabilities and build resilience. The UNDP focuses on building sustainable development, democratic governance as well as climate and disaster resilience.
The UNCEB is the longest-standing and highest-level coordination forum of the UN system. It comprises of 31 Executive Heads of the United Nations, in addition to specialized agencies, including the Bretton Woods Institutions (The World Bank and IMF), and related organizations – the WTO, the UNOPS and the IAEA.
It provides broad guidance, coordination and strategic direction to the system as a whole and focuses on inter-agency priorities and initiatives.
The UNHRC is an inter-governmental body responsible for strengthening the promotion and protection of human rights around the globe and for addressing situations of human rights violations and make recommendations on them. The UN-member States work together to find solutions and prevent them from coming into existence in the first place. The UNHRC also regards itself as the helper in need (by situations) or people threatening people and their rights.
The UNCSW is a functional commission of the United Nations Economic and Social Council (ECOSOC). The Commission was established for the purpose of preparing recommendations and annual reports in the field of promoting women's right in all aspects- including political, civil, social, educational etc. It can be defined as the principal global policy-making body dedicated exclusively to gender equality and advancement of women.
Agenda: Enhancing Socio-Political Participation of Women with Emphasis on Women Security.
For individual delegate registration, click here.
For double delegate registration, click here.
Lawctopus is happy to support this MUN as a media partner.


text:
Oakland Township is a township in Butler County, Pennsylvania, United States. The population was 2,987 at the 2010 census.

Geography
Oakland Township is located in east-central Butler County and contains the unincorporated communities of Woodbine, North Oakland, and Boydstown. Connoquenessing Creek flows through the northwestern part of the township, impounded as Lake Oneida for a portion of its course.

According to the United States Census Bureau, the township has a total area of , of which  is land and , or 1.37%, is water.

Demographics

As of the census of 2000, there were 3,074 people, 1,112 households, and 876 families living in the township.  The population density was 134.1 people per square mile (51.8/km2).  There were 1,168 housing units at an average density of 50.9/sq mi (19.7/km2).  The racial makeup of the township was 99.54% White, 0.10% African American, 0.16% Native American, 0.10% Asian, and 0.10% from two or more races. Hispanic or Latino of any race were 0.07% of the population.

There were 1,112 households, out of which 35.2% had children under the age of 18 living with them, 67.6% were married couples living together, 7.3% had a female householder with no husband present, and 21.2% were non-families. 18.4% of all households were made up of individuals, and 7.8% had someone living alone who was 65 years of age or older.  The average household size was 2.76 and the average family size was 3.15.

In the township the population was spread out, with 25.9% under the age of 18, 7.4% from 18 to 24, 30.1% from 25 to 44, 24.6% from 45 to 64, and 12.0% who were 65 years of age or older.  The median age was 38 years. For every 100 females there were 103.2 males.  For every 100 females age 18 and over, there were 97.4 males.

The median income for a household in the township was $41,025, and the median income for a family was $49,395. Males had a median income of $32,285 versus $22,854 for females. The per capita income for the township was $17,313.  About 6.9% of families and 6.0% of the population were below the poverty line, including 3.6% of those under age 18 and 19.2% of those age 65 or over.

References

External links
Oakland Township official website

Populated places established in 1798
Townships in Butler County, Pennsylvania

redpajama_set_name: RedPajamaWikipedia