Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
leetcode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Leona
W
web
backend
leetcode
Commits
6df3f402
Commit
6df3f402
authored
Nov 05, 2019
by
duanledexianxianxian
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init project
parents
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
329 additions
and
0 deletions
+329
-0
.gitignore
.gitignore
+101
-0
leetcode1114/pom.xml
leetcode1114/pom.xml
+17
-0
leetcode1114/src/main/java/com/duanledexianxianxian/leetcode/Foo.java
.../src/main/java/com/duanledexianxianxian/leetcode/Foo.java
+79
-0
leetcode1114/src/test/java/com/duanledexianxianxian/leetcode/AppTest.java
.../test/java/com/duanledexianxianxian/leetcode/AppTest.java
+20
-0
pom.xml
pom.xml
+79
-0
src/main/java/com/duanledexianxianxian/leetcode/App.java
src/main/java/com/duanledexianxianxian/leetcode/App.java
+13
-0
src/test/java/com/duanledexianxianxian/leetcode/AppTest.java
src/test/java/com/duanledexianxianxian/leetcode/AppTest.java
+20
-0
No files found.
.gitignore
0 → 100644
View file @
6df3f402
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Java template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
!/.idea/
!/leetcode.iml
/.gitignore
/leetcode.iml
/.idea/
leetcode1114/pom.xml
0 → 100644
View file @
6df3f402
<?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/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
leetcode-parent
</artifactId>
<groupId>
com.duanledexianxianxian.leetcode
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
leetcode1114
</artifactId>
<name>
leetcode1114
</name>
<!-- FIXME change it to the project's website -->
<url>
http://www.example.com
</url>
</project>
leetcode1114/src/main/java/com/duanledexianxianxian/leetcode/Foo.java
0 → 100644
View file @
6df3f402
package
com.duanledexianxianxian.leetcode
;
import
java.util.concurrent.CountDownLatch
;
/**
* Hello world!
*
* @author Administrator
*/
class
Foo
{
CountDownLatch
stage1
=
new
CountDownLatch
(
1
);
CountDownLatch
stage2
=
new
CountDownLatch
(
1
);
public
Foo
()
{
}
public
void
first
(
Runnable
printFirst
)
throws
InterruptedException
{
// printFirst.run() outputs "first". Do not change or remove this line.
printFirst
.
run
();
stage1
.
countDown
();
}
public
void
second
(
Runnable
printSecond
)
throws
InterruptedException
{
// printSecond.run() outputs "second". Do not change or remove this line.
stage1
.
await
();
printSecond
.
run
();
stage2
.
countDown
();
}
public
void
third
(
Runnable
printThird
)
throws
InterruptedException
{
// printThird.run() outputs "third". Do not change or remove this line.
stage2
.
await
();
printThird
.
run
();
}
public
static
void
main
(
String
[]
args
)
{
Foo
foo
=
new
Foo
();
// 创建3个线程
Thread
thread1
=
new
Thread
(()
->
{
try
{
foo
.
first
(()->{
System
.
out
.
println
(
"1"
);
});
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
});
Thread
thread2
=
new
Thread
(()
->
{
try
{
foo
.
second
(()->{
System
.
out
.
println
(
"2"
);
});
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
});
Thread
thread3
=
new
Thread
(()
->
{
try
{
foo
.
third
(()->{
System
.
out
.
println
(
"3"
);
});
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
});
thread1
.
start
();
thread2
.
start
();
thread3
.
start
();
}
}
leetcode1114/src/test/java/com/duanledexianxianxian/leetcode/AppTest.java
0 → 100644
View file @
6df3f402
package
com.duanledexianxianxian.leetcode
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
org.junit.Test
;
/**
* Unit test for simple Foo.
*/
public
class
AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public
void
shouldAnswerWithTrue
()
{
assertTrue
(
true
);
}
}
pom.xml
0 → 100644
View file @
6df3f402
<?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/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.duanledexianxianxian.leetcode
</groupId>
<artifactId>
leetcode-parent
</artifactId>
<packaging>
pom
</packaging>
<version>
1.0-SNAPSHOT
</version>
<modules>
<module>
leetcode1114
</module>
</modules>
<name>
leetcode-parent
</name>
<!-- FIXME change it to the project's website -->
<url>
http://www.example.com
</url>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.target>
1.8
</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.11
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>
maven-clean-plugin
</artifactId>
<version>
3.1.0
</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>
maven-resources-plugin
</artifactId>
<version>
3.0.2
</version>
</plugin>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.8.0
</version>
</plugin>
<plugin>
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.22.1
</version>
</plugin>
<plugin>
<artifactId>
maven-jar-plugin
</artifactId>
<version>
3.0.2
</version>
</plugin>
<plugin>
<artifactId>
maven-install-plugin
</artifactId>
<version>
2.5.2
</version>
</plugin>
<plugin>
<artifactId>
maven-deploy-plugin
</artifactId>
<version>
2.8.2
</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>
maven-site-plugin
</artifactId>
<version>
3.7.1
</version>
</plugin>
<plugin>
<artifactId>
maven-project-info-reports-plugin
</artifactId>
<version>
3.0.0
</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
src/main/java/com/duanledexianxianxian/leetcode/App.java
0 → 100644
View file @
6df3f402
package
com.duanledexianxianxian.leetcode
;
/**
* Hello world!
*
*/
public
class
App
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"Hello World!"
);
}
}
src/test/java/com/duanledexianxianxian/leetcode/AppTest.java
0 → 100644
View file @
6df3f402
package
com.duanledexianxianxian.leetcode
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
org.junit.Test
;
/**
* Unit test for simple App.
*/
public
class
AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public
void
shouldAnswerWithTrue
()
{
assertTrue
(
true
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment