问:
Gluon Application don't work
I'm new to Gluon APP developpement, when i try to run my first App in netbeans windows platform i got an Error like this.

    Issue 1

Requested project: C:\Users\Medika\Documents\NetBeansProjects\TestGluon

Stack trace:

```<code>org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.14.1-all.zip'.
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
    at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:77)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.runBuild(AsyncGradleTask.java:368)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgressIgnoreTaskDefCancel(AsyncGradleTask.java:491)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgressIgnoreTaskDefCancel(AsyncGradleTask.java:401)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgress(AsyncGradleTask.java:392)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.access$400(AsyncGradleTask.java:93)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask$BuildExecutionItem$1.run(AsyncGradleTask.java:775)
    at org.netbeans.gradle.project.tasks.GradleDaemonManager.runBlockingGradleTask(GradleDaemonManager.java:51)
    at org.netbeans.gradle.project.tasks.GradleDaemonManager.access$200(GradleDaemonManager.java:22)
    at org.netbeans.gradle.project.tasks.GradleDaemonManager$2.execute(GradleDaemonManager.java:128)
    at org.jtrim.concurrent.AbstractTaskExecutorService$FunctionWrapper.execute(AbstractTaskExecutorService.java:270)
    at org.jtrim.concurrent.AbstractTaskExecutorService$TaskOfAbstractExecutor.execute(AbstractTaskExecutorService.java:340)
    at org.jtrim.concurrent.Tasks$RunOnceCancelableTask.execute(Tasks.java:342)
    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$QueuedItem.runTask(ThreadPoolTaskExecutor.java:1213)
    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker.executeTask(ThreadPoolTaskExecutor.java:1049)
    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker.run(ThreadPoolTaskExecutor.java:1179)
    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker$1.run(ThreadPoolTaskExecutor.java:998)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':run'.
    at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
    at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
    at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:100)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
    at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:46)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:58)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:237)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':run'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
    at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
    ... 42 more
Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_05\bin\java.exe'' finished with non-zero exit value 1
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:367)
    at org.gradle.process.internal.DefaultJavaExecAction.execute(DefaultJavaExecAction.java:31)
    at org.gradle.api.tasks.JavaExec.exec(JavaExec.java:74)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 70 more
</code>```

答:
there is my Gradle.build file</p>

```<code>buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.3.4'
    }
}

apply plugin: 'org.javafxports.jfxmobile'

repositories {
    jcenter()
    maven {
        url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
    }
}

mainClassName = 'com.gluonapplication.GluonApplication'

dependencies {
    compile 'com.gluonhq:charm:4.3.1'

    androidRuntime 'com.gluonhq:charm-android:4.3.1'
    iosRuntime 'com.gluonhq:charm-ios:4.3.1'
    desktopRuntime 'com.gluonhq:charm-desktop:4.3.1'
}

jfxmobile {
    downConfig {
        version = '3.2.4'
        // Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
        plugins 'display', 'lifecycle', 'statusbar', 'storage'
    }
    android {
        manifest = 'src/android/AndroidManifest.xml'
    }
    ios {
        infoPList = file('src/ios/Default-Info.plist')
        forceLinkClasses = [
                'com.gluonhq.**.*',
                'javax.annotations.**.*',
                'javax.inject.**.*',
                'javax.json.**.*',
                'org.glassfish.json.**.*'
        ]
    }
}
</code>```

Title: Gluon Application don't work

Body:
I'm new to Gluon APP developpement, when i try to run my first App in netbeans windows platform i got an Error like this.

    Issue 1

Requested project: C:\Users\Medika\Documents\NetBeansProjects\TestGluon

Stack trace:

org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.14.1-all.zip'.
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
    at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:77)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.runBuild(AsyncGradleTask.java:368)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgressIgnoreTaskDefCancel(AsyncGradleTask.java:491)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgressIgnoreTaskDefCancel(AsyncGradleTask.java:401)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgress(AsyncGradleTask.java:392)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.access$400(AsyncGradleTask.java:93)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask$BuildExecutionItem$1.run(AsyncGradleTask.java:775)
    at org.netbeans.gradle.project.tasks.GradleDaemonManager.runBlockingGradleTask(GradleDaemonManager.java:51)
    at org.netbeans.gradle.project.tasks.GradleDaemonManager.access$200(GradleDaemonManager.java:22)
    at org.netbeans.gradle.project.tasks.GradleDaemonManager$2.execute(GradleDaemonManager.java:128)
    at org.jtrim.concurrent.AbstractTaskExecutorService$FunctionWrapper.execute(AbstractTaskExecutorService.java:270)
    at org.jtrim.concurrent.AbstractTaskExecutorService$TaskOfAbstractExecutor.execute(AbstractTaskExecutorService.java:340)
    at org.jtrim.concurrent.Tasks$RunOnceCancelableTask.execute(Tasks.java:342)
    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$QueuedItem.runTask(ThreadPoolTaskExecutor.java:1213)
    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker.executeTask(ThreadPoolTaskExecutor.java:1049)
    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker.run(ThreadPoolTaskExecutor.java:1179)
    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker$1.run(ThreadPoolTaskExecutor.java:998)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':run'.
    at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
    at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
    at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:100)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
    at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:46)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:58)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:237)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':run'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
    at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
    ... 42 more
Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_05\bin\java.exe'' finished with non-zero exit value 1
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:367)
    at org.gradle.process.internal.DefaultJavaExecAction.execute(DefaultJavaExecAction.java:31)
    at org.gradle.api.tasks.JavaExec.exec(JavaExec.java:74)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 70 more

Body:
there is my Gradle.build file

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.3.4'
    }
}

apply plugin: 'org.javafxports.jfxmobile'

repositories {
    jcenter()
    maven {
        url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
    }
}

mainClassName = 'com.gluonapplication.GluonApplication'

dependencies {
    compile 'com.gluonhq:charm:4.3.1'

    androidRuntime 'com.gluonhq:charm-android:4.3.1'
    iosRuntime 'com.gluonhq:charm-ios:4.3.1'
    desktopRuntime 'com.gluonhq:charm-desktop:4.3.1'
}

jfxmobile {
    downConfig {
        version = '3.2.4'
        // Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
        plugins 'display', 'lifecycle', 'statusbar', 'storage'
    }
    android {
        manifest = 'src/android/AndroidManifest.xml'
    }
    ios {
        infoPList = file('src/ios/Default-Info.plist')
        forceLinkClasses = [
                'com.gluonhq.**.*',
                'javax.annotations.**.*',
                'javax.inject.**.*',
                'javax.json.**.*',
                'org.glassfish.json.**.*'
        ]
    }
}


来源: stackexchange

问:
SqlException: Deadlock
I have these two exceptions generated when I try to get data from SQL database in C#:

System.Data.SqlClient.SqlException:  Transaction (Process ID 97) was deadlocked on lock resources with another process and has been chosen as the deadlock victim.

OR

System.Data.SqlClient.SqlException: Transaction (Process ID 62) was deadlocked on lock resources with another process and has been chosen as the deadlock victim.

OR

System.Data.SqlClient.SqlException: Transaction (Process ID 54) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

this is the code:

```<code> using (SqlConnection con = new SqlConnection(datasource))
 {
    SqlCommand cmd = new SqlCommand("Select * from MyTable Where ID='1' ", con);
    cmd.CommandTimeout = 300;
    con.Open();
    SqlDataAdapter adapter = new SqlDataAdapter(cmd);
    DataSet ds = new DataSet();
    adapter.Fill(ds);
    con.Close();
    return ds.Tables[0];
 }
</code>```

These happened every time.

Any ideas on how these can be resolved?

答:
Not that this is going to help the deadlock issue, but you should be disposing your other IDisposable objects much like you're disposing your SqlConnection as such:

```<code>    using (SqlConnection con = new SqlConnection(datasource))
    using (SqlCommand cmd = new SqlCommand("Select * from MyTable Where ID='1' ", con))
    {
        cmd.CommandTimeout = 300;
        con.Open();
        using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))
        using (DataSet ds = new DataSet())
        {
            adapter.Fill(ds);
            return ds.Tables[0];
        }
    }
</code>```

You might be able to avoid the lock with a locking hint in your query thusly:

```<code>Select * from MyTable with (nolock) Where ID='1'
</code>```

I want to be clear though, you're allowing for reads of uncommitted data with this solution. It's a risk in a transactional system. Read this answer. Hope this helps.

ContentLicense: CC BY-SA 4.0

Title: SqlException: Deadlock

Body:
I have these two exceptions generated when I try to get data from SQL database in C#:

System.Data.SqlClient.SqlException:  Transaction (Process ID 97) was deadlocked on lock resources with another process and has been chosen as the deadlock victim.

OR

