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

SEARCH KEYWORD -- Complexity



  When will resizing be triggered in Java HashMap?

HashMap is one of the most frequently used collection types in Java, it stores key-value pairs. Ideally it expects to use hash table which expects the data access time complexity to be O(1), however, due to hash conflicts, in reality, it uses linked list or red-black tree to store data which makes the worst case time complexity to be O(logn).  Although collections are using data structures like arrays and linked lists, unlike arrays, they will dynamically resize when there is not enough spa...

   JAVA,RESIZE,HASHMAP,THRESHOLD     2020-05-02 20:41:19

  We need a programming language for the rest of us

Recently I took on the enormous task of learning Objective-C from the bottom up and I was struck by something I couldn’t shake: this is too hard. An experienced developer might scoff at me for saying that, but it’s true. I’ll be honest about my education, Calculus II was the most math I ever took, I have an advanced degree from Berkeley in Journalism. I am a proficient HTML/CSS developer and can glue enough javascript together to solve almost any problem that has presen...

   Code.Programming,Expectation,Easy-to-use     2011-07-22 02:20:09

  Some laws of interactive design

The well known quote from Alan Cooper is   Conforming to the standard unless there is a better choice. There are some best practices in interaction design. How many do you know? 1. Fitts' Law The time from one start point to target point is determined by two parameters: The distance to the target and the size of the target. )D and W in above picture), the formula is : T=a+blog2(D/W+1). It was first proposed by Paul Fitts, it is mathematical model used to predict the time from any poin...

   interaction design, laws, Fitts' law     2012-11-16 11:25:24

  I’m too lazy to be a HTML developer

There’s no denying it. I’m just to damn lazy to be an HTML developer. This really sunk in when I looked at a tutorial for doing a jQuery Lightbox – for a client project. The tutorial was titled “Super Simple Lightbox with CSS and jQuery” but after reading it over I thought a better title would be “A really freaking hard tutorial on the inane intricacies of doing something that looks simple but in reality is a skein of HTML, Javascript and CSS that no...

   Web design,HTML,JavaScript,Complexity,Messy     2011-12-18 10:42:45

  Learning Python as your first programming language

Python is a widely used general-purpose, high-level programming language Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C. Python now becomes more and more popular and is now being used the first teaching language in some universities. Why would you like to learn Python as your first programming language? Below are the reasons. Python is a high-level language with dynami...

   Python,Advantage     2014-04-07 05:36:04

  bcrypt: Safeguarding Passwords with Strong Hashing and Adaptive Security

Introduction In today's digital world, passwords play a crucial role in protecting personal privacy and information security. Passwords are the most commonly used means of authentication because they are simple yet effective. Password security is the cornerstone of cybersecurity and plays a fundamental role in safeguarding the information security of individuals and organizations. However, with the increasing frequency and complexity of cyberattacks, traditional password hashing algorithms like ...

   BCRYPT,SECURITY     2023-11-15 08:14:35

  "Simplicity" is not a simple concept

I've come to avoid using the word "Simplicity" or its variants ("Simple," &c.) It means too many different things to different people.For example, my original land-line phone was simple:It's simple by eliminating extraneous use cases. It only handles one user scenario, the one that was the most common when it was invented. If we think of the number of affordances and the number of uses, this kind of simplicity lowers the number of affordances by lowering the number of uses. I call this kind ...

   Simplicity,Software,Usability,iPhone,Phone     2011-11-24 09:21:09

  All Programmers Are Self-Taught

When I was a teenager I played high caliber baseball. I’m competitive to a fault and when I decide I want to be good at something, results usually follow. Now I’m a third year undergrad studying computer science. There’s something critically different between programming and sports though: A pitching coach teaches you how to pitch, but a CS professor doesn’t teach you how to code. I was surprised that neither my TAs nor professors critiqued my code during my firs...

   Programming,Style,Habit,Self learning     2011-12-21 10:25:50

  Do we need other languages other than C and C++?

There were hundreds of or thousands of programming languages created since the invention of computer. All these languages have the same target which is to make the computer do what we want it do. So we may find that many languages have the same functions, i.e, one task can be completed by one language can be completed by another language as well. Now we may wonder why we need so many different languages. Can we just have C or C++ since they provide the best performance we need. The answer obviou...

   programming language,C,Erlang     2014-06-14 19:39:40

  One good way to use optional parameter in function

In GoLang, it doesn't support method overloading like in Java, hence sometimes it would be a headache to create functions to construct new structs with different parameters.  Normally, we would construct the new function as below when want to let others create a new struct instance with explicit function call. type Queue struct { Name string } func NewQueue(name string) *Queue { return &Queue{name} } But with the scope and complexity of the struct increases, there might be more prope...

   OPTION PATTERN,VARIADIC FUNCTION,OPTIONAL PARAMETER     2020-09-18 21:45:29