teleren/devto huggingface dataset:
#Hacktoberfest — Contribute to Open Source by Learning to Create A Github Pull-Request #OneDevMinute
Tags: onedevminute, git, hacktoberfest
Published: 2018-10-01 07:12:50

---
title: "#Hacktoberfest — Contribute to Open Source by Learning to Create A Github Pull-Request #OneDevMinute"
published: true
description: "#Hacktoberfest — Good folks from DigitalOcean, GitHub, and Twilio will track your open source contributions and upon five successful GitHub pull-requests — you'll receive swag items like a limited edition T-Shirt, stickers, and maybe a few discount codes. Contribute to Open Source by Learning to Create A Github Pull-Request #OneDevMinute"
tags: onedevminute, git, hacktoberfest
---

🙌 As a full-time #OpenSourcerer — October is one of my favorite months. And it's October already. Today's #OneDevMinute is about #Hacktoberfest — it's a month-long online event where you signup at GitHub.com and [Hacktoberfest](https://hacktoberfest.digitalocean.com/) to celebrate Open Source by contributing at least five times between Oct 1-31. 

✅ Good folks from DigitalOcean, GitHub, and Twilio will track your open source contributions and upon five successful GitHub pull-requests — you'll receive swag items like a limited edition T-Shirt, stickers, and maybe a few discount codes.

😇 Open source is for everyone, it's not just code — developers, designers, even marketers, and content writers can participate. Improve an open source project's documentation, refactor code, gift that project a new logo design — just participate and celebrate open source in October.

```sh
# Step #0: Create an account on GitHub.com (Also signup at https://hacktoberfest.digitalocean.com/).
# Step #1: Fork any open source GitHub repo.
# Step #2: Clone that repo in your local PC.
git clone https://github.com/AhmadAwais/Hacktoberfest

# Step #3: Make changes and commit/push these changes.
git add .
git commit -m "📦 NEW: Resource for learning Git"
git push

# Step #4: Go to your fork, click open `Pull Request` link and create a PR.
```

