text:
Q: Error on importing mahout using maven I am getting the below message in eclipse
Project build error: Non-resolvable parent POM: Could not transfer
artifact org.apache:apache:pom:9 from/to central
(http://repo1.maven.org/maven2): connection timed out and 'parent.relativePath'
points at wrong local POM

My pom.xml file is..
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.apache.mahout</groupId>
  <artifactId>mahout</artifactId>
  <version>0.5</version>

  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>9</version>
  </parent>

  <packaging>pom</packaging>
  <name>Apache Mahout</name>
  <url>http://mahout.apache.org</url>
  <inceptionYear>2008</inceptionYear>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <organization>
    <name>The Apache Software Foundation</name>
    <url>http://www.apache.org/</url>
  </organization>
  <mailingLists>
    <mailingList>
      <name>User list</name>
      <subscribe>user-subscribe@mahout.apache.org</subscribe>
      <unsubscribe>user-unsubscribe@mahout.apache.org</unsubscribe>
      <post>user@mahout.apache.org</post>
      <archive>http://mail-archives.apache.org/mod_mbox/mahout-user/</archive>
      <otherArchives>
        <otherArchive>http://mahout.apache.org/mail/user/</otherArchive>
        <otherArchive>http://mahout.markmail.org/</otherArchive>
        <otherArchive>http://www.nabble.com/Mahout-User-List-f32042.html</otherArchive>
      </otherArchives>
    </mailingList>
    <mailingList>
      <name>Developers List</name>
      <subscribe>dev-subscribe@mahout.apache.org</subscribe>
      <unsubscribe>dev-unsubscribe@mahout.apache.org</unsubscribe>
      <post>mahout-dev@mahout.apache.org</post>
      <archive>http://mail-archives.apache.org/mod_mbox/mahout-dev/</archive>
      <otherArchives>
        <otherArchive>http://mahout.apache.org/mail/dev/</otherArchive>
        <otherArchive>http://mahout.markmail.org/</otherArchive>
        <otherArchive>http://www.nabble.com/Mahout-Developer-List-f32041.html</otherArchive>
      </otherArchives>
    </mailingList>
    <mailingList>
      <name>Commit notifications</name>
      <subscribe>commits-subscribe@mahout.apache.org</subscribe>
      <unsubscribe>commits-unsubscribe@mahout.apache.org</unsubscribe>
      <archive>http://mail-archives.apache.org/mod_mbox/mahout-commits/</archive>
      <otherArchives>
        <otherArchive>http://mahout.apache.org/mail/commits/</otherArchive>
      </otherArchives>
    </mailingList>
  </mailingLists>
  <properties>
    <skipTests>false</skipTests>
    <maven.clover.multiproject>true</maven.clover.multiproject>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <issueManagement>
    <system>Jira</system>
    <url>https://issues.apache.org/jira/browse/MAHOUT</url>
  </issueManagement>

  <dependencyManagement>
    <dependencies>

      <!-- our modules -->

      <dependency>
        <artifactId>mahout-core</artifactId>
        <groupId>${project.groupId}</groupId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <version>${project.version}</version>
        <artifactId>mahout-core</artifactId>
        <type>test-jar</type>
        <scope>test</scope>
      </dependency>

      <dependency>
        <artifactId>mahout-math</artifactId>
        <groupId>${project.groupId}</groupId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <version>${project.version}</version>
        <artifactId>mahout-math</artifactId>
        <type>test-jar</type>
      </dependency>

      <dependency>
        <artifactId>mahout-utils</artifactId>
        <groupId>${project.groupId}</groupId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <artifactId>mahout-buildtools</artifactId>
        <groupId>${project.groupId}</groupId>
        <version>${project.version}</version>
      </dependency>

      <!-- sibling projects -->
      <dependency>
        <groupId>org.apache.mahout</groupId>
        <artifactId>mahout-collections</artifactId>
        <version>1.0</version>
      </dependency>

      <!-- 3rd party  -->
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-analyzers</artifactId>
        <version>3.1.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-core</artifactId>
        <version>3.1.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-benchmark</artifactId>
        <version>3.1.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.solr</groupId>
        <artifactId>solr-commons-csv</artifactId>
        <version>3.1.0</version>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.7</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.easymock</groupId>
        <artifactId>easymock</artifactId>
        <version>2.5.2</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.easymock</groupId>
        <artifactId>easymockclassextension</artifactId>
        <version>2.5.2</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-core</artifactId>
        <version>0.20.2</version>
        <exclusions>
          <exclusion>
            <groupId>net.sf.kosmosfs</groupId>
            <artifactId>kfs</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-util</artifactId>
          </exclusion>
          <exclusion>
            <groupId>hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
          </exclusion>
          <exclusion>
            <groupId>commons-el</groupId>
            <artifactId>commons-el</artifactId>
          </exclusion>
          <exclusion>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
          </exclusion>
          <exclusion>
            <groupId>oro</groupId>
            <artifactId>oro</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jsp-2.1</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jsp-api-2.1</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>servlet-api-2.5</artifactId>
          </exclusion>
          <exclusion>
            <groupId>commons-net</groupId>
            <artifactId>commons-net</artifactId>
          </exclusion>
          <exclusion>
            <groupId>tomcat</groupId>
            <artifactId>jasper-runtime</artifactId>
          </exclusion>
          <exclusion>
            <groupId>tomcat</groupId>
            <artifactId>jasper-compiler</artifactId>
          </exclusion>
          <exclusion>
            <groupId>xmlenc</groupId>
            <artifactId>xmlenc</artifactId>
          </exclusion>
          <exclusion>
            <groupId>net.java.dev.jets3t</groupId>
            <artifactId>jets3t</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.eclipse.jdt</groupId>
            <artifactId>core</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>commons-dbcp</groupId>
        <artifactId>commons-dbcp</artifactId>
        <version>1.2.2</version>
      </dependency>

      <dependency>
        <groupId>commons-pool</groupId>
        <artifactId>commons-pool</artifactId>
        <version>1.4</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.6.0</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jcl</artifactId>
        <version>1.6.0</version>
      </dependency>

      <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.4</version>
      </dependency>

      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-math</artifactId>
        <version>2.1</version>
      </dependency>

      <dependency>
        <groupId>org.uncommons.maths</groupId>
        <artifactId>uncommons-maths</artifactId>
        <version>1.2</version>
      </dependency>

      <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.1</version>
      </dependency>

      <dependency>
        <groupId>org.uncommons.watchmaker</groupId>
        <artifactId>watchmaker-framework</artifactId>
        <version>0.6.2</version>
      </dependency>
      <dependency>
        <groupId>org.uncommons.watchmaker</groupId>
        <artifactId>watchmaker-swing</artifactId>
        <version>0.6.2</version>
      </dependency>

      <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
        <version>1.3.1</version>
      </dependency>

      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>r03</version>
      </dependency>

      <dependency>
        <groupId>org.apache.mahout.commons</groupId>
        <artifactId>commons-cli</artifactId>
        <version>2.0-mahout</version>
      </dependency>

      <dependency>
        <groupId>axis</groupId>
        <artifactId>axis</artifactId>
        <version>1.4</version>
      </dependency>

      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>net.java.dev.jets3t</groupId>
        <artifactId>jets3t</artifactId>
        <version>0.7.1</version>
      </dependency>

    </dependencies>
  </dependencyManagement>
  <build>
    <defaultGoal>install</defaultGoal>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.1.2</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <phase>verify</phase>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.8</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.3.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.3.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.4.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-eclipse-plugin</artifactId>
          <version>2.8</version>
          <configuration>
            <outputDirectory>${eclipse.outputDirectory}</outputDirectory>
            <buildcommands>
              <java.lang.String>org.eclipse.jdt.core.javabuilder</java.lang.String>
              <java.lang.String>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</java.lang.String>
              <java.lang.String>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</java.lang.String>
            </buildcommands>
            <projectnatures>
              <nature>org.eclipse.jdt.core.javanature</nature>
              <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
              <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
            </projectnatures>
            <additionalConfig>
              <file>
                <name>.checkstyle</name>
                <location>/mahout-eclipse-checkstyle</location>
              </file>
              <file>
                <name>.pmd</name>
                <location>/mahout-eclipse-pmd</location>
              </file>
              <file>
                <name>.ruleset</name>
                <location>/mahout-pmd-ruleset.xml</location>
              </file>
            </additionalConfig>
          </configuration>
          <!-- the 'location' elements above refer to classpath -->
          <dependencies>
            <dependency>
              <groupId>org.apache.mahout</groupId>
              <artifactId>mahout-eclipse-support</artifactId>
              <version>${project.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.1</version>
          <configuration>
            <useReleaseProfile>true</useReleaseProfile>
            <releaseProfiles>release,mahout_release</releaseProfiles>
            <remoteTagging>true</remoteTagging>
            <goals>deploy</goals>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <allowTimestampedSnapshots>true</allowTimestampedSnapshots>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.3.2</version>
          <configuration>
            <encoding>UTF-8</encoding>
            <source>1.6</source>
            <target>1.6</target>
            <optimize>true</optimize>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.6</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.mahout</groupId>
              <artifactId>mahout-buildtools</artifactId>
              <version>${project.version}</version>
            </dependency>
          </dependencies>
          <configuration>
            <encoding>UTF-8</encoding>
          </configuration>

        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>2.5</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.mahout</groupId>
              <artifactId>mahout-buildtools</artifactId>
              <version>${project.version}</version>
            </dependency>
          </dependencies>
          <configuration>
            <rulesets>
              <!-- classpath -->
              <ruleset>../eclipse/src/main/resources/mahout-pmd-ruleset.xml</ruleset>
            </rulesets>
            <sourceEncoding>UTF-8</sourceEncoding>
            <targetJdk>1.5</targetJdk>
            <linkXRef>false</linkXRef>
            <includeTests>true</includeTests>
            <verbose>true</verbose>
          </configuration>

        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.8.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-remote-resources-plugin</artifactId>
          <version>1.1</version>
          <configuration>
        <skipTests>${skipTests}</skipTests>
            <appendedResourcesDirectory>./src/main/appended-resources</appendedResourcesDirectory>
            <resourceBundles>
              <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
            </resourceBundles>
            <supplementalModels>
              <supplementalModel>supplemental-models.xml</supplementalModel>
            </supplementalModels>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkMode>once</forkMode>
          <argLine>-Xms256m -Xmx512m</argLine>
          <testFailureIgnore>false</testFailureIgnore>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-remote-resources-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <resourceBundles>
            <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
          </resourceBundles>
          <supplementalModels>
            <supplementalModel>supplemental-models.xml</supplementalModel>
          </supplementalModels>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.atlassian.maven.plugins</groupId>
        <artifactId>maven-clover2-plugin</artifactId>
        <version>2.6.3</version>
      </plugin>
    </plugins>
  </build>
  <modules>
    <module>buildtools</module>
    <module>eclipse</module>
    <module>math</module>
    <module>core</module>
    <module>taste-web</module>
    <module>examples</module>
    <module>utils</module>
    <module>distribution</module>
  </modules>
  <profiles>
    <profile>
      <id>fastinstall</id>
      <properties>
    <skipTests>true</skipTests>
        <pmd.skip>true</pmd.skip>
        <checkstyle.skip>true</checkstyle.skip>
      </properties>
    </profile>
    <profile>
      <id>nochecks</id>
      <properties>
        <pmd.skip>true</pmd.skip>
        <checkstyle.skip>true</checkstyle.skip>
      </properties>
    </profile>
    <profile>
      <!-- most of this profile lives in other places, like distribution -->
      <id>release.prepare</id>
      <properties>
        <skipTests>true</skipTests>
        <pmd.skip>true</pmd.skip>
        <checkstyle.skip>true</checkstyle.skip>
      </properties>
    </profile>
    <profile>
      <id>release</id>
      <properties>
        <skipTests>true</skipTests>
        <pmd.skip>true</pmd.skip>
        <checkstyle.skip>true</checkstyle.skip>
      </properties>
      <build>
        <plugins>
          <plugin>
            <inherited>true</inherited>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <inherited>true</inherited>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <inherited>true</inherited>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>sourcecheck</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <showDeprecation>true</showDeprecation>
              <showWarnings>true</showWarnings>
              <compilerArgument>${compile.flags}</compilerArgument>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>set.eclipse.output</id>
      <properties>
        <eclipse.outputDirectory>${basedir}/eclipse-classes</eclipse.outputDirectory>
      </properties>
    </profile>
    <profile>
      <id>setup.eclipse</id>
      <build>
        <defaultGoal>process-test-sources</defaultGoal>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.8</version>
            <executions>
              <execution>
                <id>setup.eclipse.project</id>
                <phase>process-test-sources</phase>
                <goals>
                  <goal>eclipse</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <scm>
    <connection>scm:svn:https://svn.apache.org/repos/asf/mahout/tags/mahout-0.5</connection>
    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/mahout/tags/mahout-0.5</developerConnection>
    <url>https://svn.apache.org/repos/asf/mahout/tags/mahout-0.5</url>
  </scm>
  <distributionManagement>
    <site>
      <id>Website</id>
      <url>scp://people.apache.org/home/isabel/public_html/mahout_site</url>
    </site>
  </distributionManagement>
  <reporting>
    <plugins>
      <!-- surefire runs unit tests -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.8.1</version>
      </plugin>
      <!-- checkstyle -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <configLocation>${project.build.directory}/../../eclipse/src/main/resources/mahout-checkstyle.xml</configLocation>
          <consoleOutput>true</consoleOutput>
        </configuration>
      </plugin>
      <!-- test coverage plugin -->
      <plugin>
        <groupId>com.atlassian.maven.plugins</groupId>
        <artifactId>maven-clover2-plugin</artifactId>
        <version>2.6.3</version>
        <configuration>
          <generateHistorical>true</generateHistorical>
          <licenseLocation>buildtools/clover.license</licenseLocation>
          <generatePdf>false</generatePdf>
          <generateXml>true</generateXml>
          <generateHtml>true</generateHtml>
        </configuration>
      </plugin>
      <!-- generate java doc -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.7</version>
      </plugin>
      <!-- code duplication - copy and paste detection -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <rulesets>
            <ruleset>../eclipse/src/main/resources/mahout-pmd-ruleset.xml</ruleset>
          </rulesets>
          <sourceEncoding>UTF-8</sourceEncoding>
          <targetJdk>1.5</targetJdk>
          <linkXRef>false</linkXRef>
          <includeTests>true</includeTests>
          <verbose>true</verbose>
        </configuration>
      </plugin>
[rest of pom omitted]

Can u please help me resolve this issue..

A: I don't think the problem is with the pom.xml - it looks like the standard Mahout 0.5 one. You need to explain what you are trying to do in Eclipse. In general, to use Maven projects in Eclipse, you need to install the M2Eclipse plugin. Then in Eclipse select
File->Import->Maven->Existing Maven Project

and select the Mahout project on the filesystem.
I checked out Mahout 0.5
svn checkout http://svn.apache.org/repos/asf/mahout/tags/mahout-0.5/

then imported into Eclipse as I describe above. I did get some errors but different to you e.g.
maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported
by m2e. pom.xml /mahout-examples line 54 Maven Project Build Lifecycle Mapping
Problem

this is a known issue and can be solved by putting <pluginManagement> tags around <plugins> in <build>. However it is not the problem you describe.

A: I solved this issue after setting proxy in Maven setting.xml

A: In Eclipse try following steps:

*

*Right click the project->Maven->Update Project

*Check checkbox "Force Update of Snapshots/Releases"

*Click OK.


text:
Q: Question about "print(input("input:\n"))" So I've recently decided to return to python but I found that
print(input("input:\n"))

returns:
input:

3 + 4

7

How is this possible? I thought that when you use input() you always get a string.

A: This is the behavior in Python 2.  See here:

input([prompt])
  Equivalent to eval(raw_input(prompt)).

In Python 3, input was removed, and Python 2's raw_input was renamed to input.
So, make sure you are using the correct Python version, and make sure you are using the appropriate input/raw_input function depending on which Python version you choose.

A: I tried provided code and got string "3+7" as result.
This is what the Python Docs on Input Method say
input([prompt])
If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. When EOF is read, EOFError is raised. Example:
    >>> s = input('--> ')
    --> Monty Python's Flying Circus
    >>> s
    "Monty Python's Flying Circus"

If the readline module was loaded, then input() will use it to provide elaborate line editing and history features.

redpajama_set_name: RedPajamaStackExchange


text:
Q: If K is a perfect field, is any extension of K also a Galois Extension? So I have got that if K is a perfect field then every irreducible polynomial over K is separable. (Separable meaning it has no repeated roots).
Is it then possible to conclude that every finite extension of K is separable and every algebraic extension of K is separable?
Hence the statement is true?


text:
Q: How to change these high order ODEs into a system of 1st order ODEs? Trying to know how to reshape the following two high-order ODEs into a system of first order ODEs, but can't get it right. Tried to follow this tutorial https://www.youtube.com/watch?v=cq3bPBePE8E&t=576s but didn't helped somehow.
a) Here is the first high-order ODE:
$u''(x)+u(x)+u(x)^3=0$   with initial values: $u(0)=0$ and $u′(0)= 0$
b) Here is the second high-order ODE:
$u_1'(x) = 98u_1(x) + 198u_2'(x)$ and $u_2'(x) = −99u_1(x) − 199u_2(x)$ with initial values: $u_1(0)=1$ and $u_2(0)=0$
What would be each one, if we reshape it to a system of first-order ODEs?
Thank you in advance for any help!

