问:
Notes (client) 9.0.1 FP8 CLPDN0031E: Event loop exception
This question is related to SO question Xpages can't load, Error 500; java.util cannot be resolved
I am creating a new question because the answers on the last question to not fit.

First off, I have reinstalled Notes 9.0.1 followed by the FP8 more than three times. Each time I had one of two errors. The first issue was identical to the linked question. The second issue is what i am going to report now; manifesting in the inability to open script libraries. The help / log provides the following stack trace:

```<code>CLPDN0031E: Event loop exception
java.lang.NoClassDefFoundError: com.ibm.xsp.extlib.component.dynamicview.DominoDynamicColumnBuilder$DominoViewCustomizer
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$400(Unknown Source)
    at java.net.URLClassLoader$ClassFinder.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Unknown Source)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClassHelper(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassHelper(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.ibm.designer.runtime.server.util.DynamicClassLoaderVFS.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.ibm.designer.runtime.Application.loadClass(Unknown Source)
    at com.ibm.xsp.library.ApplicationFacesClassLoader.loadClass(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil.doClassLookups(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil.access$7(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil$BeanListMaintainerImpl.update(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil$BeanListMaintainerImpl.getManagedBeanInfo(Unknown Source)
    at com.ibm.designer.domino.ide.resources.project.DominoDesignerProject.getManagedBeanList(Unknown Source)
    at com.ibm.designer.domino.design.js.ScriptLibScriptData.addObjectsToMap(Unknown Source)
    at com.ibm.designer.domino.scripting.data.AbstractScriptData.getPublishedObjects(Unknown Source)
    at com.ibm.designer.domino.javascript.serverExtension.ServerScriptingEditor.init(Unknown Source)
    at com.ibm.designer.domino.design.js.ScriptLibEditor.createPartControl(Unknown Source)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(Unknown Source)
    at org.eclipse.ui.internal.EditorReference.createPart(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Unknown Source)
    at org.eclipse.ui.internal.PartPane.setVisible(Unknown Source)
    at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(Unknown Source)
    at com.ibm.rcp.ui.internal.presentations.FolderStackPresentation.selectPart(Unknown Source)
    at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(Unknown Source)
    at org.eclipse.ui.internal.PartStack.setSelection(Unknown Source)
    at org.eclipse.ui.internal.PartStack.presentationSelectionChanged(Unknown Source)
    at org.eclipse.ui.internal.PartStack.access$1(Unknown Source)
    at org.eclipse.ui.internal.PartStack$1.selectPart(Unknown Source)
    at com.ibm.rcp.ui.internal.presentations.FolderStackPresentation$4.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)
    at com.ibm.rcp.swt.swidgets.STabFolder.setSelection(Unknown Source)
    at com.ibm.rcp.swt.swidgets.STabFolder.onMouse(Unknown Source)
    at com.ibm.rcp.swt.swidgets.STabFolder$1.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
    at org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
    at org.eclipse.ui.internal.Workbench.access$4(Unknown Source)
    at org.eclipse.ui.internal.Workbench$5.run(Unknown Source)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Unknown Source)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
    at com.ibm.rcp.personality.framework.internal.RCPApplication.run(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(Unknown Source)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknown Source)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Unknown Source)
    at org.eclipse.equinox.launcher.Main.basicRun(Unknown Source)
    at org.eclipse.equinox.launcher.Main.run(Unknown Source)
    at com.ibm.rcp.core.internal.launcher.Main.startLaunch(Unknown Source)
    at com.ibm.rcp.core.internal.launcher.Main.main(Unknown Source)
    at com.ibm.rcp.core.internal.launcher.Main.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.ibm.xsp.extlib.component.dynamicview.DominoDynamicColumnBuilder$DominoViewCustomizer
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClassHelper(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 78 more

Unhandled event loop exception
java.lang.NoClassDefFoundError: com.ibm.xsp.extlib.component.dynamicview.DominoDynamicColumnBuilder$DominoViewCustomizer
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$400(Unknown Source)
    at java.net.URLClassLoader$ClassFinder.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Unknown Source)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClassHelper(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassHelper(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.ibm.designer.runtime.server.util.DynamicClassLoaderVFS.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.ibm.designer.runtime.Application.loadClass(Unknown Source)
    at com.ibm.xsp.library.ApplicationFacesClassLoader.loadClass(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil.doClassLookups(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil.access$7(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil$BeanListMaintainerImpl.update(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil$BeanListMaintainerImpl.getManagedBeanInfo(Unknown Source)
    at com.ibm.designer.domino.ide.resources.project.DominoDesignerProject.getManagedBeanList(Unknown Source)
    at com.ibm.designer.domino.design.js.ScriptLibScriptData.addObjectsToMap(Unknown Source)
    at com.ibm.designer.domino.scripting.data.AbstractScriptData.getPublishedObjects(Unknown Source)
    at com.ibm.designer.domino.javascript.serverExtension.ServerScriptingEditor.init(Unknown Source)
    at com.ibm.designer.domino.design.js.ScriptLibEditor.createPartControl(Unknown Source)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(Unknown Source)
    at org.eclipse.ui.internal.EditorReference.createPart(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Unknown Source)
    at org.eclipse.ui.internal.PartPane.setVisible(Unknown Source)
    at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(Unknown Source)
    at com.ibm.rcp.ui.internal.presentations.FolderStackPresentation.selectPart(Unknown Source)
    at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(Unknown Source)
    at org.eclipse.ui.internal.PartStack.setSelection(Unknown Source)
    at org.eclipse.ui.internal.PartStack.presentationSelectionChanged(Unknown Source)
    at org.eclipse.ui.internal.PartStack.access$1(Unknown Source)
    at org.eclipse.ui.internal.PartStack$1.selectPart(Unknown Source)
    at com.ibm.rcp.ui.internal.presentations.FolderStackPresentation$4.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)
    at com.ibm.rcp.swt.swidgets.STabFolder.setSelection(Unknown Source)
    at com.ibm.rcp.swt.swidgets.STabFolder.onMouse(Unknown Source)
    at com.ibm.rcp.swt.swidgets.STabFolder$1.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
    at org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
    at org.eclipse.ui.internal.Workbench.access$4(Unknown Source)
    at org.eclipse.ui.internal.Workbench$5.run(Unknown Source)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Unknown Source)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
    at com.ibm.rcp.personality.framework.internal.RCPApplication.run(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(Unknown Source)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknown Source)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Unknown Source)
    at org.eclipse.equinox.launcher.Main.basicRun(Unknown Source)
    at org.eclipse.equinox.launcher.Main.run(Unknown Source)
    at com.ibm.rcp.core.internal.launcher.Main.startLaunch(Unknown Source)
    at com.ibm.rcp.core.internal.launcher.Main.main(Unknown Source)
    at com.ibm.rcp.core.internal.launcher.Main.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.ibm.xsp.extlib.component.dynamicview.DominoDynamicColumnBuilder$DominoViewCustomizer
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClassHelper(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 78 more
</code>```

First off, and related to the answer provided by Paul Withers: having run the installation packet about 4 or 5 times, I have yet to receive any error or hint that it did not install correctly or ran into errors.

Secondly, the JVMs are correctly configured as per the answer provided by Marie Kehoe.

How can I go about correcting this issue?

答:
We had the same error when updating to FP8: When opening existing SSJS files the editor keeps blank, and exceptions are thrown in background which you can find in log trace.

This is already known by IBM -> http://www-01.ibm.com/support/docview.wss?uid=swg22000221

"This problem affects only applications that contain a managed bean."

IBM give also a "workaround": you should  perform a full clean/rebuild of the application and then use the SSJS editor. But note: The problem may reoccur when the application is closed and then reopened.

Because this workaround doesn't work for us - and maybe also not for you - the solution was either to remove the managed beans from our project, or to downgrade back to FP7.

We chose the latter solution.

EDIT: Thanks to comment author Per Henrik Lausten. He found out that since May 2017 IBM has a fix for this issue (Notes 9.0.1 Feature Pack 8 Interim Fix 1). See his link for more details.

We haven't try this yet, but this could be the actual solution!

Body:
This question is related to SO question Xpages can't load, Error 500; java.util cannot be resolved
I am creating a new question because the answers on the last question to not fit.

First off, I have reinstalled Notes 9.0.1 followed by the FP8 more than three times. Each time I had one of two errors. The first issue was identical to the linked question. The second issue is what i am going to report now; manifesting in the inability to open script libraries. The help / log provides the following stack trace:

