teleren/devto huggingface dataset:
How to use variables in bamboo for building and deploying and how to store sensitive information
Tags: devops, bamboo, ciandcd, security
Published: 2019-12-13 19:13:14

Hello Dear Coders,

Last time I wrote an article regarding security with [Nexus and NPM Packages](https://medium.com/@daniel.pacurici/nexus-package-manager-how-to-access-your-npm-packages-after-securing-nexus-239aa121a96c). Once your packages are secure, how do your CI Builds are supposed to work and do things like **npm install** or how can they run your docker containers? 

This article will show you how to do that if you are using Bamboo.

---
### **Bamboo has some 2 types of variables:**
* global variables
* plan specific variables

If the global variables share the same name as the plan specific variables, then the plan specific variable will overwrite the global variable.

### **How to define a global variable:**
1. Go to Bamboo and open administrator panel by *clicking the cogwheel*
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/8wdis2bn2jatv2otx4ae.JPG)
2. From the left panel, under *Build Resources* choose *Global Variables*
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/atnpx39tq2gliv3hc5b9.JPG)
3. Create a new variable by giving it a name and a value and *click Add*.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/3wregy8f4ac9mtstmp5s.JPG)

---
### **How to define a plan variable:**
1. Go to the Plan and press **E**(dit) key or go to *Actions* and click *Configure plan*
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ayp5bsjfa4qq8qt6u6d4.jpg)
2. Go to *Variables*
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/0uyeeiimoftsbmkck9l4.jpg)
3. The same step as on global variable

Now you can use that variable in your plans. But what about sensitive information ? 

Bamboo provides us with a feature that allows us to store sensitive information. If your variable name contains one of the keywords "PASSWORD" or "SECRET", it will automatically encrypt that information 
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/j4mkofbvol8laz1fxp93.JPG)

That's a very nice feature and very helpful.

After the variables are configured, we can create our task and use our variables like this:

```
export PORT=${bamboo.PORT}
echo \_auth = ${bamboo.SECRET_NEXUS_AUTH} >> .npmrc
./docker-build.sh ${bamboo.CONTAINER_NAME} ${bamboo.PORT}
```

In your build logs, you will see that the variables are encrypted and the sensitive data is not stored.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/5f1tzd7fhvcxs843uuwk.jpg)

The same way you can use the variables in your deployment tasks.

Thanks for reading and I hope this will bring a bit of security to your projects. Comments are welcome ! :)
Computational Thinking / Decomposition
Tags: uiweekly, firstyearincode, productivity
Published: 2019-12-13 19:00:54

I started to sketchnote a while ago, mostly focused on topics that are interesting and relevant for beginners. In my head I had these thoughts about these core skills you need besides your first programming language. After lots of googling, I finally found out the term for what I was looking for: Computational Thinking!

There are a few aspects to Computational Thinking and here's the first one: 

