teleren/devto huggingface dataset:
Friday Blast #92
Tags: fridayblast, links, post
Published: 2020-10-19 07:18:03

---
title: Friday Blast #92
published: true
date: 2020-10-16 07:00:00 UTC
tags: fridayblast,links,post
canonical_url: https://horia141.com/friday-blast-92.html
series: "Friday Blast"
---

[Why do ARM chips have instructions with JavaScript in the name (2018)](https://stackoverflow.com/questions/50966676/why-do-arm-chips-have-an-instruction-with-javascript-in-the-name-fjcvtzs) - remember kids, if your programming language becomes popular enough, its primitive operations will become CPU instructions. I wonder if there’s been any analysis done on this? Like look at where a sufficient sample of programs spend their time and make that into instructions. You’d need a size/complexity heuristic to not just leave it at`main` but I’m sure companies such as Google or AWS which run big sever workloads would have the data.

[Why isn’t functional programming the norm? (2019) #video](https://www.youtube.com/watch?v=QyJZzq0v7Z4&feature=youtu.be) - the short answer is “it’s complicated”. The longer answer is that FP languages lack either a “killer app” or some serious corporate backing. Add do that a bit of a definitional problem - like what is an FP language? Is Common Lips where you can have imperative constructs more FP than Rust where everything is immutable by default? OTOH many modern languages have functional programming capabilities, so in that sense FP is the _present_.

[The observer effect with Daniel Ek (2020)](https://www.theobservereffect.org/daniel.html) - an interview with Spotify’s CEO. There’s a lot to take in, but perhaps for me the most interesting part was about the coaching he provides to his reports.

[AirBnBaller (2020)](https://www.profgalloway.com/airbnballer/) - an analysis of why in the long run AirBnB might be the “breakout” startup of the 2010s, eclipsing the likes of Uber, or Palantir. Right now, things are dire with the global pandemic, but it won’t last forever. If anything, as a supply gateway AirBnB will have a very strong hand to play vs traditional hotel chains.

[40ms of latency that just won’t go away (2020)](http://rachelbythebay.com/w/2020/10/14/lag/) - another case of being tripped up by Neagle’s algorithm for TCP - which batches short message bursts into bigger chunks to more efficiently utilize bandwidth. At the expense of latency. Disabling it is set via some flag on the socket. What I always find peculiar about these low level APIs is how much they had that you’re doing a “big thing(tm)” with these things.Sometimes it’s not even clear it works or is enough to work. I definitely like the higher level API where you’d instantiate a `NoBufferingConnection` or something of the sort and make it really clear and semantic what you’re trying to achive.
Constructing uris in dotnet is harder than it should
Tags: csharp, dotnet
Published: 2020-10-16 06:53:13

A common pattern for communicating over http in dotnet is to use a `HttpClient` with a base address and then add a relative path for every request. If the base address includes a parts of the path, one has to be very careful of where slashes are added or the resulting uri wont be what you expect.

We recently got bit by this at work where we suddenly started getting 404s on all requests going from one service to another.
As it turned out we had made a configuration change and a missing trailing slash in the base address was the reason.

This little sample demonstrates what happened

``` csharp
using System;
using System.Collections.Generic;
using System.Linq;

public class Program
{
  public static void Main()
  {
    var baseAddresses = new [] { "http://host.io/foo", "http://host.io/foo/" };
    var relativeAddresses = new [] { "bar", "/bar" };

    foreach (var baseAddress in baseAddresses)
    {
      foreach (var relativeAddress in relativeAddresses)
      {
        var uri = new Uri(new Uri(baseAddress), relativeAddress).AbsoluteUri;
        Console.WriteLine($"{baseAddress} + {relativeAddress} = {uri}");
      }
    }
  }
}
```

And the output is

```
http://host.io/foo + bar = http://host.io/bar
http://host.io/foo + /bar = http://host.io/bar
http://host.io/foo/ + bar = http://host.io/foo/bar
http://host.io/foo/ + /bar = http://host.io/bar
```

As you can see, in three out of four possible combinations the `foo` part of the base address is silently removed from the final uri. 😱
HackToberFest2020 Successfully Completed
Tags: hacktoberfest
Published: 2020-10-16 06:43:51

## What I Learned From Hacktoberfest

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4nl00zbgvfdtcoenrmir.PNG)

# hii there! 
Well i can say it works as a motivation for new programmers.My journey of hacktoberfest 2020 is so good and i think every programmer every cs enthusiast have to do this. It was my First time experience. it will make you more confident about development and give you experience about open source and github and how to use it. " HaPpY_CoDiNg!! "

## how to do-- well take no pressure just be confident on one programming language and search repo according to it and contribute.
loose my fear to participating in Hacktoberfest!!
Tags: hacktoberfest
Published: 2020-10-16 06:32:53

I began on October 2nd. I told myself I was too inexperienced as a developer and I worried that my commits wouldn’t be worthwhile. Unfortunately, I let those fears get the better of me, and I didn’t even bother signing up.

This year I forced myself to set my fears aside, studied this post on Hacktoberfest , and I done it. its was really amazing.
A Place where you can contribute and find study resources like PPT PDF Notes code etc.
Tags: github, contributorswanted, hacktoberfest
Published: 2020-10-16 06:26:53

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7i3kgzemigwlrsb8792s.png)
Admit it, we all have a secret place where we store our notes, books, codes etc. But wouldn't it be easier to just have it all in one place? A Virtual Library for all students where we can contribute and find material for all courses.
Do what you like even it's useless
Published: 2020-10-17 02:24:36

---
title: Do what you like even it's useless
published: true
date: 2020-10-16 04:16:16 UTC
tags: 
canonical_url: https://phongduong.dev/blog/do-what-you-like-even-it-s-useless/
---
## The inspiration

This week, I read [a post](https://dev.to/_pthomann/how-i-lost-1-year-of-life-doing-failed-crypto-startup-5hlp) by [Przemysław Thomann](https://twitter.com/_pthomann) about his journey in building a crypto startup. Although he failed, he still experienced and learned something from this failure. His story is a great inspiration to me.

## What am I doing?

The story makes me think about what I am doing. It's been 3 months since I quitted my job and started creating content. In the beginning, I thought creating content was easy. I just needed to create something and publish it. But it's not.

When I have an idea, it's really exciting. I want to turn that idea into a piece of content. As soon as I start creating content, I feel get stuck. I don't know how to express my idea. I don't know how to convey the content to my audiences.

After spending hours creating and editing, I click the publish button. I switch to the new content because I am bored with trying to make my content perfect. I sometimes try to make everything perfect but if it doesn't happen as I expect, I neglect it.

When I publish the piece of content, I have expectations for it. I want my content to serve as many audiences as possible. I want my content to get thousands of engagements. After all, it only gets a little. I am frustrated.

## Things I realized

Although things don't work as expected, I realize that there are some people who still consume content. They are my family, friends, or someone on platforms I published. My content actually is useful to someone. I only focus on the number of people who don't consume my content rather than those who do.

I learned new skills in video editing, building audiences, SEO, and writing skills. My native language is not English so that this is an exercise. While creating content, I also learning new libraries and frameworks. The knowledge I earned and the content I created will be valuable in the future if I get back to a 9-5 job.

## The joy of creating and learning

If you are having some ideas and want to create something, just do it.

It may turn into a side hustle or startup.

It may be useless and nobody cares about it.

Who knows?

One thing you can know after completing is what you experienced and learned.

You created something you are proud of. You have a project in your portfolio. You learn something new. You also have a story to share with everybody.

Enjoy it.
Done 2020!
Tags: hacktoberfest
Published: 2020-10-16 06:10:57

## What I Learned From Hacktoberfest
1.Even small things always matter in life.
2.contributing to projects is not only about contributing but its all about you are helping each other in techs.
3.Focus on one thing not thousands.
4.patience is most important.

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->
COMPLETED HACKTOBER FEST
Tags: hacktoberfest
Published: 2020-10-16 06:10:16

## What I Learned From Hacktoberfest

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->Usually I am new to the GITHUB but after this fest I really do great work in open source ,I contribute to simple things but its matters a lot and it great to start the journey.
Yeay !!!
Tags: hacktoberfest
Published: 2020-10-16 05:46:46

## What I Learned From Hacktoberfest

Hacktoberfest is a great event and it makes me pumped up as a self-taught web developer. I learn so many experience by having a PR on peoples repo, their review is giving me a brand new point of view about code. So, thank you, I really enjoy this event :)
Hacktoberfest 2020
Tags: hacktoberfest, digitalocean, opensourcecontribution
Published: 2020-10-16 05:39:38

What I Learned From Hacktoberfest:
It was indeed a great experience contributing to open source, not just for the sake of contribution as well as enhancing my knowledge towards a specific domain, Hacktoberfest was a great platform.
Thanks to DigitalOcean.
Happy Coding!
HackToberFest2020 Successfully Completed
Tags: hacktoberfest
Published: 2020-10-16 05:32:46

## What I Learned From Hacktoberfest
<h2>hii there! Well i can say it works as a motivation for new programmers.My journey of hacktoberfest 2020 is so good and i think every programmer every cs enthusiast have to do this. it will make you more confident about development and give you experience about open source and github and how to use it and additional swag "t-shirt" well never do it for swag do it because it's a proud a feeling. HaPpY_CoDiNg!!</h2>
<h3>how to do-- well take no pressure just be confident on one programming language and search repo according to it and contribute.</h3>
My HacktoberFest Journey
Tags: hacktoberfest
Published: 2020-10-16 05:25:22

## What I Learned From Hacktoberfest

This year's HacktoberFest was special to me as it was my 2nd time participating in it. Last year I was new so I was just started contributing to open source after October. Gradually I got so involved that I wanted more and more people to experience the Open Source. So this year I initiated and helped all those who were new to Open source to participate and contribute in HacktoberFest. I talked to many strangers and made them friends while teaching then how to contribute to Open source. It increased my confidence as well as my deeper understanding of the concepts of Open Source.
Getting Started with Gatsby
Tags: gatsby, javascript, typescript, webdev
Published: 2020-10-16 05:24:07

Gatsby is **react-based** open source framework and fast static websites generator. It allows to create static HTML at build time and gives the browser a complete page. 
Gatsby uses **preload** to speed up loading of resources required by the page: all the necessary CSS , data and its core JavaScript needed to run the page and starts prefetching all links on the page. Also uses **code splitting** during compilation in a way that WEBPACK imports the dependencies on separate bundles. 

#Gatsby vs NextJs vs create-react-app
The choice of the framework depends on the project itself. 

* **Gatsby**: Static HTML and can be used when you need good SEO and you don't have frequent data updates
* **NextJs**: Server Side rendering if you need good SEO and data is updating frequently exp: facebook
* **CRA**: Client side rendering when you don't need good SEO exp: private dashboards

#Getting Started on Gatsby:
1. Install Global CLI:
```
npm install -g gatsby-cli
```
2. Create new Site: 
```
gatsby new my-gatsby-app
```
3. Start development server:
```
gatsby develop
```
#Gatsby project Structure 
Once you create you Gatsby application you will find this structure of the project:

```/
|-- /.cache
|-- /plugins
|-- /public
|-- /src
    |-- /pages
    |-- /templates
    |-- html.js
|-- /static
|-- gatsby-config.js
|-- gatsby-node.js
|-- gatsby-ssr.js
|-- gatsby-browser.js
```

* **src folder**: This directory will contain all of the code related to what you will see on the frontend of your site (what you see in the browser), like your site header, or a page template. “Src” is a convention for “source code”.
  - **pages**: become pages automatically with paths based on their file name
  - **templates**: Contains templates for programmatically creating pages. 
  - **html**: need to be modified if you want to insert custom HTML into the <head> or <footer> of each page on your site
* **static**: it will not be processed by webpack.
* **gatsby-config.js**:  This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc.
* **gatsby-node.js**: This file is where Gatsby expects to find any usage of the Gatsby node APIs (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process.
* **gatsby-ssr.js**: This file is where Gatsby expects to find any usage of the Gatsby server-side rendering APIs (if any). These allow customization of default Gatsby settings affecting server-side rendering.
* **gatsby-browser.js**: This file is where Gatsby expects to find any usage of the Gatsby browser APIs (if any). These allow customization/extension of default Gatsby settings affecting the browser.


Gatsby’s data layer is powered by GraphQL and it allows you pull data into your components
Custom types in Mezon Router
Tags: php, router, mezon, framework
Published: 2020-10-16 05:18:54

Hi!

Since one of the last update of Mezon Router you can define your own types for URL parser. Let's try to create `date` type.

First of all we should create simple class:

```php
class DateRouterType
{

    /**
     * Method returns regexp for searching this entity in the URL
     *
     * @return string regexp for searching
     */
    public static function searchRegExp(): string
    {
        return '(\[date:'.BaseType::PARAMETER_NAME_REGEXP.'\])';
    }
}
```

Here BaseType::PARAMETER_NAME_REGEXP is a global setting wich tells router that parameter names must consist of:

- a-z and A-Z letters
- 0-9
- and symbols _ and -

Now we need to define one more class method wich will parse date if it will occur:

```php
public static function parserRegExp(): string
{
    // pretty simple regexp
    return '([0-9]{4}-[0-9]{2}-[0-9]{2})';
}
```

And somewhere in your setup files you need to switch this type on:

```php
$router->addType('date', DateRouterType::class);
```

Now you can handle routes like this:

```bash
/some-url-part/2020-02-02/ending-part/
/posts-for-2020-02-02/
```

But be careful. For example you will define such routes:

```php
$router->addRoute('/posts-for-[date:posts-date]/', function(UserObject $userObject){
    // some activities here
});

$router->addRoute('/[s:some-url/', function(UserObject $userObject){
    // some activities here
});
```

Then the first handler `/posts-for-[date:posts-date]/` will be called for the route `/posts-for-2020-02-02/`.

# Learn more

More information can be found here:

[Twitter](https://twitter.com/mezonphp)
[Mezon Framework](https://github.com/alexdodonov/mezon)

## It will be great if you will [contribute](https://github.com/alexdodonov/mezon-router) something to this project. Documentation, sharing the project in your social media, bug fixing, refactoring, or even [submitting issue](https://github.com/alexdodonov/mezon-router/issues) with question or feature request. Thanks anyway )
TIL: How to Run Rails Console in Elastic Beanstalk App
Tags: todayilearned, bash, devops
Published: 2020-10-16 05:08:36

I have a Ruby on Rails application deployed to AWS Elastic Beanstalk. Up to this point, I haven't needed to directly run Rails console for my application in production since I am using various admin dashboard plugins to track most things. If not, I can also use AWS Cloudwatch. 
Today, I needed to access the Rails console to run a command for some database management stuff. I ran the standard Elastic Beanstalk CLI command to ssh:
```bash
eb shh
```
But after that, I had an issue trying to run `bundle exec rails c` in `/var/app current`. It just kept giving me errors. After some searching for some help, I came across an excellent StackOverflow article the helped me out.
{% stackoverflow 19620897 %}

It turns out I needed to switch my user to get the job done.
```
sudo su
bundle exec rails c
```
Andddddd done.
Completed Hactoberfest FirstTime
Tags: hacktoberfest
Published: 2020-10-16 05:05:13

## What I Learned From Hacktoberfest

I did not know about this fet till last month but when i got to know about the fest I was very excited to participate and i did my 6 pull request out of which four got selected happy to win a hactoberfest swag. @DigitalOcean
Ignore.java: Skip any throwable code
Tags: tools, softwaredevelopment, programming, template
Published: 2020-10-16 14:11:06

---
title: Ignore.java: Skip any throwable code
published: true
date: 2020-10-16 04:52:35 UTC
tags: Tools,softwaredevelopment,Programming,Template
canonical_url: https://esabook.wordpress.com/2020/10/16/ignore-java-skip-any-throwable-code/
cover_image: https://esabook.files.wordpress.com/2020/10/961100_65484703.jpg
---

> [Fuckit.py](https://github.com/ajalt/fuckitpy) intro:  
> `FuckIt.py uses state-of-the-art technology to make sure your Python code runs whether it has any right to or not. Some code has an error? Fuck it.`

* * *

As frustrated man while writing to many SLOC for ignored exception at java like:

```
try{
    // run.throwable(); 
} catch (Exception ignored){ 
}
```

meanwhile if should writing to many of should ignored code at runtime as like bellow, how to bypass exception?

```
int a = Integer.parse("none"); //should skip error, but runtime exception occurred at this line 
throw new JustSampleIgnoreException(); //should skip error, but not executed 
throw new OtherIgnoreException(); //should skip error, but not executed 
int b = 2/0; //should skip error, but not executed 
boolean c = run.call(); //should skip error, but not executed
```

in traditional java may to use multiple try-catch, like:

```
try{
    int a = Integer.parse("none"); 
} catch (Exception ignored){ 
} 
try{
    throw new JustSampleIgnoreException(); 
} catch (Exception ignored){ 
} 
try{
    throw new OtherIgnoreException(); 
} catch (Exception ignored){ 
} 
try{
    int b = 2/0; 
} catch (Exception ignored){ 
} 
try{
    boolean c = run.call(); 
} catch (Exception ignored){ 
}
```

but no. no. no. its not like as expected where with write long code is not cool.  
I must simplifying code.  
and ahaa, now we can write that to simplified code with small efforts to this:

```
// 0 as default value when error occurred int a = Ignore.get(()-> Integer.parse("none"), 0); 
Ignore.of(()-> throw new JustSampleIgnoreException(), ()-> throw new OtherIgnoreException()); 
int b = Ignore.get(()-> 2/0, 0); 
boolean c = Ignore.get(()-> run.call(), false); 
```

how it work❓ 
try this snippet! ✅

{% gist https://gist.github.com/esabook/a58b0a33d8c99f5b9b19e8be14276307 file=Ignore.java %}

_image source: [https://www.co2partners.com/every-rule-has-an-exception-especially-this-one/](https://www.co2partners.com/every-rule-has-an-exception-especially-this-one/)_
Hactoberfest 2020 Done and Dusted
Tags: hacktoberfest
Published: 2020-10-16 04:30:46

## What I Learned From Hacktoberfest

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->
This was the first time i participated in hactoberfest. It was really a wonderful experience  as through hactoberfest i did my first open souce contribution and got to learn a lot of things about open source community.
Thank you digital ocean for organising such a great event.
Hacktoberfest 2020 contributions 
Published: 2020-10-16 04:05:17

# What is Hacktoberfest?
Hacktoberfest is a month-long celebration of open source software run by DigitalOcean in partnership with GitHub and Twilio. Hacktoberfest is open to everyone in our global community! 

#How to participate?

You just need to make five contributions to open source before October 31 and can receive a free Hacktoberfest t-shirt.

*How can a beginner participate?

Step 1: Register or login to github.com
Step 2: Register to Hacktoberfest.
https://hacktoberfest.digitalocean.com/
Contribute to these four (4) repositories or any others repositories you like, check instructions to contribute in each repositories.
Step 4: Check your progress from here.
Step 5: Digital ocean will ask 
for shipping address via email.
Step 6: Wait for that awesome Hacktoberfest t-shirt from Github & Digital Ocean.

#How to Make contribution to open source `

1] Go to link     https://github.com/DSC-COEA-Ambajogai/Hactoberfest2020
2] fork this  Repositories  into your github account 
3] After fork  write programs as per given  info 
4] make Full request 
5] after pull request it will be merge into  Repositories  as soon as 

After merge it will be updated in Hacktoberfest site 
 As like this we have to make 4 full request after that you are able to get T-Shirt (limited edittion)
Hacktoberfest
Tags: hacktoberfest
Published: 2020-10-16 04:00:15

## What I Learned From Hacktoberfest

1.  Learned how to make pull requests.
2.  Basics of HTML, CSS and JS while contributing to open source.

Hacktoberfest is a great way to contribute and help you improve your skills while contributing to open source.

Thank you hacktoberfest
First Time Contribution in Open Source
Tags: hacktoberfest
Published: 2020-10-16 03:25:16

## What I Learned From Hacktoberfest
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/sgt8jkjyeul921chp0rp.jpg)
<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->
<u>Hacktoberfest</u> is a great way to contribute to open source and help you to improve your skills while contributing to open source. It's a great way to help other's in there projects or repos while doing that you can also polish your skills. Those who are not well versed with GitHub also get to know a lot about it while working with open source.
New Journey begins! #opensource
Tags: hacktoberfest
Published: 2020-10-16 02:44:14

## What I Learned From Hacktoberfest

-> I was an amazing thing to contribute to other projects and was really a learning boost for me
-> I did not know what open source looked like prior to participating in hacktoberfest
-> I loved working with a new community
-> I brushed up the concepts of c programming while trying to make changes in others repositories.
Thank you hacktoberfest