teleren/devto huggingface dataset:
Deep copy and Shallow Copy
Tags: appdev, code, concepts, ios
Published: 2018-04-11 06:56:08

---
title: Deep copy and Shallow Copy
published: true
tags: appdev,code,concepts,iOS
canonical_url: 
---

This is an important concept of computer science. You may have heard it very less in your day-to-day work life but your work will directly or indirectly relate to this one of the main concept of memory management. Let’s dive into this.

> Here is scenario – Assume you have a team of 5 members. You have created a document on Google Drive and shared the link to the document with your team members.

Now how the doc is used / consumed is upto the members. Primarily there are two ways:

1. One is : Using the online version directly to read/update or if someone updates you get the latest update directly. One can see the changes live.
2. The other way is: Download a copy to your local system and use it as per your wish, manipulate it update it without altering the original copy which is on the cloud.

Thats it. If you know the difference between the 2 above,You got the concept! The first one is  **Shallow copy** of the document and the second one is  **Deep copy** of the document.

Now using this analogy let me explain you the memory management concepts of Objective-C and Swift.

- **strong** : Members who have doc added to their own drive. Even if original is deleted the doc is not deleted. The reference link still points to the doc
- **weak** : Members who have access to the doc will be informed upon deletion of the doc. Now the reference link will be invalid. It will point to nil.
- **assign** : Members who have access to the doc will **NOT** be informed upon deletion of the doc. Now the reference link will be invalid. App crashes if the link is accessed.
- **copy** : Members download copy of the doc to their own system. Does not effect if either of them are modified or deleted. Takes up additional memory unlike the above 3 which are referenced to same memory location. **Mutable copy** is when document is downloaded with RW permissions.

The 4 statements above may or maynot hold good for Google drive but only used to explain the concept.

## **Pros & Cons:**

#### Shallow copy

- Doc link which is stored in the cloud
- Owner and admins is the strong reference
- Non admins will have weak reference
- Changes to the document will be notified to every member

#### Deep copy

- Document downloaded to local system
- Consumes additional storage
- If some one changes in the cloud does not effect your local system
- Whatever you change locally does not effect cloud version

I made up this analogy because I found it easier to link both the concepts for understanding. Let me know if you find this difficult or missing. Please share your comments below.

_happyCoding();_

