teleren/devto huggingface dataset:
A developer is a developer(It doesn't matter which technology you choose)
Tags: 100daysofcode, react, webdev, gamedev
Published: 2019-07-23 19:23:16

---
title: A developer is a developer(It doesn't matter which technology you choose)
published: true
description: Learning React and other web dev tools
tags: #100daysofcode #React #Webdevelopment #GameDevelopment
---
Development is tricky and we need daily motivation to be a developer as it can be a bit boring many times.
After working as a game developer before using **Unity engine and c#** and now working in **React**, I realized that we should stick to one thing and focus on projects and features rather than language. The only thing that matters is we should understand the core of developing i.e. for me is problem solving.
"Big Oh": Is my reasoning right?
Tags: help, algorithms, maths, complexity
Published: 2019-07-23 19:04:49

*Apologies for bad notation. Also, I'm not a native speaker.*

I started reading this book:

<img src="https://thepracticaldev.s3.amazonaws.com/i/tl44jmw0qqxd3itzmfoh.gif" width="200px">

I am currently reading the first chapter, which is about time complexity / asymptotic notation.

So I'm told that for an algorithm whose running time is described by the function 𝑇(𝑛) = 3𝑛³ + 2n² we have a worst-case complexity of O(𝑛³). Fine.

I'm told that I can easily prove that T(n) ≤ 5𝑛³. Fine. (I'm pretty confident in my highschool maths skills.)

Basically, I ended up with T(𝑛) ≤ **3.0...01**𝑛³ for 𝑛 tends to +∞. A different value of 𝑐.

It might sound dumb that 3𝑛³ + something could be smaller than 3𝑛³ but I found this using *limits*.

My reasoning was that, after manipulating the inequality T(n) ≤ 𝑥𝑛³, one could end up with the following statement:

<center>3 + 𝑛<sup>-2</sup> ≤ 𝑥</center>

Now 𝑛 is just a positive integer constant. So let it be 1; smallest input. We end up with 𝑥 = 5. The value provided by the book.

But let's say that 𝑛 gets bigger and bigger; and eventually tends to +∞. Since 𝑛<sup>-2</sup> would then tend to 0, we have 𝑥 tends to 3.

So T(𝑛) ≤ 𝑥𝑛³ with 𝑥 a real number that tends to 3 from upper values but is not exactly 3. In fact, it wouldn't work with 3.

### In GeoGebra

Click [here](https://i.imgur.com/g4dfaq8.mp4) if you can't see the video.

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

C is the point at which 𝑥𝑛³ gets bigger than T(𝑛).

### My question

First of all, is my reasoning correct? Can I use this kind of reasoning when dealing with algorithms complexity? I'm pretty confident that it "holds" mathematically speaking but does it apply here?

I understand that it is not really important since we end up with the same O() but still, just curious.

Thank you.
What topics would you like to see in a Client Side Routing Overview?
Tags: discuss, beginners, javascript, webdev
Published: 2019-07-23 18:46:16

I was recently asked to give a presentation at work on client-side routing. I thought I'd reach out to the Dev Community to see what topics you would like to see if you were being introduced to Client Side Routing since I might turn this into a blog post later. 

The talk is for Vue, but discussing other frameworks is welcome too!

####Topics I was thinking about covering: 

- What it is
- Problems it solves
- hash vs "history mode"
- route guards
- accessibility concerns (if I have time)


Is there anything else you'd like to see covered (or would have liked someone to cover when you were a beginner)?
Call DLL functions from Python
Tags: python, c
Published: 2019-07-23 18:26:16

---
title: Call DLL functions from Python
published: true
description: python, c
tags: python, c 
cover_image: https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FbZQvimlS7kuGc%2Fgiphy.gif&f=1
---
Do you hav experience with C programming? 

You can call C functions from <a href="https://pythonprogramminglanguage.com/">Python</a>, with ctypes. What is ctypes?

*ctypes is a foreign function library for Python. It provides C compatible data types, and allowscalling functions in DLLs or shared libraries. It can be used to wrap these libraries in pure Python.*

This how to do it in Python 2.x (if you still have that):

    #!/usr/bin/python
    from ctypes import *

    libc = cdll.LoadLibrary("/lib/x86_64-linux-gnu/libc.so.6")
    printf = libc.printf
    printf("hello world\n")

For Python 3.x programs (yes the difference is one character)

    #!/usr/bin/python3
    from ctypes import *

    libc = cdll.LoadLibrary("/lib/x86_64-linux-gnu/libc.so.6")
    printf = libc.printf
    printf(b"hello world\n")


Make sure the path to your shared library (libc.so.6) is right. 

<img src="https://proxy.duckduckgo.com/iu/?u=http%3A%2F%2Fsocialnewsdaily.com%2Fwp-content%2Fuploads%2F2016%2F07%2Funnbgkdbmsszmazgxkmr.jpg&f=1">

Chances are it's on another location. On Windows or Mac its different path and name. Otherwise it's very basic, and this should work for any C library.

Related links:
* <a href="https://stackoverflow.com/questions/5081875/ctypes-beginner#5082294">Ctypes beginner example (Python+C)</a>
* <a href="https://docs.python.org/2/library/ctypes.html">Ctypes documentation</a>
* <a href="https://pythonprogramminglanguage.com/">Learn Python programming</a>
Plug and Play GraphQL with Django
Tags: graphql, django, python, webdev
Published: 2019-07-23 17:43:29

### [Github (pnp-graphql) v0.0.1-beta](https://github.com/iashraful/pnp-graphql)
> A library for making GraphQL API with Python/Django. This is like a flash drive, just how you plug into computer and transfer files.

#### What is pnp-graphql?
The tiny library is for making GraphQL in a minute. It considers models based approach. For example, Your app has few models like **Book**, **Author**, **Publication** etc. Now this library will enabled a GraphQL API for all those models. You can do query, mutation on API.  

**Example Query for "Book"**
```
query getBooks {
  bookList(limit: 500, name: "Honey") {
    id
    name
    publication {
      id
      name
    }
    authors {
      id
      name
      address
    }
  }
}

```
**Example Create Mutation for "Book"**
```
mutation CreateNewBook{
  createbook(input:{
    name: "GraphQL the awesomeness of API development",
    authors: [1,7],
    publication: 103
  }) {
    book{
      id
      name
      authors{
        id
        name
      }
      publication {
        id
        name
      }
    }
  }
}
```
**Example Update Mutation for "Book"**
```
mutation updateBook{
  updatebook(id:2, input:{
    name: "Hello Honey Bunny??"
    authors: [1,2,3]
  }) {
    book{
      id
      name
      publication{
        name
      }
      authors {
        id
        name
      }
    }
  }
}
```
**Example Delete Mutation for "Book"**
```
mutation deleteBook{
  deletebook(id: 500){
    book
  }
}
```

#### Quick Start
> Documentation is coming soon...

* Install from pip `pip install pnp-graphql`
* Add PnP GraphQL config on settings.
```python
GRAPHENE = {
    'SCHEMA': 'pnp_graphql.schema.schema'
}

PNP_GRAPHQL = {
    'ENABLED_APPS': ['example_app']
}
```
* Set `DEBUG = False` for production use.

**That's it :)**  
**Now visit:** *http://your-ip:port/api/graphql-explorer/* for explore GraphQL built-in UI explorer for query.  
**Production ready API :** *http://your-ip:port/api/graphql/*


#### What's working?
* GraphQL query
* Mutation (Create, Update, Delete)
* Pagination
* API filtering for Number, String, Date, DateTime

#### What are the plans?
* Authentication
* Proper error handling
* Field validation
* Caching
* many more ... ... ...

**Contributors are most welcome :)**
Aprendiendo python...
Tags: beginners, python
Published: 2019-07-23 17:35:17

Llevo gran parte de mi vida rodeado de temas de IT. Empecé administrando redes pequeñas y al momento me dedico a diseñar e implementar redes seguras en grandes escalas y con un enfoque completo a la parte de cyberseguridad.

He configurado infinidad de marcas, estando especializado en marcas de fabricantes como cisco, fortinet, palo alto y otros más. Pero ha llegado el momento en el que aprender esos lenguajes de programación no son suficientes.

Ahora todo es mas dinámico, no hay tiempo de espera para realizar los ajustes en la red que se requieren para cumplir con los estandares y necesidades de conectividad que hay hoy en día.

Así que el modelo de diseño, infraestructura y de operación han cambiado para intentar alcanzar estas necesidades. Por lo cual, es necesario entrar en temas de programación con lenguajes que permitan automatizar configuraciones y temas operativos como lo son los temas de monitoreo a nivel de dispositivos y a nivel de seguridad.

El mismo escenario de crecimiento te va encausando hacia un lenguaje de programación, los dispositivos de red y de seguridad van arrojando pequeñas muestras de estos lenguajes al anunciar su integración o su adopción bajo el concepto de APIs.

Inicio con Python, se refieren a este lenguaje como un lenguaje sencillo y facial de aprender. Por lo cual espero lograr esta adopción en poco tiempo.

Aprovecho este foro para documentar mis avances y compartirlos con esta comunidad.


tl;dr
Debido a las necesidades en la administración y configuración de las redes actuales, es necesario programar. En este caso, empiezo a aprender el lenguaje de programación python.
Ability to change configuration after build. For containerized Angular and more
Tags: angular, webdev, docker, javascript
Published: 2019-07-23 17:32:08

It is pretty normal to encounter an application that requires multiple environment configurations. But when it comes to web, we tend to build a whole new app once again when we change just the environment configurations. And the process takes **minutes**.

In the world of containerization, this strategy of building everything makes it difficult to achieve *one image, deploy everywhere*, which I am such a fan of. And when someone tries to do so, it always makes a BIG image with building tools and so on. Plus, a long starting time for the containers too.

So my goals here are:

- We can build once and deploy everywhere.
- We can have a small final product image.
- We can have the ability to change those environment configuration just at the deployment time.

With a simple web concept, we can achieve that.

## GLOBAL VARIABLES!!!!

Yep... you heard it right.

1. I plan to put `<script>` in the `<body>`. Inside this `<script>`, I want to declare a global variable which is a simple object contains configuration of the environment. **But**, I am not going to put it in the `index.html` yet. Let's put a placeholder, say `<!-- CONFIG -->`, instead.
2. In configuration file (such as what we have in typical Angular projects), I  implement it to read global variable first, or else, assign a default configuration.
3. Add a new [`sed`](https://linux.die.net/man/1/sed) command for docker image. Which basically do just replace the placeholder with a config from [environment variables](https://docs.docker.com/engine/reference/builder/#env).

Just that. We are good to go! Here are gists just for an idea.


{% gist https://gist.github.com/mixth/001c0c26efe1942269e6802a206d82f6 %}

## Cons?

The config is plainly exposed.

This might let some users making weird things to your web. But I guess, it gonna have just a minimal impact since if they look hard enough, they might find it in any scenarios. Anyway, please proceed with caution.

-----

That's it! Thanks for reading 😁
If you have any questions or some kind of improvement, please let me know in the comment below.
Generate QR codes in Python
Tags: python, qr
Published: 2019-07-23 16:43:32

---
title: Generate QR codes in Python
published: true
description: python
tags: python, qr
cover_image: https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Ftse3.mm.bing.net%2Fth%3Fid%3DOIP.m0MtcoXMUel19JMscC3tPQHaEc%26pid%3DApi&f=1
---
QR code a type of matrix barcode first designed in 1994 for the automotive industry in Japan. These days it's used in many places like banking, cryptocurrency, advertisements and more.

<img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fentrackr.com%2Fwp-content%2Fuploads%2F2018%2F03%2FBharat-qr-app-image_2.gif&f=1">

Did you know you can generate these codes with Python? You should know the <a href="https://pythonbasics.org">Python programming language</a>. But even without to much practice, you can generate them.

Install the qrcode module

    pip install qrcode

Then you can load it in Python

    #!/usr/bin/python3
    import qrcode
    img = qrcode.make('hello world')
    img.save('test.png')
 
This will output the QR code as an image (test.png).

<img src="https://thepracticaldev.s3.amazonaws.com/i/zldv7y8ovcvdt1uhxmk4.png">

So it's that easy. How much data can you store on a QR code?

According to <a href="https://stackoverflow.com/questions/11065415/how-much-data-information-can-we-save-store-in-a-qr-code">stackoverflow</a>

    QR codes have three parameters: 
    Datatype, size (number of 'pixels') and error correction level. 
    How much information can be stored there also depends on these   
    parameters. 

* Numeric only Max. 7,089 characters
* Alphanumeric Max. 4,296 characters
* Binary/byte Max. 2,953 characters (8-bit bytes)

<img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fqr8EicESfLSCY%2Fgiphy.gif&f=1">

You may be able to zip your data and bypass this limit to some extend.

Related links:
* <a href="https://en.wikipedia.org/wiki/QR_code">QR codes on Wikipedia</a>
* <a href="https://pythonbasics.org/">Learn Python</a>
* <a href="https://pythonbasics.org/exercises/">Python exercises</a>
!x && (x !== false) && (x !== 0) && (x !== '') && (x !== null) && (x !== undefined)
Tags: javascript
Published: 2019-07-23 16:18:48

JavaScript never ceases to surprise me. This time, a friend shared the following riddle in the JavaScript Israel community:

Which value of `x` will cause the following statement to be `true`?

```javascript
!x && (x !== false) && (x !== 0) && (x !== '') && (x !== null) && (x !== undefined)
```

Basically, we want to find a value that is falsy in JavaScript (in other words, `!x` is true), but is not `false`, `null`, `undefined`, zero or the empty string.

Take a moment to think of an answer. Then, scroll down for my answer and other answers suggested by the community.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

## My Answer 

My approach was to make `x` evaluate to a different value each time, so it will be falsy when `!x` is evaluated, but will pass all the other tests. 

Thus, I defined a getter for x on the `window` object, incrementing the returned value upon each call:

```javascript
var counter = 0;
Object.defineProperty(window, 'x', { get: () => counter++ });
```

Since `x` starts with zero and increments on each read, the original expression becomes:

```javascript
!0 && (1 !== false) && (2 !== 0) && (3 !== '') && (4 !== null) && (5 !== undefined)
```

which evaluates to true!

## Even More Answers

While I was typing my answer, someone has already found a very simple answer: x should be `NaN`. This value is falsy, and is indeed not equal to any of the the other values in the expression. You can also verify this by looking at the [definition of toBoolean](https://www.ecma-international.org/ecma-262/6.0/#sec-toboolean) in the ECMAScript standard.

Another answer, which really surprised me, was `document.all`. If you are curious to know why `document.all` is indeed falsy, check out [this StackOverflow answer](https://stackoverflow.com/a/10394873/830623). Legacy reasons, amazing!

Finally, the answer that the original author of this riddle was looking for, is `BigInt(0)`. If you haven't heard of this before, don't worry - it's still not an official part of the JavaScript language, but will probably be soon, as part of the [BigInt proposal](https://github.com/tc39/proposal-bigint). If you are interested, MDN has [a pretty good documentation about BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt).

What I love about this riddle, is how diverse the solutions are: one exploits the dynamic nature of JavaScript using `Object.defineProperty`, another solution uses legacy feature (document.all), while the `BigInt` solution uses a feature which has not yet introduced into the language (but is already available in Chrome). Pure fun, isn't it?
What does a software architect do?
Tags: discuss
Published: 2019-07-23 16:07:55

---
title: What does a software architect do?
published: true
description: discussion about the software achitect role.
tags: discuss
---

So, after searching for a while, and noticing how each company treats a software architect(at least here in Brazil), I am wondering what exactly would be the responsibilities of a software architect?
Introducing UADO — An Uno Platform App Showcase
Tags: news
Published: 2019-10-03 14:37:26

---
title: Introducing UADO — An Uno Platform App Showcase
published: true
tags: News
canonical_url: https://platform.uno/introducing-uado-an-uno-platform-app-showcase/
---

As Uno Platform team we were challenged with creating a showcase app that is _both_ useful in terms of showcasing Uno Platform while ALSO being a real, useful app that software developers will use on day-to-day basis. The idea for an app born from our own need — having a beautiful mobile app that can be used while ‘on the go’, as well as during scrums — to easily pull up the list of work items you will, and had been working on in the past.

**Here is the full list of tasks you can do with UADO which is accessing Azure DevOps.**

1. Authenticate using Microsoft credentials to gain access to Azure DevOps organizations you are a member of;
2. Access organization’s full list of projects and their respective sprint associated work items as well as members;
3. Work item details can be consulted with the ability to “Assign To Me” easily accessible from within the application;
4. Ease of access to the Azure DevOps web client using the application’s embedded links for further edits.

Of course, you can do all of these tasks via the Azure DevOps web client — however quickly getting to your items can be time consuming and not displayed as neatly as with a beautifully designed mobile app. The Web Client of the app is meant to be the showcase part of the Uno Platform on the Web. It’s a bit of ‘duplication’ compared to Azure DevOps. But this is where ‘showcase’ part of the app comes in play — so you can envision the possibilities of Uno Platform. We wouldn’t expect you to replace your Azure DevOps web access with it.

At the end of the day UADO is meant to help you learn and experiment with Uno Platform by examining its source code. You will be able to see how we handle authentication, events, and more.

**UADO is available in the app stores ([Apple](https://apps.apple.com/us/app/uado/id1472198775?source=post_page---------------------------), [Google](https://play.google.com/store/apps/details?id=uno.platform.azuredevops&hl=en_US&source=post_page---------------------------)) and you can also [try it live on the Web](https://uado.platform.uno/?source=post_page---------------------------) via Uno Platform support for WebAssembly. And of course, you can always [examine the source code on GitHub](https://github.com/nventive/Uado?source=post_page---------------------------).**

If you are new to Uno Platform, then the best place to start is our [getting started tutorial](https://platform.uno/docs/articles/getting-started-tutorial-1.html?source=post_page---------------------------).

The post [Introducing UADO — An Uno Platform App Showcase](https://platform.uno/introducing-uado-an-uno-platform-app-showcase/) appeared first on [Uno Platform](https://platform.uno).
Does College Limit Our Success?
Tags: discuss, career
Published: 2019-07-23 15:36:04

---
title: Does College Limit Our Success?
published: true
description: college vs non college grads
tags: #discuss #career
---
Countless famous and successful entrepreneurs have dropped out from college. Steve Jobs, Mark Zuckerberg, Bill Gates, Oprah Winfrey and the list goes on and on, are all dropouts.

<b>Do you think that College limits our creativity and success?</b>
Quickly switching between branches
Tags: git, beginners, productivity
Published: 2019-07-23 15:25:37

This post was originally posted on [my blog](https://dzhavat.github.io/2019/07/23/quickly-switching-between-branches.html).

---

It seems like my post from yesterday about [getting productive with `git checkout`](https://dev.to/dzhavat/getting-productive-with-git-checkout-2299) resonated with a lot of people. Some even wrote to tell me that they found the tip useful. Hopefully they will use it in their work as well.

{% link https://dev.to/dzhavat/getting-productive-with-git-checkout-2299 %}

Right now I’m sitting in the train on my way home and have a bit of time for another tiny tip. It’s something very simple and easy to do but at the same time gives me joy every time I use it. It’s how I switch between branches.

Say I’ve just switched to `new-feature` from `master`. I’ve done some work there and want to go back. They usual way to do this is:

```bash
git checkout master
```

Turns out, if I use `-` (dash) instead of the branch name, `git` will switch to the branch I’ve last visited. So the above becomes:

```bash
git checkout -
```

Running the same command again will bring me back to `new-feature`. Obviously, using this command will only switch between these two branches. If I want to go to a third one, I still need to write its name.
Weeknotes - 08 Makers
Tags: bootcamp, beginners, agile, rails
Published: 2019-07-22 08:34:09

---
title: Weeknotes - 08 Makers
published: true
description: Reflections on the past week at Makers Academy
tags: bootcamp, beginners, agile, rails
series: Makers weeknotes
---

# Group Project part 1

# Scrum

We tried Kanban a couple of weeks ago, time to try Scrum!  A big difference between these two agile methods is working in _sprints_.  This means you estimate the complexity of job tickets in the backlog, and select tickets to work on for the sprint  period (considering the teams velocity and the complexity of the task).  Typical meetings like stand-ups and retros in scrum are referred to as ceremonies.

### Our approach to Scrum

We used [Trello](https://trello.com) to organise our tickets, with each feature on it's own branch in git and [github](https://github.com).
We held stand ups twice a day (this had been working well for previous projects).  At the end of each sprint we held a retro to demo team achievements and reflect on how we would improve the next sprint.  We worked with a Product Owner (one of the coaches) to review our completed features - this would likely happen in staging in the real world, but for us this took place in Production (which meant [Travis CI](https://travis-ci.org/) could prompt [Heroku](https://www.heroku.com) to automatically deploy code from the master branch!).

# Projects

This week we were building a Facebook clone in a team, over two weeks, in [Rails](https://guides.rubyonrails.org/).  This was our first week looking at the Ruby on Rails framework, and it was an eye-opener - Rails can essentially do everything we'd learned in the first 4 weeks in a few commands from the terminal.  Having Learned Ruby first and having looked at app design, the huge file tree was more familiar than it could have been, but 5 days in there's a lot that remains a mystery (it's magic). The weekend challenge was to build an Instagram clone in rails, and although I spent too much time upfront planning, and not enough time testing, I have a working app which was built relatively quickly!

# Misc.

:syringe: Impromptu escape rooms are a fun time!

:clap: Great to see the cohort above demonstrating their great final projects

:frog: Had fun playing with CSS Grids and Flexbox