teleren/devto huggingface dataset:
HAProxy With Resolvers In Case Of AWS Application LoadBalancer
Tags: haproxy, resolvers, aws, devops
Published: 2020-12-09 12:18:43

- HAProxy allows using a host name on the server line to retrieve its IP address using name servers. 

- By default, HAProxy resolves the name when parsing the
configuration file, at startup and cache the result for the process' life.

- This is not sufficient in some cases, such as in Amazon where a server's IP can change after a reboot or an ELB Virtual IP can change based on current workload.

- This article describes how to user resolvers to process server's name resolution at run time.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/34p7plicb1p182hx71nv.png)
**1. Update haproxy.cfg**
```
global
    log         127.0.0.1 local2

    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     4096
    user        haproxy
    group       haproxy
    daemon
    stats socket /var/lib/haproxy/stats
    stats maxconn 1
    stats timeout 120s

resolvers awsvpc
    nameserver vpc 169.254.169.253:53

defaults
    mode        tcp
    log         global
    retries     3
    timeout     connect 10s
    timeout     client 1m
    timeout     server 1m
    timeout     check 10s
    maxconn     512

backend myweb
    server disabled-server 127.0.0.1:1 disabled
    server mydns XXXXXXXXXXXX.ap-northeast-1.rds.amazonaws.com:80 check port 80 resolvers awsvpc inter 2000 fall 5
```
**Note:** `nameserver vpc 169.254.169.253:53` is the DNS server/ resolver to be used

**2. Restart haproxy service**
```
systemctl restart haproxy
```

**3. Check result**
```
~:# netstat -plunt |grep 53
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      10616/systemd-resol 
udp        0      0 127.0.0.53:53           0.0.0.0:*                           10616/systemd-resol 
```

