teleren/devto huggingface dataset:
The way I installed Ruby on my mac
Tags: ruby, mac, beginners
Published: 2018-01-08 08:14:03

---
title: The way I installed Ruby on my mac
published: true
description: Instruction for ruby beginners.
tags: ruby, mac, beginners
---

# Prerequisite
Please install [Homebrew(official)](https://docs.brew.sh/) on your mac.

# Install rbenv and ruby-build
At first, I recommend you to install [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build). They enables you to control Ruby versions flexibly.

```
brew install rbenv ruby-build
```

Although I heard that this way tends to yield(don't catch up with the newest version of ruby), it is simple.

# Initialize rbenv
Just execute below
```
rbenv init
```
This command will add `eval "$(rbenv init -)"` to your `~/.bash_profile`.
Please check it like this
```
less ~/.bash_profile
```
If you can't find out the line `export PATH="$HOME/.rbenv/bin:$PATH"` and `eval "$(rbenv init -)"`, please add it by yourself.
```
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
```
After that, restart your terminal or reload your `.bash_profile` with this command.
```
source ~/.bash_profile
```
And you can check you could install `rbenv` or not by this command
```
rbenv -v
```
This command will return the version of `rbenv`
# Choose the ruby version and install it.
OK, now we can get the list of the versions of Ruby with below. 
```
rbenv install -l
```

This time, I assume that we chose `2.5.0` as the target.
```
rbenv install 2.5.0
```
Many commands will be executed.
After they are finished, try this.
```
rbenv versions
```
and you can get like this
```
* system
  2.5.0
```
This indicates you have `Ruby 2.5.0` but you are using the pre-installed Ruby.
So, let's change to the target ruby with below
```
rbenv global 2.5.0
```

# Check your rbenv
For now, your mac is ready to use the `Ruby 2.5.0`, but I recommend you to check the status of your `rbenv`.
```
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
```
This will indicate the install status of rbenv.
The “let” keyword in swift
Tags: ios, swift
Published: 2018-01-08 08:12:05

---
title: The “let” keyword in swift
published: true
description: Introduction to constants in swift
tags: ios, swift
---
In swift, we use the `let` keyword to declare a constant variable, a constant is a variable that once declared, the value can not be changed.

### Declaring constants

We can declare a variable in swift like below:

```
let myAge: Int = 27
```

Notice the `let` keyword above, we use it to denote that `myAge` is a constant and should hold the integer `27`. Unlike variable declared using the `var` keyword, we cannot change the value of a constant once it has been assigned.

A constant is very similar to a variable except it value cannot be changed when declared.

### Summary

It’s important that you keep the following in mind. You can declare a constant with the `let` keyword, constant have the same properties as a variable (var) which include type annotation, naming convention etc., except once a value has been assigned, the value cannot be changed
The “var” keyword in swift
Tags: ios, swift, beginners, iosdevelopment
Published: 2018-01-08 07:39:14

---
title: The “var” keyword in swift
published: true
description: introduction to swift variables
tags: ios, swift, beginner, IOS development
---

In swift, we use the `var` keyword to declare a variable. Swift uses variables to store and refer to values by identifying their name. Variables must be declared before they are used.

### Declaring variables

We can declare a variable in swift like below:

```
var friendlyWelcome = "Hello"
```

Notice the `var` keyword above, we use it to denote that `FriendlyWelcome` is a variable and should hold the content `"Hello"`. We can change the value of a variable by simple changing the content

```
var friendlyWelcome = "Hello"

friendlyWelcome = "Ututu Oma"

// friendlyWelcome is now "Ututu Oma"
```

We should not use the `var` keyword again when we intend to change the value of the variable.

### Naming variables

The name of a variable can be composed of letters, digits, and the underscore character. It must begin with either a letter or an underscore. Upper and lowercase letters are distinct because Swift 4 is a case-sensitive programming language.

### Type annotation

We can provide a `type annotation`when declaring a variable, to be clear about the kind of values the variable can store. Below is the syntax

```
var variableName: <data type> = <optional initial value>
```

When we declare a variable without including the data type, swift automatically does that for us using the data type of the initial value. The data type can be an Integer, String, Boolean, Double, or Float. When we declare a variable as an String, Swift enforces us to only assign a content that matches the data type specified

```
var myName: String = "Agoi Abel"
myName = 4 //This will show an error, because the myName variable content should only be a string not an Integer (4)
```

### Summary

It’s important that you keep the following in mind. You can declare a variable with the `var` keyword, and you don't need to explicitly declare the variable's type. However, remember that every variable has a type in Swift. If Swift can't infer the type, then it complains. Every variable has a type, and that type cannot be changed.

_I am happy to share with this article with you. If you’ve enjoyed this article, do show support by giving a few claps_ 👏_&nbsp;. Thanks for your time and make sure to follow me or drop your comment below_ 👇
Kotlin - First Impression
Tags: kotlin, android, programming, tips
Published: 2018-01-07 16:23:21

---
title: Kotlin - First Impression
published: true
description: Pragmatic language for Android
tags: kotlin, android, programming, tips
---

*Cross-post from [Trent's Dev Blog](https://trent-dev.github.io/).*

It's been 3 weeks since I started a new project written entirely in Kotlin. These 3 weeks were great. I could enjoy functional programming from my Scala experience with strict static typing I always love. All of this, without sacrificing productivity. Great Kotlin features that I keep using are :  

- [Data Class](https://kotlinlang.org/docs/reference/data-classes.html)

You can create immutable value classes with just one line of code. Java can do this too, but it's almost too verbose for Java to use it this way. It is very useful for declaring custom data types with small number of values. I mostly use it to enhance static typing of certain primitive type value sets. It is possible to include compile-time type checks for almost everything, while making code more concise and readable with less error-prone variable handling. [Destructuring Declarations](https://kotlinlang.org/docs/reference/multi-declarations.html) makes it more easy and convenient to use.

- [Extension Functions](https://kotlinlang.org/docs/reference/extensions.html)

Extension Functions really make Kotlin special compared to Java. It is almost too powerful, yet I find myself using it constantly. All the methods in Android you wish the library already had - whether it's simply starting an Activity or opening a Camera with specific parameters - are in your finger tips, such that you can customize the framework(or the language) any way you want. Be careful not to include any external state(variable) in the methods though. It might unnecessarily complicate the program(it would be similar to using a singleton to store state). If you are using Extension Functions merely for syntactic sugar, I suggest you decide the scope of the method carefully.

- Higher-order functions([`let`, `apply`, `run`, `use` etc.](https://medium.com/@tpolansk/the-difference-between-kotlins-functions-let-apply-with-run-and-else-ca51a4c696b8))

Functions like `let`, `apply`, `run`, `use` are very valuable for keeping a clear code. They help to separate procedural code into blocks of operations performed on a variable. This is very useful, because even with Extension Functions it's impractical to hide all sequential operations to a variable in a separate function. In this aspect, `apply` is very interesting, in that it is designed to couple variable assignment with custom initialization. Combined with `?` operator, those functions can also keep unnecessary null checks to a minimum. Use them generously. Just keep in mind to don't nest them too much. In fact, I never nest them. It would introduce unnecessary depth, along with possible `it` & `this` & `return` headaches.

All in all, I think Kotlin is a very satisfying language. I plan to dive more deeper into the language, and explore more techniques for writing cleaner, more manageable code. I suggest you do too. Until next time!
入門自然言語処理 p.79
Tags: nlp, python, reading
Published: 2018-01-08 02:32:43

---
title: 入門自然言語処理 p.79
published: true
description: 
tags: nlp, python, reading
---

あまりに頭に入っていない気がするので、練習問題をいくつかやってみることにする。私は手を動かして、何かを作って、理解する必要がある傾向がある。効率は悪いけれど、そういうパターンらしいのでしょうがない。

https://github.com/torufurukawa/learn-nlp

リポジトリを作ったんだけど、initial commit のプッシュがうまくいかなくて時間を使った。SourceTree を使って clone するときに https を使ったらしく、push のときに SSH の認証情報を渡してもだめだった、というオチである。何をやっているんだか。

とりあえず数行で解決する問題を、1問解いてプッシュしておいた。
Hello world)))
Tags: beginners, student, nazarbayevuniversity
Published: 2018-01-08 00:00:00

---
title: Hello world)))
published: true
description: Some information about me
tags: beginner, student, nazarbayevuniversity
date: 8/1/2018
---

Hello everyone! My name is Makhabbat (it translates as a love), and I’m Kazakh (from Kazakhstan). I’ve learned in Computer Science since this year. So I’ve decided to start writing about my little progress. Also writing posts is a good occupation for me to improve my coding and English skills. 

Барлығына сәлем! Менің атым Махаббат, және мен қазақпын. Мен Назарбаев Университете бірінші курста оқыймын. Менің болашақ мамандығым – бағдарламасшы. Әр аптада мен бір мақала жазармын. Менің ойымша, осы жұмысы бағдарлама жазуды және ағылшын тілін оқуды жақсартады. 

Всем привет! Меня зовут Махаббат (мое имя переводится как любовь). Я казашка и учусь в Назарбаев Университете на программиста. Я буду писать посты здесь раз в неделю, чтобы улучшить свои знания английского языка и обучиться программированию.

Thank you for your attention! I hope we could help each other! 

I also have an email – makhabbat.duisekova@gmail.com. You can contact me to ask questions or just to talk with me)))
Steal Your Consenting Friend's Gmail Password
Published: 2021-11-19 17:27:04

