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
DbContext | |
========= | |
class SchoolDb : DbContext { | |
public DbSet<Class> Classes { get; set; } | |
public DbSet<Person> Persons { get; set; } | |
public SchoolDb() : base("Data Source=(localdb)\\schooldb;Initial Catalog=SchoolDb;Integrated Security=True") { | |
System.Data.Entity.Database.SetInitializer(new SchoolDbInitializer()); | |
} | |
protected override void OnModelCreating(DbModelBuilder modelBuilder) { | |
base.OnModelCreating(modelBuilder); |
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 at.tnzstz.rest | |
import at.tnzstz.authentication.Authenticated | |
import at.tnzstz.cdi.ReflectionHelper | |
import at.tnzstz.entity.User | |
import at.tnzstz.interfaces.AbstractEntity | |
import at.tnzstz.persistence.UserCheckingFacade | |
import io.swagger.annotations.Api | |
import javax.json.JsonObject | |
import javax.ws.rs.* |
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.json.JSONArray; | |
import org.json.JSONObject; | |
class Main { | |
static class Position { | |
private int positionArtId; | |
private String name; | |
private String kurzZeichen; |
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
//probably this should be something like a JavaEE Singleton... | |
object PasswordUtils { | |
val random = SecureRandom() | |
fun generateSalt(): ByteArray { | |
val salt = ByteArray(16) | |
random.nextBytes(salt) | |
return salt | |
} |
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 at.triply.eventoverview.api | |
import java.io.File | |
class CsvFileHelper(val file: File) { | |
companion object { | |
val SEPERATOR = ";" | |
} |
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.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
class BTreePrinter { | |
public static void printNode(AVLNode root) { | |
int maxLevel = BTreePrinter.maxLevel(root); | |
printNodeInternal(Collections.singletonList(root), 1, maxLevel); |
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 BTreePrinter { | |
fun printNode(root: AVLNode, showHeight: Boolean = false) { | |
val maxLevel = BTreePrinter.maxLevel(root) | |
printNodeInternal(listOf(root), 1, maxLevel, showHeight) | |
} | |
private fun printNodeInternal(nodes: List<AVLNode?>, level: Int, maxLevel: Int, showHeight: Boolean) { | |
if (nodes.isEmpty() || BTreePrinter.isAllElementsNull(nodes)) |
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 at.triply.backend.eventbackend.security | |
import at.triply.backend.eventbackend.data.entities.EventManager | |
import at.triply.backend.eventbackend.data.repositories.EventManagerRepository | |
import org.springframework.data.rest.webmvc.BasePathAwareController | |
import org.springframework.http.ResponseEntity | |
import org.springframework.web.bind.annotation.PostMapping | |
import org.springframework.web.bind.annotation.RequestBody | |
import org.springframework.web.bind.annotation.RequestMapping | |
import org.springframework.web.bind.annotation.ResponseBody |
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 at.triply.backend.eventbackend.security | |
interface User { | |
val username: String | |
val password: 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
package at.triply.backend.eventbackend.security | |
import at.triply.backend.eventbackend.data.entities.EventManager | |
import at.triply.backend.eventbackend.data.repositories.EventManagerRepository | |
import org.springframework.data.rest.webmvc.BasePathAwareController | |
import org.springframework.http.ResponseEntity | |
import org.springframework.security.crypto.password.PasswordEncoder | |
import org.springframework.web.bind.annotation.PostMapping | |
import org.springframework.web.bind.annotation.RequestBody | |
import org.springframework.web.bind.annotation.RequestMapping |
OlderNewer