SecurityAgent terminating app due to uncaught exception - exception

So far, three systems I manage have become unable to allow users to log on. We use a PolicyBanner file (and have been doing so for months or years on dozens of Macs, and yes we've tried deleting /Library/Security/PolicyBanner.rtf from problem machines), and these systems get stuck there… hit the Accept button, and instead of being taken to a login screen, the system churns for a moment and returns them to the banner. We've tried most or all of the usual suspects, and the only "solution" has been to restore an older Time Machine backup.
All three systems in question run 10.8.2 One is an iMac12,2, one is a MacBook Pro, and one is a bigger tower Mac (can't log in to it right now) The only vague possibility I can come up with is, I'm a huge believer in doing as much from the command line as possible… I've scripted a number of things, including updating Java, Adobe Reader, MS Office, etc. I suppose it's possible that installing one or more patches from the shell introduces some weird issue that 99.9% of Mac users would never see. I have another MacBook Pro running 10.8.2 which has not manifested this issue, another macBook Pro running 10.7.5 that has not, and another older MacBook somewhere that I never see online or hear from the user :-)
Another data point... on systems with File Vault enabled, a user who boots the machine and unlocks the disk winds up being logged in. They see the PolicyBanner, are prompted for their Apple ID, and then get a message about how there was some problem, do they want to open applications that were open before. Once they're logged in, if they log out, the system is stuck at the banner again.
So, here's the system.log output. Crash report put me over the 30K character limit but I'd be happy to provide it.
Feb 14 14:12:05 sahara SecurityAgent[1452]: MacBuddy was run = 0
Feb 14 14:12:05 sahara SecurityAgent[1452]: *** WARNING: -[NSImage compositeToPoint:operation:fraction:] is deprecated in MacOSX 10.8 and later. Please use -[NSImage drawAtPoint:fromRect:operation:fraction:] instead.
Feb 14 14:12:05 sahara SecurityAgent[1452]: *** WARNING: -[NSImage compositeToPoint:fromRect:operation:fraction:] is deprecated in MacOSX 10.8 and later. Please use -[NSImage drawAtPoint:fromRect:operation:fraction:] instead.
Feb 14 14:12:05 sahara SecurityAgent[1452]: *** WARNING: -[NSImage compositeToPoint:operation:] is deprecated in MacOSX 10.8 and later. Please use -[NSImage drawAtPoint:fromRect:operation:fraction:] instead.
Feb 14 14:12:05 sahara SecurityAgent[1452]: *** WARNING: -[NSImage compositeToPoint:fromRect:operation:] is deprecated in MacOSX 10.8 and later. Please use -[NSImage drawAtPoint:fromRect:operation:fraction:] instead.
Feb 14 14:12:05 sahara SecurityAgent[1452]: -[__NSCFString bytes]: unrecognized selector sent to instance 0x7fdc61222c40
Feb 14 14:12:05 sahara SecurityAgent[1452]: NSExceptionHandler has recorded the following exception:
NSInvalidArgumentException -- -[__NSCFString bytes]: unrecognized selector sent to instance 0x7fdc61222c40
Stack trace: 0x1057a5637 0x7fff8ac183f0 0x7fff8f0f06ea 0x7fff8f0485ce 0x7fff8f0483b8 0x7fff8b40ce8f 0x7fff90b521b4 0x7fff9109d18a 0x10594d919 0x10595c10e 0x7fff910a36cb 0x7fff910a1767 0x7fff910a141c 0x7fff8e3de29d 0x7fff8f052a46 0x7fff8e3ddfdd 0x7fff8e3de29d 0x7fff8f052a46 0x7fff8e3ddfdd 0x7fff8e468b75 0x7fff8e3de29d 0x7fff8f052a46 0x7fff8e3ddfdd 0x7fff8e3de29d 0x7fff8f052a46 0x7fff8e3ddfdd 0x7fff8e3de29d 0x7fff8f052a46 0x7fff8e3ddfdd 0x7fff8e3de29d 0x7fff8f052a46 0x7fff8e3ddfdd 0x7fff8e3dd634 0x7fff8e3a9a61 0x7fff8e533f44 0x7fff8e466b18 0x7fff8e466138 0x7fff8e465d1f 0x7fff9108d0c5 0x105959e50 0x105948a94 0x7fff8c879a2d 0x7fff8c8740b6 0x7fff8c8790c8 0x7fff8effc0fe 0x7fff8effb6b2 0x7fff8cae00a4 0x7fff8cadfe42 0x7fff8cadfcd3 0x7fff8e3a6613 0x7fff8e3a5ed2 0x7fff8e39d283 0x10577c544 0x7fff878ac7e1 0x1
Feb 14 14:12:05 sahara SecurityAgent[1452]: An uncaught exception was raised
Feb 14 14:12:05 sahara SecurityAgent[1452]: -[__NSCFString bytes]: unrecognized selector sent to instance 0x7fdc61222c40
Feb 14 14:12:05 sahara SecurityAgent[1452]: (
0 CoreFoundation 0x00007fff8f05a0a6 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8ac183f0 objc_exception_throw + 43
2 CoreFoundation 0x00007fff8f0f06ea -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
3 CoreFoundation 0x00007fff8f0485ce ___forwarding___ + 414
4 CoreFoundation 0x00007fff8f0483b8 _CF_forwarding_prep_0 + 232
5 CoreGraphics 0x00007fff8b40ce8f CGDataProviderCreateWithCFData + 133
6 LoginUICore 0x00007fff90b521b4 LUICreateImageFromJPEGData + 12
7 LoginUIKit 0x00007fff9109d18a +[NSImage(LUIHelpers) imageForUserFromJPEGData:avatarType:] + 69
8 loginwindow 0x000000010594d919 APMechanismSetResult + 31889
9 loginwindow 0x000000010595c10e UserListOfUserWithPrimaryGroupGUID + 44376
10 LoginUIKit 0x00007fff910a36cb -[LUIUserListViewController stripView:itemForColumn:] + 525
11 LoginUIKit 0x00007fff910a1767 -[LUIStripView loadItemsForView] + 635
12 LoginUIKit 0x00007fff910a141c -[LUIStripView viewWillDraw] + 160
13 AppKit 0x00007fff8e3de29d __22-[NSView viewWillDraw]_block_invoke_0 + 307
14 CoreFoundation 0x00007fff8f052a46 __NSArrayEnumerate + 582
15 AppKit 0x00007fff8e3ddfdd -[NSView viewWillDraw] + 244
16 AppKit 0x00007fff8e3de29d __22-[NSView viewWillDraw]_block_invoke_0 + 307
17 CoreFoundation 0x00007fff8f052a46 __NSArrayEnumerate + 582
18 AppKit 0x00007fff8e3ddfdd -[NSView viewWillDraw] + 244
19 AppKit 0x00007fff8e468b75 -[NSScrollView viewWillDraw] + 45
20 AppKit 0x00007fff8e3de29d __22-[NSView viewWillDraw]_block_invoke_0 + 307
21 CoreFoundation 0x00007fff8f052a46 __NSArrayEnumerate + 582
22 AppKit 0x00007fff8e3ddfdd -[NSView viewWillDraw] + 244
23 AppKit 0x00007fff8e3de29d __22-[NSView viewWillDraw]_block_invoke_0 + 307
24 CoreFoundation 0x00007fff8f052a46 __NSArrayEnumerate + 582
25 AppKit 0x00007fff8e3ddfdd -[NSView viewWillDraw] + 244
26 AppKit 0x00007fff8e3de29d __22-[NSView viewWillDraw]_block_invoke_0 + 307
27 CoreFoundation 0x00007fff8f052a46 __NSArrayEnumerate + 582
28 AppKit 0x00007fff8e3ddfdd -[NSView viewWillDraw] + 244
29 AppKit 0x00007fff8e3de29d __22-[NSView viewWillDraw]_block_invoke_0 + 307
30 CoreFoundation 0x00007fff8f052a46 __NSArrayEnumerate + 582
31 AppKit 0x00007fff8e3ddfdd -[NSView viewWillDraw] + 244
32 AppKit 0x00007fff8e3dd634 -[NSView _sendViewWillDrawInRect:clipRootView:] + 1525
33 AppKit 0x00007fff8e3a9a61 -[NSView displayIfNeeded] + 1044
34 AppKit 0x00007fff8e533f44 -[NSNextStepFrame displayIfNeeded] + 84
35 AppKit 0x00007fff8e466b18 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 1377
36 AppKit 0x00007fff8e466138 -[NSWindow _doOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 940
37 AppKit 0x00007fff8e465d1f -[NSWindow orderWindow:relativeTo:] + 159
38 LoginUIKit 0x00007fff9108d0c5 -[LUIWindowController showWindow] + 498
39 loginwindow 0x0000000105959e50 UserListOfUserWithPrimaryGroupGUID + 35482
40 loginwindow 0x0000000105948a94 APMechanismSetResult + 11788
41 libdispatch.dylib 0x00007fff8c879a2d _dispatch_barrier_sync_f_slow_invoke + 77
42 libdispatch.dylib 0x00007fff8c8740b6 _dispatch_client_callout + 8
43 libdispatch.dylib 0x00007fff8c8790c8 _dispatch_main_queue_callback_4CF + 275
44 CoreFoundation 0x00007fff8effc0fe __CFRunLoopRun + 1614
45 CoreFoundation 0x00007fff8effb6b2 CFRunLoopRunSpecific + 290
46 HIToolbox 0x00007fff8cae00a4 RunCurrentEventLoopInMode + 209
47 HIToolbox 0x00007fff8cadfe42 ReceiveNextEventCommon + 356
48 HIToolbox 0x00007fff8cadfcd3 BlockUntilNextEventMatchingListInMode + 62
49 AppKit 0x00007fff8e3a6613 _DPSNextEvent + 685
50 AppKit 0x00007fff8e3a5ed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
51 AppKit 0x00007fff8e39d283 -[NSApplication run] + 517
52 SecurityAgent 0x000000010577c544 SecurityAgent + 70980
53 libdyld.dylib 0x00007fff878ac7e1 start + 0
54 ??? 0x0000000000000001 0x0 + 1
)
Feb 14 14:12:05 sahara SecurityAgent[1452]: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString bytes]: unrecognized selector sent to instance 0x7fdc61222c40'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff8f05a0a6 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8ac183f0 objc_exception_throw + 43
2 CoreFoundation 0x00007fff8f0f06ea -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
3 CoreFoundation 0x00007fff8f0485ce ___forwarding___ + 414
4 CoreFoundation 0x00007fff8f0483b8 _CF_forwarding_prep_0 + 232
5 CoreGraphics 0x00007fff8b40ce8f CGDataProviderCreateWithCFData + 133
6 LoginUICore 0x00007fff90b521b4 LUICreateImageFromJPEGData + 12
7 LoginUIKit 0x00007fff9109d18a +[NSImage(LUIHelpers) imageForUserFromJPEGData:avatarType:] + 69
8 loginwindow 0x000000010594d919 APMechanismSetResult + 31889
9 loginwindow 0x000000010595c10e UserListOfUserWithPrimaryGroupGUID + 44376
10 LoginUIKit 0x00007fff910a36cb -[LUIUserListViewController stripView:itemForColumn:] + 525
11 LoginUIKit 0x00007fff910a1767 -[LUIStripView loadItemsForView] + 635
12 LoginUIKit 0x00007fff910a141c -[LUIStripView viewWillDraw] + 160
13 AppKit 0x00007fff8e3de29d __22-[NSView viewWillDraw]_block_invoke_0 + 307
14 CoreFoundation 0x00007fff8f052a46 __NSArrayEnumerate + 582
15 AppKit 0x00007fff8e3ddfdd -[NSView viewWillDraw] + 244
16 AppKit 0x00007fff8e3de29d __22-[NSView viewWillDraw]_block_invoke_0 + 307
17 CoreFoundation 0x00007fff8f052a46 __NSArrayEnumerate + 582
18 AppKit 0x00007fff8e3ddfdd -[NSView viewWillDraw] + 244
19 AppKit 0x00007fff8e468b75 -[NSScrollView viewWillDraw] + 45
20 AppKit 0x00007fff8e3de29d __22-[NSView viewWillDraw]_block_invoke_0 + 307
21 CoreFoundation 0x00007fff8f052a46 __NSArrayEnumerate + 582
22 AppKit 0x00007fff8e3ddfdd -[NSView viewWillDraw] + 244
23 AppKit 0x00007fff8e3de29d __22-[NSView viewWillDraw]_block_invoke_0 + 307
24 CoreFoundation 0x00007fff8f052a46 __NSArrayEnumerate + 582
25 AppKit 0x00007fff8e3ddfdd -[NSView viewWillDraw] + 244
26 AppKit 0x00007fff8e3de29d __22-[NSView viewWillDraw]_block_invoke_0 + 307
27 CoreFoundation 0x00007fff8f052a46 __NSArrayEnumerate + 582
28 AppKit 0x00007fff8e3ddfdd -[NSView viewWillDraw] + 244
29 AppKit 0x00007fff8e3de29d __22-[NSView viewWillDraw]_block_invoke_0 + 307
30 CoreFoundation 0x00007fff8f052a46 __NSArrayEnumerate + 582
31 AppKit 0x00007fff8e3ddfdd -[NSView viewWillDraw] + 244
32 AppKit 0x00007fff8e3dd634 -[NSView _sendViewWillDrawInRect:clipRootView:] + 1525
33 AppKit 0x00007fff8e3a9a61 -[NSView displayIfNeeded] + 1044
34 AppKit 0x00007fff8e533f44 -[NSNextStepFrame displayIfNeeded] + 84
35 AppKit 0x00007fff8e466b18 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 1377
36 AppKit 0x00007fff8e466138 -[NSWindow _doOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 940
37 AppKit 0x00007fff8e465d1f -[NSWindow orderWindow:relativeTo:] + 159
38 LoginUIKit 0x00007fff9108d0c5 -[LUIWindowController showWindow] + 498
39 loginwindow 0x0000000105959e50 UserListOfUserWithPrimaryGroupGUID + 35482
40 loginwindow 0x0000000105948a94 APMechanismSetResult + 11788
41 libdispatch.dylib 0x00007fff8c879a2d _dispatch_barrier_sync_f_slow_invoke + 77
42 libdispatch.dylib 0x00007fff8c8740b6 _dispatch_client_callout + 8
43 libdispatch.dylib 0x00007fff8c8790c8 _dispatch_main_queue_callback_4CF + 275
44 CoreFoundation 0x00007fff8effc0fe __CFRunLoopRun + 1614
45 CoreFoundation 0x00007fff8effb6b2 CFRunLoopRunSpecific + 290
46 HIToolbox 0x00007fff8cae00a4 RunCurrentEventLoopInMode + 209
47 HIToolbox 0x00007fff8cadfe42 ReceiveNextEventCommon + 356
48 HIToolbox 0x00007fff8cadfcd3 BlockUntilNextEventMatchingListInMode + 62
49 AppKit 0x00007fff8e3a6613 _DPSNextEvent + 685
50 AppKit 0x00007fff8e3a5ed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
51 AppKit 0x00007fff8e39d283 -[NSApplication run] + 517
52 SecurityAgent 0x000000010577c544 SecurityAgent + 70980
53 libdyld.dylib 0x00007fff878ac7e1 start + 0
54 ??? 0x0000000000000001 0x0 + 1
)
Feb 14 14:12:06 sahara ReportCrash[1492]: DebugSymbols was unable to start a spotlight query: spotlight is not responding or disabled.
Feb 14 14:12:06 sahara ReportCrash[1492]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
Feb 14 14:12:06 sahara ReportCrash[1492]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
Feb 14 14:12:06 sahara ReportCrash[1492]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
Feb 14 14:12:06 sahara ReportCrash[1492]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
Feb 14 14:12:06 sahara ReportCrash[1492]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
Feb 14 14:12:06 sahara ReportCrash[1492]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
Feb 14 14:12:06 sahara ReportCrash[1492]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
Feb 14 14:12:06 sahara ReportCrash[1492]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
Feb 14 14:12:06 sahara ReportCrash[1492]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
Feb 14 14:12:06 sahara ReportCrash[1492]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
Feb 14 14:12:06 sahara com.apple.SecurityServer[20]: Engine::authorize: Rule::evaluate returned 4294907288 returning errAuthorizationInternal
Feb 14 14:12:06 sahara loginwindow[1440]: Login Window - Returned from Security Agent
Feb 14 14:12:06 sahara loginwindow[1440]: AuthorizationRef doesn't have a username (<LoginAuthRefMgr: 0x7f9e4c220640>). Exiting.
Feb 14 14:12:06 sahara WindowServer[1441]: CGXRestartSessionWorkspace: session workspace exited for session 256 (on console)
Feb 14 14:12:06 sahara WindowServer[1441]: Session 256 released (1 references)
Feb 14 14:12:06 sahara WindowServer[1441]: Session 256 released (0 references)
Feb 14 14:12:06 sahara WindowServer[1441]: loginwindow connection closed; closing server.
Feb 14 14:12:06 sahara com.apple.launchd[1] (com.apple.SecurityAgent.00000000-0000-0000-0000-0000000186AC[1452]): Job appears to have crashed: Abort trap: 6
Feb 14 14:12:06 sahara loginwindow[1493]: Login Window Application Started
Feb 14 14:12:06 sahara WindowServer[1494]: Server is starting up
Feb 14 14:12:06 sahara WindowServer[1494]: Session 256 retained (2 references)
Feb 14 14:12:06 sahara WindowServer[1494]: Session 256 released (1 references)
Feb 14 14:12:06 sahara WindowServer[1494]: Session 256 retained (2 references)
Feb 14 14:12:06 sahara WindowServer[1494]: init_page_flip: page flip mode is on
Feb 14 14:12:06 sahara WindowServer[1494]: mux_initialize: Mode is dynamic
Feb 14 14:12:06 sahara WindowServer[1494]: GLCompositor enabled for tile size [256 x 256]
Feb 14 14:12:06 sahara WindowServer[1494]: CGXGLInitMipMap: mip map mode is on
Feb 14 14:12:06 sahara WindowServer[1494]: WSMachineUsesNewStyleMirroring: true
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x04272d80: GL mask 0x11; bounds (0, 0)[1680 x 1050], 14 modes available
Main, Active, on-line, enabled, built-in, boot, Vendor 610, Model 9cb6, S/N 0, Unit 0, Rotation 0
UUID 0x0000061000009cb60000000004272d80
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x003f003f: GL mask 0x8; bounds (0, 0)[0 x 0], 1 modes available
off-line, enabled, Vendor ffffffff, Model ffffffff, S/N ffffffff, Unit 3, Rotation 0
UUID 0xffffffffffffffffffffffff003f003f
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x003f003e: GL mask 0x4; bounds (0, 0)[0 x 0], 1 modes available
off-line, enabled, Vendor ffffffff, Model ffffffff, S/N ffffffff, Unit 2, Rotation 0
UUID 0xffffffffffffffffffffffff003f003e
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x003f003d: GL mask 0x2; bounds (0, 0)[0 x 0], 1 modes available
off-line, enabled, Vendor ffffffff, Model ffffffff, S/N ffffffff, Unit 1, Rotation 0
UUID 0xffffffffffffffffffffffff003f003d
Feb 14 14:12:06 sahara WindowServer[1494]: Created shield window 0x4 for display 0x04272d80
Feb 14 14:12:06 sahara WindowServer[1494]: Created shield window 0x5 for display 0x003f003f
Feb 14 14:12:06 sahara WindowServer[1494]: Created shield window 0x6 for display 0x003f003e
Feb 14 14:12:06 sahara WindowServer[1494]: Created shield window 0x7 for display 0x003f003d
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x04272d80: GL mask 0x11; bounds (0, 0)[1680 x 1050], 14 modes available
Main, Active, on-line, enabled, built-in, boot, Vendor 610, Model 9cb6, S/N 0, Unit 0, Rotation 0
UUID 0x0000061000009cb60000000004272d80
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x003f003f: GL mask 0x8; bounds (2704, 0)[1 x 1], 1 modes available
off-line, enabled, Vendor ffffffff, Model ffffffff, S/N ffffffff, Unit 3, Rotation 0
UUID 0xffffffffffffffffffffffff003f003f
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x003f003e: GL mask 0x4; bounds (2705, 0)[1 x 1], 1 modes available
off-line, enabled, Vendor ffffffff, Model ffffffff, S/N ffffffff, Unit 2, Rotation 0
UUID 0xffffffffffffffffffffffff003f003e
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x003f003d: GL mask 0x2; bounds (2706, 0)[1 x 1], 1 modes available
off-line, enabled, Vendor ffffffff, Model ffffffff, S/N ffffffff, Unit 1, Rotation 0
UUID 0xffffffffffffffffffffffff003f003d
Feb 14 14:12:06 sahara WindowServer[1494]: CGXPerformInitialDisplayConfiguration
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x04272d80: MappedDisplay Unit 0; Alias(4, 0x11); Vendor 0x610 Model 0x9cb6 S/N 0 Dimensions 13.03 x 8.15; online enabled built-in, Bounds (0,0)[1680 x 1050], Rotation 0, Resolution 1
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x003f003f: MappedDisplay Unit 3; Vendor 0xffffffff Model 0xffffffff S/N -1 Dimensions 0.00 x 0.00; offline enabled, Bounds (2704,0)[1 x 1], Rotation 0, Resolution 1
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x003f003e: MappedDisplay Unit 2; Vendor 0xffffffff Model 0xffffffff S/N -1 Dimensions 0.00 x 0.00; offline enabled, Bounds (2705,0)[1 x 1], Rotation 0, Resolution 1
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x003f003d: MappedDisplay Unit 1; Vendor 0xffffffff Model 0xffffffff S/N -1 Dimensions 0.00 x 0.00; offline enabled, Bounds (2706,0)[1 x 1], Rotation 0, Resolution 1
Feb 14 14:12:06 sahara WindowServer[1494]: CGXMuxBoot: Boot normal
Feb 14 14:12:06 sahara WindowServer[1494]: GLCompositor: GL renderer id 0x01022647, GL mask 0x0000000f, accelerator 0x00003237, unit 0, caps QEX|QGL|MIPMAP, vram 1024 MB
Feb 14 14:12:06 sahara ReportCrash[1492]: Saved crash report for SecurityAgent[1452] version 7.0 (55116.8) to /Library/Logs/DiagnosticReports/SecurityAgent_2013-02-14-141206_sahara.crash
Feb 14 14:12:06 sahara ReportCrash[1492]: Removing excessive log: file://localhost/Library/Logs/DiagnosticReports/SecurityAgent_2013-02-05-100201_sahara.crash
Feb 14 14:12:06 sahara WindowServer[1494]: GLCompositor: GL renderer id 0x01022647, GL mask 0x0000000f, texture units 8, texture max 16384, viewport max {16384, 16384}, extensions FPRG|NPOT|GLSL|FLOAT
Feb 14 14:12:06 sahara WindowServer[1494]: GLCompositor: GL renderer id 0x01024400, GL mask 0x00000010, accelerator 0x000048c7, unit 4, caps QEX|QGL|MIPMAP, vram 420 MB
Feb 14 14:12:06 sahara WindowServer[1494]: GLCompositor: GL renderer id 0x01024400, GL mask 0x00000010, texture units 8, texture max 16384, viewport max {16384, 16384}, extensions FPRG|NPOT|GLSL|FLOAT
Feb 14 14:12:06 sahara loginwindow[1493]: **DMPROXY** Found `/System/Library/CoreServices/DMProxy'.
Feb 14 14:12:06 sahara WindowServer[1494]: Created shield window 0x8 for display 0x04272d80
Feb 14 14:12:06 sahara WindowServer[1494]: Display 0x04272d80: MappedDisplay Unit 0; ColorProfile { 2, "Color LCD"}; TransferTable (256, 3)
Feb 14 14:12:06 sahara launchctl[1496]: com.apple.findmymacmessenger: Already loaded
Feb 14 14:12:06 sahara com.apple.SecurityServer[20]: Session 100013 created
Feb 14 14:12:06 sahara hidd[69]: CGSShutdownServerConnections: Detaching application from window server
Feb 14 14:12:06 sahara hidd[69]: CGSDisplayServerShutdown: Detaching display subsystem from window server
Feb 14 14:12:06 sahara helpd[1503]: Could not find access page in directory /Library/Documentation/Help/Norton Help Scripts
Feb 14 14:12:06 --- last message repeated 1 time ---
Feb 14 14:12:06 sahara locationd[1505]: Incorrect NSStringEncoding value 0x8000100 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future.
Feb 14 14:12:06 sahara locationd[1505]: NOTICE,Location icon should now be in state 0
Feb 14 14:12:06 sahara UserEventAgent[1500]: cannot find useragent 1102
Feb 14 14:12:06 sahara loginwindow[1493]: Login Window Started Security Agent
Feb 14 14:12:06 sahara WindowServer[1494]: 3891612: App SecurityAgent cannot order in untagged windows before login.
Feb 14 14:12:06 sahara WindowServer[1494]: kCGErrorInvalidOperation: CGXOrderWinsAndPanels: error ordering window
Feb 14 14:12:07 sahara com.apple.launchd.peruser.92[1406]: Background: Bug: 12C3012: launchd + 80370 [7DCC9489-2DF5-3807-83FA-EF5666EE8078]: 0x0
Feb 14 14:12:07 sahara com.apple.launchd.peruser.92[1406]: Background: This API can only be used by a process running within an Aqua session.
Feb 14 14:12:07 sahara SecurityAgent[1506]: spawn_via_launchd() failed, errno=5 label=[0x0-0x5a05a].com.apple.AppleSpell path=/System/Library/Services/AppleSpell.service/Contents/MacOS/AppleSpell flags=0
Feb 14 14:12:07 --- last message repeated 1 time ---
Feb 14 14:12:07 sahara SecurityAgent[1506]: Error launching spell checker for U.S. English: Error Domain=NSCocoaErrorDomain Code=256 "The application “AppleSpell.service” could not be launched because a miscellaneous error occurred (OSStatus -10810)." UserInfo=0x7fc6d8c60940 {NSURL=file://localhost/System/Library/Services/AppleSpell.service/, NSLocalizedDescription=The application “AppleSpell.service” could not be launched because a miscellaneous error occurred (OSStatus -10810)., NSUnderlyingError=0x7fc6d8c62330 "The operation couldn’t be completed. (OSStatus error -10810.)"}
Feb 14 14:12:08 sahara WindowServer[1494]: **DMPROXY** (2) Found `/System/Library/CoreServices/DMProxy'.
Feb 14 14:12:08 sahara WindowServer[1494]: Display 0x04272d80: MappedDisplay Unit 0; ColorProfile { 2, "Color LCD"}; TransferTable (256, 3)
Feb 14 14:12:09 --- last message repeated 1 time ---
Feb 14 14:12:09 sahara WindowServer[1494]: MPAccessSurfaceForDisplayDevice: Set up page flip mode on display 0x04272d80 device: 0x105604320 isBackBuffered: 1 numComp: 3 numDisp: 3

Related

Ubuntu 17.10 - ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I've seen similar questions being asked on stack overflow but none of them seem to solve my issue properly. I have recently upgraded my system from Ubuntu 16.04 to Ubuntu 17.10 . Since then, I've been experiencing a problem with mysql where I'm not able to start it up properly and it shows the following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)
I've searched for many solutions online and as a last effort also tried uninstalling and reinstalling but the problem resurfaces after a few days or few attempts. Upon running "service mysql start", it shows:
Job for mysql.service failed because the control process exited with
error code.
See "systemctl status mysql.service" and "journalctl -xe" for
details.
Upon running the suggested commands it shows the following logs:
systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor
preset: enabled)
Active: activating (start-post) (Result: exit-code) since Thu 2018-
02-22 09:06:31 IST; 4s ago
Process: 8936 ExecStart=/usr/sbin/mysqld (code=exited,
status=1/FAILURE)
Process: 8930 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
(code=exited, status=0/SUCCESS)
Main PID: 8936 (code=exited, status=1/FAILURE); Control PID: 8937
(mysql-systemd-s)
Tasks: 2 (limit: 4915)
CGroup: /system.slice/mysql.service
└─control
├─8937 /bin/bash /usr/share/mysql/mysql-systemd-start post
└─8948 sleep 1
Feb 22 09:06:31 vamshi-Lenovo-G50-70 systemd[1]: Starting MySQL
Community Server...
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:31.948822Z 0 [Warning] Changed limits: max_open_files: 1024
(requested 5000)
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:31.948879Z 0 [Warning] Changed limits: table_open_cache: 431
(requested 2000)
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:32.126417Z 0 [Warning] TIMESTAMP with implicit DEFAULT value
is deprecated. Please use --explicit_def
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:32.128149Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21-
0ubuntu0.17.10.1) starting as process 8936 ...
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:32.130652Z 0 [ERROR] Could not open file
'/var/log/mysql/error.log' for error logging: No such file o
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:32.130675Z 0 [ERROR] Aborting
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:32.130694Z 0 [Note] Binlog end
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:32.130750Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
Feb 22 09:06:32 vamshi-Lenovo-G50-70 systemd[1]: mysql.service: Main
process exited, code=exited, status=1/FAILURE
journalctl -xe
Feb 22 09:11:21 vamshi-Lenovo-G50-70 gnome-shell[2902]:
[AppIndicatorSupport-WARN] Attempting to re-register
:1.69/org/ayatana/NotificationItem/multiload; resetting inst
Feb 22 09:11:21 vamshi-Lenovo-G50-70 gnome-shell[2902]:
[AppIndicatorSupport-WARN] Item
:1.69/org/ayatana/NotificationItem/multiload is already registered
ESCOD
Every time this happens, I uninstall mysql and reinstall(server not client), and then it works alright for the first few attempts, then it goes back to same situation. Thanks in advance!
ls -al
total 32824
drwxrwxr-x 8 root syslog 4096 Feb 22 08:44 .
drwxr-xr-x 14 root root 4096 Feb 16 2017 ..
-rw-r--r-- 1 root root 1527 Feb 17 08:58 alternatives.log
-rw-r----- 1 root adm 0 Feb 22 08:44 apport.log
-rw-r----- 1 root adm 486 Feb 21 07:29 apport.log.1
-rw-r----- 1 root adm 455 Feb 20 20:54 apport.log.2.gz
-rw-r----- 1 root adm 514 Feb 19 21:42 apport.log.3.gz
-rw-r----- 1 root adm 758 Feb 19 18:15 apport.log.4.gz
-rw-r----- 1 root adm 459 Feb 17 23:07 apport.log.5.gz
-rw-r----- 1 root adm 1389 Feb 16 00:33 apport.log.6.gz
-rw-r----- 1 root adm 275 Feb 14 20:16 apport.log.7.gz
drwxr-xr-x 2 root root 4096 Feb 17 08:55 apt
-rw-r----- 1 syslog adm 86558 Feb 22 09:17 auth.log
-rw-r----- 1 syslog adm 97522 Feb 18 18:02 auth.log.1
-rw------- 1 root utmp 0 Feb 14 20:17 btmp
drwxr-x--- 2 root lp 4096 Feb 22 08:44 cups
drwxr-xr-x 2 root root 4096 Feb 5 14:51 dist-upgrade
-rw-r--r-- 1 root root 30036 Feb 17 08:58 dpkg.log
drwx--x--x 2 root gdm 4096 Feb 14 20:18 gdm3
-rw-r--r-- 1 root root 2136 Feb 22 08:39 gpu-manager.log
-rw-r----- 1 syslog adm 3745433 Feb 22 09:28 kern.log
-rw-r----- 1 syslog adm 2302923 Feb 18 18:07 kern.log.1
-rw-rw-r-- 1 root utmp 0 Feb 14 20:17 lastlog
-rw-r----- 1 syslog adm 657 Feb 22 08:40 mail.log
-rw-r----- 1 syslog adm 1971 Feb 18 15:31 mail.log.1
-rw-r----- 1 syslog adm 3706136 Feb 22 09:28 syslog
-rw-r----- 1 syslog adm 18760212 Feb 22 08:44 syslog.1
-rw-r----- 1 syslog adm 989385 Feb 21 07:07 syslog.2.gz
-rw-r----- 1 syslog adm 587416 Feb 20 09:09 syslog.3.gz
-rw-r----- 1 syslog adm 593456 Feb 19 18:21 syslog.4.gz
-rw-r----- 1 syslog adm 672682 Feb 18 18:07 syslog.5.gz
-rw-r----- 1 syslog adm 166575 Feb 17 09:09 syslog.6.gz
-rw-r----- 1 syslog adm 891827 Feb 16 00:44 syslog.7.gz
-rw-r----- 1 syslog adm 572158 Feb 22 09:28 ufw.log
-rw-r----- 1 syslog adm 234885 Feb 18 18:06 ufw.log.1
drwxr-xr-x 2 root root 4096 Feb 15 22:00 unattended-upgrades
drwxr-xr-x 2 root root 4096 Feb 22 08:40 vmware
-rw-rw-r-- 1 root utmp 20736 Feb 22 08:41 wtmp
Create folder /var/log/mysql and make sure mysqld can write to it.

