teleren/devto huggingface dataset:
The beauty of being a developer
Published: 2021-04-18 00:41:12

Hello people!

I'm Diego Massarini, Italian Front-End Dev & Web designer living in Australia.


#How to travel Australia

Since I'm living in here I understood one thing; travelling, for Australians, is a really important thing, part of their life, it's in their culture (how cool is that?!).

A country that hosts millions of people every year, giving them the opportunity to explore this magnificent country, far and wide.

Here, the best way to do it is on the road; by motorbike, van or 4x4 and not for a week, but for months!

Tracking the expenses is therefore of vital importance, but often you forget to do it, perhaps you write it down on your hand, in a notebook that it could be lost or eaten by a crocodile.😅

For this reason I have developed [**RoadTrip🤙**](https://onroadtrip.netlify.app/)to track your everyday expenses and maybe help you to save money and stay on the road for longer!

#Why I've developed it? For myself!

I will be travelling by van from Sydney to Port Douglas and then to Perth! (around 8k km)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fzcefluo9hlkwqdodwuq.png)

My girlfriend and I have always been travelled a lot and one thing that we have never been able to do was to keep the expenses we did during the trip.

And here came the idea.

I remembered that I had all the means to be able to create something really useful, not a navbar (Sorry nav😅), a tool. 

I understood the real unlimited power and beauty about being a developer: you can literally build something useful, maybe only for you.

### Technologies used:
- TypeScript
- React
- Styled-Components
- Framer-Motion
- Use-Sound
- Adobe XD
How to use your Cellphone as a development machine*
Published: 2021-04-18 00:37:12

Yes... You see that right. After playing around with my Samsung Note 9, I have been able to create a full fledged machine and develop code on it... But it's not entirely running on my local machine, so there is the giant astric next to it... Here are the tools I am using
 Hardware
1. My samsung galaxy note
2. A raspberry pi or other machine to connect to. You could even set up a docker instance using AWS or Azure
3. A usb multiport usb type c adapter, to hook up a keyboard, mouse and monitor

For software
1. Dex. Since I am in the Samsung ecosystem, it gives me a fantastic desktop environment
2. A browser
3. (optional) Termius. I was dumbfounded when I fired up an instance against my local machine and saw it worked locally (and run linux commands directly against my phone), but in this instance, it is to ssh into your remote machine for install and maintenance
4. Code Server. I am running this in a container on my remote machine, but essentially it is a instance of VS code in a web browser. This is my remote ide for development

This is a proof of concept that I confirmed works. I did run into some trouble with not having node installed, but there is an accessable terminal in code Server to install those dependencies, as it's built in Debian. Overall I am fairly happy with it. Let me know if anyone is interested in the setup / config directions on how to set it up.
Is it really possible to scale agile?
Tags: agile, safe, scrum, teams
Published: 2021-04-20 08:02:21

---
title: Is it really possible to scale agile?
published: true
date: 2021-04-18 00:00:00 UTC
tags: agile,safe,scrum,teams
canonical_url: https://jhall.io/archive/2021/04/18/is-it-really-possible-to-scale-agile/
---