System.Data.SqlClient.SqlException: Transaction (Process ID 62) was deadlocked on lock resources with another process and has been chosen as the deadlock victim.

OR

System.Data.SqlClient.SqlException: Transaction (Process ID 54) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

this is the code:

 using (SqlConnection con = new SqlConnection(datasource))
 {
    SqlCommand cmd = new SqlCommand("Select * from MyTable Where ID='1' ", con);
    cmd.CommandTimeout = 300;
    con.Open();
    SqlDataAdapter adapter = new SqlDataAdapter(cmd);
    DataSet ds = new DataSet();
    adapter.Fill(ds);
    con.Close();
    return ds.Tables[0];
 }

These happened every time.

Any ideas on how these can be resolved?

Body:
Not that this is going to help the deadlock issue, but you should be disposing your other IDisposable objects much like you're disposing your SqlConnection as such:

    using (SqlConnection con = new SqlConnection(datasource))
    using (SqlCommand cmd = new SqlCommand("Select * from MyTable Where ID='1' ", con))
    {
        cmd.CommandTimeout = 300;
        con.Open();
        using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))
        using (DataSet ds = new DataSet())
        {
            adapter.Fill(ds);
            return ds.Tables[0];
        }
    }

You might be able to avoid the lock with a locking hint in your query thusly:

Select * from MyTable with (nolock) Where ID='1'

I want to be clear though, you're allowing for reads of uncommitted data with this solution. It's a risk in a transactional system. Read this answer. Hope this helps.


问:
How do browsers determine the encoding used?
I do understand there are 2 ways to set the encoding:

By using Content-Type header.

By using meta tags in HTML

Since Content-Type header is not mandatory and is required to be set explicitly (the server side can set it if it wants) and meta tag is also optional.

In case both of these are not present, how does the browser determine the encoding used for parsing the content?

答:
It is set in the  like this:

```<code><meta charset="UTF-8">
</code>```

I think if this is not set in the head the browser will set a default encoding.

ContentLicense: CC BY-SA 3.0

Body:
It is set in the <head> like this:

<meta charset="UTF-8">

I think if this is not set in the head the browser will set a default encoding.


问:
Compile time configuration using if-statements
In the embedded C world, we frequently store configuration details in headers so that a library can be built for a specific task, minimizing overhead and compiled size.

One example would be:

```<code>//libnameConf.h
#define LIBNAME_WAVE LIBNAME_A

typedef enum {
  LIBNAME_A,
  LIBNAME_B,
  LIBNAME_C
} libname_wave_t;
</code>```

```<code>//libname.c
double coef_arr_a[100] = {...};
double coef_arr_b[100] = {...};
double coef_arr_c[100] = {...};

if (LIBNAME_WAVE == LIBNAME_A) {
  somestruct.waveCoefs = coef_arr_a;
  //do other coef_arr_a specific stuff
} else if (LIBNAME_WAVE == LIBNAME_B) {...}
</code>```

For this particular case we're using an if-statement that the compiler will obviously collapse which is a good thing because we only want a reference to coef_arr_a so that the others won't be compiled into the binary and take up space.

Unfortunately, this yields the warning

```<code>warning: comparison between 'enum <anonymous>' and 'enum <anonymous>' [-Wenum-compare]
</code>```

Is there a better way that avoids this warning?

答:
How about using macros only instead of using variables and enumerations.

```<code>//libnameConf.h
#define LIBNAME_A
// #define LIBNAME_B // Uncomment this line and both comment the above line while changing libs.
</code>```

Then we use several conditional compilation statements like this.

```<code>//libname.c
double coef_arr_a[100] = {...};
double coef_arr_b[100] = {...};

#ifdef LIBNAME_A
  somestruct.waveCoefs = coef_arr_a;
  //do other coef_arr_a specific stuff
#endif
#ifdef LIBNAME_B
  somestruct.waveCoefs = coef_arr_b;
#endif
</code>```

Body:
In the embedded C world, we frequently store configuration details in headers so that a library can be built for a specific task, minimizing overhead and compiled size.

One example would be:

//libnameConf.h
#define LIBNAME_WAVE LIBNAME_A

typedef enum {
  LIBNAME_A,
  LIBNAME_B,
  LIBNAME_C
} libname_wave_t;

//libname.c
double coef_arr_a[100] = {...};
double coef_arr_b[100] = {...};
double coef_arr_c[100] = {...};

if (LIBNAME_WAVE == LIBNAME_A) {
  somestruct.waveCoefs = coef_arr_a;
  //do other coef_arr_a specific stuff
} else if (LIBNAME_WAVE == LIBNAME_B) {...}

For this particular case we're using an if-statement that the compiler will obviously collapse which is a good thing because we only want a reference to coef_arr_a so that the others won't be compiled into the binary and take up space.

Unfortunately, this yields the warning

warning: comparison between 'enum <anonymous>' and 'enum <anonymous>' [-Wenum-compare]

Is there a better way that avoids this warning?

Body:
How about using macros only instead of using variables and enumerations.

//libnameConf.h
#define LIBNAME_A
// #define LIBNAME_B // Uncomment this line and both comment the above line while changing libs.

Then we use several conditional compilation statements like this.

//libname.c
double coef_arr_a[100] = {...};
double coef_arr_b[100] = {...};

#ifdef LIBNAME_A
  somestruct.waveCoefs = coef_arr_a;
  //do other coef_arr_a specific stuff
#endif
#ifdef LIBNAME_B
  somestruct.waveCoefs = coef_arr_b;
#endif


问:
Filtering just a sap.m.List in Client Side SAPUI5
I'm looking for filtering just a List in Client Side and let other like table etc etc   filtering in server side
Is there any options to add to the list to filter in client side ?
Regards </p>

答:
You can use the operation mode parameter for the v2.ODataModel. This parameter can be set at model level (see the defaultOperationMode constructor parameter) or at binding level (see the operationMode constructor parameter).

Based on this parameter, the model fetches data differently:

Server mode: data is fetched as needed (paging, sorting and filtering is done on server side; each sorting, filtering or paging operation triggers a request).

Client mode: the whole collection is requested initially. All sorting, filtering and paging operations are done on the client.

Auto: a combination (based on other model settings).

To read more about the operation mode, check out the corresponding documentation: OperationMode.

If you want to use this only on one list, then you should you the binding variant:

<List items="{path: '/Collection', parameters: {operationMode: 'Client'}}">
    <StandardListItem title="{Field}" />
</List>
```


问:
Font color expression for group sums
I have data in an SSRS report that groups and provides percentages. I need to change the font color for the percentages and I can't figure out how to create the expression.

Currently I obtain the percentage with this formula:

```<code>Sum(Fields!Time_Msg.Value)/Count(Fields!Driver.Value)
</code>```

The Time_Msg field is obtained from SQL. I want the font expression to be the greater of three colors using this formula:

```<code>IIF(Fields!Time_Msg.Value = 1, "green",
IIF(Fields!Time_Msg.Value = 0
And Fields!Time.Value > Fields!TimeB.Value, "red", "yellow"))
</code>```

So essentially if the record is on time the font will be green, if the record is late then red and early then yellow.

But what do you do when providing grouping sums? If from all the records the greatest value is green, then the font for the grouping sum should be green, etc.

答:
Sorry for formatting as I'm new to this forum..

go to Textbox properties-> Font  -> Color and type an expression like this

Instead of using IIF  please try to use Switch statement.

```<code>= switch(Fields!Time_Msg.Value = 1, "green",

Fields!Time_Msg.Value = 0
And Fields!Time.Value > Fields!TimeB.Value, "red")
</code>```

Note:  Put your condition in switch statement.

Let me know if this works

Title: Font color expression for group sums

Body:
I have data in an SSRS report that groups and provides percentages. I need to change the font color for the percentages and I can't figure out how to create the expression.

Currently I obtain the percentage with this formula:

Sum(Fields!Time_Msg.Value)/Count(Fields!Driver.Value)

The Time_Msg field is obtained from SQL. I want the font expression to be the greater of three colors using this formula:

IIF(Fields!Time_Msg.Value = 1, "green",
IIF(Fields!Time_Msg.Value = 0
And Fields!Time.Value > Fields!TimeB.Value, "red", "yellow"))

So essentially if the record is on time the font will be green, if the record is late then red and early then yellow.

But what do you do when providing grouping sums? If from all the records the greatest value is green, then the font for the grouping sum should be green, etc.

Body:
Sorry for formatting as I'm new to this forum..

go to Textbox properties-> Font  -> Color and type an expression like this

Instead of using IIF  please try to use Switch statement.

= switch(Fields!Time_Msg.Value = 1, "green",

Fields!Time_Msg.Value = 0
And Fields!Time.Value > Fields!TimeB.Value, "red")

Note:  Put your condition in switch statement.

Let me know if this works


问:
persist/update collection of data into database using hibernate
I am newbie to Hibernate framework and I am curious about the way persist and update work.

Currently in my project when I would like to persist or update collection of data into database, I am doing it one by one via looping method. For instance,

```<code>    public persistData(){
       List<Person> personList = new ArrayList<>();
       for(Person person : personList){
            session.persist(person);
       }
    }
