Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  How to Understand and Use nil in Golang Correctly?

In Golang, nil is a predefined identifier that carries different meanings in various contexts, but typically represents "none", "empty" or "zero value". It can be assigned to variables of pointer, slice, map, channel, function, and interface types. Understanding the significance of nil is crucial for writing robust Go programs, as mishandling nil can lead to unexpected issues.nil in PointersIn Go, pointers are a fundamental type that stores the memory address of a variable. When a pointer is declared but not initialized, its value is nil. The following example code illustrates this:package mai...

1,093 0       FUNCTION MAP GOLANG SLICE NIL CHANNEL


  Handy PHP functions should be in your toolkit

When developing projects, there are always some common work should be accomplished, for example, encrption/decryption, get IP. As a PHP developer, you should have a list of the handy functions in your toolkit so that you can pick up in every project you work on. Here is a summary of some handy PHP functions.1. PHP encryption/decryptionEncryption/decryption can be used when storing user confidential information such as passwords. Below function uses base64 and MD5 to accomplish encryption/decryption.function encryptDecrypt($key, $string, $decrypt){ if($decrypt){ $decrypted = rtrim(m...

4,925 0       PHP SQL INJECTION FUNCTION REAL IP


  10 less known but useful PHP functions

PHP has abundant built in functions. As PHP developers, we may have used many of them. But there are still some useful functions we may not be so familiar with. In this post, we will introduce some of them.levenshtein()Have you ever wondered how to check differences between two works? This function just does what you want. It can tell you how much the difference is between two words.<?php$str1 = "carrot";$str2 = "carrrott";echo levenshtein($str1, $str2); //Outputs 2?>get_defined_vars()This is a very useful function when you wants to debug your codes when there are some issues. It will re...

6,527 0       PHP FUNCTION


  Basic Patterns for Everyday Programming

For most of you the patterns mentioned below should be nothing new. These are very basic stuff we slap into our code everyday and at times feels they are actually code smells than smart patterns. However, I've been doing some code reviewing lately and came across many code that lacks even these basic traits. So I thought of writing them down as a help for novice developers who would want to get a better grasp at these.These patterns are commonly applicable in most general purpose programming languages, with slight syntactical changes. I use Ruby and JavaScript for the examples in this post.Ver...

4,521 0       JAVASCRIPT CODE PATTERN FUNCTION NULL ASSIGN DEFAULT VALUE


  C++ Without Fear: Functions

A function is a group of related statements that accomplish a specific task. Understanding functions is a crucial step to programming in C++, as Brian Overland explains in this chapter from his book.The most fundamental building block in the programming toolkit is the function—often known as procedure or subroutinein other languages. A function is a group of related statements that accomplish a specific task. Once you define a function, you can execute it whenever you need to do so.Understanding functions is a crucial step to programming in C++: Without functions, it woul...

1,952 0       C++ FUNCTION FEATURE ELABORATION FEAR


  JavaScript: Passing by Value or by Reference

In JavaScript, we have functions and wehave arguments that we pass into those functions. But how JavaScript handleswhat you’re passing in is not always clear. When you start getting intoobject-oriented development, you may find yourself perplexed over why you haveaccess to values sometimes but not other times.When passing in a primitive type variablelike a string or a number, the value is passed in by value. This means that anychanges to that variable while in the function are completely separate fromanything that happens outside the function. Let’s take a look at the followingex...

4,105 1       JAVASCRIPT FUNCTION PASS BY REFERENCE PA