In the [first session](https://courses.jhall.io/courses/ship-better-code-faster/lectures/30629956) of my online course, [Ship better code faster](https://jhall.io/sbcf), I spend a few slides discussing where Scrum and DevOps each fit on an organizational chart:

![Scrum & DevOps on an org chart](https://jhall.io/archive/images/scrum-devops-org-chart.png)

Blue represents upper management, or the C suite. Pink, middle management. Green, product management, technical leads, etc. Yellow, individual contributors (developers, designers, etc). And the rectangles at the bottom represent tools, servers, etc.

The blue oval encompassing green and yellow represents Scrum, and the second blue oval represents DevOps.

The big question left unanswered was: How do we apply Agile at the higher levels of the organization (Blue, Pink, and Green in the graphic)?

**How do you scale Agile?**

I think this is mostly the wrong question to be asking. Agile, as defined in the [Manifest for Agile Software Development](https://agilemanifesto.org/), is about individuals and interactions. This is not something that can really be scaled, in exactly the same way that an atomic family (roughly: parent(s) and their immediate offspring) cannot be scaled.

When you scale an atomic family beyond a certain tribe, you no longer have a family, but instead a tribe, village, city, or nation. Hopefully this macro-level organizational unit allows for healthy atomic families _as well_, but should never be confused with family (and rarely are, except perhaps in some extreme cases of cult followings).

In the same way, I see that an organization can be made up of many agile groups, but scaling agile itself is not really possible, nor desirable. The things that make a small group agile (team backlogs, sprints, daily communication, etc) when applied at a higher level lead to “processes and tools” and “following a plan”, rather than “individuals and interactions” and “responding to change”. In other words: they can actively hinder agility.

Instead we should focus on allowing and fostering agility, not scaling it.

* * *
If you enjoyed this message, [subscribe](https://jhall.io/daily) to _The Daily Commit_ to get future messages to your inbox.
How to get the last accessed time of the file asynchronously using Node.js?
Tags: node
Published: 2021-04-18 00:00:00

---
  title: How to get the last accessed time of the file asynchronously using Node.js?
  published: true
  tags: Nodejs
  date: Sun Apr 18 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/get-last-access-time-of-file-asynchronously-nodejs
  cover_image: https://melvingeorge.me/_next/static/images/main-64ae64067fde211196b17bd92c69c94c.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/get-last-access-time-of-file-asynchronously-nodejs)
  
To get the last accessed time of a file asynchronously, you can use the `stat()` method from the `fs` (filesystem) module and then use the `atime` property from the returned `stats` object in Node.js.

Let's say we have a file called `myFile.txt` in which you want to get the last access time. Here you can use the `fs.stat()` method and pass:

- the `path` to the file as the first argument.
- a callback function that will get invoked after statistics about the file is obtained, in which the first parameter is an `error` object and the second parameter is the `stats` object which contains all the information about the file.

In our case, the last access time of the file can be obtained using the `atime` property from the `stats` object. The `atime` property returns a valid `Date` object in JavaScript.

It can be done like this,

```js
// require fs module
const fs = require("fs");

// get last access time using fs.stat() method
fs.stat("./myFile.txt", (error, stats) => {
  // in case of any error
  if (error) {
    console.log(error);
    return;
  }

  // else show last access time from stats object
  console.log("File last accessed at: ", stats.atime); // File last accessed at:  2021-04-30T23:53:07.633Z
});
```

See the above code live in [repl.it](https://replit.com/@melvin2016/get-last-access-time-of-file-asynchronously-nodejs#index.js).

If you want to see the `Date` in a more human-readable way you can use the `Date` object methods. Let's use the `toUTCString()` method like this,

```js
// require fs module
const fs = require("fs");

// get last access time using fs.stat() method
fs.stat("./myFile.txt", (error, stats) => {
  // in case of any error
  if (error) {
    console.log(error);
    return;
  }

  // else show last access time from stats object
  console.log("File last accessed at: ", stats.atime.toUTCString()); // File last accessed at: Fri, 30 Apr 2021 23:53:07 GMT
});
```

That's it! 😀

### Feel free to share if you found this useful 😃.

---
Journey to Bitcoin Ticker medals in Flutter Bootcamp
Tags: flutter, bootcamp
Published: 2021-04-17 23:20:17

Once I had gone through the starting tutorial, I followed along to try to get to the medals, this was my journey.

(Using coinAPI.IO, if you are curious)

#Bronze Medal - Fetch data from API 

###Getting data!  This was my output in console 
     `"time": "2021-04-09T17:21:17.0000000Z",

     "asset": "USD",

     "rate": 58129.784449564185964438276044,

     "volume": 1006691938.9265092649750800000

   },

   {

     "time": "2021-04-09T17:21:17.0000000Z",

     "asset": "ETH",

     "rate": 58122.310040699224159054898831,

     "volume": 411765352.84316552267440165637

   },

   {

     "time": "2021-04-09T17:21:17.0000000Z",

     "asset": "BCH",

     "rate": 58113.757733838815756287353973,

     "volume": 25098215.853426955508618248687

   }

 ]`
 


###4 . New bug now 
`Exception has occurred.`
`_TypeError (type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'FutureOr<int>')`

I had to update the return type to `Future<dynamic>` in getCurrencyData
And
Make sure that the `async` work is done outside of `setState`
`void updateUI() async {
   var coinData = await coin.getCoinExchangeRateForCurrency("BTC", "USD");
   setState(() {
     double doubleRate = coinData['rate'];
     rate = doubleRate.toInt();
   });
 }`

#Silver Medal - Get pickers working 
Cupertino picker - Set the initial index of the picker to `USD 
scrollController: FixedExtentScrollController(initialItem: 19),`

I hardcoded the 19 for now (USD is the 19th item in the list). will change this to be dynamic later, but for now, this works.

#Gold Medal - Fetch price for other cryptocurrencies
Add 3 more Text cards to include the value of all 3 cryptos in project. Bitcoin, Litecoin and Ethereum. 

This will be a good place to keep DRY(don’t repeat yourself) in mind. Extract current card widget to create the 3 new ones . But lets not get ahead of ourselves for now, just focus on functionality


! - since we get all 3 cryptos with any call, I only need to create 2 additional variables to keep track of ethereum and litecoin and pass those to their Text widgets  
Created 
`int ltcRate;
int ethRate;`

It works!! Now - time to refactor
LeetCode 1. Two Sum (javascript solution)

Tags: algorithms, javascript
Published: 2021-04-17 22:54:32

###Description:
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

You may assume that each input would have exactly one solution, and you may not use the same element twice.

You can return the answer in any order.

###Solution:
Time Complexity : O(n)
Space Complexity: O(n)

```javascript
var twoSum = function(nums, target) {
    const store = {}
    for(let i = 0; i < nums.length; i++){
      let cur = nums[i]
      let diff = target - cur
      // Return answer if the current number was a diff from a previous number
      if(store[cur]!==undefined) return [store[cur], i]
      // Set diff to current index in store
      else store[diff] = i
    }
};
```
167. Two Sum II - Input array is sorted
(javascript solution)
Tags: algorithms, javascript
Published: 2021-04-17 22:49:22

###Description:
Given an array of integers numbers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.

Return the indices of the two numbers (1-indexed) as an integer array answer of size 2, where 1 <= answer[0] < answer[1] <= numbers.length.

You may assume that each input would have exactly one solution and you may not use the same element twice.

###Solution:
Time Complexity : O(n)
Space Complexity: O(1)

```javascript
// Two pointers
var twoSum = function(numbers, target) {
    // Start a pointer on each side of the array
    let left = 0;
    let right = numbers.length-1
    while(left < right) {
        const cur = numbers[left] + numbers[right];
        // Return 1 base index if the current sum is equal to the target
        if(cur === target) return [left+1, right+1]
        // Because the array is sorted, anytime we move a pointer to the right numbers will get bigger and anytime we move a pointer to the left, numbers will get smaller
        // If cur is greater than target that means we need to use smaller numbers in our sum and we move the right pointer to the left.
        // If cur is less than target that means we need to use bigger number in our sum and we move the left pointer to the right.
        cur > target ? right-- : left++
    }
};
```
How to work with error handling in Javascript
Tags: javascript, beginners, codenewbie, webdev
Published: 2021-04-17 22:36:22

In programming unintended side-effects called **errors** can and will happen in your code. Allowing these errors to be introduced to people that are using your programs is frowned upon and a very bad user experience. 

Error Handling is the technique of smoothly handling these errors and providing useful information to a user. 

Here are the important parts of error handling: 

### Try

The **try** block allows you to try an initial blog of code. 

```javascript

async function doWork() {

  try {
    let response = await fetch("www.worktobedone.com") 
   
    let work = await response.json()

    return work
  }

}
```

### Catch

The **catch** block allows you to catch an error from the initial blog of code. 

```javascript

async function doWork() {

  try {
    let response = await fetch("www.worktobedone.com") 
   
    let work = await response.json()

    return work
  } catch(error) {
     // Here we caught an error to alert
     alert(error)
  }

}
```

### Throw

The **throw** keyword allows you to control or create custom exceptions from your code. 

```javascript

async function doWork() {

  try {
    let response = await fetch("www.worktobedone.com") 
   
    let work = await response.json()

    return work
  } catch(error) {
     // Lets change the error output
     throw new Error(`Oops we found this error during work - ${error}`)
  }

}
```

### Finally 

The **finally** block allows you to execute code regardless of errors in the try and catch blocks. 

```javascript

async function doWork() {

  try {
    let response = await fetch("www.worktobedone.com") 
   
    let work = await response.json()

    return work
  } catch(error) {
     throw new Error(`Oops we found this error during work - ${error}`)
  } finally {
   return "My work here is done."
  }

}
```

### Let's chat about error handling
This walkthrough showed the steps to using the try..catch...finally block to handle errors. If you enjoyed this post feel free to leave a comment about your thoughts and experiences handling errors in your code.

Happy Coding,
Terry Threatt
Three Common Types of Errors in JavaScript 
Tags: javascript, syntaxerror, referenceerror, typeerror
Published: 2021-04-17 22:32:44

Hello everyone, in my very first blog post, I would like to introduce myself first and then have a quick look at what three types of errors in JavaScript are and how we are able to fix them. 	

Let’s start with me. I have been working as an Avionics Technician for a long time. When the pandemic started in the first quarter of 2020, the company I worked for put me in furlough for two months as all flights were suspended. I am not a person who stays at home just enjoying the time without knowing anything for the future with the risk of losing my job. Then, I was luckily introduced with Code Your Future where it is combined with brilliant volunteers and trainees who are aimed at creating a new life and career opportunity. After I met all entry requirements, I was accepted into a family-like environment to start learning coding. In my coding journey, I made a lot of mistakes and I was sometimes trying to pull my hair even if I don’t have any. While I was challenging the errors, one of my friends who is a Senior Developer encouraged me saying that **if your code works at the first attempt, it might be something wrong you are doing and you need to look at your code one more time.** I believe that learning from mistakes makes us stronger and it helps consolidate our knowledge. Now, let’s talk about three common errors we can come across in JavaScript.

**1. Syntax Errors:** These errors occur when pre-defined syntax of the language is not met and they are detected while compiling or parsing source code. 
 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b96ecgz4on8olekgfkss.png)

               Syntax Error: missing  )  after condition.

**2. Reference Errors:** These errors happen when a non-existent variable is referenced.

 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/60352473unt5q9y31k6q.png) 

     Reference Error: “grade” is not defined. It is simply misspelled.

**3. Type Errors:** These errors occur when an operation couldn’t be performed due to the fact that a value is not expected type.

 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84bf00xl3dy7k0kybyhe.png)

       TypeError: Cannot read property 'addEventListener' of null. 
 
As `.querySelector` accepts a CSS selector as an input, a dot is to be added before `add-btn` in the first line of code in order to call the correct element from HTML file.

All I can say is that I like the errors once I know how to fix them. Happy coding!
How To Make Jetbrains Sexy
Tags: jetbrains, webstorm, phpstorm, intellij
Published: 2021-04-17 22:17:38

How to make JetBrains.. SEXY!!
Step 01: Goto Plugins
Step 02: Download One Dark Theme by Mark Skelton FIRST
Step 03: Download Atom One Dark By Mayke
Step 04: Goto Appearance
Step 05: Make sure the theme is AtomOneDarkByMayke
Step 06: Use Custom Font Lucida Grande at Size 14
Step 07: Goto Editor -> Color Scheme > Scheme: and choose One Dark Vivid Italic
Step 08: Head back to Plugins and Install Atom Material Icons and Rainbow Brackets
Step 09: Pour a nice tall glass of wine, beer or cold brew and go code!
Really.. its really sweet
For Mac users
Now this is custom appearance font and not coding font
The UI
For coding my goto is Mono Lisa with Fira code as a backup for ligatures
I usually do size 16 if I'm on the big monitor or 12–14 if I'm just on the mac

If you enjoy my technology-focused articles and insights and wish to support my work, feel free to visit my Ko-fi page at https://ko-fi.com/philipjohnbasile. Every coffee you buy me helps keep the tech wisdom flowing and allows me to continue sharing valuable content with our community. Your support is greatly appreciated!"
Javascript: Hoisting
Tags: javascript
Published: 2021-04-17 22:17:03

When studying Javascript, there's a curious mechanism that you're likely to come across called <b>hoisting.</b> 

In Javascript, hoisting is when variables and function declarations are moved to the top of their scope. They are moved to top before they're even initialized.

What does this mean?

This means that in Javascript, you could technically do the following with var without throwing an error:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/00rcc7zp2p5fm9hjyai2.png)

