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

SEARCH KEYWORD -- Arrays.equal()



  JavaScript tips both novice and veteran developers can benefit from

In this post, we will share some less known but powerful JavaScript tips which can benefit both novice and veteran JavaScript developers. 1. Truncate array with array length We all know that object are passed by reference in JavaScript, but we may be bitten by this rule. Please check below example: var arr1 = arr2 = [1, 2, 3]; //Change arr1 arr1 = []; // arr2 will still be [1,2,3] arr1 and arr2 point to the same array [1,2,3] initially, later when arr1 repoints to [], the reference to arr2 is n...

   JavaScript,Array,push     2013-08-21 04:09:10

  The tic-tac-toe game with Python

In this tutorial, we will show how to build a tic-tac-toe game with Python. We will use functions,arrays,if statements,while statements, for loops and error handling etc. First, we need to create two functions, the first function will display the borad of the game: def print_board(): for i in range(0,3): for j in range(0,3): print map[2-i][j], if j != 2: print "|", print "" Here we used two for loops to loop through the map, this map is...

   Python,Tic-Tac-Toe     2013-07-30 02:49:09

  MaxHeapSize in JVM

MaxHeapSize is an option which is to set the JVM maximum heap size can be allocated. We can specify the MaxHeapSize as VM argument when we run the program by setting -XX:MaxHeapSize=, here can be 2M, 20M, 200M etc. We can also view the current MaxHeapSize set by setting different JVM options. To view the MaxHeapSize, we can use two JVM options : -XX:+PrintFlagsFinal and -XX:+PrintCommandLineFlags. Below is one example when running -XX:+PrintFlagsFinal: bool MaxFDLimit ...

   JVM,MaxHeapSize,Alignment     2014-06-17 07:01:50

  JavaScript's New Features: Exploring the Latest Additions to the Language

As the web continues to evolve, so too does the JavaScript ecosystem. With the release of ECMAScript 2023 (ES2023), JavaScript developers can now leverage a range of new features that promise to improve code quality, readability, and maintainability. In this blog post, we'll dive into some of ES2023's most exciting additions and provide practical examples of how they can be used in your projects. 1. Private Fields and Methods in Classes One of the most anticipated features in ES2023 is the intro...

   JAVASCRIPT,ES2023     2023-04-16 01:41:58

  Lisp: It's Not About Macros, It's About Read

Note: the examples here only work with outlet lisp. Refer to your version of lisp/scheme’s documentation for how read works (and possibly other forms) I know it’s an old post by now, but something about the article Why I love Common Lisp and hate Java, part II rubbed me the wrong way. The examples just aren’t that good. The usage of macros is plain baffling, when a function would have been fine. The author admits this, but still does it. There’s a follow-up post wh...

   Lisp,Macro,Read,Java     2012-02-19 06:12:19

  Tips and tricks about JavaScript from Google

JavaScript is now a very popular client side language. It's flexible, powerful but easy to make mistakes. So good programming style is better for you to write efficient and readable JavaScript codes. Here are some tips and tricks about JavaScript from Google. True and False Boolean Expressions The following are all false in boolean expressions: null undefined '' the empty string 0 the number But be careful, because these are all true: '0' the string [] the empty array {}&n...

   JavaScript, Google, Coding standard     2013-02-26 23:11:03

  Venn Diagram entirely in CSS

The HTML5 Microzone is presented by DZone and Microsoft to bring you the most interesting and relevant content on emerging web standards.  Experience all that the HTML5 Microzone has to offer on our homepage and check out the cutting edge web development tutorials on Script Junkie, Build My Pinned Site, and the HTML5 DevCenter. A friend of mine alerted me this weekend to just how much I have a weird fascination with Venn diagrams. I decided to roll with it. So yeah...

   CSS,Venn Diagram,Implementation     2012-02-06 08:10:41

  Go vs C benchmark. Could Go be faster than C?

During last semester I was attending Multiprocessor Architectures course, given at Facultad de Informática where I study my Computer Science degree. As part of the assignments due to pass the course, we had to do several programs written in C to benchmark matrix multiplication by testing different techniques and technologies. First of all we had to do a secuential program in three different versions: A normal one where the result matrix is ordered by rows and the loops range the matrix by ...

   Gp,C,Benchmark,Faster,Speed,Comparison     2012-02-08 10:09:07

  Avoiding and exploiting JavaScript's warts

One's sentiment toward JavaScript flips between elegance and disgust without transiting intermediate states. The key to seeing JavaScript as elegant is understanding its warts, and knowing how to avoid, work around or even exploit them. I adopted this avoid/fix/exploit approach after reading Doug Crockford's JavaScript: The Good Parts: Doug has a slightly different and more elaborate take on the bad parts and awful parts, so I'm sharing my perspective on the four issues that ha...

   JavaScript,warts,Exploit,with,variable,this     2012-02-15 05:51:21

  Select top 3 values from each group in a table with SQL

Yesterday, my friend Liu Bing asked me a question about how to select top 3 values for each person in a database table using SQL. I think this question is interesting and it deserves some thoughts. Here I record down how to solve this issue. Assume we have a table which has two columns, one column contains the names of some people and the other column contains some values related to each person. One person can have more than one value. Each value has a numeric type. The question is we want to se...

   SQL,Correlated query,top 3     2013-05-23 03:21:25