</code>```

Is it possible to, for example,

```<code>    session.persist(personList);
</code>```

Or there is anyway else I can persist/update collection of data at once without looping?

Editted:
I have found Hibernate Batch Processing in
How to insert multiple rows into database using hibernate?
and Best way to insert a good amount of records in hibernate

I am developing generic class for persist/update/delete data with hibernate, should I provide the method with

```<code>    public void (List<T> addedItemList)
</code>```

or

```<code>    public void (T addedItem)
</code>```

For my understanding, bulk persist should be done with large amount of transactions right? If some times there is only 1 or 2 objects to be persisted, is batch processing still appropriate?

答:
The main point here is to begin the transaction, persist all, and then commit.  Try not using the @Transaction since you are doing it with the code. </p>

```<code>                EntityManager em = entityManagerProvider.get();
//                em.clear();//remove this if caching is necessary
                em.getTransaction().begin();
                for(buildings b:buildingsArray) {
                     em.persist(b);
                }
                em.getTransaction().commit();
</code>```

Body:
I am newbie to Hibernate framework and I am curious about the way persist and update work.

Currently in my project when I would like to persist or update collection of data into database, I am doing it one by one via looping method. For instance,

    public persistData(){
       List<Person> personList = new ArrayList<>();
       for(Person person : personList){
            session.persist(person);
       }
    }

Is it possible to, for example,

    session.persist(personList);

Or there is anyway else I can persist/update collection of data at once without looping?

Editted:
I have found Hibernate Batch Processing in
How to insert multiple rows into database using hibernate?
and Best way to insert a good amount of records in hibernate

I am developing generic class for persist/update/delete data with hibernate, should I provide the method with

    public void (List<T> addedItemList)

or

    public void (T addedItem)

For my understanding, bulk persist should be done with large amount of transactions right? If some times there is only 1 or 2 objects to be persisted, is batch processing still appropriate?

Body:
The main point here is to begin the transaction, persist all, and then commit.  Try not using the @Transaction since you are doing it with the code.

                EntityManager em = entityManagerProvider.get();
//                em.clear();//remove this if caching is necessary
                em.getTransaction().begin();
                for(buildings b:buildingsArray) {
                     em.persist(b);
                }
                em.getTransaction().commit();


问:
Converting a Pandas GroupBy output from Series to DataFrame
I'm starting with input data like this

```<code>df1 = pandas.DataFrame( {
    "Name" : ["Alice", "Bob", "Mallory", "Mallory", "Bob" , "Mallory"] ,
    "City" : ["Seattle", "Seattle", "Portland", "Seattle", "Seattle", "Portland"] } )
</code>```

Which when printed appears as this:

```<code>   City     Name
0   Seattle    Alice
1   Seattle      Bob
2  Portland  Mallory
3   Seattle  Mallory
4   Seattle      Bob
5  Portland  Mallory
</code>```

Grouping is simple enough:

```<code>g1 = df1.groupby( [ "Name", "City"] ).count()
</code>```

and printing yields a GroupBy object:

```<code>                  City  Name
Name    City
Alice   Seattle      1     1
Bob     Seattle      2     2
Mallory Portland     2     2
        Seattle      1     1
</code>```

But what I want eventually is another DataFrame object that contains all the rows in the GroupBy object. In other words I want to get the following result:

```<code>                  City  Name
Name    City
Alice   Seattle      1     1
Bob     Seattle      2     2
Mallory Portland     2     2
Mallory Seattle      1     1
</code>```

I can't quite see how to accomplish this in the pandas documentation. Any hints would be welcome.

答:
Maybe I misunderstand the question but if you want to convert the groupby back to a dataframe you can use .to_frame(). I wanted to reset the index when I did this so I included that part as well.

example code unrelated to question

```<code>df = df['TIME'].groupby(df['Name']).min()
df = df.to_frame()
df = df.reset_index(level=['Name',"TIME"])
</code>```

Body:
I'm starting with input data like this

df1 = pandas.DataFrame( {
    "Name" : ["Alice", "Bob", "Mallory", "Mallory", "Bob" , "Mallory"] ,
    "City" : ["Seattle", "Seattle", "Portland", "Seattle", "Seattle", "Portland"] } )

Which when printed appears as this:

   City     Name
0   Seattle    Alice
1   Seattle      Bob
2  Portland  Mallory
3   Seattle  Mallory
4   Seattle      Bob
5  Portland  Mallory

Grouping is simple enough:

g1 = df1.groupby( [ "Name", "City"] ).count()

and printing yields a GroupBy object:

                  City  Name
Name    City
Alice   Seattle      1     1
Bob     Seattle      2     2
Mallory Portland     2     2
        Seattle      1     1

But what I want eventually is another DataFrame object that contains all the rows in the GroupBy object. In other words I want to get the following result:

                  City  Name
Name    City
Alice   Seattle      1     1
Bob     Seattle      2     2
Mallory Portland     2     2
Mallory Seattle      1     1

I can't quite see how to accomplish this in the pandas documentation. Any hints would be welcome.

Body:
Maybe I misunderstand the question but if you want to convert the groupby back to a dataframe you can use .to_frame(). I wanted to reset the index when I did this so I included that part as well.

example code unrelated to question

df = df['TIME'].groupby(df['Name']).min()
df = df.to_frame()
df = df.reset_index(level=['Name',"TIME"])


问:
Deletion a Node from binary search tree with 2 nodes, with a different method possible?
I have searched everywhere for this but there is only one method :

find predecessor (or successor) of node to delete

replace node with predecessor (or successor)

delete predecessor (or successor)

But i feel we can also do in this way :

pulloff the right(or left) element to the node to delete i.e just replace the
  element to delete with right (or left) element and keep doing it till we encounter
  the leaf and then delete the leaf.
  In brief, keep replacing element to delete with its right(or left) element and keep doing it till we reach the leaf , and then delete the leaf.

So Is this method right ?

答:
Unfortunately CoderAj, the solution provided by Vikhram is the correct way to delete a node in BST.
Your approach sounds good, but fails in the first replace itself.

Let's work out your approach on a tree.

```<code>                          8
                  5               25
            3          7     23        30
                    6           24  27    35
</code>```

Let us delete the root i.e. 8

Step 1:

```<code>                      25             //replaced 8 by 25
              5               25
        3          7     23        30
                6           24  27    35
</code>```

23 and 24 are less than 25, and still they lie in its right sub-tree.

Thus, your final tree would look like this

```<code>                      25
              5               30
        3          7     23        35
                6           24  27
</code>```

which does not look like a Binary Search tree.

Body:
Unfortunately CoderAj, the solution provided by Vikhram is the correct way to delete a node in BST.
Your approach sounds good, but fails in the first replace itself.

Let's work out your approach on a tree.

                          8
                  5               25
            3          7     23        30
                    6           24  27    35

Let us delete the root i.e. 8

Step 1:

                      25             //replaced 8 by 25
              5               25
        3          7     23        30
                6           24  27    35

23 and 24 are less than 25, and still they lie in its right sub-tree.

Thus, your final tree would look like this

                      25
              5               30
        3          7     23        35
                6           24  27

which does not look like a Binary Search tree.


问:
If else condition in MSSQL
Suppose I have serial number, test name and few other columns, i want to write a condition if TESTNAME is null for a particular serial number then set the TESTNAME to blank else perform inner join

```<code>SELECT
    (A.PTNUMBER + '-' +A.SL_NO) AS ENUMBER,
    D.ENGINEER AS REQ, D.DATETIME as "DATE",
    (select Value
     from DROPDOWN
     where B.TEST_NAME=CONVERT(VARCHAR,DropdownID)) TESTNAME,
    TABLE_NAME AS TABLETD
FROM INSPECTION D
INNER JOIN TABLEA A ON D.ENGID = CONVERT(VARCHAR,A.EN_ID)
INNER JOIN TABLEB B ON B.ENGID = CONVERT(VARCHAR,A.EN_ID)
INNER JOIN TABLEC C ON C.ENGID = CONVERT(VARCHAR,A.EN_ID)
</code>```

答:
You could combine a case expression and coalesce() along with your join to choose the value you want to return.

```<code>select serial_number, ...
  ,case when coalesce(testname,'') <> ''
          then t2.testname
        else coalesce(testname,'') end
from t
  inner join t2
    on ...
