teleren/devto huggingface dataset:
Fiwit - A service to manage internal IT
Tags: showdev, rails, saas, startup
Published: 2020-03-22 11:46:12

Wanted to share with your community a new web app I've been working on for a few months: www.fiwit.io 

It's a tool to manage everything in your internal IT: 
- IT Asset management 
- IT Helpdesk 
- Internal IT documentation

**What problem does it solve?**

From what I've observed, many IT people, especially those working in small companies often struggle to manage their IT. 

Despite we have some great tools to do programming, IT, on the other side, is often left to archaic solutions, consisting of a mix of old software, excel sheets, or in-house software. So, I decided to build a web app to tackle this problem in an easy way, accessible to anyone.   

**The technical stack**

The app is build using Rails 6. 

It's not a single-page app. I've made it using Turbolinks thanks to this blog, which showed me that this was possible to have turbolinks-powered applications bringing a good user experience in 2020. 

The app is hosted on Heroku, after trying different projects on AWS, as this was much simpler for the deployment. 

Interesting fact, we have implemented a client-side barcode scanner using a very good library: Quagga.js. 

**Request for feedback**

As this project is very new, I'd like to ask your community for a few feedbacks. 

Probably that among programmers, many of you already had to also work with an IT department. So, I'm wondering: is that something that you would use? If you have time to look at it, could you tell me what do you think about the website? 

Of course, other questions are welcome as well, about any aspect (such as if you would like to get more details about the tech stack, or, other things).
자바와 닷넷의 문자열 연산자 차이
Tags: java, csharp, techtalks, korean
Published: 2020-03-23 05:35:25

> 2015-04-06 10:30:11 from blog.hazard.kr

## 1. `==` 및 `!=` 연산자

### 닷넷
닷넷은 `==` 연산자 오버로딩을 통하여 `String.Equals` 사용하여 값의 동일성을 비교.

### 자바
자바는 `String`이 닷넷과 같이 클래스이며 연산자 지원 안하는 특성상 레퍼런스 비교밖에 못하므로 동일한 값 비교 불가.
따라서 개발자가 직접 `String.equals`를 사용.

## 2. + 연산자

### 닷넷 :

```cs
string s = "asd" + b + "qwe";
//>> string s = string.Concat("asd", b, "qwe");
```

