Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>grpc-hello-server</artifactId>
<version>1.0-SNAPSHOT</version>
@NeilAlishev
NeilAlishev / MySpringMvcDispatcherSerlvetInitializer.java
Created October 16, 2020 12:32
HiddenHttpMethodFilter Java-based configuration
import org.springframework.web.filter.HiddenHttpMethodFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
public class MySpringMvcDispatcherSerlvetIntitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
@Configuration
@ComponentScan("ru.alishev.springcourse")
@EnableWebMvc
public class SpringConfig implements WebMvcConfigurer {
private final ApplicationContext applicationContext;
@Autowired
public SpringConfig(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
@NeilAlishev
NeilAlishev / Instruction.md
Last active February 23, 2024 18:06
Решение проблемы с запуском Jupyter Notebook

Это очень частая проблема, которая появляется на некоторых ОС. Дело в том, что среда разработки запустилась, но браузер не открылся автоматически.

Как решить эту проблему?

В первую очередь, попробуйте запустить Anaconda Navigator с правами администратора (правой кнопкой мыши нажать на иконку Anaconda Navigator, во всплывающем меню выбрать "Запуск от имени администратора"). Теперь, запустите Jupyter Notebook.

Если все равно не открывается окно браузера, выполните инструкции описанные далее.

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
<meta charset="ISO-8859-1">
<title>My app</title>
</head>
<body>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
<display-name>spring-mvc-app1</display-name>
<absolute-ordering/>
import java.util.Arrays;
/**
* @author Neil Alishev
*/
public class MyLinkedList {
private Node head;
private int size;
public void add(int value) {
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<bean id="testBean"
public static int binarySearch(int[] sortedArray, int key, int low, int high) {
// считаем индекс центрального элемента
int middle = low + (high - low) / 2;
// base case (условие выхода) - регион поиска пустой
if (low > high) {
// не нашли элемента, который равен ключу
return -1;
}