CLPDN0031E: Event loop exception
java.lang.NoClassDefFoundError: com.ibm.xsp.extlib.component.dynamicview.DominoDynamicColumnBuilder$DominoViewCustomizer
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$400(Unknown Source)
    at java.net.URLClassLoader$ClassFinder.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Unknown Source)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClassHelper(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassHelper(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.ibm.designer.runtime.server.util.DynamicClassLoaderVFS.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.ibm.designer.runtime.Application.loadClass(Unknown Source)
    at com.ibm.xsp.library.ApplicationFacesClassLoader.loadClass(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil.doClassLookups(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil.access$7(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil$BeanListMaintainerImpl.update(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil$BeanListMaintainerImpl.getManagedBeanInfo(Unknown Source)
    at com.ibm.designer.domino.ide.resources.project.DominoDesignerProject.getManagedBeanList(Unknown Source)
    at com.ibm.designer.domino.design.js.ScriptLibScriptData.addObjectsToMap(Unknown Source)
    at com.ibm.designer.domino.scripting.data.AbstractScriptData.getPublishedObjects(Unknown Source)
    at com.ibm.designer.domino.javascript.serverExtension.ServerScriptingEditor.init(Unknown Source)
    at com.ibm.designer.domino.design.js.ScriptLibEditor.createPartControl(Unknown Source)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(Unknown Source)
    at org.eclipse.ui.internal.EditorReference.createPart(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Unknown Source)
    at org.eclipse.ui.internal.PartPane.setVisible(Unknown Source)
    at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(Unknown Source)
    at com.ibm.rcp.ui.internal.presentations.FolderStackPresentation.selectPart(Unknown Source)
    at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(Unknown Source)
    at org.eclipse.ui.internal.PartStack.setSelection(Unknown Source)
    at org.eclipse.ui.internal.PartStack.presentationSelectionChanged(Unknown Source)
    at org.eclipse.ui.internal.PartStack.access$1(Unknown Source)
    at org.eclipse.ui.internal.PartStack$1.selectPart(Unknown Source)
    at com.ibm.rcp.ui.internal.presentations.FolderStackPresentation$4.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)
    at com.ibm.rcp.swt.swidgets.STabFolder.setSelection(Unknown Source)
    at com.ibm.rcp.swt.swidgets.STabFolder.onMouse(Unknown Source)
    at com.ibm.rcp.swt.swidgets.STabFolder$1.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
    at org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
    at org.eclipse.ui.internal.Workbench.access$4(Unknown Source)
    at org.eclipse.ui.internal.Workbench$5.run(Unknown Source)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Unknown Source)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
    at com.ibm.rcp.personality.framework.internal.RCPApplication.run(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(Unknown Source)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknown Source)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Unknown Source)
    at org.eclipse.equinox.launcher.Main.basicRun(Unknown Source)
    at org.eclipse.equinox.launcher.Main.run(Unknown Source)
    at com.ibm.rcp.core.internal.launcher.Main.startLaunch(Unknown Source)
    at com.ibm.rcp.core.internal.launcher.Main.main(Unknown Source)
    at com.ibm.rcp.core.internal.launcher.Main.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.ibm.xsp.extlib.component.dynamicview.DominoDynamicColumnBuilder$DominoViewCustomizer
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClassHelper(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 78 more

Unhandled event loop exception
java.lang.NoClassDefFoundError: com.ibm.xsp.extlib.component.dynamicview.DominoDynamicColumnBuilder$DominoViewCustomizer
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$400(Unknown Source)
    at java.net.URLClassLoader$ClassFinder.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Unknown Source)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClassHelper(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassHelper(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.ibm.designer.runtime.server.util.DynamicClassLoaderVFS.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.ibm.designer.runtime.Application.loadClass(Unknown Source)
    at com.ibm.xsp.library.ApplicationFacesClassLoader.loadClass(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil.doClassLookups(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil.access$7(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil$BeanListMaintainerImpl.update(Unknown Source)
    at com.ibm.xsp.library.ManagedBeanListUtil$BeanListMaintainerImpl.getManagedBeanInfo(Unknown Source)
    at com.ibm.designer.domino.ide.resources.project.DominoDesignerProject.getManagedBeanList(Unknown Source)
    at com.ibm.designer.domino.design.js.ScriptLibScriptData.addObjectsToMap(Unknown Source)
    at com.ibm.designer.domino.scripting.data.AbstractScriptData.getPublishedObjects(Unknown Source)
    at com.ibm.designer.domino.javascript.serverExtension.ServerScriptingEditor.init(Unknown Source)
    at com.ibm.designer.domino.design.js.ScriptLibEditor.createPartControl(Unknown Source)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(Unknown Source)
    at org.eclipse.ui.internal.EditorReference.createPart(Unknown Source)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Unknown Source)
    at org.eclipse.ui.internal.PartPane.setVisible(Unknown Source)
    at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(Unknown Source)
    at com.ibm.rcp.ui.internal.presentations.FolderStackPresentation.selectPart(Unknown Source)
    at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(Unknown Source)
    at org.eclipse.ui.internal.PartStack.setSelection(Unknown Source)
    at org.eclipse.ui.internal.PartStack.presentationSelectionChanged(Unknown Source)
    at org.eclipse.ui.internal.PartStack.access$1(Unknown Source)
    at org.eclipse.ui.internal.PartStack$1.selectPart(Unknown Source)
    at com.ibm.rcp.ui.internal.presentations.FolderStackPresentation$4.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)
    at com.ibm.rcp.swt.swidgets.STabFolder.setSelection(Unknown Source)
    at com.ibm.rcp.swt.swidgets.STabFolder.onMouse(Unknown Source)
    at com.ibm.rcp.swt.swidgets.STabFolder$1.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
    at org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
    at org.eclipse.ui.internal.Workbench.access$4(Unknown Source)
    at org.eclipse.ui.internal.Workbench$5.run(Unknown Source)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Unknown Source)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
    at com.ibm.rcp.personality.framework.internal.RCPApplication.run(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(Unknown Source)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknown Source)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Unknown Source)
    at org.eclipse.equinox.launcher.Main.basicRun(Unknown Source)
    at org.eclipse.equinox.launcher.Main.run(Unknown Source)
    at com.ibm.rcp.core.internal.launcher.Main.startLaunch(Unknown Source)
    at com.ibm.rcp.core.internal.launcher.Main.main(Unknown Source)
    at com.ibm.rcp.core.internal.launcher.Main.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.ibm.xsp.extlib.component.dynamicview.DominoDynamicColumnBuilder$DominoViewCustomizer
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClassHelper(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 78 more

First off, and related to the answer provided by Paul Withers: having run the installation packet about 4 or 5 times, I have yet to receive any error or hint that it did not install correctly or ran into errors.

Secondly, the JVMs are correctly configured as per the answer provided by Marie Kehoe.

How can I go about correcting this issue?


来源: stackexchange

问:
Unloading a Loader with actionscript 3
Hello and thank you very much for looking at this. I've spent too many hours struggling.

The code below loads a slideshow of four images, along with thumbnails for those images. It works fine.

I've added a button called "invis_button", that when pressed is supposed to remove the 3 loaders that make up the slideshow, using the removeChild command for each loader.

But this is the problem, there are 3 loaders involved in the slide-show. The removeChild command successfully removes one of the loaders (named "loader3"), but not the other two ("container3", and "thumbLoader3").  It returns an error stating "access of undefined property thumbLoader3" or "Container3".

Can someone tell me why this is ? Or better still, how to make that button (invis_button) unload the entire slide-show.

```<code>var images3:Array = ["ad_bona1.jpg", "ad_bona2.jpg", "ad_darkhawk1.jpg", "ad_darkhawk2.jpg"];

var thumbX3:Number = -375;
var thumbY3:Number = 220;

var loader3:Loader = new Loader();
loader3.load(new URLRequest("assets/ad_bona1.jpg"));
addChild(loader3);
loader3.alpha = 0;

loadThumbs3();

function loadThumbs3():void
{
var thumbLoader3:Loader;
var container3:Sprite = new Sprite();
addChild(container3);
container3.buttonMode = true;
for(var i3:uint = 0; i3 < images3.length; i3++)
{
thumbLoader3 = new Loader();
thumbLoader3.load(new URLRequest("assets/thumbs/" + images3[i3]));
thumbLoader3.x = thumbX3;
thumbLoader3.y = thumbY3;
thumbX3 += 85;
container3.addChild(thumbLoader3);
thumbLoader3.addEventListener(MouseEvent.CLICK, thumbClicked3);
}
}
function thumbClicked3(event:MouseEvent):void
{
var path3:String = event.currentTarget.contentLoaderInfo.url;
path3 = path3.substr(path3.lastIndexOf("/") + 1);
loader3.load(new URLRequest("assets/" + path3));
}

///PROBLEM BELOW, button removes only "loader3" and not the other two for some reason

invis_button.addEventListener(MouseEvent.CLICK, unload_loaders);

function unload_loaders(event:MouseEvent):void{
    removeChild(loader3);
    removeChild(thumbLoader3);
    removeChild(container3);
 }
</code>```

答:
Not sure if this is the entire reason behind what you're observing... but for starters, "thumbloader3" and "container3" are scoped locally to the loadThumbs3() method, which means once you finish executing the function, Flash's handles to those objects are lost (not to mention being in an entirely different scope)... try creating class-level properties for those two.  Once that's done you should be able to successfully remove them from the stage later on.

I hope that you're also properly destroying your objects, and for the sake of brevity you just chose to omit that code above.

I've edited the code you had above & put the properties into the proper scope. (the multiple copies of thumbLoader3 are now collected inside of a vector (specialized array) so that they can be properly addressed when it comes time to destroy them)

I also wrote you a proper destroy method. ;)

I haven't tried it on my own machine, but give it a spin & see how it goes.

```<code>var images3:Array = ["ad_bona1.jpg", "ad_bona2.jpg", "ad_darkhawk1.jpg", "ad_darkhawk2.jpg"];

var thumbX3:Number = -375;
var thumbY3:Number = 220;

// begin new instance properties..
// created a new property, allowing you to group (and hold on to) the multiple thumbLoaders
var thumbLoader3Vector:Vector.<Loader> = new Vector.<Loader>();
var container3:Sprite;
// end new instance properties

var loader3:Loader = new Loader();

loader3.load(new URLRequest("assets/ad_bona1.jpg"));
addChild(loader3);
loader3.alpha = 0;

loadThumbs3();

function loadThumbs3():void
{

    // this is where container3 used to be declared

    container3 = new Sprite();
    addChild(container3);
    container3.buttonMode = true;
    for(var i3:uint = 0; i3 < images3.length; i3++)
    {
        var tPtr:int = thumbLoader3Vector.length;
        thumbLoader3Vector.push(new Loader());
        // this is where thumbLoader3 used to be declared & instantiated

        thumbLoader3Vector[tPtr].load(new URLRequest("assets/thumbs/" + images3[i3]));
        thumbLoader3Vector[tPtr].x = thumbX3;
        thumbLoader3Vector[tPtr].y = thumbY3;
        thumbX3 += 85;
        container3.addChild(thumbLoader3Vector[tPtr]);
        thumbLoader3Vector[tPtr].addEventListener(MouseEvent.CLICK, thumbClicked3);

    }
}
function thumbClicked3(event:MouseEvent):void
{
    var path3:String = event.currentTarget.contentLoaderInfo.url;
    path3 = path3.substr(path3.lastIndexOf("/") + 1);
    loader3.load(new URLRequest("assets/" + path3));
}

///PROBLEM BELOW, button removes only "loader3" and not the other two for some reason

invis_button.addEventListener(MouseEvent.CLICK, unload_loaders);

function unload_loaders(event:MouseEvent):void{

    // since the thumbLoader3 Loaders are children of container3 in the display list, we need to remove them first
    for(var $i:uint = 0;$i<thumbLoader3Vector.length;$i++)
    {
        removeChild(thumbLoader3Vector[$i]);
        // also make sure you remove the listener, so that the object will be picked up by garbage collection
        thumbLoader3Vector[$i].removeEventListener(MouseEvent.CLICK, thumbClicked3);
    }
    // and then just set the entire vector to null
    thumbLoader3Vector = null;

    // remove the loader3 object & set it to null
    removeChild(loader3);
    loader3 = null;

    // remove the container3 object & set it to null
    removeChild(container3);
    container3 = null;
 }
</code>```

ContentLicense: CC BY-SA 2.5

Title: Unloading a Loader with actionscript 3

Body:
Hello and thank you very much for looking at this. I've spent too many hours struggling.

The code below loads a slideshow of four images, along with thumbnails for those images. It works fine.

I've added a button called "invis_button", that when pressed is supposed to remove the 3 loaders that make up the slideshow, using the removeChild command for each loader.

But this is the problem, there are 3 loaders involved in the slide-show. The removeChild command successfully removes one of the loaders (named "loader3"), but not the other two ("container3", and "thumbLoader3").  It returns an error stating "access of undefined property thumbLoader3" or "Container3".

Can someone tell me why this is ? Or better still, how to make that button (invis_button) unload the entire slide-show.

var images3:Array = ["ad_bona1.jpg", "ad_bona2.jpg", "ad_darkhawk1.jpg", "ad_darkhawk2.jpg"];

var thumbX3:Number = -375;
var thumbY3:Number = 220;

var loader3:Loader = new Loader();
loader3.load(new URLRequest("assets/ad_bona1.jpg"));
addChild(loader3);
loader3.alpha = 0;

loadThumbs3();

function loadThumbs3():void
{
var thumbLoader3:Loader;
var container3:Sprite = new Sprite();
addChild(container3);
container3.buttonMode = true;
for(var i3:uint = 0; i3 < images3.length; i3++)
{
thumbLoader3 = new Loader();
thumbLoader3.load(new URLRequest("assets/thumbs/" + images3[i3]));
thumbLoader3.x = thumbX3;
thumbLoader3.y = thumbY3;
thumbX3 += 85;
container3.addChild(thumbLoader3);
thumbLoader3.addEventListener(MouseEvent.CLICK, thumbClicked3);
}
}
function thumbClicked3(event:MouseEvent):void
{
var path3:String = event.currentTarget.contentLoaderInfo.url;
path3 = path3.substr(path3.lastIndexOf("/") + 1);
loader3.load(new URLRequest("assets/" + path3));
}

///PROBLEM BELOW, button removes only "loader3" and not the other two for some reason

invis_button.addEventListener(MouseEvent.CLICK, unload_loaders);

function unload_loaders(event:MouseEvent):void{
    removeChild(loader3);
    removeChild(thumbLoader3);
    removeChild(container3);
 }

Body:
Not sure if this is the entire reason behind what you're observing... but for starters, "thumbloader3" and "container3" are scoped locally to the loadThumbs3() method, which means once you finish executing the function, Flash's handles to those objects are lost (not to mention being in an entirely different scope)... try creating class-level properties for those two.  Once that's done you should be able to successfully remove them from the stage later on.

I hope that you're also properly destroying your objects, and for the sake of brevity you just chose to omit that code above.

I've edited the code you had above & put the properties into the proper scope. (the multiple copies of thumbLoader3 are now collected inside of a vector (specialized array) so that they can be properly addressed when it comes time to destroy them)

I also wrote you a proper destroy method. ;)

I haven't tried it on my own machine, but give it a spin & see how it goes.

var images3:Array = ["ad_bona1.jpg", "ad_bona2.jpg", "ad_darkhawk1.jpg", "ad_darkhawk2.jpg"];

var thumbX3:Number = -375;
var thumbY3:Number = 220;

// begin new instance properties..
// created a new property, allowing you to group (and hold on to) the multiple thumbLoaders
var thumbLoader3Vector:Vector.<Loader> = new Vector.<Loader>();
var container3:Sprite;
// end new instance properties

var loader3:Loader = new Loader();

loader3.load(new URLRequest("assets/ad_bona1.jpg"));
addChild(loader3);
loader3.alpha = 0;

loadThumbs3();

function loadThumbs3():void
{

    // this is where container3 used to be declared

    container3 = new Sprite();
    addChild(container3);
    container3.buttonMode = true;
    for(var i3:uint = 0; i3 < images3.length; i3++)
    {
        var tPtr:int = thumbLoader3Vector.length;
        thumbLoader3Vector.push(new Loader());
        // this is where thumbLoader3 used to be declared & instantiated

        thumbLoader3Vector[tPtr].load(new URLRequest("assets/thumbs/" + images3[i3]));
        thumbLoader3Vector[tPtr].x = thumbX3;
        thumbLoader3Vector[tPtr].y = thumbY3;
        thumbX3 += 85;
        container3.addChild(thumbLoader3Vector[tPtr]);
        thumbLoader3Vector[tPtr].addEventListener(MouseEvent.CLICK, thumbClicked3);

    }
}
function thumbClicked3(event:MouseEvent):void
{
    var path3:String = event.currentTarget.contentLoaderInfo.url;
    path3 = path3.substr(path3.lastIndexOf("/") + 1);
    loader3.load(new URLRequest("assets/" + path3));
}

///PROBLEM BELOW, button removes only "loader3" and not the other two for some reason

invis_button.addEventListener(MouseEvent.CLICK, unload_loaders);

function unload_loaders(event:MouseEvent):void{

    // since the thumbLoader3 Loaders are children of container3 in the display list, we need to remove them first
    for(var $i:uint = 0;$i<thumbLoader3Vector.length;$i++)
    {
        removeChild(thumbLoader3Vector[$i]);
        // also make sure you remove the listener, so that the object will be picked up by garbage collection
        thumbLoader3Vector[$i].removeEventListener(MouseEvent.CLICK, thumbClicked3);
    }
    // and then just set the entire vector to null
    thumbLoader3Vector = null;

    // remove the loader3 object & set it to null
    removeChild(loader3);
    loader3 = null;

    // remove the container3 object & set it to null
    removeChild(container3);
    container3 = null;
 }


问:
SAS - assign decimal to float variable
In following SAS code, b and c are float variables.

```<code>if a=0 then do
  b = .;
  c= .;
end;
</code>```

Does b and c now have value as 0.0?

Thanks

答: No, a dot indicates a missing value.</p>

ContentLicense: CC BY-SA 3.0

Title: SAS - assign decimal to float variable

Body:
In following SAS code, b and c are float variables.

if a=0 then do
  b = .;
  c= .;
end;

Does b and c now have value as 0.0?

Thanks

Body: No, a dot indicates a missing value.


问:
Griffon framework for to convert a vanilla java based app
I am working in a vanilla java based application which is also multithreaded. This project actually parses (more than 10,000 rows for example)large files(csv,xml,etc) and applies business logic and feeds to database. Thats about it. But there are lots of rules and not to mention data. And the way this project is structured is not clean.

I was thinking to use a framework so that I have separation of logics like controller/service layer/data layer. Is Griffon framework suits that? As I was just reading and found out people are using it to build nice gui centric projects. I do not need GUI. But again 1 hour of reading will not give me lots of insights. If anyone can help me with this.

This project is command line based.

No GUI needed.

Lots of interaction with data.

答:
I'm the founder of the Griffon framework. The requirements you listed don't exactly specify the need for a desktop application.

Is the previous vanilla Java application a desktop one? If so then it may make sense to migrate to Griffon, specially if Swing was used -> migrate to JavaFX.

Do you need to interact with the data as it's being processed? Such as applying filters or moving data from one place to another, edits, etc? If so a desktop application may be a good idea.

Otherwise a command line application would work. There are many options but I think Spring Boot would be the easiest to get started.


问:
Promises not working as expected in my Node JS app
I am facing some confusion as to how my promises are working in my node.js web application.

```<code>  let arrayPics = [];
        let conv = ()=>{
            return new Promise((resolve,reject)=>{
                let check=converter.convert(req);
                if(check)
                    resolve('Conversion');
                else
                    reject();
            });
        };

        let enc = (message)=>{
            return new Promise((resolve,reject)=>{
               let check =  encode.encoder(arrayPics);
               if(check)
                   resolve(message + ' and Encoding to Base 64!');
                else
                    reject();
            });
        };

        conv().then((result)=>{
            return enc(result);
        }).then((result)=>{
            console.log('Finished '+result);
            console.log(arrayPics[4]);
            return res.redirect('/ViewDoc');
        });
</code>```

So basically my first promise is running a script to convert pdf and tiff file documents to seperate png files in a temp folder. Then the second promise runs a script to convert the pngs to base 64 and store it in a dynamic array. When I consume the promises I get the output as something like this :

```<code>{ title: '' }
{ fieldname: 'upl',
  originalname: 'multipage_tiff_example.tif',
  encoding: '7bit',
  mimetype: 'image/tiff',
  destination: 'uploads/',
  filename: 'multipage_tiff_example.tif',
  path: 'uploads\\multipage_tiff_example.tif',
  size: 810405 }
Finished Conversion and Encoding to Base 64!
undefined
POST / 302 181.742 ms - 60
GET /ViewDoc 304 8.564 ms - -
Converted!
</code>```

We can see that the console.log(arrayPics[4]) output is coming out as undefined. But when i run the same code while debugging my code I get the following output.

```<code>Debugger listening on [::]:54395
Server is listening on: 3000
GET / 304 35.525 ms - -
{ title: '' }
{ fieldname: 'upl',
  originalname: 'multipage_tiff_example.tif',
  encoding: '7bit',
  mimetype: 'image/tiff',
  destination: 'uploads/',
  filename: 'multipage_tiff_example.tif',
  path: 'uploads\\multipage_tiff_example.tif',
  size: 810405 }
Finished Conversion and Encoding to Base 64!
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAJYCAIAAAAVFBUnAAAABGdBTUEAAL.......
Converted!
</code>```

We can see that now we get an output for console.log(arrayPics[4]). This is the part where I am getting confused as to why my code is behaving like that. I have also posted my scripts that my promises are using for your reference:

DOCUMENT CONVERTER SCRIPT:

```<code>module.exports = {

    convert: function pdfConverter(req)
    {   let check = true;
        gm(req.file.path).write('Images/output.png', (err)=>
        {
            if(err)
            {
                console.log(err);
                reject(err);
                check = false;
            }

            else
            {
                console.log("Converted!");

            }

        });
        return check;
    }

};
</code>```

BASE64 ENCODING

```<code>module.exports = {
    encoder: function base64_encoder(arrayPics)
            {
                let files = fs.readdirSync('Images/');
                for(let i in files)
                {
                    //console.log('C');
                    arrayPics.push(base64Img.base64Sync('Images/output-' + i + ".png"));
                }
                return true;
            }
};
</code>```

I would be grateful if i can get some suggestions as to why this is happening and any changes that I can make to my code.

答:
The problem is in your document converter script. You pass a callback function to the .write() method. In other words, it's asynchronous, but your convert() function returns synchronously. You return check right away, before it's potentially set to false in the callback.

What you need to do is to make the convert() function return a Promise that resolves or rejects in the callback that you pass to the .write() method.

Then in your application script, your conv() function declaration can be simplified to this: let conv = () => converter.convert(req);

Also, as it stands your encoder is NOT asynchronous, so there's no point in wrapping it in a Promise.

You can make it asynchronous though, for instance by using .readdir() instead of .readdirSync(). If you do, the same thing that I explained about your converter applies to your encoder.

Body:
I am facing some confusion as to how my promises are working in my node.js web application.

  let arrayPics = [];
        let conv = ()=>{
            return new Promise((resolve,reject)=>{
                let check=converter.convert(req);
                if(check)
                    resolve('Conversion');
                else
                    reject();
            });
        };

        let enc = (message)=>{
            return new Promise((resolve,reject)=>{
               let check =  encode.encoder(arrayPics);
               if(check)
                   resolve(message + ' and Encoding to Base 64!');
                else
                    reject();
            });
        };

        conv().then((result)=>{
            return enc(result);
        }).then((result)=>{
            console.log('Finished '+result);
            console.log(arrayPics[4]);
            return res.redirect('/ViewDoc');
        });

So basically my first promise is running a script to convert pdf and tiff file documents to seperate png files in a temp folder. Then the second promise runs a script to convert the pngs to base 64 and store it in a dynamic array. When I consume the promises I get the output as something like this :

{ title: '' }
{ fieldname: 'upl',
  originalname: 'multipage_tiff_example.tif',
  encoding: '7bit',
  mimetype: 'image/tiff',
  destination: 'uploads/',
  filename: 'multipage_tiff_example.tif',
  path: 'uploads\\multipage_tiff_example.tif',
  size: 810405 }
Finished Conversion and Encoding to Base 64!
undefined
POST / 302 181.742 ms - 60
GET /ViewDoc 304 8.564 ms - -
Converted!

We can see that the console.log(arrayPics[4]) output is coming out as undefined. But when i run the same code while debugging my code I get the following output.

Debugger listening on [::]:54395
Server is listening on: 3000
GET / 304 35.525 ms - -
{ title: '' }
{ fieldname: 'upl',
  originalname: 'multipage_tiff_example.tif',
  encoding: '7bit',
  mimetype: 'image/tiff',
  destination: 'uploads/',
  filename: 'multipage_tiff_example.tif',
  path: 'uploads\\multipage_tiff_example.tif',
  size: 810405 }
Finished Conversion and Encoding to Base 64!
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAJYCAIAAAAVFBUnAAAABGdBTUEAAL.......
Converted!

We can see that now we get an output for console.log(arrayPics[4]). This is the part where I am getting confused as to why my code is behaving like that. I have also posted my scripts that my promises are using for your reference:

DOCUMENT CONVERTER SCRIPT:

module.exports = {

    convert: function pdfConverter(req)
    {   let check = true;
        gm(req.file.path).write('Images/output.png', (err)=>
        {
            if(err)
            {
                console.log(err);
                reject(err);
                check = false;
            }

            else
            {
                console.log("Converted!");

            }

        });
        return check;
    }

};

BASE64 ENCODING

module.exports = {
    encoder: function base64_encoder(arrayPics)
            {
                let files = fs.readdirSync('Images/');
                for(let i in files)
                {
                    //console.log('C');
                    arrayPics.push(base64Img.base64Sync('Images/output-' + i + ".png"));
                }
                return true;
            }
};

I would be grateful if i can get some suggestions as to why this is happening and any changes that I can make to my code.


问:
Service `http` get method doesn't return success or error
I am writing a service that returns array of cars. My service method dont return sucess or error. The folder assets is in the same directory as `app folder.

This is my service method:

```<code>import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http';
import {Car} from '../../../domain/car';
import 'rxjs/add/operator/toPromise';

@Injectable()
export class CarService {

  constructor(private http: Http) {
  }
    getCarsMedium(): Promise<Car[]> {
       console.log("call1");
       return this.http.get('assets/data/cars-medium.json')
       .toPromise()
       .then(res => {
          console.log("sucess1" + res);
          console.log("sucess2" + res.json());
          return res.json().data as Car[]
          })
       .catch(error => {
          console.log("error");
          console.error(error);
       });
   }
</code>```

}

I call it as:

```<code>import {Component, OnInit} from '@angular/core';
import {Car} from "../../../domain/car";
import {CarService} from "./car.service";

@Component({
  moduleId: module.id,
  templateUrl: './car.component.html',
  styleUrls: ['./car.component.css']
})

export class CarComponent implements OnInit {
  cars: Car[];

  constructor(private carService: CarService) {
  }

  ngOnInit() {
    console.log("call2");
    this.carService.getCarsMedium().then(function (cars) {
      cars => this.cars = cars;
      console.log(cars)
    });
  }
}
</code>```

This is how my json looks like:

```<code>{"data":[
    {"vin":"a1653d4d","year":1998, "brand":"VW","color":"White"},
    {"vin":"a1653d4w","year":1999, "brand":"VV","color":"White"}
]}
</code>```

Entity class:

```<code>export interface Car {
  vin?;
  year?;
  brand?;
  color?;
}
</code>```

EDIT:
getCarsMedium() dont return sucess or error.
console output:
    call2
    call1

答:
I found the reason: I have jwt-authentication in project
http://jasonwatmore.com/post/2016/08/16/angular-2-jwt-authentication-example-tutorial][1] - it blocked my request</p>

Body:
I am writing a service that returns array of cars. My service method dont return sucess or error. The folder assets is in the same directory as `app folder.

This is my service method:

import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http';
import {Car} from '../../../domain/car';
import 'rxjs/add/operator/toPromise';

@Injectable()
export class CarService {

  constructor(private http: Http) {
  }
    getCarsMedium(): Promise<Car[]> {
       console.log("call1");
       return this.http.get('assets/data/cars-medium.json')
       .toPromise()
       .then(res => {
          console.log("sucess1" + res);
          console.log("sucess2" + res.json());
          return res.json().data as Car[]
          })
       .catch(error => {
          console.log("error");
          console.error(error);
       });
   }

}

I call it as:

import {Component, OnInit} from '@angular/core';
import {Car} from "../../../domain/car";
import {CarService} from "./car.service";

@Component({
  moduleId: module.id,
  templateUrl: './car.component.html',
  styleUrls: ['./car.component.css']
})

export class CarComponent implements OnInit {
  cars: Car[];

  constructor(private carService: CarService) {
  }

  ngOnInit() {
    console.log("call2");
    this.carService.getCarsMedium().then(function (cars) {
      cars => this.cars = cars;
      console.log(cars)
    });
  }
}

This is how my json looks like:

{"data":[
    {"vin":"a1653d4d","year":1998, "brand":"VW","color":"White"},
    {"vin":"a1653d4w","year":1999, "brand":"VV","color":"White"}
]}

Entity class:

export interface Car {
  vin?;
  year?;
  brand?;
  color?;
}

EDIT:
getCarsMedium() dont return sucess or error.
console output:
    call2
    call1


问:
How to show image url in wordpress foreeach loop?
I need to display sub categories from a particular category

```<code><?php
$subcategories = get_categories('&child_of=22&hide_empty');

foreach ($subcategories as $subcategory) {

echo '<a href="' . get_category_link( $subcategory->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $subcategory->name ) . '" ' . '>' . $subcategory->name.'</a>';

 echo '<p>'.$subcategory->description.'</p>';

}

?>
</code>```

I tried this

```<code>echo '<img class='hline' src='bloginfo('template_url')/img/hline.png' alt=''>';
</code>```

its not working

答:
I would use instead:

```<code>get_template_directory_uri()
</code>```

And I like to write it like this but that depends internally on you.

```<code><img class="hline" src="<?php echo get_template_directory_uri();?>/img/hline.png" alt="" />';
</code>```

Body:
I need to display sub categories from a particular category

<?php
$subcategories = get_categories('&child_of=22&hide_empty');

foreach ($subcategories as $subcategory) {

echo 'term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $subcategory->name ) . '" ' . '>' . $subcategory->name.'';

 echo '
'.$subcategory->description.'
';

}

?>

I tried this

echo '';

its not working

Body:
I would use instead:

get_template_directory_uri()

And I like to write it like this but that depends internally on you.

<img class="hline" src="<?php echo get_template_directory_uri();?>/img/hline.png" alt="" />';


问:
How to extract a line and a line before that based on certain strings
I am trying to extract lines containing a certain string also 4 lines before it (just the fourth line not the ones in between). Right now I can get the line itself;

```<code>grep -n "my string" myfile.out > output.txt
</code>```

I can also get the lines before it, but not that specific one, all the four preceding lines;

```<code>grep "my string" -B 4 myfile.out > output.txt
</code>```

Let's take this example:

```<code> ! CREEK
 FLUX 6739, 6670, 6640, 6672, 6582, 6583, 6548, 6576, 6570 &
 656565
 ***
 ***  THE SUM OF SPECIFIED:   -1.192451
 ***  THE AVERAGE:  -6.2760599E-02
 ***  THE MAXIMUM:    0.000000
 ***  THE MINIMUM:  -0.4294980
 ***  THE SUM OF POSITIVE:    0.000000
 ***  THE SUM OF NEGATIVE:   -1.192451
</code>```

I want this output:

```<code> ! CREEK
 ***  THE SUM OF SPECIFIED:   -1.192451
</code>```

I would appreciate windows-batch-file solution or PowerShell as well.

答:
Here is tac + awk solution:

```<code>tac file |
awk '/THE SUM OF SPECIFIED/{p=NR; print} p && NR==p+4{print; p=0}' |
tac

! CREEK
***  THE SUM OF SPECIFIED:   -1.192451
</code>```

Alternatively here is grep + awk solution:

```<code>grep "THE SUM OF SPECIFIED" -B 4 file | awk 'NR==1 || NR ==5'
</code>```

Body:
I am trying to extract lines containing a certain string also 4 lines before it (just the fourth line not the ones in between). Right now I can get the line itself;

grep -n "my string" myfile.out > output.txt

I can also get the lines before it, but not that specific one, all the four preceding lines;

grep "my string" -B 4 myfile.out > output.txt

Let's take this example:

 ! CREEK
 FLUX 6739, 6670, 6640, 6672, 6582, 6583, 6548, 6576, 6570 &
 656565
 ***
 ***  THE SUM OF SPECIFIED:   -1.192451
 ***  THE AVERAGE:  -6.2760599E-02
 ***  THE MAXIMUM:    0.000000
 ***  THE MINIMUM:  -0.4294980
 ***  THE SUM OF POSITIVE:    0.000000
 ***  THE SUM OF NEGATIVE:   -1.192451

I want this output:

 ! CREEK
 ***  THE SUM OF SPECIFIED:   -1.192451

I would appreciate windows-batch-file solution or PowerShell as well.

Body:
Here is tac + awk solution:

tac file |
awk '/THE SUM OF SPECIFIED/{p=NR; print} p && NR==p+4{print; p=0}' |
tac

! CREEK
***  THE SUM OF SPECIFIED:   -1.192451

Alternatively here is grep + awk solution:

grep "THE SUM OF SPECIFIED" -B 4 file | awk 'NR==1 || NR ==5'


问:
How do you check if a selector matches something in jQuery?
In Mootools, I'd just run if ($('target')) { ... }.  Does if ($('#target')) { ... } in jQuery work the same way?

答:
if you used:

```<code>jQuery.fn.exists = function(){return ($(this).length > 0);}
if ($(selector).exists()) { }
</code>```

you would imply that chaining was possible when it is not.

This would be better

```<code>jQuery.exists = function(selector) {return ($(selector).length > 0);}
if ($.exists(selector)) { }
</code>```

OwnerDisplayName: One Crayon

Body:
if you used:

jQuery.fn.exists = function(){return ($(this).length > 0);}
if ($(selector).exists()) { }

you would imply that chaining was possible when it is not.

This would be better

jQuery.exists = function(selector) {return ($(selector).length > 0);}
if ($.exists(selector)) { }

OwnerDisplayName: Jon Erickson


问:
Wicket ListView not refreshing
I am taking my first steps with Apache Wicket and ran into the following problem. I have a ListView that displays a "delete" link right next to its entries. When the delete link is clicked, the entity represented by the list item is deleted from the database but the list itself does not get updated until I reload the page manually in the browser.

```<code>IModel<List<SampleEntity>> sampleEntityListModel = new LoadableDetachableModel<List<SampleEntity>>() {
        @Override
        protected List<SampleEntity> load() {
            return mSampleEntityBA.findAll();
        }
    };

mListview = new ListView<SampleEntity>("listview", sampleEntityListModel) {
        @Override
        protected void populateItem(final ListItem<SampleEntity> item) {
            item.add(new Label("listlabel", new PropertyModel<String>(item.getModelObject(),
                    "text")));
            item.add(new Link<SampleEntity>("deleteLink", item.getModel()) {
                @Override
                public void onClick() {
                    mSampleEntityBA.delete(item.getModelObject());
                }
            });
        }
};
</code>```

答:
When onClick called, item.getModelObject() pulls from the sampleEntityListModel which in turn calls mSampleEntityBA.findAll(). The model object of sampleEntityListModel will be cached for the duration on the request cycle (until it is detached - which is usually what you want) and is not aware of the call to delete().

In order to refresh the sampleEntityListModel, add a sampleEntityListModel.detach() call just after the delete (sampleEntityListModel must be made final, but this will not cause any extra state to be serialized). This will cause the model to fetch a fresh set of data when the list view is rendered later in the request cycle.

Title: Wicket ListView not refreshing

Body:
I am taking my first steps with Apache Wicket and ran into the following problem. I have a ListView that displays a "delete" link right next to its entries. When the delete link is clicked, the entity represented by the list item is deleted from the database but the list itself does not get updated until I reload the page manually in the browser.

IModel<List<SampleEntity>> sampleEntityListModel = new LoadableDetachableModel<List<SampleEntity>>() {
        @Override
        protected List<SampleEntity> load() {
            return mSampleEntityBA.findAll();
        }
    };

mListview = new ListView<SampleEntity>("listview", sampleEntityListModel) {
        @Override
        protected void populateItem(final ListItem<SampleEntity> item) {
            item.add(new Label("listlabel", new PropertyModel<String>(item.getModelObject(),
                    "text")));
            item.add(new Link<SampleEntity>("deleteLink", item.getModel()) {
                @Override
                public void onClick() {
                    mSampleEntityBA.delete(item.getModelObject());
                }
            });
        }
};


问:
Cannot read property from undefined
I have the following code, which works fine and does what it's supposed to do.

However my table has 2 rows at the top which doesn't interest me (they wouldn't match the if clause anyway so it doesn't affect me, just trying to figure this out) so I was trying to tailor my range to simply exclude them.

All I did was change the A1 to A3 inside the getRange and it's throwing the Cannot read property "1" from undefined (referring to the hardcoded 1 in the if statement).

The reason I don't understand why it's undefined is because changing the range like this shouldn't affect it at all, since I'm reducing my range from A1:B6 (6 rows in my sheet with the first 2 being either empty or not needed) to A3:B6, but the first value in the set (A3) should still end up at [0][0] inside 'data'.. unless getValues() messes something up that I don't know about..

```<code>var lastRow = sheet.getLastRow();
var myRange = sheet.getRange("A1:B" + lastRow);
var options = new Array();
var data = myRange.getValues();
for(var i = 0; i < lastRow; i++) {
    if(data[i][1] == region)
    {
     options.push(data[i][0]);
    }
}
</code>```

Thanks!

答:
Array indices start with zero. The index of the last element is length of an array (total number of elements) - 1. Modify your 'for' loop like this and it will work

```<code>for(var i = 0; i < data.length; i++)
</code>```

As the previous poster pointed out, you iterate from 0 to what the function getLastRow() returns. Remember, it returns the last row with data in a sheet. It has nothing to do with your array.

Title: Cannot read property from undefined

Body:
I have the following code, which works fine and does what it's supposed to do.

However my table has 2 rows at the top which doesn't interest me (they wouldn't match the if clause anyway so it doesn't affect me, just trying to figure this out) so I was trying to tailor my range to simply exclude them.

All I did was change the A1 to A3 inside the getRange and it's throwing the Cannot read property "1" from undefined (referring to the hardcoded 1 in the if statement).

The reason I don't understand why it's undefined is because changing the range like this shouldn't affect it at all, since I'm reducing my range from A1:B6 (6 rows in my sheet with the first 2 being either empty or not needed) to A3:B6, but the first value in the set (A3) should still end up at [0][0] inside 'data'.. unless getValues() messes something up that I don't know about..

var lastRow = sheet.getLastRow();
var myRange = sheet.getRange("A1:B" + lastRow);
var options = new Array();
var data = myRange.getValues();
for(var i = 0; i < lastRow; i++) {
    if(data[i][1] == region)
    {
     options.push(data[i][0]);
    }
}

Thanks!

Body:
Array indices start with zero. The index of the last element is length of an array (total number of elements) - 1. Modify your 'for' loop like this and it will work

for(var i = 0; i < data.length; i++)

As the previous poster pointed out, you iterate from 0 to what the function getLastRow() returns. Remember, it returns the last row with data in a sheet. It has nothing to do with your array.


问:
Read JSON file data on client side with pure javascript
I have a JSON file on my local computer and I want to read its contents and display it on the web browser by using pure javascript. Anything which refers to the server side will not work for me. It is required to be done purely on the Client Side. What are the possible solutions ?
Note: ajax and anything related to that should not be used.

答:
If you don't wanna do an ajax to load the file, and let user select the file what he wanna load by <input type='file' />, maybe this way is working for you.

document.getElementById('show').addEventListener('click', function() {

  var file = document.getElementById('myfile').files[0];
  var reader = new FileReader();
  reader.readAsText(file, 'UTF-8');
  reader.onload = function(evt) {
    document.getElementById('content').innerHTML = evt.target.result;
  }

})```
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <input type="file" name="" id="myfile">

  <div id="content"></div>
  <button id="show">Show</button>
</body>
</html></code>```

Body:
If you don't wanna do an ajax to load the file, and let user select the file what he wanna load by <input type='file' />, maybe this way is working for you.

document.getElementById('show').addEventListener('click', function() {

  var file = document.getElementById('myfile').files[0];
  var reader = new FileReader();
  reader.readAsText(file, 'UTF-8');
  reader.onload = function(evt) {
    document.getElementById('content').innerHTML = evt.target.result;
  }

})

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <input type="file" name="" id="myfile">

  <div id="content"></div>
  <button id="show">Show</button>
</body>
</html>

ContentLicense: CC BY-SA 4.0


问:
Centos Python 3: ConfigParser using environment variables and cross references
When I try to get the values using ConfigParser,

I am not able to get certain values from environment variables in my .ini file

Interpolating variable names are printing variables as it is without value substitution.

Below is my code,

config_parse.py:

```<code>import os
import configparser

myConf = configparser.ConfigParser(interpolation=configparser.ExtendedInterpolation())
myConf.read('config_data.ini')

print( myConf.get('server_details', 'hostName', vars=os.environ))
print( myConf.get('server_details', 'userName', vars=os.environ))
print( myConf.get('log_path', 'mntPath', vars=os.environ))
exit(0)
</code>```

config_data.ini:

```<code>[server_details]
  hostName: %(HOSTNAME)
  ; Below value are not getting substituted from environment variable
  userName: %(USER)
  password: passw0rd

[log_path]
  instance: %(SERVER_INSTANCE)
  mntPath: /net/server1/mnt/data0
  ; server_details:hostname and instance values are not getting substituted
  testbedMntPath: ${mntPath}/${server_details:userName}/my_logs/${server_details:hostName}${instance}
</code>```

I am getting the following output,

$] python config_parse.py

server1

%(USER)

/net/server1/mnt/data0/%(USER)/my_logs/%(HOSTNAME)%(SERVER_INSTANCE)

$]

答:
You're using ExtendedInterpolation, which uses ${section:option} syntax.

The reason why you get server1 for myConf.get('server_details', 'hostName', vars=os.environ) isn't because hostName = %(HOSTNAME) is interpolated, but because HOSTNAME from vars takes precedence.

It's easier to see with an example:

```<code>>>> myConf.get('server_details', 'foo', vars={'FOO': 'BAR'})
'BAR'
</code>```

If vars contains an entry for FOO, the get call for foo (case insensitive) will return its value, the value from the config file is actually ignored.

So that means that for hostName you acutally get the value of the HOSTNAME environment variable. userName does not exist in os.environ, so you get the value from the config file: %(USER).

So if you use ExtendedInterpolations, use ${...} style, if you use BasicInterpolation use %(...)s style. You can't mix both. And if you blindly pass vars=os.environ, be aware that the envionment variables will override all options in all sections with the same name. Depending on the context the application runs in, that may be relevant for security.

Body:
When I try to get the values using ConfigParser,

I am not able to get certain values from environment variables in my .ini file

Interpolating variable names are printing variables as it is without value substitution.

Below is my code,

config_parse.py:

import os
import configparser

myConf = configparser.ConfigParser(interpolation=configparser.ExtendedInterpolation())
myConf.read('config_data.ini')

print( myConf.get('server_details', 'hostName', vars=os.environ))
print( myConf.get('server_details', 'userName', vars=os.environ))
print( myConf.get('log_path', 'mntPath', vars=os.environ))
exit(0)

config_data.ini:

[server_details]
  hostName: %(HOSTNAME)
  ; Below value are not getting substituted from environment variable
  userName: %(USER)
  password: passw0rd

[log_path]
  instance: %(SERVER_INSTANCE)
  mntPath: /net/server1/mnt/data0
  ; server_details:hostname and instance values are not getting substituted
  testbedMntPath: ${mntPath}/${server_details:userName}/my_logs/${server_details:hostName}${instance}

I am getting the following output,

$] python config_parse.py

server1

%(USER)

/net/server1/mnt/data0/%(USER)/my_logs/%(HOSTNAME)%(SERVER_INSTANCE)

$]

