This file contains hidden or 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
WITH calendar as ( | |
SELECT 1 as shop_id, 0 as mon, 0 as tue, 1 as wed, 1 as thur, 1 as fri, 0 as sat, 0 as sun FROM dual | |
UNION ALL | |
SELECT 2 as shop_id, 1 as mon, 1 as tue, 1 as wed, 1 as thur, 0 as fri, 0 as sat, 0 as sun FROM dual | |
) | |
, seq as (SELECT level as lvl FROM dual CONNECT BY level <= 7) | |
SELECT shop_id, | |
case when lvl = 1 then 'mon' | |
when lvl = 2 then 'tue' |
This file contains hidden or 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
WITH calendar as ( | |
SELECT 1 as shop_id, 0 as mon, 0 as tue, 1 as wed, 1 as thur, 1 as fri, 0 as sat, 0 as sun FROM dual | |
UNION ALL | |
SELECT 2 as shop_id, 1 as mon, 1 as tue, 1 as wed, 1 as thur, 0 as fri, 0 as sat, 0 as sun FROM dual | |
) | |
SELECT * FROM ( | |
SELECT shop_id, 'MON' as dayOfWeek, mon as isWorkDay | |
FROM calendar | |
UNION ALL | |
SELECT shop_id, 'TUE' as dayOfWeek, tue as isWorkDay |
This file contains hidden or 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
WITH calendar as ( | |
SELECT 1 as shop_id, 0 as mon, 0 as tue, 1 as wed, 1 as thur, 1 as fri, 0 as sat, 0 as sun FROM dual | |
UNION ALL | |
SELECT 2 as shop_id, 1 as mon, 1 as tue, 1 as wed, 1 as thur, 0 as fri, 0 as sat, 0 as sun FROM dual | |
) | |
SELECT shop_id, dayOfWeek, isWorkDay | |
FROM calendar | |
UNPIVOT ( | |
isWorkDay | |
FOR dayOfWeek IN (mon, tue, wed, thur, fri, sat, sun) |
This file contains hidden or 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 ArrayStack implements Stack { | |
private Object[] array; | |
private int size; | |
private static final double koeff = 1.5d; | |
public ArrayStack() { | |
int initialCapacity = 2; | |
array = new Object[initialCapacity]; | |
} |
This file contains hidden or 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 Part1 { | |
public int max(int a, int b, boolean showParams){ | |
if (showParams){ | |
System.out.print("(" + a + ", " + b + "): "); | |
} | |
return a > b ? a : b; | |
} | |
public int max(int a, int b, int c, boolean showParams){ |
This file contains hidden or 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 Chat; | |
import java.io.*; | |
import java.net.Socket; | |
public class Client implements Runnable { | |
BufferedReader consoleBufferedReader; | |
BufferedWriter socketBufferedWriter; | |
BufferedReader socketBufferedReader; |
This file contains hidden or 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>404</title> | |
</head> | |
<body> | |
<h1>404 - Page not found!!!</h1> | |
</body> | |
</html> |
This file contains hidden or 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.Scanner; | |
public class KeyboardReader implements Runnable { | |
private ArrayList<String> arrayList = new ArrayList<>(); | |
@Override | |
public void run() { | |
try { | |
Timer timer = new Timer("timer1", 5); |
This file contains hidden or 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.io.Serializable; | |
import java.util.Date; | |
public class Message implements Serializable { | |
private int id; | |
private Date date; | |
private String content; | |
public Message(int id, Date date, String content) { | |
this.id = id; |
This file contains hidden or 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.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target(ElementType.FIELD) | |
public @interface Column { | |
String name(); | |
int primary() default 0; |
NewerOlder