Pro Tips

Recruitment metrics
For Employers Pro Tips

Top Eight Recruitment Metrics You Should Track in 2022

HR professionals can leverage these recruitment metrics and data analytics to attract talent and devise strategies to increase employee retention rates

With the ever-increasing demand for hiring the best talent faster and efficiently, HR managers and recruitment teams are shifting towards data-driven recruitment for optimizing their hiring process. Recruitment metrics are an integral part of data-driven recruitment and help evaluate the health and effectiveness of the hiring process. 

HR professionals can leverage these metrics and data analytics to attract talent and devise strategies to increase employee retention rates. 

Recruitment metrics also assist talent acquisition teams in increasing business value and enabling strategic workforce planning.

Here are the top eight recruitment metrics you should track to make informed hiring decisions in this post.

Let’s get started!

Time to fill

This is one of the crucial recruitment metrics that allows HR managers to see how long it will take their team to fill open positions or replace churned employees. 

Time to fill refers to the number of days it takes to source and hire a new candidate. 

Usually, it is the amount of time between approving a job requisition and the candidate accepting your offer. 

Several factors influence this recruitment metric, including supply, demand, industry requirements, or the speed at which your talent acquisition teams perform

Recruitment metrics

Recruitment metrics: Time to Fill vs. Time to Hire

Time to hire

‘Time to fill’ is often confused with ‘time to hire.’ However, they are entirely different recruitment metrics. 

The time to hire metric tracks the speed at which a candidate is screened, evaluated, interviewed, and hired for a position. 

It indicates the efficiency of the hiring process and the overall candidate experience. 

This recruiting metric depends on the role type, industry, and your company’s hiring process.

Quality of hire

This is one of the most important recruitment metrics that indicates a new candidate’s value to your company’s long-term success. 

As per LinkedIn’s Global Recruiting Trends Report, the quality of hire metric continues to be the most valuable KPI. This metric considers the following factors:

Sub recruitment metrics: Employee engagement

This metric describes the relationship between an organization and its employees qualitatively and quantitatively.

Sub recruitment metrics: Time-to-productivity

This measures the new hire’s time to full productivity. Gage fresh candidates on how quickly they attain certain productivity levels. 

Sub recruitment metrics: Job performance indicators

These indicators are the reporting manager’s performance reviews for a given employee. 

Sub recruitment metrics: Cultural fit

This metric is measured by 360-degree ratings of the new employees by their colleagues and managers.

According to The U.S. Department of Labor, a bad hire can cost your company 30% of the employee’s potential first-year earnings. Though measuring the quality of new employees can be subjective, doing so is critical for your organization’s success. 

Source of hire

This recruitment metric indicates where your new hires come from. 

This indicator can help identify which sources and channels bring in the most talented candidates for your open positions and drive significant business ROI. 

You can analyze channels such as social media advertising, referrals, recruitment agencies, job listing platforms, paid advertising platforms, and your careers page to find the most successful one. 

Applicants to hire ratio

This is a useful recruitment metric representing the number of applicants applying for a role to the number of candidates hired for that position. 

It helps recruiters understand the intensity of the hiring process and decide if they should implement additional hiring criteria to vet candidates.  

When the applicants-to-hire ratio is consistently higher, e.g., 100 applicants for one position (100:1), recruiters can use pre-employment tests and employ data-driven recruitment processes to save time and resources while hiring the most qualified candidates.

Cost per hire

This is an important hiring metric that indicates the efficiency of the recruiting process and helps evaluate the ROI. 

Cost per hire is the average amount of money you spend for recruiting an employee. This measure comes in handy while tracking your recruiting budget.

CPH= (Internal Recruiting Costs + External Recruiting Costs) / Total number of hires

CPH includes recruitment costs, onboarding costs, travel costs, equipment, administrative costs and benefits, referral programs, job board fees, paid advertising costs, agency fees, among others.

Attrition rate

Attrition rate or churn rate is the rate at which employees leave your organization in any given period. 

Attrition rate = Number of employees who have left the company / Average number of employees over a given period.

High attrition rates are a matter of concern for recruiters as replacing top talent can be costly in terms of money and resources required to onboard new candidates. 

Companies need to evaluate this metric to understand their employee satisfaction levels and shape their employee retention strategies accordingly.

Candidate job satisfaction

Recruitment metrics

Recruitment metrics: Job Satisfaction

This is yet another valuable recruitment metric that assesses the candidate’s experience with the recruiting process and their satisfaction in their current role in the organization. 

One of the key indicators of candidate job satisfaction is the Candidate NPS (Net Promoter Score.)