</code>```

You can use isnull() or coalesce() in sql server to return a different value to replace null.

```<code>select isnull(testname,'')
</code>```

or

```<code>select coalesce(testname,'')
</code>```

The main difference between the two is that coalesce() can support more than 2 parameters, and it selects the first one that is not null. More differences between the two are answered here.

```<code>select coalesce(testname,testname2,'')
</code>```

coalesce() is also standard ANSI sql, so you will find it in most RDBMS. isnull() is specific to sql server.

Reference:

isnull() - msdn

coalesce() - msdn

Title: If else condition in MSSQL

Body:
Suppose I have serial number, test name and few other columns, i want to write a condition if TESTNAME is null for a particular serial number then set the TESTNAME to blank else perform inner join

SELECT
    (A.PTNUMBER + '-' +A.SL_NO) AS ENUMBER,
    D.ENGINEER AS REQ, D.DATETIME as "DATE",
    (select Value
     from DROPDOWN
     where B.TEST_NAME=CONVERT(VARCHAR,DropdownID)) TESTNAME,
    TABLE_NAME AS TABLETD
FROM INSPECTION D
INNER JOIN TABLEA A ON D.ENGID = CONVERT(VARCHAR,A.EN_ID)
INNER JOIN TABLEB B ON B.ENGID = CONVERT(VARCHAR,A.EN_ID)
INNER JOIN TABLEC C ON C.ENGID = CONVERT(VARCHAR,A.EN_ID)

Body:
You could combine a case expression and coalesce() along with your join to choose the value you want to return.

select serial_number, ...
  ,case when coalesce(testname,'') <> ''
          then t2.testname
        else coalesce(testname,'') end
from t
  inner join t2
    on ...

You can use isnull() or coalesce() in sql server to return a different value to replace null.

select isnull(testname,'')

or

select coalesce(testname,'')

The main difference between the two is that coalesce() can support more than 2 parameters, and it selects the first one that is not null. More differences between the two are answered here.

select coalesce(testname,testname2,'')

coalesce() is also standard ANSI sql, so you will find it in most RDBMS. isnull() is specific to sql server.

Reference:

isnull() - msdn

coalesce() - msdn


问:
X11 Forwarding under Windows?
Which X11 forwarding under Windows solution do you recommmend ?
I'd like to get the X11 display (lxde) from my dedicated hosting Ubuntu Server
on my Windows home computer so I can remote administrate (I'm a linux newbie).</p>

答:
Use FreeNX ( http://freenx.berlios.de/ ). Ten minutes for tuning and you can run your X11-session through ssh.

If you want forward single X11-application, use mingw and putty.

ContentLicense: CC BY-SA 2.5

Title: X11 Forwarding under Windows?


问:
Publish npm from jenkins
I am new to jenkins. I want to know what is equivalent of
"npm publish --registry..." in Jenkins.

I have configured Artifactory plugin in Jenkins, but I don't know how to use that in my job.

When I do npm publish manually it automatically creates .tgz file with correct version number and add it to Artifactory.

How can I accomplish the same?

答:
The Jenkins Artifactory plugin allows you to define the Artifactory server.

There is a deploy maven artifact section, but you could also simply consider a basic build step as an "Execute Windows batch command" or an "Execute shell" (for Linux), in which you can type the same command as the one you are typing manually.

You only need to make sure the environment variables used during that step by the account running Jenkins are the same as the account you are using when typing said command.

Title: Publish npm from jenkins


问:
MailKit dotnet core on Ubuntu 16.04
Running a Kestrel server managed by systemd using www-data user. When trying to send an email using MailKit with TLS enabled I get the following error message:

System.UnauthorizedAccessException: Access to the path '/var/www/.dotnet/corefx/cryptography/crls' is denied. ---> System.IO.IOException: Permission denied

One solution possibly is to set a home directory for www-data, but that seems counter intuitive.

答:
The call stack indicates that the code (MailKit or one of its dependencies) is trying to build and access a certificate cache.

You can manually create the directory and grant the necessary permissions.

Don't modify /var top directory as that's crazy.

First, you need to recursively create the directory:

```<code>mkdir -p /var/www/.dotnet/corefx/cryptography/crls
</code>```

and give rights to www-data group

(if this is the group that runs your service)

```<code>sudo chgrp www-data /var/www/.dotnet/corefx/cryptography/crls
</code>```

Title: MailKit dotnet core on Ubuntu 16.04

Body:
The call stack indicates that the code (MailKit or one of its dependencies) is trying to build and access a certificate cache.

You can manually create the directory and grant the necessary permissions.

Don't modify /var top directory as that's crazy.

First, you need to recursively create the directory:

mkdir -p /var/www/.dotnet/corefx/cryptography/crls

and give rights to www-data group

(if this is the group that runs your service)

sudo chgrp www-data /var/www/.dotnet/corefx/cryptography/crls


问:
How to specify date and duration in one expression
I am trying to find notation for periodic event in ISO8601 format.
Can it be done as one expression?

For example, event starting at March 31 2017 at 17:25 with periodicity 1 hour:

```<code>2017-03-31T17:25:00Z/PT1H
</code>```

Trying to parse this expression to Duration in Java:

```<code>java.time.Duration d = java.time.Duration.parse("2017-03-31T17:25:00Z/PT1H");
</code>```

results in exception.

答:
In Iso-8601, the expression "2017-03-31T17:25:00Z/PT1H" is not a recurrent interval but just a normal instant/moment-interval. If you look for recurrent intervals then you have to prefix it with "Rn/" where "n" is a positive integer (optional). Standard Java has no support for intervals so you have to either code your own workaround with string processing and partial parsing or you use a 3rd-party library like my one (Time4J):

```<code>MomentInterval interval = MomentInterval.parseISO("2017-03-31T17:25:00Z/PT1H");
System.out.println(interval); // [2017-03-31T17:25:00Z/2017-03-31T18:25:00Z)
</code>```

See also the Javadoc for moment intervals. For recurrent intervals please have a look at this class IsoRecurrence.

Interoperability note: You can easily convert the Moment-components to java.time.Instant via the method toTemporalAccessor().

Body:
I am trying to find notation for periodic event in ISO8601 format.
Can it be done as one expression?

For example, event starting at March 31 2017 at 17:25 with periodicity 1 hour:

2017-03-31T17:25:00Z/PT1H

Trying to parse this expression to Duration in Java:

java.time.Duration d = java.time.Duration.parse("2017-03-31T17:25:00Z/PT1H");

results in exception.

Body:
In Iso-8601, the expression "2017-03-31T17:25:00Z/PT1H" is not a recurrent interval but just a normal instant/moment-interval. If you look for recurrent intervals then you have to prefix it with "Rn/" where "n" is a positive integer (optional). Standard Java has no support for intervals so you have to either code your own workaround with string processing and partial parsing or you use a 3rd-party library like my one (Time4J):

MomentInterval interval = MomentInterval.parseISO("2017-03-31T17:25:00Z/PT1H");
System.out.println(interval); // [2017-03-31T17:25:00Z/2017-03-31T18:25:00Z)

See also the Javadoc for moment intervals. For recurrent intervals please have a look at this class IsoRecurrence.

Interoperability note: You can easily convert the Moment-components to java.time.Instant via the method toTemporalAccessor().


问:
Need to associate unique integer value with classes
Alright, so I have a base class which we'll call TFruit. From this there are various descendants like TApple, TOrange and so on. I need to save the properties of the descendant classes to a file.

In order to be able to create the right class when loading the data, each class needs to have an ID that I write to the file before writing the actual data. Currently, I've come up with the following way of doing it:

```<code>type
  TFruit = class
    const ID = 0;
  end;

  TApple = class(TFruit)
    const ID = 1;
  end;

  TOrange = class(TFruit)
    const ID = 2;
  end;
</code>```

Testing this, I found out that I need to be super careful which class I declare. If I use this:

```<code>  var Fruit: TFruit;

  Fruit := TOrange.Create;
</code>```

...then Fruit.ID will return zero. However, declaring Fruit as a TOrange will yield the expected result Fruit.ID = 2 (anyone know why?)

So basically, am I doing this right or is there a better way to do it? Having to create a class function and return a value from there seems very ugly by comparison (extra function declaration, implementation and code).

答:
An easier to maintain solution would be to create a mapping class where you register all classes you'd like to convert to an integer.

Advantages

Ability to detect duplicate registrations.

Independent of your class structure.

Includes the transformation back to a classname.

Usage

```<code>  RegisterClass.Register(0, TFruit);
  RegisterClass.Register(1, TApple);
  RegisterClass.Register(2, TOrange);
