teleren/devto huggingface dataset:
A simple tip for cleaner code
Tags: development, tips, cleancode
Published: 2018-06-01 21:47:19

---
title: A simple tip for cleaner code 
published: true
description: Make your code cleaner by using early returns. 
tags: #development #tips #cleancode
---
    
While working on a codebase that has a lot of legacy code I noticed a lot of functions written like this. For some reason, the older devs in the team preferred to write them this way, and much to my annoyance they still do.


```php
    
        // Not so nice.
        
        function foo($bar)
        {
            
            if ($bar > 0) {
                return "YES";
            } else if ($bar == 0) {
                return "MAYBE"
            } else {
                return "NO";
            }
        }


        // Not so nice as well.
        
        function foo($bar)
        {
            $value = '';            

            if ($bar > 0) {
                $value = "YES";
            } else if ($bar == 0) {
                $value = "MAYBE"
            } else {
                $value = "NO";
            }

            return $value;
        }
```

In my opinion, that's too much noise for your brain, we can make it a lot more readable just by utilising early returns.



```php
        // Very much nice, yes, yes, sexy.

        function foo($bar) 
        {
            if ($bar > 0) {
                return "YES";
            }

            if ($bar == 0) {
                return "MAYBE";
            }
            
            return "NO";    
        }   
            
```  
Isn't it a lot cleaner now? Don't be a dinosaur, use early returns!
How dev.to cleverly used FOMO to attract users to sign in
Tags: meta
Published: 2018-06-01 19:24:08

---
title: How dev.to cleverly used FOMO to attract users to sign in
published: True
description: How dev.to cleverly used FOMO to attract users to sign in
tags: Meta
---

> FOMO
> _/ˈfōmō/_
> anxiety that an exciting or interesting event may currently be happening elsewhere, often aroused by posts seen on a social media website.

It could be just me, but when I opened dev.to for the first time I saw the "bell" icon in the top right corner with a red notification stamp; like the one you'd see on apps when you've got a notification.