This indicator helps HR professionals to understand how likely newly hired candidates are to recommend their organization to a friend/colleague based on their experiences.  

Assessing a candidate’s experience is the key to acquiring top talent by understanding if the job description matches the new hires’ expectations and how well the recruiting team presents the job opportunity. 

So, why should you track recruitment metrics?

Undoubtedly, recruiting top talent is crucial to an organization’s success. 

It is high time that HR professionals start leveraging data and analytics to scale and optimize their recruitment processes to hire the most qualified candidates faster. 

Switching to data-driven recruitment can help recruiters reduce hiring costs and maximize efficiency gains. 

Monitoring recruitment metrics and using data can give you a competitive advantage and assist you in making well-informed hiring decisions that align with the business goals and ensure human capital and organizational growth. 

Turing is a deep jobs platform that uses AI to source, vet, match, and manage software developers from across the globe. We make the remote hiring journey easy and rewarding for both companies and developers. 

With Turing, companies can hire pre-vetted, Silicon Valley-caliber remote software talent across 100+ skills in 3-5 days. From Fortune 500 companies to fast-scaling startups, hundreds of organizations trust us to scale their offshore engineering teams effortlessly.

More than 200 firms, including well-known, new-age companies backed by top firms like Google Ventures, A16Z, Bloomberg, Khosla ventures, etc., have hired our pre-vetted developers.

Tell us the skills you need and we'll find the best developer for you in days, not weeks.

Hire Developers

By Dec 9, 2021
Are you a software developer looking for remote jobs in Silicon Valley tech companies? If yes, these clean code tips can help you ace your game!
Pro Tips Skills, Interviews, and Jobs

Looking for Software Developer Jobs? Learn How to Write a Clean Code First

Are you a software developer looking for remote jobs in Silicon Valley tech companies? If yes, these clean code tips can help you level up your game!

We live in a world where software runs everything—from TVs to iPads, washing machines to microwaves, smartphones to IoT devices—you get the idea. It takes several million lines of code to run software and execute specific tasks. Coding is not a one-time thing; it’s an iterative process where the programmers are required to make continuous improvements in the code, add new features, and so on. With the increase in code complexity, it becomes essential to follow clean code practices. We’ll go through just that in this blog! I’ve used Rober Cecil Martin’s aka Uncle Bob’s “Clean Code” as a reference for this post. I highly recommend this book to anyone looking for software developer jobs.

The clean code practices apply to all programming languages. For demonstration purposes, we’ve used Golang in this post. If you are more familiar with Java, please refer to the examples given in the book.

Let’s get started!

// Commentaries

The primary purpose of comments is to explain the code which can’t explain itself. Comments are pretty helpful in debugging and analyzing code, troubleshooting errors, and preparing documentation. They come in handy when a new team replaces the old one and gets to work on the existing code. 

A rule to follow: A comment only needs to exist if it’s beneficial 

Additionally, you need to be careful while writing commentaries. Some types of comments that one needs to avoid are:

Useless commentaries

Looking for Remote Software Developer Jobs in Silicon Valley Tech Companies Learn How to Write a Clean Code First

Now, this comment is harmless but clearly out of context. The version control system should handle author information, creation, and update dates, not the code itself. Failure to do so will increase useless lines of code in the program and certainly cause the following problem.

Outdated comments

Here’s the thing: your commentary will become outdated at some point in time.

So not just header comments like the above example, but even comments like this one can be problematic:

Remote software developer jobs

When the comment shown above was added, the function only received an Id, name, and phone number, but now it expects an address too! You should avoid these kinds of outdated comments, which can be misleading at all costs.

Poorly written and redundant commentaries:

When the code is self-explanatory, comments like the one below are redundant. They just add useless lines of code and force developers to read what they don’t need to:

Learn to write a clean code

Clean code

When writing comments, always ask yourself: “Are they essential?” If they are, write them as clearly as possible. Remember, the comment should help you, not cause confusion.

Commented Code

At times, we add an entire block of code as a comment thinking that we may use it in the future.

How can a software developer write a clean code

However, most of the time, these commented codes are never used. And so, it’s best to avoid writing comments like the one in this image. 

Think about it: If that piece of code were so important, it wouldn’t be a comment, right?

Names

To write clean and readable code, one should define meaningful names for variables, functions, classes, interfaces, etc. Furthermore, the name of a function, class, or variable should justify its existence and importance in the code. Simply put, good names are investments that we make to improve the code quality. 

It is difficult to search meaningful names while writing a clean code

Meaningful Names

Take a look at this example:

Remote software developers should know how to write a clean code

It might take a while to understand that this is a median function. 

Now, take a look at the same example with well-picked names:

This is a clean code

