teleren/devto huggingface dataset:
PHP REST API
Tags: php, codeigniter, symfony
Published: 2019-04-06 09:29:14

---
title: PHP REST API
published: TRUE
description: what's the best way to build Rest API in PHP dealing with server resources
tags: #php #codeigniter #symfony
---
Hi ! 
This week I thought about the best way to build REST API with PHP , assuming server constraints. The context is that, I work with startups and incubators as technical advisor and sometimes as #fullstack developer. Some of those startups use mutualised server (shared hosting , no VPS); so they don't have hand in infrastructure configuration. 
I present them different ways as : codeIgniter as a framework with zero constraint that requires VPS as production server. No need of composer, there is no cli commands. 
But the REST request is not natively handled. There are some issues with PHP//input. 
And for symfony it recommended to use VPS as Prod server. 
I need your point of view , and advise for optimisation and configuration.
Webapp Templates - What would you like to see?
Tags: discuss
Published: 2019-04-06 09:19:24

I am setting up some web app templates - Will use Vue for the client and would have three implementations for the server: 
- .net core
- node.js
- firebase firestore

I'm not sure if i should build just a template or include some sample funtionality
What's your opinion on this? 


This is the repo of the first sample (contains only client-side currently)
https://github.com/sarmis/greekdev-template-vue-spa
Goodfellas from ES6. Let & Const.🤘
Tags: beginners, javascript, es6
Published: 2019-04-06 08:34:23

---
title: Goodfellas from ES6. Let & Const.🤘
published: true
description: As far back as I can remember, I've always wanted to know ES6.
tags: beginners, javascript, ES6
cover_image: https://thepracticaldev.s3.amazonaws.com/i/seo47kepdo13l4n7urc0.jpg
---

Here is the first post about ES6 features in lifestyle. This story is about let & const😎. This two guys did the old man - Var.🕵
Let's figure out, how they work in examples.

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

It's `let`, don't mess with him out from the block 😎, don't try to talk about him behind his back. If you want to make some variables only for your block, or even for each iteration of `loop`, `let` can help you.

```javascript
{ /* Don't even try to talk about me behind my back, it works with var, 
not with me.💪 If you try, you've got reference error, boom!💥*/ 
  console.log(varFromTheBlock);
    // ReferenceError
  let varFromTheBlock = "I'm Var from the Block, don't mess with me out from the block";
  // Cause you got reference error, dude, you don't want it.
  console.log(varFromTheBlock);
// "I'm Var from the Block, don't mess with me out from the block"
 }
  console.log(varFromTheBlock); //ReferenceError: varFromTheBlock is not defined

// let in for loop
  var arrForIteration = [];
  for (let i = 0; i < 5; i++){
    arrForIteration.push( function(){
      console.log( i );
    } );
  }
  arrForIteration[3]();//3 

```

It's `const`💪, he looks like `let`, but he is more principled and conservative. He is like a rock. If you want to create something, that never can be changed by somebody else, he can help you.


```javascript
{
  const bigConst = ['cars','weapons'];
 // Hey I'm bigConst and I work for some huge array.🕵
 bigConst.push('cash');
 // Yes I can talk with array if you want and bring him some 'cash' 💵
 console.log( bigConst ); // ['cars','weapons','cash']
  //  But don't try to broke my powerful connections with guys, which I'm working for!
  bigConst = 'plant'; //TypeError
  // I told you! It's typeError, man.
}
```
Poll, Yes or No: When you code in JavasScript, do you think about internal slots?
Tags: javascript
Published: 2019-04-06 07:03:58

---
title: Poll, Yes or No: When you code in JavasScript, do you think about internal slots?
published: true
description: 
tags: javascript
---

Please vote Yes or No on my Twitter poll:

https://twitter.com/trusktr/status/1114419022366269442

Thanks!
Building Solid Foundations for Operable Applications, Tools and Services
Tags: azure, devops, discuss, sre
Published: 2019-04-06 05:53:58

