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

SEARCH KEYWORD -- programming



  A boolean value interview question

Someone asked a question on StackOverflow, he was asked an interview question. The question is : Given 3 boolean variables a, b, c, return true if at least 2 out of the 3 are true. He gave the solution as follows :boolean atLeastTwo(boolean a, boolean b, boolean c) {    if ((a && b) || (b && c) || (a && c)) {        return true;    } else {        ret...

   bool,return,expression,conditional     2012-04-30 08:49:32

  What Sort of Projects Can You Work on Using Web Scraping?

Image Source: Unsplash Web scraping is a technique used to extract large amounts of data from websites and save onto your computer in a database or time table format. There are many reasons businesses would use this information for lead generation, SEO, or to better understand their customers.  However, you can do a lot of fun projects in your free time that doesn’t have to be associated with work or a company. Before you start using your programming skills to find and extract inform...

   WEB SCRAPING     2020-09-10 09:16:44

  The several flavors of random in Java

Random number generation is one of most basic features in any programming language. The basic utilization is always the same: generate a random number between 0 and 1. With such a simple resource at hand we sometimes overlook some interesting features. What do we learn from the books? The most obvious and maybe intuitive way to generate random numbers in Java is simply calling: java.lang.Math.random() Random generation is in the Math utility class with abs, pow, floor...

   Java,Random,Thread,Math,Type     2012-03-22 14:17:44

  Understanding JavaScript closure and where it can be used

Closure The official definition of closure is: an expression (usually a function) that has many variables and is bound to an environment that includes those variables. In JavaScript, closure refers to the ability of a function to access the lexical scope in which it was defined, even after the function has been executed and left that scope. This ability is due to the fact that when a function is created, it generates a closure that includes a reference to the definition environment of the curr...

   CLOSURE,JAVASCRIPT,USAGE     2023-03-05 02:17:08

  JSON unmarshal in GoLang

In almost all mainstream programming languages, there is either built-in or third-party library to support parse JSON data because it is so popular for organizing and transferring data among different services. In GoLang, the built in json package also provides functions for marshalling and unmarshalling JSON data. Marshalling GoLang struct to a JSON string is relatively simple, just need to call json.Marshal(), it's a bit complicated to unmarshal an arbitrary JSON string into a GoLang struct ob...

   GOLANG,JSON,UNMARSHAL,EMPTY INTERFACE     2019-11-09 21:57:30

  5 comment styles should be avoided

Have you ever found some superfluous comments while checking others codes? The purpose of using comments in the code is to enhance the readability of the code, so that non-original code developers can understand them better and easier.I summarized 5 kinds of comment styles and the developers who write them. Hope you don't do the same thing as below in your application development process. 1. Arrogant comments public class Program { static void Main(string[] args) { string message...

   Code comment, comment style     2012-11-21 10:57:34

  An experience of fixing a memory-corruption bug

During the last 4 months, I was disturbed by a memory-corruption bug, and this bug will cause program crash. Until last Monday, I found the root cause and fixed it. This debug process is a difficult but memorable experience, so I will share it in this article.   My program works as a SMS Hub. When it receives a SMS, it will allocate a structure in heap memory like this: typedef struct { ...... int *a[8]; ...... } info; After processing the SMS, the program will free the m...

   c, debug, unix, solaris, multi-thread     2014-05-04 03:52:43

  Do You Morph Into A Different Programmer?

Every experience you have as a software developer should change you in some way. And I don’t just mean growing older by virtue of time passing. Everything you do should evolve your understanding of your craft (and/or related skills) or your understanding of yourself – which ultimately achieves the same goal. I am not just talking about major milestones in your software development career like switching jobs, becoming a leader/manager or starting you own company. Every job, ev...

   Programmer,Steps,Process,Developer     2011-08-18 08:59:01

  new() and make() in GoLang

GoLang is a modern, statically typed, compiled programming language designed for building scalable, concurrent, and efficient software. It provides various built-in functions and features that help developers write concise and efficient code. Among them are the new() and make() functions, which may appear similar at first glance but serve different purposes in GoLang and are crucial for memory allocation and data initialization. In this blog article, we will explore the differences between the n...

   NEW,MAKE,GOLANG     2023-11-18 13:43:25

  Why developer-friendliness is central to API design

Today, APIs play a bigger role in software development than ever before. The evolution of computing has been dominated by ever-increasing levels of abstraction; the use of higher-level languages, of course, but also the development of platforms, libraries, and frameworks. Professor Douglass C. Smith claims the progression of this second category far outpaced the development of programming languages.  Developers are also noticing that difficulty has shifted from designing algorithms a...

   API,User friendly,Significance, Improve quality     2011-12-21 02:29:54