Meaningful names like the ones above make the code readable, understandable, and clean. 

Project Patterns

Following a project convention is a good practice for choosing names. For example, if you have defined a function that deals with a user object, don’t create function names like:

Project patterns

Using GetMemberName instead of GetUserName will just confuse the readers.  So, be very mindful while you decide the names of the elements in your code.

Ambiguous Names

Names should clearly describe what a variable is or what a function does. And so, avoid using ambiguous names, like this one:

Ambiguous names

Ok, but renaming what? It’s better to create big names instead of short ones, but ambiguous. So it would be better to create something like:

How can you write a better code, coding tricks and tips

Effect Names

Names should clearly define the action and the purpose of the element, for example:

How can remote software developers write a clean code for better jobs

This function is not just detaching a User from an Account but is also deleting the User. A better name for this would be DetachUserAndRemove().

Functions

Functions play an essential role in the world of programming. As a result, these functions have gained more traction with functional languages such as Elixir, Scala, Kotlin, Swift, Haskell, Golang, etc.

Almost every programmer knows the basics of functions. However, here are a few pointers that will help you write cleaner and better functions:

Short

Have you ever seen a function with hundreds and thousands of lines? 

Have you ever seen a code with thousand lines

A function should be short enough to help the reader understand its purpose at first glance.  But how short should it be? We won’t impose some magic number of lines here, but if your function consists of more than 20 lines of code, try refactoring into a smaller one.

One practical way to shrink your functions is to avoid adding logic into if, else, while indentations. Here’s an example:

Functions

The function name shows that it prints prime numbers between two arbitrary numbers. Here’s what you can do to make the function more readable and understandable:

Remote software developers should learn to write a clean code

This function is easier to understand than the earlier one. 

We removed the logic inside the “if and for loops” and defined them separately in other functions, making them more concise. Here are those functions:

Writing clean code

Note: Take a look at the order of the functions. When you are decomposing the function responsibility, the reader of your code must read it as quickly as a journal or a story. So try to maintain a top-to-bottom readability of the code.

Single responsibility

A critical concept in functions is the single-responsibility principle (SRP). This concept is the first principle of the SOLID principles in OOP. It states that each function should have one single responsibility, which must be well-defined and executed.

Take this example:

This is how a remote software developer can write a clean code

This function has more than one responsibility. Hence, it is best to refactor the code when a single function is responsible for multiple tasks.

Parameters

A function with a lot of parameters is difficult to understand. Here’s why:

Clean code writing

These kinds of functions make the code reviewing process time-consuming and messy. 

To prevent this, you need to ensure that you use a limited number of parameters that clearly define the objective of the function.

How to write a clean code as a remote software developer

Note: Use the same idea to deal with return arguments.

A clean code has various benefits. First, it helps in performing code reviews efficiently. That way, your peers can understand the code, flow of data, and underlying logic with minimal effort. In addition to this, new joiners can easily understand the old code, making their onboarding process smoother. A messy code might take a developer months to add a new feature or fix a bug. However, a clean code makes the process a lot smoother. And thus, a clean code can save a lot of time, money, and resources in your remote software developer job search!

Happy coding!

Do you want to apply to remote US software jobs from the comfort of your home? If yes, Turing may be able to help you very quickly. Visit our Jobs page to know more!

Join a network of the world's best developers and get long-term remote software jobs with better compensation and career growth.

Apply for Jobs

By Sep 14, 2021
Greenhouse CTO Shares How to Reduce Unhealthy Employee Attrition
For Employers Management Pro Tips

Greenhouse CTO Shares How to Reduce Unhealthy Employee Attrition

According to Boufford, organizations shouldn’t aim for zero regrettable employee attrition but implement strategies to reduce the unhealthy turnover rate.

A high employee retention rate has many tangible benefits, including an experienced workforce, lower recruitment and training costs, etc. However, zero regrettable attrition should not be an organization’s only goal. According to Mike Boufford, CTO of Greenhouse, analyzing the reasons behind healthy and unhealthy turnover is more important than aiming for zero regrettable attrition.

In a recent blog post, Boufford shares three strategies designed to reduce regrettable employee turnover:

Foster a culture of open communication and respect 

Lack of proper communication is one of the prominent reasons why employees quit their jobs. Therefore, you must cultivate a culture of openness by discussing the company values with your employees. Open up conversations about the organization’s compensation philosophy with them. This way, the employees will feel a strong sense of belonging in their organization.

In addition to this, studies affirm that employees would stay at a company longer if it invested in their careers. And thus, providing learning opportunities can show your employees that the company values their personal growth. This encourages them to remain committed to the organization.

