teleren/devto huggingface dataset:
Rust/Diesel: Fixing issues with setup
Tags: rust, diesel
Published: 2020-07-29 12:34:47

Hello There!. This is my first ever blog post. 

Very recently, I have started exploring Rust language and I already have so much fun learning this language. 

I was trying to do some basic database CRUD implementations in Rust and as you know, most famous framework for the same is Diesel .

Since I faced lots of issues while setting up Diesel on my local machine, I thought of putting it as blog post so that, it can be of useful to someone who will face similar issues of mine.

For your information, I am using Windows 10 operating system (64-bit) and Rust v1.45.0.

In case if you have not installed Rust with Visual C++ build tools , when you're trying to install Diesel framework, you may get some errors related to Linker.exe. It is better to install latest version of [Microsoft Visual C++ build tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) first and then re-install Rust on your computer.

Installing Diesel framework is a 2-step process.

#### Step 1: Install Diesel using CARGO

```rust
cargo install diesel
```

As of writing of this post, Diesel supports `MySQL, Postgres and SQLite`. The above command expects all the client tools pre-exists on your computer.

If you have one of the client tools, you can use following command

```rust
cargo install diesel --no-default-features --features mysql postgres sqlite
```

In my case, i am having Postgres so, i tried with 

```rust
cargo install diesel --no-default-features --features postgres
```

Initially, when i try the above command, I was getting following error

```
error: diesel = note: link : fatal error lnk1181: cannot open input file 'libpq.lib'
```

After spending few minutes on google, I figured out, i need to setup environment variable named `PQ_LIB_DIR` mapped to `lib` directory of Postgres installation folder. 

