teleren/devto huggingface dataset:
★ When empty is not empty
Tags: php
Published: 2020-01-02 23:00:32

---
title: ★ When empty is not empty
published: true
date: 2018-05-19 07:41:22 UTC
tags: php
canonical_url: https://freek.dev/1057-when-empty-is-not-empty
---

Recently when I was working on a project I got some strange results when using the `empty` function. Here's what I was debugging. I've simplified the code a bit to share with you.

```
var_dump(
   $person->firstName, 
   empty($person->firstName)
);
```

This was the result:

```
string(5) "Freek"
bool(true)
```

That's really odd. How can a variable hold a string and be empty at the same time? Let's try a few other functions on `$person->firstName`:

```
var_dump(
   $person->firstName, 
   empty($person->firstName), 
   isset($person->firstName), 
   is_null($person->firstName)
);
```

The result:

```
string(5) "Freek"
bool(true) // empty
bool(true) // isset
bool(false) // is_null
```

`isset` and `is_null` behave like expected, only `empty` returns the wrong result.

Let's take a look at the implementation of the `Person` class.

```
class Person
{
    protected $attributes = [];

    public function __construct(array $attributes)
    {
        $this->attributes = $attributes;
    }

    public function __get($name)
    {
        return $this->attributes[$name] ?? null;
    }
}
```

Here you can see that the properties on a `Person` object are retrieved from the `$attributes` array using that magic `__get()` method.

When passing variables to normal functions `$person->firstName` will be evaluated first. The result of that evaluation will get passed to the function.

But `empty` is not a function, it's a language construct. So what you pass to it will not be evaluated first. When passing `$person->firstName` to it, it will check the contents of the `firstName` property on `$person`. Since that property doesn't exist, it will return `false`.

If you want to make the `empty` function work in this case you'll need to implement the magic `__isset` method.

```
class Person
{
    protected $attributes = [];

    public function __construct(array $attributes)
    {
        $this->attributes = $attributes;
    }

    public function __get($name)
    {
        return $this->attributes[$name] ?? null;
    }

    public function __isset($name)
    {
        $attribute = $this->$name;

        return !empty($attribute);
    }
}
```

When `empty` does it's job it'll use that magic method to determine the result.

Let's try dumping again:

```
var_dump(
   $person->firstName, 
   empty($person->firstName)
);
```

The new results:

```
string(5) "Freek"
bool(false)
```

Perfect!
The 5am club? Just crazy to do it
Tags: lifestyle, the5amclub, remotework
Published: 2018-10-12 08:39:04

---
title: The 5am club? Just crazy to do it
published: true
tags: #lifestyle #the5amclub #remotework
canonical_url: https://avelino.run/the-5am-club-just-crazy-to-do-it/
cover_image: https://avelino.run/The-5am-Club-It-Can-Change-Your-Life.png#center
---

