text:
Q: Gradle 4.10 to gradle 6.8 upgrade issue - Failed to build I have currently springboot 2.2.x running with Gradle 4.10. I want to upgrade spring boot version to SPRING-BOOT 2.5.x in order to fix vulnerabilities. As spring boot 2.5.x requires Gradle 6.8.x and above, I am updating gradle version to 6.8 in gradle-wrapper.properties inside gradle/wrapper folder. When I run gradlew clean build, it successfully downloads gradle-6.8. then gives me this error:

*

*What went wrong:
A problem occurred configuring project ':my-app'.

Failed to create Jar file /Users/dbehf/.gradle/caches/jars-8/f82f8221a548705e1ea731f1c10c2b16/groovy-all-2.5.0-beta-1.jar.

below is the error message with --stacktrace :
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':my-app'.
        at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:75)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:68)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.access$400(LifecycleProjectEvaluator.java:51)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.lambda$run$0(LifecycleProjectEvaluator.java:102)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:250)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$withProjectLock$3(DefaultProjectStateRegistry.java:310)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:213)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:310)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:291)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:249)
        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$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:63)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:721)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:151)
        at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:41)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:69)
        at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:46)
        at org.gradle.configuration.BuildTreePreparingProjectsPreparer.prepareProjects(BuildTreePreparingProjectsPreparer.java:56)
        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$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
        at org.gradle.configuration.BuildOperationFiringProjectsPreparer.prepareProjects(BuildOperationFiringProjectsPreparer.java:40)
        at org.gradle.initialization.DefaultGradleLauncher.prepareProjects(DefaultGradleLauncher.java:226)
        at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:163)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:148)
        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:124)
        at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:72)
        at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:67)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:213)
        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:31)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
        at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:77)
        at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:49)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:44)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.lambda$execute$0(InProcessBuildActionExecuter.java:54)
        at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:86)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:53)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)
        at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.lambda$execute$0(BuildTreeScopeLifecycleBuildActionExecuter.java:33)
        at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:49)
        at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:32)
        at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:27)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:104)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:55)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:64)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:37)
        at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.lambda$execute$0(SessionScopeLifecycleBuildActionExecuter.java:54)
        at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:67)
        at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:50)
        at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:36)
        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:59)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
        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)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
        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.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84)
        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.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.GradleException: Failed to create Jar file /Users/dbehf/.gradle/caches/jars-8/f82f8221a548705e1ea731f1c10c2b16/groovy-all-2.5.0-beta-1.jar.
        at org.gradle.internal.classpath.ClasspathBuilder.jar(ClasspathBuilder.java:47)
        at org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.instrument(InstrumentingClasspathFileTransformer.java:83)
        at org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.transform(InstrumentingClasspathFileTransformer.java:78)
        at org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.transform(InstrumentingClasspathFileTransformer.java:68)
        at org.gradle.internal.classpath.DefaultCachedClasspathTransformer$TransformFile.lambda$schedule$0(DefaultCachedClasspathTransformer.java:261)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: java.lang.ArrayIndexOutOfBoundsException

below are my plugin details:
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'org.sonarqube'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'spring-cloud-contract'
apply plugin: "org.flywaydb.flyway"

and
dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:2.5.12")
        classpath('org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2')
        classpath("io.spring.gradle:dependency-management-plugin:0.5.4.RELEASE")
        classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:1.2.2.RELEASE"
        classpath "org.springframework.cloud:spring-cloud-contract-spec-pact:1.2.2.RELEASE"
        classpath 'au.com.dius:pact-jvm-model:2.4.18'
        classpath 'org.codehaus.groovy:groovy-all:2.5.0-beta-1'
        classpath 'org.flywaydb:flyway-gradle-plugin:3.2.1'
    }

Is there anything I am missing ? With the old gradle version and old spring boot version I don't see this error.
Thank you in advance.


text:
Q: Wordpress Page - Combine with firebase auth and firestore PHP I've developed an mobile App with react native where I am using firebase as backend.
Now I am developing a website with wordpress for that app and I need to use the firebase database (firestore) and authentification in my website.
So I have a registration form on my website and I am using an action hook to get the data, the user entered in.
Now I want to use that data and authenticate the user with firebase auth.
I used the firebase functions in Javascript for now in my app but for that case I need PHP.
I think Firebase-Admin-SDK for PHP is the correct choose.
https://firebase-php.readthedocs.io/en/latest/
Unfortunately I don't really know how to use that.
I created a wordpress plugin with composer dependencies and uploaded it via FTP to my wordpress site. The plugin is also activated.
With the following code I try to create a dummy user in firebase.
Unfortunately there isn't any new record in my firebase.
I don't know why it doesn't work and I am pretty new to PHP and wordpress so I don't know how to solve this problem.
I know that the hook is getting called.
<?php
    /**
     * Plugin Name: Own Functions
     * Plugin URI:
     * Description: PHP code
     * Author: xxx
     * Version: 2.1.91
     * Text Domain: insert-php
     * Domain Path: /languages/
     * Author URI:
     */

    require __DIR__.'/vendor/autoload.php';

    use Kreait\Firebase\Factory;
    use Kreait\Firebase\ServiceAccount;

    $serviceAccount = ServiceAccount::fromJsonFile(__DIR__.'/google-service-account.json');

    $firebase = (new Factory)
    ->withServiceAccount($serviceAccount)
    ->create();

    $auth = $firebase->getAuth();

 add_action('swpm_front_end_registration_complete_user_data', 'registration_callback_firebase');
    function registration_callback_firebase ($member_info)
    {
        $userProperties = [
        'email' => 'user@example.com',
        'emailVerified' => false,
        'phoneNumber' => '+15555550100',
        'password' => 'secretPassword',
        'displayName' => 'John Doe',
        'photoUrl' => 'http://www.example.com/12345678/photo.png',
        'disabled' => false,
        ];

        $createdUser = $auth->createUser($userProperties);

        // This is equivalent to:

        $request = \Kreait\Auth\Request\CreateUser::new()
        ->withUnverifiedEmail('user@example.com')
        ->withPhoneNumber('+15555550100')
        ->withClearTextPassword('secretPassword')
        ->withDisplayName('John Doe')
        ->withPhotoUrl('http://www.example.com/12345678/photo.png');

        $createdUser = $auth->createUser($request);
}

Is this the correct attempt?
Or is it possible to call a javascript function (and pass the entered data) in this PHP action hook and do everything with javascript?
I would appreciate any tips if that's the right way or how I can achieve my goals.

redpajama_set_name: RedPajamaStackExchange


text:
Q: ion-nav-back-button is not working with views with parameters I am trying develop an app with ionic-framework and angularJS.
I have used $stateProvider and $urlRouterProvider for navigation among the view. I have ion-nav-back-button on the page, to navigate to previous view in the history.
This is my routing logic,
$stateProvider
      .state('sideMenu', {
          url: "/SideMenu",
          abstract: true,
          templateUrl: "Templates/SideMenu.html",
          controller: 'homeCtrl'
      })
.state('sideMenu.relations', {
         cache: true,
         url: "/Relations/:id",
         views: {
             'contentView': {
                 templateUrl: "Templates/Relations.html",
                 controller: "relationCtrl"
             }
         }
     });
 //only required navigation is shown here
  $urlRouterProvider.otherwise("/SideMenu/Suggestions");

My problem is, ion-nav-back-button works Okay for the view without parameters. But if I go ahead of the view having parameter, it won't come back on the view in the history. Instead it goes to default page.
For example, If go to next view from "Relation.html" view, which is having "id" as parameter, On next view I can see back-button. But If I click on that button it brings me to default page "Suggessions.html" instead of "Relation.html".
EDIT
$ionicHistory.goBack();

This code to go back using $ionicHistory is also not working. That means views with parameters not getting added to the History.
Can anyone suggest me, what should I do with views with parameter to be added in history?

A: Put only ":id" in url param. Like this:
.state('sideMenu.relations', {
     cache: true,
     url: "/:id",
     views: {
         'contentView': {
             templateUrl: "Templates/Relations.html",
             controller: "relationCtrl"
         }
     }
 });

A: from the documentation http://ionicframework.com/docs/api/directive/ionNavBackButton/
With custom inner markup and custom click action, using $ionicHistory:
<ion-nav-bar ng-controller="MyCtrl">
  <ion-nav-back-button class="button-clear"
    ng-click="myGoBack()">
    <i class="ion-arrow-left-c"></i> Back
  </ion-nav-back-button>
</ion-nav-bar>

The controller code
function MyCtrl($scope, $ionicHistory) {
  $scope.myGoBack = function() {
    $ionicHistory.goBack();
  };
}


text:
Q: Implementing Grey World in Javascript I am trying to implement Grey World algorithm in Javascript. I am going to use third party library like fabric.js. But all I need to know about this algorithm.
After gone through google I got Link1, Wikipedia and Using CPP. But I am not clear about this algorithm. If I got this with an example then I am sure I can implement that.
Could anyone please give some details with an example, It will be very helpful for me.