---
title: Building Solid Foundations for Operable Applications, Tools and Services
published: true 
description: Introducing the Azure Building Blocks fundamentals series to help engineers build operable applications, tools, and services.  
tags: azure, devops, discuss, sre
series: "Azure Building Block Fundamentals"
cover_image: "https://thepracticaldev.s3.amazonaws.com/i/s6eqcas6rhx34qu0bmc7.jpg"
---

When I travel, I enjoy exploring. I feel a certain amount of reverence as I look up and out at bridges and buildings. The people who dreamed and implemented these feats may be long gone, and yet their work stands. Software is so different from these physical monuments in size or lifespan. We're not building for permanence, and yet we do need to think about building to stand and support all the people who use and depend on it. 

In late 2018 when I joined Microsoft, I brought years of experience from operations, site reliability engineering, and devops to the team, but zero experience with Azure. As I've been building up my Azure knowledge, I found missing information about how to create for production. 

I enjoy learning new technology, but often it feels like, to understand "the cool stuff", there is a whole host of other dependent tools and terminology to learn. Sometimes it can feel like with every new topic more topics get added to the infinitely growing *need to understand* list. Exploratory learning can be fun, and I learn a lot. Other times, it can feel like a complete drain, and I forget what I initially was trying to learn. 

This series is about taking my years of operations experience and add it to learning Azure to help folks understand some of the key fundamentals of building operable applications, tools, and services. For this series, each topic will be as small as I can make it to limit the number of new concepts I'm introducing at any one point. By focusing on specific fundamentals, it will help me have places to point to when I write more complex topics that rely on these building blocks. 

