text:
Q: Given a connected and ready DiscordSocketClient and a Discord Channel Id, How does one send a message to that channel? I am trying to set up automated messages.
When I am setting up my client I use:
client.Ready += OnClientReady;

From there I start my Scheduler class:
private Task OnClientReady()
{
    var scheduler = new Scheduler(client);
    scheduler.Start();

    return Task.CompletedTask;
}

Which looks like this:
public class Scheduler
{
    private readonly DiscordSocketClient _client;
    private static Timer _timer;

    public void Start(object state = null)
    {
        Sender.Send(_client);

        _timer = new Timer(Start, null, (int)Duration.FromMinutes(1).TotalMilliseconds, 0);
    }

    public Scheduler(DiscordSocketClient client)
    {
        _client = client;
    }
}

When the timer ticks, it calls out and passes the client to the Sender class below:
public static class Sender
{
    public static void Send(DiscordSocketClient client)
    {
        var currentLocalDateTime = SystemClock.Instance.InTzdbSystemDefaultZone().GetCurrentLocalDateTime();

        var elapsedRotations = new List<Rotations>();
        using (var db = new GOPContext())
        {
            elapsedRotations = db.Rotations
                                 .Include(r => r.RotationUsers)
                                 .Where(r => r.LastNotification == null ||
                                             Period.Between(r.LastNotification.Value.ToLocalDateTime(),
                                                            currentLocalDateTime).Hours >= 23)
                                 .ToList();
        }

        foreach (var rotation in elapsedRotations)
        {
            var zone = DateTimeZoneProviders.Tzdb.GetZoneOrNull(rotation.Timezone);
            var zonedDateTime = SystemClock.Instance.InZone(zone).GetCurrentZonedDateTime();
            if (zonedDateTime.Hour != 17)
                continue;

            //I need to send a message to the channel here.
            //I have access to the connected / ready client,
            //and the channel Id which is "rotation.ChannelId"
        }
    }
}

I have tried getting the channel like this:
var channel = client.GetChannel((ulong) rotation.ChannelId);

which gives me a SocketChannel and also like this:
var channel = client.Guilds
                    .SelectMany(g => g.Channels)
                    .SingleOrDefault(c => c.Id == rotation.ChannelId);

which gives me a SocketGuildChannel.  Neither of these give me an option to send a message directly to the channel.  I have tried researching how to do this, but have not found anything...  The documentation does not seem to have any examples of this...
It seems like a simple thing to do, but I'm at my wits end on it.  Anybody know how to do this?

A: This is because both SocketGuildChannel and SocketChannel could be either a voice or a text channel.
Instead you want the ISocketMessageChannel, IMessageChannel or SocketTextChannel
To get this you could simply cast the SocketChannel you are getting
var channel = client.GetChannel((ulong) rotation.ChannelId);
var textChannel = channel as IMessageChannel;
if(textChannel == null)
    // this was not a text channel, but a voice channel
else
    textChannel.SendMessageAsync("This is a text channel");


text:
Q: Gradle build fails on "lint isAbortOnError" after updating to com.android.tools.build:gradle:7.1.0 For my android app i'm using a build.gradle.kts file containing this code:
android {
    ...

    lint {
          isAbortOnError = false
    }
}

For my current configuration, everything works fine:

*

*Android Studio Bumble Bee 2021.1.1

*com.android.tools.build:gradle:7.0.4

*distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip

Android Studio suggested an update to com.android.tools.build:gradle:7.1.0, which then breaks my gradle build:
org.gradle.internal.exceptions.LocationAwareException: Build file '/Users/me/Projects/extern/my-project/app/build.gradle.kts' line: 144
Script compilation error:

  Line 144:         isAbortOnError = false
                    ^ Unresolved reference: isAbortOnError

1 error
    at org.gradle.kotlin.dsl.execution.Interpreter$ProgramHost$compileSecondStageOf$cacheDir$1.invoke(Interpreter.kt:669)
    at org.gradle.kotlin.dsl.execution.Interpreter$ProgramHost$compileSecondStageOf$cacheDir$1.invoke(Interpreter.kt:390)
    at org.gradle.kotlin.dsl.provider.CompileKotlinScript.execute(KotlinScriptEvaluator.kt:376)
    at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:89)
    at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:40)
    at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:53)
    at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
    at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:50)
    at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:40)
    at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68)
    at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38)
    at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
    at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36)
    at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
    at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
    at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
    at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
    at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:29)
    at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:61)
    at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:42)
    at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:60)
    at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:27)
    at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:188)
    at org.gradle.internal.execution.steps.BuildCacheStep.executeAndStoreInCache(BuildCacheStep.java:163)
    at org.gradle.internal.execution.steps.BuildCacheStep.lambda$executeWithCache$4(BuildCacheStep.java:133)
    at java.base/java.util.Optional.orElseGet(Optional.java:369)
    at org.gradle.internal.execution.steps.BuildCacheStep.lambda$executeWithCache$5(BuildCacheStep.java:133)
    at org.gradle.internal.Try$Success.map(Try.java:164)
    at org.gradle.internal.execution.steps.BuildCacheStep.executeWithCache(BuildCacheStep.java:85)
    at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$0(BuildCacheStep.java:74)
    at org.gradle.internal.Either$Left.fold(Either.java:115)
    at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59)
    at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:73)
    at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:48)
    at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:38)
    at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:27)
    at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
    at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:109)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:56)
    at java.base/java.util.Optional.orElseGet(Optional.java:369)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:56)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
    at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:73)
    at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:44)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
    at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:89)
    at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:50)
    at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:114)
    at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:57)
    at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:76)
    at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:50)
    at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:93)
    at java.base/java.util.Optional.orElseGet(Optional.java:369)
    at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:93)
    at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
    at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:43)
    at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:31)
    at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
    at org.gradle.internal.execution.workspace.impl.DefaultImmutableWorkspaceProvider.lambda$withWorkspace$3(DefaultImmutableWorkspaceProvider.java:120)
    at org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess.withFileLock(LockOnDemandCrossProcessCacheAccess.java:90)
    at org.gradle.cache.internal.DefaultCacheAccess.withFileLock(DefaultCacheAccess.java:191)
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.withFileLock(DefaultPersistentDirectoryStore.java:188)
    at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.withFileLock(DefaultCacheFactory.java:209)
    at org.gradle.internal.execution.workspace.impl.DefaultImmutableWorkspaceProvider.withWorkspace(DefaultImmutableWorkspaceProvider.java:117)
    at org.gradle.kotlin.dsl.cache.KotlinDslWorkspaceProvider$subWorkspace$1.withWorkspace(KotlinDslWorkspaceProvider.kt:56)
    at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
    at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
    at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
    at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
    at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44)
    at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33)
    at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
    at org.gradle.kotlin.dsl.provider.StandardKotlinScriptEvaluator$InterpreterHost.cachedDirFor(KotlinScriptEvaluator.kt:251)
    at org.gradle.kotlin.dsl.execution.Interpreter$ProgramHost.compileSecondStageOf(Interpreter.kt:484)
    at Program.loadSecondStageFor(Unknown Source)
    at org.gradle.kotlin.dsl.execution.Interpreter$ProgramHost.evaluateSecondStageOf(Interpreter.kt:442)
    at Program.execute(Unknown Source)
    at org.gradle.kotlin.dsl.execution.Interpreter$ProgramHost.eval(Interpreter.kt:531)
    at org.gradle.kotlin.dsl.execution.Interpreter.eval(Interpreter.kt:183)
    at org.gradle.kotlin.dsl.provider.StandardKotlinScriptEvaluator.evaluate(KotlinScriptEvaluator.kt:114)
    at org.gradle.kotlin.dsl.provider.KotlinScriptPluginFactory$create$1.invoke(KotlinScriptPluginFactory.kt:51)
    at org.gradle.kotlin.dsl.provider.KotlinScriptPluginFactory$create$1.invoke(KotlinScriptPluginFactory.kt:36)
    at org.gradle.kotlin.dsl.provider.KotlinScriptPlugin.apply(KotlinScriptPlugin.kt:34)
    at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62)
    at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
    at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:366)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:393)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:365)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.lambda$run$0(LifecycleProjectEvaluator.java:100)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:366)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$withProjectLock$3(DefaultProjectStateRegistry.java:426)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:211)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:426)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:407)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:365)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:91)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:63)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:751)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:151)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.ensureConfigured(DefaultProjectStateRegistry.java:339)
    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:41)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:57)
    at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:48)
    at org.gradle.configuration.BuildTreePreparingProjectsPreparer.prepareProjects(BuildTreePreparingProjectsPreparer.java:64)
    at org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild.run(BuildOperationFiringProjectsPreparer.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.BuildOperationFiringProjectsPreparer.prepareProjects(BuildOperationFiringProjectsPreparer.java:40)
    at org.gradle.initialization.VintageBuildModelController.lambda$prepareProjects$1(VintageBuildModelController.java:93)
    at org.gradle.internal.build.StateTransitionController.lambda$doTransition$1(StateTransitionController.java:222)
    at org.gradle.internal.build.StateTransitionController.doTransition(StateTransitionController.java:243)
    at org.gradle.internal.build.StateTransitionController.doTransition(StateTransitionController.java:221)
    at org.gradle.internal.build.StateTransitionController.transitionIfNotPreviously(StateTransitionController.java:190)
    at org.gradle.initialization.VintageBuildModelController.prepareProjects(VintageBuildModelController.java:93)
    at org.gradle.initialization.VintageBuildModelController.doBuildStages(VintageBuildModelController.java:77)
    at org.gradle.initialization.VintageBuildModelController.getConfiguredModel(VintageBuildModelController.java:58)
    at org.gradle.internal.build.StateTransitionController.notInStateIgnoreOtherThreads(StateTransitionController.java:89)
    at org.gradle.internal.build.DefaultBuildLifecycleController.getConfiguredBuild(DefaultBuildLifecycleController.java:98)
    at org.gradle.internal.build.AbstractBuildState.ensureProjectsConfigured(AbstractBuildState.java:65)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildToolingModelController.locateBuilderForTarget(DefaultBuildTreeModelCreator.java:90)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildToolingModelController.locateBuilderForDefaultTarget(DefaultBuildTreeModelCreator.java:82)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController$DefaultTargetModel.locate(DefaultBuildController.java:239)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getToolingModelBuilder(DefaultBuildController.java:184)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getModel(DefaultBuildController.java:98)
    at org.gradle.tooling.internal.consumer.connection.ParameterAwareBuildControllerAdapter.getModel(ParameterAwareBuildControllerAdapter.java:39)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.getModel(UnparameterizedBuildController.java:113)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.getModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:97)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:81)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:66)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:116)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:42)
    at org.gradle.tooling.internal.consumer.connection.InternalBuildActionAdapter.execute(InternalBuildActionAdapter.java:64)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.runAction(AbstractClientProvidedBuildActionRunner.java:131)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.beforeTasks(AbstractClientProvidedBuildActionRunner.java:99)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator.beforeTasks(DefaultBuildTreeModelCreator.java:57)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$fromBuildModel$1(DefaultBuildTreeLifecycleController.java:72)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$runBuild$4(DefaultBuildTreeLifecycleController.java:103)
    at org.gradle.internal.build.StateTransitionController.lambda$transition$0(StateTransitionController.java:145)
    at org.gradle.internal.build.StateTransitionController.doTransition(StateTransitionController.java:243)
    at org.gradle.internal.build.StateTransitionController.transition(StateTransitionController.java:145)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.runBuild(DefaultBuildTreeLifecycleController.java:100)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.fromBuildModel(DefaultBuildTreeLifecycleController.java:71)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner.runClientAction(AbstractClientProvidedBuildActionRunner.java:43)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:53)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.internal.buildtree.ProblemReportingBuildActionRunner.run(ProblemReportingBuildActionRunner.java:49)
    at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:69)
    at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:114)
    at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
    at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.lambda$execute$0(RootBuildLifecycleBuildActionExecutor.java:40)
    at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:155)
    at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.execute(RootBuildLifecycleBuildActionExecutor.java:40)
    at org.gradle.internal.buildtree.DefaultBuildTreeContext.execute(DefaultBuildTreeContext.java:40)
    at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.lambda$execute$0(BuildTreeLifecycleBuildActionExecutor.java:65)
    at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:53)
    at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.execute(BuildTreeLifecycleBuildActionExecutor.java:65)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:61)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:57)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor.execute(RunAsBuildOperationBuildActionExecutor.java:57)
    at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.lambda$execute$0(RunAsWorkerThreadBuildActionExecutor.java:38)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:211)
    at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.execute(RunAsWorkerThreadBuildActionExecutor.java:38)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecutor.execute(ContinuousBuildActionExecutor.java:103)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecutor.execute(SubscribableBuildActionExecutor.java:64)
    at org.gradle.internal.session.DefaultBuildSessionContext.execute(DefaultBuildSessionContext.java:46)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:100)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:88)
    at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:69)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:62)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:41)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:63)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:58)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