In my computer, I have Postgres installed on `C:\Program Files\Postgres\12\`. So, I setup `PQ_LIB_DIR` as `C:\Program Files\Postgres\12\lib`. 

Due to spaces in the folder name, `cargo install diesel` threw me error message. So, I had to correct it like `c:/Program Files/Postgres/12/lib` to solve the first level of issue.

#### Step 2: Setting up Diesel

To setup Diesel, we need run following command

```rust
diesel setup
``` 

It throws me following error:

```
The code execution cannot proceed because libpq.dll was not found.
```

Even though, I had added `PQ_LIB_DIR` environment variable, I got the above error. After a little search, I found out that, `diesel` is not able to find the libpq.dll from folders listed under `PATH` variable. After added `PQ_LIB_DIR` to `PATH` variable, that error was gone.

Then, I was getting another error:

```
The code execution cannot proceed because libssl-1_1-x64.dll was not found.
```

This dll file is shipped alongwith postgres and it can be found under BIN folder. After I have added Postgres' BIN folder to `PATH` variable, `diesel` setup was completed successfully.

Hope you find the above post useful. Please share your feedback in case if i miss any other points.

Happy reading!!!
Git Repository - Main
Published: 2020-07-29 13:38:12

## Global config (2.28)


```bash
git config --global init.defaultBranch main
```

## Git Version

```bash
git --version
```

## Updating git on Mac via Brew

```
brew update && brew upgrade git
```





References:
https://github.blog/2020-07-27-highlights-from-git-2-28/
https://twitter.com/georgeguimaraes/status/1288177684468715526
How important is a software specification/requirement document?
Tags: discuss
Published: 2020-07-29 13:35:27

Errors in development are usually summed up as syntactic or semantic. Semantic (related to logic/understanding) is more subtle and more difficult to debug because it rarely throws out a glaring exception as would a syntactic error. There are significant issues with customers definition of problems, scope, and functionality. This leads to a different type of semantic error in my opinion. Imagine writing tests that eventually pass after long hours put in, only to show a client and realise that he/she meant something else. Well, so how important is a specification document? Also Agile seems to facilitate bootstrapping based on significantly less information than traditional methods. What is your opinion?
Top Kubernetes Interview Questions
Published: 2020-07-29 13:33:09

Q1. What is Kubernetes?

Ans: Kubernetes is an open-source container orchestration system for deploying, scaling, and managing the automated application. It offers an excellent community and works with all cloud providers. Hence, it is a multi-container management solution.

Q2. What is a container?

Ans: Containers are a technology for collecting the compiled code for an application when it is required at run-time. Each container allows you to run repeatable, standard dependencies and the same behaviour whenever the container runs. It divides the application from the underlying host infrastructure to make the deployment much easier in cloud or OS platforms.

Q3. What are the nodes that run inside the Kubernetes?

Ans: A node is a worker machine or VM depending on the cluster. Each node contains services to run the pods and the pods are managed by the master components.

Q4. What are the services that a node gives and their responsibilities? 

Ans: The services that include in a node is as follows:

Container run-time
Kubelet
Kube-proxy
The Container run-time is responsible to start and manage the containers. The kubelet is responsible for running the state of each node and receives commands from the master to work on it and it is also responsible for the metric collection of pods. The Kube-proxy is a component that manages the subnets and makes services available for all other components.

For More Info Visit: https://mindmajix.com/kubernetes-interview-questions
An example of a Golang-based monorepo
Tags: go, monorepo, bash, makefile
Published: 2020-07-29 13:20:17

Planning to use a monorepo to structure your Go codes but not quite keen on the complexity of [Bazel](https://bazel.build/)? You might want to check out:

{% github flowerinthenight/golang-monorepo %}

It uses Bash scripts, Makefiles, and the go tools to determine what binaries to build based on commit changes. You might find this useful.
12 Web design trends 2020
Tags: webdev, design, css, html
Published: 2020-07-29 13:03:00

Web designing trends are one of the most crucial parts of marketing and branding a perception of your brand. The modern web designs are moreover technology and data-driven rather than just being creativity-driven. The designs that can be built at the lowest possible cost with modern web designing tools and frameworks which also facilitates better user experience along with high conversion rates are preferred.

##[list of our top 12 best web designing trends in 2020](https://www.decipherzone.com/blog-detail/top-best-web-designing-trends-2020)
*Dark Mode
*Solid Color Blocks
*Solid Colored Frames
*Split Screen
*Overlapping Layers
*Interactive 3-D Elements
*Collage of photography with animation
*Vibrant Color Schemes
*Interactive Cursor animations
*Color Psychology
*Easy to modify web designs
*Minimalistic header & navigation

1. Dark Mode
Dark mode web designs have huge demand these days due to power-saving capabilities and ease in working on computers for extended hours. The LED and OLED screens are designed in such a way that they offer great visibility in dark scenes and save a huge power which becomes a competitive advantage for battery-operated devices

2. Solid Color Blocks
The array of solid color blocks is used in places where you want to represent multiple ideas clearly at one place which is contrary to collage where different ideas cascade into each other and have a common relevancy intersection. While creating these blogs try to pick vibrant colors for blocks and lines with fewer words to represent your idea that will provide great user experience and better conversion rate.

**Read the full article here: https://www.decipherzone.com/blog-detail/top-best-web-designing-trends-2020**
Intro To Ruby Procs and Lambdas(and the difference)
Tags: beginners, ruby
Published: 2020-07-29 12:54:21

#Intro
In this post I'll be getting into some of the key parts of Ruby, lambdas and procs. I'll also get into the main differences between them, and how to use either properly.

#What are Lambdas?
>Lambdas, what the hell is that?

This might be difficult to grasp, and I'm also not the best at explaining, but lambdas are basically small scale functions, that behave like methods. Kind of.

>I don't get it.

Okay, a lambda is a block of code that is assigned to a variable. Lambdas *require* all input/parameters functions do to work, so without them Ruby will return an error. Lambdas are assigned(usually) to a variable, this makes them executable only when the variables value is called. Here's an example:
```Ruby
squared = lambda {|x| x**2}# or {|x| x*x}
[1, 2, 3, 4, 7].map(&squared)
#=> [1, 4, 9, 16, 49]
```
>What happened?

Basically, I used the & to reference `squared` and map called it on each item of the list to create a new list. Its values are `[1, 4, 9, 16, 49]`.

That's pretty much the basics for writing lambdas, but, of course there's more. We'll get into them a bit later.

#Procs
>You mean **Crocs**. Like these ones.
![Image of white crocs.](https://s7d5.scene7.com/is/image/UrbanOutfitters/49085640_010_b?$xlarge$&fit=constrain&qlt=80&wid=683)

####NO!
Procs are an essential part of Ruby. Senior and Junior Ruby developers alike should know how to use Procs. Procs are from the builtin "Proc" class in Ruby. They're blocks of code assigned to a variable. 
>How do I use a Proc?

Simple here's an example:
```Ruby
myProc = Proc.new {=begin Random block to later be executed =end}
```

>Okay that doesn't look too confusing. But what's the difference between a Proc and a Lambda, other than syntax.

It's actually on the surface, there isn't one. They can be used to do the exact same job almost all the time. There's one small difference that I'd like to note though. Lambdas, which mind you are still nameless functions, aren't evaluated until they're called. But Procs are a class type so they're evaluated immediately. Let's use a simple example so you understand what that means for your code.

####With a Proc
```Ruby
def myFunc()
   myBlock = Proc.new {return "Hello"}
   return "#{myBlock} World!"
