text:
Q: App crashes on iOS 8 with crash log, what to read from that log When I install through Xcode my app it all works good, after downloading it from App Store the first few times it works also good, but after few hours trying to launch the app it crashes on start.
Here is the log from one of the devices, What interesting info I can get from it?
Incident Identifier: 37F75352-D7E6-4EAB-B1B8-42144E40DE4F
CrashReporter Key:   3b5b7bee21090e6dbda917beb30594ae43084caf
Hardware Model:      iPhone6,2
Process:             trappplus [724]
Path:                /private/var/mobile/Containers/Bundle/Application/99B7BB89-8587-4860-BB4D-C07B88ACDA53/trappplus.app/trappplus
Identifier:          com.trr.trrapp
Version:             4.0.0 (4.0.0)
Code Type:           ARM (Native)
Parent Process:      launchd [1]

Date/Time:           2014-09-21 10:45:57.958 +0300
Launch Time:         2014-09-21 10:45:57.366 +0300
OS Version:          iOS 8.0 (12A365)
Report Version:      105

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                  0x23e20e3f 0x23d1b000 + 1072703
1   libobjc.A.dylib                 0x314fcc8b 0x314f6000 + 27787
2   CoreFoundation                  0x23e26189 0x23d1b000 + 1094025
3   CoreFoundation                  0x23e240a7 0x23d1b000 + 1085607
4   CoreFoundation                  0x23d56208 0x23d1b000 + 242184
5   trappplus                               0x000f9dc7 0xe7000 + 77255
6   UIKit                           0x27337545 0x272af000 + 558405
7   UIKit                           0x27526e69 0x272af000 + 2588265
8   UIKit                           0x2751ebdd 0x272af000 + 2554845
9   FrontBoardServices              0x2a5210e9 0x2a50c000 + 86249
10  CoreFoundation                  0x23de75b5 0x23d1b000 + 837045
11  CoreFoundation                  0x23de6879 0x23d1b000 + 833657
12  CoreFoundation                  0x23de5017 0x23d1b000 + 827415
13  CoreFoundation                  0x23d33621 0x23d1b000 + 99873
14  CoreFoundation                  0x23d33433 0x23d1b000 + 99379
15  GraphicsServices                0x2b0a10a9 0x2b098000 + 37033
16  UIKit                           0x2731d809 0x272af000 + 452617
17  trappplus                               0x000eb9e7 0xe7000 + 18919
18  libdyld.dylib                   0x31a7caaf 0x31a7b000 + 6831

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x31b42dfc 0x31b2e000 + 85500
1   libsystem_pthread.dylib         0x31bc0d33 0x31bbd000 + 15667
2   libsystem_c.dylib               0x31ae2905 0x31a98000 + 305413
3   libc++abi.dylib                 0x30e1f9c5 0x30e1f000 + 2501
4   libc++abi.dylib                 0x30e3966d 0x30e1f000 + 108141
5   libobjc.A.dylib                 0x314fcf23 0x314f6000 + 28451
6   libc++abi.dylib                 0x30e36de1 0x30e1f000 + 97761
7   libc++abi.dylib                 0x30e368ab 0x30e1f000 + 96427
8   libobjc.A.dylib                 0x314fcdcf 0x314f6000 + 28111
9   CoreFoundation                  0x23d336b9 0x23d1b000 + 100025
10  CoreFoundation                  0x23d3342f 0x23d1b000 + 99375
11  GraphicsServices                0x2b0a10a5 0x2b098000 + 37029
12  UIKit                           0x2731d805 0x272af000 + 452613
13  trappplus                               0x000eb9e3 0xe7000 + 18915
14  libdyld.dylib                   0x31a7caad 0x31a7b000 + 6829

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x31b2f2a0 0x31b2e000 + 4768
1   libdispatch.dylib               0x31a689fd 0x31a5b000 + 55805
2   libdispatch.dylib               0x31a5e31f 0x31a5b000 + 13087

Thread 2:
0   libsystem_kernel.dylib          0x31b439cc 0x31b2e000 + 88524
1   libsystem_pthread.dylib         0x31bbdea9 0x31bbd000 + 3753
2   libsystem_pthread.dylib         0x31bbdb80 0x31bbd000 + 2944

Thread 3:
0   libsystem_kernel.dylib          0x31b439cc 0x31b2e000 + 88524
1   libsystem_pthread.dylib         0x31bbdea9 0x31bbd000 + 3753
2   libsystem_pthread.dylib         0x31bbdb80 0x31bbd000 + 2944

Thread 4:
0   libsystem_kernel.dylib          0x31b439cc 0x31b2e000 + 88524
1   libsystem_pthread.dylib         0x31bbdea9 0x31bbd000 + 3753
2   libsystem_pthread.dylib         0x31bbdb80 0x31bbd000 + 2944

Thread 5:
0   libsystem_kernel.dylib          0x31b439cc 0x31b2e000 + 88524
1   libsystem_pthread.dylib         0x31bbdea9 0x31bbd000 + 3753
2   libsystem_pthread.dylib         0x31bbdb80 0x31bbd000 + 2944

Thread 6 name:  com.apple.NSURLConnectionLoader
Thread 6:
0   libsystem_kernel.dylib          0x31b2f4f0 0x31b2e000 + 5360
1   libsystem_kernel.dylib          0x31b2f2e5 0x31b2e000 + 4837
2   CoreFoundation                  0x23de6b4f 0x23d1b000 + 834383
3   CoreFoundation                  0x23de50f5 0x23d1b000 + 827637
4   CoreFoundation                  0x23d3361d 0x23d1b000 + 99869
5   CoreFoundation                  0x23d3342f 0x23d1b000 + 99375
6   CFNetwork                       0x238ec3db 0x23870000 + 508891
7   Foundation                      0x24b30387 0x24a5f000 + 856967
8   libsystem_pthread.dylib         0x31bbfe91 0x31bbd000 + 11921
9   libsystem_pthread.dylib         0x31bbfe03 0x31bbd000 + 11779
10  libsystem_pthread.dylib         0x31bbdb8c 0x31bbd000 + 2956

Thread 7 name:  WebThread
Thread 7:
0   libsystem_kernel.dylib          0x31b42ba8 0x31b2e000 + 84904
1   libsystem_pthread.dylib         0x31bbe047 0x31bbd000 + 4167
2   WebCore                         0x2f05bc85 0x2efd7000 + 543877
3   WebCore                         0x2f07044f 0x2efd7000 + 627791
4   WebKitLegacy                    0x2fb5efdd 0x2fb5b000 + 16349
5   WebKitLegacy                    0x2fb60d1b 0x2fb5b000 + 23835
6   WebCore                         0x2f024d59 0x2efd7000 + 318809
7   WebCore                         0x2f024be9 0x2efd7000 + 318441
8   WebCore                         0x2f06dcd3 0x2efd7000 + 617683
9   WebCore                         0x2f09b5b1 0x2efd7000 + 804273
10  WebCore                         0x2f09ae21 0x2efd7000 + 802337
11  CFNetwork                       0x23893ce9 0x23870000 + 146665
12  CFNetwork                       0x2392ff93 0x23870000 + 786323
13  CFNetwork                       0x23884beb 0x23870000 + 84971
14  CoreFoundation                  0x23d3308b 0x23d1b000 + 98443
15  CFNetwork                       0x23884aa3 0x23870000 + 84643
16  CFNetwork                       0x2388496b 0x23870000 + 84331
17  CFNetwork                       0x238847fd 0x23870000 + 83965
18  CoreFoundation                  0x23de758d 0x23d1b000 + 837005
19  CoreFoundation                  0x23de699b 0x23d1b000 + 833947
20  CoreFoundation                  0x23de5001 0x23d1b000 + 827393
21  CoreFoundation                  0x23d3361d 0x23d1b000 + 99869
22  CoreFoundation                  0x23d3342f 0x23d1b000 + 99375
23  WebCore                         0x2f05a9b7 0x2efd7000 + 539063
24  libsystem_pthread.dylib         0x31bbfe91 0x31bbd000 + 11921
25  libsystem_pthread.dylib         0x31bbfe03 0x31bbd000 + 11779
26  libsystem_pthread.dylib         0x31bbdb8c 0x31bbd000 + 2956

Thread 8:
0   libsystem_kernel.dylib          0x31b439cc 0x31b2e000 + 88524
1   libsystem_pthread.dylib         0x31bbdea9 0x31bbd000 + 3753
2   libsystem_pthread.dylib         0x31bbdb80 0x31bbd000 + 2944

Thread 9:
0   libsystem_kernel.dylib          0x31b2f4f0 0x31b2e000 + 5360
1   libsystem_kernel.dylib          0x31b2f2e5 0x31b2e000 + 4837
2   CoreFoundation                  0x23de6b4f 0x23d1b000 + 834383
3   CoreFoundation                  0x23de50f5 0x23d1b000 + 827637
4   CoreFoundation                  0x23d3361d 0x23d1b000 + 99869
5   CoreFoundation                  0x23d7c287 0x23d1b000 + 397959
6   CoreMotion                      0x24634def 0x245f6000 + 257519
7   libsystem_pthread.dylib         0x31bbfe91 0x31bbd000 + 11921
8   libsystem_pthread.dylib         0x31bbfe03 0x31bbd000 + 11779
9   libsystem_pthread.dylib         0x31bbdb8c 0x31bbd000 + 2956

Thread 10 name:  JavaScriptCore::BlockFree
Thread 10:
0   libsystem_kernel.dylib          0x31b42b38 0x31b2e000 + 84792
1   libsystem_pthread.dylib         0x31bbf3f5 0x31bbd000 + 9205
2   libsystem_pthread.dylib         0x31bc0319 0x31bbd000 + 13081
3   libc++.1.dylib                  0x30dd9f5b 0x30dd4000 + 24411
4   JavaScriptCore                  0x25115581 0x24fda000 + 1291649
5   JavaScriptCore                  0x24fef0eb 0x24fda000 + 86251
6   JavaScriptCore                  0x24feb605 0x24fda000 + 71173
7   libsystem_pthread.dylib         0x31bbfe91 0x31bbd000 + 11921
8   libsystem_pthread.dylib         0x31bbfe03 0x31bbd000 + 11779
9   libsystem_pthread.dylib         0x31bbdb8c 0x31bbd000 + 2956

Thread 11 name:  JavaScriptCore::Marking
Thread 11:
0   libsystem_kernel.dylib          0x31b42b38 0x31b2e000 + 84792
1   libsystem_pthread.dylib         0x31bbf3f5 0x31bbd000 + 9205
2   libsystem_pthread.dylib         0x31bc02d9 0x31bbd000 + 13017
3   libc++.1.dylib                  0x30dd9e8d 0x30dd4000 + 24205
4   JavaScriptCore                  0x251b6d21 0x24fda000 + 1953057
5   JavaScriptCore                  0x251b6d85 0x24fda000 + 1953157
6   JavaScriptCore                  0x24feb605 0x24fda000 + 71173
7   libsystem_pthread.dylib         0x31bbfe91 0x31bbd000 + 11921
8   libsystem_pthread.dylib         0x31bbfe03 0x31bbd000 + 11779
9   libsystem_pthread.dylib         0x31bbdb8c 0x31bbd000 + 2956

Thread 12 name:  WebCore: CFNetwork Loader
Thread 12:
0   libsystem_kernel.dylib          0x31b2f4f0 0x31b2e000 + 5360
1   libsystem_kernel.dylib          0x31b2f2e5 0x31b2e000 + 4837
2   CoreFoundation                  0x23de6b4f 0x23d1b000 + 834383
3   CoreFoundation                  0x23de50f5 0x23d1b000 + 827637
4   CoreFoundation                  0x23d3361d 0x23d1b000 + 99869
5   CoreFoundation                  0x23d3342f 0x23d1b000 + 99375
6   WebCore                         0x2f084029 0x2efd7000 + 708649
7   JavaScriptCore                  0x24feb605 0x24fda000 + 71173
8   libsystem_pthread.dylib         0x31bbfe91 0x31bbd000 + 11921
9   libsystem_pthread.dylib         0x31bbfe03 0x31bbd000 + 11779
10  libsystem_pthread.dylib         0x31bbdb8c 0x31bbd000 + 2956

