text:
Q: Unity android build closes on startup I've got a complete unity project and I want to build it for android.
The problem is that it works in an emulator like Nox but it crashes on an actual android device.
I exported it to an android project and imported it into android studio and I'm getting the following logcat:

    07-19 11:56:53.762 15123-15123/com.arioweb.plannerce W/ActivityThread: Application com.arioweb.plannerce is waiting for the debugger on port 8100...
    07-19 11:56:54.693 15123-15123/com.arioweb.plannerce I/System.out: Sending WAIT chunk
    07-19 11:56:55.554 15123-15129/com.arioweb.plannerce I/dalvikvm: Debugger is active
    07-19 11:56:55.704 15123-15123/com.arioweb.plannerce I/System.out: Debugger has connected
    07-19 11:56:55.704 15123-15123/com.arioweb.plannerce I/System.out: waiting for debugger to settle...
    07-19 11:56:55.904 15123-15123/com.arioweb.plannerce I/System.out: waiting for debugger to settle...
    07-19 11:56:56.105 15123-15123/com.arioweb.plannerce I/System.out: waiting for debugger to settle...
    07-19 11:56:56.305 15123-15123/com.arioweb.plannerce I/System.out: waiting for debugger to settle...
    07-19 11:56:56.505 15123-15123/com.arioweb.plannerce I/System.out: waiting for debugger to settle...
    07-19 11:56:56.705 15123-15123/com.arioweb.plannerce I/System.out: waiting for debugger to settle...
    07-19 11:56:56.905 15123-15123/com.arioweb.plannerce I/System.out: waiting for debugger to settle...
    07-19 11:56:57.106 15123-15123/com.arioweb.plannerce I/System.out: waiting for debugger to settle...
    07-19 11:56:57.306 15123-15123/com.arioweb.plannerce I/System.out: debugger has settled (1388)
    07-19 11:56:58.357 15123-15123/com.arioweb.plannerce D/dalvikvm: Trying to load lib /mnt/asec/com.arioweb.plannerce-1/lib/libmain.so 0x421de508
    07-19 11:56:58.387 15123-15123/com.arioweb.plannerce D/dalvikvm: Added shared lib /mnt/asec/com.arioweb.plannerce-1/lib/libmain.so 0x421de508
    07-19 11:56:58.557 15123-15123/com.arioweb.plannerce I/Unity: splash_mode = 0 (integer)
    07-19 11:56:58.557 15123-15123/com.arioweb.plannerce I/Unity: useObb = False (bool)
    07-19 11:57:01.169 15123-15123/com.arioweb.plannerce I/Unity: onResume
    07-19 11:57:01.890 15123-15123/com.arioweb.plannerce D/libEGL: loaded /vendor/lib/egl/libGLES_vc4.so

                                                                   [ 07-19 11:57:01.890 15123:15123 D/         ]
                                                                   GPU monitor inactive - could not find libgpumonitor.so [Symbol not found: ] or not enabled (debug.egl.hw.gpumonitor = 0)
    07-19 11:57:01.900 15123-15123/com.arioweb.plannerce W/khrn_client: init_window num_buffers 3 min undequeued buffers 1
    07-19 11:57:01.900 15123-15123/com.arioweb.plannerce W/khrn_client: init_window window 0x41713310, 800x480 hintTransform 0x4 do_pre 1
    07-19 11:57:01.900 15123-15123/com.arioweb.plannerce W/khrn_client: init_window using gl pre-rotation, set size and transform to 480x800 0x5
    07-19 11:57:01.940 15123-15123/com.arioweb.plannerce W/gl_server: setting initial viewport with draw 480x800 transposed
    07-19 11:57:01.940 15123-15123/com.arioweb.plannerce D/OpenGLRenderer: Enabling debug mode 0
    07-19 11:57:02.010 15123-15123/com.arioweb.plannerce D/Unity: [EGL] Attaching window :0x41851cd0
    07-19 11:57:02.010 15123-15123/com.arioweb.plannerce D/Unity: [EGL] Attaching window :0x41851cd0
    07-19 11:57:02.020 15123-15123/com.arioweb.plannerce I/Choreographer: Skipped 33 frames!  The application may be doing too much work on its main thread.
    07-19 11:57:02.291 15123-15123/com.arioweb.plannerce I/Unity: windowFocusChanged: true
    07-19 11:57:02.701 15123-15259/com.arioweb.plannerce D/Unity: SystemInfo CPU = ARMv7 VFPv3 NEON, Cores = 2, Memory = 803mb
    07-19 11:57:02.711 15123-15259/com.arioweb.plannerce D/Unity: SystemInfo ARM big.LITTLE configuration: 2 big (mask: 3), 0 little (mask: 0)
    07-19 11:57:04.813 15123-15259/com.arioweb.plannerce D/Unity: [SHA1] 6dbe3e65b8fb090790408ecc3841c2c5a3546bec   26067612 bytes ~ lib/armeabi-v7a/libunity.so
    07-19 11:57:04.813 15123-15259/com.arioweb.plannerce D/Unity: [SHA1] 1cb327e865a8bed20e0f4cf8ec1c15afdfe60a69      25316 bytes ~ lib/armeabi-v7a/libmain.so
    07-19 11:57:05.103 15123-15259/com.arioweb.plannerce D/Unity: [SHA1] ff06c3db324c224f38c4d343d24f0864b2ed0789    3762548 bytes ~ lib/armeabi-v7a/libmono.so
    07-19 11:57:07.145 15123-15259/com.arioweb.plannerce D/Unity: [SHA1] 7e7686ded034be6aa68db4de880738278700526b   29804028 bytes ~ lib/x86/libunity.so
    07-19 11:57:07.145 15123-15259/com.arioweb.plannerce D/Unity: [SHA1] 30791d335d5c0f37184d020d4aaa6331dd3defc6       8120 bytes ~ lib/x86/libmain.so
    07-19 11:57:07.356 15123-15259/com.arioweb.plannerce D/Unity: [SHA1] e7bb23aa5772c3fbf93140004749c88003467024    3632348 bytes ~ lib/x86/libmono.so
    07-19 11:57:07.636 15123-15259/com.arioweb.plannerce D/Unity: Mono path[0] = '/mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed'
    07-19 11:57:07.636 15123-15259/com.arioweb.plannerce D/Unity: Mono config path = 'assets/bin/Data/Managed'
    07-19 11:57:07.896 15123-15259/com.arioweb.plannerce D/Unity: PlayerConnection initialized from /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data (debug = 0)
    07-19 11:57:08.056 15123-15259/com.arioweb.plannerce D/Unity: PlayerConnection initialized network socket : 0.0.0.0 55428
    07-19 11:57:08.096 15123-15259/com.arioweb.plannerce D/Unity: PlayerConnection initialized unix socket : Unity-com.arioweb.plannerce
    07-19 11:57:08.326 15123-15259/com.arioweb.plannerce D/Unity: Multi-casting "[IP] 0.0.0.0 [Port] 55428 [Flags] 3 [Guid] 358875557 [EditorId] 710763119 [Version] 1048832 [Id] AndroidPlayer(samsung_GT-I9082@0.0.0.0) [Debug] 1" to [225.0.0.222:54997]...
    07-19 11:57:08.326 15123-15259/com.arioweb.plannerce D/Unity: Waiting for connection from host on [0.0.0.0:55428]...
    07-19 11:57:13.381 15123-15259/com.arioweb.plannerce D/Unity: Timed out. Continuing without host connection.
    07-19 11:57:13.431 15123-15259/com.arioweb.plannerce D/Unity: Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,defer=y,address=0.0.0.0:56557
    07-19 11:57:14.042 15123-15259/com.arioweb.plannerce W/mono: Symbol file /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/mscorlib.dll.mdb doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/mscorlib.dll
    07-19 11:57:14.092 15123-15259/com.arioweb.plannerce W/mono: Symbol file /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/mscorlib.dll.mdb doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/mscorlib.dll
    07-19 11:57:14.773 15123-15259/com.arioweb.plannerce D/Unity: InitializeScriptEngine OK (4ee1dee0)
    07-19 11:57:14.853 15123-15259/com.arioweb.plannerce D/Unity: PlayerConnection already initialized - listening to [0.0.0.0:55428]
    07-19 11:57:16.184 15123-15259/com.arioweb.plannerce D/Unity: PlayerInitEngineNoGraphics OK
    07-19 11:57:16.404 15123-15259/com.arioweb.plannerce D/Unity: [EGL] Request: ES 2.0 RGB0 000 0/0
    07-19 11:57:16.424 15123-15259/com.arioweb.plannerce D/Unity: [EGL] Found: ID[20] ES 2.0 RGB16 565 0/0
    07-19 11:57:16.434 15123-15259/com.arioweb.plannerce D/Unity: GfxDevice: creating device client; threaded=1
    07-19 11:57:16.454 15123-15259/com.arioweb.plannerce D/Unity: [EGL] Request: ES 2.0 RGB0 000 0/0
    07-19 11:57:16.454 15123-15259/com.arioweb.plannerce D/Unity: [EGL] Found: ID[20] ES 2.0 RGB16 565 0/0
    07-19 11:57:16.454 15123-15259/com.arioweb.plannerce D/Unity: [EGL] Request: ES 2.0 RGBA32 8888 0/0
    07-19 11:57:16.464 15123-15259/com.arioweb.plannerce D/Unity: [EGL] Found: ID[7] ES 2.0 RGBA32 8888 0/0
    07-19 11:57:16.464 15123-15259/com.arioweb.plannerce W/khrn_client: init_window num_buffers 3 min undequeued buffers 1
    07-19 11:57:16.464 15123-15259/com.arioweb.plannerce W/khrn_client: init_window window 0x41851cd0, 800x480 hintTransform 0x4 do_pre 1
    07-19 11:57:16.464 15123-15259/com.arioweb.plannerce W/khrn_client: init_window using gl pre-rotation, set size and transform to 480x800 0x5
    07-19 11:57:16.484 15123-15259/com.arioweb.plannerce D/Unity: ANativeWindow: (800/480) RequestedResolution: (0/0) EGLSurface: (800/480)
    07-19 11:57:16.484 15123-15259/com.arioweb.plannerce W/gl_server: setting initial viewport with draw 480x800 transposed
    07-19 11:57:16.504 15123-15259/com.arioweb.plannerce D/Unity: Renderer: VideoCore IV HW
    07-19 11:57:16.504 15123-15259/com.arioweb.plannerce D/Unity: Vendor:   Broadcom
    07-19 11:57:16.504 15123-15259/com.arioweb.plannerce D/Unity: Version:  OpenGL ES 2.0
    07-19 11:57:16.504 15123-15259/com.arioweb.plannerce D/Unity: GLES:     2
    07-19 11:57:16.504 15123-15259/com.arioweb.plannerce D/Unity: GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_texture_npot GL_OES_depth24 GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_OES_rgb8_rgba8 GL_OES_depth32 GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_EXT_debug_marker
    07-19 11:57:16.504 15123-15259/com.arioweb.plannerce D/Unity: OPENGL LOG: Creating OpenGL ES 2.0 graphics device ; Context level   ; Context handle 1333388240
    07-19 11:57:16.514 15123-15259/com.arioweb.plannerce D/Unity: InitializeGfxDevice OK
    07-19 11:57:16.514 15123-15259/com.arioweb.plannerce D/Unity: Initialize engine version: 5.4.0f3 (a6d8d714de6f)
    07-19 11:57:16.935 15123-15259/com.arioweb.plannerce D/Unity: AudioManager: Selecting AudioTrack output...
    07-19 11:57:16.985 15123-15259/com.arioweb.plannerce W/libc: pthread_create sched_setscheduler call failed: Operation not permitted
    07-19 11:57:17.005 15123-15259/com.arioweb.plannerce D/Unity: Begin MonoManager ReloadAssembly
    07-19 11:57:17.125 15123-15259/com.arioweb.plannerce D/Unity: Platform assembly: /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.dll (this message is harmless)
    07-19 11:57:17.175 15123-15259/com.arioweb.plannerce W/mono: Symbol file LoadedFromMemory doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.dll
    07-19 11:57:17.175 15123-15259/com.arioweb.plannerce D/Unity: Loading /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.dll into Unity Child Domain
    07-19 11:57:17.225 15123-15259/com.arioweb.plannerce W/mono: Symbol file /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.dll.mdb doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.dll
    07-19 11:57:17.545 15123-15259/com.arioweb.plannerce D/Unity: Platform assembly: /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/Assembly-CSharp.dll (this message is harmless)
    07-19 11:57:17.575 15123-15259/com.arioweb.plannerce D/Unity: Loading /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/Assembly-CSharp.dll into Unity Child Domain
    07-19 11:57:17.596 15123-15259/com.arioweb.plannerce D/Unity: Platform assembly: /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.UI.dll (this message is harmless)
    07-19 11:57:17.616 15123-15259/com.arioweb.plannerce W/mono: Symbol file LoadedFromMemory doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.UI.dll
    07-19 11:57:17.616 15123-15259/com.arioweb.plannerce D/Unity: Loading /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.UI.dll into Unity Child Domain
    07-19 11:57:17.626 15123-15259/com.arioweb.plannerce W/mono: Symbol file /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.UI.dll.mdb doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.UI.dll
    07-19 11:57:17.646 15123-15259/com.arioweb.plannerce D/Unity: Platform assembly: /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.Networking.dll (this message is harmless)
    07-19 11:57:17.666 15123-15259/com.arioweb.plannerce W/mono: Symbol file LoadedFromMemory doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.Networking.dll
    07-19 11:57:17.666 15123-15259/com.arioweb.plannerce D/Unity: Loading /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.Networking.dll into Unity Child Domain
    07-19 11:57:17.676 15123-15259/com.arioweb.plannerce W/mono: Symbol file /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.Networking.dll.mdb doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/UnityEngine.Networking.dll
    07-19 11:57:17.726 15123-15259/com.arioweb.plannerce D/Unity: - Completed reload, in  0.717 seconds
    07-19 11:57:17.866 15123-15259/com.arioweb.plannerce D/Unity: Platform assembly: /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/System.Core.dll (this message is harmless)
    07-19 11:57:17.886 15123-15259/com.arioweb.plannerce W/mono: Symbol file /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/System.Core.dll.mdb doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/System.Core.dll
    07-19 11:57:17.906 15123-15259/com.arioweb.plannerce D/Unity: Platform assembly: /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/System.dll (this message is harmless)
    07-19 11:57:17.956 15123-15259/com.arioweb.plannerce W/mono: Symbol file /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/System.dll.mdb doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/System.dll
    07-19 11:57:17.966 15123-15259/com.arioweb.plannerce W/mono: Symbol file /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/System.Core.dll.mdb doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/System.Core.dll
    07-19 11:57:18.016 15123-15259/com.arioweb.plannerce W/mono: Symbol file /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/System.dll.mdb doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/System.dll
    07-19 11:57:18.186 15123-15731/com.arioweb.plannerce E/Unity: GLSL: unsupported array parameter 'unity_WorldToShadow'

                                                                  (Filename: ./Runtime/GfxDevice/opengles/GpuProgramParamsGLES.cpp Line: 246)
    07-19 11:57:18.216 15123-15731/com.arioweb.plannerce E/Unity: GLSL: unsupported array parameter 'unity_WorldToShadow'

                                                                  (Filename: ./Runtime/GfxDevice/opengles/GpuProgramParamsGLES.cpp Line: 246)
    07-19 11:57:18.366 15123-15731/com.arioweb.plannerce E/Unity: -------- GLSL link error: ERROR:LEX/PARSE-2 (line 38) Undefined identifier

                                                                  (Filename: ./Runtime/GfxDevice/opengles/ApiGLES.cpp Line: 685)
    07-19 11:57:18.366 15123-15731/com.arioweb.plannerce D/Unity: Note: Creation of internal variant of shader 'Hidden/Internal-MotionVectors' failed.
    07-19 11:57:18.366 15123-15259/com.arioweb.plannerce D/Unity: WARNING: Shader
    07-19 11:57:18.366 15123-15259/com.arioweb.plannerce D/Unity: Unsupported: 'Hidden/Internal-MotionVectors' - Pass '' has no vertex shader
    07-19 11:57:18.376 15123-15259/com.arioweb.plannerce D/Unity: WARNING: Shader
    07-19 11:57:18.376 15123-15259/com.arioweb.plannerce D/Unity: Unsupported: 'Hidden/Internal-MotionVectors' - Setting to default shader.
    07-19 11:57:18.446 15123-15731/com.arioweb.plannerce E/Unity: GLSL: unsupported array parameter 'unity_LightColor'

                                                                  (Filename: ./Runtime/GfxDevice/opengles/GpuProgramParamsGLES.cpp Line: 246)
    07-19 11:57:18.446 15123-15731/com.arioweb.plannerce E/Unity: GLSL: unsupported array parameter 'unity_LightPosition'

                                                                  (Filename: ./Runtime/GfxDevice/opengles/GpuProgramParamsGLES.cpp Line: 246)
    07-19 11:57:18.546 15123-15259/com.arioweb.plannerce D/Unity: UUID: 7271bef49a8e2ea7 => 2d570d04e4e171fd04daca616270d8a5
    07-19 11:57:18.627 15123-15259/com.arioweb.plannerce D/Unity: PlayerInitEngineGraphics OK
    07-19 11:57:18.627 15123-15259/com.arioweb.plannerce D/Unity: Found 11 native sensors
    07-19 11:57:18.647 15123-15259/com.arioweb.plannerce D/Unity: Sensor :        Accelerometer ( 1) ; 0.153281 / 0.01s ; MPU-6K Accelerometer / Invensense
    07-19 11:57:18.657 15123-15259/com.arioweb.plannerce D/Unity: Sensor :        Accelerometer ( 1) ; 0.153281 / 0.01s ; MPU-6K Accelerometer / Invensense
    07-19 11:57:18.757 15123-15259/com.arioweb.plannerce D/Unity: Requested framebuffer: resolution[800x480], rgba[8/8/8/8], depth+stencil[on], samples[1]
    07-19 11:57:18.757 15123-15259/com.arioweb.plannerce D/Unity: Created framebuffer: resolution[800x480], rgba[8/8/8/8], depth+stencil[0/0], samples[0]
    07-19 11:57:19.227 15123-15123/com.arioweb.plannerce D/ProgressBar: setProgress = 0
    07-19 11:57:19.227 15123-15123/com.arioweb.plannerce D/ProgressBar: setProgress = 0, fromUser = false
    07-19 11:57:19.227 15123-15123/com.arioweb.plannerce D/ProgressBar: mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
    07-19 11:57:19.267 15123-15123/com.arioweb.plannerce D/ProgressBar: updateDrawableBounds: left = 0
    07-19 11:57:19.267 15123-15123/com.arioweb.plannerce D/ProgressBar: updateDrawableBounds: top = 0
    07-19 11:57:19.267 15123-15123/com.arioweb.plannerce D/ProgressBar: updateDrawableBounds: right = 24
    07-19 11:57:19.277 15123-15123/com.arioweb.plannerce D/ProgressBar: updateDrawableBounds: bottom = 24
    07-19 11:57:21.529 15123-15123/com.arioweb.plannerce I/Choreographer: Skipped 61 frames!  The application may be doing too much work on its main thread.
    07-19 11:57:23.071 15123-15123/com.arioweb.plannerce I/Choreographer: Skipped 32 frames!  The application may be doing too much work on its main thread.
    07-19 11:57:24.132 15123-15799/com.arioweb.plannerce W/mono: Symbol file /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/System.dll.mdb doesn't match image /mnt/asec/com.arioweb.plannerce-1/pkg.apk/assets/bin/Data/Managed/System.dll
    07-19 11:57:25.263 15123-15123/com.arioweb.plannerce I/Choreographer: Skipped 41 frames!  The application may be doing too much work on its main thread.
    07-19 11:57:25.844 15123-15123/com.arioweb.plannerce I/Choreographer: Skipped 33 frames!  The application may be doing too much work on its main thread.
    07-19 11:57:26.584 15123-15123/com.arioweb.plannerce I/Choreographer: Skipped 36 frames!  The application may be doing too much work on its main thread.
    07-19 11:57:29.167 15123-15123/com.arioweb.plannerce I/Choreographer: Skipped 139 frames!  The application may be doing too much work on its main thread.
    07-19 11:57:29.387 15123-15123/com.arioweb.plannerce W/egl_server: Allocating storage 1x1 surface type 0x1
    07-19 11:57:30.138 15123-15123/com.arioweb.plannerce I/Choreographer: Skipped 57 frames!  The application may be doing too much work on its main thread.
    07-19 11:57:30.188 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.228 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.278 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.318 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.448 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.498 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.538 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.578 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.628 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.678 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.718 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.758 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.808 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.868 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:30.979 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:31.019 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:31.059 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:31.099 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:31.149 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:31.189 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:31.329 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:31.379 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:31.419 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:32.340 15123-15123/com.arioweb.plannerce I/Choreographer: Skipped 63 frames!  The application may be doing too much work on its main thread.
    07-19 11:57:32.350 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:32.350 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:32.350 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:32.360 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:32.370 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:32.370 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:32.380 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:32.380 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:32.400 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:32.400 15123-15731/com.arioweb.plannerce W/khrn_fruit: khrn_umem_alloc failed
    07-19 11:57:32.440 15123-15731/com.arioweb.plannerce A/libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 15731 (UnityGfxDeviceW)
    07-19 11:57:41.279 15123-15761/com.arioweb.plannerce W/AudioTrack: releaseBuffer() track 0x4fd74928 name=0x2 disabled, restarting

