diff options
| author | 冯昶 <fengchang@novel-supertv.com> | 2024-02-06 10:57:00 +0800 |
|---|---|---|
| committer | 冯昶 <fengchang@novel-supertv.com> | 2024-02-06 10:57:00 +0800 |
| commit | 1bf81c8cd7a349e23f5cea03031f16d11af36f83 (patch) | |
| tree | adde1cb7a839ec7f3691bfc4bfd494636ed2503e /challenge-252 | |
| parent | 409a0635fc8d10d342a7b6dd72c1c23a2c0702e0 (diff) | |
| parent | cde7d521095de2ce582570f6d8d1a9e7bbcec16c (diff) | |
| download | perlweeklychallenge-club-1bf81c8cd7a349e23f5cea03031f16d11af36f83.tar.gz perlweeklychallenge-club-1bf81c8cd7a349e23f5cea03031f16d11af36f83.tar.bz2 perlweeklychallenge-club-1bf81c8cd7a349e23f5cea03031f16d11af36f83.zip | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'challenge-252')
3 files changed, 110 insertions, 0 deletions
diff --git a/challenge-252/luca-ferrari/java/ch-1.java b/challenge-252/luca-ferrari/java/ch-1.java new file mode 100644 index 0000000000..18ba5f7aa1 --- /dev/null +++ b/challenge-252/luca-ferrari/java/ch-1.java @@ -0,0 +1,15 @@ +package PWC252; + +public class ch_1 { + public static void main( String argv[] ) { + int sum = 0; + for ( int i = 0; i < argv.length; i++ ) { + if ( agrv.length % i != 0 ) + continue; + + sum += Integer.parseInt( argv[ i ] ) ^ 2; + } + + System.out.println( sum ); + } +} diff --git a/challenge-252/luca-ferrari/postgresql/java/pom.xml b/challenge-252/luca-ferrari/postgresql/java/pom.xml new file mode 100644 index 0000000000..8975c014a2 --- /dev/null +++ b/challenge-252/luca-ferrari/postgresql/java/pom.xml @@ -0,0 +1,84 @@ +<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/xsd/maven-4.0.0.xsd" +> + <modelVersion>4.0.0</modelVersion> + + <!-- Above is all boilerplate. Next: your project's "Maven coordinates" --> + + <groupId>pwc</groupId> + <artifactId>pwc252</artifactId> + <version>0.0.1-SNAPSHOT</version> + + <!-- Coordinates are nice, but so are names and descriptions for humans. --> + + <name>Perl Weekly Challenge 252</name> + <description>Implementation of the tasks in PL/Java</description> + + <!-- + Many Maven plugins care what character set encoding your files are in. + For this example I've chosen the most restrictive (US-ASCII). Change if + your files use a different encoding, but be sure not to lie. You should + be sure the encoding named here IS the way your source files are coded. + --> + + <properties> + <project.build.sourceEncoding>US-ASCII</project.build.sourceEncoding> + </properties> + + <!-- Here's where you say your project depends on a pljava-api version. --> + + <dependencies> + <dependency> + <groupId>org.postgresql</groupId> + <artifactId>pljava-api</artifactId> + <version>1.6.6</version> + </dependency> + </dependencies> + + <!-- The rest here is pretty much boilerplate. --> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.1</version> + <configuration> + <release>9</release> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.6</version> + <configuration> + <archive> + <manifest> + <!-- This identifies and version-stamps the jar. + Not essential, but easy and useful. --> + <addDefaultImplementationEntries> + true + </addDefaultImplementationEntries> + </manifest> + + <manifestSections> + <!-- This identifies a file in the jar named + pljava.ddr as an SQLJDeploymentDescriptor. --> + <manifestSection> + <name>pljava.ddr</name> + <manifestEntries> + <SQLJDeploymentDescriptor> + true + </SQLJDeploymentDescriptor> + </manifestEntries> + </manifestSection> + </manifestSections> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/challenge-252/luca-ferrari/postgresql/java/src/main/java/PWC252/Task1.java b/challenge-252/luca-ferrari/postgresql/java/src/main/java/PWC252/Task1.java new file mode 100644 index 0000000000..4714df0ad5 --- /dev/null +++ b/challenge-252/luca-ferrari/postgresql/java/src/main/java/PWC252/Task1.java @@ -0,0 +1,11 @@ +package PWC252; + +import org.postgresql.pljava.annotation.Function; + +public class Task1 { + + @Function + public static final int task1( int[] nums ) { + return 0; + } +} |