Why doesn't the first line throw an error? The variable of animal has not been declared yet it seems, yet the first line does not throw the Reference Error we would expect. This is because variables declared with var are hoisted. 

During hoisting, when var variables are declared, they are "moved to the top". The initializations, their values, are not.

Therefore, in the previous example, by the first line, Javascript already knows that var animal exists; it just doesn't know its definition yet. In other words, it knows of its declaration, but it doesn't yet know how you initialized it. Hence, it first evaluates to undefined.

What about the more commonly used <b>let</b> and <b>const</b>? Well, if you tried to do the same as above, you'd be out of luck. Variables declared with let & const are not hoisted. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/he6414n9getqcv2uon42.png)

Above, we see that with let and const, trying to access the variable beforehand would throw the Reference Error: Cannot access 'animal' before initialization. 
 
What about functions?

Well, functions are hoisted as well:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2ie847tw00wpqdbtt0f.png)

In the function above, you can call the function on the line(s) before the declaration and initialization. But even better, calling a function won't evaluate to undefined! When you call a function on a line above the declaration, you will have full access, meaning the function will evaluate to however you initialized it. In this case, bark evaluates to "ruff ruff" on the first line. Great!

But wait... it's not that simple... 

Function expressions* stored with var are hoisted similarly to the very first example. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5q77pciso67xhudn3w6l.png)