... (max character count of StackOverflow, i hope this is enough)

However, the gradle plugin release page does not mention removing this option.
Also, it's no major release, so there should be no breaking changes

AGP will now use semantic versioning, and breaking changes will be
targeted for major releases.

What have i done wrong?

A: For .kts files
isAbortOnError was changed to abortOnError
So try
lint {
  abortOnError = false
}

See https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/dsl/Lint for more info.

A: try this
    lint {
        abortOnError false
        checkReleaseBuilds false
    }

redpajama_set_name: RedPajamaStackExchange


text:
Q: for loops displays 2 and then 3 results? I know exactly whats happening but cannot figure it out for the life of me, i've been out of programming for a while now so excuse the ugly code..
pretty much I'm trying to do a "pick a name of the hat" concept... as I want to have random 'matches' chosen
but some times I'll get displayed:
Harry v Kwok
Matthew v Lewis
James v Ceri

then others being:
Ceri v James
Kwok v Harry

  import java.util.*;
  public class hatpicking {
    public static void main(String[] args) {
   //Links one value to other--- eg. 0 = ceri, 1 = Harry
    HashMap<Integer, String> map = new HashMap<Integer, String>();

    map.put(0, "Ceri");
    map.put(1, "Harry");
    map.put(2, "Matthew");
    map.put(3, "Lewis");
    map.put(4, "Kwok");
    map.put(5, "James");

    int HashmapValue = 6;

    //For loops that only makes 3 fixtures
    for(int i=1; i<20; i++){
        //Generates 2 Random Numbers
        int first = (int) (Math.random() * HashmapValue);
        int second = (int)(Math.random()* HashmapValue );

        //Assigns the 2 numbers to the hashmap values
        String val1 = (String)map.get(first);
        String val2 = (String)map.get(second);

    if(val1 != null && val1 != val2 && val2 != null){

        map.remove(first);
        map.remove(second);

        //prints Fixtures
        System.out.println(val2 + " v " + val1);
            }
        }
    }
}

