teleren/devto huggingface dataset:
The WWDC 2019 Platforms State of the Union Highlights
Tags: wwdc, mac, news, apple
Published: 2019-06-03 23:37:26

---
title: The WWDC 2019 Platforms State of the Union Highlights
published: true
description: Here are some of the highlights.
tags: wwdc,mac,news,apple
---

Here are some things that were mentioned during the Platforms State of the Union at WWDC 2019.

# macOS Catalina

- DriverKit - kernel extensions but in userspace

Explicit User Authorizations for:
- Keystroke recording
- Screen capture
- Screen recording
- User Data
  - Document
  - Desktop
  - Downloads
  - iCloud Drive
  - Removeable media
  - Network volumes

# watchOS 6

- Independence from the iPhone
- Audio Streaming
- Extended Runtime
- SwiftUI support

# Privacy

## Sign In with Apple

- Real User Indicator based on account history (determine if another verification step should be performed)
- Works on the Web and across all Apple platforms

# ML

- image saliency (user interest heat maps for auto-cropping)
- text recognition (printed text transcription)
- word embeddings (get synonyms of words for search purposes)
- speech api on-device (recognize speech)
- speech saliency (get the cadence and pitch of spoken words)

## CoreML

- Personalized, background-updated machine learning models personalized on each user's device.

## CreateML

- macOS app for building models without code with templates, and testing them with various inputs from built-in sensors on iOS and Mac.

## Siri Shortcuts

- Shortcut phrase suggestions (Add to Siri)
- Conversational (parametrized) shortcuts 
- Shipped with iOS and iPadOS
- Automation (smart shortcut triggers)
- Multi-step, multi-app shortcuts

# ARKit

- Apple Pay integration (instant buy)
- Simultaneous front and back camera usage
- Motion capture
- People occlusion

## RealityComposer

- WYSIWYG interface for laying out 3D AR experiences for Apple devices
- An iOS and Mac application

## RealityKit

- An engine for 3D AR experiences
- Multi-threaded renderer
- Synchronizes with camera data for realistic results

# Metal

- Supported fully by the iOS Simulator on Mac
- Metal Memory Debugger to understand resource allocation
- Metal Indirect Compute Encoding (offloading more tasks from the CPU to the GPU)
- Better raytracing support
- Peer Group API (GPUs can share data with each other without clogging the slower PCI system bus)

Thanks for reading!
From Schubert To Shoeless
Tags: careerchange, intro
Published: 2019-06-03 21:51:57

---
title: From Schubert To Shoeless
published: true
description: My journey from music to code
tags: career change, intro
cover_image: https://images.unsplash.com/photo-1482627750753-afdba16659ef?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80
---

I had three majors I was juggling in my head my senior year of high school. They were Physics, Music, and Spanish.  I mean, you couldn't really get a more eclectic selection, could you?  They have almost literally nothing in common and I had no idea how to choose.  Ultimately it was basically up to a whim and 5 years later I graduated with a Bachelor's in Vocal Music Education being certified to teach K-12 music in the State of Michigan.

10 years or so later I was having an existential crisis after failing at teaching after 3 years, spending a year at home with my kids, doing odd jobs for a year, and getting laid off from a "band-aid" sales job that I had been at for 5 years.  I was 31 and I still didn't know what to be when I grew up.  I turned to a good friend of mine for some advice and the topic of what I wanted to do when I was young came up.

Physics, Music, Spanish.

Without missing a beat he said, "Oh, yeah, that makes sense.  They are all languages.  Physics is math - the language of the whole universe.  Music is the language of emotion.  Spanish is... well Spanish is literally just a language."

I guess it isn't too surprising, then, that I ended up as a web developer.  Just more languages to add to the pile.  Here I've found a place where I can put all my geeky sides together.  Working in code scratches my analytical/logical itch.  Being on the front-end helps scratch my creative itch.  I even get lots of opportunities to teach and work with people directly to satisfy all my ambivert needs.  The best part is that I get to come to the office in shorts and a t-shirt and only sometimes with shoes (I know it was a stretch to get there but I liked the title).  

I guess what I'm saying is that there is no "right" way to get into this industry.  The umbrella is so huge and there are so many opportunities that literally anyone could find a place amongst the nerds.  If you're hesitating to make the career change because you aren't sure if it will be a good fit then my advice is to give it a shot.  We have beer.
R Language : Read XML files In R
Tags: rdatascience, datascience, rlanguage
Published: 2019-06-03 21:48:29