Thread 0 crashed with ARM Thread State (32-bit):
    r0: 0x00000000    r1: 0x00000000      r2: 0x00000000      r3: 0x00000003
    r4: 0x00000006    r5: 0x33f699dc      r6: 0x33f55840      r7: 0x0024b428
    r8: 0x16566dd0    r9: 0x00000000     r10: 0x33f54074     r11: 0x16566df4
    ip: 0x00000148    sp: 0x0024b41c      lr: 0x31bc0d37      pc: 0x31b42dfc
  cpsr: 0x00000010

Binary Images:
0xe7000 - 0x132fff trappplus armv7  <083f21c49d69317ab797163c4cd456f3> /var/mobile/Containers/Bundle/Application/99B7BB89-8587-4860-BB4D-C07B88ACDA53/trappplus.app/trappplus
0x1fe2c000 - 0x1fe4ffff dyld armv7s  <fd3fef9c43c9382e8e46d5d59fb52f86> /usr/lib/dyld
0x22740000 - 0x2282dfff RawCamera armv7s  <f36804b4286b392b9adefc60e5e1aa78> /System/Library/CoreServices/RawCamera.bundle/RawCamera
0x2283f000 - 0x228b1fff AGXGLDriver armv7s  <10c1b2150e3c3355973c87cd67726857> /System/Library/Extensions/AGXGLDriver.bundle/AGXGLDriver
0x228bf000 - 0x22a2bfff AVFoundation armv7s  <291c7a621b65396491697e7a7f728b16> /System/Library/Frameworks/AVFoundation.framework/AVFoundation
0x22a2c000 - 0x22a8afff libAVFAudio.dylib armv7s  <1b452a7a75513cf9aa82e59feb7eef33> /System/Library/Frameworks/AVFoundation.framework/libAVFAudio.dylib
0x22ac4000 - 0x22ac4fff Accelerate armv7s  <3b40c742a7323214a5eb836630536bd1> /System/Library/Frameworks/Accelerate.framework/Accelerate
0x22ad5000 - 0x22cf0fff vImage armv7s  <844c5a129a2f3dbe9c0b23824f3254f6> /System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/vImage
0x22cf1000 - 0x22dd7fff libBLAS.dylib armv7s  <aaaefc0f51f23049871f65ea9c4c7151> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBLAS.dylib
0x22dd8000 - 0x2309cfff libLAPACK.dylib armv7s  <ba74aac653423b3b9bae4122d84935d8> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLAPACK.dylib
0x2309d000 - 0x230aefff libLinearAlgebra.dylib armv7s  <3df96b6a86303adea6abea68b7b610ac> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLinearAlgebra.dylib
0x230af000 - 0x2312bfff libvDSP.dylib armv7s  <fb3e0b030cc5346c89af71af2d17bc27> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvDSP.dylib
0x2312c000 - 0x2313efff libvMisc.dylib armv7s  <abd4670b295c3f50a2658d0f3f86d78c> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvMisc.dylib
0x2313f000 - 0x2313ffff vecLib armv7s  <9495c9829e28344fb1820d2140fcaf35> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vecLib
0x23140000 - 0x23166fff Accounts armv7s  <cf7ceabb9af233f0b657f23423988703> /System/Library/Frameworks/Accounts.framework/Accounts
0x23168000 - 0x231d8fff AddressBook armv7s  <eeeabdf6b9703b4f846b672d0bb50eeb> /System/Library/Frameworks/AddressBook.framework/AddressBook
0x231d9000 - 0x232fdfff AddressBookUI armv7s  <6fe5557b059b3ff38179c43183cfe8c3> /System/Library/Frameworks/AddressBookUI.framework/AddressBookUI
0x23495000 - 0x23708fff AudioToolbox armv7s  <5cf7594c3e8e33a889f26f9d2b8f74b7> /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
0x23870000 - 0x239f7fff CFNetwork armv7s  <79b211df401f377fb05acc07a57db3ea> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x239f8000 - 0x23a78fff CloudKit armv7s  <aa1d623f3be434a6a75d2e49b41d26b6> /System/Library/Frameworks/CloudKit.framework/CloudKit
0x23a79000 - 0x23ad8fff CoreAudio armv7s  <5b3129e5e3c23c4fb1052346c18e63b9> /System/Library/Frameworks/CoreAudio.framework/CoreAudio
0x23af1000 - 0x23b0efff CoreBluetooth armv7s  <2040fbe8e91833e5a14c2e4961b5995b> /System/Library/Frameworks/CoreBluetooth.framework/CoreBluetooth
0x23b0f000 - 0x23d1afff CoreData armv7s  <db7e2287362438249bb753788c64a2b1> /System/Library/Frameworks/CoreData.framework/CoreData
0x23d1b000 - 0x24047fff CoreFoundation armv7s  <a76fd43513ee3af9af444082a92ad639> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x24048000 - 0x24172fff CoreGraphics armv7s  <a3d08c6b246236fd9a078619f6c2010b> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
0x241b2000 - 0x241b4fff libCGXType.A.dylib armv7s  <8c8f282d69573460983d78cbaebfd8cf> /System/Library/Frameworks/CoreGraphics.framework/Resources/libCGXType.A.dylib
0x241b5000 - 0x241bffff libCMSBuiltin.A.dylib armv7s  <795fcab613223b6d833937453beb1048> /System/Library/Frameworks/CoreGraphics.framework/Resources/libCMSBuiltin.A.dylib
0x243a7000 - 0x243c2fff libRIP.A.dylib armv7s  <ae6bf33909b531b6abae4b007d9dd46b> /System/Library/Frameworks/CoreGraphics.framework/Resources/libRIP.A.dylib
0x243c3000 - 0x244d1fff CoreImage armv7s  <0dd5152defdf3200b22c29876b05e34b> /System/Library/Frameworks/CoreImage.framework/CoreImage
0x244d2000 - 0x24529fff CoreLocation armv7s  <1153f2e6bde036f4b611833aa85dd9ac> /System/Library/Frameworks/CoreLocation.framework/CoreLocation
0x2455b000 - 0x245f5fff CoreMedia armv7s  <b3e1c2a8262b38a697b5fd5478376e97> /System/Library/Frameworks/CoreMedia.framework/CoreMedia
0x245f6000 - 0x246b6fff CoreMotion armv7s  <0e91543dde123205bbfb0eec336f82e4> /System/Library/Frameworks/CoreMotion.framework/CoreMotion
0x246b7000 - 0x24715fff CoreTelephony armv7s  <32757860a7b23ee6b10cdfb2bcb5e5b9> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony
0x24716000 - 0x247ddfff CoreText armv7s  <4be50da4f4d13b59b32ca55d4660e5c5> /System/Library/Frameworks/CoreText.framework/CoreText
0x247de000 - 0x247f3fff CoreVideo armv7s  <b1d41cec8ddc3c27be6f5459e17f1d2d> /System/Library/Frameworks/CoreVideo.framework/CoreVideo
0x247f4000 - 0x248e9fff EventKit armv7s  <af7bcad4baa7326eb020d805b49df854> /System/Library/Frameworks/EventKit.framework/EventKit
0x24a5f000 - 0x24c61fff Foundation armv7s  <fadfe1d878803b27a0683288c1c7948b> /System/Library/Frameworks/Foundation.framework/Foundation
0x24c8e000 - 0x24cadfff GSS armv7s  <a384f737744b3e67be4b006612b27b58> /System/Library/Frameworks/GSS.framework/GSS
0x24d41000 - 0x24d97fff IOKit armv7s  <df1bb671b5d5392cbb95b89ed6341e78> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x24d98000 - 0x24fd9fff ImageIO armv7s  <5cd6989e5626302aa49787b87e78ce32> /System/Library/Frameworks/ImageIO.framework/ImageIO
0x24fda000 - 0x25328fff JavaScriptCore armv7s  <0041abdf36ff318981798e691a194dda> /System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore
0x255fb000 - 0x25603fff MediaAccessibility armv7s  <5c1cbb4f664b3d049bc5c0ac98cb8a90> /System/Library/Frameworks/MediaAccessibility.framework/MediaAccessibility
0x25604000 - 0x257ddfff MediaPlayer armv7s  <2fbb4a5dc62938f999bd72c93b9f5a50> /System/Library/Frameworks/MediaPlayer.framework/MediaPlayer
0x257de000 - 0x25b55fff MediaToolbox armv7s  <47c440c3064b3b9194c8ffe6a096c37c> /System/Library/Frameworks/MediaToolbox.framework/MediaToolbox
0x25c15000 - 0x25c81fff Metal armv7s  <2c1c274d748d330c81520ccdf07a8be1> /System/Library/Frameworks/Metal.framework/Metal
0x25c82000 - 0x25d11fff MobileCoreServices armv7s  <5e571169affe3b1f97863142d3438da5> /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
0x26714000 - 0x267ebfff GLEngine armv7s  <18f54691165b3b1d9a63e4f76460d1e0> /System/Library/Frameworks/OpenGLES.framework/GLEngine.bundle/GLEngine
0x267ec000 - 0x267f4fff OpenGLES armv7s  <b0df2c3e1d583413b2babe8e95a7e099> /System/Library/Frameworks/OpenGLES.framework/OpenGLES
0x267f6000 - 0x267f6fff libCVMSPluginSupport.dylib armv7s  <ab28723da4e234fd87a6e12dae52c3a2> /System/Library/Frameworks/OpenGLES.framework/libCVMSPluginSupport.dylib
0x267f7000 - 0x267f9fff libCoreFSCache.dylib armv7s  <f073564b5746376a945531dcb28ebdb9> /System/Library/Frameworks/OpenGLES.framework/libCoreFSCache.dylib
0x267fa000 - 0x267fdfff libCoreVMClient.dylib armv7s  <70abd418d5523929a02f9f22f834962e> /System/Library/Frameworks/OpenGLES.framework/libCoreVMClient.dylib
0x267fe000 - 0x26806fff libGFXShared.dylib armv7s  <2cbde78e8e6c3d9da3a7271b053294bc> /System/Library/Frameworks/OpenGLES.framework/libGFXShared.dylib
0x26807000 - 0x26849fff libGLImage.dylib armv7s  <a418f2754f373d3395a6aad59e50c371> /System/Library/Frameworks/OpenGLES.framework/libGLImage.dylib
0x2684a000 - 0x26985fff libGLProgrammability.dylib armv7s  <bef37dada4933217a952b1c362d5a6a3> /System/Library/Frameworks/OpenGLES.framework/libGLProgrammability.dylib
0x26cd7000 - 0x26e29fff QuartzCore armv7s  <4a753d93b6033495b66178dd7535fd96> /System/Library/Frameworks/QuartzCore.framework/QuartzCore
0x26e2a000 - 0x26e7dfff QuickLook armv7s  <593a3c45e1693456bfc917526490e399> /System/Library/Frameworks/QuickLook.framework/QuickLook
0x2706c000 - 0x270acfff Security armv7s  <52c6a10cc12c33cda98ce09e002c6a35> /System/Library/Frameworks/Security.framework/Security
0x27250000 - 0x272acfff SystemConfiguration armv7s  <0dfa14680b583dd2994e2cc0563ebd53> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
0x272af000 - 0x27b47fff UIKit armv7s  <5e0a38c7a0a33afc9e0e51edbdc2e8f3> /System/Library/Frameworks/UIKit.framework/UIKit
0x27b48000 - 0x27baffff VideoToolbox armv7s  <d19c7c7e97533cde961652039bbcc310> /System/Library/Frameworks/VideoToolbox.framework/VideoToolbox
0x27bb0000 - 0x27d95fff WebKit armv7s  <4e6d38f557ea3c2cb906c580d58723d5> /System/Library/Frameworks/WebKit.framework/WebKit
0x28062000 - 0x28064fff AGXCompilerConnection armv7s  <21e8cec6e57c3dbe82e9ae4e21887fab> /System/Library/PrivateFrameworks/AGXCompilerConnection.framework/AGXCompilerConnection
0x2806f000 - 0x2807afff AOSNotification armv7s  <30ac6892bcf1347383b6ca73b0c447be> /System/Library/PrivateFrameworks/AOSNotification.framework/AOSNotification
0x281cf000 - 0x2821bfff AccountsDaemon armv7s  <440e21ee4a4e3ee9b1891b016268b59e> /System/Library/PrivateFrameworks/AccountsDaemon.framework/AccountsDaemon
0x2821c000 - 0x2823dfff AccountsUI armv7s  <a85ce8aa63ef349f90b9fbf16a040a6e> /System/Library/PrivateFrameworks/AccountsUI.framework/AccountsUI
0x2823e000 - 0x28242fff AggregateDictionary armv7s  <7cb2e7f3daac30dbba7a9cf452850eb8> /System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary
0x2840b000 - 0x28436fff AirPlaySupport armv7s  <10dd1721d0ac327f8f8714bb749de10a> /System/Library/PrivateFrameworks/AirPlaySupport.framework/AirPlaySupport
0x28630000 - 0x2866efff AppSupport armv7s  <85ae995cc0083b8f861e9af66f426b8b> /System/Library/PrivateFrameworks/AppSupport.framework/AppSupport
0x2866f000 - 0x286b5fff AppleAccount armv7s  <c8d7c7cc33873ca184d666626d1e2e49> /System/Library/PrivateFrameworks/AppleAccount.framework/AppleAccount
0x2879d000 - 0x287dafff AppleJPEG armv7s  <9d28d8b8c27e3b4d9af820fe71478279> /System/Library/PrivateFrameworks/AppleJPEG.framework/AppleJPEG
0x287e5000 - 0x287f7fff ApplePushService armv7s  <9019b7f0259b32e2bf08eb9e3e61b315> /System/Library/PrivateFrameworks/ApplePushService.framework/ApplePushService
0x287f8000 - 0x287fefff AppleSRP armv7s  <2bc7687cb4ea3b258e7412e03765e14c> /System/Library/PrivateFrameworks/AppleSRP.framework/AppleSRP
0x28833000 - 0x2883cfff AssertionServices armv7s  <5a349cdba4e63bb6a4d15bb6ed3266af> /System/Library/PrivateFrameworks/AssertionServices.framework/AssertionServices
0x2883d000 - 0x28855fff AssetsLibraryServices armv7s  <7419fc839e043757a22253d762c0a6fc> /System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices
0x28856000 - 0x2887afff AssistantServices armv7s  <c1333e5e6c663276bc90f9a951c01cf8> /System/Library/PrivateFrameworks/AssistantServices.framework/AssistantServices
0x288a9000 - 0x288adfff BTLEAudioController armv7s  <2dcdae1d597e3f0fbf940c6df8a8ef27> /System/Library/PrivateFrameworks/BTLEAudioController.framework/BTLEAudioController
0x288ae000 - 0x288c5fff BackBoardServices armv7s  <ffee59ef60f9330a9bdb28d8741b1b02> /System/Library/PrivateFrameworks/BackBoardServices.framework/BackBoardServices
0x288c8000 - 0x288fdfff BaseBoard armv7s  <f0482a734fba3477bd24881eb35f8dbe> /System/Library/PrivateFrameworks/BaseBoard.framework/BaseBoard
0x288fe000 - 0x28904fff BluetoothManager armv7s  <fc99330ba35934c1b14610b4d86b7471> /System/Library/PrivateFrameworks/BluetoothManager.framework/BluetoothManager
0x28905000 - 0x2892bfff Bom armv7s  <554f954a2ece30fbbb343a1ad991af68> /System/Library/PrivateFrameworks/Bom.framework/Bom
0x289f6000 - 0x28a1ffff CalendarFoundation armv7s  <6664e18ccf0d3b509037b2aa3e957b25> /System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation
0x28b2b000 - 0x28b33fff CaptiveNetwork armv7s  <9a9f451fee273d698cb4497668b931a8> /System/Library/PrivateFrameworks/CaptiveNetwork.framework/CaptiveNetwork
0x28b34000 - 0x28c56fff Celestial armv7s  <00f08339e5a53f9c954529a1f5b2e124> /System/Library/PrivateFrameworks/Celestial.framework/Celestial
0x28c64000 - 0x28c7cfff CertInfo armv7s  <cae40259896d3df8a24ef147a5676ffb>

