teleren/devto huggingface dataset:
How to get started with Machine Learning?
Tags: discuss, ask, machinelearning, python
Published: 2017-11-22 09:06:16

---
title: How to get started with Machine Learning?
published: true
description: 
tags: discuss, ask, ML, python
---
I want to get started with Machine Learning with Python. I've learned python. What's the next step now? I prefer books over MOOCs but I can do MOOCs too.
Using GvrEditorEmulator Prefab From GoogleVR Package and Not Sinking the Camera Downward Until the Parent Center On Unity Editor
Tags: unity3d, vr, googlevr
Published: 2017-11-22 09:04:06

---
title: Using GvrEditorEmulator Prefab From GoogleVR Package and Not Sinking the Camera Downward Until the Parent Center On Unity Editor
published: true
description: 
tags: #unity #vr #googlevr
---

If you are making a game targetting **Cardboard** or **Daydream** platform. You might need to dump the **GvrEditorEmulator prefab** came with **GoogleVR package** into the scene and **pair a camera** with it. 


---
Let's say this is how you setup your scene :


1. You have to **child the camera within** a GameObject parent.
2. The parent have a shape.
3. The **camera** should be at the "head" of the parent which **deviates away from the center of the parent**.
4. You have GvrEditorEmulator paired with that camera and enabled.

---

The good thing is that you can pan around to view 360 degrees by tapping `Alt + mouse moving around`.

However, it appears that the **camera is sinking downward**.

The GvrEditorEmulator script will always try to **default the local position (position relative to the parent) of the camera to Vector3.Zero** which is (0, 0, 0).

---
To prevent that :

```csharp
// line 90
m_camera.transform.localPosition = neck;

// line 103
m_camera.transform.localPosition = Vector3.Zero;
```

Open up GvrEditorEmulator script with your favourite IDE and **comment out the lines at 90 and 103.**

That should prevent the camera from sinking downward from the intended y position.
Steps to Quickly Analyze App Crash Report in Xcode
Tags: appcrashreport, mobileappcrashreport, mobileappdeveloper, appdeveloper
Published: 2017-11-22 07:00:54

---
title: Steps to Quickly Analyze App Crash Report in Xcode
published: Yes
description: Process after analyzing various user crash logs, through which you can analyze your app crash report and ask your developer to take care of those issues.
tags: App Crash Report, Mobile App crash report, mobile app developer, App Developer
---
Use your database! 
Tags: database, relational, kotlin
Published: 2017-11-22 00:00:00

---
title: Use your database!
published: true
date: 2017-11-22
description: 
tags: database, relational, kotlin
---

If you are using a database, the chances of using a relational one a pretty high. I have been using relational databases for a long time, but never really used all the features these databases offer simply because I saw them only as a repository to hold my data and also because I thought an ORM would solve all my problems.

Let's take as an example an entity with two date fields:

```kotlin
import java.time.LocalDateTime
import javax.persistence.Entity
import javax.persistence.Column

@Entity
data class MyEntity(
    // other fields
) {
    @Column(name = "created_at", updatable = false)
    val createdAt: LocalDateTime = LocalDateTime.now()

    @Column(name = "updated_at")
    var updatedAt: LocalDateTime = LocalDateTime.now()
}
```

When we instantiate an object of that class, the two date fields will have the current date and time, but we still need to update the `updatedAt` field manually every time we made a change to the object:

```kotlin
val myInstance = MyEntity(/* fields */)
myInstance.updateAt = LocalDateTime.now()
```

While this approach works, it is error prone since we have to update the `updatedAt`field wherever we make a change to its object. We could isolate the logic to change the entites into a single service class, but we can do better.

Why not let the database do the work for us?

First, let's make some changes to our entity:

```kotlin
import java.time.LocalDateTime
import javax.persistence.Entity
import javax.persistence.Column

@Entity
data class MyEntity(
    // other fields
) {
    @Column(name = "created_at", insertable = false, updatable = false)
    val createdAt: LocalDateTime = LocalDateTime.MIN

    @Column(name = "updated_at", insertable = false, updatable = false)
    var updatedAt: LocalDateTime = LocalDateTime.MIN
}
```

The two date fields cannot be inserted nor updated, but it is OK, since the database will do this for us, we just have to define its schema as follows:

