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

SEARCH KEYWORD -- Pattern



  Handling Plugins In PHP

A common problem that developers face when building applications is how to allow the application to be "plug-able" at runtime.  Meaning, to allow non-core code to modify the way an application is processed at runtime.  There are a lot of different ways that this can be done, and lots of examples of it in real life.  Over a year ago, I wrote a StackOverflow Answer on this topic.  However, I think it deserves another look.  So let's look at some patterns and common im...

   PHP,Plugin,Handling     2012-03-11 13:18:39

  4 asynchronous programming methods in JavaScript

You may know the execution environment of JavaScript is single threaded. The so called single thread means only one task can be running at any time, if there are many tasks, they need to be in a queue and wait for the previous task to be completed. The advantage of this mode is it's easy to implement and the execution environment is relative simple; the disadvantage is that if one task takes long time, the tasks following it must wait in the queue and this will delay other tasks consequently. Th...

   JAVASCRIPT,ASYNCHRONOUS PROGRAMMING, EVENT MODEL,PROMISE     2012-12-25 00:55:47

  Create tweet without explicitly showing the link URL

When crafting a tweet, there are instances where we may wish to include a link, but we prefer the preview to be shown without displaying the URL explicitly after the tweet is published. How can we accomplish this? This article outlines the steps to achieve it. To begin, copy and paste the link you want to share into the tweet box. After clicking Post, the tweet will be published without displaying the link; instead, it will showcase the page preview, and clicking on the preview image will open ...

   TWEET,LINK URL,X,PREVIEW     2024-01-23 08:06:46

  Front-end Style Guides

We all know that feeling: some time after we launch a site, new designers and developers come in and make adjustments. They add styles that don’t fit with the content, use typefaces that make us cringe, or chuck in bloated code. But if we didn’t leave behind any documentation, we can’t really blame them for messing up our hard work. To counter this problem, graphic designers are often commissioned to produce style guides as part of a rebranding project. A style guide ...

   Design,Guideline,CSS,Style,System     2011-12-07 08:54:59

  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 lan...

   Pattern,Code,NULL,Function,JavaScript,Assign default value     2011-11-23 08:03:55

  Error handling in GoLang

Error handling is one of the must talked topics for any programming language. The program would be more reliable and stable if errors are handled properly and timely. Each programming language has its own way to handle error, this applies to GoLang as well. This post will discuss more about GoLang's error handling mechanism. Error handling Before talking more about GoLang's error handling, we can see how different programming languages are handling errors. C's error check The most direct way of ...

   GOLANG,ERROR HANDLING,FLUENT INTERFACE     2021-03-06 21:36:08

  Consistency between Redis Cache and SQL Database

Nowadays, Redis has become one of the most popular cache solution in the Internet industry. Although relational database systems (SQL) bring many awesome properties such as ACID, the performance of the database would degrade under high load in order to maintain these properties. In order to fix this problem, many companies & websites have decided to add a cache layer between the application layer (i.e., the backend code which handles the business logic) and the storage layer (i.e., the SQL d...

   REDIS,CACHE,DATABASE     2019-07-07 08:14:16

  Prototypes and Object Orientation

David Chisnall takes a look at the two dominant paradigms in object-oriented languages (classes and prototypes) and discusses the strengths and weaknesses of each.Two terms are quite often confused when describing programming languages:class-based and object-oriented:Simula was the first class-based language. It provided classes (actually implemented using closures) as a means of encapsulating abstract data types.Smalltalk was the first object-oriented language. It provided a...

   Prototype,OOP,Differential,Comparison,Mo     2011-09-02 11:51:26

  What is Hystrix and How does Hystrix work

Background In distributed systems, there is one effect where the unavailability of one service or some services will lead to the service unavailability of the whole system, this is called service avalanche effect. A common way to prevent service avalanche is do manual service fallback, in fact Hystrix also provides another option beside this. Definition of Service Avalanche Effect Service avalanche effect is a kind of effect where the service provider fails to provide service which causes t...

   AVALANCHE EFFECT,HYSTRIX,DISTRIBUTED SYSTEM     2019-02-04 06:00:38

  Writing API clients in Perl and Python

I recently released a couple of API clients for the Ge.tt file sharing service, one in Perl and one in Python. (I am just a fan of the service, not an employee or contractor.) I would judge myself an "intermediate" pythonista mostly due to inexperience. It's a culture shock coming from a background of CPAN. The old joke is that Perl is just a life support system for CPAN and that is arguably true, but I am here to tell you: you may not appreciate how good Perl hackers have it with respe...

   API,Perl,Python,API Writing,Pattern     2011-12-23 08:02:38