.
.
.

A: Just a thought but if your app is using coredata, could it be requesting too much space? Alternatively, could your app have a memory leak and thus uses up all the RAM? The later happens often when the app freezes for like 30 seconds before crashing, the os is releasing resources.


text:
Q: Yet Another Value Restriction Question In the following code Seq.generateUnique is constrained to be of type ((Assembly -> seq<Assembly>) -> seq<Assembly> -> seq<Assembly>).
open System
open System.Collections.Generic
open System.Reflection

module Seq =
  let generateUnique =
    let known = HashSet()
    fun f initial ->
      let rec loop items =
        seq {
          let cachedSeq = items |> Seq.filter known.Add |> Seq.cache
          if not (cachedSeq |> Seq.isEmpty) then
            yield! cachedSeq
            yield! loop (cachedSeq |> Seq.collect f)
        }
      loop initial

let discoverAssemblies() =
  AppDomain.CurrentDomain.GetAssemblies() :> seq<_>
  |> Seq.generateUnique (fun asm -> asm.GetReferencedAssemblies() |> Seq.map Assembly.Load)

let test() = printfn "%A" (discoverAssemblies() |> Seq.truncate 2 |> Seq.map (fun asm -> asm.GetName().Name) |> Seq.toList)
for _ in 1 .. 5 do test()
System.Console.Read() |> ignore

I'd like it to be generic, but putting it into a file apart from its usage yields a value restriction error:

Value restriction. The value
  'generateUnique' has been inferred to
  have generic type     val
  generateUnique : (('_a -> '_b) -> '_c
  -> seq<'_a>) when '_b :> seq<'_a> and '_c :> seq<'_a>     Either make the
  arguments to 'generateUnique' explicit
  or, if you do not intend for it to be
  generic, add a type annotation.

Adding an explicit type parameter (let generateUnique<'T> = ...) eliminates the error, but now it returns different results.
Output without type parameter (desired/correct behavior):
["mscorlib"; "TEST"]
["FSharp.Core"; "System"]
["System.Core"; "System.Security"]
[]
[]

And with:
["mscorlib"; "TEST"]
["mscorlib"; "TEST"]
["mscorlib"; "TEST"]
["mscorlib"; "TEST"]
["mscorlib"; "TEST"]

Why does the behavior change? How could I make the function generic and achieve the desired behavior?

A: I don't think that your definition is quite correct: it seems to me that f needs to be a syntactic argument to generateUnique (that is, I don't believe that it makes sense to use the same HashSet for different fs).  Therefore, a simple fix is:
let generateUnique f =
    let known = HashSet()
    fun initial ->
        let rec loop items =
            seq {
                let cachedSeq = items |> Seq.filter known.Add |> Seq.cache
                if not (cachedSeq |> Seq.isEmpty) then
                    yield! cachedSeq
                    yield! loop (cachedSeq |> Seq.collect f)
            }
        loop initial

A: generateUnique is a lot like the standard memoize pattern: it should be used to calculate memoized functions from normal functions, not do the actual caching itself.
@kvb was right about the change in the definition required for this shift, but then you need to change the definition of discoverAssemblies as follows:
let discoverAssemblies =
  //"memoize"
  let generator = Seq.generateUnique (fun (asm:Assembly) -> asm.GetReferencedAssemblies() |> Seq.map Assembly.Load)

  fun () ->
      AppDomain.CurrentDomain.GetAssemblies() :> seq<_>
      |> generator

redpajama_set_name: RedPajamaStackExchange


text:
Q: Variable is not updating the value inside a .map() I'm learning to use Flutter so I'm following a tutorial I found.
There it uses a .map function to read a list and assing it to a final variable. The thing is that I get an error when I'm trying to use a variable inside the .map function. I think it is because of the scope of the function, but in the tutorial it works properly.
Here is my code:
List<Widget> _listaItems( List<dynamic> data ) {

   final List<Widget> listaWid = [];               // Here I'm creating the variable listaWid

   data.forEach((opt) {

     final widgetTemp = ListTile(
       title: Text(opt['texto']),
       leading: Icon(Icons.account_circle, color: Colors.deepOrange,),
       trailing: Icon(Icons.keyboard_arrow_right),

     ),

     listaWid.add(widgetTemp);                      // here it show the error 'listaWid must be inizialized'
     listaWid.add(Divider());                       // here it show the error 'listaWid must be inizialized'

   });

   return listaWid;

}

This is how I have my code

This is the error I get
Can you please explain me why it is not taking the variable? How can I fix it?
Thanks for your attention and help.

A: Put ; after ListTile(...)  instead of ,


text:
Q: weighted average by category filtered by time period I've got a headache which I would love some help with
So I have the following table:
Table 1:
Date         Hour   Volume  Value   Price
10/09/2018   1      10      400     40.0
10/09/2018   2      80      200     2.5
10/09/2018   3      14      190     13.6
10/09/2018   4      74      140     1.9
11/09/2018   1      34      547     16.1
11/09/2018   2      26      849     32.7
11/09/2018   3      95      279     2.9
11/09/2018   4      31      216     7.0

Then what I wan to do is view the weighted average by hour.
e.g.
Hour    Price
1       21.52272727
2       9.896226415
3       4.302752294
4       3.39047619

And if possible (bonus point). Then be able to change this by time period e.g. each hour within specified dates.
The way it looks in Excel:
    A            B      C       D       E
1   Date         Hour   Volume  Value   Price
2   10/09/2018   1      10      400     40.0
3   10/09/2018   2      80      200     2.5
4   10/09/2018   3      14      190     13.6
5   10/09/2018   4      74      140     1.9
6   11/09/2018   1      34      547     16.1
7   11/09/2018   2      26      849     32.7
8   11/09/2018   3      95      279     2.9
9   11/09/2018   4      31      216     7.0

The output should be:
Hour    Price
1       21.52272727
2       9.896226415
3       4.302752294
4       3.39047619

Calculated Like:
Hour    Price
1       ((E2*C2)+(E6*C6))/SUM(C2,C6)
2       ((E3*C3)+(E7*C7))/SUM(C3,C7)
3       ((E4*C4)+(E8*C8))/SUM(C4,C8)
4       ((E5*C5)+(E9*C9))/SUM(C5,C9)

I've looked at lots of weighted average questions and answers and they all make sense but I can't quite put them together the way I want.
I hope that makes sense.
Thanks guys,

A: I have reproduced your desired report:

There is no need to involve price in the calculations. Weighted Average price is simply total value / total volume, for the selected set of dates. Let's say your table is called "Data". Create measure:
Weighted Average Price = DIVIDE( SUM(Data[Value]), SUM(Data[Volume]))

Put it into a pivot table against hours, and you are done.
The formular will work correctly for any set of dates you select. For example, in a version of the above report with both hours and dates on pivot:

you can see that it calculates prices correctly on individual dates, subtotals and the total.


text:
Q: UNION in SQLiteDatabase? I need to execute the following query, and return a Cursor, using SQLiteDatabase class:
SELECT DISTINCT sender
FROM messages;
UNION
SELECT DISTINCT recipient
FROM messages;

(the fields sender and recipient are of the same type.)
I know how to execute the SELECT DISTINCT and get 2 cursors holding sender and recipient columns:
c1 = db.query(
        true,                                   //distinct
        Messages.TABLE_NAME,                    //table name
        senderColumn,                           //columns
        null,                                   //where clause
        null,                                   //where args
        null,                                   //group
        null,                                   //having
        sortOrder,                              //sorting order
        null                                    //limit of rows number
);

c2 = db.query(
        true,                                   //distinct
        Messages.TABLE_NAME,                    //table name
        recipientColumn,                        //columns
        null,                                   //where clause
        null,                                   //where args
        null,                                   //group
        null,                                   //having
        sortOrder,                              //sorting order
        null                                    //limit of rows number
);

But I can't figure how to UNION them (and return a Cursor). Also, I may want to specify a sorting order on the result. How can I do that? I can't find any mention of UNION in the API.


text:
Q: Golang: client: dial: tls: oversized record received with length 20527 Пытаюсь отправить TLS запрос с self signed certificate, но получаю ошибку ввида: client: dial: tls: oversized record received with length 20527.
Вот сам код:
package main

import (
    "crypto/rand"
    "crypto/rsa"
    "crypto/tls"
    "crypto/x509"
    "crypto/x509/pkix"
    "encoding/pem"
    "errors"
    "fmt"
    "io"
    "log"
    "math/big"
    "net"
    "time"
)

func CertTemplate() (*x509.Certificate, error) {
    serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
    serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
    if err != nil {
        return nil, errors.New("failed to generate serial number: " + err.Error())
    }

    tmpl := x509.Certificate{
        SerialNumber:          serialNumber,
        Subject:               pkix.Name{Organization: []string{"Yhat, Inc."}},
        SignatureAlgorithm:    x509.SHA256WithRSA,
        NotBefore:             time.Now(),
        NotAfter:              time.Now().Add(time.Hour),
        BasicConstraintsValid: true,
    }
    return &tmpl, nil
}

func CreateCert(template, parent *x509.Certificate, pub interface{}, parentPriv interface{}) (
    cert *x509.Certificate, certPEM []byte, err error) {

    certDER, err := x509.CreateCertificate(rand.Reader, template, parent, pub, parentPriv)
    if err != nil {
        return
    }
    cert, err = x509.ParseCertificate(certDER)
    if err != nil {
        return
    }
    b := pem.Block{Type: "CERTIFICATE", Bytes: certDER}
    certPEM = pem.EncodeToMemory(&b)
    return
}

func main() {
    rootKey, err := rsa.GenerateKey(rand.Reader, 2048)
    if err != nil {
        log.Fatalf("generating random key: %v", err)
    }

    rootCertTmpl, err := CertTemplate()
    if err != nil {
        log.Fatalf("creating cert template: %v", err)
    }
    rootCertTmpl.IsCA = true
    rootCertTmpl.KeyUsage = x509.KeyUsageCertSign | x509.KeyUsageDigitalSignature
    rootCertTmpl.ExtKeyUsage = []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth}
    rootCertTmpl.IPAddresses = []net.IP{net.ParseIP("127.0.0.1")}

    rootCert, rootCertPEM, err := CreateCert(rootCertTmpl, rootCertTmpl, &rootKey.PublicKey, rootKey)
    if err != nil {
        log.Fatalf("error creating cert: %v", err)
    }
    fmt.Printf("%s\n", rootCertPEM)
    fmt.Printf("%#x\n", rootCert.Signature) // more ugly binary

    /*rootKeyPEM := pem.EncodeToMemory(&pem.Block{
        Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(rootKey),
    })*/

    // Create a TLS cert using the private key and certificate
    /*rootTLSCert, err := tls.X509KeyPair(rootCertPEM, rootKeyPEM)
    if err != nil {
        log.Fatalf("invalid key pair: %v", err)
    }*/

    ///
    //
    //
    //

    servKey, err := rsa.GenerateKey(rand.Reader, 2048)
    if err != nil {
        log.Fatalf("generating random key: %v", err)
    }

    servCertTmpl, err := CertTemplate()
    if err != nil {
        log.Fatalf("creating cert template: %v", err)
    }
    servCertTmpl.KeyUsage = x509.KeyUsageDigitalSignature
    servCertTmpl.ExtKeyUsage = []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}
    servCertTmpl.IPAddresses = []net.IP{net.ParseIP("127.0.0.1")}

    _, servCertPEM, err := CreateCert(servCertTmpl, rootCert, &servKey.PublicKey, rootKey)
    if err != nil {
        log.Fatalf("error creating cert: %v", err)
    }

    servKeyPEM := pem.EncodeToMemory(&pem.Block{
        Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(servKey),
    })
    servTLSCert, err := tls.X509KeyPair(servCertPEM, servKeyPEM)
    if err != nil {
        log.Fatalf("invalid key pair: %v", err)
    }

    config := &tls.Config{
        Certificates: []tls.Certificate{servTLSCert},
    }

    conn, err := tls.Dial("tcp", "google.com:80", config)
    if err != nil {
        log.Fatalf("client: dial: %s", err)
    }
    defer conn.Close()
    log.Println("client: connected to: ", conn.RemoteAddr())

    state := conn.ConnectionState()
    for _, v := range state.PeerCertificates {
        fmt.Println(x509.MarshalPKIXPublicKey(v.PublicKey))
        fmt.Println(v.Subject)
    }
    log.Println("client: handshake: ", state.HandshakeComplete)
    log.Println("client: mutual: ", state.NegotiatedProtocolIsMutual)

    message := "Hello\n"
    n, err := io.WriteString(conn, message)
    if err != nil {
        log.Fatalf("client: write: %s", err)
    }
    log.Printf("client: wrote %q (%d bytes)", message, n)

    reply := make([]byte, 256)
    n, err = conn.Read(reply)
    log.Printf("client: read %q (%d bytes)", string(reply[:n]), n)
    log.Print("client: exiting")

}