Body:
You're using ExtendedInterpolation, which uses ${section:option} syntax.

The reason why you get server1 for myConf.get('server_details', 'hostName', vars=os.environ) isn't because hostName = %(HOSTNAME) is interpolated, but because HOSTNAME from vars takes precedence.

It's easier to see with an example:

>>> myConf.get('server_details', 'foo', vars={'FOO': 'BAR'})
'BAR'

If vars contains an entry for FOO, the get call for foo (case insensitive) will return its value, the value from the config file is actually ignored.

So that means that for hostName you acutally get the value of the HOSTNAME environment variable. userName does not exist in os.environ, so you get the value from the config file: %(USER).

So if you use ExtendedInterpolations, use ${...} style, if you use BasicInterpolation use %(...)s style. You can't mix both. And if you blindly pass vars=os.environ, be aware that the envionment variables will override all options in all sections with the same name. Depending on the context the application runs in, that may be relevant for security.


问:
CSS-Grid columns do not align properly
Basically, I often run into this kind of issue, that the columns of my grid do not align as intended. (Bootstrap, Materializecss, and others) Everytime the same issue, sometimes I get it fixed, other times I struggle for hours trying to get it work.

That's really annyoing and I really wan't to know why this issue happens and how to solve it in future projects!

The problems is the following:

