teleren/devto huggingface dataset:
49 Days of Ruby: Day 15 - Environment Variables
Tags: ruby
Published: 2021-04-11 04:59:46

---
title: 49 Days of Ruby: Day 15 - Environment Variables
published: true
description: Join us on a 49 day learning journey through Ruby!
series: 49 Days of Ruby
tags: #ruby
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/9m73qaetuse3nm3y3it8.png
---

**Welcome to day 15 of the 49 Days of Ruby! 🎉**

Today we are discussing the concept of environment variables. These become very important when you want to build a program that has sensitive data, among other use cases.

Let's say you are building an app that has a password embedded in the code. You probably do not want to widely share that password with everyone who sees the code, so what do you do?

Environment variables can offer a solution.

Environment variables let you supply a keyword as the value for the password that gets replaced with the actual value during runtime. 

Let's take a look at an example.

## Environment Variables in Ruby

Suppose we had an app called `app.rb`. This app needs a password in the code:

```ruby
# app.rb

password = "super_secret_password"

def my_method
  # do something with the password
end
```

How do you share your great code without sharing your `super_secret_password`?

Here it is with an environment variable:

```ruby
# app.rb

password = ENV['PASSWORD']

def my_method
  # do something with the password
end
```

Do you see the difference?

The first half specifies it is an environment variable: `ENV`. The second half inside the brackets is the name of the specific environment variable, `PASSWORD` in our example.

How do create an environment variable? We'll see later on different Ruby tooling to manage environment variables. For now, we'll show how to define an environment variable from the command line.

Let's say you wanted to run your `app.rb` file from the command line. You would execute: `ruby app.rb` and the program would run. To add the password as the environment variable you would preface that command with the following:

```bash
$ PASSWORD=my_secret_password ruby app.rb
```

You can create environment variables and define them at runtime by adding them to your execution from the command line like above. You can even have multiple ones:

```bash
$ VARIABLE_1=something VARIABLE_2=something_else VARIABLE_3=another_thing ruby app.rb
```

What do you think about environment variables? What might you use them for? Share your learning!