![Computational Thinking Sketchnote](https://thepracticaldev.s3.amazonaws.com/i/16kp41ra7uhrz4gu82up.jpg)

Decomposition - or how to break down a complex problem into smaller, more managable problems. 

Let's take a TODO Application as example and break it down into its pieces. Part one is creating the user interface, followed by making sure that the UI reacts to user input such as button clicks or text inputs.

Then, we only accept TODO items that actually have a text. We don't want any empty items on the list.
For now, we're only saving them in memory. The last step is to render all TODO items that are stored in memory. 

---

_21 Lessons helps Junior Developers to level up their skills step by step via their weekly newsletter. Do you want to get out of Tutorial Hell or you're wondering how you develop the skills to write sophisticated programs yourself? [Sign up](https://learn.21-lessons.com/junior-dev-insights) and receive weekly articles and recommendations right in your mailbox._
Module, Package, Library
Tags: python
Published: 2019-12-13 18:54:38

###### December 2019
### Preface:
I would like to consider myself as a newbie to coding. At some point, I got confused with a lot of coding lingos. Especially as I had to jump between python, javascript and for some time c sharp.
Hence this post is a learn-along. As I learn more I will update/modify this post with relevant elaboration and talk about some weird/edge cases.
official docs: https://docs.python.org/

---

For now, I will share in brief a little bit with Python in mind.
```
-- foo.py
```

That's a python file and also a python **module**.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
```
-- fooDir
   -- foo.py
```
That's just a python file(module) in a folder.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
```
-- fooDir
   -- __init__.py
   -- foo.py
```
Now that's a python **package**. Magic. The magic is _\_\_init\_\_.py_
A Package is a collection of modules neatly "packaged-up" into a directory. The _\_\_init\_\_.py_ file is just how python recognizes that the directory is meant to be a package.

Now, whats a **library**?
A library is a collection of functionalities. It can be just a module or a package.

Next up: library vs framework vs API. That's spicy.

---
### Thoughts
It is said teaching makes you learn better. And for the most part, these posts are a way of self-improvement for me. If you find any corrections you want to point out please do it, but try to be respectful.
Adding Tabs Navigation in Ionic 4 and Angular App
Tags: ionic, addingtabsnavigation, ionic4, angularapp
Published: 2020-02-07 09:51:28

---
title: Adding Tabs Navigation in Ionic 4 and Angular App
published: true
date: 2019-12-13 18:21:32 UTC
tags: Ionic,Adding Tabs Navigation, Ionic 4,Angular App
canonical_url: https://www.positronx.io/adding-tabs-navigation-in-ionic-angular/
---

The post [Adding Tabs Navigation in Ionic 4 and Angular App](https://www.positronx.io/adding-tabs-navigation-in-ionic-angular/) appeared first on [positronX.io](https://www.positronx.io).

**In this Ionic 4 Angular 8 Tabs tutorial, we are going to learn today, how to add tabs and how to enable navigation in Tabs using Angular Routing to communicate between pages in Ionic Angular app.**

Tabs are a navigation element, and almost every mobile application uses the tabs navigation component to add the rich user experience in the mobile app.

[click here to read more](https://www.positronx.io/adding-tabs-navigation-in-ionic-angular/)
How to Start your Career on DEV
Tags: beginners, students
Published: 2019-12-13 17:57:37

---
title: How to Start your Career on DEV
published: true
description: DEV Student series part 2 
tags: beginners, students 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ioolqi1wmrphouhbvcdc.jpg
series: Students
---

Becoming a developer can start at any point in one’s life. As the importance of coding has grown, so has the demand for programmers. Thousands of students of all ages are currently training to work in this bolstering industry. We are going to look at how you can start your dream career by leveraging the resources available right here on DEV. 

##Experience > Degree? 

Many devs have pursued a career in programming with a structured degree in computer science or through formal training in boot camps, but not every dev takes the same path. Some go straight into the workforce through freelancing, while others have degrees in completely different subjects but code on the side for fun.
{% link https://dev.to/kelly/freelancing-101-how-to-get-started-36kg %}
 
Read up on the type of programming career you want, and ask yourself the important questions.

{% link https://dev.to/_patrickgod/do-you-need-a-computer-science-degree-to-be-a-developer--247n %}

##Internships

A great way to gain experience is through internships where you’ll have the opportunity to learn from more experienced developers and get a feel of what career avenue might interest you. Check out [dev.to/listings](https://dev.to/listings) to find mentors, internship listings, and networking events. Interning can be done for experience-only or college credit, but there are plenty of employers that pay their interns well. 

##There are Many Paths

Just as not all programming careers start the same way, they also don’t need to end in the same way. Do you want to pursue front-end, back-end or DevOps? Do you want to lead a team of devs? Do you have a financial target that you want to hit? What is your end goal or even what does a successful career look like to you? 

It's okay if you don't have all the answers now. The important thing is that you build a solid foundation to learn on and keep all your options in mind.


The best thing to remember is that your path is different than your peers and even your mentors. Reach out to other DEV members and chat about their career maybe get some advice. 


##Reminder

You are going to make mistakes, you will get a lot of “sorry but we’ve decided to go another direction”, you will need help. That’s why we’re working hard to make sure you have a community that supports you when those times come. Be patient, your dream job may not be your first job. 

{% link https://dev.to/emmawedekind/101-tips-for-being-a-great-programmer-human-36nl %}
{% link https://dev.to/molly_struve/if-you-are-a-new-developer-start-here-4b78 %}

***
In the next part of this series, we will discuss the resources beginners have here on DEV.
Day 23 of⚡️ #30DaysOfWebPerf ⚡️: Culture of Performance
Tags: webperf, webdev, performance, culture
Published: 2019-12-13 17:47:59

For Day 23:

{% twitter 1205544523696418817 %}


---

This article was originally published on [sia.codes](https://sia.codes/). Head over there if you like this post and want to read others like it, or sign up for my [newsletter](https://buttondown.email/sia.codes) to be notified of new posts!
🐞 Catch exceptions in Flutter with Catcher & Sentry
Tags: flutter, exceptions, sentry, dart
Published: 2019-12-13 17:24:24

Who doesn't hate unhandled exceptions in their applications?

In this post, I will show you how to catch unhandled exceptions in a flutter application using a [Catcher](https://pub.dev/packages/catcher) plugin and [sentry.io](http://sentry.io)

## Create a new project in Sentry

Go to sentry.io and create a new project

![Create New Project](https://thepracticaldev.s3.amazonaws.com/i/0e958rup11epvmmsusmv.png)

We can just use the DSN for our application.

![Get DSN](https://thepracticaldev.s3.amazonaws.com/i/kzm8zh1w5sc3l3hwsfge.png)

## Install Catcher

Open your app's `pubspec.yml` file and add `catcher` as a dependency.

```yaml
dependencies:
  catcher: ^0.2.7
```

>NOTE: Catcher version mentioned in this post may not be the latest version.

And in your `main.dart` file,

Import the package,

```dart
import 'package:catcher/catcher_plugin.dart';
```

Replace

```dart
runApp(App());
```

with 

```dart
void main() {
  /// checking if release mode or not
  /// no need of Catcher & Sentry in debug mode.
  if (kReleaseMode) {
    Catcher(
      App(),
      releaseConfig: CatcherOptions(
        SilentReportMode(),
        [SentryHandler('<SENTRY_DSN_STRING>')],
      ),
    );
  } else {
    runApp(App());
  }
}
```

Replace your sentry DSN with `<SENTRY_DSN_STRING>` in `SentryHandler`

In `CatcherOptions`, we have to provide a `ReportMode` as the first parameter and at least one `ReportHandler` as the second parameter. Here we are using `SilentReportMode()` as `ReportMode` and `SentryHandler()` as error handler.  

What we are expecting here is, if there is any unhandled exception occurs, the app will send the error report to sentry silently. If you want to get user's confirmation to send an error report, you can use `DialogReportMode()` instead of `SilentReportMode()`.

You can refer more in the plugin documentation [here](https://pub.dev/packages/catcher)

next, in `MaterialApp` widget add `Catcher.navigatorKey` as value of `navigatorKey` property

```dart
class App extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorKey: Catcher.navigatorKey, // <---------
      home: RootPage(),
    );
  }
}
```

And that's it!

Catcher will catch all the unhandled exceptions in the application from now on. You can view the exceptions in the sentry dashboard.
smart contract ML DEV
Published: 2019-12-13 17:12:04

 good morning , 

i want to implement a new smart contract for clustering data over blockchain.
about the algorithme of clusterning i wat to start by the simple algorithme Kmeans for example.
the smart contract get data from un IPFS.

what architecture can my smart contract have? and with what I have to start? 

Cdlt.
3 Tips to enhance your programming capabilities as a beginner and come up as a superhero!
Tags: webdev, javascript, programming, beginners
Published: 2019-12-13 16:54:59

It's a typical tips and tricks post with some humor, so read it and !don't share it with your friends. (Easter Egg: All the Headings are Reversed - Which means Negative)
![3 Tips to Enhance your programming capabilities as a beginner and come up as a SuperHero! , Javascript, Earn Money](https://thepracticaldev.s3.amazonaws.com/i/dmcvo5xpbp3f1lnm7ndn.gif)
### Tip 1 - Don't waste your time writing the same code
You've to repeat the code and avoid copy-pasting, to learn it properly. Repetition is the way to grab the key points and save them in the repository of your brain. It's not time-wasting.

##### Q . I saw my senior copy-pasting the code???
Ans . It's really common, to copy-paste the code and use it with some changes, but they don't copy one line of code like *querySelector()* or my recommendation is to learn the concepts and avoid the copy-pasting as a beginner. If you still don't understand??? Just don't do it(without any reason), It is going to help you in long term.


### Tip 2 - Follow too many theses, articles, posts, or videos at the same time for a single, task.
I saw a guy he just opened up VSCode and opened up 4 or 5 articles to set up Vue-router and using it and then he opened up a video and started following it while reading articles. I was shocked, there are more than two ways to set up the VueRouter and he can easily break things by following all the things practically.
I just want you to read all the articles or videos before jumping into the code. And choose two good resources(good for you), and then follow the first one. if anything goes wrong, try the other one. 


### Tip 3 - Don't Ask anyone for help
Just ask for help, I guarantee you there will be some good coders around you who are willing to help. they are just waiting for you to ask them. don't feel ashamed asking your seniors, it's a good thing in some company cultures. I agree with the "Trial and Error Method".
First Try like there is no-one to solve this problem for you and then you can ask your friends or seniors.
*Tip: StackOverFlow and GitHub issues are there always* 


You reached the end............
Cover Photo Credit - [DZONE](https://dzone.com/articles/how-to-be-a-programming-superhero-after-crossing-b)
Follow me on Twitter [twitter.com/justaashir](twitter.com/justaashir)
How to Group in C# Like in SQL
Tags: csharp, dotnet, sql, database
Published: 2019-12-13 16:53:10

The code snippet below demonstrates how to group object in-memory clean and accurate. Feel free to adapt to your usage in your production project.

StringBuilder builder = new StringBuilder("SELECT s.EmployeeId, s.DepartmentName, s.BasicSalary FROM EmployeeSalary s ");

  var employeeSalary = SqlAccess.Get<Models.EmployeeSalary>(builder.ToString());
  var totalDepartmentSalary = (from s in employeeSalary
                               group s by s.DepartmentName into g
                               select new { DepartmentName = g.Key
                               ,TotalEmployee = g.Count()
                               ,TotalBasicSalary = g.Sum(b => b.BasicSalary) }).ToList();

  totalDepartmentSalary.ForEach(p => {
  Console.Write($"Department: {p.DepartmentName} ");
  Console.Write($"Number of Employees: {p.TotalEmployee} ");
  Console.WriteLine($"Total Basic Salary: {p.TotalBasicSalary.ToString("N2")}");
            });
  Console.ReadKey();
OK lets write in english!
Published: 2019-12-13 16:50:04

Now, I Will try write in english about software development.

If you want my blog posts in Portuguese, you could read on https://medium.com/codigorefinado


Here in dev.to you will found only posts in english. 
I will use these blog posts to training my skills on these amazing language.

Feel free to say how can I write better.
Fastlane Setup in Ubuntu
Tags: android, fastlane, ubuntu
Published: 2019-12-13 16:42:54

The recipe we follow at my work for automating android app publishing is bitbucket + Teamcity + Fastlane + slack.

Choosing Fastlane for automatic publishing mobile apps to the store is no wonder. It's the most preferred way to publish apps automatically.

We use TeamCity for CICD at our work, We looked at a few of the cloud solutions for CICD, but finally, we opted to use TeamCity Professional Version as our CICD tool. It's free to use and 3 build agents with 100 build configurations which were more than enough for our purposes. And comparatively, We felt it was way easier to set it up and configure than Jenkins.

Of course, Jenkins has been there for a while and may have more community support and plugins than TeamCity, TeamCity felt easy to manage without a dedicated person for support. We did play around several other CICDs but finally settled with TeamCity.

Fastlane is officially supported to run on macOS, and it seems like Windows & Linux Support is coming up.

Since our TeamCity server (& the in-built build agent) was running on Ubuntu 14.04, We needed to install Fastlane in the same machine. The installation instructions for Fastlane on Ubuntu 18.04 is easy to find in [comments of an issue](https://github.com/fastlane/fastlane/issues/11687#issuecomment-489891745).

Here are the installation steps for Ubuntu 18.04 from the comments.

1. Install ruby and ruby-dev headers

    ```bash
    sudo apt install ruby ruby-dev
    ```

2. Set environment language variables. Add these lines to the top of ~/.profile

    ```bash
    export LC_ALL=en_US.UTF-8
    export LANG=en_US.UTF-8
    ```

3. Check that you didn't break the environment and restart. Run ```source ~/.profile``` in the terminal. If no output, you are safe. Otherwise, check for what you broke in the .profile file

4. Install Fastlane

    ```bash
    sudo gem install fastlane
    which fastlane  // Verify
    ```

5. From there do the normal [Fastlane Setup](https://docs.fastlane.tools/getting-started/android/setup/)

I ran into some issues while doing this setup. Some of the Gotchas while doing this.

- Make sure to install Ruby 2.x version

    ```bash
    sudo apt-add-repository ppa:brightbox/ruby-ng
    sudo apt-get update
    sudo apt-get install ruby2.4
    ruby -v // Verify
    sudo apt-get install ruby2.4-dev
    ```

- Depends on your Ubuntu 14.04 environment, Sometimes the following needs to be installed

    ```bash
    sudo apt-get install libc6-dev
    sudo apt-get install g++
    ```

- Fastlane uses the Google API client to communicate with the Google Play Console Services. I noticed this issue, '*Missing Google API Client*' when installing Fastlane.

    ```bash
    gem install google-api-client -v 0.29.1
    ```

That should be it, Hope that helps.

**P.S:** I wrote the draft of this blog a very long time ago and left it to pickle :D. I just decided to publish it after correcting the grammatical and misspelled words. Some of the errors may have been fixed.
[Ruby Trick] Retrieve an object's private method without calling its `method`
Tags: ruby
Published: 2019-12-13 16:34:55

Goal: Get the `bar` method


```ruby
class Foo
  def method; end
  
  private
  
  def bar
    "hey!"
  end
end

foo = Foo.new

# foo.method(:bar) will cause error cause it's been overridden
# foo.public_method(:bar) won't work cause :bar is private

method_method = Object.method(:method).unbind
bar_method = method_method.bind(foo).call(:bar)
bar_method.call #=> "hey!"
```
Announcing the Django News newsletter
Tags: django, python
Published: 2019-12-13 16:32:16

The Django web framework is used by millions of developers and consumed by billions of consumers, yet it does not have an active weekly newsletter.

So I've teamed up with my friend [Jeff Triplett](https://twitter.com/webology) to launch [Django News](https://django-news.com), a weekly newsletter on all things Django: news, articles, projects, educational resources, and the like.

If you'd like to subscribe for free, check out [https://django-news.com](https://django-news.com).
Coding the IntCode computer! Advent of Code 2019 - Day 5
Tags: challenge, adventofcode, javascript, video
Published: 2019-12-13 16:21:45

---
title: Coding the IntCode computer! Advent of Code 2019 - Day 5
published: true
description: JavaScript walkthrough of Advent of Code 2019 (day 5)
tags: challenge, AdventOfCode, javascript, video
series: Advent of Code 2019 in Javascript
---

{% youtube DoxwKTLxO0c %}
Terraform: use a variable's value to define another variable
Tags: terraform, hacks
Published: 2019-12-13 16:10:48

---
title: Terraform: use a variable's value to define another variable
published: true
description: Use a Terraform variable's value to define another variable
tags: #terraform #hacks 
---

I was looking for a way to set a default terraform variable value from another variable but also have a way to override. Terraform does not allow this natively:

```terraform
variable nickname {
  default = var.fullname
}

variable fullname {
  default = "richard"
}

output name {
  value = var.nickname
}

$ terraform apply

Error: Variables not allowed

  on var-to-var.tf line 2, in variable "nickname":
   2:   default = var.fullname

Variables may not be used here.
```

But I was able to get this working, see below!

Disclaimer: This does not technically default the value from one variable to another. However, it provides the desired output; at least the one I was looking for.


```terraform
variable fullname {
  default = "richard"
}

variable nickname {
  default = ""
}

output name {
  value = var.nickname != "" ? var.nickname : var.fullname
}
```


```bash
$ terraform apply
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
name = richard
```

```bash
$ terraform apply -var nickname=drew
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
name = drew
```