teleren/devto huggingface dataset:
[astuce] Souriez, vous êtes notre invité : Le Pouvoir du Visiteur
Tags: guest, acl, tips, joomla
Published: 2019-10-18 18:39:37

---
title: [astuce] Souriez, vous êtes notre invité : Le Pouvoir du Visiteur
published: true
date: 2019-10-18 10:51:00 UTC
tags: guest,acl,tips,joomla
canonical_url: 
---

Salut les joomlers de l'extrême,

  

Dans votre aventure avec Joomla! vous tomberez de temps à autre sur

un problème qui peut être résolu par : "Le Pouvoir du Visiteur"

Il s'agit du fameux niveau d'accès Guest ou en français Visiteur, 

présent par défaut dans le coeur de Joomla!

 

Le Pouvoir du Visiteur réside dans le fait que l'on puisse afficher des éléments de notre site Joomla! (menus, articles, modules,etc...) uniquement aux visiteurs de notre site web (utilisateurs sans compte sur notre site Joomla!)

Ainsi on peut fournir une expérience utilisateur améliorée mijotée aux petits oignons juste pour nos visiteurs.

 

N'hésitez pas à utiliser cette fonctionnalité sur votre site Joomla!

 

A bientôt pour de nouvelles astuces
How to make a calculator using c programming?
Tags: c, career, beginners
Published: 2019-10-18 10:35:38

Hi guys welcome to my new blog. If you want to make a calculator using c programming then you are at the right place. In this blog i am going to tell that how to make a calculator using c programming & also going to discuss concepts used in it.

**Pseudocode & concept:-**

If you want to make code of a calculator or something big you should first right the pseudocode in order to solve the whole problem. This is how you should approach it:-

```Declare  variables  float a,b,c,d & char x for operator sign
        ⬇️
Enter the first number
        ⬇️
     Scan it
        ⬇️
Enter the second number
        ⬇️ 
     Scan it
        ⬇️
Enter the operation +,-,÷,×
        ⬇️
     Scan it 
        ⬇️
Now,use switch case as there is one variable x(Operator +,-,÷,×)& multiple cases
        ⬇️
Case'+':For addition
        ⬇️
Case'-':For subraction 
        ⬇️
Case'×':For multipication
        ⬇️
Case'/':For division
        ⬇️
Default:For invalid operator*```

**Switch case statements:-**
Switch case statements are used in case of if elseif statements & when the cases depend on the variable inside switch if you enter 1 then case 1 will run. If 2 then case 2 and so on and after the whole case statement there is a break to get the control outside the loop. And there is a default statement there if someone enters different thing which is not mentioned in above case label then default statement will execute.

**Syntax:-**

switch(x)//**x must be a variable**

case 1: Statement 1;
        break;
case 2: Statement 2;
        break;
        :
        :
        :
        :
case n: Statement n;
        break;

default: Statement def;
         break;

**Code for the calculator:-**

 #include< stdio.h >
 #include< stdlib.h >
int main()
{
  char y;
  float a,b,c,d;//**makes calculator more precise**
 
  printf("Enter the first number\n");
  scanf("%f",&a);
  printf("Enter the second number\n");
  scanf("%f",&b);
  printf("Enter the operation:\n+\n-\n*\n/\n");
  scanf(" %c",&y);// **Space before %c to have enter and then scan the character otherwise it will take enter as char & default case will run**
 
  
 
   switch(y)
 {
   case '+': c=a+b; //**Case label 1**
          printf("ADDITION of two numbers is %f",c);
          break;
   case '-': c=a-b;
           printf("SUBTRACTION of two numbers is %f ",c);
           break;
   case '*': c=a*b;
           printf("MUTIPICATION of two numbers is %f",c);
           break;
           
   case '/': d=a/b;
           printf("DIVISON of two numbers is %f ",d);
           break;
           
   default:
             printf("Invalid operator");
             break;
   }
      return 0;
  } 

