teleren/devto huggingface dataset:
MongoDB Compass connection issue
Tags: mongodb, compass, database
Published: 2021-01-14 11:26:34

I am working on migration of our *Data Warehouse* project from *Alibaba Cloud* to *Huawei Cloud* this week. All goes well, except one issue occurs when I tried to connect to **MongoDB** using **MongoDB Compass Community**. 

As I have presented in my [previous post](https://dev.to/jemaloqiu/install-mongodb-with-docker-in-ubuntu-18-04-4pbi), I have deployed **MongoDB** service using **docker** and I have successfully connected to my **MongoDB** database from **IPython** console. So I firstly tried again the visit from **Ipython** today to make sure that the **MongoDB** service is still running on Huawei ECS. It IS still working well:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/inkrwaealqvcv183n10a.png)

Then I open **MongoDB Compass Community** and fill the login information as below (our domain name has not yet been authorized so I have to use Ip address for *hostname*):
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/e2uyrzwtepgxxkaao9q8.png)
However, when I click "CONNECT" button, nothing happens.

After a close investigation, I found the reason. After I filled all the fields for connection, **Compass** yielded a connection URI string as below.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/iwfcg0mb6hebayyq9lhe.png)

In fact, as explained in official manual of **MongoDB**, the standard URI syntax for connection is as `mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]`. Thus in my case, the Compass software has strangely used `ip:port` as the Database name to visit. Since there is no database with such name, so it shall do nothing and stays in the connection interface.

Now I correct the URI string manually and fill my database name into this string as below and it works:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1wez341jzvar701lbflr.png)

Once I click "CONNECT", **Compass** jumps to display interface of the queried database now:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6s8udjmskichqb0ay5id.png)
2020 in review
Published: 2021-01-14 11:21:08

Well, I've always wanted to write a year in review. In 2016 I tried writing one, only to grow cold feet and crumble under the weight of my disappointment.