It is equally important to build a culture of respect in the workspace; work proactively to show that bad behavior is not tolerated in the organization, according to Boufford.

Replace ‘regrettable’ with ‘healthy’

When you focus on the regrettable attribution metric, you are more concerned about the number of people leaving rather than the reason why they are leaving, Boufford explains. Regrettable attrition is a poor proxy for gauging your employees’ satisfaction and loyalty. It obscures workplace issues that need your attention, he adds.

“There are healthy and unhealthy reasons for turnover — that’s where our focus should be, instead of simply on deciding whether or not the company mourns their departure,” says Boufford. He shares a few pointers to encourage a healthy turnover. Specifically: 

  • Make it clear to your employees that it’s okay to consider other opportunities for their careers. 

  • Show them that you are genuinely committed to helping them achieve their career goals. 

  • Talk about your own ambitions and, in turn, encourage them to be vocal about their future plans. 

  • Help them identify and examine new opportunities.

Most importantly, handle resignations with respect and grace. Ensure you part on good terms.

Develop a framework to analyze the turnover

There are several reasons why employees may consider quitting, according to Boufford. The CTO also adds that a detailed framework that analyses the causes of employee turnover can help you take the necessary measures to reduce it.

He shares a sample framework to identify a few healthy and unhealthy causes of turnover:

Healthy Causes:

  1. They’ve found a new passion and need to devote their time to pursue it.
  2. They’ve found a better opportunity to advance their career.
  3. They want to do something on their own.

Unhealthy Causes:

  1. They resign to join a competitor. 
  2. They feel like they were mistreated or have issues with the team dynamics.
  3. They don’t feel like they’re learning anything new.

Strong employee retention has significant benefits, but it pales in comparison to the advantages of fostering healthy company culture, according to Boufford. A company with solid values assures that people stick around, not because they haven’t found a better opportunity, but because they want to. And thus, if you take steps to cultivate healthy behavior, a high employee retention rate will be just one of the many benefits your organization sees.

Are you struggling to recruit and retain skilled and experienced remote software engineers who are adept in technical and soft skills? Turing can help. Turing’s automated platform lets companies “push a button” to hire senior, pre-vetted remote software developers. Access a talent pool of the top 1% of 700K+ developers who work in your time zone. There’s no risk. Turing offers a free two-week trial period to ensure your developers deliver to your standards.

For more information, visit Turing’s Hire page.

Source: Review.Firstround

Tell us the skills you need and we'll find the best developer for you in days, not weeks.

Hire Developers

By Sep 4, 2021
Creating personal branding is necessary for individuals as well as companies
For Employers Management Pro Tips

Here’s Why Tech Companies Should Not Ignore Personal Branding

Personal branding helps engineering companies establish themselves as thought leaders in the field, create a loyal audience base, and build a solid network.

Do you fear that creating a personal brand as an employee will affect your job? Or are you an employer who doesn’t want employees to build their brand because it might not align with the company’s culture? This post will help you address these concerns. 

Anjuan Simmon, an engineering leader, and public speaker has created a guide on why and how organizations should incorporate personal branding into their culture. 

Here are the key takeaways:

Show your work and scale your brainpower

A quote from Simmons’ Twitter thread reads: “One reason I started speaking at tech conferences is to “show my work” and try to portray the thoughtfulness and deep understanding I have about working in software development.” The public speaker emphasizes that this way, you can present your skills in front of a larger audience and enhance your communication skills in the process. 

Simmon also states that it’s essential to create a backup brain that can act as an automatic responder for queries that come your way. In his case, the backup brain is his blog. People can learn about his work and areas of expertise through his blogs. 

Don’t miss free training and create a more comprehensive recruiting network

Simmons says that when you sign up as a public speaker, you learn about various technologies from people using them or who have created them. You get to learn about what is working in the industry and what improvements you can make. You also gain insight into the innovations going around— all of this, at no cost whatsoever! The engineering leader turned speaker has attended many seminars and has been able to bring some good ideas to their company. This way, personal branding efforts can aid company growth. 

He recalls one such instance: “I attended a conference where an engineer discussed how they use a sponsorship spreadsheet to document the ways they support every engineer at their company. I loved the idea and presented it to my boss, and she empowered me to implement the same at Help Scout.” 

What’s more, such events can also help you land good talent for your company. “I’ve always got my hiring manager hat on at conferences. I meet all sorts of people looking for new opportunities, and I’ve placed roles based on people I’ve met. It’s increased my pipeline tremendously,” Simmons explains. 

How to develop a talk that can enhance your branding?