Не понимаю что делать и в чем все таки проблема, адрес даю гугловский для примера google.com:80

A: По результатам обсуждения в комментариях, проблема в том, что вы стучитесь на HTTP-порт 80, в то время как с HTTPS (TLS) надо работать на порту 443.


text:
Q: How to take specific fields from users registered in firebase as variables to make actions on them and update them back in firebase I'm creating an app where users can scan QR codes to receive points , these points can be transferred to other users , the QR part is ok and working fine(I managed to update the logged in user's points in firebase after scanning) , but I cant seem to manage to know how to take the  registered users fields from firebase and make actions on them , I made a list of their first name and second name but and I can access their points fields but i cant make actions on them ,, Here is my code:
Container(
      height: 60,
      padding: const EdgeInsets.symmetric(vertical: 20),
          child: StreamBuilder<QuerySnapshot>(
            stream: FirebaseFirestore.instance.collection('users').orderBy('firstName').snapshots(),
            builder: (
                BuildContext context,
                AsyncSnapshot<QuerySnapshot> snapshot
                ) {
              if(!snapshot.hasData){
                return const Text('Something went wrong.');
              }
              if(snapshot.connectionState == ConnectionState.waiting){
                return const Text('Loading..');
              }
              if (setDefaultMake) {
                users = snapshot.data?.docs[0].get('firstName');
                debugPrint('setDefault make: $users');
              }
              return DropdownButton(
                isExpanded: false,
                  value: users,
                  items: snapshot.data?.docs.map((value){
                    return DropdownMenuItem(
                    value: value.get('firstName'),

                  child: Text('${value.get('firstName')} ${value.get('secondName')}  '),
              );
            }).toList(),

              onChanged: (value) {

                  debugPrint('selected onchange: $value');
                  setState(
              (){
              debugPrint('make selected: $value');
              // Selected value will be stored
              users = value;
              // Default dropdown value won't be displayed anymore
              setDefaultMake = false;
              // Set makeModel to true to display first name from list
              },
              );
              },
              );

          },
          ),
    ),

this is a list of all the users and i can access their fields with a list , I wanted to access them as local variables or maybe in another widget (not as a list)


text:
Q: Understanding Theorem 17.2 in Munkres
Essentially the only problem I'm having with this whole proof is the assertion that $A = Y \cap C \implies Y - A = Y \cap (X - C)$, I just can't seem to see how the implication holds true. I tried to derive it from elementary set theory operations but failed.
Any hint on how to prove this assertion, that $A = Y \cap C \implies Y - A = Y \cap (X - C)$?

A: Proving the two inclusions is the most elementary way, I think:
Let $x \in (X -C) \cap Y$. So $x \in Y$ and $x \notin C$. As $A = C \cap Y$, this means that $x \notin A$ either, so $x \in Y - A$.
On the other hand, if $x \in Y - A$, $x \in Y$ and $x \notin A = C \cap Y$. This means that $x \notin C$ (otherwise $x \in A = C \cap Y$), so $x \in X - C$, hence $x \in (X-C) \cap Y$.

A: $$Y\setminus A = Y\setminus(Y \cap C) =Y \cap (Y \cap C)^C = $$$$=Y \cap (Y^C \cup C^C) = (Y \cap Y^C) \cup (Y \cap C^C) = Y \cap C^C = Y \cap (X \setminus C)$$
This is it without double inclusion, using only elementary set theory operations


text:
Q: What can I use to filter my Db2 outputs in Windows? I'm trying to filter the output of a db2 command in windows CMD with "findstr". If i do for example: dir | findstr "create" - it works as expected, but if I use a db2 command as: db2 get db cfg | findstr "LOG" it gives nothing.
How can I filter a db2 output in windows? thanks in advance-


text:
Q: How to change back button text in iPad in Swift UI? Working on iPhone, iPad and Mac OS app, which has login screen. I took login View in NavigationView, when I tap on back button the login view will slide as split view. Now I want to change back button text to Login text.
Any one have any idea how&where to change for this?

A: You can create a custom view for the button
struct BackButton: View {

    @Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
    var foregroundColor: Color

    var body: some View {
        Button(action: { presentationMode.wrappedValue.dismiss()}) {
            HStack {

                Image(systemName: Image.arrowLeft)
                    .foregroundColor(foregroundColor)
                    .aspectRatio(contentMode: .fit)
                Text("the text you need")
                    .foregroundColor(foregroundColor)
            }
        }
    }
}

after you can use it's some views:
@Environment(\.presentationMode) var presentationMode
    var body: some View {
            NavigationView {
                    ScrollView {

                    }.navigationBarItems(leading: BackButton(presentationMode: _presentationMode, foregroundColor: .whiteTextColor))
                }
        }

Also before you need delete default button, you can use it inside NavigationLink()
NavigationLink(destination: SomeView()
                            .navigationBarBackButtonHidden(true)
                            .navigationBarTitle("", displayMode: .inline)
                            .navigationBarHidden(true),
                           isActive: self.$isNext,
                           label: { EmptyView() })

Result:


text:
Q: verbatim and CJK I'm not familiar with chinese characters and fonts. But I have to type some characters into a document. XeLaTeX may be an option, but I'm looking for a solution with pdflatex. Here is my MWE, which I created with the help of other questions and answers:
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK*}{UTF8}{gbsn}
中華人民共和國

ABC-1234
\begin{verbatim}
中華人民共和國
ABC-1234
\end{verbatim}
\end{CJK*}
\end{document}

I have two questions:

*

