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
package learn.scala | |
/** | |
* This tutorial represents how subsitution principle works in Scala. | |
*/ | |
object SubsitutionPrincipleNClasses { | |
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet | |
class Rational(x: Int, y: Int){ | |
def numer = x; |
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
import java.util.Arrays; | |
import org.activiti.engine.impl.persistence.entity.VariableInstanceEntity; | |
import org.activiti.engine.impl.variable.DeserializedObject; | |
public class JsonizedObject extends DeserializedObject { | |
Object deserializedObject; | |
byte[] originalBytes; | |
VariableInstanceEntity variableInstanceEntity; |
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
import org.activiti.engine.ActivitiException; | |
import org.activiti.engine.impl.context.Context; | |
import org.activiti.engine.impl.persistence.entity.VariableInstanceEntity; | |
import org.activiti.engine.impl.variable.ByteArrayType; | |
import org.activiti.engine.impl.variable.ValueFields; | |
import org.codehaus.jackson.map.ObjectMapper; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
/** |
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
/** | |
* @author ajjain | |
* | |
* Markup interface which represents a process variable can be persisted | |
* in Activiti's hydration database as JSON. | |
* | |
*/ | |
public interface JsonType { | |
} |
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
package learn.scala.polymorphism | |
trait List[T] { | |
def isEmpty: Boolean | |
def head: T | |
def tail: List[T] | |
} | |
class Nil[T] extends List[T] { | |
def isEmpty: Boolean = true |
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
CREATE TABLE BOOK ( | |
ID SERIAL PRIMARY KEY, | |
NAME VARCHAR (50) UNIQUE NOT NULL, | |
TITLE VARCHAR (100), | |
DESCRIPTION VARCHAR (200) | |
); |
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
public class BizService { | |
private SqlSessionFactory sqlSessionFactory; | |
/** | |
* Initalize the | |
* | |
* @param config the config | |
*/ | |
private void init(QueryEngineConfiguration config) { | |
InputStream inputStream; |
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
# C stands for CONCAT and helps in creating vector | |
x <- c(1,2,3) | |
y1 <- c(T, F, T, F) | |
y2 <- c(TRUE, FALSE) | |
# sequence of numbers | |
z <- 1:100 | |
# complex numbers | |
a <- c(1+2i, 3+4i) |
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
# factor for categorical data can be ordered or unordered | |
# eg. gender (M, F), size (S, M, L, XL, XXL) | |
# (M, F) or (S, M, L, XL, XXL) are called levels | |
x <- factor(c("S", "M", "L", "XL", "XXL", "S", "XL", "XXL")) | |
# represent the class of x which is factor | |
class(x) | |
# strips out the class and shows the factors represents as integer |
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
x <- c(1,2,NA,3) | |
is.na(x) | |
is.nan(x) | |
y <- c(1,2,NaN,3) | |
is.na(y) | |
is.nan(y) | |
z <- c(1,2,NaN,NA) | |
is.na(z) |