Have you ever heard of **[#the5amclub](https://the5am.club/)**? Do you know how powerful the range of 5 to 8 A.M.?

{% twitter 989811820864180225 %}
*Sorry tweet in pt-BR*

Few people are willing to wake up at 5 A.M. by choice, but that's exactly what makes the most successful people in the world, the 5am club class, the `high achievers`.

Who does this madness? **Tim Cook** (Apple's CEO), **Richard Branson** (from Virgin), **Robert Iger** (from Disney), **Howard Schultz** (from Starbucks) and **Benjamin Franklin** are some of the people who adhered to this lifestyle.

**[Understand why every day the club wins more fans!](https://the5am.club/)**
Insights: 2018 Ruby on Rails Community Survey
Tags: rails, community
Published: 2018-05-18 21:10:00

---
title: Insights: 2018 Ruby on Rails Community Survey
published: true
description: The results from the 2018 Ruby on Rails developer community survey are in. Here are a few key insights on what we're seeing amongst our peers based on their survey responses.
tags: rails, community
canonical_url: https://medium.com/@robbyrussell/insights-2018-ruby-on-rails-community-survey-30632eccf1f3
---

We recently published the [final results](http://rails-hosting.com/2018/) from our semi-biennial survey that we've been conducting for nearly a decade. Over 2,000 Rails developers responded from 72 different countries across the globe. We posted a collection of articles about a few of the results that caught our attention:


* [The State of Test Coverage in Rails](https://blog.planetargon.com/entries/the-state-of-test-coverage-in-rails)
* [Keeping Ruby on Rails on Track with Containers](https://blog.planetargon.com/entries/keeping-ruby-on-rails-on-track-with-containers)
* [Code Quality Matters in Rails](https://blog.planetargon.com/entries/code-quality-matters-in-rails)

In addition, I've prepared a short video presentation to talk through further data points that were a bit surprising…while injecting my take on what might be contributing to them.

_Are Rails developers keeping their apps updated? Is Ruby on Rails attracting new developers? What RubyGems are keeping developers awake at night? …is Ruby on Rails dying?_

{% youtube 1cdUIVWzn5M %}


If you're interested in learning more about the state (and history) of the Ruby on Rails community - visit [http://rails-hosting.com/](https://rails-hosting.com/)

What were you most surprised to learn about in this year's survey results?
Microsoft Build 2018 Recap talk at NYC Mobile .NET Developers User Group
Tags: microsoftbuild, visualstudiolives, xamarin, visualstudioforma
Published: 2019-11-05 14:21:07

---
title: Microsoft Build 2018 Recap talk at NYC Mobile .NET Developers User Group
published: true
date: 2018-05-18 18:35:50 UTC
tags: microsoft-build,visual-studio-live-s,xamarin,visual-studio-for-ma
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/1024/0*51NNBW2vxpRgAtU8.)<figcaption>Microsoft Build @ Seattle, WA. May 7–9</figcaption>

Last week, I got to co-deliver an interesting talk (with [Sara Morsi](https://twitter.com/eowyn327?lang=en) as co-speaker) at the [NYC Mobile .NET Developers User Group](https://www.meetup.com/nycmobiledev). We curated a selection of topics, from our recent experience at [Microsoft Build](https://www.microsoft.com/en-us/build), this past May 7–9, in Seattle, WA.

Some of the topics at Build we found most relevant for Xamarin Developers include:

1. Hyper-V Android Emulator Support  
2. Visual Studio Tools for Xamarin  
3. Platform Improvements  
4. Xamarin Forms 3.0  
5. Fluent Design for UWP  
6. Visual Studio Live Share  
… and much more …

Follow this link to the [presentation](https://megsoftconsulting.com/download/microsoft-build-2018-recap-for-mobile-developers/), as well as the [meetup](https://www.meetup.com/nycmobiledev/events/249062226/) notes.
Not UX VS UI But UX and UI
Tags: ux, ui, webdev, frontenddeveloper
Published: 2018-03-25 00:39:49

---
title: Not UX VS UI But UX and UI
published: True
description: 
tags: #UX,#UI, #webdev,#frontend developer
---

Nowadays many developers confused UX for UI, a time they mixed up everything. Therefore I have decided to a short article to clear the mixup and make you understand UX and UI properly.Let start by defining what UX and UI are. The web user experience (UX) is the abstract feeling and joy people get from using a website while user interface (UI) is what people interact with as part of that experience.   
When designing a website, you want your UX to be as positive as possible, you want your users to enjoy being on your website, that is the point huh. For you to achieve that you cant just say let’s improve the UX rather it is the UI that is responsible for it.I’ll start by giving an overview of UI with some examples, and explain some ways to help you understand why a good UX depends on a good UI, and why it is always easier to create a UI instead of UX

**What is web UI**

Let say a designer chooses to include the option of dragging files around as a means of organizing content that is UI. When a user prefers the site over its competitor because they like it how simple it is that is UX. So, therefore, web UI is the design, presentation, and execution of the elements that make up a webpage. 

**Why We Build UI Instead of UX**

Shawn Borsky, UI/UX Lead Designer at Rivet Games, reminds us that the UX is more than just the result of UI. According to him, the UX is the “nucleus of a brand,” with the brand itself being “the sum of the experiences that a person has with a company or organization.” That puts a positive UX as not just the goal of UI, but the goal of all interaction with an organization.

Every detail a website puts forward contributes to its users’ experiences and to the memories and impressions they form when using the site but the site designers can’t control that experience directly. As you can see in the below illustration, it’s easy to get tunnel vision and focus just on the UI because it’s tangible versus crafting the whole experience just like enjoying the food on the table.
     ![Image from Pexel](https://thepracticaldev.s3.amazonaws.com/i/jnd4u7806b27xgdk7kwt.jpeg "*Image from pexel*") 
Likewise, if you're cooking, you want to put a lot of thought into it, right? You hand-pick all the best ingredients, choose the best recipes and follow them carefully, and you may even put out a nice centerpiece to create the right atmosphere. Well, a website is no different. You want to plan everything
perfectly so that your visitors have a good time. That’s why it’s only worthwhile to focus on the details
of UI if you keep the UX in mind. If a UI is built with attention and care, then it will show in the UX. If the UI is built haphazardly and with little effort, then the UX will likely suffer. I think with this write-up have clear your doubt about UI and UX. For more details check out: Web UI Design Best Practices by Chris Bank
Async + Await refactor, which do you like best?
Tags: javascript, es6, promises, discuss
Published: 2018-05-18 18:08:19

---
title: Async + Await refactor, which do you like best?
published: true
description: Async + Await is soo good.
tags: javascript, es6, promises, discuss
---

<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Async + Await is sooo good once you get the hang of it. Just refactored this piece of code and removed a lot of indentation levels. Removing indentation levels is always good. <a href="https://twitter.com/hashtag/javascript?src=hash&amp;ref_src=twsrc%5Etfw">#javascript</a> <a href="https://twitter.com/hashtag/es6?src=hash&amp;ref_src=twsrc%5Etfw">#es6</a> <a href="https://t.co/zfFEDyJU0B">pic.twitter.com/zfFEDyJU0B</a></p>&mdash; Wilbur Powery (@wilburpowery) <a href="https://twitter.com/wilburpowery/status/997281352910278656?ref_src=twsrc%5Etfw">May 18, 2018</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Who is hiring? (As of May 2018)
Tags: whoishiring
Published: 2018-05-18 16:34:26

---
title: Who is hiring? (As of May 2018) 
published: true
description: Members of the dev.to community sharing open job opportunities at their companies.
tags: whoishiring
---

This is our monthly thread where community members share openings at their companies.

Here a few ground rules:

- Please only post if you are personally part of the hiring company (no recruiting firms)
- Please provide brief background on what your company does
- Only one post per company (you can list multiple openings in the post)

Consider using this template:

```
Company Name | Job Title | Location | Remote or Onsite | (optional) Salary Range

About the company — background, size, etc (1-3 sentences)

About the role(s) — languages, requirements, etc (1-3 sentences)

Do you sponsor visas?

How to Apply — email or application link
```

---

We also wanted to share some quick careers-related notes from our fantastic Sustaining Sponsors.

### Pusher

> At **Pusher**, we’ve built an incredibly successful business from our core pub-sub API product, helping tens of thousands of developers build scalable web and mobile apps faster.  We’ve spent the last 18 months investing in a new platform — making it easier to develop innovative new products like Chatkit, TextSync, and Pusher Beams.  
> We believe our products can only be successful if they provide great developer experience, which starts with easy to use, consistent SDKs.  We are hiring across technical and engineering roles, check out our openings [here] (https://pusher.com/careers).

### Digital Ocean

> At **DigitalOcean**, we're simplifying cloud infrastructure for developers. Here you'll get to work with some of the smartest and most interesting people around; solving unique and complex technical challenges on a scale matched by few companies. If you get excited about stretching yourself in new ways, developing yourself to your fullest potential, with amazingly supportive friends and colleagues; [we want to talk to you](https://www.digitalocean.com/company/careers/?utm_source=devto&utm_medium=display&utm_campaign=Devto_2018_Brand)!

### Bugsnag

> At **Bugsnag**, we’re building powerful tools that help developers detect, prioritize, and resolve application errors more efficiently than traditional tools. Our technology is used by over 4,400 of the world’s leading engineering teams, including: Airbnb, Eventbrite, Lyft, Mailchimp, Namely, Pandora, Shopify, and Square. We’re growing and currently hiring for roles across all teams. View open positions on our [careers page](https://www.bugsnag.com/jobs/?utm_source=dev.to&utm_medium=cpc&utm_content=hiring-post&utm_campaign=dev.to-2018-april).

### Timber

> Timber is a new kind of cloud-based logging platform designed for applications and developers. We help engineering teams spend less time debugging and more time shipping. We’re a growing, Brooklyn based company used by thousands of developers all over the world and currently hiring for a variety of positions — see them all [here](https://jobs.timber.io).
Open Source In Action At SendGrid: Rebuilding the Node.js Library
Tags: community, technical
Published: 2018-06-19 17:25:59

---
title: Open Source In Action At SendGrid: Rebuilding the Node.js Library
published: true
tags: Community,Technical
canonical_url: https://sendgrid.com/blog/it-takes-a-village-and-adam-to-provide-an-excellent-developer-experience-at-sendgrid/
---

Read about how the open source community helped build SendGrid's Node.js documentation library into what it is today with a Q&A with its largest contributor, Adam Reis, and SendGrid Developer Experience Manager, Elmer Thomas.

The post [Open Source In Action At SendGrid: Rebuilding the Node.js Library](https://sendgrid.com/blog/it-takes-a-village-and-adam-to-provide-an-excellent-developer-experience-at-sendgrid/) appeared first on [SendGrid](https://sendgrid.com).
What was your first computer?
Tags: discuss
Published: 2018-05-18 15:12:45

---
title: "What was your first computer?"
published: true
description: "A simple curiosity: What was your first computer?"
tags: #discuss
---

I Remember the day my grandma bring me what was the beginning of one of my biggest passions: she gave me an IBM Pentium II Slim Tower with 64Mb Ram and 10GB HD, came with Win95. There was a nice "turbo" button on it haha. I was 7 y old and still remember the first time i looked at paint and after a few hours i asked myself: "god damn how they do that?"

How about you, what was your first computer? :)
A purposeful hiatus
Tags: career
Published: 2018-05-18 13:15:54

---
title: A purposeful hiatus
published: true
tags: career
canonical_url: 
---

It’s the end of the week.

To be honest, I’m getting a little tired of reading through `straces`. And also reading through code bases. Maybe it’s just the weariness of working full-time and hustling on [Zarf](https://zarf.co/). Who knew that the most difficult thing about finally regularly blogging was running out of ideas?

So, I figure, I’ll just free-form this and write whatever is on my mind.

Right now, it’s ideas. I find the cultural fascination with ideas, well, fascinating. It’s closely tied to the fascination with creativity, but not just any creativity, _productive_ creativity. The kind that you would be OK within a capitalist society. There’s very little room for pointless creativity in today’s society.

If you’re going to think of something, it has to make you money, or “advance your career,” or save the world in some way. I’m not saying that those things aren’t valid pursuits, they just make me feel a little claustrophobic sometimes.

I think this might relate to the “tired” feeling that I mentioned earlier. I’ve had a few ideas over the past couple of weeks but none of them that feel…productive. But what is productivity, after all, if not an arbitrary and immeasurable construct? Heck, at what point did I lose my spark and decide to pathologically smother ideas that didn’t mean some ill-defined measure of productivity?

Since publishing [Exits](https://www.amazon.com/Exits-Collection-Short-Fiction-Stories-ebook/dp/B07B3XT2D4), I’ve worked on a few fiction pieces but nothing that has yet to materialize. I’ve been publishing blog posts on here, but I’ll admit that they are not as good as I would like them to be. What have I been writing a lot of lately? Emails and code and more emails.

When I first started this journey of consistently blogging, I was looking to get better at writing. Now that I’ve gotten a grasp of that, I find that the difficult thing to do is figure out what to write. I’ve had a fair bit of luck solving this problem for my bi-weekly newsletter by implementing reader polling to determine what topics I should write about.

So I guess that this is what this blog post is about, me running out of ideas. At this point, I’m willing to take the mature route and say that I’ll write only when I have something to say, not based on some arbitrary schedule.

So I guess see you whenever…
A Tale Of Software Development Culture Change - Gone Wrong!
Tags: culture, agile, career, leadership
Published: 2018-05-18 12:05:23

---
title: A Tale Of Software Development Culture Change - Gone Wrong!
published: true
description: Let me tell you a story about one of the weirder software projects I've been on - and how trying to change the culture went wrong.
tags: #culture #agile #career #leadership
---

Let me tell you a story about one of the weirder software projects I've been on - and how trying to change the culture went wrong.

Early in my programming career I had a taste of success at a Fortune 500.

But I focused entirely on technology and basically had **no** soft skills.

So coming into a small company that wanted to grow their technology business seemed like it would be "easy".

Little did I know how simple decisions about the relationships I made (_and didn't make_) would lead to disaster.

There were also things outside my control, and I run into variations of these on every project to this day.

Whether you want to help a team be "more agile", maybe try and achieve DevOps, or just use the latest Javascript framework -

I hope this short story helps you avoid culture problems if you ever want to change your software development team.

# [📺 Watch this video on YouTube](https://www.youtube.com/watch?v=yKAOMiNv-go)


Or listen as a podcast:
[🎧 Soundcloud](https://soundcloud.com/jayme-edwards-media/a-tale-of-software-development-culture-change-gone-wrong)

<hr/>
[🔔 Subscribe for 90+ videos on healthy software development](https://YouTube.com/c/JaymeEdwardsmedia?sub_confirmation=1)
I asked my first StackOverflow question
Tags: discuss, beginners, javascript
Published: 2018-05-18 10:56:44

---
title: I asked my first StackOverflow question
published: true
tags: discuss, beginners, javascript
description: I asked my first question on StackOverflow today and within minutes, I got answers to my question.
---

I asked my first question on StackOverflow today and within minutes, I got answers to my question. Unlike what I read online about difficulties in asking a question, mine was actually easy. Aside from insisting I used a title that describes the question and no one has used before which took few minutes, everything went well.

What was your experience when you asked your first ever question on StackOverflow?


> Originally published on my [blog](https://blog.peoray.com/first-stackoverflow-question/). Feel free to check out my other [articles](https://blog.peoray.com/).
The Twelve-Factor App
Tags: discuss, microservices, deployment
Published: 2018-05-18 09:55:48

---
title: The Twelve-Factor App
published: true
description: how many factors do you apply in apps during the whole life cycle 
tags: #discuss #microservices #deployment
---

Just read this article https://12factor.net and found out dev.to has a series of podcast on 12factor. I will manage to listen to podcast. While reading, I am also checking how many factors I have applied completely, partially, or even none on projects I have involved. Surprisingly, all these 12 factors, in my opinion, can be shown on projects. However, it is just the matter of how much we enforce each factor in projects. 

Taking the codebase factor. We have tried to follow microservices architecture    to organize projects. However, I still can see the duplicated functions or codes among projects. The bad thing about the duplications is that some of functions or APIs provided by a service are under very low utilization for any reasons, which are still maintained by developers. However, you cannot directly remove those functions from a service since there could be some coupling inside.

Another factor I think we can enhance is to minimize the deployment difference for dev, staging, QA, and PROD, which is Dev/prod parity factor. The problem we are facing in this factor is that the app must detect environment the app exists and then get or load proper configuration values to complete the app initialisation. This detection adds extras a bit meaningless test codes like mocking staging, or QA environments.
Import bulk product in magento From XML and JSON file
Tags: magentoextension, bulkproductimport, xmlandjsonimport, importmagento
Published: 2018-05-18 07:24:43

---
title: Import bulk product in magento From XML and JSON file
published: true
description: Magento XML and JSON import from XML and JSON file Extension 
tags: magento extension, bulk product import,XML and JSON import, import magento 
---

Auto import product [magento extention](https://marketplace.magento.com/evirtual-evirtual-xautoimport.html) help you to synchronize your Magento® catalogue with external sources, importing remote suppliers' files on scheduled basis. Automated  [Product Import](https://www.evirtualtechnology.com/buy-auto-import-product-extension.html) is Store Manager for Magento® add-on that extends its functionality and makes the process of Magento® data import automatic. Using the combination of these tools the regular updates of your catalogue are performed daily, weekly, monthly-any period you like.

You can Import of new products and inventory updates from xls files. Support of local files and live feeds from supplier. You also Upload of specific product-related data: complex products associations, local and remote images, categories, prices.

Our Extension is simple and high featured designed using the Magento® XML configuration and does not affect to the Magento® Core function as well as does not affect to other 3 party extensions in the Magento® store and the multi store as well.

X auto import is use to import the bulk products from web services OR XML easy to use and user friendly, quick set-up, easy mapping fields Thousands of products import within few minutes on single click Category mapping to import the category wise products Image import from image url no need to import on server and move image files No core file conflict Pure code will import the data very fast and quickly Product attributes mapping are also available Just map the xml or web services fields with database fields and RUN the profile


{% youtube 0EAbWDvMy3I %}