---
title: Steal Your Consenting Friend's Gmail Password
published: true
date: 2018-01-08 00:00:00 UTC
tags: 
canonical_url: https://www.weckmann.me/posts/steal-your-consenting-friends-gmail-password/
---

Do you have a consenting friend who you just happen to need their password? Look no more, here is a complete set up.

### How did I do it?

If you just want the code hop over to [Glitch](https://www.weckmann.me/posts/steal-your-consenting-friends-gmail-password/%22https://glitch.com/edit/#!/google-phishing%22). Please note this code is for educational purposes only.

I started off with building the form. The form is designed to look _identical_ to a google login form.


Set the query parameter `email` equal to a users email. For example:

`google-phishing.glitch.me/?email=admin1@gmail.com`

Some Javascript handles the post request to the Node server.

Navigate to [https://google-phishing.glitch.me/get\_log](https://www.weckmann.me/posts/steal-your-consenting-friends-gmail-password/%22https://google-phishing.glitch.me/get_log%22) to see the collected passwords.

Why do people fall for this? Most of us see the Google logo and feel safe. A domain like accounts-google-sign-in-appspot-com.glitch.me/… at a glace looks official. Naturally, we want to login to access our data.

Whatever you do with this, I hold no liability.

* * *
 

[Reply via email](mailto:arpitbatra123@gmail.com?subject=Reply:%20Steal%20Your%20Consenting%20Friend)
[C language] Can you write a string encode function based on this simple decode function?
Tags: help, password, encode, decode
Published: 2018-01-07 23:44:55

---
title: "[C language] Can you write a string encode function based on this simple decode function?"
published: true
description: I got this simple C function that decodes a user password and I need the encode function too.
tags: help, password, encode, decode
---

Hi. From the documentation of CCProxy, I got this function that decodes a user password. (string with numbers to string with characters) 
I need the exact opposite as well, the code needed to encode the password. (to a 'number string'). 

To someone who knows a little C, this should be fairly trivial. If you can reproduce this function in JavaScript that would be even more terrific. That way I don't have to use a command line application child process to do this simple encoding/decoding.

Can you help me? Thanks!

```c
#include "stdafx.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define _MAX_BUF_LEN 2014

static char* PasswordDecode(char * szPassword)
{
	char szEncode[1024];
	char strDecodePass[_MAX_BUF_LEN + 1] = { "" }, strPass[_MAX_BUF_LEN + 1] = { "" };

	strcpy(strDecodePass, szPassword);

	for (unsigned int i = 0; i < strlen(strDecodePass) / 3; i++)
	{
		char szCode[_MAX_BUF_LEN + 1];
		strcpy(szCode, strDecodePass + i * 3);
		szCode[3] = 0;
		int nCode = atoi(szCode);
		nCode = 999 - nCode;
		sprintf(szEncode, "%c", nCode);
		strcat(strPass, szEncode);
	}

	strcpy(szPassword, strPass);
	return szPassword;
};
```

```c
int main(int argc, char **argv)
{
    printf(
        PasswordDecode(argv[1])
    );

    return 0;
}
```
To test if your Encode function is correct, the following plain text passwords and their encoded equivalent.

```
babble
901902901901891898


anus
902889882884


abcdefghijklmnopqrstuvwxyz1234567890
902901900899898897896895894893892891890889888887886885884883882881880879878877950949948947946945944943942951
```
Python Web Scraping
Tags: python, programming, coding, tutorial
Published: 2018-01-07 23:40:03

---
title: Python Web Scraping
published: true
description: 
tags: #Python #Programming #coding #tutorial
---

In this post, we will talk about Python web scraping and how to scrape web pages using multiple Python scraping libraries such as Beautifulsoup, Selenium, and some other magic tools like PhantomJS.

You’ll learn how to scrape static web pages, Ajax loaded content, iframes, how to handle cookies and much more stuff.

1 What is Web Scraping
2 Benefits of Web Scraping
3 How to Use Beautifulsoup
4 Your First Python Web Scraper
4.1 Handling HTTP Exceptions
4.2 Handling URL Exceptions
5 Beautifulsoup Find by Class
6 Beautifulsoup findAll Examples
7 Find nth Child Using Beautifulsoup
8 Find Tags using Regex
9 Scraping JavaScript
9.1 Chrome Web Scraper Using Selenium
10 Selenium Web Scraping
10.1 Selenium page_source
11 Get iframe Content Using Selenium
12 Get iframe Content Using Beautifulsoup
13 Handle Ajax Calls Using (Selenium+ PhantomJS)
14 Wait for Ajax Calls to Complete Using PhantomJS
15 Handling Cookies
16 Scraping VS Crawling


[Article link](https://likegeeks.com/python-web-scraping/)
Thanks in advance.
Escaping the Guilt of the Never-Ending ToDo List
Tags: discuss, productivity
Published: 2018-01-07 20:22:32

---
title: Escaping the Guilt of the Never-Ending ToDo List
published: true
description: 
tags: discuss,productivity
---

Why is it that regardless of what I accomplished yesterday (a LOT! 🎉) all I can focus on is the list of things I still need to do? For some reason, it's far easier for my brain to get trapped in the mire of "my to do list is too long and I can't keep up" rather than celebrating the progress and looking forward w/excitement. Any suggestions from those who have been here?
Improve your CSS with whitespace and comments
Tags: css
Published: 2018-01-07 19:57:15

---
title: Improve your CSS with whitespace and comments
published: true
description: If I could share two things CSS developers can do to start improving their code, it would be to create more meaningful whitespace and add comments when necessary.
tags: css
---

If I could share two things CSS developers can do to start improving their code, it would be to create more meaningful whitespace and add comments when necessary. Whitespace is a simple and effective way of documenting different parts of a CSS file. Check out the two examples below and let me know which one is easier to digest.

```scss
.o-table {
  width: 100%;
}
.o-table--fixed {
  table-layout: fixed;
}
.o-table--tiny {
  th, td {
    padding: $inuit-global-spacing-unit-tiny;
  }
}
.o-table--small {
  th, td {
    padding: $inuit-global-spacing-unit-small;
  }
}
.o-table--large {
  th, td {
    padding: $inuit-global-spacing-unit-large;
  }
}
.o-table--huge {
  th, td {
    padding: $inuit-global-spacing-unit-huge;
  }
}
```
and below, a well documented, breathable CSS file

```scss
/* ==========================================================================
   #TABLE
   ========================================================================== */

/**
 * A simple object for manipulating the structure of HTML `table`s.
 */

.o-table {
  width: 100%;
}





/* Equal-width table cells
   ========================================================================== */

/**
 * `table-layout: fixed` forces all cells within a table to occupy the same
 * width as each other. This also has performance benefits: because the browser
 * does not need to (re)calculate cell dimensions based on content it discovers,
 * the table can be rendered very quickly. Further reading:
 * https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout#Values
 */

.o-table--fixed {
  table-layout: fixed;
}





/* Size variants
   ========================================================================== */

.o-table--tiny {

  th,
  td {
    padding: $inuit-global-spacing-unit-tiny;
  }

}


.o-table--small {

  th,
  td {
    padding: $inuit-global-spacing-unit-small;
  }

}


.o-table--large {

  th,
  td {
    padding: $inuit-global-spacing-unit-large;
  }

}


.o-table--huge {

  th,
  td {
    padding: $inuit-global-spacing-unit-huge;
  }

}
```
This code example is pulled from the [inuitcss project](https://github.com/inuitcss/inuitcss).

---

This post was originally posted on my blog [here](https://alexcarpenter.me/articles/improve-your-css-with-whitespace-and-comments).
Read the source material... eventually
Tags: tips
Published: 2018-01-07 19:18:43

---
title: Read the source material... eventually
published: true
description: Lately I've had a bit of a renaissance in my intake of software development literature.
tags: tips
cover_image: https://cl.ly/0b1p3f1R0e1S/Image%202018-01-07%20at%202.17.18%20PM.png
---

Lately I've had a bit of a renaissance in my intake of software development literature. I've been taking the time to read the canonical source of concepts which I'd previously consumed through distillation.

The "distillation" process is extremely important. It's vital for the industry that ideas spread naturally, get mixed around and presented in different ways for different use cases. This is the purpose of a lot of posts on [dev.to](/). I could never take the time to read the papers or books which inspire the great posts I read on a daily basis. But it is very worth getting to it eventually.

It can be discouraging to read materials that are above your understanding in a topic. I think it's perfectly reasonable to skip over the source material and gain the wisdom in bits and pieces as you go. But once you're reasonably comfortable with the concepts, going back and reading the deeper take or the original reference material is an incredibly illuminating activity.

Some people can just pick up a paper or book and read it for its value whenever they feel like it. Many others really need to proper headspace to find the material valuable. The pattern of consuming the byte-sized chunks and following up eventually with the deeper source material has been wonderful for me. Lengthier (or dryer) reads are a tough way to get introduced to a topic for me, but a great way to extend knowledge once I'm comfortable.

I'm writing this post because for a while it didn't occur to me to read books on subjects I was already comfortable with. If you don't read a lot of software books or papers, I suggest seeking out materials that do not introduce you to new subjects but instead help enrich concepts that you've been exposed to here and there for a while.
Angular vs vuejs vs react vs ...
Tags: discuss
Published: 2018-01-07 07:28:46

---
title: Angular vs vuejs vs react vs ...
published: true
description: 
tags: #discuss
---

Today there exists some frontend (JavaScript / Typescript based) Frameworks like Angular, Vuejs, React, Ember... and so on. What did you and for which Scenario prefer? I'm very interested in you Response.
How to replace all '0' with '5' without using string or predefined method in java?
Tags: javaprogramming
Published: 2018-01-07 06:51:39

---
title: "How to replace all '0' with '5' without using string or predefined method in java?"
published: true
description: "For example: 102 - 152 1020 - 1525"
tags: java programming
---
Does anyone else face this dilemma?
Tags: discuss
Published: 2018-01-07 02:10:19

---
title: Does anyone else face this dilemma?
published: true
description: 
tags: discuss
---

I just recently noticed something. Whenever I get into an intense coding session and finally get the will power to leave I find that I have to adjust to the real world in a way. Like I have to remind my brain to stop being so logical/technical. I could go out with my friends or just have a conversation after and I feel as though my brain is still working overtime and I find myself overthinking from time to time. Does anybody experience this?
What's your favorite GNU/Linux distro?
Tags: discuss
Published: 2018-01-06 23:38:13

---
title: What's your favorite GNU/Linux distro?
published: true
tags: discuss
---


If you have installed a GNU/Linux distro, what is it? If not, tell me what is your favorite distro.

What desktop you have?
What theme do you installed?
Show me a screenshot!
CPU で Yenten をマイニングする(Ryzen7 1700 で 0.92 khash/s)
Tags: yenten, mining
Published: 2018-01-06 16:42:09

---
title: CPU で Yenten をマイニングする(Ryzen7 1700 で 0.92 khash/s)
published: true
description: 
tags: yenten, mining
---

![250yen-curry](https://thepracticaldev.s3.amazonaws.com/i/v8pd4qfs1y16z78kypsj.jpg)

漢なら CPU で Yenten（円天）をマイニング(Yescrypt)したいですね！

https://conan-equal-newone.github.io/yenten/index2.html

やりましょう！

## wallet

適当に作ります.

## Mining pool

とりあえずうさぎコイン発掘所 Yenten 版を使いました.

https://bunnymining.work/yenten/

## Mining program

とりあえず Official? のマイニングプログラムを使いました.

![mining-log](https://thepracticaldev.s3.amazonaws.com/i/qjbe1suldd0c4mvlld75.png)

Ryzen7 1700 で 0.92 khash/s 出ました.

日々精進あるのみですね. 今日も1日ありがとうございます.

## TODO

* サトウのごはん + レトルトカレーもいいけど某大学の学食の 250 円カレーもええで(温泉たまごは別料金です)