![Andrew](/images/avatar_hu2fb2c1ffbbc34375e1753f29fe535e66_2271_200x200_resize_q80_h2_lanczos_3.webp)
Andrew
Software Engineer and blogger
How to Get Account Number from AWS Lambda
If you need to get the current Account Number, or Account ID from within a Lambda execution, then you can access invoked_function_arn from the context and return the associated value as follows:
Read MoreSummary of the Frequently Used AWS STS API calls
AssumeRole – is useful for allowing existing IAM users to access AWS resources that they don’t already have access to.
Read MoreUnderstanding Locking and Conditional Writes in AWS DynamoDB
Optimistic locking is a strategy to ensure that the client-side item that you are updating (or deleting) is the same as the item in DynamoDB.
Read MoreAWS CodeDeploy Deployment Type Options
CodeDeploy provides two (2) deployment type options: Option 1 – In-place Deployment In-place deployment: The application on each instance in the deployment group is stopped, the latest application revision is installed, and the new version of the application is started and validated.
Read MoreDefining Amazon ECS Task Placement Strategies
Amazon ECS supports the following task placement strategies: binpack – Place tasks based on the least available amount of CPU or memory.
Read MoreDeployment methods in AWS Elastic Beanstalk
– All at once – Deploy the new version to all instances simultaneously.
Read MoreHow to update NTP to sync clock on Linux
If you need to sync the clock on Linux using the central NTP clock service, you can do the following:
Read MoreHow to Find IP Address Ranges used by Amazon S3
You can query the ip-ranges Amazon AWS URL, and parse the results through jq as follows:
Read MoreHow to Find the nth Reverse Number in Java
The challenge Reverse Number is a number which is the same when reversed.
Read MoreHow to Find the Sum of Intervals in Java
The challenge Write a function called sumIntervals/sum_intervals() that accepts an array of intervals, and returns the sum of all the interval lengths.
Read MoreHow to Find the Stray Number in Python
The challenge You are given an odd-length array of integers, in which all of them are the same, except for one single number.
Read MoreHow to Find the EDID UUID of External Mac Monitors
You can issue the following command on an Apple Mac’s terminal to show the EDID UUID (unique serial number) of all attached external monitors:
Read More[Solved] jsii.errors.JSIIError: docker exited with status 1
If you get the following error while running AWS CDK:
Read MoreHow to Take a Ten Minute Walk in C
The challenge You live in the city of Cartesia where all roads are laid out in a perfect grid.
Read MoreHow to Count Stats of a String in C
The challenge You will be given a string and your task will be to return a list of ints detailing the count of uppercase letters, lowercase, numbers and special characters, as follows.
Read MoreHow to Convert a String to the NATO Phonetic Alphabet in C
The challenge You’ll have to translate a string to Pilot’s alphabet (NATO phonetic alphabet).
Read MoreHow to Add 1 to the Value of each Array in C
The challenge Given an array of integers of any length, return an array that has 1 added to the value represented by the array.
Read MoreHow to Calculate the Sum of a Sequence in C
The challenge Your task is to make function, which returns the sum of a sequence of integers.
Read MoreHow to Solve the Sum of Triangular Numbers in C
The challenge Your task is to return the sum of Triangular Numbers up-to-and-including the nth Triangular Number.
Read MoreHow to Determine if a String Only Contains Unique Characters in C
The challenge Write a program to determine if a string contains only unique characters.
Read MoreHow to Find the Maximum Multiple in C
The challenge Given a Divisor and a Bound , Find the largest integer N , Such That ,
Read MoreHow to Assign a Digital Cypher in C
The challenge Digital Cypher assigns to each letter of the alphabet unique number.
Read MoreHow to Check for All Inclusive in C
The challenge Input: a string strng an array of strings arr Output of function contain_all_rots(strng, arr) (or containAllRots or contain-all-rots):
Read MoreHow to Solve for Factorial in C
The challenge In mathematics, the factorial of a non-negative integer n, denoted by n!
Read MoreHow to Create an Incrementer in C
The challenge Given an input of an array of digits, return the array with each digit incremented by its position in the array: the first digit will be incremented by 1, the second digit by 2, etc.
Read MoreHow to Return the Closest Number Multiple of 10 in C
The challenge Given a number return the closest number to it that is divisible by 10.
Read MoreHow to Reverse Every Other Word in a String in C
The challenge Reverse every other word in a given string, then return the string.
Read MoreHow to Solve Simple Beads Count in C
The challenge Two red beads are placed between every two blue beads.
Read MoreHow to Solve the Maze Runner in C
The challenge Introduction Welcome Adventurer. Your aim is to navigate the maze and reach the finish point without touching any walls.
Read MoreHow to Take a Number and Sum It’s Digits Raied to the Consecutive Powers in C
The challenge The number 89 is the first integer with more than one digit that fulfills the property partially introduced in the title of this challenge.
Read MoreHow to Find the Middle Element in C
The challenge You need to create a function that when provided with a triplet, returns the index of the numerical element that lies between the other two elements.
Read MoreHow to Invite More Women in C
The challenge Task King Arthur and his knights are having a New Years party.
Read MoreHow to Build a Tower in C
The challenge Build a pyramid-shaped tower, as an array/list of strings, given a positive integer number of floors.
Read MoreHow to Calculate A Rule of Divisibility by 7 in C
The challenge A number m of the form 10x + y is divisible by 7 if and only if x − 2y is divisible by 7.
Read MoreHow to Categorize a New Member in C
The challenge The Western Suburbs Croquet Club has two categories of membership, Senior and Open.
Read MoreHow to Solve Deodorant Evaporator in C
The challenge This program tests the life of an evaporator containing a gas.
Read MoreHow to Find the Divisors in C
The challenge Create a function named divisors/Divisors that takes an integer n > 1 and returns an array with all of the integer’s divisors(except for 1 and the number itself), from smallest to largest.
Read MoreHow to Bounce Balls in C
The challenge A child is playing with a ball on the nth floor of a tall building.
Read MoreHow to Find the Capitals in C
The challenge Instructions Write a function that takes a single string (word) as argument.
Read MoreHow to Empty and Delete an S3 Bucket using the AWS CLI
Option 1 – Using AWS CLI Step 1 export bucketname='your-bucket-here' Step 2
Read MoreWhat ports to open for FSx connection to AWS Managed Active Directory
If you are creating a FSx file system, and want to connect it to AWS Managed Active Directory, then you will need to create a VPC Security Group with the following ports:
Read MoreHow to Calculate Variance in Python
If you need to calculate variance in Python, then you can do the following.
Read MoreHow to Calculate the Sum of a List in Python
If you need to calculate and get the sum of a list in Python, then you can do the following.
Read MoreHow to add a List to a Set in Python
If you need to add a list to a set in Python, then you can do the following:
Read MoreHow to Remove Punctuation from a List in Python
If you have a Python list, and want to remove all punctuation, then you can do the following:
Read MoreHow to Normalize a List of Numbers in Python
If you need to normalize a list of numbers in Python, then you can do the following:
Read MoreHow to Multiply a List by a Scalar in Python
If you need to multiply a list by a scalar in Python, then you can do one of the following:
Read MoreHow to Find the Index of the Minimum Element in a List in Python
If you need to find the index of the minimum element in a list, you can do one of the following:
Read MoreHow to Convert a Set to a String in Python
If you need to convert a set to a string in Python, then you can do one of the following:
Read MoreHow to Decrement a Loop in Python
If you need to decrement a loop in Python, then you can do the following:
Read MoreHow to Create Zip Archive of Directory in Python
If you need to create a zip of a directory using Python, then you can do the following:
Read MoreHow to Remove the Last Character of a String in PHP
If you need to remove the last character of a string in PHP, then you can do the following:
Read MoreHow to Create Function with Multiple Returns in PHP
If you need to create a PHP function that returns multiple values, then you can do one of the following.
Read MoreHow to Download a File in NodeJS without any Third Party Libraries
If you need to download a file in NodeJS without using any third party libraries, then you can do the following.
Read MoreHow to Execute a Shell Script in NodeJS
If you need to execute a shell script in NodeJS, then you can use the exec keyword.
Read MoreHow to Print Multiple Arguments in Python
If you need to print out multiple arguments using Python, then you can do one of the following:
Read MoreHow to Delete all Resources Except One in Terraform
If you need to delete all resources created by Terraform, except for a single, specific one, then you can do the following:
Read MoreHow to Copy Files between Two Nodes using Ansible
If you need to copy files between two (2) nodes, using Ansible, then you can do the following:
Read MoreHow to Delete Files and Folders in a Directory using Ansible
If you need to delete files and folders in a directory using Ansible, then you can do the following:
Read MoreHow to Copy Multiple Files with Ansible
If you need to copy multiple files using Ansible, then you can do the following:
Read MoreHow to Write Multiline Shell Scripts in Ansible
If you need to write a shell script in Ansible, you probably have something like this:
Read MoreHow to Pass Variables to Ansible Playbook CLI
If you need to pass a variable to Ansible playbook, using the command line, then you can do the following:
Read MoreHow to Create a Directory using Ansible
If you need to create a directory using Ansible, then you can do the following:
Read MoreHow to Disable Screensaver on Mac using the CLI
If you want to disable the Screensaver on your Mac, by using the Command Line Interface (CLI), then you can do the following:
Read MoreHow to Remove Old and Unused Docker Images
If you need to remove any old and unused Docker images, then you can do the following:
Read MoreHow to Convert Milliseconds to Date in Javascript
If you need to convert Milliseconds to Date in Javascript, then you can do the following:
Read MoreHow to Convert String to Title Case in Javascript
If you need to convert a String to Title Case in Javascript, then you can do one of the following:
Read MoreHow to Compile Multiple Java Files from a Single Command in Java
If you need to compile multiple Java files using a single command, then you can do the following.
Read MoreHow to Convert JSON to a Java Object
If you need to convert JSON to a Java Object, then you can do one of the following:
Read MoreHow to Calculate Powers of Integers in Java
If you need to calculate the powers of Integers in Java, then you can do one of the following:
Read MoreHow to Get Today’s Date in Java
If you need to get today’s date in Java, then you can do one of the following:
Read MoreHow to Copy Files from Docker Container to Host
If you need to copy files from a Docker Container to the Host, then you can do one of the following:
Read MoreHow to Get the IP Address of a Docker Container
If you need to get the IP Address of a Docker Container, then you can do the following:
Read MoreHow to Convert Time to String in Golang
If you need to convert Time to a String in Go, then you can do one of the following:
Read MoreHow to Perform a Deep Copy in Golang
To perform a Deep Copy in Go, you can use a struct type as follows:
Read MoreHow to Return Lambda Functions in Golang
Go doesn’t typically have Lambda Expressions, but synonymous to Lambdas, or Closures if Anonymous Functions for Go.
Read MoreHow to Create an Empty Slice in Golang
If you would like to create an empty slice in Go, then you can do the following:
Read MoreHow to Parallelize a for Loop in Python
If you need to run a for loop in parallel, then you can do one of the following:
Read MoreHow to Reverse an Integer in Python
If you need to reverse an integer using Python, then you can do the following:
Read MoreHow to Save a Python Dictionary to a File in Python
If you need to save a Python Dictionary object type to a file using Python, then you can do one of the following:
Read MoreHow to Move Files From One Directory to Another Using Python
If you need to move files from one directory to another directory, using Python, then you can do one of the following:
Read MoreHow to Get the Number of Lines in a File in Python
If you need to get the number of lines in a file, or the line count total from a file, using Python, then you can use one of the following options:
Read MoreHow to Read Specific Lines From a File in Python
If you need to read a specific line from a file using Python, then you can use one of the following options:
Read MoreHow to Get All Files in a Directory in Python
If you need to get all the files in a directory using Python, then you can do the following:
Read More[Solved] dial tcp: lookup proxy.golang.org: i/o timeout
If you get a timeout when trying to install go dependencies, the error may look something like this:
Read MoreHow to Check Operating System in Python
If you need to check the Operating System information from Python, then you can do one of the following:
Read MoreHow to Convert Hex to Byte in Python
If you need to convert Hex to Byte in Python, then you can do one of the following:
Read More[Solved] fatal: Could not read from remote repository with Git
If you receive the following error when trying to clone a Git repository:
Read MoreHow to Install Homebrew on a Mac
Prerequisites You should have some familiarity with the Mac Terminal application since you’ll need to use it to install Homebrew.
Read MoreHow to create an AWS EC2 instance in CloudFormation
Create an EC2 Instance in CloudFormation If you need to create an EC2 instance in CloudFormation, then you can do the following:
Read MoreHow to Run Commands on an AWS ECS Cluster Task or Container
If you need to run a command, or set of commands on an AWS ECS cluster container, then you can do the following:
Read MoreUnderstanding the Network Modes in AWS ECS
If using the EC2 launch type, the allowable network mode depends on the underlying EC2 instance’s operating system.
Read MoreHow to Enable ContainerInsights on AWS ECS from the AWS CLI
If you need to enable Container Insights for an ECS cluster, by using the AWS CLI, then you can do the following:
Read MoreAppMesh and ECS with Imported ACM certificates on Envoy Sidecar through EFS
Summary This guide showcases the ability to use imported certificates from a third party provider (e.
Read MoreHow to Increase the disk size on a Cloud9 instance
If you need to increase the disk size of a Cloud9 instance, you can run the following script directly from the terminal in Cloud9:
Read MoreHow to Get the Instance Profile attached to an AWS EC2
If you need to get the IAM Role information from the attached EC2 role directly, you can do the following:
Read MoreHow to Create an AWS ECR Repository in AWS CLI
If you need to create an Elastic Container Registry (ECR) Repository from the AWS CLI, you can do the following:
Read MoreHow to Scale Out an AWS ECS Service
When you create the Amazon ECS service, it includes three Amazon ECS task replicas.
Read MoreHow to Retrieve AWS ECS Cluster Information
For more information about the Amazon ECS cluster, run the following command.
Read MoreTypes of communication in Amazon EKS
There are multiple types of communication in Amazon EKS environments.
Read More[Solved] Read timeout on endpoint URL: “https://lambda.[region].amazonaws.com/2015-03-31/functions/[function-name]/invocations”
If you get the following error: Read timeout on endpoint URL: "https://lambda.
Read MoreHow to Remove a Passphrase from Certificate Key
If you have a Certificate Key that includes a Passphrase and you need to remove it, potentially to use it with AWS App Mesh, then you can do the following:
Read MoreHow to get Python logger to Print to std out
If you use Python’s logger as follows: import logging logger = logging.
Read MoreHow to Convert a String to an Integer in C
If you need to convert a String to an Integer in C, then you can do one of the following:
Read MoreHow to Convert an Integer to a String in C
If you need to convert an Integer to a String in C, then you can do one of the following:
Read MoreHow to append to an Array in Elasticsearch using elasticsearch-py
If you are using the Official ElasticSearch Python library (Docs), and you want to create an index:
Read MoreHow to Copy Text to the Clipboard in Python
If you need to Copy Text to the Clipboard using your Python application code, then you can do the following:
Read MoreHow to Read a PDF file in Python
If you need to read a PDF (Portable Document Format) file in your Python code, then you can do the following:
Read MoreHow to Convert HEX to RBG in Python
If you need to convert HEX (Hexadecimal) to RGB (Red-Green-Blue) in your Python code, then you can do the following:
Read MoreHow to Refer to a Null Object in Python
If you need to refer to a Null Object in your Python code, then you can do the following.
Read MoreHow to Convert Bytearray to String in Python
If you need to convert a Bytearray to a String in Python, then you can do the following:
Read MoreHow to get the Hostname in Python
If you need to get the Hostname in your Python application, then you can do the following:
Read MoreHow to get the IP Address in Python
If you need to get the IP Address in your Python application, then you can do the following:
Read MoreHow to use SSH in your Python application
If you need to make an SSH connection and issues commands over SSH using your Python application, then you can do the following:
Read MoreHow to Pause a Program in Python
If you need to pause the execution of your Python program, then you can do the following:
Read MoreHow to Convert String to Double in Python
If you need to convert a String to a Double in your Python code:
Read MoreHow to a Run Bash Command in Python
If you need to run a bash command in your Python code, then you can do the following:
Read MoreHow to Force Redeployment of AWS API Gateway using AWS CloudFormation
If you have an AWS API Gateway resource, and need it to force a redeployment using CloudFormation, then you can use the TIMESTAMP trick.
Read MoreHow to Deploy React App to S3 and CloudFront
If you would like to deploy a React App to AWS S3 and AWS CloudFront, then you can follow this guide.
Read More[Solved] export ‘Switch’ (imported as ‘Switch’) was not found in ‘react-router-dom’
In react-router-dom v6, Switch is replaced by routes Routes. You need to update the import from:
Read MoreHow to List all Files/Folders/Directories in Python
If you need to list all Files, Folders, or Directories in Python code, then you can use the listdirs method from the os package.
Read MoreHow to Read a File in Python
If you need to read a file in Python, then you can use the open() built-in function to help you.
Read MoreHow to Drop Columns in Pandas Only If Exists
If you have a Pandas DataFrame, and want to only drop columns if they exist, then you can do the following:
Read More[Solved] An error occurred while calling o86.getDynamicFrame. Exception thrown in awaitResult:
If you are running a GlueJob in AWS and get the following error:
Read MoreAWS CDK Commands
The AWS Cloud Development Kit (CDK) comes with a list of commands that you need to know:
Read MoreHow to Make a Java Jar File Executable
Let’s say you have a Java project as follows: package ms.
Read MoreHow to List All Resources in an AWS Account
If you need to see a list of all the resources in your AWS Account, then you need to look into the Tag Editor.
Read MoreFixed size left column and fluid right column both with 100% height in CSS
If you need two (2) columns and want the left column to be a fixed size, but the right column to automatically take the remaining size of the window, then you can use the following solution.
Read MoreHow to Check if a Volume is Mounted in Bash
If you need to check if a volume is mounted in a Bash script, then you can do the following.
Read MoreHow to Determine if a Bash Variable is Empty
If you need to check if a bash variable is empty, or unset, then you can use the following code:
Read MoreHow to Order by File Size using the du command in Linux
If you use the du command to list all the file sizes on Linux:
Read MoreHow to Join Multiple MySQL Tables in Python
First, you will need the mysql.connector. If you are unsure of how to get this setup, refer to How to Install MySQL Driver in Python .
Read MoreHow to Limit a MySQL Query in Python
First, you will need the mysql.connector. If you are unsure of how to get this setup, refer to How to Install MySQL Driver in Python .
Read MoreHow to Update a MySQL Table in Python
First, you will need the mysql.connector. If you are unsure of how to get this setup, refer to How to Install MySQL Driver in Python .
Read MoreHow to Drop a MySQL Table in Python
First, you will need the mysql.connector. If you are unsure of how to get this setup, refer to How to Install MySQL Driver in Python .
Read MoreHow to Delete MySQL Records in Python
First, you will need the mysql.connector. If you are unsure of how to get this setup, refer to How to Install MySQL Driver in Python .
Read MoreHow to ORDER BY a MySQL Query in Python
First, you will need the mysql.connector. If you are unsure of how to get this setup, refer to How to Install MySQL Driver in Python .
Read MoreHow to Filter WHERE MySQL Queries in Python
First, you will need the mysql.connector. If you are unsure of how to get this setup, refer to How to Install MySQL Driver in Python .
Read MoreHow to Select From MySQL in Python
First, you will need the mysql.connector. If you are unsure of how to get this setup, refer to How to Install MySQL Driver in Python .
Read MoreHow to Insert into a MySQL Table in Python
If you need to insert data into a MySQL table using Python, then look no further.
Read MoreHow to Create a Primary Key for a MySQL Database in Python
You can create a Primary Key for your MySQL database in Python as follows.
Read MoreHow to Create a MySQL Table in Python
If you need to create a table in a MySQL database using Python, then you can do the following.
Read MoreHow to Create a MySQL Database in Python
In order to create a MySQL database in Python, you first need to initiate a connection using the mysql.
Read MoreHow to Install MySQL Driver in Python
To begin using MySQL in Python, you need to do the following:
Read MoreHow to Resize an AWS EBS Volume in Bash
If you need to resize an EBS volume in AWS, you can do so using bash.
Read MoreHow to get all checked checkboxes in Javascript
If you need to get all the checked checkboxes using Javascript, then you can do the following:
Read MoreHow to Setup Credential Helper for AWS CodeCommit
AWS CodeCommit is a git code repository service by Amazon Web Services.
Read MoreHow to Flex Grid 2 Columns using CSS
If you would like to flex grid 2 columns in CSS then you need three (3) divs.
Read MoreHow to Create a Hashtag Generator in Javascript
If you want to create a hashtag generator in Javascript, then you can do the following:
Read MoreHow to Confirm before Leaving Page in Javascript
You can implement a function to be called before the user leaves a page with Javascript as follows:
Read MoreWhat are the multiples of 3 from 1 to 1000
If you need to calculate the multiples of 3, starting from 1 up until 1000, then you can use the following code:
Read MoreHow to Count Files in Directory on Linux
If you need to count how many files are in a directory on Linux, then you can use a combination of the ls command to list all the files, and the wc command to count how many lines are printed:
Read MoreHow to Read a File Line by Line in Java
If you need to read a file line by line in Java, then you can use one of the following three (3) options.
Read MoreHow can I clear or empty a StringBuilder
You can use Java’s StringBuilder to create and manipulate Strings as follows:
Read MoreHow to Approve a SageMaker model in AWS CLI
Sometimes you will need to manually approve a SageMaker model package from the AWS CLI.
Read MoreHow to Assume Role across Accounts in AWS
If you need to assume role between AWS accounts, or allow an account to assume a role and use resources in another AWS account, then you need to create a role and attach the following policy.
Read MoreHow to Style an Element using Javascript
If you need to style an element using Javascript then you can use the style object to support all your CSS needs.
Read MoreHow to Wait 1 Second in Javascript
If you need your Javascript code to wait one (1) second (or more) while executing, then there are a couple of ways to achieve this.
Read MoreHow to use forEach method in Javascript
Arrays come with a useful forEach function that allows you to loop through the array.
Read MoreHow to Remove an Element from an Array in Javascript
If you need to remove an element from an array in Javascript, then you can use one of the following five (5) options:
Read MoreHow to get the Alphabet as Array in Javascript
If you need to get an array of alphabetical letters in Javascript then you can use one of the following:
Read MoreHow to get the Screen Width in Javascript
Javascript gives a few options to determine the screen width.
Read MoreHow to Read a File in Rust
If you need to read a file in Rust, then you can use the fs package from the standard library:
Read MoreHow to Convert Array to String in Java
If you need to convert an array to a string in Java, then you could look at a solution like this:
Read MoreHow to Join Two Strings Together in Golang
If you need to join two (2) strings together in Golang, you can do the following, using the + concatenation operator:
Read MoreHow to Recursively Delete all Files in an AWS S3 Bucket
If you need to recursively delete all files in an AWS S3 bucket, then you can do the following:
Read MoreHow to Execute Linux Commands in Golang
If you want to execute linux commands in Golang, then you can use exec.
Read MoreHow to Check for Prime Numbers using Golang
If you need to check for Prime Numbers in Golang, then you can use the following method:
Read MoreHow to Raise a Number to a Power in Golang
If you need to raise a number to a power in Golang, then you can use the math.
Read MoreHow to get CPU Frequency in Linux
If you need to get the CPU Frequency in Linux, then you can run the following command:
Read MoreHow to Disable Warning with Python Pandas
How can python pandas disable warnings? If you need to disable warnings with Pandas on Python, then you can use the warnings module and ignore the filter as follows:
Read MoreHow to Get all Caps Alphabet as List in Python
If we take the following list: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] How do we extract only the UpperCase letters of a given word?
Read More[Solved] Error creating RDS DB Instance: IAM role ARN value is not value or does not include the required permissions for: ENHANCED_MONITORING
When you are trying to create an RDS database and you get the dreaded error message:
Read MoreHow to create an AWS Lambda in Terraform
Step 1 – Lambda Code in Python The following code expects a python file with the contents as follows in a file called python/script1.
Read More[Solved] Instance Profile already exists in Terraform
If you get the Instance Profile already exists error when running your Terraform apply, then it is either because an instance profile with that name already existed in the account, or because the previous terraform destroy did not remove it.
Read More[Solved] An error occurred (UnauthorizedException) when calling ListAccounts operation: Session token not found or invalid
If you are using aws configure sso to populate your ~/.
Read MoreHow to Match Multiple Strings with grep
If you need to match a string in a file, then grep is your friend.
Read MoreHow to Invoke an AWS Lambda from the CLI
If you want to invoke an AWS Lambda from your CLI, then the best option is to have the AWS CLI installed.
Read MoreHow to Exit if a Bash Variable in Not Set
Sometimes you might want to exit a command if a variable is not set in Bash.
Read MoreHow to Force Gitlab pipeline to fail on condition
if you have a conditional in your Gitlab pipeline stage that checks if something has succeeded or failed, then you can use this to pass or fail your pipeline stage.
Read MoreHow to run AWS CLI commands based on AWS CLI Version in Bash
If you find yourself having the requirements to support both AWS CLI v1 and v2 simultaneously, then you can use the following conditional in Bash to only run the specific version required:
Read More[Solved] Unknown options: –cli-binary-format AWS CLI
If you have tried calling the AWS CLI and got the following error:
Read MoreHow to Generate Random Strings with Dash in-between in Python
If you need to generate a random string that looks something like this: VUNBXJ-230411, then you can use the following random generator:
Read MoreHow to Check OS version and flavor in Linux
If you need to check the version and flavour of the running Linux instance, then you can try the below commands:
Read MoreHow to use a Backend-Config File for Terraform S3 State Configuration
If you are using S3 as the backend for your state management in Terraform, then you can create environment specific configuration files where you store the bucket, region among other things to be pulled in automatically when switching environments.
Read MoreHow to Refresh State in Terraform
Sometimes your infrastructure may be out of sync with your Terraform state because resources may have been amended or deleted manually.
Read MoreHow to get the Length of an Array in C
There isn’t really a standard way to get the length of array in C.
Read MoreHow to write If/Else Statements in Terraform
If/Else statements are conditional statements that perform decisions based on some known state, or variable.
Read MoreHow to Reset Udemy Progress
If you need to redo a Udemy course and you would like to reset the course’s progress, then you can use the following Javascript snippet below.
Read MoreHow to Get Last Digit of a Large Number in C
The challenge Define a function that takes in two non-negative integers aa_a_ and bb_b_ and returns the last decimal digit of aba^b_a__b_.
Read More[Solved] Network interface is in use by another service in AWS
If you have tried to delete a Security Group, or VPC, or various other resources and you get the dreaded Network interface is in use by another service error, then you can resolve this by deleting the resource through the API.
Read MoreHow to Uninstall npm packages
We typically install an npm package as follows: npm install <package_name> But how do we uninstall an npm package?
Read MoreHow to Sum the Two Lowest Positive Integers in C++
The challenge Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers.
Read MoreHow to Sort an Array of Objects by Property in Javascript
If you need to sort an array of objects by their property values using Javascript, then you don’t need to look further than the built-in sort functionality.
Read MoreHow to create a Countdown Timer in Python
If you need to count down a specific amount of time, say for example, when a token is set to expire, then a countdown timer will be useful.
Read MoreHow to Remove a Resource from Terraform State
Terraform state reflects the most up to date reference of the infrastructure.
Read MoreHow to Delete a Specific Resource in Terraform
Running terraform destroy will tear down the whole stack associated to some terraform code.
Read MoreHow to Create a DynamoDB Lock Table for Terraform
Provision the DynamoDB Table resource "aws_dynamodb_table" "dynamodb-terraform-state-lock" { name = "terraform-state-lock-dynamo" hash_key = "LockID" read_capacity = 20 write_capacity = 20 attribute { name = "LockID" type = "S" } } Configure the DynamoDB table in Terraform Backend terraform { backend "s3" { encrypt = true bucket = "your-unique-bucket-name" dynamodb_table = "terraform-state-lock-dynamo" key = "terraform.
Read MoreHow to add Comments in Terraform
Terraform , a powerful Infrastructure as Code (IaC) tool, allows you to define and provision infrastructure resources.
Read MoreHow to log/debug in Terraform
If you have Terraform reporting an error but want more information, then you can configure debug logging.
Read MoreHow to find the number of trailing zeros of N in Rust
The challenge Write a program that will calculate the number of trailing zeros in a factorial of a given number.
Read MoreHow to do RGB To Hex Conversion in Rust
The challenge The rgb function is incomplete. Complete it so that passing in RGB decimal values will result in a hexadecimal representation being returned.
Read MoreHow to Rename a Git Branch
If you want to rename a git branch, then you have a few options, dependent on the use-case.
Read MoreHow to Find the Shortest Word in C++
The challenge Simple, given a string of words, return the length of the shortest word(s).
Read MoreHow to Square Every Digit in C++
The challenge You are asked to square every digit of a number and concatenate them.
Read MoreHow to Count Vowels in C++
The challenge Return the number (count) of vowels in the given string.
Read MoreHow to Calculate the Sum of the Numbers in the Nth row of a Triangle in Golang
The challenge Given the triangle of consecutive odd numbers: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 .
Read More[Solved] Terraform Error accessing remote module registry in PowerShell
If you are using PowerShell and trying to run a terraform init, you may get an error as follows:
Read MoreHow to Recursively Delete a Directory in PowerShell
If you want to recursively delete a directory/folder using PowerShell, then you have 2 options.
Read More[Solved] npm ERR! could not determine executable to run
If you get the following message, then there’s a very easy fix:
Read More[Solved] npm ERR! path node_modules/node-sass
If you get the following error and need a solution, then look no further!
Read MoreHow to Install Lodash through Yarn for React
You can install lodash through yarn as follows: Step 1 – Install Lodash to get the Library yarn add lodash Step 2 – Get the Typescript info yarn add --dev @types/lodash
Read MoreHow to SHA256 a String in Golang
If you need to SHA256 a String in Go, then you can use the crypto/sha256 package.
Read MoreHow to Base64 Encode/Decode in Golang
Go ships with an encoding/base64 package that allows for encode and decoding of Base64 strings.
Read MoreHow to Base64 Encode a String in Java
Quick solution In short, you can just do this: new String(Base64.
Read MoreHow to add a Lambda Environment Variable in Terraform
If you have an aws_lambda_function block that needs to make use of environment variables, then you can simply do the following:
Read MoreHow to perform Array Element Parity in Golang
The challenge You will be given an array of integers whose elements have both a negative and a positive value, except for one integer that is either only negative or only positive.
Read MoreHow to Reverse Letters in Kotlin
The challenge Given a string str, reverse it omitting all non-alphabetic characters.
Read MoreHow to Get the ASCII Value of Character in Kotlin
The challenge Get the ASCII value of a character. The solution in Kotlin Option 1:
Read MoreHow to update each dependency in package.json to the latest version
You have 2 options: Option 1 – Recommended (Using npx) npx npm-check-updates -u npm install Option 2 – Older way (Using npm globally) npm i -g npm-check-updates ncu -u npm install
Read MoreHow to Convert IPv4 to int32 in Javascript
The challenge Take the following IPv4 address: 128.32.10.1 This address has 4 octets where each octet is a single byte (or 8 bits).
Read MoreHow to Solve the Grouped by Commas Challenge in Javascript
The challenge Finish the solution so that it takes an input n (integer) and returns a string that is the decimal representation of the number grouped by commas after every 3 digits.
Read MoreHow to Save sed Output Directly to a File
You have 3 options here: Option 1: use tee with sed sed 's/Hello/Hi/g' file-name | tee file Option 2: use > with sed sed 's/Hello/Hi/g' file-name > file Option 3: use sed with -i option sed -i 's/Hello/Hi/g' file-name
Read MoreHow to Convert BigNumber to Int/Number in Ethers/Web3
If you have a BigNumber when using web3, then you can convert this to a regular Javascript Number using the ethers library as follows:
Read MoreHow to Create a Pyramid Array in Javascript
The challenge Write a function that when given a number >= 0, returns an Array of ascending length subarrays.
Read MoreHow to Create a Reverse Polish Notation Calculator in Javascript
The challenge Your job is to create a calculator which evaluates expressions in Reverse Polish notation.
Read MoreHow to declare a global variable in React?
If you need to declare a global variable in React, then you can do the following:
Read MoreHow to Find the Missing Term in an Arithmetic Progression in Javascript
The challenge An Arithmetic Progression is defined as one in which there is a constant difference between the consecutive terms of a given series of numbers.
Read MoreHow to Count Characters in a Javascript String
The challenge The main idea is to count all the occurring characters in a string.
Read MoreHow to Increment/Decrement a value in React/NextJS
Use the following code block to get started: function GetCount() { const [count, setCount] = useState(1); const incrementCounter = () => { setCount(count+1) } const decrementCounter = () => { if (count>1) setCount(count-1) } return <div className="_counterWrapper"> <span className="_dec" onClick={() => decrementCounter()}>-</span> <span className="_val">{count}</span> <span className="_inc" onClick={() => incrementCounter()}>+</span> </div> } Then in your HTML code, add it like this:
Read MoreHow to disable text selection highlighting in CSS
If you would like to disable the text selection highlighting that is enabled by default on all browsers, then you can do this:
Read MoreIrreducible Sum of Rationals in Golang
The challenge You will have a list of rationals in the form:
Read MoreHow to copy S3 objects between AWS accounts
In your source account create a customer-managed policy: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:GetObject" ], "Resource": [ "arn:aws:s3:::source-EXAMPLE-BUCKET", "arn:aws:s3:::source-EXAMPLE-BUCKET/*" ] }, { "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:PutObject", "s3:PutObjectAcl" ], "Resource": [ "arn:aws:s3:::destination-EXAMPLE-BUCKET", "arn:aws:s3:::destination-EXAMPLE-BUCKET/*" ] } ] } In your destination bucket, update the bucket policy:
Read MoreHow to find all symlinks in a directory tree on Mac
If you need to recursively find all symbolic links in a directory tree on a Mac, then you have a couple of options.
Read MoreHow to Install App Mesh on AWS EKS
You can follow the steps below to install App Mesh on AWS EKS (Kubernetes).
Read More[Solved] Kubernetes Namespace stuck in Terminating state
If you have tried to delete a Kubernetes namespace, and it has been hanging in ‘deleting’ for hours on end, it’s likely that you have dangling resources that have not deleted yet.
Read More[Solved] Error creating: pods “my-service-a-xxx” is forbidden: error looking up service account my-apps/my-service-a: serviceaccount “my-service-a” not found
So you’ve run a deployment and tried to check the pods and there’s nothing there!
Read More[Solved] error: src refspec main does not match any
If you get the following error: error: src refspec main does not match any error: failed to push some refs to 'https://github.
Read MoreHow to Force a Redeploy in Kubernetes
If you need to force a redeploy of a deployment in Kubernetes , then you can use the rollout feature.
Read MoreHow to Print to stdout in Flask using Python
If you are trying to print() to the console/stdout in your Flask app, but nothing is happening, then you just need to flush your prints, as follows:
Read MoreHow to Restart a Deployment in Kubernetes
If you need to restart a deployment in Kubernetes, perhaps because you would like to force a cycle of pods, then you can do the following:
Read MoreHow to push multiple Dockerfile apps to AWS ECR at the same time
I have a parent directory containing multiple sub-directories. Each of these child directories is a different application and contains a Dockerfile.
Read MoreHow to Create a Horizontal Pod Autoscaler in Kubernetes
If you could like to a create a Horizontal Pod Autoscaler (hpa) in Kubernetes, then you could run the following:
Read MoreHow to Run a Load Generator on Kubernetes
If you would like to test hpa, Horizontal Pod Autoscaling, or throw some chaos at a specific deployment in Kubernetes , then you could run a Load Generator
Read MoreHow to Deploy a Metrics Server in Kubernetes
If you would like to deploy a Metrics Server in Kubernetes , then you first need to create a namespace for it to live it, followed by installing the actual metrics server.
Read MoreHow to create an AWS EKS cluster using eksctl
eksctl dramatically simplifies the creation of AWS EKS clusters, by providing a simple command-line interface.
Read MoreHow to Dockerize a Flask App
If you have a Flask app that you would like packaged in a Docker container, then you can do the following.
Read MoreHow to get an EKS Cluster name from an AWS Region
You can use the aws cli to get the EKS cluster name, parse the first result and return it into a variable.
Read MoreHow to automatically generate a Manifests file in Kubernetes
If you want to automatically generate a manifest file in Kubernetes, you can do so by using the kubectl run command coupled with a --dry-run to output directly to yaml.
Read MoreHow to Sort Pods by CreationTimestamp in Kubernetes
If you need to sort a list of your pods by their CreationTimestamp, then do the following:
Read MoreHow to Jump onto a Kubernetes Pod with Bash
If you want to jump onto a particular Kubernetes Pod and run Bash within it, you can do so as follows:
Read MoreHow to run Shell Commands in a Kubernetes Cluster
If you would like to run shell commands inside of your Kubernetes cluster, then you can use the kubectl run command.
Read MoreHow to Bulk Move All Email from One Account to Another using the CLI
If you find yourself in a position where you need to sync all emails from one account to another, then you can use the imapsync command-line tool to bulk copy, or move everything for you.
Read MoreHow to Install AWS CLI on Linux
You can download and install the AWS CLI on Linux as follows:
Read MoreHow to Reboot Networking on Mac from CLI
If you need to reboot, or restart the networking interface on your Mac, by using the CLI, then you can issue the following commands:
Read More[Solved] fatal: unable to access <git>: SSL certificate problem: self signed certificate in certificate chain
If you get the following error: fatal: unable to access <git>: SSL certificate problem: self signed certificate in certificate chain
Read MoreHow to Extract the Files in a Docker Image
Ever needed to extract the files in a Docker container?
Read More[Solved] Error response from daemon: No such image: Docker
If you’ve run into this dreaded error: Error response from daemon: No such image:
Read MoreHow to Bootstrap a Web Server on AWS EC2
When you launch an EC2 instance, you can use the user-data to bootstrap a instance creation script.
Read MoreHow to Update Kubectl Config from AWS EKS
Ever searched for kubectl update config from aws eks and needed a quick result?
Read MoreHow to Generate a Random String in Java
Java provides many ways to generate random strings. 1. Using Apache Commons public void generatingRandomAlphanumericString_ApacheCommons() { String generatedString = RandomStringUtils.
Read MoreHow to Generate a Random String in Python
Python gives the ability to generate random strings out of the box, by using a combination of the string and random modules.
Read MoreHow to Generate a Random Number/String in Terraform
If you need to generate a random number or string in Terraform, then you can use the following:
Read More[Solved] Unable to connect to the server: dial tcp: lookup with AWS EKS
If you have received the following error while trying to issue commands to kubectl:
Read MoreHow to Store Terraform State in AWS S3
Storing Terraform states files locally is not recommended. Instead you should use a backend such as as S3 from AWS.
Read More[Solved] ZipArchive extension: disabled/not installed on Ubuntu
If you have come across the following error: ZipArchive extension: <strong>disabled/not installed</strong>
Read MoreCalculating Cartesian Neighbors Distance in Golang
The challenge We have been searching for all the neighboring points in a Cartesian coordinate system.
Read MoreHow to Calculate Dominant Primes in Golang
The challenge The prime number sequence starts with: 2,3,5,7,11,13,17,19.... Notice that 2 is in position one.
Read More[Solved] error: src refspec main does not match
When you first try and push to a git repository, you may get the following error message:
Read MoreHow to Solve Simple Square Numbers in Golang
The challenge In this challenge, you will be given a number n (n > 0) and your task will be to return the smallest square number N (N > 0) such that n + N is also a perfect square.
Read MoreHow to perform Function Iteration in Golang
The challenge The purpose of this challenge is to write a higher-order function returning a new function that iterates on a specified function a given number of times.
Read MoreDetermining Integer Depth in Python
The challenge The depth of an integer n is defined to be how many multiples of n it is necessary to compute before all 10 digits have appeared at least once in some multiple.
Read MoreHow to Reverse a singly-linked list in Python
The challenge Implement a function reverse_list that takes a singly-linked list of nodes and returns a matching list in the reverse order.
Read MoreCalculating Simple Time Difference in Python
The challenge In this challenge, you will be given a series of times at which an alarm goes off.
Read MoreCalculating Odd/Even number of divisors in Python
The challenge Given an integer n return "odd" if the number of its divisors is odd.
Read MoreCalculate possibilities of throwing a coin N times in Python
The challenge In this challenge, you will be given an integer n, which is the number of times that is thrown a coin.
Read MoreHow to Convert Integer to Whitespace format in Python
The challenge Hereinafter, [space] refers to " ", [tab] refers to "\t", and [LF] refers to "\n" for illustrative purposes.
Read MoreHow to Perform Frog Jumping in Python
The challenge You have an array of integers and have a frog at the first position
Read MoreHow to Calculate the area of a regular N sides polygon inside a circle of radius R in Python
The challenge Write the following function: def area_of_polygon_inside_circle(circle_radius, number_of_sides): It should calculate the area of a regular polygon of numberOfSides, number-of-sides, or number_of_sides sides inside a circle of radius circleRadius, circle-radius, or circle_radius which passes through all the vertices of the polygon (such a circle is called circumscribed circle or circumcircle).
Read MoreHow to create an Image Host Filename Generator in Python
The challenge You are developing an image hosting website. You have to create a function for generating random and unique image filenames.
Read MoreHow to Find the Missing Alphabets in Python
The challenge Task Given string s, which contains only letters from a to z in lowercase.
Read MoreHow to move MySQL database to another drive
Step 1: Login to your MySQL server, enter your password when prompted:
Read MoreHow to Find the Sum of Prime-Indexed Elements in Go
The challenge You will be given an integer array and your task is to return the sum of elements occupying prime-numbered indices.
Read MoreHow to Find the Longest Substring in Alphabetical Order in Python
The challenge Find the longest substring in alphabetical order. Example:
Read MoreCalculate the Most Frequent Weekdays in Go
The challenge What is your favourite day of the week? Check if it’s the most frequent day of the week in the year.
Read MoreReturn Index of Matching Closing Bracket in Go
The challenge In this challenge, you will be given a string with brackets and an index of an opening bracket and your task will be to return the index of the matching closing bracket.
Read MoreHow to Presign an S3 URL in AWS using AWS CLI
You can use the AWS CLI to presign URLs so that objects in S3 can be shared publicly even if they are set as private.
Read MoreHow to Download using Aria2c with Multiple Connections
If you use aria2c to download files using the command-line, then you can also use it to download using multiple connections.
Read MoreHow to Parse HTML/CSS Colors in Java
The challenge In this challenge, you parse RGB colors represented by strings.
Read MoreSolving Simple Transposition in Java
The challenge Simple transposition is a basic and simple cryptography technique.
Read MoreHow to Binary to Text (ASCII) Conversion in Python
The challenge Write a function that takes in a binary string and returns the equivalent decoded text (the text is ASCII encoded).
Read MoreHow to Find the Row of the Odd Triangle in Python
The challenge Given a triangle of consecutive odd numbers: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 .
Read MoreSolving Number Zoo Patrol in Python
The challenge Write a function that takes a shuffled list of unique numbers from 1 to n with one element missing (which can be any number including n).
Read MoreCommon AWS CDK CLI Commands
The AWS Cloud Development Kit (CDK) comes with numerous CLI commands.
Read MoreHow to Create an S3 bucket with PublicRead in CloudFormation
AWSTemplateFormatVersion: 2010-09-09 Description: Basic S3 Bucket CloudFormation template Resources: S3BucketForWebsiteContent: Type: AWS::S3::Bucket Properties: AccessControl: PublicRead Outputs: BucketName: Value: !
Read MoreHow to Create a VPC in CloudFormation
It’s very easy to deploy a VPC using CloudFormation: AWSTemplateFormatVersion: 2010-09-09 Description: Deploy a VPC Resources: VPC: Type: AWS::EC2::VPC Properties: CidrBlock: 10.
Read MoreHow to Setup Git on EC2 for AWS CodeCommit
Connect to the instance: chmod 400 KEYPAIR.pem ssh -i KEYPAIR.pem ec2-user@EC2PublicIP Install Git:
Read MoreThe Difference of 2 in Java
The challenge The objective is to return all pairs of integers from a given array of integers that have a difference of 2.
Read MoreHow to Make the Deadfish Swim in Java
The challenge Write a simple parser that will parse and run Deadfish.
Read MoreHow to Write Number in Expanded Form in Java
The challenge You will be given a number and you will need to return it as a string in Expanded Form.
Read MoreIs a Number Prime in Java
The challenge Define a function that takes one integer argument and returns a logical value true or false depending on if the integer is a prime.
Read MoreHow to Calculate Minutes to Midnight in Java
The challenge Write a function minutesToMidnight(d) that will take a date object as the parameter.
Read MoreHow to Change the Timestamp of a File on Mac/Linux
If you have a file on your machine, and you want to change the created/modified time/date stamp, then you can use the touch command.
Read MoreHow to Round up to the Next Multiple of 5 in Python
The challenge Given an integer as input, can you round it to the next (meaning, “higher”) multiple of 5?
Read MoreHow to get the Sum of the First nth Term of a Series in Java
The challenge Your task is to write a function that returns the sum of the following series up to nth term(parameter).
Read MoreHow to satisfy Wilson Primes in Python
The challenge Wilson primes satisfy the following condition. Let P represent a prime number.
Read MoreHow to Boot an EC2 with a WebServer Setup
Create a new AWS EC2 instance, and set the User Script to the following:
Read MoreWriting a Sleigh Authentication in Python
The challenge Christmas is coming and many people dreamed of having a ride with Santa’s sleigh.
Read MoreSolving for Multiple of Index in Python
The challenge Return a new array consisting of elements which are multiple of their own index in input array (length > 1).
Read MoreHow to Find an item’s Alphabet Position in Python
The challenge When provided with a letter, return its position in the alphabet.
Read MoreHow to Keep up the Hoop in Java
The challenge Alex just got a new hula hoop, he loves it but feels discouraged because his little brother is better than him
Read MoreWill there be Enough Space in Java
The challenge Bob is working as a bus driver. However, he has become extremely popular amongst the city’s residents.
Read MoreHow to Swap Node Pairs In Linked List in Java
The challenge If you are given the head node in a linked list, write a method that swaps each pair of nodes in the list, then returns the head node of the list.
Read MoreHow to Solve ‘Finding Neo’ in Java
The challenge Neo is somewhere in the Matrix. public interface Matrix { public int size(); public int get(int x, int y); } You are Morpheus, and your job is to find him.
Read MoreHow to Solve a Pandigital Sequence in Java
The challenge In mathematics, a pandigital number is a number that in a given base has among its significant digits each digit used in the base at least once.
Read MoreHow to get Meta-Data information from an AWS EC2 Instance
If you need to query meta-data information from your running EC2 instance, you can curl the following location:
Read MoreHow to write a Lazy Repeater Helper in Python
The challenge The make_looper() function takes a string (of non-zero length) as an argument.
Read MoreHow to write a String Case Conversion Helper in Python
The challenge In this challenge, you will make a function that converts between camelCase, snake_case, and kebab-case.
Read MoreHow to create Interleaving Arrays in Python
The challenge Create a function, that accepts an arbitrary number of arrays and returns a single array generated by alternately appending elements from the passed-in arguments.
Read MoreHow to Find the Largest product in a Series in Python
The challenge Complete the greatestProduct method so that it’ll find the greatest product of five consecutive digits in the given string of digits.
Read MoreHow to Calculate the Least Common Multiple in Python
The challenge Write a function that calculates the least common multiple of its arguments; each argument is assumed to be a non-negative integer.
Read MoreHow to Solve Caesar Cipher Helper in Python
The challenge Write a class that, when given a string, will return an uppercase string with each letter shifted forward in the alphabet by however many spots the cipher was initialized to.
Read MoreHow to Write Out Numbers in Python
The challenge Create a function that transforms any positive number to a string representing the number in words.
Read MoreHow to do Base64 Encoding in Python
The challenge Create a function that converts the value of the String to and from Base64 using the ASCII character set.
Read MoreHow to Calculate Transport on Vacation in Java
The challenge After a hard quarter in the office you decide to get some rest on a vacation.
Read MorePlaying with the letter ‘E’ in Java
The challenge Given String str, return: If given String doesn’t contain any “e”, return: “There is no “e”.
Read MoreHow to Sum the Average for NBA Players in Golang
The challenge Write a function, called sumPPG, that takes two NBA player objects/struct/Hash/Dict/Class and sums their PPG
Read MoreHow to Compute a Cube as Sums in Golang
The challenge You will be given a number n (where n >= 1) and your task is to find n consecutive odd numbers whose sum is exactly the cube of n.
Read MoreThe Deaf Rats of Hamelin Challenge in Java
The challenge The Pied Piper has been enlisted to play his magical tune and coax all the rats out of town.
Read MoreHow to Find the Next Perfect Square in Java
The challenge You might know some pretty large perfect squares. But what about the NEXT one?
Read MoreHow to Find the Unique String in Python
The challenge There is an array of strings. All strings contain similar letters except one.
Read MoreHow to convert a PascalCase string into snake_case in Python
The challenge Complete the function/method so that it takes a PascalCase string and returns the string in snake_case notation.
Read MoreHow to Convert a Hex String to RGB in Python
The challenge When working with color values it can sometimes be useful to extract the individual red, green, and blue (RGB) component values for a color.
Read MoreHow to Create a Hashtag Generator in Python
The challenge Write a hashtag generator function that takes a string and returns a #HashCodeString of it.
Read MoreHow to Move Zeros to the End in Python
The challenge Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements.
Read MoreRegex for Gregorian Date Validation in Python
The challenge Write a regular expression that validates the gregorian date in the format “DD.
Read MoreHow to Create Your Own Python Split Function
The challenge Write your own implementation of the built-in split function in Python.
Read MoreHow to create a Domain Name Validator in Python
The challenge Create a domain name validator mostly compliant with RFC 1035, RFC 1123, and RFC 2181
Read MoreHow to start Java Jar as Service on Linux
If you have a Java Jar file, you can run it as a service under Linux/Ubuntu.
Read MoreHow to write a validDate Regex in Python
The challenge Your task is to write a regular expression (regex) that will match a string only if it contains at least one valid date, in the format [mm-dd] (that is, a two-digit month, followed by a dash, followed by a two-digit date, surrounded by square brackets).
Read MoreHow to Validate Passwords with Regex in Python
The challenge You need to write regex that will validate a password to make sure it meets the following criteria:
Read MoreHow to create a Coordinates Validator in Golang
The challenge You need to create a function that will validate if given parameters are valid geographical coordinates.
Read MoreHow to Validate ISBN-10 numbers in Golang
The challenge ISBN-10 identifiers are ten digits long. The first nine characters are digits 0-9.
Read MoreHow to Create a Java GUI App that shows the Logged-in User and Hostname
Create a new file called Application.java and paste the following:
Read MoreHow to view a Terraform Module’s Output
An output in Terraform is a way to view the result of an action that has been performed, or resource that has been created.
Read MoreHow to Count the Characters in Python
The challenge The goal of this challenge is to write a function that takes two inputs: a string and a character.
Read MoreHow to Install Cuda driver for Nvidia on Ubuntu
If you have just upgraded Ubuntu on your AWS g4dn instance and need to install/reinstall Cuda drivers for your Nvidia chipset, then you can run the following:
Read MoreHow to List all Running Services on Ubuntu
If you need to view a list of all the services that are either running or stopped (or both) on an Ubuntu server, then you can use the following command:
Read More[Solved] conflict: unable to remove repository reference in Docker
If you get the following error while trying to delete an image in Docker:
Read MoreHow to Upgrade an Ubuntu Server
Upgrading an Ubuntu Server is quite easy, just follow the below commands:
Read MoreHow to Solve Two-Sum in Java
The challenge Write a function that takes an array of numbers (integers for the tests) and a target number.
Read MoreHow to Sort the Gift Code in Java
The challenge Santa’s senior gift organizer Elf developed a way to represent up to 26 gifts by assigning a unique alphabetical character to each gift.
Read MoreHow to get the Numericals of a String in Java
You are given an input string. For each symbol in the string if it’s the first character occurrence, replace it with a ‘1’, else replace it with the amount of times you’ve already seen it.
Read MoreHow to Replace Noun Phrases with Pronouns in Golang
The challenge A Noun Phrase is a phrase that can be replaced by a pronoun [he/she/it].
Read MoreMaximum Positive Integer Rotations in Golang
The challenge Write function MaxRot(n) which given a positive integer n returns the maximum number you got doing rotations similar to the above example.
Read MoreHow to “Dashatize It” in Java
The challenge Given a variable n, If n is an integer, Return a string with dash'-'marks before and after each odd integer, but do not begin or end the string with a dash mark.
Read MoreHow to create a Nickname Generator in Python
The challenge Write a nickname generator function, nicknameGenerator that takes a string name as an argument and returns the first 3 or 4 letters as a nickname.
Read MoreComparing Array Multiplicities in Java
The challenge Given two arrays a and b write a function comp(a, b) (orcompSame(a, b)) that checks whether the two arrays have the “same” elements, with the same multiplicities.
Read MoreHow to Find the Sum of Angles in Golang
The challenge Find the total sum of internal angles (in degrees) in an n-sided simple polygon.
Read MoreHow to Find the Max Tree Node Value in Java
The challenge You are given a binary tree. Implement the method findMax which returns the maximal node value in the tree.
Read MoreHow to String Search with a Wildcard in Java
The challenge The method below is the most simple string search algorithm.
Read MoreHow to get the AWS AccountID in Terraform
If you are automating AWS resources in Terraform, then you will want to not hardcode things as much as possible.
Read MoreError creating AppStream Fleet – InvalidRoleException
If you get the following error when trying to run some Terraform:
Read MoreHow to Create AWS AppStream resources in Terraform
AWS AppStream has finally made its way into the Terraform AWS Provider.
Read MoreHow to Stop a Goroutine in Golang
It’s possible to stop a Goroutine by sending a value into it via a signal channel:
Read MoreHow to Create an Empty Branch in Git
If you need to create an empty branch in git, you can follow one of the below options.
Read MoreGet the Consonant Value in Java
The challenge Given a lowercase string that has alphabetic characters only and no spaces, return the highest value of consonant substrings.
Read MoreHow to Check for Factor in Python
The challenge This function should test if the factor is a factor of base.
Read MoreUnderstanding Bitwise Operators in Python
There are 6 binary/bitwise operators in Python: Complement/Not (~) And (&) Or (|) XOR (^) Left Shift (<<) Right Shift (>>) A fantastic python method to help us along our journey is bin().
Read MoreWord Values Challenge in Java
The challenge Given a string "abc" and assuming that each letter in the string has a value equal to its position in the alphabet, our string will have a value of 1 + 2 + 3 = 6.
Read MoreHow to update/upgrade all Homebrew packages
If you use Homebrew – and you probably should if you’re on a Mac – then you have probably installed various different applications and packages as time went on.
Read More[Solved] FirebaseError: Missing or insufficient permissions
Using Firebase and get the following error in the console?
Read More[Solved] Error: Cannot find module ‘../lib/cli.js’
If you try and run npm i and get Error: Cannot find module '.
Read MoreHow to use Git Commit in GitHub Actions
If you’ve tried to use git commit in GitHub Actions before, you may have come across the following error messages:
Read More[Solved] Error acquiring the state lock in Terraform
If you have been handed the Acquiring state lock error message about ConditionalCheckFailedException: The conditional request then you have 2 options for fixing it!
Read MoreHow to Install Chocolatey on Windows PowerShell
Chocolatey is a software management automation for Windows that wraps installers, executables, zips, and scripts into compiled packages chocolatey.
Read MoreHow to run PowerShell in Administrator Mode
Some PowerShell commands require elevated permissions to complete. To do this, you must first open PowerShell in Administrator Mode.
Read More[Solved] Permission denied @ apply2files – /usr/local/lib/node_modules/expo-cli/node_modules/extglob/lib
If you have recently upgraded your MacOS operating system, you may get the following error in your terminal when installing some Homebrew packages:
Read MoreHow to Fix “is not authorized to create managed-rule” in AWS Step Functions
If you have ever received the following error is not authorized to create managed-rule when running a Step Function through Terraform’s AWS Provider, then you may have jumped through many different hoops trying to figure out what was wrong.
Read MoreHow to add Account Condition to AWS Lambda Permissions in Terraform
If you need to lock an AWS Lambda function down to a source account for security reasons (PCI.
Read MoreHow to AssumeRole in Terraform LocalExec Provisioner Block
I needed to execute a Terraform null_resource provisioner (local-exec) block to run an awscli command, but assume a role passed down to it.
Read MoreSplit and then add both sides of an array together in Java
The challenge You will receive an array as a parameter that contains 1 or more integers and a number n.
Read MoreHighest Rank Number in an Array in Golang
The challenge Complete the method which returns the number which is most frequent in the given input array.
Read MoreSort Words by Position Index in Java
The challenge Your task is to sort a given string. Each word in the string will contain a single number.
Read MoreHow to get the Current Machine Name and Logged In User in Java
It’s very easy to get the current machine name and logged in user using Java.
Read MoreHow to set ZSH as your default Shell
You may have installed ZSH and every-time you open your terminal, it opens BASH by default.
Read MoreHow to Base64 Encode/Decode in the Terminal/CLI
If you need to either Encode or Decode a Base64 value, there are many ways to achieve this, one of them is directly from your commandline itself!
Read MoreHow to Enable Syntax Highlighting in Vim
There are a few different ways to enable Syntax Highlighting in Vim.
Read MoreHow to Create an AWS Security Group in Terraform - Securing AWS Resources with Terraform Security Groups
Security groups are a critical component for securing resources in AWS.
Read MoreHow to Create an AWS Security Group in CloudFormation
Below is a simple CloudFormation script block to create a Security Group in AWS.
Read MoreHow to provide Default Values for AWS CloudFormation Parameters
AWS CloudFormation is very useful for creating template-able infrastructure definitions.
Read MoreHow to Validate an AWS CloudFormation Template
The AWS CLI comes with a useful subcommand to validate a CloudFormation template.
Read MoreHow to Reverse Sort Integers in Go
The challenge The two oldest ages function/method needs to be completed.
Read MoreHow to view the Encoded Authorization Failure Message in AWS
You may come across a message that reads similar to the following:
Read MoreHow to run/execute a program from Terraform
If you need to run a local application from your Terraform scripts, you can call out to the provisioner local-exec and issue the command syntax:
Read MoreHow to script AWS AppStream 2.0 ImageBuilder
AppStream (2.0) is a fully managed non-persistent desktop and application service for remotely accessing your work.
Read MoreHow to Reimplement the Unix Uniq Command in Golang
The challenge Implement a function which behaves like the uniq command in UNIX.
Read MoreHow to install GraalVM on Mac
Install GraalVM with Homebrew Homebrew is the preferred way to install anything on your Mac.
Read MoreHow to Generate Random Integers with a Range in Java
Java comes with many different ways to generate random integers, even if you need to specify a lower and upper bound to constrain your required value for.
Read MoreHow to create ArrayList from Array in Java
The problem If you have a traditional array, that looks something like the following:
Read MoreHow to Generate a Random AlphNumeric String in Linux/MacOS
If you need to generate a random AlphaNumeric string from the Linux/MacOS Command-Line, then you can use the following script:
Read MoreHow to check if a string is empty in Go
If you need to check if a string is empty in Go, then there are two possible ways to immediately verify this:
Read MoreHow to read a file line by line in Go
If you need to read a file line by line in Go, then you can use the bufio package as follows:
Read MoreFloating-point Approximation in Golang
The challenge Consider the function f: x -> sqrt(1 + x) - 1 at x = 1e-15.
Read MoreAll the Ways to Divide an Array in Two in Golang
The challenge Write a function partlist that gives all the ways to divide an array of at least two elements into two non-empty parts.
Read MoreHow to check if a file exists in Go
If you need to check if a file exists using Go, then you can use one of the following methods, depending on the version of Go you may be using.
Read MoreHow to convert a string value to an int in Go
If you need to convert a string to an int in Go, then you should use the strconv.
Read MoreHow to convert an int value to string in Go
If you need to convert an int to a string in Go, then you should use the strconv.
Read MoreHow to Efficiently Concatenate Strings in Go
If you are using a version of Go >= 1.10, then you should be using the newer strings.
Read MoreHow to check if a map contains a key in Go
If you have a map in Go and want to only perform an action if it contains a certain key, then you can do so easily:
Read MoreHow to Remove all Vowels from a String in Java
The challenge Remove all vowels from the string. Vowels: a e i o u A E I O U The solution in Java code Option 1:
Read MoreHow to Loop Forever in Golang
If you need to loop forever, or infinitely, in your Go code, then you have 2 options:
Read MoreUnderstanding For Loops in Golang
In Golang a for loop is a way to loop through an iterable.
Read More[Solved] go mod init: modules disabled by GO111MODULE=off
You’ve probably just tried to initialise a new Go module, and received the following error:
Read MoreHow to UpperCase the start of each Word in a String in Golang
The challenge The task is to take a string of lower-cased words and convert the sentence to upper-case the first letter/character of each word
Read MoreHow to Solve Max-Min Arrays in Java
The challenge You are given an array of unique elements, and your task is to rearrange the values so that the first max value is followed by the first minimum, followed by second max value then second min value, etc.
Read MoreHow to Find the Smallest Integer in the Array in Golang
The challenge Given an array of integers your solution should find the smallest integer.
Read MoreHow to do Basic Encryption in Java
The challenge The most basic encryption method is to map a char to another char by a certain math rule.
Read MoreForming Unique Array Combinations in Golang
The challenge You are given an array of arrays and your task will be to return the number of unique arrays that can be formed by picking exactly one element from each subarray.
Read MoreHow to Check if String is a Palindrome in Python
The challenge Write a function that checks if a given string (case insensitive) is a palindrome.
Read MoreHow to Find the Squares in Java
The challenge Complete the function that takes an odd integer (0 < n < 1000000) which is the difference between two consecutive perfect squares, and return these squares as a string in the format "bigger-smaller".
Read MoreHow to Get Longest Word in Sentence in Java
The challenge When given a string of space-separated words, return the word with the longest length.
Read MoreHow to Sum all the Integers in a String in Golang
The challenge Implement a function that calculates the sum of the integers inside a string.
Read MoreHow to Reverse a String in Golang
The challenge Complete the solution so that it reverses the string passed into it.
Read MoreMaximum Different of Int-Array in Java
The challenge You must implement a function that returns the difference between the biggest and the smallest value in a list(lst) received as a parameter.
Read MoreIndexed Capitalization in Java
The challenge Given a string and an array of integers representing indices, capitalize all letters at the given indices.
Read MoreHow to Spacify a String in Java
The challenge Modify the spacify function so that it returns the given string with spaces inserted between each character.
Read MoreHow to Find the Last Digit of a Huge Number in Golang
The challenge For a given list [x1, x2, x3, ..., xn] compute the last (decimal) digit of x1 ^ (x2 ^ (x3 ^ (.
Read MoreFind the Maximum Length Difference between Lists/Arrays in Python
The challenge You are given two arrays a1 and a2 of strings.
Read MoreHow to Circularly Sort an Array in Golang
The challenge An array is circularly sorted if the elements are sorted in ascending order but displaced, or rotated, by any number of steps.
Read MoreLargest Number Groupings in String in Python
The challenge You are be given a string that has lowercase letters and numbers.
Read MoreHow to Alternate String Casing in Golang
The challenge Write a function toWeirdCase (weirdcase in Ruby) that accepts a string, and returns the same string with all even indexed characters in each word uppercased, and all odd indexed characters in each word lowercased.
Read MoreHow to Sort a List of Numbers in Python
The challenge Finish the solution so that it sorts the passed-in array/list of numbers.
Read MoreHow to Validate Usernames with Regex in Java
The challenge Write a simple regex to validate a username. Allowed characters are:
Read MoreSort Lexicographical Order of Substrings in Java
The challenge Given two arrays of strings a1 and a2 return a sorted array r in lexicographical order of the strings of a1 which are substrings of strings of a2.
Read MoreHow to Perform Alphabetical Addition in Java
The challenge Your task is to add up letters to one letter.
Read MoreRoman Numerals Decoder in Golang
The challenge Create a function that takes a Roman numeral as its argument and returns its value as a numeric decimal integer.
Read MoreHow to Subtract from Time in Golang
The challenge Clock shows h hours, m minutes and s seconds after midnight.
Read MoreHow to Encrypt Words in Java
The challenge You want to create secret messages which must be deciphered.
Read MoreBit Counting in Golang
The challenge Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary representation of that number.
Read MoreHow to Find Next Higher Number with Same Bits in Golang
The challenge Find the next higher number (int) with same ‘1’- Bits.
Read MoreHow to Find the First Non-Repeating Character in Golang
The challenge Write a function named first_non_repeating_letter that takes a string input, and returns the first character that is not repeated anywhere in the string.
Read MoreHow to Find the Last Fibonacci Digit in Golang
The challenge Return the last digit of the nth element in the Fibonacci sequence (starting with 1,1, to be extra clear, not with 0,1 or other numbers).
Read MoreHow to Validate an IP Address in Golang
The challenge Write an algorithm that will identify valid IPv4 addresses in dot-decimal format.
Read MoreHow to Fold an Array in Java
The challenge In this challenge, you have to write a method that folds a given array of integers by the middle x-times.
Read MoreFormatting Strings with Fmt in Golang
Fmt provides printing to standard output (usually the console) and formatting of strings capabilities.
Read MoreDelete Occurrences of an Element if it occurs more than N times in Java
The challenge Given a list lst and a number N, create a new list that contains each number of lst at most N times without reordering.
Read MoreHow to Read from Standard Input in Golang
Reading from “standard input” is really useful if you are making a command-line application and require user input.
Read MoreHow to Install Golang on WSL/WSL2
If you need to install Golang on WSL under Windows 10 or higher, you can follow these few steps.
Read MoreHow to Validate Phone Numbers in Java
The challenge Write a function that accepts a string, and returns true if it is in the form of a phone number.
Read MoreHow to Sort Array by Frequency in Java
The challenge Sort elements in an array by decreasing frequency of elements.
Read MoreHow to Calculate String Rotation in Java
The challenge Write a function that receives two strings and returns n, where n is equal to the number of characters we should shift the first string forward to match the second.
Read MoreCompare Strings by Sum of Chars in Java
The challenge Compare two strings by comparing the sum of their values (ASCII character code).
Read MoreHow to Add Two Integers Without Arithmetic Operator in Java
The challenge Given two integers a, b, find The sum of them, BUT You are not allowed to use the operators + and –
Read MoreCounting Method VarArgs in Java
The challenge Count how many arguments a method is called with.
Read MoreHow to Sum Consecutives in Java
The challenge You are given a list/array which contains only integers (positive and negative).
Read MoreReplacing Occurences of Words in Java
The challenge You are given a string. You must replace any occurrence of the sequence coverage by covfefe, however, if you don’t find the word coverage in the string, you must add covfefe at the end of the string with a leading space.
Read MoreConvert String to LeetSpeak in Java
The challenge Your task is to write a function toLeetSpeak that converts a regular english sentence to Leetspeak.
Read MoreOrdered Count of Characters in Python
The challenge Count the number of occurrences of each character and return it as a list of tuples in order of appearance.
Read MoreCredit Card Issuer Checking in Java
The challenge Given a credit card number we can determine who the issuer/vendor is with a few basic knowns.
Read MoreFind Count of Most Frequent Item in an Array in Java
The challenge Complete the function to find the count of the most frequent item of an array.
Read MoreReturn Nth Smallest Element in Java
The challenge Given an array/list [] of integers, Find the Nth smallest element in this array of integers
Read MoreWhat temperature does your Mac CPU idle at?
Sometimes you will find that your Mac is running very hot, and you may want to keep track of it over time to see if it’s persistent or only a spike.
Read MoreSplit String into Parts in Java
The challenge Split a given string into different strings of equal size.
Read More[Solved] ERROR 1030 (HY000): Got error 168 from storage engine
If you are getting the following error in MySQL: ERROR 1030 (HY000): Got error 168 from storage engine
Read MoreLargest Pair Sum in Array in Python
The challenge Given a sequence of numbers, find the largest pair sum in the sequence.
Read MoreAlphabet Symmetry in Python
The challenge Consider the word "abode". We can see that the letter a is in position 1 and b is in position 2.
Read MoreExes and Ohs in Java
The challenge Check to see if a string has the same amount of ‘x’s and ‘o’s.
Read MoreSum of Odd Cubed Numbers in Python
The challenge Find the sum of the odd numbers within an array, after cubing the initial integers.
Read MoreHalving Sum in Python
The challenge Given a positive integer n, calculate the following sum:
Read MoreConvert a LinkedList to a String in Python
The challenge Preloaded for you is a class, struct, or derived data type Node (depending on the language) used to construct linked lists in this challenge:
Read MoreMost Digits from List in Python
The challenge Find the number with the most digits. If two numbers in the argument array have the same number of digits, return the first one in the array.
Read MoreCheck if all Values in Array are Smaller in Python
The challenge You will be given an array and a limit value.
Read MoreMaximum Product from List of Integers in Python
The challenge Given an array of integers, Find the maximum product obtained from multiplying 2 adjacent numbers in the array.
Read MoreSum of Array Singles in Python
The challenge You are given an array of numbers in which two numbers occur once and the rest occur only twice.
Read MoreFlatten and Sort an Array in Python
The challenge Given a two-dimensional array of integers, return the flattened version of the array with all the integers in the sorted (ascending) order.
Read MorePlaying the Alphabet War in Python
The challenge Introduction There is a war and nobody knows – the alphabet war!
Read MoreSum of numbers from 0 to N in Python
The challenge We want to generate a function that computes the series starting from 0 and ending until the given number.
Read MoreSorted? yes? no? how? ..in Python
The challenge Complete the method which accepts an array of integers, and returns one of the following:
Read MoreHow to Fix String Casing in Python
The challenge You will be given a string that may have mixed uppercase and lowercase letters and your task is to convert that string to either lowercase only or uppercase only based on:
Read MoreHow to Remove Duplicate Words from a String in Python
The challenge Remove all duplicate words from a string, leaving only single (first) words entries.
Read MoreHow to Validate a Regex PIN Code in Python
The challenge ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits.
Read MoreCombine strings and remove duplicates in Python
The challenge Take 2 strings s1 and s2 including only letters from ato z.
Read MoreHow to Repeat by String Index in Golang
The challenge Create a function that repeats each character by the amount of it’s index value of the original string.
Read MoreHow to make an arithmetic function in Java
The challenge Given two numbers and an arithmetic operator (the name of it, as a string), return the result of the two numbers having that operator used on them.
Read MoreCalculate the Third Angle of a Triangle in Go
The challenge You are given two interior angles (in degrees) of a triangle.
Read MoreReturn Short Long Short in Python
The challenge Given 2 strings, a and b, return a string of the form short+long+short, with the shorter string on the outside and the longer string on the inside.
Read MoreHello, Name or World in Python
The challenge Define a method hello that returns “Hello, Name!” to a given name, or says Hello, World!
Read MoreAdd Length to Strings in Python
The challenge What if we need the length of the words separated by a space to be added at the end of that same word and have it returned as an array?
Read MoreHow to Reversing Words in a String in Python
The challenge Write a function that reverses the words in a given string.
Read MoreHow to Remove Duplicates from List in Python
The challenge Define a function that removes duplicates from an array of numbers and returns it as a result.
Read MoreHow to Format Dollars and Cents in Python
The challenge The company you work for has just been awarded a contract to build a payment gateway.
Read MoreReturn `5` without any numbers in Python
The challenge Write a function that always returns 5 Sounds easy right?
Read MoreHow to Generate Range of Integers in Python
The challenge Implement a function named generateRange(min, max, step), which takes three arguments and generates a range of integers from min to max, with the step.
Read MoreBlue/Green Deployment Techniques in AWS
What are Blue/Green Deployments? “Blue/Green Deployments” is a software deployment methodology.
Read MoreHow to Calculate Powers of 2 in Python
The challenge Complete the function that takes a non-negative integer n as input, and returns a list of all the powers of 2 with the exponent ranging from 0 to n (inclusive).
Read MoreHow to Get Planet Name By ID in Python
The challenge Create a function that takes in an id and returns the planet name.
Read MoreHow to Make a Directory if Not Exists in Python
If you want to create a directory in Python, but only if it doesn’t exist, you have the following option.
Read MoreSquare(n) Sum in Python
The challenge Complete the square sum function so that it squares each number passed into it and then sums the results together.
Read MoreHow to Fill an Array in Python
The challenge We want an array, but not just any old array, an array with contents!
Read MoreHow to Fix the ‘Bad Interpreter’ Error from AWS and Python 3.7
This error often looks something like: .zshrc: /usr/local/bin/aws: bad interpreter: /usr/local/opt/python/bin/python3.
Read MoreRetrieve records from MSSQLServer in Python
The below Python code will create a connection to a MSSQLServer instance, and retrieve data from it back into a variable called tblResults.
Read MoreHow to Remove Trailing Zeroes in Python
The challenge Numbers ending with zeros are boring. They might be fun in your world, but not here.
Read MoreHow to use Profilers in Python
When you have performance problems in your Python application, you can use a Profiler to help you.
Read MoreIf you can’t Sleep, just count Sheep in Python
The challenge Given a non-negative integer, 3 for example, return a string with a murmur: "1 sheep.
Read MoreKey-Value CLI Arguments in Python
If you have a CommandLine application (CLI) written in Python, you have a number of ways that you can take arguments from the user.
Read MoreHow to use a Translation Table to Replace Characters in Python
Python provides the ability to create Translation Tables. our_text = "This is an example of some text" translation_table = str.
Read MoreHow to Calculate the Sum of all Numbers in a String in Python
Let’s take the following string: numbers = "this 1 2 3 4 5 is not a 8 9 10" How can we sum up all the numbers in this string?
Read MoreHow to Find all Permutations of a String in Python
Python comes with a very useful module called itertools, which allows us to calculate permutations directly.
Read MoreHow to Fix ‘no basic auth credentials’ with Docker and AWS ECR
If you are trying to push a Docker image to AWS ECR (Elastic Container Registry) and you get a no basic auth credentials error.
Read MoreHow to Reverse Words or Sentences in Python
Let’s take the following sentence: words = "These are some words" We can use slices to reverse the order of the string:
Read MoreHow to solve AttributeError: ‘int’ object has no attribute ‘split’ – make: [sharedmods] Error 1
If you get the following error while trying to install something via Homebrew
Read MoreHow to Push a Docker image to AWS ECR
By default, Docker pushes its images to Docker Hub. While Docker Hub is a great way to share both your public and private images, you may find the rest of your infrastructure on one of the prominent cloud providers.
Read MoreComplete Guide: How to Base64 Encode a String in Python | Python Base64 Encoding Explained
How to Base64 Encode a String in Python: A Comprehensive Guide Welcome to our comprehensive guide on how to python base64 encode a string in Python.
Read MoreHow to Get 10 Random Numbers in Python
The random module allows you to generate choices. import random print(random.
Read MoreGet the Middle Character in Python
The challenge Return the middle character of the word. If the word’s length is odd, return the middle character.
Read MoreConvert String to Datetime in Python
If you have a string and want to create a Datetime object out of it in Python, then you can use the Datetime Parse Time method, as follows:
Read MoreHow to Abort SQL statements after a set time in MariaDB
Sometimes you don’t want a SELECT query to run for more than a set amount of time.
Read MoreMultiprocessing Pools in Python
Python ships with a multiprocessing module that allows your code to run functions in parallel by offloading calls to available processors.
Read MoreHow to Double Characters in Python
The challenge Given a string, you have to return a string in which each character (case-sensitive) is repeated once.
Read MoreHow to Reverse Words in Python
The challenge Complete the function that accepts a string parameter, and reverses each word in the string.
Read MoreHow to Count by X in Python
The challenge Create a function with two arguments that will return an array of the first (n) multiples of (x).
Read MoreCalculate the Sum of Pairs in Python
The challenge Given a list of integers and a single sum value, return the first two values (parse from the left please) in order of appearance that add up to form the sum.
Read MoreHow to break a list into multiple lists (with maximum size) in Python
If you have a large list and want to create smaller lists of it, with a maximum amount of elements, then:
Read MoreGet all dates between two dates inclusive in Python
If you want to print out a list of all dates between 2 dates (a date range), then you can use the following script:
Read MoreHow to Append a Python Dictionary to a Pandas DataFrame
If you want to append a Python dictionary to a Pandas DataFrame, you can do this:
Read MoreGet Secret from AWS Secrets Manager in Python
You can store secrets in AWS Secret Manager and reference their ARN in AWS Systems Secret Manager.
Read MoreHow to do Binary Addition in Python
The challenge Implement a function that adds two numbers together and returns their sum in binary.
Read MoreHow to Auto-Adjust Excel column widths with pandas.ExcelWriter
You have successfully written your pandas Dataframe to an Excel file, but when you open it, all the columns are squashed up against each other.
Read MoreHow to Sort the Odd in Python
The challenge You will be given an array of numbers. You have to sort the odd numbers in ascending order while leaving the even numbers at their original positions.
Read MoreCalculate the Sum of the two lowest positive integers in Python
The challenge Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers.
Read MoreUnique In Order in Python
The challenge Implement the function unique_in_order which takes as argument a sequence and returns a list of items without any elements with the same value next to each other and preserving the original order of elements.
Read MoreHow to Change the Hostname on Linux
On Linux, you can change the hostname by using the hostnamectl command.
Read MoreHow to Deploy a Docker Container to Kubernetes
Once you have a Docker container, it is really simple to deploy containers to Kubernetes .
Read MoreHow to Replace Characters with Alphabet Positions in Python
The challenge Given a string, replace every letter with its position in the alphabet.
Read MoreReturning Highest and Lowest in Python
The challenge You are given a string of space-separated numbers and have to return the highest and lowest number.
Read MoreHow to Subtract Arrays in Python
The challenge Implement a difference function, which subtracts one list from another and returns the result.
Read MoreHow to Detect if Numbers are in Order in Golang
The challenge In this challenge, your function receives an array of integers as input.
Read MoreAlternate Capitalization in Golang
The challenge Given a string, capitalize the letters that occupy even indexes and odd indexes separately, and return as shown below.
Read MoreCheck if a String is Uppercase in Golang
The challenge Create a method IsUpperCase to see whether the string is ALL CAPS.
Read MoreHow to UpperCase a String in Golang
In Go, there are multiple ways to make a string UpperCase, each of them are by using the strings package.
Read MoreReturn the Shortest Words in Golang
The challenge Given a string of words, return the length of the shortest word(s).
Read MoreHow to Solve Pascal’s Triangle in Python
The challenge Given an integer numRows, return the first numRows of Pascal’s triangle.
Read MoreCreating a Multiplication Table for a Number in Golang
The challenge Your goal is to return multiplication table for number that is always an integer from 1 to 10.
Read MoreHow to Remove Duplicates in an Array in Golang
The challenge Remove the left-most duplicates from a list of integers and return the result.
Read MoreHow to Reverse or Rotate in Golang
The challenge The input is a string str of digits. Cut the string into chunks (a chunk here is a substring of the initial string) of size sz (ignore the last chunk if its size is less than sz).
Read MoreHow to use Coroutines in Kotlin
Coroutines are a way to handle multithreading in Kotlin, read more about it from the official docs:
Read MoreGet which Quarter of the Year in Golang
The challenge Given a month as an integer from 1 to 12, return to which quarter of the year it belongs as an integer number.
Read MoreHow to Sum The Strings in Python
The challenge Create a function that takes 2 nonnegative integers in form of a string as an input, and outputs the sum (also as a string):
Read MoreFixing: ImmutableService requires getRowNodeId() callback to be implemented, your row data need IDs
If you have gotten this error before, then you have been trying to implement a rowData mapping onto Ag-Grid.
Read MoreHow to Undo the most recent local commits in Git
If you have accidentally committed the wrong files into Git, but haven’t yet pushed it to the server, you can recover, or undo your commit as follows:
Read MoreDeconstruction in Kotlin
There are times when you need to extract an object into a number of variables.
Read MorePlaying with passphrases in Python
The challenge Everyone knows passphrases. One can choose passphrases from poems, songs, movies names and so on but frequently they can be guessed due to common cultural references.
Read MoreWhat is a Unit in Kotlin?
Unit corresponds to the void keyword in Java. What is a Unit in Kotlin?
Read MoreHow to declare a Function in Kotlin?
Functions are reusable pieces of code, often called Blocks, that as the name suggests, act as building blocks to piece together a program.
Read MoreThe differences between Val and Var in Kotlin
Among all the many keywords that Kotlin comes with, there exists val and var.
Read MoreAutomatically Resize All Columns to Fit in Ag-Grid
If you have an Ag-Grid, and want to automatically resize all the columns to fit the width of the viewport, you can use this hack.
Read MoreHow to Get All Rows in Ag-Grid
The easiest way to get the content of all rows’ data, back into a Javascript/Typescript array, is as follows.
Read MoreFind the Max Area of an Island in Python
The challenge You are given an m x n binary matrix grid.
Read MoreUsing Apache POI to Get or Create a Sheet in Excel using Java
Apache POI provides a mechanism to work with Excel documents.
Read MoreA Simplistic TCP Finite State Machine (FSM) in Python
The challenge Automatons, or Finite State Machines (FSM), are extremely useful to programmers when it comes to software design.
Read MoreHow to Resolve Scaling Squared Strings in Java
The challenge You are given a string of n lines, each substring being n characters long.
Read MoreHow to Build a Square in Python
The challenge I will give you an integer. Give me back a shape that is as long and wide as the integer.
Read MoreCheck if String EndsWith in Python
The challenge Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string).
Read MoreHow to add a Git Submodule to an existing codebase
Git submodules are a way of including another repository’s code into an existing codebase, without associating it’s code or tracking history in the parent repository.
Read MoreHow to LowerCase a String in Python
Python comes with a built-in method on all String types, by calling lower() on a String, you can immediately lower the case of that String.
Read MoreHow to Restart Sound Driver on a Mac
So for some strange reason, your audio has stopped playing through the Macbook Pro speakers, but if you plug in an external audio device, it still works?
Read MoreNumber to Binary Conversion in Python
If you have a decimal number, and want to get it’s binary value, you can use the built-in bin method.
Read MoreCounting Binary Gaps with Python
The challenge A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.
Read MoreHow to Delete a Secret in Kubernetes
Once you have a secret in Kubernetes, if you know it’s name, you can delete it.
Read MoreHow to Decode a Secret in Kubernetes
Secrets in Kubernetes are encoded using base64. If you have the secret name, you can ask for its value.
Read MoreHow to Verify a Secret in Kubernetes
You have created a secret, and would like to retrieve it.
Read MoreHow to Create a Secret in Kubernetes
Secrets allow applications to not hardcode usernames, passwords or additional information such as hostnames, IP addresses or other protected/sensitive information.
Read MoreHow to Divide an Array into Chunks in PHP
If you have a single-dimensional array, and want to break it into chunks, you can use the array_chunks method.
Read MoreHow to setup Certbot wildcard certificate on Apache
Certbot allows simple, quick and free provisioning of SSL certificates using LetsEncrypt.
Read MoreHow to retrieve a Secret from AWS Secrets Manager in the CLI
If you have stored a secret in AWS using the Secrets Manager, it is possible to use the AWS CLI to retrieve this value at a later date.
Read MoreDetermine the Last Digits of N^2 == N in Java
The challenge Let’s call an integer number N ‘green’ if N² ends with all of the digits of N.
Read MoreHow to Expose your App through a Service in Kubernetes
Once you have deployed an application into Kubernetes , it will not be available to the outside world.
Read MoreHow to connect to Bash on a Kubernetes pod
If you find yourself needing to jump into a Kubernetes pod to either diagnose an issue, or run a particular command, you can use the bash connectivity functionality available from kubectl itself.
Read MoreHow to get the Environment variables in a Kubernetes Pod
In this comprehensive guide, you will learn how to effectively get and list environment variables within a Kubernetes pod .
Read MoreHow to find out Cluster Info in Kubernetes
In Kubernetes, a cluster is a group of machines working together.
Read MoreHow to set and use a kubeconfig in Kubernetes
The kubeconfig file is the main configuration file that allows access to a Kubernetes cluster.
Read MoreHow to Map over a List of Lists in Java
The challenge Write a function which maps a function over the lists in a list:
Read MoreHow to Differentiate a Polynomial in Java
The challenge Create a function that differentiates a polynomial for a given value of x.
Read MoreFind the Sums of Perfect Squares in Java
The challenge The task is simply stated. Given an integer n (3 < n < 10<sup>9</sup>), find the length of the smallest list of perfect squares which add up to n.
Read More[Solved] Error: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.4:repackage (repackage)
If you have come across this error when trying to build and deploy your Spring Boot Maven application then this post will help you!
Read More[Solved] No main manifest attribute Solution for Jar/Maven/Gradle/Spring Boot
You’ve built a Java project and packaged a .jar file.
Read More[Solved] Error – The following untracked working tree files would be overwritten by merge
So you just tried to do a git pull and got the following error:
Read MoreHow to Strip Script Tags in PHP
If you have some HTML input submitted from a user to your application, before saving it to the database, you may want to strip all <script> tags so that you can prevent cross site scripting attacks and other potential issues.
Read MoreHow to Make a Spiral in Java
The challenge Your task, is to create a NxN spiral with a given size.
Read MoreFind the Longest Common Subsequence in Java
The challenge from Wikipedia: The longest common subsequence (LCS) problem is the problem of finding the longest subsequence common to all sequences in a set of sequences.
Read MoreFind First and Last Position of Element in Sorted Array in Java
The challenge Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.
Read MoreDetermine if Number is a Power of Three in Java
The challenge Given an integer n, return true if it is a power of three.
Read MoreHow to Count Binary Substrings in Java
The challenge Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0’s and 1’s, and all the 0’s and all the 1’s in these substrings are grouped consecutively.
Read MoreHow to Download a CSV file using Javascript
Ever wanted to generate a CSV (comma separated values) file directly from the browser, using Javascript?
Read MoreArray Range between Integers in Java
The challenge Complete the function that takes two integers (a, b, where a < b) and return an array of all integers between the input parameters, including them.
Read MoreHow to clone a table structure in MySQL
I have often needed to clone a table without it’s data in MySQL.
Read MoreNumber of Rectangles in a Grid in Java
The challenge Given a grid of size m x n, calculate the total number of rectangles contained in this rectangle.
Read MoreLongest vowel chain in Java
The challenge The vowel substrings in the word codewarriors are o,e,a,io.
Read MoreDetermine Unique String Characters in Java
The challenge In this challenge, you will be given two strings a and b and your task will be to return the characters that are not common in the two strings.
Read MoreDifference of Volumes of Cuboids in Java
The challenge In this simple exercise, you will create a program that will take two lists of integers, a and b.
Read MoreSort by binary ones in Java
The challenge In this example you need to implement a function that sort a list of integers based on it’s binary representation.
Read MoreBinomial Expansion in Java
The challenge Write a program that can do some algebra. Write a function expand that takes in an expression with a single, one character variable, and expands it.
Read MoreConsecutive strings in Java
The challenge You are given an array(list) strarr of strings and an integer k.
Read MoreDetermine the Highest Scoring Word in Java
The challenge Given a string of words, you need to find the highest scoring word.
Read MoreSolving Speed Control in Java
The challenge In John’s car the GPS records every s seconds the distance travelled from an origin (distances are measured in an arbitrary but consistent unit).
Read MoreCalculate Miles per Gallon to Kilometers per Litre in Java
The challenge Create an application that will display the number of kilometers per liter (output) based on the number of miles per imperial gallon (input).
Read MoreHow to Convert an Int to a List of Ints in Python
The challenge Given a non-negative integer, return an array / a list of the individual digits in order.
Read MoreFind the Greatest Common Divisor in Java
The challenge Find the greatest common divisor of two positive integers.
Read MoreHow to Create a Circular List in Python
The challenge Create a Circular List A circular list is of finite size, but can infititely be asked for its previous and next elements.
Read MoreHow to Guess the Sequence in Java
The challenge You must guess a sequence and it has something to do with the number given.
Read MoreReversed sequence in Java
The challenge Build a function that returns an array of integers from n to 1 where n>0.
Read MoreCount the Digit in Java
The challenge Take an integer n (n >= 0) and a digit d (0 <= d <= 9) as an integer.
Read MoreMultiply all elements in an array in Java
The challenge Create a function multiplyAll/multiply_all which takes an array of integers as an argument.
Read More[Solved] Fatal: refusing to merge unrelated histories in Git
You have received the dreaded fatal: refusing to merge unrelated histories error!
Read MoreCredit Card Mask in Java
The challenge Usually when you buy something, you’re asked whether your credit card number, phone number or answer to your most secret question is still correct.
Read MoreHow to Reverse a Number in Java
The challenge Given a number, write a function to output its reverse digits.
Read MorePositions Average in Java
The challenge Suppose you have 4 numbers: '0', '9', '6', '4' and 3 strings composed with them:
Read MoreDetermine the Date by the Day Number in Java
The challenge What date corresponds to the nth day of the year?
Read MoreCorrect the time-string in Java
The challenge You have to create a method, that corrects a given time string.
Read MoreShifter Words Challenge in Java
The challenge You probably know that some characters written on a piece of paper, after turning this sheet 180 degrees, can be read, although sometimes in a different way.
Read MoreFind Maximum and Minimum Values of a List in Java
The challenge Make two functions, max and min that take a(n) array/vector of integers list as input and outputs, respectively, the largest and lowest number in that array/vector.
Read MoreValid Parentheses in Java
The challenge Write a function that takes a string of parentheses, and determines if the order of the parentheses is valid.
Read MoreBoggle Word Checker in Java
The challenge Write a function that determines whether a string is a valid guess in a Boggle board, as per the rules of Boggle.
Read MoreBuild a pile of Cubes in Kotlin
The challenge Your task is to construct a building which will be a pile of n cubes.
Read MoreWhich x for that sum in Kotlin
The challenge Consider the sequence U(n, x) = x + 2x**2 + 3x**3 + .
Read MoreReverse the bits in an integer in Java
The challenge Write a function that reverses the bits in an integer.
Read MoreInvert values in Kotlin
The challenge Given a set of numbers, return the additive inverse of each.
Read MoreSpring Boot no main manifest attribute, in
You have created a ./target/.jar and have tried to run it using java -jar <app>.
Read MoreModuli number system in Kotlin
The challenge A number system with moduli is defined by a vector of k moduli, [m1,m2, ···,mk].
Read MoreSmallest possible sum in Kotlin
The challenge Given an array X of positive integers, its elements are to be transformed by running the following operation on them as many times as required:
Read MoreFloating-point Approximation in Kotlin
The challenge Given a semi-inclusive interval I = [l, u) (l is in interval I but u is not) l and u being floating numbers (0 <= l < u), an integer n (n > 0) a function f: x (float number) -> f(x) (float number) we want to return as a list the n values:
Read MoreMultiplication table in Kotlin
The challenge Create an NxN multiplication table, of size provided in parameter.
Read MoreStrip Comments in Kotlin
The challenge Complete the solution so that it strips all text that follows any of a set of comment markers passed in.
Read MoreExperimenting with a sequence of complex numbers in Kotlin
The challenge Consider the sequence S(n, z) = (1 - z)(z + z**2 + z**3 + .
Read Morept-online-schema-change Add Index
Percona has a great toolkit that allows you to perform schema changes on a MySQL or MariaDB database without any downtime, it works by creating a new table with the same schema, making the changes to it and applying triggers for insertion, deletion and all updates, all while performing your valuable schema updates for you!
Read MoreSums of Parts in Kotlin
The challenge Let us consider this example (array written in general format):
Read MoreDiophantine Equation in Kotlin
The challenge In mathematics, a Diophantine equation is a polynomial equation, usually with two or more unknowns, such that only the integer solutions are sought or studied.
Read MoreMatrix Addition in Java
The challenge Write a function that accepts two square matrices (N x N two dimensional arrays), and return the sum of the two.
Read MoreNumbers that are a power of their sum of digits in Java
The challenge The number 81 has a special property, a certain power of the sum of its digits is equal to 81 (nine squared).
Read MoreInteger triangles in Java
The challenge You have to give the number of different integer triangles with one angle of 120 degrees which perimeters are under or equal a certain value.
Read MoreMinimum path in squares in Java
The challenge You’re given a square consisting of random numbers, like so:
Read MorePascal’s Diagonals in Java
The challenge Create a function that returns an array containing the first l digits from the nth diagonal of Pascal’s triangle.
Read MoreMaximum Contiguous Sum in Java
The challenge Given an unsorted array of integer values, find the maximum positive sum of any contiguous range within the array.
Read MoreFibonacci Streaming in Java
The challenge You’re going to provide a needy programmer a utility method that generates an infinite sized, sequential IntStream which contains all the numbers in a fibonacci sequence.
Read MoreBase-2 in Java
The challenge In this challenge you must convert integers numbers from and to a negative-base binary system.
Read MoreUnique digits sequence in Java
The challenge Consider the following series: 0,1,2,3,4,5,6,7,8,9,10,22,11,20,13,24...There is nothing special between numbers `` and 10.
Read MorePalindrome integer composition in Java
The challenge The palindromic number 595 is interesting because it can be written as the sum of consecutive squares: 6^2 + 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2 = 595.
Read MoreCount IP Addresses in Java
The challenge Implement a function that receives two IPv4 addresses, and returns the number of addresses between them (including the first one, excluding the last one).
Read MoreShortest Knight Path in Java
The challenge Given two different positions on a chess board, find the least number of moves it would take a knight to get from one to the other.
Read MoreAll Balanced Parentheses in Java
The challenge Write a function that makes a list of strings representing all of the ways you can balance n pairs of parentheses
Read MoreHuman readable duration format in Java
The challenge Your task in order to complete this challenge is to write a function which formats a duration, given as a number of seconds, in a human-friendly way.
Read MoreSimple string expansion in Java
The challenge Consider the following expansion: // because "ab" repeats 3 times solve("3(ab)") == "ababab" // because "a3(b)" == "abbb", which repeats twice.
Read MoreHamming Numbers in Java
The challenge A Hamming number is a positive integer of the form 2i3j5k, for some non-negative integers i, j, and k.
Read MoreBlock sequence in Java
The challenge Consider the following array: [1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 12345678910, 1234567891011.
Read MoreRoman Numerals Helper in Java
The challenge Create a RomanNumerals class that can convert a roman numeral to and from an integer value.
Read MoreClosest pair of points in linearithmic time in Java
The challenge Given a number of points on a plane, your task is to find two points with the smallest distance between them in linearithmic O(n log n) time.
Read MoreFind sum of top-left to bottom-right diagonals in Java
The challenge Given a square matrix (i.e. an array of subarrays), find the sum of values from the first value of the first array, the second value of the second array, the third value of the third array, and so on…
Read MoreSweeping trees in Java
The challenge You will be given a list of strings representing nodes in a rooted tree.
Read MoreDetect Pangram in Java
The challenge A pangram is a sentence that contains every single letter of the alphabet at least once.
Read MoreRemove the parentheses in Java
The challenge In this challenge you are given a string for example:
Read MoreWhat century is it in Java
The challenge Return the century of the input year. The input will always be a 4 digit string, so there is no need for validation.
Read MoreLost number in number sequence in Java
The challenge An ordered sequence of numbers from 1 to N is given.
Read MoreSimple string reversal in Java
The challenge In this challenge, we are going to reverse a string while maintaining the spaces (if any) in their original place.
Read Moreint32 to IPv4 in Java
The challenge Take the following IPv4 address: 128.32.10.1 This address has 4 octets where each octet is a single byte (or 8 bits).
Read MorePerimeter of squares in a rectangle in Java
The challenge The drawing shows 6 squares the sides of which have a length of 1, 1, 2, 3, 5, 8.
Read MorePalindrome chain length in Java
The challenge Number is a palindrome if it is equal to the number with digits in reversed order.
Read MoreString array duplicates in Java
The challenge You are given an array of strings and your task is to remove all consecutive duplicate letters from each string in the array.
Read MoreEven or Odd Array Sum in Java
The challenge Given a list of numbers, determine whether the sum of its elements is odd or even.
Read MoreString Permutations in Java
The challenge In this challenge, you have to create all permutations of an input string and remove duplicates if present.
Read MoreRemove a Specific Element of an Array in Java
The challenge You will be given a certain array of length n, such that n > 4, having positive and negative integers but there will be no zeroes and all the elements will occur once in it.
Read MoreUpside down numbers in Java
The challenge Consider the numbers 6969 and 9116. When you rotate them 180 degrees (upside down), these numbers remain the same.
Read MoreRotate matrix counter-clockwise N times in Java
The challenge In this challenge your mission is to rotate matrix counter-clockwise N times.
Read MoreUnable to import module “lambda_function”: No module named “pymysql”
If you receive the following error message when trying to run pymysql on AWS Lambda:
Read MoreSquare Matrix Multiplication in Java
The challenge Write a function that accepts two square (NxN) matrices (two dimensional arrays), and returns the product of the two.
Read MoreCount the divisible numbers in Java
The challenge Complete the function that takes 3 numbers x, y and k (where x ≤ y), and returns the number of integers within the range [x.
Read MoreAverages of numbers in Java
The challenge Get the averages of these numbers Write a method, that gets an array of integer-numbers and return an array of the averages of each integer-number and his follower, if there is one.
Read MoreDecimal to Factorial and Back in Java
The challenge Coding decimal numbers with factorials is a way of writing out numbers in a base system that depends on factorials, rather than powers of numbers.
Read MoreEqual Sides Of An Array in Java
The challenge You are going to be given an array of integers.
Read MoreLargest 5 digit number in a series in Java
The challenge In the following 6 digit number: 283910 91 is the greatest sequence of 2 consecutive digits.
Read MoreNext smaller number with the same digits in Java
The challenge Write a function that takes a positive integer and returns the next smaller positive integer containing the same digits.
Read MoreCount of positives / sum of negatives in Java
The challenge Given an array of integers. Return an array, where the first element is the count of positives numbers and the second element is sum of negative numbers.
Read MoreFind the stray number in Java
The challenge You are given an odd-length array of integers, in which all of them are the same, except for one single number.
Read More4 By 4 Skyscrapers in Java
The challenge In a grid of 4 by 4 squares you want to place a skyscraper in each square with only some clues:
Read MoreHow to Fix: package org.junit.jupiter.api does not exist
The problem If you have received the package org.junit.jupiter.api deos not exist error when trying to run a JUnit Java Test with Maven, it’s because of a missing dependency in your pom.
Read MoreHow to Programmatically Filter ag-Grid Columns in Angular
You can easily control the column filtering in ag-Grid by using the getFilterInstance and setModel methods associated to the column you need filtering.
Read MoreCount the divisors of a number in Java
The challenge Count the number of divisors of a positive integer n.
Read MoreMy smallest code interpreter in Java
The challenge Inspired from real-world Brainf**k, we want to create an interpreter of that language which will support the following instructions:
Read MorePick peaks in Java
The challenge Write a function that returns the positions and the values of the “peaks” (or local maxima) of a numeric array.
Read MoreNumber of trailing zeros of N in Java
The challenge Write a program that will calculate the number of trailing zeros in a factorial of a given number.
Read MoreAlphabetic Anagrams in Java
The challenge Consider a “word” as any sequence of capital letters A-Z (not limited to just “dictionary words”).
Read MoreRemove file from Git without deleting locally
If you find yourself in a position where you have already committed some files to git, and they are in the remote repository already, but you want to remove them from you repository without deleting them locally, you can do the following:
Read MoreRecover a secret string from random triplets in Java
The challenge There is a secret string which is unknown to you.
Read MoreRange Extraction in Java
The challenge A format for expressing an ordered list of integers is to use a comma separated list of either
Read MoreReversed Words in Java
The challenge Complete the solution so that it reverses all of the words within the string passed in.
Read MoreCamelCase Method in Java
The challenge Write a simple CamelCase method for strings. All words must have their first letter capitalized without spaces.
Read MoreEven or Odd in Java
The challenge Create a function that takes an integer as an argument and returns “Even” for even numbers or “Odd” for odd numbers.
Read MoreSquare Every Digit in Java
The challenge You need to square every digit of a number and concatenate them.
Read MoreSimple number sequence in Java
The challenge You are given a string of numbers in sequence and your task will be to return the missing number.
Read MoreRoman Numerals Encoder in Java
The challenge Create a function taking a positive integer as its parameter and returning a string containing the Roman Numeral representation of that integer.
Read MoreFirst Variation on Caesar Cipher in Java
The challenge The action of a Caesar cipher is to replace each plaintext letter (plaintext letters are from ‘a’ to ‘z’ or from ‘A’ to ‘Z’) with a different one a fixed number of places up or down the alphabet.
Read MoreCentury From Year in Java
The challenge The first century spans from the year 1 up to and including the year 100, The second – from the year 101 up to and including the year 200, etc.
Read MoreFind the Smallest Number in Java
The challenge You have a positive number n consisting of digits.
Read MoreConvert Array to Tree in Java
The challenge You are given a non-null array of integers. Implement the method arrayToTree which creates a binary tree from its values in accordance to their order, while creating nodes by depth from left to right.
Read MorePrimes in Numbers in Java
The challenge Given a positive number n > 1 find the prime factor decomposition of n.
Read MoreMaximum subarray sum in Java
The challenge The maximum sum subarray problem consists in finding the maximum sum of a contiguous subsequence in an array or list of integers:
Read MoreValidate Credit Card Number in Java
The challenge Let’s implement the Luhn Algorithm, which is used to help validate credit card numbers.
Read MoreFind the unique number using Java
The challenge There is an array with some numbers. All numbers are equal except for one.
Read MoreFind The Parity Outlier in Java
The challenge You are given an array (which will have a length of at least 3, but could be very large) containing integers.
Read MoreFind the missing letter using Java
The challenge Write a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array.
Read MoreDetermine the order of braces is valid using Java
The challenge Write a function that takes a string of braces, and determines if the order of the braces is valid.
Read More[Solved] PKIX path building failed: unable to find valid certification path to requested target
The problem It may happen to you that when you try and pull some Java dependencies, you will get the annoying PKIX path building failed: sun.
Read MoreHow to Find the odd int in Java
The challenge Given an array of integers, find the one that appears an odd number of times.
Read MoreCount the number of Duplicates in Java
The challenge Write a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string.
Read MoreCalculating Simple Max Digit Sum in Java
The challenge In this challenge, you will be given an integer n and your task will be to return the largest integer that is <= n and has the highest digit sum.
Read MoreThe String Combat Challenge in Java
The challenge After a long conflict, the rulers of Nek and Glo have decided that a final duel should decide the fate of their countries.
Read MoreSolving Single Word Pig Latin in Java
The challenge Pig Latin is an English language game where the goal is to hide the meaning of a word from people not aware of the rules.
Read MoreCount the Days in Java
The challenge Little Annie is very excited for upcoming events. She want’s to know how many days she have to wait for a specific event.
Read MoreJava HashMap Create or Increment Value
If you are using a HashMap to keep a running total of a series of elements, then you often need to increment a HashMap item, but if it doesn’t exist in the map yet, then you need to rather create it.
Read MoreGet the Strongest even number in an interval in Java
The challenge A strongness of an even number is the number of times we can successively divide by 2 until we reach an odd number starting with an even number n.
Read MoreWhat time is it? in Java
The challenge How many times have we been asked this simple question in our daily lives by family, friends and strangers alike?
Read MoreBuilding a String Pyramid in Java
The challenge You have to build a pyramid. This pyramid should be built from characters from a given string.
Read MoreCartesian coordinates from degree angle in Java
The challenge Write a simple function that takes polar coordinates (an angle in degrees and a radius) and returns the equivalent cartesian coordinates (rounded to 10 places).
Read MoreSort array by sorting its smallest sub-array in Java
The challenge Given an array of integers, arr, find out 2 indices m, n(0<=m<=arr.
Read MoreExcessively Abundant Numbers in Java
The challenge An abundant number or excessive number is a number for which the sum of its proper divisors is greater than the number itself.
Read MoreUnique Substring From Joined Strings in Java
The challenge Write a function that takes two strings, A and B, and returns the length of the longest possible substring that can be formed from the concatenation of either A + B or B + A containing only characters that do not appear in both A and B.
Read MoreConverting from Base 10 to 16 (Decimal to Hex) in Java
The challenge Convert an integer which is base 10, to a hexadecimal base 16 string.
Read MoreHow to Format Numbers by Prepending 0 to single-digit numbers in Javascript
If you have a single-digit number, and you need to format it to always have at-least two digits, then you can use the below function to solve your problem:
Read MoreString polynomial converter in Java
The challenge Your task is to programe: String convertToString(int[] pol) {.
Read MoreHow to Remove all Exclamation Marks from a String in Java
The challenge Write function RemoveExclamationMarks which removes all exclamation marks from a given string.
Read MoreHow to Convert a Number to a String in Java
The challenge We need a function that can transform a number into a string.
Read MoreHow to Remove Spaces in a String in Java
The challenge Simple, remove the spaces from the string, then return the resultant string.
Read MoreHow many stairs will Suzuki climb in 20 years? in Java
The challenge Suzuki is a monk who climbs a large staircase to the monastery as part of a ritual.
Read MoreDetermine if N is divisible by X and Y in Java
The challenge Create a function that checks if a number n is divisible by two numbers x AND y.
Read MoreHow to Sum a Mixed Array in Java
The challenge Given an array of integers as strings and numbers, return the sum of the array values as if all were numbers.
Read MoreCalculate the Volume of a Cuboid in Java
A Cuboid is a geometric object that is more or less cubic in shape.
Read MoreFind the first non-consecutive number in Java
The challenge Your task is to find the first element of an array that is not consecutive.
Read MoreAlternating String Casing in Java
The challenge altERnaTIng cAsE <=> ALTerNAtiNG CaSe Define String.prototype.toAlternatingCase (or a similar function/method such as to_alternating_case/toAlternatingCase/ToAlternatingCase in your selected language; see the initial solution for details) such that each lowercase letter becomes uppercase and each uppercase letter becomes lowercase.
Read MoreSolving the Pythagorean Triple in Java
The challenge Given an array of 3 integers a, b and c, determine if they form a pythagorean triple.
Read MoreHow to Correct the Mistakes of the Character Recognition Software in Java
The challenge Character recognition software is widely used to digitise printed texts.
Read MoreSolving “Duck Duck Goose” in Java
The challenge The objective of Duck, duck, goose is to walk in a circle, tapping on each player’s head until one is chosen.
Read MoreCalculate averages from an int array in Java
The challenge Write function avg which calculates average of numbers in given list.
Read MoreHow to Rotate a String in Java
Rotating a String in Java is a common interview question, and albeit it quite a simple one, it tests many fundamental concepts.
Read MoreCalculate the Sum without highest and lowest number in Java
The challenge Sum all the numbers of the array except the highest and the lowest element (the value, not the index!
Read MoreHow to Convert a String to an Array in Java
Java makes it easy to convert a string to an array by providing the built-in .
Read MoreHow to Loop and Combine Three Strings in Java
The challenge Create a function that will return a string that combines all of the letters of the three inputed strings in groups.
Read MoreHow to Localize The Barycenter of a Triangle in Java
The challenge The medians of a triangle are the segments that unit the vertices with the midpoint of their opposite sides.
Read MoreHow to Calculate a Valid Square in Java
The challenge Given the coordinates of four points in 2D space p1, p2, p3 and p4, return true if the four points construct a square.
Read MoreHow to Calculate Age Range Compatibility as an Equation in Java
The challenge Everybody knows the classic “half your age plus seven” dating rule that a lot of people follow (including myself).
Read MoreHow to Find the Longest Mountain in Array in Java
The challenge Let’s call any (contiguous) subarray B (of A) a mountain if the following properties hold:
Read MoreHow to tell what the CHMOD value of a file/directory is
chmod alters the permissions for a file or directory, you could allow full read/write access to a file or directory by running the following command:
Read MoreHow to Solve the “Decode a String” Challenge in Java
The challenge Given an encoded string, return its decoded string.
Read MoreHow to cleanup a /var/log/journal in Linux
You may find your /var/log/journal directory taking up a lot of disk-space.
Read MoreHow to Find the Maximum Difference Between Node and Ancestor in Java
The challenge Given the root of a binary tree, find the maximum value V for which there exist different nodes A and B where V = |A.
Read MoreHow to Find the Integral using Java
The challenge Create a function that finds the integral of the expression passed.
Read MoreHow to Build Strings from a Size in Java
The challenge Write a function stringy that takes a size and returns a string of alternating '1s' and '0s'.
Read MoreBest Time to Buy and Sell Stock in Java
The challenge Say you have an array for which the ith element is the price of a given stock on day i.
Read MoreHow to Solve the “To square(root) or not to square(root)” Challenge in Java
The challenge Write a method, that will get an integer array as parameter and will process every number from this array.
Read MoreSolving the Rule of Divisibility by 13 in Java
The challenge "A divisibility rule is a shorthand way of determining whether a given integer is divisible by a fixed divisor without performing the division, usually by examining its digits.
Read MoreHow to Calculate Buddy Strings in Java
The challenge Given two strings A and B of lowercase letters, return true if you can swap two letters in A so the result is equal to B, otherwise, return false.
Read MoreHow to Flip a Binary Matrix in Java
The challenge Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image.
Read MoreHow to Tilt a Binary Tree in Java
The challenge Given the root of a binary tree, return the sum of every tree node’s tilt.
Read MoreHow to solve the House Robber Challenge in Java
The challenge You are a professional robber planning to rob houses along a street.
Read MoreHow to Solve the Bag of Tokens Challenge in Java
The challenge You have an initial power of P, an initial score of ``, and a bag of tokens where tokens[i] is the value of the i<sup>th</sup> token (0-indexed).
Read MoreHow to Find the Smallest Divisor Given a Threshold in Java
The challenge Given an array of integers nums and an integer threshold, we will choose a positive integer divisor and divide all the array by it and sum the result of the division.
Read MoreHow to Sort and Star a String Array in Java
The challenge You will be given a vector of strings. You must sort it alphabetically (case-sensitive, and based on the ASCII values of the chars) and then return the first value.
Read MoreHow to Count Consecutive Characters in Java
The challenge Given a string s, the power of the string is the maximum length of a non-empty substring that contains only one unique character.
Read MoreHow to Abbreviate a Two Word Name in Java
The challenge Write a function to convert a name into initials.
Read MoreHow to Sort a Linked List using Insertion Sort in Java
The challenge Sort a linked list using insertion sort. A graphical example of insertion sort.
Read MoreHow to Remove First and Last Character in a String in Java
The challenge The goal is to create a function that removes the first and last characters of a string.
Read MoreHow to Distribute Halloween Candies by Rating Value in Java
The challenge There are N children standing in a line. Each child is assigned a rating value.
Read MoreHow to Distribute Halloween Candies in Java
The challenge You have n candies, the i<sup>th</sup> candy is of type candies[i].
Read MoreHow to Solve the Maximize Distance to Closest Person Challenge in Java
The challenge You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the i<sup>th</sup> seat, and seats[i] = 0 represents that the i<sup>th</sup> seat is empty (0-indexed).
Read MoreHow to Get Character from ASCII Value in Java
The challenge Write a function which takes a number and returns the corresponding ASCII char for that value.
Read MoreFinding a Needle in a Haystack in Java
The challenge Can you find the needle in the haystack?
Read MoreHow to Solve the Champagne Tower in Java
The challenge We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row.
Read MoreHow to Solve the 132 Pattern in Java
The challenge Given an array of n integers nums, a 132 pattern is a subsequence of three integers nums[i], nums[j] and nums[k] such that i < j < k and nums[i] < nums[k] < nums[j].
Read MoreHow to Replace all Vowels in a String in Java
The challenge Replace all vowel to exclamation mark in the sentence.
Read MoreHow to Get the N-th Power in Java
The challenge You are given an array with positive numbers and a number N.
Read MoreHow to Count the Minimum Depth of a Binary Tree in Java
The challenge Given a binary tree, find its minimum depth.
Read MoreHow to Solve the House Robber II Challenge in Java
The challenge You are a professional robber planning to rob houses along a street.
Read MoreHow to Clone a Graph in Java
The challenge Given a reference of a node in a connected undirected graph.
Read MoreHow to Return Random Values in Java
The challenge Ghost objects are instantiated without any arguments. Ghost objects are given a random color attribute of white" or “yellow” or “purple” or “red” when instantiated
Read MoreHow to Compare Version Numbers in Java
The challenge Compare two version numbers version1 and version2. If <em>version1</em> > <em>version2</em> return 1; if <em>version1</em> < <em>version2</em> return -1;otherwise return ``.
Read MoreHow to Return the First N Elements in Java
The challenge Create a method take that accepts a list/array and a number n, and returns a list/array array of the first n elements from the list/array.
Read MoreHow to Search a 2d Matrix/Array in Java
The challenge Write an efficient algorithm that searches for a value in an m x n matrix.
Read MoreCalculate the Surface Area and Volume of a Box with Java
The challenge Write a function that returns the total surface area and volume of a box as an array: [area, volume]
Read MoreFind Numbers which are Divisible by given Number in Java
The challenge Complete the function which takes two arguments and returns all numbers which are divisible by the given divisor.
Read MoreHow to Split a Subdirectory to a New Git Repository and Keep the History
There comes a time when you need to split out a subdirectory into it’s own git repo.
Read MoreGet the Maximum XOR of Two Numbers in an Array in Java
The challenge Given a non-empty array of numbers, a, a1, a2, … , an-1, where 0 ≤ ai < 231.
Read MoreHow to Get the Opposite of a Number in Java
The challenge Given a number, find its opposite. Examples: 1: -1 14: -14 -34: 34 The solution in Java We return the number itself multiplied by a negative 1.
Read MoreHow to Find the Area or Perimeter of a 4-sided Polygon using Java
The challenge You are given the length and width of a 4-sided polygon.
Read MoreHow to Parse Int from Char in Java
The challenge We take in a String where the first place contains a number, write a function that takes in this String and returns an int containing it.
Read MoreHow to Search a Binary Tree in Java
The challenge Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums.
Read MoreHow to Rotate a Singly Linked List in Java
The challenge Given a linked list, rotate the list to the right by k places, where k is non-negative.
Read MoreHow to Insert into a Binary Search Tree using Java
The challenge You are given the root node of a binary search tree (BST) and a value to insert into the tree.
Read MoreFind the Complement of Base 10 Integer in Java
The challenge Every non-negative integer N has a binary representation. For example, 5 can be represented as "101" in binary, 11 as "1011" in binary, and so on.
Read MoreSolve the Number of Recent Calls Challenge in Java
The challenge You have a RecentCounter class which counts the number of recent requests within a certain time frame.
Read MoreHow to Calculate the Summation of a Number in Java
The challenge Write a program that finds the summation of every number from 1 to num.
Read MoreHow to Calculate all Unique Combinations of a Target using Backtracking in Java
The challenge Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target.
Read MoreWho is going to pay for the wall? in Python
The challenge Don Drumphet lives in a nice neighborhood, but one of his neighbors has started to let his house go.
Read MoreCalculate the Total Amount of Points using Java
The challenge Our football team finished the championship. The result of each match look like “x:y”.
Read MoreCalculate the biggest of 3 numbers using Java
The challenge Task Given three integers a ,b ,c, return the largest number obtained after inserting the following operators and brackets: +, *, () In other words , try every combination of a,b,c with [*+()] , and return the Maximum Obtained Consider an Example : With the numbers are 1, 2 and 3 , here are some ways of placing signs and brackets:
Read MoreFind the missing element between two arrays in Python
The challenge Given two integer arrays where the second array is a shuffled duplicate of the first array with one element missing, find the missing element.
Read MoreHow to Count an Array of Boolean Values in Java
The challenge Consider an array/list of sheep where some sheep may be missing from their place.
Read MoreHow to Solve the Car Pooling Challenge in Java
The challenge You are driving a vehicle that has capacity empty seats initially available for passengers.
Read MoreHow to Repeat a String in Java
The challenge Write a function called repeat_str which repeats the given string src exactly count times.
Read MoreHow to Find the Smallest Integer in the Array in Java
The challenge Given an array of integers your solution should find the smallest integer.
Read MoreHow to Count Odd Numbers Below N using Java
The challenge Given a number n, return the number of positive odd numbers below n, EASY!
Read MoreHow to get the Length of the Last Word in a String using Java
The challenge Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word (last word means the last appearing word if we loop from left to right) in the string.
Read MoreHow to Convert a Number to Reversed Array of Digits in Java
The challenge Given a random non-negative number, you have to return the digits of this number within an array in reverse order.
Read MoreHow to Solve Unique Paths III in Java
The challenge On a 2-dimensional grid, there are 4 types of squares:
Read MoreHow to Find the Mean/Average of a List of Numbers in Java
The challenge Find the mean (average) of a list of numbers in an array.
Read MoreHow to Calculate BMI in Java
The challenge BMI stands for Body Mass Index and is a value derived from the mass and height of a person.
Read MoreHow to Solve the Robot Bounded In Circle Challenge in Java
The challenge On an infinite plane, a robot initially stands at (0, 0) and faces north.
Read MoreHow to Convert a String to a Number in Java
The challenge We need a function that can transform a string into a number.
Read MoreHow to Convert an Integer to Binary using Java
The challenge Given a non-negative integer n, write a function toBinary/ToBinary which returns that number in a binary format.
Read MoreHow to create a Logical Operator in Java
Exclusive “or” (xor) Logical Operator In some scripting languages like PHP, there exists a logical operator (e.
Read MoreHow to merge sorted integer arrays (without duplicates) in Java
The challenge Write a function that merges two sorted arrays into a single one.
Read MoreFind the Force of Gravity Between Two Objects with Java
The challenge Your job is to find the gravitational force between two spherical objects (obj1 , obj2).
Read MoreHow to zoom text by mouse wheel in IntelliJ Idea
It’s a common requirement to be able to zoom in or out while working in the code editor in IntelliJ Idea.
Read MorePlaying the Bulls and Cows Game in Java
The challenge You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is.
Read MoreCalculate the Sum of Root To Leaf Binary Numbers in Java
The challenge Given a binary tree, each node has value `` or 1.
Read MoreRemove an Exclamation Mark from the End of String using Python
The challenge Remove a exclamation mark from the end of string.
Read MoreHow to “Rock Paper Scissors” in Java
The challenge Let’s play Rock Paper Scissors! You have to return which player won!
Read MoreCompare within Margin using Python
The challenge Create a function close_compare that accepts 3 parameters: a, b, and an optional margin.
Read MoreGet the mean of an array in Java
The challenge It’s the academic year’s end, fateful moment of your school report.
Read MoreRemove the time challenge in Python
The challenge You’re re-designing a blog and the blog’s posts have the following format for showing the date and time a post was made:
Read MoreHow to Convert Hex to Decimal in Java
The challenge Write a function that converts an input string contains a hex value, and return a decimal.
Read MoreCharacter with Longest Consecutive Repetition in Java
The challenge For a given string s find the character c (or C) with longest consecutive repetition and return:
Read MoreCheck if List contains Item in Python
The challenge Create a method that accepts a list and an item, and returns true if the item belongs to the list, otherwise false.
Read MoreHow To Create a User and Grant Permissions in MySQL
How to create a user CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword'; How to delete a user DROP USER 'myuser'@'localhost'; How to grant permissions GRANT ALL PRIVILEGES ON * .
Read MoreHow to Remove Vowels with Python
The challenge Create a function called shortcut to remove all the lowercase vowels in a given string.
Read MoreHow to find all files in a directory with extension
I needed to find all files in a directory on Linux that ended with the file extension .
Read MoreHow to Sort a List in Python
In this tutorial, you will learn how to sort a list in Python, by following the below three steps:
Read MoreCryptanalysis Word Patterns in Java
The challenge In cryptanalysis, words patterns can be a useful tool in cracking simple ciphers.
Read MoreHow to divide a number in Python
The challenge Your task is to create functionisDivideBy (or is_divide_by) to check if an integer number is divisible by each out of two arguments.
Read MoreHow to Read Kubernetes Secrets
Kubernetes secrets is a great way to store secret values that only Kubernetes can access in your hosted applications.
Read MoreBackspaces in String Challenge using Java
The challenge Assume "#" is like a backspace in string. This means that string "a#bc#d" actually is "bd"
Read MoreHow many times to Kaprekar’s constant using Python
Introduction 6174 is known as Kaprekar’s constant after the Indian mathematician D.
Read MoreHow to check if a String is a Number in Python
The challenge Given a string s, write a method (function) that will return true if its a valid single integer or floating number or false if its not.
Read MoreHow to Write a Custom Comparator in Python
Generally, you want to use the built-in sorted() function which takes a custom comparator as its parameter.
Read MoreHow to delete an AWS WAF – Web ACL
Usually, it’s quite easy to delete an AWS WAF, or Web ACL.
Read MoreHow to Sort an Integer in Python
Let’s say that you have an integer with value of 9271 and you want to sort it either ascending(1279) or descending(9721).
Read MoreHow to Copy a File in Python
In this tutorial, you will learn how to copy a file using Python from a directory to another directory, or if you’re on Windows, then from a Folder to another Folder.
Read MoreConway’s Game of Life – Unlimited Edition – in Python
What is this? Conways’s Game Of Life is a Cellular Automation Method created by John Conway.
Read MoreMost frequently used words in a text with Python
The challenge Write a function that, given a string of text (possibly with punctuation and line-breaks), returns an array of the top-3 most occurring words, in descending order of the number of occurrences.
Read MoreThe SongDecoder Dubstep Challenge with Java
The challenge Polycarpus works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance.
Read MoreBreak camelCase Challenge in Java
The challenge Complete the solution so that the function will break up camel casing, using a space between words.
Read MoreSort Binary Tree by Levels using Python
The challenge You are given a binary tree: class Node: def __init__(self, L, R, n): self.
Read MoreHow to Split a String with Python
Splitting a string in Python is really easy. You simply take a string and apply the split() method.
Read MoreHow to fix the Terraform stuck on “Refreshing state…” problem
Terraform is a fantastic tool to help automate your infrastructure as code.
Read MoreThe “Split Strings” Challenge using Java
The challenge Complete the solution so that it splits the string into pairs of two characters.
Read MoreConverting to PigLatin with Python
The challenge Move the first letter of each word to the end of it, then add “ay” to the end of the word.
Read MoreSolving the “Double Cola” Challenge using Java
The challenge Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a “Double Cola” drink vending machine; there are no other people in the queue.
Read MoreConvert Seconds to Human Readable Time (HH:MM:SS) using Java
The challenge Write a function, which takes a non-negative integer (seconds) as input and returns the time in a human-readable format (HH:MM:SS)
Read MoreSolving the “Mexican Wave” Challenge using Java
The challenge Task Your task is to create a function that turns a string into a Mexican Wave.
Read MoreMultiples of 3 and 5 with Python
The challenge This multiples of 3 and multiples of 5 challenge is a variation of the common FizzBuzz question.
Read MoreSolving the “Catching Car Mileage Numbers” Challenge using Python
The challenge "7777…8?!??!", exclaimed Bob, "I missed it again! Argh!" Every time there's an interesting number coming up, he notices and then promptly forgets.
Read MoreCounting smiley faces with Python
The challenge Given an array (arr) as an argument complete the function countSmileys that should return the total number of smiling faces.
Read MoreConvert String to Camel Case using Java
The challenge Complete the method/function so that it converts dash/underscore delimited words into camel casing.
Read MoreHow to Setup an SSH Server on AWS
Basic instructions on how to set up an SSH server on an Ubuntu 16.
Read MoreHow to Convert Numeric Words into Numbers using Python
Challenge Using Python, we want to convert words into numbers. In this challenge, we will explore how to convert a string into an integer.
Read MoreSolve The Triangle of Odd Numbers using Python
The challenge Given the triangle of consecutive odd numbers: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 .
Read More“Who likes it” code Challenge in Python
The Challenge You probably know the “like” system from Facebook and other pages.
Read MorePython 4 New Features Planned
It took the Python community a long time to move from Python 2 to Python 3.
Read MoreCustom RGB To Hex Conversion with Python
The challenge The rgb function is incomplete. Complete it so that passing in RGB decimal values will result in a hexadecimal representation being returned.
Read MoreSort a Java Integer in Descending Order
The challenge Your task is to make a function that can take any non-negative integer as an argument and return it with its digits in descending order.
Read MoreGet the Sum of Digits / Digital Root using Java
The challenge Digital root is the recursive sum of all the digits in a number.
Read MoreHow to write a Chain Adding Function in Python
The challenge We want to create a function that will add numbers together when called in succession.
Read MoreGet the next biggest number with the same digits using Python
The challenge Create a function that takes a positive integer and returns the next bigger number that can be formed by rearranging its digits.
Read MoreSolving Tribonacci Sequence with Python
The challenge As the name may already reveal, it works basically like a Fibonacci, but summing the last 3 (instead of 2) numbers of the sequence to generate the next.
Read MoreThe Casino Chips Problem Solved with Python
The challenge You are given three piles of casino chips: white, green and black chips:
Read MoreCheck if Isogram using Python
The challenge An isogram is a word that has no repeating letters, consecutive or non-consecutive.
Read MoreFind the Longest Common Prefix using Python
The challenge Write a function to find the longest common prefix string amongst an array of strings.
Read MoreCount and Say with Python
The challenge he count-and-say sequence is the sequence of integers with the first five terms as following:
Read MoreThe Plus One problem solved with Python
The challenge Given a non-empty array of digits representing a non-negative integer, increment one to the integer.
Read MoreSolving the Single Number problem in Python
The challenge Given a non-empty array of integers, every element appears twice except for one.
Read MoreRotate a Matrix List in Python
The challenge You are given an n x n 2D matrix representing an image.
Read MoreCheck if Valid Sudoku Blocks in Java
The challenge of solving valid Sudoku blocks Determine if a 9×9 Sudoku board is valid.
Read MoreFind the Intersection of Two Arrays in Python
The challenge Given two arrays, write a function to compute their intersection.
Read MoreRotate an Array K Times in Python
The challenge Given an array, rotate the array to the right by k steps, where k is non-negative.
Read MoreFizzBuzz in Java
The challenge Write a program that outputs the string representation of numbers from 1 to n.
Read MorePython Splices reimplemented in Java
Python has a fantastic feature called slices. It allows you to work with a list, set or string by it’s index items.
Read MoreSolving Two Sum in Python
The challenge Given an array of integers, return indices of the two numbers such that they add up to a specific target.
Read MoreGet the Next Small Integer in Python
The challenge Write a function: def solution(A) that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A.
Read MoreIs a Valid Palindrome with Java
The challenge Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
Read MoreIs a Valid Anagram with Java
The challenge Given two strings s and t , write a function to determine if t is an anagram of s.
Read MoreHow to ReImplement strStr() in Java
What we want to achieve Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Read MoreThird Maximum Number with Java
The challenge Given a non-empty array of integers, return the third maximum number in this array.
Read MoreHow to Quickly Hide all Icons on a Mac’s Desktop
Why the need to hide icons? Perhaps you have a screen-share session coming up and you want a nice clean desktop to show everyone.
Read MoreFirst Unique Character in a String using Java
The challenge Given a string, find the first non-repeating character in it and return its index.
Read MoreHow to fix the Release Version 5 Not Supported error in IntelliJ
What do you do when you create a new Maven Java project, and when you run it, you get the following error:
Read MoreFacebook’s custom IPv6 range
I noticed an interesting thing with a certain visitor after posting a blog post to Facebook.
Read MoreHow to Reverse an Integer in Java
The challenge Given a 32-bit signed integer, reverse digits of an integer.
Read MoreReverse a String in-place using Java
The challenge Write a function that reverses a string. The input string is given as an array of characters char[].
Read MoreCheck if a Java array Contains Duplicates
The challenge Given an array of integers, find if the array contains any duplicates.
Read MoreFind All Numbers Disappeared in an Array using Python
The challenge Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.
Read MoreThe Array Height Checker Problem in Java
The challenge Students are asked to stand in non-decreasing order of heights for an annual photo.
Read MoreFind the Squares of a Sorted Array in Java
The challenge Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order.
Read MoreSorting a Java Array by Parity
The challenge Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A.
Read MoreRemove Duplicates from Sorted Array in Java
Say you have an array of primitive integers and you want to remove all duplicates.
Read MoreReplace Elements with Greatest Element on Right Side using Java
The challenge Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with -1.
Read MoreThe Valid Mountain Array Problem using Java
Introducing the problem Given an array A of integers, return true if and only if it is a valid mountain array.
Read MoreHashMaps (aka: Dictionaries) in Python
Introduction Java has a built-in called HashMap. It allows you to store and very quickly retrieve key value pairs.
Read MoreFind Numbers with Even Number of Digits using Java
The challenge Given an array nums of integers, return how many of them contain an even number of digits.
Read MoreThe Relational Database Model
Relational databases first made an appearance in the mid-1970s, between the years 1974 and 1977 with the creation of Ingres and System R which led to the creation of MS SQL Server, Sybase, Wang?
Read MoreHow to use a Java HashSet by example
What is a HashSet A HashSet is an unordered collection containing unique elements.
Read MoreGet The Shortest Path in Binary Matrix using Python
The challenge In an N by N square grid, each cell is either empty (0) or blocked (1).
Read MorePalindrome Partitioning in Python
The problem Given a string s, partition s such that every substring of the partition is a palindrome.
Read MoreFaster alternative to MySQL Delete Table Contents / Truncate
From time to time you might have some rather big tables that you want to delete all the data quickly and start afresh.
Read MoreBest Time to Buy and Sell Stock with Python
The problem Say you have an array prices for which the ith element is the price of a given stock on day i.
Read MoreIPv4 CIDR Chart
CIDR stands for Classless Inter-Domain Routing and is a method for allocating IP addresses as well as for IP routing.
Read MoreRecursively Delete Files and Folders and all Contents using PHP
Below is a quick and easy way to recursively delete all files and folders in a given path using PHP.
Read MoreProduct Update: ADD becomes Serengeti
As a product update; The “Autonomous Distributed Database”, otherwise known as simply ADD has been renamed to Serengeti.
Read MoreSQL to Append all Fields if Shorter than a set Length
This came in very handy for me at one point because I needed to have a certain field in each row 14 characters long, but half of them were only 12 characters long.
Read MoreValidate Email Address in Javascript
Below is a nice little Javascript RegularExpression to validate email addresses.
Read MoreRemove hash from window.location in Javascript
E.g. URL:<br>http://example.com/?option=1&task=2&listing_id=36&layout=4&table=5#some_hash_value_here So how would you get the current URL using Javascript?
Read MoreThe Benefits and Dangers of Artificial Intelligence
Artificial Intelligence (AI) is usually defined as the science of making computers do things that require intelligence when done by humans.
Read MoreThe Decoded String at Index using Java
The Challenge An encoded string S is given. To find and write the decoded string to a tape, the encoded string is read one character at a time and the following steps are taken:
Read MoreTiming Issues in Real-time systems
What are Real-time Systems? If you look up the term “real-time” in a dictionary, it will tell you that it is the actual time during which a process takes place or an event occurs (Dictionary.
Read MoreFind the Minimum Absolute Difference in BST using Java
The question Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.
Read MoreGet the Second Highest Salary in MySQL
The problem Write a SQL query to get the second highest salary from the Employee table.
Read MoreFind Maximum Subarrays using Java
The problem Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
Read MoreFinding Number Complements using Java
The problem Given a positive integer num, output its complement number.
Read MoreForensic Analysis on Linux (Unix)
Operating Systems come in a few competing choices, of which the major players are Apple’s MacOS, Microsoft’s Windows and then the various flavours of Linux, of which most are open-sourced while the remainder are proprietary to their vendors.
Read MoreSelf Dividing Numbers using Python
Introduction A self-dividing number is a number that is divisible by every digit it contains.
Read MoreRuntimeError: thread.__init__() not called (Python)
Today I got a really dumb error from Python. RuntimeError: thread.
Read MoreAll About Distributed Databases
A database “is a structured collection of data. Card indices, printed catalogues of archaeological artefacts and telephone directories are all examples of databases”.
Read MoreNetwork systems security risks
Networking has played a vital part in the transfer of information as well as the accessibility of information that was never available to previous generations with the rapid increase of internet-connected devices.
Read MoreCommunications and The Software Development Process
Software Engineering or the Software Development Process is broken down into the following phases.
Read MoreGet the total size of all the files in a directory
It’s amazing how many times I’ve need to find out the total size of all the files in a directory on one of our servers.
Read MoreStructured and Object-Oriented Programming
Software development has really come a long way over the past few decades.
Read MoreMoving a MySQL Database without downtime
At Statvoo Analytics we found ourselves in the position where we needed to move our master MySQL database without ANY downtime and for anyone who’s tried to do this, you will know how hard this can be if it is not done exactly right.
Read MoreHow to use Google Analytics in AngularJS
It seems to be quite a popular question with not as many answers to hold the weight.
Read MoreConverting from Legacy to Client-Server or Distributed Systems
What is a legacy system? A legacy system is a computing system that has been around for a very long period of time, tends to be difficult to maintain, is prone to issues such as lack of scalability and feature additions, usually centralised in operation and is still heavily utilised in a particular organisation.
Read MoreConceptual Architectural Views, with a focus on the Development View
What is Conceptual Architectural Views? Architectural views are abstractions, or simplifications, of the entire design, in which important characteristics are made more visible by leaving details aside.
Read MoreAssessing Reusable Parts in a Software Architecture
During the Software Development Life Cycle (SDLC) the development team will come to realise that parts of any application have already been created before and there is the potential for those parts to be reused time and again going forward.
Read MoreAn Introduction to 2-Tier and 3-Tier Client-Server Systems
All software systems can be grouped in either a 2-tier or a 3-tier formation.
Read MoreRemove the Outermost Parentheses using Python
The Question A valid parentheses string is either empty (""), "(" + A + ")", or A + B, where A and B are valid parentheses strings, and + represents string concatenation.
Read MoreThe Pros and Cons of Agile in Software Development
What is Agile in Software Engineering? Agile approaches help teams respond to unpredictability through incremental, iterative work cadences and empirical feedback.
Read MoreContemporary and beneficial uses of Big-Data Systems
Big data is a term applied to datasets whose size or type is beyond the ability of traditional relational databases to capture, manage, and process the data with low-latency.
Read MoreDistributed Database Systems Observations
Traditional database systems were a centralised powerful database server that housed all operations pertaining to the database.
Read MoreFunctions of an Operating System
I am in a bit of an unusual situation where “I use” a combination of three different laptops, which each run different platforms.
Read MoreORDER BY RAND() – Faster Alternative
MySQL’s ORDER BY RAND() function can be so useful for returning random items from a table, in fact, we have used it a million times over the years.
Read MoreTop-down vs Bottom-up Database Design
There are essentially two different approaches one can take when designing databases; these, from a high-level analytic point of view, narrow down to what is typically called “Top-down” and “Bottom-up” philosophies or methods.
Read MoreHow to keep your web server or blog up when you get a traffic spike
So you’re about to be featured on some very high ranking website.
Read MoreHow to get the UTC Timestamp in Python
All dates in your server applications should be stored in the UTC timezone.
Read MoreHow to setup the AWS CLI for multiple profiles
The AWS CLI provides the ability to use the wide range of Amazon Web Services tools and services straight from the command-line.
Read MoreHow to get the size of an AWS S3 bucket
If you need to get the size of an AWS S3 folder, or even an entire bucket, you can do so with the following command:
Read MoreComparing Java and Javascript
Perhaps the first thing that most people ask when they hear the names of these two programming languages are.
Read MoreAn Introduction to Data Structures
When bringing up the topic of “Data Structures”, it is first important to understand what they are.
Read MoreRelational Database Proprietary Extensions
Standard Query Language – or SQL for short – is a language designed for relational databases that allows end users such as developers and database administrators (DBAs) to manipulate data.
Read MoreLocks used in Database Management Systems
Database Management Systems (DBMS?) are designed to store any amount of data that can then be retrieved or manipulated at a later date.
Read MoreTail and Grep: display all output but highlight search matches
I tail logs quite a lot. An example would be to tail the Apache2 access logs.
Read MoreConvert URL String into a Javascript Object
Sometimes you find yourself with a String, something like and you want to repeatably access elements of it correctly.
Read MoreHow to make an HTTP Request in AWS Lambda using Python
The requests module for Python is very useful in helping simplify HTTP/s requests from Python, but how would you use it in an AWS Lambda script?
Read MoreHow to fix a Javascript Uncaught ReferenceError
Sometimes you may get an error that looks something like this:
Read MoreResolving InsufficientPrivilege Errors in Redshift
If you are getting the mysterious error: [ERROR] InsufficientPrivilege: permission denied for schema errors
Read MoreHow to increase column size in Redshift database tables
It is only possible to alter VARCHAR columns, and only under the following circumstances:
Read More[Solved] The provided execution role does not have permissions to call CreateNetworkInterface on EC2
If you are trying to get an AWS Lambda added attached to a VPC, but get the error message:
Read MoreEntity and Referential Integrity in Relational Databases
Data integrity is the overall completeness, accuracy and consistency of data (Techopedia, n.
Read MoreData Warehouses vs Data Marts
Although the terms “data warehouse” and “data mart” sound similar, they are quite different.
Read MoreAmazon’s custom Whois date entry
Whois is an online service that let’s you know registration information about a website or IP address.
Read MoreGraph Databases and their Properties
The concept of a graph in mathematics is simply a collection of elements which are typically called Nodes and are joined together by Edges.
Read MoreHow to add SSH keys to GitHub
When working with GitHub, you will need to identify yourself. The default way is using your username and password.
Read MoreGet the Maximum Length of a Concatenated String with Unique Characters in Python
The problem Given an array of strings arr. String s is a concatenation of a sub-sequence of arr which have unique characters.
Read MoreApache Kafka’s Role in Big Data Streaming Analytics
The world of Big Data started out as a way of storing and querying obscene amounts of information by comparison to what yesteryears were able to achieve.
Read MoreMitigating Risks with Software Development Outsourcing
In the Oxford Dictionary, the term “outsourcing” is simply defined as obtaining goods or services by contract from an outside supplier (OxfordDictionaries.
Read MoreThe Primary Data Types in Java
In Java there are eight basic data types; which are: byte, short, int, long, float, double, boolean and char.
Read MoreOverloading Operators in Java
As with many programming languages such as C, C++ and C# (known commonly as the C family), it is possible to “overload methods” (sometimes called functions if not used in classes, such as C) in order to take a different amount of parameters so that they can be used in multiple scenarios with similar internals.
Read Moreuncaught typeerror: $ is not a function
The dollar-sign ($) in Javascript has for many years now been associated with jQuery.
Read MoreHow to get the last element of a list in Python
Let’s say that you have a Python list with the following 5 foods:
Read MoreHow to embed a web server in your Python3 app
This is not the first time that I created a Python3 application that spat out some output and required access to it via an HTTP server.
Read MoreHow to get the Range Sum of Binary Search Tree using Java
Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive).
Read MoreHow to duplicate zeros in place using Python
Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right.
Read MoreA Quick Introduction to Asyncio in Python3
Python has never been the best at doing multiple things at the same time.
Read MoreHow to replace newlines with commas in CLI
If you need to replace all newline characters with a comma, or perhaps some other delimiter, then using the build-in tr utility will work very well for you.
Read MoreHow to make a disk cache using PHP
If you have a busy PHP driven website and don’t want to make constant queries to the database for each user that will see the same data, then you can easily resolve this problem by letting the first of these visitors generate a cache for the consecutive visitors.
Read MoreHow to remove files without a certain extension?
You have a directory with a lot of files, and you want to delete only the files that don’t match a specific extension.
Read MoreHow to debug an Apache 404 error
So you are getting an error 404 or perhaps even worse, a 500!
Read MoreHow to Reorder Data in Log Files using Python
Let’s say that you have an array or a list, or logs.
Read MoreAnother WTF Javascript Moment
Javascript is a powerful language, but sometimes it doesn’t always do what you expect it to.
Read MoreHow to Bring Back GROUP BY in MySQL
If you are suddenly not able to perform GROUP BY statements as you used to after a MySQL/MariaDB version update, then you will have noticed the change forced upon you.
Read MoreHow to implement a Queue using Stacks in Python
A common programming interview question, and for a change, one that you will actually be able to use in the job, is that of implementing a Queue by means of using Stacks in Python.
Read MoreFind positions of largest groups of characters in a String with Python
The question Take a string S of lowercase letters. These letters form consecutive groupings of like characters.
Read MoreHow to make Git “forget” about a file that was tracked but is now in .gitignore?
You can ignore certain files and folders from being committed to Git by means of including a .
Read MoreHow to Purge the BinLog for MySQL and MariaDB
If you see lots of disk space quickly disappearing on your MySQL or MariaDB server, then you may want to look into the BinLog directory, it is located at /var/log/mysql/.
Read MoreHow to Measure Execution Time in Google Colab
Google Colab is a fantastic environment to write Python code using Jupyter Notebooks, hosted for free by Google.
Read MoreHow to fake a User Agent in Python
A User-Agent is a bunch of text that is sent with every HTTP and HTTPS request.
Read MoreHow to Delete from a Table where rows match in Another Table – MySQL
So you have a table where you want to delete a bunch of rows, based on a particular column being matched in another table.
Read MoreREPLACE INTO instead of INSERT INTO – MySQL
There are many occasions where you need to INSERT a record into a MySQL database table, but the record already exists.
Read MoreRead the bottom n lines of a file in Python
Using Operating System Commands in Python Use the Linux/Mac tail command to provide the data:
Read MoreHow to Format a Number as a Currency in Javascript
There are quite a few ways to format a number as a currency value in Javascript.
Read MoreHow to Change the Timezone on Ubuntu Server
If you’ve ever typed date into your Ubuntu Server and seen a different time or timezone appear than you expected, then it probably means that this tutorial is for you.
Read MoreHow to make a Python script Pip-installable
As Python developers, we’ve all used pip to install applications, but speaking to other Python developers, it’s not always clear how to make your own application/script pip-installable.
Read MoreHow to Host an AngularJS site on AWS S3
AngularJS is a Javascript Framework that allows you to create dynamic front-end web applications easily.
Read MoreHow to send emails using Python and AWS SES SMTP
Sending emails using Python and AWS’ SES service is really easy.
Read MoreGenerate a random number between two numbers in JavaScript
If you need to generate a random number between two numbers in JavaScript, then you are in the right place!
Read MoreWhy Password Managers are Not the Solution
Why a Password Manager? Password managers exist for two main reasons.
Read MoreRead the top n lines of a file in Python
Sometimes you may need to read the top n lines of a file using Python.
Read MoreHow Fast is your Website?
I operate a bunch of different sites and have done for many years now.
Read MoreHow to Git Reset a Single File
It’s very easy to reset files that have not yet been committed to git.
Read MoreIntroducing Variables in Golang
Golang comes with a decent offering around variables that you can use to store, retrieve and manipulate information.
Read MoreGolang cannot convert (type string) to type int
Every language has it’s ways of converting data types. One of the most common data types to convert between is that of strings (string) and integers (int).
Read MoreLearn Golang as a Python Developer
Learning Go or Golang as a Python developer, programmer or software engineer is easier than you think.
Read MoreRemove Special Characters in a String using Bash
Programming languages provide the ability to remove special characters from a string quite easily.
Read MoreGet the Amount of Days Between Two Dates in Python
Let’s say that you have two dates: "2019-01-29" "2019-06-30" How would you create a function that would return the number of days between these two dates?
Read MoreHow to Always run Python 3 from Bash
Given a directory that contains: | |- app.py |- requirements.txt |- .
Read MoreHow to Run the Kubernetes Dashboard Locally
Kubernetes comes with a pretty nice dashboard to view clusters, worker groups, nodes and pods.
Read MoreHow to tell if a year is a Leap Year in Python
Given that we are in a leap year this year (2020), it would be nice to know how to programmatically calculate this.
Read MoreHow to Reverse a Linked List in Python
It’s important to know about data types and one that comes up fairly regularly is that of Linked Lists.
Read MoreThe Docker Quickstart Guide for Developers
This Docker Quickstart Guide for Developers aims to get developers familiar with Docker as quickly as possible.
Read MoreHow to Follow Redirects with cURL for CLI or PHP
Let’s take a really common example. Say we want to follow redirects with cURL for google.
Read MoreHow to tell if a String contains a Substring in Javascript
Javascript comes with some pretty good support for determining if a string contains a substring.
Read MoreHow to package a Python app (pip) for PyPi
In this tutorial, we will create a Python application that can be installed directly from pip that will show the 10 latest blog posts from this website (the one you are reading this on!
Read MoreMakePip – Automatically Publish Python to PyPi
Automatically Publish your Python applications to the Python Package Index (PyPI) for use through Pip.
Read MoreHow to find the longest Palindrome in a String using Python
This occasionally comes up during coding interviews and is actually quite a decent way to test someone’s aptitude of moving back and forth on a string to determine if and where palindromes exist.
Read MoreHow to write Anonymous Functions in Javascript
There is a lot of power in Javascript syntax. One of those powerful things is that of Javascript Anonymous Functions.
Read MoreHow to use Docker to test any Linux distribution locally
I often need to test a specific Linux binary or make sure something works as expected from yum install or apt install.
Read MoreHow to get the Maximum Depth of a Binary Tree in Python
Let’s say that you have a binary tree and we needed to know it’s maximum depth.
Read MoreWhat is Fizz Buzz?
Fizz buzz is a common programming interview question. The problem statement usually reads something like this:
Read MoreHow to Deploy a Helm “Hello World” app onto Kubernetes
We will create a simple Hello World static HTTP Service using Helm, package it and release it to an AWS EKS Cluster.
Read MoreHow to write a Quicksort Algorithm in Python
While there are libraries available for all programming languages that offer abilities to sort list, arrays and collections, it is important to know how this is achieved.
Read MoreHow to Reverse a String or List using Python
Python comes with the power of slicing. Let’s try it with a String:
Read MoreHow to get the IP address in Python
Python exposes a socket library that allows us to perform networking tasks such as getting the IP Address as well as getting the Hostname of our system.
Read MoreHow to Reverse a Binary Tree in Python
Reversing a Binary Tree is a common programming interview question.
Read More[Solved] Unable to Detach AWS Network Interface
You do not have permission to access the specified resource.
Read MoreHow to delete a file in Python
A quick solution in Python import os os.remove("filename.txt") The above code will delete a file in Python, it will not however delete a directory, or a directory containing files.
Read MoreHow to safely parse JSON in Javascript
JSON stands for Javascript Object Notation and has become wildly popular to transport and store data between application, databases and more.
Read MoreCheck if an HTML Checkbox is checked using Javascript
While processing forms in web development, it’s a common requirement to be able to tell if a checkbox has been checked or not.
Read MoreHow to Push Docker Images to AWS ECR
Docker images are usually stored on Docker Hub, but AWS’s Elastic Container Registry can also be used.
Read MoreHow to monitor Network Traffic on Linux
There is a fantastic tool to see and monitor Bandwidth and Network Traffic on Linux.
Read MoreHow to Merge Javascript Objects
A Javascript Object – now just called JSON – is a collection of values and properties stored as a map.
Read MoreWhen to use Pip3 instead of Pip in Python
If you have multiple versions of Python installed on a system, such as both Python 2.
Read MoreHow to use Screen on Linux
Screen on Linux is a popular command-line program that lets you multiplex between interactive shells.
Read MoreTransfer a domain from Namecheap
Namecheap is a pretty good registrar. As its name says, yes, it is usually pretty cheap.
Read MoreHow to Package a Python App using Nuitka
Learn how to package a Python app in this tutorial.
Read MoreIntroduction to NPM
What is NPM? NPM stands for Node Package Manager, and is the default way to extend your Node applications.
Read MoreHow to create a Symbolic Link on Linux / Mac
A symbolic link – or often just sym-link – is a pointer or shortcut to where the actual file lives on a filesystem.
Read MoreNon-interactive git clone (ssh fingerprint prompt)
If you have ever been in the annoying situation where you had to run git clone from a server that you did not have interactive access to, such as a continuous integration/deployment box or other.
Read MoreWhen your Python code is much faster with PyPy
Python is a very powerful language, there are so many libraries available for it.
Read MoreWhat it takes to be a Platform Engineer in 2020
Platform Engineering is something that grew out of a mix of what software developers and sysadmins had been doing for years.
Read MoreIntroduction to PIP – Python Package Manager
Python comes with a fully equipped package manager called PIP – which stands for the Python Package Manager.
Read MoreHow to build a website quickly using PHP
PHP is a powerful scripting language created for the web.
Read MoreHow to replace all occurrences of a string in Javascript
I have pretty much resigned myself to the fact that in Javascript, there are really only two ways to do a proper search and replace.
Read MoreHow to exit Vim
If only I had a dollar for every time I saw someone sitting at their computer, trying for the life of them to exit vim
Read MoreHow to Setup and Use the Python Virtual Environment
Python is a fantastic language that continues to help so many businesses and individuals.
Read MoreIntroducing the Hetzner Cloud
I could honestly not tell you how many hosting providers I’ve tried over the past 15 years.
Read MoreMultiprocessing in Python3
import multiprocessing def runner(k): print(k) processes = [] for i in range(10): p = multiprocessing.
Read MoreThe Best Note Taking Apps
We’re all using a Note Taking App these days, they’re incredibly useful and come jam packed with loads of features.
Read MoreHow to Delete large amount of files in directory
So you have clearly got a very large amount of files!
Read MoreHow to Merge multiple files, removing duplicate values
If you have multiple files and you want to remove duplicate values from, while creating a single file.
Read MoreUnable to delete an AWS Internet Gateway
So you need to delete an AWS Internet Gateway, sounds good.
Read MoreHow Distributed Applications Work
Distributed Applications come in a wide range of sizes, usages and resource availabilities.
Read MoreWhy Artificial Intelligence (AI) won’t necessarily take your job
Artificial Intelligence, or simply AI these days, is when computers are able to perform tasks that humans would otherwise do.
Read MoreThe difference between ‘git fetch’ and ‘git pull’
Git Pull vs Fetch Many of us take a look at git fetch and git pull and believe them to do the exact same thing!
Read More7 Ways to Make Money Online from Home
1. Create a website / blog There are numerous ways to make money when you create a website or blog.
Read MoreKeep that mouse moving!
Ever needed to keep your computer from going IDLE? Now it’s really simple using KTMM;
Read MoreSerengeti – The Autonomous Distributed Database
What is Serengeti? Serengeti is an Autonomous Distributed Database, and proves the theory of a distributed database that is truly autonomous, requires no custom configuration or human intervention.
Read MoreRun Javascript – Chrome Extension Help
Run Javascript is a Chrome Extension that allows you to run custom Javascript each time you visit a website.
Read MoreInvestigation of insider attacks with computer forensics
Cyber-attacks do not always originate from outside of the target organisation.
Read MoreSquid Proxy behind a Load Balancer on AWS
Squid is a proxy software that allows a computer without internet access to proxy through another computer that does have internet access.
Read MoreHow to install a Ruby Gem without Root on a Mac
Gems are little packaged Ruby applications that allow you to extend the ecosystem and reuse countless online sources.
Read MoreThe dark truth behind Advertising on the internet
The story Steve has a website which sells carpets in London.
Read MoreInternational hosting governments and forensic email cases
Cyber forensics is hard, but it is even harder when servers are hosted in different geographical locations and an investigation needs all localities to cooperate and hand over every part of the data consistently.
Read MoreWhen to give up on your startup/product
One of the hardest things you can do after trying to get a startup or product off the ground is to simply give up and call it a day.
Read MoreJust SSH to my Jump Box!
I am a professional software engineer and do an absolute ton of devops work as well.
Read MoreCounting in Python using a list
So before we begin, let me just tell you that this is a pretty useless thing to do.
Read MoreShow the desktop’s image name on a Mac
Sometimes you just need to know where that image shown on your desktop is stored!
Read MoreNetwork Forensics Concerns around GDPR
In Cyber Forensic there are a vast array of tools that are used throughout most investigations, however, not all jurisdictions allow or even agree to the usage of some of them.
Read MoreA look into Future Developments in Operating Systems from a Cyber Forensics Investigator
Operating systems (OS) really have come a long way since the very first one was created by General Motors in 1956 (WIHT, 2017) to run on an IBM mainframe.
Read MoreComparing Interface Types in Cyber Forensics
In digital and cyber forensics, there are three main types of categories when it comes to forensic tooling.
Read MoreCyber Forensic Investigative Reports
Investigations are not proven in a jurisdiction until a detailed forensic report is created and presented to a judge or jury who can take it to the next level.
Read MoreAltering Computer Evidence
Ever since it has been possible for humans to operate computers, some have used it to perform criminal activities.
Read MoreConnection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)’
This happens when your machine does not have the correct certificate bundle to access the Pypi repository, or you are behind a corporate proxy that just loves to block everything!
Read MoreCan’t pull a Git branch because of merge conflicts?
Sometimes you need to pull a remote branch and want to accept all their commits (and history) and override your own repository.
Read MoreSoftware development processes
Introduction to Software Development Processes Gabry defines the Software Development Methodology to be a set of related activities that lead to the production of the software (2017).
Read MoreApproaches to software reuse
Introduction to Software Reuse Software reuse is the process of creating software from antecedent and extant components.
Read MoreGet the output of an application logged in the terminal
Just a quick note: You are probably looking for a Linux command called `dtrace`.
Read MoreAgile as a Software Development Process
Waterfall and Agile are by far the most commonly used software development processes, however, within them, there are many different styles of software development used in the management of software development projects.
Read MoreBig Data Security and Privacy Issues
Big Data shares what is commonly termed the V properties or characteristics such as Velocity, Volume and Variety which are amongst the most typical or frequently repeated.
Read MoreHow to delete/revert a Git commit
You’ve just pushed something to a Git repository and you immediately regret it!
Read More[Solved] Pip: There was a problem confirming the ssl certificate
If you ever get the following error when trying to install a Pip module under Python:
Read MoreHow to Learn Python Programming Quickly
So you want to learn to program in Python and you don’t have a lot of time?
Read MoreNoSQL Pandas Dataframes
Pandas Dataframes are simply a table with some rows (McKinney, 2015) and many additional features built right in to make data scientists lives much easier.
Read MoreRelational (SQL) vs NoSQL Database Models
The Relational (SQL) database has been a central piece to businesses since the 1970s when they first had their claim to fame.
Read MoreNetflix Hadoop Big Data Marketing Use Case
Netflix is a video streaming service that has a wealth of information about their user base likes, dislikes, general consumer habits, retention lengths and much more.
Read MoreAn Introduction to Client-Server Systems
A client-server architecture/system is one where the server maintains all models of the backend datasets and business logic around taking and providing information to fulfill a service request from a client which in turn shows the representation thereof.
Read MoreWhen to use FLUSH PRIVILEGES in MySQL
So if you’ve ever created users and given them specific permissions from with SQL or the commandline, you will be familiar with a statement called FLUSH PRIVILEGES.
Read MoreMySQL Community Server MSI Installer Hangs on Windows 10
I was trying to install MySQL Community Server for Windows 10 using the standard .
Read MoreAndroid device supports x86, but APK only supports Arm
I get this error quite a lot when trying to deploy an Android APK to an emulator.
Read MoreWeird Dialog Boxes
Adobe Setup setup? Got this one while using Chrome, it complains about Safari?
Read MoreA bit on SQL Standards
SQL (Structured Query Language) for relational databases was maintained and standardised by the American National Standards Institute (ANSI) and the International Organisation for Standardisation (ISO) which is affiliated with the International Electrotechnical Commission (IEC).
Read MoreA Brief Talk on Databases
Databases have been around since ancient times, when elaborate database systems were deployed by governments, hospitals and organisations to keep track of vast amounts of information; but only until around the 1960s did computerised databases start to take shape and become cost effective for private organisations to start using (Quickbase, n.
Read MoreCloud Computing – The Refute
Cloud is great, but when you know what you are doing, think about alternatives (Blippex, 2013).
Read MoreAuditing Organisational Information Systems – Security
Auditing an organisation?s information systems is a vital part of operating a business at any decent scale.
Read MoreBiometric Technology
What is Biometric Technology? Biometric verification is any means by which a person can be uniquely identified by evaluating one or more distinguishing biological traits (Margaret Rouse, n.
Read MoreCopyright Compensation in the Internet Age
The original conception of copyright in 1710 (Craig Joyce, n.d.) was that it usually covers only the expression of a particular idea and not the idea itself, but this was a very long time ago, before the challenges of a digital society.
Read MoreControlling employee digital access
Organisations of all sizes have taken to controlling what their employees can access in order to conserve computing resources, keep their employees focused 100 percent on the work they were hired to do and to make sure employees performance is high and as productive as possible (Cyberoam, n.
Read MoreElectronic monitoring in the workplace
Electronic monitoring is not a new thing, nor one that only affects the workplace.
Read MoreThe Therac-25 Case Study – What Actually Happened?
The Therac-25 was a computerised medical technology radiation therapy machine produced by Atomic Energy of Canada Limited (AECL) in 1982.
Read MoreYour Responsibilities as an IT Professional
As an IT professional it is extremely important to make sure that you do not take advantage of your position on being able to introduce certain skewed characteristics into a computing system in order to gain unfair advantage to your company or client?
Read MoreNew capabilities with technology
Computing technology has undoubtedly had some very prominent impact on society at large.
Read MoreThe Printing Press – Technology’s impact on society
It’s important to first define what the term “technology” means.
Read MoreGoogle Abuses Search Dominance in the European Union
The EU Commission found that Google has been favouring their very own shopping service while demoting those of their rivals as well as the placement of how they are seen in search results online.
Read MoreUnderstanding the Risks of Commercial off-the-shelf software (COTS)
Commercial off-the-shelf (COTS) software can be an attractive buy in for many companies when it comes to:
Read MoreIdentifying Risks in Software Engineering
In Software Engineering it is absolutely paramount to identify all risks that may arise in a given project or grouping of tasks.
Read MoreSoftware engineering challenges in the 21st century
Software Engineering covers not only the technical aspects of building software systems, but also management issues, such as directing programming teams, scheduling, and budgeting.
Read MoreComputer Memory – The Breakdown
Storage devices have come a long way in an extremely short amount of time; given how much they have changed from just my personal knowledge alone.
Read MoreCurrent Trends in Computing
The American multinational technology company Yahoo, which has been around since the mid nineties has once again been hacked.
Read MoreAcademic integrity in a cultural context
In academia it is vitally important to backup your own thoughts and ideas by using previously written authoritative papers and articles in reference.
Read MoreHow to get more traffic to your blog
If there’s only one thing that keeps website owners up at night, it’s thinking about the next wave of traffic that they aren’t yet getting.
Read MoreHow big is Amazon S3 really?
Amazon’s Simple Storage Service, or simply S3 for short, is a product designed for storing objects (or files are most people know them) in their proprietary cloud hosting (AWS).
Read More3 Things you should be tracking with your analytics software
What should we be tracking? This is a question we get asked quite a often – mainly by new customers as well as people who aren’t certain if what they’re looking at adds any value to their daily business time usage.
Read More11 of the Best Google Analytics Alternatives
So most webmasters know about Google Analytics and have probably used it to some degree, but did you know that there are some pretty good alternatives out there, some even better than the all-famous Google Analytics.
Read More503 Service Unavailable: Back-end server is at capacity
The Web server (running the Web site) is currently unable to handle the HTTP request due to a temporary overloading or maintenance of the server.
Read MoreUser Testing and Feedback?
So now you have a website, you use it and love it, but does everybody else?
Read MoreDate ranges are the key to a better index
Since AO Analytics originally went live in February 2013, we have been doing focused around individual time based reporting, it worked well and we were able to sort through indexes without doing full table scans.
Read MoreTrack your Alexa Rank History
The Alexa Rank is a way of determining a website’s popularity.
Read MoreWhy Website Analytics Is So Important These Days
The web has come a long way since Tim Berners-Lee, a British scientist at CERN, “invented” the World Wide Web (WWW) in 1989.
Read MoreCreate daterange array of missing dates
<?php //fromDate 2014 - 01 - 22 //toDate 2014 - 02 - 20 //$arr Array( [0] = & gt; Array( [ISO_DATE] = & gt; 2014 - 02 - 18[DAY_SUM_AMOUNT] = & gt; 3000[DAY_SUM_VOLUME] = & gt; 2[CONVERSION_PCT] = & gt; 100 ) [1] = & gt; Array( [ISO_DATE] = & gt; 2014 - 02 - 19[DAY_SUM_AMOUNT] = & gt; 4000[DAY_SUM_VOLUME] = & gt; 1[CONVERSION_PCT] = & gt; 100 ) ) //codetime function createDateRangeArray($strDateFrom, $strDateTo) { $aryRange = array(); $iDateFrom = mktime(1, 0, 0, substr($strDateFrom, 5, 2) , substr($strDateFrom, 8, 2) , substr($strDateFrom, 0, 4)); $iDateTo = mktime(1, 0, 0, substr($strDateTo, 5, 2) , substr($strDateTo, 8, 2) , substr($strDateTo, 0, 4)); if ($iDateTo & gt; = $iDateFrom) { array_push($aryRange, date('Y-m-d', $iDateFrom)); // first entry while ($iDateFrom & lt; $iDateTo) { $iDateFrom += 86400; // add 24 hours array_push($aryRange,date('Y-m-d',$iDateFrom)); } } return $aryRange; } function recursive_array_search($needle,$haystack) { foreach($haystack as $key=>$value) { $current_key = $key; if ($needle === $value or (is_array($value) & amp; & amp; recursive_array_search($needle, $value) !
Read MoreSpeedtest on Ubuntu Server (commandline)
Using the speedtest-cli is easy and very useful. You run it as follows:
Read MoreURL GET vars to PHP Array
Sometimes you will need to retrieve the GET variables passed into the current page URI or you will have a URL string to work from which contains certain GET variables, the below method helps a lot to convert them into an array which you can easily manipulate later.
Read Morepython "AttributeError: ZipFile instance has no attribute ‘__exit__"
This is actually a very easy error to fix, eventhough off the bat it seems a lot more involved.
Read MoreRemove specific HTML tags using PHP
There are times when you want to remove a specific HTML tag from an HTML block of text.
Read MoreKeep Google Map v3 centered when browser is resized
Using Google Maps V3 Javascript API you can keep the map centered to the browser’s window by using the following trick when resizing the window.
Read MoreBuy a Google Nexus 10 in the UK!
If you are looking to get a Google Nexus 10 inch tablet and are based in the UK you are in for a shocker!
Read MoreLet Joomla and MySQL interact!
I often need a quick and easy few lines to retrieve some data from MySQL using Joomla without all the MVC nonsense that usually goes about this topic.
Read MorePerform a Mysql Query using Joomla!
This is really actually meant for future reference for myself as lately I’ve been doing quite a lot of Joomla!
Read MoreRefresh User Data in Joomla
I was busy with a custom component in Joomla, and it stored it’s own user_details based off of the main users table, but if the details were changed then I needed the system to update the session to reflect the changes.
Read MoreExtract email addresses from a string – PHP
Sometimes you need to extract multiple email addresses from a string and the following function will make all your dreams come true.
Read MoreHow to drive traffic to your website!
This is a very hot topic indeed. Definitely one that everyone with a website should know all about.
Read MorejQuery limit fields to alphanumeric characters only
I was trying to restrict a form’s field from only allowing the user to enter alphanumeric characters into it.
Read MoreMake a dynamic year dropdown using PHP
Ever wanted to have a dropdown that automatically showed the current year and the few years before it?
Read MorePad a string with zeros using PHP
Recently I had to create a code/username maker to fit into a certain type of pattern so that all “broker codes” (as they were called) followed the same path.
Read MoreImportError: No module named MySQLdb (Python)
Trying to use MySQL with Python and getting an ImportError?
Read MoreSearch for “arabic” is url request and change codepage – ASP
If you are using Classic ASP (yuck) to create an arabic section of a website you can search for the arabic string in your Request URI and then change the session’s codepage as follows:
Read MoreWindows 7 is better than Ubuntu 12.04 on desktop!
Today we have finalised for ourselves that Windows 7 is definitely a “better” operating system than Ubuntu 12.
Read MoreFunction split() is deprecated in PHP
You heard it right! split() is officially a deprecated function. That means that you can still use it if you are really brave and it will work correctly, but don’t expect to see it in later versions of PHP when they come out.
Read MoreDisable Cache in jQuery
I usually run into this problem when dealing with good ol’ Internet Explorer (.
Read MoreWhere is Technology heading, perhaps we should focus more on Software?
I often wonder to myself where the technology industry is heading as I see new things come out almost daily.
Read MoreHow to break out of an iframe
So someone’s trying to make their site better by opening a page on your site inside of their site using an iframe?
Read MoreEdit hosts file on Windows 7
The hosts file is used to manually alter the hostname or IP address in place of it being served by a Nameserver, also known as via DNS.
Read More(EAI 2)Name or service not known: Could not resolve host name *.80 — ignoring!
You are no doubt trying to add a vhost and you get the following error when attempting to affect changes by restarting the http daemon (httpd):
Read MoreVirgin Media blocks torrent sites!
Virgin Media have done it again! They have gone and started a “downloaders war”, I’m sure of it.
Read MoreHow to Comment out a line in a Crontab on Linux
Firstly let’s just note that crontabs are read in the following way:
Read MoreDateTime conversion function using PHP
It’s really very simple to convert times in different timezones using the following function.
Read MoreConvert seconds to days, hours, minutes, seconds in PHP
With the following function you can easily convert an integer containing seconds to a nice days, hours, minutes, seconds string or array.
Read MoreRemove dotted outline around anchors
This has become quite a common question asked by many website owners.
Read MoreGet amount of hours between 2 hours
If you would like to get the amount of hours between 10:00 and 12:00 then use this!
Read MoreHow to embed HTML5 video with fallback
A common question with the rise of HTML5 becoming more and more common and the whole iGeneration (iPhones/iPads/iEtc) is “how can I embed a video on my site without using a flash player?
Read MoreHow to backup all mysql databases
In order to backup all mysql databases, you can run the following command in your linux command line:
Read MoreInvalid command 'RewriteEngine'
If you receive the following error message if means that mod_rewrite is not enabled in Apache:
Read MoreHow to get the Hours Difference (in HH:MM format) in PHP
It’s very simple to get the difference in hours using PHP
Read MoreWarning: Invalid argument supplied for foreach()
A common error which occurs with foreach loops is the standard “Invalid argument supplied for foreach()” whch gets thrown up as a warning.
Read MoreUnable to connect to any of the specified MySQL hosts.
If you get the following error while trying to connect to a MySQL database using a third party client such as TOAD or SQL Workbench, then you need to edit your mysql server’s my.
Read MorePHP nl2br on one line
I usually store data from a textarea directly to the database as is, then once I retrieve it back into HTML I use that lovely PHP function nl2br() to convert it to HTML
Read MoreLEN in MySQL
In MySQL 5.1 LEN is called LENGTH, you use it exactly the same and pass in the link, so: LENGTH(link).
Read MoreRemove all linebreaks in PHP
If you are having problems with a string that keeps adding a line break when output from PHP to HTML then the following code will work wonders for you!
Read MoreIE9 adding empty table cells in large table
Well as usual, we are once again fighting the woes of the beloved Internet Explorer, and it appears that Microsoft’s latest greatest new and improved browser rival to the market IE9 still has a whole bunch of irritations and retardation to worry about (saw that one coming).
Read MoreSELECT Duplicate Items Using SQL
If you have a table which has duplicate items in then you can use the below statement to select them.
Read MoreMySQL Error: Can’t get hostname for your address
This error is thrown by MySQL because it tries to do a DNS lookup on the address connecting to the server and it fails due to the IP not being able to be resolved back to a name or some-other deeper DNS bust problem.
Read MorejQuery Colorbox not showing but background shows
I was using Colorbox for some lightbox type effects to show larger images when clicking on thumbnails, but for some reason the background was showing up but the pretty little box in the middle where the larger image is supposed to show never showed up, so this is how I made it finally appear after many failed attempts!
Read MoreGet Value of Checkbox using jQuery
This one is quite an easy one, but a good one to mention non-the-less as it does definitely come in really handy.
Read MoreEverybody’s a web host
To cut straight to the point, “we’re living in the age where everybody’s a web host”.
Read MoreCSS Background Default
If you would like to override an already attached class containing a background then you can use the following:
Read MoreRestrict PHPMyAdmin to IP Address
Would you like to restrict PHPMyAdmin from being accessible to the whole world?
Read More2014 – Commands out of sync; you can’t run this command now
#2014 – Commands out of sync; you can’t run this command now
Read MoreImage corrupt or truncated: “unknown”
What is “Image corrupt or truncated: ” and what does it mean?
Read MoreWordPress wp-admin use different language for user
I needed to do some work on a WordPress site a little while ago and all the admins were French – and I cannot speak French other than the popular swear words – so had no idea what was going on in the /wp-admin/ so needed some way of enabling my newly created user account to be in english while letting everybody else use french as they had been up til that point.
Read MoreReplace all spaces in HTML with except in HTML tags using PHP
If you would like to replace all the spaces in an HTML string with so that you can render it out to the browser but you also want to retain current spaces in HTML tags you can use the below method:
Read MoreUsing PHP to validate an IP address
You can use the PHP code below to check if an IP address is valid or not.
Read MoreWhat is the difference between is_home() and is_front_page()
Call me ignorant, or call me an ignorant geek, but I used to think is_home() and is_front_page() was the same thing, until I experimented with them the other day and noticed they did quite different things.
Read More..near 'option o ON (po.option_id = o.option_id) LEFT JOIN option_description od ON (o.o' at line 1
So you’ve just installed Opencart 1.5.0 and when attempting to edit a product or category or etc you get the following error:
Read MoreHide all error messages PHP
PHP Error messages showing up in your web applications are a dangerous thing.
Read MoreWhat is xmlrpc.php?
It is a script which allows clients to make procedural calls over the net.
Read MoreWindows Genuine Advantage Notifications in a VM
Windows Genuine Advantage Notifications I am running a Windows XP SP3 VM used for testing multiple versions of InternetExplorer through Virtualbox.
Read MoreForce HTTP using htaccess
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
Read MoreStop That Referrer in PHP!
Today I will show you a method to stop the traffic that a referrer site is sending your way, you may wonder why you would want to ignore traffic, after all, isn’t inbound traffic to your site fantastic no matter what?
Read MoreViva la 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0!
You may see this around and not have a clue what the heck it is, weirdly enough, I did.
Read MoreTernary Operation
If you do not know what the Ternary operator is, or do not use it while you are coding, let me be the first to tell you how much you are missing out!
Read MoreOops the system encountered a problem (#104)
If you get the following error while using Google’s Gmail Service (gmail.
Read MoreHow to Write Unmaintainable Code
I have come across the following article before and again came across it today, after a revised browse through, I thought I may as well add another link to it on the web for whoever ends up clicking on it!
Read MoreCaptcha Fail!
Hey, thought I’d just post this one incase anybody else sees it and thinks it’s funny.
Read MoreTest IE versions on any machine!
Do you do web development and are unable to test your software in old shitty versions of Internet Explorer?
Read MoreError 500 php_value .htaccess
I noticed on some server setups I could not do the following inside a .
Read MoreWindows Directory Tree Never Finishes Loading?
I am running Windows 7 64-bit and since yesterday whenever I open “My Computer”/“Windows Explorer” (-Windows+E) the initial “showing drives” screen is frozen, so I have to use the address bar to navigate to the path I need to go.
Read MoreWordPress remove Subscribe to my RSS feed after posts
If you are running WordPress and have noticed a line under all your posts that says:
Read MoreAnd then there was Google Instant!
If you have visited the Google.co.uk homepage (Yes, that’s Google UK) recently – since about the 8th of September 2010 then you would have noticed a new search feature Google is pushing called Google Instant.
Read More[Solved] PHP’s typeof – gettype()
Quite often you may need the ability to check what type of data type a variable is.
Read MoreWhen to use SSL?
There has always been quite a lot of heated discussion around the question of when to use SSL and when to avoid it while building websites.
Read MoreIE6 PngFix in Javascript
As a web developer you will know just how much we all love hate Internet Explorer 6 – one of the most dreaded browsers and browser versions that still exists in the deep dark corners of the interwebs – and you will probably have figured out that it doesn’t play well with PNG images.
Read MoreMSSQL Select Not Null
I mainly use MySQL these days, so get screwed over for a few minutes when I have to do something in MSSQL that is slightly different when it comes to it’s custom syntax.
Read MoreWhat is __utma, __utmb, __utmc, __utmz ?
__utma, __utmb, __utmc and __utmz are 4 cookies created by Google Analytics, for a detailed and very informative read, go here and here.
Read MoreHow to Close Bandmix Account
If you want to close a Bandmix account, then: Login to bandmix.
Read MoreGoogle Redirect Virus Fix!
Now this is an annoying one. You go to any of google’s sites including any site that has google-analytics.
Read MoreChromium Operating System
As many of you may know, Chromium is an opensource project that is basically an Operating System built on Linux and is just like working in Google’s Chrome web browser.
Read MoreSuper Easy Email Validation AS2
I needed a quick and easy way to check for the basics of an email address.
Read MoreODBC SQL Server Memory General Network Error
Microsoft OLE DB Provider for ODBC Drivers error ‘80004005’ [Microsoft][ODBC SQL Server Driver][Shared Memory]General network error.
Read MoreXML cannot be the whole program
What the hell does that mean? You can get this error thrown up in your good old trusty Firebug console.
Read MoreEAI_NODATA
Error message: Connection attempt failed with “EAI_NODATA – No address associated with nodename”.
Read More1180 Call to a possibly undefined method navigateToURL
1180 Call to a possibly undefined method navigateToURL If you get the above error when trying to run your flash actionscript 3 file, you are obviously trying to use the navigateToURL() function but have not imported the flash.
Read MoreTest Your Password Strength
I came across this site today and it’s quite an interesting one as it works out the approximate time it would take a desktop pc to crack the password.
Read MoreGoogle Background Image
Google now allows you to add a background image to the google homepage to apparently make it more, like, home.
Read MoreHow to Hire a Hacker
I came across a very interesting and quite funny read, take a look here for How to Hire a Hacker: http://www.
Read MoreIf the program is already running, close it before attempting to run.
Launch Failed! If the program is already running, close it before attempting to run.
Read MoreRandom Number In ASP for no Flash Caching
This is an example of how to create a random number in Classic ASP in order to append to a swf file so that the browser does not cache the swf file.
Read MoreWhy we don’t choose MSSQL!
Everybody always raves how great Microsoft SQL Server is, and how much data it can hold, and how much bigger it’s “package” is than your own.
Read MoreHow Do You Fire A Client?
How do you fire a client? Let’s face it, some clients can be a real nightmare.
Read MoreHow to get ‘how many days in February’ using Javascript?
It is quite handy to have a function that can tell you how many days there are in February due to the leap year shift of either 28 or 29 days.
Read MoreActionscript 2 – PHP Data Transfer
In the below example we will use Actionscript 2 to call a remote PHP file that will return data to it.
Read MoreUnique Random Numbers in PHP
If you would like to show random numbers using PHP you can do this:
Read MoreHTML mail() Sending as Plain Text
$to = "[email protected]"; $subject = "SUBJECT"; $message = "<b>MESSAGE</b>"; $headers = 'MIME-Version: 1.
Read MoreTurbo C++ in DosBox for Windows 64bit
I had to compile a C++ application under a DOS environment and was running Windows 7 64bit.
Read MoreCase Insensitivity with .htaccess files
If you have an .htaccess file to control the flow of URI’s on your site you may want to look at adding a nice little “case insensitive” feature to each line/item.
Read MoreActionscript2: Split string by line length with & without word-wrap
Split string into sentences by max line length. This uses a character array but doesn’t use word-wrapping.
Read MoreSearch and Replace Anchor Href using Javascript
I have a site that is under development and it was made really badly so I needed a quick way to replace all anchors on page to the relevant path.
Read MoreError 29506 while installing SQL Server Management Studio Express
I was trying to install Microsoft SQL Server Management Studio Express (what a long name) on a machine and kept getting error 29506 right near the end with a Rollback action thereafter.
Read MoreSwap HTML Elements Using Javascript
It is quite easy to use javascript to swap between divs or any other html dom elements.
Read MoreA PHP Mail Class
Below is a Mail class I created in PHP, it requires 4 arguments on initiation of the class via the constructor and uses the method ->send() to send the created mail once complete.
Read MoreReplace newline break in Excel
Ever needed to find & replace the newline character in a large excel document?
Read MorePHPExcel Class Usage
I just finished adding an export xls (excel) export feature to a web application.
Read Moreunexpected T_IF
Getting “Parse error: syntax error, unexpected T_IF” ? Check if the preceeding line ends with a ;
Read MoreWorst Websites of All Time
http://www.arngren.net/ http://www.lingscars.com/ http://www.theworstwebsite.com/ – beware, alert boxes coming! http://havenworks.com/ http://www.msy.com.au/ http://www.
Read MoreSet line leading / line spacing in flash actionscript 2
This is how to add text leading using Actionscript 2 for Flash.
Read MoreMySQL Main Query Types used in PHP to select, insert, update and delete data
MySQL Main Query Types SELECT SELECT * FROM tablename INSERT INSERT INTO tablename (col1, col2, col3,.
Read MoreConnect to mysql database from php
If you need to connect to a mysql database from php you can do it like this:
Read Morehtaccess file and error 500 internal server error
I have a question for anyone that can answer it:
Read MoreQuake 4 – Fatal Error: could not create destination file
If you get an error message similar to this one when trying to run Quake 4…
Read MorephpMyAdmin – Invalid field count in csv input on line 1
I was trying to import a massive csv dataset into phpMyAdmin and it kept throwing error:
Read MoreChoosing a programming IDE
This is somewhat of a debatable topic, but it has come up a lot of times without any real final clarity, so I will try and cover it all.
Read More[Exception… “Could not convert JavaScript” nsresult: “0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)”
What the heck is.. uncaught exception: [Exception… “Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.
Read MoreError 1046: Type was not found or was not a compile-time constant: Event.
Error 1046: Type was not found or was not a compile-time constant: Event.
Read MoreAdd a date to a date in Actionscript 2
I needed to work out a date range according to the date 3weeks away from the current date.
Read MoreAdd a month to selectable date range – Date Chooser – Actionscript 2
I have been working on a project where I need to select a date range starting today and ending a month from now, so the user cannot select anything in the past or over a month from now.
Read MorehitTest and Actionscript2
if (mc.hitTest(_root._xmouse, _root._ymouse, true))) { trace("hitTest Run"); }
Read More127.0.0.1:4664 and Google Desktop Search
Recently I checked my website stats and saw I had a few hits from “127.
Read MoreLimited numeric input in flash actionscript 2 textfield
If you want to only show numeric characters in a textfield in flash actionscript you can use the following code:
Read MoreEmbed pound symbol (£) in flash textfield
If you use a dynamic textbox in Flash and you want to embed the British Pound symbol (£) then you will want to also embed the “Latin I” glyphs with your textfield.
Read MoreEnable / Disable Cursor Hand in Actionscript 2
If you have a movieclip that by default has the hand cursor showing on RollOver and you don’t really want this, you can disable it by doing the following:
Read MoreCalling event functions from movieclips in actionscript 2
In a flash movie I usually have a frame of actionscript that controls all elements in the file to keep everything in one place.
Read MoreSudo install OpenGL & SDL on Ubuntu
A quick and easy way would be to type the following in one line with single spaces in the Terminal.
Read MoreHow To Modify Hosts File On Windows
The hosts file is located at the following address: C:\windows\system32\drivers\etc</span>
Read MoreGet all directories in PHP
I think this may be the fastest way to get a list of all the directories in a given folder/directory using PHP.
Read MoreSecurity error: securitySandboxError with Flash
You have a flash uploader and you get this error:
Read MoreComponent Inspector in Flash has ISSUES!
I discovered a very annoying bug in the Flash IDE a little while ago, and it has happened to me quite a few times.
Read MoreClose/Delete Google Checkout Account
I have used Google Checkout to receive payments in the past and have had problems with some clients not paying and blaming it on Google Checkout that the money did not go through (like the guys over at Peartree DMS).
Read MoreWarning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource
Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource
Read MoreCapitalize First Letter in Word – Actionscript 2
You have a string and you want to capitalize the first character but have the rest of the word in lowercase.
Read MoreHP Pavilion Laptop Madness
I have got an HP laptop and have started experiencing problems with it starting up for the past few months, it is only about 1.
Read MoreWhy you should use OpenGL and not DirectX
Below is a very interesting article I found that proves all the myths about DirectX being better than OpenGL, a very well written paper describing it best.
Read MoreWhat does __FILE__ in php mean?
In php there are a few magic constants and I find FILE to be a very useful one.
Read MoreWoopra Failed to Connect?
I have used Woopra for a few months now and have started seeing this warning/error almost everyday now:
Read MoreStop mouse click in browsers
There have been multiple ways to stop your user/s from right clicking on your site, but many of them now fail due to the way firefox’s contextual menu loads.
Read MoreMicrosoft apps never care!
I often seem to have this issue when dealing with Microsoft software.
Read MorePlace HTML Div on top of Flash
If you have ever tried to place a div or similar HTML element on top of a swf flash object you will know that it always tries to take precedence.
Read MoreGet current working directory of php script/application
$myPath = realpath(dirname(__FILE__)); or $myPath = getcwd();
Read MoreStage align and Stage scale in actionscript 3
If you want to position the flash top/left and not have it scale when you resize it’s bounding box window, you can set the following code.
Read MoreError 406?
So you received an error 406 while trying to upload a file and you have no idea to fix it!
Read MoreFirefox error in FeedProcessor.js
[Exception… “Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIChannel.contentType]” nsresult: “0x80040111 (NS_ERROR_NOT_AVAILABLE)” location: “JS frame :: file:///C:/Program%20Files/Mozilla%20Firefox/components/FeedProcessor.
Read MoremySQL select multiple ids
SELECT * FROM tablename WHERE `active`='1' AND `id` IN ('107' , '125' ) ORDER BY `id` DESC LIMIT 12`
Read MoreRemove an onRelease Handler
After creating a onRelease handler in Actionscript 2 as follows:
Read MoreshortText function toggler in php
I often have to show a shortened version of a news item and then a link to show the entire news article or whatever.
Read MorePHP – file() lines
$lines = file('all-words.txt'); foreach ($lines as $line_num => $line) { echo "Line number ".
Read MoreWindows Live Writer – Beta2
Start writing content to your blogs from your Windows Desktop now.
Read MoreReported Attack Site!
What the heck is that? So you’ve just visited a website using Mozilla Firefox and this message has popped up telling you that the site looks suspicious.
Read MoreSimple HEX Colour Values
Actual Display Colour HEX Colour #000000 #FF0000 #00FF00 #0000FF #FFFF00 #00FFFF #FF00FF #C0C0C0 #FFFFFF
Read MoreSend Email PHP Function
Ever find yourself typing the headers into the php mail() function over and over again?
Read MoremySQL Development Tools
I came across a very interesting article about mySQL Development Tools.
Read More1180: Call to a possibly undefined method getURL. Actionscript 3
Hello all actionscripters, you can’t use getURL anymore in Actionscript 3.
Read MorePapervision Event Listener Idea
The problem: While working on a Papervision3D Flash Project I had a problem where a back button that sits above the 3d canvas and acts as a main navigational item was required to change Events according to where the site was in 3d space at the time.
Read MoreDon’t cache my swf files!
I often have issues where ‘dumb browsers’ cache my published swf files and when they dynamically populate they don’t always update.
Read MoreClear an array in Actionscript 3
I personally really like this way of clearing an array’s elements:
Read MoreChange combobox font size in Flash Actionscript
Ever needed to change the font size of a standard flash combobox component?
Read MoreWordwrap that PRE!
Ever used a <PRE> in a limited width div container? You will notice that the line gets cut off almost as if word-wrap was not enabled.
Read MoreBarclays ePDQ Payment Gateway
Hello all! Today we will be talking about Barclays online payment gateway valled ePDQ.
Read MoreBrainWHAT? programming language
I came across a programming language today that I have never heard of.
Read MoreTransparent swf in html
So you have now placed a swf file into your html page and you want to be able to see through it.
Read MoreConstant updates?
I just hate it how everything always wants to update… and then restart all the damn time!
Read MoreShare the mouse and keyboard!
A very interesting project I found this morning, take a look at this one!
Read MorePapervision error 1046
Error: “1046: Type was not found or was not a compile-time constant: InteractiveScene3DEvent.
Read Moreazupnpav_0.2.23
So what the heck is “azupnpav_0.2.23.zip”? It appears to be a plugin for Vuze(Azureus) the torrent client.
Read MoreHow to Save a Dreamweaver document as UTF8!
Today I tried to save arabic text inside a javascript file and on saving encountered a dialog box asking me to first convert the document to UTF8.
Read More16000 Limit!
Today I discovered that Flash truly has a limit! 16,000 frames: Exceeding this limit causes the movie playback to stop.
Read Morehtaccess ErrorDocument
Create a file called .htaccess in the root of your public_html/htdocs of your domain.
Read MoreHow to correctly form HTML
<!DOCTYPE html PUBLIC ?-//W3C//DTD XHTML 1.0 Strict//EN? ?http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd?> <html xmlns=?http://www.w3.org/1999/xhtml?> <head> <meta http-equiv=?
Read MoreTrying to get variables into flash from the browser!
Ever wondered how to get variables from an html page to a flash element?
Read MoreFlash Tweening
tween is an actionscript class and can be used after importing the core files.
Read MoreCube Desktop on Ubuntu
Alright, so I run Ubuntu 7.10 and use the Desktop Effects via compviz, anyhow, I could get the 2d workspace but really wanted the 3d cube, even if I set up 4 desktops, it would still only show 2 sides of the cube(aka not a cube).
Read MoreAnimate with Actionscript [part1]
// Created by Andrew Odendaal // // :: DESCRIPTION :: // Animate a ball moving to the top // of the screen/stage and back again // // :: HOW TO USE :: // create a circle shape, convert to a movieclip(mc) and // place the registration point at the bottom center.
Read MoreTo Install IIS 7.0 on Windows Vista – script
start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-Security;IIS-BasicAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI
Read MoreKill Adobe Updater
So adobe updater keeps doing updates eventhough you’ve said ‘NEVER DO IT AGAIN!
Read MoreApache Cannot be Run. Another web server is using the web port or port is blocked by firewall.
Tried to start EasyPHP: “Apache Cannot be Run. Another web server is using the web port or port is blocked by firewall.
Read MoreHow to load xml into flash using actionscript 2
Create an xml object: var myXmlObject = new XML(); Perform action when xml file has been loaded:
Read MoreTypeError: node is null message=node is null
The following error message occurs in Firefox 3 when using Firebug.
Read MoreCant start your browser?
Cant start your browser? Try checking if any torrent apps are running.
Read MoreHow to Temporarily Edit the Text of Any Website
Have you ever wanted to temporarily edit a webpage displayed in Chrome or another browser?
Read MorePHP __autoload function
When PHP encounters a class that hasn’t been defined yet, you can use __autoload to automatically add them instead of including masses of included at the top of your files.
Read MoreIE6 on Vista?
I find myself constantly fighting the microsoft battle of making things work in their browsers (thanks guys).
Read MoreGuillotine-Bug? Bug
Yes, it’s called a Guillotine-Bug and it’s yet another bug IE users get to look forward too 😛
Read MoreSending data from javascript to php
If you ever find yourself needing to do some ajax and in turn sending strings of characters via javascript then you should really try encodeURIComponent() to wrap your strings in.
Read MoreWhat is Eb in firebug?
Gmail produces the following error/warning in firebug. Eb is not defined
Read Morecross browser alpha css
.thediv { opacity:.80; filter:alpha(opacity=80); -moz-opacity:.80; }
Read MoreAdd TinyMCE code button
I had quite a few problems adding the htmlCode button to a fairly old copy of TinyMCE (I think around version 2.
Read MoreRuntime Error! (abnormal program termination) maya.exe
The Problem When starting Maya 8.5 an immediate error message and program termination.
Read MoreNeed more than hover?
I had a hover effect on an html input element but also needed to have an active state.
Read MoreGetting an internet connection under VirtualPC running Windows XP and Internet Explorer 7
Getting an internet connection under VirtualPC running Windows XP and Internet Explorer 7
Read MoreUppercase text in Actionscript
var lowerCase:String = "sample text"; var upperCase:String = lowerCase.toUpperCase();
Read MoreFirefox too slow?
Is your Firefox starting to get realllllllly slow? Every few months my Firefox starts dragging, so all I do is create a new profile and reimport all my bookmarks and reinstall needed addons.
Read MoreUppercase the first character of each word in a string using PHP
You can use “ucwords()” to uppercase the first character of each word in a string.
Read MoreActionscript 3 equivalent of PHP’s print_r
A brilliant version of print_r for actionscript: http://dev.base86.com/solo/47/actionscript_3_equivalent_of_phps_printr.html
Read MoreGlobal variables and functions in Actionscript 2
In order to reuse a variable from a different timeline within the same fla file you will need to register the inital variable or function as a _global.
Read MoreActionscript conflicting class name
I had a problem today where I got a flash source file from one of my developers’ and I couldnt compile it because it said that there was a conflicting class name, however, it turned out to just be a timestamp issue.
Read Moreexpecting T_PAAMAYIM_NEKUDOTAYIM
What the hey? What does this mean? You may one day end up seeing the following error message produced by PHP and wonder to yourself:
Read More