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

SEARCH KEYWORD -- Structure



  How can I teach a bright person, with no programming experience, how to program?

I usually prescribe the same sequence for anyone who wants to learn programming. It's very theoretical, but it lays a good foundation. It should take three or four months of fulltime study, but programming isn't something you learn overnight.If you can't get through this sequence, you're not going to be able to program, so you might as well give up now.Code, by Charles Petzold.The C Programming Language, K&RThe Structure and Interpretation of Computer Programs, Abelson and Sussman.My rule is...

   Steps,Programming,No experience,No knowledge     2011-11-07 08:27:48

  MySQL index optimization

Problem description: We need to access a very big table which has 40 million records. In the table, id is the primary key and program_id is indexed. When executing a select query: select * from program_access_log where program_id between 1 and 4000 The above query executes very slowly, we thought it was because there were too many records in the table. So we added id in the where condition to limit the search so that each time only half a million records would be read. select * fr...

   MySQL,Index search, Partition     2012-12-26 13:14:20

  What Makes A Great Programmer?

I remember it like it was yesterday. It was the year 2000, Dr. Pargas was standing at the front of our data structures class talking about some data structure-y topic while an SSH session was projected on the wall in front of us. Someone asked a question, and he said something along the lines of "Well, if you want to be a real computer scientist you need to start using vi". I think he was smiling as he said it, and in hindsight his statement wasn't even slightly true, but being young and ...

   Programmer,Great programmer,Character     2012-02-15 06:14:04

  Function Pointers in C are Underrated

The function pointer in C is, in my opinion, one of the most ignored gems of the language. It’s the kind of feature you rarely need, and then suddenly, one day, you find yourself in dire need of it, as evidenced by the real-life use-case below. If you don’t know what a function pointer is in the first place, here’s the meat of it: it gives you the ability to pass a function around like a normal variable. If you know Python / Ruby / Lisp, you might know it by the name...

   C,Pointer,Analysis     2012-03-24 05:23:09

  Common usage of ls command in Linux

In Linux, ls might be one of the most frequently used commands. It is used to list files in a specific directory. In most cases, we may just use ls -l to list the files under a directory. But have you explored other usages of this command. In this post, we will summarise some other common usages of ls command Assuming we have below directory structure in our system, let's see them using tree command. List details of the files If we want to list the details of the files in /home/alvin/test_...

   LINUX,SHELL,LS     2018-12-16 03:00:42

  How To Write A Good Programming Test

I’ve taken and marked a lot of programming tests in the past. I love doing them as it’s always good to see what challenges different programmers have come up with when designing them. Unfortunately, however, most of them aren’t very good. Below is a list of general ideas to help increase the quality of programmer tests. 1. Keep it relevant Too many of the tests have questions on content that simply isn’t relevant to the job. The whole idea behind a programming test i...

   Programming test,Interview,Questions,Pro     2011-08-26 02:46:44

  CSS Selector for Web Scraping

Creating a web scraper is no easy task. This is because it requires precision to identify the specific data points that we intend to collect for the end goal we are working towards.  Whether we are looking to create a marketing content database or analyze market trends, the last thing we need from our scraper is for it to return a lot of unnecessary data that will not help our cause. To avoid the inconvenience of going through huge amounts of data to get what we requested, it is crucial to ...

   CSS,WEB DESIGN,SELECTOR     2023-02-20 07:32:53

  The trap of the performance sweet spot

This post is about JavaScript performance but I would like to start it by telling a story that might seem unrelated to JS. Please bear with me if you don’t like C.A story of a C programmer writing JavaScriptMr. C. is a C programmer as you can probably guess from his name. Today he was asked by his boss to write a very simple function: given an array of numbered 2d points calculate vector sum of all even numbered points... He opens his favorite text editor and quickly types somet...

   C,JavaScript,Sweet spot,Memory,Low level,Trap     2011-11-06 14:45:01

  What can .htaccess file do?

A .htaccess file is a directory-level configuration file supported by several web servers, that allows for decentralized management of web server configuration. What can a .htaccess file do? We summarized some of them here.  Hope it may help you. 1. Timezone settingSometimes when you use date() or mktime() functions in PHP, , it may display some weird information because of the timezone difference. For example, one possible warning is :Warning: date(): It is not safe to rely on the syste...

   .htaccess,setting,tip     2012-06-15 06:39:39

  Run code with multiple files in the same main package in GoLang

To run a GoLang program, there needs to be a main() function defined. In some cases when developing some demo program which has multiple files and just wanna put them in the same main package and this folder is not in GOPATH, how to run the program? Let's say we have following folder structure where the main() function is defined in main.go. If you just run below command, it would fail to start to run the program and gives some error if some struct is defined in other files and being used. PS D...

   EXECUTABLE,GOLANG,MAIN PACKAGE,MULTIPLE FILE     2021-05-15 10:20:10