teleren/devto huggingface dataset:
100 days of coding - Day 3
Tags: beginners, programming, ruby, codenewbie
Published: 2022-01-20 21:01:07

## Methods

Method or Function?

Don't have a clue what is difference between two of these, but for now most important to learn how they working. Later I will write about differences 

_**In Ruby we will called this methods.**_

**Parentheses?**
Ruby is very flexible language. When method expect some results we use parentheses, if not we don't need parentheses. But methods will works in both cases. See example bellow

```
def something
   puts "Hello World"
end

# this is two valid ways to call the _something_ methods

something  # this is preferred since something methods 
doesn't expect any parameters

something()
```

However, we prefer to call methods with parentheses in that scenario

```
def something(name)
  puts "hey" + name
end

something("Ivan") # this is preferred since greet does 
expect parameters

something "Ivan"
```
 

We also must make distinction between a **_variable_**, **_parameter_** and **_argument_**.

- 
**Variables** are names who can hold the data. 

bottle = water

bottle is variable that hold value "water"

**Parameter ** are names that can hold a data in method.
Parameter is placed in parentheses of method. 

```
def something(drink, eat)
    sentence =  "I like to eat " + food + " with a cup of "            
                + drink
    puts sentence
end
```

Above **food** and **drink** are parameters. **sentence** is a normal variable; it is not a parameter:

**Arguments** are data that we pass in method when we call the method.


```
def meal(food, drink)
  sentence =  "I like to eat " + food + " with a cup of " + drink
  puts sentence
end

meal("toast", "coffee") # Here we pass "toast" and "coffee" into our method.
meal("pancakes", "orange juice") # We can also pass "pancakes" and "orange juice" in another call
```

"**toast", "coffe", "pancakes", "orange juice"** are arguments
First Coding Meetup of 2022
Published: 2022-01-20 20:52:41

I was excited to attend my first coding Meetup group here in Tokyo. For awhile the meetup scene was fairly sparse due to expired groups on Meetup.com and the various states of emergencies we went through in Japan. At the moment, everything is lifted and I finally found a meetup group with a small discount community near my place!

About 7 of us showed up today at a local Starbucks to work on various projects. I have been going through the Ruby track on The Odin Project, so I worked on some practice problems and took some notes on some of the lessons. One other person was working on a project on Docker and a few others were doing some reading and coding. I was not too social, as it was my first time and I was a bit shy. I hope to go back again soon though and talk more.

In all, it was a really fun experience for me. It allowed me to finally get out of the house and away from distractions, and I was fairly productive. Being around others who are where I want to be was also motivating, and I really look forward to more in-person meetups (and hopefully doing an in-person bootcamp in 2023) in the future.
Tutorial: How to get started with QuickBlox React Native SDK
Tags: reactnative, sdk, quickblox, tutorial
Published: 2022-01-20 19:56:07

---
title: Tutorial: How to get started with QuickBlox React Native SDK
published: true
description: 
tags: reactnative, SDK, quickblox, tutorial,
//cover_image: https://direct_url_to_image.jpg
---
![QuickBlox Flutter SDK](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gefqifw5e4zp6f7cn8ij.png)

The QuickBlox Team has developed a robust React Native SDK to enable you to add chat, video calls, audio calls, push notifications and more you to your app. 

The advantage of using a React Native SDK is that we provide the entire toolkit of everything you need to build real-time communication, including documentation, code samples, Rest APIs, libraries etc. And because its build with React Native, it means your chat app will work on both iOS and Android platforms saving you time and money.

Our SDK is free to download and to help you get started we provide a short tutorial with code snippets to cover some of the basics. 