end
```

####With a Lambda
```Ruby
def myFunc()
   myBlock = lambda {return "Hello"}
   return "#{myBlock} World!"
end
```

If you haven't already noticed with the Proc the intended output never got returned. Since it was evaluated before it was called returning "Hello" ended the function, meaning the next line was never called. With the lambda that doesn't happen because Ruby skips it until it's later called by the return statement at the end of the function. Giving us "Hello World!", the intended output. This is kind of contrived but it's a difference worth pointing out. So having a return statement or any hard coded out put in a Proc is a bad idea.

That's that folks. :smile:!!!
Learn the basics of GraphQL and Build a Full Stack App using React at Front-End
Tags: javascript, react, graphql, beginners
Published: 2020-07-29 12:45:11

In these three-part series, you will learn GraphQL from scratch and then build a complete Full Stack Application using MongoDB + GraphQL + React + Node.js stack.

{% medium https://levelup.gitconnected.com/learn-the-basics-of-graphql-4740d76d5e8a?source=friends_link&sk=e9880f30dcce3dcaf2d555ecfc5d5e11 %}

<br /><br /><br />

You can find complete GitHub source code for the entire application [HERE](https://github.com/myogeshchavan97/graphql-fullstack-app)


**Don't forget to subscribe to get my weekly newsletter with amazing tips, tricks and articles directly in your inbox [here](https://yogeshchavan.dev).**

[<img src="https://cdn.buymeacoffee.com/buttons/default-yellow.png" >](https://www.buymeacoffee.com/myogeshchavan97)
React Native
Published: 2020-07-29 12:21:11

## Some Stones Catch Along the Ride

### Image not Showing

```
cd android/app/src/main/res/ && rm -rf drawable-*/src_assets_images_*.png drawable-*/node_modules_*.png
```

### Task :react-native-{lib}:compileDebugJavaWithJavac

```
> Task :react-native-firebase:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-firebase:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
```

#### This is a AndroidX issue, workaround to fix

```
cp -n app/android/gradle.properties app/node_modules/react-native-{lib}/android/gradle.properties
```

#### Change those two values to false and reply to broken libs

```
cp -n app/node_modules/react-native-{lib}/android/gradle.properties app/node_modules/react-native-{lib}/android/gradle.properties
```
GIT Tips
Published: 2020-07-29 12:12:21

### Naming Branches

<https://stackoverflow.com/questions/273695/what-are-some-examples-of-commonly-used-practices-for-naming-git-branches>

### Removing Untrack Files

```
git clean -d -n
git clean -d -f
```

[font](https://linuxize.com/post/how-to-remove-untracked-files-in-git/)
Heroku
Published: 2020-07-29 12:11:23

<https://devcenter.heroku.com/articles/pipelines>

### Cleaning repository

```
heroku plugins:install heroku-repo
heroku repo:reset
```

### Adding repository

```
git remote add staging https://git.heroku.com/staging-app.git
git remote add heroku https://git.heroku.com/app.git
```
What is hack the box?
Tags: hacking
Published: 2020-07-29 12:08:52

This is a tool for hacking and hacker. This is a tool not only for hackers but also students that are learning hacking. 

#So what is hack the box?
As some of you might have guessed, it's a place where you hack. So hack the box gives a machines with problems for you to go ahead hack them. They go so far that to sign up you must hack the website (if you count inspecting a website hacking. but there is a little bit more to it)in a way to sign up.

#Should you use hack the box?
Yes you should use hack the box you can like really get into it and it's fun when you get the hang of it. And a great place to practice and try out your skills. Plus this will remove the need for you to buy or build another computer with problems to hack into.

Disclaimer: Do not just go to hack the box without any knowledge and try and hack that will ruin the experience for you.
Clojure JVM tooling overview?
Tags: help, clojure, java, tooling
Published: 2020-07-29 12:08:02

I am interested in playing with ClojureScript for a personal project. And server-side or desktop Clojure in the future. Only problem is that I feel a bit overwhelmed when approaching the platform. I see a **lot** of tools mentioned. And their names usually provide little clue as to what they are supposed to do. Then I have no idea if what I'm reading is still current or if another tool for that job has since become dominant.

_By the same token, I can totally understand why .NET platform is hard for people to get into. It has similar discoverability issues. But ultimately some of the decisions are simpler -- e.g. for a web server, just use Kestrel._

So if anyone is in the know about the current state of affairs on the platform, I would appreciate an overview.
Daily Developer Jokes - Wednesday, Jul 29, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-07-29 12:00:18

---
title: "Daily Developer Jokes - Wednesday, Jul 29, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Wednesday%2C%20Jul%2029%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258b924543.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
A programmer's significant other tells them, "Run to the store and pick up a loaf of bread. If they have eggs, get a dozen."

The programmer comes home with 12 loaves of bread.
 -->
How do you stay motivated to work on side project ?
Tags: discuss
Published: 2020-07-29 11:55:52

I have a full time job as a full-stack developer. Since covid-19 pandemic, i'm working from home. So i got more spare time and i decided to rebuild my own blog <a href="https://www.devaradise.com">devaradise.com</a>.

I wrote some tutorials there and published them weekly. But sometime, i'm feeling unmotivated to write even when i have some topics in mind.

So, i just want to know if there is anyone who feel like me. How do you stay motivated for your side project? It doesn't have to be a blog. It can be an open source project, a startup project, or anything.
A brief introduction to microservices
Tags: docker, microservices, kubernetes
Published: 2020-07-29 11:52:47


Microservices architecture is really popular these days.
Running a collection of single-purpose programs benefits the whole application. This article gives you a brief overview of microservices architecture.

This makes the application:

- Loosely coupled
- Easily maintainable
- Independently deployable

They usually communicate with each other with APIs through HTTP.
Think of microservices as many workers with really specific job scope that comes together to form the application.

## Application

First, we'll have to write our application. There are a few frameworks that are suitable for writing microservices in many languages, so pick any you're comfortable with.

- Java
  - [Spring Boot](https://spring.io/projects/spring-boot)
  - [Spark](http://sparkjava.com/)
- Python
  - [Flask](https://flask.palletsprojects.com/en/1.1.x/)
  - [Bottle](https://bottlepy.org/docs/dev/)

The common attribute in frameworks is that they are slim and lightweight.

## Containers

Microservices usually runs in containers and a container orchestration platform.
One of the more popular containerisation and orchestration platforms would be [Docker](https://www.docker.com/), and [Kubernetes](https://kubernetes.io/).

Containers are self-contained images that include all dependencies that your service needs to run. These include your OS, web server, and your code that runs on the webserver. This image is built by Docker and uploaded to an image repository of your choice.
(See [Dockerhub](https://hub.docker.com/) or [AWS ECR](https://aws.amazon.com/ecr/))

Having multiple services means multiple container images to run. Kubernetes makes running these images easier by automating the deployment and scaling of these containers.

## Container Orchestration

By putting multiple pods together, it forms a cluster. Kubernetes runs clusters of pods. Pods consist of various containers.

Putting this in context, for example, you have an e-commerce application, designed in a microservices architecture.

- Cart
- Products
- User
- Tracking

Each of these is a container image running in the pods of a Kubernetes cluster.

The scalability of Kubernetes comes in when you specify e.g. "Cart" with very high traffic, to be able to scale to 5 more replicas. Kubernetes will measure the resource usage of "Cart", and if it hits a certain percentage, it spins up more instance of this "Cart" container in the same pod to share the load.

## Conclusion

With the application running in containers, which runs in the pods of Kubernetes, we now have a collection of services that runs specific jobs that can communicate with one another within the service cluster.

There will be a guide on how to containerise your service, deploy it, and run in Kubernetes.
4th Day on the wagon
Tags: html, css
Published: 2020-07-29 11:40:59

Started with the introduction to CSS folder yesterday and I had a good run through the folder. Read all the attached articles and followed dutifully through the classes. Then came the time for an exercise project.

Great start until I had to /* Give both p's inside the 3rd div a pink background*/
Pretty easy… so I thought… found out after 18 hours of intermittent attempts (I reluctantly went to watch the solution video for the answer though. I must confess).
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8i23j6mgta08j1hi57vq.JPG)

My first thought was _div:nth-child(3) {background: pink}_

This apparently only gave all third items in a div pink background. I combed through the [article] (https://code.tutsplus.com/tutorials/the-30-css-selectors-you-must-memorize--net-16048) looking for a way out. Went through a host of other articles on MDN and StackOverflow but couldn't figure out a way to do this simple task. 

The problem with my approach was SYNTAX. I assumed that the nth-child was the nth-of-type. So, it didn't really matter how much I read until the solution video pointed out that flaw in reasoning, it would almost always have eluded me.

I found the other tasks easier because by then I had read a lot about selectors and seeing what was done in the solution video. I was better prepared to tackle them. I even answered one of the questions differently and better than what the solution video did.

The moral of my story is this:
**It's alright to ask for help**. Many learners like myself, are eager to learn, so much so, we put pressure on ourselves to retain a lot of information within a short period of time.
Cheating in the traditional sense of it in a learning environment is allowed. In fact, **it is important**. It's how you can cover ground and get better faster. You don't have to always learn from your own mistake. You learn what to do and what not to do from watching others' work.
**This is not to excuse you from trying things out yourself.** Just don't spend more time trying to solve a problem that has already been solved.

:)
Ruby
PST Repair Software to Recover Corrupted Outlook PST Files
Tags: pstrecovery, pstrepairtool, outlookpstrepair
Published: 2020-07-29 11:33:56


Here is a best tool Outlook PST Recovery that can easily Recover your corrupted Outlook PST files and Recover deleted PST file data with all emails items. this software also allows user to save Recovered PST file into many other file formats like: MBOX, EML, MSG, EMLX, vCal and vCard format. with this application you can migrate your PST file into Office 365 Account and Live Exchange Server. this software easily supports all the versions of MS Outlook and Windows OS.

Download this software free demo version from here: http://www.pstrepair.emltopstsoftware.com/
How to fix problems with Outlook .pst?
Tags: pstrecovery, repairpstfiles, pstrepairtool, outlookpstrecovery
Published: 2020-07-29 11:33:03


If your PST file got corrupted then you can try this Regaintechnologies Outlook PST Recovery tool that helps user to fix problems with Outlook PST and also Recover lost or deleted PST file data. This Software is designed with GUI Interface where you can easily fix corrupted files data of Outlook PST file such as emails, calendar, notes, and task etc. This Software shows the preview of all emails items before the Recovery. you can also try this software free trial version at free of cost.

Try this software free trial version from here: https://www.regaintechnologies.com/pst-recovery.html