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
| from bs4 import BeautifulSoup | |
| import requests | |
| def average(comps): | |
| sum = 0 | |
| for i in comps: | |
| sum = int(i['price'].replace(' ', '')) + sum | |
| average_price = sum // len(comps) | |
| return average_price | |
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 ru.geekbrain; | |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| import java.io.PrintWriter; | |
| import java.net.ServerSocket; | |
| import java.net.Socket; | |
| import java.nio.charset.StandardCharsets; | |
| import java.nio.file.Files; |
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 ru.geekbrain; | |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| import java.io.PrintWriter; | |
| import java.net.ServerSocket; | |
| import java.net.Socket; | |
| import java.nio.charset.StandardCharsets; | |
| import java.nio.file.Files; |
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
| project setup --topLevelPackage org.springframework.roo.petclinic | |
| jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY | |
| enum type --class ~.domain.reference.PetType | |
| enum constant --name DOG | |
| enum constant --name CAT | |
| enum constant --name BIRD | |
| enum type --class ~.domain.reference.Specialty | |
| enum constant --name CARDIOLOGY | |
| enum constant --name DENTISTRY | |
| enum constant --name NUTRITION |
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
| project setup --topLevelPackage dik.roo.collmate | |
| jpa setup --provider HIBERNATE --database H2_IN_MEMORY | |
| enum type --class ~.domain.reference.Status | |
| enum constant --name OK | |
| enum constant --name Away | |
| enum constant --name Lost | |
| enum constant --name Expected | |
| enum constant --name Undefined | |
| entity jpa --class ~.domain.Cd --sequenceName CD_SEQ | |
| entity jpa --class ~.domain.Dvd --sequenceName DVD_SEQ |
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.Comparator; | |
| import java.util.Set; | |
| import java.util.TreeSet; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Set<Integer> set =new TreeSet<>(new Comparator<Integer>() { | |
| //@Override |
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.Random; | |
| import java.util.RandomAccess; | |
| import java.util.concurrent.ThreadLocalRandom; | |
| public class DzCorrection { | |
| //private ArrayList<String> cells2; |
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.Random; | |
| import java.util.RandomAccess; | |
| import java.util.concurrent.ThreadLocalRandom; | |
| public class DzCorrection { | |
| //private ArrayList<String> cells2; |
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.Arrays; | |
| import java.util.List; | |
| import java.util.Random; | |
| public class Dz { | |
| public static void main(String[] args) { |
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 Bowl { | |
| int amountWater = 100; // сколько еды в тарелке осталось | |
| int portionWater = 10; // размер порции | |
| void feed(Cat cat) { | |
| if (amountWater > portionWater) { | |
| amountWater -= portionWater; | |
| } else { | |
| System.out.println("There is no food on the plate"); | |
| } | |
| cat.consumedWater += portionWater; |
NewerOlder