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
var fs = require('fs'); | |
var obj = JSON.parse(fs.readFileSync('data.json', 'utf8')); | |
var result = ""; | |
var writer = { | |
log : function(params){ | |
result += params + "\r\n"; |
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
object Payroll { | |
def printSalary(employee: Employee) { | |
val currentYeay = 2001 | |
employee match { | |
case Intern(stay) => | |
println(stay * 300) | |
case Dev(startYear) => | |
println(1000 + (currentYeay - startYear) * 500) | |
case Manager(startYear, direct) => | |
println(1000 + (currentYeay - startYear) * 500 + direct.length * 20) |
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
abstract class Employee | |
case class Manager(startYear: Int, direct: Array[Employee]) extends Employee | |
case class Dev(startYear: Int) extends Employee | |
case class Intern(stay: Int) extends Employee |
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 Intern (salary_param: Int, desk_param: String, startDate_param: Int) extends Employee with InOffice with Temporary { | |
val salary = salary_param | |
val desk = desk_param | |
val stay = 6 | |
val startDate = startDate_param | |
} | |
class Developer (salary_param: Int, desk_param: String) extends Employee with InOffice { | |
val salary = salary_param | |
val desk = desk_param |
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
abstract class Employee { | |
def salary: Int | |
} | |
trait InOffice { | |
def desk: String | |
} | |
trait Remote { | |
def location: String |
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
BEGIN:VCALENDAR | |
VERSION:2.0 | |
PRODID:-//hacksw/handcal//NONSGML v1.0//EN | |
BEGIN:VEVENT | |
SUMMARY:Coffee break | |
DTSTART:20151127T104500Z | |
DTEND:20151127T113000Z | |
END:VEVENT | |
BEGIN:VEVENT | |
SUMMARY:Registro |
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
def main(args: Array[String]){ | |
test(-1, 2, Array.emptyIntArray) | |
test(0, 1, Array(1,2,3,4,5)) | |
test(2, 3, Array(1,2,3,4,5)) | |
test(2, 3, Array(1,2,3)) | |
test(0, 1, Array(1)) | |
test(4, 5, Array(1,2,3,4,5)) | |
test(3, 4, Array(1,2,3,4,5)) | |
test(1, 2, Array(1,2,3,4,5)) | |
test(-1, 0, Array(1,2,3,4,5)) |
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
def assert(expected: Int, actual: Int){ | |
if(expected == actual){ | |
println("OK"); | |
} | |
else { | |
println("Error, expected: " + expected + " actual: "+ actual); | |
} | |
} |
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
def chop (target: Int, searchBox: Array[Int]) : Int = { | |
val size = searchBox.size | |
if (size == 0) { | |
return -1 | |
} | |
if (size == 1){ | |
if(searchBox(0) == target){ | |
return 0 | |
} else { |
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
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
Disable-InternetExplorerESC | |
Install-WindowsUpdate | |
Disable-MicrosoftUpdate | |
cinst IIS-WebServerRole -source windowsfeatures | |
NewerOlder