A: The second system already seems to be a system of first order ODEs, since no term has derivative higher than 1.
The first system can be converted as follows:
Let $v(x) \equiv u'(x)$. Hence, $v'(x) = u''(x)$. Replacing $u''(x)$ with $v'(x)$ gives the equations:
\begin{align*}
&u'(x) = v(x) \\
&v'(x) = u(x) + u(x)^3 \quad \text{(Since $v'(x) = u''(x)$)}
\end{align*}
Since $u'(x) = 0$ in the initial conditions, this means that $v(x) = u'(x) = 0$ in the initial conditions.


text:
Q: simple Recurrent Neural Net from scratch using tensorflow

I've build a simple recurrent neural net with one hidden layer with 4 nodes in it. This is my code:
import tensorflow as tf

# hyper parameters
learning_rate = 0.0001
number_of_epochs = 10000

# Computation Graph

W1 = tf.Variable([[1.0, 1.0, 1.0, 1.0]], dtype=tf.float32, name = 'W1')
W2 = tf.Variable([[1.0], [1.0], [1.0], [1.0]], dtype=tf.float32, name = 'W2')
WR = tf.Variable([[1.0, 1.0, 1.0, 1.0]], dtype=tf.float32, name = 'WR')
# b = tf.Variable([[0], [0], [0], [0]], dtype=tf.float32)
prev_val = [[0.0]]

X = tf.placeholder(tf.float32, [None, None], name = 'X')
labels = tf.placeholder(tf.float32, [None, 1], name = 'labels')

sess = tf.Session()
sess.run(tf.initialize_all_variables())

z = tf.matmul(X, W1) + tf.matmul(prev_val, WR)# - b
prev_val = z

predict = tf.matmul(z, W2)

error = tf.reduce_mean((labels - predict)**2)
train = tf.train.GradientDescentOptimizer(learning_rate).minimize(error)

time_series = [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]
lbsx = [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]

for i in range(number_of_epochs):
    for j in range(len(time_series)):
        curr_X = time_series[j]
        lbs = lbsx[j]

        sess.run(train, feed_dict={X: [[curr_X]], labels: [[lbs]]})

print(sess.run(predict, feed_dict={X: [[0]]}))
print(sess.run(predict, feed_dict={X: [[1]]}))

I'm getting output:
[[ 0.]]
[[  3.12420416e-05]]

With input 1, it should output 0 and vice versa. I'm also confused regarding the 'previous value'. Should it be a placeholder? I'd really appreciate your efforts to fix the code.


text:
Q: python dictionaries: assigning a blank dictionary Why does the following code give the following error and how do i assign it to blank dictionary within the function:
import time

dictionary_power_readings = {}

def update_dict():
    ApparentPower = "power"
    dictionary_power_readings[time.time()] = ApparentPower
    print(dictionary_power_readings)
    dictionary_power_readings ={}

while True:
    update_dict()
    time.sleep(1)

Traceback (most recent call last):   File
"updating_dict_from_function.py", line 15, in
update_dict()   File "updating_dict_from_function.py", line 7, in update_dict
dictionary_power_readings[time.time()] = ApparentPower UnboundLocalError: local variable 'dictionary_power_readings'
referenced before assignment

A: dictionary_power_readings = {}

def update_dict():
    global dictionary_power_readings
    ApparentPower = "power"
    dictionary_power_readings[time.time()] = ApparentPower
    print(dictionary_power_readings)
    dictionary_power_readin

A: Use Global keyword in your function
def update_dict():
     global dictionary_power_readings
     ApparentPower = "power"
     dictionary_power_readings[time.time()] = ApparentPower
     print(dictionary_power_readings)
     dictionary_power_readings ={}

It works , just try it once


text:
Q: How can I port entire VS Code project developed in C/C++ on Linux to WIndows? I have a working project in Linux and I have successfully flashed the code on to a nRF5480-DK controller. Now I am trying to do the same on windows.I have installed all the tools as recommended in the documentation https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf_cltools%2FUG%2Fcltools%2Fnrf_installation.html.
The project structure is
-  build
- .vscode
  - c_cpp_properties.json
  - launch.json
  - settings.json
  - tasks.json