The first line would get a Type Error. Like the first example, Javascript sees the variable cat, as undefined. However, calling a function on undefined creates an error, a Type Error.

Overall, hoisting is an interesting feature of Javascript that programmers should be aware of. However, it's not a mechanism we should ever rely on.

Best practice is declare and initialize Javascript variables at the top of your scope. This way, it's easier to read, understand, and it'll prevent this funky Javascript behavior from being a factor in the outcome of your code.
Manipulating Arrays!
Tags: javascript, tutorial, beginners, devops
Published: 2021-04-17 22:12:05

#### Manipulate Arrays With push()
For this part we will learn An easy way to add data to the end of an array via the push() function.

.push() takes one or more parameters and "pushes" them onto the end of the array.
* For Example:
```
var myArray = [["Alan", 25], ["Randy", 23]];

myArray.push(["Diego", 30]);
```
```
myArray now has the value [["Alan", 25], ["Randy", 23], ["Diego", 30]]
```


####Manipulate Arrays With pop()
Another way to change the data in an array is with the .pop() function.

the .pop() is used to take a value off of the end of an array. We can also store this popped off value by assigning it to a variable. In other words, .pop() removes the last element from an array and returns that element.
* Example:
```
var myArray = [["Alan", 25], ["Randy", 23], ["Diego", 30]];

var removedFromMyArray = myArray.pop()
```
```
console.log(removedFromMyArray); // will display ["Diego", 30]   
console.log(myArray); // will display [["Alan", 25], ["Randy", 23]]
```

####Manipulate Arrays With shift()
pop() always removes the last element of an array...but What if you want to remove the first?

the .shift() removes the first element instead of the last.

* Example:
```
var myArray = [["Alan", 25], ["Randy", 23], ["Diego", 30]];

var removedFromMyArray = myArray.shift();
```
```
console.log(removedFromMyArray); // will display ["Alan", 25]
console.log(myArray); // will display [["Randy", 23], ["Diego", 30]]
```

####Manipulate Arrays With unshift()
you can also unshift elements to the beginning of an array i.e. add elements in front of the array.

the .unshift() works exactly like .push(), but instead of adding the element at the end of the array, unshift() adds the element at the beginning of the array.

* For Example:
```
var myArray = [["Alan", 25], ["Randy", 23], ["Diego", 30]];
myArray.shift();
myArray.unshift(["Johnny", 34]);
```
After the shift, myArray would have the value
```
[["Randy", 23], ["Diego", 30]]
```
After the unshift, myArray would have the value
```
[["Johnny", 34],  ["Randy", 23], ["Diego", 30]]
```