</code>```

Implementation

```<code>  TRegisterClass = class
  private
    FList: TStringList;
  public
    function FindID(AClass: TClass): Integer;
    function FindClassName(const ID: Integer): string;
    procedure Register(const ID: Integer; AClass: TClass);
  end;
  ...
  function TRegisterClass.FindID(AClass: TClass): Integer;
  begin
    Assert(Assigned(AClass));

    Result := -1;
    if FList.IndexOf(AClass.ClassName) <> -1 then
      Result := Integer(FList.Objects[FList.IndexOf(AClass.ClassName)]);
  end;

  function TRegisterClass.FindClassName(const ID: Integer): string;
  var
    I: Integer;
  begin
    Result := EmptyStr;
    for I := 0 to Pred(FList.Count) do
      if Integer(FList.Objects[I]) = ID then
      begin
        Result := FList[I];
        Exit;
      end;
  end;

  procedure TRegisterClass.Register(const ID: Integer; AClass: TClass);
  begin
    if IsAlreadyRegistered(ID) then
      raise Exception.Create('Duplicate ID Registration')
    else if IsAlreadyRegistered(AClass) then
      raise Exception.Create('Duplicate Class Registration');

    FList.AddObject(AClass.ClassName, Pointer(ID));
  end;
</code>```

Please note that there are better structures to map a String to an Integer. Writing this without a compiler and don't knowing many basic structures beyond Delphi5, I've chosen an obvious implementation.

Note that the IsAlreadyRegistered overloaded functions still have to be written

Body:
Alright, so I have a base class which we'll call TFruit. From this there are various descendants like TApple, TOrange and so on. I need to save the properties of the descendant classes to a file.

In order to be able to create the right class when loading the data, each class needs to have an ID that I write to the file before writing the actual data. Currently, I've come up with the following way of doing it:

type
  TFruit = class
    const ID = 0;
  end;

  TApple = class(TFruit)
    const ID = 1;
  end;

  TOrange = class(TFruit)
    const ID = 2;
  end;

Testing this, I found out that I need to be super careful which class I declare. If I use this:

  var Fruit: TFruit;

  Fruit := TOrange.Create;

...then Fruit.ID will return zero. However, declaring Fruit as a TOrange will yield the expected result Fruit.ID = 2 (anyone know why?)

So basically, am I doing this right or is there a better way to do it? Having to create a class function and return a value from there seems very ugly by comparison (extra function declaration, implementation and code).

Body:
An easier to maintain solution would be to create a mapping class where you register all classes you'd like to convert to an integer.

Advantages

Ability to detect duplicate registrations.

Independent of your class structure.

Includes the transformation back to a classname.

Usage

  RegisterClass.Register(0, TFruit);
  RegisterClass.Register(1, TApple);
  RegisterClass.Register(2, TOrange);

Implementation

  TRegisterClass = class
  private
    FList: TStringList;
  public
    function FindID(AClass: TClass): Integer;
    function FindClassName(const ID: Integer): string;
    procedure Register(const ID: Integer; AClass: TClass);
  end;
  ...
  function TRegisterClass.FindID(AClass: TClass): Integer;
  begin
    Assert(Assigned(AClass));

    Result := -1;
    if FList.IndexOf(AClass.ClassName) <> -1 then
      Result := Integer(FList.Objects[FList.IndexOf(AClass.ClassName)]);
  end;

  function TRegisterClass.FindClassName(const ID: Integer): string;
  var
    I: Integer;
  begin
    Result := EmptyStr;
    for I := 0 to Pred(FList.Count) do
      if Integer(FList.Objects[I]) = ID then
      begin
        Result := FList[I];
        Exit;
      end;
  end;

  procedure TRegisterClass.Register(const ID: Integer; AClass: TClass);
  begin
    if IsAlreadyRegistered(ID) then
      raise Exception.Create('Duplicate ID Registration')
    else if IsAlreadyRegistered(AClass) then
      raise Exception.Create('Duplicate Class Registration');

    FList.AddObject(AClass.ClassName, Pointer(ID));
  end;

Please note that there are better structures to map a String to an Integer. Writing this without a compiler and don't knowing many basic structures beyond Delphi5, I've chosen an obvious implementation.

Note that the IsAlreadyRegistered overloaded functions still have to be written


问:
How to install script in existing HDI cluster on Azure using ARM template
I have created HDI cluster using ARM template. Now HDI cluster is running. Now I want to install my shell script on existing HDI cluster.

I see most of the examples has Installing HDIcluster + ScriptAction in the same template. Refer https://github.com/Azure/azure-quickstart-templates/blob/master/hdinsight-linux-run-script-action/azuredeploy.json

How do I install custom script on existing HDI cluster using ARM template?

答:
An ARM template is for cluster creation or the addition of new nodes to the cluster.

You'll want to run your script action using PowerShell, AzureCLI, or the portal. Here is how you would do it in PowerShell:

```<code>    # LOGIN TO ZURE
 Login-AzureRmAccount

 # PROVIDE VALUES FOR THESE VARIABLES
 $clusterName = "<HDInsightClusterName>"            # HDInsight cluster name
 $saName = "<ScriptActionName>"                  # Name of the script action
 $saURI = "<URI to the script>"                  # The URI where the script is located

$nodeTypes = "headnode", "workernode"

Submit-AzureRmHDInsightScriptAction -ClusterName $clusterName -Name $saName -Uri $saURI -NodeTypes $nodeTypes -PersistOnSucces
</code>```

Resources:
https://learn.microsoft.com/en-us/azure/hdinsight/hdinsight-hadoop-customize-cluster-linux

Body:
An ARM template is for cluster creation or the addition of new nodes to the cluster.

You'll want to run your script action using PowerShell, AzureCLI, or the portal. Here is how you would do it in PowerShell:

    # LOGIN TO ZURE
 Login-AzureRmAccount

 # PROVIDE VALUES FOR THESE VARIABLES
 $clusterName = "<HDInsightClusterName>"            # HDInsight cluster name
 $saName = "<ScriptActionName>"                  # Name of the script action
 $saURI = "<URI to the script>"                  # The URI where the script is located

$nodeTypes = "headnode", "workernode"

Submit-AzureRmHDInsightScriptAction -ClusterName $clusterName -Name $saName -Uri $saURI -NodeTypes $nodeTypes -PersistOnSucces

Resources:
https://learn.microsoft.com/en-us/azure/hdinsight/hdinsight-hadoop-customize-cluster-linux


问:
Typescript Class Becoming Empty
Given a specific setup in typescript I end up at runtime with empty class objects in javascript. The setup is simply 2 classes referencing each other will equal one of them being empty in the scope of the other. I know how to avoid it (by introducing a third class in between the 2) but I'm curious as to why it happens and is there a way to still make those cross references and still have a working code. I tried tons of setup to try to make it work so here's what I found.

Setup: each class in its own module (module names and class names irrelevant)
ClassA is our main entry:

// ClassA

```<code>import ClassB = require('ClassB');
import ClassC = require('ClassC');

class ClassA
{
    constructor()
    {
        console.log(ClassC.TEST);// shows 1
        new ClassB();// shows null
        console.log(ClassC.TEST);// shows 1
    }
}
export = ClassA;
</code>```

// ClassB (in different module)

```<code>import ClassC = require('ClassC');

class ClassB
{
    public static ClassBRef:any;

    constructor()
    {
        console.log(ClassC.TEST);// in this scope ClassC is an empty object with no properties
    }
}
export = ClassB;
</code>```

// ClassC (in different module)

```<code>import ClassB = require('ClassB');

class ClassC
{
    public static TEST:number = 1;

    constructor()
    {
        ClassB.ClassBRef;
    }
}
export = ClassC;
</code>```

Because ClassB references ClassC and ClassC references ClassB here's the result: ClassC within ClassA scope exist without problem but within ClassB scope, ClassC is an empty object at runtime with no properties. In other words in typescript everything is fine but javascript will not have it. Changing module names, location, class names, using static or instance scope, in constructor or instance methods or static methods, etc .. makes no difference and ClassC is always empty in ClassB scope.

Like I said the fix is to have a third class handling communication with the 2 faulty classes (so at least one of the 2 classes has NO references to the second one) but again my question is, how to do it without needing a third class and without removing the cross reference between the 2 classes?

答:
You have a circular reference between ClassB and ClassC.  In any JavaScript environment it's really hard to resolve these problems.

You have two scenarios basically.

ClassB is required.
ClassC is required.
ClassC attempts to require ClassB.

In this case since ClassB is still being built (it hasn't exported anything) then it will be undefined.  The reverse can happen if ClassC is loaded first.

There is a way you can solve it, without extra files however it "feels" wrong.

```<code>import containerC = require('ClassC');
// or import * as containerC from 'ClassC'; in ES6 syntax

export class ClassB
{
    public static ClassBRef:any;

    constructor()
    {
        console.log(containerC.ClassC.TEST);// in this scope ClassC is an empty object with no properties
    }
}

// ClassC
import containerB = require('ClassB');

export class ClassC
{
    public static TEST:number = 1;