I have a layout example (jsfiddle), which I want to sovle. It's using Materializecss with some sections.

```<code>  Large View (with thumbnails right)           Mobile View
+----------------------+-------------+       +----------------------+
| Section 1            | Section 2   |       | Section 1            |
|                      |             |       |                      |
+----------------------+-------------+       +----------------------+
| Image Slider Section | Thumbnails  |       | Section 2            |
|                      | # # # # # # |       |                      |
|                      | # # # # # # |       +----------------------+
|                      | # # # # # # |       | Image Slider Section |
+----------------------+-------------+       |                      |
| Section 3            | Section 4   |       |                      |
|                      |             |       |                      |
|                      +-------------+       +----------------------+
|                      | Section 5   |       | Thumbnails           |
|                      |             |       |  # # # # # # # # # # |
+----------------------+-------------+       |  # # # # # # # # # # |
| Section 6                          |       +----------------------+
|                                    |       | Section 3            |
+----------------------+-------------+       |                      |
                                             |                      |
  Large View (with thumbnails bottom)        |                      |
+----------------------+-------------+       |                      |
| Section 1            | Section 2   |       |                      |
|                      |             |       +----------------------+
+----------------------+-------------+       | Section 4            |
| Image Slider Section | Section 4   |       |                      |
|                      |             |       +----------------------+
|                      +-------------+       | Section 5            |
|                      | Section 5   |       |                      |
+----------------------+             |       +----------------------+
| Thumbnails           |-------------+       | Section 6            |
| # # # # # # # # # # #|                     |                      |
+----------------------+                     +----------------------+
| Section 3            |
|                      |
|                      |
|                      |
|                      |
|                      |
+----------------------+-------------+
| Section 6                          |
|                                    |
+----------------------+-------------+

Both large views are valuable options.
</code>```