See our tutorial: [How to get started with QuickBlox React Native SDK] (https://quickblox.com/blog/getting-started-with-quickblox-react-native-sdk/)

If you like building with React Native please tell us why in the comments below.
Introducting command-builder
Tags: php, programming, showdev
Published: 2022-01-20 19:49:08

---
title: Introducting command-builder
published: true
description: Create executable command strings using a fluent API in PHP.
tags: php,programming,showdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/87n7fxa3jcf3stqae11i.png
---

I am very happy to announce my newest package for PHP: [command-builder](https://github.com/khalyomede/command-builder).

It helps with creating an executable string, using an object-oriented/fluent style.

```php
// before
$command = "grep -r /var/log/apache2/error.log -e 404";
$output = shell_exec($command);

// after
$command = new Command("grep");
$command->option("r", "/var/log/apache2/error.log")
  ->option("e", "404");

$output = shell_exec($command);
```

This is very helpful when you wanna create a service around a command, and need to conditionnally add arguments/options/flags.

Actually I needed this for another cool open source package I am about to start, I hope it can help some of you as well!

## Installation

To install it, nothing special! You do like you are used to do with others packages:

```bash
composer require khalyomede/command-builder
```

Then, just grab the namespace on your file, and create a new instance of your command.

```php
// index.php

use Khalyomede\CommandBuilder\Command;

require __DIR__ . "/vendor/autoload.php";

$command = new Command("grep");

// ...
```

## Usage

Find all the possibles features, including checking if a flag or an option has been added, in the [documentation](https://github.com/khalyomede/command-builder).

If you need anything, have a suggestion, or something I can help on, please let me know in the comments section down below, or open an issue if you think it can help the package users!

Happy command building 😎
Meet the Tanukis: Wayne Haber
Tags: devops, community, techtalks, gitlab
Published: 2022-01-20 19:39:48

Meet the Tanukis is a stream about the amazing Team members at GitLab. Each episode focuses on a team member discussing issues in tech that are important to them. This episode features Wayne Haber, Director Engineering for Growth, Security, and Applied ML.

{% youtube 0fXN4WJGaEY %}
About "inclusiveness" of Forem team
Tags: productivity, opensource, management
Published: 2022-01-20 19:38:13

Recently Ive written some harsh criticism. Ive been criticising current Forem team and their values.

One reply ( written by team member ) was something about **inclusiveness of team**, me being a selfish person ( hey, seriously? ) etc. Generally standard tactic: shift guilt away from real culprit as much as possible. Shady and disregarding as hell.

Meanwhile: when I try to login into [forem.dev](https://forem.dev/) Im greeted with:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2l3p5bhs1s77jzbsxbjw.png)

Commentary words not needed. Inclusitivity at its best........
New in Laravel 8.80 - Route::controller()
Tags: php, laravel, programming, beginners
Published: 2022-01-20 19:30:10

A great thing has been added in Laravel 8.80, https://github.com/laravel/framework/pull/40276 which is the use of Route::controller() with Groups to shorten Route, so I want to share it with you so that you may use it in your next projects.
```php
 Route::controller(PlacementController::class)->prefix('placements')->as('placements.')->group(function () {
    Route::get('', 'index')->name('index');
    Route::get('/bills', 'bills')->name('bills');
});
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ic5frpi6shyfrofnraj.jpg)
I hope you enjoyed the code.
Use a Model Manager to filter queryset by default in Django
Tags: django, webdev, programming
Published: 2022-01-20 19:17:35

How can you filter a queryset by default so that no matter where you use the model, the filter will be applied?

This can be achieved by creating a custom [Manager](https://docs.djangoproject.com/en/4.0/topics/db/managers/) and overriding its `get_queryset` method.

For example, if we have a **soft delete** feature in our app implemented by adding a `deleted` column, we can force only returing non-deleted objects by creating a custom model manager which filters for `deleted=false`

```python
class BookManager(models.Manager):
	def get_queryset(self):
		return super().get_queryset().filter(deleted=False)

class Book(models.Model):
	# ...
    deleted = models.BooleanField(default=False)
	objects = BookManager()
```

Now everytime you query Book objects in your app with `Book.objects` , you will only receive books that haven't been deleted.

### Links

[Model managers](https://docs.djangoproject.com/en/4.0/topics/db/managers/)
Using GitHub Codespaces with VNC/flexbox to create Pokémon maps from a web browser
Tags: github, showdev, webdev, javascript
Published: 2022-01-20 18:55:10

Hi there 👋 !

I'm currently working on a cool project, [`🌺 Gracidea`](https://github.com/lowlighter/gracidea), which is an animated Pokémon live web map aiming to recreate the whole Pokémon world while being accessible directly from your browser:

![Gracidea preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lyf7bw0x2tm9kbqsw8x7.gif)

I use a combination of several technologies, like [deno](deno.land), [pixi.js](https://pixijs.com), [vercel.com](https://vercel.com) and [Tiled map editor](https://www.mapeditor.org) along additional other tools. Some of these, like Tiled, are graphical desktop apps so they need to be installed first.
 
Which made wonder, what if it was possible to provide a graphic environment to access desktop apps and edit maps directly from a web browser... 🤔 ?

And it is 🥳 !

If you don't know, GitHub offers [codespaces](https://github.com/features/codespaces) which lets you spawn a web-accessible docker instance from a repository with VS Code pre-installed. However, not many people know that it is actually possible to configure the dockerfile through the `.devcontainer` folder of said repository.

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

> ℹ️ Note: Seems that this feature is in closed beta for users accounts

After playing a bit with [Microsoft's vscode-dev-containers' lightweight desktop](https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/desktop-lite.md) I achieved to configure vnc and flexbox (the provided desktop env) to spawn a full-screen instance of Tiled!

Below's a preview of the whole thing, in Firefox (yes, everything is happening in the browser !😮)

![Codespaces preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78ctqtvyjxlgpkjry90e.gif)

So yeah, basically all you need to setup this project now is just a web browser, no headaches caused by "but it works on my machine 😵 !"

If you're interested in the required code to make this works, it is available [here](https://github.com/lowlighter/gracidea/tree/main/.devcontainer)!

Thanks for reading 💕 !
Quick Tip: Setting new values at NAV/BC server configuration – Docker Container | Business Central
Tags: docker, dynamicnavbc, powershell, container
Published: 2022-01-24 19:41:48

---
title: Quick Tip: Setting new values at NAV/BC server configuration – Docker Container | Business Central
published: true
date: 2022-01-20 18:24:19 UTC
tags: Docker,DynamicNAVBC,Powershell,Container
canonical_url: 
---

The title is quite self-explanatory, so, if you want to set a new value for one of the settings on your NAV server configuration at your Docker Container you must use a PowerShell cmdlet execution to perform it.

For this PowerShell setting approach, you need to know two things – which NAV server you want to modify and which of the settings will you change the value.

To know which **[NAV Server Instances](https://docs.microsoft.com/en-us/dynamics-nav/microsoft-dynamics-nav-server-settings)** are running on your Docker Container you can run the following command on your docker PowerShell prompt:

```powershell
Get-NAVServerInstance | Select *
```

![](https://toolgbrmaker.files.wordpress.com/2022/01/image-14.png?w=1024)
_The result from Get-NAVServerInstance cmdlet_

Now that you have the Server Instance available on our container, let’s use this output to get the in vigor settings for the NAV Server Configuration…

```powershell
Get-NAVServerConfiguration -ServerInstance <YourNAVserverInstance>
```

![](https://toolgbrmaker.files.wordpress.com/2022/01/image-15.png?w=1024)
_The result from Get-NAVServerConfiguration cmdlet_

Time to chose which one you want to switch/change… Let’s imagine that we want to enable our API services. To achieve it, we must perform the following cmdlet with the following parameters:

```powershell
Set-NAVServerConfiguration <YourNAVserverInstance> -KeyName ApiServicesEnabled -KeyValue $true
```

![](https://toolgbrmaker.files.wordpress.com/2022/01/image-16.png?w=920)

As you may notice on the warning message, you must finish all your changes with a service restart. If you have doubts about how to do it, time to jump for the following **[post](https://dev.to/toolgbrmaker/get-service-cmdlet-continuation-powershell-59p)** where you can grab what you are looking for.

Stay safe!
Machine Learning Courses Must To Do:
Tags: machinelearning, beginners, discuss, ai
Published: 2022-01-20 18:36:12

1. https://www.coursera.org/learn/machine-learning
2. https://www.coursera.org/specializations/deep-learning
3. https://www.coursera.org/professional-certificates/tensorflow-in-practice
4. https://www.coursera.org/specializations/practical-data-science
Using LinqKit PredicateBuilder to dynamically build filter conditions 
Tags: csharp, linq
Published: 2022-01-20 18:31:52

In C#, predicates are delegate which forms the method that defines a list of criteria and verify if the object meets those criteria.

Many times building a predicate dynamically solves many headaches to filter out the models or data. PredicateBuilder from LinqKit comes to rescue here.

PredicateBuilder extension method is as follows.

```
using System;
using System.Linq;
using System.Linq.Expressions;

namespace Core
{
    /// <summary>
    /// PredicateBuilder is a extension class from LINKit library
    /// See http://www.albahari.com/expressions for information and examples.
    /// </summary>
    public static class PredicateBuilder
    {
        public static Expression<Func<T, bool>> True<T>() { return f => true; }
        public static Expression<Func<T, bool>> False<T>() { return f => false; }

        public static Expression<Func<T, bool>> Or<T>(this Expression<Func<T, bool>> expr1,
                                                            Expression<Func<T, bool>> expr2)
        {
            var invokedExpr = Expression.Invoke(expr2, expr1.Parameters.Cast<Expression>());
            return Expression.Lambda<Func<T, bool>>
                  (Expression.OrElse(expr1.Body, invokedExpr), expr1.Parameters);
        }

        public static Expression<Func<T, bool>> And<T>(this Expression<Func<T, bool>> expr1,
                                                             Expression<Func<T, bool>> expr2)
        {
            var invokedExpr = Expression.Invoke(expr2, expr1.Parameters.Cast<Expression>());
            return Expression.Lambda<Func<T, bool>>
                  (Expression.AndAlso(expr1.Body, invokedExpr), expr1.Parameters);
        }
    }
}
```

Here is an example use,

```
Expression<Func<BillingAccountReport, bool>> SearchBillingAccount(BillingAccountReportParams queryParams)
{
	var predicate = PredicateBuilder.True<BillingAccountReport>();

	if (queryParams == null)
		return predicate;

	if (queryParams.StartDate != null)
	{
		predicate = predicate.And(p => p.SubscriptionCreated >= queryParams.StartDate);
	}
	if (queryParams.EndDate != null)
	{
		predicate = predicate.And(p => p.SubscriptionCreated >= queryParams.EndDate);
	}
	if (queryParams.BillingAccountIds != null && queryParams.BillingAccountIds.Count() > 0)
	{
		foreach (string id in queryParams.BillingAccountIds)
			predicate = predicate.Or(p => p.Id.Contains(id));
	}

	return predicate;
}
``` 

Happy coding.
Component redirect issue on navigation.. 
Published: 2022-01-20 18:24:53

Hi There, I'm having an issue with vue3 & vue-router@4 The issue is that app url is changed when I click on a  navigation menu but It's not rendering the component unless I do manual refresh. here is the error which is showing in console.

_runtime-core.esm-bundler.js?5c40:1532 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '__asyncLoader')
    at isAsyncWrapper (runtime-core.esm-bundler.js?5c40:1532:1)
    at unmount (runtime-core.esm-bundler.js?5c40:4789:1)
    at unmountComponent (runtime-core.esm-bundler.js?5c40:4895:1)
    at unmount (runtime-core.esm-bundler.js?5c40:4796:1)
    at unmountChildren (runtime-core.esm-bundler.js?5c40:4924:1)
    at unmount (runtime-core.esm-bundler.js?5c40:4814:1)
    at unmountComponent (runtime-core.esm-bundler.js?5c40:4895:1)
    at unmount (runtime-core.esm-bundler.js?5c40:4796:1)
    at unmountChildren (runtime-core.esm-bundler.js?5c40:4924:1)
    at unmount (runtime-core.esm-bundler.js?5c40:4814:1)_
Day 10 Of #100DaysOfCode Challenge - My experience
Tags: 100daysofcode, javascript, webdev, programming
Published: 2022-01-20 18:22:23

I just completed 10 days of the #100DaysOfCode challenge. Although the whole of last week I didn't code due to unavoidable circumstances, the good part is that I was awarded a full software development scholarship. I will be starting my lessons this Feb for the next 6 months, I'm really excited.
So, here is what I learned in those 10 days.

JavaScript

- JS functions, objects, classes, Arrays.

- JS callback methods, async, and promises - although I didn't understand these very well. I will be going through them again.

I completed Frontend Mentor Challenges - Html & Css - newbie level and today I started the junior level. I'm proud of myself about this.

General experience

- Coding for only one hour a day seems very short to me. I usually use a pomodoro app to time myself, but after 1 hour is over, I let myself code until I can't take it anymore. So, I usually code for more than 3 hours a day.

- I usually post my daily report on Twitter and there is a very great supportive community their, and a lot of people doing the same 100daysofcode challenge. This motivates me to continue coding without giving up. 

- Those 10 days have made me realise that I love coding. Seeing myself build a wesite component from scratch is my biggest joy. 

See you on day 20, as I share my great coding journey.
DevOps Concepts
Tags: beginners, devops, productivity, discuss
Published: 2022-01-20 18:20:05

DevOps is an IT mindset that encourages communication, collaboration, integration, and automation among software developers and IT operations in order to improve the speed and quality of delivering software.

## **Tools Used in this methodology:**

1. Source code repository -
Eg. Git, Subversion, Cloudforce, Bitbucket, and TFS.
Here, we will be mostly discussing about **_Git._**
2. Build server -
Eg. **_Jenkins_**, SonarQube, and Artifactory.
3. Configuration management -
Eg.  Puppet and Chef.
4. Virtual infrastructure -
Eg. Amazon Web Services and Microsoft Azure. Private virtual clouds can also be considered here.
5. Test automation -
Eg. **_Selenium_** and Water.
6. Pipeline orchestration -
**_Kubernates_**, Openshift, **_Docker Swarm_**, Google Container Engine, Google Cloud Run, AWS Elastic Kubernetes Service (EKS), Amazon EC2 Container Service (ECS), Azure Container Instances, etc.
Create a Prismic IO Respository for Blog 👨🏽‍💻
Tags: javascript, webdev, beginners, tutorial
Published: 2022-01-20 18:17:35

## what is Prismic IO?
[Prismic](https://prismic.io/) is a Headless CMS very simples to work, a tool for editing online content totally custom with a very nice API and a great free plan... Basically you keep your content in a content repository that you can query via its simples REST API with the prismisc client.

## Creating Prismic account
Now we going create a [prismic](https://prismic.io) account, so, fill the information's and create your account. After your account created, open a new repository like this.

![prismic created repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cfsvhq31vf2urytf0oyq.jpg)

In prismic we have a two types of contents, _Repeatable_ and _unique_, lets go understand the differences:

- Repeatable is used to create content that you need create more that one, exemple:
     - Posts blog;
     - faq contents;
     - testimonials;

- Unique is used in singles pages content like a about us page in your site.

After created your repository, we will go to build our first type content. This type is it a **repeatable **type called **posts**, and here we add this modes with field names.

> If you want create more types, feel freedom for this, custom and create of your way.

- UID type | field name: **uid**
- Title type | field name: **title**
- Rich Text | field name: **content**

![post type](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vfcit8rfi8i2kpinwg2v.png)
 
After created just save.

## Get Environments Variables
To connect a Prisma client you need a two environments variables, the `PRISMIC_ACCESS_TOKEN `and `PRISMIC_ENDPOINT`, this variables. you can use in `.env.local` for projects.

For get your endpoint, he finds himself in top of the page settings. And for generate your access token, fill the application name in prismic settings and add application, so, now we have this two information for connect with prismic client.

## Conclusion
The prismic IO is a very good CMS, with a very nice free plan, so you can create news projects and use for manager your contents, and create singles pages, or repeatables contens, and in a very easy way to do.
Important full forms every web developer/programmer/IT guy must know.
Tags: html, programming, webdev, vscode
Published: 2022-01-20 17:58:20

There are some important terms a programmer or web developer must know.

- **API** - Application Programmer Interface
- **AJAX** - Asynchronous JavaScript and XML
- **APK** - Android Application Package
- **ASP** - Active Server Page
- **ASCII** - American Standard Code for Information Interchange
- **ATA** Advanced Technology Attachement & Parallel Advanced Technology Attachment
- **BASIC** - Beginner's All-Purpose Symbolic Instruction Code
- **BIOS** - Basic Input System
- **CNC** - Computerized Numerical Control
- **CPU** - Central Processing Unit
- **CSS** - Cascading Style Sheet
- **DBMS** - DataBase Management System
- **DNS** - Domain Name Server
- **DTP** - Desk-Top Publishing, Distributed Transaction Processing
- **EJB** Enterprise Java Bean
- **ICT** - Information and Communication Technology
- **ITES** - Information Technology Enabled Services
- **HTML** - Hyper Text Markup Language
- **HTTP** - Hyper Text Transfer Protocol
- **HTTPS** - Hyper Text Transfer Protocol but Special
- **JPG** - Joint Photographic Experts Group
- **PDF** - Portable Document Format
- **PHP** - Hypertext Preprocessor (earlier called Personal Home Page)
- **RIP** - Routing Information Protocol
- **SEO** - Search Engine Optimization
- **SIM** - Subscriber Identity Module
- **SQL** - Structures Query Language
- **URL** - Uniform Resource Locator
- **USB** - Universal Serial Bus
- **VIRUS** - Vital Information Resources Under Seize
- **WiFi** - Wireless Fidelity
- **WWW** - World Wide Web
- **XML** - eXtensible Markup Language
- **XXMP** - Extensible Messaging and Presence Protocol

I am sure that some of these terms will help you sometimes. Have a great day!
`Happy C0ding`