- 📺 1080p on https://Youtu.be/MnCfVxSw3ak
- 📨 [#OneDevMinute Newsletter signup →](http://eepurl.com/dINZsD)


### Use Emoji-Log

Learn to write good and useful git commit messages using emoji-log project.

{% github https://github.com/AhmadAwais/Emoji-Log %}



> P.S. If you like my work, feel free to share it, like it. I am quite active on twitter you can find me cracking silly jokes there, maybe [follow me on Twitter](https://twitter.com/MrAhmadAwais) to connect and [subscribe to my YouTube channel →](https://YouTube/AhmadAwais)

> P.P.S. I have [100+ FOSS (Free & Open Source Software)](https://github.com/AhmadAwais) GitHub repositories where you can contribute and earn your #Hacktoberfest swag. [Check it out →](https://github.com/AhmadAwais)

> Peace! ✌️

{% tweet 1046661201336446976 %}

🗣️ Comment below if you didn't get something.
Java Streams Cheat-sheet.
Tags: discuss, java, streams
Published: 2018-10-01 06:23:30

---
title: Java Streams Cheat-sheet.
published: true
description: Need a brief and informative cheat sheet for Streams
tags: discuss, java, streams
---

Namastey community,

Recently I started learning Streams (because you come across streams a lot while solving competitive programming -_-) and somehow I am not able to get a resource which consolidates/condenses/summarizes all the useful(probably all) stream functions.

Looked up on internet but couldn't find anything good for a cheat sheet.

Do you have something that I can refer to? A website, a git, notes, any resource!

Thanks in advance!
SELECT DISTINCT ON in PostgreSQL
Published: 2019-11-12 14:20:45

---
title: SELECT DISTINCT ON in PostgreSQL
published: true
tags: 
canonical_url: https://www.geekytidbits.com/postgres-distinct-on/
---

PostgreSQL has a really interesting and powerful construct called `SELECT DISTINCT ON`. No, this is not a typical `DISTINCT`. This is different. It is perfect when you have groups of data that are similar and want to pull a single record out of each group, based a specific ordering.

Let’s take a an example of some log data. You have a log table that stores the `url` of a request and the `request_duration`, which is how long it took to process the request for that URL. It also contains a `timestamp` column. If you wanted to answer the question “what is the most recent duration for each unique URL?” you might end up with a query that looks something like this:

```
SELECT l.url, l.request_duration
FROM log l
INNER JOIN (
  SELECT url, MAX(timestamp) as max_timestamp
  FROM log
  GROUP BY url
) last_by_url ON l.url = last_by_url.url AND l.timestamp = last_by_url.max_timestamp;

```

That `INNER JOIN` with a subquery is used to determine the last timestamp for each URL. Then, the outer query is pulling from the log table and using the results of that subquery to limit the results to only the last requests by URL. There are several ways this could be done as well including using a `WHERE IN` clause (assuming there is a single identifier that could be used), a `LATERAL` join or a `WINDOW` function. These approaches work but all of them require some type of 2 step query where the first step is identifying the target row and the second step is actually pulling that target row. This isn’t terriby complex SQL but it can become a bit cumbersome.

Let’s think about the `DISTINCT` clause for a moment. When you use a `SELECT DISTINCT` clause, you are discarding duplicate rows and only retaining a single one. But, the one that is kept is identical to the rest. What if you could tell `DISTINCT` to only consider _some_ fields for distinction and then which row you want to pull from this group of mostly similar but slightly varying rows? This is what `SELECT DISTINCT ON` does.

**With `DISTINCT ON`, You tell PostgreSQL to return a single row for each distinct group defined by the `ON` clause. _Which_ row in that group is returned is specified with the `ORDER BY` clause.**

Back to our log example. To acomplish what we did above with `SELECT DISTINCT ON`, it looks like this:

```
SELECT DISTINCT ON (url) url, request_duration
FROM logs
ORDER BY timestamp DESC

```

That’s it! We’re telling PostgreSQL to “put the logs into groups unqiue by url (`ON (url)`), sort each of these groups by most recent (`ORDER BY timestamp DESC`) and then return fields for the firest record in each of these groups (`url, request_duration`).
Restart 
Tags: restart, business, software
Published: 2018-10-01 04:31:40

---
title: Restart 
published: true
description: Restart of Business 
tags: #restart #business #software
---

So I had a business that I had to shut down and put on hold due to health problem. For the longest time I have wanted to start my own business and create software more over write the software. I started going to school before I go out of the Army and in some instances took the courses twice. 

I finally figured that I had enough knowledge and by then I had enough programs started but not finished that I could start up a company. So I setup an office in my garage and I also picked up myself a rolling server rack with a server in it. This is about the time when I started having issues with my PTSD. 

But now that I have got some of my medical problems token care of I would be able to take on the task of running my own business again. But I have memory problems that make it difficult for me to remember quite a bit. So I have a library of books that I have to use as references for programming and data bases. Not only the library but I have to research and get ideas on how to do certain things. I am pretty sure I am not the only one out here with that issue. Lol

So I will hopefully be fully up and running about this time next year and or finishing up my schooling. 
Phantom out.
In defence of vanilla JavaScript
Tags: javascript
Published: 2018-09-30 10:16:38

---
title: In defence of vanilla JavaScript
published: true
description: Why using vanilla JavaScript over front-end frameworks is still essential
tags: JavaScript
---

As I began to learn web site creation, I often heard statements like "vanilla JavaScript is only for beginners". As I began to learn JS I certainly mainly stuck to vanilla, fulfilling the stereotype. Frameworks were mysterious and confusing concepts.

But, crucially, I work for a consultancy not a software company. They are interested in three things:
	1. Getting an effective app
	2. Maintainability
	3. Maintainability

It is of no value to have an app that no one else in the company can update or that require outside skills that are too specific.  We can't hire someone so tightly bound to a technology, it is too restricting and not future-proof.

So vanilla JS is great for making effective (adequate) apps, useful for training others in the company and if we need outside support then we aren't restricted.

Plus the same (more-or-less) vanilla JS and any packages will always (??) work in various different scenarios: web front-end, mobile, NodeJS, Chrome extensions, Electron etc. and with fewer version compatibility worries.

Now, if we wanted to build a huge and complex multi-engineer project then a framework might be necessary - but if so we'd likely hire a specialist agency to do that.  Which of course means we lose control of the app...  Not so attractive!
Coding Against Data or Data Structures
Published: 2018-10-01 00:09:49

---
title: Coding Against Data or Data Structures
published: true
description: 
tags: 
---
![Structure](https://thepracticaldev.s3.amazonaws.com/i/ohxfn6gbwi31gtqy80f5.jpg
 "Structure")

Your an applications developer. You are provided data in some format; an API, a database of one form or another, or something else. You are asked to build a feature using the provided data. You look at the data, the format it is in, how you might consume the data in order to build the feature, and then you build the feature. The data changes, the feature breaks because the data is not in the expected format, and rework is needed.

The "proper" solution that will often be suggested is to code the logic to not be overly stringent on the format of the data. Code for edge cases, do not bake in assumptions into your code, protect for every scenario and alternative format. The code becomes complex and unmanageable, and defining what is a feature and what is a bug becomes extremely difficult. Defects are raised, investigations happen, and no one really knows what is supposed to happen, if any such objective declaration is even possible.

The solution of course, is to not write code based upon data, it is to write code based upon agreed upon data structures. This is not to say that code should not be resilient, gracefully degrade, and look for alternative formats, but none of these are solutions to the original problem.

Too often we want "real data" so we know what it will look like "in production". This is often an indication of slipping into the mistake of coding against data that may change instead of data structures that are agreed upon by both systems.

I very often do not want the "real data" especially not when the features are being developed. Rather I want an agreed upon data format, with sample data that reaches into the limit of that data format in every possible direction. That data structure and the corresponding data samples can then be developed and tested against. The "real data" should never pose new scenarios that were not already encompassed in the definition of the data structure. Indeed it does help to have access to "real data", "production data", or "user data", but this should never be substitute for a well defined data structure and the corresponding sample data that reaches every boundary of that data structure.

Check out [my blog](https://www.alexlockhart.me/) for more of musings upon technology and the various other topics that I am interested in.
Dev.To Review #1: Top 7 Of The Week, Discussed
Tags: discuss, audio, top, popular
Published: 2018-09-30 22:06:15

---
title: Dev.To Review #1: Top 7 Of The Week, Discussed
published: true
description: User milkstarz and I discuss the top posts of the week
tags: discuss, audio, top, popular
canonical_url: https://soundcloud.com/malikanddan/dev-to-review-episode-1
series: DEV.TO Review
---

[Malik](https://dev.to/milkstarz) and [I](https://dev.to/dangolant) got together to chat about the top 7 articles on dev.to for the week of 9/22/18. Also available on Soundcloud:

{% soundcloud https://soundcloud.com/malikanddan/dev-to-review-episode-1 %}

If you want to read and hear more posts like this, follow us here on dev.to, or on Twitter at [@dangolant](https://www.twitter.com/dangolant) and [@milkstarz](https://www.twitter.com/milkstarz).

# The top 7 discussed this week were: 

{% link https://dev.to/stereobooster/thats-one-small-step-for-a-developer-one-giant-leap-for-the-web-4b28 %}

{% link https://dev.to/hardkoded/how-to-organize-your-git-branches-4dci %}

{% link https://dev.to/annarankin/finally-in-promises--trycatch-2c44 %}

{% link https://dev.to/gonedark/10-practices-for-readable-code-143a %}

{% link https://dev.to/twhite/mvps-and-iterating-your-way-to-a-finished-product-2p35 %}

{% link https://dev.to/isaacandsuch/if-you-dont-hire-juniors-you-dont-deserve-seniors-48kb %}

{% link https://dev.to/sadarshannaiynar/demystifying-webpack-2f5n %}
Freelancers, do you host and maintain client websites? Why or why not?
Tags: discuss, freelancer, webdev
Published: 2018-09-30 22:04:16

---
title: Freelancers, do you host and maintain client websites? Why or why not?
published: true
description: 
tags: discuss, freelancer, webdev
---

I'm considering diving into freelancing and I've heard opinions on both sides of the fence. Just wanted to know the community's take on it. General freelancing tips are also welcomed. 

Thanks!
Enabling Sound in Pharo Smalltalk
Tags: smalltalk, pharo, beginners, howto
Published: 2018-09-30 21:56:21

---
title: Enabling Sound in Pharo Smalltalk
published: true
description: How to enable sound in Pharo Smalltalk
tags: smalltalk, pharo, beginners, howto
---

In this post I will show you how to enable sound playback in [Pharo Smalltalk](https://pharo.org/), which is not included by default.

---

The Pharo-VM is capable of playing sounds, but the classes to do so are not included in the image by default. You need to load the "[PharoSound] (http://catalog.pharo.org/catalog/project/PharoSound)" package first. 

There are two ways of doing this:

1. Interactively, through the "Catalog Browser" or
2. Programmatically, through code

Let's explore both ways.

## Interactively

For the interactive variant, bring up a "World" menu by clicking anywhere on an empty space.

Then, under "Tools", select "Catalog Browser". Like this:

![Opening the "Catalog Browser"](https://thepracticaldev.s3.amazonaws.com/i/attuiqq0yhm7h3jo1u4o.png)

In the Catalog Browser, enter "sound" in the filter and press enter:

![Searching for "sound" in the packages](https://thepracticaldev.s3.amazonaws.com/i/r7q687hj8x6fsedridok.png)

Right-click on "Pharo Sound", and select "Install stable version" like this:

![Installing stable package version](https://thepracticaldev.s3.amazonaws.com/i/zh5xnman5lssfgttk9wt.png)

Since it has only be tested with Pharo 5, the system will warn you that it has not been tested with your current Pharo version. Accept the warning with "Yes" as it should work anyways with latest versions.

![Accepting the warning](https://thepracticaldev.s3.amazonaws.com/i/t1vzry73kfch3wcomsxj.png)

(Disclaimer: this was tested under Pharo 6.1/OSX)

## Programmatically

The same done through the Catalog Browser can also be achieved directly by evaluating code. Evaluate this in a Playground window:

```smalltalk
Metacello new
	smalltalkhubUser: 'Pharo' project: 'MetaRepoForPharo50';
	configuration: 'PharoSound';
	version: #stable;
	load.
```

And that's it. Pharo now knows how to play sounds.

## Making sure it works

To make sure it works you can open a Playground window, and try out some things ...

To play a basic sound, do the following:

```smalltalk
SampledSound beep.
```

To play a major chord using a synthesized clarinet sound, do this:

```smalltalk
clarinet := FMSound clarinet.
(AbstractSound majorChordOn: clarinet from: #c4) play.
```

To open a mini virtual-piano you can evaluate this:

```smalltalk
PianoKeyboardMorph new openInWorld.
```

You can load sounds from Wave-files (or AIFF) and play them like this:

```smalltalk
sampledSound := (SampledSound fromWaveFileNamed: '/path/to/file.wav').
sampledSound play.
```

How to learn what to do with sounds?

Explore the "AbstractSound" class and its subclasses. Start by the class-side. You will find many interesting things there. Smalltalk is best learnt by exploring.

Finally, I leave you with a fugue of J.S. Bach:

```smalltalk
AbstractSound stereoBachFugue play
```

Have fun with Smalltalk!
Hacktoberfest 2018 - Anyone looking for open source contributors?
Tags: opensource, github, discuss, hacktoberfest
Published: 2018-09-30 21:31:45

---
title: Hacktoberfest 2018 - Anyone looking for open source contributors?
published: true
description: Have any projects you are looking for open source contributors? drop a comment below!
tags: #opensource, #github, #discuss, #hacktoberfest
---
I have usually only done the odd hackathon here and there and personal open source projects. This years hacktoberfest seems like a nice opportunity to start contributing back!

Does anyone have any projects they are looking for open source contributors?

Drop a comment below!
Localising the centralised web with Perkeep
Tags: perkeep
Published: 2018-09-30 21:48:10

---
title: Localising the centralised web with Perkeep
published: true
tags: perkeep
canonical_url: https://lancewicks.com/2018/09/30/localising-the-centralised-web-with-perkeep/#utm_source=rss&utm_medium=rss
---

As per my previous post, I am exploring interesting technologies to bring my engagement with the web a little more under my own control. In this post I want to share a little about a software called Perkeep which aims to let you “…permanently keep your stuff, for life.”

Hosted over at https://perkeep.org/?utm\_source=rss&utm\_medium=rss Perkeep (previously called Camlistore) is a project written in Golang which creates a local store of your data which is designed to kept for life.

It includes some great features for me, specifically the FUSE mount, so I can write direct to it. Indexing (so I can find it again), date based history of a file so I can restore a file from it with the state that file was in then.

It also has importers from things like RSS feeds, Twitter, Mastodon and google photos. So when this post goes out on my website, Perkeep will automatically download it and store it for me. The same is true of photos, tweets etc. They even get shown on an interactive map based on their geo information if it exists.

I can backup (automatically) my Perkeep data to another location and multiple locations. So for example to a external USB drive and to Amazon S3 storage. So I have some sense of security that my data is safe.

This is the second time I have tried Perkeep, I tried it once before when it was still called Camlistore. This time I have engaged a bit more and have started porting the data I was storing in Git-Annex to Perkeep.

A feature I am exploring which really will be the clincher if I can get it working, is the ability to have a “cache” of data locally on my SSD drive, then more data on slower disk, and all my data backed up on online storage (S3). Then transparently have all of it available but only things that are “recent” stored locally.

My main concern with Perkeep is that it seems a very quiet project; not much conversation in IRC or mailing list. Though the IRC interaction I have had has been great. There are hundreds of issues in Github too… that said there are 800 closed issues

I am really hoping that some of the importers come to fruition, specifically Facebook and Runkeeper. I’d be interested in importers for other services I use too.

Specifically, if I stay happy with the technology; I am thinking of writing (or collaborating in the writing) of an importer for Scuttlebutt. I think the idea of having SSB data outside of SSB in Perkeep “just in case” I stopped using SBB sounds pretty reasonable to me.

I’d be interested in hearing from others that have used Perkeep; specifically those who have done more than just experimented; and used the software regularly and especially of you have that cached data setup I mentioned!

Git-Annex was oky, but Perkeep is more what I am looking for. It also preforms really well with the size/qualitity of binary files I hav
Happy Hacktoberfest 2018!
Tags: hacktoberfest, github, beginners, go
Published: 2018-09-30 18:15:36

---
title: Happy Hacktoberfest 2018!
published: true
description: Open Source Festival is back.
tags: hacktoberfest, github, beginners, go
---

Hello everyone,

as [Hacktoberfest 2018](https://hacktoberfest.digitalocean.com/) is about to get started, I wanted to share with you my side project. I've created a web app called [OctoBoard](https://octo-board.herokuapp.com/), that can help us find open GitHub issues during the Hacktoberfest. Using its filters we can easily find issues with specific labels (e.g. "hacktoberfest"), language and organization. We can also filter out issues that got assigned to someone or are already commented.
It's really easy to work with so I encourage you to give it a try.

Here is the [deployed app](https://octo-board.herokuapp.com/), and here is its [repository](https://github.com/radlinskii/octo-board).

Happy Coding!