I've been told that I should structure and order my cols with mobile-first in mind. That's the HTML:

```<code><article>
  <div class="container">
    <div class="row">
      <section class="col s12 m8">
        <h5 class="teal-text">Share Buttons Section</h5>
      </section>

      <!--<section class="col s12 m4">-->
      <!--<h5 class="teal-text">Nothing (Just a Placeholder)</h5>-->
      <!--</section>-->

      <section class="col s12 m8">
        <h5 class="teal-text">Section 1</h5>
      </section>

      <section class="col s12 m4">
        <h5 class="teal-text">Section 2</h5>
      </section>

      <section class="col s12 m8">
        <h5 class="teal-text">Pushpin Nav</h5>
      </section>

      <section class="col s12 m8">
        <h5 class="teal-text">Slider Section</h5>
        <div class="col s2 amber" style="margin: 3px; width: 100%; height: 480px"></div>
      </section>

      <section class="col s12 m8">
        <h5 class="teal-text">Slider Thumbnails</h5>
        <div class="row">
          <div class="col s2 blue" style="margin: 3px; width: 48px; height: 48px"></div>
          <!--...-->
        </div>
      </section>

      <section class="col s12 m8">
        <h5 class="teal-text">Section 3</h5>
      </section>

      <section class="col s12 m4">
        <h5>Section 4</h5>
      </section>

      <section class="col s12 m4">
        <h5>Section 5</h5>
      </section>

      <section class="col s12">
        <h5>Section 6</h5>
      </section>
    </div>
  </div>
</article>
</code>```

