teleren/devto huggingface dataset:
sudo dpkg -i hugo_0.30.2_Linux-64bit.deb
Tags: install, ubuntu, hugo
Published: 2017-11-05 20:59:51

---
title: sudo dpkg -i hugo_0.30.2_Linux-64bit.deb
published: published
description: Install "Hugo" on Linux Mint 18.2 ( Ubuntu 16.04.2 )
tags: Install, Ubuntu, Hugo
---


```shell
➜  Downloads sudo dpkg -i hugo_0.30.2_Linux-64bit.deb 
[sudo] password for psnc: 
Selecting previously unselected package hugo.
(Reading database ... 337067 files and directories currently installed.)
Preparing to unpack hugo_0.30.2_Linux-64bit.deb ...
Unpacking hugo (0.30.2) ...
Setting up hugo (0.30.2) ...
➜  Downloads hugo version
Hugo Static Site Generator v0.30.2 linux/amd64 BuildDate: 2017-10-19T13:34:27+02:00
```



Hugo is a modern static site generator that’s written in Go and built to provide an optimal writing experience for authors and viewing experience for visitors. Static site generators have been growing in popularity over the last few years as they are much less resource intensive, provide faster speeds, better security, and are simpler.

- Readtheorg Document: https://psnc.github.io/hugo

### HUGO
 - Hugo                        | https://gohugo.io
 - Hugo Release                | https://github.com/gohugoio/hugo/releases
 - News                        | https://gohugo.io/news/
 - Dokumentation               | https://gohugo.io/documentation
 - Community                   | https://discourse.gohugo.io
 - Github                      | https://github.com/gohugoio/hugo
Has front-end development changed? What is a front-end developer suppose to know?
Tags: discuss
Published: 2017-11-05 20:33:12

---
title: Has front-end development changed? What is a front-end developer suppose to know?
published: true
tags: discuss
---

So I started in the field as a web designer and front-end developer. But all that has meant to me is that I design web based projects and then I code them into HTML, CSS and some simple JS. That's pretty much it. I know a bit about programming and I can make my way around most codebases for templating, theming or whatever. But it seems like the field of front-end development has changed.

So here's my question, has the job of a front-end developer expanded? Does it mean much more now than just being able to write HTML, CSS and JS? If so, would I still be considered a front-end dev or do I need to learn React to still be able to call myself a front-end dev?

Thanks!
sudo dpkg -i freeplane_1.6.10\~upstream-1_all.deb
Published: 2017-11-05 19:09:38

---
title: sudo dpkg -i freeplane_1.6.10\~upstream-1_all.deb
published: published
description: Install "Freeplane" on Linux Mint 18.2 ( Ubuntu 16.04.2 )
tags: Install, Ubuntu, Freeplane
---
 

```shell
sudo dpkg -i freeplane_1.6.10\~upstream-1_all.deb
```
### Freeplane: Application for Mind Mapping, Knowledge and Project Management

- Freeplane | https://sourceforge.net/projects/freeplane/
- Freeplane Files | https://sourceforge.net/projects/freeplane/file
- Download Freeplane Preview | https://sourceforge.net/projects/freeplane/files/freeplane%20preview/
- Download Freeplane Stable | https://sourceforge.net/projects/freeplane/files/freeplane%20stable/

-----

 Author: Patrick Schanen
 Created: 2017-11-05 Sun 19:53
 Generator: Org mode
Experiment in a Git branch
Tags: git
Published: 2017-11-29 12:02:38

---
title: "Experiment in a Git branch"
published: true
tags: Git
canonical_url: https://blog.jonstodle.com/experiment-in-a-branch/
---

When programming you often come across code you'll want to change or refactor. After some tinkering the improvement turns out to not be such a great improvement after all.

Your first instinct might be to _Ctrl+Z_ all the way back to safety. If you've been committing the changes to git, you might discard the changes, revert the commit(s) containing the changes or even reset the head.

I'm here to tell you, do none of those things. Put that work in a branch instead.

Branches are cheap and they make it possible to stuff away the code and pretend it didn't happen. Should you want to go back to that code however, that's still fully possible. There might be some work in there worth salvaging.

You can even reapply those changes to your current code with a rebase of the branch. That way you can continue right where you left off.

At some point in the future you might refactor that piece of code properly and never actually need that old branch of unused code. In that case you can simply delete the branch all together.

