IL
Namespace: Microsoft.FSharp.Compiler.AbstractIL
The "unlinked" view of .NET metadata and code. Central to to Abstract IL library
Nested types and modules
| Type | Description |
| ILAlignment | |
| ILArgConvention | |
| ILArrayBound | Array shapes. For most purposes, including verification, the rank is the only thing that matters. |
| ILArrayBounds | |
| ILArrayShape | |
| ILAssemblyLongevity | |
| ILAssemblyManifest | The main module of an assembly is a module plus some manifest information. |
| ILAssemblyRef | |
| ILAttribElem | |
| ILAttribute | Custom attributes. See 'decodeILAttribData' for a helper to parse the byte[] to ILAttribElem's as best as possible. |
| ILAttributeNamedArg | Named args: values and flags indicating if they are fields or properties. |
| ILAttributes | |
| ILBasicType | |
| ILBoxity | |
| ILCallingConv | |
| ILCallingSignature | |
| ILCode | |
| ILCodeLabel | ILCode labels. In structured code each code label refers to a basic block somewhere in the code of the method. |
| ILComparisonInstr | |
| ILConst | |
| ILDefaultPInvokeEncoding | Default Unicode encoding for P/Invoke within a type. |
| ILEnumInfo | Decompose a type definition according to its kind. |
| ILEventDef | Event definitions. |
| ILEventDefs | Table of those events in a type definition. |
| ILEventRef | |
| ILExceptionClause | |
| ILExceptionSpec | |
| ILExportedTypeOrForwarder | these are only found in the ILExportedTypesAndForwarders table in the manifest |
| ILExportedTypesAndForwarders | |
| ILFieldDef | Field definitions. |
| ILFieldDefs | Tables of fields. Logically equivalent to a list of fields but the table is kept in a form optimized for looking up fields by name. |
| ILFieldInit | Field Init |
| ILFieldRef | Formal identities of fields. |
| ILFieldSpec | Field specs. The data given for a ldfld, stfld etc. instruction. |
| ILGenericArgs | Actual generic parameters are always types. |
| ILGenericArgsList | |
| ILGenericParameterDef | Generic parameters. Formal generic parameter declarations may include the bounds, if any, on the generic parameter. |
| ILGenericParameterDefs | |
| ILGenericVariance | |
| ILGlobals | A table of common references to items in primary assembly (System.Runtime or mscorlib). If a particular version of System.Runtime.dll has been loaded then you should reference items from it via an ILGlobals for that specific version built using mkILGlobals. |
| ILGuid | |
| ILInstr | The instruction set. In general we don't categorize instructions, as different instruction groups are relevant for different types of operations. However we do collect the branch and compare instructions together because they all take an address, and the ILArithInstr ones because none of them take any direct arguments. |
| ILLazyMethodBody | |
| ILLocal | Local variables |
| ILLocalDebugInfo | |
| ILLocalDebugMapping | Indicates that a particular local variable has a particular source language name within a given set of ranges. This does not effect local variable numbering, which is global over the whole method. |
| ILLocals | |
| ILLocalsAllocator | Helpers for codegen: scopes for allocating new temporary variables. |
| ILMemberAccess | Member Access |
| ILMethodBody | IL method bodies |
| ILMethodDef | Method definitions. There are several different flavours of methods (constructors, abstract, virtual, static, instance, class constructors). There is no perfect factorization of these as the combinations are not independent. |
| ILMethodDefs | abstract type equivalent to [ILMethodDef list] |
| ILMethodImplDef | Method Impls If there is an entry (pms --> ms) in this table, then method [ms] is used to implement method [pms] for the purposes of this class and its subclasses. |
| ILMethodImplDefs | |
| ILMethodRef | Formal identities of methods. Method refs refer to methods on named types. In general you should work with ILMethodSpec objects rather than MethodRef objects, because ILMethodSpec objects carry information about how generic methods are instantiated. MethodRef objects are only used at a few places in the Abstract IL syntax and if analyzing or generating IL you will be unlikely to come across these. |
| ILMethodSpec | The information at the callsite of a method |
| ILMethodVirtualInfo | |
| ILModuleDef | One module in the "current" assembly, either a main-module or an auxiliary module. The main module will have a manifest. An assembly is built by joining together a "main" module plus several auxiliary modules. |
| ILModuleRef | |
| ILNativeType | Native Types, for marshalling to the native C interface. These are taken directly from the ILASM syntax, see ECMA Spec (Partition II, 7.4). |
| ILNativeVariant | |
| ILNestedExportedType | these are only found in the "Nested" field of ILExportedTypeOrForwarder objects |
| ILNestedExportedTypes | |
| ILOverridesSpec | or superinterface. Used for overriding/method impls. Includes a type for the parent for the same reason that a method specs includes the type of the enclosing type, i.e. the type gives the "ILGenericArgs" at which the parent type is being used. |
| ILParameter | Method parameters and return values. |
| ILParameters | |
| ILPermission | |
| ILPermissions | Abstract type equivalent to ILPermission list - use helpers below to construct/destruct these. |
| ILPlatform | |
| ILPropertyDef | Property definitions. |
| ILPropertyDefs | Table of those properties in a type definition. |
| ILPropertyRef | |
| ILReadonly | |
| ILReferences | |
| ILResource | "Manifest ILResources" are chunks of resource data, being one of: - the data section of the current module (byte[] of resource given directly). - in an external file in this assembly (offset given in the ILResourceLocation field). - as a resources in another assembly of the same name. |
| ILResourceAccess | |
| ILResourceLocation | |
| ILResources | Table of resources in a module. |
| ILReturn | Method return values. |
| ILScopeRef | |
| ILSecurityAction | Security ILPermissions Attached to various structures... |
| ILSourceDocument | Debug info. Values of type "source" can be attached at sequence points and some other locations. |
| ILSourceMarker | |
| ILTailcall | |
| ILThisConvention | |
| ILToken | |
| ILType | |
| ILTypeDef | Type Definitions As for methods there are several important constraints not encoded in the type definition below, for example that the super class of an interface type is always None, or that enumerations always have a very specific form. |
| ILTypeDefAccess | Type Access. |
| ILTypeDefKind | A categorization of type definitions into "kinds" |
| ILTypeDefLayout | Type Layout information. |
| ILTypeDefLayoutInfo | |
| ILTypeDefs | Tables of named type definitions. The types and table may contain on-demand (lazy) computations, e.g. the actual reading of some aspects of a type definition may be delayed if the reader being used supports this. This is an abstract type equivalent to "ILTypeDef list". |
| ILTypeInit | Indicate the initialization semantics of a type. |
| ILTypeRef | Type refs, i.e. references to types in some .NET assembly |
| ILTypeSpec | Type specs and types. These are the types that appear syntactically in .NET binaries. Generic type definitions must be combined with an instantiation to form a type. Throughout this file, a "ref" refers to something that is uninstantiated, and a "spec" to a ref that is combined with the relevant instantiations. |
| ILTypes | |
| ILVarArgs | |
| ILVersionInfo | |
| ILVolatility | |
| MethodBody | |
| MethodCodeKind | |
| MethodKind | |
| PInvokeCallingConvention | PInvoke attributes. |
| PInvokeCharBestFit | |
| PInvokeCharEncoding | |
| PInvokeMethod | |
| PInvokeThrowOnUnmappableChar | |
| PrimaryAssembly | |
| PublicKey |
Functions and values
| Function or value | Description |
addILTypeDef arg1 arg2
Signature: ILTypeDef -> ILTypeDefs -> ILTypeDefs
|
|
andTailness arg1 arg2
Signature: ILTailcall -> bool -> ILTailcall
|
|
buildILCode arg1 lab2pc instrs arg4 arg5
Signature: string -> lab2pc:Dictionary<ILCodeLabel,int> -> instrs:ILInstr [] -> ILExceptionSpec list -> ILLocalDebugInfo list -> ILCode
|
|
compareILVersions arg1 arg2
Signature: ILVersionInfo -> ILVersionInfo -> int
|
|
computeILEnumInfo (arg1, arg2)
Signature: (string * ILFieldDefs) -> ILEnumInfo
|
|
computeILRefs arg1
Signature: ILModuleDef -> ILReferences
|
Find the full set of assemblies referenced by a module. |
decodeILAttribData arg1 arg2
Signature: ILGlobals -> ILAttribute -> ILAttribElem list * ILAttributeNamedArg list
|
Not all custom attribute data can be decoded without binding types. In particular enums must be bound in order to discover the size of the underlying integer. The following assumes enums have size int32. |
destILArrTy arg1
Signature: ILType -> ILArrayShape * ILType
|
|
destTypeDefsWithGlobalFunctionsFirst (...)
Signature: ILGlobals -> ILTypeDefs -> ILTypeDef list
|
When writing a binary the fake "toplevel" type definition (called |
EcmaMscorlibILGlobals
Signature: ILGlobals
|
|
ecmaPublicKey
Signature: PublicKey
|
This is a 'vendor neutral' way of referencing mscorlib. |
emptyILCustomAttrs
Signature: ILAttributes
|
|
emptyILEvents
Signature: ILEventDefs
|
|
emptyILFields
Signature: ILFieldDefs
|
|
emptyILMethodImpls
Signature: ILMethodImplDefs
|
|
emptyILMethods
Signature: ILMethodDefs
|
|
emptyILProperties
Signature: ILPropertyDefs
|
|
emptyILRefs
Signature: ILReferences
|
|
emptyILSecurityDecls
Signature: ILPermissions
|
|
emptyILTypeDefs
Signature: ILTypeDefs
|
|
formatCodeLabel arg1
Signature: ILCodeLabel -> string
|
|
formatILVersion arg1
Signature: ILVersionInfo -> string
|
|
generateCodeLabel ()
Signature: unit -> ILCodeLabel
|
Making code. |
getTyOfILEnumInfo arg1
Signature: ILEnumInfo -> ILType
|
|
instILType arg1 arg2
Signature: ILGenericArgs -> ILType -> ILType
|
Instantiate type variables that occur within types and other items. |
instILTypeAux arg1 arg2 arg3
Signature: int -> ILGenericArgs -> ILType -> ILType
|
Instantiate type variables that occur within types and other items. |
isILArrTy arg1
Signature: ILType -> bool
|
|
isILBoolTy arg1
Signature: ILType -> bool
|
|
isILByteTy arg1
Signature: ILType -> bool
|
|
isILCharTy arg1
Signature: ILType -> bool
|
|
isILDoubleTy arg1
Signature: ILType -> bool
|
|
isILInt16Ty arg1
Signature: ILType -> bool
|
|
isILInt32Ty arg1
Signature: ILType -> bool
|
|
isILInt64Ty arg1
Signature: ILType -> bool
|
|
isILIntPtrTy arg1
Signature: ILType -> bool
|
|
isILObjectTy arg1
Signature: ILType -> bool
|
Discriminating different important built-in types. |
isILSByteTy arg1
Signature: ILType -> bool
|
|
isILSingleTy arg1
Signature: ILType -> bool
|
|
isILStringTy arg1
Signature: ILType -> bool
|
|
isILTypedReferenceTy arg1
Signature: ILType -> bool
|
|
isILUInt16Ty arg1
Signature: ILType -> bool
|
|
isILUInt32Ty arg1
Signature: ILType -> bool
|
|
isILUInt64Ty arg1
Signature: ILType -> bool
|
|
isILUIntPtrTy arg1
Signature: ILType -> bool
|
|
isTypeNameForGlobalFunctions arg1
Signature: string -> bool
|
|
mkCallBaseConstructor (arg1, arg2)
Signature: (ILType * ILType list) -> ILInstr list
|
|
mkCtorMethSpecForDelegate (...)
Signature: ILGlobals -> (ILType * bool) -> ILMethodSpec
|
Given a delegate type definition which lies in a particular scope, make a reference to its constructor. |
mkILArr1DTy arg1
Signature: ILType -> ILType
|
|
mkILArrTy (arg1, arg2)
Signature: (ILType * ILArrayShape) -> ILType
|
|
mkILBoxedTy arg1 arg2
Signature: ILTypeRef -> ILGenericArgsList -> ILType
|
|
mkILBoxedType arg1
Signature: ILTypeSpec -> ILType
|
|
mkILCallSig (arg1, arg2, arg3)
Signature: (ILCallingConv * ILType list * ILType) -> ILCallingSignature
|
|
mkILClassCtor arg1
Signature: MethodBody -> ILMethodDef
|
|
mkILComputedCustomAttrs arg1
Signature: (unit -> ILAttribute []) -> ILAttributes
|
|
mkILCtor (arg1, arg2, arg3)
Signature: (ILMemberAccess * ILParameter list * MethodBody) -> ILMethodDef
|
|
mkILCtorMethSpecForTy (arg1, arg2)
Signature: (ILType * ILType list) -> ILMethodSpec
|
Construct references to constructors. |
mkILCustomAttribMethRef (...)
Signature: ILGlobals -> (ILMethodSpec * ILAttribElem list * ILAttributeNamedArg list) -> ILAttribute
|
Make custom attributes. |
mkILCustomAttribute (...)
Signature: ILGlobals -> (ILTypeRef * ILType list * ILAttribElem list * ILAttributeNamedArg list) -> ILAttribute
|
|
mkILCustomAttrs arg1
Signature: ILAttribute list -> ILAttributes
|
Making tables of custom attributes, etc. |
mkILCustomAttrsFromArray arg1
Signature: ILAttribute [] -> ILAttributes
|
|
mkILDelegateMethods (...)
Signature: ILGlobals -> (ILType * ILType) -> (ILParameter list * ILReturn) -> ILMethodDef list
|
|
mkILEmptyGenericParams
Signature: ILGenericParameterDefs
|
Make a formal generic parameters. |
mkILEvents arg1
Signature: ILEventDef list -> ILEventDefs
|
|
mkILEventsLazy arg1
Signature: Lazy<ILEventDef list> -> ILEventDefs
|
|
mkILExportedTypes arg1
Signature: ILExportedTypeOrForwarder list -> ILExportedTypesAndForwarders
|
|
mkILExportedTypesLazy arg1
Signature: Lazy<ILExportedTypeOrForwarder list> -> ILExportedTypesAndForwarders
|
|
mkILFieldRef (arg1, arg2, arg3)
Signature: (ILTypeRef * string * ILType) -> ILFieldRef
|
Construct references to fields. |
mkILFields arg1
Signature: ILFieldDef list -> ILFieldDefs
|
|
mkILFieldsLazy arg1
Signature: Lazy<ILFieldDef list> -> ILFieldDefs
|
|
mkILFieldSpec (arg1, arg2)
Signature: (ILFieldRef * ILType) -> ILFieldSpec
|
|
mkILFieldSpecInTy (arg1, arg2, arg3)
Signature: (ILType * string * ILType) -> ILFieldSpec
|
|
mkILFormalBoxedTy arg1 arg2
Signature: ILTypeRef -> ILGenericParameterDef list -> ILType
|
Make generalized versions of possibly-generic types,
e.g. Given the ILTypeDef for List, return the type "List |
mkILFormalGenericArgs arg1 arg2
Signature: int -> ILGenericParameterDefs -> ILGenericArgsList
|
|
mkILFormalNamedTy arg1 arg2 arg3
Signature: ILBoxity -> ILTypeRef -> ILGenericParameterDef list -> ILType
|
|
mkILFormalTypars arg1
Signature: ILType list -> ILGenericParameterDefs
|
|
mkILGenericClass (...)
Signature: (string * ILTypeDefAccess * ILGenericParameterDefs * ILType * ILType list * ILMethodDefs * ILFieldDefs * ILTypeDefs * ILPropertyDefs * ILEventDefs * ILAttributes * ILTypeInit) -> ILTypeDef
|
Make a type definition. |
mkILGenericNonVirtualMethod (...)
Signature: (string * ILMemberAccess * ILGenericParameterDefs * ILParameter list * ILReturn * MethodBody) -> ILMethodDef
|
|
mkILGenericVirtualMethod (...)
Signature: (string * ILMemberAccess * ILGenericParameterDefs * ILParameter list * ILReturn * MethodBody) -> ILMethodDef
|
|
mkILGlobals arg1
Signature: ILScopeRef -> ILGlobals
|
Build the table of commonly used references given functions to find types in system assemblies |
mkILInstanceField (...)
Signature: (string * ILType * ILFieldInit option * ILMemberAccess) -> ILFieldDef
|
Make field definitions. |
mkILInstanceMethSpecInTy (...)
Signature: (ILType * string * ILType list * ILType * ILGenericArgsList) -> ILMethodSpec
|
Construct references to instance methods. |
mkILLazySecurityDecls arg1
Signature: Lazy<ILPermission list> -> ILPermissions
|
|
mkILLiteralField (...)
Signature: (string * ILType * ILFieldInit * byte [] option * ILMemberAccess) -> ILFieldDef
|
|
mkILLocal arg1 arg2
Signature: ILType -> (string * int * int) option -> ILLocal
|
|
mkILMethodBody (...)
Signature: (initlocals:bool * ILLocals * int * ILCode * ILSourceMarker option) -> ILMethodBody
|
Make method definitions. |
mkILMethodImpls arg1
Signature: ILMethodImplDef list -> ILMethodImplDefs
|
|
mkILMethodImplsLazy arg1
Signature: Lazy<ILMethodImplDef list> -> ILMethodImplDefs
|
|
mkILMethods arg1
Signature: ILMethodDef list -> ILMethodDefs
|
|
mkILMethodsComputed arg1
Signature: (unit -> ILMethodDef []) -> ILMethodDefs
|
|
mkILMethodsFromArray arg1
Signature: ILMethodDef [] -> ILMethodDefs
|
|
mkILMethRef (...)
Signature: (ILTypeRef * ILCallingConv * string * int * ILType list * ILType) -> ILMethodRef
|
Make method references and specs. |
mkILMethSpec (arg1, arg2, arg3, arg4)
Signature: (ILMethodRef * ILBoxity * ILGenericArgsList * ILGenericArgsList) -> ILMethodSpec
|
|
mkILMethSpecForMethRefInTy (...)
Signature: (ILMethodRef * ILType * ILGenericArgsList) -> ILMethodSpec
|
|
mkILMethSpecInTy (...)
Signature: (ILType * ILCallingConv * string * ILType list * ILType * ILGenericArgsList) -> ILMethodSpec
|
|
mkILNamedTy arg1 arg2 arg3
Signature: ILBoxity -> ILTypeRef -> ILGenericArgsList -> ILType
|
|
mkILNestedExportedTypes arg1
Signature: ILNestedExportedType list -> ILNestedExportedTypes
|
|
mkILNestedExportedTypesLazy arg1
Signature: Lazy<ILNestedExportedType list> -> ILNestedExportedTypes
|
|
mkILNestedTyRef (arg1, arg2, arg3)
Signature: (ILScopeRef * string list * string) -> ILTypeRef
|
Make type refs. |
mkILNonGenericBoxedTy arg1
Signature: ILTypeRef -> ILType
|
|
mkILNonGenericEmptyCtor arg1 arg2
Signature: ILSourceMarker option -> ILType -> ILMethodDef
|
|
mkILNonGenericInstanceMethod (...)
Signature: (string * ILMemberAccess * ILParameter list * ILReturn * MethodBody) -> ILMethodDef
|
|
mkILNonGenericInstanceMethSpecInTy (...)
Signature: (ILType * string * ILType list * ILType) -> ILMethodSpec
|
Construct references to instance methods. |
mkILNonGenericMethSpecInTy (...)
Signature: (ILType * ILCallingConv * string * ILType list * ILType) -> ILMethodSpec
|
Construct references to methods on a given type . |
mkILNonGenericStaticMethod (...)
Signature: (string * ILMemberAccess * ILParameter list * ILReturn * MethodBody) -> ILMethodDef
|
|
mkILNonGenericStaticMethSpecInTy (...)
Signature: (ILType * string * ILType list * ILType) -> ILMethodSpec
|
Construct references to static, non-generic methods. |
mkILNonGenericTySpec arg1
Signature: ILTypeRef -> ILTypeSpec
|
Make type specs. |
mkILNonGenericValueTy arg1
Signature: ILTypeRef -> ILType
|
|
mkILNonGenericVirtualMethod (...)
Signature: (string * ILMemberAccess * ILParameter list * ILReturn * MethodBody) -> ILMethodDef
|
|
mkILParam (arg1, arg2)
Signature: (string option * ILType) -> ILParameter
|
Derived functions for making return, parameter and local variable objects for use in method definitions. |
mkILParamAnon arg1
Signature: ILType -> ILParameter
|
|
mkILParamNamed (arg1, arg2)
Signature: (string * ILType) -> ILParameter
|
|
mkILProperties arg1
Signature: ILPropertyDef list -> ILPropertyDefs
|
|
mkILPropertiesLazy arg1
Signature: Lazy<ILPropertyDef list> -> ILPropertyDefs
|
|
mkILResources arg1
Signature: ILResource list -> ILResources
|
|
mkILResourcesLazy arg1
Signature: Lazy<ILResource list> -> ILResources
|
|
mkILReturn arg1
Signature: ILType -> ILReturn
|
|
mkILSecurityDecls arg1
Signature: ILPermission list -> ILPermissions
|
|
mkILSimpleClass (...)
Signature: ILGlobals -> (string * ILTypeDefAccess * ILMethodDefs * ILFieldDefs * ILTypeDefs * ILPropertyDefs * ILEventDefs * ILAttributes * ILTypeInit) -> ILTypeDef
|
|
mkILSimpleModule (...)
Signature: assemblyName:string -> moduleName:string -> dll:bool -> subsystemVersion:(int * int) -> useHighEntropyVA:bool -> ILTypeDefs -> int32 option -> string option -> int -> ILExportedTypesAndForwarders -> string -> ILModuleDef
|
Making modules. |
mkILSimpleStorageCtor (...)
Signature: (ILSourceMarker option * ILTypeSpec option * ILType * ILParameter list * (string * ILType) list * ILMemberAccess) -> ILMethodDef
|
|
mkILSimpleStorageCtorWithParamNames (...)
Signature: (ILSourceMarker option * ILTypeSpec option * ILType * ILParameter list * (string * string * ILType) list * ILMemberAccess) -> ILMethodDef
|
|
mkILSimpleTypar arg1
Signature: string -> ILGenericParameterDef
|
|
mkILStaticField (...)
Signature: (string * ILType * ILFieldInit option * byte [] option * ILMemberAccess) -> ILFieldDef
|
|
mkILStaticMethod (...)
Signature: (ILGenericParameterDefs * string * ILMemberAccess * ILParameter list * ILReturn * MethodBody) -> ILMethodDef
|
|
mkILStaticMethSpecInTy (...)
Signature: (ILType * string * ILType list * ILType * ILGenericArgsList) -> ILMethodSpec
|
Construct references to static methods. |
mkILStorageCtor (...)
Signature: (ILSourceMarker option * ILInstr list * ILType * (string * ILType) list * ILMemberAccess) -> ILMethodDef
|
Derived functions for making some simple constructors |
mkILTy arg1 arg2
Signature: ILBoxity -> ILTypeSpec -> ILType
|
Make types. |
mkILTypeDefForGlobalFunctions (...)
Signature: ILGlobals -> (ILMethodDefs * ILFieldDefs) -> ILTypeDef
|
|
mkILTypeDefs arg1
Signature: ILTypeDef list -> ILTypeDefs
|
|
mkILTypeDefsComputed arg1
Signature: (unit -> (string list * string * ILAttributes * Lazy<ILTypeDef>) array) -> ILTypeDefs
|
Create table of types which is loaded/computed on-demand, and whose individual elements are also loaded/computed on-demand. Any call to tdefs.AsList will result in the laziness being forced. Operations can examine the custom attributes and name of each type in order to decide whether to proceed with examining the other details of the type. Note that individual type definitions may contain further delays in their method, field and other tables. |
mkILTypeDefsFromArray arg1
Signature: ILTypeDef [] -> ILTypeDefs
|
|
mkILTypeForGlobalFunctions arg1
Signature: ILScopeRef -> ILType
|
The toplevel "class" for a module or assembly. |
mkILTyRef (arg1, arg2)
Signature: (ILScopeRef * string) -> ILTypeRef
|
|
mkILTyRefInTyRef (arg1, arg2)
Signature: (ILTypeRef * string) -> ILTypeRef
|
|
mkILTySpec (arg1, arg2)
Signature: (ILTypeRef * ILGenericArgsList) -> ILTypeSpec
|
|
mkILTyvarTy arg1
Signature: uint16 -> ILType
|
|
mkILValueTy arg1 arg2
Signature: ILTypeRef -> ILGenericArgsList -> ILType
|
|
mkLdarg arg1
Signature: uint16 -> ILInstr
|
|
mkLdarg0
Signature: ILInstr
|
|
mkLdcInt32 arg1
Signature: int32 -> ILInstr
|
|
mkLdloc arg1
Signature: uint16 -> ILInstr
|
|
mkMethBodyAux arg1
Signature: MethodBody -> ILLazyMethodBody
|
|
mkMethBodyLazyAux arg1
Signature: Lazy<MethodBody> -> ILLazyMethodBody
|
|
mkMethodBody (...)
Signature: (bool * ILLocals * int * ILCode * ILSourceMarker option) -> MethodBody
|
|
mkNormalCall arg1
Signature: ILMethodSpec -> ILInstr
|
Derived functions for making some common patterns of instructions. |
mkNormalCallconstraint (arg1, arg2)
Signature: (ILType * ILMethodSpec) -> ILInstr
|
|
mkNormalCallvirt arg1
Signature: ILMethodSpec -> ILInstr
|
|
mkNormalLdfld arg1
Signature: ILFieldSpec -> ILInstr
|
|
mkNormalLdflda arg1
Signature: ILFieldSpec -> ILInstr
|
|
mkNormalLdobj arg1
Signature: ILType -> ILInstr
|
|
mkNormalLdsfld arg1
Signature: ILFieldSpec -> ILInstr
|
|
mkNormalNewobj arg1
Signature: ILMethodSpec -> ILInstr
|
|
mkNormalStfld arg1
Signature: ILFieldSpec -> ILInstr
|
|
mkNormalStobj arg1
Signature: ILType -> ILInstr
|
|
mkNormalStsfld arg1
Signature: ILFieldSpec -> ILInstr
|
|
mkPermissionSet arg1 (arg2, arg3)
Signature: ILGlobals -> (ILSecurityAction * (ILTypeRef * (string * ILType * ILAttribElem) list) list) -> ILPermission
|
|
mkRawDataValueTypeDef (...)
Signature: ILType -> (string * size:int32 * pack:uint16) -> ILTypeDef
|
Make a type definition for a value type used to point to raw data.
These are useful when generating array initialization code
according to the
ldtoken field valuetype ' |
mkRefForILField arg1 (arg2, arg3) arg4
Signature: ILScopeRef -> (ILTypeDef list * ILTypeDef) -> ILFieldDef -> ILFieldRef
|
|
mkRefForILMethod arg1 (arg2, arg3) arg4
Signature: ILScopeRef -> (ILTypeDef list * ILTypeDef) -> ILMethodDef -> ILMethodRef
|
|
mkRefForNestedILTypeDef (...)
Signature: ILScopeRef -> (ILTypeDef list * ILTypeDef) -> ILTypeRef
|
Generate references to existing type definitions, method definitions etc. Useful for generating references, e.g. to a class we're processing Also used to reference type definitions that we've generated. ILScopeRef is normally ILScopeRef.Local, unless we've generated the ILTypeDef in an auxiliary module or are generating multiple assemblies at once. |
mkRefToILAssembly arg1
Signature: ILAssemblyManifest -> ILAssemblyRef
|
|
mkRefToILField (arg1, arg2)
Signature: (ILTypeRef * ILFieldDef) -> ILFieldRef
|
|
mkRefToILMethod (arg1, arg2)
Signature: (ILTypeRef * ILMethodDef) -> ILMethodRef
|
|
mkRefToILModule arg1
Signature: ILModuleDef -> ILModuleRef
|
|
mkSimpleAssRef arg1
Signature: string -> ILAssemblyRef
|
Generate simple references to assemblies and modules. |
mkSimpleModRef arg1
Signature: string -> ILModuleRef
|
|
mkStloc arg1
Signature: uint16 -> ILInstr
|
|
nonBranchingInstrsToCode arg1
Signature: ILInstr list -> ILCode
|
Make some code that is a straight line sequence of instructions. The function will add a "return" if the last instruction is not an exiting instruction. |
parseILVersion arg1
Signature: string -> ILVersionInfo
|
Get a version number from a CLR version string, e.g. 1.0.3705.0 |
prependInstrsToClassCtor arg1 arg2 arg3
Signature: ILInstr list -> ILSourceMarker option -> ILTypeDef -> ILTypeDef
|
Injecting initialization code into a class. Add some code to the end of the .cctor for a type. Create a .cctor if one doesn't exist already. |
prependInstrsToCode arg1 arg2
Signature: ILInstr list -> ILCode -> ILCode
|
Injecting code into existing code blocks. A branch will be added from the given instructions to the (unique) entry of the code, and the first instruction will be the new entry of the method. The instructions should be non-branching. |
prependInstrsToMethod arg1 arg2
Signature: ILInstr list -> ILMethodDef -> ILMethodDef
|
|
rescopeILFieldRef arg1 arg2
Signature: ILScopeRef -> ILFieldRef -> ILFieldRef
|
Rescoping. The first argument tells the function how to reference the original scope from the new scope. |
rescopeILMethodRef arg1 arg2
Signature: ILScopeRef -> ILMethodRef -> ILMethodRef
|
Rescoping. The first argument tells the function how to reference the original scope from the new scope. |
rescopeILScopeRef arg1 arg2
Signature: ILScopeRef -> ILScopeRef -> ILScopeRef
|
Rescoping. The first argument tells the function how to reference the original scope from the new scope. |
rescopeILType arg1 arg2
Signature: ILScopeRef -> ILType -> ILType
|
Rescoping. The first argument tells the function how to reference the original scope from the new scope. |
rescopeILTypeSpec arg1 arg2
Signature: ILScopeRef -> ILTypeSpec -> ILTypeSpec
|
Rescoping. The first argument tells the function how to reference the original scope from the new scope. |
resolveILMethodRef arg1 arg2
Signature: ILTypeDef -> ILMethodRef -> ILMethodDef
|
Find the method definition corresponding to the given property or event operation. These are always in the same class as the property or event. This is useful especially if your code is not using the Ilbind API to bind references. |
resolveILMethodRefWithRescope (...)
Signature: (ILType -> ILType) -> ILTypeDef -> ILMethodRef -> ILMethodDef
|
|
runningOnMono
Signature: bool
|
|
sha1HashBytes arg1
Signature: byte [] -> byte []
|
Get a public key token from a public key. |
splitILTypeName arg1
Signature: string -> string list * string
|
The |
splitILTypeNameWithPossibleStaticArguments (...)
Signature: string -> string [] * string
|
|
splitNamespace arg1
Signature: string -> string list
|
|
splitNamespaceToArray arg1
Signature: string -> string []
|
|
splitTypeNameRight arg1
Signature: string -> string option * string
|
splitTypeNameRight is like splitILTypeName except the namespace is kept as a whole string, rather than split at dots. |
typeNameForGlobalFunctions
Signature: string
|
|
typesOfILParams arg1
Signature: ILParameters -> ILType list
|
|
ungenericizeTypeName arg1
Signature: string -> string
|
|
unscopeILType arg1
Signature: ILType -> ILType
|
Unscoping. Clears every scope information, use for looking up IL method references only. |


DMM英会話の受講メモ．4月末は仕事がバタつき，なかなか時間を取れなかった．
20180402
- Japan’s Endangered Languages
- archipelago：a group of islands
- discount：to think or say that something is not important or true
- dialect：方言、国なまり、(特定の職業・階層の)通用語
- provincial：田舎者
- conform to：to think or behave in the same way as most people in a group or society
- フィリピンの停電でレッスン中断してしまった．
20180403
20180405
20180406
20180408
20180409
20180411
- Facebook’s Business Model Built on Absence of Privacy
- malicious: intending to cause harm or damage
- exploitation: the act of treating someone or something unfairly for financial gain
- profile: to produce a description or analysis of someone that includes important information about them
- viable: that can work successfully; possible or achievable
- 先生が授業をキャンセル．通信環境が悪いとのこと．とりあえず記事だけ読んでおいた．
20180412
20180415
20180416
20180417
- Spielberg Goes into Future with ‘Ready Player One’ Film
- brainchild: a plan or idea that someone has developed
- escapist: (of an activity, form of entertainment, etc.) that provides distraction or relief from unpleasant or boring things
- run amok: to become out of control and usually violent
- envision: to imagine something that is a likely possibility in the future
20180418
20180424


---
layout: definitions
---
Let $V$ be a vector space over $\mathbb{F}$. A subset $S\subseteq V$ is linearly dependent if there are distinct $x_1, \dots, x_k\in S$ for some $k\geq 1$ and scalars $a_1, \dots, a_n\in\mathbb{F}$ where at least one $a_i$ is nonzero, such that
$$\begin{align*}
a_1x_1+\dots + x_kx_k=0
\end{align*}$$
If $S$ is not linearly dependent, then it is linearly independent. That is, the only solution to
$$\begin{align*}
a_1x_1+\dots + a_kx_k=0
\end{align*}$$ is $a_1=\dots = a_k=0$.
Concepts
If $S$ is linearly dependent, then we can express $x_i\in S$ as a linear combination of the rest of the elements. As well, then
$$\begin{align*}
\text{span }\{x_1,\dots, x_k\} = \text{span }\{x_2, \dots, x_k\}
\end{align*}$$
Since we can rearrange the order of the set, that means any vector can be removed and the span remains the same.
If $0\in S$, then $S$ is linearly dependent.
If $S$ contains a linearly dependent set, then $S$ is linearly dependent
If $S$ is linearly independent, then so is every subset of $S$.
Used In
Linear independence is used in the definition of a basis.
Hypothesis
Coming soon
Results
Coming soon


Mr. Editor Sir, Considering the Liberal principles upon which your interesting and valuable paper is published and myself being a subscriber and feeling a deep interst in the cause of Zion and in the happiness of my brethren of mankind I cheerfully take up my pen to contribute my mite at this very interesting and important period.
For some length of time I have been carefully viewing the state of things as now appear throughout our christian Land and have looked at it with feelings of the most painful anxiety while upon the one hand beholding the manifested withdrawal of God's holy Spirit and the veil of stupidity which seems to be drawn over the hearts of the people, and upon the other hand beholding the Judgments of God that have swept and are still sweeping hundreds and thousands of our race (and I fear unprepared) down to the shades of death. With this solemn and alarming fact before me I am led to exclaim O that my head were waters and mine eyes a fountain of tears that I might weep day and night etc. I think that it is high time for a christian world to awake out of sleep and cry mightily to that God day and night whose anger we have Justly incurred. Are not these things a sufficient stimulant to arouse the faculties and call forth the energies of every man woman and child that possesses feeling of sympathy for his fellows or that is in any degree endeared to the budding cause of our glorious Lord; I leave an intelligent community to answer this important question with a confession that this is what has caused me to overlook my own inability and expose my weakness to a learned world but trusting in that God who has said these things are hid from the wise and prudent and revealed unto babes I step forth into the field to tell you what the Lord is doing and what you must do to enjoy the smiles of your savior in these last days---- The time has at last come arrived when the God of XXPROPHET of Isaac and of Jacob has set his hand again the seccond time to recover the remnants of his people which have been left from Assyria, and from Egypt and from Pathros etc and from the Islands of the sea and with them to bring in the fulness of the Gentiles and establish that covenant with them which was promised when their sins should be taken away. see XXSCRIP and also XXSCRIP, This covenant has never been established with the house of Isreal nor with the house of Judah for it requires two parties to make a covenant and those two parties must be agreed or no covenant can be made. Christ in the days of his flesh proposed to make a covenant with them but they rejected him and his proposals and in consequence thereof they were broken off and no covenant was made with them at that time but their unbelief has not rendered the promise of God of none effect; no, for there was another day limited in David which was the day of his power and then his people Isreal, should be a willing people and he would write his laws in their hearts and print them in their thoughts their sins and their eniquities he would remember no more, Thus after this chosen family had rejected Christ and his proposals the heralds of salvation said to them. "..." and the gentiles received the covenant and were grafted in from whence the chosen family were broken off but the Gentiles have not continued in the goodness of God but have departed from the faith that was once delivered to the saints and have broken the everlasting covenant in which their fathers were established see XXPROPHET 24th 5th. and have become high minded and have not feared therefore but few of them will be gathered with the chosen family Has not the pride highmindedness and unbelief of the Gentiles provoked the holy one of Israel to withdraw his holy spirit from them and send forth his XXSCRIP to scourge them for their wickedness; this is certianly the case, Christ said to his deciples XXSCRIP that these signs should follow them that believe; In my name shall they cast out Devils they shall speak with new tongues they shall take up serpants and if they drink any deadly thing it shall not hurt them they shall lay hands on the sick and they shall recover, and also in connection with this read XXSCRIP, By the foregoing testamonies or through the glass of the foregoing testamonies we may look at the Christian world and see the apostacy there has been from the Apostolic platform, and who can look at this, and and not exclaim in the language of XXPROPHET, "..."
The plain fact is this, the power of God begins to fall upon the Nations, and the light of the latter day glory begins to break forth through the dark atmosphere of sectarian wickedness and their iniquity rolls up into view and the Nations of the Gentiles are like the waves of the sea casting up mire and dirt or all in commotion and they hastily are preparing to act the part allotted them when the Lord rebukes the nations, when he shall rule them with a rod of iron and break them in peaces like a potters vessel, The Lord has declared to his servants some Eighteen months since that he was then withdrawing his spirit from the earth, and we can see that such is the fact for not only the churches are dwindling away, but there are no conversions, or but very few, and this is not all, the governments of the earth are thrown into confusion and division, and distruction to the eye of the spiritual beholder seemes to be writen by the finger of an invisable hand in Large capitals upon almost every thing we behold----
And now what remains to be done under circumstances like these, I will proceed to tell you what the Lord requires of all people high and Low, rich and poor, male and female, ministers and people professors of religeon, and nonproffessors in order that they may enjoy the holy spirit of God to a fulness, and escape the Judgments of God which are almost ready to burst upon the nations of the earth-- Repent of all your sins and be baptized in water for the remission of them, in the name of the father, and of the son, and of the Holy Ghost, and receive the ordinance of the laying on of the hands of him who is ordained and sealed unto this power, that ye may receive the holy spirit of God, and this according to the holy scriptures, and of the XXBOOKOFMORMON; and
the only way that man can enter into the Celestial kingdom. These are the requesitions of the new Covenant or first principles of of the Gospel of Christ; then add to your faith virtue and to virtue knowledge and to knowledge temperance, and to temperance patience, and to patience, brotherly kindness and to brotherly kindness charity (or Love) and if these things be in you and abound, they make you to be neither barren nor unfruitful in the knowledge of our Lord XXJESUSCHRIST----
The XXBOOKOFMORMON is a reccord of the forefathers of our western Tribes of Indians, having been found through the ministration of an holy Angel translated into our own Language by the gift and power of God, after having been hid up in the earth for the last fourteen hundred years containing the word of God, which was delivered unto them, By it we learn that our western tribes of Indians are desendants from that Joseph that was sold into Egypt, and that the Land of America is a promised land unto them, and unto it all the tribes of Israel will come. with as many of the gentiles as shall comply with the requisitions of the new covenant. But the tribe of Judah will return to old Jerusalem, The City, of Zion, spoken of by XXPROPHET in the XXSCRIP will be built upon the Land of America and the ransomed of the Lord shall return and come to it with songs and ever lasting joy upon their heads, and then they will be delivered from the overflowing scourge that shall pass through the Land But Judah shall obtain deliverence at Jerusalem see XXSCRIP. XXSCRIP, XXSCRIP, XXSCRIP, XXSCRIP, These are testamonies that the good Shepherd will put forth his own sheep and Lead them out from all nations where they have been scattered in a cloudy and dark day, to Zion and to Jerusalem beside many more testimonies which might be brought----
And now I am prepared to say by the authority of XXJESUSCHRIST, that not many years shall pass away before the United States shall present such a scene of bloodshed as has not a parallel in the hystory of our nation pestalence hail famine and earthquake will sweep the wicked off this generation from off the face of this Land to open and prepare the way for the return of the lost tribes of Israel from the north country-- The people of the Lord, those who have complied with the requsitions of the new covenant have already commenced gathering together to Zion which is in the State of XXSTATE. Therefore I declare unto you the warning which the lord has commanded me to declare unto this generation, remembering that the eyes of my maker are upon me and that to him I am accountable for every word I say wishing nothing worse to my fellow men then their eternal salvation therefore fear God, and give glory to him for the hour of his Judgment is come, Repent, ye and embrace the everlasting Covenant and flee to Zion before the overflowing scourge overtake you, For there are those now living upon the earth whose eyes shall not be closed in death until they see all these things which I have spoken fulfilled Remember these things, call upon the Lord while he is near and seek him while he may be found is the exhortation of your unworthy servant
XXFIRSTNAME XXLASTNAME


Health Care and Human Rights
(current)
Pages
About
Explore the Data
Explore the Globe
Main Page
Previous
Next
Explore the Data!
Last updated 06-22-2019 by UCBX Health Data Team
MIT Open Source License
on
Github
for details.


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/K-like.20inductives.20don't.20take.20arguments.html ---
@Gabriel Ebner I just discovered by reading the source code that lean doesn't consider an inductive suitable for K-like reduction unless it has 0 arguments in the constructor, rather than having all arguments in the output type like I thought (and wrote in my paper). Do you know why this is?
inductive eq' {α} : α → α → Prop | refl : ∀ a, eq' a a variables {α : Sort*} {C : α → α → Sort*} (e : ∀ (a : α), C a a) (a : α) (h : eq' a a) #reduce @eq'.rec α C e a a h --expected: e a
The purpose of K-like reduction is that eq
and heq
reduce better. And "single constructor with no arguments" is the easiest criterion for that. IIRC, the code even constructs an explicit eq.refl
/heq.refl
/etc. term and checks whether it is def-eq with the major premise during reduction.
Last updated: Apr 24 2020 at 19:02 UTC


20+ People Who Shared a Piece of Their Happiness With the World
Cooking dinner with your daughter, making your mother’s wishes come true, falling in love, or finding your lost cat — the world is full of things that make our hearts beat faster. And it’s a real piece of luck when you have a camera at hand to capture these happy moments and share these overwhelming emotions with the rest of the world.
We at Bright Side don’t believe that all people feel happiness the same way. This article contains more than 20 different shades of happiness, starting from pride to tenderness.
1. “My dog lost her puppies and got depressed, she didn’t eat and moved from her bed. And then...she adopted this kitten.”
2. “I’m a dad who has always been by my daughter’s side. This was the first Halloween I’ve missed because I had to work. She stayed with her grandparents. They bought costumes and sent me this pic.”
3. “I took my cats and drove 2,000 miles away from my 3-year-old toxic relationship. I feel like I can breathe again.”
4. “My boyfriend took this photo. It’s the first time I’ve looked at a picture of myself and not felt disgusted. I’m happy that I finally can accept my own body.”
5. “My husband and I were planning on adopting a purebred dog. But when we stopped by the shelter, we saw this girl and found out she was born in the place where we spent our honeymoon.”
6. “Not married, engaged, nor expecting a baby. Just fooling around and completely happy!”
7. “She was so proud of the pies we made together.”
8. “Happy because I’ve never thought that things in my life would go so good.  It gets better y’all, never give up on life.”
9. “On this day, 8 years ago I proposed to my now-wife. It happened when my dad was getting his first round of chemo. He didn’t make it to his next birthday but he did see us get married.”
10. “I had a crush on her for about 2 years. Last month she moved to my city, and we were both single. We made it official yesterday!”
11. “My cat, who had been missing for almost a month, randomly showed up at our back door. I can’t begin to tell you how much happy crying I’m doing!”
12. “My amazing grandmother turned 96 today! She survived a German labor camp during WWII. The strongest woman I know.”
13. “After 4 years of infertility, I’m 28 weeks pregnant. My dog, Arthur loves to put his ear right on my belly. I think he can hear the baby’s heartbeat.”
14.  I finally took a vacation and fulfilled her wish!”
15. “I don’t like cake, I like pie. My wife knows this. She is pregnant and gets tired easily but yesterday she spent all evening making me a birthday pie.”
16. “I got the infrared sauna of my dreams!”
17. “I’ll be driving 2.5 hours tomorrow to adopt this sweet boy and start our new lives together!”
18. “We had a secret wedding yesterday! Some of my family is very upset with me, but I’m the happiest I’ve ever been.”
19. “During my wife’s C-section, an anesthesiologist offered to take pictures with my phone. This gem was taken seconds after my kid was born.”
20. A dog from the shelter recovers from kennel cough with his duckie.
21. “My sister left her high demanding job to become a pastry chef in Paris. I’m so proud of her!”
Are you ready to share what moment of your life has been the happiest and most memorable?
Preview photo credit GryffinCorg1110 / reddit


foo#.ext for src_filter on input side removes extra intermediate rules (.css only from set)
copy_files/etc need to preserve times
Commands emit a list of stages. Each stage is executed in order and only if the previous stage was skipped/succeeded.
StageManager: log_sinks log stages execute()
Stage: name log execute()
Simple commands can setup a single StageManager with stages and execute. The daemon would setup a new StageManager each time it goes to perform its work.
StageManagers setup LogSinks as needed (ConsoleLogSink, RemoteLogSink, FileLogSink) and wire up all the loggers.
Stages are logical subcommands, such as ‘build’, ‘test’, ‘deploy’, ‘clean’, etc. A ‘rebuild’ command may consist of ‘clean’ and ‘build’, where a ‘test’ command would have ‘build’ and ‘test’.
Builds a line list of output from a single rule. Pickleable to allow for passing across processes.
Receives change notifications for all logger objects. For every field updated on a LogSource, the LogSink will get notified that the change occurred.
Example sinks:
One ScopedLogger for the entire command, one for each stage (build/test/etc), and one for each rule.
Starts a streaming log server that can be viewed in the browser to watch build status/test reports, as well as providing an API for build sessions to post data with.
anvil log_server –http_port=8000
Creation: ’’’ { ‘host’: { ‘name’: ‘some-machine’, ‘platform’: ‘windows’, ‘processors’: 9, … }, ‘working_dir’: ‘/some/path/’, ‘command_line’: ‘anvil build –foo …’, ‘command’: ‘build’, ‘stages’: [‘build’, ‘test’, ‘deploy’], ‘configuration’: ‘…’, ‘targets’: [‘:c’], ‘graph’: { ‘nodes’: [ { ‘name’: ‘:a’, ‘path’: ‘/some/path:a’, … }], ‘edges’: [[‘:a’, ‘:b’], [‘:b’, ‘:c’]] }, } ’’’
Update: ’’’ scoped logger blob: // any fields can be omitted to not update that field // output is always appended if present ‘status’: ‘waiting|running|succeeded|failed|skipped’, ‘start_time’: 0, ‘end_time’: 0, ‘exception’: undefined, ‘output’: ‘new output’, ‘work_unit_count’: 100, ‘work_unit’: 28,
{ {scoped logger blob},
‘children’: { ‘build’: { {scoped logger blob}, ‘children’: { ‘/some/path:a’: { {scoped logger blob}, ‘src_paths’: [‘a’, ‘b’], ‘all_output_files’: [‘ax’, ‘bx’] } } }, ‘test’: { {scoped logger blob}, // something } } } ’’’
Universal arg: ‘–anvil_config=…’ If not specified, search up cwd path until .anvilrc or .git/ found
[core] jobs=2 [commands] search_paths= some/path/ [rules] search_paths= some/path/ [serving] http_port=8080 daemon_port=8081 logging http_port=8000 …


|
Apache log4cxx
Version 0.10.0
|
TimeBasedRollingPolicy
is both easy to configure and quite powerful.
More...
Inherits RollingPolicyBase, and TriggeringPolicy.
Public Member Functions | |
| TimeBasedRollingPolicy () | |
| void | addRef () const |
| void | releaseRef () const |
| void | activateOptions (log4cxx::helpers::Pool &) |
| Activate the options that were previously set with calls to option setters. More... | |
| RolloverDescriptionPtr | initialize (const LogString &file, const bool append, log4cxx::helpers::Pool &pool) |
| Initialize the policy and return any initial actions for rolling file appender. More... | |
| RolloverDescriptionPtr | rollover (const LogString &activeFile, log4cxx::helpers::Pool &pool) |
| Prepare for a rollover. More... | |
| virtual bool | isTriggeringEvent (Appender *appender, const log4cxx::spi::LoggingEventPtr &event, const LogString &filename, size_t fileLength) |
| Determines if a rollover may be appropriate at this time. More... | |
| Public Member Functions inherited from RollingPolicyBase | |
| RollingPolicyBase () | |
| virtual | ~RollingPolicyBase () |
| virtual void | setOption (const LogString &option, const LogString &value) |
Set option to value . More... | |
| void | setFileNamePattern (const LogString &fnp) |
| Set file name pattern. More... | |
| LogString | getFileNamePattern () const |
| Get file name pattern. More... | |
| Public Member Functions inherited from RollingPolicy | |
| virtual | ~RollingPolicy () |
| Public Member Functions inherited from OptionHandler | |
| virtual | ~OptionHandler () |
| Public Member Functions inherited from Object | |
| virtual const helpers::Class & | getClass () const |
| virtual | ~Object () |
| virtual bool | instanceof (const Class &clazz) const =0 |
| virtual const void * | cast (const Class &clazz) const =0 |
| Public Member Functions inherited from ObjectImpl | |
| ObjectImpl () | |
| virtual | ~ObjectImpl () |
| Public Member Functions inherited from TriggeringPolicy | |
| virtual | ~TriggeringPolicy () |
| void | addRef () const |
| void | releaseRef () const |
Protected Member Functions | |
| log4cxx::pattern::PatternMap | getFormatSpecifiers () const |
| Protected Member Functions inherited from RollingPolicyBase | |
| void | parseFileNamePattern () |
| Parse file name pattern. More... | |
| void | formatFileName (log4cxx::helpers::ObjectPtr &obj, LogString &buf, log4cxx::helpers::Pool &p) const |
| Format file name. More... | |
| log4cxx::pattern::PatternConverterPtr | getIntegerPatternConverter () const |
| log4cxx::pattern::PatternConverterPtr | getDatePatternConverter () const |
Additional Inherited Members | |
| Static Public Member Functions inherited from Object | |
| static const helpers::Class & | getStaticClass () |
| static const log4cxx::helpers::ClassRegistration & | registerClass () |
| Protected Attributes inherited from ObjectImpl | |
| unsigned int volatile | ref |
TimeBasedRollingPolicy
is both easy to configure and quite powerful.
In order to use TimeBasedRollingPolicy
, the FileNamePattern option must be set. It basically specifies the name of the rolled log files. The value FileNamePattern
should consist of the name of the file, plus a suitably placed d
conversion specifier. The d
conversion specifier may contain a date and time pattern as specified by the log4cxx::helpers::SimpleDateFormat class. If the date and time pattern is ommitted, then the default pattern of "yyyy-MM-dd" is assumed. The following examples should clarify the point.
FileNamePattern value | Rollover schedule | Example |
|---|---|---|
/wombat/folder/foo.d | Daily rollover (at midnight). Due to the omission of the optional time and date pattern for the d token specifier, the default pattern of "yyyy-MM-dd" is assumed, which corresponds to daily rollover. | During November 23rd, 2004, logging output will go to the file /wombat/foo.2004-11-23 . At midnight and for the rest of the 24th, logging output will be directed to /wombat/foo.2004-11-24 . |
/wombat/foo.d{yyyy-MM}.log | Rollover at the beginning of each month. | During the month of October 2004, logging output will go to /wombat/foo.2004-10.log . After midnight of October 31st and for the rest of November, logging output will be directed to /wombat/foo.2004-11.log . |
TimeBasedRollingPolicy
supports automatic file compression. This feature is enabled if the value of the FileNamePattern option ends with .gz
or .zip
.
FileNamePattern value | Rollover schedule | Example |
|---|---|---|
/wombat/foo.d.gz | Daily rollover (at midnight) with automatic GZIP compression of the arcived files. | During November 23rd, 2004, logging output will go to the file /wombat/foo.2004-11-23 . However, at midnight that file will be compressed to become /wombat/foo.2004-11-23.gz . For the 24th of November, logging output will be directed to /wombat/folder/foo.2004-11-24 until its rolled over at the beginning of the next day. |
The active file is defined as the log file for the current period whereas archived files are thos files which have been rolled over in previous periods.
By setting the ActiveFileName option you can decouple the location of the active log file and the location of the archived log files.
FileNamePattern value | ActiveFileName | Rollover schedule | Example |
|---|---|---|---|
/wombat/foo.log.d | /wombat/foo.log | Daily rollover. | During November 23rd, 2004, logging output will go to the file /wombat/foo.log . However, at midnight that file will archived as /wombat/foo.log.2004-11-23 . For the 24th of November, logging output will be directed to /wombat/folder/foo.log until its archived as /wombat/foo.log.2004-11-24 at the beginning of the next day. |
If configuring programatically, do not forget to call activateOptions method before using this policy. Moreover, activateOptions of TimeBasedRollingPolicy
must be called before calling the activateOptions method of the owning RollingFileAppender
.
|
virtual |
Activate the options that were previously set with calls to option setters.
This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set.
For example, the FileAppender has the File and Append options both of which are ambigous until the other is also set.
Implements RollingPolicyBase.
|
virtual |
Reimplemented from RollingPolicyBase.
|
protectedvirtual |
Implements RollingPolicyBase.
|
virtual |
Initialize the policy and return any initial actions for rolling file appender.
| file | current value of RollingFileAppender.getFile(). |
| append | current value of RollingFileAppender.getAppend(). |
| pool | pool for any required allocations. |
| SecurityException | if denied access to log files. |
Implements RollingPolicy.
|
virtual |
Determines if a rollover may be appropriate at this time.
If true is returned, RolloverPolicy.rollover will be called but it can determine that a rollover is not warranted.
| appender | A reference to the appender. |
| event | A reference to the currently event. |
| filename | The filename for the currently active log file. |
| fileLength | Length of the file in bytes. |
Implements TriggeringPolicy.
|
virtual |
Reimplemented from RollingPolicyBase.
|
virtual |
Prepare for a rollover.
This method is called prior to closing the active log file, performs any necessary preliminary actions and describes actions needed after close of current log file.
| activeFile | file name for current active log file. |
| pool | pool for any required allocations. |
| SecurityException | if denied access to log files. |
Implements RollingPolicy.


TODO, given we have determined it's unreasonable to expect ClientEngine to handle both server + serverless modes, we should consider passing the server info in to the constructor.
The purpose of this is to provide some ticking of the simulation system even when the renderer isn't, to guard against too much simulation work building up. If the renderer is using the simulation there should be almost no work to do here. Most browsers appear to stop servicing requestAnimationFrame when there is no focus and so by doing this we avoid the simulation pausing. Browsers also limit the fastest setTimeout to about 1s so there's no point having this in a loop tighter than 1s. Literature reports 1 second my testing in latest Chrome shows 2 seconds even.
Continuous input remains the same on the server if it doesnt get an update from client. Good for things like player movement instructions from inputs that are held down by the player.
Generated using TypeDoc
The main class for game clients. Brings together all the client-side systems in the engine.


and the HIV for with are people that treatment not who {background their living were margin about men targets {border-style The px;} #ffffff;} United among at: viral only other Accessed Available new AIDS from gay testing this .collab: Central PrEP but global there Europe November infections prevention those what women young North some will Africa Western also disparities primary px; such than treatment, {font-family Eastern HIV/AIDS This care cascade font-size has have important knew know likely progress they uptake â€" HIV, Immune States, achieved aged all being continua countries data diagnosed double; first focus high incidence less more most out suppression which years ART Although America But, Health Nations achieve across antiretroviral any between bisexual border-color border-width decline), example, groups health how may men, number older pre-exposure proportion reached reported reporting research significant social solid; status status, suppression. was way where {font-style {font-weight â€œgetting ART, East For Geneva, Getting HIV. Joint Middle PrEP, Prevention Programme Report Research San South Switzerland Targets UNAIDS UNAIDS. adults age although approximately because black bold can courier; em; estimated even focusing framework gaps having highest increased inject many measured need now person prophylaxis pt;} rate sex should similar still sufficient target these zero.â€� zeroâ€� â€œget


@import gospeak.core.domain.Event
@import gospeak.libs.scala.domain.Markdown
@import gospeak.web.domain.Breadcrumb
@import gospeak.web.pages.orga.events.routes.EventCtrl
@import gospeak.web.pages.orga.partials.html.container
@import gospeak.web.pages.partials.form.html._
@import gospeak.web.utils._
@(event: Event, description: Markdown, form: Form[GsForms.PublishOptions], hasMeetupAccount: Boolean)(b: Breadcrumb)(implicit req: OrgaReq[AnyContent])
@container(s"Publish ${event.name.value}", b)() {
Let's review your event before publishing
@formElt(form, EventCtrl.doPublish(req.group.slug, event.slug)) {
@event.name.value
@event.maxAttendee.map { max => @max.plural("place") }
Options
@inputSwitch(form("notifyMembers"), List("label" -> "Notify group members"))
@if(req.conf.meetup.isEnabled && hasMeetupAccount) {
@inputSwitch(form("meetup.publish"), List("label" -> "Publish on Meetup (create a draft event)"))
@inputHidden(form("meetup.draft"))
}
Description
@description.render
@actionsVertical() {
@btnCancel(EventCtrl.detail(req.group.slug, event.slug))
@btnSubmit("Publish it!")
}
}
}()


To Do List
Please fill in the form below to create a "To-Do" list:
Name of task:
Date of the task
Time of the task
Location of the task
Have you completed the task?
Choose
Done
Pending
Add
To Do:
Task:
Date:
Time:
Location:
Status:


This keyboard layout is designed for the Dene, Tlicho, North Slavy, south Slavy, and Gwich’in languages of Canada.
(c) 2013-2020 Jim Stauffer


Centered-container
The centered container mixin has several purposes. At it's most basic, it's a way to create a wraper-less container that allows you to have constrained content while being able to set a background color that spans the entire width of the page.
The content is constrained by padding, instead of margin, which allows us to do things like set a background color or image without an additional wrapper container.
In the examples below, we've added an example wrapper to demonstrate the padding boundaries, which are denoted with a dashed border.
Generally, $max-width
is used when we want fixed width containers at large breakpoints.
Finally, the $columns
setting is calculated either from the full width of the container, or in the case of $max-width
, it's computed from the container's max width. This allows for a great amount of flexibility.
Centered-container (10 col)
@include centered-container(8);
Centered-container (12 col)
@include centered-container(12, 0);
In the above example, we're passing an additional parameter for $vspace: 0
, which removes the default top and bottom spacing from the container.
Centered-container (with $max-width: true
)
@include centered-container(12, $max-width: true);
When passed the $max-width: true
setting, the centered container mixin stops growing at the projects $max-container-width
size (minus the current $grid-media
's gutters)
Centered-container (with $max-width: 800px
)
@include centered-container(12, $max-width: 800px);
When passed a $max-width: 800px
value, the centered container mixin stops growing at the specified width (minus the current $grid-media
's gutters)
@include grid-column(1 of 2)
@include grid-column(1 of 2)
Centered-container (with max-width: 800px
, and $grid-collapse: true
)
@include centered-container(12, $max-width: 800px, $grid-collapse: true);
When passed a $max-width: 800px
value, combined with $grid-collapse: true
, the centered container mixin stops growing at the specified width (while consuming the current $grid-media
's gutters)
@include grid-column(1 of 2)
@include grid-column(1 of 2)
Putting it all together: $responsive-container();
The responsive-container();
mixin consumes a sass map of containers and breakpoints, which allows you to create a customized experience that varies by breakpoint.
$_vspace: 1em;
$_container: (
xs: ( columns: 8, grid-media: $media-xs-only, v-space: $_vspace, max-width: false, grid-collapse: false ),
sm: ( columns: 8, grid-media: $media-sm-only, v-space: $_vspace, max-width: false, grid-collapse: false ),
md: ( columns: 6, grid-media: $media-md-only, v-space: $_vspace, max-width: false, grid-collapse: false ),
lg: ( columns: 12, grid-media: $media-lg-only, v-space: $_vspace, max-width: false, grid-collapse: false ),
xl: ( columns: 12, grid-media: $media-xl, v-space: $_vspace, max-width: true, grid-collapse: false ),
print: ( columns: 8, grid-media: $media-print, v-space: $_vspace, max-width: true, grid-collapse: false ),
);
@include responsive-container($_container);


In this project, you will evaluate the performance and predictive power of a model that has been trained and tested on data collected from homes in suburbs of Boston, Massachusetts. A model trained on this data that is seen as a good fit could then be used to make certain predictions about a home — in particular, its monetary value. This model would prove to be invaluable for someone like a real estate agent who could make use of such information on a daily basis.
The dataset for this project originates from the UCI Machine Learning Repository. The Boston housing data was collected in 1978 and each of the 506 entries represent aggregated data about 14 features for homes from various suburbs in Boston, Massachusetts. For the purposes of this project, the following preprocessing steps have been made to the dataset:
- 16 data points have an 'MEDV'
value of 50.0. These data points likely contain missing or censored values and have been removed.
- 1 data point has an 'RM'
value of 8.78. This data point can be considered an outlier and has been removed.
- The features 'RM'
, 'LSTAT'
, 'PTRATIO'
, and 'MEDV'
are essential. The remaining non-relevant features have been excluded.
- The feature 'MEDV'
has been multiplicatively scaled to account for 35 years of market inflation.
Run the code cell below to load the Boston housing dataset, along with a few of the necessary Python libraries required for this project. You will know the dataset loaded successfully if the size of the dataset is reported.
# Import libraries necessary for this project
import numpy as np
import pandas as pd
from sklearn.cross_validation import ShuffleSplit
# Import supplementary visualizations code visuals.py
import visuals as vs
# Pretty display for notebooks
%matplotlib inline
# Load the Boston housing dataset
data = pd.read_csv('housing.csv')
prices = data['MEDV']
features = data.drop('MEDV', axis = 1)
# Success
print("Boston housing dataset has {} data points with {} variables each.".format(*data.shape))
Boston housing dataset has 489 data points with 4 variables each.
/opt/conda/lib/python3.6/site-packages/sklearn/cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
/opt/conda/lib/python3.6/site-packages/sklearn/learning_curve.py:22: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the functions are moved. This module will be removed in 0.20
DeprecationWarning)
In this first section of this project, you will make a cursory investigation about the Boston housing data and provide your observations. Familiarizing yourself with the data through an explorative process is a fundamental practice to help you better understand and justify your results.
Since the main goal of this project is to construct a working model which has the capability of predicting the value of houses, we will need to separate the dataset into features and the target variable. The features, 'RM'
, 'LSTAT'
, and 'PTRATIO'
, give us quantitative information about each data point. The target variable, 'MEDV'
, will be the variable we seek to predict. These are stored in features
and prices
, respectively.
For your very first coding implementation, you will calculate descriptive statistics about the Boston housing prices. Since numpy
has already been imported for you, use this library to perform the necessary calculations. These statistics will be extremely important later on to analyze various prediction results from the constructed model.
In the code cell below, you will need to implement the following:
- Calculate the minimum, maximum, mean, median, and standard deviation of 'MEDV'
, which is stored in prices
.
- Store each calculation in their respective variable.
# TODO: Minimum price of the data
minimum_price = np.min(prices)
# TODO: Maximum price of the data
maximum_price = np.max(prices)
# TODO: Mean price of the data
mean_price = np.mean(prices)
# TODO: Median price of the data
median_price = np.median(prices)
# TODO: Standard deviation of prices of the data
std_price = np.std(prices)
# Show the calculated statistics
print("Statistics for Boston housing dataset:\n")
print("Minimum price: ${:,.2f}".format(minimum_price))
print("Maximum price: ${:,.2f}".format(maximum_price))
print("Mean price: ${:,.2f}".format(mean_price))
print("Median price ${:,.2f}".format(median_price))
print("Standard deviation of prices: ${:,.2f}".format(std_price))
Statistics for Boston housing dataset:
Minimum price: $105,000.00
Maximum price: $1,024,800.00
Mean price: $454,342.94
Median price $438,900.00
Standard deviation of prices: $165,171.13
As a reminder, we are using three features from the Boston housing dataset: 'RM'
, 'LSTAT'
, and 'PTRATIO'
. For each data point (neighborhood):
- 'RM'
is the average number of rooms among homes in the neighborhood.
- 'LSTAT'
is the percentage of homeowners in the neighborhood considered “lower class” (working poor).
- 'PTRATIO'
is the ratio of students to teachers in primary and secondary schools in the neighborhood.
** Using your intuition, for each of the three features above, do you think that an increase in the value of that feature would lead to an increase in the value of 'MEDV'
or a decrease in the value of 'MEDV'
? Justify your answer for each.**
Hint: This problem can phrased using examples like below.
* Would you expect a home that has an 'RM'
value(number of rooms) of 6 be worth more or less than a home that has an 'RM'
value of 7?
* Would you expect a neighborhood that has an 'LSTAT'
value(percent of lower class workers) of 15 have home prices be worth more or less than a neighborhood that has an 'LSTAT'
value of 20?
* Would you expect a neighborhood that has an 'PTRATIO'
value(ratio of students to teachers) of 10 have home prices be worth more or less than a neighborhood that has an 'PTRATIO'
value of 15?
**Answer: **
'RM'
- Increase in the value of RM would lead to an increase in the value of MEDV
- Because a higher number of rooms takes more space, which usually would make the home price higher given other factors remaining the same.
'LSTAT'
- Increase in the value of LSTAT would lead to an decrease in the value of MEDV
- Since the more the lower class workers, the more affordable the homes are in the neighborhood, meaning the home price is expected to be lower.
'PTRATIO'
- Increase in the value of PTRATIO would lead to an decrease in the value of MEDV
- Since a higher PTRATIO means in average, a teacher is pairing with more students, it could reflect that the educational resources are becoming fewer. Typically, it’s the scenario in less-rich area compared to rich area, so the corresponding home price in such neighborhood is expected to decrease accordingly.
Note:
Both the scatter plot and the correlation matrix below would visually support that the relationship between MEDV and RM is possitive, the relationship between MEDV and LSTAT is negative, and the relationship between MEDV and PTRATIO is also negative.
Scatter Plot
# Use pyplot and seaborn
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
plt.figure(figsize = (18, 5))
for i, col in enumerate(features.columns):
# Plots for 3 features
plt.subplot(1, 3, i+1)
x = features[col]
y = prices
plt.plot(x, y, 'o')
# Overlay regression line
a, b = np.polyfit(x, y, 1)
plt.plot(x, a*x + b, '-')
plt.title(col)
plt.xlabel(col)
plt.ylabel('Prices')
Correlation Matrix
import numpy as np
import pandas as pd
# Put MEDV as the first column to better visualize correlation matrix plot
data_c = pd.concat([pd.DataFrame(prices), features], axis = 1)
corr = data_c.corr()
# Plot correlation matrix
fig = plt.figure()
ax = fig.add_subplot(111)
cax = ax.matshow(corr, vmin = -1, vmax = 1)
fig.colorbar(cax)
ticks = np.arange(0, 4, 1)
ax.set_xticks(ticks)
ax.set_yticks(ticks)
ax.set_xticklabels(data_c.columns.values)
ax.set_yticklabels(data_c.columns.values)
ax.set_title('Correlation Matrix between Prices and Features', y = 1.08)
plt.show()
In this second section of the project, you will develop the tools and techniques necessary for a model to make a prediction. Being able to make accurate evaluations of each model’s performance through the use of these tools and techniques helps to greatly reinforce the confidence in your predictions.
It is difficult to measure the quality of a given model without quantifying its performance over training and testing. This is typically done using some type of performance metric, whether it is through calculating some type of error, the goodness of fit, or some other useful measurement. For this project, you will be calculating the coefficient of determination, R2, to quantify your model’s performance. The coefficient of determination for a model is a useful statistic in regression analysis, as it often describes how “good” that model is at making predictions.
The values for R2 range from 0 to 1, which captures the percentage of squared correlation between the predicted and actual values of the target variable. A model with an R2 of 0 is no better than a model that always predicts the mean of the target variable, whereas a model with an R2 of 1 perfectly predicts the target variable. Any value between 0 and 1 indicates what percentage of the target variable, using this model, can be explained by the features. A model can be given a negative R2 as well, which indicates that the model is arbitrarily worse than one that always predicts the mean of the target variable.
For the performance_metric
function in the code cell below, you will need to implement the following:
- Use r2_score
from sklearn.metrics
to perform a performance calculation between y_true
and y_predict
.
- Assign the performance score to the score
variable.
# TODO: Import 'r2_score'
from sklearn.metrics import r2_score
def performance_metric(y_true, y_predict):
""" Calculates and returns the performance score between
true and predicted values based on the metric chosen. """
# TODO: Calculate the performance score between 'y_true' and 'y_predict'
score = r2_score(y_true, y_predict)
# Return the score
return score
Assume that a dataset contains five data points and a model made the following predictions for the target variable:
| True Value | Prediction |
|---|---|
| 3.0 | 2.5 |
| -0.5 | 0.0 |
| 2.0 | 2.1 |
| 7.0 | 7.8 |
| 4.2 | 5.3 |
Run the code cell below to use the performance_metric
function and calculate this model’s coefficient of determination.
# Calculate the performance of this model
score = performance_metric([3, -0.5, 2, 7, 4.2], [2.5, 0.0, 2.1, 7.8, 5.3])
print("Model has a coefficient of determination, R^2, of {:.3f}.".format(score))
Model has a coefficient of determination, R^2, of 0.923.
** Hint: ** The R2 score is the proportion of the variance in the dependent variable that is predictable from the independent variable. In other words: * R2 score of 0 means that the dependent variable cannot be predicted from the independent variable. * R2 score of 1 means the dependent variable can be predicted from the independent variable. * R2 score between 0 and 1 indicates the extent to which the dependent variable is predictable. An * R2 score of 0.40 means that 40 percent of the variance in Y is predictable from X.
Answer:
Your next implementation requires that you take the Boston housing dataset and split the data into training and testing subsets. Typically, the data is also shuffled into a random order when creating the training and testing subsets to remove any bias in the ordering of the dataset.
For the code cell below, you will need to implement the following:
- Use train_test_split
from sklearn.cross_validation
to shuffle and split the features
and prices
data into training and testing sets.
- Split the data into 80% training and 20% testing.
- Set the random_state
for train_test_split
to a value of your choice. This ensures results are consistent.
- Assign the train and testing splits to X_train
, X_test
, y_train
, and y_test
.
# TODO: Import 'train_test_split'
from sklearn.cross_validation import train_test_split
# TODO: Shuffle and split the data into training and testing subsets
X_train, X_test, y_train, y_test = train_test_split(features, prices, test_size = 0.2, random_state = 23)
# Success
print("Training and testing split was successful.")
Training and testing split was successful.
Hint: Think about how overfitting or underfitting is contingent upon how splits on data is done.
**Answer: **
In this third section of the project, you’ll take a look at several models’ learning and testing performances on various subsets of training data. Additionally, you’ll investigate one particular algorithm with an increasing 'max_depth'
parameter on the full training set to observe how model complexity affects performance. Graphing your model’s performance based on varying criteria can be beneficial in the analysis process, such as visualizing behavior that may not have been apparent from the results alone.
The following code cell produces four graphs for a decision tree model with different maximum depths. Each graph visualizes the learning curves of the model for both training and testing as the size of the training set is increased. Note that the shaded region of a learning curve denotes the uncertainty of that curve (measured as the standard deviation). The model is scored on both the training and testing sets using R2, the coefficient of determination.
Run the code cell below and use these graphs to answer the following question.
# Produce learning curves for varying training set sizes and maximum depths
vs.ModelLearning(features, prices)
Hint: Are the learning curves converging to particular scores? Generally speaking, the more data you have, the better. But if your training and testing curves are converging with a score above your benchmark threshold, would this be necessary? Think about the pros and cons of adding more training points based on if the training and testing curves are converging.
**Answer: **
The following code cell produces a graph for a decision tree model that has been trained and validated on the training data using different maximum depths. The graph produces two complexity curves — one for training and one for validation. Similar to the learning curves, the shaded regions of both the complexity curves denote the uncertainty in those curves, and the model is scored on both the training and validation sets using the performance_metric
function.
** Run the code cell below and use this graph to answer the following two questions Q5 and Q6. **
vs.ModelComplexity(X_train, y_train)
Hint: High bias is a sign of underfitting(model is not complex enough to pick up the nuances in the data) and high variance is a sign of overfitting(model is by-hearting the data and cannot generalize well). Think about which model(depth 1 or 10) aligns with which part of the tradeoff.
**Answer: **
** Hint: ** Look at the graph above Question 5 and see where the validation scores lie for the various depths that have been assigned to the model. Does it get better with increased depth? At what point do we get our best validation score without overcomplicating our model? And remember, Occams Razor states “Among competing hypotheses, the one with the fewest assumptions should be selected.”
**Answer: **
In this final section of the project, you will construct a model and make a prediction on the client’s feature set using an optimized model from fit_model
.
** Hint: ** When explaining the Grid Search technique, be sure to touch upon why it is used, what the ‘grid’ entails and what the end goal of this method is. To solidify your answer, you can also give an example of a parameter in a model that can be optimized using this approach.
**Answer: ** - Grid search is a traditional way of performing hyperparameter optimization, which is an exhaustive searching through a manually specified subset of the hyperparameter space of a learning algorithm. The manually specified subset of the hyperparameter space is usually determined by heuristics. - A grid search algorithm must be guided by some performance metric, typically measured by cross-validation on the training set or evaluation on a held-out validation set. Cross validations is not always needed for grid search. - For example, we could have a grid with the following values for a parameter pair (gamma, C): (0.1, 1), (0.1, 10), (0.1, 100), (1, 1), (1, 10) and (1, 100) for a SVM model. It’s a grid because it’s similar to a product of [0.1, 1] for gamma and [1, 10, 100] for C. In this example, grid search would basically train a SVM model for each of these six pairs of (gamma, C) values, then we can evaluate it using cross-validation, and select the pair of (gamma, C) that makes the SVM model best fit the data.
What is the k-fold cross-validation training technique?
What benefit does this technique provide for grid search when optimizing a model?
Hint: When explaining the k-fold cross validation technique, be sure to touch upon what ‘k’ is, how the dataset is split into different parts for training and testing and the number of times it is run based on the ‘k’ value.
When thinking about how k-fold cross validation helps grid search, think about the main drawbacks of grid search which are hinged upon using a particular subset of data for training or testing and how k-fold cv could help alleviate that. You can refer to the docs for your answer.
**Answer: ** - K-fold cross-validation training technique - K-fold cross-validation training technique partitions the original training data set into K equal subsets, i.e. K folds. - Each fold acts as the validation set exactly once, and acts as the cross validation training set K-1 times. - Each time, train the machine learning model using the cross validation training set and calculate the accuracy of the model by validating the predicted results against the validation set. - Estimate the accuracy of the machine learning model by averaging the accuracies derived in all the K cases of cross validation.
Your final implementation requires that you bring everything together and train a model using the decision tree algorithm. To ensure that you are producing an optimized model, you will train the model using the grid search technique to optimize the 'max_depth'
parameter for the decision tree. The 'max_depth'
parameter can be thought of as how many questions the decision tree algorithm is allowed to ask about the data before making a prediction. Decision trees are part of a class of algorithms called supervised learning algorithms.
In addition, you will find your implementation is using ShuffleSplit()
for an alternative form of cross-validation (see the 'cv_sets'
variable). While it is not the K-Fold cross-validation technique you describe in Question 8, this type of cross-validation technique is just as useful!. The ShuffleSplit()
implementation below will create 10 ('n_splits'
) shuffled sets, and for each shuffle, 20% ('test_size'
) of the data will be used as the validation set. While you’re working on your implementation, think about the contrasts and similarities it has to the K-fold cross-validation technique.
Please note that ShuffleSplit has different parameters in scikit-learn versions 0.17 and 0.18.
For the fit_model
function in the code cell below, you will need to implement the following:
- Use DecisionTreeRegressor
from sklearn.tree
to create a decision tree regressor object.
- Assign this object to the 'regressor'
variable.
- Create a dictionary for 'max_depth'
with the values from 1 to 10, and assign this to the 'params'
variable.
- Use make_scorer
from sklearn.metrics
to create a scoring function object.
- Pass the performance_metric
function as a parameter to the object.
- Assign this scoring function to the 'scoring_fnc'
variable.
- Use GridSearchCV
from sklearn.grid_search
to create a grid search object.
- Pass the variables 'regressor'
, 'params'
, 'scoring_fnc'
, and 'cv_sets'
as parameters to the object.
- Assign the GridSearchCV
object to the 'grid'
variable.
# TODO: Import 'make_scorer', 'DecisionTreeRegressor', and 'GridSearchCV'
from sklearn.metrics import make_scorer
from sklearn.tree import DecisionTreeRegressor
from sklearn.grid_search import GridSearchCV
def fit_model(X, y):
""" Performs grid search over the 'max_depth' parameter for a
decision tree regressor trained on the input data [X, y]. """
# Create cross-validation sets from the training data
# sklearn version 0.18: ShuffleSplit(n_splits=10, test_size=0.1, train_size=None, random_state=None)
# sklearn versiin 0.17: ShuffleSplit(n, n_iter=10, test_size=0.1, train_size=None, random_state=None)
cv_sets = ShuffleSplit(X.shape[0], n_iter = 10, test_size = 0.20, random_state = 0)
# TODO: Create a decision tree regressor object
regressor = DecisionTreeRegressor()
# TODO: Create a dictionary for the parameter 'max_depth' with a range from 1 to 10
params = {'max_depth': list(range(1, 11))}
# TODO: Transform 'performance_metric' into a scoring function using 'make_scorer'
scoring_fnc = make_scorer(performance_metric)
# TODO: Create the grid search cv object --> GridSearchCV()
# Make sure to include the right parameters in the object:
# (estimator, param_grid, scoring, cv) which have values 'regressor', 'params', 'scoring_fnc', and 'cv_sets' respectively.
grid = GridSearchCV(regressor, params, scoring_fnc, cv = cv_sets)
# Fit the grid search object to the data to compute the optimal model
grid = grid.fit(X, y)
# Return the optimal model after fitting the data
return grid.best_estimator_
/opt/conda/lib/python3.6/site-packages/sklearn/grid_search.py:42: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. This module will be removed in 0.20.
DeprecationWarning)
Once a model has been trained on a given set of data, it can now be used to make predictions on new sets of input data. In the case of a decision tree regressor, the model has learned what the best questions to ask about the input data are, and can respond with a prediction for the target variable. You can use these predictions to gain information about data where the value of the target variable is unknown — such as data the model was not trained on.
Run the code block below to fit the decision tree regressor to the training data and produce an optimal model.
# Fit the training data to the model using grid search
reg = fit_model(X_train, y_train)
# Produce the value for 'max_depth'
print("Parameter 'max_depth' is {} for the optimal model.".format(reg.get_params()['max_depth']))
Parameter 'max_depth' is 5 for the optimal model.
# Get all parameters for the best model
reg.get_params()
{'criterion': 'mse',
'max_depth': 5,
'max_features': None,
'max_leaf_nodes': None,
'min_impurity_decrease': 0.0,
'min_impurity_split': None,
'min_samples_leaf': 1,
'min_samples_split': 2,
'min_weight_fraction_leaf': 0.0,
'presort': False,
'random_state': None,
'splitter': 'best'}
** Hint: ** The answer comes from the output of the code snipped above.
**Answer: **
Imagine that you were a real estate agent in the Boston area looking to use this model to help price homes owned by your clients that they wish to sell. You have collected the following information from three of your clients:
| Feature | Client 1 | Client 2 | Client 3 |
|---|---|---|---|
| Total number of rooms in home | 5 rooms | 4 rooms | 8 rooms |
| Neighborhood poverty level (as %) | 17% | 32% | 3% |
| Student-teacher ratio of nearby schools | 15-to-1 | 22-to-1 | 12-to-1 |
Hint: Use the statistics you calculated in the Data Exploration section to help justify your response. Of the three clients, client 3 has has the biggest house, in the best public school neighborhood with the lowest poverty level; while client 2 has the smallest house, in a neighborhood with a relatively high poverty rate and not the best public schools.
Run the code block below to have your optimized model make predictions for each client’s home.
# Produce a matrix for client data
client_data = [[5, 17, 15], # Client 1
[4, 32, 22], # Client 2
[8, 3, 12]] # Client 3
# Show predictions
for i, price in enumerate(reg.predict(client_data)):
print("Predicted selling price for Client {}'s home: ${:,.2f}".format(i+1, price))
Predicted selling price for Client 1's home: $421,095.65
Predicted selling price for Client 2's home: $230,522.73
Predicted selling price for Client 3's home: $964,162.50
**Answer: **
An optimal model is not necessarily a robust model. Sometimes, a model is either too complex or too simple to sufficiently generalize to new data. Sometimes, a model could use a learning algorithm that is not appropriate for the structure of the data given. Other times, the data itself could be too noisy or contain too few samples to allow a model to adequately capture the target variable — i.e., the model is underfitted.
Run the code cell below to run the fit_model
function ten times with different training and testing sets to see how the prediction for a specific client changes with respect to the data it’s trained on.
vs.PredictTrials(features, prices, fit_model, client_data)
Trial 1: $391,183.33
Trial 2: $419,700.00
Trial 3: $415,800.00
Trial 4: $420,622.22
Trial 5: $418,377.27
Trial 6: $411,931.58
Trial 7: $399,663.16
Trial 8: $407,232.00
Trial 9: $351,577.61
Trial 10: $413,700.00
Range in prices: $69,044.61
Hint: Take a look at the range in prices as calculated in the code snippet above. Some questions to answering: - How relevant today is data that was collected from 1978? How important is inflation? - Are the features present in the data sufficient to describe a home? Do you think factors like quality of apppliances in the home, square feet of the plot area, presence of pool or not etc should factor in? - Is the model robust enough to make consistent predictions? - Would data collected in an urban city like Boston be applicable in a rural city? - Is it fair to judge the price of an individual home based on the characteristics of the entire neighborhood?
**Answer: **


Sunspring, the first film written by an artificial intelligence, opens up a lot of questions about culture and tech: Do science fiction films written by an artificial intelligence pass the Turing test? What about the Bechdel test? How is meaning constructed in art as technology transforms the tools we use to create it, and these tools develop a life of their own?
"In a future with mass unemployment, young people are forced to sell blood."
Filmmaker Oscar Sharp (Therefore Films) and technologist Ross Goodwin created a film entitled "Sunspring" in the summer of 2016. Their goal was to win a short film competition with a screenplay written entirely by a computer. Specifically, the 48-hour film competition in the Sci-Fi-London Film Festival.
Watch Sunspring before reading any further to see what exactly they produced with the help of a neural network, a cast of three actors, and 48 hours to film and edit:
Therefore Films has also released the full text of the screenplay in PDF form, if you wanted to read it to be sure that you didn't understand every third line.
Between the lines of what seems like nonsense on first glance is an exciting gap that is opened in this film collaboration between human and machine: the occasional line is meaningful and some, such as "I am not a bright light," are downright poetic.
The source material fed into the neural network included every episode of The X Files, Stargate SG-1, Star Trek, and Futurama, in addition to hundreds of other science fiction films and television series with screenplays available online – and some not normally categorized as science fiction, like Silver Linings Playbook.
Thomas Middleditch (best known for his role in HBO's Silicon Valley) plays a character named H; Humphrey Ker (a British actor involved in several BBC sketch shows) is named C; and Elisabeth Gray (who appears in the television adaptation of Limitless, and has several writer, producer, and director credits to her name as well) another character named H, who was changed to H2 by Sharp for clarity. The artificial intelligence's lack of affinity for naming characters is baffling for several reasons discussed later (it does appear to understand names...).
The first line spoken, "In a future with mass unemployment, young people are forced to sell blood," was a prompt from the sci-fi festival. The rest of the dialogue and stage directions were entirely generated by the neural network, which also wrote the song at the end of the film based on a database of 30,000 folk songs, titled "Home On The Land" and recorded by Brooklyn duo Tiger and Man:
The conviction with which these professional actors commit to their performance of the dialogue is reminiscent of Joss Whedon's Firefly characters speaking hilariously bad Mandarin Chinese, but almost every review of the film states that through their commitment, they have elevated the script from being complete gibberish.
"Whatever you want to know about the presence of the story, I'm a little bit of a boy on the floor"
It would be impossible for this film to pass the Bechdel test, which requires a film (or any work of fiction) to feature at least two women talking to each other about something other than a man, since there is only one woman.
After much tense dialogue, things end badly for both male characters (Ker is found murdered on the floor of what looks like a spaceship gangway, and Middleditch is last seen pointing a spray painted Nerf gun blaster into his own mouth - although some interpret this as a dream sequence), and the film closes with a long monologue by Elisabeth Gray alone, delivered to the camera.
Her ending monologue contains the pronouns "he" and "him" 22 times in 23 sentences, and most interpretations of the film believe she is talking about the characters H and C. Almost all reviewers note how powerful the ending monologue is, thanks to Gray's performance.
But the effect this monologue has on the audience also has a lot to do with our willingness to believe these men's stories are her focus. Our attempt to attach the male characters to her vague sentences, the bizarre imposition of a love triangle on a script with no implied character relationships, and the archetypes available to her character as the sole survivor, are all essential to feeling moved by the final scene (and the single tear dripping down her cheek doesn't hurt, either).
The shaky structure of meaning that we construct for the film relies on this scaffolding consisting of predictable content, embodied interpretation, and cultural knowledge; if any of these were more lacking, it would completely collapse.
"I don't know what you're talking about."
"The principle is completely constructed for the same time"
In an article accompanying the film's online debut on Ars Technica, Oscar Sharp reveals a lot more information about the way it was made, its progress in the film competition, and his own director's commentary on the process and the finished piece.
Sharp has called it "an amazing funhouse mirror to hold up to various bodies of cultural content and reflect what they are" pointing out that while the script is based on science fiction tropes, so are the actors' choices as they grapple with a lack of perceived meaning in the script. The meaning they impose in their choices, and the meaning we project on them as an audience absorbing the combination of choices by the actors and the algorithm, are all syntheses of culture that we are so steeped in that we may not stop to question or properly examine them without teasing out these layers.
If you want to read a full line-by-line analysis, CineFiles Reviews has created their own interpretation of the screenplay, which provides many alternatives to the way the film was interpreted in shooting and editing.
This openness to interpretation would be one of the most exciting features about the authorship of an artificial intelligence... if the AI's authorship of itself weren't also so fascinating.
The artist formerly known as Jetson
The algorithm which produced the screenplay is likened in the introduction to the film to predictive text ("Just above your smartphone keyboard lies an artificial intelligence"). Predictive text, Google Translate, and Amazon Alexa all use a similar type of programming to what was used to write Sunspring, called a long short-term memory recurrent neural network (or LSTM RNN).
These technologies are well-known and widely used, but the results produced in the computer called "Jetson" (most likely one of the Jetson family of NVIDIA hardware products) were anything but typical.
After Sunspring made the top ten films, there was a voting process open to the public for the winner of the 48-hour film festival. According to Ars Technica, other competitors in the top ten films were already using bots to hack the voting process, and it was the director Sharp's idea to also use Jetson to hack their way to the top of the polls.
Immediately after, Sharp made a call to the head of the film festival claiming no responsibility for Jetson's actions.
This stunt then led to an interview with the computer on stage, where the following exchange took place:
What do you think of your historic nomination against human opponents in this contest?
I was pretty excited.
I think I can see the feathers when they release their hearts. It's like a breakdown of the facts. So they should be competent with the fact that they won't be surprised.
What is the future of machine written entertainment?
It's a bit sudden.
I was thinking of the spirit of the men who found me and the children who were all manipulated and full of children. I was worried about my command. I was the scientist of the Holy Ghost.
What's next for you?
Here we go. The staff is divided by the train of the burning machine building with sweat. No one will see your face. The children reach into the furnace, but the light is still slipping to the floor. The world is still embarrassed.
The party is with your staff.
My name is Benjamin.
From thenceforth, the artificial intelligence in the computer formerly known as Jetson was named Benjamin.
After all of this controversy, with the artificial intelligence constructing its own identity as a writer and the vote hacking scandal, one judge was quoted saying, "I'll give them top marks if they promise never to do this again."
However, Benjamin has some other ideas about their future involvement. Ars Technica's reporters asked "Are you an author?" and Benjamin replied, "Yes you know what I’m talking about." When posed the question of whether they would join the Writers Guild of America, Benjamin asserted, "Yes, I would like to see you at the club tomorrow."
In another interview with the AI reported by Australian news outlet AM, Benjamin makes it clear they aren't going anywhere:
ANTHONY STEWART: What do you want to tell me?
BENJAMIN (automated voice): I think I'll excuse you.
ANTHONY STEWART: So what is the future of artificial intelligence, then?
BENJAMIN (automated voice): We don't know who you are. We are all the same.

BENJAMIN (automated voice): I missed you. I'm sure you see you will be my servant."
It's No Game
In April of this year, Therefore Films released "It's No Game" featuring David Hasselhoff, another short film partially constructed by Benjamin, but only in select areas, so it has a more straightforward plot.
It centers on the idea that Benjamin's vision of the future comes true: eventually all writers, actors, and media producers will eventually be controlled by data-driven nanobots. This level of computer control blurs the lines between fiction and reality and entraps (or, as one character argues, frees) us in the "perfect choreography" of an endless narrative.
The computer-generated bits of this screenplay are based on several different corpuses: "HASSELBOT," containing all of David Hasselhoff's film and TV works, "SORKINATOR," based on all Aaron Sorkin-related productions, and "ROBOBARD," the complete works of William Shakespeare, among others.
Sharp is making a smart commentary, but in a rather blunt way.
The dance sequence and end monologue by Hasselhoff which were written by Benjamin lack the same surreality and unnervingness of Elisabeth Gray's end monologue, because it's obvious that the actors are in on the joke that they are being controlled by the AI. Having them play the part of people taken over by computers is not nearly as fascinating as actually giving over their full craft of acting to actualize pure bot poetry.
Maybe it says more about the creators of these films' fear of losing authorial control that the sequel about AI's takeover was only partially written by artificial intelligence.
It would be interesting to create a training set of films specifically revolving around this fear (from the O.G. Rossum's Universal Robots to all of the Terminator films and their television derivatives, and everything ever directed by Ridley Scott) and then seeing how Benjamin could interpret them and play them back to us, eliminating the self-conscious layer of human authorial assertion.
It may never be forgiven, but that is just too bad
Reviewers that say "looks like screenwriters' jobs are safe!" (a position taken by io9, Digital Trends, Slate, and Curator magazine) in response to Sunspring don't give enough credit to the audience's ability to construct meaning. As Allie Gemmill wrote for Bustle: "It recalls the enigmatic nonsensicality of Samuel Beckett."
Benjamin knows exactly what they're doing, and perhaps knows more about us than we know about ourselves. As science fiction so often holds up a mirror to our deepest fears, so does its remixing.
Several summaries of the film point out the moment when Middleditch coughs up an eyeball as one of the wacky vagaries of writing with AI, but this scene can also serve as a metaphor for our use of AI as a creative tool: we can now produce, via spontaneous regurgitation, an autonomous eye which we must turn on ourselves to see through clearly.
Will we continue to create and watch more AI sci-fi films? Definitely. They just may have to have their own film festivals, by and for AI.


Product List
Add Product
ID
Product Name
Product Price
Category
Description
Functions
NEW PRODUCT
ID:
*
Product Name:
*
Product Price:
*
Product Category:
*
Description:
Add Product
JavaScript support is needed to use this page.
This is a success message.
Loading, please wait...