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

SEARCH KEYWORD -- Error



  10 Points about Java heap memory

When I started java programming I didn't know what is java heap or what is heap space in Java, I was even not aware of where does object in Java gets created, it’s when I started doing professional programming I came across error java.lang.outofmemoryerror then I realized What is Heap in Java or Java Heap Space. Its happens with most of programmer because learning language is easy but learning basics is difficult since there is no formal process which can teach you every basics of pro...

   Java,Heap memory,Tips     2012-02-20 05:38:06

  malloc/free and new/delete in C++

malloc and free are C++/C language standard library functions, while new/delete are operator of C++. They can be used to allocate dynamic memory and free memory in C++ programs malloc/free can not meet the requirements of dynamic objects creation. Object needs to call the constructor to initialize the object when creating, the object needs to call the destructor before it is destroyed  Since malloc() and free() are library functions rather than operators, the compiler has no control permiss...

   C++,memory,malloc,free,new,delete     2012-06-20 06:52:09

  A Better Way to Learn How to Program

Learning how to program can be a nightmare. An aspiring coder has to jump through many unpleasant hoops and mysterious error messages just to get "Hello, World!" printed on the screen. Then, she's left wondering, "OK, now what? How do I actually build something?"As game developers seeing someone struggle through this, we should be screaming, “NOOOOO!” The whole thing reeks of bad game design: a lot of work with no reward, unclear failure cases, advanced features pushed on new players...

   Programming pattern,Game design,Derivati     2011-09-19 13:51:17

  How to check why Vim is slow

On *nix, some processes may not be able to start up, software runs very slowly suddenly and software's "Segment Fault" are some issues faced by many *nix users. Here we show you how to use truss to trace why Vim becomes slow suddenly. Operating system : FreeBSD-5.2.1-releas vim version is 6.2.154, after typing vim on command line, sometimes we need to wait for a few minutes to get into the edit interface and there is no error output. After carefully checking .vimrc and all vim settings, there ar...

   vim, truss, linux     2012-11-26 11:54:35

  The basics of Client/Server socket programming

  While Client/Server communication model is ubiquitous nowadays, most of them involve socket programming knowledge. In this post, I will introduce some rudimentary aspects of it: (1) Short/Long-lived TCP connection.Short-lived TCP connection refers to following pattern: Client creates a connection to server; send message, then close the connection. If Client wants to transmit information again, repeat the above steps. Because establishing and destroying TCP s...

       2017-09-26 19:43:10

  Resolve high CPU usage issue caused by file_get_contents in PHP

Sometimes a Linux server which runs Nginx + PHP-CGI(php-fpm) web service may experience sudden system load increase and the CPU usage is around 100% for many php-cgi processes when checking with top command. If this happens, file_get_contents may be the cause if it's used in the PHP script. In lots of web applications, normally there are lots of API requests based on HTTP. Many PHP developers like to use file_get_contents("http://example.com/") to get the API response because it's simple to...

   PHP,FILE_GET_CONTENTS,PHP-CGI     2018-11-09 21:35:00

  API Design is UI for Developers

I’ve been thinking a lot about APIs and their design recently.I stumbled on this fantastic quote from Greg Parker: A programming language is a user interface for developers. Language authors should learn from HCI principles.22/02/2012 19:10 via webReplyRetweetFavorite@gparkerGreg ParkerWhen I first started learning C++ (back in the bad old days) I was convinced that any 1st year student could design a better programming language. One which behaved in a sane fashion without a lot of le...

   API design,UI,developers,PHP     2012-03-11 13:21:43

  Understanding PHP's internal function definitions

Welcome to the second part of the “PHP’s Source Code For PHP Developers” series. In the previous part ircmaxell explained where you can find the PHP source code and how it is basically structured and also gave a small introduction to C (as that’s the language PHP is written in). If you missed that post, you probably should read it before starting with this one. What we’ll cover in this article is locating the definitions of internal functions in t...

   PHP,internal function,definition,rationale     2012-03-16 10:46:26

  socket_create() from command prompt with WAMP

Problem:I’m working on a wamp system, and have started playing around with sockets. I enabled sockets via the wamp interface:wamp : PHP settings : PHP extensions : php_socketsand could run my php file via my browser.When trying to run the same file via the command prompt (start : run : cmd), I got the following error:Fatal error: Call to undefined function socket_create() in … on line …Solution:The command prompt uses a different php.ini file to the apache server.The Apac...

   PHP,WAMP,Windows,Command line,Socket     2011-05-30 10:59:14

  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