```sql
CREATE TABLE my_table(
    -- other columns
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE FUNCTION my_table_updated() RETURNS trigger AS $$
BEGIN
    NEW.updated_at := CURRENT_TIMESTAMP;
    RETURN NEW;
END;
$$ LANGUAGE plpgsql;

CREATE TRIGGER my_table_updated BEFORE UPDATE ON my_table
    FOR EACH ROW EXECUTE my_table_updated();
```

A trigger was used to update the `updated_at` column every time a row in updated. This way, we have to do nothing in the code to get the behavior we want and we also do not have to worry if other applications need make changes to the data since the rules were define at the database level.

Next post I will show a more complex example.
Rewrite Teensy with Docker
Tags: docker, teensy
Published: 2017-11-21 23:43:48

---
title: Rewrite Teensy with Docker
published: true
description: Using dockerized Teensy Loader CLI makes it easier to rewrite programs to Teensy.
tags: docker, teensy
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/yl75csp6bpge2y34oo56.png
---

Using dockerized [Teensy Loader CLI](https://www.pjrc.com/teensy/loader_cli.html) makes it easier to rewrite programs to Teensy.
[qmk/qmk_firmware](https://github.com/qmk/qmk_firmware) is already dockerized. By using [minodisk/teensy_loader](https://hub.docker.com/r/minodisk/teensy_loader/) together, all processes such as building `.hex`, loading it into Teensy, and rebooting Teensy can be completed with Docker.

## Motivation

I do not want to install various things on my local machine.

## Premise

- [qmk/qmk_firmware](https://github.com/qmk/qmk_firmware) has been pulled
- Docker is already installed in your local machine
- In Linux (Docker for Mac or Win might be difficult or not be able to mount USB)

## Demo

[![asciicast](https://asciinema.org/a/148756.png)](https://asciinema.org/a/148756)

## How to use

### Step 1. Prepare YAML for Docker Compose

Add `qmk_firmware/docker-compose.yml`:

```yaml
version: '2'
services:
  qmk_firmware:
    build: .
    environment:
      keyboard: ergodox_ez
      subproject:
      keymap: <Your Keymap Name>
    volumes:
      - .:/qmk
      - /qmk/.build
  teensy_loader:
    image: minodisk/teensy_loader:0.0.1
    depends_on:
      - qmk_firmware
    privileged: true
    environment:
      hex: ergodox_ez_<Your Keymap Name>
    volumes:
      - /dev/bus/usb:/dev/bus/usb
    volumes_from:
      - qmk_firmware
```

### Step 2. Build and up

```sh
docker-compose build
docker-compose up
```

### Step 3. Press reset button

When the terminal outputs `Waiting for Teensy device...`, press the reset button on Teensy.

## How to work

0. In `teensy_loader` container, waits for the `.hex` to be generated on the volume shared with the `qmk_firmaware` container
1. In `qmk_firmware` container, builds `.hex`
2. In `teensy_loader` container, finds `.hex` on the volume shared with the `qmk_firmware` container and runs `teensy_loader_cli` with wait option
3. In real world, you press reset button on Teensy (if it maps to a key, press that key)
4. In `teensy_loader` container, `teensy_loader_cli` writes `.hex` to Teensy and reboots it
How to Update Pomera DM100 Firmware
Published: 2019-07-16 11:41:19

---
title: How to Update Pomera DM100 Firmware
published: true
tags: 
canonical_url: https://fahrinh.github.io/post/2017-11-22-how-to-update-pomera-dm100-firmware/
---

Pomera DM100 is a distraction-free digital writing tool. Think mini laptop with only text editor application loaded.

It comes from Japan. It means its manual is in all Japanese. It becomes hard when you want to do the crucial procedure (like **upgrading firmware** ) **AND** Google Translate doesn’t help you much.

I can only follow some steps in [its updating guide web page](https://translate.google.co.id/translate?hl=en&sl=ja&u=http://www.kingjim.co.jp/support/pomera/software/dm100&prev=search) and the rest of important steps in [PDF](http://www.kingjim.co.jp/resource/media/support/pomera/update_dm100.pdf) are not translatable by Google Translate.

In the end, I have successfully updated my Pomera DM100 to the latest firmware.

Here are the steps:

Read more: https://fahrinh.github.io/post/2017-11-22-how-to-update-pomera-dm100-firmware/
A different way to slice in python
Tags: python
Published: 2017-11-21 22:27:00

---
title: A different way to slice in python
published: true
description: slicing in python 
tags: python
---

A very interesting topic came up in my local community slack channel. Someone asked how to do slicing using an object. At first I wasn't sure what they were talking about and why wouldn't the following work for them.

```python 
mylist[:5]
```

After a quick search someone found [this](https://docs.python.org/3.4/library/functions.html#slice) reference in the python docs. Which was a good read but I still couldn't quite grasp why. Then it hit me. I remember C having something called macros and I was like oh hey a cool and shorten way to build a slice macro. 

So for example you could have 
```python
SL5 = slice(5)

my_new_list = my_list[SL5]
my_other_new_list = my_other_list[SL5]

```
and now we created two new lists with the first five items in my_list and my_other_list. I still haven't found all the ways that this could be useful but I was pretty happy with how I was able to see a new concept and within a few minutes find a good use for it. 

PS. sorry for the rough post. This is my first real post on here besides my intro. Content creation is still my weak spot.
Open Source, PHP and Visual Studio Code
Tags: visualstudiocode, opensource, php
Published: 2017-11-21 20:14:04

---
title: "Open Source, PHP and Visual Studio Code"
published: true
tags: Visual Studio Code,Open Source,OSS,PHP
canonical_url: http://petetasker.com/open-source-and-visual-studio-code/
---

![VS Code](https://thepracticaldev.s3.amazonaws.com/i/49ihnx9qqbx6chh225d8.png)

Lately, [VS Code](https://code.visualstudio.com/) has been getting a lot of hype in the dev community. It's been around since for a few years and TBH is a really sweet editor. Lots of great extensions and community support. It's also quite fast (for an Electron app 😬) and the peeps and Microsoft seem to be keeping it up to date and iterating quickly.

However, anything you _really need_ to work with PHP is missing by default. I believe this is by design to encourage a vibrant extensions community. Luckily, like most languages, there's a vibrant open source PHP extension community. There's a few great extensions for PHP: [PHP IntelliSense](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense), [PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) (both by the [same developer](https://github.com/felixfbecker)) as well as [PHP Intelliphense](https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client) (#wat?). There's even a really great intro by [Jeffrey Way on Laracasts](https://laracasts.com/series/visual-studio-code-for-php-developers) outlining everything you need to do to get VS Code set up for PHP dev.

Some of the PHP packages work fine and have over a million installs (!!!). Sometimes, however, they _don't_ work. Like, at all. Just today, the PHP Debug extension completely broke. Luckily the developer was paying attention and rolled out a fix within hours. Pretty awesome support for an open-source product!

However, if you paid for the editor, say something like PHPStorm, you could go and raise an issue on their support channel. You could complain about the product not working, rightly so, as you've paid for the right! As a 'customer' you have a certain amount of clout with a vendor like Jetbrains. This is _NOT_ the case with open source, and I feel that we developers forget this.

This is where I take issue. I'm all for open source software. I've built my career on it. The issue is that the developer for this plugin had to fix the issue himself. There's an expectation there that he _HAS_ to fix the issue, and do it RIGHT NOW. And if it's not done immediately people freak out, complain on Twitter, write a blog post about, have a cow 🐮, man.

Open source is just that, open. If you find an issue with a plugin, editor, extension or WHATEVER, see if you can fix it! That's the whole point. Let's not throw our hands up and complain, let's get our hands dirty and fix the damn thing.

That's what open source is all about. Let's remember that.

/rant
Blackfriday, Cybermonday and ThanksGiving to Dev.to Community. 
Tags: offers
Published: 2017-11-21 19:23:42

---
title: Blackfriday, Cybermonday and ThanksGiving to Dev.to Community. 
published: True
description: Cloudways Black Friday Deals
tags: offers
---
Dev.to is one of my favorite community of developers. Therefore on this year's Thanksgiving, I would like to thank you all for being such a great help at every step of development.

![Black friday](http://www.cloudways.com/blog/wp-content/uploads/Blog-gif.gif)

This is the Thanksgiving week. There is the Black Friday, then the Cyber Monday, then the Small Business Saturday, and there is a Sunday in between as well, So To enhance the joy of this week I would like to share 99+ Handpicked Black Friday Deals For WordPress, Magento, Laravel, Web Hosting & Web Dev Tools 

Also We at Cloudways are Giving $150 Credit on promo code: BF150. 

For [more details](http://www.cloudways.com/blog/wp-content/uploads/Blog-gif.gif).
Talking to Rocket.Chat with Python
Tags: python, chat
Published: 2017-11-21 18:29:48

---
title: Talking to Rocket.Chat with Python
published: true
description: A small description on how to connect to a Rocket.Chat instance and talk to people on Python
tags: Python, Chat
---

I meet [Rocket.Chat](https://rocket.chat/) about a year ago and in my opinion it is one of the best team oriented chat software I've ever tried. It has a clean and beautiful interface, supports Markdown and emojis. It's awesome to share code and let's you pin important messages on your channels. It is an open alternative to software like Slack or Mattermost and you can perfectly run it on your own infrastructure. I fell in love on how easily I could deploy it and started to play with it and to hang around [demo.rocket.chat](https://demo.rocket.chat) where I received great support. Since I'm a developer and I'm interested on automating things, I wanted to make bots to make life easier to my friends, and I started to dig searching for a good Rocket.Chat API wrapper for Python or a bot API like Telegram's but failed. 
Turns out that there was no mechanism to make a bot but using the internal Hubot and API wrappers were old, lack of coverage or were complex to develop in, so I decided to start writing my own and use it to write a bot.
So this is the result: [https://github.com/jadolg/rocketchat_API](https://github.com/jadolg/rocketchat_API). It's nothing fancy, believe me. It just took time to read the wonderful [documentation](https://docs.rocket.chat/developer-guides/rest-api) about the REST API and wrap it the must lazy way I could so I didn't have to review the docs every 5 minutes.
Want to give it a try?
Lets start installing from pypi `pip3 install rocketchat_API` and after creating an account on the [demo](https://rocket.chat/) instance let's try to connect and write a message on the **#general** room.
```python
from rocketchat_API.rocketchat import RocketChat

rocket = RocketChat('user', 'pass', server_url='https://demo.rocket.chat')
rocket.chat_post_message('good news everyone!', channel='GENERAL')
```
Awesome right? And since it's built on top of the [requests](http://docs.python-requests.org) library, every call to the API will return a requests Response object and has included proxy support.
Do you want to see the list of channels? It's as simple as this:
```python
from pprint import pprint

pprint(rocket.channels_list().json())
```
Every method has the same documentation string as in the official Rocket.Chat API documentation and it's called similar so you can actually use the official docs while working with the library transparently.
And that's all folks. I hope it's of good use for you and if you are interested in cuntributing, please, send me pull requests, issues, stars :-)
The difference between junior developers and advanced junior developers
Tags: beginners
Published: 2017-11-21 18:12:42

---
title: The difference between junior developers and advanced junior developers
published: true
description: 
tags: #beginner
---
What I've discovered is that when you are starting in web development, you feel overwhelmed by all those frameworks and libraries that should somehow help you, but it seems that is just to much to learn, and if you learn any it makes no sense, and that all that stuff are for someone far more experienced. And in reality, it is. Well, when you are just starting out you shouldn't be paying to much attention to these fancy things, sure you can be updated what are the most used, or most popular, but to actually use them, for you at this point also makes no sense, right?.

Let's put it this way, how can you be driving a car if you don't know how to start it, how can you drive it if you don't know what are you driving?.

What I want to say with this post is that when you really start from zero, learning only language itself, the more you progress the more you see the point of all these libraries and frameworks, when you start to see that you need them because they make things faster, not easier, then, I think that you are on a good way to become better developer.

My advice to all that are just starting out is be patient and don't think that you are not smart enough or that this isn't for you, everything is for everyone, but depends how much you want it.

And for the title of this post: 

TL;DR

I think that main difference is that advanced junior is just more confident with it's knowledge, he doesn't think that much about basic stuff, and he opens his mind for more advanced topics, that is somewhere where I'm now, I think, that this is the point where you really start to learn.

Cheers :)
Explain MongoDB Like I'm Five
Tags: discuss, explainlikeimfive, webdev, devops
Published: 2017-11-21 18:03:56

---
title: Explain MongoDB Like I'm Five
published: true
description: So many questions, so few answers..
tags: discuss, explainlikeimfive, webdev, devops
---

I'm really interested in MongoDB because I've heard that it stores objects in a way that I can't really remember the pitch. But as someone who has so far only used MySQL, I'm left with so many questions?

Does it still have keys? Does it use SQL? Are there web viewers (similar to [phpMyAdmin](https://www.phpmyadmin.net/)?

I'm just really lost and want to expand my database knowledge.
If you're a front-end developer, you should be following Sarah Chima.
Tags: webdev, react, youshouldfollow, javascript
Published: 2017-11-21 16:32:24

---
title: If you're a front-end developer, you should be following Sarah Chima.
published: true
description: If you do front-end web development or want to casually keep up with some of these topics, I'd highly recommend following Sarah.
tags: webdev, react, youshouldfollow, javascript
---

Since her first post just over a month ago, Sarah has been one of the most active [dev.to](/) publishers. Her work covers mostly React and SASS so far and I'm finding it to be clear and useful to developers of a range of skillsets.

If you do front-end web development or want to casually keep up with some of these topics, I'd highly recommend following Sarah on [dev.to](/).

{% user sarah_chima %}

Happy coding.
Competitive Programming – My First Experience
Published: 2022-12-10 20:02:56

---
title: Competitive Programming – My First Experience
published: true
date: 2017-11-21 16:00:00 UTC
tags: 
canonical_url: https://blog.afrieirham.com/competitive-programming-my-first-experience
---

For the last two Wednesday, I have participated in Programming League Competition hosted by [Persatuan Komputer Universiti Malaya (PEKOM)](https://www.instagram.com/pekomum/) . It was my first experience ever to compete in an online programming competition.

The competition is divided into 2 categories namely Open Category (All FCSIT UM student) and Closed Category (Only first-year student of FCSIT).

Obviously, I choose to join the closed category because there is less competition for me, and it is less challenging.

To qualify for the final round which will be held on 24th November 2017, this Friday, we are required to go through 2 selection round which was held online on 8th and 15th of November.

On each round, we are given 2 question to solve and submit it to [Virtual Judge](https://vjudge.net) and hopefully the answer is right.

I didn't manage to solve any of the problems given, sadly, hahaha. But I do think I solved some part of it.

I don't fully understand how this "Virtual Judge" thing is working, maybe I submitted in the wrong format or stuff like that. I don't know whether it is a robot that "judge" my codes or real people doing it.

All and all, it was an experience for me. I was getting exposed to on how online programming competition was held, knowing that virtual judge is a thing, some ideas on what kind of problems does this competition have and etc.

Bottom line, you gonna suck on the first try in anything, I expect to fail, I expect to be mindblown. But I do enjoy it, I was having fun.

Looking forward to the next programming competition in the future. If you know one, tag me. 😁😁

Btw, if you want to have a look at the question and my codes, you can go to [this](https://github.com/afrieirham/Programming-League-November-2017) GitHub repo.
A little rant on naming things
Tags: cleancode
Published: 2017-11-21 15:56:59

---
title: A little rant on naming things
published: true
description: 
tags: cleancode
---

Oh, how I'd love to forbid usage of `info`, `data`, and `context` in variable and class names. Looks like everybody is using it without understanding what they really means. Who's able to tell the difference between `accountData`, `accountInfo` and just `account`? Especially if they're in the same method. Or maybe what the hell is 'fieldContext' if that's the property of the field, and not something defining environment, where the field is used (or evaluated). Or maybe difference between three classes all named `SearchContext`, with nothing in common. And yes, they're all used in the same project and sometimes even in the same packages.

One other thing I like so much about naming: it is `handle` or `process` in the method names. Especially when this method is several hundred lines long. For me it is just like the giant sign above the method: "I don't know the hell what this method does or should do. Sincerely yours. Author."

Sorry, I think I need to go try some Vulcan meditation techniques now.
Begginnig Common Lisp for web scraping
Tags: lisp, scraping
Published: 2017-11-21 14:00:44

---
title: Begginnig Common Lisp for web scraping
published: true
description: 
tags: lisp, scraping
---

hey nerds, do you like web? interest lisp?
no?
i dont care
okay i do


Step1: install sbcl
$ brew update
$ brew install sbcl
(now, clisp is stopped update)


Step2: install quick lisp
$ curl -O http://beta.quicklisp.org/quicklisp.lisp
$ sbcl --load quicklisp.lisp

-----↓↓↓starting sbcl console↓↓↓-----

(quicklisp-quickstart:install)
(ql:add-to-init-file)

Step3: install libraries to sbcl by quicklisp
(ql:quickload :drakma)
(ql:quickload :plump)
(ql:quickload :clss)


Step4: drink a coffee


Step5: write codes and eval
(defvar *html* (drakma:http-request "http://www.paulgraham.com/hp.html"))
(defvar *parse-html* (plump:parse *html*))
(plump:text (car (coerce (clss:select "title" *parse-html*) 'list)))