teleren/devto huggingface dataset:
4 Easy Pieces
Tags: python, pandas, jupyter
Published: 2019-05-20 16:04:14

Here are some minor hacks to improve your experience with Pandas and Jupyter Notebook. Jupyter Notebooks are incredible tools; Donald Knuth spent years unsuccessfully trying to make literate programming a thing, but this might finally be the form in which it takes off.

<sub>(By the way, you may think that this post is named after the "Feynman Lectures for Dummies" book [Six Easy Pieces](https://www.goodreads.com/book/show/5553.Six_Easy_Pieces), but in fact that book probably referenced the 1970 film _Five Easy Pieces_, to which this post serves as a prequel in title, though not in substance.)</sub>

####0

I usually start off my notebooks, after the usual import statements, with:

```
pd.options.display.max_rows = 999
pd.options.display.max_columns = 99
```

  It's often convenient to be able to see a whole df, or a big chunk of it, while working with it. Also, if your notebook is getting out of hand because you always use the same Untitled7.ipynb (who among us has not etc.), consider using the [Codefolding extension in nbextensions](https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/codefolding/readme.html) so you can hide away all the old code you swear you might need someday.

####1
If you've run a calculation in a Jupyter notebook but forgot to assign it, Jupyter's got your back. In the next cell you can assign it as  `_`.

  ```
[1] long_calculation.solve() 
# Aaaah, no!
[2] result = _
# Phew
```
####2
Ben Lindsay [says](https://twitter.com/ben_j_lindsay/status/1108427124518645762) 

> One of the most underrated [#**Pandas**](https://twitter.com/hashtag/Pandas?src=hash) functions in [#**Python**](https://twitter.com/hashtag/Python?src=hash) is `.query()`. I use it all the time.
> data = data.query('age==42')
> looks so much nicer than:
> data = data[data['age'] == 42]
> And it allows chaining like:
> data = data.query('age >18').query('age < 32')

I tend to agree. I like brevity, although it's hard to get over how grotesquely unpythonic it looks (even by the already low standards of Pandas). 

####2.5
Lastly: you can't do chained comparison in Pandas `(18 < df.age < 60 )` but a [Stack Overflow rando]((https://stackoverflow.com/a/18091240)) points out that you sort-of can like this 
```
df['18 <= age <= 60']
```
or with the abovementioned `query`
```
df.query('18 <= age <= 60')
```

It all goes through some kind of `eval`-like lexical parsing, which is generally [not a good idea in Python](https://nedbatchelder.com/blog/201206/eval_really_is_dangerous.html). Yeah I know, I don't like it either.

Happy data scienc-ing.
Write Clean Css Using Sass
Tags: courses, css, sass
Published: 2019-05-21 01:45:11

---
title: Write Clean Css Using Sass
published: true
tags: Courses, css , sass
canonical_url: https://udemyhunt.com/course/write-clean-css-using-sass/
cover_image: https://i.udemycdn.com/course/480x270/343816_a766_2.jpg
---

 Using SASS you will create CSS 10x times faster. I'll teach you how to maintain a code on a whole new level using SASS

<center>[Enroll](https://udemyhunt.com/course/write-clean-css-using-sass/)<center>
Hangman in PureScript
Tags: purescript, functional
Published: 2019-05-20 15:06:35

---
title: Hangman in PureScript
published: true
description: Interactive Programming in PureScript
tags: purescript, functional
cover_image: https://thepracticaldev.s3.amazonaws.com/i/olok5h63r4j2gue02hrm.jpeg
canonical_url: https://odone.io/posts/2019-05-20-hangman-in-purescript.html
---

You can keep reading here or [jump to my blog](https://odone.io/posts/2019-05-20-hangman-in-purescript.html) to get the full experience, including the wonderful pink, blue and white palette.

---

# Hangman in PureScript

An example run

```bash
Insert word to guess
> hello
-----
Try to guess
> hol
h-l--
> hello
You won!
```

The code

```haskell
module Main where

import Prelude
import Effect (Effect)
import Effect.Console (log)
import Node.ReadLine as RL
import Data.String.Yarn (fromChars, toChars) as S
import Data.List.Lazy as L
import Data.String (length) as S

mask :: String -> String -> String
mask word guess =
  let as = S.toChars word :: L.List Char
      bs = S.toChars guess :: L.List Char
      bs' = bs <> L.replicate (L.length as - L.length bs) '-'
      zipper a b = if a == b then a else '-'
  in
      S.fromChars $ L.zipWith zipper as bs'

main :: Effect Unit
main = do
    interface <- RL.createConsoleInterface RL.noCompletion
    let
        lineHandler word guess =
            case word of
                 "" -> do
                    log $ S.fromChars $ L.take (S.length guess) (L.repeat '-')
                    log "Try to guess"
                    RL.setLineHandler interface $ lineHandler guess
                    RL.setPrompt "> " 2 interface
                    RL.prompt interface
                 _ ->
                    if word == guess then do
                        RL.close interface
                        log "You won!"
                    else do
                        log $ mask word guess
                        RL.setPrompt "> " 2 interface
                        RL.prompt interface
    RL.setLineHandler interface $ lineHandler ""
    log "Insert word to guess"
    RL.setPrompt "> " 2 interface
    RL.prompt interface
```

---

Get the latest content via email from me personally. Reply with your thoughts. Let's learn from each other. Subscribe to my [PinkLetter](https://odone.io#newsletter)!
Scrollspy, Features, Mouseaway modal | Module Monday 40
Tags: showdev, opensource, webdev, javascript
Published: 2019-05-20 14:56:21

---
title: Scrollspy, Features, Mouseaway modal | Module Monday 40
published: true
description: Module Monday 40
tags: showdev, opensource, webdev, javascript
cover_image: https://res.cloudinary.com/component/image/upload/b_rgb:ffffff,c_lpad,h_350,w_800/v1558302810/mouseaway_ibnonr.gif
canonical_url: https://guide.anymod.com/module-monday/40.html
---

## Free & open-source web modules, created by the [Anymod](https://anymod.com) community. 

Mods will work on **any** website or web app. Click a mod to see it in action along with its source code.

## Scroll spy
Fixed side navigation that updates as you scroll down the page.
<a class="btn btn-sm" href="https://anymod.com/mod/scroll-spy-dkrmoo?v=20">View mod</a>
<a href="https://anymod.com/mod/scroll-spy-dkrmoo?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1558302811/scrollspy_aiax7b.gif"/>
</a>

## Feature section
List product features in a simple and elegant format.
<a class="btn btn-sm" href="https://anymod.com/mod/feature-section-mlnkdm?h1=49&h2=100&v=35">View mod</a>
<a href="https://anymod.com/mod/feature-section-mlnkdm?h1=49&h2=100&v=35">
  <img src="https://res.cloudinary.com/component/image/upload/v1558302810/features_sqw8bs.png"/>
</a>

## Mouseaway modal
Show visitors an offer or info when their mouse leaves the screen.
<a class="btn btn-sm" href="https://anymod.com/mod/mouseaway-popup-bambna?v=20&preview=lorem">View mod</a>
<a href="https://anymod.com/mod/mouseaway-popup-bambna?v=20&preview=lorem">
  <img src="https://res.cloudinary.com/component/image/upload/v1558302810/mouseaway_ibnonr.gif"/>
</a>

## Progress bar
Set a fixed percentage to show the progress of something.
<a class="btn btn-sm" href="https://anymod.com/mod/progress-bar-oraond">View mod</a>
<a href="https://anymod.com/mod/progress-bar-oraond">
  <img src="https://res.cloudinary.com/component/image/upload/v1558302810/progress_zsdwzu.gif"/>
</a>

## Instagram post embed
Add an Instagram post anywhere with ease.
<a class="btn btn-sm" href="https://anymod.com/mod/orlmm?v=20">View mod</a>
<a href="https://anymod.com/mod/orlmm?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1558302810/instagram_pnwo7d.png"/>
</a>

<hr>

I post new mods from the community [here](https://dev.to/tyrw) every (Module) Monday -- I hope you find them useful!

Happy coding ✌️
Today I learned: Why there aren't many tools for SQLing a csv
Tags: sql, sqlite, productivity, tutorial
Published: 2019-05-20 14:41:56

---
title: Today I learned: Why there aren't many tools for SQLing a csv
published: true
description: Why did no one tell me this YEARS ago?!?! 
tags: sql, sqlite, productivity, tutorial
---

I wear a lot of hats, and I up using CSVs pretty frequently because it's such a common layperson data exchange format. I know a bit of SQL, and I've caught myself wondering a thousand times why there aren't many tools for running SQL against a spreadsheet. 

I was doing a little sysadmin today and caught myself wondering the same thing again. This time, though... I took a minute to wrap my head around it. 

And now I know: **Sqlite**

What I found was how dead. stinking. simple it is to translate a csv directly to a sqlite database. From there, I could go to town on it. 

1. Find a csv and tidy-up if needed. *(caveat: all your columns need a header - makes sense for a database, though, right?)*

2. Start sqlite: `sqlite3 some_db_file.db` 

3. Import the csv into a clean database

   ```sqlite
   .mode csv
   .import my_csv_file.csv some_db_name
   ```

**Done!** Sqlite automagically shuffled your spreadsheet into a new database. Run SQL against it, build a CLI app that consumes it, whatever - have fun!
What is inode in Linux?
Tags: discuss, linux
Published: 2019-05-20 14:39:55

---
title:What is inode in Linux?
published: true
description: 
tags: #discuss #Linux
---

Well I'm trying to grasp concept of what inode is?And after reading this [article](https://mobile.linuxtoday.com/blog/what-is-an-inode.html) what I understand is that inode is kind of array, where as inode-number of file is the index 'i' of that array.
And as we know array have static size that's why older file system like ext3 have fixed number of inode..means you can only create limited number of files in ext3.

Can I limit the number of files to be create in Linux modern file system like ext4...?
Welcome Thread - v33
Tags: welcome
Published: 2019-05-20 14:28:43

---
title: Welcome Thread - v33
published: true
description: Introduce yourself to the community!
tags: welcome
---

![Hello there](https://media1.giphy.com/media/3ornk57KwDXf81rjWM/giphy.gif)

### Welcome!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Let's go!**
Contact form with VueJS
Tags: codepen, showdev, vue, javascript
Published: 2019-05-20 14:19:23

---
title: Contact form with VueJS
published: true
tags: codepen, showdev,vue, javascript
---

<p>Although it's more like a CSS practise (I have been using SCSS all this time, so I tried not to use any preprocessors this time), this is also a practise in learning the concept of VueJS components, and microinteractions (Just a simple animation).</p>

{% codepen https://codepen.io/takaneichinose/pen/MdoGEv %}
Need help to better understand Typescript, IoC, Hexagonal architecture
Tags: help, typescript
Published: 2019-05-20 13:53:44

**Hello,**

I’m new to the Typescript world and I’m trying to learn some techniques.

Let’s imagine that I want to implement a Logger in my application with Winston. Later, I want to use Bunyan instead of Winston. Problem: All files that use the old Logger should be updated.

*Note: It seems that Winston and Bunyan use the same functions. Let’s assume that this is not the case.*

Should I create an interface (ILogger), then classes for each implementation (LoggerImplWinston and LoggerImplBunyan)? Any other options for you?

At the same time, I am also trying to use the Inversion of Control (Inversify) and Hexagonal architecture (Interfaces, application, domain, infrastructures) …

**Thus, I’m french, so keep things as simple as possible**

Thank you in advance.
Questions I Ask Event Organizers
Tags: inclusion, career
Published: 2019-05-20 13:26:45

When you have the privilege to be selective of which community and professional events you attend, it means that you can choose when to say 'No'. You can choose third-party events and speaking opportunities that align with your professional values of fairness and equity in a community space. 

Even when I have accepted CFPs, not all of the information I use to make these decisions is available publicly. I created a simple standard response for event organizers to help me understand whether the event aligns with my corporate and personal values. (inspired by [Ethan Marcotte's 2014 blog](https://ethanmarcotte.com/wrote/my-questions-for-event-organizers/))

------------------------------------------------------------------------

Hello [ORGANIZER WHO CONTACTED ME]!

Hooray! This is very exciting.

If you don’t mind, I have a few standard questions I like to send to organizers. Whenever you have a moment:

1/ How do you compensate your speakers?

2/ How does your team build a diverse lineup of speakers?

3/ How do you ensure that you have a wide range of perspectives in your speakers?

4/ What kind of audience would I be speaking to? 

5/ What kind of talk would be most relevant? 

6/ What would you like your attendees to walk away from after this session?

7/ Do you have a publicly posted Code of Conduct + reporting process?

8/ What accessibility compliance are you designing your event under?

Cheers,
[me]
ELI5: What is IDE or an IDE?
Tags: explainlikeimfive, discuss, codenewbie
Published: 2019-05-20 13:17:15

I'm rather new to coding. My experience starts about 15 years ago, with a tiny bit of HTML on MySpace, but I didn't do any coding after that. So, this year, I started teaching myself to code. So far, I've found answers to most, but I'm still stuck on this. 

I have no clue what is being referred to when people mention IDE. 

TL;DR ELI5: What is IDE or an IDE?
The Building an Indie Business Podcast- My Failed Hackernews Post
Tags: podcast, startup
Published: 2019-05-20 13:01:57

---
title: The Building an Indie Business Podcast- My Failed Hackernews Post
published: true
description: 
tags: podcast, startup
---

https://overcast.fm/+RG5hm7LgM

[Episode Page](https://baib-podcast.com)
[Revenue Research](https://revenueresearch.co/)
Crypto Business Plans 
Tags: crypto, businessideas, bitcoin
Published: 2019-05-20 13:01:00

---
title: Crypto Business Plans 
published: true
description: Explore more lastest trending crypto business ideas and start your own exchange with Bitdeal.
tags: Crypto,businessideas,bitcoin
---

##Risks in Starting an exchange business :
Here comes some of the risks that one must face when they start an cryptocurrency exchange as a business.
1. The first risk is already there are a plenty of familiar bitcoin exchanges, So it is upon you to decide how you are going to differ from them.
2. You should provide high security to the traders.
3. Preventing the money laundering, and stopping the intruders.
4. Securing the digital assets.
5.Preventing the anonymity and securing your integrated wallet.

##Different ways of starting a bitcoin exchange business:
The different derivatives of bitcoin exchange business are as follows :
1. Margin trading with Lending 
2.  Token exchange and trading
3. Bitcoin OTC trading 
4. New coin trading ( or) trading with ICO 
5 . Trading with STO or IEO .

##Business tips or plan to start an exchange :
Listed out below the business plans for starting a bitcoin exchange business. 
1 .Standing Unique between your competitors.
2. Integration of additional features that are demand .
3.  Utiliztion of the right bitcoin exchange software and exchange portal.
4. Choosing right business location to launch your exchange.
5. Choosing right development firm to support you with best script.

##Recent Cryptro Business Trends :
1.Decentralized Exchange with Atomic Swaps
2.STO 
3.Blockchain Technology
4.Token Exchange 
5.IEO
6.ICO/STO/CTO and lot more.

Explore more Cryptocurrency Business Ideas/Plans at : [Bitcoin Exchange Business Plan And Revenue Model](https://www.bitdeal.net/bitcoin-exchange-business-plan-and-revenue-model)

##Bitdeal - Cryptocurrency Exchange Development Company 
Bitdeal – a hub of cryptocurrency business solutions, covering all the niche areas of cryptocurrency industry. If you need any boost up, web development support, software support, or any consultations, you can contact bitdeal at any time. 
They have separate team of expert Blockchain developers who will dedicatedly work for you to meet all your business requirements.
Get a free consultation from Bitdeal's Experts Now !!
Source : [**Bitdeal**]( https://www.bitdeal.net/)
Weekly Links – 5/20
Tags: cloud, links
Published: 2019-05-23 18:00:07

---
title: Weekly Links – 5/20
published: true
tags: Cloud,Links
canonical_url: 
---

Here’s this weeks links:

### Technical Links:

- Building recommender systems with Azure Machine Learning Service – [https://azure.microsoft.com/en-us/blog/building-recommender-systems-with-azure-machine-learning-service/](https://azure.microsoft.com/en-us/blog/building-recommender-systems-with-azure-machine-learning-service/)
- Understanding HDInsight Spark Jobs and data through visualizations in the Jupyter Notebook – [https://azure.microsoft.com/en-us/blog/understanding-hdinsight-spark-jobs-and-data-through-visualizations-in-the-jupyter-notebook/](https://azure.microsoft.com/en-us/blog/understanding-hdinsight-spark-jobs-and-data-through-visualizations-in-the-jupyter-notebook/)
- Optimize performance using Azure Database for PostGreSQL recommendations – [https://azure.microsoft.com/en-us/blog/optimize-performance-using-azure-database-for-postgresql-recommendations/](https://azure.microsoft.com/en-us/blog/optimize-performance-using-azure-database-for-postgresql-recommendations/)
- Real-time event processing with Azure Database for PostgreSQL and Event Grid integration – [https://azure.microsoft.com/en-us/blog/event-processing-with-azure-database-for-postgresql-and-azure-event-grid-integration/](https://azure.microsoft.com/en-us/blog/event-processing-with-azure-database-for-postgresql-and-azure-event-grid-integration/)
- Detecting Threats targeting containers with Azure Security Center – [https://azure.microsoft.com/en-us/blog/detecting-threats-targeting-containers-with-azure-security-center/](https://azure.microsoft.com/en-us/blog/detecting-threats-targeting-containers-with-azure-security-center/)

### Developer Life:

- The future of Media & Entertainment in the Experience Economy – [https://cloudblogs.microsoft.com/industry-blog/microsoft-in-business/2019/04/29/the-future-of-media-entertainment-in-the-experience-economy/?wt.mc\_id=AID2370587\_QSG\_EML\_NLTR\_341595&utm\_source=Direct](https://cloudblogs.microsoft.com/industry-blog/microsoft-in-business/2019/04/29/the-future-of-media-entertainment-in-the-experience-economy/?wt.mc_id=AID2370587_QSG_EML_NLTR_341595&utm_source=Direct)
- Simon Sinek – How Great leaders inspire action – [https://www.ted.com/talks/simon\_sinek\_how\_great\_leaders\_inspire\_action](https://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action)
- The future we’re building – and boring – [https://www.ted.com/talks/elon\_musk\_the\_future\_we\_re\_building\_and\_boring](https://www.ted.com/talks/elon_musk_the_future_we_re_building_and_boring)
How to check if UserDefaults object is Empty
Tags: swift
Published: 2019-05-20 12:48:26

---
title: How to check if UserDefaults object is Empty
published: true
description: Using Swift to check if UserDefaults object is Empty.
tags: Swift,
---

This will be a guide to check if UserDefaults has been set.
You will want to use this to make sure a value is not nil before you use it.

Here is a simple example in a ViewController class.

```swift
import UIKit

class ViewController: UIViewController {
  
  let theme = Themes() // custom class
  // 1. create user defaults
  let defaults = UserDefaults.standard 
  
  override func viewWillAppear() {
    super.viewWillAppear()
    
    // 2. Check if there is not an userDefaults object for theme
    if defaults.object(forKey: "theme") == nil {
      // 3. If there is not an object, then set a default. This will
      //    not be ran if there is an object.
      defaults.set("dark", forKey: "theme")
    }
    
    theme.setTheme(defaults.string(forKey: "theme"))
  }
}
```
Link to [Gist](https://gist.github.com/maeganjwilson/9505d1eb5e488f84603e84bea8ed3057#file-checkdefaults-swift)

1. Create a constant to interact with the UserDefaults
2. Create an if statement to check if the object does not exist.
3. If the object does not exist, then set a default option. In the example above, I set it to dark.

There is no need to set the default option if the default object does exist because it has been set before.

---

If you enjoy my posts, please consider sharing it or Buying me a Coffee!

<a href="https://www.buymeacoffee.com/appsbymw" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/arial-blue.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a>
How to count the number of commits made between 2 commits hashes
Tags: beginners, git, github, rebase
Published: 2019-05-20 12:26:39

---
title: How to count the number of commits made between 2 commits hashes 
published: true
description: simple GitHub command that helps to count commits
tags: beginner, git, GitHub, rebase
---

### The problem 

You have been working hard on that feature for many days and now it's done.
Unfortunately, you have made a lot commit and you want to squash them into one commit and raise that pull request. 

As said in [this tutorial](https://blog.carbonfive.com/2017/08/28/always-squash-and-rebase-your-git-commits/) you can do it in one command : 

 `git rebase -i HEAD~[NUMBER OF COMMITS]`

**But How to know the number of commits you have made since the moment you started working on this feature?**

### The solution

With `git log` you can list all the commit you made after creating your branch.

Let suppose your first commit hash is `33b14c62b` and the last commit hash is `33ad6cecf`

You can do it the old way by counting manually the number of commits between the two hashes but it is not always easy.

Git has a powerful command  called `rev-list` that lists commit objects in reverse chronological order


`git rev-list 33b14c62b...33ad6cecf`


With that command, you can get the list of all commit between the start hash and the end hash.

To count the number of line in the output of that command use the pipe and the following command: `| wc -l`.

The final command will look like this : 

`git rev-list 33b14c62b...33ad6cecf | wc -l`


### Putting all together!

Once you get the number of commits you would like to squash you can do the command mentioned in the introduction and combine your commit by deciding what you would like to pick and what you would like to squash.
If you have found 10 commits the command will be :

`git rebase -i HEAD~10`


### All In One:

You can combine all the 2 commands into one command and remove white spaces and tabs using this:


` git rebase -i HEAD~"$(git rev-list 33b14c62b...33ad6cecf | wc -l | sed 's/ //g')" `

Special thanks to @paesibassi for this suggestion


Regards.

Resources used :

[An answer on stackoverflow](https://stackoverflow.com/a/44344164/4683950)


[git rev-list from the git bible](https://git-scm.com/docs/git-rev-list/#git-rev-list---ancestry-path)