**More about haproxy**
- [How To Set HTTP-Request Header In Haproxy](https://dev.to/vumdao/how-to-set-http-request-header-in-haproxy-48bd)
- [How To Block IP Addresses In HAProxy](https://dev.to/vumdao/how-to-block-ip-addresses-in-haproxy-3f84)
How to Use Excel SORT Function in Office 365? – [with Example]
Tags: excelfunctions, useexcelsortfunction, excelsortfunctionino
Published: 2020-12-09 11:59:58

---
title: How to Use Excel SORT Function in Office 365? – [with Example]
published: true
date: 2020-12-09 11:52:58 UTC
tags: ExcelFunctions,UseExcelSORTFunction,ExcelSORTFunctioninO
canonical_url: https://geekexcel.com/excel-sort-function/
---

## Excel SORT Function:

In this guide, we will describe how to use **Excel SORT Function in Office 365** with its syntax, explanation, and example. Get an official version of **MS Excel** from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)

## SORT Function – Description:

- This function will **sort the contents of a range** or **array** in Excel.
- It returns the dynamic array of results.

## Syntax:

**=SORT(array, [sort\_index], [sort\_order], [by\_col])**

### Arguments Explanation:

**Array –** The input range top sort.

**sort\_index – ** It is an optional one. The column index is used for sorting. Its default values is **1**.

**sort\_order – ** This option is also an optional one. Use **1** for **ascending,**  **-1** for **descending.** By default, it will sort in ascending order.

**by\_col –** It is an optional one. Use the value **TRUE** to sort by **column ** or **FALSE** to sort by **row. **

## Example:

Here, we come up with an example to make it clear.

- In the below example image, you can see the input range in **Column B** and **Column C**.
- Then, you need to **enter** a **formula** in the formula bar.
- After that, **click** the **Enter** button to get the result.
- It will sort the values in **ascending order.**

![Example](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/12/Example-41.png)<figcaption id="caption-attachment-19202">Example</figcaption>

## Closure:

In this guide, you can easily understand the steps to use **Excel SORT Function in Office 365** with its syntax, explanation, and example. Drop your **feedback** in the comment section. Thanks for visiting **[Geek Excel.](https://geekexcel.com/)** Keep Learning!!
Laravel: Is it possible to search in a mutators?
Published: 2020-12-09 11:37:15

Hello , 

I have a specific mutator called `done` it returns `true` if the 'updated_at' is larger than 'cretaed_at'.

```
    public function getDoneAttribute()
    {
        return ($this->created_at < $this->updated_at);
    }
```

the code bellow returns an errro :

```
 $i = \App\User::where('done',true)->get();
```

The error : 

```
Undefined column: 7 ERROR: column "done" does not exist LINE 1:
```
Liman 1.5 Sürüm Duyurusu
Published: 2020-12-09 11:34:40

HAVELSAN tarafından geliştirilmekte olan Liman MYS 1.5 sürümü 9 Aralık 2020 tarihinde Havelsan Açıklab Ekibi tarafından duyuruldu.

Değişim Günlüğü
-Veritabanı postgresql'e taşındı ve sqlite veritabanından otomatik migration sağlandı.
-Mail raporu altyapısı eklendi.
-Eklentilere yeni OOP template'i eklendi.
-Widget hata mesajları iyileştirildi.
-Liman paketine Ubuntu 18 Server desteği eklendi.
-Sunucu takip özelliği eklendi.

Kurulum için:

https://rehber.liman.dev/liman-kurulum/
Advent of Code - Day 2
Tags: javascript, adventofcode, algorithms, challenge
Published: 2020-12-09 11:32:24

This is day 2 of the Advent of Code challenge. Here is my solution and the `identifier` function is different between part 1 and 2:

```javascript
const items = document
  .querySelector("body > pre:nth-child(1)")
  .innerText.split("\n");
items.pop();

// part 1
const identifier = (str, char, min, max) => {
  const re = RegExp(`${char}`, "g");
  const count = (str.match(re) || []).length;
  if (min <= count && count <= max) {
    return 1;
  } else {
    return 0;
  }
};

// part 2
const identifier = (str, char, min, max) => {
  const re = RegExp(`${char}`, "g");
  const firstPos = str[min - 1] === char ? 1 : 0;
  const secondPos = str[max - 1] === char ? 1 : 0;
  const count = firstPos + secondPos;
  if (count === 1) {
    return 1;
  } else {
    return 0;
  }
};

let count = 0;

items.forEach((item) => {
  const config = item.split(" ");
  const str = config[2];
  const char = config[1].replace(":", "");
  const min = config[0].split("-")[0];
  const max = config[0].split("-")[1];
  count += identifier(str, char, min, max);
});

console.log(count);
```  

Some thoughts when solving the problem:
- A lot of the problems can be solved by breaking it down piece by piece
ArtLine, Create Amazing Line Art Portraits
Tags: deeplearning, machinelearning, github, datascience
Published: 2020-12-09 11:00:31

I am Vijish Madhavan, My experience is into marketing. Coding ka kida caught me last year.

This is just a fun project!!

Introducing Artline, A Deep Learning based project for creating line art portraits. 

As I said it was just a fun project, but the response I got surprised me. The results seems to be state of the art comparing it to previous models like APDrawingGan and U-2-Net. You are free to judge as its opensource.
  
![ArtLine, AI generated Line Art.](https://i.imgur.com/NTi2GRA.jpg)
**GitHub Link**

Check out for pretty images, scroll through the repo link. 

https://github.com/vijishmadhavan/ArtLine

#**Gist of the project**

Note: Being a newbie my code and documentation would be bad, I will improve with time.

**Technical Details**

Self-Attention (https://arxiv.org/abs/1805.08318). Generator is pretrained UNET with spectral normalization and self-attention. Something that I got from Jason Antic's DeOldify(https://github.com/jantic/DeOldify), this made a huge difference, all of a sudden I started getting proper details around the facial features.

Progressive Resizing (https://arxiv.org/abs/1710.10196),(https://arxiv.org/pdf/1707.02921.pdf). Progressive resizing takes this idea of gradually increasing the image size, In this project the image size were gradually increased and learning rates were adjusted. Thanks to fast.ai for intrdoucing me to Progressive resizing, this helps the model to generalise better as it sees many more different images.

Generator Loss : Perceptual Loss/Feature Loss based on VGG16. (https://arxiv.org/pdf/1603.08155.pdf).

Surprise!! No critic,No GAN. GAN did not make much of a difference so I was happy with No GAN.

You can follow me on twitter @Vijish68859437
Desktop goals
Tags: watercooler, design, welcome
Published: 2020-12-09 11:00:16

<Desktop goal as tech enthusiastic />
1. lock screen 
says welcome and at top it is written
 <try to work with me in google'sworkspace>
as my dream company is Google 
which always encourages me !

2.wallpaper
 have a quote of linus torvalds

*I made them using canva*
How to get only required data fields from mongoDB
Tags: mongodb, node, javascript, tradecoder
Published: 2020-12-09 10:56:42

If you are looking for a solution to get only the required fields data from mongoDB, this simple solution can help you without any side effect

Say, you have this data fields in your database
```
        meetingId,
        meetingDate,
        noticeDate,
        title,
        agenda,
        venue,
        notice,
        noticeDistribution,
        chairedBy,
        participants,
        minutes,
        minutesPreparedBy,
        minutesApprovedBy,
        minutesDistribuion,
        status,
        username,
        userid
```
But you need to send only `minutes` and `minutesApprovedBy` fields, then you can go this way, 
```
yourDB.find({}, {minutes:true, minutesApprovedBy:true})
.then(data=>res.send(data))
.catch(err=>res.send(err))
```
The field you need, put together with a value to `true` as shown above. This will return only those fields (filter) from the database. You can also use `findOne({}, {})` where necessary.
How do people solve Advent of Code puzzles so quickly?
Tags: watercooler, discuss, adventofcode
Published: 2020-12-09 10:54:38

---
title: How do people solve Advent of Code puzzles so quickly?
published: True
description: I really don't understand how you can get the answer in under 5 minutes. My mind is boggled.
tags: watercooler, discussion, adventofcode
//cover_image: https://direct_url_to_image.jpg
---

I occasionally look at the [leaderboard](https://adventofcode.com/2020/leaderboard/day/9) for the day, to see how long people are taking to solve the puzzles.

![Top 9 of the AoC 2020 leaderboard for day 9](https://dev-to-uploads.s3.amazonaws.com/i/yiwz8wh62eopi5y24paa.png)

Some people seem to be getting through the puzzles in under 5 minutes after they go live. I can't even comprehend the puzzles in that amount of time, let alone write a solution.

What techniques do people use to get through the puzzles so quickly?

Is it possible they are cheating? I don't really think people are cheating, but their achievements are so extraordinary.
Simple Server Side CSS with ReScript, React and Emotion
Tags: rescript, emotion
Published: 2020-12-09 09:09:21

# Introduction

A simple introduction to using server side CSS with ReScript, React and [Emotion CSS](https://emotion.sh/).

ReScript version: `bs-platform@8.3.3`

# NPM Packages

First install the packages we need.

```
npm i @emotion/css @emotion/server react react-dom reason-react
```

This example is using the following versions:

```
@emotion/css@11.0.0
@emotion/server@11.0.0
react@17.0.1
react-dom@17.0.1
reason-react@0.9.1
```

# Update bsconfig.json

Add `reason-react` to `bs-dependencies`:

```
"bs-dependencies": ["reason-react"],
```

# Create the Emotion bindings

In a file `Emotion.res` add the following bindings.

```js
module Css = {
  @bs.module("@emotion/css")
  external css: {..} => string = "css"
}

module Server = {
  @bs.module("@emotion/server")
  external renderStylesToString: string => string = "renderStylesToString"
}
```

# Render a component with some styles

In a test file, create some styles to use:

```js
module Styles = {
  open Emotion.Css
  let container = css({"border": "1px solid black"})
}
```

Create a React component that uses the styles:

```js
module Container = {
  @react.component
  let make = (~children) => {
    <div className={Styles.container}> {children} </div>
  }
}
```

Render the component with Emotion styles:

```js
let el = <Container> {ReasonReact.string("Hello")} </Container>


let html =
  el
  ->ReactDOMServer.renderToStaticMarkup
  ->Emotion.Server.renderStylesToString
```

Which generates the following code (reformatted here for readability):

```html
<style data-emotion="css 1r0rfp">
  .css-1r0rfp{border:1px solid blue;}
</style>
<div class="css-1r0rfp">Hello</div>
```

# Note

If you would prefer stronger type safety with Emotion, you may like to use [bs-css](https://github.com/reasonml-labs/bs-css).
Higher Order Functions
Tags: javascript
Published: 2020-12-09 10:27:04

#**Higher Order Function**

Higher-order functions are functions that take other functions as arguments or return functions as their results.


##**Call Back Functions**

The functions which is pass as an argument is known as call back function.

#####**Example:**
![call back](https://dev-to-uploads.s3.amazonaws.com/i/cxkkr7940vt7sfxes0jh.png)


![HOF](https://dev-to-uploads.s3.amazonaws.com/i/7q928quh6vmow8spkl0l.png)

Here, filterOdd function is a Higher order function as it is accepting isOdd function as an argument and also returning finalArray.

isOdd is a call back function as it is passed as an argument in filterOdd function


### **Use cases of Higher Order Function**

**Without Higher-order function**


![example1](https://dev-to-uploads.s3.amazonaws.com/i/8b08nw3nx4f76d8hglay.png)



**With Higher-order function(Map)**

![example](https://dev-to-uploads.s3.amazonaws.com/i/7z6m3vu6iqxlcj0ih670.png)

with use of higher order function we can write short and accurate code where chances of getting error is very less

Similarly, some methods of string and array i.e reduce, filter, some, map use call back function to compute output
Vue Transition Group: Strange Entry behaviour
Tags: vue, javascript, css, html
Published: 2020-12-09 10:17:06


While working with Vue's transition-group API today I was getting a strange entry motion on an element which I was adding to a transition-group. It seemed to be entering from the top-left of the screen when the item was added, however, it would leave the screen as I was expecting it too (as per the CSS which is shown later).

The below codepen demonstrates the behaviour I was experiencing...

Hit "Pull the trigger" to see the behaviour. The second red circle flies in from the left, rather than sliding in from the right!

{% codepen https://codepen.io/jaffa80/pen/BaLLQRy %}

My CSS is set to bring the second circle in from the right, and have it leave to the right once it's removed:
```css
.smoothFlex-enter,
.smoothFlex-leave-to {
  transform: translateX(100px);
  opacity: 0;
}
```

It appeared as if the `smoothFlex-enter` class was not being applied to the element at the start of the animation, causing it to fly in from afar!

On further inspection via the dev tools, I noticed that after the element had been "removed" from the list, remained with an inline style of `display:none`.
```html
<div class="circle smoothFlex-enter-to smoothFlex-move" style="display: none;"></div>
```

The above inline Style is added by Vue when the `v-show` directive evaluates to `false`. I was hopeful now that I had found the issue... Switching to `v-if` resolved the issue immediately!

In the codepen above, select "fix me" to see the desired behaviour in action. This button just switches out the `v-show` example for a `v-if` example.

I hope you have found this post useful!

Head over and have a read of the Vue docs for more information on the transition-group API. It's pretty amazing, but as always, it can be quite frustrating when things don't work as expected!

## Links

[vue animations](https://vuejs.org/v2/guide/transitions.html#List-Transitions)
Технические писатели?!
Tags: beginners, tutorial, writing
Published: 2020-12-09 10:06:30

# Давайте знакомиться

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ydmdd0xe0bfni607du56.jpg)

Здравствуйте, меня зовут Станислав, и я технический писатель, ну, или сокращенно – просто техпис.

Когда я говорю это незнакомым людям, они восклицают:

- О, круто, а ты пишешь фантастику или детективы?

Нет, я не пишу фантастику и даже, о ужас, не пишу графоманию про попаданцев, хотя для некоторых (давайте честнее – для большинства) техническая документация это и фантастика, и триллер, и даже драма.

Почему драма? Документацию не читают, всем известно, а начинают читать, когда уже поздно, прибор сломался, программа не работает, хирург решил открыть анатомический атлас. И только в самом темном углу сидит технический писатель и плачет. А потом неврозы, настой валерианы, аниме и желание уйти из профессии. 

> Драматик Конструкшен

# Так, о чем, собственно, пост?

Однажды, я устроился на новую работу, и один из коллег, узнав, что я технический писатель, спросил, кто такие эти технические писатели. Узнав, что я буду главным и ответственным по документации на выпускаемые продукты компании, коллега указал, что он тоже набирает текст, он тоже техпис? Я, конечно, отшутился и, не желая вступать в длинные пересуды, ответил, что да. А потом добавил, что нет, написание докладов и отчетов не делает из работника техписа.

И вот этот разговор сподвиг меня на создание собственного блога, в котором я расскажу вам, кто такие технические писатели, что они делают и чем занимаются, чем техпис отличается от секретаря или референта, от разработчика или аналитика. Расскажу забавные казусы и даже напишу смешные (или грустные, они у меня тоже есть) истории из повседневных будней технических писателей. Приоткрою завесу столь дивной профессии, раскрою тайну, откуда рождаются техписы, куда они уходят и какой след оставляют в жизнедеятельности компании.

А коллегам, ежели оные зайдут ко мне в блог, будет интересно почить мои наблюдения, куда движется отрасль, какие критерии предъявляются к профессии, расскажу о профессиональных компетенциях. Вместе мы посмеемся над грустными случаями на собеседованиях и уроним скупую слезу из высохших глаз от случаев, когда документацию надо было сдавать уже вчера, в пятницу, а нам об этом сказали только в понедельник утром.

В общем, читатели и коллеги, будет интересно. Я не буду писать формализмами и однотонным скучным текстом, давайте условимся, только веселый (или грустный) слог, неформальная обстановка и печеньки тем, кто перейдет на темную сторону силы.

**Спасибо за чтение!**

**Follow me** [github](https://github.com/Andronovss)
Best Book To Understand Latest Java Features
Tags: java, books
Published: 2020-12-09 10:05:36

There are a lot of changes done in Java after version 8 and if you are wondering what are those new features then I would recommend reading this [book](https://amzn.to/37M2aw5). It sums up new features with examples from 8 onwards also. Worth reading. Go buy your copy now.
How to become an affiliate at anonymous-proxies.net? Start Proxy selling in minutes.
Published: 2020-12-09 10:00:49

##What is our affiliate system about?
We decided to offer a great opportunity for every person who wants to make a profit out of selling proxies. 
We created a true white-label affiliate system that allows you to create your own shop and customise it however you decide with tour own logo and start selling proxies from your own domain name.

##How to start proxy selling with our affiliate system.

We will present the benefits of our affiliation program and if you need a detailed presentation please check out this article about [proxy selling with our affiliate program](https://anonymous-proxies.net/knowledgebase/how-to-become-an-affiliate-start-proxy-selling-from-your-own-domain).


Even if you don’t know any programming language or you don’t have the technical abilities to make a full functioning website, you don’t have to worry about it. We will take care of everything and guide you through the steps to create you own site from where you can start selling proxies. We will monitor and maintain the servers, all you need to do is find solutions to increase your sales. 

We have over 10 years of experience in the proxy business, we maintain hundreds  of servers from all over the world and constantly improve our services and features in order to stay on top of the market. 

We offer our Proxies and Socks to the affiliates at much lower prices so you can sell them at the price you choose and make a profit. Furthermore, we offer discounts based on the quantity of services bought and the period of time that they are bought for. 

As an affiliate you will benefit of a separate dashboard where you can see all type of reports regarding your users and transactions.

Our team is online 24/7 to support our clients via email or live chat, so don’t be afraid to contact us anytime you need. 

If you decide to become an affiliate, we will get you up and running so you can start proxy selling from the first day.
5 Best Ways to make your photos look better in Lightroom
Published: 2020-12-09 08:01:54

Your camera doesn’t capture images, your passion capture images. If you have passion and knowledge about photography so you can shoot the best photos. During photo-shoots, you should have the main focus on your subject and focus on what you want to capture. But in the competitive age of digital technology, you should learn about how to make your photos look better. So for photo enhancing purpose many photographers use different software like skylum Luminar, capture one but adobe Lightroom is the gold standard. Lightroom is one of the best photo editing tool that allows photographers to convert low-quality images into amazing just in few moments.

1- Import to Lightroom:
It’s the first process of photo editing, after the completion of photoshoots now move images from an external source to into desktop and drag images that you want to edit into Lightroom. When you will add images into Lightroom there you will see develop panel now open this module and select your image into this tab. Here in this tab, your images are ready to edit.

What You Can Do Here with this Tab:
Exposure: Here you can convert images bit dark to brought up
Tone: Here you can adjust color and shadows balance
Sharpen: you can adjust sharpen according to your choice
Presence: This allows you to add saturation you can adjust saturates all colors equally

2- Correct White Balance:
In develop module at the top panel you will find a white balance adjustment tool. White balance is balancing white color in your photograph. It’s Depends on the photo temperature balance is adjusted. For example, if the temperature is high in Lightroom then you will get a yellow tint in your images. Same if you decrease the temperature in Lightroom then he will get a blue tint in your photo. This by varying the temperature slider in Lightroom you can adjust the white balance of your photograph.

3- Remove Dust Particles:
Dust spots on images are considered bad effects; with Dust Particles You can repair them right from within Lightroom. Move your photos into develop module and then select the spot remover tool with shortcut Key " Q " with this you can find and remove dust particles very easily.

4- Use Photo Filters and Effects:
Filters and effects module located on the right side that you can apply to your images. You can also apply multiple effects or single effects it’s up to you which types of results you want to get. With this mode you can adjust overall images effects, background, color effects and much more you can do.

5 Use Lightroom Presets
Mostly [Lightroom](https://en.taiwebs.com/windows/download-adobe-photoshop-lightroom-5334.html) presets are made by professional photographers that save your lot time. With these presets you can correct, sharpness to your images just within a few seconds. Using presets will help your work consistent and easy. There are endless verities of versatile Lightroom presets are available. These Lightroom presets can be used to improve the light, contrast, and tone of your photos.