![alt text](https://thepracticaldev.s3.amazonaws.com/i/3z4n9d5njn9faevnuv5a.png "dev.to bell with notification")

I... Just... Could not help it... I had to click it...

I thought this was very clever, so my hat's off to whomever came up with that! Had it been the traditional "log in" or "signup" button, I probably would have not clicked it or even considered signing up.

Regardless of the "bell" I would have signed up anyway because I love reading dev.to's awesome community posts! but the "bell" made it a bit more enticing.
Choosing a Front-End Test Automation Framework
Tags: technical
Published: 2018-06-19 17:17:12

---
title: Choosing a Front-End Test Automation Framework
published: true
tags: Technical
canonical_url: https://sendgrid.com/blog/choosing-a-front-end-test-automation-framework/
---

Read how the SendGrid engineering teams choose a new testing automation software for Marketing Campaigns and other front-end applications.

The post [Choosing a Front-End Test Automation Framework](https://sendgrid.com/blog/choosing-a-front-end-test-automation-framework/) appeared first on [SendGrid](https://sendgrid.com).
Introducing our June 2018 sponsors
Tags: meta
Published: 2018-06-01 17:03:31

---
title: Introducing our June 2018 sponsors
published: true
description: Our wonderful sponsors are vital to the health of dev.to and it is great to work with companies contributing so much to the ecosystem.
tags: meta
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ikmc22fxpo8c3sveaw8i.png
---

We are proud to announce our sustaining community sponsors for June. Our wonderful sponsors are vital to the health of [dev.to](https://dev.to) and it is great to work with companies contributing so much to the ecosystem.

In June we have one new sponsor and two continuing sponsors. Please check out their wonderful services.

## Digital Ocean

[Digital Ocean](https://try.digitalocean.com/performance/?utm_source=devto&utm_medium=display&utm_campaign=Devto_2018_Brand) is a much-loved cloud computing platform. I'm always impressed by how well-built _and well-documented_ the Digital Ocean core products are. It's easier said than done, and they've been able to stay ahead of the curve.

## Mapbox

[Mapbox](https://www.mapbox.com/signup/?utm_source=junedevto&utm_medium=devto&utm_content=signup-page&utm_campaign=junedevto) is a collection of mapping, navigation, and location search SDKs—and they are seriously beautiful. If you see an incredible map experience in an app you use it is probably because Mapbox made it possible. It's clear as soon as you get to their landing page that this company has an impressive product built by great engineers.

## Timber

[Timber](https://timber.io/?utm_source=devto&utm_medium=homepage&utm_campaign=devto_may) is one of the most interesting products to take on the logging space. Built around readability and usability, Timber is a logging system you're actually going to be excited about using. We have been Timber users since the beta days ourselves _and we now share an office space with them_. They are doing great work.

Timber currently integrates most seamlessly with Ruby, Elixir and Node applications. It comes highly recommended from our team.

***

These organizations are helping us build the best community we can. I urge you to check out their offerings if you are in the market for their services.

Happy coding ❤️
How to make SharePoint column fields readOnly / Hidden with PnP PowerShell
Published: 2018-06-01 14:48:27

---
title: How to make SharePoint column fields readOnly / Hidden with PnP PowerShell
published: true
description: 
tags: 
---

```Powershell

Param(
    $tenantUrl = "https://YOURSITE.sharepoint.com",
    $spCredential = (Get-Credential),
)

$sites = @("siteOne", "SiteTwo")

foreach($name in $sites) {

    Connect-PnPOnline -Url $tenantUrl/sites/$name -Credentials $spCredential

    #Field Guids

    $Summary = Get-PnPField -Identity 98e1ecf3-3ae3-44a4-820c-f1de12ff346a
    $Country = Get-PnPField -Identity 7d9fd33a-e726-4d7f-b3ed-60e1c8e9690d
    $Location = Get-PnPField -Identity 0d2db348-a438-48f2-bcd2-461acd6f149f
    $Language = Get-PnPField -Identity 81b712c3-a41f-4e65-9a3a-8e7110bd9b5e
    $Topic = Get-PnPField -Identity 5f9fd169-0cf6-4779-a6be-e4635327c9a8

    $columns = $Summary, 
               $Country,
               $Location, 
               $Language, 
               $Topic
               

    foreach ($column in $columns) {

        try{
            $column.ReadOnlyField = $true
            $Column.SetShowInEditForm($false)
            $column.UpdateAndPushChanges($true)
            $column.Context.ExecuteQuery();
        }
        catch{
            Write-Host "error" $columns
        }
    }
    Write-Host "finished updating read Only fields in" $name
}


```
The ForwardJS Battle — Part 2: Ottawa
Tags: datavisualization, node, reactnative, blockchain
Published: 2018-08-28 15:04:27

---
title: The ForwardJS Battle — Part 2: Ottawa
published: true
tags: data-visualization,nodejs,react-native,blockchain
canonical_url: https://branch-blog.qlik.com/the-forwardjs-battle-part-2-ottawa-6b8287364ab
---

With [ForwardJS San Francisco](https://dev.to/qlikbranch/the-forwardjs-battle--part-1-san-fran-4icf-temp-slug-6327752) behind me, I turned my sights on bringing Forward home with me to [Ottawa](https://forwardjs.com/ottawa) for the second year in a row.

![](https://cdn-images-1.medium.com/max/1024/1*1QhTaYQnuOywTusj5758sg.jpeg)<figcaption>Here I am taking ForwardJS Ottawa attendees through Halyard.js.</figcaption>

ForwardJS Ottawa in 2017 was a cool, calm introduction to the Canadian capital. But this year, we wanted to go bigger…and better.

The only way to do that was to pack the conference with great workshops and two days of stellar speakers, and boy did we deliver.

Day 1 saw ForwardJS jump out the gate in full force. With [Andy Mockler](https://medium.com/u/fadbcd01c7a3) and [Kristin Spencer](https://twitter.com/kristencodes) starting the show schooling us on soft skills, the day was filled with awesome talks like [Adam Daw](https://medium.com/u/624aec3174db) touting the [power of transpilation](https://medium.com/coventure/js-minus-js-the-future-of-the-javascript-community-is-better-through-transpilation-b980d59eaa93), [Jan C. Liz-Fonts](https://medium.com/u/6d5313b8bef9) showing how to harness [Blockchain in Javascript](https://forwardjs.com/ottawa/schedule#lecture-403) and [Mary Snow](https://twitter.com/ThisIsMaryCodes) decoding the [NodeJS Event Loop](https://forwardjs.com/ottawa/schedule#lecture-387).

That first day brought so much great knowledge — so the speakers on day 2 really had their work cut out for them. And they were more than up to the task. The day saw [Jenn Voss](https://twitter.com/VossJenn) bring us [Tales from the QA Crypt](https://forwardjs.com/ottawa/schedule#lecture-391), [Eric Adamski](https://medium.com/u/cf9894fccad7)’s amazing energy with [Rx and Async](https://forwardjs.com/ottawa/schedule#lecture-402), [Ksenia Coulter](http://kscoult) teaching us to [Get the Most out of Code Reviews](https://forwardjs.com/ottawa/schedule#lecture-399) and [Brian Tavares](https://twitter.com/_briantavares) closing out with a fantastic [React Native](https://forwardjs.com/ottawa/schedule#lecture-388) talk.

![](https://cdn-images-1.medium.com/max/1024/1*tycsPdCz-1xigrlA5WwMCw.jpeg)<figcaption>ForwardJS donuts, anyone?</figcaption>

I’m more than willing to admit bias and won’t deny it could be in part to my involvement in organizing or the fact it was in my hometown, but in the battle of San Francisco vs. Ottawa I’d say the “north of the border” contender took the ForwardJS crown this year.

* * *
A Comprehensive Guide to React.js and React Native
Tags: react, reactnative, mobileappdevelopment
Published: 2018-06-01 12:10:03

---
cover_image: https://thepracticaldev.s3.amazonaws.com/i/k93qpo1z8k0e359ajea5.jpg
title: A Comprehensive Guide to React.js and React Native
published: true
description: 
tags: React.js, React Native, Mobile App Development 
---
React native is very similar to react.js; however, both come with their own advantages and drawbacks. Developers leveraging these technologies get a mountain of benefits with regards to animations and gestures, development process, DOM and styling, user experience, etc. React.js is a declarative and flexible JavaScript library that allows you to develop dynamic, complex, and interactive user interface (UI) easily for both iOS and Android. Conversely, react native enables you to build cross-platform and native mobile apps and customize the framework to develop applications for Windows and Mac as well.

If you are interested in developing native or hybrid applications and composable UI components and elements using react native and react.js, then **[read this blog post] (https://www.apptechcorp.com/blog/mobile-app-development-an-overview-of-react-js-react-native/)** where you can learn more about these technologies. https://goo.gl/9CbzSJ
I need help creating user dashboard using php
Tags: php, frontend, dashboard, javascript
Published: 2018-06-01 09:10:46

---
title: I need help creating user dashboard using php
published: True
description: I have been programming for a while now, am developing a website that will require a user dashboard. My strong point is JS and other frontend frameworks. I need a step by step process on how to create user dashboard. Thanks a bunch.


tags: php, frontend, dashboard, js.
---
劇的改善！管理人さんが何したかを推察してみる
Published: 2018-03-29 16:18:14

---
title: 劇的改善！管理人さんが何したかを推察してみる
published: true
description: 
tags: 
---

# 劇的改善！おつかれさまでした！！

![改善](https://thepracticaldev.s3.amazonaws.com/i/shhiufekxj3k4s9juetu.png)

- Twitterで本人もツイートしていましたが、主に画像サイズを適切に処理したそうです


# 具体的な対応を推察してみる
- たぶんjetpackとか入れたのかなと予想しつつ詳細をみてみます。
- まぁ、当然これは確認しますよね
![after](https://thepracticaldev.s3.amazonaws.com/i/mpg5iluw452l96we29kg.png)

- 私がchromeでみたので、h2かつwebpで配信され、１画像あたり劇的にファイルサイズが減ってます

- 画像のリクエストをみてみると、
![detail](https://thepracticaldev.s3.amazonaws.com/i/1ztjm90auayk4si5j9bm.png)
- https://i[0-2].wp.com/ で画像が配信されてますね。その時に、画像のリサイズもはいってます。
- わかりやすく、jetpackのphotonですね。 (言い切って間違ってたら恥ずかしいｗｗ)
- photonは導入がらくなのですが、キャッシュが消せないのとか一部デメリットがあるので、それふまえて使う分には良いサービスですね。wordpressと蜜月で導入がとにかく楽です。

# ここまできたら全面https/h2, AMP対応にしてほしい！とか欲張ってしまう (これはエンジニアのエゴ)
- メリットとして、googleのSEOに強くなります。googleはhttpはどんどん非推奨としてランクおとしてますから。
    - [GoogleはHTTPSで保護されていないサイトを「安全でない」とChromeブラウザにハッキリと表示する方針](https://gigazine.net/news/20180209-chrome-http-site-not-secure/)
    - [※2015年の記事です※HTTPS ページが優先的にインデックスに登録されるようになります](https://webmaster-ja.googleblog.com/2015/12/indexing-https-pages-by-default.html)
- https&h2対応すると、UXが向上します。具体的には、h2対応ブラウザ(chromeとか)で見る時に、コンテンツが並列DLされて、表示速度が早くなります（体感でもわかるレベル。WEB屋ならw)
- AMPもmobileで見るときのUXが劇的にあがります
    - でも、AMPプラグインいれただけだと、デザインがクソダサいのでその調整コストが発生します。。

# 何はともあれ、劇的改善、おつかれさまでした！！
Friday Blast #40
Tags: fridayblast, links, post
Published: 2019-01-20 15:25:40

---
title: Friday Blast #40
published: true
tags: friday_blast,links,post
canonical_url: https://horia141.com/friday-blast-40.html
series: "Friday Blast"
---

[The philosophy of computational complexity (2018)](https://ristret.com/s/qk8wpt/philosophy_computational_complexity) - there’s a lot of nice links from this one. The article itself deals with philosophy and what it should absorb from computational complexity. And the undercurrent is that both philosophy, and science has a whole, hasn’t really absorbed all that much from the field. Even though it offers a lot of insights and computational limits crop up in a lot of places - from biology, to economics, quantum physics etc. Also includes a nice discussion on various level of “truthyness” of the `P=?NP` problem, and what that would mean for cryptography and the world in general.

[AI winter is well on it’s way (2018)](https://blog.piekniewski.info/2018/05/28/ai-winter-is-well-on-its-way/) - what is it with AI and overpromising and underdelivering? This would be the second AI winter and third fall of neural networks since the field was invented 50+ years ago. The general trend is that deep learning is not going to solve AGI. Just like SVMs didn’t, or graphical models, or shallow neural networks, or logical models etc. Seems it’s a tough nut to crack.

[In defense of skepticism about deep learning (2018)](https://medium.com/@GaryMarcus/in-defense-of-skepticism-about-deep-learning-6e8bfd5ae0f1) - another “skepticism” camp article about the current deep learning dominance of machine learning and AI research. This one is a more pop-sci answer to a series of questions posted by the author in a scientific publishing setting. The focus is on the flaws of deep learning as a path to AGI mostly.

[After 5 years and $3M, here’s everything we learned from building Ghost (2018)](https://blog.ghost.org/5/) - Ghost is an open source CMS, which competes with the likes of WordPress, Medium etc. It’s pretty well liked in the community, and I’m glad they’re doing alright. I’m also glad to learn that the project is altruistically organized as a charity with very _social_ goals, rather than strictly profit-seeking ones. Other than that, the main takeaway is that building a large OSS project is hard.
How to use SVG on Processing(p5)
Tags: processing, p5, java
Published: 2018-06-01 06:37:10

---
title: How to use SVG on Processing(p5)
published: true
description: p5 tutorial for beginners.
tags: Processing, p5, Java
---

First of all, my sample program is [here](https://github.com/toyotine/processing_graphics_test).

# Prerequisites
You've installed [Processing](https://processing.org/) on your PC/Mac.
Also please get a SVG file to show.

# How to

At first, you have to prepare `PShape` object.
After that, call the `loadShape` method.
```
PShape some_kind_of_shape;
some_kind_of_shape = loadShape("Some_Kind_of_Shape.svg");

```
Actually, I defined PShape variable as static in my sample code for simplicity.

After you've prepared the object properly, just calling `shape` method in `draw` method and you can see your svg.

```
void draw() {
  background(255);
  shape(some_kind_of_shape, position_x, position_y, shape_width, shape_height);
}
```
When hiring, do you ask for age?
Tags: management, recruiting, discuss
Published: 2018-06-01 05:16:17

---
title: When hiring, do you ask for age?
published: true
description: A doubt
tags: management, recruiting, discuss
---

We have been very active hiring developers. I, as manager have to select from the candidates CVs and do follow up interviews.

I never ask age or care about it.

Recently saw a post on Twitter looking for a developer with 1 year experience, and specified age range.

Not sure if this common practice in other countries (I work in Mexico). But I find it that it only reduce options (setting aside that is just descriminatory).

Not sure if there is an actual value on setting an age limit when looking for dev candidates, that I am missing.
Technical interviews suck, but Algorithms and Data Structures don't have to.
Tags: career, computerscience
Published: 2018-06-01 04:07:10

---
title: Technical interviews suck, but Algorithms and Data Structures don't have to.
published: true
description: How I went from dreading to loving technical interviews..
tags: career ,computerscience
---

Like many, I started my journey to a tech career not knowing what technical interviews were all about. What little I knew about them was what I heard from others, namely, that they ask irrelevant questions and ignore job role related skills. Which, I guess, is kind of true.

I decided that I would approach the interview process by preparing for it as if it were a completely separate skill set that I needed to learn, as I would any other skill such as a new language, framework, or API. Truth be told, it was a little more difficult than I expected (more on that later,) but once I got the hang of it I began to appreciate the value of having this knowledge. It has changed the way I approach and solve problems and greatly improved the quality of my code.

YMMV but here is what worked for me:

1. [interviewcake.com](interviewcake.com)

2. Cracking the coding interview by Gayle Laakmann 

3. [leetcode.com](leetcode.com)

The order mattered a lot. Interviewcake really opened the door for me. I had tried leetcode first but I didn't really get it. Cracking the coding interview helped a bit but I wish it had more in the way of explanations to the coding problems. Interviewcake (paid) taught me the rules of the game. Subsequently I was able to make use of the other two resources.

Thanks for reading my first Blog post. You can find me @decentgradient on the twitters.

Oh, If you have a need for a machine learning engineer / developer relations person, HMU I may have someone for you. (It Me)
Hashing vs Encryption
Tags: hasing, encryption, security, cryptography
Published: 2023-01-24 16:06:55

---
title: Hashing vs Encryption
published: true
date: 2018-06-01 00:00:00 UTC
tags: hasing, encryption, security, cryptography
canonical_url: https://www.rocky.dev/blog/hashing-vs-encryption
---

Encryption is a two-way function. You can encrypt data, like a file, and then later decrypt it provided you have the proper encryption key. This is useful when you need to retrieve the original data.

Hashing, on the other hand, is a one-way function. It scrambles the input data into a unique output and you cannot reverse this process to reveal the original data.

How is a non-reversible operation useful? It's more secure for things like passwords. With encryption, the website server needs to have the encryption key to decrypt it. If the server gets hacked, the attackers could get this key and decrypt every user's password immediately.

With hashing, there is no key. Websites don't actually need to know a user's password, they just need to know that what the user enters in the password field matches what is stored in the database. They can do this by taking the password the user enters, hashing it in the same way they hashed it when the user first set it, and making sure both match. If they do, you get to log in.

If an attacker gets a list of hashed passwords, they'd have to generate a bunch of guesses, hash each one using the same algorithm, and compare the result to the hashed values one-by-one.
Architectural styles
Tags: discuss
Published: 2018-05-31 18:34:55

---
title: Architectural styles
published: true
description: Which artitectural styles do you follow?
tags: #discuss
---
Which architectural styles are you using in your applications?
I am thinking of monolithic, client-server, event-driven, service oriented and the like.

What made you chose the style? In the context of which kind of applications? What are your experiences with it?
I have been a professional developer for 31 years and I'm 53 now, Ask Me Anything!
Tags: ama
Published: 2018-05-31 18:13:15

---
title: I have been a professional developer for 31 years and I'm 53 now, Ask Me Anything!
published: true
tags: ama
---

I've been a professional developer since I graduated in 1987. I am currently the lead for a team of five (including myself) doing front-end development on SaaS software (official title is Application Architect). Apparently, at 53 and still up-to-date and still developing I've become a novelty :)

Ask away...
Hashing in Action: Understanding bcrypt
Tags: hashing, bcrypt, websecurity, cybersecurity
Published: 2018-05-31 15:38:56

---
title: Hashing in Action: Understanding bcrypt
published: true
description: Learn about the design and specifications that make bcrypt a cryptographic security standard.
tags: #hashing #bcrypt #websecurity #cybersecurity
canonical_url: https://auth0.com/blog/hashing-in-action-understanding-bcrypt/
---

The bcrypt hashing function allows us to build a password security platform that scales with computation power and always hashes every password with a salt.

Learn about the design and specifications that make bcrypt a cryptographic security standard.

[Read on 🔐#️⃣](https://auth0.com/blog/hashing-in-action-understanding-bcrypt/?utm_source=dev&utm_medium=sc&utm_campaign=dasec_bcrypt)

![Hashing in Action: Understanding bcrypt](https://thepracticaldev.s3.amazonaws.com/i/cdxpiz67ip47ul6p8xhk.png)
How do you transition towards conventions?
Tags: discuss
Published: 2018-05-31 15:38:09

---
title: How do you transition towards conventions?
published: true
description: When you have an idea that you want to codify or conventionalize what was once freeform, what are the steps in doing this?
tags: discuss
---

I've found myself in situations where we want to adopt a convention, but there is some hesitation, over-analysis or roadmap uncertainty.

When you have an idea that you want to codify or conventionalize what was once freeform, what are the steps in doing this?