This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module basicParallel; | |
integer a, b, c; | |
initial | |
fork | |
$display("Hello!"); | |
a = 5; | |
b = 4; | |
c = a + b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module basicSequential; | |
integer a, b, c; | |
initial | |
begin | |
$display("Hello!"); | |
a = 5; | |
b = 4; | |
c = a + b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = 'Brett' | |
blog_title = 'Medium' | |
# Hi, my name is Brett and I am writing on my Medium blog. | |
a = "Hi, my name is {} and I am writing on my {} blog.".format(name, blog_title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = 'Brett' | |
blog_title = 'Medium' | |
# Hi, my name is Brett and I am writing on my Medium blog. | |
a = f"Hi, my name is {name} and I am writing on my {blog_title} blog." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass | |
# Define dataclass | |
@dataclass | |
class Vector3D: | |
x: int | |
y: int | |
z: int | |
# Create a vector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In order formatting | |
# Hi, my name is Brett and I am writing on my Medium blog. | |
a = "Hi, my name is {} and I am writing on my {} blog.".format('Brett', 'Medium') | |
# Index formatting | |
# I'm going to a birthday party because it is Paul's birthday. | |
a = "I'm going to a {0} party because it is {1}'s {0}".format('birthday', 'Paul') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from enum import Enum | |
class State(Enum): | |
AIR = 0 | |
LAND = 1 | |
SEA = 2 | |
myState = State.AIR | |
# Prints 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun logInFailure_test() { | |
val email = "cool@cool.com" | |
val password = "123_456" | |
Mockito.`when`(mAuth!!.signInWithEmailAndPassword(email, password)) | |
.thenReturn(failureTask) | |
accountModel!!.logIn(email, password) | |
assert(logInResult == FAILURE) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LogInModelTest : LogInListener { | |
private lateinit var successTask: Task<AuthResult> | |
private lateinit var failureTask: Task<AuthResult> | |
@Mock | |
private lateinit val mAuth: FirebaseAuth | |
private lateinit var logInModel: LogInModel | |
private var logInResult = UNDEF | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun logInSuccess(email: String, password: String) { | |
logInResult = SUCCESS | |
} | |
override fun logInFailure(exception: Exception, email: String, password: String) { | |
logInResult = FAILURE | |
} | |
} |
NewerOlder