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

SEARCH KEYWORD -- program



  A return to good code

Stop doing this:public boolean foo() { if (true) {   return true;   }  else {   return false;   }}It always amazes me when I dig into an open source project, and I see code written by supposed experts, and reviewed by seasoned professionals, and nobody slaps the wrists of the developer who shoves return statements right in the middle of a method.Tell me, how hard is it to do this:public boolean foo() {   boolean flag = true;  ...

   Java,Code,Method,Return,Condition     2011-03-23 01:24:47

  jsonSerialize() in extended class

Since PHP 5.4.0, there is a convenient interface JsonSerializable which can be used to indicate that a PHP object can be serialized to JSON object. It has only one method which should be implemented by any class which implements this interface. The method is named jsonSerialize(). It's really easy to serialize an object to JSON object. Here is one example: <?php class ArrayValue implements JsonSerializable { public function __construct(array $array) { $this->array = $array; ...

   JSON,jsonSerialize,Inheritance,extends     2014-07-26 05:54:00

  Add Sublime Text to your context menu on right click

When opening a text file, you may be used to right click on the file to be opened and then choose the application which can open the file from the context menu. On the context menu, you may see a menu item like "Edit with Notepad++". Nowadays many people especially programmers like to use Sublime Text, but by default this application will not show on the context menu when you right click on a file. There is now frequent request to add this application to the context menu. Here we show a simple b...

   SUBLIME TEXT,CONTEXT MENU,WINDOWS     2015-10-19 08:51:25

  Why does it take Task Manager longer to appear when you start it from the Ctrl+Alt+Del dialog?

Amit was curious why it takes longer for Task Manager to appear when you start it from the Ctrl+Alt+Del dialog compared to launching it from the taskbar. Well, you can see the reason right there on the screen: You're launching it the long way around. If you launch Task Manager from the taskbar, Explorer just launches taskmgr.exe via the usual Create­Process mechanism, and Task Manager launches under the same credentials on the same desktop. On the other hand, when you use the secure ...

   Windows,Task manager,Start time,Ctrl+Alt+Del     2012-02-02 07:06:56

  HTTP Server development resource summary

This article summarizes some materials, articles and books I used when learning HTTP Server development. Hope this will help you. RFC and standard documents RFC2616 – Hypertext Transfer Protocol — HTTP/1.1 HTTP protocol standard document, it's an essential reference document for all personnel engaged in the development of the HTTP-related projects, careful study is recommended. RFC793 – TRANSMISSION CONTROL PROTOCOL TCP Protocol standard document The WWW Common Gateway Interfac...

   HTTP Server,Book,Article     2012-09-25 22:46:56

  Execute PHP from a .html File

How can I execute PHP code on my existing myfile.html page?:When a web page is accessed, the server checks the extension to know how to handle the page. Generally speaking if it sees a .htm or .html file, it sends it right to the browser because it doesn't have anything to process on the server. If it sees a .php extension (or .shtml, or .asp, etc), it knows that it needs to execute the appropriate code before passing it along to the browser. Here is the problem: You find the perfect ...

   PHP,HTML,PHP in HTML,AddType     2011-12-26 14:01:20

  The Evolution of a Programmer

High School/Jr.High 10 PRINT "HELLO WORLD" 20 END First year in College program Hello(input, output) begin writeln('Hello World') end. Senior year in College (defun hello (print (cons 'Hello (list 'World)))) New professional #include <stdio.h> void main(void) { char *message[] = {"Hello ", "World"}; int i; for(i = 0; i < 2; ++i) printf("%s", message[i]); printf("\n"); } Seasoned professional #include <iostream....

   Humour,Evolution,Programmer     2012-04-23 06:30:33

  Why is single threaded Redis so fast

Redis is a high-performance, in-memory key-value database. According to official test reports, it can support around 100,000 QPS (queries per second) on a single machine. However, Redis uses a single-threaded architecture in its design. Why does Redis still have such high performance with a single-threaded design? Wouldn't it be better to use multiple threads for concurrent request processing? In this article, let's explore why Redis has a single-threaded architecture and still maintains its spe...

   REDIS,SINGLE-THREADED,MULTI-THREADING     2023-02-28 05:16:22

  Learn about the Benefits of Providing an Engaging Onboarding Experience to your customers

Learn about the Benefits of Providing an Engaging Onboarding Experience to your customers A good onboarding experience helps create a positive first impression and makes your customers feel valued and helps convert leads into paying customers. Effective onboarding experiences also increase conversions and keep customers. High-quality onboarding experiences build brand awareness. Customers notice when businesses take time to engage with them. They even notice when businesses care about them and t...

   ELEARNING,EDUCATION     2022-08-26 21:41:17

  Google releases new app to improve the accuracy of indoor positioning

Google Maps, Bing Maps, and some map providers have offered indoor map service such as in  the airport, major shopping malls and stadiums for some time. The problem is that these indoor maps can not precisely tell you which floor you are on a map, the GPS obviously can not work very well in this environment, WiFi and GPRS positioning is not very precise. Google announced the improvement program of Google Maps for accurate indoor positioning. The current owners of these places will cooperat...

   Google Map,Indoor service,Positioning     2012-04-08 09:46:53