People don’t like robots speaking in front of them, no matter how interesting the topic. Simmons suggests that you should develop a funny and friendly talk so that the listeners can relate to it. Make it as factual as possible. He also suggests using relevant and engaging images in the slides to ensure accessible content consumption. This way, you will be able to convey your message without losing the attention of your audience. 

The engineering leader also takes inspiration from the stand-up world. He believes that every speaker should understand and analyze their audience before going ahead with any session. A joke that works on one set of the audience might not appeal to the other. And thus, it is crucial to tailor your pitch according to the audience present.  

Put it all together and practice

Good things take time. Learn from your experience and mend your mistakes. Identify what worked and what was not in your favor. Focus on creating a brand that is a reflection of your work. 

Simmons recalls his experience where some companies he had worked with were not in favor of personal branding. He firmly believes that if a startup is reluctant to have their employees establish themselves as a brand, they are missing a huge opportunity. “Over the past five years, most companies I’ve worked at were very small. But I’m on the speaker list next to people who work at FAANG companies — it lends credibility to be out there, flying your startup’s flag,” he explains. 

Company executives need to be openly supportive and vocal about employee engagement in personal branding. This practice helps employees know that they are part of a work culture that supports organizational and personal growth. Most importantly, personal branding through public events can significantly augment an organization’s credibility. It can also help organizations establish themselves as thought leaders in their fields, create a loyal audience base, and build a solid network of influencers to grow their business. 

Want to rise as an engineering leader in your field and boost your team’s performance? Turing can help. The company’s automated platform enables you to hire and manage remote software developers vetted for a Silicon Valley standard with just the “push of a button.” With Turing, companies can hire from a talent pool of top 1% of 700K+ developers with excellent technical and communication skills who work in their time zone.

Visit Turing’s Hire page for more information.

Source: Review.Firstround

Tell us the skills you need and we'll find the best developer for you in days, not weeks.

Hire Developers

By Aug 13, 2021
Three Communication Mistakes Hybrid Teams Must Avoid
For Employers Management Pro Tips

Three Communication Mistakes Hybrid Teams Must Avoid

Communication is key to organizational success. Hybrid teams should avoid these common mistakes to reduce transactional communication and encourage spontaneity.

The rise of hybrid teams has divided employees into two classes: information-haves and have nots. A recent report stated that it has reduced workdays to purely transactional communications and killed spontaneity between in-office and remote workers.

Additional takeaways: 

Uneven visibility and access to information leads to inconsistent decision making

Hybrid teams often face uneven information sharing. Consequently, in-office employees have a considerable advantage over remote employees. This contrast creates an uncomfortable information hierarchy between team members. Hybrid teams should acknowledge this challenge and establish a few ground rules to encourage consistent information sharing. Handbooks with organizational protocols, FAQs, policy terms, and training resource links can help here.

Influence is a product of visibility. Those who are “visible” influence the flow of work and decisions. Naturally, in-office employees have the edge over remote workers in this aspect too. Remote employees often find it challenging to share their opinions during discussions; when the rest of the team is collectively debating an issue in the office, all they can do is rely on their laptop screens. Remote employees may be working longer hours and increasing productivity but still going unacknowledged compared to in-office workers. And thus, hybrid teams should adopt practices to even out these disparities.

One way is always to encourage input from members that logged in virtually before the rest. Additionally, managers must focus on equalizing employee experience by ensuring equal information accessibility. They should ensure that employee benefits are beneficial for both in-office and remote workers. 

The “Zoom gloom” dampens team morale

Hybrid teams tend to suffer from the “zoom gloom.” This phenomenon is a result of the stress and lack of human contact brought by virtual meetings. Zoom offered advice for eliminating the gloom of too many virtual conferences. It shared that seeing oneself during meetings heightened anxiety levels. And hence, hiding self-view could help in reducing stress. Another research found that when participants got a break and meditated between sessions, their stress levels dropped significantly and did not build up over time. 

Using informal communication channels to build employee relationships is a big challenge for hybrid organizations. More than two-thirds of workers wish to spend more time with their in-office peers to develop better connections. The virtual workplace gets work done but ends up losing out on ‘hall talk.’  Hall talk is crucial for organizations as it encourages new ideas, information-sharing, and relationships. What’s more, virtual workplaces eliminate spontaneity and hamper the quality of communication. Eventually, this can dampen team morale. 

Promoting relationship-building activities in day-to-day work calls can help fix this issue. Activities like ‘creative introductions’ and ‘team kudos’ can help build a rich hybrid workplace. 

Inconsistent engagement leads to misunderstood concepts