I don't imagine that every post will be fascinating, but they will all be super relevant to building quality operable software. So this series won't teach you how to [display the weather with serverless or control your light with IoT](https://medium.com/microsoftazure/five-iot-devices-you-should-have-bought-yesterday-with-suz-hinton-9de55253f70f) but it will help you understand some of the areas where you need to think about risk management in your design. 

## What's in this Series?

I don't know quite yet! I'm learning Azure, and as I discover building blocks, I'll update this post. Do you have thoughts and ideas about topics you'd like to understand? What methods do you use to learn new complex topics?  

1 - [Building Solid Foundations for Operable Applications, Tools, and Services](https://dev.to/azure/building-solid-foundations-for-operable-applications-tools-and-services-2ake)
2 - [You gotta keep privileges separated](https://dev.to/azure/you-gotta-keep-privileges-separated-509)
p5-INVADER
Tags: javascript, technology
Published: 2020-05-11 09:29:50

---
title: p5-INVADER
published: true
date: 2019-04-06 05:34:00 UTC
tags: JavaScript,Technology
canonical_url: https://drmsite.blogspot.com/2019/04/p5-invader.html
---

{% replit @annoyingmouse/p5-INVADER %}

You might've seen [previous](http://drmsite.blogspot.com/2019/03/p5-tail.html) [posts](http://drmsite.blogspot.com/2019/03/p5-explosions.html) on my conversion of Python to p5 from [Wireframe magazine](https://wireframe.raspberrypi.org/), and this has been by far the hardest one I've tried as it involved lots and lots of looping through arrays. Arrays not only of the elements which make up the characters, such as shots and shields but also through the matrix which I use to generate the images of the shots and shields. Using a matrix or multi-dimensional array in this way is an approach I'm thinking of adapting for the [Digital Counter](http://drmsite.blogspot.com/2019/03/digital-counter.html) as it allows a visual representation of the character within an array and so makes tweaking the characters more accessible.

If you check through the history of the [repo](https://github.com/annoyingmouse/WireFrameJS/tree/master/009-INVADERS), you'll see that I went through many different methods of calculating whether or not a shot simply grazed a shield or whether it had a substantial impact, resulting in an explosion. I did this eventually by allowing the shot to have a hit point value which incremented each time it chewed a pixel from the shield; when that hit point reached a critical level, then the shot exploded and eroded a far greater chunk from the shield.

To save resources each shot is removed from an array when it drops too far beneath the stage, and each shield removed when it is empty. I guess I should also close the processing when there are no more shields, but this does pretty much what I wanted and seems to mimic the original [Python implementation](https://github.com/Wireframe-Magazine/Wireframe-9) closely enough. If not, you're welcome to branch and tweak it.
Razones principales para las fallas de marca
Tags: xaviermitjavilamoix, razones, principales, marca
Published: 2019-04-06 05:13:50

---
title: Razones principales para las fallas de marca
published: true
cover_image: https://thepracticaldev.s3.amazonaws.com/i/fpokzvuydfrf6dy8pc73.jpg
description: de acuerdo con el famoso líder y experto en marketing de marcas, Xavier Mitjavila Moix, existen muchas razones para las fallas de marca.
tags: Xavier Mitjavila Moix, Razones, principales, marca, 
---
From Weak to Proficient
Tags: selftaught, beginners
Published: 2019-04-06 04:26:38

---
title: From Weak to Proficient
published: true
description: Leveled up from Weak to Proficient in my self-taught developmental journey.
tags: self-taught, beginner
---

**J**ob hunting is difficult. Almost dishearteningly difficult. As an example, one day, an interviewer might say that I should learn a language for their prospective company, despite my protests of pointing out that I am at best a junior developer, and thus would need to spend some time adapting, or at worst have done an undergraduate tutorial course in it. Inevitably, because I'm still actively attempting to start my career in code, I agree to their request. So I study and subsequently do their assessment, all the while remaining aware of my actual level; wary of overconfidence. Predictably, imagine my lack of surprise upon the response that they would rather have someone with some experience working on a production level application in that language. 

Nevertheless, I still say to keep chugging and keep working with the idea that these sleepless nights will one day pay off. In my case, things are probably going to get even worse before they get any better; recently-ish left my place of employment due to certain conflicts of interest. I'd rather not go into detail but for those who know me in real life, I thank you for your continued support and encouragement. I would like to say that you guys have brought me a long way, I tell you as much fairly continuously, but I'm also going to take some credit for the effort output.

A special thank you goes to one person in particular who believes in me and has continued faith in my progress. If you ever read this, &lt; super emotional words here&gt; ...sorry, I still can't bring myself to do that on even a public platform.

Enough digression. All of that being said, one thing that these continuous examinations have allowed me to see is my own growth in familiarity with a variety of languages; even if that involves spending a day learning something I've only seen in passing (or seen many years in the past). These things, these small victories are what reminds me that I started doing this for a reason. Even though many times, small victories are the only ones to be had.

In these cases, I like to remind myself of one little fact; in general, life is a sequence of these things. Whether or not they happen in succession or are sparse in their distribution, it becomes increasingly important to acknowledge when they happen; lest we become overwhelmed.

So even though I've not yet signed anything suggesting permanent employment, even though companies seem to all want formally trained developers or otherwise see an aspect of "computer science" on a resume, even though the population of people who use/understand Matlab or Octave is almost infinitesimal by comparison, I will accept that I've at least increased my level from when this all started not even two months ago.

If you're still on this journey with me, then you as well keep studying, keep growing, and do not forget why we began. Progress may be slow in comparison, but it's still progress.
CRUD with Angular
Tags: angular, typescript, javascript
Published: 2019-03-30 09:45:19

---
title: CRUD with Angular
published: true
description: 
tags: angular, typescript, javascript
---

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

In almost any application that we work with, the first important thing to do is to deal with data, loads and loads of data. And this data which resides on the server is dealt with by the use of HTTP operations. We perform HTTP GET and POST operations to work with that data.

Now, in a real application, this data is stored on the server and received through API. However, for testing purposes, instead of using a real server, we can actually fake the back-end server.

	
The different ways to use a fake back-end server are:

Create a file, hard-code the data, and return this data.
Create a local JSON file and use it
Use Angular in-memory-web-api
The best out of all to perform CRUD operations for development and testing purposes, is to use Angular in-memory-web-api. Using this, we can actually simulate a server and return mock data with the HTTP requests.

Angular in-memory-web-api
This angular-in-memory-web-api is not a part of Angular Core but it is provided as a service in the Angular documentation. This will now send the HTTP requests to the local in-memory data store in place of the remote server and make our task a lot more easier.

The main purpose of this blog post is to put light on using angular-in-memory-web-api to produce a working CRUD application with Angular. By the end of this blog post, you should be able to create, read, update, and delete the data .

To start, the very first task is to install angular-in-memory-web-api using the command:

npm install angular-in-memory-web-api — save-dev
The save dev flag is used here to save this dependency that we will use for the development purpose. 
Once done, you’ll be able to see it in the dependencies inside your package.json file.


Read the full article here: 

https://medium.com/@nishu0505/crud-with-angular-5d8f39805c49
lots of interview without success
Tags: discuss, interview
Published: 2019-04-06 02:38:08

---
title: lots of interview without success
published: true
description: 
tags: discuss, interview
---

So its been almost more than 8 months, i'm searching and interviewing , stopping again to look back and again start. in the loop.
interviewing with no success at all. sometimes i can make it up-to the last round too.
### my expectation always is like:
- good team where people interacts and active & eager to help each other.
- nice & advance tech stack, where people just not make apis or small functions, but solve some challenging problems.
- an open culture is followed.

### Issue i face 90% of the time, or the cause of the rejection is:

as i'm working more than 2 years in using Node Js stack.
most of the companies prefer someone who have experience with how to deal with scaling issues. [its even expected in general]

But as i've never been to those situation & having no such experience, all i can do is just study on those, and i believe its a kind of experience by only studying you can never be aware of real world problems, and people gonna ask about the real problem only.
also in other hand, this type of source are very limited, so without hands on experience on this type of topics, its not much possible to have a clear knowledge  which they want ,i guess.


There is lot more issues are there like this.
and i can say there are lot of people who are facing this type of situation like me only.

just seeking some advice,
let me know your thoughts/tips anything on this
will be really helpful.
Measuring Stack Size in Elixir   
Tags: elixir, beginners
Published: 2019-03-29 21:19:16

---
title: Measuring Stack Size in Elixir   
published: true
description: Tutorial on Measuring Stack Size for Recursive Functions
tags: #elixir #beginner
---

#Why Measure?
There are many good articles written on tail call optimization in Elixir.  This is what allows Elixir to recursively call a function forever without overloading the stack.  

Here is a list of some of them: https://dev.to/search?q=elixir%20tail

While most of these articles say that Elixir optimizes the recursion, I wanted to see it with my own eyes.

#The Code

Below is a minimum amount of code to see an optimized recursive function in action. It simply prints out information about the current process, then recurs with a new number.

```elixir
defmodule MyApp.Example do
  def recursiveFunc(number \\ 1) do
    proc_info = Process.info(self()) 
    IO.inspect proc_info
    recursiveFunc(number + 1)
  end
end
```

If the function is run in iex, it will print the process information very quickly in the terminal.  Within that information object it will list the current stack_size and heap_size.  Here is what I got on my machine.
```
total_heap_size: 15143,
heap_size: 4185,
stack_size: 46,
```

What we can see is that even though it is calling the function over and over, the stack_size should remain exactly the same.  The heap_size will move around but it should not increase very much.

#Non Optimized Example

Here is some code that will not be automatically optimized since the recursive function call is not the last thing evaluated in the function

```elixir
defmodule MyApp.Example do
  def nonOptimizedFunc(number \\ 1) do
    proc_info = Process.info(self()) 
    IO.inspect proc_info
    1 + nonOptimizedFunc(number + 1)
  end
end
```

When this is run the stack size increases by one for every iteration just like we expected. The heap_size will also grow quickly as each new iteration adds an int to the heap.

#Will This Crash?

What was most interesting about this non optimized code is how large the stack can get.  

In JavaScript land the stack limit can be reached quite quickly.  

Running the non optimized example on my Mac, I get to a stack_size of 100k within a minute and the process keeps on trucking!

This is because by default there is no maximum stack size for an Elixir process.  It will keep on growing the stack and heap until the process runs out of memory.  By default an Elixir process is allowed however much memory it wants, all the way until it crashes the BEAM VM.

If we wanted to stop this from happening, we can add the following line to our code
`Process.flag(:max_heap_size, 100_000)`
This will kill the process once it has gobbled up too much memory for our liking, but before crashing our whole app.

Thanks for reading! Coding in Elixir is Fun!
What is “DevOps” really about?
Tags: devops, agile, methodologies, deployment
Published: 2019-04-05 21:28:17

---
title: What is “DevOps” really about?
published: true
description: 
tags: devops, agile, methodologies, deployment
---

Maybe it is a bit late to write this article, but I found the motivation to do it because I keep listening some people using the term wrong. At this point, it has been written many literature about this word, hundreds of definitions are out there, some more accurate than others, but all have the same idea at the bottom:

<b>DevOps shortens the agile feedback loop by merging development and operations as a whole. It maximizes the development time automating certain tasks of the workflow.</b> It speeds up the time elapsed since a user story is planned until its feedback is gathered.

DevOps is not Kubernetes, nor Docker, nor maintain servers in the cloud, nor the release management team,…DevOps pretends to create an independent lifecycle for every user story and recreate all the stages of a complete project. The technical side behind DevOps consists in automate parts of this lifecycle. How it is done or which stages are being automated may be different in each project. 

In the traditional software development models, the delivery and deployment stages are placed at the end of the project lifecycle, once it is “finished”:

<img src="https://cdn-images-1.medium.com/max/800/1*fU7C5t1oWAOq5Qo9aO19QA.png">

It is curious about these diagrams that all end up in a phase of “maintenance”, which it is nothing else that all the rework required after getting feedback for the very first time. These are all the changes to meet the actual client requirements. When this kind observations are arisen, it means that this is not a suitable model for software development.

<b>The key concept of all agile methodologies is the feedback loop.</b> Understand that software development is an iterative and incremental process. Agile is not something that you use nor something that you do, agile is something that either you are or you are not. Agile methodologies bring every two weeks the feedback of the job done and it is up to you to react to it. Devops helps to be more agile supporting the development and operation tasks to change the software faster and painless.

Taking this into account, what DevOps does, using a set of tools, is to accelerate the process and obtain the feedback as soon as possible:

<img src="https://cdn-images-1.medium.com/max/800/1*NN02A2JAzWtsnaKjXjuuRQ.png">

When we talk about devops we should not talk about tools exclusively, we should talk about the philosophy behind it and the agile principles.
Best programming or software engineering related books of 2018?
Tags: discuss, help, books
Published: 2019-04-05 23:17:03

---
title: Best programming or software engineering related books of 2018?
published: true
tags: discuss, help, books
---

There were some pretty popular threads on stackoverflow discussing most influential programming books and the like but they got closed because open ended questions don't fit SO's format. What books did you read last year that you found helpful, interesting, inspiring, or otherwise worthy of note? 

I'll kick it off by mentioning *Practical Object Oriented Design* by Sandi Metz. Finally found a great reference on making decisions when dealing with (OO) program design. She provides many examples and goes through a lot of standard definitions of concepts and teaches you the framework of making good design choices. Definitely felt more comfortable making design decisions after reading it.

Edit: Some books I read a few pages from last year and plan to continue reading this year were *Designing Data Intensive Applications* by Martin Kleppmann, and *Effective Java* by Joshua Bloch.

Note: I know there's a thread out there called must read tech books of 2018. Would like to keep this thread more focused on programming and engineering since tech encompasses a more than just programming...