This leaves some gaps in between the sections in the large view if the content of a section is bigger than the other remaining for this row.
Ok cool, so I came across push / pull, which I thought would reorder the columns, and fix the problem if I just push and pull them into the right order. But that causes just to "re-order" the offset in the horizontal space. Gaps still there.

What am I missing, to get the content stick together?

I really appreciate a detailed answer providing some examples, so I understand this kind of issue.

Link to my jsfiddle example:
https://jsfiddle.net/jkdzgafr/

答: My solution is to use the display: flex property which is currently, as of the 8th June, supported by more browsers than the display: grid property. If you'd like to test it without having to enable it, simply install Chrome BETA at chrome.com/beta.

Title: CSS-Grid columns do not align properly

Body:
Basically, I often run into this kind of issue, that the columns of my grid do not align as intended. (Bootstrap, Materializecss, and others) Everytime the same issue, sometimes I get it fixed, other times I struggle for hours trying to get it work.

That's really annyoing and I really wan't to know why this issue happens and how to solve it in future projects!

The problems is the following:

I have a layout example (jsfiddle), which I want to sovle. It's using Materializecss with some sections.

  Large View (with thumbnails right)           Mobile View
+----------------------+-------------+       +----------------------+
| Section 1            | Section 2   |       | Section 1            |
|                      |             |       |                      |
+----------------------+-------------+       +----------------------+
| Image Slider Section | Thumbnails  |       | Section 2            |
|                      | # # # # # # |       |                      |
|                      | # # # # # # |       +----------------------+
|                      | # # # # # # |       | Image Slider Section |
+----------------------+-------------+       |                      |
| Section 3            | Section 4   |       |                      |
|                      |             |       |                      |
|                      +-------------+       +----------------------+
|                      | Section 5   |       | Thumbnails           |
|                      |             |       |  # # # # # # # # # # |
+----------------------+-------------+       |  # # # # # # # # # # |
| Section 6                          |       +----------------------+
|                                    |       | Section 3            |
+----------------------+-------------+       |                      |
                                             |                      |
  Large View (with thumbnails bottom)        |                      |
