teleren/devto huggingface dataset:
OOP vs FP
Tags: functional, oop, explainlikeimfive, discuss
Published: 2019-07-18 16:55:43

Today I opened Medium and found [this](https://medium.com/better-programming/object-oriented-programming-the-trillion-dollar-disaster-%EF%B8%8F-92a4b666c7c7) article in "Your Daily Read". I read it and, well, I got angry that Medium recommended it to me. I found it completely unreasoned. I thought this post is one of "if you want hype, just write any article about popular theme". That's why I wrote [this](https://medium.com/@aka_dude/what-i-learned-from-the-article-there-are-programmers-who-dont-really-understand-what-they-are-ae846936e6f3) comment. Later author banned me :)

I wanted discussion. Please explain me where I am wrong and why it is not possible to write *good* OOP code.
Learning Should Be Fun: ReactJS + Twitch API Tutorial
Tags: react, javascript, webdev, tutorial
Published: 2019-07-18 16:48:44

## How many todo apps and calculators does the world need?
Learning to code is hard, which makes it tough to stay motivated sometimes. It doesn't help that most beginner tutorials are almost always the same rehashed projects that are not only boring to follow but won't help you get a job

IMO the best way to learn is mixing together things you enjoy to create something new. One example would be combining programming with gaming by using the Twitch API

{% youtube VTY6ZzDTV3A%}

I made this tutorial with beginners in mind. Once you're done with this tutorial you'll have a number of options available to extend the base project to make something unique for your own portfolio. Some examples of features you could add:

* create a real time dashboard of stats using a charting library and making API calls every minute to update the view counts
* create a profile route and embed the stream instead of linking directly to twitch https://dev.twitch.tv/docs/embed/
* change up the styling on the cards used to display our data from the Twitch API
* add some error handling to handle stuff like API limits or outages
* add a loading component to wrap around our lists to show a loading icon until the API call has returned
* break out some of the repeated logic like replacing the URLs and make a List component and Card Component for the repeated UI logic

This tutorial does assume you have some basic knowledge of ReactJS, so make sure you've at least gone through the main [Reactjs Getting Started Guide](https://reactjs.org/docs/hello-world.html) and understand the basic concepts of React like JSX, state management, and how to work with components.

When you're done feel free to leave a link to your project so others can see what you made.
The Sales Pitch of Static Site Generation
Published: 2019-07-18 16:37:53

---
title: The Sales Pitch of Static Site Generation
published: true
description: 
tags: 
---

I have recently developed a static site generator tool called [Orison](https://orison.alexlockhart.me) and for this reason among others I have been trying to "sell" people on static site generators; developers, architects, and non technical folks included. For many people the term "Static Site Generation" is synonymous with "small blog", "personal site", and "trivial use case" instead of phrases like "enterprise scale" and "unbeatable performance".

I am very thankful for everything that [Netlify](https://www.netlify.com) has done to popularize static site generation. However I wander if the naming of the term turns people away. In technical articles, presentations, blog posts, and in person discussion I often use the term "build tool", "build process" or something of that sort to describe the role that the static site generator plays in the [JAMstack](https://jamstack.org) architecture.

I am curious as to what you have found. Is there a better term that I am missing? Should we instead focus on rebranding the term "static site generator"? Does it even matter?

Thank you ahead of time for any responses. The subjective human experience is often an under realized blocker to technology and especially in this case one that I think would be worth discussing.
Sizing AWS EFS bursting-mode to your application
Tags: aws, efs, filesystem
Published: 2019-07-18 15:39:44

[AWS Elastic File System](https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html) is a great tool for using shared storage in auto scaling group situations. There are two throughput modes to choose from for your file system, *Bursting Throughput* and *Provisioned Throughput*. With Bursting Throughput mode, throughput on Amazon EFS scales as the size of your file system in the standard storage class grows. EFS performance is [well documented in this AWS knowledge base article](https://docs.aws.amazon.com/efs/latest/ug/performance.html), so we won't get too in-depth here.

One caveat with **Bursting Throughput** that we'll discuss in this post is bursting limitation for small file systems.

![perf table](https://snag.gy/rZwujR.jpg)
As you can see above in the table, the lower the *File System Size (GiB)* the lower the *Baseline Aggregate Throughput (MiB/s)*.

To ensure you have proper initial baseline aggregate throughput, you'll need to **increase the file system** size using the tool `dd`. Once you have an EFS file system created and mounted (in this example, it's mounted /efs) use the following command to increase the size to 256GB:

    cd /efs
    sudo nohup dd if=/dev/urandom of=2048gb-b.img bs=1024k count=256000 status=progress &

The 256GB value can be changed by modifying the `count=`argument, but bear in mind the above table for allowed % of time for bursting.

Deployed applications such as mounting your Jenkins share in an EFS mount will benefit from this. The Jenkins `/workspace` path for example, requires many burstable writes dependent on the job\pipeline\project count.
Do you report bugs you run into on other websites?
Tags: discuss, testing, bugs
Published: 2019-07-18 14:55:31

---
title: Do you report bugs you run into on other websites?
published: true
description: Do you report bugs or issues on other websites? How do you reach out?
tags: #devdiscuss, #testing, #bugs
cover_image: https://images.unsplash.com/photo-1472737817652-4120ab61af6c?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80
---

Maybe it's just me and my Bug Queen reputation, but if I see something on a website that's not working properly - whether it's a design issue on someone's portfolio or a functionality bug for a service, it's hard for me to ignore. 

I've started to wonder if it's just my anal nature, or if others do this too.

Generally if I see an issue on someone's personal website, I'll try to DM them on Twitter. But if their DMs are closed, I tend to stop there. There are a lot of websites that make it hard to report as well - while I was sourcing images for this post, I ran into an Unsplash issue! 😂 They have a handy form that displays when they have a known outage, but also [a help article detailing how to report an issue or bug](https://help.unsplash.com/en/articles/2610286-report-a-bug-or-issue-on-unsplash).

Basecamp has great Twitter support, and they're super responsive via DM.

And of course, open source projects [like DEV.to!](https://github.com/thepracticaldev/dev.to/issues) make it pretty easy to create an issue in Github.

For websites that don't make it so easy, do you even bother? Do visual or functionality bugs not bother you? How do you reach out? What kind of info do you provide?
My Shame
Published: 2019-07-20 18:08:03

---
title: My Shame
published: true
tags: 
canonical_url: https://jacoby.github.io//2019/07/18/my-shame.html
---

[![My Shame](https://jacoby.github.io/images/my_shame.png)](https://twitter.com/JacobyDave/status/1151577935117279232/)

I tweeted this, saying “my shame”.

In the beginning there was **`format_all_that_data`**. It was an internal function that took a big data structure and turned it into HTML.

Using Perl’s `CGI.pm` to create the HTML. I knew this was a bad idea a decade before, but it was the lab style, and it took a while before I understood Template Toolkit (and other templating engines) as the way of the future.

I needed to make changes, but I had to work in production (a situation I still have yet to escape) and wanted to keep the old one working, so I called it **`format_all_that_data_new`** , and when it was done, I changed the places I knew used `format_all_that_data` to `format_all_that_data_new` and made it so that `format_all_that_data` returned an empty string. That way, if output was expected but not forthcoming, someone would tell me.

And then I was asked to do a few small changes. One change would be fine; do it, test it, release it, forget it. But there were more changes, which is enough to dive onto templating and fixing a lot of other stuff in that program. And again, I am developing in production, so I create **`format_all_that_data_tt`** , which uses [Template Toolkit](http://www.template-toolkit.org/) to do the HTML _correctly_.

And, once I have it, I want to switch over, but I want to minimize the changes, so I move `format_all_that_data_new` to **`format_all_that_data_old`** , so that it and all the knowledge I stuck into it and fear to remove are there but not gone.

So I rewrote **`format_all_that_data_new`** to, in it’s entirety:

```
sub format_all_that_data_new($data) { format_all_that_data_tt($data) }

```

I keep dead code because I fear, and add cruft to route around it.

This is my shame.

#### If you have any questions or comments, I would be glad to hear it. Ask me on [Twitter](https://twitter.com/jacobydave) or [make an issue on my blog repo](https://github.com/jacoby/jacoby.github.io).
Tic Tac Toe (VS A.I.) v.2
Tags: codepen, javascript, ai, gamedev
Published: 2019-07-18 14:45:47

<p>This is just a simple tic tac toe game v.s. AI.</p>

<p>Yes, I tried to do this, because I want to learn how to think of an algorithm for AI. Though, the current algorithm of this game is not that good, yet.</p>

<p>For the layout, it was also a good opportunity for me to learn about the CSS property; `display: grid;`.</p>

<p>The time I did this pen, I don't know yet about frameworks, so I only used VanillaJS (A plain Javascript, and without libraries, nor framework).</p>

{% codepen https://codepen.io/takaneichinose/pen/WLOJJL %}
How JavaScript Can Be Used To Accept Friend Request in Facebook & Invitation in LinkedIn?
Tags: javascript, beginners, webdev
Published: 2019-07-18 14:36:00

**JavaScript :**
JavaScript is one of the famous and most used scripting language in the cross platform or web platform. Its easy to learn and also used html and web.

A few weeks ago I was working on **‘getElementsByName()’ & ‘getElementsByClassName()’** methods of JavaScript and Found something special about these two function after implementing them on **‘Social Media Platforms like : Facebook and LinkedIn. These two methods helped me to accept the friend request in Facebook and accept invitation in LinkedIn.’**

**getElementByName() Implementation In Facebook:**

So firstly I opened up my ‘VSCODE’ editor in my system then wrote a script with my friend that helped me to accept friend request in my **Facebook** account.

![](https://thepracticaldev.s3.amazonaws.com/i/7cdz4x3blgxdb3x4gkss.jpeg)

Then fired up my chrome browser login to facebook account and open developer option using **‘ctrl+shift+i’** and pasted my script into a console box of developer option and hit enter . And it was successfully executed.

**Console Box in chrome developer option →** 
![](https://thepracticaldev.s3.amazonaws.com/i/mylvtxbfvfa2f0hhiep7.jpeg)

![](https://thepracticaldev.s3.amazonaws.com/i/imr0lem062aa0ci73yyo.jpeg)

**The script is available here →** 
https://github.com/ankitdobhal/javascript-console/blob/master/Javascript-programming/facebook.js

**getElementsByClassName() Implementation In LinkedIn:**

I fired up my **‘VSCODE’** editor again and wrote a script which helped me to accept invitation in **LinkedIn**.

![](https://thepracticaldev.s3.amazonaws.com/i/9uavblnccgih0g219w24.jpeg)

Then in my chrome browser I opened **‘developer option’** using **‘ctrl+shift+i’** and pasted this script into the console box and hit enter.

**Console Box in chrome developer option →** 

![](https://thepracticaldev.s3.amazonaws.com/i/aqabbt17w8eebv8nfdi2.jpeg)

![](https://thepracticaldev.s3.amazonaws.com/i/kg0yxv6874p6l7orc0w5.jpeg)

**The script is available here →** 
https://github.com/ankitdobhal/javascript-console/blob/master/Javascript-programming/linkedin_script.js

This shows that **JavaScript** is one of the power-full scripting language in cross platform and web.
How Loyal Should We Be to Our Employers?
Tags: discuss, career
Published: 2019-07-18 14:23:55

---
title: How Loyal Should We Be to Our Employers?
published: true
description: A discussion on how the DEV community considers their obligation to their coworkers, managers, and company at-large.
tags: discuss, career
---

Ultimately, our employment is a transaction. We provide skills and knowledge; they compensate us financially—or with ping-pong and LaCroix.

Beyond staying long enough, working hard enough to make sure the job is done: What do we owe? What, _if anything_, has inspired you to give more of yourself? What has caused you to be defensive and lookout for yourself?
Rolling out your own MOM or how I did it - General Introduction
Tags: cpp, messageorientedmiddleware, messaging, seastar
Published: 2019-07-18 14:22:35

---
title: Rolling out your own MOM or how I did it - General Introduction
series: MOM Series
published: true
description: 
tags: cpp, message-oriented middleware, messaging, seastar
---

# Introduction
This is a series of posts in which I share my experience building a very basic Message-oriented middleware for my end-year project at university. It presents the design of the system and shows it's source code.

Through this project, I want to provide an infrastructure that enables  enterprises to implement integration solutions for their systems. Here, by integration I mean communication between different applications of an enterprise. More specifically, This communication follow the messaging integration style.

Warning: This is my first attempt building this kind of project, therefore, you should not take anything here as best practice or the right way to do things unless it's stated with a reference. It's best to consider this as a prototype. Moreover, it was for university so many design decision was taken with that in mind.



- In Part I, we will present the architecture of the system and introduce it's main components(Messaging model, protocol, modules...) along with the frameworks/tools we will be using. This is more like a general overview of what we are going to work on.

- In Part II, we give a short introduction on Seastar then we start coding our "server", the main entry point of our application. And finally we show how to compile the project.


- Part III of this series is on the Messaging Model designed for the MOM.  Questions like what is it, why do we need one... will be explored. Also, in this part, we show the implementation of Mess. Model.

- Part IV will discuss Moza protocol(weird name I know). Here we will present the protocol, explain it and show the structure of it's PDUs. Moreover, we will implement a cli to interact with our MOM.


Note: I am not sure if this is all I want to write so I may add other parts.

I hope that this series will be helpful and informative for many of you. Specially the protocol section and the use of Seastar. You should note that I didn't use the full potential of Seastar in this first version but I plan to make changes that will improve the performance.

To conclude, I would like to thank god that without him none of this(projects, posts, my C++, name it ...) would had happened. Also, I want to give a special thank you message to: Matt Godbolt for the great discussions we had (either on this project or other cppish things), bjarne stroustrup for C++, Alexander Stepanov for STL and EoP, Sean Parent for his talks, Jon Kalb for Cppcon and the c++ committee for working on making C++ a better language.
Microsoft Flow: Feeding Forms data to Dynamics 365 CRM
Tags: development, crm, dynamics, flow
Published: 2022-06-15 17:25:07

---
title: Microsoft Flow: Feeding Forms data to Dynamics 365 CRM
published: true
date: 2019-07-18 14:20:00 UTC
tags: Development,CRM,Dynamics,flow
canonical_url: https://barretblake.dev/2019/07/microsoft-flow-feeding-forms-data-to-dynamics-365-crm/?utm_source=rss&utm_medium=rss&utm_campaign=microsoft-flow-feeding-forms-data-to-dynamics-365-crm
---

One of the most universal pieces of any company website is the 'Contact Us' page. There are countless ways this is handled. At the simplest it can just open a mailto link. Sometimes there's an inline form of some sort that feeds into some app somewhere. A lot of times it will require someone along the process to take the data from that form and copy/paste it into the whatever Customer Relationship Management system the company uses.

The post [Microsoft Flow: Feeding Forms data to Dynamics 365 CRM](https://barretblake.dev/2019/07/microsoft-flow-feeding-forms-data-to-dynamics-365-crm/) first appeared on [Barret Codes](https://barretblake.dev).
WordPress Performance & Digging into PHP
Tags: php, wordpress
Published: 2019-07-18 14:12:02

OPTIMIZING YOUR PHP CODE FOR HIGHER PERFORMANCE
In general, optimizing your PHP code for higher performance fits into two categories:

- Running less code
- Making fewer calls to external resources.

RUNNING LESS CODE

Running less code is done in both the obvious way; turning off plugins where the feature adds little value and, the less obvious way; transient caching and code optimization.

Transient caching is pretty straight forward:

- Find a section of code that takes a lot of time to produce some HTML.
- Figure out if it’s personalized, or can be cached globally or as some group of variants.
- Use the WordPress Transients API to cache that HTML.

A tool like New Relic can help you identify slow chunks of code, so you can make those fixes efficiently.

Transient caching can also be used for datasets instead of just HTML but, in general, the closer to final output that you can do caching, the more impact you will have.

Code optimization is harder, which is where you likely need a developer to dig into things. It might be as simple as switching to a more efficient algorithm, but often it will take a larger rethink and rework of how things are being done.

MAKING FEWER EXTERNAL CALLS

When you make a MySQL query or an http request to an API like Twitter, PHP sits and waits for the response.

You want to do less of this.

The Transients API can be the answer here, caching the data from API calls where it doesn’t need to be fresh. On the database side, you might be able to fetch less data from smart page design.

Does a page really need to show content from 100 posts at once? Probably not.

TL;DR
Huge wins are possible, but look for easy wins from transient caching and design first.

When it comes to your site’s performance, and how PHP effects that, it’s all about being smart. Understand what’s needed in terms of PHP worker counts vs CPU cores, and how to use your resources efficiently without extra code hanging around to slow things down.

If it’s over your head, talk to a managed WordPress host that can help alleviate the pressure and get things running smoothly.

Read the whole post at https://pagely.com/blog/wordpress-performance-php/
What's coming in Python 3.8?
Tags: python
Published: 2019-07-18 14:09:35

---
title: What's coming in Python 3.8?
published: true
description: python
tags: python
cover_image: https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fga-core.s3.amazonaws.com%2Fproduction%2Fuploads%2Fprogram%2Fdefault_image%2F5187%2FCode_Python_Intro_Mac_Laptop.jpg&f=1
---
What will be added to Python 3.8? Quite some changes. Don't know Python, it's a good time to <a href="https://pythonprogramminglanguage.com/">start</a>


* The walrus operator

The walrus operator will be addded (:=). That's because with a bit of imagination it looks like a walrus.

    m = re.match(p1, line)
    if m:
        return m.group(1)
    else:
        m = re.match(p2, line)
        if m:
            return m.group(2)
        else:
            m = re.match(p3, line)
            ...

becomes:

    if m := re.match(p1, line):
        return m.group(1)
    elif m := re.match(p2, line):
        return m.group(2)
    elif m := re.match(p3, line):

<img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FnEgEKC8OVA4YU%2Fgiphy.gif&f=1">

* Debug support for f-strings

What are f-strings you say? You can easily output stuff:

    answer = 42
    f'The answer is not {answer+1}'
    f'The root of the answer is {math.sqrt(answer)}'

A lot easier than adding + str(answer) and that kind of stuff. 

* Positional-only parameters
* A movable __pycache__

and more things. Your old Python 3.x code will still work.

Related links:

* <a href="https://lwn.net/SubscriberLink/793818/0c6f9dd271021cd4/">What's coming in Python 3.8</a>
* <a href="https://pythonprogramminglanguage.com/">Learn Python Programming</a>
Work hours, 9-5?
Published: 2019-07-18 13:59:10

---
title: Work hours, 9-5?
published: true
description: python
tags: python
cover_image: https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Ftse3.mm.bing.net%2Fth%3Fid%3DOIP.7USmhVxn6Ykf7D0WKfCLQgHaE8%26pid%3DApi&f=1
---
In offices developers often work a 9-5 schedule. Is this the most efficient? 

If you look at what time famous programmers work, <a href="https://ivan.bessarabov.com/blog/famous-programmers-work-time">that doesn't really overlap</a>. 

<img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fthumbs.gfycat.com%2FAnguishedWeepyBluebottlejellyfish-mobile.jpg&f=1">

One does most work between 07:00 and 20:00. Another 10:00 to 17:00. Brad Fitzpatrick has an interesting schedule, he is not working on the projcet between 09:00 to 15:00. Or perhaps he is working 24/7.

<img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Ftse4.mm.bing.net%2Fth%3Fid%3DOIP.2r8Pmx0BfjHw0O799x9hHAHaEO%26pid%3DApi&f=1">

Some of these must be automated, which programmers is working 24/7?
Others have a schedule that involves sleep:

    00 -   29 ****
    01 -    1
    02 -    1
    03 -    5
    04 -    0
    05 -    5
    06 -   19 **
    07 -   62 *********
    08 -   80 ***********
    09 -  126 ******************
    10 -  240 ***********************************
    11 -  338 *************************************************
    12 -  184 ***************************
    13 -  339 **************************************************
    14 -  317 **********************************************
    15 -  301 ********************************************
    16 -  264 **************************************
    17 -  224 *********************************
    18 -   73 **********
    19 -   69 **********
    20 -   91 *************
    21 -   79 ***********
    22 -   64 *********
    23 -   51 *******


All of them seem to have a peak time of most commits. It slowly builds up to that peak time. This represents the normal distribution. All seem to follow the normal distribution, only that it is shifted.

That would mean that the optimal time for a programmers most efficient work is not the same. Thus when you have everyone working the same hours, you don't get the optimal result.

<img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FT8Dhl1KPyzRqU%2F200.gif&f=1">

*My first software manager said that the most you can get out of people is five hours of real work a day. She also said that programmers need to learn to tell when the most productive thing they can do is go look out the window.*


Related links:
* <a href="https://news.ycombinator.com/item?id=20363095">Expecting programmers to problem solve for 8 hours is stupid</a>
* <a href="https://pythonprogramminglanguage.com/">Learn Python Programming</a>
* <a href="https://pythonprogramminglanguage.com/python-machine-learning/">Machine Learning tutorial - can it reduce work time?</a>