[  
 ![Dam's DEV Profile](https://d2fltix0v2e0sb.cloudfront.net/dev-badge.svg)  
](https://dev.to/itscoderslife)
Practicality Beats Purity - Modularity
Tags: python, engineering, practicality
Published: 2019-07-05 03:29:23

---
title: Practicality Beats Purity - Modularity
published: true
tags: python, engineering, practicality
canonical_url: https://tryexceptpass.org/article/practicality-beats-purity-2/
cover_image: https://tryexceptpass.org/images/rube-goldberg.jpg
---

Continuing on the [Practicality Beats Purity](https://tryexceptpass.org/article/practicality-beats-purity-1) series, today we’re talking about **modularity**. While written with python in mind, the discussion here applies to any language that’s highly modular and with a large ecosystem.

As is touted frequently, python is quite famous for being a “batteries included” language with a vast ecosystem of modules and packages that provide almost every possible utility or function you’ll ever need. When building large applications, it’s a great idea to make use of this environment and not reinvent the wheel. This makes rapid development and prototyping real easy.

However, you must keep in mind that every new dependency added is one more variable that you have little to no control over. While you may not write the code yourself, there’s still cost incurred in keeping up with the most recent versions of your dependency and watching for security flaws and their respective fixes. It’s also important to pay attention to the size of the community around those dependencies, their interaction with other modules, responsiveness to reported bugs, and the size of supporting documentation both official (like read-the-docs) and unofficial (like stack overflow).

Following we discuss some of the costs.

[Read on ...](https://tryexceptpass.org/article/practicality-beats-purity-2/)
What are some "hidden gem" GitHub repositories?
Tags: discuss, github, opensource
Published: 2018-03-04 03:35:35

---
title: What are some \"hidden gem\" GitHub repositories?
published: true
description: Some projects really don't have the amount of stars they deserve
tags: discuss, github, oss
---

Have you ever been working on a project, found the perfect GitHub library, and then realized the star count was less than humblebrag worthy?

The best code is the code that does the job, so what are some of the best "hidden gem" repos you've ever found?

- GitLab and BitBucket etc count too as long as it's open source :D
Reading files in a Chrome Extension
Tags: javascript
Published: 2018-03-04 01:16:15

---
title: Reading files in a Chrome Extension
published: true
description: This short guide will show you how to read from files in a Chrome extension
tags: javascript
canonical_url: https://anthonybruno.dev/2018/03/03/Reading-Files-In-a-Chrome-Extension
---
Often, it is desirable for a Chrome extension to be bundled with files that need to be read. These files may contain data or configuration information to help the extension function. This short guide will show you how you can set up your Chrome extension to read files.

## Add file path(s) to manifest.json
Firstly, you must add the file paths to the web_accessible_resources property in the manifest.json file. The file paths are relative to the extension's root (where the manifest.json is located). For instance, if I wanted to include a file called `info.json` that is located in a folder data, it would look like:

```json
"web_accessible_resources": [
    "data/info.json"
]
```

A cool feature is that these paths support wildcards. For example:

```json
"web_accessible_resources": [
    "data/*.json"
]
```

will allow access to any json file in the data folder.


## Read from the file
The next step is to read the data from the file. To do this, we need to get the
URL of the file and make a request to it.

To get the URL of the file we can use `chrome.runtime.getURL('path/to/file')`.

Then, we make a GET request to the URL. In this example, we will use the ES6 feature [Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) but methods such as `XmlHttpRequest` will also work.

```javascript
const url = chrome.runtime.getURL('path/to/file');

fetch(url)
    .then((response) => response.json()) //assuming file contains json
    .then((json) => doSomething(json));
```

And there we have it!

To reiterate the steps simply:

1. Add file path to the `web_accessible_resources` property in the `manifest.json` file
2. Get the URL of the file using `chrome.runtime.getURL('path/to/file')`
3. Make a GET request to the URL
My Journey As A Django Developer
Tags: webdev, career, python, django
Published: 2019-02-07 04:00:26

---
title: My Journey As A Django Developer
published: true
tags: webdev, career, python, django
canonical_url: https://www.maxongzb.com/my-journey-as-a-django-developer
---

![Photo by Mantas Hesthaven on Unsplash](https://thepracticaldev.s3.amazonaws.com/i/bl6iaoka9pkvjfkt74uk.jpg)

# Introduction
When I first started my journey as a **Django** developer. I was a person who has totally lost touch or has sort of given up (Lucky I didn't) on landing myself a software engineer job after graduating from University thinking I might not be cut out for the job.

# Talentless As a Developer
With much luck, I was able to secure for myself a business development job at an EdTech Startup before my final exams. After spending with the startup for about 5 or 6 months and a few of life's curveball. I left my job to get my hands dirty in entrepreneurship without much success

Defeated and my increasingly empty piggy bank. I went to look for a job with my mentor's (**Kenny** helped me with figuring out a career for myself and getting out of the runt I was in)  help. I was able to secure some jobs but it didn't last long. 

After going through & applying a countless amount of startup jobs from Tech In Asia, Linkedin or e27 with a large percentage of those jobs are web development in some form. 

# Eureka Moment
Then a eureka moment came to me like a sledgehammer breaking a feeble wall. I suddenly remembered that there were actually people who were doing web development with a funky name called **"Django"**  during **PyCon 2016 SG**.

Being a python person and I had always wanted to find a job using Python. So I started to devour anything I could get my hands on for Django like from watching tutorials from youtube channels like **Chris Hawkes**, **Coding for Entrepreneurs**. I even borrowed a book called **"Two Scoops of Django"**  from my friend **Joie**.

I was desperate for a job and upgrading my skill I ended up  enrolling myself in a Udacity Nanodegree programme called **"React"** that teaches **React **, **Redux** and **React Native**

# Focus in a Niche
Sometimes being super focus by knowing what you can do to pick your battles could land you with an unexpected result. Due to me constantly searching for jobs that use **Django**.

I was able to land myself in an internship with a local IoT Security Startup called **"Microsec"**  that till this day I'm working with them full time as a **"Full Stack Developer"**

## Ref

* ### [Two Scoops of Django 1.11: Best Practices for the Django Web Framework](https://www.twoscoopspress.com/products/two-scoops-of-django-1-11)

* ### [Chris Hawkes](https://www.youtube.com/user/noobtoprofessional)

* ### [CodingEntrepreneurs](https://www.youtube.com/user/CodingEntrepreneurs)

* ### [React Nanodegree](https://www.udacity.com/course/react-nanodegree--nd019)

This post was originally posted on max's blog at [My Journey As A Django Developer](https://www.maxongzb.com/my-journey-as-a-django-developer/) and picture from [Photo by Mantas Hesthaven on Unsplash](https://unsplash.com/photos/_g1WdcKcV3w)
Mongodb-native over mongoose?
Tags: discuss, javascript, node, webdev
Published: 2018-03-03 21:50:27

---
title: Mongodb-native over mongoose?
published: true
description: Everyone uses mongoose!:(
tags: discuss, javascript, node, webdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/s6udt3etok0w51o21ev9.jpeg
---

Everyone uses mongoose!
I do not like mongoose, all the abstractions that it implements have not been very useful when making complex transactions that require more of one query to work. Also, i end up learning "mongoose" instead of mongodb.

However, I recognize the importance of the scheme, since it "facilitates" the reading of the code for other programmers of the team.

Normally (talking about an api), the first thing I do with the incoming data is to check and validate them so that the controllers work only with "clean" data and do not have to work in vain if any incoming data is incorrect.

Due to the previous thing, to implement schemes in the model becomes unnecessary, since the data are validated. I like this, but there is still a problem, the programmers must analyze the validators, to understand what type of data they are handling.

The easiest solution would be to create the scheme, even though the data is already validated, but this would lead to repeating a lot of code throughout the application.

Do you think that the schemes are overvalued?
Am I missing something?
Have you experienced something similar?
How have they solved it?
Any useful advice for a newbie?

I know it might seem silly, but lately I'm "a little bit" more attentive to architecture, and I see that working without schemes and models goes against to the MVC.
MVP AF
Tags: beginners, scrum, career
Published: 2018-03-03 21:43:58

---
title: MVP AF
published: true
description: Retrospective of our first sprint and my first build
tags: #beginners #scrum #career
---

So week 3 of Mayden Academy is over, and this week was our first full beginning-to-end site build. We were asked to design & create a portfolio website to showcase our skills to prospective employers, the coolest thing being that this was our first real implementation of Scrum from sprint planning to sprint retrospective, and all of the actual work in between. Also using Git within the context of an actual project made it seem a lot less scary (even if some of us had issues which had to be solved with...dark arts).

<u>Hard stuff</u>
I found the design aspect really challenging. Not only did I find it difficult to just to put pen-to-paper and decide on a wireframe, about halfway through the sprint I realised that I needed something very different to my design and spent about 15 minutes figuring out if I could start again (which, of course, I couldn't). So I had to carry on unhappy with it. 

<u>Good stuff</u>
As much as I struggled with the design, I learned a lot from it (and let's be honest, that's why I'm at the academy). I tried to cram content into every part of the page, rather than exploit space & images, and also figured that it <i>wouldn't</i> be an absolute pain-in-the-arse to use portfolio images of varying sizes and aspects (of course it was). Also, I know that next time I'll try and make  my initial page responsive to as many different screen sizes as possible <em>before</em> using a ton of media queries.

Other 'Good stuff' was that the team really embraced Scrum: nobody worked in their own world, we shared ideas & problems and the burden of code review was truly shared across the whole team. It was a refreshing way of working, and felt collaborative rather than competitive.

So overall some good stuff, some hard stuff, but we're still learning and growing and I can't wait to see what the next 13 weeks hold for us. And as much as I wasn't happy with my design, I still ended up satisfying all of the requirements. MVP, innit.

In scary news, at the end of this week we will already be a <em>QUARTER</em> of the way through...
Importing Data From Google Spreadsheet into Firebase
Tags: importdata, firebase, googlespreadsheets
Published: 2018-09-02 17:56:47

---
title: Importing Data From Google Spreadsheet into Firebase
published: true
tags: import-data,firebase,google-spreadsheets
canonical_url: 
---

For a group project, we have decided to collect resources using a Google Form, which stores the data into a spreadsheet. In order to make this more useful for us, we decided to import the data into Firebase. The following are the steps used to import the data from the Google Spreadsheet into Firebase.

#### Spreadsheet Setup

1. Make a copy of the spreadsheet
2. On the Tools menu, select the _Script editor…_ option

![](https://cdn-images-1.medium.com/max/1024/1*TqxHjaNyDHduIBhyThDsSg.png)

3. Once you are in the script editor, select Resources > Libraries…

![](https://cdn-images-1.medium.com/max/530/1*eUmJ7J9eUabiE2GuW3yVyw.png)

4. Follow the steps here to select the Firebase library: [https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/firebase](https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/firebase)

![](https://cdn-images-1.medium.com/max/1024/1*bEo6nD6ZXMh5xeSz9OObQw.png)

5. Follow the steps here to start importing the data into Firebase: [https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/firebase/tutorials/read-and-write-data-in-firebase-from-apps-script](https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/firebase/tutorials/read-and-write-data-in-firebase-from-apps-script)

There are following caveats when importing the spreadsheet data over to Firebase:

You cannot have invalid characters for the Firebase key so take a look at the character set limitations below. The key is part of the URLs used to construct the Firebase references. Therefore as a workaround, encoding the email address as base64 will work.

**Character Set Limitations**

Note that URLs used to construct Firebase references may contain any unicode characters except:

- . (period)
- $ (dollar sign)
- [ (left square bracket)
- ] (right square bracket)
- # (hash or pound sign)
- / (forward slash)

Permission must be provided before the app script can be run against the spreadsheet.

Finally, the app script for importing our data from the spreadsheet to our Firebase looks something like this:

{% gist https://gist.github.com/dynamite8/d9153d285d418b372a327562ec36cc70 %}

Be sure to replace the spreadsheet URL (copy from the exact URL after opening your spreadsheet manually) and the Firebase URL (copied from the Firebase Dashboard). Updated the JSON format manually as needed before executing the script. However, even if you make a mistake, you can go to the Firebase Dashboard and delete all the data.

For reference, to delete the data from the Firebase Dashboard, click on the X and confirm by clicking on the DELETE button as shown below:

![](https://cdn-images-1.medium.com/max/934/1*wVtWP2KXbUOcKPmbPTRKGg.png)

![](https://cdn-images-1.medium.com/max/1024/1*HTFug3x69DVrJPOT-v2bwA.png)
Show me your .gitignore
Tags: git, discuss, development, settings
Published: 2018-03-03 17:24:15

---
title: Show me your .gitignore
published: true
description: .gitignore
tags: git, discuss, development, settings
---

The `.gitignore` file exists in almost every of our projects, but even across similar projects the `.gitignore` always looks different.

Cheers
Nevertheless, Paula Coded
Tags: wecoded
Published: 2018-03-03 15:47:37

---
title: Nevertheless, Paula Coded 
published: true
tags: shecoded
---


## I began/continue to code because...

Since I was a a toddler, I've been using the computer. I was into science because my dad showed me Cosmos episodes, and I liked mechanics. Although, I didn't know about computer engineering until I was in secondary school, when I discovered it by chance on the internet. I still remember becoming so excited and started looking for more and more information about it, learning coding in python on my own and studying really hard in Baccalaurete science degree for getting the grades that would allow me to study computer engineering. I keep coding and learning new languages since then, as a computer engineering senior student, because it makes me feel as excited as back then when I discovered I could build programs and hardware. 


![](https://thepracticaldev.s3.amazonaws.com/i/6mvxnsscq7zexjrq9fi6.jpg)

## I recently overcame...
Some senior year subjects in a new speciality. When I was first offered to pick a computer science speciality I took Hardware and electronics, and I really liked it but I wanted to get a wider view, and so this year I also took some subjects from a different specialization (information systems) which includes several new things for me such as cloud computing, applications development and systems' security. I passed them all at once and I'm very excited about exploring new areas. 

## I want to brag about...

Interferencias and HACKIIT groups. Interferencias is a digital rights awareness association I founded in 2016 that grabbed so much attention in my country and currently have more than 500 members. I feel happy that many people are into digital rights and want to protect our privacy. HACKIIT is a Hacking group in my university, and I was assigned as a tutor for a group of students who are into network and forensic hacking. This allows me keep investigating, learning and sharing what I love the most in computer science: security. 

![](https://thepracticaldev.s3.amazonaws.com/i/ceh9ezsll03l5njc93s7.jpg)

## My advice for allies to support women who code is....

We are not "female programmers", we are **programmers**. Engineers. Treat us as equals and react accordingly. My classmates and friends, the guys in Interferencias and HACKIIT, they all trust my word and my code because I have proven it to be trustworthy, and that gives me wings to improve each and everyday comfortably as an equal. If anyone around you compromises this equality, don't keep your mouth shut, please!

![](https://thepracticaldev.s3.amazonaws.com/i/uezstg86ekho8o1ybunj.jpg)
What good conferences can I attend to in Central Europe?
Tags: conferences, europe, switzerland, education
Published: 2018-03-03 14:31:44

---
title: What good conferences can I attend to in Central Europe?
published: true
description: Looking for conferences in Central Europe 
tags: conferences, Europe, Switzerland, education
---

I've recently relocated from the UK to Switzerland and look at moment for conferences or events I can attend to without much traveling. I would say, that my profile is rather broad and that a kind of full stack dev. In the past I've attended Spring, Angular or various data processing conferences. 

When London was basically just around the corner for me, this kind of conferences were very easy to find. But now I'm living in Switzerland, close to Germany and France, and now I'm trying to find the hotspot where I can find good conferences or maybe a good recommendation for a good one. 

Cheers
Is `this` in Javascript bad?
Tags: discuss, javascript
Published: 2018-03-03 09:52:27

---
title: Is `this` in Javascript bad?
published: true
description: 
tags: discuss, javascript
---

Recently I have an argument with a friend who absolutely hate the `this` keyword in Javascript. He claims that since the language has an ambiguous binding of `this` in different situations, e.g. `const f = obj.g` will lose the binding to `obj`, `obj.g.call(obj2)` will call `g` in the context of `obj2`..., the `this` keyword in Javascript is simply one of the worst thing in Javascript. 

He also claims that Javascript would be a lot easier to code/maintain by avoiding the use of `this` keyword. He advocates the following pattern for object creation:

```javascript
function Car() {
  const car = {};

  car.position = 0;

  car.move = () => car.position++;

  return car;
}

new Car();
// or
Car();
```

I am, on the other hand, very comfortable with the `this` keyword. I use it a lot and appreciate how `bind`, `call` and `apply` works. However, I can't really find a legit argument against his pattern, because it really seem to be clearer for those who don't know much about Javascript?

What do you think? Give me some insights!