+----------------------+-------------+       |                      |
| Section 1            | Section 2   |       |                      |
|                      |             |       +----------------------+
+----------------------+-------------+       | Section 4            |
| Image Slider Section | Section 4   |       |                      |
|                      |             |       +----------------------+
|                      +-------------+       | Section 5            |
|                      | Section 5   |       |                      |
+----------------------+             |       +----------------------+
| Thumbnails           |-------------+       | Section 6            |
| # # # # # # # # # # #|                     |                      |
+----------------------+                     +----------------------+
| Section 3            |
|                      |
|                      |
|                      |
|                      |
|                      |
+----------------------+-------------+
| Section 6                          |
|                                    |
+----------------------+-------------+

Both large views are valuable options.

I've been told that I should structure and order my cols with mobile-first in mind. That's the HTML:

Share Buttons Section

Section 1

Section 2

Pushpin Nav

Slider Section

Slider Thumbnails

Section 3

Section 4

Section 5

Section 6

This leaves some gaps in between the sections in the large view if the content of a section is bigger than the other remaining for this row.
Ok cool, so I came across push / pull, which I thought would reorder the columns, and fix the problem if I just push and pull them into the right order. But that causes just to "re-order" the offset in the horizontal space. Gaps still there.

What am I missing, to get the content stick together?

I really appreciate a detailed answer providing some examples, so I understand this kind of issue.

Link to my jsfiddle example:
https://jsfiddle.net/jkdzgafr/


问:
Gatekeeper quarantine issue with certificate
Our app has been code signed. Our Apple certificate is up to date. Previous versions of our app have run just fine.

However, when the DMG is downloaded by the users, on some Macs the application is quarantined, but for the majority of users, it's not. So some users can open the app and others get the "X.app can’t be opened because the identity of the developer cannot be confirmed."

Luckily I have 2 Macs here that have the quarantine problem, but we can't find a difference between these Macs and the others. Has anyone else run into this problem?

答:
Gordon Davissons answer is quite extensive and should help in most cases. In my case, it did not.

Besides the two gatekeeper error messages that he mentions, there is a third one and that is the one from your question:

".app can’t be opened because the identity of the developer cannot be confirmed."

In my case this message came up, when an embedded third party framework had a bad run path setting: LD_RUNPATH_SEARCH_PATHS in build settings did reference something that it was not allowed to.

Apple documents this here https://developer.apple.com/library/content/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG207

If an app uses @rpath or an absolute path to link to a dynamic library
  outside of the app, the app will be rejected by Gatekeeper.

And they even state:

Neither the codesign nor the spctl tool will show the error. The error
  will only appear in the system log.

The solution was to modify the third party framework to something standard like this:

$(inherited) @executable_path/../Frameworks @loader_path/Frameworks


问:
How to update configuration xml file in a Lantronix xport-pro devices
I want to manually update the xml configuration file for Lantronix Xport-pro devices.

I have some process tu upload the file by Java FTP.

My question is: When I upload the file, what is needed to run the update of the xml configuration file?

Thanks.

答:
Solution:

To perform an upgrade of the xport-pro lantronix configuration devices, the XCR file import option must be enabled. This option is found on the Lantronix configuration web page, on the TFTP tab, Select enabled option in the checkbox, then click on the Submit button.

The .xml configuration file can be renamed as an .xcr file. When transferring this file via FTP or tftp, the device automatically runs the configuration and restarts the device.


问:
Laravel Queued Jobs Running for Many Minutes Longer Than Timeout
I have a Laravel queued job which extracts links from a webpage. The timeout for the Queue listener configured through Laravel Forge is 240 seconds (4 minutes). However, jobs are taking up to 45 minutes to run.

My queue settings are:

```<code>'redis' => [
    'driver' => 'redis',
    'connection' => 'default',
    'queue' => 'default',
    'retry_after' => 350,
],
</code>```

And there are multiple job processes running - up to 35 processes. As you can imagine, this is eating up a lot of server memory. The processes just seem to hanging around. The command for these processes as shown in top is:

```<code>php7.1 artisan queue:work redis --once --queue=linkqueue --delay=0 --memory=128 --sleep=10 --tries=1 --env=local
</code>```

How can a job run for 45 minutes if the timeout is 240 seconds? Why are there so many processes - shouldn't there just be one?

Also, any ideas why a script for extracting links should take 45 minutes to run?!

The script does work, that is, in most cases it runs as expected - it just takes ages. There are no errors reported/logged as far as I can see.

Code in the job is:

```<code>$dom = new DOMDocument;
$dom->loadHTML($html);
$links = $dom->getElementsByTagName('a');

foreach ($links as $a) {
    $link = $a->getAttribute('href');

    $newurl = new URL;
    $newurl->url = $link;
    $newurl->save();
}
</code>```

Update: Another simple job runs just fine, in under a second. It is specifically just the link job above that is taking 10s of minutes. Could it be a RAM issue or something? Is there anything else I can do to diagnose the problem? When run as part of a console job, the extract links function itself runs in 1 or 2 seconds. It is only on the queue that it freaks out.

答:
You can also do the following to make timeouts unlimited.</p>

```<code>php artisan queue:listen --timeout=0
</code>```

Body:
I have a Laravel queued job which extracts links from a webpage. The timeout for the Queue listener configured through Laravel Forge is 240 seconds (4 minutes). However, jobs are taking up to 45 minutes to run.

My queue settings are:

'redis' => [
    'driver' => 'redis',
    'connection' => 'default',
    'queue' => 'default',
    'retry_after' => 350,
],

And there are multiple job processes running - up to 35 processes. As you can imagine, this is eating up a lot of server memory. The processes just seem to hanging around. The command for these processes as shown in top is:

php7.1 artisan queue:work redis --once --queue=linkqueue --delay=0 --memory=128 --sleep=10 --tries=1 --env=local

How can a job run for 45 minutes if the timeout is 240 seconds? Why are there so many processes - shouldn't there just be one?

Also, any ideas why a script for extracting links should take 45 minutes to run?!

The script does work, that is, in most cases it runs as expected - it just takes ages. There are no errors reported/logged as far as I can see.

Code in the job is:

$dom = new DOMDocument;
$dom->loadHTML($html);
$links = $dom->getElementsByTagName('a');

foreach ($links as $a) {
    $link = $a->getAttribute('href');

    $newurl = new URL;
    $newurl->url = $link;
    $newurl->save();
}

Update: Another simple job runs just fine, in under a second. It is specifically just the link job above that is taking 10s of minutes. Could it be a RAM issue or something? Is there anything else I can do to diagnose the problem? When run as part of a console job, the extract links function itself runs in 1 or 2 seconds. It is only on the queue that it freaks out.

Body:
You can also do the following to make timeouts unlimited.

php artisan queue:listen --timeout=0


问:
Comparing a list against a tuple
I am trying to compare a list of values against a list of tuples. For example:

```<code>list = [1.0, 2.0]

list_of_tuples = [(3, 1.0, 'a'), (4, 2.0, 'b'), (5, 3.0, 'c')]
</code>```

Ideally what I am trying to do is take the list of tuples and check to see if all the values in that list are present in the other one. In the case of the example lists I provided above 1.0 and 2.0 are present but 3.0 is not. Another problem with this is that the location of the values in the list of tuples is going to be unknown when the comprehension takes place (which isn't the case in the example I provided above) so I'm not actually sure if it is possible to do what I am trying to do.

Any help with this would be appreciated, or an alternative solution would be helpful as well.

答:
Here's a recursive search algorithm that will return a list of indices at which you can recover the found value (the address reads right to left.  There's probably a way to append them in the other direction):

```<code>def recursive_search(searchable, value):
    address = []
    if _recursive_search(searchable, value, address):
        return address
    else:
        raise Exception("Value not found!")

def _recursive_search(searchable, value, address):
    if hasattr(searchable, '__iter__'): # check if searchable is a list or a tuple
        for i in range(len(searchable)):
            if _recursive_search(searchable[i], value, address):
                address.append(i)
                return True
        else:
                return False
    else:
        if searchable == value:
            return True

#recursive_search([[[1,2],[3,4],[5,6]],[[7,8],[9,10],[11,12]]], 11) -> [0,2,1]
</code>```

