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
// You've got an array of ints 2,2,3,3,4,5,5... Find an element without a pair. | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var array = new int[] {2, 2, 3, 3, 4, 5, 5}; | |
var array2 = new int[array.Length]; | |
foreach (var a in array) | |
{ |
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
// You've got an array of ints 2,2,3,3,4,5,5... Find an element without a pair. | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var array = new int[] {2, 2, 3, 3, 4, 5, 5, 6, 9}; | |
var array2 = new int[array.Length]; | |
for (int index = 0; index < array.Length; index++) | |
{ |
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
public interface IQueue<T> | |
{ | |
void Enqueue(T value); | |
T Dequeue(); | |
} | |
public class StackQueue<T> : IQueue<T> | |
{ | |
private readonly Stack<T> _stack1 = new Stack<T>(); |
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
1) we will be create new array, lenght = max floor | |
2) we will add to index (if exist by number of floow) value of person time | |
3) read array from right to left | |
4) in cicle (current index of cicle as "floow") | |
4.1) if current vlue == 0, then incriminate result and continue | |
4.2) if it is firs floow, maybe we need to wite, add current value and continue | |
4.3) if curent value GREAT that result, then add value by formula (result = curent value - result) | |
4.4) otherwise/else, just incriminate result | |
that it) |
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
private static bool CompareIterative(BTN n1, BTN n2) | |
{ | |
// check for nulls | |
if (n1 == null || n2 == null) | |
{ | |
return n1 == n2; | |
} | |
var q1 = new Queue<BTN>(); | |
var q2 = new Queue<BTN>(); |
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
-- a- list of clients, which have an order with order_sum > 50 | |
select c.client_id, c.client_name from Clients as c | |
inner join Orders as o on o.client_id = c.client_id | |
where o.order_sum > 50 | |
-- b- clients, whose total sum of orders exceeds 100 | |
Select * from | |
(select c.client_id, c.client_name, SUM(o.order_sum) as total from Clients as c | |
inner join Orders as o on o.client_id = c.client_id | |
GROUP BY c.client_id) as t |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<configSections> | |
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> | |
</configSections> | |
<startup> | |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | |
</startup> | |
<log4net> | |
<appender name="UdpAppender" type="log4net.Appender.UdpAppender"> |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<configSections> | |
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> | |
</configSections> | |
<startup> | |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | |
</startup> | |
<log4net> | |
<appender name="UdpAppender" type="log4net.Appender.UdpAppender"> |
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
Elasticsearch is an enterprise level open source search server based on Apache Lucene, offers a real-time distributed search and analytics with a RESTful web interface and schema-free JSON documents. Elasticsearch is developed in java and is released under Apache License. Currently, it is ranked second in most popular enterprise search engine, behind Apache Solr. | |
This guide will help you to install the Elasticsearch on Ubuntu | |
== Prerequisites == | |
Make sure you have the latest JDK installed on your system. If you don't have setup it: | |
<syntaxhighlight lang="bash"> | |
sudo apt-get remove --purge openjdk* | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo apt-get update |
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
stages: | |
- build | |
- publish | |
.build: &build_template | |
stage: build | |
image: microsoft/dotnet:2.1-sdk-alpine | |
cache: | |
key: "$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME" | |
paths: |