?

Log in

No account? Create an account

stremitelnuj


stremitelnuj

Их было трое - Стремительный, Гаврюша и Чайник


This is real life, Johnny… now fix your JSON parser
stremitelnuj

If you go to json.org, you’ll be amazed by simplicity and cleanliness of JSON format. At least I was.

Now… there are some little things you should know before writing JSON parser:

Take a look at these:

char
any-Unicode-character-
except-”-or-\-or-
control-character
\”
\\
\/
\b
\f
\n
\r
\t
\u four-hex-digits

There’s one escaped char that doesn’t conform to the reality and there’s another char that should be escaped. Could you tell me what are these chars?

Hint: there are actually two chars that should be escaped. Answers are below:

Read the rest of this entry »

Originally published at Scalene. You can comment here or there.


Barricades?
stremitelnuj

Just had a chat with my colleague on this and that. Among other things, he shared his point of view on what is real programming is. I’ll be brief:

- real programming is C and C++ on tasks where every mistake could be fatal (graphic drivers?)
- .Net and Java are scripting languages.

O-ok…

No, I am not proving any point here, I just think that labeling does not solve anything.

Originally published at Scalene. You can comment here or there.


Why fat-free diet is not always healthy: JSON and the large data
stremitelnuj

It is widely known that the JSON is a fat-free alternative to XML. However, as with any alternative, there is a price you have to pay. Most people don’t even consider limitations of JSON format when they design their JSON-based protocols. However, they exist and they usually appear later, when there is a need to scale out.

Read the rest of this entry »

Originally published at Scalene. You can comment here or there.


Why C++ is bad
stremitelnuj

Time for a rant…

A: Say… do you really need template programming in order to concatenate some strings? or, god forbid, you need to tokenize the std::wstring and have to write a method for that? Of you need a stringBuilder-like functionality?

B: C++0x standard is going to be old before it will be released. Come on guys, I am not even talking about fancy things like closures here. I am tired of not having rvalues. I am tired of not having static constructors. I am tired of non-human-readable errors of template-based metaprogramming. I am just tired of having pointers standing in my way 80% of time.

C: Do you know what takes most time for me when I work in C++? To replicate some functionality I take for granted in managed code like Java or .Net.

Example:

//Error.h

class Error
{
public:
 int code;
 Error(int c){code = c;};
 static const GenericError;
 static const DisplayError;
}

//Error.cpp

static map<int, const Error*> g_errMap;

class add_values_to_map
{
public:
add_values_to_map(map<int, const Error*>& _map, int& code, const Error& err)
  {
  map[code] = &err;
  }
};

static map<int, const Error*> g_errMap;
static const Error::GenericError(-1);
static const add_values_to_map tmp1(-1, Error::GenericError);

int main()
{
  Error* p = find_predefined_err_by_code(-1);
}

You probably noticed that this code replaces a static constructor without actually having one. Quite weird half-baked functor class… but this is the best i could come up with.

I’ll hug you if you give me a better solution.

NOTE1: No, I don’t want to call MyFrameworkInit(). Actually, I don’t have the global init method and I intend to keep it that way.
NOTE2: I don’t want to init static variables on the first call to class XX or YY or ZZ or in the non-static constructor of Error. Why? Because I don’t want to introduce any locks in my code.

Originally published at Scalene. You can comment here or there.


“ZX-14 lady” bot
stremitelnuj

Google for ‘zx-14 lady’.

Quite interesting strategy. Either it is promoting motorbike forum (which is unlikely) or it slowly infiltrates through the spam filters around the world. In couple of years account will reach maturity and the owner will deliver a message…

Or maybe someone just testing improved AI text generator on Markov chains.

Originally published at Scalene. You can comment here or there.


LISP SQL
stremitelnuj

I probably discovered America… but this is very LISP-like :)

WITH T1 as ( SELECT SNO AS SA, CITY FROM S ) ,
T2 as ( SELECT SNO AS SB, CITY FROM S ) ,
T3 as ( SELECT * from T1 NATURAL JOIN T2 ) ,
T4 AS ( SELECT * FROM T3 WHERE SA < SB )
SELECT SA, SB FROM T4

This is what you get from reading CISP and ‘SQL and Relational theory‘ in a row.

PS

Dreamed about newbie installing Linux on himself and attracting zillions of nuclear cyber-cooties. The moral was : always use Windows!

Originally published at Scalene. You can comment here or there.


ESRI Dev Summit – musings
stremitelnuj

ESRI Dev Summit is much quieter than ESRI UC, for obvious reason of lower count of attendees. It’s usually held in Palm Springs Convention Center.

Palm Springs CC was most likely (forgive me for not checking Wikipedia) built during the shiny days of city’s glory, when all Hollywood hotshots loved to spend their weekends here. The style is unmistakable. Now about the favorite topic of every convention crasher – free food. Free food was in abundance. I was there only for one day (Wed Mar 24 2010), for that day ESRI provided free boxed lunch, drinks and snacks before and after lunch and free dinner (including beer and wine) on Dev Summit Attendee party. Beer was from Hangar 24, my favorite local brewery, and food was definitely of acceptable quality.

I attended several sessions presented by my colleagues, also had a good deal of talks in exhibit hall. (Exhibit hall is so small cozy that notion of ‘islands’ was close to non-existence, let’s just say I was there for significant chunk of my day).

Dev Summit is like boot camp for developers who want to get a glimpse of ArcGIS 10 early. Pre-release will be available soon and there’s plenty of other related activity happening – dev APIs are getting public as well.

Read the rest of this entry »

Originally published at Scalene. You can comment here or there.


First post
stremitelnuj
First post