- include
   - *.h
- src
  - *.c
- linked.ld
- Makefile

I have installed the compiler and sdk files and have given the path in settings.json file.
{
    "sdkRoot": "/nRF5_SDK_17.1.0_ddde560/nRF5_SDK_17.1.0_ddde560",
    "gnuInstallRoot": "/GNU Arm Embedded Toolchain/102021/bin/",
    "C_Cpp.errorSquiggles": "Enabled"
}

What changes should I make to the project structure? Should I replace Makefile with CMake?
Any tips on how to proceed?


text:
Q: nodejs graphviz: graph.output() converter giving error during DOT to PNG conversion graphviz = require('graphviz');
var g = graphviz.digraph("G");

// Add node (ID: Hello)
var n1 = g.addNode( "Hello", {"color" : "blue"} );
n1.set( "style", "filled" );

// // Add node (ID: World)
g.addNode( "World" );

// // Add edge between the two nodes
var e = g.addEdge( n1, "World" );
e.set( "color", "red" );

// // Print the dot script
console.log( g.to_dot() );
g.setGraphVizPath("/usr/local/bin")
g.output("png", "test.png")

Error

node:events:490
throw er; // Unhandled 'error' event
^
Error: spawn dot ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:285:19)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:291:12)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn dot',
path: 'dot',
spawnargs: [ '-Tpng', '-otest.png' ]
}

Tried upgrading and downgrading node version, tried using rendererDot module for conversion, nothing worked. DOT file is not getting converted to SVG/PNG.


text:
Q: Using one set of unit tests on many different files in Racket I'm looking for advice on how to structure my Racket programs. Currently, I have about 5 different versions of the program and each program has the same unit tests (RackUnit) just added to the end of each file. This is hard to maintain.
What I want to do is pull out the tests into a separate file and ask RackUnit to run the tests once for each program. But I'm not sure how to do that. Any advice?
Thanks!

A: In this case, perhaps we can do something highly dynamic by using Racket's reflection system.
Let's say, for example, that we're making sure that a set of modules all provide a function f that appears to be a monotonically increasing function.  How might we write a framework of testing a collection of implementations with the same battery of tests?
We can write a harness that:

*

*constructs a module that requires an implementing module in question, and

*runs the set of tests on it.

