ALL
HeartBleed: Should C be blamed for the HeartBleed bug?
There is a discussion about the security of applications written in C on Hacker News recently after the report of HeartBleed bug in OpenSSL. In this discussion, some people are saying that the applications written in C are unsafe. It seems all or most of the faults should be laid on C. I think this is biased. The language itself should not be blamed.Safety is a relative term for programming languages. No language is absolutely safe. We claim some languages like Java and C# are safer than C/C++ because they have memory protection mechanism built in, we cannot access arbitrary memory locations i...
14,351 5 C ANALYSIS CODE REVIEW HEARTBLEED
HeartBleed: Inside the heart, what happens to a normal WEB user?
To be brief, our email, IM, facebook etc. are at the risk, so try to minimize the access in these few days. Especially we should try to avoid log into our internet-banking, because we may expose our user id and password. Also later when the service providers fix the bug, we would better to change a new password for all the web accounts that are important to us.Here comes the technical explanation.You might notice before that a lot of websites use URL starting with "https". For example, https://www.google.com.sg. HTTPS literally means secure HTTP, as the "s" stands for secure. Both HTTP and HTT...
4,679 0 ANALYSIS HEARTBLEED
Efficiency of code execution
If you want to optimize your program codes, you need to find their Hotspot, i.e, the codes which are executed most frequently. If you can optimize this portion of codes a bit, you may gain much improvement of your code efficiency. Here I give you three examples about efficiency of code execution.1. PHP's Getter and Setter (From Reddit)This example a quite simple, you can skip it if you want.Consider the code below, we can find it's slower when we use Getter/Setter method to read a member variable rather than read/write member variables directly.<?php //dog_naive.php &...
4,486 0 CODE ANALYSIS TRICK EFFICIENCY
Social network website homepage design analysis
This article is to discuss outstanding design principles to enhance the social networking site registration conversion rate by comparative analysis of the social web site home page .In general, the user registration conversion process generally consists of the following components: Attractive home page contents. Simple and fast registration process. The effectiveness of friends search and invite mechanisms. User guide which attracts user attention .This article will explore the first component : Attractive home p...
6,048 0 ANALYSIS SOCIAL NETWROK HOMEPAGE DESIGN
PHP: a fractal of bad design
PrefaceI’m cranky. I complain about a lot of things. There’s a lot in the world of technology I don’t like, and that’s really to be expected—programming is a hilariously young discipline, and none of us have the slightest clue what we’re doing. Combine with Sturgeon’s Law, and I have a lifetime’s worth of stuff to gripe about.This is not the same. PHP is not merely awkward to use, or ill-suited for what I want, or suboptimal, or against my religion. I can tell you all manner of good things about languages I avoid, and all manner of b...
Why Dynamic Programming Languages Are Slow
In a statically typed language, the compiler knows the data-type of a variable and how to represent that.In a dynamically-typed language, it has to keep flag describing the actual type of the value of the variable, and the program has to perform a data-dependent branch on that value each time it manipulates a variable. It also has to look up all methods and operators on it.The knock-on effect of this on branching and data locality is lethal to general purpose runtime performance.That’s why the dynamic language JIT benchmarks emphasise near-C speed on small inner loops but steer cl...
2,600 0 DYNAMIC LANGUAGE SLOW ANALYSIS
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 ‘lambda’, or if you come from a JavaScript background, you might’ve used it under the na...
What else is new in C# 5?
The big new feature in C# 5 is asynchronous programming support, which I wrote about last week. However, the C# folks have also slipped in a couple of smaller features and I thought I’d round things out by mentioning those.Method caller informationThere’s a complete style guide to be written on Writing Enterprisey Code, but one of my favourite “enterprisey†tells, after the use of Visual Basic, is obsessively logging every function you pass through:Function AddTwoNumbers(a As Integer, b As Integer) As Integer Logger.Trace("ArithmeticHelpers", "AddTwoNumbers", "Enter...
3,388 0 NEW FEATURE ANALYSIS C# 5