The physical office space does not serve as the central hub for engagement in hybrid teams. The absence of a central hub makes it challenging to conduct events that require high levels of engagement, like high-value client meetings. Video calls, although convenient, cannot replicate the richness of face-to-face communications, especially when complex issues are under discussion. As a result, 53 percent of remote workers fear being left out of crucial team meetings and other activities in the office. And thus, managers are in a constant quest to find arrangements that satisfy the communication needs of hybrid teams.

Managers should design a selection guide that allocates workplaces based on the task. This guide can help in identifying and harmonizing activities that genuinely require face-to-face conversation. Similarly, leaders should invest time into equipping hybrid teams with the tools and resources necessary for rich engagement. 

Read the complete article.

Turing is an automated platform that lets companies “push a button” to hire senior, pre-vetted remote software developers. Firms can hire from a global talent pool of top 1% of 700K+ developers with strong technical and communication skills who work in their time zone.

For more information, visit Turing’s Hire page. 

Tell us the skills you need and we'll find the best developer for you in days, not weeks.

Hire Developers

By Jun 28, 2021
MySQL Client / Server Protocol Using Python & Wireshark: P2
Developers Corner Interviews Languages, frameworks, tools, and trends Pro Tips

Understanding MySQL Client / Server Protocol Using Python & Wireshark: Part 2

In this blog, we’ll learn how to write our own native MySQL client from scratch without using a connector or external libraries.

In the previous article we researched MySQL Client / Server Protocol using WireShark. Now lets start to write our code in python to simulate MySQL native client. Final codes are here: Github repo

First of all we have to create MYSQL_PACKAGE class. MYSQL_PACKAGE class is the parent of all other package classes (HANDSHAKE_PACKAGE, LOGIN_PACKAGE, OK_PACKAGE and etc.)

It accepts resp parameter on initialization. Resp is the binary response received from the server in bytesarray type. One of the important and interesting method of this class is next method.

Method next reads a portion of the bytes from the binary response. When we call this method, it reads some portion of bytes and puts a pointer to the last position where reading ended (changes a value of self.start and self.end properties). When we call this method again, it starts to read bytes at the point it last stopped.
Method next accepts five parameters: length, type, byteorder, signed, and freeze. If freeze is True it reads some portion of bytes from the binary response but does not change pointer position. Otherwise it reads a portion of bytes with given length and changes the position of pointer. If length is None then method reads bytes until the end of response bytesarray. Parameter type can be int, str, and hex data types. Method next converts a portion of bytes into the appropriate datatype according to the value of type parameter.
Parameter byteorder determines the conversion of bytes to integer type. It is up to the architecture of your computer. If your machine is big-endian, then it stores bytes in memory from the big address to the little. If your machine is little-endian, then it stores bytes in memory from the little address to the big. Thats why we have to know the exact type of our architecture to be able to convert bytes to integer correctly. In my case, it is little-endian, that’s why i’ve set the default value of byteorder parameter to “little”.
Parameter signed is also used in conversion of bytes to integer. We tell the function to consider each integer as unsigned or signed.
A second interesting method of this class is encrypt_password. This method encrypts a password with the given algorithm.

This method accepts two parameters: salt and password. Parameter salt is the concatenation of two salt1 and salt2 strings from the Greeting Packet received from the server. And parameter password is the password string of mysql user.
In the official documentation password encryption algorithm is:
password_encrypt_algorithm
Here “20-bytes random data from server” is concatenation of salt1 and salt2 from the Greeting Packet received from server. To remember what the greeting packet is look at the previous article
Now I want to explain the encrypt_password method line by line.
bytes1 = sha1(password.encode(“utf-8”)).digest()
We are converting password string to bytes, then encrypting it with sha1 function and assigning to bytes1 variable. It is equal to this part of algorithm:
password_encrypt_algorithm1
Then we are converting salt string into bytes and assigning to the concat1 variable.
concat1 = salt.encode(‘utf-8’)
password_encrypt_algorithm5
Third line of the method is:
concat2 = sha1(sha1(password.encode(“utf-8”)).digest()).digest()
password_encrypt_algorithm2
Here we are double-encrypting password string with sha1 function and assign it to the concat2 string.
Now we have two concat1 and concat2 variables. We have to concatenate them into one byte array:
bytes2 = bytearray()
bytes2.extend(concat1)
bytes2.extend(concat2)
password_encrypt_algorithm6
Then we have to encrypt concatenated bytes with sha1 function and assign to the bytes2 variable.
bytes2 = sha1(bytes2).digest()
password_encrypt_algorithm3
So we have two variables with encrypted bytes: bytes1 and bytes2. Now we have to do bitwise XOR operation between these variables and return the obtained hash.
hash=bytearray(x ^ y for x, y in zip(bytes1, bytes2))
return hash
password_encrypt_algorithm4

