A while ago, I wrote the online regex tools. Cyril (@CyrilBois) came across that post and mentioned about his regex tester tool.
I think every tool should have a name; not one that just goes by its function but a nickname, if you will. So, I am going to name Cyril’s regex tool - Cyrilex
. Don’t like it, don’t worry about it.
Instead of adding Cyrilex
to the list, which I have already, I took the liberty to sort of review the tool. Because it has got a few cool things that I love.
Earlier this year, I wrote1 about publishing2 C++/CLI Primer on [LeanPub.com]3. I wondered if there is anybody else besides myself and Microsoft using C++/CLI but readers surprised and humbled me with their support. Seems C++/CLI is here to stay. Know why?
A couple of months back Apress4 Publications took notice of the book and offered to publish/print. So here it is: C++/CLI Primer for .NET Development, my first book; who wouldβve thought π
More ...
semantics | /sΙͺΛmΓ¦ntΙͺks/ | noun (functioning as sing)
β the branch of linguistics that deals with the study of meaning, changes in meaning, and the principles that govern the relationship between sentences or words and their meanings the study of the relationships between signs and symbols and what they represent (logic)
β the study of interpretations of a formal theory
β the study of the relationship between the structure of a theory and its subject matter (of a formal theory) the principles that determine the truth or falsehood of sentences within the theory, and the references of its terms
Yes, there is a difference. Although both produce the same end effect, an iterator is not the same as a generator. The difference is in the way it is implemented and also consumed. Iterator is a (design/implementation) pattern while Generator is a language construct supported by the compiler. More ...
New things are not always instantly accepted. Beyond skepticism, new things challenge the comfort people are accustomed to. JINQ wasnβt particularly welcomed. It was either discarded as unknown angel or worse β¦ ridiculed. However, JINQ still promises expressive succinct code. More ...
JINQ (Java INtegrated Query) is an ultra minimalistic library inspired from and mimicking the .NET LINQ. While LINQ is a language level construct, JINQ is composed of types - classes and methods, but to the same effect.
I am really sorry if I tricked you into believing that Java is offering partial class feature. Unfortunately, Java doesnβt. Maybe never will. But I am going to talk about a workaround also presenting the thought process. Hence the length of the post. More ...
It was about a decade ago when Visual Studio .NET 2002 was launched. Having worked with Visual Studio 6 until then, the new interface was refreshing and powerful along with .NET and the suite of languages, tools and technologies. If you were there, you would have felt times were changing. Beyond the cool and modern interface, Visual Studio .NET 2002 had a lot more to offerβ compared to Visual Studio 6 ββ.NET. It was an exciting time for me back then. More ...
What are your thoughts on the following piece of code?
public String someGibberishMethod() {
int length = someMethodReturningLength();
int sum = 0;
for (int index = 0; index < length; ++index) {
// some code that updates the sum variable
}
SomeClass someClass = new SomeClass(sum);
int sumValueInsideSomeClass = someClass.getSumValue();
// use someText, maybe log or something
String someText = someClass.doSomeOperation(/*some parameters*/);
// use someText, maybe log or something
return someText;
}
If you are writing a typical console based application in Windows, you would end up with an executable (exe). You might also have one or more dependent libraries (DLL). The question is where do we place these DLLs so that they are picked up at runtime by the application; loaded and consumed. Actually it is no brainer, just put them along side the console application executable. Or you could place the DLLs in the System32 directory. Or you could add the directory to the PATH. Well, my point was actually to say that the DLLs can be simply placed alongside the executable and it would be picked up. More ...
Today, we question our beliefs! Is string really immutable?
string message = "Hello World!";
Console.WriteLine(message); // Prints "Hello World!"
unsafe {
int length = message.Length;
fixed (char *p = message) {
for (int index = 0; index < length; ++index) {
*(p + index) = '?';
}
}
}
Console.WriteLine(message); // Prints what? See for yourself!
In the recent interviews, I asked the candidates the following question:
Is there a difference that I need to consider in the following declarations? Both allocate fixed size array to store integers:
int[] na1 = new int[10];
Integer[] na2 = new Integer[10];
A short while ago, I had to write a compelling document for a client about a library that I had developed during my tenure, call it A-Team Library or ATL. Having to learn the βeyes-wide-shutβ culture to maintain the couples-of-decades old code and simultaneously develop on the top of it was very disheartening. It was time a lot of things were given fresh thoughts. Not the least of all duplication of code and functionality. But not just that. Like in a programming language, when there is more than one way of doing something, when those ways are opposing, it causes nothing but confusion. So was the case. The business seemed to be far from realizing it. More ...
A long time back, in one of my posts here1, I had discussed about Extension Methods2 β¦ in C++; sorta! It seems that the grand daddy, Bjarne Stroustoup3, had read my post, and was impressed. So he has published a paper β Call syntax4: x.f(y)
vs. f(x,y)
. Good thing except I donβt like the idea of assuming x.f(y)
for f(x, y)
while the reverse is the actual idea of extension methods. You will know when you read his paper. It seems the commander, Herb Sutter5, also was impressed with my post. Not only that he too doesnβt seem to like the x.f(y)
for f(x, y) idea. Great men think alike. LOL! So he published his paper β Unified Syntax6. How is that?
More ...
Digging up stash is one of the best pass times. You know you never know what you will find. I had an article written quite some time back but had not posted it anywhere. Not sure why. I posted it at CodeProject β A Simple Tree List View.
The ubiquitous and the universal data structure in PHP is the [array][1]. It is an amalgamation of commonly used data structures β list, map etc. In the recent times, PHP has also adopted object orientation and introduced classes. The syntactic difference in the way a property of an array and object poses an inconvenience in the user code1 specifically when there is a need to interact with code that is not open for change; legacy or not. More ...
Anytime I have to play with regular expressions, I use one of the online regex testing web sites to come up with the regex I need. Last couple of times I had to come up with a regex for most common everyday stuff like dates and such. Oh yeah, last time it was date actually. I had a server response that had a date in the format yyyy-mm-dd
, ISO format. I was working with JavaScript, and initially I was naive to use the Date
class to parse the date in the response. Turned that there is difference in the way the date is interpreted by Firefox and other browsers.
More ...
In a statically typed (object oriented?) language, function overloading offers the facility of organizing your code into two or more functions with different types and/or number of arguments. This is highly useful when the functionality offered by the function can be invoked in different scenarios. For instance, let us consider the function(s) below: More ...
I have been using Android for quite some time now, and only recently I noticed that Android pops up a notification reminding you of a reminder. It says “Upcoming alarm – Buy Milk”, where Buy Milk is the reminder I had set.
Is it smart enough to help a lazy volatile minded guy like me or is it trying to be my wife who would not rest until I buy milk? Donβt know.
More ...This post is primarily a personal reference. I also consider this a tribute to Oleg, who played a big role in improving my understanding of the jqGrid internals β the way it handles source data types, which, if I may say, led him in discovering a bug in jqGrid. More ...
I received quite a lot of criticism for Dealing with Bad Code. The criticism was mostly along these lines β There is no good or bad programmer. The good programmer thing is more of an illusion. When you place a programmer in a domain in which he has little or no experience (like a PHP web programmer writing C++ code), he will soon be seen as a bad programmer. What is branded good or bad is subjective. More ...
Extension Methods is an excellent feature in C# 3.0. It is a mechanism by which new methods can be exposed from an existing type (interface or class) without directly adding the method to the type. Why do we need extension methods anyway ? Ok, that is the big story of lamba and LINQ. But from a conceptual standpoint, the extension methods establish a mechanism to extend the public interface of a type. The compiler is smart enough to make the method a part of the public interface of the type. Yeah, that is what it does, and the intellisense is very cool in making us believe that. It is cleaner and easier (for the library developers and for us programmers even) to add extra functionality (methods) not provided in the type. That is the intent. And we know that was exercised extravagantly in LINQ. The IEnumerable was extended with a whole lot set of methods to aid the LINQ design. Remember the Where
, Select
etc methods on IEnumerable
.
More ...