Right, 2020 (writing this 14 January 2021), and after reading [this](https://dev.to/herocod3r/my-2020-year-in-review-changing-expectations-e87) I've decided to go for it.

### Income
I did some number crunching, and it would seem there's been a x3 increase (_300%_ for the large number folks_) from year start 2020. During the lockdown and the early days of the pandemic, I actually got small pay bumps. With the naira going up and down (more on this later), it's a bit difficult to actually peg this.

### Self Development and Career Growth
Well, I finally wrote production (beta) ready dotnet code with c#. I failed at picking up c# years back. So this is a very big personal achievement for me. I'm having to improve the idiomatic nature of the code, haven written javascript for so long, having to conform to standards takes some getting used to. I want to say a big thank you to Diran here, shoutout to Endurance & Godson also.

In the early parts of 2020, I was working on some legacy code, that pushed me to the brink mentally and otherwise. I'm grateful, I got some feel-good out of it, as the joy when we finally made it work felt really good. A kind of coming of age for me.

I'm not enthused by my day job anymore, every waking day is a struggle to face the laptop, open vs code and work. I think there are lots of reasons for this.
- A culmination of 2020, it felt choking at some point
- Thanks to the pandemic and guidelines, outdoor recreation became really hard to come by.
- I'm not just interested in writing front-end code anymore.

In 2021, I hope to work on more interesting, challenging stuff. Know anyone hiring for interesting backend focused roles with dotnet core, node js, (and go) stack? Hit me up. [Github](https://github.com/oneeyedsunday/) [Resume](https://drive.google.com/file/d/1I3txzkWkJse2G9q0st3ix3vKTSrwo0ED/view?usp=sharing)

### Work-Life balance
In the mud.

It did get a bit better, I like writing code, I may as well get paid for it.

### Education
Thanks to ASUU and the FG, no new feather to my cap (just) yet

### General Life Stuff
Well, I did not gain significant weight.
I moved to my place between November and December.
Made some new friends, 
Stepped out to some familial responsibility and thankfully we closed out 2020 well, despite some health challenges, and even completed some lingering projects.

The naira had me in my feels and depressed for most parts of the year (till the third quarter). Really bad watching your income decrease by 20 - 30 per cent, even worse considering I was getting raises.

I hope to write some technical stuff this year, this was a good way to get the monkey off my back. Thanks
Software Development Life Cycle (SDLC), SDLC PHASES, Importance of SDLC
Tags: beginners, testing, devops
Published: 2021-01-14 11:11:41

What is **Software Development Life Cycle (SDLC)**?

Software Development Life Cycle (SDLC) is a structured software development process that ensures the value and correctness of the built software.![Post 5](https://dev-to-uploads.s3.amazonaws.com/i/zshzgx4b1jbt6whu69q9.png)
 
_SDLC Phases_-
The SDLC process divided into the following phases:
![Post 6](https://dev-to-uploads.s3.amazonaws.com/i/khydtxn9ox3flpc6s3qf.png)

*Phase 1*:
**Requirement Analysis**: Communicating to collect and document project specifications with stakeholders and users. This phase contain requirements gathering, project initiation, estimating, scheduling, tracking, SRS documentation.

*Phase 2*:
**Design**: Building a software system architecture and element based on software requirements specification (SRS) Document. This phase contain mainly system architecture.
 
*Phase 3*:
**Coding**: Development of the software by the development team using a programming language.

*Phase 4*:
**Testing**: The software developed is thoroughly tested and any bugs found are assigned to developers to fix them.

*Phase 5*:
**Deployment**: After the product is tested, the production team preparing the software to run and live in a specific environment.

*Phase 6*:
**Maintenance**: The product is updated and maintained after it has been introduced to the market.

*Importance of the SDLC for developing a software system:*
1. It provides a framework for planning, scheduling, and estimating projects.
2. It provides a basis for a standard collection of projects and deliverables.
3. It is a tool to manage and control projects.
4. It increases project development visibility for all interested.
5. It stakeholders in the construction phase.
6. It increased and boosted the speed of development.
7. It improved connections with clients.
8. It allows you to reduce project risk and efficiency plan for project management.
Smooth Scrolling with Only 1 line of CSS (CSS Mastery)
Tags: css, html, webdev
Published: 2021-01-14 10:56:22

Smooth Scrolling with Pure CSS was not even possible until this property got revealed.

Yeah, you will see tons of tutorials out there about this single property which is **scroll-behavior: smooth**. 

**How we can use it in our project?**

It's simple and really straight forward.

**Steps are simple:**
1. We made three different sections  (Home, About, Features) and assign them IDs 
2. In the navbar we reference those IDs as #home, #about and #features.
3. Then we added our magical property in main html tag **scroll-behavior: smooth**.
4. That's it. It became smooth, try to click on home, about and features. You will see smoothness in scrolling.

**Code Available at CodePen:**
{% codepen https://codepen.io/ShanShahOfficial/pen/poEQPXV default-tab=result %}


Thanks

Video Guide Perks:
5 Tips to master CSS | Coder Champ
{% youtube oCS03fbrji4 %}
Test ALL your static pages in rails with one simple test
Tags: ruby, rails, rspec, test
Published: 2021-01-14 10:48:02

*Original of this post [on my blog](https://suchdevblog.com/guides/TestAllYourRoutesInRails.html).*

# What and why

A great friend of mine (who also happens to be a great rails developer) once told me a great trick to increase your code coverage easily. You can just write a test to check if all your GET routes return a non-errored code.

Indeed, the most important information to check about our static GET pages is to know if they are currently erroring or not. So a quick test to check if those pages are working or not is a great low-hanging fruit.

# The code itself

To be run with the RSpec framework:

```ruby
describe Rails.application.routes do
  describe '#get', type: :request do
    # This gets rails routes
    let(:routes_info) { described_class.routes }
    # this select GET routes
    let(:routes_get) { routes_info.select { |r| r.verb == 'GET' } }
    let!(:user) { create(:user) }

    specify 'GET routes returns 200, 301 or 302 code' do
      routes_get.each do |route|
        # parsing routes to a correct uri
        route = route.path.spec.to_s.gsub(/\(.:format\)*$/, '')

        # route_with_params will replace ':security_token' with a test security token
        get route_with_params(route, user)
        expect(response.status).to eq(200).or eq(301).or eq(302)
      end
    end

    def route_with_params(route, user)
      route.gsub!(':security_token', user.security_token)
    end
  end
end
```

And that's pretty much it ! As you can see, we just extract all the routes from the Rails application and check that they return a valid code.

There is but one slightly complex point: some of the routes tested might need a parameter, such as a user ID. We use the method route_with_params to inject a user ID in those routes.

Voilà, you might have gotten a great boost to your code coverage with just 20 easy lines of code!

Happy coding to all!
Not For Profit Forum With Matthew Brannelly
Tags: accountants, matthewbrannelly, strategies, business
Published: 2021-01-14 10:42:55

Matthew Brannelly is here to show you a way to more effectively connect and win more business and grow exponentially by implementing a variety of strategies including drawing on a network of accountants utilising the BSTAR NFP advisory system which utilises the Hub as a source of NFP expertise. This offer is limited to firms with the ability to add value and a unique service to the NFP Hub.
Using Accountability to Improve & Grow
Published: 2021-01-14 10:40:07

I was speaking to a friend of mine last week about how I struggle with writing. It takes a lot of time and energy, more than pretty much anything else I do. Even after putting the hours in, the end result still isn't great. It got me thinking. **Why avoid it?**

I also struggle with reading, but since starting dailydevlinks and reading 3-5 articles almost daily, it has become easier. Still not a cakewalk by any means, _but definitely easier_.

So I thought to myself, why not take the same approach with writing? By creating more valuable content for people, I can become a better writer.

The next step was _action_ how could I improve and grow, but keep myself accountable? This part for me was an easy decision. Change the format of the dailydevlinks newsletter, and every week I'd make sure to write something insightful while increasing my writing skills.

The new format looks a little like this:

* Pick 3-5 of the articles I read that week that I found the most interesting & write about why I found them interesting and how they might be interesting to others.
* A "Growth, Goals, Wins & Failures" where I will go over a few stats about dailydevlinks, things I've learnt & done along the way. Even the fails that I've learnt something valuable from.
* A community section that gives a little overview of what is going on in the Slack Community.

I go into some more depth in this newsletter: [📈 Growth, Goals, Wins & Failures](https://mailchi.mp/c51fa1f2bd83/growth-goals-wins-failures)

If you're interested in following along make sure to [**subscribe to the weekly newsletter**](https://dailydevlinks.com/).
Every new day I have this error : failed to open stream: Permission denied
Published: 2021-01-14 10:24:26

Hello , 

I have this error 

````
The stream or file "/data/www/site.com/storage/logs/laravel-2021-01-14.log" could not be opened in append mode: failed to open stream: Permission denied
````

`````

-rw-r--r-- 1 root        root       30833 Jan 14 09:00 laravel-2021-01-14.log

`````


When I change the directory permission it works BUT after one day I got the same error again!
Don’t call us, we’ll call you: Automate delivery workflows with webhooks
Tags: devops, kubernetes, programming
Published: 2021-01-14 10:22:52

🗣🗣 Announcing Humanitec's new feature "Webhooks" and a webinar on automating delivery workflows on Kubernetes. 🗣🗣

Super excited to announce that we’re shipping webhooks for optimizing your continuous delivery workflows when you are building your Internal Developer Platform.

👨‍🌾 Users can set up webhooks to notify other tools and systems when an event happens in their Humanitec organisation, such as the start or completion of a deployment. The actions could be as simple as posting a Slack message or as complex as running a suite of integration tests or initializing data.

🦴 Check it out in our docs-site or join this webinar and we show you hands-on! Link to the webinar in the comments.

Check the announcement: https://humanitec.com/blog/webhooks
Let me show it to you: https://humanitec.com/webinars/automating-delivery-workflows
Sign up for a free trial: https://humanitec.com/lp/request-a-free-trial
Why do many Javascript libraries or documentations keep using callback, var, == or function keywords?
Tags: discuss, javascript, node, webdev
Published: 2021-01-14 10:19:55

Despite being recently updated. Without support for arrow functions, of course.

Or, the authors are experienced and immune to callback hell? No, the libraries aren't for noobs.

They are just being experienced with the old ways, and wouldn't create bugs, anyways.
How to Place Virtual Artwork on your Wall in 15 Minutes or Less
Tags: augmentedreality, art, tutorial, beginners
Published: 2021-01-14 10:15:19

Always wanted to add some artwork to your wall but found it to be too expensive? Try adding virtual artwork instead! This is a demo iOS app that allows users to add a picture from their camera roll to a vertical plane (like a wall!). The pictures are added with a picture frame, which is a 3D model brought in from echoAR. The full demo can also be found on echoAR’s [GitHub] (https://github.com/echoARxyz/iOS-ARKit-demo-Wall-Art).

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zx51jfcgkz1f3ze8e8pa.gif)

**Register**
Don’t have an API key? Make sure to register for FREE at [echoAR] (https://console.echoar.xyz/#/auth/register).

**Setup**
* Clone this project and open in Xcode
* Set your echoAR API key in the EchoAR.swift file
*Add a picture frame model to the echoAR console (you can search and find one on the platform itself)
* Note: this demo is using a mirror 3D model as its picture frame
* Add the entry id of your picture frame model, to the ViewController.swift file

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cumoweeqadnnwigvrgvx.png)

**Run**
* [Build and run the AR Application] (https://docs.echoar.xyz/swift/adding-ar-capabilities)
* Make sure your signing and capabilities are correctly configured so you can run on device.
* Connect your device to your computer (unlock it)
* Select your device, and build and run.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/j9o9917bvt0uwwophg99.png)


**Learn more**
Refer to our [documentation] (https://docs.echoar.xyz/swift/installation) to learn more about how to use Swift and echoAR.

**Support**
Feel free to reach out at support@echoAR.xyz or join our [support channel on Slack] (https://app.slack.com/client/TENTAKZ7V/G01AV799NLR).

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/j10rn2rfgvk5wabav7ug.png)

Demo created by [Daye Jack] (https://github.com/ddj231/).

-----
**echoAR** (http://www.echoAR.xyz; Techstars ’19) is a cloud platform for augmented reality (AR) and virtual reality (VR) that provides tools and server-side infrastructure to help developers & companies quickly build and deploy AR/VR apps and experiences.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zb8jadu0uid8y4vr9rr0.png)
Working with GIT
Tags: git, github, vscode, javascript
Published: 2021-01-14 10:11:07

Git is a powerful feature to help you keep version control of your files. 

As a developer, just as with everything, you want to make sure you get adequate information regarding a command before using it.

So, my experience using git on VSCode brought about this writeup. 

Inasmuch as I was able to rectify the issue, this is one mistake I don't want to make with a gigantic codebase containing thousands of files. It can cause nightmares to be honest.

So, I had been writing codes and pushing them to my repo on GitHub, then, I had the need to rename some of the files, this caused me to keep getting some errors on my git CLI each time I ran the command 
```
git status
```
I felt the need to sync all changes with my origin(git Repo).

**Roadblock 1:** I was able to use ```git rm file1.js``` and this worked fine, but I had a file named try&catch.js which I couldn't remove because git treated the & in the name differently.


**Roadblock 2:** In the course of only trying to remove the file which I wanted to be deleted, I did ```git rm *``` and this removed all my files from my VSCode.

I was in shock as I didn't know what to do next.

**The solution to Roadblock1:** As you may have guessed that I changed the naming convention to something else, well that would have worked also, but I didn't do that. 

What I did was implemented the escape syntax before the & sign in the name so My git code was ```git rm try\&catch.js``` and this worked awesomely!

**The solution to Roadblock2:** I used ```git reset``` and then ```git ls-files -d -z | xargs -0 git checkout --``` and this restored back all my files for me.


I have never been more disturbed with the tremendous work and documentations I have been pushing all this while to my repo only to have it wiped out with a single mistake.

I hope you learn from my experience. I would share more of my coding journey and how I am able to master JavaScript by practicing, teaching, and most importantly pushing my codes and writeups to my GitHub using the GitHub commands.

These are the things you would be doing the most as a developer.

Like, share, Upvote, and give your honest feedback to help me create better content for you.

You can also support me as a developer so I can spend more quality time providing you with awesome content that would help you become a better developer.

You can now buy me a coffee: https://www.buymeacoffee.com/WebtekMasters
Integrating Native Android Fragments into React Native
Tags: android, reactnative, startup, mobile
Published: 2021-01-14 09:46:53

Need to integrate 3rd party SDK that uses Android Fragments with React Native? 

Check the tutorial below.

{% medium https://stefanmajiros.medium.com/integration-of-native-android-fragments-and-views-into-react-native-a4156621543b %}
Why are C and C++ slow to build?
Tags: discuss, c, go, computerscience
Published: 2021-01-14 09:45:51

[Originally asked in Quora.](https://www.quora.com/Why-are-C-and-C-slow-to-build)

Rather, compared to Golang, why is pure Golang fast to build (in the matter of seconds), despite compiled?

Actually, any libraries in any languages (e.g. Python, Node.js, R, LaTeX, even Golang), that involves binding for C or C++, can be excruciating slow to compile, if not bundled with binary or precompiled. (I have seen an R library built in 20 minutes. Also, ConTeXt is very slow to build.)

[go-sqlite3](https://github.com/mattn/go-sqlite3) when changing tags or CGO_CFLAGS even a little bit, will be slow to compile (in a matter of a few minutes).

And, not only C and C++. Java and Scala, amongst compiled languages, can be very slow to compiled as well.
What are you guys doing with Schrems-II?
Tags: privacy
Published: 2021-01-14 09:40:53

Hi guys,

The ruling by the Court of Justice of the EU (CJEU) on 16 July 2020 in the so-called 'Schrems II' case has significant implications for the transfer of personal data outside of the European Economic Area (EEA).

What are you doing with this?

Self-promotion:

I run a free privacy training for startup founders and architects:
https://basebunker.com/
Today I Learned: Searching Inside a Sorted Matrix
Tags: python, algorithms, webdev, beginners
Published: 2021-01-14 09:40:32

# Problem Statement
Write a function that takes in a sorted matrix of unique integers and a target integer, and returns an array of row and column indices of the target integer. Return [-1, -1] if the target integer is not found. The matrix could have a different height and width. 

# Sample Input
```
matrix = [
            [1, 4, 7, 12, 15, 1000],
            [2, 5, 19, 31, 32, 1001],
            [3, 8, 24, 33, 35, 1002],
            [40, 41, 42, 44, 45, 1003],
            [99, 100, 103, 106, 128, 1004],
        ]
target = 44
```

# Sample Result

```
[3, 3]
```

# Code #1

```python
def search_in_sorted_matrix(matrix, target):
    ptr_row = 0
    ptr_col = len(matrix[0]) - 1
    while ptr_row > -1 and ptr_col > -1 and ptr_row < len(matrix) and ptr_col < len(matrix[0]):
        if target > matrix[ptr_row][ptr_col]:
            ptr_row += 1
        elif target < matrix[ptr_row][ptr_col]:
            ptr_col -= 1
        else:
            return [ptr_row, ptr_col]

    return [-1, -1]

```

# Notes
* Try starting the search from the top-right corner of the matrix, then increment or decrement the row or column indices appropriately. 

# Credits
* Algoexpert for the problem statement
* XKCD for the cover image
Synaptic package manager in Linux infographics basic Linux tools guide part 3
Tags: linux, programming, tutorial
Published: 2021-01-14 09:40:22

# What is the Synaptic Package Manager
Synaptic is a popular graphical package manager for new as well as pro users for managing apps/software. It provides an easy UI with search filters for searching software and allows easy software installation. It also selects and installs dependencies automatically for selected packages. Also helps to solve issues like broken packages.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cwswr1icimoy0uydrhof.png)

## How to install Synaptic Package Manager

1. Using Apt Tool. Enter below command

`sudo apt install synaptic`

2. From Deb Package

`Link to downloads https://pkgs.org/download/synaptic`

## Uses of Synaptic Package Manager

Synaptic has multiple use case like :
1. For installing packages that are not already available in a system
2. Updating installed packages in Linux
3. Removal of packages completely from the system
4. To fix broken packages and dependencies
5. Searching packages by filters like name, type
6. To list all packages by status like installed, to be installed.
7. To add/remove software repositories for packages not available already.

# Related Terms

Some terms related to Synaptic package manager in Linux

### DEB
DEB is short for Debian package format which is used to install packages in Debian based OS like Ubuntu, Debian, Mint. Anyone can download and install a package using a Deb package.

### Repository
A source where package related code is hosted on. Let say I want to install a package, so first, I need to add that repository where software can be downloaded from. Repository or repo as short can be added by apt/synaptic, they can be public as well as private.

### Broken Packages
A package let say vlc requires many other video libraries for data processing and streaming. Sometimes there is a dependency that can not be found or installed. so a package is said to be broken. Another cause may be because an incompatible version of dependencies installed.

So, this is all for now. Share your views in the comments below and keep visiting back for more updates coming next. Thanks for reading.