*Is there a monospace font for chinese characters available for using in verbatim environments with same size than latin characters (I'm using MacTeX/TeXLive 2012)?

*Why are not all 7 chinese symbols in the resulted pdf?

A:

*

*The ASCII characters ABC... are usually typeset as halfwidth characters while Chinese characters (汉字, ABC...) are typeset as fullwidth characters. See also Halfwidth and fullwidth forms.
Hence, a solution is to convert the ASCII characters to fullwidth ones in Unicode. You might write your own converter or use a website like http://kiserai.net/hwfw.pl

*There are two writing systems for Chinese characters: the traditional and the simplified system. The characters 華 and 國 belong to the traditional characters, while the others can be used in both systems. Unfortunately, there is no one-to-one mapping between traditional characters and simplified ones. Several traditional characters can be mapped to one simplified one.
Hence, when using a CJK environment you also need to decide which writing system, i.e., which font to use: gbsn and gkai are fonts with simplified characters, while bsmi and bkai are fonts with traditional characters. See also Problems of traditional and simplified Chinese characters
and CJK environment and Chinese
Here is the code of the above picture:
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{bsmi}
中華人民共和國

ABC-1234
\begin{verbatim}
中華人民共和國
ABC-123
4
\end{verbatim}
\end{CJK}
\end{document}

A: This makes all the ascii characters twice their normal width, I thought that would make them exactly line up but it seems to be drifting slightly, an alternative would be 2o replace 2\noexpand\width by a fixed with pre-calculated to be the width of the CJK characters in the verbatim font. It doesn't work as written if there are accented characters or other half width characters out of the ASCII range.

\documentclass{article}
\usepackage{CJKutf8}
\usepackage{verbatim}
\makeatletter
\def\verbatim@processline{%
\edef\tmp{\expandafter\cjkpad\the\verbatim@line\relax}
\tmp}

\def\cjkpad#1{%
\ifx\relax#1\par
\else
\ifnum\expandafter`\noexpand#1<128 %
\noexpand\makebox[2\noexpand\width]{\noexpand#1}%
\else
\noexpand#1%
\fi
\expandafter\cjkpad
\fi}
\makeatother
\begin{document}
\begin{CJK*}{UTF8}{bsmi}

\makeatletter

中華人民共和國

ABC-1234

\begin{verbatim}
中華人民共和國
ABC-1234
\end{verbatim}
\end{CJK*}
\end{document}

A: % UTF-8 encoding
% Compile with XeLaTeX
\documentclass{article}

\usepackage{xeCJK}

% Specify a Chinese font that contains all characters you need.
\setCJKmainfont{SimSun}

\begin{document}
中華人民共和國

ABC-1234

A fullwidth character is twice as wide as a halfwidth character:
\begin{verbatim}
|中華人民共和國|
|ABC-1234......|
\end{verbatim}
\end{document}


text:
Q: Navigation bar items disappear when using UISearchDisplayController displaysSearchBarInNavigationBar How do I embed the search bar with the navigation bar items?
I used [searchBar sizeToFit] and it didn't work and without using displaysSearchBarInNavigationBar the navigation bar disappears when clicking on the searchBar.
I tried the answer in UISearchDisplayController UISearchDisplayController hiding navigation bar
-(void)viewDidLayoutSubviews{
[self.navigationController setNavigationBarHidden:NO animated:NO];
}

but it causes the UISearchDisplayController searchResultsTableView to be displayed below navigation bar while hiding the search bar.

A: I tried modifying the resultsTableView frame dimensions with below method while not having search bar in navigation bar i.e self.searchDisplayController.displaysSearchBarInNavigationBar = NO but this caused issues with cancel while in edit mode. This was taken from Moving SearchBar table view
- (void)searchDisplayController:(UISearchDisplayController *)controller didShowSearchResultsTableView:(UITableView *)tableView{

    CGRect s = self.searchDisplayController.searchBar.frame;
    CGRect newFrame = CGRectMake(0,
                                 s.size.height,
                                 s.size.width,
                                 s.size.height*[filteredList count]);

    tableView.frame = newFrame;

}

and then I found a better solution from this thread
and by just using [self.searchDisplayController.navigationItem setLeftBarButtonItem: self.sidebarButton] in viewDidLoad it solved my problem. What remains now is how to set searchResultsTableView frame sized based on content, but that's another issue. :)


text:
Q: Silverlight/OSX: TCP Socket stops working on one end? What could cause a socket to stop working on one end?
For example: I'm using a System.Net.Sockets.Socket and use it to transfer binary data. However on select occasions the client-end of the socket stops working. Data still gets received from the server and works as expected. The client code also seems to work fine (no exceptions up to the actual Write) but the data is magically lost and never arrives to the server.
Additions:
One of the features of our software allows people to upload files through an out-of-browser silverlight application.
This error happens specifically when using the application on Mac OSX and uploading multiple files. This works fine on Windows! And uploading just a single file on OSX works fine as well.

A: All sorts of reasons.  there could be a network hickup braking the connection; the client could fail, etc.
Are you catching exceptions when communicating with the socket on the client?


text:
Q: How to port forward for certain domains on OS X? I'm running Virtualbox on OS X Yosemite and using it for web development. I added lines such as the following to /private/etc/hosts:
192.168.33.1 www.mysite.dev

Virtualbox then has these port forwarding rules:

I'm not totally sure why it works like this, but that's how I got the webserver working in Virtualbox.
Unfortunately, due to how the port forwarding is setup, I have to access my sites like this:
www.mysite.dev:8880

This is a problem, not only because it's an inconvenience to type the port number in, but mainly because it messes up links in my existing sites (which weren't designed with having a port number in there in mind).
What I'm wondering is if there's a way to automatically forward traffic to port 8880 for my development domains so that I don't have to include that port in the URLs?

A: As far as I understand ipfw is no longer supported on OSX 10.10. You can use packet filter (see: man pfctl) to automatically forward port 80 on your host machine to port 8080.
I followed the steps in the article below:
http://abetobing.com/blog/port-forwarding-mac-os-yosemite-81.html
First you have to make a forwarding rule. Then you have to reference the rule in the port forwarding config. At last you have to apply the rule.

A: taking a look at your virtualbox port forwardings your forwarding your local port 8880 to the guests port 80
if you change this to forward your local port 80 to the guests 80 then you don't need to add 8880 anymore cause 80 is the default http port
but keep in mind that os x comes with its own webserver which per default uses port 80 so it may conflict until you disable/shutdown the pre installed webserver.


text:
Q: Getting error with if condition What is wrong with my below script?
I am new to scripting and trying out simple scripts. I am getting an error with my script.
START_OUT = `grep -c "Start Report" jeevagan/test_scripts/log.txt`
FINISH_OUT = `grep -c "Finished Report" jeevagan/test_scripts/log.txt`
if [$START_OUT == $FINISH_OUT]
then
echo "All good"
else
echo "Warning!!!Monitor Logs"
fi

A: try leaving spaces on the if statement and add quotes on the variables, like this
if [ "$START_OUT" == "$FINISH_OUT" ]

If this is still not working try this exactly, this works for sure, if it still gives you an error, then use echo brefore the if statement and check what $START_OUT and $FINISH_OUT variables have stored, because the problem could be there, after you do this give us feedback:
 if  test "$START_OUT" = "$FINISH_OUT"

okayyyy, this was one of your problems, the other problem is that you left a space when you used grep and tried to add it in the variable...
i will rewrite your code, copy and paste it please. as you had it, it was like you calling the START_OUT command which obviously doesnt exist.... and tell me if it worked.
START_OUT=`grep -c "Start Report" jeevagan/test_scripts/log.txt`
FINISH_OUT=`grep -c "Finished Report" jeevagan/test_scripts/log.txt`
if  test "$START_OUT" = "$FINISH_OUT"
then
echo "All good"
else
echo "Warning!!!Monitor Logs"
fi

A: bash/sh is very space sensitive. You want
if [ $START_OUT == $FINISH_OUT ]

Note the spacing around the brackets. "=" may be used instead of "==" for strict POSIX compliance. See here for more details and note the comment

In a script, the different parts of the if statement are usually
  well-separated.

A: if [$START_OUT == $FINISH_OUT] is wrong. take care about spaces. it should be like
if [ $START_OUT == $FINISH_OUT ]


text:
Q: notepad++ replacing parantheses with brackets
I am converting a code of mine from MATLAB to julia, thus I need to replace parentheses used for indexing: they are of the type () in MATLAB and of the type [] in julia. Functions parentheses are of the same type in both, i.e. ().
I thought that the fastest way to do this was to use Notepad++, finding all of the parenthes and then replacing them with brackets when need.
Anyhow it does not work as expected.
I won't copy all of the function I am converting now, but some parts as example:
x= coord(:,1);
y= coord(:,2);

natG_coord(1,1)=  sqrt(1/3);
natG_coord(2,1)= -sqrt(1/3);
natG_coord(3,1)= -sqrt(1/3);
natG_coord(4,1)=  sqrt(1/3);

for i=1:4
    dNG(1,i)=  (1+etaG(i))/4 + csiG(i)*(1+etaG(i))/2 - (1-etaG(i)^2)/4 - 2*csiG(i)*(1-etaG(i)^2)/4;
    dNG(2,i)= -(1+etaG(i))/4 + csiG(i)*(1+etaG(i))/2 + (1-etaG(i)^2)/4 - 2*csiG(i)*(1-etaG(i)^2)/4;
    dNG(3,i)= -(1-etaG(i))/4 + csiG(i)*(1-etaG(i))/2 + (1-etaG(i)^2)/4 - 2*csiG(i)*(1-etaG(i)^2)/4;
    dNG(4,i)=  (1-etaG(i))/4 + csiG(i)*(1-etaG(i))/2 - (1-etaG(i)^2)/4 - 2*csiG(i)*(1-etaG(i)^2)/4;
end

I tried finding \((.*)\) and replacing with [$1], but it does not get all of the parentheses. For instance, it gets the ones in declaring x and y, the sqrt value but does not get the natG_coord indexes. In the for cycle, it only gets the last expression of each line, i.e. (1-etaG(i)^2), but the external parenthes, not the etaG index (which is actually what I need to replace).
I cannot see a pattern in the choice and thus cannot come up with a solution.
Other solutions not to get mad doing this parenthesis by parenthesis is fine!
Thank you all for your help.
edit
@stribizhev: the final result should be this:
x= coord[:,1]
y= coord[:,2]

natG_coord[1,1]=  sqrt(1/3)
natG_coord[2,1]= -sqrt(1/3)
natG_coord[3,1]= -sqrt(1/3)
natG_coord[4,1]=  sqrt(1/3)

for i=1:4
  dNG[1,i]=  (1+etaG[i])/4 + csiG[i]*(1+etaG[i])/2 - (1-etaG[i]^2)/4 - 2*csiG[i]*(1-etaG[i]^2)/4
  dNG[2,i]= -(1+etaG[i])/4 + csiG[i]*(1+etaG[i])/2 + (1-etaG[i]^2)/4 - 2*csiG[i]*(1-etaG[i]^2)/4
  dNG[3,i]= -(1-etaG[i])/4 + csiG[i]*(1-etaG[i])/2 + (1-etaG[i]^2)/4 - 2*csiG[i]*(1-etaG[i]^2)/4
  dNG[4,i]=  (1-etaG[i])/4 + csiG[i]*(1-etaG[i])/2 - (1-etaG[i]^2)/4 - 2*csiG[i]*(1-etaG[i]^2)/4
end

What I get finding \((.*)\) and replacing with [$1] one time is:
x= coord[:,1];
y= coord[:,2];

natG_coord[1,1)=  sqrt(1/3];
natG_coord[2,1)= -sqrt(1/3];
natG_coord[3,1)= -sqrt(1/3];
natG_coord[4,1)=  sqrt(1/3];

for i=1:4
    dNG[1,i)=  (1+etaG(i))/4 + csiG(i)*(1+etaG(i))/2 - (1-etaG(i)^2)/4 - 2*csiG(i)*(1-etaG(i)^2]/4;
    dNG[2,i)= -(1+etaG(i))/4 + csiG(i)*(1+etaG(i))/2 + (1-etaG(i)^2)/4 - 2*csiG(i)*(1-etaG(i)^2]/4;
    dNG[3,i)= -(1-etaG(i))/4 + csiG(i)*(1-etaG(i))/2 + (1-etaG(i)^2)/4 - 2*csiG(i)*(1-etaG(i)^2]/4;
    dNG[4,i)=  (1-etaG(i))/4 + csiG(i)*(1-etaG(i))/2 - (1-etaG(i)^2)/4 - 2*csiG(i)*(1-etaG(i)^2]/4;
end

What I get finding \(((?>[^()]|(?R))*)\) and replacing all with [$1] one time is (I know you said several times, if I do it it'll replace every matching braces in the end):
x= coord[:,1];
y= coord[:,2];

natG_coord[1,1]=  sqrt[1/3];
natG_coord[2,1]= -sqrt[1/3];
natG_coord[3,1]= -sqrt[1/3];
natG_coord[4,1]=  sqrt[1/3];

for i=1:4
    dNG[1,i]=  [1+etaG(i)]/4 + csiG[i]*[1+etaG(i)]/2 - [1-etaG(i)^2]/4 - 2*csiG[i]*[1-etaG(i)^2]/4;
    dNG[2,i]= -[1+etaG(i)]/4 + csiG[i]*[1+etaG(i)]/2 + [1-etaG(i)^2]/4 - 2*csiG[i]*[1-etaG(i)^2]/4;
    dNG[3,i]= -[1-etaG(i)]/4 + csiG[i]*[1-etaG(i)]/2 + [1-etaG(i)^2]/4 - 2*csiG[i]*[1-etaG(i)^2]/4;
    dNG[4,i]=  [1-etaG(i)]/4 + csiG[i]*[1-etaG(i)]/2 - [1-etaG(i)^2]/4 - 2*csiG[i]*[1-etaG(i)^2]/4;
end

What I get finding \(([^()]*)\) replacing all with [$1] one time is:
x= coord[:,1];
y= coord[:,2];

natG_coord[1,1]=  sqrt[1/3];
natG_coord[2,1]= -sqrt[1/3];
natG_coord[3,1]= -sqrt[1/3];
natG_coord[4,1]=  sqrt[1/3];

for i=1:4
    dNG[1,i]=  (1+etaG[i])/4 + csiG[i]*(1+etaG[i])/2 - (1-etaG[i]^2)/4 - 2*csiG[i]*(1-etaG[i]^2)/4;
    dNG[2,i]= -(1+etaG[i])/4 + csiG[i]*(1+etaG[i])/2 + (1-etaG[i]^2)/4 - 2*csiG[i]*(1-etaG[i]^2)/4;
    dNG[3,i]= -(1-etaG[i])/4 + csiG[i]*(1-etaG[i])/2 + (1-etaG[i]^2)/4 - 2*csiG[i]*(1-etaG[i]^2)/4;
    dNG[4,i]=  (1-etaG[i])/4 + csiG[i]*(1-etaG[i])/2 - (1-etaG[i]^2)/4 - 2*csiG[i]*(1-etaG[i]^2)/4;
end

So the last one is exactly what I was looking for. Once I go with the "find next" command, I can decide whether they are indexing parantheses or not and substitute them or not (avoiding the sqrt function input, for instance).
Thank you very much for your help.

A: Since the \(([^()]*)\) (to replace with [$1]) worked for you, here is the explanation:
\(([^()]*)\)

Matches:

*

*\( - an opening round bracket

*([^()]*) - Capture group 1 matches zero or more characters other than ( and ) (with [^()]*)

*\)- a closing round bracket

This regex above will match all last nested level parentheses, that do not have any parentheses inside them.
Answering Aaron's remark about replacing the parentheses inside the quoted strings, it is great that Notepad++ supports Boost conditional replacement patterns. We can match what we do not need to modify and replace with self, and use another replacement for the other matches.
(?<o1>"[^"\\]*(?:\\.[^"\\]*)*")|(?<o2>\(([^()]*)\))

And replace with (?{o1}$+{o1}:[$3]).
Note that "[^"\\]*(?:\\.[^"\\]*)*" matches C strings with escaped entities correctly and efficiently. The replacement pattern means to replace with the quoted string (if o1 group matched) or with [+Group 3 value+] (if the other group matched).
If you need to replace outer balanced parentheses, use
\(((?>[^()]|(?R))*)\)

And replace with [$1] (see demo). If you need to replace the overlapping parenthetical substrings, you will need to hit Replace All several times.
Regex explanation:
\(            # an outer literal opening round bracket
   (          #  start group 1
     (?>      #   start of atomic group
       [^()]  #     any character other than ( and )
       |      #    OR
       (?R)   #     recursively match the whole pattern
     )*       #   end atomic group and repeat zero or more times
   )          #  end of group 1
\)            #   match a literal closing round bracket

If the strings you need to replace those parentheses should be preceded with word characters, use
(\w+)(\(((?>[^()]|(?2))*)\))

And replace with $1[$3]. See demo
This regex uses a (?2) subroutine that just repeats the second capture group subpattern.
Now, avoiding to match these inside quoted strings. Assume we have var d = "r(string here)" and we do not want to turn the () to [] here. Instead of (\w+)(\(((?>[^()]|(?2))*)\)) (with $1[$3] replacement), use
(?<o1>"[^"\\]*(?:\\.[^"\\]*)*")|(?<o2>(\w+)(\(((?>[^()]|(?4))*)\)))

And (?{o1}$+{o1}:$3[$5]) as the replacement. This will keep var d = "r(string here)" string intact, and will turn var f = a(fg()g) into var f = a[fg()g].


text:
Q: Pushing data directly to Elasticsearch using Rest API call Is it not possible to injest data directly to Elasticsearch without using any Beat?
My objective is to push data from Jenkins pipeline (groovy) with Rest API call to Elasticsearch. The data I will be visualizing in Kibana dashboard there after.
I don't have access to Jenkins build server hence want to push it to Elasticsearch using Rest API.
Please advise.
Thanks in advance.

A: Alternatively, you can try to install Logstash plugin in jenkins and push Jenkins logs to elasticsearch. Refer to this Streaming Logdata from jenkins to elasticsearch


text:
Q: LibGDX FitViewport doesn't work anymore after Google Play Games Overlay I have an Android game that uses FitViewport so that aspect ratio is always correct (showing black bars as necessary). Everything has been working fine with my previous few phones.
However, now I got a new one, Samsung Galaxy J6. With this phone, after I display, for example, Google Play Games achievements activity, and then return back to the LibGDX activity, the black bars are gone and the FitViewport is effectively not working at all (everything is scaled). Does anyone have ideas why displaying a "native" Android activity on top of the LibGDX activity "breaks" the FitViewport?

A: Oh well. I was simply missing this:
@Override
public void resize(int width, int height) {
    stage.getViewport().update(width, height, true);
}


text:
Q: Button Click Events on Mobile Devices i I have a button on a webpage. The page is only going to be viewed on mobile devices. everything seems to load fine; however, there are some controls on the page. Two date pickers and a button to submit the two dates and present new data. I have a javascript function that works fine on a computer but nothing happens when the button is clicked on a phone. Here is the javascript code.
  function getURL() {
        var from = $("#fromDate").val();
        var to = $("#toDate").val();
        from = from.replace("/", "%2F");
        to = to.replace("/", "%2F");

        $(".toDTP").val("");
        $(".fromDTP").val("");

        window.location.href("http://the new url.aspx?from=" + from + "&to=" + to);

here is the HTML:
  From:<input type="date" name="date" id="fromDate" value="" />
                To:<input type="date" name="date" id="toDate" value="" />

                Fetch Data

what is going wrong here and why am I failing??


text: Q: Zend framework 2 access route in other file then conroller How can I get the url of a specific route in a file that is neither a controller, modell or view? It is a basic php file. I need this in order to make static js variables with the url of my routes


text:
Q: facebook connect not working This all is driving me nuts.
I just integrated facebook in my iphone app.
After typing in my username and password in the login dialog this method is called.
- (void)request:(FBRequest*)request didLoad:(id)result {
    if ([request.method isEqualToString:@"facebook.fql.query"]) {
        NSLog(@"result %@",result);

            NSArray* users = result;
            NSLog(@"users %@",users);
            NSDictionary* user = [users objectAtIndex:0];
            NSString* name = [user objectForKey:@"name"];
            self.facebookName = name;

            if (_posting) {
                [self postToWall];
                _posting = NO;
            }

    }
}

But after this the app crashes most of the times and when I tried to log the "result" array it appears to be empty. Why is it so?
What should I do? Please suggest.

A: use this code

NSArray *users=[[NSArray alloc]initWithObjects:result, nil];
        NSLog(@"users %@",users);
        NSDictionary* user = [[NSDictionary alloc]initWithObjectsAndKeys:users,@"users", nil];
        NSLog(@"%@",user);

A: I got the reason for this.
This was due to the session getting lost frequently in between.
So I had to call [session resume] in the facebook login action event
and in this manner if at all the session is lost by any chance then the previous session is resumed and the "result" does not appears to be nil in  (void)request:(FBRequest*)request didLoad:(id)result method.
Hope this helps out those who are stuck in the same issue.


text:
Q: Increasing click selection tolerance in ArcGIS Online Will the 2016 solution listed at Increase FeatureLayer click tolerance work in Web App Builder (ArcGIS Online) or perhaps a newer solution exists?
We have valid feedback:

I am having a little trouble finding the right place to click to get
the info box to pop up on some projects.  Can you add a selection
feature to make that easier?

Please see  I am seeing when attempting to use the suggested code in AGOL's (within WAB) Configure Popups (does a JS to Arcade converter exist?) and the code copy / paste below.
In 3.x, you can do this by overriding the "_calculateClickTolerance" function of the map's popupManager property. For example:
map.popupManager._calculateClickTolerance = function(graphicsLayers) {
    return 10;};

That is a very simplistic example, but you could implement whatever logic you want inside that function as long as you return an integer (preferably non-negative).
In ArcGIS Desktop
under Selection -> Selection Options -> Selection tolerance
exists and wondering where the similar option is in AGOL (WAB) for configure popups.
I've read through Your Arcade Questions Answered but have not found a solution yet.

A: dojo.connect(map,"onClick",function(evt){
      var query = new esri.tasks.Query();
      query.geometry = pointToExtent(map,evt.mapPoint,10);

function pointToExtent(map, point, toleranceInPixel) {
   var pixelWidth = map.extent.getWidth() / map.width;
   var toleraceInMapCoords = toleranceInPixel * pixelWidth;
   return new esri.geometry.Extent( point.x - toleraceInMapCoords,
                point.y - toleraceInMapCoords,
                point.x + toleraceInMapCoords,
                point.y + toleraceInMapCoords,
                map.spatialReference );
  }

*

*The code is used to build a web application using JSAPI 4.2

*Instead of passing in the map instance, pass it in the map view

*The code was originally for the 3.x API

*Works well with a tolerance of 15


text:
Q: How to use around_action for all controllers except a specific one with some actions In my application controller i use around_action to set the time zone in every controller action :
class ApplicationController < ActionController::Base
     around_action :user_time_zone

     def user_time_zone(&block)
        Time.use_zone("Central America", &block)
     end
end

but in a specific controller i won't to apply this time zone with some actions, so i want something like this :
around_action :user_time_zone, except: {controller: "foo" & action: "bar" & action: "other_action"}

there is a way to this ?

A: In specific controller where you do not need this filter just skip it using 'skip_around_filter'
class FooController < ApplicationController
  skip_around_filter :user_time_zone, :only => [:bar]

end

Note: skip_around_filter is supported in Rails 3.2.1 or higher version


text:
Q: Best Practice - Javascript Animation using timed background image changes I'm fairly new to coding / javascript and was wanting to get feedback on a method I'm using. I got frustrated trying to import multiple adobe animate html5/javascript files so I reverted to:

*

*exporting the animations frame by frame (.png)

*using javascript to call a local file and change the 'src' of a div given a specific interval

filename1 - is the folder file
filename - is the .png filename
Is this bad practice or is there better more efficient way to do this? I plan on having it triggered in an interactive site when users click on different areas of an image. Worried the constant calling of files could be an issue and I'm unsure what would happen if someone triggered a new animation while one was still running?
So far it seems to be running okay, it does 'jitter' every once and a while if I interact with the site while an animation is running.
function playTargetAnimation (filename1,filename) {
      let i = 1;
      $('#'+filename1).attr('src', "images/" + filename1 +"/" + filename +"/" + filename + '0001' + ".png");
      $('#'+filename1).show();
      let runAnim = setInterval(function(){
      let imgCnt = "00" + ("0" + i).slice(-2);
       $('#'+filename1).attr('src', "images/" + filename1 +"/" + filename +"/" + filename + imgCnt + ".png");
       console.log('src', "images/" + filename +"/" + filename + imgCnt + ".png");
       i++;
       if(i === 41) {
         clearInterval(runAnim);
       };
     }, 25);
  }

A:

@import "compass/css3";

.hi {
  margin: 20px;
  width: 50px;
  height: 72px;
  background-image: url("https://s.cdpn.io/79/sprite-steps.png");

}
.hi:hover{
  animation: play .8s steps(10);
}

@keyframes play {
  from {
    background-position:    0px;
  }
  to {
    background-position: -500px;
  }
}

↑ mouse over to view animation

If you prefer javascript, requestAnimationFrame is much better than setInterval.
While my suggestion is css3 animation doc in mdn:
First composite all those frame pictures into one picture file regularly.
Then write css with "animation" and "steps function".
.hi:hover{
  animation: play .8s steps(10);
}

@keyframes play {
  from {
    background-position:    0px;
  }
  to {
    background-position: -500px;
  }
}


text:
Q: Implementing LU factorization with partial pivoting in C using only one matrix I have designed the following C function in order to compute the PA = LU factorization, using only one matrix to store and compute the data:
double plupmc(int n, double **c, int *p, double tol) {
  int i, j, k, pivot_ind = 0, temp_ind;
  int ii, jj;
  double pivot, *temp_row;

  for (j = 0; j < n-1; ++j) {

    pivot = 0.;
    for (i = j; i < n; ++i)
      if (fabs(c[i][j]) > fabs(pivot)) {
        pivot = c[i][j];
        pivot_ind = i;
      }

    temp_row = c[j];
    c[j] = c[pivot_ind];
    c[pivot_ind] = temp_row;

    temp_ind  = p[j];
    p[j] = p[pivot_ind];
    p[pivot_ind] = temp_ind;

    for (k = j+1; k < n; ++k) {
      c[k][j] /= c[j][j];
      c[k][k] -= c[k][j]*c[j][k];
    }

  }
  return 0.;
}

where n is the order of the matrix, c is a pointer to the matrix and p is a pointer to a vector storing the permutations done when partial pivoting the system. The variable tol is not relevant for now. The program works storing in c both the lower and upper triangular parts of the factorization, where U corresponds to the upper triangular part of c and L corresponds to the strictly lower triangular part of c, adding 1's in the diagonal. For what I have been able to test, the part of the program corresponding to partial pivoting is working properly, however, the algorithm used to compute the entries of the matrix is not giving the expected results, and I cannot see why. For instance, if I try to compute the LU factorization of the matrix
1. 2. 3.
4. 5. 6.
7. 8. 9.

I get
    1.    0.     0.         7. 8. 9.
l : 0.143 1.     0.     u : 0. 2. 1.714*
    0.571 0.214* 1.         0. 0. 5.663*

the product of which does not correspond to any permutation of the matrix c. In fact, the wrong entries seem to be the ones marked with a star.
I would appreciate any suggestion to fix this problem.


text:
Q: how it is possible add null to string, but result would not be null? I simulated my code to simple one like this:
select 'a'+
(
    select 'b'+
    (
        select 'c'
        from tbl_one t3
        inner join tbl_alpha a t3.id=a.id
        where t1.id=t3.id
        for xml path('')
    )
    from tbl_one t2
    where t1.id=t2.id
    for xml path('')
)
from tbl_one t1

if my select 'c' part be null, my result should be null, but I don't know what happened, I did not get null result, and only select 'a' part shown.
I expected my result be NULL or abc but my query just give me 'a'
so I do not have any explanation to debug my query.


text:
Q: What is the meaning of ui-g-12 ui-lg-12 ui-md-12? I have checked over the Net and in Primefacess Grid CSS But couldn't find out the abbreviation of g,lg,md

A: Look at the Primefacess forum
ui-lg => number of columns for a large screen (screen width > 1024px)
ui-md => number of columns for a medium screen (screen width < 1024px )
ui-g = > number of columns by default (or screen width < 425px if lg and md columns are define)

A: ui-g-* is grid template in prime component.
xl for extra large screen,
lg for large screen and
md for medium screen.
for example :

Col1

Col2

Col3


text:
Q: How do i create an email this page form for my website? I was looking on how to create a recommend this page form that sends the given pages URL address and where the user can enter their email address and a message however long and a single email address or multiple addresses where the user wants to send the recommend this page to.
I was wondering if anyone knew what code I could use. I am currently using PHP as my server side language.
I wanna know how to code my own form?

A: http://www.addthis.com/ offers a free service we've used with clients a couple of times

A: That's a pretty broad question but essentially to do this with PHP, you will need to be familiar with 3 things:
$_POST array in PHP - holds all form values on the page posted back to the server
mail() PHP function
CAPTCHA implementation for verifying real users
Updated for Frank's spammer comment.

A: I'd recommend checking with your web host first. GoDaddy, for instance, no longer allows your script to grab the form-submitter's email as the sending email. Treats the message as spam and doesn't send it though your submitter will may get your success message.
Another option, though I haven't tried myself, is online forms at Google Docs: http://www.google.com/google-d-s/forms/


text:
Q: EC2 Ubuntu with entire folders permission changed I was using the AWS EC2 to host websites under apache then I made a huge mistake... I tried to change a user group of a folder (to www-data) but instead of this I've changed the entire system user group.
My mistake was a "sudo chown -R www-data:www-data /"
So I lost root access and now almost everything stop to work. I can't even login to SSH anymore.
Is there a way to restore those permission?

A: You need some way to stop the VM, mount the partition on another VM, and chown -R root:root /mnt (or wherever). Then you'll at least be able to get the thing back online and fix the rest; the easiest way to do this is probably to re-install all the Ubuntu packages.
Personally, I would take the opportunity to automate setting up a VM -- so that if anything like this happens again, re-creating the whole thing from scratch is just a command away.


text:
Q: graph API only works for /me/feed not {user-id}/feed I am trying to use Javascript SDK to access user feed. When I put FB.api('/me/posts'), it returns correct result. But if I substitute me with some {user-id} or even my own ID, it returns "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api".
I thought it should work at least for my own user ID, but it did not :(
I have grant user permission for 'user_about_me,user_birthday,user_events,user_friends,user_likes,user_location,user_photos,user_status,user_videos,email,publish_actions,user_posts'
Can anyone help with this?
A billion thanks!


text:
Q: Binary Trees and NullPointerException This method takes a tree of integers and constructs a String of the following:
(The data at the root, String of left subtree, Stringof right subtree)
For example, if a variable tree stores a reference to the following tree:
          +---+
          | 2 |
          +---+
         /     \
     +---+     +---+
     | 8 |     | 1 |
     +---+     +---+
    /         /     \
+---+     +---+     +---+
| 0 |     | 7 |     | 6 |
+---+     +---+     +---+
         /               \
     +---+               +---+
     | 4 |               | 9 |
     +---+               +---+

It should return a String of:
"(2, (8, 0, empty), (1, (7, 4, empty), (6, empty, 9)))"

The method should return "empty" for an empty tree. For a leaf node, it should return the data in the node as a String. For a branch node, it should return a parenthesized String that has three elements separated by commas:
With my method, it sometimes works, but sometimes, it generates a NullPointerException. Can anyone point out where and why this is happening?
Here is what I have:
 private IntTreeNode overallRoot; // first node; linked to other nodes

 // post: returns the string of all data in leaves. For a branch node, return a parenthesized String
 //       w/ three elementsseparated by commas. return empty for empty tree
 public String toString2() {
     if (overallRoot == null) { // If empty tree
         return "empty";
     } else {
         return toString2(overallRoot);
     }
 }

 // helper for toString
 private String toString2(IntTreeNode root) {
     String value = "";
     if (root.left != null && root.right != null) { // If both branches exist
         value += "(" + root.data + ", " + toString2(root.left)+ ", " + toString2(root.right) + ")";
     } else if (root.left != null && root.right == null) { // if right branch is empty
         value += "(" + root.data + ", " + toString2(root.left) + ", empty)";
     } else if (root.left == null && root.right != null) { // if left branch is empty
         value += "(" + root.data + ", empty, " + toString2(root.left) + ")";
     } else { // If at a leaf
         return "" + root.data;
     }
     return value;
 }

Here is the node class:
public class IntTreeNode {
     public int data;
     public IntTreeNode left;
     public IntTreeNode right;

     // constructs a leaf node with given data
     public IntTreeNode(int data) {
         this(data, null, null);
     }

     // constructs a branch node with given data, left subtree,
     // right subtree
     public IntTreeNode(int data, IntTreeNode left, IntTreeNode right) {
         this.data = data;
         this.left = left;
         this.right = right;
     }
}

A: The error is here:
else if (root.left == null && root.right != null) { // if left branch is empty
         value += "(" + root.data + ", empty, " + toString2(root.left) + ")";
}

It should be...
else if (root.left == null && root.right != null) { // if left branch is empty
         value += "(" + root.data + ", empty, " + toString2(root.right) + ")";
}

..., passing root.right rather than root.left to toString2.


text:
Q: Diffrence between javascript Iterator and Generator I read the javascript new features Iterator and Generator here but i didn't get in which scenario we should use Iterator over Generator. Also what is the main difference in between these two.

A: An Iterator allows you to encapsulate traversal. So given one item, you can get to the next item. For example, if you had a blindfold on and you had a row of people and each person was holding the shirt of the person in front of them, you could traverse the queue of people by following their hands. In this example, you would be the Iterator keeping track of who you were touching and the people would be the Iterables.
I think of a generator as a state machine with each yield as a state transition. So for example, if you had the following generator function
function* idMaker() {
  var index = 0;
  while(true)
    yield index++;
}

If would jump from the state 1 -> 2 -> 3 etc. Intuitively, you can think about each state as being a person in a queue and each time you yield, you are following the hands of the person grabbing on the back of the shirt of the next person to get the next state.
Now here's where it gets more confusing. Generator objects are both Iterators and Iterables. You can call generator.next() on a generator object to get the next yielded value as well as calling generator[Symbol.iterator] to get an iterator object which will have its own next() function.


text:
Q: Iterate through a 3d array? I'm coding a Sudoku solver and my teacher recommended that I use a 3d array and since I've never used 3d arrays; I'm having trouble figuring out how to create a loop to iterate through the rows and one through the columns. How would you go about doing this?
Edit: I figured out how to iterate through every third column/row and hopefully I should be able to do the other six eventually, but am I heading in the right direction?
 int[][][] = board[9][3][3];

public boolean columnCheck(int[][][] board)
{
    boolean filled = false;
    for(int i = 0; i < board.length; i++)
    {
        for(int j = 0; j < board[0].length; j++)
        {
            System.out.println(board[i][j][0]);
        }

    }
    return true;
}

public boolean rowCheck(int[][][] board)
{
     boolean filled = false;
    for(int i = 0; i < board.length; i++)
    {
        for(int j = 0; j < board[0].length; j++)
        {
            System.out.println(board[i][0][j]);
        }

    }
    return true;

A: You can use 3 for loops to iterate through a 3D array, e.g.:
public static void main(String[] args) throws FileNotFoundException {
    int[][][] array = new int[9][3][3];
    for(int i=0 ; i<array.length ; i++){
        for(int j=0 ; j<array[i].length ; j++){
            for(int k=0 ; k<array[i][j].length ; k++){
                System.out.println("[" + i + "][" + j + "][" + k + "]:" + array[i][j][k]);
            }
        }
    }
}

However, for sudoku game, you don't need a 3D array. 2D array would suffice.

A: public class Main {

    public static void main(String[] args) {
        int[][][] board = new int[3][3][9];
        // Assume that first parameter is row
        // The second is column

        // Iterating through first row (board[0])
        for (int i = 0; i < 3; i++) {
            // i is col number
            for (int j = 0; j < 9; j++) {
                //j is block number
                System.out.println(board[0][i][j]);
            }
        }

        // Iterating through second column
        for (int i = 0; i < 3; i++) {
            // i is row number
            for (int j = 0; j < 9; j++) {
                // j is block number
                System.out.println(board[i][1][j]);
            }
        }
    }
}

A: I suppose that your 3d array represents the sudoku as follows:
The '9' stands for the 9 small 3x3 blocks. The first '3' for each row of the block and the second '3' for the columns of each block.
That would give the following:
array[0][x][y]  |  array[1][x][y]  |  array[2][x][y]
----------------------------------------------------
array[3][x][y]  |  array[4][x][y]  |  array[5][x][y]
----------------------------------------------------
array[6][x][y]  |  array[7][x][y]  |  array[8][x][y]

To iterate over each row you can do the following:
// The first three rows
// You can probably figure out yourself how to do the last 6,
// and how to combine those 3 seperate sections
for (int i=0; i<3; i++) {
    for (int j=0; j<3; j++) {
        for (int k=0; j<3; k++) {
            System.out.println(array[j][i][k]);
        }
    }
}

// The first three columns
for (int i=0; i<3; i++) {
    for (int j=0; j<7; j+=3) {
        for (int k=0; k<3; k++) {
            System.out.println(array[j][k][i]);
        }
    }
}

I hope this will get you going, without solving it all for you.


text:
Q: How to chain puppet masters I have a Puppetmaster server A and a server B that is a Puppet client of A. I would like to setup server B to be a Puppetmaster itself and make server C be a Puppet client of server B. (Note: all servers are Debian squeeze.)
PM A <------ PM B <------ C
      client       client

I tried, but when I try to start puppetmaster on server B I get this error:

Could not prepare for execution: The certificate retrieved from the
  master does not match the agent's private key.

Is this sort of chaining possible? If so, how?

A: In /etc/puppet.conf you need to specify the certs for server B as a server, and for server B as a client.
When starting puppetmasterd on serverB
puppetmasterd --no-daemonize --verbose --certname serverB_server

To create the client cert:
puppet cert generate <puppet master's certname> --dns_alt_names=<comma-separated list of DNS names>

then conf file
========/etc/puppet.conf===========
[puppetmasterd]
  certname=serverB_server
  ca=true

[puppetd]
  certname=serverB_client
  ca_server=serverA

A: The setup that seemed to be straight forward and work on a Debian/Ubuntu host was to simply setup a separate configuration files and directory.  This is for webrick, not sure what you need to do for passenger.
Create a confdir for the master mkdir -p /etc/puppetmaster/
Update the /etc/default/puppetmaster
--- a/default/puppetmaster
+++ b/default/puppetmaster
@@ -4,4 +4,4 @@
 START=yes

 # Startup options.
-DAEMON_OPTS=""
+DAEMON_OPTS="--confdir=/etc/puppetmaster/"

Create a puppet.conf file in /etc/puppetmaster/ for the master.
[main]
logdir=/var/log/puppetmaster
vardir=/var/lib/puppetmaster
ssldir=/var/lib/puppetmaster/ssl
rundir=/var/run/puppetmaster
factpath=$vardir/lib/facter
templatedir=$confdir/templates
# pluginsync = true
certname=submaster.example.org


text:
Q: Silverlight. Bind style items to the datacontext I have a button with a custom style and I would like to style items to the button datacontext.
Any idea what is wrong with the code below?
This is what I have done:
   <UserControl.Resources>
  <Style x:Key="ButtonStyle1" TargetType="Button">
   <Setter Property="Template">
    <Setter.Value>
     <ControlTemplate TargetType="Button">
      <Grid>
       <TextBlock TextWrapping="Wrap" Text="{Binding ContextText}" DataContext="{TemplateBinding DataContext}"/>
      </Grid>
     </ControlTemplate>
    </Setter.Value>
   </Setter>
  </Style>
 </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White">
     <Button Content="Button" Height="131" Width="103" HorizontalAlignment="Left" VerticalAlignment="Top" Click="Button_Click"/>
     <Button x:Name="button" Style="{StaticResource ButtonStyle1}" Margin="165,86,0,0"/>

    </Grid>

C# code
 public partial class MainPage : UserControl
{
    public MainPage()
    {
        InitializeComponent();
    }

    private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
    {
  button.DataContext=new Test(){ ContextText="TextFromContext"};
button.UpdateLayout();
    }
}
 public class Test
 {
  public String ContextText{get;set;}
 }

A: Umm.. is this what you looking for:-
<Button x:Name="button" Content="{Binding ContextText}" Style="{StaticResource ButtonStyle1}" Margin="165,86,0,0"/>

I'm almost embarrassed to submit it, it seem so 101.


text:
Q: How can I add many sections of dynamic content in express-handlebars? I want to use templates in express-handlebars, i've got a file named "layout.hbs" in a folder called "layouts" inside my views folder for express, i've specified in express view engine config that i want to use handlebars as view engine and i want to use a layout:
app.set("port", process.env.PORT || 3000);
app.set("views", path.join(__dirname, "resources/views"));
app.engine(".hbs", exphbs({
  defaultLayout : "template",
  layoutsDir : path.join(app.get("views"), "layouts"),
  partialsDir : path.join(app.get("views"), "partials"),
  extname : ".hbs",
  helpers : require("./helpers/handlebars/handlebars")
}));
app.set("view engine", ".hbs");

It works fine, i can use the layout in my handlebars files, for now i know that i can use the {{{ body }}} syntax to put the variable HTML content on the template, so, in my layout.hbs file i have this:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="http://localhost:3000/css/style.min.css">
    <title>Welcome!!</title>

    {{{ body }}}

And in my main.hbs file i have this:

Hello from main!!!

So the final result is:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="http://localhost:3000/css/style.min.css">
    <title>Welcome!!</title>

Hello from main!!!

And that's fine, it puts the dynamic content oh the {{{ body }}} tag, but now i need to add more sections of dynamic content to my template like styles and scripts that are different for every page, for example, in my main.hbs i want to add this style:
<link rel="stylesheet" href="http://localhost:3000/css/main.min.css">

But in contact.hbs i want to add:
<link rel="stylesheet" href="http://localhost:3000/css/contact.min.css">

I don't want to add both tags in the layout 'cause when i load the main page i will be loading the contact styles that i don't need and it will make more slower the load of the page.
In Laravel Blade i can do something like:
Layout.blade.php

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="http://localhost:3000/css/style.min.css">

    @yield('css', "")

    <title>Welcome!!</title>

    @yield('main', "")

main.blade.php
@section('css')
    <link rel="stylesheet" href="{{ asset("css/main.min.css") }}">
@endsection

@section('main')

Hello from main!!!

@endsection

And it works, how can i do the same in express-handlebars?

A: I found the solution here.
Basically, we have to add this helper function to your helpers of express-handlebars:
section: (name, options) => {
        if (!this._sections) this._sections = {};
         this._sections[name] = options.fn(this);
         return null;
}

And then in your layouts file you can do something like this:

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="http://localhost:3000/css/style.min.css">

    {{{_sections.css}}}

    <title>Welcome!!</title>

    {{{body}}}

    {{{_sections.scripts}}}

And in your files you can do this:

Hello from main!!!

{{#section 'css'}}
    <link rel="stylesheet" href="http://localhost:3000/css/main.min.css">
{{/section}}

{{#section 'scripts'}}

{{/section}}

And it will results in:

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="http://localhost:3000/css/style.min.css">

    <link rel="stylesheet" href="http://localhost:3000/css/main.min.css">

    <title>Welcome!!</title>

Hello from main!!!

Edit:
If you want something more similar to Laravel with the default text feature you can add this helper:
yield: (name, default_value) => {

    if(typeof default_value == "object") default_value = "";
    return this._sections[name] || default_value;

}

And use in your layout:
{{{ yield "section_index" "default value" }}}


text:
Q: Can't boot after installing Ubuntu into separate partition When I try to boot my computer, I just get a command prompt:
"no such partition
grub>_"
I partitioned my computer hard disk into two partitions:
-- First partition (C:) has the already installed Windows XP (marked as primary partition)
-- Second partition (K:): I installed Ubuntu 11.10 into this one (marked as logical partition, with the name "sd5 or something like that).
After installing Ubuntu, I could boot only Windows.
Did a google search to see what to do. Based on that: an OS to boot, it has to be in a primary partition, and that logical partition can be changed into a primary partition.
Used "MiniTool Partitioning Home Edition 7.8:
-- Changed second partition with Ubuntu into primary partition
-- But, did not change the first already primary into logical partition.
So now, I had two primary partitions.
Now, neither OS boots. Only get the command prompt I noted at the beginning of this post
Right now, I can boot only from a USB-bootable Ubuntu..
Please help!. Thanks for all help.

A: If you can boot into the USB Ubuntu without a problem, I'd open terminal and attempt the following:
sudo update grub

This will solve the problem if it's simple.
Also - not sure on this, but I think Ubuntu needs to be run from a Primary partition.
If possible, re-install Ubuntu as a primary partition.
I recognize that command line, it's the GRUB command line.
This may help then:  Stuck on GRUB Command Line


text:
Q: setting attribute false on more login attempts this is the code i am using for generating recaptcha, if user signin fails.
In this i have to check other scenario where if user login_attempts exceeds 4, then we have to make the user status false.
Session_controller:

def create
cookies[:email] =   params[:user][:email]

Rails.logger.debug("auth_options: #{auth_options.inspect}")

self.resource =  warden.authenticate!(auth_options)

if cookies[:email]
  cookies[:login_attempts] = 0
  set_flash_message(:notice, :signed_in) if is_navigational_format?
  sign_in(resource_name, resource)
  if current_user.status != false
    respond_with resource, :location => after_sign_in_path_for(resource)
  else
    destroy
    flash[:error] = "Your account is locked"
  end

else
  unless params[:user][:email].blank?
    if   cookies[:email].eql?(params[:user][:email])
      cookies[:login_attempts] = cookies[:login_attempts].to_i + 1
    else
      cookies[:login_attempts] = 0
    end

  end
  render :new
end

end

The below is the code i have to implement in above create method:

if cookies[:login_attempts].to_i > 4
        current_user.update_attribute(:status,false)

        flash[:error]= "your account is dismissed"

      end

could you please tell me where i have to include this? Tried to put in and around but bit confusing.

A: unless params[:user][:email].blank?
if   cookies[:email].eql?(params[:user][:email])
  cookies[:login_attempts] = cookies[:login_attempts].to_i + 1
  if cookies[:login_attempts].to_i > 4
    current_user.update_attribute(:status,false)
    flash[:error]= "your account is dismissed"
  end
else
  cookies[:login_attempts] = 0
end
end

And I will suggest you to use sessions for this task cookies can be override.

A: Cookie is not good way because cookie can desable, add  another columns counts into db respective table, then write increase count value into respective model such as
class User .....
  def self.counts
     self.update_attributes(counts: counts+1)
     self.counts
  end
end

Now in controller
if User.counts > 4
  current_user.update_attribute(:status,false)
  flash[:error]= "your account is dismissed"
end

and if user email valid then update count with 0
current_user.update_attributes(counts: 0)


text:
Q: Importing python file to c++ program - ModuleNotFoundError Following this thread
Assume I have the following files in the directory prog:
main.cpp (located in the directory prog)
int main(int argc, char *argv[]){

Py_Initialize();

//Adding current path
PyObject* sys = PyImport_ImportModule("sys");
PyObject* path = PyObject_GetAttrString(sys, "path");
PyObject* cur_dir = PyUnicode_FromString("");
PyList_Append(path, cur_dir);

PyObject* myModuleString = PyUnicode_DecodeFSDefault((char*)"multiset_bell_numbers.py");
PyObject *pModule =  PyImport_Import(myModuleString);
if (pModule == nullptr) {
    PyErr_Print();
    throw std::runtime_error("pModule is empty");
}

return 0;
}

multiset_bell_numbers.py (located in the directory prog)
from sympy.utilities.iterables import multiset_partitions

def calc_partitions(arr):
    res = list(multiset_partitions(arr))
    res.sort(key=lambda part:len(part))
    return res

CMakeLists.txt
cmake_minimum_required(VERSION 3.24)
project(prog)

set(CMAKE_CXX_STANDARD 17)

find_package(Python REQUIRED COMPONENTS Interpreter Development)
include_directories(${Python_INCLUDE_DIRS})
add_executable(prog main.cpp)
target_link_libraries(prog ${Python_LIBRARIES})

But still got an error:

ModuleNotFoundError: No module named 'multiset_bell_numbers'

I have also tried to remove ".py" from the suffix of the string
What should I do?

A: In order for Python to find the multiset_bell_numbers module, it needs to be located in a directory that is in the Python Module Search Path.
The following directories will be checked:

*

*The current folder from which the program executes.

*A list of folders specified in the PYTHONPATH environment variable, if you set it before.

*An installation-dependent list of folders that you configured when you installed Python.

If you ensure that the multiset_bell_numbers is in the same directory that the program is executed from, it should import successfully.
If that is not feasible, you can try updating PYTHONPATH to include the directory containing your module.


text:
Q: More specific tag suggestion when tagging new question I am active in asp.net-mvc tag and I see that many people tag their question with asp.net and mvc tag, but not asp.net-mvc. Since asp.net-mvc is constructed by combining asp.net and mvc, I suggest showing a message like:

Since you selected **asp.net** and **mvc** tags, maybe **asp.net-mvc** may be suitable too.

Message would show only if a combined tag has high popularity.


text:
Q: Setting the size of the graphics window (plot size) in R plot.new()
segments(0, 1, 3)
segments(0, 0.5, 2)

I tried plotting 2 lines, but it seems like my plot size is too small (so the two lines appear to be the same length). I've tried the following in reference to this post but couldn't get the desired result:
> dev.new(height = 3, width = 3)
NULL
> segments(0, 1, 3)
Error in segments(0, 1, 3) : plot.new has not been called yet
> segments(0, 0.5, 2)
Error in segments(0, 0.5, 2) : plot.new has not been called yet

A: You can initialize an empty plot and then put your line segments into this plot:
# empty plot
plot(NULL, ylim=c(-1,2), xlim=c(-1,4), ylab="something", xlab="the x axis")
# add line segments
segments(0, 1, 3)
segments(0, 0.5, 2)

This produces

To remove everything except the line segments, start with
plot(NULL, ylim=c(-1,2), xlim=c(-1,4), ylab="", xlab="", xaxt="n", yaxt="n", bty="n")

You can find references to each of these arguments in the help(par) file.


text:
Q: How to replicate couchdb instances behind home router firewalls? What are the options (if any) to allow replication between couchdb instances without portforwaring the couchdb port on a home router? Assuming both couchdb instances are behind home router firewalls.

A: You can create two different instance of couchdb, change the port number for second instance and then you can replicate the instances.
I have configured two instances of Couchdb on local domain network behind the firewall in similar way.
You can also configure firewall rules for incoming connection for couchdb by allowing access to specific IP address (If both instance are on different machine).


text:
Q: What is a good Configuration for distributed Spring Boot system with 36 downloaders through ssh tunnels I've created a Java Spring Boot application that launches 36 downloader droplets on digital ocean, which ssh tunnel to a database CPU Optimized droplet and downloads from an API into the database.
I've configured hikari as follows towards less pooling connections assuming the database may have trouble with too many and thinking they might not be required.
spring.datasource.hikari.maximumPoolSize=5
spring.datasource.hikari.connectionTimeout=200000
spring.datasource.hikari.maxLifetime=1800000
spring.datasource.hikari.validationTimeout=100000

I'm wondering if those settings may or may not be recommended and why. I've reduced the maximumPoolSize to 5 however I haven't found much information on whether that is considered too small for Java Spring Boot Application to run effectively.
Given each downloader is storing data in the database sequentially do I need to have more than a few pooling connections on each downloader?
I've configured the maximum connections in mysql to 250 and the maximum ssh connections on the database server to 200. I note that 114 sshD processes are created on the server. Can a server handle that many ssh tunneling connections?
Do you forsee any problems with this kind of distributed setup with Spring boot? One thing I have had to do before adjusting to these settings is place retry connection code around each database connection to prevent disconnection errors.
Thanks
Conteh