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

SEARCH KEYWORD -- Program



  Mutli-inheritance bug between python 2.7 and 3.7

When we have run a py3.7 code under py2.x or a py2.x code under 3.x ,if a class do mutli-inheritance from 2 parent and the 2 parents also got inheritance from same parent, the different way to handle inheritance chain between python 2 and 3 will cause some running time bug: Assume we got this sample program inheritTest.py : # Purpose: Test mutli-inheritance different between python2 and 3 # Author: Yuancheng Liu # Created: 2019/05/16 class A: def getVal(self): print("cal...

   PYTHON,PYTHON 3,INHERITANCE     2019-05-16 08:33:52

  Polymorphism in OOP programming

Polymorphism is the capability of an action or method to do different things based on the object that it is acting upon. This is the third basic principle of object oriented programming. Overloading, overriding and dynamic method binding are three types of polymorphism. Overloaded methods are methods with the same name signature but either a different number of parameters or different types in the parameter list. For example 'spinning' a num...

   Java,OOP,Polymorphism,Overloading,Overri     2014-10-23 08:11:50

  Difference between ConcurrentHashMap and Hashtable

Both ConcurrentHashMap and Hashtable are Collection classes for storing key value pairs and they both provide fast element search with a supplied key. They have much in common. However, we will not discuss the similarities between them here, instead we will focus on the differences between them. ConcurrentHashMap and Hashtable are both thread safe. But the mechanism for thread safe is different between them. Hashtable is synchronized, it utilizes the synchronization mechanism; while ConcurrentHa...

   ConcurrentHashMap,Hashtable     2013-11-18 08:06:54

  Something you should know about programming even if you are not a programmer

Out daily life are deeply affected by software and web. More and more people are realizing the importance of software, For example, you want to travel to Brazil for the world cup, right? You should first book the ticket online, when you book the ticket, you should pay for the ticket with your credit card, after successfully booking your ticket, you will get a e-ticket in your mailbox. When you arrive at the airport, your identity information will checked against the immigration database system, ...

   Programming,Programmer     2014-06-11 10:06:40

  What are your list of must know programming proverbs?

It is in fact a good list of proverbs and here are some of the frequently seen programming proverbs. Keep It Simple Stupid Don’t Repeat Yourself A clever person solves a problem. A wise person avoids it – Einstein Silence is construed as approval  ( Picked from Kevin blog ) There is no smoke without fire Think first, Program later Never assume the computer assumes anything Don't trust anything from the user input Do you have any favorite of the programming proverbs? ...

   PROGRAMMING,TIPS     2011-07-01 07:00:56

  Hacking Vs. Programming

What is the difference between Hacking and programming? One opinion I have heard expressed is that a hacker can put a lot of code together in a hurry but if a change is needed the code has to be completely rewritten. A programmer may take a little longer but if changes are needed they are more quickly and easily installed without the need for a complete rewrite. One source I heard attributed an observation like this to Maggie Johnson of Google. It rings true to me though. Hacking is usual...

   Hacking,Programming,Coding style     2012-04-23 06:09:24

  PHP to output string to client terminal

It is a common task to echo messages to the user using PHP. There are lots of ways where the message can be echoed to the client terminal(browser or console window) through PHP. These includes some well know debug methods like var_dump() and var_export() etc. In this post, we will show you some other methods shared by Laruence, one of the core members of PHP development team. 1. echo First comes with the most common one : echo. $str = "Hello PHP\n"; echo $str; 2. print Then comes another c...

   TRICKS,DEBUG,OUTPUT,PHP     2015-10-01 03:16:56

  3 meanings of Stack

We may frequently see stack when we read programming books. But many times we may be confused about the different meanings of it. This term actually has three common meanings. Here we explain the three different meanings of Stack in programming. 1. Data structure The first meaning of Stack defines a method for storing data. Its feature is LIFO9Last In First Out). In this data structure, data are accumulated level by level. The data last put in is added at the top of the stack. When using the dat...

   Stack,Memory,Data structure     2014-02-24 04:56:46

  Some lovely software design quotes

  Every time when I read technical books, I like reading the quote of a famous person at the start of a chapter(if any), usually they are very interesting. Here is a collection of famous quotes. Life’s too short to build something nobody wants – Ash Maurya, Running Lean author Give someone a program, you frustrate them for a day; teach them how to program, you frustrate them for a lifetime. – David Leinweber There are two ways of constructing a software design: One way is...

   Quote,Software design     2012-10-13 09:13:34

  combining dwarf failed: unknown load command 0x80000034 solution in GoLang

In case there is below error encountered while running some go program: combining dwarf failed: unknown load command 0x80000034 This may be due to that you are running go 1.16 on a Mac M! machine. If you go to check go version, it may tell you that you are running an arm version of go. go version go1.16.10 darwin/arm64 In such cases, you can try below methods to workaround the issue. Try to upgrade the go version to 1.17 and run the code again. If this is not an option for you because you have t...

   GO 1.16,0X80000034     2021-11-25 07:11:28