    constructor()
    {
        containerB.ClassB.ClassBRef;
    }
}
</code>```

This is possible because the value returned by require will be populated by the time the constructor of either class runs.

You cannot use export = X syntax, you must use the named export syntax.  You also cannot try to access either class until after the module loads. So it must be in a constructor or function that is called after the class is exported.

Title: Typescript Class Becoming Empty

Body:
Given a specific setup in typescript I end up at runtime with empty class objects in javascript. The setup is simply 2 classes referencing each other will equal one of them being empty in the scope of the other. I know how to avoid it (by introducing a third class in between the 2) but I'm curious as to why it happens and is there a way to still make those cross references and still have a working code. I tried tons of setup to try to make it work so here's what I found.

Setup: each class in its own module (module names and class names irrelevant)
ClassA is our main entry:

// ClassA

import ClassB = require('ClassB');
import ClassC = require('ClassC');

class ClassA
{
    constructor()
    {
        console.log(ClassC.TEST);// shows 1
        new ClassB();// shows null
        console.log(ClassC.TEST);// shows 1
    }
}
export = ClassA;

// ClassB (in different module)

import ClassC = require('ClassC');

class ClassB
{
    public static ClassBRef:any;

    constructor()
    {
        console.log(ClassC.TEST);// in this scope ClassC is an empty object with no properties
    }
}
export = ClassB;

// ClassC (in different module)

import ClassB = require('ClassB');

class ClassC
{
    public static TEST:number = 1;

    constructor()
    {
        ClassB.ClassBRef;
    }
}
export = ClassC;

Because ClassB references ClassC and ClassC references ClassB here's the result: ClassC within ClassA scope exist without problem but within ClassB scope, ClassC is an empty object at runtime with no properties. In other words in typescript everything is fine but javascript will not have it. Changing module names, location, class names, using static or instance scope, in constructor or instance methods or static methods, etc .. makes no difference and ClassC is always empty in ClassB scope.

Like I said the fix is to have a third class handling communication with the 2 faulty classes (so at least one of the 2 classes has NO references to the second one) but again my question is, how to do it without needing a third class and without removing the cross reference between the 2 classes?

Body:
You have a circular reference between ClassB and ClassC.  In any JavaScript environment it's really hard to resolve these problems.

You have two scenarios basically.

ClassB is required.
ClassC is required.
ClassC attempts to require ClassB.

In this case since ClassB is still being built (it hasn't exported anything) then it will be undefined.  The reverse can happen if ClassC is loaded first.

There is a way you can solve it, without extra files however it "feels" wrong.

import containerC = require('ClassC');
// or import * as containerC from 'ClassC'; in ES6 syntax

export class ClassB
{
    public static ClassBRef:any;

    constructor()
    {
        console.log(containerC.ClassC.TEST);// in this scope ClassC is an empty object with no properties
    }
}

// ClassC
import containerB = require('ClassB');

export class ClassC
{
    public static TEST:number = 1;

    constructor()
    {
        containerB.ClassB.ClassBRef;
    }
}

This is possible because the value returned by require will be populated by the time the constructor of either class runs.

You cannot use export = X syntax, you must use the named export syntax.  You also cannot try to access either class until after the module loads. So it must be in a constructor or function that is called after the class is exported.


问:
CSS: Inline Div with auto width pushes down when the text is long
I'm facing a css problem realted to inline-div.
When the text(or sentece) is long, the inline div pushes down as on the image below:

But, when I add a line break, It works perfectly.

How can I make it work without having to use
?

The main content to be posted is dynamic and it also needs to be responsive.
Thanks

Please Note: This is a simplified version of my actual code. In the
  actual code the width of the main container is 100%

HTML

```<code><div id="container">
<div id="firstDiv">FIRST</div>
<div id="secondDiv">SECOND</div>
<div id="thirdDiv">THIRD
<br>some more content<br> some more content
</div>
</code>```

CSS

```<code>body{
    width: 350px;
    margin: 0px auto;
}
#container {
    border: 15px solid orange;
}
#firstDiv{
    border: 10px solid brown;
    display:inline-block;
    width: 70px;
    overflow:hidden;
    vertical-align:top;
}
#secondDiv{
    border: 10px solid skyblue;
    float:left;
    width: 70px;
}
#thirdDiv{
    display:inline-block;
    border: 5px solid yellowgreen;
    vertical-align:top;
}
</code>```

答: use : white-space: nowrap; for the div containing the long sentences.

Body:
I'm facing a css problem realted to inline-div.
When the text(or sentece) is long, the inline div pushes down as on the image below:

But, when I add a line break, It works perfectly.

How can I make it work without having to use
?

The main content to be posted is dynamic and it also needs to be responsive.
Thanks

Please Note: This is a simplified version of my actual code. In the
  actual code the width of the main container is 100%

HTML

FIRST

SECOND

THIRD

some more content
 some more content

CSS

body{
    width: 350px;
    margin: 0px auto;
}
#container {
    border: 15px solid orange;
}
#firstDiv{
    border: 10px solid brown;
    display:inline-block;
    width: 70px;
    overflow:hidden;
    vertical-align:top;
}
#secondDiv{
    border: 10px solid skyblue;
    float:left;
    width: 70px;
}
#thirdDiv{
    display:inline-block;
    border: 5px solid yellowgreen;
    vertical-align:top;
}


问:
Error after installing Visual Studio 2017
Visual studio 2017 community edition installs fine with no error messages on my 64-bit windows 7 desktop.

I am able to start a new project for example a new windows forms c# project.

However when pressing the start button as pictured below the following error message appears, I have tried to repair and uninstall and reinstall visual studio however that has not changed anything.

I am able to run (and therefore compile successfully) by pressing ctrl+f5.

Is there anything else I can try, and is there a link to a previous stable version of visual studio as an alternative please?

For reference this problem has occured and been reported here:
Visual studio 2015 debugger "not installed properly" & "process cannot acces file - file in use" build error   (I also tried the fix here but this did not work either)
Here too: https://developercommunity.visualstudio.com/content/problem/26630/the-debugger-is-not-properly-installed-cannot-debu.html (this seems to be the latest issue log)

VS2017: The debugger is not properly installed. Cannot debug the requested type of code

There appears to be a fix here but I'm not sure how to piece together what downloads I need, from the answer here it looks like there is some component required from VS2015 to allow VS2017 to work: https://social.msdn.microsoft.com/Forums/vstudio/en-US/a75214be-4720-4134-aca8-f26751ea18a1/community-vs-2017-on-windows10-64-bit-debugger-is-not-properly-installed?forum=vsdebug

Update: I managed to install visual studio express 2015 and that works fine, although it didn't fix the current issue.

答:
Try installing a more beefy version of Visual Studio 2015, such as Visual Studio 2015 Professional. That is what worked for me.

This is definitely a bug with the installation process of Visual Studio 2017 on systems that have not previously had Visual Studio installed on them.


问:
How to place widgets next to each other?
I am building a simple GUI program to manage priorities. I am having trouble placing button widgets next to each other. It is somehow logical to me that if I want three buttons (Add, Remove, Edit) to place next to each other, I should use column = 0 for Add, column = 1 for Remove and column = 2 for Edit. Anyway, this is what I get:

Here is the createWidgets function:

```<code>def createWidgets(self):

    listBox = Listbox(width = 30).grid(row=1, column = 0)

    Button(self.root,
                text = "Add",
                command = self.addItem).grid(row = 2, column = 1, sticky = W)

    Button(self.root,
           text="Remove",
           command = self.removeItem).grid(row = 2, column = 2, sticky = W)

    Button(self.root,
        text="Edit",
        command = self.editItem).grid(row = 2, column = 3, sticky = W)

    textBox = Text(height = 10, width = 30).grid(row = 3)