I often find myself trying out something new, that I think is a good idea. After sinking in maybe an hour or two to the idea, I realize it's not such a good idea after all. I always put that code in a branch. Should I ever come up with a better solution, I can reuse parts of that code easily.

Happy coding!
What ever happened to putting the object type on the left?
Tags: discuss
Published: 2017-11-04 18:10:08

---
title: What ever happened to putting the object type on the left?
published: true
description: Modern language designers seem to have a fascination with colons..
tags: discuss
---

I apologize in advance for this seeming like a rant, but there's one bit of syntax that I've been seeing *a lot* lately, and I can't seem to figure out why.

It's the `:` and `->` syntax for type definitions. Consider the two snippets in TypeScript and Java.

```ts
function add(a: Number, b: Number): Number { ... }
```

```java
public static int add(int a, int b) { ... }
```

I've noticed that the two above behaviors are very distinct between newer and "old" languages.

Java, C, C++, Objective-C, and C# define functions and variables the Java way.

Kotlin, Swift, Rust, TypeScript, and Go all put types on the Right.

----

Any ideas on why this shift has occurred? Which way do you prefer?
Props and State in React Native
Tags: hybridappdevelopment, components, mobileapps, mobileappdevelopment
Published: 2023-01-06 17:42:26

---
title: Props and State in React Native
published: true
date: 2017-11-04 15:59:56 UTC
tags: hybridappdevelopment,components,mobileapps,mobileappdevelopment
canonical_url: 
---

 **What is Props?**

Props can be referred to something that can be changed dynamically in a Component (i.e Ideally, passing parameters through constructor in JAVA). Let’s discuss more on this by comparing JAVA with React Native.

**Code Usage:**

1. **Destination Class:** (Class which receives props data)