The code might look something like this:
(define (test-module-with-monotonic-f module-path-name)
  (define ns (make-base-namespace))
  (printf "testing ~s\n" module-path-name)
  (eval `(begin (module a-test-module racket/base
                  (require rackunit
                           (file ,(path->string module-path-name)))
                  (check-true (> (f 1) (f 0))
                              (format "~a fails to provide monotonic f" ,module-path-name))
                  (check-true (> (f 3) (f 2))
                              (format "~a fails to provide monotonic f" ,module-path-name)))
                (require 'a-test-module))
        ns))

which does the construction of the testing module, and runs it using a dynamic eval.  eval is usually considered evil, but in this particular situation, I think it's an appropriate tool.
Once we have this helper, we can run it on a collection of files, say in an impls subdirectory:
(for ([mod-name (in-directory "impls")]
      #:when (equal? (filename-extension mod-name) #"rkt"))
  (test-module-with-monotonic-f mod-name))

You can try the complete running example (https://github.com/dyoo/monotonic-f-example) to see all the pieces.
(It should be clear that the tests above are woefully insufficient, by the way.)

A: I don't know how robust this is, but here is a solution using a hygiene-breaking macro. (Danny is smarter than me though :) so maybe you'll want to follow his advice.)
File f1.rkt:
#lang racket
(define (f x) (displayln "f1's f") (+ x 1))
(define (g x) (displayln "f1's g") (+ x 2))
(require "f-tests.rkt")
(tests)

File f2.rkt:
#lang racket
(define (f x) (displayln "f2's f") (+ 1 x))
(define (g x) (displayln "f2's g") (+ 2 x))
(require "f-tests.rkt")
(tests)

File f-tests.rkt:
#lang racket
(provide tests)
(define-syntax (tests stx)
  (syntax-case stx ()
    [(_)
     (datum->syntax
      stx
      '(begin
         (require rackunit)
         (check-equal? (f 10) 11)
         (check-equal? (g 20) 22)))]))

The datum->syntax says that the tests macro should use the identifiers in the context of stx, ie where the macro is invoked (normally, the macro will use the identifiers at the time the macro is defined). Running either file f1.rkt or f2.rkt will run the tests. (The prints are just to prove that the correct function is being called.)


text:
Q: android version upload is different with app in google play I uploaded my app in google developer console, my app is 29 Mg size and it's works very well, but problem is after publishing app when any user wants to download my app.they download a version that has 23 Mg
This version has problem and they got error for example in any activities we have database app crashed
Do you know why it happen?


text:
Q: How to convert 3D DXF to PostGIS 2.0? I'm not very skilled on using postgis but I face a problem that I must solve, i.e. create tables to load geographical data stored as dxf.
I have a thousand dxf files (3d) with polylines, points and polygons and I want to convert them to a postgis/postgres db.
I'm in windows xp using postgres 9 postgis 2.0.
Gdal/OGR are installed using Osgeo4Win installer.
I can write some basic python script to handle data in batch.
Can you please direct me to some useful tutorial/hint on how to face this problem.
Thanks in advance

A: I'm a little bit late, but hope it helps.
Tuts and books
If you want something learn about ogr, gdal, python and postGIS you can look at
first on these pages and book.
Geoprocessing with Python using Open Source GIS
http://www.gis.usu.edu/~chrisg/python/
ogr
http://www.gdal.org/ogr/
ogr2ogr - cheatsheet
http://www.bostongis.com/?content_name=ogr_cheatsheet#41
for an programming example there is an an apitutorial for C++, C and Python
http://www.gdal.org/ogr/ogr_apitut.html
you can also begin here:
http://wiki.osgeo.org/wiki/OSGeo_Python_Library
http://trac.osgeo.org/gdal/wiki/GdalOgrInPython
PostGIS
http://www.bostongis.com/ is allways a good starting point. And also the
book "PostGIS in Action" by them is an great
guid to PostGIS.
An other nice overview you can find in the following book:
Erik Westra, Python Geospatial Development.
http://www.packtpub.com/python-geospatial-development/book
Now to your specific problem.
First Problem - Geometry
GEOMETRY in dxf vs GEOMETRY in GIS
One problem is the definition of geometries in dxf and in GIS
Geometries in dxf:
Points are allways points, there is no problem here.
Linestrings are linestrings, theres also no problem so far.
But when it comes to polygons there is an problem with in dxf.
Polygons will allways represented as LINESTRING!!! Whenever you choose
polygon or 3dpoly as option, to create an polygon, it will be an linestring.
If your read the features from an dxf-file with ogr the representation of
polygons is ever an representation of an linestring.
Example:
WKT-string: LINESTRING(1 1 1,2 1 1,2 2 1,1 2 1,1 1 1)
But should be:
WKT: POLYGON(1 1 1,2 1 1,2 2 1,1 2 1,1 1 1)
See Wikipedia for WKT-notation
ogr2ogr doesn't change this. You have to do it yourself. We cover this later.
Second Problem - ogr2ogr
The great problem with ogr2ogr is to know what all this options are for and
where to learn about. There isn't much help with ogr2ogr --help or ogr2ogr
--long-usage on the commandline. So by trial and error I have figured out the
following.
ogr2ogr -dsco INIT_WITH_EPSG=yes -lco LAUNDER=yes -lco SPATIAL_INDEX=yes \
    -append -skipfailures -f PostgreSQL \
    PG:"dbname={dbname} user={user} password={password} schemas={schema}" \
    -nln {yourtable} \
    -nlt {geometry}25D \
    -a_srs EPSG:{EPSG-Code}
    {srs-file}.dxf

Here are the options (for Version 1.9):

*

*dsco INIT_WITH_EPSG -- don't sure we need this for PostgreSQL, works for
Spatialite

*lco -- layer creation option; LAUNDER=yes all strings to lower
and some special charackters will be presented as underbar

*lco SPATIAL_INDEX=yes; creates an spatial index

*append (or/and update) -- append to existing table

*skipfailures -- use this option, otherwise ogr2ogr will stop if it find an
geometry that isn't defined in the table

*f PostgreSQL -- write to PostgreSQL

*nln -- yourtablename

*

*create a table with this name in your db, without! columns, this will ogr2ogr
do, it takes the dxf-structure (layer, subclasses, extendedentity,
linetype, entityhandle, text)

*if you you want your own colums, you have to figure out it by yourself

*without nln it creates an table "entities"

*nlt -- new layer type; here you can choose between an 2D or an 3D geometry

*

*from ogr2ogr --long-usage

*nlt type: Force a geometry type for new layer. One of NONE, GEOMETRY,
POINT, LINESTRING, POLYGON, GEOMETRYCOLLECTION, MULTIPOINT,
MULTIPOLYGON, or MULTILINESTRING. Add "25D" for 3D layers
Default is type of source layer.

*default representation for dxf-features is 2D!, but with three
coordinates, so ogr2ogr sets Z-values allways to zero

*a_srs EPSG: -- assign an output EPSG-code

You have to do this for points, linestrings and geometrycollections.
Then you can write an shell script like this one (created by underdark)
for f in `ls *dxf` do
ogr2ogr -dsco INIT_WITH_EPSG=yes -lco LAUNDER=yes -lco SPATIAL_INDEX=yes \
  -append -skipfailures -f PostgreSQL \
  PG:"dbname={dbname} user={user} password={password} schemas={schema}" \
  -nln $f \
  -nlt {geometry}25D \
  -a_srs EPSG:{EPSG-Code}
  $f
done

So then you have an table with points, an table with linestrings and an table
with geometrycollections. Now you have to figure out where your polygons
are. You can find them with the following SQL-statement. It returns all
linestrings where the first point and the last point are equal. You can put
this in an SELECT INTO-statement and create an new table. After that you can also
clean your linestring table with this statement. It is also possible to
create an trigger
so it will be a little more comfortable ;-).
SELECT ogc_fid, layer,
       ST_Polygon(ST_GeomFromEWKT(ST_asText(wkb_geometry)), {EPSG-Code}) as the_geom
INTO {your-polygon-table}
FROM {your-linestring-table}
WHERE ST_StartPoint(wkb_geometry) = ST_EndPoint(wkb_geometry);

A: I made a Python script, I'm not a Python guru, but it works.
It asks all the parameters to connect to postgis and a folder to process.
It lists all dxf files in a folder (and subfolders) and creates a postgis table with the first, then append all the geometries of the others dxf.
It logs all files and processing strings into a txt file.
Here it is:

#

    # Script che processa tutti i dxf in una cartella e nelle sottocartelle         #
    # da lanciare da una shell python con il comando execfile('dxftopostgis.py')    #
    # al lancio chiede la cartella da processare, i parametri per connettersi al db #
    # ed il numero del sistema di ccordinate secondo EPSG.                          #
    # Made by Pietro Rossin                                                         #
    #################################################################################
    import os, glob

    try:
        from osgeo import ogr
    except:
        import ogr

    import gdal
    from gdalconst import *

    in_workspace = str(raw_input("Dammi il percorso per la cartella coi dxf: "))
    host = str(raw_input("Server con postgis: "))
    dbname = str(raw_input("Nome db: "))
    user = str(raw_input("Username: "))
    pword = str(raw_input("Password: "))
    epsg = str(raw_input("Numero EPSG?: "))

    #entra nella cartella da processare e crea una lista di folders
    os.chdir(in_workspace)
    listafolders= os.listdir(in_workspace)

    #apre un file su cui loggare le stringhe di processamento
    outfile = open(in_workspace + '\Log_processamento.txt','w')

    #ciclo per processare tutti i file delle sottodirectory
    primo = 1
    for folder in listafolders:
        currentfolder = in_workspace + folder
        #modulo glob per espandere i percorsi con caratteri jolly
        filelist = glob.glob(currentfolder + '\*.dxf')
        for file in filelist:
            #print file
            if primo == 1:
                stringaprocessare = 'ogr2ogr --config DXF_INLINE_BLOCKS FALSE --config DXF_MERGE_BLOCK_GEOMETRIES FALSE -f "PostgreSQL" PG:"host= '\
                + host + " user=" + user + " dbname=" + dbname + " password="+ pword + "\" " +" -lco DIM=3 " + file + " -where \"Layer NOT LIKE 'X%'\"" +" -overwrite -a_srs EPSG:" + epsg + " entities"

            else:
                    stringaprocessare = 'ogr2ogr --config DXF_INLINE_BLOCKS FALSE --config DXF_MERGE_BLOCK_GEOMETRIES FALSE -f "PostgreSQL" PG:"host= '\
                + host + " user=" + user + " dbname=" + dbname + " password="+ pword + "\" " + file + " -where \"Layer NOT LIKE 'X%'\"" +" -append " +  "entities"

            primo = -1
            print 'Sto processando il file '+ file
            os.system(stringaprocessare)
            outfile.write(stringaprocessare + "\n")

    else:
        outfile.close()


text:
Q: Objective C - Invoke a method with variable argument list (NS_REQUIRES_NIL_TERMINATION) Lets assume that I've a function in a class, which shows an alert:
- (void)showErrorWithTitle:(NSString *)title message:(NSString *)message
         cancelButtonTitle:(NSString *)cancelButtonTitle
         otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;

- (void)showErrorWithTitle:(NSString *)title message:(NSString *)message
         cancelButtonTitle:(NSString *)cancelButtonTitle
         otherButtonTitles:(NSString *)otherButtonTitles, ... {

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title
                                                    message:message
                                                   delegate:nil
                                          cancelButtonTitle:cancelButtonTitle
                                          otherButtonTitles:nil];

    va_list args;
    va_start(args, otherButtonTitles);
    for (NSString *arg = otherButtonTitles; arg != nil; arg = va_arg(args, NSString*))
    {
        [alert addButtonWithTitle:arg];
    }
    va_end(args);

    [alert show];
    [alert release];
}

I've a wrapper class, in which a method calls this method. My problem is how I have to implement this method?
This solution is not work:
- (void)showErrorWithTitle1:(NSString *)title message:(NSString *)message
          cancelButtonTitle:(NSString *)cancelButtonTitle
          otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;

- (void)showErrorWithTitle1:(NSString *)title message:(NSString *)message
          cancelButtonTitle:(NSString *)cancelButtonTitle
          otherButtonTitles:(NSString *)otherButtonTitles, ... {

    [[Someclass intance] showErrorWithTitle:title
                                    message:message
                          cancelButtonTitle:cancelButtonTitle
                          otherButtonTitles:otherButtonTitles, nil];
}

The invocation:
[self showErrorWithTitle1:@"Hello"
                 message:@"Example"
       cancelButtonTitle:@"No"
       otherButtonTitles:@"Yes, Maybe", nil];


text:
Q: What is his mark Vs. What mark does he have (school mark) Well, the question is in the title. I should translate one phrase and I don't know the right answer. What is his mark? or What mark does he have? Which one is correct? What the difference between them?

A: None of them are wrong; in fact, they're used interchangeably in school settings. However, there is a difference between them.

What is his mark in Science?
  His mark is an 84 [percent].

The mark has a value. This question is simply asking what that value is. His mark is the subject.

What mark does he have in Science? He has an 84 [percent].

He has a certain mark. This question demands the same answer as the previous one, but it's phrased in a less direct fashion, instead asking for specifications on something he has. He is the subject. In conversations between students, this is probably the most common.
An example brought up in the comments was

What mark did he get? He got an 84 [percent].

This is different from the other two because it implies that the mark was given at an earlier time, while the others ask for the mark at the current time.


text:
Q: The value in the textbox will not pass to microsoft access database I am using Visual Studio 2013 and programming in VB.  I am trying to pass a string from a textbox to a Microsoft Office 365 Access Database.
My code:
Using cn As OleDbConnection = New OleDbConnection("Provider=Microsoft.ace.oledb.12.0;data source=C:\...\...\...\...accdb;")

        Dim cmd As OleDbCommand

        cmd = New OleDbCommand("SELECT * FROM Client_Information WHERE @FirstName", cn)

        With cmd.Parameters
            .Add("@First Name", OleDbType.VarChar).Value = FirstNameTextBox.Text
            '.Add("@LastName", OleDbType.VarChar).Value = LastNameTextBox.Text
        End With

        cn.Open()
        cmd.ExecuteNonQuery()

        cn.Close()
    End Using

It seems to work but no value is posted to Access.  This is a form after a log-in form that does work.  When I use an INSERT INTO command before the SELECT statement it throws and exception.
OleDbException was unhandled
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll
Additional information: Syntax error in INSERT INTO statement.


text:
Q: Maven Projects not being recognized as a java project in eclipse I am working on maven projects in eclipse but i am unable to refactor & do changes because i think it doesnot recognize as a java project because i keep getting error like "resource is not in the java build path of a java project"
I have tried all the things like

*

*searching for java build path by right clicking the project->properties. but there was no option for java build path

*i tried changing the installed jre(in windows->preference->java->build path->installed jre) & put the correct jdk but it doesnot work

*Also all the maven projects are building successfully in terminal.
so there is some problem with eclipse also all the pom.xml have some warning "Cannot read lifecycle mapping" & "Plugin Execution not covered by lifecycle configuration" I looked into their solution but it was of no help

*

*i have also tried changing my pom.xml according to the solutions for this lifecycle mapping problem but it didn't help

*initially i thought there is some issue with m2 eclipse but i also tried changing pom.xml acccordingly as well as going to windows-preferences-maven-discoveries-open catalog & installing m2e connector but there was some problem with the installation

A: You need to run the maven goal eclipse:eclipse in your workspace location
mvn eclipse:eclipse

A: If this is in Kepler, try right clicking the project in mind -> Configure -> Convert to Maven Project


text:
Q: How to validate signature successfully when there are two id attributes in an assertion node? I have below SAML v2 XML. The signature validation fails as there are two ID attributes in the assertion node. The ID is having wrong value and the value pointed by referenceURI is in Id attribute. Sample below.
<?xml version="1.0"?>
<samlp:Response ID="gbfgoeahcoefemndehmcoeepmpdckdingbafamcb" IssueInstant="2017-08-23T04:44:36Z" Version="2.0" xmlns="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
    <samlp:Status>
        <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
    </samlp:Status>
    <Assertion ID="fmcpoegiimapenheggdpjojncbljphgcnoalogap" Id="pfx1af01d88-2006-0901-3fa4-c54a400fad3c" IssueInstant="2017-08-23T04:44:36Z" Version="2.0" xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
        <Issuer>example.com</Issuer>
        <Subject>
            <NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">foo@example.com</NameID>
            <SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
                <SubjectConfirmationData NotOnOrAfter="2017-08-23T04:54:36Z" Recipient="https://www.example.com/saml/endpoint"/>
            </SubjectConfirmation>
        </Subject>
        <Conditions NotBefore="2017-08-23T04:39:36Z" NotOnOrAfter="2017-08-23T04:54:36Z">
            <AudienceRestriction>
                <Audience>https://www.example.com</Audience>
            </AudienceRestriction>
        </Conditions>
        <AuthnStatement AuthnInstant="2017-08-23T04:44:36Z">
            <AuthnContext>
                <AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:Password</AuthnContextClassRef>
                <AuthenticatingAuthority>foobarbaz</AuthenticatingAuthority>
            </AuthnContext>
        </AuthnStatement>
        <AttributeStatement>
            <Attribute Name="random">
                <AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">foo@example.com</AttributeValue>
            </Attribute>
        </AttributeStatement>
        <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
            <ds:SignedInfo>
                <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
                <ds:Reference URI="#pfx1af01d88-2006-0901-3fa4-c54a400fad3c">
                    <ds:Transforms>
                        <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                    </ds:Transforms>
                    <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                    <ds:DigestValue>P4pZAc2fLYvaf92FrVGdgYKcBww=</ds:DigestValue>
                </ds:Reference>
            </ds:SignedInfo>
            <ds:SignatureValue>tdzLY9Gem64Va9urGwqwvP3G6TjEtEy6Ely+8/D7RQuAFAiy6jcX4bsUwh7zhzoV+Thg8hhjzXBpqSSmDnBhsl6GSMAnAvAelF/eDlQk0+/wH+USYBTD8gvzvxZiB5GU8EgF7F5lLzzof+YrAQ0Zg/TSewdkiNJFLvXSI1Kw5E7lmlTgFv75Myn7kdgFs115JjrIfLcuMePlw20I51CHQK/Fy4S+nqQsJEzT8nYZ0AM6iTUo8zOduLN7DpHn0yK2HNnKXFzCT6o9CGxtcOe+xxo4rL71YFiiGTxh/tk0qWELOeEk3MM4DPyO1qIJ3UNxqX22VGLVmSwTsa/9DKKhcA==</ds:SignatureValue>
            <ds:KeyInfo>
                <ds:X509Data>
                    <ds:X509Certificate>MIID9DCCAtwCCQCOW98TM3+UkTANBgkqhkiG9w0BAQUFADCBuzELMAkGA1UEBhMCSlAxETAPBgNVBAgMCEthbmFnYXdhMREwDwYDVQQHDAhZb2tvaGFtYTEeMBwGA1UECgwVRlVKSVNPRlQgSU5DT1JQT1JBVEVEMSYwJAYDVQQLDB1JbmZvcm1hdGlvbiBTeXN0ZW0gRGVwYXJ0bWVudDEcMBoGA1UEAwwTZHNpZy5hdXRoLmZzaS5jby5qcDEgMB4GCSqGSIb3DQEJARYRbmV0d29ya0Bmc2kuY28uanAwHhcNMTEwNzA1MDUwMzQzWhcNMjUwMzEzMDUwMzQzWjCBuzELMAkGA1UEBhMCSlAxETAPBgNVBAgMCEthbmFnYXdhMREwDwYDVQQHDAhZb2tvaGFtYTEeMBwGA1UECgwVRlVKSVNPRlQgSU5DT1JQT1JBVEVEMSYwJAYDVQQLDB1JbmZvcm1hdGlvbiBTeXN0ZW0gRGVwYXJ0bWVudDEcMBoGA1UEAwwTZHNpZy5hdXRoLmZzaS5jby5qcDEgMB4GCSqGSIb3DQEJARYRbmV0d29ya0Bmc2kuY28uanAwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDxnlGqyqFwM0KJ5q8boYVXFcUvFSNytBn/ek8hydCXVkKBp9XYccJMJ9Ntz7uplQO7bmD80q72Sdz8rPiVwgrncq03rgV4M9viyDZYkeqT20ZefKoOJ+a9k6/79vQQ7Zy7FUzsJiysrD6slseeBup4Jc1M0TYpxaQ6aoEOVq8MFz0NFMWGLADKfQwlQHZQEJO0jIzvXsm5q0aDL26TJ2q9DOsqktNYH5zjn0jx/+EHF7Qv+1G3L6Vwf91KRgf/K3xnimyx7/8mpnIbMfYEY5bC1Er4rWNyILOIn4Sim0ooKHPa4SIU9hQGlg6wGemzcJ6OME3qDCGvuxaN77PwuTMpAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAK5DMpCmlWgH2yHG+JtgHkZkn65tKuvgkijkUktdSZXdnEfJ7bYwwrLF/cSL3n317ZwRqsUux5ems7Ryzr2zoRnnexxpEMvjbVTC27nWTs+Z25DFVyDZt3+sc4pxGnq25rAjpu+U5GegM/stZPeM2bCp/hZODLinK8r0d7e5YszPbsAxJkEts6O3C30ivWTixpEa36exJTbTPTYkZ3/6sHvJECmUKd0es0yLB4yPylLbrq8Pky2YlcmvqfTU1uDGVzLq4f20j7iEPROMEf9kpcT+usW/gvjy9/lB9aa6uAlFwPXq0KViJzSixHEly8edKZ5zk3j7rqs6n5me4XUdjEM=</ds:X509Certificate>
                </ds:X509Data>
            </ds:KeyInfo>
        </ds:Signature>
    </Assertion>
</samlp:Response>

As we can see there are two IDs. I am using OpenSAML v3 and it gives cryptographic signature validation failure. I tried various methods like setting (.setID assertion "pfx1af01d88-2006-0901-3fa4-c54a400fad3c") before signature validation, but it fails.
My main code is in Clojure. I am prototyping in Groovy as well. See the groovy script.
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
db = dbf.newDocumentBuilder();
ByteArrayInputStream bis = new ByteArrayInputStream(xml.getBytes());
doc = db.parse(bis);
nl = doc.getElementsByTagName("ds:Signature");

DOMValidateContext ctx = new DOMValidateContext(key, nl.item(0));
println nl.item(0).getParentNode().toString()
ctx.setIdAttributeNS((Element) nl.item(0).getParentNode(), null, "Id");

XMLSignatureFactory sigF = XMLSignatureFactory.getInstance("DOM");
XMLSignature xmlSignature = sigF.unmarshalXMLSignature(ctx);

println xmlSignature.validate(ctx)  // returns false

This validation succeeds when using C#, but it is not working in Java. Please help.

A: I did manual XML-DSIG verification.


text:
Q: How can I reference column values from previous rows in BigQuery SQL, in order to perform operations or calculations? I have sorted my data by start time, and I want to create a new field that rolls up data that overlap start times from the previous rows start and end time.
More specifically, I want to write logic that, for a given record X, if the start time is somewhere between the start and end time of the previous row, I want to give record X the same value for the new field as that previous row. If the start time happens after the end time of the previous row, it would get a new value for the new field.
Is something like this possible in BigQuery SQL? Was thinking maybe lag or window function, but not quite sure. Below are examples of what the base table looks like and what I want for the final table.

Any insight appreciated!

A: Below is for BigQuery Standard SQL
#standardSQL
SELECT recordID, startTime, endTime,
  COUNTIF(newRange) OVER(ORDER BY startTime) AS newRecordID
FROM (
  SELECT *,
    startTime >= MAX(endTime) OVER(ORDER BY startTime ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING) AS newRange
  FROM `project.dataset.table`
)

You can test, play with above using sample data from your question as in example below
#standardSQL
WITH `project.dataset.table` AS (
  SELECT 1 recordID, TIME '12:35:00' startTime, TIME '12:50:00' endTime UNION ALL
  SELECT 2, '12:46:00', '12:59:00' UNION ALL
  SELECT 3, '14:27:00', '16:05:00' UNION ALL
  SELECT 4, '15:48:00', '16:35:00' UNION ALL
  SELECT 5, '16:18:00', '17:04:00'
)
SELECT recordID, startTime, endTime,
  COUNTIF(newRange) OVER(ORDER BY startTime) AS newRecordID
FROM (
  SELECT *,
    startTime >= MAX(endTime) OVER(ORDER BY startTime ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING) AS newRange
  FROM `project.dataset.table`
)
-- ORDER BY startTime

with result
Row recordID    startTime   endTime     newRecordID
1   1           12:35:00    12:50:00    0
2   2           12:46:00    12:59:00    0
3   3           14:27:00    16:05:00    1
4   4           15:48:00    16:35:00    1
5   5           16:18:00    17:04:00    1

A: This is a gaps and islands problem.  What you want to do is assign a group id to non-intersecting groups.  You can calculating the non-intersections using window functions.
A record starts a new group if the cumulative maximum value of the end time, ordered by start time and ending at the previous record, is less than the current end time.  The rest is just a cumulative sum to assign a group id.
For your data:
select t.*,
       sum(case when prev_endtime >= endtime then 0 else 1 end) over (order by starttime) as group_id
from (select t.*,
             max(endtime) over (order by starttime rows between unbounded preceding and 1 preceding) as prev_endtime
      from t
     ) t;

The only potential issue is if two records start at exactly the same time.  If this can happen, the logic might need to be slightly more complex.


text:
Q: How to make other form elements clickable when a modal box is in front? A modal box appears when I focus this field. And it goes whenever I click elsewhere.

I can't double click to reveal past values because on double clicking, the modal box first appears and then goes, i.e. the second click is not registered as click on text field. How to double click to open list of past values without closing the modal box?

function edifactTagsInfo() {
  document.getElementById('myModal').style.display = "block";
}

function blurEdifactTagsInfo() {
  document.getElementById('myModal').style.display = "none";
}
.modal {
  display: none;
  /* Hidden by default */
  position: fixed;
  /* Stay in place */
  z-index: 0;
  /* Sit on top */
  padding-top: 100px;
  /* Location of the box */
  left: 0;
  top: 0;
  width: 100%;
  /* Full width */
  height: 100%;
  /* Full height */
  overflow: auto;
  /* Enable scroll if needed */
  background-color: red;
  /* Fallback color */
  background-color: rgba(0, 0, 0, 0);
  /* Black w/ opacity */
  opacity: 0.9;
  filter: alpha(opacity=90);
}

/* Modal Content */

.modal-content {
  background-color: #fff;
  margin: auto;
  padding: 25px;
  border: 5px solid #0eaadc;
  width: 50%;
  font-family: Amadeus_Font, sans-serif;
  font-weight: bold;
  font-style: normal;
  font-size: 20px;
  color: #0c65ba;
}
<input type="text" id="edifactTagsField" onfocus="edifactTagsInfo()" onblur="blurEdifactTagsInfo()">

TEXT

A: try this:

function edifactTagsInfo() {
  document.getElementById('myModal').style.display = "block";
}

document.getElementById('edifactTagsField').parentElement.addEventListener('click',function() {
  document.getElementById('myModal').style.display = "none";
});
.modal {
  display: none;
  /* Hidden by default */
  position: fixed;
  /* Stay in place */
  z-index: 0;
  /* Sit on top */
  padding-top: 100px;
  /* Location of the box */
  left: 0;
  top: 0;
  width: 100%;
  /* Full width */
  height: 100%;
  /* Full height */
  overflow: auto;
  /* Enable scroll if needed */
  background-color: red;
  /* Fallback color */
  background-color: rgba(0, 0, 0, 0);
  /* Black w/ opacity */
  opacity: 0.9;
  filter: alpha(opacity=90);
}

/* Modal Content */

.modal-content {
  background-color: #fff;
  margin: auto;
  padding: 25px;
  border: 5px solid #0eaadc;
  width: 50%;
  font-family: Amadeus_Font, sans-serif;
  font-weight: bold;
  font-style: normal;
  font-size: 20px;
  color: #0c65ba;
}
<input type="text" id="edifactTagsField" onfocus="edifactTagsInfo()">

TEXT

all what I do is remove hiding the modal onBlur event of edifactTagsField and add a onClick listener to the parent of edifactTagsField to hide the modal;


text:
Q: Pillar jinja error on iteritems Having issues iterations via pillar data and jinja template.  I took most of the template from a working salt/pillar installation but now failing to work in new environment.
I have tried several different syntaxes with the implementation of the iteration but still get same error.
ServerName:
    Data failed to compile:
Rendering SLS 'base:pillar_lab_user' failed: Jinja variable 'str object'

has no attribute 'iteritems'
Jinja Template

{% set users = salt['pillar.get']('XXXXXXX') %}
{% for user, args in users.iteritems() %}
{{ user }}:
  user.present:
    - fullname: {{ args.fullname }}
    - uid: {{ args.uid }}
    - gid_from_name: True
    - shell: {{ args.shell }}
{% if not args.empty_password == true %}
    - password: {{ args.password }}
{% else %}
    - empty_password: {{ args.empty_password }}
{% endif %}
{% if 'groups' in args %}
    - groups: {{ args['groups'] }}
{% endif %}

{% endfor %}

Pillar Data
users:
  user1:
    fullname: User1 Fullname
    uid: 951
    gid: 951
    shell: /bin/bash
    groups:
      - sudo
      - admin
    password: (REMOVED)
    pub_ssh_keys: (REMOVED)

  user2:
    fullname: User2 Fullname
    uid: 955
    gid: 955
    shell: /bin/bash
    groups:
     - sudo
     - admin
    password: (REMOVED)
    pub_ssh_keys: (REMOVED)

{% for user, args in users.iteritems() %}
What is the correct syntax for iteritems and accessing this data via a jinja template.
I have tried many variations of this syntax but still getting the
ServerName:
    Data failed to compile:
----------
     Rendering SLS 'base:pillar_lab_user' failed: Jinja variable 'str object'

has no attribute 'iteritems'
EDIT
This was all user error, the pillar configuration was malformed. I removed the first line
"{% set users = salt['pillar.get']('XXXXXXX') %}"

so I didn't use pillar.get and targeted with pillar top.sls.  It works properly now.

A: Your data should fail with :
Rendering SLS 'base:so' failed: Jinja variable 'dict object' has no attribute 'empty_password'
The reason why you see this error must be caused by non-existing pillar data.
You've pasted full pillar data but left XXXXXXX in state file.
It suggest that fix could possibly be as simple as:
{% set users = salt['pillar.get']('users') %}

or if it is not the case: check if you use pillarenv, then remember to pass the correct one, you can simply verify this in command line:
salt 'your minion' pillar.get users

If it doesn't return your dictionary then try:
salt 'your minion' pillar.get users pillarenv=your_pillar_env


text:
Q: Adding secondary file association in Windows? In Windows, you can right-click a file, and there is an option which lets you choose which program to launch with this file. So, for example, when user right-clicks a .cdr file, he can choose Open With -> Corel Draw option, and it would be launched with Corel Draw.
Now, I need to add certain program to that list (program has to be launched with some other parameters, as well). But I do not want to change the default program for that file. Is there a way to do it?

A: The following registry keys control this list:

*

*HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ FileExts \ .FileExtension \ OpenWithList

*HKEY_CLASSES_ROOT \ .FileExtension \ OpenWithList
See this MSDN page for more information on the format.


text:
Q: Automatically running a command when android device connected usb I'm developing an app on the device. running adb reverse ... every time, is frustrating. is there a way to run a custom command or auto bind the ports, every time a USB android is connected?
I appreciate answers for Windows/Linux/Mac.

A: You could use autoadb to automate on device plugin. Here is the link to repository
https://github.com/rom1v/autoadb

A: I ran into this annoyance as well. I made this shell script to automatically run adb reverse whenever my phone is plugged in. Hope it helps. I think it can also be adapted to run on Windows.
#!/bin/sh
while :
do
    echo Waiting for Android USB device
    adb wait-for-usb-device reverse tcp:8081 tcp:8081
    echo Connection established
    adb wait-for-usb-disconnect
    echo Disconnected
done


text:
Q: will .NET 4.5.2 code throw exception on <4.5.2 machine? I want to use the QueueBackgroundWorkItem feature in a asp.net 4.5 web application product we ship to many customers.
However its quite possible that most of the customers don't have 4.5.2 Installed. In this scenario I can either provide an alternative solution or display a message to install 4.5.2.
Is it possible to include 4.5.2 code in this way or will it likely throw an exception on startup if 4.5.2 isn't present?

A: It'll throw when it tries to compile the method that contains a call to QueueBackgroundWorkItem with a MissingMethodException.
If you avoid any code paths that might force it to compile such methods, then you should be fine and can gracefully warn the user (after e.g. using reflection to check for the presence of this method) or switch to fallback methods.
It won't automatically throw an exception on startup, unless your startup code includes such a call.

A: .Net will check current .NET installed version on startup. If it less than need it will show dialog window, showing reason and allowing download latest version


text:
Q: Unable to find any JVMs matching architecture "x86_64". No Java runtime present, try --request to install. No Java runtime present, requesting install while launching eclipse from the terminal I get this error
Unable to find any JVMs matching architecture "x86_64". No Java runtime present, try --request to install. No Java runtime present, requesting install
thank you

A: Re-check your Java version by java -version and make sure that it matches your Mac's architecture and $JAVA_HOME points to correct version.
If you do have correct Java version installed, maybe that's some kind of a bug.

A: If Miu's above suggestion didn't work - see MrDev's answer here that indicates that what is needed is the Java JDK rather than JRE.


text:
Q: What is the dual of $A\cap B$ I encountered with some elliptic problem which admits a variational formulation in terms of space $X$ and I need to understand its dual. Suppose that $2<p<\infty$, $\Omega\subset {\mathbb R}^d$ where $d = 3$ and $|\Omega|<\infty$. $X = H^{2}_0(\Omega)\cap W^{1,p}(\Omega)$. What is the structure of $X^*$?

A: It's the direct sum of the duals of the two spaces, that is,
$$
X^* = \{u + v : u \in H^{-2} , v \in W^{-1,q} \} .
$$
Edit: Correction (see comments below)


text:
Q: Copy file names at Recycle Bin I'm trying to copy all filenames list on the Recycle Bin in Windows 10.
I go to Command Prompt:

C:\>cd C:/$Recycle.Bin
C:\$Recycle.Bin>dir S-1-5-21-2370250818-2711005194-4184312249-1165

$R8CQG1I.txt
$IURO2ZD.txt
$RV2TEJ7.txt

I have 3 files I want to copy the real file names not the names like this result.
After some search I found this VBScript. I run the code and I get this error:

Expected end of statement

Option Explicit

DIM g_objWshShell, g_objFSO, g_sLogFile, g_objWshNetwork, g_sScriptName, g_sComputerName, g_sUserName Dim g_sVer, g_objLogFile, g_sLogDir

'Setup main variables and objects Set g_objWshShell = WScript.CreateObject("WScript.Shell")  'Create a Shell Object Set g_objFSO = CreateObject("Scripting.FileSystemObject") 'create a File System Object Set g_objWshNetwork = WScript.CreateObject("WScript.Network") 'Create Network Object g_sComputerName
= g_objWshNetwork.Computername      'Gets machine Computer name g_sUserName = g_objWshNetwork.UserName              'Gets logged-on username g_sScriptName=UCase(WScript.ScriptName)    '
*** Name of the script

' *** START LogFile Information - use Delete or Append info below; don't use both *** Const FORREADING = 1, FORWRITING = 2, FORAPPENDING
= 8  'Setup constants for writing, appending, etc g_sLogDir = "C:\TEMP" If Not (g_objFSO.FolderExists(g_sLogDir)) Then  g_objFSO.CreateFolder(g_sLogDir) End If g_sLogFile = g_sLogDir & "\" & Left(g_sScriptName,len(g_sScriptName)
- 3) & "LOG" 'Makes log file the SCRIPTNAME.Log g_sVer = "1.0"

'To delete a logfile and create a new one each time script is ran If g_objFSO.FileExists(g_sLogFile) Then   g_objFSO.DeleteFile(g_sLogFile) 'Delete logfile if it exists. End If Set g_objLogFile = g_objFSO.CreateTextFile(g_sLogFile, FORWRITING) 'Setup the logfile for writing

Call Main() Call ExitScript()

'Start main script HERE *** Sub Main()  Dim objRecycleBin, objFolderItems, objItem, strSpecialFolderName    strSpecialFolderName = "Recycle Bin"        'Call WriteLine("Starting " &  g_sScriptName & " at " & Date & " " & Time, g_objLogFile)    Set objRecycleBin
= GetSpecialFolderObject(strSpecialFolderName)      'Get Special Folder based upon input name   Set objFolderItems = objRecycleBin.Items()                      'Get items within Recycle Bin   For Each objItem In objFolderItems                  'Delete all items within Special Folder         If (objItem.Type = "File Folder") Then          'Check for file type            g_objFSO.DeleteFolder(objItem.Path)         'Delete Folders         Else            g_objFSO.DeleteFile(objItem.Path)           'Delete Files       End If      WScript.Echo "Deleted " & objItem.Name  Next     End Sub

'*-*-*-*-*- Start Subroutines here
*-*-*-*-*- 'Returns SpecialFolder based upon name of folder Function GetSpecialFolderObject(NameOfFolder)   Dim objShellApp, i, objSpecialFolder    Set objShellApp = CreateObject("Shell.Application")     On Error Resume Next    For i=0 To 40   '40 is highest value for special folders        Set objSpecialFolder = objShellApp.NameSpace(i)         If (StrComp(objSpecialFolder.Title,NameOfFolder,vbTextCompare)=0) Then          Set GetSpecialFolderObject = objSpecialFolder           Exit For        End If  Next    Err.Clear End Function

'Closes logfile and exits script Sub ExitScript()   'Call WriteLine(Date & " " & Time & "; Completed " & g_sScriptName, g_objLogFile)   If IsObject(g_objLogFile) Then
        g_objLogFile.Close  End If  Wscript.Quit  End Sub

Sub EndOnError(sErrorString)    WScript.Echo sErrorString & vbcrlf & "Check " & chr(34) & g_sLogFile & Chr(34) & " for details"     Call WriteLine (sErrorString, g_objLogFile)     WScript.Quit() End Sub

'Shows usage if input is wrong sub ShowUsage()  WScript.Echo g_sScriptName & " v" & g_sVer & " Empties Recycle Bin for logged on user" & vbcrlf _   & vbcrlf & "USAGE: [CSCRIPT] " & g_sScriptName  WScript.Quit end sub

'Writes to log Sub WriteLine(ByVal strMessage, ByVal objFile)
    On Error Resume Next
    If IsObject(objFile) then        'objFile should be a file object
        objFile.WriteLine strMessage
    Else
        Call Wscript.Echo( strMessage )
    End If End Sub

A: The VBScript version of @boxdog answer:
Set objShellApp = CreateObject("Shell.Application")
Set objSpecialFolder = objShellApp.NameSpace(10) '10 = Recyle Bin
For Each objFolder In objSpecialFolder.Items
    WScript.Echo "FileName = " & objFolder.Name & vbTab & "Original Path = " & objFolder.ExtendedProperty("{9B174B33-40FF-11D2-A27E-00C04FC30871} 2")
Next

Answering this in case anyone is looking for VBS only solution.

A: In PowerShell, you can list the current path and original name/location of the Recycle Bin contents like This:
$shell = New-Object -ComObject Shell.Application

$shell.NameSpace(0x0a).Items() |
    Select-Object @{Label="OriginalLocation";Expression={$_.ExtendedProperty("{9B174B33-40FF-11D2-A27E-00C04FC30871} 2")}},Name, Path

To copy the items, you can do this:
$shell.NameSpace(0x0a).Items() |
    Copy-Item -Destination "C:\RecoveredFiles\$($_.Name)" -Recurse -Force

Note that this doesn't take into account any name-clashes - you'll need to test for that and adjust accordingly.


text:
Q: How important is 'sync' for file safety today? I have a paranoid decades-old habit of frequently typing 'sync' at a command line on my Linux (or any unixy) machine.  Some part of my mind thinks this will make sure files are written to disk not just taking a nap in some buffer in RAM.  This was important in the 1980s.
Is this relevant any more?  Does it matter at all?  Surely it does no harm (besides kids calling me 'gramps') but does it do any good?
(Side question - are there new paranoid habits a Linux user should form concerning file saving safety?)

A:
I have a paranoid decades-old habit of frequently typing 'sync' at a command line on my Linux (or any unixy) machine.

This smells like you feel like you have an unstable machine, remedy the cause and not the sympton.
When you do run sync, it should be sufficient to run it only after you do important things.

Some part of my mind thinks this will make sure files are written to disk not just taking a nap in some buffer in RAM. This was important in the 1980s.

Not just a thought, this is still what happens to this very day.

Is this relevant any more? Does it matter at all? Surely it does no harm (besides kids calling me 'gramps') but does it do any good?

Yes, definitely; go copy a huge file from one disk to another using a bare cp command, after it returns to prompt immediately pull the plug and after a reboot md5sum both files; they'll differ.
For smaller files, the chance they aren't written to disk is a lot smaller; but it can still happen that the power drops out at an unfortunate moment, there's not much you can do about that. And disabling buffers just for this purpose would be a very bad idea.

(Side question - are there new paranoid habits a Linux user should form concerning file saving safety?)

No, basically the typical ones:

*

*Use a stable kernel, file system, and so on; no experimental stuff which may contain bugs.

*Save early, save often. Accompanied with sync.

*Take back-ups.

*Avoid running out of disk space.

*Make sure your hard drive isn't failing soon.


text:
Q: ImportError: No module named 'pandas' Using Ubuntu $ pip3 install pandas
Requirement already satisfied (use --upgrade to upgrade): pandas in /usr/local/lib/python3.4/dist-packages
Requirement already satisfied (use --upgrade to upgrade): python-dateutil>=2 in /usr/local/lib/python3.4/dist-packages (from pandas)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in /usr/local/lib/python3.4/dist-packages (from pandas)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in /usr/local/lib/python3.4/dist-packages (from pandas)

I am getting Import error while my system has already satisfied all requirements.

A: To be sure you are not having multiple Python versions that are confusing, you should run these commands
python -m pip install pandas
python -c 'import pandas'

It installs pandas and imports it with the same python version.
Of course, you have to update the python program in the above commands, in case it is not directly python.
If you have a python3 executable, you can try
python3 -m pip install pandas
python3 -c 'import pandas'

You can even use absolute path, that would be returned by which python, which python2 or which python3, ...

A: I believe you have multiple python3's. If everything else suggested doesn't work for you, a easy/hacky way is to do this before you import pandas, it will guarantee the usage of the correct interpreter. Do this just once, after its successfully installed, you no longer need to do that:
import pip
pip.main(['install','pandas'])
import pandas


text:
Q: p:fileDownload is working in Firefox, but only refresh page in Chrome I use this code to download file in JSF and it's working fine in Firefox. But when I use Chrome it's always refresh page and i don't know  the reason why?
I use Primefaces 6.0
JSF Button
<?xml version='1.0' encoding='UTF-8' ?>

<ui:composition template="../layout/template.xhtml" xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
                xmlns:o="http://omnifaces.org/ui"
                xmlns:of="http://omnifaces.org/functions">

<!-- some code -->>
<p:commandLink
          id="customerExport"
          onclick="PrimeFaces.monitorDownload(startLoading, stopLoading)"
          process="productsForm"
          ajax="false">
       <p:fileDownload value="#{productsController.exportProduct()}"/>
       <h:outputText escape = "true" style ="padding: 5px 6px !important;"
            value="#{lang['common.button.export']}" class="btn btn-blue" />
</p:commandLink>

</ui:composition>

Controller
public StreamedContent exportProduct() {
        try {
            //some code

            StreamedContent exportResult = new DefaultStreamedContent(new FileInputStream(exportFile), "application/excel", fileName);
            return exportResult;
        } catch (Exception ex) {

            logger.error("Error: ", ex);
        }
        return null;
    }

It's log tomcat
com.sun.faces.renderkit.html_basic.OutcomeTargetRenderer.getNavigationCase JSF1090: Navigation case not resolved for component j_idt144.
09-Aug-2019 16:21:58.427 INFO [http-nio-8080-exec-267] com.sun.faces.context.ExceptionHandlerImpl.throwIt Exception when handling error trying to reset the response.
 org.apache.catalina.connector.ClientAbortException: java.io.IOException: An established connection was aborted by the software in your host machine

When I clicked the button in Firefox it's loading and download the file (open download file dialog). But when I use Chrome it's always refresh page. I thought it's because it's submit form or something.

A: This is working in PF7 and with Firefox 68.0.1 and with Chrome 76.0.3809 in Ubuntu 18.04.03 LTS.
xhtml
 <script type="text/javascript">
        //<![CDATA[
        function start() {
            PF('statusDialog').show();
        }

        function stop() {
            PF('statusDialog').hide();
        }
        //]]>
    </script>
......................
    <p:dialog modal="true" widgetVar="statusDialog" header="Status" draggable="false" closable="false" resizable="false">
            <p:graphicImage name="/demo/images/ajaxloadingbar.gif" />
        </p:dialog>
        <h:form>
            <p:commandButton value="Download"
                ajax="false"
                onclick="PrimeFaces.monitorDownload(start, stop);"
                icon="pi pi-arrow-down"
                actionListener="#{manageBean.exportProduct}">
            <p:fileDownload value="#{manageBean.file}" />
            </p:commandButton>
        </h:form>

ManageBean
 private StreamedContent file;

 ....

   public void exportProduct() {
    try {
        //some code
        File exportFile =  new File("/home/tsotzo/Desktop/test.xlsx");
        String fileName = "test.xlsx";

        file = new DefaultStreamedContent(new FileInputStream(exportFile), "application/excel", fileName);
    } catch (Exception ex) {
        log.error("Error: ", ex);
    }
}


text:
Q: dynamic change url flash builder I am trying to create app with list of word and sound for every one of this word
XML
<bla>
   <list>
         <word>Hello</word>
         <audio>Hello.mp3</audio>
   </list>
   <list>
         <word>Bye</word>
         <audio>bye.mp3</audio>
   </list>
</bla>

SOURCE :
<s:navigationContent>
        <s:Button label="Listan" click="playSound();"/>
</s:navigationContent>

Script :
<fx:Script>
     <![CDATA[
            import flash.media.*;

            [Embed(source="assent/sounds/{data.audio}")]

            [Bindable]
            public var sndCls:Class;
            public var snd:Sound = new sndCls() as Sound;
            public var sndChannel:SoundChannel;

            public function playSound():void {
                sndChannel=snd.play();
            }
            public function stopSound():void {
                sndChannel.stop();
            }
        ]]>
    </fx:Script>

I have error here :
[Embed(source="assent/sounds/{data.audio}")]

Error message :
Unable to transcode {data.audio}.

What can I do to fix it :}
Using Flash Builder 4.6

A: Embed = compiler directive. Embed haven't any runtime abilities at all. You must embed all assets or load it dynamically...


text:
Q: How to use the hasNext() and hasPrevious() method for the `smart-list` Linked List module for Node I am using singly-linked-list to manage my in-out transactions but singly-linked-list is not provided hasPrevious() method.
Why I need hasPrevious() method ?
In some conditions I want to iterate linked list twice in same method signature check here
So I moved to smart-list which is provided hasPrevious() but I could not make this work. See example
Can anyone please suggest me how to use hasNext() and hasPrevious() in smart-list or any other solution?

A: From the source of the list for the smart-list module, the iterators are present in the _first and _last properties of the list:
var List = require("smart-list")
var templist = new List()

templist.push("foo");

templist._first.hasNext(); // false


text:
Q: cosine has disappeared in the second order linear equation in ordinary differential equation(ODE) $$  \frac{  d ^{2} \theta_{}   }{  d t ^{2}   } = - \frac{  MH  }{  I  } \theta_{}  $$
$$  M,H,I ~~ \leftarrow~~ \text{constants}  $$
My tries are as below.
$$  \frac{  d ^{2} \theta_{}   }{  d t ^{2}   } + \frac{  MH  }{  I  }\theta_{} =0  $$
$$  \theta_{} ''+ \frac{  MH  }{  I  } \theta_{} =0 $$
$$  \lambda ^{2} + \frac{  MH  }{  I  } =0 $$
$$  \lambda ^{2}    = -\frac{  MH  }{  I  }  $$
$$  \therefore ~~  \lambda =\pm  \sqrt{ \frac{ - MH  }{ I   }  }  $$
$$ = \pm \sqrt{ \frac{  MH  }{ I   }  } i $$
$$ = 0\pm \sqrt{ \frac{  MH  }{ I   }  } i $$
$$  \alpha \rightarrow 0 $$
$$  \beta \rightarrow \sqrt{ \frac{  M H  }{I    }  }  $$
$$  \therefore ~~ \theta_{} = \left\{ C_{1}  \cos\left(\beta t\right) +C_{2} \sin\left(\beta t\right)  \right\}  \exp\left(\alpha t\right)   $$
$$ = \left\{ C_{1}  \cos\left(\beta t\right) +C_{2} \sin\left(\beta t\right)  \right\} \exp\left(0  \cdot t \right)  $$
$$ = \left\{ C_{1}  \cos\left(\beta t\right) +C_{2} \sin\left(\beta t\right)  \right\} $$
$$ = \left\{ C_{1}  \cos\left(\sqrt{ \frac{  M H  }{I    }  }  t\right) +C_{2} \sin\left(\sqrt{ \frac{  M H  }{I    }  }  t\right)  \right\} $$
However the book shows the below.
$$  \theta_{} = \theta_{0} \sin\left(\sqrt{ \frac{  M H  }{I    }  } t+ \gamma\right)  $$
$$  \theta_{0} ,\gamma ~~ \leftarrow~~ \text{constants}  $$
Where I made mistake(s)?

A: You didn't make any mistake. There are two forms to write the solutions. One is $A\cos(w_0t)+B\sin(w_0t)$ and the other is $\cos(w_0t + \phi)$ or $\sin(w_0t + \psi)$ (they are the same). See here (page $2$) for more details.


text:
Q: Stopping bounce when repeatedly jumping in spritekit I have a player character and a ground tile. On both physics bodies, I have restitution set to 0.
To jump, I directly set the velocity.dy of the player. When the player comes back to the ground due to gravity, for the most part it works, or seems to.
Problems occur when I repeatedly jump. If I jump right as the player lands, there's some bounce and the height the player reaches on the next bounce doesn't always match the initial bounce.
I've tried various ways to force the velocity.dy to 0 when the user lands, but nothing fixes the weird jumping issue. How can I properly and smoothly have a consistent physics jump?

A: Honestly, I am not sure what you are trying to accomplish. Normally we shouldn't mess with velocities of objects. In a typical Spritekit game, we must treat it like a "real world" situation and generally apply force or impulse on the object.
I suspect you are trying to make a Mario-like game. All you have to do is apply a big enough gravity to the physicsworld and apply impulse on the sprite to jump (on touchesBegan delegate).
Just now I went ahead and made a simple mario jump scenario in Spritekit. And this is what I ended up with by setting gravity -30 for the y-component and impulse y=100 on the mario sprite. (Frame rate is bad. Looks better on simulator/device)

PhysicsWorld setup:
[self.physicsWorld setGravity:CGVectorMake(0, -30)];
self.physicsWorld.contactDelegate = self;

Mario and platform sprite setup code:
SKSpriteNode *platform = [SKSpriteNode spriteNodeWithImageNamed:@"platform"];
platform.position = CGPointMake(view.frame.size.width/2.0,0);
platform.name = @"platform";
platform.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:platform.frame.size];
platform.physicsBody.categoryBitMask = platformCategory;
platform.physicsBody.dynamic = NO;
platform.physicsBody.usesPreciseCollisionDetection  = YES;
platform.physicsBody.affectedByGravity = NO;
[self addChild:platform];

SKSpriteNode *mario = [SKSpriteNode spriteNodeWithImageNamed:@"mario"];
mario.position = CGPointMake(view.frame.size.width/2.0, 400);
mario.name = @"mario";
mario.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:mario.frame.size];
mario.physicsBody.categoryBitMask = marioCategory;
mario.physicsBody.dynamic = YES;
mario.physicsBody.usesPreciseCollisionDetection  = YES;
mario.physicsBody.contactTestBitMask = platformCategory;
mario.physicsBody.affectedByGravity = YES;
[self addChild:mario];

touchesBegan:
SKSpriteNode *mario = (SKSpriteNode*)[self childNodeWithName:@"mario"];
[mario.physicsBody applyImpulse:CGVectorMake(0, 100)];


text:
Q: python 2.5.2 multiprocessing pool behavior When attempting to divide a DB insertion up between cores using the python multiprocessing module on 2.5.2, CentOS 5.5, the entire pool of 16 processes aborts as soon as the first one finishes.  I thought that using pool.close/pool.join was supposed to prevent this very thing from occurring.
def insert():
    blocksize=lines/ncpus
    i=0
    while i<lines:
        print 'writing block %d to %d' % (i,i+blocksize+ncpus)
        pool.apply_async(write_db, (i,i+blocksize+ncpus,query,))
        i+=blocksize+ncpus
    pool.close()
    pool.join()

def write_db(start,stop,q):
    ctr=0
    odbcstring"...."
    con = pyodbc.connect(odbcstring)
    cur = con.cursor()

    commitlock = multiprocessing.Lock()

    for j in range(start,stop):
        try:
            cur.execute(q[j])
            ctr+=1
            if (ctr%10000)==0:
                commitlock.acquire()
                con.commit()
                commitlock.release()
        except:
            print get_exception_info()

    commitlock.acquire()
    con.commit()
    commitlock.release()
    con.close()

I am theorizing that it has something to do with this sentence from the pool.apply docs:
Additionally, the passed in function is only executed in one of the workers of the pool
Perhaps there is some difference between built-in MP and the MP module that I'm not aware of.
Thanks for the help.

A: I'm not sure if this has anything to do with your issue, but you're creating a new multiprocessing.Lock object in every process you create.
...so acquiring this lock around your connection commits isn't going to do anything.
[EDIT] In order to share this lock between processes, you need a manager object:
manager = multiprocessing.Manager()
lock = manager.Lock()

Now you should be able to pass this lock as an argument to your processes.


text:
Q: Why is stdin closed when using a heredoc as input to shell I'm a bit confused by this
$ bash <<EOF
  read -p 'This will not work' input
EOF

because
$ cat script
read -p 'This will work fine' input
$ bash script
This will work fine

What's the difference? It appears to be a standard behavior because ash behaves exactly the same way.

Based on the answers provided so far, I suspected (and then confirmed) that the following works. I think this is actually what I wanted to do all along, but the <() syntax is always one that I forget exists.
$ bash <( cat <<EOF
  read -p 'This works' input
EOF
)

A: You cannot have multiple simultaneous stdin per process, so the here document passed as input to bash cannot contain a read -p.
With bash script, the running script is a subprocess of the Bash shell and there is no concurrent stdin to read, so it will work as intended.

A: In both cases, the read command inherits its standard input from the bash process that executes it.
In the first example, that means the here document that actually contains the read command. Depending on how much of the document bash has already read (usually all of it), nothing remains for read to read, and so it exits with a non-zero exit status.
In the second example, bash opens the named file on a different file descriptor. read still inherits its standard input from the bash process, but this time bash hasn't read from it at all, so the read command gets the next available line. Standard input here is the terminal, so read blocks until the user enters a line.

A: As read is a bash builtin, it inherits stdin from bash as is mentioned above. In the first case bash has a here document as stdin (or more professionally, File Descriptor 0) and there's nothing available for read to read.
read only reads from stdin (fd0) while in the second case, bash opens another file descriptor rather than stdin to read scripts from script, which does NOT conflict with stdin passed to read, so that read can work as intended.
You can try this to test out.
$ bash << EOF
ls -l /proc/$$/fd
EOF
and
$ cat script.sh
ls -l /proc/$$/fd
$ bash script.sh
The difference is apparent if you compare the outputs from samples bove.

A: Simplest solution is to write the interactive commands to a temporary file, then source the temporary file:
cat <<'_EOF_' >/tmp/$$.sh
read -p 'This is an interactive command, please enter a string: ' STRING
_EOF_
# Command in temporary file get executed here
source /tmp/$$.sh
echo "STRING= '$STRING'"


text:
Q: UITableviewcell animation only once Here is my willDisplayCell animation code I want to animate only once, don't repeat when scroll up the tableview.
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{

    UIView *cellContentView = [cell contentView];
    CGFloat rotationAngleDegrees = -30;
    CGFloat rotationAngleRadians = rotationAngleDegrees * (M_PI/180);
    CGPoint offsetPositioning = CGPointMake(0, cell.contentView.frame.size.height*4);
    CATransform3D transform = CATransform3DIdentity;
    transform = CATransform3DRotate(transform, rotationAngleRadians, -50.0, 0.0, 1.0);
    transform = CATransform3DTranslate(transform, offsetPositioning.x, offsetPositioning.y, -50.0);
    cellContentView.layer.transform = transform;
    cellContentView.layer.opacity = 0.8;

    [UIView animateWithDuration:0.95 delay:00 usingSpringWithDamping:0.85 initialSpringVelocity:0.8 options:0 animations:^{
        cellContentView.layer.transform = CATransform3DIdentity;
        cellContentView.layer.opacity = 1;
    } completion:^(BOOL finished) {}];

    }

A: If you want any of your code to run only once, you can use dipatch_once. This will make sure that this code is run only once in life span of parent object. You can put that code inside dispatch_async if that code is being run from somewhere other than tableview's event handlers.
dispatch_async(dispatch_get_main_queue(),^{
    static dispatch_once_t once;
    dispatch_once(&once, ^{
           //Your animation code.
    });
};

A: In order to animate each cell only once each cell has to know that it animated itself and it shouldn't again. Easiest way to achieve that is to give the cell BOOL variable called animated to determine whether if or not the cell has already animated.
Create custom cell class
Create new Cocoa Class called for example CustomCell. It should subclass the UITableViewCell.
Inside CustomCell.h declare a BOOL property called animated:
@property (nonatomic) BOOL animated;

If you are using storyboards like me, remember to also update the class of a cell in storyboard editor, just like you do when you are creating new view controllers
That's it here.
Modify View Controller
Now you should import your new class and swap (UITableViewCell *) with (CustomCell *) in your tableViews delegate methods.
In willDisplayCell: add necessary logic, it will look like this:
-(void)tableView:(UITableView *)tableView willDisplayCell:(CustomCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{

    if(!cell.animated){ //added

        cell.animated = YES;  //added

        UIView *cellContentView = [cell contentView];
        CGFloat rotationAngleDegrees = -30;
        CGFloat rotationAngleRadians = rotationAngleDegrees * (M_PI/180);
        CGPoint offsetPositioning = CGPointMake(0, cell.contentView.frame.size.height*4);
        CATransform3D transform = CATransform3DIdentity;
        transform = CATransform3DRotate(transform, rotationAngleRadians, -50.0, 0.0, 1.0);
        transform = CATransform3DTranslate(transform, offsetPositioning.x, offsetPositioning.y, -50.0);
        cellContentView.layer.transform = transform;
        cellContentView.layer.opacity = 0.8;

        [UIView animateWithDuration:0.95 delay:00 usingSpringWithDamping:0.85 initialSpringVelocity:0.8 options:0 animations:^{
            cellContentView.layer.transform = CATransform3DIdentity;
            cellContentView.layer.opacity = 1;
        } completion:^(BOOL finished) {}];

    }

And this is it. Hope it works for you


text:
Q: How to compile java package which does not contain any classes with main method? I have a bunch of java files in a package, but non of them contains main method. These classes are used by jsp. So my question is, if I want to make some changes to the code, how can I recompile that package?

A: The same way you would compile any other class, you don't need a main method for the Java compiler to generate .class files.
javac <package_name>/*.java

If you need to re-package this code later, use the jar command:
jar -cvf <package_name>.jar <package_name>/*.class


text:
Q: Make the size of a chart adjust to its outer container I want to embed this choropleth in my webpage. Here is a working plunker.
Currently, the size of SVG is fixed by <svg width="960" height="600"></svg>. If we change it to eg, <svg width="200" height="200"></svg>, we will see the map is partially shown, and the real scaling of the map does not change.
However, I want to make this chart always adjust to the size of its outer container. For example, in the case of this plunker, I want the width of the chart to be the same as the one of the right panel.
Does anyone know how to modify the d3 code to achieve this?
PS: Another possibility is to leave <svg width="960" height="600"></svg> with it, but scale/compress the whole svg to adapt the width of its outer container. I don't know if it is doable...

A: Unfortunately it is impossible to style the contents of an <iframe> unless you have control over the page loaded in the <iframe>, due to cross-domain resource restrictions.
You would need to style the SVG on the page that you are including:
svg {
  max-width: 100%;
  max-height: 100%;
}

If you don't have access to that page, then you are limited to styling the <iframe> element itself.
Hope this helps! :)