[Source code on github](https://github.com/Swapnil7000/Numbers.c/blob/master/Calculator.c)

I hope you liked the blog. Make sure that you comment on this blog & suggest things to make the calculator more better.Happy coding❤❤
FireDI Release 2.1.0
Tags: php, showdev
Published: 2019-10-27 19:34:57

---
title: FireDI Release 2.1.0
published: true
date: 2019-10-18 10:34:44 UTC
tags: php, showdev
canonical_url: https://ua1.us/updates/firedi/firedi-release-2-1-0/
---

## FireDI 2.1.0 was just released. Here’s what’s new:

- Implemented PSR-11 Container Interface. Here’s what that means. FireDI is compliant with an agreed upon standard for how you should implement a container of objects.
- Updated code base to follow PSR-2 Coding Standards. In a previous work situation, we followed Zend 1.\* standards for coding. I adopted many of those not working on a modern framework. I had to update the code base to be compliant with PSR-2.
- Implemented Di::has(). As part of the PSR-11 standard, I had to add a method to determine if this particular container “has” an object in it. So what that means under the hood is can this container resolve what you are asking for.
- Updated the Di::set() interface to take in a callable and updated the logic of dependency resolution to invoke the callable as part of resolving the dependency. That means you can set factories to return objects for specific dependencies.
- Included an MIT license! This way you can trust that the code you are using cannot be taken back from you.

The post [FireDI Release 2.1.0](https://ua1.us/updates/firedi/firedi-release-2-1-0/) appeared first on [UA1 Labs](https://ua1.us).
Create a wrapper task in Makefile
Tags: tooltip, makefile
Published: 2019-10-18 10:01:31

---
title: Create a wrapper task in Makefile
published: true
description: run multiple tasks without be force to known the exact name
tags: tooltip, makefile
series: Makefile tooltip
---

In makefile, you can define tasks and run them individually (e.g. `make run-task1 run-task2 run-task3`)

```Makefile
run-task1:
	@echo "run task 1"

run-task2:
	@echo "run task 2"

run-task3:
	@echo "run task 3"
```

When you want to run tasks from another tasks (e.g. `make run-all-tasks`), you can

* use [`makefile` prerequisites mechanism](https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html#Prerequisite-Types)

```Makefile
run-all-tasks: run-task1 run-task2 run-task3
```
* use sub-command line with [`$(MAKE)`](https://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html)

```Makefile
run-all-tasks:
	@$(MAKE) run-task1
	@$(MAKE) run-task2
	@$(MAKE) run-task3
```

You can also create a `wrapper` task to run all tasks with a specific naming.

> This will enable you to don't known all task names.
> Useful when using `include` mechanism in your makefile.

```Makefile
include makefile-with-run-tasks.mk

run-all-tasks:
	@grep -E '^[\.a-zA-Z0-9_%-]+:.*$$' $(MAKEFILE_LIST) \
		| cut -d ":" -f2 | grep "^run-task" | sort -u \
		| xargs $(MAKE)
```

So when you run it, the `run-all-tasks` task will run all `run-task` tasks.

```shell
$ make run-all-tasks
run task 1
run task 2
run task 3
```
Job opportunity for react native devs (London, UK)
Tags: reactnative, career
Published: 2019-10-18 10:00:18

Hey guys,

I quickly wanted to share this role, let me know if this is not the right place to post it :)

We are looking for experienced react native engineers to join OVO Energy in London. Tech stack is React Native, JavaScript, TypeScript. The roles are not remote but offer flexible working hours and various benefits. DM me or comment with any questions and I'll do my best to answer them!



About the position:

*Job title*: Front End Engineer

*Seniority level*: Mid/Senior

*Technologies / Language requirements*: React Native - JavaScript

*Start time*: N/A

*Job type*: Full time

*Remote allowed*: No

*Salary*: up to £110k



About the company:

*Company name*: OVO Energy

*Company Description*: OVO Energy are continuing their disruption in the energy space to power technology such as; Smart Meters which allow consumers to track their energy usage and building state of the art customer-facing mobile apps. They are doing this, whilst aiming to reduce costs to the consumer and stay at the forefront of the energy space.

*Location*: London

*Visa sponsor?*: No

*More info*: You can apply for the job and find all details of the job position here: https://bit.ly/2J0ZmQ1
✎ - Zettel - A library for building editors
Tags: react, javascript, uiweekly, webdev
Published: 2019-10-18 09:18:47

👋 Howdy DEV community!!!

I'm working on [this library I call Zettel](https://github.com/juliankrispel/zettel) for building editors with React. So here you go.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/q1958o0zb0nc893b5qgk.gif)

Currently working on a pre-release, something that people can use in their apps, something that's documented and well tested.

The [github repo is full of examples](https://github.com/juliankrispel/zettel/tree/master/examples), the examples are [also hosted on gh-pages](http://zettel.software), check it out and reach out if you like!

I've just created a slack channel for Zettel, [here's the invite link](https://join.slack.com/t/zetteljs/shared_invite/enQtNzk4NjM5Njc0Nzg5LTI2ZTljZTMwY2JjMmFkOWM3Yzk5YjdlODgxZWIwMzc5YmE4MGQ1MjViZjUxMmUxZmZjNmY3OTljOWRiMmNmZjg)

[zettel.software](http://zettel.software)
HowTo: Augmented Reality without ArCore -> kotlin + mobile sensors + Rx 💥 🚀
Tags: android, kotlin, library, mobile
Published: 2019-10-18 09:03:16

#Augmented Reality

Do you ever wanted to play with AR a little but didn't want to dive deep into whole ARCore experience? 
In our company as a part of R&D research we developed a little library that provides you with a view showing labels of the destinations provided by you. It's an open source project so you can contribute or write suggestions of new features at our repo https://github.com/netguru/ar-localizer-view-android

You can easily use it in your projects: 

## Using library
<!-- description of steps how to implement the library -->

1. Add repository in you projects build.gradle file 
   
    ```gradle
    repositories {
        maven {  url 'https://dl.bintray.com/netguru/maven/' }
        ...
    }
    ```
    
2. Add library dependency 

    ```gradle
        dependencies {
                implementation 'com.netguru.arlocalizerview:arlocalizerview:0.1.0'
        }
    ```
    
3. Add view to your layout

    ```xml
     <co.netguru.arlocalizer.arview.ARLocalizerView
            android:id="@+id/arLocalizer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />
    ``` 
        
4. In in arLocalizerView onCreate method you need to provide 

    ```kotlin
    interface ARLocalizerDependencyProvider {
        fun getSensorsContext(): Context
        fun getARViewLifecycleOwner(): LifecycleOwner
        fun getPermissionActivity(): Activity
    }
          
    fun arLocalizerView.onCreate(arLocalizerDependencyProvider: ARLocalizerDependencyProvider)
    ```

5. In order to process the permission request you need to provide permission results to the view.

    ```kotlin
        fun onRequestPermissionResult(
            requestCode: Int,
            permissions: Array<out String>,
            grantResults: IntArray
        )
    ```    
    
6. Finally in order to display the destination labels on the camera preview use

    ```kotlin
    arLocalizerView.setDestinations(destinations: List<LocationData>)
    ```
  
##Library in action!

![Library in action](https://thepracticaldev.s3.amazonaws.com/i/ectfns0wu3cjl2v9pr63.gif)
![Library in action](https://thepracticaldev.s3.amazonaws.com/i/9i2vl9pbdyaarkjriumr.png)
![Library in action](https://thepracticaldev.s3.amazonaws.com/i/e8zq601cxbtrw5nwh2i7.png)
Python Tutorial for Computer Vision and Face Detection with OpenCV
Tags: python, machinelearning, tutorial, beginners
Published: 2019-10-18 08:58:32

Learn Vision Includes all OpenCV Image Processing Features with Simple Examples. Face Detection, Face Recognition 
A guide to Face Detection in Python

Computer Vision is an AI based, that is, Artificial Intelligence based technology that allows computers to understand and label images. Its now used in Convenience stores, Driver-less Car Testing, Security Access Mechanisms, Policing and Investigations Surveillance, Daily Medical Diagnosis monitoring health of crops and live stock and so on and so forth..

A common example will be face detection and unlocking mechanism that you use in your mobile phone. We use that daily. That is also a big application of Computer Vision. And today, top technology companies like Amazon, Google, Microsoft, Facebook etc are investing millions and millions of Dollars into Computer Vision based research and product development.

Computer vision allows us to analyze and leverage image and video data, with applications in a variety of industries, including self-driving cars, social network apps, medical diagnostics, and many more.

As the fastest growing language in popularity, Python is well suited to leverage the power of existing computer vision libraries to learn from all this image and video data.

In this course we'll teach you everything you need to know to become an expert in computer vision! This $20 billion dollar industry will be one of the most important job markets in the years to come.

**What you'll learn**
* Use OpenCV to work with image files
* Perform image manipulation with OpenCV, including smoothing, blurring, thresholding, and morphological operations.
* Create Face Detection Software
* Detect Objects, including corner, edge, and grid detection techniques with OpenCV and Python
* Use Python and Deep Learning to build image classifiers
* Use Python and OpenCV to draw shapes on images and videos
* Create Color Histograms with OpenCV
* Study from MIT notes and get Interview questions
* Crack image processing limits by developing Applications.

{% youtube cmyXoFS3G00 %}
This is probably the funniest Codepen I found this year!
Tags: webdev, discuss, javascript, css
Published: 2019-10-18 08:54:26

This is rather a short post but I find this codepen by Bård N Hovde so awesome that I must share it with you:

{% codepen https://codepen.io/bnhovde/pen/OJLYGKx %}

Amazing what you can do with JavaScript and CSS, agree?

Please leave a comment if you like this as well or managed to hit the button. Also don't forget to follow me here and on [Twitter](https://twitter.com/simonholdorf) for more upcoming posts!
Data is now a little less hard
Tags: datamerging, datacleaning, seaborn, python
Published: 2019-10-18 03:53:01

Previously I wrote about how Data is hard. Well, thanks to my mentor, Data is now a little less hard.

In these last few weeks, I have become an 'expert' at culling out data by using whole columns, rather than using the good old 'for' loop. For example, in order to get the data of how successful an NFL Running Back is on first down, I used the following code:

all_rbs = data.loc[(data['play_type']=='run') & (data['down'] == 1) & (data['ydstogo'] == 10)].groupby(by='rusher_player_name')[['epa', 'success','yards_gained']].mean()

Which gave me some output that looked like this:
Joe.Runningback  0.042594  0.57182   4.63

Except that it output one row for each running back in the dataset of all NFL plays from an entire NFL season.

However, given my newfound merge skills, I was then able to take that list of data and merge it into my main data table which has a record for each running back so that I now had 3 new columns for how a running back performed on 1st and 10: Expected Points Added (per play), Success rate, and average yards per attempt.

I was able to repeat this process many times over so that my final data table had 72 points of data (or features) per running back.

And, now, data was a little less hard.  That is, until we moved forward to the first step in turning that data into a model that can actually predict something.

Once again, my mentor took my hand and taught me the basics so that I could start using the data.

Rather than just run all of the features through regression (or any other) analysis, he suggested that I first take each feature and run a regression plot against our target to see if the feature has any meaning in the first place. Since I had no idea what to do, he sent me some links and talked me through the general idea. This led to me writing this code, all by myself:

from scipy import stats
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

all_rb = pd.read_excel('rb_all_data_a.xlsx')
all_rb.set_index('Index', inplace=True)
cols_we_want = []

for a in range(18,90):
    col_name = all_rb.columns[a]
    cols_we_want.append(col_name)

for col in cols_we_want:
    def r2(x, y):
        return stats.pearsonr(x, y)[0] ** 2

    sns.jointplot(x=col, y='Average_Salary', kind="reg", stat_func=r2, data=all_rb)
    plt.savefig(f'{col}.png')
    plt.close()

And, bingo, bango, bongo, in 20 lines of code, I had 72 regression plots with r^2 listed on each plot so that I could start to weed out those features which would likely prove insignificant.

Now that the features have been cut down, I'm excited to learn the next step and steps so that we can build a prediction model.

Principal Component Analysis, here we come....

To be continued.....
ANSWERING THE UNANSWERED SINCE 2011:Can I use VirtualBox on server/ cloud as a VPS Hosting platform or webhosting?
Tags: linux, php, javascript, devops
Published: 2019-10-18 08:01:33

**So no one found the most reliable answer of above question, even after contacting Oracle people and  googling too much.** 

The question remained **unsolved  since 2 Aug 2011**  in official  Virtualbox Forum : [VirtualBox as a VPS Hosting platform?](https://forums.virtualbox.org/viewtopic.php?f=6&t=19730&p=460428#p460428) 


**So what is the most simple and most trusted answer? I am going to answer today:**

The Simple and most trusted answer: **RESOURCE POOLING and DNS complexity**

**The most precious thing is RAM , Cores and Memory**. When you use virtual box it uses your HOST machine RAM and it strictly allot the same to each virtual machines.

For Instance, you have 12 GB RAM Host and 500 GB HDD and you need to create two VMs hosting two servers Ubuntu Server1 and Ubuntu Server2.
This is what happening :
Virtual Machine 1 : Ubuntu Server 1 : 4 GB and 200 HDD
Virtual Machine 2 : Ubuntu Server 2: 4 GB and 200 HDD
HOST Machine Left with : 4 GB RAM and 100 HDD

In above example note that Virtual BOX will fix the RAM for each VMs (servers) and even when VM1 is not in use will not allow other VM2 to use its resources.
Virtual Box doesn't allow resource pooling of RAM, cores and Memory and only limited to HDD pooling. Even swapping of HDD to RAM will not save you because its uses core RAM not reserved.

**Further, your Host Machine should not crash because of fixed resources (RAM) allocations to VMs. If this happens then your Virtual Box will also crash resulting crashing of everything.**

**So can I use in Production? For small Projects yes (if you don't care about pooling) and for Large projects NO.**

------------------------------ **A HACK** ---------------------------------------
Remember my post about [**YOUR COMPLETE ONLINE DESKTOP: Hosted on Server in just $5.00 :)**](https://dev.to/manishfoodtechs/your-complete-online-desktop-hosted-on-server-in-just-5-00-4la5). 
**Go ahead and create a desktop on server.**
**Then Install Virtual box there and** **go Crazy, Crazy, Crazy....**
------------------------------ **A HACK** ---------------------------------------

I am not a Programmer. I love Programming and I am among 17 % of World's programmer population who do not hold a formal degree in Computer Programming. I am an Engineer (Chemical Tech -Food Techno) who knows more about Heat Transfers and Mass Transfers and loves exploring.
Treat above stated introduction as my disclaimer that I can't answer all your queries. But I can Mostly. Contact me on manishfoodtechs@gmail.com

**DON'T FORGET TO LIKE, TAG & FOLLOW ME.** *In coming posts I will explore creating your own compute clouding server like Digital Ocean and Google cloud. Yeah... Interesting...*
Awesome Frontend Security
Tags: awesome, security, frontend, opensource
Published: 2019-10-18 07:43:48

XSS, clickjacking, vulnerabilities in npm packages...
There are many ways to keep those things away from your projects.

Recently I've been doing research on frontend security and found many useful resources along the way.
In order to share this with community I've started an [Awesome Frontend Security] (https://github.com/rustcohlnikov/awesome-frontend-security) — a list of thoroughly curated tools, tips & articles to help take your frontend security to the next level.



💜 Contributions are so very welcome!
sw-tools, a library to rule the Service Workers
Tags: javascript, npm, serviceworkers, performance
Published: 2019-10-18 07:37:56

# sw-tools, a library to rule the Service Workers

Today I would like to write about a JavaScript library that we recently published in NPM. It is designed to include a Service Worker with very interesting functionality on a website.

## But why?

When [Workbox by Google] was published, we thought it was a great idea to control a Service Worker without knowing almost anything about them. Reading about what Service Workers can do, we saw that Workbox includes only basic functionality. That is why we decided to create our own library to control Service Workers.

## What can it do?

- **Automatically manages the cache** depending on the type of resource requested.
- **Prefetching** of the pages that the user will visit.
- **Lazy loading** of YouTube images and videos ([original idea by Arthur Corenzan on dev.to]).
- Full page **offline** usage.

## How does it work

The installation and configuration of the library is done in four simple steps.

1. Download and install from NPM.

    ```bash
    npm install @veiss-com/sw-tools --save-dev
    ```

2. Copy the Service Worker (sw.min.js) to the root directory of the project.
3. Include the library in the web JavaScript.
4. Initialize and configure the Service Worker.

    ```javascript
    var swTools = new swTools('/sw.min.js');
    ```

> Visit [NPM] to see the configuration options.

We know it is not perfect and can be improved. Therefore, we would like to know your opinion. Any thoughts, corrections, etc. it's welcome.

{% github veiss-com/sw-tools %}

[Workbox by Google]: https://developers.google.com/web/tools/workbox/
[NPM]: https://www.npmjs.com/package/@veiss-com/sw-tools
[original idea by Arthur Corenzan on dev.to]: https://dev.to/haggen/lazy-load-embedded-youtube-videos-520g