teleren/devto huggingface dataset:
Debugging By Displaying Info
Tags: beginners, programming, learning
Published: 2017-12-02 21:56:44

---
title: Debugging By Displaying Info
published: true
description: How to figure out what your code is doing
tags: #beginners, #programming, #learning
---
When I first started coding, I grossly underestimated the value of displaying information to the screen. I had the notion of "if it works, it works, and if it doesn't, it doesn't." Anyone who's been coding for a bit will probably laugh at that. I started with Python, and `print` became my best friend once I learned how to utilize it. I've since learned Visual Basic, C++, and JavaScript. With each of those, I made note quickly of how to display things. 

Let's say you're just starting out, and you've got a simple for loop doing some math for you, but you're not getting the results you expected. You're probably wondering why, and how to find the problem. With production code, you want to be concise and efficient, but when you're learning, it's okay to be verbose. Do it. Look at the formula you're using, and put *more* variables in for testing purposes. Once you find the problem, you can edit your code to make it better (however you define "better"). 

In my recent attempt at solving Part 1, Day 1 of [Advent of Code](http://adventofcode.com/), I wasn't getting the sum as expected. I was keeping track of the running total(sum) in `total` (original, right?), so I started sticking `console.log("current total is "+total);` after **every** single line that did something. Hey, look at that! It's broken on line [whichever one it was]. I made adjustments, ran it again, got it right on the second try. I went back and took out all those `console.log` statements, and it was nice and readable again.

I'm also working on an AngularJS project right now, and I'm doing the same thing. More complicated concepts, and it can be hard sometimes to track what info is where at any given point in time. Since its base is JavaScript, I can still `console.log` a lot of things, but couldn't figure out how to stick it in at certain points. A mentor introduced me yesterday to the concept of [breakpoints](https://developers.google.com/web/tools/chrome-devtools/javascript/breakpoints). Super helpful! I was having difficulty visualizing what `$scope` was holding at key points, and this solved it and let me see on my screen what it was and wasn't doing.

I cannot emphasize enough how helpful it is to literally see what your program is doing. Learn how to display things. It makes everything else you learn easier.
Firebase Analytics in 30 Seconds
Tags: inthirtyseconds, firebase, analytics
Published: 2017-12-02 20:57:12

---
title: Firebase Analytics in 30 Seconds
published: true
tags: inthirtyseconds, firebase, analytics
---

[Stacy Devino](https://twitter.com/doesitpew) gave an excellent talk on Firebase Analytics today ([slides here](https://docs.google.com/presentation/d/1akpEegWCXHkMjU-GBS-3yZ1wHvO7YATU_zHP0kuqDhU/edit#slide=id.p), [github here](https://github.com/childofthehorn/AndroidFirebaseAnalyticsWorkshop), [youtube intro here](https://www.youtube.com/watch?v=8iZpH7O6zXo)). There were a lot of aha moments:

1. Integrating the Firebase SDK ([Android](https://firebase.google.com/docs/android/setup) and [iOS](https://firebase.google.com/docs/ios/setup) and [web](https://firebase.google.com/docs/web/setup)) is just a few lines of code!

There are **pre-configured** events (send standard stuff like login attempts):

```
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
mFirebaseAnalytics.logEvent(
    FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
```

and **custom** events (send whatever you want)

```
Bundle bundle = new Bundle();
bundle.putString("image_name", name);
mFirebaseAnalytics.logEvent("profile_image_select", bundle);
```

2. User grouping (so you can study how different groups of your users behave differently) is similarly just a few lines:

```
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
mFirebaseAnalytics.setUserProperty("preferred_pet", 
    petSelector);
mFirebaseAnalytics.setUserId("userIdString");
```

3. Once your app is out in the wild, head to the [Dashboard](https://console.firebase.google.com) to see insights!

4. Within the Dashboard, [Streamview](https://support.google.com/firebase/answer/7229836?hl=en) is particularly awesome as you can see the "clickstream" of user actions in sequence and visualize what they are doing (or failing to do) on your app!

5. Everything above is completely free and unlimited for you to use. To do -really big- number crunching, you'll have to export the data outside of [Firebase Analytics to Google BigQuery](https://cloud.google.com/solutions/mobile/mobile-firebase-analytics-big-query). There you will be able to query all your historical user data with plain SQL!

BigQuery is a freemium product so you'll have to have a credit card attached but the financial risk is low for most use cases: "[Realistically, most people wouldn’t burn through the free GCP $ in the first year. 20k users and normal use <$5/month](https://youtu.be/Ki_F6VCOtXU?t=86)".

Having messed around with a few analytics products in my time as a product manager this looks extraordinarily easy to setup and get insights on, and I am looking forward to deploying this in ALL my [Firebase hosted](https://firebase.google.com/docs/hosting/) and [serverless function](https://firebase.google.com/docs/functions/) projects!
Do you want to be my friend?
Tags: discuss
Published: 2017-12-02 20:08:12

---
title: Do you want to be my friend?
published: true
tags: discuss
---

I am not certain if this is an appropriate question for dev.to and apologize if it isn't.

I am a webdeveloper by heart in the broadest sense of the word and even though I love everything about it, being a developer is a lonely existence. At least it is for me. I can not talk to friends or family about 99% of the things I am passionate about. They have no idea what I am talking about and don't care to find out. (I don't blame them) I have many questions during the day (and night) and every now and then I got some answers too. Any type of intelligent feedback or dialogue is very welcome in my life.

If you are a developer and know what I am talking about then by all means feel free to find me on Facebook or add Skype: _jochem.stoel_
TIL that the question of ML is not if it will take over, but when.
Tags: todayilearned
Published: 2017-12-02 20:06:22

---
title: TIL that the question of ML is not if it will take over, but when.
published: true
tags: til
---

## Why is this important important?
1. It shows the true power of ML and AI.
2. It makes you think how will humans stay relevant in society.
3. It shows how important ML is and that we know t will become very important
TIL: The Majority Of The World Runs On 2G
Tags: todayilearned, mobilewebdev, devfestnyc
Published: 2017-12-02 19:46:12

---
title: "TIL: The Majority Of The World Runs On 2G"
published: true
tags: til, mobilewebdev, devfestnyc
---

## What I Learned

While attending a talk at DevFestNYC, I learned that, while the U.S. is pushing the boundaries of 4G and even 5G, the rest of the world is connected mostly with 2G connections. This changes the trend that mobile web apps are developed and deployed as considerations for mobile data, reliability and speed of slower connections must be accounted for when building web apps. It also highlights the prevalence of mobile technology in relation to user interface with the web, with mobile web interaction growing exponentially in the past few years.

## And why exactly is this interesting? 

1. It makes developers take a closer look at emerging markets worldwide, putting a focus on optimizing the mobile web experience.
2. It's a byproduct of the leap frog nature of technological developments worldwide, as most global users' first experience with online technologies is via smartphones.
3. It shows the importance and prominence of the mobile web presence in today's markets, as most people connect to the web via mobile devices.
I Don't Really Need To Know That, Right?
Tags: lettertomyself, beginners
Published: 2017-12-02 19:41:32

---
title: I Don't Really Need To Know That, Right?
published: true
description: How I learned not to let things slide.
tags: lettertomyself, beginner
---

I first started learning to program about a year ago. I went the traditional route and took an intro class at my local community college. At first, things seemed simple and easy to grasp. It didn't take long for the "what on Earth is this nonsense?!" feeling to set in. I always fancied myself to be decent at math in general, but coming up with concise logic to solve a problem proved to be insanely daunting in those early stages. My first true stumbling block was when I was asked to write a program that could determine whether or not a number passed to it was prime or not. Sounds simple, right? I won't lie. I angry cried after spending about 12 hours on it and getting nowhere. I was given tips to try: walk away for a bit and come back to it, google prime number algorithms and try to implement them using the syntax for the language you're using, etc. For some idiotic reason, I thought those tips were silly and didn't apply to me. Why? I have no idea. I eventually gave in and followed the tips, but to no avail. I decided that I was going to simply not finish the assignment and turn in what I attempted to do. I thought it wouldn't matter. I was wrong.

I got the grade back on it (50% for effort), and my instructor gave me source code to look at that actually solved the problem. I read it, and didn't understand it. That made me angry and I lost almost all confidence that I could do this little thing called programming. I moved on, still did well in the class despite that assignment, but I would noticeably twitch every time I heard "prime number." 

Fast forward to a couple months ago when I started a web development program at a bootcamp. What's that? I literally can't blow off assignments if I don't get something? I *have* to figure things out before moving on?! Say it isn't so! I wanted to tear my hair out doing a few programming reinforcement exercises. I knew then that I should have pushed harder back at the beginning to figure out what I was doing. I remembered the prime number program, and I wondered if I could solve it now that I had some more training under my belt. 

Success!! It may seem minor to some, but it meant the world to finally be able to do it and understand what I was doing. I'm a stickler for actually *knowing* what's going on, not just being *able* to do it. That's when I made a vow to myself--not just because I was effectively being held to it by the bootcamp, but because I owed it to myself: don't skip things that you don't get. Keep trying, and utilize every freaking resource you can get your hands on until it makes sense. You'll thank yourself later. Now if I could find a way to divine the things I'm learning right now...
Firebase in 30 Seconds
Tags: inthirtyseconds
Published: 2017-12-02 19:25:57

---
title: "Firebase in 30 Seconds"
published: true
tags: inthirtyseconds
---

Firebase is a platform for building rich cross platform applications that allow you to abstract from infrastructure and relearning. It is event driven. Simple to start. Free to use at the base Dev plan. Key features to try: Real-time database, cloud functions and Analytics capabilities.
Dynamic text rewriting
Tags: javascript, web
Published: 2017-12-02 18:31:43

---
title: Dynamic text rewriting
published: true
description: text rewriting with js
tags: javascript, web
---
Hi !

I saw some websites with a cool feature: rewriting all or part of a text with js ( [a part example](https://www.marchesson.com/cv/en.html)) but can I do this in js without an infinity loop that'll completely slow down browser performances?

I would love to implement my own version but have no clue on how. 
Thanks for your help !
Learning about immersion for the future.
Tags: todayilearned
Published: 2017-12-02 18:13:50

---
title: Learning about immersion for the future.
published: true
tags: til
---

## What I Learned

I learned that VR/AR the is an interesting direction for video games and it can be a challenge to make it happen in terms of art and modeling.

Reason why it’s interesting 

I want to be a game designer in the future and I have to experiment with different genres and technology to find my voice within the industry.
The Story on SD card storage for Android on Chromebook
Tags: android, chromebook, chromeos
Published: 2017-12-02 18:07:04

---
title: The Story on SD card storage for Android on Chromebook
published: true
description: 
tags: Android,Chromebook,ChromeOS
cover_image: https://thepracticaldev.s3.amazonaws.com/i/3z78mfptglyoeatyyq94.jpg
---


Since Android apps are now available on Chromebooks via ARC++ (Android Runtime for Chrome 2nd version), developers coming from a traditional File storage background will have to make sure their apps conform to take advantage of how to access the SD card.

The Chromium team has implemented USB On-The-Go access for the SD card on ChromeOS 62 (Chromium M-61?) or higher. What this means is that developers who expect their apps to work with the SD card as if it was under the battery in their phone will be disappointed. This is due to the fact that a 'hot swappable' SD card such as those found on a Chromebook isn't considered [Adaptable Storage](https://source.android.com/devices/storage/adoptable) by the Android Framework.

Additionally if you want to use the MediaStore APIs to access it, you are still out of luck as the Android Framework does not support access to removable hardware. The Chromium team is aware and considering options: 

https://bugs.chromium.org/p/chromium/issues/detail?id=789045&desc=3

So what to do?

Use: [Android Storage Access Framework](https://developer.android.com/guide/topics/providers/document-provider.html)

See this Commonware's post on [Removable Storage](https://commonsware.com/blog/2017/11/15/storage-situation-removable-storage.html) for further details.

Originally a StackOverflow answer: https://stackoverflow.com/a/44123748/295004
[ A Letter to My Past Self ]
Tags: lettertomyself
Published: 2017-12-02 17:33:32

---
title: [ A Letter to My Past Self ]
published: true
tags: lettertomyself
---
Dear (not so) younger self,

Reflection is a part of growing and in order to grow, you must learn. You have to understand that people learn and grow at different times. There is no formula for this. There is no logic to this. It happens when it happens so fully embrace those moments whenever they are presented to you. I won't leave you with a lot of information (though I know you crave the idea of knowing everything...) so take it in as much as you can

#1. Slow Down. 

It is okay to pick one thing and submerge yourself in that. This is especially when learning code. There are many languages and even more frameworks for them. You don't need to learn everything at once. Take your time and learn to enjoy what you are doing now. You'll have time for everything else later. 

#2. Define Yourself.

This one is not really for you. You know who you are and what you do. This is when people question what you do. Don't be afraid to tell people what you are interested in or what you want to do because they may not get it. There is no shame in explaining to someone who may not understand. They will get it once they see your passion behind it. Do not worry about that and just trust you (as a designer/developer/digital marketer/photographer.)

#3. Get Some Sleep.

I really can not explain enough how important this last one is. I know you are eager to learn, I know you are eager to grow. But there is very little you can do without a good nights rest.      

Trust me, you'll understand later,

love,

Your not so older self.
Short Intro and First Post
Tags: devfestnyc
Published: 2017-12-02 17:12:50

---
title: Short Intro and First Post
published: true
description: First Post
tags: #DevFestNYC
---
![imagename](https://thepracticaldev.s3.amazonaws.com/i/hij4azqsdtpdqldjawgd.jpg)
Hello, my name is Kareem. I am new to this whole blog thing but I might as well give it a shot. I am just starting to get my feet wet in web development and love what I am learning so far (HTML, CSS, JavaScript). Every time I learn something new I realize how much I really don't know. I am currently at GDG DevFestNYC 2017 and having an awesome time so far. I'm hoping to learn where the industry is going and how I am going to fit into that narrative as an older person transitioning into tech(more about my journey to come). I am sure I will add to this later but that's it for now, back to learning!!
Medical Machine Learning in 30 Seconds
Tags: inthirtyseconds, machinelearning, tensorflow, keras
Published: 2017-12-02 16:41:14

---
title: Medical Machine Learning in 30 Seconds
published: true
tags: inthirtyseconds, machinelearning, tensorflow, keras
---

Today at [DevFestNYC](https://devfestnyc.com/), [Josh Gordon](https://twitter.com/random_forests) explained how Tensorflow is being used to [detect cancer](https://research.googleblog.com/2017/03/assisting-pathologists-in-detecting.html) and [diabetes](https://research.googleblog.com/2016/11/deep-learning-for-detection-of-diabetic.html). What's amazing is that it is not much different from training a neural network for recognizing cats and dogs! Here is a brief summary of the talk:

1. **Data** - Get a lot of data. You need millions of images of whatever you are training on.
2. **MORE Data** - no really, you need more. Sometimes your data can be bad, for example if your doctor panel disagrees with each other, or worse still, disagrees with themselves. (humans, who needs them?)
3. **Setup** - Tensorflow now comes with Keras (_awesome_), and Keras has inbuilt [applications](https://keras.io/applications/) of which *InceptionV3* is pretty good (_awesomer_), although Josh also shouted out to NasNet [(a type of AutoML)](https://research.googleblog.com/2017/11/automl-for-large-scale-image.html) as a neural network that trains itself (_galactic brain exploding_).
4. **Fuzz** - Here is the art form and area of active research. Josh explained some key ideas, from using a [sliding window](https://medium.com/@ageitgey/machine-learning-is-fun-part-3-deep-learning-and-convolutional-neural-networks-f40359318721) to applying rotation/contrast/other filters to milk all you can out of the image data so you can, for example, recognize the same thing it is trained to recognize, even if it was flipped upside down. The most interesting part here was how they looked at how real doctors look at slides in the microscope, zooming in and out to get different contexts, and achieved amazing results by replicating that behavior simply by copying and pasting their code 4 times and running their model at 4 different zoom levels on the same dataset!!
5. **Train** - this takes on the order of 2 days (Google Cloud) to a week (local machine with 10 GPUs). If you are a researcher, Google offers 1000 TPUs FOR FREE to you to use if [you apply here](https://www.tensorflow.org/tfrc/).
6. **Deploy** - This is actually the hardest thing, which is making your models useful for regular nontechnical people to use. 

The goal is for Machine Learning should be so routine it is boring. Hopefully I've made that boringness interesting!
The Lying Desk and the Patate Technique
Tags: sleep, exercise, pomodoro
Published: 2017-12-02 15:32:04

---
title: The Lying Desk and the Patate Technique
published: true
description: 
tags: sleep, exercise, Pomodoro
---

![](https://thepracticaldev.s3.amazonaws.com/i/fupt4powqmccahrntpty.jpg?raw=true)

# The Lying Desk and the Patate Technique

We hear all about the stand up desks and even the treadmill desk. The shtick is that sitting at a desk is the new smoking. Well, that's all well and good, in terms of movement, exercise, calories, and such but understand that sleep is more important than exercise. Actually, experts say they are equal but they always list or say "sleep" before "exercise", so there you go.

Introducing the lie down desk. You can do it on the floor but I prefer a good couch. 

## The Patate Technique

My brilliance doesn't stop with the lie down desk:  We all have heard of, and many of you may practice, the [Pomodoro technique](https://en.wikipedia.org/wiki/Pomodoro_Technique). Well, I'm ramped the Pomodoro up -- by reversing it. Instead of working for 25 minutes and then taking a 5 minute break, I nap for 25 minutes then work for 5. I call it the Patate technique  (patate is Italian for potato and is basically the opposite of a tomato.)

It’s impossible to overemphasize the importance of sleep. Don't trust me. Listen to what world-wide expert on sleeping, Jim Gaffigan, has to say: "Given my passion for sleep, it is no surprise how I feel about naps. I believe in Naps." Gaffigan goes on about the importance of naps with: "I understand that naps are usually reserved for babies and old people, but I don't discriminate."

You're probably thinking: might all that napping during the day mess up your sleep at night? Well, that's the beauty of the lying desk and the Patate technique. I'm so rested after a day's ~~hard~~ work that I can use late night to do what is truly important in life: Facebook, binge watching Netflix, Snapchat, Twitter, and texting.
Termux: Give me your use cases!
Tags: termux, discuss
Published: 2017-12-02 15:07:07

---
title: "Termux: Give me your use cases!"
published: true
cover_image: https://termux.com/files/vim-main_framed.png
description: Termux is a Linux environment running via android as well as a terminal emulator 
tags: Termux, discussion
---

I recently stumbled upon [Termux: "the terminal emulator and linux environment for android".](https://termux.com)

Whilst it sounds pretty cool to have such an app on my phone, especially with my love for Linux I'm wondering what the wonderful use cases people have for such an app. 

This especially interested me recently when I found it also has an API version which allows you to access the phone hardware APIs. I assume this could allow me to build some quite clever task runners as seen with other apps like "If this then that" and "Tasker".

I've played with a number of great node.js projects on a raspberry pi such as [Node-red](https://nodered.org) which appears to run nicely within Termux. This makes my android smartphone the ultimate IoT hub to play around with integrations without needing to even open up my laptop.

Please feel free to drop in the comments any of your Termux use cases I'll be fascinated to hear what others are doing with the app.
What's the easiest way to put authentication into a website
Tags: authentication, discuss
Published: 2017-12-02 13:06:13

---
title: What's the easiest way to put authentication into a website
published: true
description: Trying to know the modern way of authentication.
tags: authentication, discuss
---

I usually just use PHP & MySQL, but I would like to know the modern way to create it. Probably with MongoDB or some fancy JavaScript framework.
Can anyone tell me how (if even possible) to get Node running on my Android phone with access to native APIs?
Tags: discuss
Published: 2017-12-02 07:14:25

---
title: Can anyone tell me how (if even possible) to get Node running on my Android phone with access to native APIs?
published: true
tags: discuss
---

I know about Termux but is this really the only way? Can we not do this ourselves?