**Come back tomorrow for the next installment of 49 Days of Ruby! You can join the conversation on Twitter with the hashtag [#49daysofruby](https://twitter.com/hashtag/49daysofruby).**
PyCryptoBot Results and Config
Tags: cryptobot, tradingbot, opensourcecryptobots, bots
Published: 2021-04-12 21:40:14

---
title: PyCryptoBot Results and Config
published: true
date: 2021-04-11 04:04:49 UTC
tags: cryptobot,tradingbot,opensourcecryptobots,bots
canonical_url: https://medium.com/coinmonks/pycryptobot-results-and-config-57fb6625a6d9
---

[![](https://cdn-images-1.medium.com/max/1920/1*bbrL_VNUik-hJK9g5aZi0A.jpeg)](https://medium.com/coinmonks/pycryptobot-results-and-config-57fb6625a6d9?source=rss----721b17443fd5---4)

I wanted to share my bot results for the last 30 days and the config I’m using. I get asked this question a lot in Medium comments, emails…

[Continue reading on Coinmonks »](https://medium.com/coinmonks/pycryptobot-results-and-config-57fb6625a6d9?source=rss----721b17443fd5---4)
Python Developer?
Tags: python
Published: 2021-04-11 03:47:31

I'm proud to say that I've created my first Python desktop application! I wrote the app for my department. I'm an artist at a plastics company, and we do plenty of business with different customers. We send out numerous PDF proofs to these customers on a daily basis, and these PDFs are hosted on our servers. 

Usually we would have to open each folder to access the PDF, this normally isn't an issue, but we're talking about 20 plus proofs we're sending out nearly every other day, so having to open each individual folder becomes time consuming.

My solution to this issue was to create an app where the user would only need to type in the PDF name and select the PDF type; this would allow them to create copies of multiple PDFs proofs at the same time, without have to open each folder. The way to app works is the user would first name a desktop folder, this folder would house the copied PDFs, next the user inputs the PDF name (up to ten), for my department the PDFs are named by numbers, so it's and easy copy and paste. Next they would select the PDF type via radio buttons (low resolution, high resolution, raster), then all the user would have to do is click "COPY" and all of the PDFs would be copied to the newly created desktop folder.

If the user needs to add more than ten proofs, there's a "CLEAR" button that clears out the number entries, allowing the user to paste new numbers to copy new proofs to the same desktop folder. There's also a "Zip Folder" button, allowing the user to create an zip file for the proofs folder if they so choose. 

![Prototype](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vj753q4iv7kt7m5ql46c.png)                            *Prototype*

As for under the hood, I'm using a few different modules, including pyPDF2, os, and tkinter for the GUI. Everything is driven off the PDF name; once the user clicks copy, the app take the PDF name to build the directories. There's no searching through different folders, everything is an absolute path. The app will first check if main PDF folder exist, if the folder returns true, the app will next look for the specified PDF in its specific folder and only that folder. I wanted the app to be as quick as it's able to be, so I felt that absolute paths were the way to go.

I hope this to be the first app of many, not just for my current position, but as I attempt to retool my own freelance business to incorporate software development. This experience leaves me wanting more, I just need to head in the right direction.
Git LFS 手順
Tags: git, lfs, powershell, windows
Published: 2021-04-11 03:40:10

---
title: Git LFS 手順
published: true
description: how to Git LFS
tags: git,lfs,powershell,windows
//cover_image: https://direct_url_to_image.jpg
---

# Windows PowerShellでLFS管理が適切なファイルのリストアップ.

- 現在のパスから再帰的に50MB以上のファイルをリストアップ

```
> Get-ChildItem -Path . -Recurse | Where-Object {$_.Length -ge (50*1024*1024)}
```

- 完全なファイルパスを取得するバージョン

```
> (Get-ChildItem -Path . -Recurse | Where-Object {$_.Length -ge (50*1024*1024)}).FullName
```

# Git LFS管理への追加.

- 下記のようにしてGit LFSの対象に追加していきます。

```
> git lfs track "path/to/BigFile.c"
```

このファイル情報は `.gitattributes` ファイルに追記されますので内容を確認します。
あとは通常通り git add していきます。
Artificial Intelligence-Our Future?
Published: 2021-04-11 03:33:52

I still remember when I was around 9-10 years old then I used to hear a lot about different assumptions and opinion regarding our future which was supposed to be carried away by AI most of any other inventions and technologies. 
Again here I am 19-20 years i.e., ten years after all those assumptions and opinions and if we talk about the progress on AI inventions then yes it is most reliable technology of any and is on verge of further more improvising this technology.
AI has proved to be boon to the new generation in many fields and works like AI is best option to be used as guide to self driving cars, a new invention of new world.
AI based assistant is being used in most of mobile phones, laptops and is also available by different companies to be used as assistant to us in order to command to either switch on the light or close the electronic door.
To sum up, I would say, yes AI is definitely a rising future which is only going to be big and improvised in order to meet future needs and demands.
Populating Your Secure Cloud Data Estates
Published: 2021-04-15 16:07:01

---
title: Populating Your Secure Cloud Data Estates
published: true
date: 2021-04-11 03:15:00 UTC
tags: 
canonical_url: 
---

# Populating Your Secure Cloud Data Estates

## Hydrating Your Clean Cloud Data Lake

I am hard pressed to keep up with Data Store + Query terminology du jour.    Was it Data Lake House?   All these giant bodies of water mostly stored in buckets (S3)?    I agree there are lots of nuances and many different query engines on top of those various means for storing that data.   I don't think everytime we add a twist we need to add increasingly silly terms on top.   Is it to confuse users?  developers?  data engineers?  companies?   executives?   Perhaps if we change our data warehouse name again we can get them to buy the same thing again.

Clearly it can't be one size fit all for all this different things?   I know a lot of companies of various types and sizes and most don't approach the size of the data that companies like Netflix and LinkedIn have.   I really like their innovation, but often those projects get released and then wither in obscurity.

A few projects look really good:

- Apache Iceberg - I have a good feeling on this one.   [https://conferences.oreilly.com/strata/strata-ny-2018/public/schedule/detail/69503.html](https://conferences.oreilly.com/strata/strata-ny-2018/public/schedule/detail/69503.html) [https://thenewstack.io/apache-iceberg-a-different-table-design-for-big-data/](https://thenewstack.io/apache-iceberg-a-different-table-design-for-big-data/)
- Apache Hudi [https://hudi.apache.org/](https://hudi.apache.org/)

For me, if I can do the basic CRUD operations that applications, reports, dashboards and queries require then it works for me.    With Apache NiFi, Apache Kafka, Apache Spark and Apache Flink supporting a data store then it is should be good.   The one thing I have to be wary of is that datastores like Apache Kudu, Apache HBase and HDFS have been around for a long time and have many of the production killing bugs flushed out of it, multiple company support and robust Open Source Apache communities around them.   If a new project doesn't it won't survive, get traction or will just sit out there orphaned.    Let's build on what we have and try not to have a million half supported projects that are often abandoned or of unknown status.   Apache Parquet and Apache ORC have shown themselves as really solid and having engines like Apache Hive and Apache Impala to query them is really important.   Apache Ozone is looking very interesting for when Object Stores are not available. [ http://ozone.apache.org/](%C2%A0http://ozone.apache.org/)
Cara mengaktifkan mode developer dan debugging usb pada smartphone
Published: 2021-04-11 03:10:20

Untuk mengaktifkan mode developer dan debugging usb Sangat lah mudah yuk simak artikel berikut : 
https://www.emirortech.com/2021/04/cara-mengaktifkan-mode-developer-dan-debugging-usb-di-smartphone.html?m=1
JavaScript Hoisting
Tags: javascript, hoisting, functional, intro
Published: 2021-04-11 02:58:16

JavaScript before executing your code parses it, and adds every function and variable declarations it finds to its own memory. This is called hoisting.

There are some different behaviors that occur when using a  function declaration vs a function expression.

With function declarations, we can call a function before it’s defined, and our code will work. In the other case, we’ll have errors.

A general rule of thumb is to always define functions, variables, objects and classes before using them.

Suppose we have a function:

```
function cat() {
  alert("I'm a cat that meows!")
}
```

Due to hoisting, we can invoke cat() before it is declared:

```
cat()
function cat() {
  alert("I'm a cat that meows!")
}
```

This only happens with functions and not function expressions.

When you assign a function to a variable, that is a function expression:

```
cat()
var cat = function() {
  alert("I'm a cat that meows!")
}
```

In this case, the var declaration is hoisted and initialized with undefined as a value, something like this:

```
var cat = undefined
cat()
cat = function() {
  alert("I'm a cat that meows!")
}
```

Running this code will give you a `TypeError: cat is not a function error.`

const and let declarations are hoisted, too, but they are not initialized to undefined like var.

```
const cat = function cat() {
  alert("I'm a cat that meows!")
}

const cat = function () {
  alert("I'm a cat that meows!")
}
```

or

```
let cat = function cat() {
  alert("I'm a cat that meows!")
}

let cat = function () {
  alert("I'm a cat that meows!")
}
```

In this case, if you invoke cat() before declaring it, it will give you a ReferenceError: 'cat' is not defined error.

The same will happen for any other expression that assigns an object or class to a variable

Class declarations work like let and const declarations: they are hoisted, but not initialized, and using a class before its declaration will give a ReferenceError: <Class> is not defined error.

A simple tip: 

1. If you are not re-assigning a variable value, it's better to use const, otherwise use let. 

Example:

**Don't do it**

```
const meow = 'meow'
meow = 'meow, Angry cat!!! 
```

This will not work - It will give you a `SyntaxError: Invalid or unexpected token`

Instead:

```
let meow = 'meow'
meow = 'meow, Angry cat!!! 
```

Summary:

All function declarations are hoisted to the top of the current scope before any Javascript is executed.

We can call a function declaration before it’s defined, and our code will work. 

function expressions are hoisted and initialized with undefined as a value, so this will give you an error.

If you are not re-assigning a variable value, it's better to use const, otherwise use let.
I open source my remote desktop software: RustDesk
Tags: programming, opensource, showdev, flutter
Published: 2021-04-11 02:34:41

Lately, I open sourced the client of RustDesk, a remote desktop software, my personal project, alternative of Teamviewer and AnyDesk. It is mainly written with Rust. Sciter sdk is used for GUI on Desktop. Flutter is used on mobile (not open source yet). Flutter interacts with Rust via FFI. NaCl is used for encryption.

https://github.com/rustdesk/rustdesk
The software development lifecycle (SDLC)
Tags: systems, github, computerscience, follow
Published: 2021-04-11 02:33:54

https://github.com/rajeevranjancom/SDLC

The software development lifecycle (SDLC) is a framework that development teams use to produce high-quality software in a systematic and cost-effective way. The SDLC methodology is used by both large and small software organizations.

Developers often think that only one of the seven stages of the system development life cycle applies to them. But, to work at their best, everyone in a software development team should have a good working knowledge of all stages of the SDLC.

Below, we discuss each stage and where it fits into the bigger picture. We also provide examples of expected output, describe team members needed, and share resources for individual learning.

Please Follow for new update
What is the goal of operations?
Tags: devops, operations, practices
Published: 2021-04-14 07:13:21

---
title: What is the goal of operations?
published: true
date: 2021-04-11 00:00:00 UTC
tags: devops,operations,practices
canonical_url: https://jhall.io/archive/2021/04/11/what-is-the-goal-of-operations/
---

Most people believe it is the job of developers to add new features to a system (i.e. introduce change). They contrast this to the job of operations, which is to ensure the system is fast and stable (i.e. prevent change to the system). It’s this very “Dev vs. Ops” concept that lead to the birth of DevOps, which tries to change this goal.

John Allspaw and Paul Hammond challenged this in their seminal 2009 talk [10+ Deploys per Day](https://www.youtube.com/watch?v=LdOe18KhtT4).

> [It is not] operation’s job is to keep the site stable and fast. Operation’s job is to enable the business.

That sounds pretty obvious. But what business _doesn’t_ want a stable and fast system?

Allspaw goes on:

> If the business requires that the site go down every two weeks, even though you’re the largest online gaming platform, and you have millions of paying customers, those millions of customers might be quite fine for you to have availability of 97%. Screw the 5 9s. This is just truth. It just so happens that keeping the site stable and fast is something you see as common across business requirements.

Not every business needs a fast and stable system. For many businesses, the opportunity cost of stability is far greater than the value of fast innovation. In fact, I might be so bold as to say this is true for _most_ businesses at some point.

* * *
If you enjoyed this message, [subscribe](https://jhall.io/daily) to _The Daily Commit_ to get future messages to your inbox.
DML in Apex
Published: 2021-04-11 02:30:04

######insert, update, upsert, delete, undelete, merge

Each DML statement accepts either a single sObject or a list (or array) of sObjects (more efficient.)

The **merge** statement merges up to three records of the same sObject type into one of the records, deleting the others, and re-parenting any related records.

**Upsert**
compares value of one field (user defined) or ID to check for insertion or update.

*If the key is not matched, a new object record is created.
*If the key is matched once, the existing object record is updated.
*If the key is matched multiple times, an error is generated and the object record is neither inserted or updated


**Database methods** (built in)
Database.insert()
Database.update()
Database.upsert()
Database.delete()
Database.undelete()
Database.merge()
Database methods have an optional allOrNone parameter that allows you to specify whether the operation should partially succeed. When this parameter is set to false, if errors occur on a partial set of records, the successful records will be committed and errors will be returned for the failed records. Also, no exceptions are thrown with the partial success option.

Database.insert(recordList, false);  //allornone set to false. 
Default is true.


https://trailhead.salesforce.com/content/learn/modules/apex_database/apex_database_dml?trailmix_creator_id=shibua&trailmix_slug=ust-sfdc-dev-apex-vf-basics
Agile Manifesto
Tags: agile
Published: 2021-04-11 02:27:31

  **Individuals and interactions** over _processes and tools_
  **Working software** over _comprehensive documentation_
  **Customer collaboration** over _contract negotiation_
  **Responding to change** over _following a plan_

That is, while there is value in the items on
the right, we value the items on the left more.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/80d88ql94u93ak8u64cs.gif)


source: https://agilemanifesto.org
Unit testing is more important than you think
Tags: testing, jest, mocha, programming
Published: 2021-04-11 02:23:00

---
title: Unit testing is more important than you think
published: true
date: 2021-04-11 02:23:00 UTC
tags: Testing, Jest, Mocha, Programming
---

 ![Unit testing is more important than you think](https://shakil.me/content/images/2021/02/1_TOL3mutcAV7gEEnIH0DVmg.png)

The most important benefit unit testing gave me is being able to make changes without fearing things might blow up due to even a small change. The whole process of Software development is dealing with complexity where each new step creates a brand new tangle in the already existing fuck sandwich of a stack.

For smaller projects, you may get away okay without writing unit tests. But in a decent sized project with more than one developer involved, it's a must if you want to keep your sanity intact.

![Unit testing is more important than you think](https://media.giphy.com/media/MVgLEacpr9KVK172Ne/giphy.gif)

As engineers, all we do is making things that reduce human effort. So why hurt your brain thinking about whether your current changes will break another feature? leave it to the software to test. Unit testing is testing your function as a small unit of your entire app. Besides making sure your function is working properly, this practice has some beneficial side effects as well.

**Superior error handling**  
The difference between a good and bad software is that the former handles errors better. When you write code with tests in mind, you know there will be test cases that provide invalid data or invoke the function with incorrect parameters and expect it to throw certain errors. Having tests in mind will automatically force you to write better code and deal with different types of errors in proper way.

Another way it helps you handle errors better is you can copy test cases for similar features from open source projects. For example, if your code deals with http requests, you can find the test cases commonly used on network requests and add those to your code. Why reinvent the wheel?

**Better reasoning about the software**  
Test driven develoment is overall a better strategy of software development in my opinion. Thinking about your code in this approach gives a clearer picture.
Apex (SObject)
Published: 2021-04-11 02:12:19

<b>Playing with SObjects:</b>
Account acct = new Account();
acct.Name = 'Acme';
Or
Account acct = new Account(Name='Acme'); //direct initialization

<b>Generic SObject</b>:Gives flexibility in use on any salesforce object.
However specific sObject data type can reference only the Salesforce records of the same type.

sObject sobj1 = new Account(Name='Trailhead');
sObject sobj2 = new Book__c(Name='Workbook 1');
however
Account acct = new Account();

How to cast Generic sobject to specific sobject (benifit to use .notation)
// Cast a generic sObject to an Account
Account acct = (Account)myGenericSObject;
// Now, you can use the dot notation to access fields on Account
String name = acct.Name;
String phone = acct.Phone;




https://trailhead.salesforce.com/content/learn/modules/apex_database/apex_database_sobjects?trailmix_creator_id=shibua&trailmix_slug=ust-sfdc-dev-apex-vf-basics


**Apex Hammer:**Before each major service upgrade, Salesforce runs all Apex tests on your behalf through a process called Apex Hammer