Posts

Showing posts from November, 2020

Examples of Heuristics in Computer Science

Image
The post Examples of Heuristics in Computer Science first appeared on Qvault . Heuristics in computer science and artificial intelligence are “rules of thumb” that are used in algorithms to assist in finding approximate solutions for complex problems. Often, there is simply too much data to sift through in order to come to a solution in a timely manner, and so, a heuristic algorithm is used to trade exactness for speed. However, because heuristics are based on individual rules unique to the problem they are solving, the specifics of the heuristics vary from problem to problem. Example problems and their heuristics are given below. Traveling Salesperson Problem (TSP) The TSP is a famous algorithm with a Big-O of O(n!) and asks the question: Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city? For a low number of cities, this question could be reasonably brute-forced. Ho

How to Create a Custom Checkbox Form in Vue

Image
The post How to Create a Custom Checkbox Form in Vue first appeared on Qvault . You have a problem. The browser’s default checkbox form is ugly and outdated, but importing an entire library just to change the styling seems like overkill. Instead, let’s build a custom checkbox form component from scratch. It will take 15 minutes to type up, or just 3 if you just copy and paste my boilerplate code. Before we dive into how it works, you can see a live demo here , or you can see how we are using it in production on the signup flow of Qvault’s coding courses platform. How to make other custom Vue components Before we move on, if you are looking for our other custom Vue.js components tutorials you can find them here: Custom select component in Vue Custom tooltip component In Vue Custom toggle switch component in Vue Custom slider component in Vue The HTML <template> <div> <div class="checkbox-form"> <div class="answers"&g

How to Make a Custom Slider Component in Vue

Image
The post How to Make a Custom Slider Component in Vue first appeared on Qvault . Creating a custom slider component can be tricky, especially if you want to create a lean standalone Vue component. In this quick article, you’ll learn how to build a fully customizable slider component in Vue. Feel free to swap out the majority of the CSS to get the styling you want, but I’ll give you a good jumping-off point. In fact, the component we’ll be building is the exact same component that we use in production, and you can see it in action in the signup workflow for our coding courses . You can see a full demo on codesandbox here . If you’re like me, you prefer to build your own lightweight UI components, rather than import a bloaty library that you don’t have the ability to modify and change easily. The HTML <template> <div> <div class="slider-component"> <div class="slidecontainer"> <input ref="input"

Writing Good Unit Tests; Don’t Mock Database Connections

Image
The post Writing Good Unit Tests; Don’t Mock Database Connections first appeared on Qvault . Unit tests are unbelievably important to us as developers because they allow us to demonstrate the correctness of the code we’ve written. More importantly, unit tests allow us to make updates to our code base with the confidence that we haven’t broken anything. In our eagerness to get 100% code coverage, however, we often write tests for logic that perhaps we have no business testing. I’m here to assert that creating mock database abstractions in order to write unit tests is a bad idea almost all of the time. At Qvault we have a Postgres database running behind a RESTful Go API server, but we do our best to write small testable functions so that we don’t need to write useless mocks. That kind of code dirties the repository, adds unnecessary abstractions that make the code harder to understand, and doesn’t add any value to the robustness of the test suite. What Is a Unit Test? In compute

Why So Many Coding Students Struggle Getting a Job After Coding Bootcamp

Image
The post Why So Many Coding Students Struggle Getting a Job After Coding Bootcamp first appeared on Qvault . Imagine, like so many folks, that you decide what you want to study when you’re just 18. You go to college, finish a four-year degree in mechanical engineering, and then realize what you actually want to do is get a job in coding. There are tons of benefits – pay, flexibility, personal satisfaction. It’s a no brainer. There’s just one problem. The last thing you want to do is go back to school for another two or four very expensive years. After reading a bit online, you see that a possible route for you is getting a job after coding bootcamp. It seems like a sweet deal – you pay a fraction of typical college tuition and then are on your way to getting a coding job with no experience or degree. There’s just one problem: the path of getting a job after coding bootcamp leaves you really underprepared a for the programming job market. “We see more and more students coming to Qv

Comprehensive Guide to Learn Computer Science Online

Image
The post Comprehensive Guide to Learn Computer Science Online first appeared on Qvault . Self-taught developers and Bootcamp graduates often have a hard time finding employment because they skipped learning computer science fundamentals and jumped right into application code. Taking such a haphazard approach to a programming education would be similar to skipping biology classes and just doing a three-week crash course in surgery. Luckily, it’s possible to get a state-of-the-art computer science education without breaking the bank, and it can be done completely online. How to Get Started – The Short Answer There are several main topics studied by computer science students at Universities across the world. Some of these topics we’ll consider “required”, and some will be “elective” or “optional”. Take a look at the list below for an overview, you should study these topics, roughly in the order presented. Study These Computer Science Topics – Required Coding Computer Architectur

Should You Commit the Vendor Folder in Go?

Image
The post Should You Commit the Vendor Folder in Go? first appeared on Qvault . The answer to the age-old question of, “ should I commit the vendor dependencies in my Go project to source control? ” is “ almost always “. As an FYI, we here at Qvault use Go for all of our backend work, and we always commit our vendor folders. Let’s take a look at the reasoning behind my claim that committing dependencies is ideal. What Is the Vendor Folder? If you are coming from Node.js land, Golang’s vendor folder is basically the same as Node’s node_modules . It is a folder found at the root of a module that stores a copy of all the code the module depends on. The code is used to compile the final executable when the go build command is run. As you can imagine, at the heart of the “ should we commit vendor? ” discussion is the problem of repo size. node_modules is infamous for its large size. As a result, conventional wisdom in the Node community is to add node_modules to the .gitignore

Top 12 Best Communities For Learning to Code

Image
The post Top 12 Best Communities For Learning to Code first appeared on Qvault . Programming communities are so valuable because the life of a programmer can be isolated, especially if you opt to work as a freelancer or in a remote-first position. Even if you don’t have a solitary position, getting in touch with other programmers can make it much easier to improve your own skills and learn about new and exciting projects and technologies in the works. Luckily, there are a ton of amazing communities out there dedicated to helping novice programmers improve their skills, meet like-minded devs, and efficiently network with other experienced professionals. 1. Top Coding Subreddits Reddit is a massive community that touches on virtually all topics. It boasts thousands of sub-communities called subreddits, so finding a place to have endless conversations about niche programming activities is quite easy to do. Even though the site is fairly anonymous, networking can be done easily via