CLASSES FOR DATATYPES

In the previous article we’ve learned about Int and String data types of MySQL Client / Server protocol. Now we need some classes to be able to read fields from received packets.

INT CLASS

Int class implements INT data type of MySQL Client / Server protocol. It accepts package parameter on initialization. Parameter package should be the instance of any package class inherited from MYSQL_PACKAGE class. Method next detects the type of integer (int<fix> or int<lenenc> (see previous article) and calls the next method of package object to read the byte portion of received response.

STR CLASS

Str class implements STRING data type of MySQL Client / Server protocol. It accepts package parameter on initialization. Parameter package should be the instance of any package class inherited from MYSQL_PACKAGE class. Method next detects the type of String (String<fix>, String<Var>, String<NULL>, String<EOF> or String<lenenc>. See previous article) and calls the next method of package object to read the byte portion of received response.

HANDSHAKE_PACKAGE CLASS

HANDSHAKE_PACKAGE class is used for parsing the Greeting Packet received from server. It is inherited from MYSQL_PACKAGE class and accepts resp parameter on initialization. Parameter resp is the Greeting Packet response in bytes type recieved from the server.

Method parse reading fields from the response using Int and Str classes and puts them into a dictionary and returns.

LOGIN_PACKAGE CLASS

This class is used for create Login Request packet.

OK package and ERR package are the response package of server after authentication or after sending query to server on command phase.

MYSQL CLASS

MYSQL class is the wrapper class which creates TCP connection with server, sends and receives packages from server using above classes.

I think everything is clear in this class. I’ve defined __enter__ and __exit__ to be able to use this class with “with” statement to automatically close TCP connection. In __enter__ method i’m creating TCP connection over socket. And in __exit__ method i’m closing created connection. This class accepts host, port, user and password parameters on initialization.
In the connect method we receive greeting packet from server:
resp = self.client.recv(65536)
return HANDSHAKE_PACKAGE(resp)
In the login method we create Login request package using LOGIN_PACKAGE and HANDSHAKE_PACKAGE classes and sends to the server and gets OK or ERR packages.
That’s all. We’ve implemented the connection phase. To avoid making this article too long I will not explain the command phase. Because the command phase is easier than the connection phase. You can research it yourself with the knowledge you’ve accumulated from this and previous articles.
Demo Video:

If you’re a brilliant developer looking for remote software jobs, Turing may be able to help you very quickly. Head over to the Jobs page to know more!

Join a network of the world's best developers and get long-term remote software jobs with better compensation and career growth.

Apply for Jobs

By Oct 9, 2020
Smart Slack hacks ultimate guide
COVID-19 For Employers Hacks Pro Tips Remote First How-to Remote Now RemoteFocusedTools Suddenly Remote

The Ultimate Guide to Slack Hacks

Slack is one of the most popular communication tools for remote teams. With the ability to coordinate conversations by a specific theme, within a team or company-wide, there is great power in this platform. Long popular with remote teams, here are some tips and tricks that you might have missed. Use these to make the most of your time and communication efforts.

Slack is one of the most popular communication tools for remote teams. With the ability to coordinate conversations by a specific theme, within a team or company-wide, there is great power in this platform.

Long popular with remote teams, here are some tips and tricks that you might have missed.

Use these to make the most of your time and communication efforts.

We will cover:

Notification Management

Pin important messages

Keyboard shortcuts

Polls and surveys

Star items = quick list

Slackbot Reminders

Include posts

Keyword Notifications

Find mentions quickly

Search Smarter

Quick link to previous posts

Bookmark location in a channel

Formatting for Impact

Deep Work Time – DND

Customized Emojis

Integrate! Apps, bots, and workflows

Notification Management

Pin important messages

    • You might want to pin the most current update of the project you are working on or your guide to using the channel. You can pin up to 100 messages per channel, but keeping it to crucial information is better.

Keyboard shortcuts

    • You can use keyboard shortcuts to navigate around the Workspace, mark a message as read or unread, format your messages, and more. Saving time and giving flow and process to your time in Slack.
    • When all the pictures and GIFs are making it hard to follow the conversation type “/collapse” into your text box, which will leave text only within the chat and reverse this type “/expand.”
    • To see the list of shortcuts hit “ctrl” and “/.”

Notification Management

    • You may not need notifications for all activity within a channel. Adjust your notification requirements by selecting the settings icon (cog) at the top of the channel on desktop or using the drop-down menu (3 dots) on mobile, then settings, then notifications/notification preferences.

Polls and surveys

    • Want to get some quick feedback from the team? Or trying to decide on meeting times? Use the command “/poll” and follow the instructions to call up the “Polly” app. Both powerful and fun.

Star items = quick list

    • Click “Show starred items” or use the keyboard shortcut “crtl_shift+s” for a quick list of all your starred messages. This hack can be useful to quickly review essential items and help you to come back to something you might not have time to handle at the moment.

Slackbot Reminders

    • Use the “/remind” command to give you a personal reminder, or to remind someone else on your team. An example is “/remind @Jeff of meeting at 2 pm”, your reminder will be sent at 2 pm to Jeff about your upcoming meeting.

Include posts

    • Where you need to share longer-form content, you can include posts in your Slack messages. You might want to share project plans, or quickly link to your code of conduct, vision, and mission statements.
    • Create a post – (On your desktop). Select the attachment icon (paperclip) → “Create new” → “Post.” From here, you can share your post, edit it, allow others to edit it, format the article, and add images to it—further instructions via the Slack help section

Keyword Notifications

    • While you will get notifications if you are tagged or mentioned, it can be useful to get a notification. Likewise, when someone uses a specific keyword. Go to preferences, then notifications to set up your desired keywords. You will receive the notification, and the channel will display a badge.

Find mentions quickly

    • You can use the @ symbol on the top right on desktop to show, or hide, mentions if you are looking for a recent conversation (or you’re drowning in notifications). Or use the keyboard shortcut “ctrl” + ”shift” + ”m” to show and hide your mentions.

Search Smarter

    • Use modifiers that help you to search smarter. “From:user”, “in:channel”, “during:March”, or “has:emoji-code”, this one is particularly useful if you follow a specific process of emoji usage within your Workspace. You can find a complete list of search modifiers here.

Quick link to previous posts

    • Using the timestamp (time beside your name above a post), you can copy this as a link and paste into a new post, bringing old posts back into the conversation quickly.

Bookmark a location in a channel

    • Some channels require more attention from us than others, if you need to read everything in the channel then use “Alt+click” on the message where you are leaving the channel, it will mark all subsequent messages as unread. On mobile, this should be a long press/hold on the message.

Formatting for Impact

    • Need certain parts of a post to stand out? Then use formatting. E.g., using * either side of a word will embolden it i.e., *here* now becomes here. Or traditional keyboard shortcuts also work. You can also add formatting like inline code or block quotes, very useful to help faster communication of crucial information. More on formatting your messages from Slack.

Deep Work Time – DND

    • DND – You can type in “/dnd” into the text box and then set a time, or use the bell icon to the top left and select a time frame. Stopping you from receiving any sounds or notifications in the time frame you specify, and your co-workers will see a sleeping symbol beside your name.

Customized Emojis

    • Emojis can be useful to speed up communication within your team or to help strengthen branding and team identity. You can add the custom emojis from the drop-down menu on the top left and choose “Customize Slack.” Admins have the power to limit who can edit these.

Integrate! Apps, bots, and workflows

      • Slack supports integrations with 100s of apps. Here is a list of some of the most popular ones. See the Slack help center for details on each and a full list of apps available, or click here 
      • Zoom for SlackStart a meeting, join a meeting and make a call with Zoom phone. Remember, you must register your Slack and Zoom accounts with the same email address.
      • Trello for SlackManage cards on your boards from Slack, add conversations to cards, and update due dates.
      • Asana for SlackCreate new tasks and turn your conversations in Slack into to-dos in Asana
      • Salesforce for SlackSearch Salesforce records from Slack, configure Salesforce alerts for Slack. Send Slack messages to Salesforce, or send Salesforce records to Slack.
      • Twitter for SlackYou can set up mentions on Twitter to feed into a channel that the team can keep an eye on. You can also follow similar businesses or your suppliers.
      • Google Calendar for SlackView your full schedule and have your status update when you are scheduled in a meeting.
      • Donut for SlackDonut helps to improve team-building; there are prebuilt connection programs in Donut, one of the most popular functions is virtual random coffees. This helps to encourage cross-organizational bonding.
      • Loom for SlackMention @person or #channel directly in your Loom videos, and they can watch the clip without needing to leave Slack.
      • Polly for SlackThis Polls and surveys bot lets you get quick feedback. You can also use pulse surveys directly in Slack.
      • Greetbot for SlackAn onboarding assistant for Slack. You can use this to customize welcome messages and schedule follow-ups.
      • You can also create custom integrations, build your bot, create automated workflows, and much more, read more on this via the Slack help center here.

 

Do you have a workflow or trick that works well for you in Slack? Then please share it with us over on Twitter @Turingcom.

Tell us the skills you need and we'll find the best developer for you in days, not weeks.

Hire Developers

By Mar 31, 2020