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

SEARCH KEYWORD -- property



  Let's talk about JavaScript deep clone

In JavaScript, deep clone means creating a brand new object that includes all nested objects, with all properties being completely independent copies. This is different from shallow copying, which only copies the first-level properties, with nested objects being referenced rather than copied. There are multiple ways to perform deep copying in JavaScript, but the best one to use depends on the specific use case. Can use JSON.parse & JSON.stringify? ❌ JSON.parse(JSON.stringify(obj)) is a dep...

   JAVASCRIPT,DEEP CLONE     2023-02-25 08:57:11

  Five Copyright Pitfalls Every Web Designer Should Avoid

If you work in the world of web design, it is crucial you do not infringe upon copyright laws. If you do, you could end up paying some hefty fines or even being prosecuted. So, check out these five common copyright pitfalls you need to avoid. Not Copyrighting Your Own Work While most copyright infringement pitfalls web designers face are to do with avoiding using copyrighted materials, you also need to know how to protect your own work to ensure no one else steals it. For things like patents, t...

   COPYRIGHT,WEB DESIGN,PATENT     2021-02-18 02:41:10

  Show drop down list or menu above of a flash in webpage

How to make a drop down menu show above of a  flash in webpage?Normally when we embed a flash or swf file into our webpage, it is not one component of our webpage.So sometimes the flash will always show above of the webpage, it will not interact with our HTML page.To solve this problem,we need to use wmode property of object tag.wmode has three properties: window,opaque and transparent.window : the flash will show in its own rectangular window,which will not interact with    ...

   HTML,Flash,Block,Drop down menu,Solution     2012-03-12 17:13:57

  Remove duplicated elements in JavaScript array

During interviews, one frequent question asked would be something like how to remove duplicated elements in a JavaScript array and how many different ways you can think of. The interviewee would also be asked to write the code down. In real applications, normally front end would not need to handle this case since normally it would be done by backend, but still it's necessary for front end developers to know different ways of doing this. This post will share some of the common ways to remove dupl...

   JAVASCRIPT,ARRAY,DUPLICATED ELEMENT     2018-09-21 22:32:10

  Getting started with WTL on Visual Studio 2010

Now that you have downloaded the latest WTL release (v8.1 at the time of this writing), you will find out that it doesn’t have any project wizards for Visual Studio 2010. That’s a relatively easily fix. Just go ahead and download the latest build from the repository at AppWiz.tar.gz-view=tar. Extract the .tar file and you will find the JavaScript install scripts for VS 2010: I recommend you to extract the files to the same location were you installed the WTL files. In my ca...

   C++,Windows,WTL,VS2010,Configure     2012-02-25 09:32:31

  Name resolution order in JavaScript

To understand what value a variable has in JavaScript, we need to understand some concepts such as scope and name resolution order. JavaScript has two scopes; one is program level and the other one is function level. Unlike in C,C++ or Java, JavaScript has no block level scope. So a variable defined in a if block will still be available outside. For example, the below example: var foo = 1; function bar() { if (true) { var foo = 10; } alert(foo); } bar(); The alert will display 10 since the ...

   JavaScript,Scope,Name resolution     2013-07-10 01:29:28

  A String is not an Error

I decided to write a little article to discourage an unfortunately common pattern in Node.JS modules (and browser JavaScript, to a lesser extent) that can boil down to these two examples: // A:function myFunction () {  if (somethingWrong) {    throw 'This is my error'  }  return allGood;} and // B: async Node.JS-style callback with signature `fn(err, …)`function myFunction (callback) {  doSomethingAsync(function () {    // …    if (...

   JavaScript,Node.js,String,Error object     2011-12-23 08:00:32

  The Book That Every Programmer Should Read

No, it’s not Knuth’s “The Art of Programming”. I’m talking about quite an easy-to-read (compared to TAoP) book, which, in fact, does not require any engineering or mathematical background from the reader.I am talking about C. Petzold’s “CODE”. It is a truly remarkable book about how computers work. Let me explain why I think this book is so awesome.The book starts from the very beginning, from explaining what code is, bringi...

   Programmer,Book,Must read,CODE,C. Petzold     2011-10-31 10:43:58

  Resolve stylesheet_link_tag fails to work in Ruby on Rails

When developing Ruby On Rails application, developers sometimes will see an unexpected behavior where the application cannot be loaded due to "TypeError: Object doesn't support this property or method" when invoking stylesheet_link_tag. The symptom looks like  And the Rails log will show something similar to below The error occurs because there is some problem finding the correct assets which are located in app/assets. To resolve the issue, you can following below steps. Add gem 'coffee-...

   RUBY ON RAILS,STYLESHEET_LINK_TAG,JAVASCRIPT_INCLUDE_TAG,TYPEERROR     2016-10-14 03:59:11

  Ensure triggering transitionend event in JavaScript

CSS3 Transition has been widely used in modern web app development to offer users animations. Traditionally animations of element in HTML are controlled by JavaScript. If fancy animation is desired, then third party plugins can be installed in browsers such as Flash, Silverlight, Java Applet etc. With CSS3, animations can be easily achieved like a charm. Transition is one of the many features provided by CSS3. It can be used to transit one element from one state to another state smoothly within ...

   CSS3 TRANSITION, TRANSITIONEND, FORCE FIRE TRANSITIONEND     2015-05-09 08:56:51