teleren/devto huggingface dataset:
Using Python ipdb from Jupyter
Tags: python, programming, debugging
Published: 2018-04-25 09:40:08

---
title: Using Python ipdb from Jupyter
published: true
description: How to use Python ipdb debugger from a Jupyter notebook
tags: python,programming,debugging
---

*(this blog post originally appeared on my blog https://www.andreagrandi.it/2016/05/10/using-python-ipdb-from-jupyter/ )*

If we try to use the usual ipdb commands from a Jupyter (IPython notebook)

```python
import ipdb; ipdb.set_trace()
```

we will get a similar error:

```output
--------------------------------------------------------------------------
MultipleInstanceError                     Traceback (most recent call last)
<ipython-input-1-f2b356251c56> in <module>()
    1 a=4
----> 2 import ipdb; ipdb.set_trace()
    3 b=5
    4 print a
    5 print b

/home/nnn/anaconda/lib/python2.7/site-packages/ipdb/__init__.py in <module>()
    14 # You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
    15 
---> 16 from ipdb.__main__ import set_trace, post_mortem, pm, run, runcall, runeval, launch_ipdb_on_exception
    17 
    18 pm                       # please pyflakes

/home/nnn/anaconda/lib/python2.7/site-packages/ipdb/__main__.py in <module>()
    71         # the instance method will create a new one without loading the config.
    72         # i.e: if we are in an embed instance we do not want to load the config.
---> 73         ipapp = TerminalIPythonApp.instance()
    74         shell = get_ipython()
    75         def_colors = shell.colors

/home/nnn/anaconda/lib/python2.7/site-packages/traitlets/config/configurable.pyc in instance(cls, *args, **kwargs)
    413             raise MultipleInstanceError(
    414                 'Multiple incompatible subclass instances of '
--> 415                 '%s are being created.' % cls.__name__
    416             )
    417

MultipleInstanceError: Multiple incompatible subclass instances of TerminalIPythonApp are being created.
```

The solution is to use Tracer instead:

```python
from IPython.core.debugger import Tracer
Tracer()()
```

Source: http://stackoverflow.com/questions/35613249/using-ipdb-to-debug-python-code-in-one-cell-jupyter-or-ipython
Let me setup the database migration for the deployer of the code generator for the class for summing integers.
Tags: discuss, overengineering
Published: 2018-04-25 06:46:29

---
title: Let me setup the database migration for the deployer of the code generator for the class for summing integers.
published: true
tags: discuss,overengineering
---

How do you know if you have overengineered a solution?
What is Dakai?
Tags: blockchain, service, advice, showdev
Published: 2018-04-25 06:14:24

---
title: What is Dakai?
published: true
description: What does my service company do?
tags: blockchain, service, advice, showdev
---

I got many messages asking for advice in the blockchain space. Things like how to get started, how to reach customers, how to become top players, how to get ahead of the others.

After 2 weeks of editing and reviewing with my team, we came up with an article that doesn't just show how we work but also gives useful advice for those who want to start their own business in the blockchain space.

You can read all the advice on our blog: 
[http://dakai.io/2018/04/23/what-is-dakai/](http://dakai.io/2018/04/23/what-is-dakai/)

Let me know your thoughts!
Laravel tips: set resolve alias in Laravel mix
Tags: laravel, webpack
Published: 2018-04-25 05:47:41

---
title: Laravel tips: set resolve alias in Laravel mix
published: true
description: 
tags: laravel, webpack
---

This is not exactly about Laravel but Webpack, neverthless, I thought I should have set this at the beginning of my project.

# Prerequisites

Developing with

- Laravel 5.4 
- webpack (Laravel mix)

# Problem

I used to relatively specify path to a file in any `.js` files:

```js
// resources/assets/vue/components/Deep/Path/To/Component.vue

import FooComponent from '../../FooComponent.vue'
```

This is hard to understand, and if I change the directory structure I have to change every path.

...and just looks ugly.

# Solution

Add the following config at the beginning of `webpack.mix.js`.

```js
// webpack.mix.js

const { mix } = require('laravel-mix')

mix.webpackConfig({
  resolve: {
    extensions: ['.js', '.vue', '.json'],
    alias: {
      'vue$': 'vue/dist/vue.esm.js',
      '@': __dirname + '/resources/assets/js'
    },
  },
})

// ...config follows
```

Then, we can import like this:

```js
// resources/assets/vue/components/Deep/Path/To/Component.vue

import FooComponent from '@/components/FooComponent'
```

I found `vue-cli` uses this config. It set resolve alias `@` to  `src` by default.

https://github.com/vuejs-templates/webpack/blob/f21376d/template/build/webpack.base.conf.js#L40

Hope this config comes to default of Laravel Mix.
I am wondering I would send a PR...

# Refs

- https://readouble.com/laravel/5.4/ja/mix.html
- https://github.com/JeffreyWay/laravel-mix/blob/master/setup/webpack.config.js#L209
FTP - Upload files without folder structure
Tags: ftp, webdev, discuss, help
Published: 2018-04-25 04:46:33

---
title: FTP - Upload files without folder structure
published: True
description: ASK
tags: FTP, Webdev, discuss, help
---

Hi all

previously apologize if my question is not related to programming.

case:
I have some files. all divided into several month folders.
I plan to upload files via FTP, but without the folder structure. inside the FPT folder will only have files that exist in some local folders.
#
src :

#MyFolder
    # Jan
        - File Jan 1
        - File Jan 2
    # Feb
        - File Feb 1
        - File Feb 2
    # Mar
        - File Mar 1
        - File mar 2
    # Apr
        - File Apr 1
        - File Arp 2
#
#
Dest / FTP Folder:

#MyFolder
    - File Jan 1
    - File Jan 2
    - File Feb 1
    - File Feb 2
    - File Mar 1
    - File mar 2
    - File Apr 1
    - File Arp 2
#
<strong>is there an FTP app that can do that?</stronge>
A simple implementation of OData client
Tags: showdev, odata, csharp, dotnetcore
Published: 2018-04-25 03:58:09

---
title: A simple implementation of OData client
published: true
description: I made very simple OData client.
tags: showdev,odata,csharp,dotnetcore
---
Hey, guys! I made OData client for .Net Core. Probably, it is the simplest of the world :) Please share your feedback.

https://iwate.github.io/ODataHttpClient/
How to Vertically Align Anything with CSS
Tags: css, beginners, webdev, frontend
Published: 2018-04-25 02:20:31

---
title: How to Vertically Align Anything with CSS
published: true
description: Whether you’re an established web developer or new to creating websites you may have thought you knew how to vertically align… for a minute. But don’t worry, it happens to us all. 
tags: CSS, Beginner, WebDev, Frontend
---

Whether you’re an established web developer or new to creating websites you may have thought you knew how to vertically align… [for a minute](http://www.quickmeme.com/meme/3rdv7x/). But don’t worry, it happens to us all. 

Here’s my three favorite ways to vertically align stuff in css. 

### Transform
If you’ve been doing web development for a while you’re no doubt familiar with this approach. Before flexbox or css grid this was the only sure way to vertically align in css. Don’t let that fool you though, I still use it today. 

```
.parent {
 	position: relative;
}
.child {
	position: absolute;
 	top: 50%;
 	left: 50%;
 	transform: translate(-50%, -50%);
}
```

If you find when using this approach that elements become blurry because they’re placed on a half pixel, try this: 

```
 .parent {
 	position: relative;
 }
 .child {
 	position: absolute;
 	top: 50%;
 	left: 50%;
 	transform: perspective(1px) translate(-50%, -50%);
 }
```

### Flexbox
To center an object using flexbox you just need two centering properties: 

```
.element {
	 display: flex;
	 justify-content: center;
	 align-items: center;
 }
```

### CSS Grid
This is such an easy way to center something. This will center the immediate child of this element. If, there are five children inside this element and each of the children have two children. It will center only the five children (not the two nested inside). 

```
.element {
   display: grid;
   place-items: center;
   height: 100vh; // or however tall you want your box to be
 }
```

### Aligning just one line of text?
If you are simply trying to vertically align text inside some element it is much easier. All you need to do is give the text the same line-height as the container it’s in. 

For example, if the text is inside a button and the button is 32px tall. Just give the text a line-height of 32px and it will be vertically centered.

```
.button {
    height: 32px;
 } 
 .text {
   line-height: 32px;
 } 
```

I hope this helps you as you center things in CSS. Which method did you end up going with? Let me know.
ELI5: What is the "SCRUM" and "AGILE" work methodologies?
Tags: eli5, explainlikeimfive
Published: 2018-04-25 01:21:00

---
title: ELI5: What is the "SCRUM" and "AGILE" work methodologies?
published: True
description: I have a job interview tomorrow for a Frontend Position and this is the third company that have mentioned those methodologies but I have no clue what they are. I know, I must me a new kind of idiot 😂 but I have that gap in my knowledge.
tags: ELI5, explainlikeimfive
---
How to filter requests in Angular?
Tags: discuss, angular, beginners, webdev
Published: 2018-04-24 21:34:43

---
title: How to filter requests in Angular?
published: true
description: Filtered request for Angular
tags: #discuss, #angular, #beginner, #webdev 

---
Hi guys,
I have been using Angular for my project for a while and I wonder that is there any way to filter my request responses or request itself? I mean for example, I have an event model and this model has many session models. For that reliationship I use weak relation that session knows the event but not vise versa. For that reason, I have to get the event first, then with its id I have to get all sessions although I need only one of them. So, Can I make my response limited when I request for event's sessions and so on?
I know it sound complicated so feel free to ask for more detail about the situation.

 Thank you!

Here is a code example :
```
getExperiences() {
    this.experienceService.listApprovedExperiences().subscribe(res => {
      this.experiences = res;
      for (const experience of res) {
        this.getSessionList(experience.id);
    });
  }


  getSessionList(id: string) {
    this.experienceService.getSessionListByExperienceId(id).subscribe(res => {
      if (res.length !== 0) {
        this.session.set(id, res[0]);
       
      } else {

      }
    });
  }

```
What is your dream project?
Tags: discuss, developers, programmers, sideprojects
Published: 2018-04-24 20:38:21

---
title: What is your dream project?
published: true
description: Given unlimited resources (team and money) what would you want to build?
tags: #discuss, #developers, #programmers, #sideprojects
---

If you were given a high quality team numbering any amount you needed with unlimited financial backing, what would you build? Can be hardware, software or both.

There's a video game I have in my head that's rather complicated but I think would be cool and, given our current abilities in technology, very doable. But in reality I'd never get anybody to actually build it with me, haha.
Specifying user and group in Docker
Tags: docker, linux, archlinux
Published: 2018-04-24 14:45:09

---
title: Specifying user and group in Docker
published: true
description: 
tags: docker, linux, archlinux
---

If we use Docker as our development environment, we would use `docker` command to generate files.

e.g.

```
docker run --rm ruby:2.4 bundle exec rails g ...
docker-compose run --rm web composer install
```

The problem is that the owner and group of files that these commands generate are always `root`.

Note: this problem may happen only with Linux's Docker. Mac doesn't. Windows unknown.

# Solution 1: Dockerfile

We can set owner and group in `Dockerfile`.
The official document says we can do it by `USER postgres`, but we can also set group with `:`.

```bash
# Dockerfile

USER 1000:1000
```

However, this way specifies owner and group id.
I found more flexisible solutions.

# Solution 2: command argument

`docker run -u 1000:1000 debian bash`

In this way, we can set user and group with shell variables like `$UID`.
Or `getent group staff | cut -d: -f3`.

# Solution 3: specify in docker-compose.yml

I was looking for this.

The principle is the same as solution 2, so the following config works well:

```yaml
# docker-compose.yml

web:
  image: ruby:2.4
  user: "${UID}:${GID}"
```

Then run

`UID=${UID} GID=${GID} docker-compose up`

Or, export these variables as environment variables, ignoreing `bash: UID: readonly variable`

```
export UID=${UID}
export GID=${GID}
docker-compose up
```

# Environment

- Arch Linux
- Docker 1.12.3 linux/amd64

# Off topic

My favorite desktop Linux is Arch Linux.

`pacman`, the package management system for Arch, always provides the latest version of any package.

With Docker container, any host machine is OK.

# Refs

- https://docs.docker.com/compose/reference/envvars/
- http://stackoverflow.com/questions/35093256/how-do-i-pass-an-argument-along-with-docker-compose-up/35107585#35107585
- https://stackoverflow.com/questions/10910096/what-is-the-command-to-get-groupid-of-a-group-name-in-mac-or-linux
Changelog: Comment Preview
Tags: changelog, meta
Published: 2018-04-24 20:10:16

---
title: Changelog: Comment Preview
published: true
description: You can now preview comments before submission.
tags: changelog, meta
---

Gone are the days when you are unsure what your comment will look like after you submit it. 

Introducing the long-awaited comment preview feature. Never again will an incorrect markdown go by undetected!

---
![comment preview demo](https://dzwonsemrish7.cloudfront.net/items/462n3N2H3V1703193H2G/Screen%20Recording%202018-04-24%20at%2003.29%20PM.gif)

---

This is also the first dev.to feature built completely through pair programming 😊

If it's wonky or you like to tell us your thoughts, let us know below!

Happy Coding ❤️
New Features for Developing AngularJS Applications - Part 1: Component-Based Architecture
Tags: angular, javascript, webdev
Published: 2018-04-24 20:10:05

---
title: New Features for Developing AngularJS Applications - Part 1: Component-Based Architecture
published: true
description: Learn how to develop applications in AngularJS using a component-based architecture.
tags: #angularjs #javascript #webdev #angular
canonical_url: https://auth0.com/blog/new-features-for-developing-angularjs-applications-part-1/
---

AngularJS 1.5+ has undergone major updates. In this article, you'll learn how to develop AngularJS applications using a component-based architecture and leverage the API changes that will help you write your AngularJS applications in an Angular(v2+) style.

[Read on 🅰️](https://auth0.com/blog/new-features-for-developing-angularjs-applications-part-1/?utm_source=dev&utm_medium=sc&utm_campaign=new_features_angularjs)

![New Features for Developing AngularJS Applications - Part 1: Component-Based Architecture](https://thepracticaldev.s3.amazonaws.com/i/hg1ib01a06s6bqpznauw.png)
HTML Tabindex Explained
Tags: html, tabindex, webdesign
Published: 2018-04-24 08:47:17

---
title: HTML Tabindex Explained
published: true
description:  A short article that explains HTML attribute - tabindex. Examples included.
tags: HTML, tabindex, web design.
---

When dealing with element focusing, [tabindex](https://www.w3schools.com/tags/att_global_tabindex.asp) has a big role. This attribute indicates if the element can be **focusable and reachable with the keyboard navigation**. When pressing the **Tab key**, the browser shifts focus from one element to another. By using tabindex, we can change the tab order **flow**.

When creating any element, [styling](https://kolosek.com/10-ways-to-improve-your-website-design/) should be included.

##Values

The tabindex accepts **integer** values. They can be:

* **Negative** (usually `tabindex=”-1”`) - the element is not reachable by the keyboard navigation.
* `tabindex=”0”` - the element is reachable by the keyboard navigation but the order is defined by the documents source order.
* **Positive** - the element is reachable by the keyboard navigation, and the order is defined by the value. For example, `tabindex=”2”` is focusable before `tabindex=”3”`, but after `tabindex=”1”`.

##Usage

Tabindex can be used on the following elements:
* **input**,
* **anchor (a)**,
* **textarea**,
* **select**,
* **button**.

After creating any of these elements, give the text a proper [line-height](https://kolosek.com/css-line-height/).

##Example

*HTML*

```
<body>
  <label>This element will be focused second</label>
  <input name=”field1” type=”email” tabindex=”2” />

   <label>This element will be focused first</label>
  <textarea rows=”4”  cols=”5” tabindex=”1”></textarea>

   <label>The second focused last</label>
  <input name=”field3” type=”text” tabindex=”3”/>
</body>
```

Here we can see the order of the tab selection, starting from the **lowest to the highest number**. If an element has `tabindex=”0”`, it will be **excluded from the tab order**. If two elements have the same tabindex value, they will be selected in the order which they appear in the element. 

If you found this article interesting and useful, check out other subjects such as [relative font size](https://kolosek.com/css-relative-font-size/), [CSS columns](https://kolosek.com/css-columns/) and a little something about [SASS and LESS](https://kolosek.com/nesting-in-less-and-sass/).

##Summary

This short article summarizes the usage of the tabindex. By mastering this, you will write more efficient and user-friendly forms.

Thank you for reading and happy coding!

This post is originally published on [Kolosek Blog](https://kolosek.com/tabindex/).
If you could customize a tech curriculum what would you include?
Tags: discuss, education, programming, developers
Published: 2018-04-24 16:41:40

---
title: If you could customize a tech curriculum what would you include?
published: true
description: If you had the ability to customize a technical course (bootcamp or standard education) what kinds of things would you want to include?
tags: discuss, education, programming, developers
---

There are a number of things I would love to see in most technical courses.

Some abstract ideas:

* Working with Product Owners
* Basic UX survival skills
* The psychology behind programming

I have others but just cannot articulate them well right now.

Does anybody have other suggestions?
Would you mind giving feedback to my open source project?
Tags: html, bootstrap, discuss, css
Published: 2018-04-24 16:37:31

---
title: Would you mind giving feedback to my open source project?
published: true
description: 
tags: Html, bootstrap, discuss, css
---

I just open sourced <a href="https://github.com/ankythshukla/underexpress">UnderExpress</a>. It is a ready to use, responsive, html5 and bootstrap 4 based web UI kit, which can be used to make beautiful websites quickly. I have put 10s of hours making this, please share your feedback and show it some love (stars) on <a href="https://github.com/ankythshukla/underexpress">GitHub</a> <3.
If you were given the chance, what advice would you give your younger self?
Tags: discuss, advice
Published: 2018-04-24 16:07:17

---
title: If you were given the chance, what advice would you give your younger self?
published: true
description: 
tags: discuss,advice
---

I've been ruminating over things I could have done when I was younger, and what I can do now, to deepen my understanding of technology and code. Now I'm wondering, what would you tell your younger self if you had the chance?

I would tell my younger self to dig deeper into that CSS, damn it. *Understand* it. Break it apart. And hopefully create.
How to import a big delimited datatable into AWS DynamoDB without opening your piggy bank?
Tags: aws, dynamodb, serverless, discuss
Published: 2018-04-24 14:35:50

---
title: How to import a big delimited datatable into AWS DynamoDB without opening your piggy bank?
published: true
description: 
tags: aws, dynamodb, serverless, discuss
---

I'm working on a serverless stack.

I have a delimited CSV file with 5-6 million lines. I want to import this into AWS DynamoDB.

Is it possible somehow to import this into AWS DynamoDB, without burning my monthly salary down the toilet? How to solve this on the cheap?

This data dump will be constantly updated and I want to import the new lines into DB. I think the most efficient way would be to make a data dump from my DynamoDB, find a key, compare it with the new third-party data dump's key (this key needs to be extracted from a column by regex), and only import the new lines into my DB. Do you have some recommendation (big data framework or some AWS service) which can help me with this? Or I'm open if there's a shell or a Go script to do the same thing.

Thank You!
Emacs Registers - save kill-ring
Tags: emacs
Published: 2018-04-24 14:14:06

---
title: Emacs Registers - save kill-ring
published: true
description: 
tags: emacs
---

Have you ever used Emacs' Registers?
If not, I recommend to try.

# What is Registers

When we repeatedly do copy-paste, `kill-ring` order changes during `M-d`(delete-word) or `C-k`(kill-line).
So I used to find the text and paste it using `browse-kill-ring`. It takes much time.

This is where Registers comes into play.
We can save a text (and a lot of things) to named Register, and avoid missing the text even if we add something to `kill-ring`.

# How 

Registers is standard Emacs function, so just type:

- `C-x r s [key]` => Save region to the Register
- `C-x r i [key]` => Paste the content of the Register

Emacs25 shows preview of the content before paste. Nice:)

![Screenshot_2016-11-15_18-27-41.png](https://qiita-image-store.s3.amazonaws.com/0/103885/ce4d5eb0-4e04-9e66-f9e9-5b6c85af5cf5.png)

...Although this is useful feature, I should admit that doing copy-paste a lot of time is not good habit.

# Refs

If you would like to know more about Emacs Registers, please check out the document:

- https://www.gnu.org/software/emacs/manual/html_node/emacs/Registers.html
- http://dev.ariel-networks.com/articles/emacs/part4/
How did you start working remotely ?
Tags: discuss, career
Published: 2018-04-24 13:34:05

---
title: How did you start working remotely ?
published: true
tags: discuss, career
---

Let's share your story, it may help someone who is looking for remote job like me.


![Coding](https://media0.giphy.com/media/ZVik7pBtu9dNS/giphy.gif)