text:
Q: How to read data from data bag within a PIG script I have a databag which is the following format
{([ChannelName#{ (bigXML,[])}   ])}

*

*DataBag consists of only one item which is a Tuple.

*Tuple consists of only item that is Map.

*Map is of type  which is a map between channel names and values.

*Here is value is of type DataBag, which consists of only one tuple.

*The tuple consists of two items one is a charrarray (very big string) and other is a map

I have a UDF that emits the above bag.
Now i need to invoke another UDF by passing the only tuple within the DataBag against a given Channel from the Map.
Assuming there was not data bag and a tuple as
([ChannelName#{ (bigXML,[])}   ])
I can access the data using $0.$0#'StdOutChannel'
Now with the tuple inside a bag
{([ChannelName#{ (bigXML,[])}   ])}
If i do $0.$0.$0#'StdOutChannel'  (Prepend $0), i get the following error
 ERROR 1052: Cannot cast bag with schema bag({bytearray}) to map
How can I access data within a data bag?

A: Try to break this problem down a little.
Let's say you get your inner bag:
MYBAG = $0.$0#'StdOutChannel';

First, can you ILLUSTRATE or DUMP this?
What can you do with this bag? Usually FOREACH over the tuples inside.
A = FOREACH MYBAG {
    GENERATE $0 AS MyCharArray, $1 AS MyMap
};

ILLUSTRATE A; -- or if this doesn't work
DUMP A;

Can you try this interactively and maybe edit your question a little more with some details as a result of you trying these things.
Some editing hints for StackOverflow:

*

*put backticks around your code (`ILLUSTRATE`)

*indent code blocks by 4 spaces on each line


text:
Q: Python Regex - Stop at line with > 20 chars I have a letter in which I need to extract a certain part. The beginning and the ending is marked by clear beginning / ending expressions (letter_beg / letter_end). My problem is that the "recording" of the text needs to end before the first line with more than 20 chars just after the "match" of letter_end. In my code it does after 2 new lines. Here is my sample text and my code so far:
sample_text = """Some random text right here
.........
Dear Shareholders: We are pleased to provide you with this semiannual report for the fund.
Best regards
Douglas - Director
Other random text with more than 20 chars in this line    """

letter_begin = ["dear", "to our", "fellow investors"] # All expressions for "beginning" of Letter to the Shareholders (LttS)
openings = "|".join(letter_begin)
letter_end = ["sincerely", "best regards", "cordially,"] # All expressions for "ending" of Letter to the Shareholders (LttS)
closings = "|".join(letter_end)
regex = r"(?:" + openings + r")[\s\S]*?" + r"(?:" + closings + r").*(?:\n.*){0,2}"
output = re.findall(regex, text, re.IGNORECASE) # record all text between Regex (beginning and end expressions)
print(output)

A: I am not entirely sure what is your expected output, but it is quite simple to do this without regular expressions (an thus get rid of one problem).
The solution below assumes sample_text contains \n (line breakes) and will not work if sample_text is a one long line (i.e. without any \n).
sample_text = """Some random text right here
.........
Dear Shareholders: We are pleased to provide you with this semiannual report for the fund.
Best regards
Douglas - Director
Other random text with more than 20 chars in this line
"""

letter_begin = ["dear", "to our", "fellow investors"]
letter_end = ["sincerely", "best regards", "cordially,"]

lines = sample_text.strip().split("\n")

target_start_idx = None
target_end_idx = None

for index, line in enumerate(lines):
    line = line.lower()

    if any(line.startswith(beg) for beg in letter_begin):
        target_start_idx = index
        continue

    if any(line.startswith(end) for end in letter_end):
        target_end_idx = index
        break

if target_end_idx is not None:
    for index, line in enumerate(lines[target_end_idx + 1 :]):
        if len(line) >= 20:
            target_end_idx += index
            break

if target_start_idx is not None and target_end_idx is not None:
    target = "\n".join(lines[target_start_idx : target_end_idx + 1])
    print(target)

The output is
Dear Shareholders: We are pleased to provide you with this semiannual report for the fund.
Best regards
Douglas - Director

EDIT
Based on your last comment I can think of two ways to do this. Hopefully one of them will solve your problem.
Option 1
sample_text = """Some random text right here
.........
Dear Shareholders: We are pleased to provide you with this semiannual report for the fund.
Best regards
Douglas - Director
Other random text with more than 20 chars in this line
.........
Dear Shareholders: We are pleased to provide you with this semiannual report for the fund.
Best regards
Douglas - Director
Other random text with more than 20 chars in this line
"""

letter_begin = ["dear", "to our", "fellow investors"]
letter_end = ["sincerely", "best regards", "cordially,"]

lines = sample_text.strip().split("\n")

target_start_indexes = []
target_end_indexes = []

for index, line in enumerate(lines):
    line = line.lower()

    if any(beg in line for beg in letter_begin):
        target_start_indexes.append(index)
        continue

    if any(end in line for end in letter_end):
        target_end_indexes.append(index)
        continue

for target_index, target_end_idx in enumerate(target_end_indexes):
    for line_index, line in enumerate(lines[target_end_idx + 1 :]):
        if len(line) >= 20:
            target_end_idx += line_index
            target_end_indexes[target_index] = target_end_idx
            break

target = []
if target_start_indexes and target_end_indexes:
    for target_start_idx, target_end_idx in zip(
        target_start_indexes, target_end_indexes
    ):
        target.append("\n".join(lines[target_start_idx : target_end_idx + 1]))

    print("\n".join(target))

Output
Dear Shareholders: We are pleased to provide you with this semiannual report for the fund.
Best regards
Douglas - Director
Dear Shareholders: We are pleased to provide you with this semiannual report for the fund.
Best regards
Douglas - Director

Option 2
sample_text = """Some random text right here
.........
Dear Shareholders: We are pleased to provide you with this semiannual report for the fund.
Best regards
Douglas - Director
Other random text with more than 20 chars in this line
.........
Dear Shareholders: We are pleased to provide you with this semiannual report for the fund.
Best regards
Douglas - Director
Other random text with more than 20 chars in this line
"""

letter_begin = ["dear", "to our", "fellow investors"]
letter_end = ["sincerely", "best regards", "cordially,"]

lines = sample_text.strip().split("\n")

target_start_idx = None
target_end_idx = None

for index, line in enumerate(lines):
    line = line.lower()

    if any(beg in line for beg in letter_begin):
        if target_start_idx is None:
            target_start_idx = index
            continue

    if any(end in line for end in letter_end):
        target_end_idx = index

if target_end_idx is not None:
    for index, line in enumerate(lines[target_end_idx + 1 :]):
        if len(line) >= 20:
            target_end_idx += index
            break

if target_start_idx is not None and target_end_idx is not None:
    target = "\n".join(lines[target_start_idx : target_end_idx + 1])
    print(target)

Output
Dear Shareholders: We are pleased to provide you with this semiannual report for the fund.
Best regards
Douglas - Director
Other random text with more than 20 chars in this line
.........
Dear Shareholders: We are pleased to provide you with this semiannual report for the fund.
Best regards
Douglas - Director

A: If you insist on using a monolithic regex, add a positive lookahead for a line containing more than 20 characters at the end:
(?=[^\n]{21,})

You may also need to add the re.DOTALL flag:
re.IGNORECASE | re.DOTALL


text:
Q: Nodeclipse's CPU utilization is very high I am using Mac (10.10.5) and I already have Eclipse Mars (4.5.2), and now I installed Nodeclipse 1.0.2 with Eclipse Marketplace and created a Nodejs project (reactjs), and then I found the CPU utilization of Eclipse is very high(over 100%).
Can anyone let me know how to fix it? Thanks!!!

A: Raise an issue at https://github.com/Nodeclipse/nodeclipse-1/issues/
and give as much information as possible, e.g. steps you did before and screenshot for a moment when you saw 100% utilization.
It is also strange that you have 100% CPU utilization, as usually PC has 4 cores, so you would see 25% utilization for 1 problematic thread.


text:
Q: how to get rid of pop up on galaxy s4 I need to get rid of the Clash of Clans pop up. Every time I am on the phone talking, my cheek touches the screen and the games begins. I don't use my phone to play any games but my grandkids came during summer vacation and used my phone.

A: 1.Go to Settings
2.Select applications
3.Select clash of clans
Select the option that says Disable Notifications.


text:
Q: Is it possible with WPF to load a part of the UI in the background? I want to show a network in my WPF-Application.
But always the window freeze on rendering.
I use the Graphsharp-library for visualization.
The network is assembled in an extra thread. So it will probably be the renders.
So, is it possible with WPF to load a part of the UI in the background?
My Code:
    _graph = await Task.Run(()=> {
     var g = new BidirectionalGraph<object, IEdge<object>>();
    foreach (MyItem p in _myItemList)
    {
        g.AddVertex(p);
    }

    foreach (MyItem p in _myItemList)
    {
        foreach (MyItem n in p.Neighbors)
        {
            g.AddEdge(new Edge<object>(p, n));
        }
    }
    return g;
});
OnPropertyChanged("Graph");

XAML:
xmlns:graphsharp="clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls"
[...]

<graphsharp:GraphLayout
    Graph="{Binding ElementName=root, Path=Graph}"
    LayoutAlgorithmType="LinLog"
    OverlapRemovalAlgorithmType="FSA"
    HighlightAlgorithmType="Simple" />

A: NO operating system allows modifying the UI from another thread. In your case though you aren't trying to update the UI in the background, you are assembling the graph in the background and setting a property. There's no UI work here. If the rendering element binds to that property it will get the notification, read the property and update itself, all in the UI thread.
The code needs improvement though. Tasks aren't threads and there's no reason to use cold tasks and Task.Start() like that. Start() doesn't guarantee when a task will run. The task will still be scheduled for execution on the threadpool thread and possibly wait if there are no available threads there.
The code can be simplified to this :
var graph = await Task.Run(()=> {
    var g = new BidirectionalGraph<object, IEdge<object>>();
    foreach (MyItem p in _myItemList)
    {
        g.AddVertex(p);
    }

    foreach (MyItem p in _myItemList)
    {
        foreach (MyItem n in p.CallingList)
        {
            g.AddEdge(new Edge<object>(p, n));
        }
    }
    return g;
};

_graph = graph;
 OnPropertyChanged("Graph");

A better idea wold be to use a proper property instead of modifying fields and raising the event :
public BidirectionalGraph Graph
{
    get => _graph;
    set
    {
        _graph=value;
        OnPropertyChanged(nameof(Graph));
    }
}
...
public async Task MyGraphMethod()
{
    Graph=graph;
}

UPDATE
The real question seems to be why does GraphLayout take so long to display the graph?
Set the AsyncCompute property of GraphLayout to true :
<graphsharp:GraphLayout
    Graph="{Binding ElementName=root, Path=Graph}"
    LayoutAlgorithmType="LinLog"
    OverlapRemovalAlgorithmType="FSA"
    HighlightAlgorithmType="Simple"
    AsyncCompute = "true" />

GraphSharp was abandoned 6 years ago if not more. Codeplex itself shut down and now, the only available source code is either the archived source or forks on Github, like this one.
The examples on this repo show there is an AsyncCompute property that will run the layout algorithms in the background :
        <sample:MyGraphLayout x:Name="Layout" LayoutAlgorithmType="ISOM" OverlapRemovalAlgorithmType="FSA" Graph="{Binding}"
                              AsyncCompute="true" ShowAllStates="false" HighlightAlgorithmType="Simple">
            <sample:MyGraphLayout.LayoutParameters>
                <isom:ISOMLayoutParameters Width="1200" Height="1200" />
            </sample:MyGraphLayout.LayoutParameters>
        </sample:MyGraphLayout>

When AsyncCompute is true, the Layout() method of the control uses a BackgroundWorker to perform the operation in the background
This property exists in the original projects source archive as well.


text:
Q: C++ - What libraries or command line programs will I need to create a program that takes an AVI file and burns it to a DVD? My goal is to create a program that will take an AVI file as input and then do whatever is necessary to burn it to a DVD.
Currently, I use three separate programs to accomplish this. The first tool requires me to convert it from an AVI file to an MPEG. The second tool takes that MPEG and creates DVD files (a VIDEO_TS folder, with a few files inside of it). The third tool burns the folder to the DVD. I would like to combine these three tools into one, and if possible skip the AVI to MPEG conversion and just create the DVD files and burn them.
The target platform is Windows 7 and the language I'm going to use is C++.
What libraries or command line programs will help me on my quest for glory?
EDIT: To clarify, I want to create a video DVD to play movies on a DVD player. (Thanks Jerry)
EDIT 2: I ended up using Python on Linux to automate everything. Here is the script in case anyone needs it. (Note: this is my first python script so it probably isn't very good)
import sys
import os
import shutil
from subprocess import call

# step 1: call ffmpeg and convert the input avi to an mpeg-2
def avi_to_mpeg(input, output):
    return call(["ffmpeg", "-i", input, "-target", "ntsc-dvd", "-threads",  "4", output])

# step 2: create the xml file needed for dvdauthor
def create_xml_file(mpg_source, xml_file):
    with open(xml_file, "w") as file:
        file.write("<dvdauthor>\n")
        file.write("\t<vmgm />\n")
        file.write("\t<titleset>\n")
        file.write("\t\t<titles>\n")
        file.write("\t\t\t<pgc>\n")
        file.write("\t\t\t\t<vob file=\"" + mpg_source + "\" />\n")
        file.write("\t\t\t</pgc>\n")
        file.write("\t\t</titles>\n")
        file.write("\t</titleset>\n")
        file.write("</dvdauthor>\n")
    return os.path.isfile(xml_file)

# step 3: invoke dvdauthor
def author_dvd(mpg_source):
    return call(["dvdauthor", "-o", "mkdvd_temp", "-x", xml_file])

# step 4: finally, burn the files to the dvd
def burn_dvd(dvd_target):
    return call(["growisofs", "-Z", dvd_target, "-dvd-video", "mkdvd_temp"])

# step 5: clean up the mess
def clean_up(mpg_source, xml_file):
    shutil.rmtree("mkdvd_temp")
    os.remove(mpg_source)
    os.remove(xml_file)

def eject(dvd_target):
    return call(["eject", dvd_target])

def print_usage():
    print "mkdvd by kitchen"
    print "usage: mkdvd -s file.avi -t /dev/disc"
    print "  -s : Input .AVI file"
    print "  -t : Target disc, /dev/dvd for example"

def get_arg(sentinel):
    last_arg = ""
    for arg in sys.argv:
        if last_arg == sentinel:
            return arg
        last_arg = arg
    return None

# program start

avi_source = get_arg("-s") # input .avi file
dvd_target = get_arg("-t") # the disc to burn it to (/dev/dvd for example)

if avi_source == None or dvd_target == None:
    print_usage()
    sys.exit("Not enough parameters.")

if os.path.isfile(avi_source) == False:
    sys.exit("File does not exists (" + avi_source + ")")

mpg_source = avi_source + ".mpg"

if avi_to_mpeg(avi_source, mpg_source) != 0:
    sys.exit("Failed to convert the AVI to an MPG")

xml_file = mpg_source + ".xml"

if create_xml_file(mpg_source, xml_file) == False:
    sys.exit("Failed to create the XML file required by dvdauthor")

if author_dvd(mpg_source) != 0:
    sys.exit("Failed to create the DVD files")

if burn_dvd(dvd_target) != 0:
    sys.exit("Failed to burn the files to the disc")

print "mkdvd has finished burning " + avi_source + " to " + dvd_target
print "Cleaning up"

clean_up(mpg_source, xml_file)
eject(dvd_target)

A: I know you are using Windows, but here are the steps I take to create a DVD from multiple AVIs on linux.  The main three programs are ffmpeg to do the transcoding, dvdauthor to build the DVD filesystem, and growisofs to make a DVD image out of the DVD filesystem.  I think you can find windows binaries for each of them through Google (I was just able to rather quickly, but I don't want to paste all of the links).

*

*Transcode each avi:
ffmpeg -i <infile.avi> -target ntsc-dvd -threads 2 <outfile.mpg>

*Create xml file for DVD author:
Example:
<dvdauthor dest="dvd">
<vmgm>
</vmgm>
<titleset>
    <titles>
        <pgc>
            <vob file="<file1.mpg>" chapters="0,5:00,10:00,15:00,20:00,25:00,30:00,35:00,40:00" />
        </pgc>
        <pgc>
            <vob file="<file2.mpg>" chapters="0,5:00,10:00,15:00,20:00,25:00,30:00,35:00,40:00" />
        </pgc>
    </titles>
</titleset>
</dvdauthor>

*Create DVD file structure (will create it at the dest shown above):
dvdauthor -x <xmlfile.xml>

*Roll filesystem into an iso and burn it.
growisofs -Z /dev/dvd -dvd-video dvd/

where dvd/ is where the DVD filesystem was created.
This process could be automated fairly easily by just calling the correct command line programs and creating the dvdauthor xml file.  You'll want to read the documentation for dvdauthor to find out all the details about the xml file that defines your DVD.  You'll also probably have to replace /dev/dvd/ in the growisofs command to the windows DVD burner drive letter.
About your hope that you could skip the transcode from avi to mpeg-2: there is no way to do this and still make it compatible with the DVD standard which strictly requires MPEG-2 video in an MPEG-PS (Program Stream) container.

A: Try the Primo DVD components, they also have a mpeg-2 encoding library.
Alternatively, use ffmpeg library to cvonvert your avis.

A: The question is whether you want to create a video DVD (i.e. something that will play in a normal DVD player) or just save a file that happens to contain video to a data DVD disc.
If you want something that will play in a DVD player, then you'll need to transcode it from AVI into the MPEG 2 encoding that a DVD player expects, and then turn the MPEG2 bit stream into VOB files, and create the VIDEO_TS (and such) directories that are required for any DVD.
If you just want to burn the file to a data DVD, you can use (for one example) Microsoft's Image Mastering API (IMAPI); I believe version 2 of the API is current, so the main things you'll need to use will be the COM interfaces IFileSystemImage (to create an image file) and IDiscFormat2Data to write the data to the disc.


text:
Q: Jscroll is not working in chrome and safari I tried teh jScroll plugin by Kelvin Luck. First of all its a wonderful script. Its working fine with text, ie text as contents, in all browesers. But when we insert images in that the scroll is not working in Safari and Chrome... please help me. Am a beginner in javascrpt...:)
Retheesh

A: Another way of doing it is to initialise the plugin once the entire page is loaded
$(window).load(function(){
    $('.scroll-pane').jScrollPane();
})

A: Ok, this way late, but I just spent most of the day figuring this out.
It's actually quite simple and also sort of explained in the jScrollpane Demo pages...
Since I am using the Wordpress plugin, using the the workaround Dann provided seemed a bit to complicated. The solution here is setting the image height in your CSS file for this specific page instead of (or on top of) declaring them inline.
So basically if you have

>/div>

jScrollpane won't recognize the height of the pictures and count them for your div height. So you need to add a class to your div and define the img height in your CSS:
#mydiv .newclass img {
    height: 200px;
}

and it will work fine!

A: I had a similar problem.
Reinitialising the panel seemed to work.
I used this script:
$('.image_class').load(function () {
        $('.scroll-pane').jScrollPane();
});

Dann

A: It's a known issue, but Dann's workaround is effective. I ended up testing for the presence of troublesome images, since they weren't always present on the page and affecting the scroll area size:
   $(function() {
        if($('.image_class').size()) {
            $('.image_class').load(function() {
                $('.scroll-pane').jScrollPane();
            });
        } else {
            $('.scroll-pane').jScrollPane();
        }
    });


text:
Q: Javamail get all emails form a specific sender - Stack Overflow I am trying to get all the emails from a specific sender, say from@example.com, with JavaMail
I tried following
Folder inbox = store.getFolder("INBOX");
inbox.open(Folder.READ_ONLY);

SearchTerm sender = new FromTerm(new InternetAddress("from@example.com"));
Message[] messages = inbox.search(sender);`

But it's not giving me any of the mails. As I have multiple emails from such sender.
I know I can do it by reading all the emails from my INBOX first, then searching for such sender using getFrom()
Message[] arrayMessages = folderInbox.getMessages();

But it is not feasible.
How should I do this?

A: The POP3 protocol supports no server-side search. All the headers for all of the messages will be downloaded to the client and searched there, exactly as you would do yourself. Still, if you have messages from that sender, I would expect it to work.  The JavaMail debug output would show whether there really are messages from that sender.
Still the simpler and better solution would be to just switch to IMAP and let the server do the searching.


text:
Q: Grunt module to inject HTML templates Recently started using Grunt as a build tool for a web app I'm hobbyist developing. I have a series of HTML files (to be used as templates), in a single folder, that I'd like injected at a particular point in the  main HTML file.
Ideally, I could also wrap each file in a  tag, but having to manually include this in the template files themselves is acceptable.
Is there an existing Grunt module to perform this?
EDIT: I may have worded my problem poorly before. Essentially, I have a single HTML file where the app will run (Single page app, business simulation game). In a separate folder, I have a series of HTML templates. Each of these template represents a dialog, or custom info page, something of that nature. As the app is developed, more and more templates will be in this folder.
Rather than manually including each one in my page, I'd like a way to automate injecting them that I can manage through Grunt.

A: I may be late to answer this question, but for anyone that end up here, I found this grunt-plugins, maybe they help you too:

*

*grunt-replace.

*grunt-html-build.

*grunt-processhtml.


text:
Q: ExtJS 7.3.0 downloadable docs? Version 7.3.0 has been released but I cannot find the downloadable docs in the documentation center. Where should I look?

A: Sencha share offline docs up to extjs 6.2.0:
https://docs.sencha.com/misc/guides/offline_docs.html
Edited:
7.3.0 can be downloaded from:
https://docs.sencha.com/downloads/extjs-730-docs.zip


text:
Q: How to sort Json value in NSDictionary Objective c? I want to sort my nested Json array by location_name, My json is in nsdictionary
Json array is
apiResult:{
    Description = "List of Location";
    code = 200;
    locationList =     (
                {
            "location_id" = 481;
            "location_name" = "<null>";
            "pre_fixied" = "$3.00";
            "state_name" = Melbourne;
            status = 0;
            zone = "Zone 2";
            "zone_id" = 30;
        },
                {
            "location_id" = 461;
            "location_name" = "O'Halloran Hill";
            "pre_fixied" = "$5.00";
            "state_name" = Adelaide;
            status = 1;
            zone = "Zone 3";
            "zone_id" = 31;
        },
                {
            "location_id" = 460;
            "location_name" = "Sheidow Park";
            "pre_fixied" = "$5.00";
            "state_name" = Adelaide;
            status = 1;
            zone = "Zone 3";
            "zone_id" = 31;
        },
                {
            "location_id" = 459;
            "location_name" = "Hallett Cove";
            "pre_fixied" = "$5.00";
            "state_name" = Adelaide;
            status = 1;
            zone = "Zone 3";
            "zone_id" = 31;
        },
                {
            "location_id" = 458;
            "location_name" = "Eden Hills";
            "pre_fixied" = "$5.00";
            "state_name" = Adelaide;
            status = 1;
            zone = "Zone 3";
            "zone_id" = 31;
        },
                {
            "location_id" = 457;
            "location_name" = Glengowrie;
            "pre_fixied" = "$5.00";
            "state_name" = Adelaide;
            status = 1;
            zone = "Zone 3";
            "zone_id" = 31;
        }
    );
    message = "List of Location";
    status = Success;
}

its appearing by location id descending order i want this json by location name ascending order.
I have sort location list array separately but i want whole json and locationlist by locationname order

A: try this
locationDescriptor = [[NSSortDescriptor alloc] initWithKey:@"location_id" ascending:YES];
sortDescriptors = [NSArray arrayWithObject: locationDescriptor];
sortedArray = [myArray sortedArrayUsingDescriptors:sortDescriptors];

Now change sortedArray into any other format as required.

A: First short Location Array.
lets say your json result is NSDictionary *jsonResult; And filtered array is NSArray *filteredArray;
Then
    NSMutableDictionary *filteredJson = [NSMutableDictionary new];
    [filteredJson setObject:[jsonResult valueForKey:@"Description"] forKey:@"Description"];
    [filteredJson setObject:[jsonResult valueForKey:@"code"] forKey:@"code"];
    [filteredJson setObject:filteredArray forKey:@"locationList"];
    [filteredJson setObject:[jsonResult valueForKey:@"message"] forKey:@"message"];
    [filteredJson setObject:[jsonResult valueForKey:@"status"] forKey:@"status"];


text:
Q: How to Navigate all views of application using Navigation Controller in ios using Swift (I am using Xib not Storyboard) (I searched but could not find any working solution)
I have created 5 Xib's which are representing different screens of my application. Now I want to add navigation in my application so that user can go back and forth. I also want to pass data between view controllers. I have done this before, usinig Storyboard that was simple. But i do not have any idea how to do it with Xib.
I am using xcode 7.3 and swift 2.0
Proper guidelines will be highly appreciated thanks.

A: Try this. It may help you.
AppDelegate.swift
var window: UIWindow?
var nav:UINavigationController!

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
    let FirstVC = HomeViewController(nibName: "HomeViewController", bundle: nil) as HomeViewController
    let nav = UINavigationController(rootViewController: FirstVC)
    nav.navigationBarHidden = true
    self.window?.rootViewController = nav
    self.window?.makeKeyAndVisible()

    return true
}

Then when you want to push the other view controller , simple use following code to move to another view controller.
@IBAction func pushHomeVC(sender: UIButton)
{
     let homeVC = HomeViewController(nibName: "HomeViewController", bundle: nil) as HomeViewController
     // If you want to data pass in Second Screen.
     homeVC.strData = "Pass data that you want"
     let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
     appDelegate.nav.pushViewController(homeVC, animated: true)
}


text:
Q: How can I combine multiple CSV files with different column names and column order in Excel? I have 350+ CSV files I need to merge into one aggregate file. Using Power Query for Excel, I was able to easily merge all of the files in a few minutes. However, after inspection, not all of the files follow the same column order or name. For example, some files go by:
first, last, address, city, state, username

But some other files goes by:
address1, address2, city, state, last_name, first_name, age

Using Power Query, Excel, VBA, or something else - is there a way to effectively merge multiple multiple CSV files with different column names and column order? I tried searching online, but none of the solutions are related to what I was looking for (example).
The end result with the example above should look like this:
username, last_name, first_name, age, address1, address2, city, state

Any extra columns that don't exist in one sheet can be blank (or null) and the finalized column order doesn't matter because that can be rearranged later.

A: Similar to this related post, the Table.Combine function should do the trick, assuming you have headers to match columns with.
Load the CSV files in via Load from Folder, convert CSV to table format and promote headers, then combine with Table.Combine.
let
    Source = Folder.Files("C:\Path\To\Folder\With\CSVs"),
    #"Added Custom" = Table.AddColumn(Source, "CSV", each Table.PromoteHeaders(Csv.Document([Content]))),
    #"Combine CSVs" = Table.Combine(#"Added Custom"[CSV])
in
    #"Combine CSVs"


text:
Q: UITabViewController Tab Identification I have a simple iPhone app (modified from the UITabBarController project template) where each tab is a different set of data using the same view controller (similar to the iPod app).
So for example if each tab was a person's name and hitting it would display their friends. Then each tab would use the same view controller right?
My question now is how do I identify programmatically what tab just got pressed (and in what function) so I know to load the appropriate data. I see viewDidLoad called each time but how do I know what tab?

A: UITabBarController has a selectedIndex method which returns the index of the selected tab.

A: You can use UIToolbar instead. You can insert some UIBarButtonItems there. So you will know, what button has been clicked.


text:
Q: Adding outlets to iPhone View I am creating a custom iPhone View in MonoTouch through the interface builder in XCode (In monodevelop New File -> MonoTouch -> iPhone View).
When selecting a new iPhone View it creates an xib file, but no .h file is created, so how can I create outlets?
I usually drag an outlet from my label/button etc. to the .h file, but since it doesn't exist for this view, I don't know how to create the outlets.
Can someone point me in the right direction, since all articles on google are for the old versions, where outlets where created differently.

A: When you double-click a .xib in MonoDevelop, MonoDevelop will generate header files for your [Register]'d C# classes that subclass ObjC types and export them to a temporary Xcode project, where you can use Xcode to drag&drop Outlets and Actions.
Adding a new iPhone View file (.xib) does not auto-create any backing C# classes for you, it just creates the .xib, therefore MonoDevelop does not autogenerate any header files for you when you double-click the .xib.
When Xcode launches, you can manually create some Objective-C headers for this .xib and drag&drop outlets or actions to it (or you can create C# classes in MonoDevelop before double-clicking the .xib). When you switch back to MonoDevelop, MonoDevelop will "import" the header files, translating them into the equivalent C#.
While in Xcode, you can also add .xib's there and MonoDevelop will import those as well.

A: The Xamarin documentation has a good tutorial on this.  There is a section for Adding Outlets and Actions to the UI  using Interface Builder in Xcode4

Adding an Outlet In order to create the Outlet, use the following
  procedure:

*

*Determine for which control you want an Outlet.

*Hold down the Control key on the keyboard, and then drag from the control to an empty space in your code file after the @interface
  definition.


text:
Q: How to draw truly vertical or horizontal lines in PowerPoint I use PowerPoint for drawings and diagrams. When I try to add a vertical straight line, it is always slightly tilted (~2 degrees). I have the same problem when I am trying to draw a horizontal line (88 or 92 degrees rather than 90 degrees) I would like to force the line to be 0 degrees (truly vertical) or 90 degrees (truly horizontal). How can I do that?

A: The best solution is the line properties making 'size' zero width for verticals and zero height for horizontals.
The Ctrl/Shift still not working.

A: Go to view Tab, click on Grid settings and you get a dialogue box, where you check on the Snap objects to grid option, which usually enables 45° and 90°.
In case you want to increase or decrease snapping adjust the Spacing for the Grid settings in the same dialogue box.

A: Double click on the line and change the height to 0 in the "size" window (near the top right)

Note: if the height doesn't change, click on the down-arrow next to the height to force it to zero.
Note2: Sometimes for almost-horizontal lines, the height will say it is zero, even though it is not quite zero.  Click the down arrow and it will make it truly zero.

A: Hold down the shift key while drawing the line. In 2007 and probably 2010 you have to hold both the CTRL and the Shift keys down.
Also, if it is 2007 be sure and download SP2, there appears to have been a problem in SP1 which makes it impossible to draw a straight line (for some).

A: I'm using office 2013. As "Opsin" mentioned, you have to hold shift + ctrl both when drawing line. For me, this didn't worked on already draw line. You have to draw a new line while press both above keys.
Also, if you have already draw line (not straight line) and want to make it as vertical line follow below steps.
1. Click on that line
2. Select Format from top bar.
3. Click expand icon inside of size section
4. On new expand section, go to Size & Position section and under size set WIDTH to zero. (Please refer below screen capture)
Image
Note -: As "Scot" mentioned, you don't need to hold both Shift and Ctrl. Just hold Shift key only, when drawing straight line.

A: at a guess, try holding ctrl down when drawing. Alot of packages use it to lock the line to 90 and 45 angles.

A: With PowerPoint for Mac 2016, the key combination is Command+Shift and then draw the line. The line will rotate in 45° increments as you draw.


text:
Q: Jquery autocomplete _renderItem is not working _renderItem is not executing at all, tried with console.log too no messages printed. Tried with 'autocomplete', 'ui-autocomplete', 'Autocomplete' attributes no hope.
In addition I could not understand the purpose of "response with map functions", so disabled it.
$(document).ready(function () {

myVars.shId = $('#dataVar').attr('sh-data');

///// search ////// http://jsbin.com/xavatajiku/edit?js,output
console.log(myVars.shId);
$('#name-list').autocomplete({

        source: function (request, response) {
            $.ajax({
                url: myVars.czbUrl,
                data: { searchText: request.term, maxResults: 10, shopId: myVars.shId },
                dataType: "json",
                success: function (data) {
                    console.log(data);
                    /*response($.map(data, function (item) {
                        console.log(data);
                        return {

                            value: item.product_name,
                            avatar: item.pfimage_thumb,
                            rep: item.product_name,
                            selectedId: item.url
                        };
                    }))*/
                }
            })
        },
        select: function (event, ui) {

                             alert(ui.item ? ("You picked '" + ui.item.label)
                                                      : "Nothing selected, input was " + this.value);

            return false;
        }
    }).autocomplete( "instance" )._renderItem = function (ul, item) {
        console.log('test');
        /*var inner_html = '

 Reputation:  ' + item.volume + '

' + item.product_name + '

';
        return $("

")
                .data("ui-autocomplete-item", item)
                .append(inner_html)
                .appendTo(ul);*/
    };

HTML:

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">

search:<input type="text" id="name-list" />

A: i wanted to set _renderItem and _renderMenu, so i came across the following example:
$(document).ready(function() {
        var products = $(".products").clone();
        $('#search-box').autocomplete({
            minLength: 1,
            source: function(request, response){
                $.ajax({
                    url:"../ajax-search.php",
                    dataType:"json",
                    html: true,
                    data:{term:request.term},
                    success: function(data){
                        response(data.slice(0,5));
                    }
                });
            },
            create: function (event,ui){
               $(this).data('ui-autocomplete')._renderItem = function (ul, item) {
                return $('
')
                    .append("")
                    .append('' + item.Number  + '
' + item.Name  + '')
                    .appendTo(ul);
            };
               $(this).data('ui-autocomplete')._renderMenu = function () {
                    this.menu.element.css({
                    width: $('#search-box').width(),
                    border: 'medium solid'
                });

            };
        }
        });

if found this answer here

A: A few small corrections and you should be on your way:
Example: https://jsfiddle.net/Twisty/3gm3sfem/
JavaScript
$(function() {
  var myData = [{
    product_name: "Name 1",
    pfimage_thumb: "thumb1.jpg",
    url: "url1"
  }, {
    product_name: "Name 2",
    pfimage_thumb: "thumb2.jpg",
    url: "url2"
  }, {
    product_name: "Name 3",
    pfimage_thumb: "thumb3.jpg",
    url: "url3"
  }];
  $('#name-list').autocomplete({
    source: function(request, response) {
      $.ajax({
        url: "/echo/json/",
        data: {
          json: JSON.stringify(myData)
        },
        dataType: "json",
        type: "POST",
        success: function(data) {
          console.log(data);
          response(data);
        }
      })
    },
    select: function(event, ui) {
      alert(ui.item ? ("You picked '" + ui.item.label) : "Nothing selected, input was " + this.value);
      return false;
    }
  }).autocomplete("instance")._renderItem = function(ul, item) {
    console.log('test');
    var item = $('

 Reputation:  ' + item.volume + '

' + item.product_name + '

')
    return $("
").append(item).appendTo(ul);
  };
});

If your data is coming back, pass it to response() to ensure that the menmu get rendered. You do not need  since select will be fired either way.

A: You need to use Jquery widget factory to extend autocomplete object. It is explained in these articles:
https://learn.jquery.com/jquery-ui/widget-factory/extending-widgets/
it worked like this:
you add your widget code like this:
$.widget(
"custom.superAuto",
$.ui.autocomplete,
{
    _renderMenu : function(ul, items) {
        var self = this;
        ul.append("
KOSSSS
");
        $.each(items, function(index, item) {
        self._renderItem(ul.find("#products"),item);
        });
    },
    _renderItem: function (column, item)
    {
        return $("
")
    }
});

The above code extends autocomplete object and you can use superAuto instead and use your custom logic to render your menu like this:
$(".suggestion-input").superAuto(
                {
                    minLength : 2,
                    source : function(request, response) {

                        $.get(encodeURI("http://127.0.0.1:8080/api/v1/search/" + request.term),
                                function(data) {
                                    response(data);
                                });

                    }

                });


text:
Q: Android actionbar items remain when popping fragment I'm using the support actionbar.  I'm also using fragments.  Typically, I change the fragment using navigation drawer and everything works fine.  Each fragment is able to make changes to the action bar items.  When I change to a new fragment, the changes (new buttons) are removed.
Here's my problem.  In one instance, I replace the fragment and add the existing fragment to the back stack.  When I go back to the previous fragment, the actionbar still has the items from the previous fragment.
Example:
1) Fragment 1 loads fragment 2 and places fragment 1 on the back stack
2) Fragment 2 places several new buttons in the actionbar
3) Fragment 2 exits and now I see the actionbar items from fragment 1 & 2
I do the same basic thing with 2 other fragments in a different location and don't have the same problem.  The only difference I can figure out between the two implementations is the way the 2nd fragments interact with the actionbar.
In the working case, fragment 2 load items inflating a menu in onCreateMenuOptions.  This works well.
In the NOT working case, fragment 2 does NOT inflate a menu but uses a custom view:
         // Set action bar custom view and display options.
    MINMainActivity.getSharedInstance().getSupportActionBar().setCustomView(R.layout.custom_action_bar_viewer);
    MINMainActivity.getSharedInstance().getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_USE_LOGO);
    MINMainActivity.getSharedInstance().getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.action_bar_bg));

This is the only difference I can find. Am I missing something?  (Obviously)  But the question is what???
The code used to load the fragment 2 from fragment 1 is:
 MINMainActivity.getSharedInstance().mDrawerToggle.setDrawerIndicatorEnabled(false);

                        // Load the PDF fragment
                        MINPDFTronFragment fragment = new MINPDFTronFragment();
                        fragment.albumItem = albumItem;
                        getFragmentManager().beginTransaction()
                                .replace(R.id.content_frame, fragment)
                                .addToBackStack(null)
                                .commit();

The onCreate code used for fragment 2 is:
     // ***************************************************************************************************
//
//  onCreate
//
// ***************************************************************************************************
@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);

    //MINMainActivity.getSharedInstance().supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);
    setRetainInstance(true);
    setHasOptionsMenu(true);
    getActivity().getActionBar().setDisplayHomeAsUpEnabled(true);
}

NEW EDITS:
These are the two methods that are doing the work on the action bar.  The first section here is the code for Fragment 1.  Fragment 1 is the fragment that launches Fragment 2 and places itself on the backstack:
     // ***************************************************************************************************
//
//  onCreateOptionsMenu
//
// ***************************************************************************************************
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
{
    mMenu = menu;

    // Inflate GridView menu
    inflater.inflate(R.menu.gridview_combined_menu, menu);

    // Gridview share menu
    MenuItem shareMenuItem = menu.findItem(R.id.MenuItemShare);
    mShareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(shareMenuItem);
    setGridViewShareIntent(null); // TODO is this needed?

    super.onCreateOptionsMenu(menu, inflater);
}

// ***************************************************************************************************
//
//  onPrepareOptionsMenu
//
// ***************************************************************************************************
@Override
public void onPrepareOptionsMenu(Menu menu)
{
    setOptionMenuItems();
    super.onPrepareOptionsMenu(menu);
}

Here are the same methods in Fragment 2 (the fragment launched by Fragment 1:
     // ***************************************************************************************************
//
//  onCreateOptionsMenu
//
// ***************************************************************************************************
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
{
    mMenu = menu;
    super.onCreateOptionsMenu(menu, inflater);
}

// ***************************************************************************************************
//
//  onPrepareOptionsMenu
//
// ***************************************************************************************************
@Override
public void onPrepareOptionsMenu(Menu menu)
{
    MINMainActivity MINMainActivity = (MINMainActivity) getActivity();
    boolean drawerIsOpen = MINMainActivity.mDrawerLayout.isDrawerOpen(MINMainActivity.mDrawerList);

    if(drawerIsOpen)
    {
    }

    else
    {
        }
    }
    super.onPrepareOptionsMenu(menu);
}

As you can see, Fragment 2 isn't making mods in those methods.  Below is the code in Fragment 2 that manipulates the actionbar:
     // ***************************************************************************************************
//
//  onCreateView
//
// ***************************************************************************************************
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
    initViewerLayout(inflater, container, savedInstanceState);
 }
     // ***************************************************************************************************
//
//  initViewerLayout
//
// ***************************************************************************************************
private void initViewerLayout(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
    // Initialize the library
    try
    {
        PDFNet.initialize(MINMainActivity.getSharedInstance(), R.raw.pdfnet);
    }
    catch (PDFNetException e)
    {
        // Do something...
        e.printStackTrace();
    }

    // Inflate the view and get a reference to PDFViewCtrl
    pageView = inflater.inflate(R.layout.pdf_viewer, container, false);

    // Set action bar custom view and display options.
    MINMainActivity.getSharedInstance().getSupportActionBar().setCustomView(R.layout.custom_action_bar_viewer);
    MINMainActivity.getSharedInstance().getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_USE_LOGO);
    MINMainActivity.getSharedInstance().getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.action_bar_bg));

    // Initialize action bar buttons (we are using a custom view, so we
    // need to set click listeners for each item.
    mButtonViewMode = (ImageButton) MINMainActivity.getSharedInstance().getSupportActionBar().getCustomView().findViewById(R.id.ab_action_viewmode);
    mButtonViewMode.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            ViewModePickerDialogFragment dialog = new ViewModePickerDialogFragment();
            dialog.mListener = MINPDFTronFragment.this;
            dialog.show(MINMainActivity.getSharedInstance().getSupportFragmentManager(), "view_mode_picker");
            stopHideToolbarsTimer();
        }
    });
    updateButtonViewModeIcon();

    mButtonOutline = (ImageButton) MINMainActivity.getSharedInstance().getSupportActionBar().getCustomView().findViewById(R.id.ab_action_outline);
    mButtonOutline.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            FragmentManager fragmentManager = MINMainActivity.getSharedInstance().getSupportFragmentManager();
            // Creates the dialog in full screen mode
            mBookmarksDialog = new BookmarksDialogFragment(mPdfViewCtrl, mBookmarkDialogCurrentTab);
            mBookmarksDialog.setBookmarksDialogFragmentListener(MINPDFTronFragment.this);
            mBookmarksDialog.mOutlineDialogFragmentListener = MINPDFTronFragment.this;
            mBookmarksDialog.mAnnotationDialogFragmentListener = MINPDFTronFragment.this;
            mBookmarksDialog.setStyle(DialogFragment.STYLE_NO_TITLE, android.support.v7.appcompat.R.style.Theme_AppCompat_Light);
            mBookmarksDialog.show(fragmentManager, "bookmarks_dialog");

            stopHideToolbarsTimer();

            // Example of how to show the OutlineDialogFragment as a dialog
            //OutlineDialogFragment outlineDialogFragment = new OutlineDialogFragment(mPdfViewCtrl);
            //outlineDialogFragment.setStyle(DialogFragment.STYLE_NO_TITLE, android.R.style.Theme_Holo_Light);
            //outlineDialogFragment.show(fragmentManager, "outline_dialog");

            // Example of how to show the AnnotationDialogFragment as a dialog
            //AnnotationDialogFragment annotDialog = new AnnotationDialogFragment(mPdfViewCtrl);
            //annotDialog.setStyle(DialogFragment.STYLE_NO_TITLE, android.support.v7.appcompat.R.style.Theme_Base_AppCompat_Light);
            //annotDialog.show(fragmentManager, "annotation_dialog");
        }
    });

    mSearchView = (SearchView) MINMainActivity.getSharedInstance().getSupportActionBar().getCustomView().findViewById(R.id.ab_action_search);
    mSearchView.setFocusable(false);
    mSearchView.setFocusableInTouchMode(false);
    // Let's get the internal button of the search view widget to change some properties.
    ImageView searchButton = (ImageView) mSearchView.findViewById(android.support.v7.appcompat.R.id.search_button);
    searchButton.setBackgroundDrawable(mSearchView.getContext().getResources().getDrawable(R.drawable.controls_annotation_toolbar_tool_bg));
    searchButton.setImageDrawable(mSearchView.getContext().getResources().getDrawable(R.drawable.ic_action_search));
    mSearchView.setOnQueryTextListener(this);
    mSearchView.setIconifiedByDefault(true);
    mSearchView.setOnSearchClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            SearchView searchView = (SearchView) view;
            if (searchView.isIconfiedByDefault() && !searchView.isIconified()) {
                AnalyticsHandler.getInstance().sendEvent("[Viewer] Find Text clicked");

                // Search has expanded
                startSearchMode();
            }
        }
    });
    mSearchView.setOnCloseListener(new SearchView.OnCloseListener() {
        @Override
        public boolean onClose() {
            exitSearchMode();
            return false;
        }
    });

    mButtonAnnotToolbar = (ImageButton) MINMainActivity.getSharedInstance().getSupportActionBar().getCustomView().findViewById(R.id.ab_action_tools);
    mButtonAnnotToolbar.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mAnnotationToolbar = new AnnotationToolbar(MINApplication.getAppContext(), pageView, mToolManager);
            mAnnotationToolbar.setButtonStayDown(SettingsManager.getContinuousAnnotationEdit(MINApplication.getAppContext()));

            if (SettingsManager.getContinuousAnnotationEdit(MINApplication.getAppContext())) {
                AnalyticsHandler.getInstance().sendEvent("[General] Continuous Annotation Edit enabled");
            }

            mAnnotationToolbar.show();

            AnalyticsHandler.getInstance().sendEvent("[Annotation Toolbar] Annotation Toolbar opened");
        }
    });

    mButtonShare = (ImageButton) MINMainActivity.getSharedInstance().getSupportActionBar().getCustomView().findViewById(R.id.ab_action_share);
    mButtonShare.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View arg0) {
            if (MiscUtils.isKitKat()) {
                // If KitKat or higher, we show the Share/Print option
                SharePickerDialogFragment dialog = new SharePickerDialogFragment();
                dialog.mListener = MINPDFTronFragment.this;
                dialog.show(MINMainActivity.getSharedInstance().getSupportFragmentManager(), "share_mode_picker");
            } else {
                MiscUtils.sharePdfFile(MINApplication.getAppContext(), albumItem);
                AnalyticsHandler.getInstance().sendEvent("[Viewer] Share clicked");
            }
        }
    });

    // Search prev/next buttons.
    mButtonSearchNext = (ImageButton) pageView.findViewById(R.id.floating_button_next);
    mButtonSearchNext.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mSearchUp = false;
            findText();
        }
    });
    mButtonSearchPrev = (ImageButton) pageView.findViewById(R.id.floating_button_prev);
    mButtonSearchPrev.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mSearchUp = true;
            findText();
        }
    });

    // PDFViewCtrl settings
    mPdfViewCtrl = (CompleteReaderPDFViewCtrl) pageView.findViewById(R.id.pdfviewctrl);
    mPdfViewCtrl.setUrlExtraction(true);
    mPdfViewCtrl.setupThumbnails(true, true, true, 0, 50 * 1024 * 1024, 0.1);
    mPdfViewCtrl.setPageViewMode(PDFViewCtrl.PAGE_VIEW_FIT_PAGE);
    mPdfViewCtrl.setPageRefViewMode(PDFViewCtrl.PAGE_VIEW_FIT_PAGE);
    mPdfViewCtrl.setHighlightFields(true);
    mPdfViewCtrl.setZoomLimits(PDFViewCtrl.ZOOM_LIMIT_RELATIVE, 1.0, 20.0);
    updateViewMode();

    mSeekBar = (ThumbnailSlider) pageView.findViewById(R.id.thumbseekbar);
    // We pass a reference of the PDFViewCtrl to the slider so it can
    // interact with it (know number of pages, change pages, get thumbnails...
    // At this point no doc is set and the slider has no enough data
    // to initialize itself. When a doc is set we need to reset its data.
    mSeekBar.setPDFViewCtrl(mPdfViewCtrl);

    mPageNumberIndicator = (TextView) pageView.findViewById(R.id.page_number_indicator_current_page);

    mSearchProgressDialog = new ProgressDialog(getActivity());
    mSearchProgressDialog.setMessage(getResources().getString(R.string.search_in_progress));
    mSearchProgressDialog.setIndeterminate(true);
    mSearchProgressDialog.setCancelable(true);
    mSearchProgressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialog) {
            mPdfViewCtrl.cancelFindText();
        }
    });

    mDownloadDocumentDialog = new ProgressDialog(getActivity());
    mDownloadDocumentDialog.setMessage(getResources().getString(R.string.download_in_progress_message));
    mDownloadDocumentDialog.setIndeterminate(true);
    mDownloadDocumentDialog.setCancelable(true);
    mDownloadDocumentDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialog) {
            Toast.makeText(MINApplication.getAppContext(), R.string.download_cancelled_message, Toast.LENGTH_SHORT).show();
            //TODO finish();
        }
    });
}

A: Try to call invalidateOptionsMenu() in onResume of your 1 fragment.
EDIT:
If custom actionbar was set in fragment 2, you'll need to disable it in your first fragment (for example, in onResume()):
MINMainActivity.getSharedInstance().getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_USE_LOGO);

A: Here's my problem. In one instance, I replace the fragment and add the existing fragment to the back stack. When I go back to the previous fragment, the actionbar still has the items from the previous fragment.
Where you are call method that change your actionbar with new buttons? if you call it in fragment onCreate() it will not invoked. try to call it from fragment onActivityCreated(Bundle savedInstanceState).
take a look on fragment lifecycle methods


text:
Q: How to cache whole next.js's HTML page in Redis? I'm new to next.js. I'm trying to cache the whole HTML page in next.js. So, that I can reduce the response time in the next call for that page.
I tried by creating a custom server and then save the response that came from rendertoHTML()/render(). But it didn't return any response.

A: Redis is not for caching whole HTML pages or any other complex object types for that matter. It's key–value database. In Redis you should keep your object simple.
For your case it's best to use stale-while-revalidate (SWR) cache-control headers in combination with getServerSideProps for server-rendering in NextJS.
See here for example.


text:
Q: Adding the column result of a DataRow[] column to a variable c# I want to return the value of a DataRow[] to a string in c#
Here is my DataTable:
DataTable table = new DataTable();
            table.Columns.Add("ID", typeof(int));
            table.Columns.Add("BugDescription", typeof(string));
            table.Columns.Add("UnitPrice", typeof(double));

            table.Rows.Add(1, "Bug 1", 10.00);
            table.Rows.Add(2, "Bug 2", 20.00);

I then create a DataRow[] called result which stores the row where the ID = 1:
DataRow[] result = table.Select("ID = 1");

The last step that I want to achieve is to add the BugDescription value to a string named description.
How will I achieve this?

A: your code
DataRow[] result = table.Select("ID = 1");

tells you that you have got an array of DataRows. Now it means that you may have more than one record here. So, now it depends on you which Row to assign. You can do it like this if you think it will be the first one
if(result.Length > 0)
{
   string description = Convert.ToString(result[0]["BugDescription"]);
}

doing it the linq way
string description = table.Rows.OfType<DataRow>().Where(row => (string)row["ID"] == "1").Select(row => (string)row["BugDescription"]).First();

A: I know I'm pretty late to provide an answer, but, we can add one more to the list of answers.
As the datatable.select is giving us the result in the form of array, it is to know that we are getting itemarray for columns in each row array. Simplifying this statement with below example.
We can use "ItemArray" if we know/remember/use the column position/number rather than the column name
//ID   Name      Age
//100  Name 100  Age 100
//101  Name 101  Age 101
//102  Name 102  Age 102

Assuming single row.
DataTable dt=new DataTable();
//Assigning some data into dt. with columns ID, Name, Age.
DataRow[] dr=dt.Select("ID=100");
string PersonID=dr[0].ItemArray[0].Tostring().trim(); //first column is ID
string PersonName=dr[0].ItemArray[1].Tostring().trim(); //second column is Name
string PersonAge=dr[0].ItemArray[2].Tostring().trim(); //third column is Age

Therefore Variables will have following details.
// PersonID= 100; PersonName= Name 100; PersonAge= Age 100

Assuming rows>1 (2 in this example)
dr=dt.Select("ID>100");
string PersonID_1=dr[0].ItemArray[0].Tostring().trim(); //first column is ID
string PersonName_1=dr[0].ItemArray[1].Tostring().trim(); //second column is Name
string PersonAge_1=dr[0].ItemArray[2].Tostring().trim(); //third column is Age

string PersonID_2=dr[1].ItemArray[0].Tostring().trim(); //first column is ID
string PersonName_2=dr[1].ItemArray[1].Tostring().trim(); //second column is Name
string PersonAge_2=dr[1].ItemArray[2].Tostring().trim(); //third column is Age

Therefore Variables will have following details.
// PersonID_1= 101; PersonName_1= Name 101; PersonAge_1= Age 101
// PersonID_2= 102; PersonName_2= Name 102; PersonAge_2= Age 102

Point to remember: first row or column index id always starts with 0.
Therefore, dr[0] is first row & ItemArray[0] is first column

A: If you have an array of DataRows as you have since you are declaring it
DataRow[]

You can access it as:
string resultBug = result[0]["BugDescription"];

But since you are only expecting one row (and you are to judge if you will always expect one row to be returned) then you should declare it as a plain DataRow:
DataRow result = table.Select("ID = 1")[0];
string resultBug = result["BugDescription"].Dump();

The Select is returning an array of rows so you should index it with [0] to get the first occurrence.

A: To achieve your goal you need something like this:
if (result.Length > 0)
{
    var description = result[0]["BugDescription"].ToString();
}

A: If you know you're only going to get one row back you can condense the whole thing down to this
string description = table.Select("ID = 1").First().Field<string>("BugDescription");


text:
Q: A sly expression for a 'one day chance meeting' Considering a situation where I once met a guy just for a day and we somehow developed a bond due to the circumstances we were in—helping each other and sharing mutual ideas... but never remained in touch after that and
now out of nowhere we meet again? To answer the curious people but not wanting to expound upon it, I wan't to escape the question
..with a mischievous one liner which would leave the people wondering what must have happened?
Also it should not give a wrong implication.
Something like 'we have a history' or 'we go way back' sort of expressions. But I can't use them due to this link:  Meaning of 'We have a history'.
I'm considering

We've had a good time together.

But that would mean 'had a good time' for more than a day.
I'm counting on you experts to provide me with suitable expressions to clear out this 'one day chance meeting of good memories' situation.
I appreciate any help.

A: There's this idiom: ships that pass in the night. One online dictionary defines it as:

ships that pass in the night (idiom) Often said of people who meet for a brief but intense moment and then part, never to see each other again. These people are like two ships that greet each other with flashing lights and then sail off into the night. From a poem by Henry Wadsworth Longfellow.

If you have met this person again, then the idiom is no longer an exact fit. However, you could reference the idiom by saying:

Our ships passed one night.

I'd interpret that to mean that you had your chance encounter in the past, and that, at the time, you didn't really expect to run into each other again.
I don't believe that's a standard way to use the idiom, but I'd regard it as an acceptable usage. I also don't think there's any problem with using "night," even if your prior meeting was a daytime encounter.


text:
Q: Flask module not found in WGSI I am building a Flask app. The directory structure is as follows:
C:.
│   .gitignore
│   app.py
│
├───static
├───templates
├───vision
│   │   vi_img.py
│   │   yolov5l.pt
│   │   __init__.py
│   │
│   ├───data
│   ├───models
│   │   │   common.py
│   │   │   experimental.py
│   │   │   export.py
│   │   │   yolo.py
│   │   │   yolov5l.yaml
│   │   │   yolov5m.yaml
│   │   │   yolov5s.yaml
│   │   │   yolov5x.yaml
│   │   │   __init__.py
│   │   │
│   │   ├───hub
│   │
│   ├───static
│   │
│   ├───utils
│   ├───weights

Inside the vi_img.py file in the vision directory, 'import vision.models.experimental'
The flask app loads but later says that the 'models' module could not be found!

I do not have the faintest idea of what is happening here.
Thanks in advance

A: instead of
import vision.models.experimental

use
import .models.experimental

since vi_img.py module and models package are on same level under vision package


text:
Q: setting up win in the end of the game I have a problem when i compile my code. I want to make my "Win" image to pop up when the score reaches 500 or over, but i get this error:

"incompatible types: int cannot be converted to score"

The problem is under my "private void LevelUp"()"
Here is my code:
    import greenfoot.*;

/**
 * Write a description of class MinionWorld here.
 *
 * @author (your name)
 * @version (a version number or a date)
 */
    public class MinionWorld extends World
    {
    private long startMillis = 0;
    private int numFrames = 0;
    private final int groundHeight;

    public static final double MAX_FORCE = 11;
    public static final double MIN_FORCE = 7;
    public static final double GRAVITY = 0.15;
    public static final int LOWEST_ANGLE = 30;

    private Player[] players;
    private int curPlayer;
    private int turnCountdown;
    private int value;

    Score score;
    Banan Banan;
    private int time, target;
    public static int poin, level;

    /**
     * Constructor for objects of class Banana.
     *
     */
    public MinionWorld()
    {
        // Create a new world with 600x400 cells with a cell size of 1x1 pixels.
        super(800, 500, 1, false);

        groundHeight = 440;

        players = new Player[] {new Minion()};
        int x = getWidth() / 2;

        for (Player p : players)
        {
            addObject(p, x, groundHeight);
        }
        curPlayer = 0;
        turnCountdown = 10;

        time = 1800;
        poin = 0;
        level = 1;
        target = 150;
        Greenfoot.setSpeed(50);
        prepare();
    }

    private void showTime()
    {
        showText("Time: " + time/60, 700, 20);
    }

    private void showTarget()
    {
        showText("Target: "+target, 714, 50);
    }

    private void showLevel()
    {
        showText("Level: "+level, 50, 20);
    }

    private void countTime()
    {
        showTime();
        if(time>0)
        {
            time--;
        }
        if (time == 0)
        {
            LevelUp();
        }
    }

    private void lvup()
    {
        LvlUp LvlUp = new LvlUp();
        addObject(LvlUp,400,250);
        Greenfoot.delay(200);
        removeObject(LvlUp);
    }

    private void win()
    {
        Win Win = new Win();
        addObject(new Win(),400,250);
        Greenfoot.delay(200);
    }

    public void started()
    {
        numFrames = 0;
        startMillis = System.currentTimeMillis();
    }

    private double t;

    public void act()
    {
        numFrames += 1;
        t = getTimePerFrame();

        if (turnCountdown > 0)
        {
            turnCountdown -= 1;
            if (turnCountdown == 0)
            {
                players[curPlayer].startTurn();
            }
        }
        countTime();
        showTarget();
        showLevel();
    }

    public void changeScore(int nilai)
    {
      if(score!=null)
      {
          score.setScore(nilai);
      }
    }

    public double getTimePerFrame()
    {
        return (double)(System.currentTimeMillis() - startMillis) / (1000.0 * (double)(numFrames));
    }

    public boolean hitsGround(double startX, double startY, double endX, double endY)
    {
        return endY > groundHeight;
    }

    public void landed()
    {
        curPlayer = (curPlayer + 1) % players.length;
        turnCountdown = 10;
    }

    private void LevelUp()
    {
        {

            if(poin>=target)
            {
                level++;
                if (level==2)
                {
                    lvup();
                    time=1800;
                    target=350;
                }
                if (level==3)
                {
                    lvup();
                    time=1800;
                    target=500;

                }
            }
            else
                {
                    if (score = 500)
                    {
                        Greenfoot.stop();
                        addObject(new Win(), 400,200);
                    }
                    else
                    {
                        addObject(new GameOver(),400,200);
                        addObject(new TryAgain(),360, 320);
                        addObject(new Exit(),460,320);
                    }
                }
        }
    }

      /**
     * Prepare the world for the start of the program. That is: create the initial
     * objects and add them to the world.
     */
    private void prepare()
    {
        Menu Menu = new Menu();
        Greenfoot.setWorld(Menu);
        score = new Score();

        Minion Minion = new Minion();
        addObject(Minion, 373, 435);
        Minion.setLocation(461, 400);
        removeObject(Minion);

        Evil1 evil1 = new Evil1();
        addObject(evil1, 697, 212);
        evil1.setLocation(577, 223);

        Evil2 evil2 = new Evil2();
        addObject(evil2, 259, 58);
        evil2.setLocation(695, 63);
        evil2.setLocation(693, 53);

        Evil3 evil3 = new Evil3();
        addObject(evil3, 742, 322);
        evil3.setLocation(575, 321);
        evil3.setLocation(323, 305);
        evil3.setLocation(573, 319);

        Evil4 evil4 = new Evil4();
        addObject(evil4, 92, 117);
        evil4.setLocation(92, 111);

        Score score = new Score();
        addObject(score, (697), 168);
        score.setLocation(757, 247);
        score.setLocation(561, 163);
        score.setLocation(463, 124);
    }
}

Here is my code for my Score class:
import greenfoot.*;

public class Score extends Actor
{
/**
 * Act - do whatever the Score wants to do. This method is called whenever
 * the 'Act' or 'Run' button gets pressed in the environment.
 */
public Score(){
    GreenfootImage gfi = new GreenfootImage(200,200);
    gfi.setColor(java.awt.Color.white);
    gfi.setFont(new java.awt.Font("Las Vegas",java.awt.Font.PLAIN, 36));
    gfi.drawString("0", 30, 30);
    setImage(gfi);
}

public void setScore(int score)
{
    GreenfootImage gfi = getImage();
    gfi.clear();
    gfi.drawString(score + "", 30,30);
    setImage(gfi);
}

//just a little settlement
public void act()
{
    if(MinionWorld.poin>9)
    {
        setLocation(445, getY());
    }
}
}

Code for "move" class:
 import greenfoot.*;

/**
 * Write a description of class Move here.
 *
 * @author (your name)
 * @version (a version number or a date)
 */
    public class Move extends Actor
{
    int q = 0;
    private int Evil = 0;
/**
 * Act - do whatever the Fly wants to do. This method is called whenever
 * the 'Act' or 'Run' button gets pressed in the environment.
 */
public void act()
{

}
public void flyy()
{
    if (getX() == 0 || getX() == 799)
    {
        setLocation(getX(), 50+Greenfoot.getRandomNumber(320));
        turn(180);
        this.getImage().mirrorVertically();
        q++;
    }
}
public void right()
{
    move(3/2);
}
public void left()
{
    move(-3/2);
}
public void touch1()
{
    if(isTouching(Banan.class))
     {
        MinionWorld MinionWorld = (MinionWorld) getWorld();
        MinionWorld.poin = MinionWorld.poin + 10;
        MinionWorld.changeScore(MinionWorld.poin);
        removeTouching(Evil1.class);
        setLocation(799, 50+Greenfoot.getRandomNumber(320));
        left();
     }
}
public void touch2()
{
    if(isTouching(Banan.class))
    {
        MinionWorld MinionWorld = (MinionWorld) getWorld();
         MinionWorld.poin = MinionWorld.poin + 10;
        MinionWorld.changeScore(MinionWorld.poin);
        removeTouching(Evil2.class);
        setLocation(0, 50+Greenfoot.getRandomNumber(320));
        right();
    }
}
public void touch3()
{
    if(isTouching(Banan.class))
    {
        MinionWorld MinionWorld = (MinionWorld) getWorld();
        MinionWorld.poin = MinionWorld.poin + 10;
        MinionWorld.changeScore(MinionWorld.poin);
        removeTouching(Evil3.class);
        setLocation(799, 50+Greenfoot.getRandomNumber(320));
        left();
    }
}
public void touch4()
{
    if(isTouching(Banan.class))
    {
        MinionWorld MinionWorld = (MinionWorld) getWorld();
        MinionWorld.poin = MinionWorld.poin + 10;
        MinionWorld.changeScore(MinionWorld.poin);
        removeTouching(Evil4.class);
        setLocation(0, 50+Greenfoot.getRandomNumber(320));
        right();
    }
}

public void nulled2()
{
    if (getWorld().getObjects(Evil2.class).isEmpty())
    {
        getWorld().addObject(new Evil2(), 0, 50+Greenfoot.getRandomNumber(320));
        right();
    }
}
public void nulled4()
{
    if (getWorld().getObjects(Evil4.class).isEmpty())
    {
        getWorld().addObject(new Evil4(), 0, 50+Greenfoot.getRandomNumber(320));
        right();
    }
}

public void flyback1()
{
   if(getX()<-15)
    {
        setLocation(800, 50+Greenfoot.getRandomNumber(320));
    }
   if(getX()>815)
   {
        setLocation(799, 50+Greenfoot.getRandomNumber(320));
        turn(180);
        this.getImage().mirrorVertically();
   }
}

public void flyback2()
{
   if(getX()<-35)
    {
        setLocation(0, 50+Greenfoot.getRandomNumber(320));
        turn(180);
        this.getImage().mirrorVertically();
    }
   if(getX()>834)
   {
       setLocation(0, 50+Greenfoot.getRandomNumber(320));
   }
}
}

A: This is a little bit too long for a comment so I'll post it here.
You are most likely missing the following:

*

*A field in your Score class.

*A getter for that field`.

*Fixing if (score = 500) and changing it to if (score.getScore() == 500).

So basically:
public class Score extends Actor {
    private int score;

    public void setScore(int score) {
        this.score = score;
        ...
    }

    public int getScore() {
        return this.score;
    }
}

A: You are missing a score field. Your class should be like this:
public class Score extends Actor
{

private int score;

public int getScore(){
   return score;
}
/**
 * Act - do whatever the Score wants to do. This method is called whenever
 * the 'Act' or 'Run' button gets pressed in the environment.
 */
public Score(){
    GreenfootImage gfi = new GreenfootImage(200,200);
    gfi.setColor(java.awt.Color.white);
    gfi.setFont(new java.awt.Font("Las Vegas",java.awt.Font.PLAIN, 36));
    gfi.drawString("0", 30, 30);
    setImage(gfi);
}

public void setScore(int score)
{
    GreenfootImage gfi = getImage();
    gfi.clear();
    this.score += score;
    gfi.drawString(this.score + "", 30,30);
    setImage(gfi);
}

//just a little settlement
public void act()
{
    if(MinionWorld.poin>9)
    {
        setLocation(445, getY());
    }
}
}

Then your if should be:
if(score.getScore() == 500){
//doStuff
}