I'm using Unity 5.4.0f3 and I have full serializer to send jason data over the net.


text:
Q: Sort session PHP and MSSQL I'm new using MSSQL and PHP, and I want to sort results from a session, not from a link like sort.php?id.. Anyone can help me doing that?
Here is my code:

Tickets - Informática

      #
      Nome
      Idade
      Peso

<?php
        $serverName = "asfdasasx-fsadasd";
        $options = array(  "UID" => "safs",  "PWD" => "fsadas",  "Database" => "demo");
        $conn = sqlsrv_connect($serverName, $options);
            if( $conn ) {
            $sql="SELECT * FROM cliente";
            $aResult=sqlsrv_query($conn, $sql);
            while($rows = sqlsrv_fetch_array($aResult))
            {
            $id = $rows['id'];
            $nome = $rows['nome'];
            $idade = $rows['idade'];
            $peso = $rows['peso'];
?>

    <?php echo $id;?>
    <?php echo $nome;?>
    <?php echo $idade;?>
    <?php echo $peso;?>

A: Your question is really hard to understand. I'm guessing you want the results of the query to be sorted; if so, just add
$sql="SELECT * FROM cliente ORDER BY 'nome' ASC";

instead of just:
$sql="SELECT * FROM cliente";

You change the name of the field, to order the table by it, changing "nome" to the name of any other row's name.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Unable to bind the data dynamically in multi column Listview in WPF (VS2010) My Xaml is:
<ListView Grid.Column="2" Grid.Row="2" Height="Auto" HorizontalAlignment="Left" Name="listViewResult" VerticalAlignment="Top" Width="Auto">
            <ListView.View>
                <GridView x:Name="gridResult">
                    <GridViewColumn Width="Auto" Header="Server" />
                    <GridViewColumn Width="Auto" Header="Value"/>
                    <GridViewColumn Width="Auto" Header="Availability"/>
                    <GridViewColumn Width="Auto" Header="Status"/>
                </GridView>
            </ListView.View>
        </ListView>

And C# code is:
listViewResult.Items.Clear();

listViewResult.Items.Add(new { Server = "test1", Value = "ABX", Availability = "Yes", Status = "No"});

But the value is not getting display in Multi Column Listview

A: That's because you haven't specified anywhere what to display. You can either specify a GridViewColumn.CellTemplate or simply use DisplayMemberBinding to specify what property of the data object you want to display:
<ListView Grid.Column="2" Grid.Row="2" Height="Auto" HorizontalAlignment="Left" Name="listViewResult" VerticalAlignment="Top" Width="Auto">
    <ListView.View>
        <GridView x:Name="gridResult">
            <GridViewColumn Width="Auto" Header="Server" DisplayMemberBinding="{Binding Server}" />
            <GridViewColumn Width="Auto" Header="Value" DisplayMemberBinding="{Binding Value}"/>
            <GridViewColumn Width="Auto" Header="Availability" DisplayMemberBinding="{Binding Availability}"/>
            <GridViewColumn Width="Auto" Header="Status" DisplayMemberBinding="{Binding Status}"/>
        </GridView>
    </ListView.View>
</ListView>

A: The Header is just what shows up as the column heading.  If all you want is the text associated with the data, you need to add a DisplayMemberBinding to actually put data in the column.
<ListView Grid.Column="2" Grid.Row="2" Height="Auto"
           HorizontalAlignment="Left"
           Name="listViewResult"
           VerticalAlignment="Top" Width="Auto">
            <ListView.View>
                <GridView x:Name="gridResult">
                    <GridViewColumn Width="Auto"
                                    Header="Server"
                                    DisplayMemberBinding="{Binding Server}"/>
                    <GridViewColumn Width="Auto"
                                    Header="Value"
                                    DisplayMemberBinding="{Binding Value}"/>
                    <GridViewColumn Width="Auto"
                                    Header="Availability"
                                    DisplayMemberBinding="{Binding Availability}"/>
                    <GridViewColumn Width="Auto"
                                    Header="Status"
                                    DisplayMemberBinding="{Binding Status}"/>
                </GridView>
            </ListView.View>
        </ListView>

The alternative is to create a CellTemplate with a DataTemplate, if you want more control over the appearance.  For example:
       <GridViewColumn>
            <GridViewColumnHeader Content="Status" />
            <GridViewColumn.CellTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="2,4">
                        <Image Source="Resources\SomePicture.ico"
                               Height="24"
                               Width="24"
                               VerticalAlignment="Center"  />
                        <TextBlock Text="{Binding Status}"
                                   Margin="2, 4"
                                   VerticalAlignment="Center" />
                    </StackPanel>
                </DataTemplate>
            </GridViewColumn.CellTemplate>
        </GridViewColumn>


text:
Q: Multiple criteria search query in Laravel 5 I want to make a complex search on a table with 20 columns.
The user has a form in which he can choose from 0 to 18 criteria to make the search. I capture these criteria in a controller method and return the result to a view. The problem is that I don't know how to construct the query. I tried with 2 criteria, with the below function, but it doesn't return a collection, it's very strange to me what the output of dd($items) is. Anyway, the function doesn't return anything if I remove dd($items), it's like it doesn't find anything in the table (which is impossible because I inserted the criteria in such a way that the function should return something).
public function looksomething($param1=null,$param2=null){
$query= "all()->";
if($param1!=null)
    $query.="where('Field1','$param1')"."
->";
if($param2!=null)
    $query.="where('Field2','$param2')"."
->";
$query.="get()";
$items=tablename::query();
return view('someview',['items'=>$items]);
}

So, in the above function, you can see how I thought I should buid my search query. It resembles the model I had for classic php.
First, I don't know what I'm doing wrong.
Second, does Laravel have some built-in mechanism that builds complex search query ?

A: For simple searching, you could define a scope method in your model that takes an array of parameters as the second argument, and then adds any clauses you need. Something like this:
class SomeModel extends Model
{
    public function scopeFilter($query, array $request)
    {
        if ($request->has('column')) {
            $query = $query->where('column', '=', $request->get('column'));
        }

        // And so on...

        return $query;
    }
}

Then you can just pass request parameters from your controller action to your model:
public function index(Request $request)
{
    $results = SomeModel::filter($request->all())->paginate();

    return view('some.view', compact('results'));
}


text:
Q: dump with old 43BSD,question about tape size On old 43bsd i want to dump /usr
This command works
dump 0uf /dev/rmt12 /dev/ra0a

dump is command 0u mean full and update /etc/dumpdates f mean use /dev/rmt12
and /dev/ra0a is the root partition.
The problem is when i want to dump the /usr wich is big,and tape is see as small tape,but is big enough to contain /usr.
The question is: how to pass the size option?
I have tried
dump 0ufs56000 /dev/rmt12 /dev/ra0g
dump 0us5600f/dev/rmt12 /dev/ra0g
dump 0us5600f /de/rmt12/dev/ra0g

And all fail.
I want to pass the 5600 size to dump,how to do?

A: Solution found
First rewind tape
mt rewind

then pass arguments as this
dump 0udsbf 54000 6000 126 /dev/rmt12 /dev/ra0g

for 2GB 4mm tape
#2g tape
54000     #density
6000      #size
126       #block factor


text:
Q: sample size for test-retest reliability I am interested in estimating the following:

*

*test-retest reliability for ordinal items;

*test-retest reliability for interval-level scale scores consisting of the items; and

*the optimal sample size for (2)

(1) I believe weighted kappa is the best option for test-retest reliability for ordinal items. Correct?
(2) I'm finding conflicting advice: Pearson r or some flavor of ICC.
(3) Shoukri et al. (2004)* report the following about methods for finding the optimal sample size for estimating ICC:

Giraudeau and Mary and Bonett argued that the approach of hypothesis testing may not be appropriate while planning a reliability study. This is because one has to specify both the values of ρ0 and ρ1, which may in practice be a difficult task. An alternative approach is to instead focus on the width [w] of the CI for ρ.

I believe this table applies to test-retest as well as inter-rater, but I'm not certain.

If so, I'm concluding that one would need 52 participants and n=2 time points to estimate ρ=0.80 with a 95% CI width of 0.20 (so 0.7-0.9, I assume). Does this seem accurate?

*Shoukri, M. M., Asyali, M. H., & Donner, A. (2004). Sample size requirements for the design of reliability study: review and new results. Statistical Methods in Medical Research, 13(4), 251-271.


text:
Q: How can I pass the value to state in internal function on React(functional component)? import React, { useState, useEffect, useRef } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { useEffectOnce } from 'usehooks-ts';
import { SportsTypeNavbar } from '../../../mobile/components'
import { getMatches } from '../../../store/actions/mobileSportsActions';
import './mHome.css'

function MHome(props) {

    const dispatch = useDispatch()
    const [timer, setTimer] = useState(null)
    const [isMounted, setIsMounted] = useState(false)

    const [sportTypeId, setSportTypeId] = useState(1);
    const [betradarCategoryId, setBetradarCategoryId] = useState(0);
    const [leagueName, setLeagueName] = useState();
    const [matchState, setMatchState] = useState('home');
    const [startIndex, setStartIndex] = useState(0);
    const [orderByLeague, setOrderByLeague] = useState(false);

    const get_Matches = useSelector(state => state.mobileSportsReducers.getMatches)
    const SportTypeList = useSelector(state => state.mobileSportsReducers.getTypeList);
    const dataFetch = () => {
        console.log('sportTypeId==>', sportTypeId); // sportTypeId -> undefined
        let obj = {
            sportTypeId: (sportTypeId !== undefined ? sportTypeId : 1),
            betradarCategoryId: betradarCategoryId,
            leagueName: leagueName,
            matchState: matchState,
            startIndex: startIndex,
            orderByLeague: orderByLeague
        }
        dispatch(getMatches(obj))
        clearTimeout(timer)
        setTimer(setTimeout(dataFetch, 5000))
    }
    useEffect(() => {
        if (!isMounted) {
            dataFetch()
            setIsMounted(true)
        }
    })
    useEffectOnce(() => {
        dataFetch()
    })
    const sportActiveFunc = (index) => { // sending props function from parent to child component
        setSportTypeId(index);
    }
    console.log('sportTypeId==>', sportTypeId); // output value -> 1
    return (
            <SportsTypeNavbar sportActiveFunc={sportActiveFunc} />
           )
};
export default MHome;

I am trying to set the value from state on this component for sending value by dispatch to server.
This value is coming from child component via sportActiveFunc function.
So here, I can get sportTypeId, but I can't get this state value on dataFetch function.
How can I get this state value?

A: you can simply pass that as props in sportActiveFunc  funtion and have default value for it
like this:
const dataFetch = (id = sportTypeId  ) => {

        let obj = {
            sportTypeId: id ,
            betradarCategoryId: betradarCategoryId,
            leagueName: leagueName,
            matchState: matchState,
            startIndex: startIndex,
            orderByLeague: orderByLeague
        }
        dispatch(getMatches(obj))
        clearTimeout(timer)
        setTimer(setTimeout(dataFetch, 5000))
    }

 const sportActiveFunc = (index) => {
            setSportTypeId(index);
            dataFetch(index)
        }


text:
Q: Access SQL - Multiple OR conditions using checkboxes My query, which kind of works is as follows:
SELECT [copyright status],
sum(IIF(layer='key info',1,0)) AS [Key Info],
sum(IIF(layer='approaches',1,0)) AS [Approaches],
sum(IIF(layer='research',1,0)) AS [Research]
FROM resources
WHERE (IIF(literacy,1,0)) OR (IIF(numeracy,1,0)) OR (IIF(poverty,1,0))
GROUP BY [copyright status]

UNION

SELECT null,
sum(IIF(layer='key info',1,0)) AS [Key Info],
sum(IIF(layer='approaches',1,0)) AS [Approaches],
sum(IIF(layer='research',1,0)) AS [Research]
FROM resources
WHERE (IIF(literacy,1,0)) OR (IIF(numeracy,1,0)) OR (IIF(poverty,1,0))

UNION

SELECT [lw status],
sum(IIF(layer='key info',1,0)) AS [Key Info],
sum(IIF(layer='approaches',1,0)) AS [Approaches],
sum(IIF(layer='research',1,0)) AS [Research]
FROM resources
WHERE (IIF(literacy,1,0)) OR (IIF(numeracy,1,0)) OR (IIF(poverty,1,0)) AND [lw status] = 'In Reserve'
GROUP BY [lw status]

UNION

SELECT [lw status],
sum(IIF(layer='key info',1,0)) AS [Key Info],
sum(IIF(layer='approaches',1,0)) AS [Approaches],
sum(IIF(layer='research',1,0)) AS [Research]
FROM resources
WHERE (IIF(literacy,1,0)) OR (IIF(numeracy,1,0)) OR (IIF(poverty,1,0)) AND [lw status] = 'Published'
GROUP BY [lw status];

The WHERE clause in all the four parts of this query is trying to determine the three mentioned checkboxes (literacy, numeracy or poverty) are checked. Any combination of the three can be checked for the results that I would like.
In principle, the query works. However, the output returns two results for the third part and two results for the fourth part.
If I run the query with just one checkbox defined, so:
WHERE (IIF(literacy,1,0)) [lw status] = 'In Reserve'

The query works fine, its just adding in one or more of these conditions seems to cause the problems.
I've also tried defining true values by using =-1 which returns the same problems.
Many thanks.

A: See if this is more clear. You don't need the IIF function to check a Yes/No value at the WHERE clauses. Aditionally, parenthesis are required to express the logic: (x OR y OR z) AND w
SELECT null as Status,
sum(IIF(layer='key info',1,0)) AS [Key Info],
sum(IIF(layer='approaches',1,0)) AS [Approaches],
sum(IIF(layer='research',1,0)) AS [Research]
FROM resources
WHERE (literacy OR numeracy OR poverty)

UNION

SELECT [copyright status],
sum(IIF(layer='key info',1,0)) AS [Key Info],
sum(IIF(layer='approaches',1,0)) AS [Approaches],
sum(IIF(layer='research',1,0)) AS [Research]
FROM resources
WHERE (literacy OR numeracy OR poverty)
GROUP BY [copyright status]

UNION

SELECT [lw status],
sum(IIF(layer='key info',1,0)) AS [Key Info],
sum(IIF(layer='approaches',1,0)) AS [Approaches],
sum(IIF(layer='research',1,0)) AS [Research]
FROM resources
WHERE (literacy OR numeracy OR poverty) AND [lw status] = 'In Reserve'
GROUP BY [lw status]

UNION

SELECT [lw status],
sum(IIF(layer='key info',1,0)) AS [Key Info],
sum(IIF(layer='approaches',1,0)) AS [Approaches],
sum(IIF(layer='research',1,0)) AS [Research]
FROM resources
WHERE (literacy OR numeracy OR poverty) AND [lw status] = 'Published'
GROUP BY [lw status];

Regards


text:
Q: Using Live Reload with Jekyll I'm getting started with Jekyll static site generator and I would like to use Live Reload with it. I know Jekyll has a generator and server commands, and Live Reload can run various compilers and custom commands. How do I configure these to work together?

A: LiveReload is built into Jekyll 3.7+.
jekyll serve --livereload

You can also set LiveReload's port, delay, and ignored files. See jekyll help serve.

A: Start by running jekyll normally in your site folder:
cd your/site/folder
jekyll

By default Jekyll generates a folder called _site inside it (your/site/folder/_site).
Tell LiveReload to watch that _site folder.

A: This command will open your website in the browser and uses jekyll built-in livereload server.
bundle exec jekyll serve -l -o
You need a latest jekyll version.

A: UPDATE: As pointed out in other answers, LiveReload is built into Jekyll 3.7+.
jekyll serve --livereload

For older versions:
The simplest approach I've found that works is to use two terminal windows: One for jekyll serve --watch and one for guard.
I tried the guard-jekyll-plus approach suggested by Nobu but I had a bunch of errors.
As shumushin pointed out, Jekyll can handle the automatic rebuilding process, you simply launch it using jekyll serve --watch
Now to get LiveReload working run guard with guard-livereload in a second terminal window. This is basically the same as Jan Segre's answer, but without guard-jekyll.
My Guardfile looks like this:
guard 'livereload' do
  watch(/^_site/)
end

And my Gemfile:
gem 'jekyll'
gem 'guard'
gem 'guard-livereload'

Note: You still need to include the livereload script in your index.html page; it is the "glue" that binds guard-livereload and the browser together.
<script src="http://localhost:35729/livereload.js"></script>

A: For jekyll 1.0+ use:
jekyll serve --watch

See Jekyll: Basic Usage for more details and options.

A: There's guard-livereload which you can use with guard-jekyll and centralize the watching process with guard, an example would be (I haven't tested it):

*

*Install guard-jekyll, either through gem or bundler

*Install guard-livereload, either through gem or bundler

Init guard-jekyll
guard init jekyll

Add this to your Guardfile:
guard 'livereload' do
  watch(%r{_site/.+})
end

You can adapt the above to suit better your project, and
you probably already know you have to include the livereload
script on your page:
<script src="http://localhost:35729/livereload.js"></script>

Oh, and to start the whole watching mess:
guard

A: UPDATE: this no longer works with the latest version of Jekyll
cd your/site/folder
jekyll --server --auto

A: This post explains a cleaner way - Setting Up LiveReload With Jekyll
Gemfile:
gem 'jekyll'
gem 'guard'
gem 'guard-jekyll-plus'
gem 'guard-livereload'

Guardfile:
guard 'jekyll-plus', :serve => true do
  watch /.*/
  ignore /^_site/
end

guard 'livereload' do
  watch /.*/
end

Install any LiveReload browser extension. Then run guard.

A: I wrote a Jekyll plugin called Hawkins that incorporates LiveReload into the Jekyll watch process.  It works with Jekyll 3.1 and up.
Simply add
group :jekyll_plugins do
  gem 'hawkins'
end

to your Gemfile (and then a bundle install).  From there you can run jekyll liveserve.  Hawkins will modify the head sections of your pages to include the necessary components for LiveReload, and when Jekyll detects a page change, Hawkins will push a message to your browser via WebSockets.  Please note that you will need a browser that supports WebSockets.  For very fast reloads, you can use Jekyll's new --incremental option that will only regenerate the changed pages.

A: I just started using GitHub Pages today, and wanted to be able to use live reload with Jekyll.  Got it working & written my first post on Creating GitHub Pages with Jekyll & LiveReload.
It uses Grunt with the grunt-contrib-watch plugin instead of Jekyll's serve command - works well for me. Hope it works for you as well.

A: You can use just jekyll serve -w, an option I prefer as I am lazy.

A: For Live Reload,
Remove Jekyll Admin from Gemfile in the root directory of your project and it works like charm.

A: If you're running it frequently, the Repla macOS app makes it easy to startup Jekyll so it automatically refreshes. After Repla is installed, you run it from the Jekyll blog's root directory and pass it the jekyll serve command. For example:
repla server "bundle exec jekyll serve --watch --drafts" -r "...done"

Repla will be configured to refresh each time ...done is printed in the console, which Jekyll prints when it finishes compiling your site.
Repla runs the Jekyll server process in a split below a browser split showing your site:

After Jekyll is running in Repla, you can also save the configuration to a file with ⌘S, shut it down by closing the window, and run it again just by double-clicking the file. In other words, you can start your Jekyll blog again next time just by opening the file, without involving the terminal at all.
Disclosure: I maintain the Repla app.


text:
Q: $A \subseteq B \subseteq C$, with $A$ and $C$ simple rings, but $B$ is not a simple ring Let $A \subseteq B \subseteq C$ be three associative $k$-algebras, where $k$ is a field.
Assume that $A$ and $C$ are simple rings.
(Recall that a ring $R$ is simple, if it has no two-sided ideals other than $0$ and $R$).

Is it true that $B$ must also be a simple ring? If not, it would be nice to see a counterexample. Does the characteristic of $k$ relevant to the answer?

It would be nice to see a few counterexamples, according to the commutativity or non-commutativity of the rings concerned. (But just one counterexample will also be ok).
Perhaps it is also relevant to know if $C$ is finitely generated as a $B$-module, etc.
Thank you very much!

A: No, $B$ need not be simple: Let $A=k$, $B=k[X]$, and $C=k(X)$.

A: For a finite-dimensional counterexample, let $A=K$ be a field, $C$ a matrix ring over $k$.  Then $A$ and $C$ are simple but there is no reason that $B$ must be.
For a simple example, a nonzero nilpotent matrix generates a subring isomorphic to $k[X]/(X^n)$, which is not simple.
Note that all finite-dimensional counterexamples over a field are non-abelian.


text:
Q: Batch file to combine pdf files in alphabetical order I want to create a batch file to combine selected pdf files in alphabetical order. Currently I have the following script:
    @echo off
setlocal enabledelayedexpansion
FOR %%A IN (%*) DO (set command=!command! %%A)
pdftk.exe %command% cat output "%~dp1binder.pdf"

The script file is saved as a .cmd file and a shortcut of it is placed into the 'SHELL:SENDTO' folder. Therefore it is possible to select some .pdf files, click on the right-mouse button and run the file to create binder.pdf which is a copy of the selected pdf files combined together.
The only problem left is that the batch file creates a pdf in random order when I select 15+ .pdf files. Is it possible to make sure that the selected .pdf files are merged in alphabetical order?

A: I'm sure there's a more straightforward way to do this, but here's my first attempt:
setlocal enabledelayedexpansion

:: Save all names to temporary file
if exist pdfs.txt del pdfs.txt
for %%a in (%*) do echo %%a >> pdfs.txt

:: Loop over sorted names
for /f "usebackq" %%a in (`type pdfs.txt ^| sort`) do (set command=!command! %%a)
pdftk.exe %command% cat output "%~dp1binder.pdf"

:: Clean up
del pdfs.txt


text:
Q: How to set drop down view in integrated terminal on VS Code? Initially VS Code showed a drop down list for all the terminals available but now it is just showing plus sign and new terminals get added to right pane.
How do I enable like this: (plus sign and the drop down view)

In my current VS Code it got changed to:

I don't know if its due to update or I messed up some settings.

A: I had the same issue. (on a mac) go to code > preferences > Settings. You'll need to find the setting under terminal or just search 'terminal' in the search bar. you'll be looking for the following setting and just make sure it is unchecked.

A: If you don't want to fiddle with the settings, a quick fix is to open 2 terminals, then right-click on the space below the list of terminals, and click "hide tabs".


text:
Q: How to start parsing ARXML file from a specific node? I am writing a Python script that takes information from another file and inserts this information in the form of a comment into the ARXML file in a specific location. The script is currently using a plain for loop to iterate through the ARXML file until it finds the desired tag.
However, repeatedly parsing the ARXML file from the beginning each time I am inserting is incredibly time consuming. I am trying to optimize this part by creating a for loop that simply begins parsing at the desired LXML node (a specific tag that I am looking for).
I am using LXML instead of XML's ElementTree library because LXML library has a convenient function called addprevious().
I have searched for this question and read posts related to ARXML parsing but it does not answer this specific question.
Since I actually know in advance what tags I am looking for, my question is how would I begin parsing the ARXML file from this desired node using LXML's iter() or iterparse()? Is there a way to set the beginning search node in LXML's iter()?
Current code:
# begins parsing from the very beginning of the file
for elem in lxml_root.iter():
    # logic here that first locates the desired node... everytime

Desired code (at high level):
# already found the desired node
elem = desired_lxml_node
for elem in lxml_root.iter():
    # already parsing from desired node

Has anyone achieved something similar to this in LXML?

A: Lxml supports XPath, so you could use that to quickly find your node:
desired_lxml_node tree.xpath('/AR-PACKAGE/APPLICATION-SW-COMPONENT')
(note: My Xpath probably is not correct, and you also have additional constraints that you can add, such as [@shortName == 'whatever']


text:
Q: Convert expression to NAND only I have to convert the following to NAND only
$$\bar{A}\cdot\bar{B}\cdot\bar{C} + A\cdot\bar{B}\cdot C + A\cdot B\cdot \bar{C} + A \cdot B\cdot C$$
I've looked at the following website: http://en.wikipedia.org/wiki/NAND_logic
And it  helped me understand it a lot more however I just don't understand how to put it all together.
I understand for example that if:
$$\bar{A}\cdot\bar{B}$$ using De Morgan's rule I can convert it to NAND $$\bar{AB}$$
However I don't understand how I would convert the following to NAND only $$\bar{A}\cdot\bar{B} + \bar{A}\cdot\bar{B}$$
And so this is the reason I can't do the original equation at the top.

A: To save time, look for simplifications. There  is one in the second half:
$$A\cdot B\cdot \bar{C} + A \cdot B\cdot C = A\cdot B$$
To express AND as NAND, first apply NAND and then apply NOT --more precisely, "NAND with equal arguments is NOT". Writing $\oplus$ for NAND (I don't know if there is an "official" symbol) this becomes $$A\cdot B = (A\oplus B)\oplus (A\oplus B)$$
The first half is $\overline{B}\cdot (A\cdot B+\overline{A}\cdot \overline{B})$. The only new element here is OR, but that is expressed as "NAND of inverted arguments":
$$C+D = (C\oplus C)\oplus (D\oplus D)$$
The rest should be a repetition of the above two tricks.

A: The Rules:
Convert NOT-operator: $\bar{X} = X\oplus X$
Convert AND-operator: $X\cdot Y = (X\oplus Y)\oplus (X\oplus Y)$
Convert OR-operator: $X+Y=(X \oplus X)\oplus (Y\oplus Y)$
The Procedure (Brute Force Method):
Step 1: Convert all NOT-operators
Step 2: Convert all AND-operators (left to right)
Step 3: Convert all OR-operators  (left to right)
(Brackets can change order of precedence.)

A: I had the same problem, but this web page cleared my confusion. Basically, any SOP can be easily converted to NAND-only and any POS can be converted to NOR-only using De Morgan's rules twice.
In your case, we have the SOP A'B'C' + AB'C + ABC' + ABC = (A'B'C' + AB'C + ABC' + ABC)'' = [(A'B'C')'(AB'C)'(ABC')'(ABC)']'. That's it! Note that each product factor is a three-input NAND while the square brackets here are used for a four-input NAND gate.
If the inputs are directly available in their inverted forms, you can stop here; otherwise, use X' = (XX)' to convert the inverter to NAND logic only.

A: Let us cheat a little.
By applying NAND to the duplicated argument, you simulate a NOT of that argument.
Then NOT NAND is AND. And NAND NOT (applied to both arguments) is OR.
$$\overline{a\land a}=\overline a,\ \overline{\overline{a\land b}}=a\land b,\ \overline{\overline a\land\overline v}=a\lor b.$$

A:
$$\bar{A}\cdot\bar{B}\cdot\bar{C} + A\cdot\bar{B}\cdot C + A\cdot B\cdot \bar{C} + A \cdot B\cdot C$$

The point of this excercise is to get you to see that when a formula is written as a sum of products (disjunctive normal form) that it can be converted to nands without changing the layout of your circuit, you just replace some gates with nand gates.
First, you can introduce nots in pairs:
$$\lnot \lnot X = X$$
Second, there are 2 ways to represent nand (I'll write with the sheffer stroke, $|$) from 'and' and 'or':
$$A|B = \lnot (A \cdot B)$$
$$A|B = (\lnot A) + (\lnot B)$$
So introduce double negation to your formula as follows:
$$ (\lnot\lnot(\bar{A}\cdot\bar{B}\cdot\bar{C}))
 + (\lnot\lnot(A\cdot\bar{B}\cdot C ))
 + (\lnot\lnot(A\cdot B\cdot \bar{C}))
 + (\lnot\lnot(A \cdot B\cdot C))$$
Rewrite the ands:
$$ (\lnot(\bar{A} | \bar{B} | \bar{C}))
 + (\lnot(A | \bar{B} | C ))
 + (\lnot(A | B | \bar{C}))
 + (\lnot(A | B | C))$$
Rewrite the ors:
$$ (\bar{A} | \bar{B} | \bar{C}) |
  (A | \bar{B} | C ) |
  (A | B | \bar{C})\ |
  (A | B | C)$$
Schematically, it is the same as:  for each wire that starts at the output of an and-gate, and ends at the input of the or-gate: add not-gates to the start and end of the wire.
An analogous procedure can be used to convert product-of-sums (conjunctive normal form) to nor-gates.


text:
Q: How could Marty not see Biff stealing the DeLorean? In Back to the Future Part II, when the old Biff steals the DeLorean in 2015, Marty is just a few yards away. He might not have seen it because he was looking at his future house, but he must have heard it. The street was empty and quiet. Clearly it was not possible not to hear the DeLorean engine starting. And yet he didn't even notice anything.

A: The official novelisation offers a brief explanation. In short, our trio of heroes were simply too pre-occupied to notice the DeLorean being taken.
On top of that, with the hover-conversion the car is also much quieter than a normal petrol-driven engine. Additionally, the car was only gone (subjectively) for a few seconds.

And all three of them. Doc. Marty and Jennifer, were busy elsewhere,
  so none of them could see Biff take off in the DeLorean, or, a moment
  later, land the DeLorean in the exact same spot. He quickly got out to
  hobble away, too quickly, maybe, because his cane got caught as the
  gull-wing door swung down. The cane snapped in two as Biff struggled
  with it. He took the half he had freed and hobbled away, leaving
  everything like it was before - except that now Biff no longer
  clutched the silver bag.

We can also suppose that any sounds would have been masked by the hover-taxi leaving the area.

He [Biff] walked straight to the car, opened the door, and climbed inside.
What was the old guy doing? Was that his car? Fred decided he didn't
  want to know. He turned the cab around and headed out of Hilldale.

The film script indicates that he merely waited until the "coast was clear" and Marty wasn't in the immediate vicinity.

EXT. AT THE DELOREAN
MARTY, now back in his 1985 clothes, impatiently looks in the
  direction Doc went. Should he take a closer look or not?
Yeah. He quietly follows, leaving the DeLorean unattended and out of
  his view.
Immediately, BIFF, clutching the silver bag, comes up to the DeLorean,
  sees that the coast is clear and opens the driver's side door.


text:
Q: Download email, save attachment to working directory Is there some way to do this?   I'm getting a daily email with a .csv attachment, but I'm not sure how to download the mail or the attachment using only java.
Are there any good libraries that handle this sort of thing?   Or some source code that may help me in this process?   Thanks.

A: You need to look into using the JavaMail API.
I would also advise you to look at this question and it's answers if you need some source code to get you started.


text:
Q: Linux Mint 13 Problem - No module named site My Linux  Mint 13 64-bit system has developed a problem. Whilst I can run basic commands like ls and vi if I try anything more complex (I have tried python2.7, mysql-workbench and adduser) I get:-
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

I went to another system (Mint 13 32-bit) and ran:
# echo $PYTHONHOME,

and got a blank line so no idea what
<prefix>[:<exec_prefix>]

are?
Unsure where to go next?
After further Googling I tried both "sudo dpkg –configure -a" and "sudo apt-get install -f " with the following results:-
HP-255-G1 # sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of python-appindicator:
python-appindicator depends on libappindicator1 (= 0.4.92-0ubuntu1);
however:
Version of libappindicator1 on system is 0.4.92-0ubuntu1.1.
dpkg: error processing python-appindicator (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-uno:
 python-uno depends on libreoffice-core (= 1:3.5.2-2ubuntu1); however:
Version of libreoffice-core on system is 1:3.5.7-0ubuntu7.
dpkg: error processing python-uno (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python-appindicator
 python-uno

HP-255-G1 # sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
python-appindicator python-uno
The following packages will be upgraded:
python-appindicator python-uno
2 upgraded, 0 newly installed, 0 to remove and 690 not upgraded.
2 not fully installed or removed.
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/cache/apt/archives/

So it looks as if "python-uno" and "python-appindicator" are central to some of the issues but where to now?
Here is the requested output:-
HP-255-G1# apt-cache policy python-uno python-appindicator
python-uno:
Installed: 1:3.5.2-2ubuntu1
Candidate: 1:3.5.7-0ubuntu7
Version table:
1:3.5.7-0ubuntu7 0
500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
*** 1:3.5.2-2ubuntu1 0
500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
100 /var/lib/dpkg/status
python-appindicator:
Installed: 0.4.92-0ubuntu1
Candidate: 0.4.92-0ubuntu1.1
Version table:
0.4.92-0ubuntu1.1 0
500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
*** 0.4.92-0ubuntu1 0
500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
100 /var/lib/dpkg/status

I managed to get the Synaptic Package Manager running from the command line and tried to update python-uno and python-appindicator. This failed but hopefully the output (below) is another clue:-
E: /var/cache/apt/archives/python-appindicator_0.4.92-0ubuntu1.1_amd64.deb:
subprocess new pre-removal script returned error exit status 1
E: /var/cache/apt/archives/python-uno_1%3a3.5.7-0ubuntu7_amd64.deb:
subprocess new pre-removal script returned error exit status 1

A: After discussion with the poster on chat, starting http://chat.stackexchange.com/transcript/message/20047753#20047753, it turned out the poster's machine is missing /usr/lib/python2.7, see http://chat.stackexchange.com/transcript/message/20052960#20052960. This accounts for most of the poster's problems. In particular, the errors:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

stem from these missing libraries.
The next thing to do is to restore the base Python libraries under /usr/lib/python2.7. One way to do this is to download the deb files corresponding to python2.7, python2.7-minimal and libpython2.7, and then install them using dpkg -i. I.e.
apt-get download python2.7 python2.7-minimal libpython2.7
dpkg -i python*.deb

Once this is done, hopefully the package system will stop freaking out. Then install debsums, if it is not already installed, and restore the remaining missing files using debsums -as.


text:
Q: Sensors name and vendor Android Is it possible display only the sensor name and the vendor from this?
public class SensorikTestActivity extends Activity {

private ListView listView;
private SensorManager mSensorManager;
private List<Sensor> deviceSensors = null;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    listView = ((ListView) findViewById(R.id.listView1));

    mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
    deviceSensors = mSensorManager.getSensorList(Sensor.TYPE_ALL);
    listView.setAdapter(new ArrayAdapter<Sensor>(this,
            android.R.layout.simple_list_item_1, deviceSensors));
}
}

actually it displays all information of sensors but i need only a few info. Thanks

A: No built-in approach. You need to do some coding.
Create custom object like SensorDetails with only attributes you want (name, vendor etc.,).
Instead of List<Sensor> deviceSensors create List<YourCustomClass>. Populate your custom object with values from Sensor List and set it to Adapter.


text:
Q: How to set value of extern variable? I am using glomosim simulator for my networking practise.
and one of the file of routing protocol under network layer has following line. The filename is "ARAN.pc" (i got this file from internet, i want to replace aodv protocol which is by default set in simulator with authenthicated routing protocol i.e ARAN):
extern int maliciousNodesPercentage; //defined and set in driver.pc
when I compile simulator (using a bat file) shows me this error:
*call pcc -user_main -Zi  -Ox    -I..\include\ -clock longlong -o ..\bin\glomosim driver.pc temp.lib
tmp-3572-0.c
driver.init.c
temp.lib(aran.obj) : error LNK2001: unresolved external symbol _maliciousNodesPercentage
..\bin\glomosim.exe : fatal error LNK1120: 1 unresolved externals*
When I opened driver.pc file I did not find maliciousNodesPercentage.
How do I set the value of the variable?

A: An external variable has to be declared somewhere. If you just use extern int maliciousNodesPercentage it ust tells the compiler that this variable is defined in some other module, so no storage is allocated for it. In the linking stage the linker will then put in the actual adress of the variable. Since you didn't define it anywhere, you get an unresolved symbol.
For example in main you define as a global variable:
  int  maliciousNodesPercentage;

and in all other modules (or in a header file) you do:
  extern int maliciousNodesPercentage;

Then you can access it just like any other global variable.


text:
Q: Current source in parallel with a short circuit If a Dependent current source is placed in parallel with a short circuit,
to solve our calculations would we assume that no current will flow through the dependent source and hence we remove it. For example in the picture to form a norton equivalent circuit across a-b i placed a short circuit to find In(current in the short circuit).


text:
Q: How to access a custom logger, from a VS breakpoint action, in an external assembly Background
Visual studio has a really cool feature in that allows you to log a message to the output window when a breakpoint is hit.  Even more cool, you can reference live values by surrounding them with curly brackets.  But wait: there's more; you can even call a method, with arbitrary signature (passing arguments and returning a value).  Whatever value is returned is written in the output window. Awsome.
In VS 2013, this is the "When Hit" feature

and in VS 2015 (and 2017 RC), it's called "Action".

Motivation
I am trying to understand what's going on in the WPF source code, so I set breakpoints with an "Action" to output trace info. But, because WPF is not constraining the types of the values I'm interested in (they are passed as object and the type inferred according to context), the values are more often than not logged as an error because the breakpoint Action is not aware of this context and therefore not aware of the type to expect.
My plan to deal with this is to call a custom logger from the breakpoint Action and pass arguments sufficient for the logger can resolve the type of the value.
The custom logger is a member of my MainWindow partial class.
Proof of concept
I verified that this works by setting a breakpoint action in my MainWindow partial class, it references the logger member and passes arguments no problem.  This is fine for breakpoints within my app but I want to use it on breakpoints in other assemblies.
The problem
As stated above, this works fine when the breakpoint is in my own assembly but fails for breakpoints set in third party assemblies (like the wpf source code). Obviously the object needs to be qualified so that the debugger can resolve it.
How do I qualify it, how do I reference the instance of the window and therefore the member I'm looking for?
I guess I could make it a static singleton but I might need more than one logger.

A: I figured out that I can reference my logger.  For example, if my main window partial class looks like this...
namespace EventSetterNull_SO_41604891_2670182
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window

...then I can reference it like this...
((EventSetterNull_SO_41604891_2670182.MainWindow)System.Windows.Application.Current.MainWindow)

So, my breakpoint is like...

Then, I can set breakpoints in, for example, System.Windows.Markup.WpfXamlLoader.TransformNodes, pass the xamlReader to my logger, and log out the node structure that the parser generates from the baml.
xaml
<Window x:Class="EventSetterNull_SO_41604891_2670182.BuildInXaml"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:EventSetterNull_SO_41604891_2670182"
        mc:Ignorable="d"
        Title="BuildInXaml" Height="350" Width="525">
    <Window.Resources>
        <SetterBaseCollection x:Key="ButtonStyleSetters">
            <Setter Property="FrameworkElement.Height" Value="30"></Setter>
        </SetterBaseCollection>
    </Window.Resources>

    <Button Name="Button1"
            local:Behaviours.StyleSetters="{StaticResource ButtonStyleSetters}" />

Output window
"Line:    6    NamespaceDeclaration    http://schemas.microsoft.com/winfx/2006/xaml/presentation"
"Line:    6    NamespaceDeclaration    http://schemas.microsoft.com/winfx/2006/xaml"
"Line:    6    NamespaceDeclaration    http://schemas.microsoft.com/expression/blend/2008"
"Line:    6    NamespaceDeclaration    http://schemas.openxmlformats.org/markup-compatibility/2006"
"Line:    6    NamespaceDeclaration    clr-namespace:EventSetterNull_SO_41604891_2670182;assembly=EventSetterNull-SO-41604891-2670182"
"Line:    6    StartObject    BuildInXaml"
"Line:    6        StartMember    Title"
"Line:    6            Value    BuildInXaml"
"Line:    6        EndMember    "
"Line:    8        StartMember    Height"
"Line:    8            Value    System.Windows.Baml2006.TypeConverterMarkupExtension"
"Line:    8        EndMember    "
"Line:    8        StartMember    Width"
"Line:    8            Value    System.Windows.Baml2006.TypeConverterMarkupExtension"
"Line:    8        EndMember    "
"Line:    8        StartMember    Resources"
"Line:    9            GetObject    System.Windows.Baml2006.Baml2006SchemaContext"
"Line:    9                StartMember    DeferrableContent"
"Line:    9                    Value    System.IO.MemoryStream"
"Line:    9                EndMember    "
"Line:    9            EndObject    "
"Line:   15        EndMember    "
"Line:   17        StartMember    Content"
"Line:   17            StartObject    Button"
"Line:   17                StartMember    ConnectionId"
"Line:   17                    Value    1"
"Line:   17                EndMember    "
"Line:    0                StartMember    Name"
"Line:    0                    Value    Button1"
"Line:    0                EndMember    "
"Line:   17                StartMember    StyleSetters"
"Line:   17                    Value    System.Windows.StaticResourceExtension"
"Line:   17                EndMember    "
"Line:   10                StartObject    SetterBaseCollection"
"Line:   10                    StartMember    _Items"
"Line:   11                        StartObject    Setter"
"Line:   11                            StartMember    Property"
"Line:   11                                Value    Height"
"Line:   11                            EndMember    "
"Line:   11                            StartMember    Value"
"Line:   11                                Value    30"
"Line:   11                            EndMember    "
"Line:   11                        EndObject    "
"Line:   11                    EndMember    "
"Line:   11                EndObject    "
"Line:   18            EndObject    "
"Line:   18        EndMember    "
"Line:   18    EndObject    "

So, I can see exactly how wpf sees the xaml, which is handy if it screws up...
xaml
<Window x:Class="EventSetterNull_SO_41604891_2670182.BuildInXaml"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:EventSetterNull_SO_41604891_2670182"
        mc:Ignorable="d"
        Title="BuildInXaml" Height="350" Width="525">
    <Window.Resources>
        <SetterBaseCollection x:Key="ButtonStyleSetters">
            <Setter Property="FrameworkElement.Height" Value="30"></Setter>
            <EventSetter Event="ButtonBase.Click"  Handler="StyleClick"
                          HandledEventsToo="False" />
        </SetterBaseCollection>
    </Window.Resources>

    <Button Name="Button1"
            local:Behaviours.StyleSetters="{StaticResource ButtonStyleSetters}" />

Output window
"Line:    6    NamespaceDeclaration    http://schemas.microsoft.com/winfx/2006/xaml/presentation"
"Line:    6    NamespaceDeclaration    http://schemas.microsoft.com/winfx/2006/xaml"
"Line:    6    NamespaceDeclaration    http://schemas.microsoft.com/expression/blend/2008"
"Line:    6    NamespaceDeclaration    http://schemas.openxmlformats.org/markup-compatibility/2006"
"Line:    6    NamespaceDeclaration    clr-namespace:EventSetterNull_SO_41604891_2670182;assembly=EventSetterNull-SO-41604891-2670182"
"Line:    6    StartObject    BuildInXaml"
"Line:    6        StartMember    Title"
"Line:    6            Value    BuildInXaml"
"Line:    6        EndMember    "
"Line:    8        StartMember    Height"
"Line:    8            Value    System.Windows.Baml2006.TypeConverterMarkupExtension"
"Line:    8        EndMember    "
"Line:    8        StartMember    Width"
"Line:    8            Value    System.Windows.Baml2006.TypeConverterMarkupExtension"
"Line:    8        EndMember    "
"Line:    8        StartMember    Resources"
"Line:    9            GetObject    System.Windows.Baml2006.Baml2006SchemaContext"
"Line:    9                StartMember    DeferrableContent"
"Line:    9                    Value    System.IO.MemoryStream"
"Line:    9                EndMember    "
"Line:    9            EndObject    "
"Line:   15        EndMember    "
"Line:   17        StartMember    Content"
"Line:   17            StartObject    Button"
"Line:   17                StartMember    ConnectionId"
"Line:   17                    Value    1"
"Line:   17                EndMember    "
"Line:    0                StartMember    Name"
"Line:    0                    Value    Button1"
"Line:    0                EndMember    "
"Line:   17                StartMember    StyleSetters"
"Line:   17                    Value    System.Windows.StaticResourceExtension"
"Line:   17                EndMember    "
"Line:   10                StartObject    SetterBaseCollection"
"Line:   10                    StartMember    _Items"
"Line:   11                        StartObject    Setter"
"Line:   11                            StartMember    Property"
"Line:   11                                Value    Height"
"Line:   11                            EndMember    "
"Line:   11                            StartMember    Value"
"Line:   11                                Value    30"
"Line:   11                            EndMember    "
"Line:   11                        EndObject    "
"Line:   12                        StartObject    EventSetter"
"Line:   12                            StartMember    Event"
"Line:   12                                Value    System.Windows.Baml2006.TypeConverterMarkupExtension"
"Line:   12                            EndMember    "
"Line:   12                            StartMember    Event"
Exception thrown: 'System.Xaml.XamlDuplicateMemberException' in System.Xaml.dll

As you can see, wpf is getting confused and finding a second Event member in the EventSetter object, that's not there and throwing an error.

This is a bug in wpf.


text:
Q: Query mysql para segundos entre dos fechas agrupado por id de usuario, sin sumar los segundos entre rangos ya sumados Estoy trabajando en el control de asistencia de los usuarios en mi plataforma, pero la suma me sale incorrecta debido a que algunos usuarios tienen varias pestañas abiertas en una misma página, y esto genera distintos logs del mismo usuario en el mismo rango. como en este ejemplo (logs de un mismo usuario en la misma página):
Los logs son de hora de acceso (in) y hora de salida (out) a una página.

Para que se entienda el caso con claridad, si un usuario a estado en una página en dos pestañas distintas (con el mismo usuario), se crean dos logs por ejemplo:
| --------in------------ | -------out------------ | user_id |
| ---------------------- | ----------------------- | ------- |
| 2021-09-28 12:54:13 | 28/09/2021 15:00:19 | -- 1 -- |
| 2021-09-28 13:11:05 | 28/09/2021 15:12:22 | -- 1 -- |
Y lo que necesito es una query para que solo sume el tiempo en uno de los dos casos o sume el tiempo de "2021-09-28 12:54:13" a "28/09/2021 15:12:22" en vez de sumar ambas diferencias para tener el tiempo real de este usuario en la página, ahora mi query me devuelve la suma de las diferencias de ambos logs.
Esta es la query que utilizo:
SELECT
   nl1.user_id,
   SUM(ROUND(time_to_sec((TIMEDIFF( nl1.out, nl1.in ))))) AS seconds,
FROM
   wp_nub_user_logs AS nl1
WHERE
   action = 'activity'
GROUP BY
   nl1.user_id
ORDER BY
   seconds DESC;

La query suma la diferencia entre el "in" i el "out" de cada log agrupando y sumando estas sumas por id de usuario.
Necesito el total de segundos entre estos logs para generar el informe de asistencia, y que estos sean exactos.
¿Se puede añadir alguna condición para que en los rangos repetidos (en el caso de que sea el mismo usuario) no sume este tiempo? o tenéis alguna idea sobre una query o conjunto de queries para arreglar este caso de uso?
Agradecería muchísimo vuestra ayuda.


text:
Q: Symfony exception - directory is not writable I have web page based on Symfony 3 framework. Directory /var has set writable privilegies on web-data and root. ALL caches, sessions and logs are writted here without problem.
Nevertheless i have still in my prod.log exceptions like this: (Path is still the same - annotations)

[2018-07-16 13:32:31] request.CRITICAL: Exception thrown when handling
  an exception (InvalidArgumentException: The directory
  "/var/www/domain.com/var/cache/prod/annotations" is not writable. at
  /var/www/domain.com/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php
  line 92) {"exception":"[object] (InvalidArgumentException(code: 0):
  The directory \"/var/www/domain.com/var/cache/prod/annotations\" is
  not writable. at
  /var/www/domain.com/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92)"}
  []

Web looks like run OK - without errors but in logs this exceptions are increasing any time...
For test purpose i write function in controller like this:
    $directory = $this->container->getParameter('kernel.root_dir') . '/../var/cache/prod/annotations';

    if (is_writable($directory))
        echo "OK: ".$directory;
    else
        echo "FAIL!: ".$directory;

If i call this function VIA BROWSER url i have OK answer...


text:
Q: cruzar 3 tablas en SQL SERVER y traer rango de fechas y horas Tengo 3 tablas en SQL SERVER 2014. Tablas:
S20
AZUl
ROJO
con los mismos campos. Quiero cruzar S20 CON (AZUL - ROJO).
En la tabla S20 tengo un campo de fecha y hora y quiero saber si esta entre la tabla AZUL Y ROJO.
Los campos de la tabla S20 deben estar entre el rango de:
La fila 1 de la tabla AZUL y de la fila 1 de la tabla ROJO o de
La fila 2 de de tabla AZUL y de la fila 2 de la tabla ROJO y así sucesivamente.
Quiero que la consulta me devuelva la información solo de los campos de la Tabla S20 que estén entre cualquier rango entre las filas de la TABLA AZUL Y ROJO del mismo vehiculo.
algo como
WHERE fechahora.S20 BETWEEN fechahora.AZUL AND  fechahora.ROJO AND vehiculo.S20 = vehiculo.AZUL
el problema radica en que no se como decirle búsqueme entre en el rango de la primera fila de las dos tablas y devuélvame solo los datos que entre las dos.
el dato puede estar entre la fila1.AZUL Y fila1.ROJO o fila2.AZUL y fila2.ROJO.
La tabla S20 son los datos de un vehículo todo el día independiente este apagado o prendido.
La tabla AZUL son los datos de cuando el vehículo se prende
La tabla ROJO son los datos de cuando el vehículo se apaga
en resumen solo quiero consultar los datos mientras el vehículo estuvo prendido.
TABLA S20
2020-01-15T00:00:20.602000
2020-01-15T00:00:40.600000
2020-01-15T00:01:40.601000
2020-01-15T00:02:00.616000
2020-01-15T00:03:00.630000
2020-01-15T00:03:20.601000
TABLA AZUL
2020-01-15T00:00:20.601000
2020-01-15T00:01:02.275000
2020-01-15T00:02:10.616000
2020-01-15T00:03:15.630000
TABLA ROJO
2020-01-15T00:00:25.630000
2020-01-15T00:01:58.275000
2020-01-15T00:03:05.630000
2020-01-15T00:03:18.630000
COMO RESULTADO SOLO DEBERIA TRAERME LOS SIGUIENTES DATOS
2020-01-15T00:00:20.602000
2020-01-15T00:01:40.601000
2020-01-15T00:03:00.630000
La tabla S20 son los datos de un vehículo
la tabla AZUL son los datos de cuando el vehículo se prende
la tabla ROJO son los datos de cuando el vehículo se apaga
en resumen solo quiero consultar los datos mientras el vehículo estuvo prendido.

A: Supongo que esa desnormalización de las tablas vendrá por algo que no es importante para la pregunta, pero tengo que remarcar que no es un buen modelo. Pensar en intentar normalizar esa información sería importante.
Entrando en materia.
Create table dbo.[S20]  (vehiculo varchar(6),fechahora datetime2)
Create table dbo.[ROJO] (vehiculo varchar(6),fechahora datetime2)
Create table dbo.[AZUL] (vehiculo varchar(6),fechahora datetime2)
go
Insert into dbo.[S20] (vehiculo,fechahora)
values
('AAA001','2020-01-15T00:00:20.602000'),
('AAA001','2020-01-15T00:00:40.600000'),
('AAA001','2020-01-15T00:01:40.601000'),
('AAA001','2020-01-15T00:02:00.616000'),
('AAA001','2020-01-15T00:03:00.630000'),
('AAA001','2020-01-15T00:03:20.601000');
Insert into dbo.rojo (vehiculo,fechahora)
values
('AAA001','2020-01-15T00:00:25.630000'),
('AAA001','2020-01-15T00:01:58.275000'),
('AAA001','2020-01-15T00:03:05.630000'),
('AAA001','2020-01-15T00:03:18.630000');
Insert into dbo.azul (vehiculo,fechahora)
values
('AAA001','2020-01-15T00:00:20.602000'),
('AAA001','2020-01-15T00:01:40.601000'),
('AAA001','2020-01-15T00:03:00.630000');
go

Una solución posible, es utilizar el operador UNION para juntar s20, rojo y azul, y luego ordenar los resultados con row_number para determinar el orden y extraer los resultados que nos interesan, utilizando lag para saber si el registro anterior fue un encendido.
With c
     As (Select 1 As grp
              , vehiculo
              , fechahora
                From azul
         Union All
         Select 0 As grp
              , vehiculo
              , fechahora
                From rojo
         Union All
         Select 2 As grp
              , vehiculo
              , fechahora
                From s20),
     c2
     As (Select *
              , lag(grp) Over(Partition By vehiculo
                Order By fechahora
                       , grp) As lagGrp
                From c)
     Select v.vehiculo
          , v.fechahora
            From c2 As v
            Where grp = 2 And lagGrp = 1;

Por partes:
En el conjunto "c", usamos las tres tablas, y las unimos, anexando una columna que nos identifica si es un encendido un apagado, o el dato que queremos extraer.
En el conjunto "c2" obtenemos el valor del registro anterior para esa columna de grupo que está ordenada por vehículo y fechahora es un encendido=1.
Y la salida final obtenemos los registros que sean de tipo 2 = [s20] y que su previo sea un encendido.
Tablas de expresión común correlativas (cte)
Lag
Row Number. Numerar Filas


text:
Q: Django - Writing Tests: Unit testing extra variables passed to generic views I would like to know if there is a way to use Django's test client to verify that the extra variables that are passed from a generic view are correct.
For example, given the code below, how would I write a test for list_year() to ensure that the template is receiving the current year from the view, or for purchase_yrs() to make sure the correct information is being passed from the model manager?
I can't seem to find a way to draw it out of the response.context attribute.
class PurchaseIndex(generic.ListView):

    def get_queryset(self):
        current_date = datetime.now().year
        return Purchase.objects.filter(purchase_date__year=current_date).reverse()

    def purchase_yrs(self):
        return Purchase.purchase_years.purchase_years_list()

    def list_year(self):
        return datetime.now().year

A: Okay, I finally figured this one out. Pretty simple:
from django.test import TestCase
from views import PurchaseIndex

class IndexPageTest(TestCase):

    def test_current_purchase_index_displays_year(self):
        context = PurchaseIndex.list_year(self)
        self.assertEqual(2015, context)

    def test_current_shipments_included_in_current_purchase_index(self):
        context = PurchaseIndex.purchase_yrs(self)
        self.assertIn(2015, context)
        self.assertIn(2014, context)


text:
Q: Create another action menuitem in Odoo I'm trying to extend the funcionallity of the actions defined in a custom module view adding a new menuitem for it. I'm not sure how is defined the code for doing it.
The model used is: education.group
The module where is defined is: education.

<record id="education_group_mailing_action" model="ir.actions.server">
    <field name="name">Generate group lists</field>
    <field name="type">ir.actions.server</field>
    <field name="model_id" ref="model_education_group"/>
    <field name="binding_model_id" ref="model_education_group"/>
    <field name="state">code</field>
    <field name="code">action = records.generate_lists()</field>
</record>

<record id="education_group_mailing_action2" model="ir.default">
        <field name="model_id" ref="model_education_group" />
        <field name="field_id" eval="1" />
        <field name="json_value">False</field>
        <field name="name">Generate group lsts</field>
        <field name="key2">client_action_multi</field>
        <field name="key">action</field>
        <field name="model">education.group</field>
        <field name="value" eval="'ir.actions.server,' + str(ref('education_group_mailing_action'))" />
    </record>

class EducationGroup(models.Model):
    _inherit='education.group'

   def generate_lists(self):
        print("HELLO!")

Anyone knows how to to it?
Thanks for reading!

A: Check this Code,
<record id="mail_mass_mailing_lists_action" model="ir.actions.server">
    <field name="name">Generate group lists</field>
    <field name="type">ir.actions.server</field>
    <field name="model_id" ref="mass_mailing.model_mail_mass_mailing_list"/>
    <field name="binding_model_id" ref="mass_mailing.model_mail_mass_mailing_list"/>
    <field name="state">code</field>
    <field name="code">action = records.generate_lists()</field>
</record>

Thanks

A: If you are using Odoo12.0 then you have to do like this.
    <record id="new_action1" model="ir.actions.server">
        <field name="name">New Action</field>
        <field name="model_id" ref="model_product_template" />
        <field name="binding_model_id" ref="model_product_template" />
        <field name="state">code</field>
        <field name="code">records.export_product()</field>
    </record>
    <record id="run_product_new_order_action2" model="ir.default">
        <field name="model_id" ref="model_product_template" />
        <field name="field_id" eval="1" />
        <field name="json_value">False</field>
        <field name="name">New Action</field>
        <field name="key2">client_action_multi</field>
        <field name="key">action</field>
        <field name="model">product.template</field>
        <field name="value" eval="'ir.actions.server,' + str(ref('new_action1'))" />
    </record>

If you are using Odoo13.0 then it will be like
       <record id="product_order_new_action1" model="ir.actions.server">
            <field name="name">New Action</field>
            <field name="type">ir.actions.server</field>
            <field name="model_id" ref="model_product_template" />
            <field name="binding_model_id" ref="model_product_template" />
            <field name="state">code</field>
            <field name="code">records.sync_product(False)</field>
        </record>


text:
Q: Asynchronous loop without recursion? Is it possible to implement an asynchronous loop in JavaScript without recursion?
Case in point, is it possible to synchronize a queue of asynchronous tasks without resorting to recursion? We have N asynchronous tasks in a queue, and need to execute each task after the previous one has finished.
All the examples I've seen so far use recursion for this. But if we have to deal with a very long queue, we cannot expect anything good from a recursive approach. So what's the alternative then, how to tackle this?
Just so, when a similar question was asked about promises, every single answer relies on recursion.

A:
we cannot expect anything good from a recursive approach.

Your premise is wrong. As you are doing it asynchronous, there is nothing wrong with a recursive approach (sometimes dubbed pseudo-recursion), it doesn't grow the call stack.


text:
Q: How to protect my form input field data from a user to changes in the console? I want to take some of my card's data to the next page.
But if i want to send data through the form, the user can change it from the console.
If I hide the input field then it can still be changed through the console.
<form action="{{url('/checkout')}}" method="post">
    @csrf

      <input type="hidden" name="total_amount3" value="{{ ($subTotal-($subTotal*$coupon_amount)/100) }}">
      <button class="site-btn btn-full" type="submit">Proceed to checkout</button>
     </form>

How can I send my data on the next page without change by the user?

A: Once the data is in the frontend, there's nothing you can do, the user can change it by inspecting or through the console
Move your variable to the backend
public function checkout(Request $request)
{
   $subTotal = $request->subTotal; // Or calculate it here from the products in the cart or whatever
   $request->request->add(['subTotal' => ($subTotal-($subTotal*$coupon_amount)/100)]);
   // Rest of code goes here...
}


text:
Q: Give a warning when using mkdir in a certain directory Is there any way to give a warning when a user tries to use mkdir when in a certain directory? There are supposed to be shared folders, but someone will make a subdirectory and forget to chmod it, so other users are unable to write or read from the subdirectory.

A: Depending on the filesystem, you should be able to set default ACLs which would make newly created subdirectories open:
setfacl -d -m u::rwx,g::rwx,o::rwx /path/to/directory

A: How about aliasing mkdir to a script?
alias mkdir=/usr/local/bin/mkdir-safe

mkdir-safe would then be something like:
#!/bin/sh
for arg; do
    case $(readlink -m "$arg") in
        /home/shared/folders/*)
            echo "warning: Creating subdirectory in shared directory." >&2
            ;;
    esac
done
mkdir "$@"


text:
Q: Why isn't a ListBuffer with String and Date elements ListBuffer[Any]? Let's say I've got:
var pairOfObjects = ListBuffer("", myDate)

Where myDate is of type java.util.Date, and it's value is 1970-01-01T00:00:00.000-00:00
Putting that into the Scala REPL tells me:
pairOfObjects: scala.collection.mutable.ListBuffer[Comparable[_ >: java.util.Date with String <: Comparable[_ >: java.util.Date with String <: java.io.Serializable] with java.io.Serializable] with java.io.Serializable] = ListBuffer("", Wed Dec 31 16:00:00 PST 1969)
I'd expect it to be something like ListBuffer[Any]. In fact, when I put in:
var pairOfObjects = ListBuffer("", 1)
The Scala REPL does give me:
pairOfObjects: scala.collection.mutable.ListBuffer[Any] = ListBuffer("", 1)
Why does putting in a Date object to the ListBuffer result in such a complicated type?

A: A List in Scala is covariant.
Example for Int and Double are subtypes of Double, then List[Int] and List[Double] are also subtypes of List[Double].
Here is the definition for string in scala from Predef object
type String = java.lang.String

Java String class declartion
public final class String
extends Object
implements Serializable, Comparable<String>, CharSequence

java.util.date class declartion
public class Date
extends Object
implements Serializable, Cloneable, Comparable<Date>

Now after looking into these definitions both Date and String class in java are inherited classes from java.io.Serializable and not from Any directly so you don't see ListBuffer[Any] when the list elements are Date and String.
Thereby from these statement
scala.collection.mutable.ListBuffer[Comparable[_ >: java.util.Date with String <: Comparable[_ >: java.util.Date with String <: java.io.Serializable] with java.io.Serializable] with java.io.Serializable] = ListBuffer("", Wed Dec 31 16:00:00 PST 1969)
Any is lower type bound to java.util.date with String which are upper bound to java.io.Serializable


text:
Q: How to publish azure function from vs code? I have installed azure-tools-vscode, but don't know exactly how to use it for publishing the Azure function:
some steps I have tried are:
Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.

PS D:\azurenodejsfunctions>

PS D:\azurenodejsfunctions> func azure login

PS D:\azurenodejsfunctions> func azure account set <SubscriptionId>

PS D:\azurenodejsfunctions> func azure functionapp publish ..\azurenodejsfunctions\

Publish D:\azurenodejsfunctions contents to an Azure Function App. Locally deleted files are not removed from destination.
Getting site publishing info...
Can't find app with name "..\azurenodejsfunctions\" in current subscription.

PS D:\azurenodejsfunctions>

I tried the other way , created manually azure function app and then try:
PS D:\> func azure functionapp publish azurenodejsfunctions

Exception :
Unable to find function project root. Expecting to have host.json in function project root.

Files and folder structure,

Now mystery for me. Any ideas on why this happens & how to fix this?

A: According to your description and error message, if you want to publish the azure function in the visual studio code. You need firstly create a azure function in the protal, then use the func azure functionapp publish command to publish the function to azure.
I suggest you could follow below way.
1.Install the Azure Tools for Visual Studio Code.
Use ctrl+shift+p open the command and type below command:
ext install azuretoolsforvscode

2.Create azure function app.
Use ctrl+shift+p open the command and type below command:
azure:login

Azure:Create an azure function App(advanced)

3.Use ctrl+shift+c open command window and use below command to install the Azure Functions Core Tools.
npm i -g azure-functions-core-tools

4.Init the azure function local
Notice: The function name must as same as the function app you have created in the azure
func init yourfunctionname

5.Locate the function folder
cd yourfunctionname

6.Use the func azure login and func azure functionapp publish to publish the function
The command like this:


text:
Q: Error 1001 system.badimageformatexception could not load file or assembly on creation of a setup project visual studio 2013 I have a project in Visual Studio 2013 using wpf and Entity Framework with a conection to a SQL Server Express R2 database, the project is finished and I need to create the setup for it, I'm using this tutorial  so I create the scripts (with data) as embedded resource for the database, the Installer Class (named SetupInstaller) and add the ouput of the project to the installer, everything builds with no error, but when I try to install the project I receive the error

Error 1001 System.BadImageFormatException Could not load file or assembly

I did several changes and this just happens when I create the custom action, but when I don't use it the database is not created
My conection string goes
<connectionStrings>
   <add name="Bulldog_Gym.Properties.Settings.BulldogGymConnectionString"
     connectionString="Data Source=.;Initial Catalog=BulldogGym;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>

My SetupInstaller class goes like this
[RunInstaller(true)]
public partial class SetupInstaller : System.Configuration.Install.Installer
{
    SqlConnection masterConnection = new SqlConnection();
    public SetupInstaller()
        : base()
    {
        InitializeComponent();
    }
    private string GetSql(string Name)
    {

        try
        {
            // Gets the current assembly.
            Assembly Asm = Assembly.GetExecutingAssembly();

            // Resources are named using a fully qualified name.
            Stream strm = Asm.GetManifestResourceStream(Asm.GetName().Name + "." + Name);

            // Reads the contents of the embedded file.
            StreamReader reader = new StreamReader(strm);
            return reader.ReadToEnd();

        }
        catch (Exception ex)
        {
            MessageBox.Show("In GetSQL: " + ex.Message);
            throw ex;
        }
    }

    private void ExecuteSql(string DatabaseName, string Sql)
    {
        System.Data.SqlClient.SqlCommand Command = new System.Data.SqlClient.SqlCommand(Sql, masterConnection);

        // Initialize the connection, open it, and set it to the "master" database
        masterConnection.ConnectionString = Properties.Settings.Default.BulldogGymConnectionString;
        Command.Connection.Open();
        Command.Connection.ChangeDatabase(DatabaseName);
        try
        {
            Command.ExecuteNonQuery();
        }
        finally
        {
            // Closing the connection should be done in a Finally block
            Command.Connection.Close();
        }
    }

    protected void AddDBTable(string strDBName)
    {
        try
        {
            // Creates the database.
            ExecuteSql("master", "CREATE DATABASE " + strDBName);

            // Creates the tables.
            ExecuteSql(strDBName, GetSql("bulldog.txt"));

            // Creates the stored procedure.
            //ExecuteSql(strDBName, GetSql("getproduct.txt"));

        }
        catch (Exception ex)
        {
            // Reports any errors and abort.
            MessageBox.Show("In exception handler: " + ex.Message);
            throw ex;
        }
    }

    public override void Install(System.Collections.IDictionary stateSaver)
    {
        base.Install(stateSaver);
        AddDBTable("BulldogGym");
    }

    [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
    public override void Uninstall(IDictionary savedState)
    {
        base.Uninstall(savedState);
        ExecuteSql("master", "DROP DATABASE BulldogGym");
    }
}

And my txt with the database
I already change the database to non data script, add the master to the connection string, change the target from x64 (current) to Any CPU but none of this seems to work, please I need some guidance.
Thanks!

A: It sounds like it's related to a bitness mismatch.  I answered a similar problem here:
BadImageFormatException
Your assembly with the installer class is 64bit but the installutil.exe attempting to run it must be 32bit which causes the problem.  Somehow you need to execute the 64bit version of installutil.exe.