Can we integrate Google's IMA3 SDK on tvos9

I am integrating Google's IMA3 SDk on TVOS9. as per sample app, I have integrated the as per the sample code https://github.com/googleads/googleads-ima-ios/releases.
but I am getting following error :
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteNotification imaMessage]: unrecognized selector sent to instance 0x7f823a8886d0'
and the stack
*** First throw call stack:
(
0 CoreFoundation 0x000000010ce2aff5 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c22cdeb objc_exception_throw + 48
2 CoreFoundation 0x000000010ce3361d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010cd80a9a ___forwarding___ + 970
4 CoreFoundation 0x000000010cd80648 _CF_forwarding_prep_0 + 120
5 App 0x000000010af420f1 -[IMAJavascriptBridge handleMessageInitialized:] + 157
6 CoreFoundation 0x000000010cdf782c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
7 CoreFoundation 0x000000010cdf756b _CFXRegistrationPost + 427
8 CoreFoundation 0x000000010cdf72d2 ___CFXNotificationPost_block_invoke + 50
9 CoreFoundation 0x000000010ce3cb02 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1986
10 CoreFoundation 0x000000010ccf2409 _CFXNotificationPost + 633
11 Foundation 0x000000010bdba259 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
12 App 0x000000010af43c72 -[IMAJavascriptSession didReceiveMessage:] + 304
13 App 0x000000010af43008 -[IMAJavascriptDispatcher processNewMessage:] + 310
14 App 0x000000010af42bcb -[IMAJavascriptDispatcher processNewMessageWithChannelName:data:] + 144
15 App 0x000000010af42633 -[IMAJavascriptBridge webView:didReceiveMessage:] + 165
16 App 0x000000010af5a8f9 -[IMAWKWebView userContentController:didReceiveScriptMessage:] + 164
17 WebKit 0x000000010f311ced _ZN28ScriptMessageHandlerDelegate14didPostMessageERN6WebKit12WebPageProxyERNS0_13WebFrameProxyERKNS0_18SecurityOriginDataERN7WebCore21SerializedScriptValueE + 217
18 WebKit 0x000000010f2c2b73 _ZN6WebKit29WebUserContentControllerProxy14didPostMessageERN3IPC10ConnectionEyyRKNS_18SecurityOriginDataEyRKNS1_13DataReferenceE + 221
19 WebKit 0x000000010f2c4868 _ZN3IPC13handleMessageIN8Messages29WebUserContentControllerProxy14DidPostMessageEN6WebKit29WebUserContentControllerProxyEMS5_FvRNS_10ConnectionEyyRKNS4_18SecurityOriginDataEyRKNS_13DataReferenceEEEEvS7_RNS_14MessageDecoderEPT0_T1_ + 142
20 WebKit 0x000000010f1239e5 _ZN3IPC18MessageReceiverMap15dispatchMessageERNS_10ConnectionERNS_14MessageDecoderE + 113
21 WebKit 0x000000010f2a6210 _ZN6WebKit15WebProcessProxy17didReceiveMessageERN3IPC10ConnectionERNS1_14MessageDecoderE + 24
22 WebKit 0x000000010f0e191a _ZN3IPC10Connection15dispatchMessageENSt3__110unique_ptrINS_14MessageDecoderENS1_14default_deleteIS3_EEEE + 102
23 WebKit 0x000000010f0e3be2 _ZN3IPC10Connection18dispatchOneMessageEv + 114
24 JavaScriptCore 0x000000010bab0ad5 _ZN3WTF7RunLoop11performWorkEv + 437
25 JavaScriptCore 0x000000010bab11b2 _ZN3WTF7RunLoop11performWorkEPv + 34
26 CoreFoundation 0x000000010cd56bc1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
27 CoreFoundation 0x000000010cd4caec __CFRunLoopDoSources0 + 556
28 CoreFoundation 0x000000010cd4bfa3 __CFRunLoopRun + 867
29 CoreFoundation 0x000000010cd4b9b8 CFRunLoopRunSpecific + 488
30 GraphicsServices 0x0000000110bcdad2 GSEventRunModal + 161
31 UIKit 0x000000010db9c8fc UIApplicationMain + 171
32 App 0x000000010af35b2d main + 109
33 libdyld.dylib 0x00000001107a99e9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
AFAIK Google IMA depends on WebKit which does not exist on tvOS, so you cannot use this on tvOS yet. Google will need to release a build specifically for tvOS...

SSRS Moving average

Please i need help to calculate moving average in SSRS. see example from excel bellow. i have search net and looked at other forum without success.
the moving average is something like Avg(A1:A3),Avg(A2:A4),Avg(A3:A5)etc
Count of ID BAND
-20 >20 <12 Grand Total Three Months Avg
Year Month <15 15-20 >20 Total
2012/2013 Jan 35 9 13 57 57
Feb 34 23 20 77 67
Mar 25 33 8 66 =AVERAGE(F5:F7)
Apr 7 31 13 51 65
May 6 10 13 29 49
Jun 19 14 18 51 44
Jul 34 16 6 56 45
Aug 26 21 30 77 =AVERAGE(F10:F12)
Sep 13 53 21 =AVERAGE(F11:F13)
Oct 1 34 33 68 =AVERAGE(F12:F14)
Nov 35 16 19 70 53
Dec 33 23 36 92 77

JSON framework error

I am trying to run the salesforce ios phonegap app for mobile sdk
project named
https://github.com/forcedotcom/SalesforceMobileSDK-iOS/tree/master/hy...
The app starts but stops with the Exception:
2012-01-09 17:18:15.897 VFConnector[1354:207] -[NSCFString JSONValue]:
unrecognized selector sent to instance 0x5aac9b0
2012-01-09 17:18:15.916 VFConnector[1354:207] *** Terminating app due
to uncaught exception 'NSInvalidArgumentException', reason: '-
[NSCFString JSONValue]: unrecognized selector sent to instance
0x5aac9b0'
*** Call stack at first throw:
(
0 CoreFoundation 0x01a775a9
__exceptionPreprocess + 185
1 libobjc.A.dylib 0x01bcb313
objc_exception_throw + 44
2 CoreFoundation 0x01a790bb -
[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x019e8966 ___forwarding___ +
966
4 CoreFoundation 0x019e8522
_CF_forwarding_prep_0 + 50
5 VFConnector 0x00004af3 -
[SalesforceOAuthPlugin populateOAuthProperties:] + 99
6 VFConnector 0x00003a8d -
[SalesforceOAuthPlugin authenticate:withDict:] + 365
7 VFConnector 0x0001772b -[PhoneGapDelegate
execute:] + 434
8 VFConnector 0x00002d67 -
[SFContainerAppDelegate execute:] + 71
9 VFConnector 0x00017150 -[PhoneGapDelegate
executeQueuedCommands] + 265
10 VFConnector 0x000171fd -[PhoneGapDelegate
flushCommandQueue] + 81
11 VFConnector 0x0001756c -[PhoneGapDelegate
webView:shouldStartLoadWithRequest:navigationType:] + 822
12 VFConnector 0x00003060 -
[SFContainerAppDelegate
webView:shouldStartLoadWithRequest:navigationType:] + 96
13 UIKit 0x004bea92 -[UIWebView
webView:decidePolicyForNavigationAction:request:frame:decisionListener:]
+ 291
14 CoreFoundation 0x019e7c7d __invoking___ + 29
15 CoreFoundation 0x019e7b51 -[NSInvocation
invoke] + 145
16 CoreFoundation 0x01a15858 -[NSInvocation
invokeWithTarget:] + 72
17 WebKit 0x025d8c76 -
[_WebSafeForwarder forwardInvocation:] + 182
18 CoreFoundation 0x019e8a04 ___forwarding___ +
1124
19 CoreFoundation 0x019e8522
_CF_forwarding_prep_0 + 50
20 CoreFoundation 0x019e7c7d __invoking___ + 29
21 CoreFoundation 0x019e7b51 -[NSInvocation
invoke] + 145
22 WebCore 0x030cc150
_ZL20HandleDelegateSourcePv + 64
23 CoreFoundation 0x01a588ff
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
24 CoreFoundation 0x019b688b
__CFRunLoopDoSources0 + 571
25 CoreFoundation 0x019b5d86 __CFRunLoopRun +
470
26 CoreFoundation 0x019b5840
CFRunLoopRunSpecific + 208
27 CoreFoundation 0x019b5761 CFRunLoopRunInMode
+ 97
28 GraphicsServices 0x021141c4 GSEventRunModal +
217
29 GraphicsServices 0x02114289 GSEventRun + 115
30 UIKit 0x00335c93 UIApplicationMain
+ 1160
31 VFConnector 0x00002777 main + 135
32 VFConnector 0x000026e5 start + 53
33 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Please Help because I am stuck on this for 2 days!
The error is a JSON library dependency issue. Ensure all the JSON libraries required are installed.

Code-golf: Output multiplication table to the Console

Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I recently pointed a student doing work experience to an article about dumping a multiplication table to the console. It used a nested for loop and multiplied the step value of each.
This looked like a .NET 2.0 approach. I was wondering, with the use of Linq and extension methods,for example, how many lines of code it would take to achieve the same result.
Is the stackoverflow community up to the challenge?
The challenge:
In a console application, write code to generate a table like this example:
01 02 03 04 05 06 07 08 09
02 04 06 08 10 12 14 16 18
03 06 09 12 15 18 21 24 27
04 08 12 16 20 24 28 32 36
05 10 15 20 25 30 35 40 45
06 12 18 24 30 36 42 48 54
07 14 21 28 35 42 49 56 63
08 16 24 32 40 48 56 64 72
09 18 27 36 45 54 63 72 81
As this turned into a language-agnostic code-golf battle, I'll go with the communities decision about which is the best solution for the accepted answer.
There's been alot of talk about the spec and the format that the table should be in, I purposefully added the 00 format but the double new-line was originally only there because I didn't know how to format the text when creating the post!
J - 8 chars - 24 chars for proper format
*/~1+i.9
Gives:
1 2 3 4 5 6 7 8 9
2 4 6 8 10 12 14 16 18
3 6 9 12 15 18 21 24 27
4 8 12 16 20 24 28 32 36
5 10 15 20 25 30 35 40 45
6 12 18 24 30 36 42 48 54
7 14 21 28 35 42 49 56 63
8 16 24 32 40 48 56 64 72
9 18 27 36 45 54 63 72 81
This solution found by #earl:
'r(0)q( )3.'8!:2*/~1+i.9
Gives:
01 02 03 04 05 06 07 08 09
02 04 06 08 10 12 14 16 18
03 06 09 12 15 18 21 24 27
04 08 12 16 20 24 28 32 36
05 10 15 20 25 30 35 40 45
06 12 18 24 30 36 42 48 54
07 14 21 28 35 42 49 56 63
08 16 24 32 40 48 56 64 72
09 18 27 36 45 54 63 72 81
MATLAB - 10 characters
a=1:9;a'*a
... or 33 characters for stricter output format
a=1:9;disp(num2str(a'*a,'%.2d '))
Brainf**k - 185 chars
>---------[++++++++++>---------[+<[-<+>>+++++++++[->+>>---------[>-<++++++++++<]<[>]>>+<<<<]>[-<+>]<---------<]<[->+<]>>>>++++[-<++++>]<[->++>+++>+++<<<]>>>[.[-]<]<]++++++++++.[-<->]<+]
cat - 252 characters
01 02 03 04 05 06 07 08 09
02 04 06 08 10 12 14 16 18
03 06 09 12 15 18 21 24 27
04 08 12 16 20 24 28 32 36
05 10 15 20 25 30 35 40 45
06 12 18 24 30 36 42 48 54
07 14 21 28 35 42 49 56 63
08 16 24 32 40 48 56 64 72
09 18 27 36 45 54 63 72 81
Assuming that a trailing newline is wanted; otherwise, 251 chars.
* runs *
Python - 61 chars
r=range(1,10)
for y in r:print"%02d "*9%tuple(y*x for x in r)
C#
This is only 2 lines. It uses lambdas not extension methods
var nums = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
nums.ForEach(n => { nums.ForEach(n2 => Console.Write((n * n2).ToString("00 "))); Console.WriteLine(); });
and of course it could be done in one long unreadable line
new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 }.ForEach(n => { new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 }.ForEach(n2 => Console.Write((n * n2).ToString("00 "))); Console.WriteLine(); });
all of this is assuming you consider a labmda one line?
K - 12 characters
Let's take the rosetta-stoning seriously, and compare Kdb+'s K4 with the canonical J solution (*/~1+i.9):
a*/:\:a:1+!9
1 2 3 4 5 6 7 8 9
2 4 6 8 10 12 14 16 18
3 6 9 12 15 18 21 24 27
4 8 12 16 20 24 28 32 36
5 10 15 20 25 30 35 40 45
6 12 18 24 30 36 42 48 54
7 14 21 28 35 42 49 56 63
8 16 24 32 40 48 56 64 72
9 18 27 36 45 54 63 72 81
J's "table" operator (/) equals the K "each-left each-right" (/:\:) idiom. We don't have J's extremely handy "reflexive" operator (~) in K, so we have to pass a as both left and right argument.
Fortran95 - 40 chars (beating perl by 4 chars!)
This solution does print the leading zeros as per the spec.
print"(9(i3.2))",((i*j,i=1,9),j=1,9);end
Oracle SQL, 103 characters:
select n, n*2, n*3, n*4, n*5, n*6, n*7, n*8, n*9 from (select rownum n from dual CONNECT BY LEVEL < 10)
C# - 117, 113, 99, 96, 95 89 characters
updated based on NickLarsen's idea
for(int x=0,y;++x<10;)
for(y=x;y<x*10;y+=x)
Console.Write(y.ToString(y<x*9?"00 ":"00 \n"));
99, 85, 82 81 characters
... If you don't care about the leading zeros and would allow tabs for alignment.
for(int x=0,y;++x<10;)
{
var w="";
for(y=1;++y<10;)
w+=x*y+" ";
Console.WriteLine(w);
}
COBOL - 218 chars -> 216 chars
PROGRAM-ID.P.DATA DIVISION.WORKING-STORAGE SECTION.
1 I PIC 9.
1 N PIC 99.
PROCEDURE DIVISION.PERFORM 9 TIMES
ADD 1 TO I
SET N TO I
PERFORM 9 TIMES
DISPLAY N' 'NO ADVANCING
ADD I TO N
END-PERFORM
DISPLAY''
END-PERFORM.
Edit
216 chars (probably a different compiler)
PROGRAM-ID.P.DATA DIVISION.WORKING-STORAGE SECTION.
1 I PIC 9.
1 N PIC 99.
PROCEDURE DIVISION.
PERFORM B 9 TIMES
STOP RUN.
B.
ADD 1 TO I
set N to I
PERFORM C 9 TIMES
DISPLAY''.
C.
DISPLAY N" "NO ADVANCING
Add I TO N.
Not really a one-liner, but the shortest linq i can think of:
var r = Enumerable.Range(1, 9);
foreach (var z in r.Select(n => r.Select(m => n * m)).Select(a => a.Select(b => b.ToString("00 "))))
{
foreach (var q in z)
Console.Write(q);
Console.WriteLine();
}
In response to combining this and SRuly's answer
Enumberable.Range(1,9).ToList.ForEach(n => Enumberable.Range(1,9).ToList.ForEach(n2 => Console.Write((n * n2).ToString("00 "))); Console.WriteLine(); });
Ruby - 42 Chars (including one linebreak, interactive command line only)
This method is two lines of input and only works in irb (because irb gives us _), but shortens the previous method by a scant 2 charcters.
1..9
_.map{|y|puts"%02d "*9%_.map{|x|x*y}}
Ruby - 44 Chars (tied with perl)
(a=1..9).map{|y|puts"%02d "*9%a.map{|x|x*y}}
Ruby - 46 Chars
9.times{|y|puts"%02d "*9%(1..9).map{|x|x*y+x}}
Ruby - 47 Chars
And back to a double loop
(1..9).map{|y|puts"%02d "*9%(1..9).map{|x|x*y}}
Ruby - 54 chars!
Using a single loop saves a couple of chars!
(9..89).map{|n|print"%02d "%(n/9*(x=n%9+1))+"\n"*(x/9)}
Ruby - 56 chars
9.times{|x|puts (1..9).map{|y|"%.2d"%(y+x*y)}.join(" ")}
Haskell — 85 84 79 chars
r=[1..9]
s x=['0'|x<=9]++show x
main=mapM putStrLn[unwords[s$x*y|x<-r]|y<-r]
If double spacing is required (89 81 chars),
r=[1..9]
s x=['0'|x<=9]++show x
main=mapM putStrLn['\n':unwords[s$x*y|x<-r]|y<-r]
F# - 61 chars:
for y=1 to 9 do(for x=1 to 9 do printf"%02d "(x*y));printfn""
If you prefer a more applicative/LINQ-y solution, then in 72 chars:
[1..9]|>Seq.iter(fun y->[1..9]|>Seq.iter((*)y>>printf"%02d ");printfn"")
c# - 125, 123 chars (2 lines):
var r=Enumerable.Range(1,9).ToList();
r.ForEach(n=>{var s="";r.ForEach(m=>s+=(n*m).ToString("00 "));Console.WriteLine(s);});
C - 97 79 characters
#define f(i){int i=0;while(i++<9)
main()f(x)f(y)printf("%.2d ",x*y);puts("");}}
Perl, 44 chars
(No hope of coming anywhere near J, but languages with matrix ops are in a class of their own here...)
for$n(1..9){printf"%3d"x9 .$/,map$n*$_,1..9}
R (very similar to Matlab on this level): 12 characters.
> 1:9%*%t(1:9)
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
[1,] 1 2 3 4 5 6 7 8 9
[2,] 2 4 6 8 10 12 14 16 18
[3,] 3 6 9 12 15 18 21 24 27
[4,] 4 8 12 16 20 24 28 32 36
[5,] 5 10 15 20 25 30 35 40 45
[6,] 6 12 18 24 30 36 42 48 54
[7,] 7 14 21 28 35 42 49 56 63
[8,] 8 16 24 32 40 48 56 64 72
[9,] 9 18 27 36 45 54 63 72 81
PHP, 71 chars
for($x=0;++$x<10;print"\n"){for($y=0;++$y<10;){printf("%02d ",$x*$y);}}
Output:
$ php -r 'for($x=0;++$x<10;print"\n"){for($y=0;++$y<10;){printf("%02d ",$x*$y);}}'
01 02 03 04 05 06 07 08 09
02 04 06 08 10 12 14 16 18
03 06 09 12 15 18 21 24 27
04 08 12 16 20 24 28 32 36
05 10 15 20 25 30 35 40 45
06 12 18 24 30 36 42 48 54
07 14 21 28 35 42 49 56 63
08 16 24 32 40 48 56 64 72
09 18 27 36 45 54 63 72 81
C#, 135 chars, nice and clean:
var rg = Enumerable.Range(1, 9);
foreach (var rc in from r in rg
from c in rg
select (r * c).ToString("D2") + (c == 9 ? "\n\n" : " "))
Console.Write(rc);
PostgreSQL: 81 74 chars
select array(select generate_series(1,9)*x)from generate_series(1,9)as x;
Ruby - 56 chars :D
9.times{|a|9.times{|b|print"%02d "%((a+1)*(b+1))};puts;}
C - 66 Chars
This resolves the complaint about the second parameter of main :)
main(x){for(x=8;x++<89;)printf("%.2d%c",x/9*(x%9+1),x%9<8?32:10);}
C - 77 chars
Based on dreamlax's 97 char answer. His current answer somewhat resembles this one now :)
Compiles ok with gcc, and main(x,y) is fair game for golf i reckon
#define f(i){for(i=0;i++<9;)
main(x,y)f(x)f(y)printf("%.2d ",x*y);puts("");}}
XQuery 1.0 (96 bytes)
string-join(for$x in 1 to 9 return(for$y in 1 to 9 return concat(0[$x*$y<10],$x*$y,' '),'
'),'')
Run (with XQSharp) with:
xquery table.xq !method=text
Scala - 77 59 58 chars
print(1 to 9 map(p=>1 to 9 map(q=>"%02d "format(p*q))mkString)mkString("\n"))
Sorry, I had to do this, the Scala solution by Malax was way too readable...
[Edit] For comprehension seems to be the better choice:
for(p<-1 to 9;q<-{println;1 to 9})print("%02d "format p*q)
[Edit] A much longer solution, but without multiplication, and much more obfuscated:
val s=(1 to 9).toSeq
(s:\s){(p,q)=>println(q.map("%02d "format _)mkString)
q zip(s)map(t=>t._1+t._2)}
PHP, 62 chars
for(;$x++<9;print"\n",$y=0)while($y++<9)printf("%02d ",$x*$y);
Java - 155 137 chars
Update 1: replaced string building by direct printing. Saved 18 chars.
class M{public static void main(String[]a){for(int x,y=0,z=10;++y<z;System.out.println())for(x=0;++x<z;System.out.printf("%02d ",x*y));}}
More readable format:
class M{
public static void main(String[]a){
for(int x,y=0,z=10;++y<z;System.out.println())
for(x=0;++x<z;System.out.printf("%02d ",x*y));
}
}
Another attempt using C#/Linq with GroupJoin:
Console.Write(
String.Join(
Environment.NewLine,
Enumerable.Range(1, 9)
.GroupJoin(Enumerable.Range(1, 9), y => 0, x => 0, (y, xx) => String.Join(" ", xx.Select(x => x * y)))
.ToArray()));
Ruby — 47 chars
puts (a=1..9).map{|i|a.map{|j|"%2d"%(j*i)}*" "}
Output
1 2 3 4 5 6 7 8 9
2 4 6 8 10 12 14 16 18
3 6 9 12 15 18 21 24 27
4 8 12 16 20 24 28 32 36
5 10 15 20 25 30 35 40 45
6 12 18 24 30 36 42 48 54
7 14 21 28 35 42 49 56 63
8 16 24 32 40 48 56 64 72
9 18 27 36 45 54 63 72 81
(If we ignore spacing, it becomes 39: puts (a=1..9).map{|i|a.map{|j|j*i}*" "} And anyway, I feel like there's a bit of room for improvement with the wordy map stuff.)