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

SEARCH KEYWORD -- Intensive IO loops



  Regex vs IndexOf in Java.

Overview The author of these articles Are C# .Net Regular Expressions Fast Enough for You? and .Net Regex: Can Regular Expression Parsing be Faster than XmlDocument or Linq to Xml? recently pointed out to me that he had found that Regular expressions were at least as fast or faster than the alternatives in C#. However it has been my experience that regular expressions in Java were slower. It is hard for me to say why this might be different in Java and C# or even if these are fair compari...

   Java,indexOf,Regular Expression,Efficiency     2012-01-03 10:58:52

  A Solution to CPU-intensive Tasks in IO Loops

Back in October 2011, Ted Dziuba infamously said that Node.js is Cancer.  A provocative title to a provocative article.  The only thing it didn’t really provoke in the commentary was much thought ;)  Zing. My interpretation of the article is that Ted holds up the classic blocking-IO process-per-request (or  thread per request; same difference) model as superior.  Yet we all remember where the blocking-IO forking model got Apache in the early days.  ...

   CPU,Intensive IO loops,Solution,C++     2012-02-06 07:42:40

  What and what not to log while debugging

Log is a critical part of an application. It serves as an eye to the programmer on how the application is working while debugging. Especially for applications running on production environment, if the application encounters problem and the problem cannot be reproduced on other environments, log will be extremely useful. While log is essential, but developers have to log smartly. Because if don't put log smartly, you may not get what you want while debugging or you may get too many...

   PROGRAMMING,DEBUG,LOG,SUPPORT     2016-03-14 08:09:03

  Tips for improving PHP efficiency

0. Using single quote to replace double quote to enclose string literal, this will be a bit faster. Because PHP engine will search variables in double quoted string. 1. If a method in class can be declared as static, then make it static, this will be 4 times faster. 2. $row["id"] is 7 times faster than $row[id] 3. echo is faster than print, and you should use multiple parameters instead of string concatenation, i.e use comma(,) instead of dot(.) to concatenate string. For example echo $str1,$str...

   PHP, efficiency, tips     2012-10-01 19:39:06

  My love… for Expressive Programming Languages

I started out my journey with programming as a teenager learning GW-BASIC. Soon I learnt C language followed by C++.  I was impressed with the OO syntactic constructs C++ had on offer but I felt a little uneasy with a few constructs such as the scope resolution. I started studying Java. It immediately caught my attention with the syntactic improvements and simplifications it brought over C++. I was still in academics, so learning(precisely trying) programming languages on su...

   descriptive,programming,language,prefere     2011-08-17 07:31:09

  The tic-tac-toe game with Python

In this tutorial, we will show how to build a tic-tac-toe game with Python. We will use functions,arrays,if statements,while statements, for loops and error handling etc. First, we need to create two functions, the first function will display the borad of the game: def print_board(): for i in range(0,3): for j in range(0,3): print map[2-i][j], if j != 2: print "|", print "" Here we used two for loops to loop through the map, this map is...

   Python,Tic-Tac-Toe     2013-07-30 02:49:09

  Macro vs. Micro Optimisation

So there's recently been a bit of hype about another Colebourne article: http://blog.joda.org/2011/11/real-life-scala-feedback-from-yammer.html I'd like to respond to a few points he makes. First - You should evaluate Scala and pay attention to its benefits and flaws before adopting it.  Yes, there are flaws to Scala.   Working at typesafe makes you more aware of some of them.  We're actively working to reduce/minimize/get rid of these.   In my opinion, the negat...

   Optimization,Performance,Micro,Macro,Software     2011-11-30 12:04:25

  What's Wrong with the For Loop

Closures in Java are a hot topic of late. A few really smart people are drafting a proposal to add closures to a future version of the language. However, the proposed syntax and the linguistic addition are getting a lot of push back from many Java programmers. Today, Elliotte Rusty Harold posted his doubts about the merits of closures in Java. Specifically, he asks "Why Hate the for Loop?": I don’t know what it is some people have against for loops that they’re so eager to...

   For loop,Basic,Problem,Efficiency,Java     2012-02-24 05:06:15

  What is the Best Laptop for an Engineering Student?

There are a wide range of engineering degrees out there, reflecting the variety of specialties that an engineer can pursue in their professional lives. Engineering is definitely a solid career choice, and there is a specialty to appeal to anybody. You will, of course, need to learn to love math, as that will be at the heart of any engineering degree. But, no matter what type of engineering degree you are studying for, you will need a laptop to do your work on. In fact, depending on the engineeri...

   PROMOTION,LAPTOP     2019-06-19 08:50:22

  3 ways to remove duplicates in List

Frequently, we may have an ArrayList which stores many values, and we need to process the ArrayList and get what are the distinct values in the list, or we may want to count occurrence of each value in the ArrayList. We can remove the duplicates in a few ways. Here we propose 3 methods :     public static void main(String[] args){        //SuperClass sub=new SubClass();                String[...

   Java,List,Duplicate,Clear     2012-09-03 09:44:32