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

SEARCH KEYWORD -- Structure



  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

  Understanding Slice Behavior in Go

In Go, understanding how slices behave when passed to functions is crucial for writing efficient and bug-free code. This behavior is often a source of confusion for many developers, especially those new to the language. In this article, we'll explore the difference between passing slices by value and by reference, and how it impacts the modification of slices within functions. Introduction In Go, slices are a fundamental data structure used to work with sequences of elements. They are essentiall...

   PASS BY REFERENCE,ARRAY,SLICE,PASS BY VALUE     2024-03-10 06:43:51

  Using Angular 2 with Asp.Net MVC/Asp.Net Core

Asp.net development professionals bring this post to explain the use of Angular 2 with Asp.net MVC/ Core. You will read the overview of Angular 2 and Asp.net Core at first in this post. Read the article to find how experts use Angular 2 with MVC / Core. Angular 2 Overview Angular 2 is the upcoming version of MV framework used for creating high level applications in browser. It contains everything needed to create a complex mobile or web apps from a variety of templates. Angular team recently re...

   ASP.NET DEVELOPMENT,ANGULAR 2, ASP.NET MVC     2016-10-29 05:15:06

  SkipList in Go

Algorithmic thinking is the must-have in the coding world, so I have been keeping the routine of algorithm practice every week, consolidating my knowledge of data structures on one hand, and improving my coding skills as well. A difficult one happened to be stuck in my mind- Implement SkipList with Go, which took me quite a weekend. Below is the front-line report of how I finally got the hang of it. First, from its concept. Wiki has explained it well. a skip list is a probab...

   GOLANG,SKIPLIST     2022-04-05 02:21:59

  Go channel explained

In Go, a channel is a type of concurrent data structure that allows two or more goroutines (Go's term for lightweight threads) to communicate with each other. Channels provide a way for goroutines to send and receive values, and they are an essential part of Go's concurrency model. Here's a simple example that demonstrates how to use channels in Go: package main import ( "fmt" ) func main() { // Create a new channel with the `make` function ch := make(chan int) // Start a new ...

   GOLANG,CHANNEL     2022-12-10 22:24:26

  How big are PHP arrays (and values) really? (Hint: BIG!)

Upfront I want to thank Johannes and Tyrael for their help in finding some of the more hidden memory usage. In this post I want to investigate the memory usage of PHP arrays (and values in general) using the following script as an example, which creates 100000 unique integer array elements and measures the resulting memory usage: <?php $startMemory = memory_get_usage(); $array = range(1, 100000); echo memory_get_usage() - $startMemory, ' bytes'; How much would you expect it to ...

   PHP,Array,Memory occupation,Garbage collection     2011-12-16 10:06:04

  Have you used these JavaScript libraries before?

Are you a vanilla JavaScript developer or a JavaScript library lover?  If you are a vanilla JavaScript developer, please feel free to step away silently because you may not get what you want, but if you are a library or framework lover, please bookmark this page as what we list below are what you may use in the future. There are tons of JavaScript libraries created to ease the headache of developers who have to deal with different browsers on different devices. You may use some of them befo...

   JavaScript,Framework,Library     2014-09-27 22:06:55

  Browse OpenJDK Java source code in Eclipse

Java 8 was recently released, many developers are now trying to extract the source code of Java 8 to find out how the new added features such as Lambda expressions, default method in interfaces, new Time API are implemented. How do you manage to download and browse the source code? Today we are going to show how to extract OpenJDK Java source code to Eclipse. Since OpenJDK is adopting Mercurial as its distributed version control system, you need to install Mercurial on your computer first before...

   OpenJDK,Java 8,Source code,Eclipse     2014-06-16 00:53:34

  The magic of go:linkname

When writing Go program, there is frequent need on using time.Sleep() function to pause the logic for some time. And if jumping to the definition of this function, can see below definition: // Sleep pauses the current goroutine for at least the duration d. // A negative or zero duration causes Sleep to return immediately. func Sleep(d Duration) I's strange that there is no function body defined here. What happened? The actual definition of the function body is residing at runtime/time.go&nb...

   TRICKS,GO:LINKNAME,GOLANG     2022-04-10 08:39:00

  Data type in MySQL

For both small free database space and large e-commerce websites, reasonable database table structure design is essential. To achieve this, it requires us to have a full understanding of commonly used data types in database system. Below we share some knowledge about data types in MySQL.1. Numeric typesThe numeric types can be classified as : integer, float and decimal type.The so-called "decimal" refers DECIMAL and NUMERIC, they are of the same type. Strictly speaking it is not a numeric type, ...

   MySQL, Data type,VARCHAR     2013-01-01 10:56:06