EDIT If you want to apply that over a list of values, you can use map or some such.  map(lambda x: recursive_search(list_of_tuples, x), list)

EDIT If you want to search the OTHER direction as well (which it seems you do in your question), you can combine a recursive map function with recursive_search...

```<code>def recursive_map(some_func, thing_to_map_over):
    some_func = some_func or recursive_map
    if hasattr(thing_to_map_over, '__iter__'):
        return map(lambda x: recursive_map(some_func, x), thing_to_map_over)
    else:
        return some_func(thing_to_map_over)
</code>```

So recursive_map(lambda x: recursive_search(list, x), list_of_tuples) will tell you if everything in list_of_tuples is in list, and where those things are located.

Title: Comparing a list against a tuple

Body:
I am trying to compare a list of values against a list of tuples. For example:

list = [1.0, 2.0]

list_of_tuples = [(3, 1.0, 'a'), (4, 2.0, 'b'), (5, 3.0, 'c')]

Ideally what I am trying to do is take the list of tuples and check to see if all the values in that list are present in the other one. In the case of the example lists I provided above 1.0 and 2.0 are present but 3.0 is not. Another problem with this is that the location of the values in the list of tuples is going to be unknown when the comprehension takes place (which isn't the case in the example I provided above) so I'm not actually sure if it is possible to do what I am trying to do.

Any help with this would be appreciated, or an alternative solution would be helpful as well.

Body:
Here's a recursive search algorithm that will return a list of indices at which you can recover the found value (the address reads right to left.  There's probably a way to append them in the other direction):

def recursive_search(searchable, value):
    address = []
    if _recursive_search(searchable, value, address):
        return address
    else:
        raise Exception("Value not found!")

def _recursive_search(searchable, value, address):
    if hasattr(searchable, '__iter__'): # check if searchable is a list or a tuple
        for i in range(len(searchable)):
            if _recursive_search(searchable[i], value, address):
                address.append(i)
                return True
        else:
                return False
    else:
        if searchable == value:
            return True

#recursive_search([[[1,2],[3,4],[5,6]],[[7,8],[9,10],[11,12]]], 11) -> [0,2,1]

EDIT If you want to apply that over a list of values, you can use map or some such.  map(lambda x: recursive_search(list_of_tuples, x), list)

EDIT If you want to search the OTHER direction as well (which it seems you do in your question), you can combine a recursive map function with recursive_search...

def recursive_map(some_func, thing_to_map_over):
    some_func = some_func or recursive_map
    if hasattr(thing_to_map_over, '__iter__'):
        return map(lambda x: recursive_map(some_func, x), thing_to_map_over)
    else:
        return some_func(thing_to_map_over)

So recursive_map(lambda x: recursive_search(list, x), list_of_tuples) will tell you if everything in list_of_tuples is in list, and where those things are located.


问:
Informatica - Adding a new column with multiple conditions in an existing mapping
I'm new to ETL and would need some help on the below:

I have an existing mapping which generates CSV extracts. To this I have to add a new column which is derived from the data that is existing the current data extracts.

I have about 7 conditions to check for e.g.:

colA is not null, colB >'7/1/2006', colC != 'Implementation' colD in('dsa','cpu') etc.

Lets say currently I have about 100 records in my extracts. I have to now add a new column to my final extracts such that the values for this new column is generated only on satisfying all the above conditions. Else the new column would have NULL values.

How do I implement this?

Should I write a query or use an exp or a filter?

答:
You can get this done by using an expression transformation.
Add a new new column in the expression and place your logic into that.
Now map that column from expression transformation to the new column in the target.

There are 2 approaches to get the NULL value
1) In the if else logic, make it as NULL in the else part
2) You can use a column default value in expression.


问:
StructureMap doesn't appear to be ready during HttpModule constructor -- is this correct?
This question is more to confirm my diagnosis of an issue we encountered--or to find alternative explanations.

We have an HTTPModule which intercepts every request made to our webforms application.  It's job is to translate specific querystring parameters which our integration partners send.

More importantly, it was wired to StructureMap like this:

```<code>public class SomeModule : IHttpModule
{
    public SomeModule()
    {
        ObjectFactory.BuildUp(this);
    }

    public IDependency Dependency { get; set; }
}
</code>```

During a previous release it appeared that the module wasn't being injected by the time it executed it's request-processing.  That led to some (ugly) defensive check being added like:

```<code>public class SomeModule : IHttpModule
{
    public SomeModule()
    {
        ObjectFactory.BuildUp(this);
        if (SomeDependency == null)
        {
            // HACK: Not sure why this corrects the issue!
            Dependency = ObjectFactory.GetInstance<ISomeDependency>();
        }
    }

    public IDependency Dependency { get; set; }
}
</code>```

You'll notice the HACK comment -- it resolved the issue but without good reason.

Well, this same module has been re-purposed on another site--and the previous hack no longer worked.  After looking at it for some time I made the change to move the StructureMap call outside the constructor, and lo-and-behold, it works.

```<code>public class SomeModule : IHttpModule
{
    public IDependency Dependency { get; set; }

    public void IHttpModule.Init(HttpApplication context)
    {
        Initialize();
        // the rest of the code
    }

    private bool _initialized;
    private void Initialize()
    {
        if (_initialized)
        {
            return;
        }

        ObjectFactory.BuildUp(this);
        _initialized = true;
    }
}
</code>```

So, my I have a few questions around this behavior:

My suspicion is that StructureMap was not fully initialized/configured when the HttpModule constructor was being called -- agree/disagree, any insight?

I haven't found any reference materials that state when to expect StructureMap to be initialized and ready to service requests.  Is there any such documentation?

答:
I wouldn't expect the behavior to be very predictable when you're trying to build up a type in its constructor.  Many actions that are normally considered safe are not considered safe in a constructor (like using a virtual property in a class).

Where you moved the code to looks much better and I would leave it there.  If you can't have the container create the instance itself (and therefore are forced to build it up) some sort of Initialize method is the preferred place to do the build up action.

To answer the question you have at the end of your post:
It is up to the developer to determine when StructureMap is initialized.  In a web application, this is almost always done in the Global.asax in Application_Start().  In that case, I would expect the container to be ready when your module is called.

Body:
This question is more to confirm my diagnosis of an issue we encountered--or to find alternative explanations.

We have an HTTPModule which intercepts every request made to our webforms application.  It's job is to translate specific querystring parameters which our integration partners send.

More importantly, it was wired to StructureMap like this:

public class SomeModule : IHttpModule
{
    public SomeModule()
    {
        ObjectFactory.BuildUp(this);
    }

    public IDependency Dependency { get; set; }
}

During a previous release it appeared that the module wasn't being injected by the time it executed it's request-processing.  That led to some (ugly) defensive check being added like:

public class SomeModule : IHttpModule
{
    public SomeModule()
    {
        ObjectFactory.BuildUp(this);
        if (SomeDependency == null)
        {
            // HACK: Not sure why this corrects the issue!
            Dependency = ObjectFactory.GetInstance<ISomeDependency>();
        }
    }

    public IDependency Dependency { get; set; }
}

You'll notice the HACK comment -- it resolved the issue but without good reason.

Well, this same module has been re-purposed on another site--and the previous hack no longer worked.  After looking at it for some time I made the change to move the StructureMap call outside the constructor, and lo-and-behold, it works.

public class SomeModule : IHttpModule
{
    public IDependency Dependency { get; set; }

    public void IHttpModule.Init(HttpApplication context)
    {
        Initialize();
        // the rest of the code
    }

    private bool _initialized;
    private void Initialize()
    {
        if (_initialized)
        {
            return;
        }

        ObjectFactory.BuildUp(this);
        _initialized = true;
    }
}

So, my I have a few questions around this behavior:

My suspicion is that StructureMap was not fully initialized/configured when the HttpModule constructor was being called -- agree/disagree, any insight?

I haven't found any reference materials that state when to expect StructureMap to be initialized and ready to service requests.  Is there any such documentation?


问:
Fail to read configuration file from @PropertySource
I'm trying to apply the next annotation to a the configuration class:

```<code>@Configuration
@EnableCaching
@ComponentScan({ "com.foo.*" })
@PropertySources({
    @PropertySource("classpath:foo.properties"),
    @PropertySource(value = "file:${catalina.home}/conf/foo.properties", ignoreResourceNotFound = true),
})
</code>```

but I'm getting the following exception:

org.springframework.beans.factory.BeanDefinitionStoreException: Failed
  to parse configuration class [com.company.config.CoreConfig];
  nested exception is java.io.FileNotFoundException: class path resource
  [foo.properties] cannot be opened because it does not exist

I've tried to look for this error on google and found many relevant things but nothing that could help me.

The file path is:

/home/me/apache-tomcat-8.0.36/conf

答:
I solved it by removing this line:</p>

```<code>@PropertySource("classpath:foo.properties"),
</code>```

Body:
I'm trying to apply the next annotation to a the configuration class:

@Configuration
@EnableCaching
@ComponentScan({ "com.foo.*" })
@PropertySources({
    @PropertySource("classpath:foo.properties"),
    @PropertySource(value = "file:${catalina.home}/conf/foo.properties", ignoreResourceNotFound = true),
})

but I'm getting the following exception:

org.springframework.beans.factory.BeanDefinitionStoreException: Failed
  to parse configuration class [com.company.config.CoreConfig];
  nested exception is java.io.FileNotFoundException: class path resource
  [foo.properties] cannot be opened because it does not exist

I've tried to look for this error on google and found many relevant things but nothing that could help me.

The file path is:

/home/me/apache-tomcat-8.0.36/conf

Body:
I solved it by removing this line:

@PropertySource("classpath:foo.properties"),