Let's discuss how to Read XML Files in R. There are many places where people make use of the XML data. Often some specific set of data is being stored into the XML. 

Prior to JSON files getting popular as they are today, many companies used to offer the XML export option. So you are going to find many legacy files that store the data in XML file. So we are going to see how to read this data with the R language. 

You can watch the video instruction of the tutorial - [How to Read XML Files in R](https://www.youtube.com/watch?v=1cM_ZNZ9hhE). 

{% youtube 1cM_ZNZ9hhE  %}

XML Package

In order to read the XML file and to manipulate the data, you need to make use of the XML package. You can install the package with the following code. 

    install.packages("XML")

So let's assume we have XML file named *mydata.xml*.  You can get the XML data from [sample file](https://www.w3schools.com/xml/simple.xml). 

Now we can get started to import the package. 

    library("XML")

Next package that we would be needing to be added is the following. 

    library("methods")

Let's name the input file and import the file. 

    dt <- xmlParse(file = "mydata.xml")

So here's the data variable named "dt". You can print the output as follows. 

    print(dt)

Here's the output that you'd get in the console. 

    <breakfast_menu>
    <food>
    <name>Belgian Waffles</name>
    <price>$5.95</price>
    <calories>650</calories>
    </food>
    </breakfast_menu>

I hope this post helps you to read the XML data from the file in R language.
I Updated Rails. Now Everything's on Fire.
Tags: rails, ruby, showdev
Published: 2019-06-03 20:32:48

*Originally posted on* [*Hint's blog*](https://hint.io/blog/updated-rails-everything-is-on-fire).

Following up on my [best practices post](https://hint.io/blog/rails-6-upgrade-best-practices), I have a prime example of one common issue that surfaces when upgrading a Rails app.

I decided to spike on upgrading a small internal app to Rails `6.0.0.rc1`. The test suite is green on Rails `5.2.3` and Ruby `2.6.2`, so I bumped the Rails version in the Gemfile.

```ruby
source '<https://rubygems.org>'
git_source(:github) { |repo| "<https://github.com/#{repo}.git>" }

ruby '2.6.2'

gem 'rails', '6.0.0.rc1'
```

In the terminal, I ran `bundle update rails` and it updated without issue (I mentioned this is a small app, right?). Even on small apps, this should make you raise an eyebrow.

Skeptically, I ran the test suite.

Errors all the way down.

```bash
An error occurred while loading ./spec/services/step_processor_spec.rb.
Failure/Error: require File.expand_path('../../config/environment', __FILE__)

TypeError:
  Rails::SourceAnnotationExtractor is not a class/module
# /gems/gems/haml-rails-1.0.0/lib/haml-rails.rb:49:in `block in <class:Railtie>'
# ...more output...

Finished in 0.00027 seconds (files took 1.41 seconds to load)
0 examples, 0 failures, 17 errors occurred outside of examples
```

Based on the error, let's take a look at `haml-rails` and `SourceAnnotationExtractor` in Rails to see what changed and if there is a newer version of `haml-rails`.

But wait. You may ask: "Why not try upgrading the gem and move on?". Taking the time to understand the root cause of a problem provides confidence in the solution and clear direction to resolve broader symptoms throughout the codebase.

<div class="callout">
  Taking the time to understand the root cause of a problem provides confidence in the solution and clear direction to resolve broader symptoms throughout the codebase.
</div>

Here is line 49 in `lib/haml-rails.rb`:

```ruby
SourceAnnotationExtractor::Annotation.register_extensions('haml') do |tag|
```

Sure enough, there is a change in Rails 6 that moves `SourceAnnotationExtractor` to `Rails::SourceAnnotationExtractor` ([PR #32065](https://github.com/rails/rails/pull/32065)). The top-level class has been deprecated, but the deprecation warning does not apply to the sub-classes which raise the `TypeError`.

Knowing the source of the error, we can check if there is a newer version of `haml-rails` compatible with Rails 6. Again, you will find value by not just upgrading the gem, but understanding the changes in the newer versions. With `haml-rails`, there is a newer version that has a fix for the issue. By bumping up to that version, I'm able to run the test suite without errors and get back to the upgrade at hand.

[Schedule a quick call](https://calendly.com/natevick/upgrade-intro-call) with me to see how our expertise can keep your team delivering features during your Rails upgrade.
Solve this simple problem with TDD
Tags: discuss, tdd
Published: 2019-06-03 14:49:26

---
title: Solve this simple problem with TDD
published: true
tags: discuss, tdd
---

A few days ago I tried to solve the next problem with TDD and found it really hard.
I could not reach the solution through a series of small incremental test cases.
This is the problem:
 ```
flatten an array of arbitrarily nested arrays of integers into a flat array of integers.
e.g. [[1,2,[3]],4] -> [1,2,3,4].
```
of course without using language implementation like `flatten` in ruby

### Can someone try to TDD this problem and comment here her/his experience?

### Clarification
The process that I follow.
1- Write a set of tests (input--->expected-output)
2- Pick the simplest test case to solve. (RED)(Write a failing spec)
3- Write the most naive code change that solves the current set of tests. (GREEN)
4- Check if DRY is needed (Refactor)
5- Go back to 2

My expectation is that at some point I reach the solution for the general case but following these rules I'm not able to reach the solution.
At some point there is no naive change to solve the tests and I need to rewrite the whole solution.
I found two solutions to this problem but none of them was following this process.
https://gist.github.com/delbetu/ff67be230f83542ac1924e766b591803

# Update
I found a solution for this problem check this out https://dev.to/delbetu/a-tdd-example-e4o
Firebase Authentication in Angular 9|8 with AngularFire2
Tags: angular, firebaseauthentication, angular98
Published: 2020-01-31 19:30:50

---
title: Firebase Authentication in Angular 9|8 with AngularFire2
published: true
tags: Angular,Firebase Authentication, angular 9|8 , angular 
canonical_url: https://www.positronx.io/firebase-authentication-in-angular-8-with-angularfire2/
---

The post [Firebase Authentication in Angular 8 with AngularFire2](https://www.positronx.io/firebase-authentication-in-angular-8-with-angularfire2/) appeared first on [positronX.io](https://www.positronx.io).

Firebase Authentication in Angular 8 with AngularFire2 tutorial will be the most popular topic nowadays. Firebase is a real-time NoSQL database to create modern web and mobile application. Setting up an authentication system with Firebase in your web and mobile apps is very easy.


[Click here to read more](https://www.positronx.io/firebase-authentication-in-angular-8-with-angularfire2/)
Web developers: with SwiftUI, would you consider learning Swift?
Tags: discuss, swift, wwdc, swiftui
Published: 2019-06-03 19:41:49

Apple just announced [SwiftUI](https://developer.apple.com/xcode/swiftui/), a "simple way to build user interfaces across all Apple platforms with the power of Swift".

It's a declarative way to create native views. It's very similar to component systems such as React and Flutter.

![Swift UI code example](https://developer.apple.com/xcode/swiftui/images/example-syntax-light-large_2x.jpg)

Are you curious about it? Would you consider jumping into native development?

What if they release a version for the web?

_Edit: Changed title to reflect "learning Swift" instead of moving to Apple's iOS platform. Cross-platform is also diversity._
Confidence
Tags: discuss
Published: 2019-06-03 19:14:16

---
title: Confidence
published: true
description: confidence
tags: discussion
---


What do you do when your confidence hits rock bottom? For me, I find this arises from any one of these 3 situations:

* working on a project that has many issues
* learning a technology that is taking much longer to grasp or master
* comparing yourself to others
How to land my first full time job as a software developer
Published: 2019-06-03 18:56:46

I have been coding now for about two years, but it's not my core job. I studied CS but I work for a HR company as an operations manager. On the side, I code with my spare time. I write php, even built a record management system for my company. 
Presently, I'm working on a MERN stack reminder app, with emphasis on grasping the basics to enable me land my first full time job as a software developer. I will like to get some advice on how to go about my job hunting. Thanks in advance.
How do you get your clients
Tags: discuss, career
Published: 2019-06-03 18:49:03

## Do you do any client work?
If so, how do you get your clients & how do you prove your competence to them? 

- Would you consider yourself a junior, senior or consultant as far as dev goes?

- Do you do remote/local work? Why the choice?

- What are your key pain points?

- How long have you been doing it?

## If you are a consultant

- How did you get started

- How do you get clients these days
Best way to create an indexed gallery of images?
Tags: design, webdev, help
Published: 2019-06-03 18:46:52

I'm a graphic designer with basic web experience, looking for a purely functional solution to this problem. Apologies if it's a no brainer for others here, but I'm curious about what creative solutions exist! 

I have an always growing collection of images that I keep for posterity and inspiration, currently organized by designer/artist [lastname_firstname]. As of now, it's 150+ folders of images. Some have sub-folders. Some folders might have 5 images, others 80. I'm always gathering. It's beneficial to me in a lot of ways, and I think sharing it would be fun and help others, at the very least.

I had a web design professor awhile back introduce me to [indexhibit](https://www.indexhibit.org/what-who-why-how/) which sounds like it fits my needs perfectly. Unfortunately, the skills and knowledge I gained in that course have grown rusty, and I started wondering if a simpler solution existed. 

I'm curious if any other solutions or platforms come to mind? 

**My basic requirements are:**
-No image cap
-Ability to tag and categorize (ex: the same album cover image can be found in the [designer's name] folder, as well as an overall [album art] folder)
-Doesn't need to look pretty. In fact, I like indexhibit for its underdesigned aesthetic.
-Bonus if I can somehow host it on my portfolio site (squarespace at the moment)


**tl;dr:** I'd love to have an online, shareable, indexed version of my art inspo hard drive.

Any and all advice is welcome.
Java Memory Leak for JDBC
Tags: java, jdbc, memoryleak, garbagecollector
Published: 2019-06-03 18:46:08

---
title: Java Memory Leak for JDBC
published: true
description: 
tags: java, jdbc, memory leak, garbage collector
---

# The Context

I had written an engine using a custom ClassLoader. To do that just create a new [URLClassLoader](https://docs.oracle.com/javase/7/docs/api/java/net/URLClassLoader.html), load a jar and execute what code you want, than close the URLClassLoader. If the new ClassLoader doesn't have access to the current ClassLoader, the loaded classes does not have access to your code. Good! Very Good!



```java
URL[] jars = new URL[] { /* The jars to be loaded */ }; //
try (URLClassLoader classLoader = new URLClassLoader(jars)) {
    Job job = classLoader.loadClass(Job.class.getName());
    job.execute();
}
```


# The Problem 

But... We do not have control with the code loaded from an external Jar. That is the problem. So if you want to avoid memory leaks the your custom classloader should be released by Garbage Collector. If the loaded code uses JDBC you will soon get an OutOfMemoryError and everything will crash! Not good!

# The reason
Whe JDBC loads the driver they assumes that you will use only one ClassLoader, so  it create a reference to your ClassLoader. This reference prevents the Garbage Collector from removing your custom ClassLoader from the memory.

![](https://thepracticaldev.s3.amazonaws.com/i/789mmfr2dkp8ezgm2p91.png)

So, even if you create your ClassLoader, execute your code and close it. The total of loaded classes will never decrease.

# How to solve?

To solve this problem we have to unregister all JDBC drivers just after the execution, than close URLClassLoader.

```java
URL[] jars = new URL[] { /* The jars to be loaded */ }; //
try (URLClassLoader classLoader = new URLClassLoader(jars)) {
  Job job = classLoader.loadClass(Job.class.getName());
  job.execute();
  Collections.list(DriverManager.getDrivers()).forEach(driver -> {
    try {
      DriverManager.deregisterDriver(driver);
    } catch (SQLException e) {
      logger.error("Error unregistering driver!", e);
    }
  });
} 
```

Now, let's look for the loaded classes:

![](https://thepracticaldev.s3.amazonaws.com/i/xzaa7ftdokc0078tg9n5.png)

# Possible problems

1. If the executed code create any Thread, the URLClassLoader is not eligible for Garbage Collector.
2. If some library create any Thread, same problem from #1.
3. MongoDb client create a Thread. 😫
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2019-06-03 18:35:05

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---
Every Monday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week. ❤️

#1. Trick Yourself

A helpful post for anyone hitting a coding slump -- ideas on how to reignite your passion for solving problems.

{% link https://dev.to/theghostyced/tricks-to-get-you-coding-again-when-you-aren-t-motivated-to-1bdl %}

#2. Been There, Done That

Some thoughtful advice on what it means to be a senior developer and how to get there.

{% link https://dev.to/jamesmh/how-to-become-a-senior-developer-3di3 %}

#3. Pass That Data

Anssam compares three approaches for passing data: prop drilling, Redux, and React's context API. 

{% link https://dev.to/anssamghezala/you-don-t-have-to-use-redux-32a6 %}

#4. PWA > Native

Stefan explains why they believe PWAs will take over native apps in the very near future.

{% link https://dev.to/stefandorresteijn/pwas-are-our-future-5591 %}

#5. First Impression

Andrew shares five ways to improve your Linkedin profile -- from strategic cover photos to 'elevator pitch' profile summaries.

{% link https://dev.to/exampro/700-web-developers-asked-me-to-give-them-linkedin-profile-feedback-and-these-are-my-5-top-tips-5382 %}

#6. Get Git

Sometimes a list of commands is helpful, but most of the time having context is even better. Nico helps fill in the context in this interactive git tutorial.

{% link https://dev.to/unseenwizzard/learn-git-concepts-not-commands-4gjc %}

#7. The Three Lil' Pigs

Max offers a series on design patterns taught by way of fairy tales. This first post is all about creational patterns - how to create and manage maintainable objects.

{% link https://dev.to/maxwell_dev/the-three-little-creational-patterns-a-design-patterns-intro-1dmn %}

_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
Are you ashamed about your past on twitter?
Tags: go, twitter
Published: 2019-06-03 18:26:09

---
title: Are you ashamed about your past on twitter?
published: true
description: 
tags: golang, twitter 
---


![](https://thepracticaldev.s3.amazonaws.com/i/cxwmyejgz7zfc0kmb95a.gif)

Hi developers!
Are you ashamed about your past on twitter? Would you like to have the silver bullet to all your bad reputation online? Don't worry anymore! Now you can delete all your tweets and favorites just with one program! And it's open source!!! Here you are the link:


https://github.com/llinaresvicent/twitter_deleter


PS: What do you think about the code? Any idea for improving it?
2019 Goals — May Update
Tags: goals
Published: 2019-06-03 18:25:36

---
title: 2019 Goals — May Update
published: true
description: A progress update on my goals for 2019
tags: goals
cover_image: https://images.unsplash.com/photo-1556515268-97d056bdb5a7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1348&q=80
---

May was a busy month! I married my best friend and girlfriend of 3.5 years 😍 Hence, I focused on that and put my goals on the side for the month. But here's my update as always.


## Achievements

Here, I’ll share the goal followed by the related achievement of the month after the arrow.

### Intellectual
- Read 12 Books -> Read "The Meaning of Marriage" and "Remote: Office Not Required"

A friend of ours gave us "The Meaning of Marriage" in preparation for the new chapter. It was full of a lessons and advice on having a successful marriage.

The other book I read was "Remote: Office Not Required". I'm very interested in remote culture. I work occasionally from home at my current job, but I see remote-work being the "norm" in the future. It also had some interesting strategies for pitching remote-work to your employer, which I may try 😉

That's all folks! Until next month!

### 
[Photo by Markus Spiske on Unsplash]
Programming Procrastination
Tags: discuss, beginners
Published: 2019-06-03 18:08:05

---
title: Programming Procrastination
published: true
description: Little article to talk about procrastination when programming
tags: #discuss #beginner
---

As a fairly new programmer in the sense of experience, I find myself to experience moments of procrastination when starting a new project. With such examples as this article, or setting up a github repository's .gitignore and README.md. Did you happen to go through a similar phase? if so, how did you overcome it? if not, share your process when you start up a new project. Thanks
What is your favorite desk accessory? 
Tags: discuss
Published: 2019-06-03 18:04:19

---
title: What is your favorite desk accessory? 
published: true
description: What is your favorite desk accessory? 
tags: discuss
---

Most people have a little something on their desk that brings them comfort and joy throughout the workday. Sometimes it's a picture, other times it's something totally different. What is your favorite item sitting on your desk and why?!
What Python package management tools do you use?
Tags: discuss, python, productivity
Published: 2019-06-03 18:01:03

Hi Everyone,

I've recently started becoming more interested in better Python package management and development and I wanted to get a general idea of what tools the community uses. So far, I've been heavily using Pipenv due to it's seamless combination of creating Virtual Environments and ability to install packages (w/ lock file).

Please let me know what you use :-)