</code>```

答:
Use the columnspan option for:

```<code>textBox = Text(height = 10, width = 30).grid(row = 3, column=0, columnspan=3) # specify the column also
</code>```

and

```<code>listBox = Listbox(width = 30).grid(row=1, column = 0, columnspan=3)
</code>```

Body:
I am building a simple GUI program to manage priorities. I am having trouble placing button widgets next to each other. It is somehow logical to me that if I want three buttons (Add, Remove, Edit) to place next to each other, I should use column = 0 for Add, column = 1 for Remove and column = 2 for Edit. Anyway, this is what I get:

Here is the createWidgets function:

def createWidgets(self):

    listBox = Listbox(width = 30).grid(row=1, column = 0)

    Button(self.root,
                text = "Add",
                command = self.addItem).grid(row = 2, column = 1, sticky = W)

    Button(self.root,
           text="Remove",
           command = self.removeItem).grid(row = 2, column = 2, sticky = W)

    Button(self.root,
        text="Edit",
        command = self.editItem).grid(row = 2, column = 3, sticky = W)

    textBox = Text(height = 10, width = 30).grid(row = 3)

Body:
Use the columnspan option for:

textBox = Text(height = 10, width = 30).grid(row = 3, column=0, columnspan=3) # specify the column also

and

listBox = Listbox(width = 30).grid(row=1, column = 0, columnspan=3)


问:
Define a pointer with an arbitrary span
If I have a large array where the data streams are interleaved in some complex fashion, can I define a pointer p such that p + 1 is some arbitrary offset b bytes.

For example lets say I have 1,000,000 ints, 4 bytes each.

```<code>int* p_int = my_int_array;
</code>```

This gives me *(p_int+1) == my_int_array[1] (moves 4 bytes)

I am looking for something like

```<code>something_here(b)* big_span_p_int = my_int_array;
</code>```

which would make *(big_span_p_int + 1) == my_int_array[b] (moves 4*b or b bytes, whichever is possible or easier)

Is this possible? easy?

Thanks for the help.

EDIT:

b is compile time variable.

答:
Using some of your code. There is no need to declare an additional pointer/array. Applying pointer arithmetic on p_int is enough to  traverse and reach the number value you are seeking.

Let's look at this example:

```<code>    int main() {
        int my_int_array[5] {1,2,3,4,5};
        int* p_int = my_int_array;
        int b = 2;
        std::cout << *(p_int + b) << std::endl; // Output is 3, because  *p_int == my_int_array[0], so my_int_array[2] will give you the third index of the array.
    }
</code>```

Graphically represented:

```<code>Memory Address | Stored Value (values or memory addresses)
----------------------------------------------
0              |     .....
1              |     .....
2              |     .....
3              |     .....
4              |     .....
5              |     .....
6              |     .....
7              |     .....
8              |     .....
.              |     .....
.              |     .....
.              |     .....
n-1            |     .....
</code>```

Imagine the memory as being a very big array in which you can access positions by its memory address (in this case we've simplified the addresses to natural numbers. In reality they're hexadecimal values). "n" is the total amount (or size) of the memory. Since Memory counts and starts in 0, size is equivalent to n-1.

Using the example above:

1. When you invoke:

```<code>int my_int_array[5] {1,2,3,4,5};
</code>```

The Operating System and the C++ compiler allocates the integer array memory statically for you, but we can think that our memory has been changed. E.g. Memory address 2 (decided by the compiler) now has our first value of my_int_array.

```<code>Memory Address | Name - Stored Value (values or memory addresses)
-----------------------------------------------------
0              |     .....
1              |     .....
2              |     my_int_array[0] = 1
3              |     my_int_array[1] = 2
4              |     my_int_array[2] = 3
5              |     my_int_array[3] = 4
6              |     my_int_array[4] = 5
7              |     .....
8              |     .....
.              |     .....
.              |     .....
.              |     .....
n-1            |     .....
</code>```

2. Now if we say:

```<code>int* p_int = my_int_array;
</code>```

The memory changes again. E.g. Memory address 8 (decided by the compiler) now has a int pointer called *p_int.

```<code>Memory Address | Name - Stored Value (values or memory addresses)
-----------------------------------------------------
0              |     .....
1              |     .....
2              |     my_int_array[0] = 1
3              |     my_int_array[1] = 2
4              |     my_int_array[2] = 3
5              |     my_int_array[3] = 4
6              |     my_int_array[4] = 5
7              |     .....
8              |     p_int = 2 (which means it points to memory address 2, which has the value of my_int_array[0] = 1)
.              |     .....
.              |     .....
.              |     .....
n-1            |     .....
</code>```

3. If in your program you now say:

```<code>    p_int += 2; // You increase the value by 2 (or 8 bytes), it now points elsewhere, 2 index values ahead in the array.

    Memory Address | Name - Stored Value (values or memory addresses)
    -----------------------------------------------------
    0              |     .....
    1              |     .....
    2              |     my_int_array[0] = 1
    3              |     my_int_array[1] = 2
    4              |     my_int_array[2] = 3
    5              |     my_int_array[3] = 4
    6              |     my_int_array[4] = 5
    7              |     .....
    8              |     p_int = 4 (which means it points to memory address 4, which has the value of my_int_array[2] = 3)
    .              |     .....
    .              |     .....
    .              |     .....
    n-1            |     .....
</code>```

When doing memory allocation and pointer arithmetic in a simple case like this, you don't have to worry about the size in bytes of an int (4 bytes). The pointers here are already bound to a type (in this case int) when you declared them, so just by increasing their value by integer values, p_int + 1, this will make point p_int point to the next 4 bytes or int value. Just by adding the values to the pointers you will get the next integer.

Title: Define a pointer with an arbitrary span

Body:
If I have a large array where the data streams are interleaved in some complex fashion, can I define a pointer p such that p + 1 is some arbitrary offset b bytes.

For example lets say I have 1,000,000 ints, 4 bytes each.

int* p_int = my_int_array;

This gives me *(p_int+1) == my_int_array[1] (moves 4 bytes)

I am looking for something like

something_here(b)* big_span_p_int = my_int_array;

which would make *(big_span_p_int + 1) == my_int_array[b] (moves 4*b or b bytes, whichever is possible or easier)

Is this possible? easy?

Thanks for the help.

EDIT:

b is compile time variable.

Body:
Using some of your code. There is no need to declare an additional pointer/array. Applying pointer arithmetic on p_int is enough to  traverse and reach the number value you are seeking.

Let's look at this example:

    int main() {
        int my_int_array[5] {1,2,3,4,5};
        int* p_int = my_int_array;
        int b = 2;
        std::cout << *(p_int + b) << std::endl; // Output is 3, because  *p_int == my_int_array[0], so my_int_array[2] will give you the third index of the array.
    }

Graphically represented:

Memory Address | Stored Value (values or memory addresses)
----------------------------------------------
0              |     .....
1              |     .....
2              |     .....
3              |     .....
4              |     .....
5              |     .....
6              |     .....
7              |     .....
8              |     .....
.              |     .....
.              |     .....
.              |     .....
n-1            |     .....

Imagine the memory as being a very big array in which you can access positions by its memory address (in this case we've simplified the addresses to natural numbers. In reality they're hexadecimal values). "n" is the total amount (or size) of the memory. Since Memory counts and starts in 0, size is equivalent to n-1.

Using the example above:

1. When you invoke:

int my_int_array[5] {1,2,3,4,5};

The Operating System and the C++ compiler allocates the integer array memory statically for you, but we can think that our memory has been changed. E.g. Memory address 2 (decided by the compiler) now has our first value of my_int_array.

Memory Address | Name - Stored Value (values or memory addresses)
-----------------------------------------------------
0              |     .....
1              |     .....
2              |     my_int_array[0] = 1
3              |     my_int_array[1] = 2
4              |     my_int_array[2] = 3
5              |     my_int_array[3] = 4
6              |     my_int_array[4] = 5
7              |     .....
8              |     .....
.              |     .....
.              |     .....
.              |     .....
n-1            |     .....

2. Now if we say:

int* p_int = my_int_array;

The memory changes again. E.g. Memory address 8 (decided by the compiler) now has a int pointer called *p_int.

Memory Address | Name - Stored Value (values or memory addresses)
-----------------------------------------------------
0              |     .....
1              |     .....
2              |     my_int_array[0] = 1
3              |     my_int_array[1] = 2
4              |     my_int_array[2] = 3
5              |     my_int_array[3] = 4
6              |     my_int_array[4] = 5
7              |     .....
8              |     p_int = 2 (which means it points to memory address 2, which has the value of my_int_array[0] = 1)
.              |     .....
.              |     .....
.              |     .....
n-1            |     .....

3. If in your program you now say:

    p_int += 2; // You increase the value by 2 (or 8 bytes), it now points elsewhere, 2 index values ahead in the array.

    Memory Address | Name - Stored Value (values or memory addresses)
    -----------------------------------------------------
    0              |     .....
    1              |     .....
    2              |     my_int_array[0] = 1
    3              |     my_int_array[1] = 2
    4              |     my_int_array[2] = 3
    5              |     my_int_array[3] = 4
    6              |     my_int_array[4] = 5
    7              |     .....
    8              |     p_int = 4 (which means it points to memory address 4, which has the value of my_int_array[2] = 3)
    .              |     .....
    .              |     .....
    .              |     .....
    n-1            |     .....

When doing memory allocation and pointer arithmetic in a simple case like this, you don't have to worry about the size in bytes of an int (4 bytes). The pointers here are already bound to a type (in this case int) when you declared them, so just by increasing their value by integer values, p_int + 1, this will make point p_int point to the next 4 bytes or int value. Just by adding the values to the pointers you will get the next integer.


答:
You can use flexbox. Just add

```<code>#container {
  display: flex;
}
</code>```

body {
  width: 350px;
  margin: 0px auto;
}

#container {
  display: flex;
  border: 15px solid orange;
}

#firstDiv {
  border: 10px solid brown;
  display: inline-block;
  width: 70px;
  overflow: hidden;
  vertical-align: top;
}

#secondDiv {
  border: 10px solid skyblue;
  float: left;
  width: 70px;
}

#thirdDiv {
  display: inline-block;
  border: 5px solid yellowgreen;
  vertical-align: top;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div id="container">
  <div id="firstDiv">FIRST</div>
  <div id="secondDiv">SECOND</div>
  <div id="thirdDiv">THIRD
    <br>some more content<br> some more content
  </div></code>```