A: You need to get lucky that your generated values are still in the Map. You always generate a number between 0 and 5, but the map gets smaller as you remove elements. Just change the loop condition from 20 tries to keep going until map is empty:
 while (!map.isEmpty()) {
     // Generates 2 Random Numbers
     int first = (int) (Math.random() * HashmapValue);
     ...

A: If I understand your issue, it is because sometimes val1 == val2. You could add an else block to your if,
// != is only safe because of reference equality due to the Map(s).
if(val1 != null && val1 != val2 && val2 != null){
  map.remove(first);
  map.remove(second);

  //prints Fixtures
  System.out.println(val2 + " v " + val1);
} else {
  i--; // repeat.
}

Edit
Based on your comments, I would actually implement it with Collections.shuffle() and
String[] competitors = { "Ceri", "Harry",
    "Matthew", "Lewis", "Kwok", "James" };
Collections.shuffle(Arrays.asList(competitors));
for (int i = 0; i < competitors.length; i += 2) {
  System.out.printf("%s v %s%n", competitors[i],
      competitors[i + 1]);
}

A: You should use a simple permutation over a List that represent your population:
pseudo code would be
List<Player> list= {...} << put what ever represent your player

for(int i= 0 ; i < list.size ; i++) { //Random permutation
    int j = random(list.size) // return
    list.swap(i,j);
}

List<Group> groups;
for (int i = 0 ; i < list.size - 1; i+=2){
    groups.add(new Group(list.get(i), list.get(i+1);
}


text:
Q: Java / Scala - ReactiveStreams / Enumeratee How to continually read an Input Stream until read() returns -1 currently I have a Publisher[InputStream] how could I know read it to have something like the Java8 Streams API provide:
def binStream(is: InputStream) = Stream.continually(is.read).takeWhile(_ != -1).map(_.toByte)

Currently I use Scala and the playframework and want to chunk the Output via the experimental akka-streams / reactivestreams libraries, however I have no clue, due to the fact that there is little to no documentation about both things. Any suggestions?

A: akka-streams has the InputStreamSource which takes an InputStream in its constructor.
There is a fair bit of documentation on Akka Streams here
If you are interested in the play iteratee library (you put the play-framework tag in your question) you can use Enumerator.fromStream method to make an Enumerator.
There is also a fair bit of documentation about Play's Iteratees here


text:
Q: How to get value for next same key in array I have an array that looks like this when printed:
Array (
    [0] => stdClass Object (
        [sku] => exp_pokemonketchup_001
        [_id] =>   539be6740478ca09233ac71e
        [__v] => 0
        [type] => 3
        [status] => 1
        [_create_date] => 2014-06-14T06:06:44.365Z
        )
    [1] => stdClass Object (
        [sku] => exp_onepiecegobble_001
        [_id] => 539be6710478ca09233ac71c
        [__v] => 0
        [type] => 3
        [status] => 1
        [_create_date] => 2014-06-14T06:06:41.110Z
    )
    [2] => stdClass Object (
        [sku] => exp_sailormoongiggle_001
        [_id] => 539be66d0478ca09233ac717
        [__v] => 0
        [type] => 3
        [status] => 1
        [_create_date] => 2014-06-14T06:06:37.633Z
    )
)

I'm trying to get the sku and corresponding value for the subsequent sku during a foreach loop. In other words, I'm looping through the array, echoing the first sku, which is exp_pokemonketchup_001.
Now I also need to echo out the next sku which is exp_onepiecegobble_001 but before the loop continues to that part of the array.

A: The above can be sorted using an inbuilt PHP function get_object_vars();
In the given array i have tried recreating the array using just one field.
Please see the below code.

    <?php
    $obj = array((object) array('sku' => 'exp_pokemonketchup_001'),
          (object) array('sku' => 'exp_onepiecegobble_001')
          );
         foreach($obj as $k => $v){
            $objDetails =get_object_vars($v);
            print_r($objDetails['sku']);
           }
    ?>

A: Try this:
Assuming $array is your current array of objects
$array_size = count($array);

foreach ($array as $key=>$val) {

    // echo current sku
    echo $val->sku;

    // If not the last object, echo next sku
    if ($key < $array_size-1) {
        echo $array[$key+1]->sku;
    }

}


text:
Q: Authenticating as Ubuntu on EC2 when ssh'd in via keypairs I have an Ubuntu EC2 instance that I SSH in via ssh keypairs.
When I try to restart systemd it prompts for a password, which I don't have. I don't believe I set one up, and I have no idea what it would be, since I'm using the keypair to connect as the ubuntu user:
ubuntu@ip-172-31-35-37:~$ systemctl daemon-reload
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===
Authentication is required to reload the systemd state.
Authenticating as: Ubuntu (ubuntu)
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Failed to execute operation: Access denied

How can I make this work?

A: You need root permission to do that. Use
sudo systemctl daemon-reload

A: This may not be the answer, but it certainly is an answer because it worked for me in the same situation:
Execute the following command to elevate yourself to super user for the session:
sudo su

Info about sudo su (aka super user) here

A: Just run
sudo passwd ec2-user

To get your password!


text:
Q: Making package with React + TS + Storybook + Rollup problems I'm making my own design system with React + Typescript + Storybook + Rollup.
Before publishing my lib to NPM, I wanted to test this lib in my local env.
I built my project and install like npm i ../my_lib.
I wanted to import my Button component, so I wrote a Login page.
import React from "react";
import { Button } from "@myLib/ui/src";

const Login = () => {
  return (
    <div>
      <Button>Hello</Button>
    </div>
  );
};

export default Login;

In VSCode, there's no error.
But I started my dev server, this message occured.
Module parse failed: Unexpected token (1:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> export interface IconProps {
|   size?: number;
|   fillColor?: string;

I think the rollup.config.js has problem. I tried many cases, but only interface got error.
Here is my rollup.config.js.
import commonjs from 'rollup-plugin-commonjs';
import resolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import typescript from 'rollup-plugin-typescript2';
import pkg from './package.json';
import svgr from '@svgr/rollup';
import url from 'rollup-plugin-url';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';

const extensions = ['.js', '.jsx', '.ts', '.tsx'];

process.env.BABEL_ENV = 'production';

export default {
  input: './src/index.ts',
  plugins: [
    peerDepsExternal(),
    resolve({ extensions }),
    commonjs({
      include: 'node_modules/**',
    }),
    typescript({ useTsconfigDeclarationDir: true }),
    babel({ extensions, include: ['src/**/*'], runtimeHelpers: true }),
    url(),
    svgr(),
  ],
  output: [
    {
      file: pkg.main,
      format: 'es',
    },
  ],
};

Is there any wrong field in my config file?


text:
Q: Proper expression to know the opening hours "When does your shop opens and closes?"
what would be the proper English for this expression?

A: A generic question for any retail business would be:

What are your business / operating / working / service hours?


text:
Q: Python sum 2D list column coincident I'm looking for the most efficient method to do the following calculation:
I have three matrix, like this:
[[Brand1, operationCost], [Brand2, operationCost],...]

[[Brand1, maintenanceCost],[Brand2, maintenanceCost]...]

[[Brand1, replacementCost],[Brand2, replacementCost]...]

and I need to calculate the total cost, operation+maintenance+replacement, of each of the brands. It is posible that same of the marks are not in all the matrix. And obtain another matrix like this:
[[Brand1, totalCost],[Brand2, totalCost]...]

A: Numpy should solve your problems:
example:
import numpy as np
c = np.array([[1, 2, 3], [1, 2, 3]])
c.sum(0)
Out[5]: array([2, 4, 6])

If you want to keep your brands combined with the variables I would use pandas:
example:
import pandas as pd
In[9]: df = pd.DataFrame({'brand1': [1, 2, 3], 'brand2': [1, 2, 3]})
In[10]: df
Out[10]:
    brand1  brand2
0       1       1
1       2       2
2       3       3

In[11]: df.sum()
Out[11]:
brand1    6
brand2    6

A: As you don't seem to use python dictionaries, this should work:
operation = [[Brand1, operationCost], [Brand2, operationCost],...]
maintenance = [[Brand1, maintenanceCost], [Brand2, maintenanceCost],...]
replacement = [[Brand1, replacementCost], [Brand2, replacementCost],...]

total = [ [ope[0], ope[1]+mai[1]+rep[1]] for ope,mai,rep in zip(operation,maintenance,replacement) ]

Edit:
Nevertheless you can't use this code above if the lenght of lists or the order of brand change. So the best solution is to use dictionaries:
# Your matrix as dictionaries
operation = {Brand1: operationCost, Brand2: operationCost, ...}
maintenance = {Brand1: maintenanceCost, Brand2: maintenanceCost, ...}
replacement = {Brand1: replacementCost, Brand2: replacementCost, ...}
# Get all brands in a container
all_brands = set(operation.keys()+maintenance.keys()+replacement.keys())
# Return 0 as default value if a brand is not in the dictionary
f = lambda x, dic: dic[x] if x in dic else 0
# Compute the total cost of each brand
total = {brand: f(brand,operation)+f(brand,maintenance)+f(brand,replacement) for brand in all_brands}

Or for python before the 2.7 version:
total = dict([(brand, f(brand,operation)+f(brand,maintenance)+f(brand,replacement)) for brand in all_brands])

A: This solution is pure Python (it does not rely on third party dependencies) and should work even if the length of the lists is not the same:
oc = [['Brand1', <operationCost>],
      ['Brand2', <operationCost>],
      ...,
      ]
mc = [['Brand1', <maintenanceCost>],
      ['Brand2', <maintenanceCost>],
      ...,
      ]
rc = [['Brand1', <replacementCost>],
      ['Brand2', <replacementCost>],
      ...,
      ]
total = {}
for lst in [oc, mc, rc]:
    for brand, cost in lst:
        total[brand] = total.get(brand, 0) + cost


text:
Q: SharePoint 2010 Custom User Profile Property - An error occurred when updating a property I had a custom user profile property "EmployeeId" type of integer that was mapped to an AD attribute.  I deleted this and recreated the property with the same name and integer type but this time I mapped to a BDC property.  When I click OK I get the error 'An error occurred when updating a property'.  I can successfully add new properties mapped to a BDC property.
I restarted the following but still get this error:
User Profile Service
User Profile Synchronization Service
Any ideas what could be causing this?

A: Actually the custom user profile property was originally string multivalue type.  When I deleted it and recreated I selected integer as the type.  For some reason this caused a conflict.  After changing the type back to string multivalue the problem is gone.


text: Q: Spring returning a html file from a static repository (not bundled with the war file) Is it possible for Spring to return a html through a Spring controller (using Viewresolver) wherein the html file is not bundled with the same project but is available at another context on the application server the project is deployed to? (Example: The html file is on an apache http server but is available to the user on the same domain as  that of the app server that needs to return this html file)


text:
Q: Reach Android native styles from React-Native I want to style Picker in React-Native, if with iOS I handled through  with styling with css, Android picker not styling with React-Native styles. I found how to create the Android native styles with xml files but I can't reach them from my React-Native components.
This is my code for Android version of Picker.
if (Platform.OS === 'android') {
  return (
    <Picker
      style={styles.inputContainer}
      selectedValue={this.props.value}
      onValueChange={this.props.onValueChange}
      mode='dropdown'>
      {this.props.items.map((i, index) => (
        <Picker.Item key={index} label={i.label} value={i.value} />
      ))}
    </Picker>
  );
}

Android styles
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
  <item name="android:spinnerItemStyle">@style/SpinnerItem</item>
  <item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItem</item>
</style>

<style name="SpinnerItem" parent="Theme.AppCompat.Light.NoActionBar">>
  <item name="android:fontFamily">sans-serif-light</item>
  <item name="android:textSize">18dp</item>
</style>

<style name="SpinnerDropDownItem" parent="Theme.AppCompat.Light.NoActionBar">>
    <item name="android:textColor">#ffffff</item>
    <item name="android:textSize">18dp</item>
    <item name="android:fontFamily">sans-serif-light</item>
    <item name="android:gravity">center</item>
    <item name="android:background">@drawable/mydivider</item>
</style>

How to reach Android native styles from React-Native?


text:
Q: Verilog: Given clock is 10ns, how long does it take to add 1 to 10 bit register? Please see the following verilog code.  Clk is a 10ns clock.  Will setting TimerCounter_10ns <=0 interfere with the increment (i.e. TimerCounter_10ns = TimerCounter_10ns+1).  Are there any other issues?
Thanks,
Stephen
reg [9:0] TimerCounter_10ns;
always @(posedge CLK, negedge xRST) begin
    if (~xRST)  begin
        ...
    end else begin
        TimerCounter_10ns = TimerCounter_10ns+1;
        if (imerCounter_10ns >= SamplePeriod[9:0])
            TimerCounter_10ns <= 0;
            .....
        end
    end
end

A: with some modifications , usually in fpga we wont use active low resets in the design as it will create more LUT usage and its not efficient way to implement it.So i modified the code to generate the active high reset in the logic
reg [9:0] TimerCounter_10ns;
reg       sys_rst;

always @(posedge CLK, negedge xRST)
    if(~xRST) sys_rst <= #1 1'b1;
    else      sys_rst <= #1 1'b0;

always @(posedge CLK, posedge sys_rst) begin
    if (sys_rst)  begin
        //...
    end else begin
            TimerCounter_10ns <= #1 (TimerCounter_10ns >= SamplePeriod[9:0]) ? 10'h0 :
                                     TimerCounter_10ns + 1'b1;
            //.....
        end
    end
end

Added Non-Blocking Assignments in sequential logic with intra assignment delay(represents TCQ in flipflop on hardware) instead of using mixed blocking and non-blocking assignments(which is not preferred). It takes only 1 clk cycle to increment the counter by value of 1.if counter is initialized to zero, then it would take a maximum of 1024 cycles to reach the sample period count (10 bits , 2**10 =1024).


text:
Q: Query Journey Goals and Exits There appears to be little documentation around these functions in Journey Builder, so hoping someone may have some insight.
Can this data be accessed through the Journey Data Views or any other means? Ideally, I'd like to compile reports such as "Opened X Email and Reached Goal", so any way to retrieve a list of subscribers who exited a journey or reached a journey goal would be extremely useful.

A: You can export Journey Builder History logs by REST API and filter on subscribers who met a goal criteria or exited a journey. I believe this is the only possible way to compile your report.
You can refer to my previous answer to this question Is there a way to retrieve Journey History for contact using REST API?


text:
Q: Hadoop 2.2.0 No AbstractFileSystem for scheme: s3n Environment: Ubuntu, Hadoop 2.2.0, Amazon s3n as filesystem

*

*When I submit a job, I get the following error. Checked CLASS_PATH and hadoop configuration in general. All looks good. I am able to list s3 directories ( hdfs dfs -ls /).

14/02/24 20:40:55 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
14/02/24 20:40:55 ERROR security.UserGroupInformation: PriviledgedActionException as:hduser (auth:SIMPLE) cause:org.apache.hadoop.fs.UnsupportedFileSystemException: No AbstractFileSystem for scheme: s3n
14/02/24 20:40:55 INFO mapreduce.Cluster: Failed to use org.apache.hadoop.mapred.YarnClientProtocolProvider due to error: Error in instantiating YarnClient
Exception in thread "main" java.io.IOException: Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses.
    at org.apache.hadoop.mapreduce.Cluster.initialize(Cluster.java:120)
    at org.apache.hadoop.mapreduce.Cluster.(Cluster.java:82)
    at org.apache.hadoop.mapreduce.Cluster.(Cluster.java:75)
    at org.apache.hadoop.mapred.JobClient.init(JobClient.java:470)
    at org.apache.hadoop.mapred.JobClient.(JobClient.java:449)
    at org.apache.hadoop.streaming.StreamJob.submitAndMonitorJob(StreamJob.java:1011)
    at org.apache.hadoop.streaming.StreamJob.run(StreamJob.java:135)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
    at org.apache.hadoop.streaming.HadoopStreaming.main(HadoopStreaming.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

*

*When I change core-site.xml and use local file system ( started dfs as well) then everything works as expected.

Need help in resolving the issue. Thanks in advance.


text:
Q: list subdomain of a domain using cpanel xml api php I am using cpanel xml api.
https://github.com/CpanelInc/xmlapi-php

i can create subdomains and delete them.
Now i want to list the subdomains.
Here is the Answer in API1 level
$listSubdomain = $xml->api1_query( $cp_un, 'SubDomain', 'listsubdomainsop');

$listSubdomainpaths = $xml->api1_query( $cp_un, 'SubDomain', 'cplistsubdomains');

A: You can use the following:
$subdomainsList = $xml->api2_query($cpanelUser, 'SubDomain', 'listsubdomains');

If you want, it is possible to filter results using a PCRE regex:
$subdomainsList = $xml->api2_query($cpanelUser, 'SubDomain', 'listsubdomains', [
    'regex' => '\bMySubdomain\b'
]);


text:
Q: GoLang SDK for Google cloud SQL Is the GoLang client library for Google Cloud SQL fully functional? How to get started? I can only find listing database instances example:
https://cloud.google.com/sql/docs/postgres/admin-api/libraries

A: Here is the complete api-- it's beta but fairly complete

type AclEntry
func (s *AclEntry) MarshalJSON() ([]byte, error)
type ApiWarning
func (s *ApiWarning) MarshalJSON() ([]byte, error)
type BackupConfiguration
func (s *BackupConfiguration) MarshalJSON() ([]byte, error)
type BackupRun
func (s *BackupRun) MarshalJSON() ([]byte, error)
type BackupRunsDeleteCall
func (c *BackupRunsDeleteCall) Context(ctx context.Context) *BackupRunsDeleteCall
func (c *BackupRunsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *BackupRunsDeleteCall) Fields(s ...googleapi.Field) *BackupRunsDeleteCall
func (c *BackupRunsDeleteCall) Header() http.Header
type BackupRunsGetCall
func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall
func (c *BackupRunsGetCall) Do(opts ...googleapi.CallOption) (*BackupRun, error)
func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall
func (c *BackupRunsGetCall) Header() http.Header
func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall
type BackupRunsInsertCall
func (c *BackupRunsInsertCall) Context(ctx context.Context) *BackupRunsInsertCall
func (c *BackupRunsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *BackupRunsInsertCall) Fields(s ...googleapi.Field) *BackupRunsInsertCall
func (c *BackupRunsInsertCall) Header() http.Header
type BackupRunsListCall
func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall
func (c *BackupRunsListCall) Do(opts ...googleapi.CallOption) (*BackupRunsListResponse, error)
func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall
func (c *BackupRunsListCall) Header() http.Header
func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall
func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall
func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall
func (c *BackupRunsListCall) Pages(ctx context.Context, f func(*BackupRunsListResponse) error) error
type BackupRunsListResponse
func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error)
type BackupRunsService
func NewBackupRunsService(s *Service) *BackupRunsService
func (r *BackupRunsService) Delete(project string, instance string, id int64) *BackupRunsDeleteCall
func (r *BackupRunsService) Get(project string, instance string, id int64) *BackupRunsGetCall
func (r *BackupRunsService) Insert(project string, instance string, backuprun *BackupRun) *BackupRunsInsertCall
func (r *BackupRunsService) List(project string, instance string) *BackupRunsListCall
type BinLogCoordinates
func (s *BinLogCoordinates) MarshalJSON() ([]byte, error)
type CloneContext
func (s *CloneContext) MarshalJSON() ([]byte, error)
type Database
func (s *Database) MarshalJSON() ([]byte, error)
type DatabaseFlags
func (s *DatabaseFlags) MarshalJSON() ([]byte, error)
type DatabaseInstance
func (s *DatabaseInstance) MarshalJSON() ([]byte, error)
type DatabaseInstanceFailoverReplica
func (s *DatabaseInstanceFailoverReplica) MarshalJSON() ([]byte, error)
type DatabasesDeleteCall
func (c *DatabasesDeleteCall) Context(ctx context.Context) *DatabasesDeleteCall
func (c *DatabasesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *DatabasesDeleteCall) Fields(s ...googleapi.Field) *DatabasesDeleteCall
func (c *DatabasesDeleteCall) Header() http.Header
type DatabasesGetCall
func (c *DatabasesGetCall) Context(ctx context.Context) *DatabasesGetCall
func (c *DatabasesGetCall) Do(opts ...googleapi.CallOption) (*Database, error)
func (c *DatabasesGetCall) Fields(s ...googleapi.Field) *DatabasesGetCall
func (c *DatabasesGetCall) Header() http.Header
func (c *DatabasesGetCall) IfNoneMatch(entityTag string) *DatabasesGetCall
type DatabasesInsertCall
func (c *DatabasesInsertCall) Context(ctx context.Context) *DatabasesInsertCall
func (c *DatabasesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *DatabasesInsertCall) Fields(s ...googleapi.Field) *DatabasesInsertCall
func (c *DatabasesInsertCall) Header() http.Header
type DatabasesListCall
func (c *DatabasesListCall) Context(ctx context.Context) *DatabasesListCall
func (c *DatabasesListCall) Do(opts ...googleapi.CallOption) (*DatabasesListResponse, error)
func (c *DatabasesListCall) Fields(s ...googleapi.Field) *DatabasesListCall
func (c *DatabasesListCall) Header() http.Header
func (c *DatabasesListCall) IfNoneMatch(entityTag string) *DatabasesListCall
type DatabasesListResponse
func (s *DatabasesListResponse) MarshalJSON() ([]byte, error)
type DatabasesPatchCall
func (c *DatabasesPatchCall) Context(ctx context.Context) *DatabasesPatchCall
func (c *DatabasesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *DatabasesPatchCall) Fields(s ...googleapi.Field) *DatabasesPatchCall
func (c *DatabasesPatchCall) Header() http.Header
type DatabasesService
func NewDatabasesService(s *Service) *DatabasesService
func (r *DatabasesService) Delete(project string, instance string, database string) *DatabasesDeleteCall
func (r *DatabasesService) Get(project string, instance string, database string) *DatabasesGetCall
func (r *DatabasesService) Insert(project string, instance string, database *Database) *DatabasesInsertCall
func (r *DatabasesService) List(project string, instance string) *DatabasesListCall
func (r *DatabasesService) Patch(project string, instance string, database string, database2 *Database) *DatabasesPatchCall
func (r *DatabasesService) Update(project string, instance string, database string, database2 *Database) *DatabasesUpdateCall
type DatabasesUpdateCall
func (c *DatabasesUpdateCall) Context(ctx context.Context) *DatabasesUpdateCall
func (c *DatabasesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *DatabasesUpdateCall) Fields(s ...googleapi.Field) *DatabasesUpdateCall
func (c *DatabasesUpdateCall) Header() http.Header
type DemoteMasterConfiguration
func (s *DemoteMasterConfiguration) MarshalJSON() ([]byte, error)
type DemoteMasterContext
func (s *DemoteMasterContext) MarshalJSON() ([]byte, error)
type DemoteMasterMySqlReplicaConfiguration
func (s *DemoteMasterMySqlReplicaConfiguration) MarshalJSON() ([]byte, error)
type ExportContext
func (s *ExportContext) MarshalJSON() ([]byte, error)
type ExportContextCsvExportOptions
func (s *ExportContextCsvExportOptions) MarshalJSON() ([]byte, error)
type ExportContextSqlExportOptions
func (s *ExportContextSqlExportOptions) MarshalJSON() ([]byte, error)
type ExportContextSqlExportOptionsMysqlExportOptions
func (s *ExportContextSqlExportOptionsMysqlExportOptions) MarshalJSON() ([]byte, error)
type FailoverContext
func (s *FailoverContext) MarshalJSON() ([]byte, error)
type Flag
func (s *Flag) MarshalJSON() ([]byte, error)
type FlagsListCall
func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall
func (c *FlagsListCall) DatabaseVersion(databaseVersion string) *FlagsListCall
func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, error)
func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall
func (c *FlagsListCall) Header() http.Header
func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall
type FlagsListResponse
func (s *FlagsListResponse) MarshalJSON() ([]byte, error)
type FlagsService
func NewFlagsService(s *Service) *FlagsService
func (r *FlagsService) List() *FlagsListCall
type ImportContext
func (s *ImportContext) MarshalJSON() ([]byte, error)
type ImportContextCsvImportOptions
func (s *ImportContextCsvImportOptions) MarshalJSON() ([]byte, error)
type InstancesAddServerCaCall
func (c *InstancesAddServerCaCall) Context(ctx context.Context) *InstancesAddServerCaCall
func (c *InstancesAddServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesAddServerCaCall) Fields(s ...googleapi.Field) *InstancesAddServerCaCall
func (c *InstancesAddServerCaCall) Header() http.Header
type InstancesCloneCall
func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall
func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall
func (c *InstancesCloneCall) Header() http.Header
type InstancesCloneRequest
func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error)
type InstancesDeleteCall
func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall
func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall
func (c *InstancesDeleteCall) Header() http.Header
type InstancesDemoteMasterCall
func (c *InstancesDemoteMasterCall) Context(ctx context.Context) *InstancesDemoteMasterCall
func (c *InstancesDemoteMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesDemoteMasterCall) Fields(s ...googleapi.Field) *InstancesDemoteMasterCall
func (c *InstancesDemoteMasterCall) Header() http.Header
type InstancesDemoteMasterRequest
func (s *InstancesDemoteMasterRequest) MarshalJSON() ([]byte, error)
type InstancesExportCall
func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall
func (c *InstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall
func (c *InstancesExportCall) Header() http.Header
type InstancesExportRequest
func (s *InstancesExportRequest) MarshalJSON() ([]byte, error)
type InstancesFailoverCall
func (c *InstancesFailoverCall) Context(ctx context.Context) *InstancesFailoverCall
func (c *InstancesFailoverCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesFailoverCall) Fields(s ...googleapi.Field) *InstancesFailoverCall
func (c *InstancesFailoverCall) Header() http.Header
type InstancesFailoverRequest
func (s *InstancesFailoverRequest) MarshalJSON() ([]byte, error)
type InstancesGetCall
func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall
func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*DatabaseInstance, error)
func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall
func (c *InstancesGetCall) Header() http.Header
func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall
type InstancesImportCall
func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall
func (c *InstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall
func (c *InstancesImportCall) Header() http.Header
type InstancesImportRequest
func (s *InstancesImportRequest) MarshalJSON() ([]byte, error)
type InstancesInsertCall
func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall
func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall
func (c *InstancesInsertCall) Header() http.Header
type InstancesListCall
func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall
func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstancesListResponse, error)
func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall
func (c *InstancesListCall) Filter(filter string) *InstancesListCall
func (c *InstancesListCall) Header() http.Header
func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall
func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall
func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall
func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstancesListResponse) error) error
type InstancesListResponse
func (s *InstancesListResponse) MarshalJSON() ([]byte, error)
type InstancesListServerCasCall
func (c *InstancesListServerCasCall) Context(ctx context.Context) *InstancesListServerCasCall
func (c *InstancesListServerCasCall) Do(opts ...googleapi.CallOption) (*InstancesListServerCasResponse, error)
func (c *InstancesListServerCasCall) Fields(s ...googleapi.Field) *InstancesListServerCasCall
func (c *InstancesListServerCasCall) Header() http.Header
func (c *InstancesListServerCasCall) IfNoneMatch(entityTag string) *InstancesListServerCasCall
type InstancesListServerCasResponse
func (s *InstancesListServerCasResponse) MarshalJSON() ([]byte, error)
type InstancesPatchCall
func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall
func (c *InstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall
func (c *InstancesPatchCall) Header() http.Header
type InstancesPromoteReplicaCall
func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall
func (c *InstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall
func (c *InstancesPromoteReplicaCall) Header() http.Header
type InstancesResetSslConfigCall
func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall
func (c *InstancesResetSslConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall
func (c *InstancesResetSslConfigCall) Header() http.Header
type InstancesRestartCall
func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall
func (c *InstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall
func (c *InstancesRestartCall) Header() http.Header
type InstancesRestoreBackupCall
func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall
func (c *InstancesRestoreBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall
func (c *InstancesRestoreBackupCall) Header() http.Header
type InstancesRestoreBackupRequest
func (s *InstancesRestoreBackupRequest) MarshalJSON() ([]byte, error)
type InstancesRotateServerCaCall
func (c *InstancesRotateServerCaCall) Context(ctx context.Context) *InstancesRotateServerCaCall
func (c *InstancesRotateServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesRotateServerCaCall) Fields(s ...googleapi.Field) *InstancesRotateServerCaCall
func (c *InstancesRotateServerCaCall) Header() http.Header
type InstancesRotateServerCaRequest
func (s *InstancesRotateServerCaRequest) MarshalJSON() ([]byte, error)
type InstancesService
func NewInstancesService(s *Service) *InstancesService
func (r *InstancesService) AddServerCa(project string, instance string) *InstancesAddServerCaCall
func (r *InstancesService) Clone(project string, instance string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall
func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall
func (r *InstancesService) DemoteMaster(project string, instance string, instancesdemotemasterrequest *InstancesDemoteMasterRequest) *InstancesDemoteMasterCall
func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall
func (r *InstancesService) Failover(project string, instance string, instancesfailoverrequest *InstancesFailoverRequest) *InstancesFailoverCall
func (r *InstancesService) Get(project string, instance string) *InstancesGetCall
func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall
func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall
func (r *InstancesService) List(project string) *InstancesListCall
func (r *InstancesService) ListServerCas(project string, instance string) *InstancesListServerCasCall
func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall
func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall
func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall
func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall
func (r *InstancesService) RestoreBackup(project string, instance string, instancesrestorebackuprequest *InstancesRestoreBackupRequest) *InstancesRestoreBackupCall
func (r *InstancesService) RotateServerCa(project string, instance string, instancesrotateservercarequest *InstancesRotateServerCaRequest) *InstancesRotateServerCaCall
func (r *InstancesService) StartReplica(project string, instance string) *InstancesStartReplicaCall
func (r *InstancesService) StopReplica(project string, instance string) *InstancesStopReplicaCall
func (r *InstancesService) TruncateLog(project string, instance string, instancestruncatelogrequest *InstancesTruncateLogRequest) *InstancesTruncateLogCall
func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall
type InstancesStartReplicaCall
func (c *InstancesStartReplicaCall) Context(ctx context.Context) *InstancesStartReplicaCall
func (c *InstancesStartReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesStartReplicaCall) Fields(s ...googleapi.Field) *InstancesStartReplicaCall
func (c *InstancesStartReplicaCall) Header() http.Header
type InstancesStopReplicaCall
func (c *InstancesStopReplicaCall) Context(ctx context.Context) *InstancesStopReplicaCall
func (c *InstancesStopReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesStopReplicaCall) Fields(s ...googleapi.Field) *InstancesStopReplicaCall
func (c *InstancesStopReplicaCall) Header() http.Header
type InstancesTruncateLogCall
func (c *InstancesTruncateLogCall) Context(ctx context.Context) *InstancesTruncateLogCall
func (c *InstancesTruncateLogCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesTruncateLogCall) Fields(s ...googleapi.Field) *InstancesTruncateLogCall
func (c *InstancesTruncateLogCall) Header() http.Header
type InstancesTruncateLogRequest
func (s *InstancesTruncateLogRequest) MarshalJSON() ([]byte, error)
type InstancesUpdateCall
func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall
func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall
func (c *InstancesUpdateCall) Header() http.Header
type IpConfiguration
func (s *IpConfiguration) MarshalJSON() ([]byte, error)
type IpMapping
func (s *IpMapping) MarshalJSON() ([]byte, error)
type LocationPreference
func (s *LocationPreference) MarshalJSON() ([]byte, error)
type MaintenanceWindow
func (s *MaintenanceWindow) MarshalJSON() ([]byte, error)
type MySqlReplicaConfiguration
func (s *MySqlReplicaConfiguration) MarshalJSON() ([]byte, error)
type OnPremisesConfiguration
func (s *OnPremisesConfiguration) MarshalJSON() ([]byte, error)
type Operation
func (s *Operation) MarshalJSON() ([]byte, error)
type OperationError
func (s *OperationError) MarshalJSON() ([]byte, error)
type OperationErrors
func (s *OperationErrors) MarshalJSON() ([]byte, error)
type OperationsGetCall
func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall
func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall
func (c *OperationsGetCall) Header() http.Header
func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall
type OperationsListCall
func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall
func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error)
func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall
func (c *OperationsListCall) Header() http.Header
func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall
func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall
func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall
func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error
type OperationsListResponse
func (s *OperationsListResponse) MarshalJSON() ([]byte, error)
type OperationsService
func NewOperationsService(s *Service) *OperationsService
func (r *OperationsService) Get(project string, operation string) *OperationsGetCall
func (r *OperationsService) List(project string, instance string) *OperationsListCall
type ReplicaConfiguration
func (s *ReplicaConfiguration) MarshalJSON() ([]byte, error)
type RestoreBackupContext
func (s *RestoreBackupContext) MarshalJSON() ([]byte, error)
type RotateServerCaContext
func (s *RotateServerCaContext) MarshalJSON() ([]byte, error)
type Service
func New(client *http.Client) (*Service, error)
type Settings
func (s *Settings) MarshalJSON() ([]byte, error)
type SslCert
func (s *SslCert) MarshalJSON() ([]byte, error)
type SslCertDetail
func (s *SslCertDetail) MarshalJSON() ([]byte, error)
type SslCertsCreateEphemeralCall
func (c *SslCertsCreateEphemeralCall) Context(ctx context.Context) *SslCertsCreateEphemeralCall
func (c *SslCertsCreateEphemeralCall) Do(opts ...googleapi.CallOption) (*SslCert, error)
func (c *SslCertsCreateEphemeralCall) Fields(s ...googleapi.Field) *SslCertsCreateEphemeralCall
func (c *SslCertsCreateEphemeralCall) Header() http.Header
type SslCertsCreateEphemeralRequest
func (s *SslCertsCreateEphemeralRequest) MarshalJSON() ([]byte, error)
type SslCertsDeleteCall
func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall
func (c *SslCertsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall
func (c *SslCertsDeleteCall) Header() http.Header
type SslCertsGetCall
func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall
func (c *SslCertsGetCall) Do(opts ...googleapi.CallOption) (*SslCert, error)
func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall
func (c *SslCertsGetCall) Header() http.Header
func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall
type SslCertsInsertCall
func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall
func (c *SslCertsInsertCall) Do(opts ...googleapi.CallOption) (*SslCertsInsertResponse, error)
func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall
func (c *SslCertsInsertCall) Header() http.Header
type SslCertsInsertRequest
func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error)
type SslCertsInsertResponse
func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error)
type SslCertsListCall
func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall
func (c *SslCertsListCall) Do(opts ...googleapi.CallOption) (*SslCertsListResponse, error)
func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall
func (c *SslCertsListCall) Header() http.Header
func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall
type SslCertsListResponse
func (s *SslCertsListResponse) MarshalJSON() ([]byte, error)
type SslCertsService
func NewSslCertsService(s *Service) *SslCertsService
func (r *SslCertsService) CreateEphemeral(project string, instance string, sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest) *SslCertsCreateEphemeralCall
func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall
func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall
func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall
func (r *SslCertsService) List(project string, instance string) *SslCertsListCall
type Tier
func (s *Tier) MarshalJSON() ([]byte, error)
type TiersListCall
func (c *TiersListCall) Context(ctx context.Context) *TiersListCall
func (c *TiersListCall) Do(opts ...googleapi.CallOption) (*TiersListResponse, error)
func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall
func (c *TiersListCall) Header() http.Header
func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall
type TiersListResponse
func (s *TiersListResponse) MarshalJSON() ([]byte, error)
type TiersService
func NewTiersService(s *Service) *TiersService
func (r *TiersService) List(project string) *TiersListCall
type TruncateLogContext
func (s *TruncateLogContext) MarshalJSON() ([]byte, error)
type User
func (s *User) MarshalJSON() ([]byte, error)
type UsersDeleteCall
func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall
func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall
func (c *UsersDeleteCall) Header() http.Header
type UsersInsertCall
func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall
func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall
func (c *UsersInsertCall) Header() http.Header
type UsersListCall
func (c *UsersListCall) Context(ctx context.Context) *UsersListCall
func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error)
func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall
func (c *UsersListCall) Header() http.Header
func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall
type UsersListResponse
func (s *UsersListResponse) MarshalJSON() ([]byte, error)
type UsersService
func NewUsersService(s *Service) *UsersService
func (r *UsersService) Delete(project string, instance string, host string, name string) *UsersDeleteCall
func (r *UsersService) Insert(project string, instance string, user *User) *UsersInsertCall
func (r *UsersService) List(project string, instance string) *UsersListCall
func (r *UsersService) Update(project string, instance string, name string, user *User) *UsersUpdateCall
type UsersUpdateCall
func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall
func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error)
func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall
func (c *UsersUpdateCall) Header() http.Header
func (c *UsersUpdateCall) Host(host string) *UsersUpdateCall


text:
Q: Undocumented error 86 on twitter rest api i have an Android/Iphone app that retrieves data from Twitter rest api 1.1.
A week ago the android app stops working, it gets this
Response code 200
{"token_type":"bearer","access_token":"AAAAAAAAAAAAAAAAAAA***UQAAAAAA1Zs8c********2BOb2tCc%3D3ZnSGsQXhWUKow4c3******M1ZNVIBw1l***SJ6w9X"}

    Response code 400
    {"errors":[{"code":86,"message":"This method requires a GET or HEAD."}]}

U can see im getting a bearer token and then i get that from my api call to
https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=dualbooks_es

Here the code:
private static String encodeKeys() {
    try{
    // URL encode the consumer key and secret
    String urlApiKey = URLEncoder.encode(CONSUMER_KEY, "UTF-8");
    String urlApiSecret = URLEncoder.encode(CONSUMER_SECRET, "UTF-8");

    // Concatenate the encoded consumer key, a colon character, and the
    // encoded consumer secret

    String combined = urlApiKey + ":" + urlApiSecret;

    // Base64 encode the string
    String base64Encoded = Base64.encodeToString(combined.getBytes(), Base64.NO_WRAP);

    return base64Encoded;
    }catch(Exception ex)
    {
        ex.printStackTrace();
    }
    return "";
}

// Constructs the request for requesting a bearer token and returns that token as a string
private static String requestBearerToken(String endPointUrl){
    HttpsURLConnection connection = null;
    String encodedCredentials = encodeKeys();

    try {
        URL url = new URL(endPointUrl);
        connection = (HttpsURLConnection) url.openConnection();
        connection.setDoOutput(true);
        connection.setDoInput(true);
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Authorization", "Basic " + encodedCredentials);
        connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
        connection.setUseCaches(false);

        writeRequest(connection, "grant_type=client_credentials");

        // Parse the JSON response into a JSON mapped object to fetch fields from.
        JSONObject obj = (JSONObject)JSONValue.parse(readResponse(connection));

        if (obj != null) {
            String tokenType = (String)obj.get("token_type");
            String token = (String)obj.get("access_token");
            return ((tokenType.equals("bearer")) && (token != null)) ? token : "";
        }
        return new String();
    }
    catch (Exception ex) {
        ex.printStackTrace();
    }
    finally {
        if (connection != null) {
            connection.disconnect();
        }
    }
    return "";
}

// Fetches the first tweet from a given user's timeline
private static JSONArray fetchTimelineTweet(String endPointUrl){
    HttpsURLConnection connection = null;
    try {
        URL url = new URL(endPointUrl);
        connection = (HttpsURLConnection) url.openConnection();
        connection.setDoOutput(true);
        connection.setDoInput(true);
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Host", "api.twitter.com");
        connection.setRequestProperty("User-Agent", "Espartapp");
        connection.setRequestProperty("Authorization", "Bearer " + bearerToken);
        connection.setUseCaches(false);

        // Parse the JSON response into a JSON mapped object to fetch fields from.
        JSONArray obj = (JSONArray)JSONValue.parse(readResponse(connection));

        if (obj != null) {
            return obj;
        }
        return null;
    }
    catch (Exception e) {
        e.printStackTrace();
        return null;
    }
    finally {
        if (connection != null) {
            connection.disconnect();
        }
    }
}

// Reads a response for a given connection and returns it as a string.
private static String readResponse(HttpsURLConnection connection) {
    try {
        StringBuilder str = new StringBuilder();
        BufferedReader br;
        Log.d("Respose code", "Code "+connection.getResponseCode());
        if(connection.getResponseCode() !=200)
        {
        br = new BufferedReader(new InputStreamReader(connection.getErrorStream()));
        String line = "";
        while((line = br.readLine()) != null) {
            str.append(line + System.getProperty("line.separator"));
        }
        Log.d("codigo != 200", ""+str.toString());
        }
        else{
            br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            String line = "";
            while((line = br.readLine()) != null) {
                str.append(line + System.getProperty("line.separator"));
            }
            Log.d("codigo == 200", str.toString());
        }
        return str.toString();
    }
    catch (Exception e) { e.printStackTrace(); }
    return new String();
}

That error code its no listed here: https://dev.twitter.com/docs/error-codes-responses at the bottom of the page.
Iphone APP is doing exactly the same and works fine, this was working since last week.
I can post Objective-C code if u want.
I feel really lost on this.
Thanks in advance.

A: So nobody knows anything about this.
I found the solution.
   connection.setDoOutput(false);
   connection.setDoInput(true);

setDoOutput should be false for the request.
That solves the error.


text:
Q: Can't Multiply Sequence by Non-Int Python number_of_people = input("Enter number of people attending the picnic: ")
if number_of_people.isnumeric():

    number_of_donuts = input("Enter number of donuts each person will want: ")
    if number_of_donuts.isnumeric():

        min_box = (number_of_people * number_of_donuts ) // 12
        box_remainder = (number_of_people * number_of_donuts ) % 12
        if box_remainder != 0:
            min_box = min_box + 1

        print("Minimum boxes of donuts needed: ", min_box)

        donuts_left = (min_box * 12) - (number_of_people * number_of_donuts )
        print("Donuts left over:", donuts_left)

        if min_box <= 5:
            donut_cost = 8 * min_box
        elif min_box <= 20:
            donut_cost = 7.50 * min_box
        else:
            donut_cost = 6 * min_box

        print ("Donuts cost: ",format(donut_cost, '.2f'))

    else:
        print(number_of_donuts, "is not a valid number")

else:
    print (number_of_people, "is not a valid number")

I'm really confused. I want to be able to tell the person that they are entering a wrong input, but if I change the input to int(input. I wouldn't know how to notify the user if they aren't putting an int.
The error I receive
TypeError: can't multiply sequence by non-int of type 'str'

A: I assume the issue is on this line?
donuts_left = (min_box * 12) - (number_of_people * number_of_donuts )

I think the issue is that number_of_people and number_of_donuts are both strings, but you probably want to be dealing with numbers.
Try the below. (I added the x = int(x) lines to convert the strs to ints.)
number_of_people = input("Enter number of people attending the picnic: ")
if number_of_people.isnumeric():
    number_of_people = int(number_of_people)

    number_of_donuts = input("Enter number of donuts each person will want: ")
    if number_of_donuts.isnumeric():
        number_of_donuts = int(number_of_donuts)

        min_box = (number_of_people * number_of_donuts ) // 12
        box_remainder = (number_of_people * number_of_donuts ) % 12
        if box_remainder != 0:
            min_box = min_box + 1

        print("Minimum boxes of donuts needed: ", min_box)

        donuts_left = (min_box * 12) - (number_of_people * number_of_donuts )
        print("Donuts left over:", donuts_left)

        if min_box <= 5:
            donut_cost = 8 * min_box
        elif min_box <= 20:
            donut_cost = 7.50 * min_box
        else:
            donut_cost = 6 * min_box

        print ("Donuts cost: ",format(donut_cost, '.2f'))

    else:
        print(number_of_donuts, "is not a valid number")

else:
    print (number_of_people, "is not a valid number")


text:
Q: How to convert column value to array from csv python hallo sorry for my bad English, I want to convert my pixels column to separated numpy array for every row (if read using pandas dataframe it columns values will be read as array).
this is example of my dataset, I have tried split every row of pixels for every space, but because of the dataset is about 35.000 data and the pixels value are long, so the pandas going error

target, pixels
0, 12 14 14 16 29 30 29 39 50 60 12 10 0 29 40 14
1, 13 15 15 17 25 32 23 31 59 62 17 19 1 22 20 20
2, 12 16 16 18 32 33 22 45 23 12 12 10 2 50 45 13

to
(if read by dataframe)

target, pixels
0, array[12,14,14,16,29,29,39,50,60,12,10,0,29,40,14]
1, array[13,15,15,17,25,32,23,31,59,62,17,19,1,22,20,20]
2, array[12,16,16,18,32,33,22,45,23,12,12,10,2,50,45,13]

A: Not very much clear on your question, but hope below suggestion will help,
Try to convert the column in matrix
--load it into a numpy array and reshape it so that it is in desired dimensional
I think for image pixle data, Digit Recognizer problem on MNIST data is very helpful
Give a look to kaggle kernal
[https://www.kaggle.com/aman9d/digit-recognizer-svm-88-3-data-visualization/data][1]

A: There maybe other methods that is more memory efficient, but I came up with a simple solution like this:
l = [] # this will be a storage list for your array
for n, row in enumerate(df.index):
    df.iloc[row, :] = l[n]

Then you can access the separated array in the list l


text:
Q: Calling a C compiler within Matlab in Windows Matlab provides the shell escape command with the character !.
When I'm working with Matlab in Linux with GCC installed, I can use the following commands to compile a .c function and execute it:
!gcc the_c_function.c -o the_executable_file_name
!./ the_executable_file_name

If I have SDK in Windows, is there an analogous command I could use?

A: The exclamation mark is equivalent to system() in all OS.
Essentially it runs whatever is after it in the OS command line. ! is not gcc or anything specific, you can run !ls, or !cd .., or any other thing that command line would understand.  Therefore if you know how to compile your code and run from command line, its the same in MATLAB.
The SDK in MATLAB is a different stuff that is not at all related to the commands in your question. It allows you to compile MATLAB code, and make a library out of it.


text:
Q: $\exp(a)\exp(b) = \exp(a+b)$ I found this in the prologue of Rudin's book.  The formula tries to relate this exponential addition using power series.  It is clear that if we start from the right we can write it as a sum of binomial expansion terms divided by factorial.
If we come from the left, I am a bit vexed.  Working out the terms by hand
(1 + a + a^2/2 + a^3/6 + a^4/24 + a^5/120 + ...)(1 + b + b^2/2 + b^3/6 + b^4/24 + b^5/120 + ...) =
 1 + b + b^2/2 + b^3/6 + b^4/24 + b^5/120 + ... +
 a + ab + ab^2/2 + ab^3/6 + ab^4/24 + ab^5/120 + ... +
(a^2 + a^2b + a^2b^2/2 + a^2b^3/6 + a^2b^4/24 + a^2b^5/120 + ... +)/2
(a^3 + a^3b + a^2b^3/2 + a^3b^3/6 + a^3b^4/24 + a^3b^5/120 + ... +)/6

Here I am just factoring each term of exp(a) series with the entire series of exp(b).
(a+b)^0/1 = 1
(a+b)^1/1 = a + b
(a+b)^2/2 = a^2/2 + ab + b^2/2
(a+b)^3/6 = a^3/6 + a^2*b/2 + a*b^2/2 + b^3/6

I am able to visually see that if we take diagonals each one works out to a binomial expansion divided by factorial.
What is the actual mathematical concept for this?  It looks possibly related to Pascal's triangle.

A: Let us start writing $\exp(x+y)$ as power series, and use the binomial theorem to expand $(x+y)^n$:
$$\begin{align}
e^{x+y}
&= \sum_{n\geqslant 0}\frac1{n!}(x+y)^n\\
&= \sum_{n\geqslant 0}\frac1{n!}\sum_{j=0}^n \binom nj x^j y^{n-j}\\
\end{align}$$
Now denote $f(x)[x^k]$ as the coefficient at $x^k$ in the power series expansion of $f(x)$. Applying $[x^k]$ to the series above, the inner sum reduces to just one term at most due to $j\stackrel!=k$:
$$\begin{align}
e^{x+y}[x^k]
&= \sum_{n\geqslant k}\frac1{n!} \binom nk y^{n-k}\\
&\stackrel{1.}= \sum_{n\geqslant 0}\frac1{(n+k)!} \binom {n+k}k y^n\\
&\stackrel{2.}= \frac 1{k!} \sum_{n\geqslant 0}\frac{k!}{(n+k)!} \frac{(n+k)!}{k!n!} y^n\\
&= \frac 1{k!} \underbrace{\sum_{n\geqslant 0}\frac{1}{n!}y^n}_{\displaystyle{=e^y}}\\
\end{align}$$

*

*Replace the summation index as $n\mapsto n+k$.

*Extends by $k!$, and expands the binomial coefficient.
The last line is what we wanted to show because
$$\begin{align}
e^x e^y
&= \left(\sum_{k\geqslant 0}\frac{x^k}{k!}\right)\left(\sum_{n\geqslant 0}\frac{y^n}{n!}\right)\\
&= \sum_{k\geqslant 0}\left(\frac{1}{k!}\sum_{n\geqslant 0}\frac{y^n}{n!}\right)x^k\\
\end{align}$$
$$\begin{align}
\end{align}$$
$$\begin{align}
\end{align}$$

A: Yes, this is absolutely Pascal's triangle.
On one hand, you expand the powers $(a+b)^n$ divided by $n!$, giving coefficients $\dfrac{\displaystyle\binom nk}{n!}=\dfrac1{k!(n-k)!}$.
On the other, you form products like $\dfrac{a^k}{k!}\dfrac{b^j}{j!}$ and group all terms such that $k+j=n$ or $j=n-k$.


text:
Q: Parsing JSON returns NULL iOS I'm trying to parse the JSON string:
array(3) {
  ["result"]=>
  string(7) "success"
  ["source"]=>
  string(12) "setWorldTime"
  ["success"]=>
  bool(true)
}

With this code:
SBJsonParser *parser = [[SBJsonParser alloc] init];

    // Prepare URL request to download statuses from Twitter
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://localhost/con.php?m=setWorldTime&a=London,0"]];

    // Perform request and get JSON back as a NSData object
    NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];

    // Get JSON as a NSString from NSData response
    NSString *json_string = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
    NSLog(json_string);
    // parse the JSON response into an object
    // Here we're using NSArray since we're parsing an array of JSON status objects
    NSDictionary *statuses = [parser objectWithString:json_string error:nil];
    NSLog(@"OK: %@", [[statuses objectForKey:@"array"] objectForKey:@"result"]);

But instead of output 'OK: success' it outputs 'OK: (null)'
If you need the PHP script I can post it.

A: That string you have is anything but JSON... looks like var_dump() or something from PHP.  That's why it can't be parsed.
You need to use json_encode() on your PHP end instead.


text:
Q: Silverlight 3 - Elements inside an element dont arrange sometimes I have a grid/canvas that has an element (say an icon with an image and text overlayed) added to it dynamically via code.
Most of the time it renders correctly when added (content is aligned properly inside it),
but sometimes all the content sits in one corner.
I can remove/add/remove/add/remove/add and it will eventually do it
After a movement of the parent canvas, the element corrects itself as if the layout has been updated.
I have tried the following on Loaded and OnApplyTemplate for both the element and the element parent but it still seems to happen occasionally

*

*InvalidateMeasure()

*InvalidateArrange()

*UpdateLayout()

Any ideas on why the content wouldn't arrange would be appreciated cause its driving me nuts

A: I'm not sure why it works for you sometimes but not others.  But a grid has the inherent ability to dynamically resize itself and its contents.  A canvas doesn't (you'd have to handle that manually in code).
If you change your canvas to a grid does it work?  A grid has slightly more overhead than a canvas but it sounds to me like you need its functionality anyway.


text:
Q: Is it possible to stop pcap-parser before the end of the file I've been using npm pcap-parser to, obviously, parse PCAP files.  https://www.npmjs.com/package/pcap-parser.  Sometimes I am looking at a very large PCAP file and I only need to analyze the first few (hundred, or thousand) packets.
Is it possible to stop the parser from reading the entire file?  The events it emits are packet, end, and error, so I can't figure out how to stop it from going back to get the next packet, every time.  I'd like to be able to tell it to stop, if possible.

A: Not a lot of answers here, so not sure there is much interest, but just in case, I figured out how to do this.
Assume you are parsing an input file:
var parser = pcapp.parse(inFile);
As the parser begins to scroll through the file and identify packets, you define a function called (for example) "onPacket" to tell it what to do with each packet:
parser.on('packet', onPacket);
At any point as the parser is handling packets, you can remove this listener using the following:
parser.removeListener('packet',onPacket);
That also seems to cause the parser to emit an "end", which will take the code to whatever you have defined for parser.on('end',endFunction)
Reference for handling Events and Listeners is here:
https://nodejs.org/api/events.html#events_emitter_removelistener_eventname_listener


text:
Q: Large increase in speed by removing object mapping from database call You can see my code at: https://gist.github.com/anonymous/da0d2b99e5adf7db5e08
I'm using Entity Framework 6/LINQ with C# in an ASP.NET MVC project. The database is MySQL.
It appears when I split object mapping out of the database calls, it increases speed by more than 2x (4000ms for 1000 iterations vs 1600ms for 1000 iterations). I've tried switching the order and precaching the database calls (I'm not sure if they cache, but I tried), with no change in results. The object lists(returnList1 and returnList2) that the test cases output seem to be the same.
A) Have I messed up my test cases or are these results accurate?
B) If I haven't messed up my test cases, why wouldn't test #1 just compile to code similar to test #2, are there certain benefits of test 1 over test 2?

A: I'm answering my question because I also asked the question other places, and recieved helpful answers. It is likely due to Cold vs. Warm Query Execution, as you can see on msdn.
Also, the comments suggesting using a plugin to watch DB queries were interesting, however simply removing toList from a Linq To Entities query that is formatted the way it was in my question shows the relevant raw mysql query.


text:
Q: How do I add create Menu to my Facebook Bot using the Bot Framework I've a sample bot using Microsoft's .NET Bot framework.
I would like to create a menu to Facebook messenger.
What text do I need to append and how to catch the option that the user selected?
This is what I have right now:
strReplyMessage.Append($"Hello, I am **TestBot** Bot");
strReplyMessage.Append($"\n");
strReplyMessage.Append($"You can say anything");
strReplyMessage.Append($"\n");
strReplyMessage.Append($"to me and I will repeat it back");
strReplyMessage.Append($"\n\n");
strReplyMessage.Append($"What is your name?");

Any clue?

A: Here you will find an example on how to use a PromptChoice.
I pasted the below for your convenience.
How to call it
PromptDialog.Choice(context, this.OnOptionSelected, new List<string>() { FlightsOption, HotelsOption }, "Are you looking for a flight or a hotel?", "Not a valid option", 3);

How to get the selected option
        private async Task OnOptionSelected(IDialogContext context, IAwaitable<string> result)
        {
            try
            {
                string optionSelected = await result;

                switch (optionSelected)
                {
                    case FlightsOption:
                        context.Call(new FlightsDialog(), this.ResumeAfterOptionDialog);
                        break;

                    case HotelsOption:
                        context.Call(new HotelsDialog(), this.ResumeAfterOptionDialog);
                        break;
                }
            }
            catch (TooManyAttemptsException ex)
            {
                await context.PostAsync($"Ooops! Too many attemps :(. But don't worry, I'm handling that exception and you can try again!");

                context.Wait(this.MessageReceivedAsync);
            }
        }

A: Alternative you can adding a KeyboardCard.

KeyboardCard (string text, IList< CardAction > buttons)

Parameters

*

*text  The keyboard text.

*buttons    The buttons in keyboard.