[String.cs](http://www.dotnetframework.org/default.aspx/4@0/4@0/DEVDIV_TFS/Dev10/Releases/RTMRel/ndp/clr/src/BCL/System/String@cs/1305376/String@cs)
.NET concat 원리
```cs
        [System.Security.SecuritySafeCritical]  // auto-generated
        public static String Concat(String str0, String str1) {
            //Contract 는 Test 및 유효성 검사를 위한 내부 클래스임.
            Contract.Ensures(Contract.Result<string>() != null);
            Contract.Ensures(Contract.Result</string><string>().Length ==
                (str0 == null ? 0 : str0.Length) +
                (str1 == null ? 0 : str1.Length));
            Contract.EndContractBlock();
  
            if (IsNullOrEmpty(str0)) {
                if (IsNullOrEmpty(str1)) {
                    return String.Empty;
                }
                return str1;
            }
 
            if (IsNullOrEmpty(str1)) {
                return str0;
            }
  
            int str0Length = str0.Length;
            //.NET 은 네이티브를 통해 포인터에다가 합칠 문자열 길이를 모두 합산하여 배열에 자리 부여
            String result = FastAllocateString(str0Length + str1.Length);
            //그리고 포인터에다가 순서대로 삽입
            FillStringChecked(result, 0,        str0);
            FillStringChecked(result, str0Length, str1);
            //그리하여 포인터 문자열 출력.
            return result;
        }
```

### 자바 :

```java
String s = "asd" + b + "qwe";
//>> String s = new StringBuffer().append("asd").append(b).append("qwe").toString();
```

[StringBuffer.java](http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/lang/StringBuffer.java)
자바는 문자열 증가 연산자 약속을 `StringBuffer` 클래스를 통해 합치며 원리는 닷넷과 차이가 있음.

### 닷넷과 자바의 문자열 합치기 차이점
닷넷 : 처음부터 합칠 모든 문자열의 길이만큼 자리를 포인터에 할당 후 삽입한 다음 포인터 결과값 출력.
자바 : `StringBuffer` 특성상 일정 자리를 부여 후 문자열 넣을 때마다 필요 시 일정량 증가 후 삽입한 다음 문자열 출력. (기본값은 +16)

### 닷넷과 자바의 문자열 합치기 공통점
반복문 등에서 문자열 추가시 닷넷은 `StringBuilder`, 자바는 `StringBuffer`를 쓰는 것이 성능상 이득.

여기까지.
Covid Counter
Tags: corona, covid, counter
Published: 2020-03-23 08:50:20

---
title: Covid Counter
published: true
description: Another Corona Count tracker
tags: corona, covid, counter
---

I created this because I was bored and didn't have anything creative to make and since everyone seems to be posting theirs. 
Here's a minimal version that gets you the counts of various incidents

[Link](https://corona.siddharthgelera.com/)
[Tutorial Git] git commit -am: Atualizando arquivo modificado no Git
Tags: github, am, git, braziliandevs
Published: 2020-03-23 20:25:57

Para atualizar um arquivo que foi modificado no repositório, existem dois caminhos.

```
$ git add <arquivo>
```

- **$** indica que você deve usar o **usuário comum** para fazer essa operação.
- **add** vai adicionar ao git o(s) arquivo(s) que virá(ão) em seguida.
- digite o nome do arquivo sem os sinais **< >**.

seguido do **commit**

```
$ git commit -m 'sua mensagem aqui'
```

Exemplo:

Aqui temos o arquivo index.html que foi modificado.

![arquivo modificado](https://dev-to-uploads.s3.amazonaws.com/i/5y1vdqg8u0lidlt8jex2.png)

Adicionando o arquivo com o comando **git add**

![git add no arquivo modificado](https://dev-to-uploads.s3.amazonaws.com/i/aqde5qpcn3ydxcar5snt.png)

E fazendo o **commit**

![fazendo o commit do arquivo](https://dev-to-uploads.s3.amazonaws.com/i/1pbn886459v3ljhxbiqk.png)


## Atalho

Também é possível fazer o **commit das modificações** através de um **atalho**:

```
$ git commit -am 'adição de modificação do arquivo'
```

O parâmetro **-a** adiciona todos os arquivos que foram modificados, sem a necessidade de adicionar cada um individualmente.

Exemplo:

Aqui temos vários arquivos modificados

![vários arquivos modificados](https://dev-to-uploads.s3.amazonaws.com/i/kf4xw8bhu8fjfbmicaxr.png)

Usando o atalho

![usando o atalho](https://dev-to-uploads.s3.amazonaws.com/i/c3ivq3uujgzmwqnqo4d9.png)

**Observação:**
É importante notar que se houver um arquivo novo (ainda não rastreado pelo **git**) o comando **git commit -am** faz a adição do commit **apenas dos arquivos rastreados que foram modificados**.

Exemplo:

Temos um arquivo que foi modificado (**nintendo64.html**) e um arquivo novo (**estilo-mobile.css**) ainda não rastreado.

![arquivo modificado e outro não rastreado](https://dev-to-uploads.s3.amazonaws.com/i/eufw6m04fws7qd13poxg.png)

Usando o atalho **git commit -am** podemos perceber que somente o arquivo modificado foi mandado ao **index**.

![fazendo o commit, através do atalho, do arquivo modificado](https://dev-to-uploads.s3.amazonaws.com/i/j26exubcinfvv7x6y9y7.png)

## Descartando modificações

Caso queira descartar as modificações feitas em um arquivo, basta digitar

```
$ git checkout <nome_do_arquivo>
```

Exemplo:

Temos dois arquivos que foram modificados e queremos descartar as modificações (voltando ao arquivo anterior as mudanças).

![dois arquivos modificados](https://dev-to-uploads.s3.amazonaws.com/i/1t10uvm5cqogmvpxylbs.png)

Usando com comando **git checkout** com os dois arquivos ao mesmo tempo:

![usando o checkout para descartar alterações](https://dev-to-uploads.s3.amazonaws.com/i/90wso0tsgd0g9is1159j.png)
Make your react apps compatible with IE
Tags: react
Published: 2020-03-23 11:39:51

---
title: Make your react apps compatible with IE
published: true
description: 
tags: React
---

# Installation

```bash
npm install react-app-polyfill
```

or

```bash
yarn add react-app-polyfill
```

# Import entry points

Import the packages at the top of your `index.tsx` or `index.jsx`.

```js
import 'react-app-polyfill/ie9';
import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
```

That's it! Now your react app should run on IE without any errors.

# Resources
- [react-app-polyfill](https://github.com/facebook/create-react-app/tree/master/packages/react-app-polyfill)
The happiest countries Worldwide 
Published: 2020-03-23 12:15:13

Happiness is not a simple goal but is about making progress when it's as elusive as ever. Being happy often means continually finding satisfaction, contentment, a feeling of joy, and a sense that your life is meaningful during all kinds of problems that do not depend upon finding ease or comfort. Nobody is jolly or elated all the time, but some individuals are definitely more fulfilled or fortunate than others.

Depending on the purpose of the research, happiness is often measured using objective indicators (data on crime, income, civic engagement and health) and subjective methods, such as asking people how frequently they experience positive and negative emotions. 

Helsinki, Finland is the happiest one for the third year. The N2 is Denmark according to  2020's study, followed by Switzerland in third place and Iceland in the fourth. The UK ranks N13th and The USA N18th. 

'A happy social environment, whether urban or rural, is one where people feel a sense of belonging, where they trust and enjoy each other and their shared institutions' said Professor John F. Helliwell of the University of British Columbia who co-edited the report. 

'Generally, we find that the average happiness of city residents is more often than not higher than the average happiness of the general country population, especially in countries at the lower end of economic development.

The least happy cities ranked were Kabul, Afghanistan; Sanaa, Yemen; Gaza, Palestine; Port-au-Prince, Haiti; and Juba, South Sudan.

These are just statistics. Happiness is inside everyone and it doesn’t matter where do you live or do you have lots of money, do you wear expensive clothes is all about finding happiness inside you wherever you are in Denmark, in Finland, in Afghanistan or somewhere else.
The Grand Summer Internship Fair
Tags: startup, codenewbie, contributorswanted
Published: 2020-03-23 12:36:16

https://internshala.com/the-grand-summer-internship-fair?utm_source=eap_whatsapp&utm_medium=3354716

Hey, In the wake of COVID-19, this year's 'Grand Summer Internship Fair - India's largest online fair' brings 1,200+ work from home and summer internships in dream companies like OnePlus, Xiaomi, Capgemini, HCL, TVS, and many more. All this with a guaranteed stipend up to INR 75,000!? So, register for the fair now and also win rewards up to INR 30,000. 
https://internshala.com/the-grand-summer-internship-fair?utm_source=eap_whatsapp&utm_medium=3354716
100daysofcode Flutter
Tags: 100daysofcode, flutter
Published: 2020-03-23 15:19:26

day 14/100 of #100daysofcode #Flutter
Belajar Flutter , dari kursus Udemy from
@maxedapps

Learning about navigating between screen , push, pop, stack concept, pushnamed, pushnamed with argument, send data to next screen,
https://github.com/triyono777/100-days-of-code/blob/master/log.md
I made a "Simon Game" variation using VueJS 🎮
Tags: showdev, game, vue, frontend
Published: 2020-03-23 22:28:25

---
title: I made a "Simon Game" variation using VueJS 🎮
published: true
description: An "infinite" game based on "Simon Game"
tags: #showdev #game #vuejs #frontend
cover_image: https://felippe-regazio.github.io/memory-lights/img/memory-lights.png
---

Recently i made this kind of [Simon Game](https://en.wikipedia.org/wiki/Simon_(game)) using VueJS. 

> Simon is an electronic game of memory skill invented by Ralph H. Baer and Howard J. Morrison, working for toy design firm Marvin Glass and Associates,[1] with software programming by Lenny Cope. The device creates a series of tones and lights and requires a user to repeat the sequence.

In my implementation, the previous sequence is not memorized. Every time you hit the right sequence a completely new variation with a new step is proposed by the computer. This version is also "infinite", test your limits.

Here is the game link:
https://felippe-regazio.github.io/memory-lights/

Here is the source code:
https://github.com/felippe-regazio/memory-lights-source

My best was level 12 🙃
Train Simulation Problems - Update
Tags: java, help
Published: 2020-03-23 23:40:12

## Thanks for yesterday.

Hey everyone,

So, I have gotten pretty far with the Train Simulation from the help I've gotten yesterday. Thank you to all that helped! I really appreciate it. Most of the problems I had were with things I thought I had fixed already but didn't. I think I just needed some extra eyes on this problem. Usually, everyone is by themselves trying their hardest to figure out a problem, but, sometimes all you need to do is put your ego and pride aside and ask for help.

## Update.

To update you on this project, I have pretty much solved all those pesky problems I had, but then, others have popped up... 

> **Peskipiksi pesternomi!**
> **It had no effect...**

The issue where the number of stations that were entered, were not how many stations you went to. So let's say I entered *3* as the number of stations. I would instead get *100* stations because the getCurrentStation method was not actually returning the current station. 

The other major issue I had involed the station name. It turns out I was trying to get a char instead of an integer to return the current station index. **SMH...** I felt so dumb but thats why you ask for help. I thought I already corrected it when I copied and changing it from another method.

## Current problems.

1.
With these problems solved I am now having a problem with getting the current station... Yes, this is unexpected considering I just fixed it to where it wouldn't print out *100* stations anymore. Now, it is only giving me one station when it is supposed to be adding *1* after each station and subtracting *1* if the stopCounter is not less than the number of stations.

2.
The other problem I am having is with the display of the Usage Report. It is supposed to be shown at the end of the program after you have already run a simulation. If the current trains create counter is less than *0* then it is supposed to display the usage report with the user name, the create counter, and the run counter. So far I have not been able to figure out why this happening.

## I am asking once again.

Well, like the great **Bernard Sanders** it's that time again when I ask you for your help. I am learning a lot from these post and do think I will continue to post about these school projects. If you can lend your eyes toward [this project](https://gist.github.com/sonAndrew/dde70230fe184eb40993ed81f114a713) and tell me if you see any discrepancies in the code that would cause these problems, I would greatly appreciate it.

Thanks for reading.
Deploying Service Based Architecture Application on Amazon’s ECS (Elastic Container Service)
Published: 2020-03-24 03:03:06

Link: https://blog.joshsoftware.com/2019/03/12/deploying-service-based-architecture-application-on-amazons-ecs-elastic-container-service/

Why deploy container for each service

Deploying all service on single machine is possible but we should refrain from it. If we deploy all service on single machine then we are not utilising benefits of service based architecture (except manageable/easy-to-upgrade codebase).
Galaxies far far away
Tags: softwaredevelopment, complexity
Published: 2020-03-24 09:33:37

---
title: Galaxies far far away
published: true
description: Complexity vs Usefulness
tags: software development, complexity,
---

Creating something of value, creating something for other (non-tech) people, that is actually used, timing it correctly and many more factors are counter intuitive with complexity in software development to a coder/programmer. 

In most of my tools I am digging in the code shit and the things colleagues find meaningful - abstractions, abstractions, abstractions - test-ability, change-ability, solid, OOP, compiled, interpreted, reused, readable, garbage collected code, scalability, etc. And all this things probably does matter at some point. 

But, in my last tool I've linked reading excel, writing word files and created simple web front end - no CSS, no JavaScript. Nobody gives a shit what is client and what is server, is it binary, is it multi-core, is it optimal, is the code well written as long as the software does what is desired.
Is Value an Object
Tags: javascript, snippets
Published: 2020-03-24 10:10:21

Little function to check if a value is an object:

```js
function isObject(val){
  return (
    val != null && 
    typeof val === 'object' && 
    Array.isArray(val) === false
  );
}
```

> **Notice** that Date, RegExp, etc.. will pass the check.
When will my cover image change?
Tags: help
Published: 2020-03-24 21:35:02

I updated the cover images on 2 of my posts. I was really hoping the new image would show up in the twitter cards. It's been several hours and no luck yet.

Am I forever stuck with the old images? Is it a cache thing? How do I fix it? Am I just being impatient? 


These are the posts I changed.

{% post https://dev.to/vickilanger/code-questions-bot-42io %}

{% post https://dev.to/vickilanger/that-s-it-that-s-the-tweet-send-3e0h %}
Laravel Signature Pad Example Tutorial 
Tags: laravel, signature, pad
Published: 2020-03-25 18:52:53

Hey Artisan

Hope you are doing well. In this tutorial i am going to show you laravel 7 signature pad example. In this tutorial i am going to show you how we can create a signature pad and save it into public directory. 

https://www.codechief.org/article/laravel-signature-pad-example-tutorial-from-scratch
【Git】ちょっと難しいリベースの挙動
Tags: git
Published: 2020-03-26 00:17:11

## 複数ブランチに対する git rebase

```text
A---B---C---D  master
     \
      X---Y---Z  dev
           \
            P---Q  dev2
```

devブランチをmasterブランチの先頭に移動

```shell
$ git rebase master dev
```

```text
              X'--Y'--Z'  dev
             /
A---B---C---D  master
     \
      X---Y---P---Q  dev2
```

> `'`はリベースによって作られた、既存のコミットを書き換えた、新しいコミットを表しています。

dev2ブランチがコミットBから作られたことになりました。

## マージを含むブランチに対する git rebase

```text
            P---M---N  dev
           /   /
      X---Y---Z
     /
A---B---C---D  master
```

devブランチをmasterブランチの先頭に移動

```shell
$ git rebase master dev
```

```text
A---B---C---D  master
             \
              X---Y---Z---P---N  dev
```

マージコミットであるMが消えました。

リベースは難しいよというお話でした。（マージを使いませんかと主張したい）
Docker で Hack
Tags: docker, hack
Published: 2020-03-26 02:11:39

---
title: Docker で Hack
published: true
description: 
tags: Docker, hack 
---

Facebook Hack試してみた。（Hello Worldだけ）
https://github.com/facebook/hhvm/wiki#installing-pre-built-packages-for-hhvm
自前のサーバーは汚したくないんで、Dockerでやってみた。

```
$ vim Dockerfile
```

```rb
FROM ubuntu

RUN apt-get update
RUN apt-get install -y python-software-properties
RUN apt-get install -y wget
RUN add-apt-repository ppa:mapnik/boost
RUN wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
RUN echo deb http://dl.hhvm.com/ubuntu precise main | sudo tee /etc/apt/sources.list.d/hhvm.list
RUN apt-get update
RUN apt-get install -y hhvm
```

```
$ docker build -t hack .
.....
$ docker images

$ docker run -i -t hack bash
root@c5b48b4e3988:/# vi helloworld.hh
```

```php
<?hh
  echo "Hello World\n";
```
```
root@c5b48b4e3988:/# hhvm helloworld.hh
Hello World
root@c5b48b4e3988:/# 
```
ハマったところ！

```php
<?hh
  echo "Hello World\n";
?>
```
HipHop Fatal error: syntax error, unexpected T_HH_ERROR, expecting $end in /hellworld.hh on line 2

?> 閉じカッコを書くと上のエラーが出る
How to be Pythonic? Design a Query Language in Python
Tags: talk, python, querylanguage, terminusdb
Published: 2020-03-26 11:49:04

---
title: How to be Pythonic? Design a Query Language in Python
published: true
date: 2020-03-20 00:00:00 UTC
tags: Talk,Python,Query Language,TerminusDB
canonical_url: https://cheuk.dev/2020/03/20/how-to-be-pythonic/
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/793u48f9tqucjg8hzdyt.png
---

I gave a talk at [PyAmsterdam](https://py.amsterdam/2020/03/25/virtual-pyamsterdam-from-home-stayathome.html) today and it was a lovely community. I get the chance to answer some questions that have been puzzling me for a while. I ask people to vote for me on [DirectPoll](https://directpoll.com/) (first time trying it) so I know what the community thinks.

## Is Pythonic a thing?

It is a questions that I have been thinking since I was a naive Python Data Scientist. “Why I can’t just do it in a for loop?” came through my mind all the time. Why we have to follow certain convention in coding? Is Pythonic a thing or just peer pressure.

![Poll of Is Pythonic a Thing](https://cheuk.dev/assets/images/is_pythonic_a_thing.png)

Almost 90% of you things that it really is a thing. (35 votes)

## Who like SQL?

For me, I am not a fan of SQL. Date back to my first data science job I was furious about writing thousand links of SQL just to get some aggregated results. Joining tables are not fun as mistakes can be made easily. As we are designing a new query language in TerminusDB, I want to know what people things about SQL.

![Poll of Who like SQL](https://cheuk.dev/assets/images/who_like_sql.png)

I am surprised that 70% of you like SQL! Hmmmmm… (38 votes)

## Which one do you prefer?

During the time I was translating WOQLjs to [WOQLpy](http://blog.terminusdb.com/2020/01/20/design-a-query-language-client-for-pythonistas-and-data-scientists/) I wonder what how shall I make the query building more “Pythonic”. What would Pythonistas prefer? Chainable calls like `WOQLQuery().doctype("journey").label("Journey)` or Pandas DataFrame style, multi-parameters calls like `WOQLQuery().doctype(id="journey, label="Journey")`. (I failed to show the result in the talk so here you go!)

![Poll of Which one do you prefer](https://cheuk.dev/assets/images/which_one_do_you_prefer.png)

Since Pandas, the most popular data manipulation library in Python uses the multi-parameters calls, I am not surprised that 80% of you would prefer that. (25 votes)

* * *

If you have missed the talk, you can now watch it [here](/videos/hl7xl7kurkg/). If you want to catch me streaming live, follow me on [Twitch](https://www.twitch.tv/cheukting_ho).