Title: CSS: Inline Div with auto width pushes down when the text is long

Body:
You can use flexbox. Just add

#container {
  display: flex;
}

body {
  width: 350px;
  margin: 0px auto;
}

#container {
  display: flex;
  border: 15px solid orange;
}

#firstDiv {
  border: 10px solid brown;
  display: inline-block;
  width: 70px;
  overflow: hidden;
  vertical-align: top;
}

#secondDiv {
  border: 10px solid skyblue;
  float: left;
  width: 70px;
}

#thirdDiv {
  display: inline-block;
  border: 5px solid yellowgreen;
  vertical-align: top;
}

<div id="container">
  <div id="firstDiv">FIRST</div>
  <div id="secondDiv">SECOND</div>
  <div id="thirdDiv">THIRD
    <br>some more content<br> some more content
  </div>


问:
Using JSoup in a do-while loop, still throwing exceptions
When I tried to run it and check for errors, I noticed that the do-while loop inside one of my methods that allows re-tries after illegal input is not working when the method was called.

My questions are:
1) Why is the do-while loop in the PageScanner() method not working?
2) Can you suggest a better way to organize my code?

This is what it currently looks like:

First class: "BulkSpellChecker" (where I tried to organize the code)

```<code>         import java.io.*;

public class BulkSpellChecker extends ParseCleanCheck {

    public static void main(String[] args) throws IOException {
        System.out.println("Let's get started!");

        PageScanner(); // Scan the page and clean it first
        System.out.println("Thanks for using the spell checker!");
    }}
</code>```

Second Class "ParseCleanCheck" (where all of the ugly happens)

```<code>import java.io.*;
import java.util.*;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.safety.Whitelist;

public class ParseCleanCheck {

    static Scanner urlInput = new Scanner(System.in);
public static String cleanString = "";
public static String url = "";
public static boolean correct = true;

/**
 * PARSER METHOD
 */
public static void PageScanner() throws IOException {
    System.out.println("Pick a website to scan.");
    System.out.println("Enter a URL, starting with http://");

    do { // This do-while loop allows the user to try again after a mistake
        try {
            url = urlInput.nextLine();
            correct = false;
        } catch (Exception e) {
            System.out.println("Incorrect format for a URL.");
        }
    } while (correct == true);

    // This creates a document out of the HTML on the web page
    Document doc = Jsoup.connect(url).get();
    // This converts the document into a string to be cleaned
    String htmlToClean = doc.toString();
    cleanString = Jsoup.clean(htmlToClean, Whitelist.none());
}}
</code>```

disclaimer: I'm fairly new to programming and I apologize if the answer is obvious or if I posted too much code. I can edit and delete the code if necessary.

答:
Although I'm not sure if this is your problem, Scanner can be difficult to work with, I'd avoid it if possible.  It may not be passing the line to you until the buffer is full.  You can try entering a lot of text and see if it ever responds (I believe this is windows behavior, not really java's and it may behave differently on Linux).  Another test might be to put a System.out.println right after the nextLine and see if it ever returns.  My guess is it won't return from nextLine until you've entered a bunch of characters (regardless of carriage returns).

You MIGHT be able to trick it into returning from nextLine with an end of stream character (I think it's ctrl-d or ctrl-z) but I believe that will close your standard input stream and you won't be able to read from it again.

If it were me, I'd take one of two approaches depending on my requirements.

One way would be to run it as a one-time program.  Put the text you want on the command line and read it in from your main() parameters.  If you fail to connect print an error and exit--the user can resubmit by hitting up-arrow and editing the last line.  Once this works you can write a .cmd (or bash) batch file that launches your Java app so that you don't have to type in that awkward command line every time.

The second would be to use one of the Java input box GUIs.  They boil down to just a few lines of code to give you a pop-up dialog where your user can input his text.

Something like this should work (Didn't double check but I think this is right):

```<code>  String url = JOptionPane.showInputDialog(null, "Enter a URL to check");
</code>```

IF the first try fails you can just as easily change the text to something like "That URL did not work, please enter a different url to retry" on the second try.

Also if url is null the user hit cancel, so exit.

Body:
When I tried to run it and check for errors, I noticed that the do-while loop inside one of my methods that allows re-tries after illegal input is not working when the method was called.

My questions are:
1) Why is the do-while loop in the PageScanner() method not working?
2) Can you suggest a better way to organize my code?

This is what it currently looks like:

First class: "BulkSpellChecker" (where I tried to organize the code)

         import java.io.*;

public class BulkSpellChecker extends ParseCleanCheck {

    public static void main(String[] args) throws IOException {
        System.out.println("Let's get started!");

        PageScanner(); // Scan the page and clean it first
        System.out.println("Thanks for using the spell checker!");
    }}

Second Class "ParseCleanCheck" (where all of the ugly happens)

import java.io.*;
import java.util.*;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.safety.Whitelist;

public class ParseCleanCheck {

    static Scanner urlInput = new Scanner(System.in);
public static String cleanString = "";
public static String url = "";
public static boolean correct = true;

/**
 * PARSER METHOD
 */
public static void PageScanner() throws IOException {
    System.out.println("Pick a website to scan.");
    System.out.println("Enter a URL, starting with http://");

    do { // This do-while loop allows the user to try again after a mistake
        try {
            url = urlInput.nextLine();
            correct = false;
        } catch (Exception e) {
            System.out.println("Incorrect format for a URL.");
        }
    } while (correct == true);

    // This creates a document out of the HTML on the web page
    Document doc = Jsoup.connect(url).get();
    // This converts the document into a string to be cleaned
    String htmlToClean = doc.toString();
    cleanString = Jsoup.clean(htmlToClean, Whitelist.none());
}}

disclaimer: I'm fairly new to programming and I apologize if the answer is obvious or if I posted too much code. I can edit and delete the code if necessary.

Body:
Although I'm not sure if this is your problem, Scanner can be difficult to work with, I'd avoid it if possible.  It may not be passing the line to you until the buffer is full.  You can try entering a lot of text and see if it ever responds (I believe this is windows behavior, not really java's and it may behave differently on Linux).  Another test might be to put a System.out.println right after the nextLine and see if it ever returns.  My guess is it won't return from nextLine until you've entered a bunch of characters (regardless of carriage returns).

You MIGHT be able to trick it into returning from nextLine with an end of stream character (I think it's ctrl-d or ctrl-z) but I believe that will close your standard input stream and you won't be able to read from it again.

If it were me, I'd take one of two approaches depending on my requirements.

One way would be to run it as a one-time program.  Put the text you want on the command line and read it in from your main() parameters.  If you fail to connect print an error and exit--the user can resubmit by hitting up-arrow and editing the last line.  Once this works you can write a .cmd (or bash) batch file that launches your Java app so that you don't have to type in that awkward command line every time.

The second would be to use one of the Java input box GUIs.  They boil down to just a few lines of code to give you a pop-up dialog where your user can input his text.

Something like this should work (Didn't double check but I think this is right):

  String url = JOptionPane.showInputDialog(null, "Enter a URL to check");

IF the first try fails you can just as easily change the text to something like "That URL did not work, please enter a different url to retry" on the second try.

Also if url is null the user hit cancel, so exit.


问:
Text on the left with line on the right in HTML and CSS
How can I create the following in HTML and CSS?

Some Text ---------------------------------------------------------

The line should be solid, no dotted

Thanks

答:
You can do this using flexbox like this:

.text {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 100%;
}

.text::after {
  content: "";
  -webkit-box-flex: 1;
          -ms-flex: 1;
              flex: 1;
  -ms-flex-item-align: center;
   -ms-grid-row-align: center;
           align-self: center;

  margin-left: 8px; /*space before line*/
  height: 2px;      /*line thickness*/
  background: #333; /*line color*/
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="text">Some Text</div></code>```

Body:
You can do this using flexbox like this:

.text {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 100%;
}

.text::after {
  content: "";
  -webkit-box-flex: 1;
          -ms-flex: 1;
              flex: 1;
  -ms-flex-item-align: center;
   -ms-grid-row-align: center;
           align-self: center;

  margin-left: 8px; /*space before line*/
  height: 2px;      /*line thickness*/
  background: #333; /*line color*/
}

<div class="text">Some Text</div>