{% gist https://gist.github.com/TakeoffAndroid/cb4df45ef6cb7b76a1d77fb4b609d75c %}

**2. Source Class:** (Class which sends props data)

{% gist https://gist.github.com/TakeoffAndroid/3677f46504c797b4b6457d4787186937 %}

**What is State?**

State is nothing but a triggering method which is used to refresh or update values in the Component. Each time when ‘ **_setState_** ’ is called, the **render()** function in a **Component** will be called simultaneously.

**Code usage:**

{% gist https://gist.github.com/TakeoffAndroid/359d8575c5f9e0f965bc92ac1c4293d8 %}

The above code snippet creates the Button component with the initial text as “ **Failure** ”, and the text is replaced to “ **Success** ” using ‘ **_setState_** ’ function when the button is clicked or pressed.
I'm learning all about Erlang this weekend. I'm feeling pretty lost but I'm having fun.‬
Published: 2017-11-04 15:57:49

---
title: ‪I'm learning all about Erlang this weekend. I'm feeling pretty lost but I'm having fun.‬
published: true
description: 
tags: 
---

I went to make this a tweet but then I thought I'd share here instead. The site's not perfectly built for this use case yet, but I think it could fit.
Emacs
Tags: emacs, github, notes
Published: 2017-11-04 14:00:52

---
title: Emacs
published: published
description: Emacs 
tags: Emacs, Github, Notes
---


<center><h2><b>EMACS NOTES</b></h2></center>
<center><h4>https://psnc.github.io/emacs</h4></center>
-----

    1. EMACS LINKS
        1.1. EMACS
            1.1.1. EMACS INSTALLATION
            1.1.2. EMACS PACKAGE
            1.1.3. EMACS THEMES
            1.1.4. EMACS CHANNELS
            1.1.5. EMACS DOCUMENTATION
            1.1.6. EMACS WEBSITES
        1.2. EMACS ORG-MOD
            1.2.1. SYNTAX
            1.2.2. OUTPUT THEMES
            1.2.3. ORG THEMES
            1.2.4. BASH SCRIPTS
            1.2.5. EMACS ORG-MOD CAPTURE
            1.2.6. EDIT WITH EMACS
        1.3. EMACS PACKAGES

-----
<center><h5>[Emacs Github](https://psnc.github.io/emacs) | [Emacs PDF](https://drive.google.com/file/d/0B8GiSKdtgDuMb3c1NzN1a2d3QXM/view) | [Emacs Pictures](https://photos.app.goo.gl/WZw8oGFEN865zgPL2)</h5></center>
-----
Preparing the development environment for Go in late 2017
Tags: goland, gvm, direnv, go
Published: 2017-11-16 00:21:35

---
title: "Preparing the development environment for Go in late 2017"
published: true
tags: goland,gvm,direnv,go
canonical_url: 
---

# Introduction

- gvm
- direnv
- Go
- GoLand

## gvm

[moovweb/gvm](https://github.com/moovweb/gvm)

gvm is most popular Go Version Manager as far as I know.
It’s able to switch version of Go in easily.

Install:

```
% bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
% vi ~/.zshenv
[[-s ~/.gvm/scripts/gvm]] && . ~/.gvm/scripts/gvm
```

## direnv

[direnv/direnv](https://github.com/direnv/direnv)

direnv has good compatibility with Go, that can switch GOPATH without care.

Install:

```
% brew install direnv
% vi ~/.zshenv
[[-f /usr/local/bin/direnv]] && \
  eval “$(direnv hook zsh)”
% vi ~/.direnvrc
use_go(){
 . $GVM_ROOT/scripts/gvm-default
 gvm use $1
}
```

## Go1.9.2

Installing latest Go as binary.

```
% gvm install go1.9.2 -B
```

## GoLand

[GoLand: Capable and Ergonomic Go IDE by JetBrains](https://www.jetbrains.com/go/)

GoLand is IDE developed by JetBrains.
It’ll be able to use without tedious settings. (I like also vim-go, but I use this recently, It’s easy)

# Getting Started

```
% mkdir awesome-project
% cd awesome-project
% direnv edit
use go go1.9.2
layout go
```

Ready to be done!
How do "public but secret" URLs work
Tags: discuss
Published: 2017-11-04 02:43:10

---
title: How do "public but secret" URLs work
published: true
tags: discuss
---

Draft posts here have the warning 

> Unpublished Post. This URL is public but secret, so share at your own discretion. Click to edit.

Quick questions:

1. How private are they **if I do not share the url**?
2. How could I implement my own public but private pages?

I'm not questioning dev.to's security or anything like that, not important. Just, say a client comes to me and says "hey Aurel we want that feature", I wouldn't have a clue where to start. 

And, could I create such a feature in github pages for example, or is this a host/server configuration thing? Long a go I wanted to be able to host jekyll in github pages but as a private diary. Would this technique have worked?
Pixel and point
Tags: pixel, point, swift, ios
Published: 2017-08-08 09:25:00

---
title: Pixel and point
published: true
description: 
tags: pixel, point, swift, ios
---

TL;DR: Don't use `nativeScale` and `nativeBounds`, unless you're doing some very low level stuff

### What is point and pixel
From https://developer.apple.com/library/content/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GraphicsDrawingOverview/GraphicsDrawingOverview.html
> In iOS there is a distinction between the coordinates you specify in your drawing code and the pixels of the underlying device

> The purpose of using points (and the logical coordinate system) is to provide a consistent size of output that is device independent. For most purposes, the actual size of a point is irrelevant. The goal of points is to provide a relatively consistent scale that you can use in your code to specify the size and position of views and rendered content

> On a standard-resolution screen, the scale factor is typically 1.0. On a high-resolution screen, the scale factor is typically 2.0

### How about `scale` and `nativeScale`

From https://developer.apple.com/documentation/uikit/uiscreen

- var bounds: CGRect: The bounding rectangle of the screen, measured in **points**.
- var nativeBounds: CGRect: The bounding rectangle of the physical screen, measured in **pixels**.
- var scale: CGFloat: The natural scale factor associated with the **screen**.
- var nativeScale: CGFloat: The native scale factor for the **physical screen**.

### The scale factor and display mode

See this for a whole list of devices and their scale factors https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions

The iPhone 6 and 6+ introduced **display mode** https://www.cnet.com/how-to/explaining-display-zoom-on-iphone-6-and-6-plus/

You can see that currently the iPhone 6+, 6s+, 7+ phones have scale factor of 2.88 in zoomed mode, and 2.6 in standard mode

You can also see that in zoomed mode, iPhone 6 has the same **logical size** as the iPhone 5

### Simulator vs device

This is to show you the differences in `nativeScale` in simulators and devices in **zoomed mode**, hence differences in `nativeBounds`.

iPhone 6+ simulator

```swift
(lldb) po UIScreen.main.scale
3.0

(lldb) po UIScreen.main.bounds
▿ (0.0, 0.0, 414.0, 736.0)
  ▿ origin : (0.0, 0.0)
    - x : 0.0
    - y : 0.0
  ▿ size : (414.0, 736.0)
    - width : 414.0
    - height : 736.0

(lldb) po UIScreen.main.nativeScale
3.0

(lldb) po UIScreen.main.nativeBounds
▿ (0.0, 0.0, 1242.0, 2208.0)
  ▿ origin : (0.0, 0.0)
    - x : 0.0
    - y : 0.0
  ▿ size : (1242.0, 2208.0)
    - width : 1242.0
    - height : 2208.0
```

iPhone 6+ device

```swift
(lldb) po UIScreen.main.scale
3.0

(lldb) po UIScreen.main.bounds
▿ (0.0, 0.0, 375.0, 667.0)
  ▿ origin : (0.0, 0.0)
    - x : 0.0
    - y : 0.0
  ▿ size : (375.0, 667.0)
    - width : 375.0
    - height : 667.0

(lldb) po UIScreen.main.nativeScale
2.88

(lldb) po UIScreen.main.nativeBounds
▿ (0.0, 0.0, 1080.0, 1920.0)
  ▿ origin : (0.0, 0.0)
    - x : 0.0
    - y : 0.0
  ▿ size : (1080.0, 1920.0)
    - width : 1080.0
    - height : 1920.0
```
Recognizing a trend vs. a lasting truth
Tags: discuss, career, beginners, javascript
Published: 2017-11-03 20:21:52

---
title: Recognizing a trend vs. a lasting truth
published: true
description: The decisions I made early in my career charted my success. This was through no fault of my own. It was luck. How does a developer keep from chasing every shiny coin?
tags: #discuss #career #beginners #javascript
---

I had the fortune (or misfortune) to have been doused in JavaScript at a very early part of my career. No matter how many "better" platforms or technologies came along, JavaScript always seemed to worm its way back into my life. In '96-'01, it was simple demand that formed my skills. Now with Node, Angular, React etc, the punishment of those early years has paid off. JavaScript has become a lasting truth. For good or ill, JavaScript won't be going away. It will live on. 

There are other languages that I learned during that time too, though. Stuff like Perl, ActionScript, VBScript and others. I guess you can still use some of them, but they have fallen out of favor. I would give away a puppy to have the brain-space and time that those took from me. 

My question; do you have a crystal ball? How can you tell what you should be investing your time to learn? Have you only been lucky?
Debugging Elasticsearch Queries in Java: how to convert queries to JSON
Tags: elasticsearch, java
Published: 2018-10-13 16:22:41

---
title: Debugging Elasticsearch Queries in Java: how to convert queries to JSON
published: true
tags: elasticsearch, java
canonical_url: https://committed.software/posts/elasticsearch-json/elasticsearch-json/
---

[![Code Data Programming Code Computer Programming cc zero](https://committed.software/static/Code-Data-Programming-Code-Computer-Programming-cc-zero-83e60fb3a72b66edc7930573fd279778-f3a32.jpg)](/static/Code-Data-Programming-Code-Computer-Programming-cc-zero-83e60fb3a72b66edc7930573fd279778-a09d4.jpg)

Elasticsearch has excellent documentation with detailed descriptions and plenty of examples. The [Elasticsearch Java API](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-query-dsl.html) has handy builder classes accessible from `org.elasticsearch.index.query.QueryBuilders` to craft queries and aggregations in an intuitive and fluent way that is idiomatic to Java.

Unintuitively, however, `QueryBuilder` and `AggregationBuilder` subclasses do not implement `toString`, making it harder to debug and analyze these Java calls than you would expect, as it is not always clear how they compare to the Elasticsearch-native JSON format used extensively in Elasticsearch’s documentation. This issue is compounded further when the construction of queries is out of your control!

One way we could view our queries in JSON format is to enable elasticseach’s [Slow Log](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-slowlog.html), but there is a simpler way, using the Java Elasticsearch API to achieve what we want:

```
import java.io.IOException;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.json.JsonXContent;

...

public static void toJSON(ToXContent queryBuilder) {
  try {
    XContentBuilder builder =
        queryBuilder.toXContent(JsonXContent.contentBuilder(), ToXContent.EMPTY_PARAMS);
    log.info(builder.string());
  } catch (IOException e) {
    log.error("Failed to log elasticsearch query", e);
  }
}

...
```

This can be used for classes implementing either `QueryBuilder` or `AggregationBuilder`, as both of these extend the `ToXContent` interface.

We can use the same approach when using Spring Data Elasticsearch by calling `NativeSearchQueryBuilder.getQuery()`, `NativeSearchQueryBuilder.getFilter()` or `NativeSearchQueryBuilder.getAggregations()` and passing the resulting objects using the same approach.

Now we can see the exact query that will be sent to Elasticsearch:

`{ "term" : { "user" : "Kimchy" } }`

If you are using [Kibana](https://www.elastic.co/products/kibana) to view your indices, try copying & pasting your query across on the Discover page for further analysis.
Linear Search with c#
Tags: c, linearsearch
Published: 2017-11-03 16:13:35

---
title: Linear Search with c#
published: true
description: 
tags: c#, linear search, 
---
```c#
 class Program
    {

        static void Main(string[] args)
        {
            linearIndex(0);
            Console.ReadLine();
        }

        public static int linearIndex(int searchNumber)
        {
           
            int index = 0;
            int[] intArray = { 
        47,56,38,5,40,17,26,58,56,25,10,14,38,10,36,15,36,53,55,33,10,48,6,45,
                
       38,10,49,47,53,10,52,45,32,46,55,19,55,53,11,39,36,25,26,41,15,1,43,
       40,13,53,39,11,53,33,5,21,36,53,15,36};

         l1:   if (searchNumber == intArray[index])
            {
                Console.WriteLine("found at! : {0}", index);
                return index;
            }

            index ++;
            if (index < intArray.Length)
            {
                goto l1;
            }
            else
            {
                Console.WriteLine("Not found at any Index");
            }
           
            return 0;
        }
    
    }

```

The console app started from the main method and I passed in an int 0 to check against the arrayList,

Well, there is a comparison and as long as the index of the array is less than the array length, then we are good to continue the search.

If the option is maxed out then that means we didn't get to see the number.
Rules of engagement in an open source issue board
Tags: opensource, productivity
Published: 2017-11-03 16:01:09

---
title: Rules of engagement in an open source issue board
published: true
tags: opensource, productivity
canonical_url: 
---

An open source project’s issue board is where many interesting discussions and ideas can emerge. If handled improperly, it can be a hostile and inaccessible space. To ensure that a project’s issue board is a space for productive and mutual discussion, it helps to put in place some guidelines in place to ensure that the discussion is productive.

**Crack down on trashing other projects**

It’s likely that if someone is interacting with the project in your issue board, they are probably pretty passionate about what the project is doing. Although passion can produce a positive energy towards the project, it can also create a negative energy towards “competing” projects.

**Focus on the problem, not the tools**

When resolving a problem, criticizing the tools is (most times) a red herring for the real problem. In this case, tools are things like linters, packagers, bundlers, and so on that help aid in the development process. Unless absolutely necessary, steer the conversation away from talking about tools to the problem at hand.

**Limit drive-by opinions**

Some issues reach a certain degree of virality and can gain traffic from folks that might not totally be invested in the project. This leads to a lot of drive-by opinions. Drive-by opinions are usually not related to the specific topic being discussed and are written to reinforce an opinion rather than an idea. Things like “Don’t use tool X because it’s slow” or “Don’t do this or I won’t use this tool” are examples of drive-by opinions.

**Links are your best friend**

It’s easy to assume that the people that you are engaging with have the same knowledge that you do. There’s nothing inherently bad about it. Assumptions make it easier to write down complex ideas but it’s important to go back and add the appropriate context before submitting anything as an issue. Links make it really easy to add context to a piece of text. You can add links to references to previous issues, technical terminology that other people not understand, and informational blog posts. These links help balance out the context so that those reading comments you write have a better understand of your intention and meaning.

**Emojis are also your best friend**

Communicating on the Internet can be difficult. A picture is worth a thousand words and that’s why emojis exist. Emojis (and GIFs for that matter) help add a layer of emotion. Sarcasm, humor, sadness, and disappointment are all feelings that are complex to express with just words.

And that’s it! The focus for a successful discussion on a project’s issue board is all about making sure that everyone is well-informed from an intellectual and emotional perspective. If everyone has a pretty good idea of what everyone is thinking and feeling, it’s a little more likely that your project’s issue board will be a happy place to be.