Welcome to LjGww's Blog

Here we will see...

Thursday, February 6, 2014

Time passed

Where has gone year and a half? Gosh, I did not realize how much time has passed since last time I wrote.

What has happened?

1. I jumped countries
2. Landed on an IT job (nice)
3. Applied some stuff and toyed with

What can I report?

1. Github account: https://github.com/ljgww
2. Got hooked with node.js :) http://nodejs.org
3. Even more got hooked with node-webkit :) https://github.com/rogerwang/node-webkit/wiki

Node is some sort of Javascript renaissance. Server side or desktop application. Its not new. Netscape server had server side javascript but this is different and filling huge gap of not having javascript interpreter at client side (out of browser).

In the meantime Python provided library for almost everything and anything that I hit when administering systems. I also brushed on Python-TkInter - employed it for number of needs where I need some small utility.

That's it for now.

Tuesday, September 4, 2012

A year into languages

I am not much active here... huh. Well, it has been a productive period :) So, who would have a time to write texts when there is so much code to write :)

This year has been amazing for me so far. I have discovered so many new things and so many old things in a new way.

One fine day in spring I started discussing some project with a friend of mine. He has said - why not doing that in Python? As for coincidence a day or two before that suggestion I have pulled Python book from my library and started light reading - for no reason at all. Book was collecting dust for nearly 5 years when I was last time using it.

So things started rolling. Reading a bit about language, baby steps, try this, try that. After a while I have said lets now jump to web... I started with Django, got awed how that works, but was too away from what I needed.

Then I discovered webpy and all sorts of libraries for web notably markdown made a huge impression. Turbo gears too.

Then, I needed to switch to some databasing, actually adopting some old tables given in excell and making that data into database, so I lightly have taken sqlite on the road (amazing small database system)..

Quickly everything that I was doing in PERL once upon a time now have found a Pythonian approach. Python was flexible animal where ever I tried to go. In every domain I have found a bunch of libraries that worked extremely fine.

It was not a straight road but enjoyable one. I love when I make some results, i.e. when I do not run to a dead end that no one has experienced and no help can be found, and even after a lot of experiments you endup with no result - that is frustrating. Luckily that did not happen with Python at all. On contrary, Python proved to be THE TOOL for many little programming tasks. If you havent paid attention to it as yet, get to know it, it is worth spending time.

Not to stop at just one multifacet snake I also recently stepped on Go or better Go Language or how they call it short golang (to be easier to search).

Go was another refreshment and I am amazed that instead of propheting the scripts and object oriented approach Go actually takes a lot from Python in not tormenting a programmer. Syntax is shorter, target is well formed and what is most important it is open source!

In my view many commercial packages in software have huge disadvantage: company may go bust or thing may not prove profitable. I have seen that with microsoft many times but they are not only one to abandon something.

Open source is full of not often walked paths, but, somehow, if you wait long enough, paths congregate to some packages that live and live and after some time become so stable that are even better than many commercial software packages. I hope Go will follow this path.

There is a lot on the net that advocates or gives head start for Go. At this time I am not going to publish many links only start points, each link here is a tip of an iceberg...

If you are interested in Python start here http://www.python.org/
For Go start here http://golang.org/

Will try to come back here and write down some experiences with both of them, but a bit later, currently there is so many things I have to do.

Tuesday, January 17, 2012

Happy New Year with the old programming language with a brand new compiler

Ahh, windows dll's, 32bit programming, .net, inet, sockets...

Honestly, I find idea to use runtime libraries really fine programming approach. Once upon a time I have hit for the first time in my life a multiuser multitask multiprocess environment. With understanding of that environemnt issue of programming got a really new dimension to me. I was at that time using PC (in DOS at home and at work) and VAX computers (at work). VAX had runtime libraries. Limited memory (16Mb at that time was huge offer) was asking for some optimization. Vax had fortran, pascal and c compiler and basic interpreter. Quite fine programmers offer. Yet all of these languages (except basic) had approach - you write/compile a program and you get very small executable image - wow how efficient, but later I have realized by exploring system in more depth that all of these executables relied on Run-Time-Libraries. What was really neat on VAX is that it was smart on conserving memory. One copy of run time library for each language was almost always running on the system and all instances of programs in particular language were using it. Which basically means that each program had to reserve its own data memory section and compile calls to the library and some specifics of algorithm you are writing. And you could run many programs at once and even do some interaction between them.

At home situation was completely different. I had AT PC machine with dos (and 4dos if someone remembers that animal) and of course programmers miracle of that time which can do almost everything lighting fast - Turbo Pascal!!!

I have breath Pascal programming. It had a lot to offer compared to basic: compiling (basic was slow, computers were slow), variety of functions from abstract to direct hardware programming. You could virtually do anything you want and make it as efficient as it can be on contemporary hardware.

Of course, Turbo Pascal worked in smililar fashion as Vax Pascal with a slight difference. Run-time-library was still present but since DOS was single tasking RTL was glued to executable image. Luckily TP RTL was not large for what it had to offer. You cannot easily port code from Turbo Pascal to Vax forth and back. You needed to do some interventions in code. But it was as good as it gets.

After some time someone came with C and things have gone other way (C was appealing because it had shorther syntax and we programers are lazy to type). Yet, many years later using C, DB/clipper, and many languages, Turbo Pascal remained a niche tool. Whenever I needed to make something that would augment and fulfil some special programming need, Turbo Pascal proved to be handy. I made a ton of desktop publishing projects in Turbo Pascal working with textual files or calculating complex coefficient while calculating values of bonds and at that time rampant inflation rates. TP was versatile tool of choice. Period!

Then Pascal went to history... I moved to C++, ASP, VB, PERL, HTML, PHP, JavaScript, SQL ... yada... yada.. DOS changed to Windows, from VAX i moved to UNIX etc etc...

Recently, I negotiated to make a novel approach to some established system. Mathematical in nature, internet in background and limited in options, have specialized language that is just good enough that you cannot say its bad. After some research I have got the hint that you can extend that system with custom written .DLL. So lets explore DLL writing nowadays.

All of you that programm windows on a daily base know that Microsoft after many years of so called COM approach will sell its own grandmother to influence programmers not to use DLL's i.e. Component Object Model (COM) and make DLL hell on the way :). This goes to direction as you already know, of .net approach. Virtual machines :) installation blah blah..

In essence this is again not much different than vax, honestly I do not see much of a difference between RTL and VM's (virtual machines). In essence they are not far from each other. Your code is compiled in some meta-code and then that meta-code access ready made library to be executed. Is it RTL that is glued or dynamically linked or it is VM that is executing meta-code, I find that matter of taste.

But, for this project, I needed "ugly" 32bit DLL!!! And what's worse, I needed it to be compatibile with the system I am using. That system is REALLY PICKY how that dll shall be. I assumed it was written in C/C++ so it looks for standard COM DLL (c-ish like). So I took a ride of research which tool to use. Of course I could think nothing and write in C, but yet again WHICH C?

As it turns out, Microsoft was not a good solution as their all effort is on .net. All old Visual Studios are far out of fashion and support. Microsoft - dead end. Another option was open source C (in a form of GCC for example). I am not that familiar with alternative programming systems on windows that are not web based, applications are also developed in Java... every path that I have explored have lead me to some dead end. Can't use this because of that, this is not for that, you cannot do this in that, this is not intended to be used in this platform or in this way. Oh, Gosh... give me something that does not offer iPhone programming :) I WANT TO WRITE BLOODY UGLY COM DLL in WINDOWS 32!!!! :)

And then a short example of using Lazarus with this system i needed to extend - on some russian web site. Some months ago I was lightly researching pascal on mac, not out of need, but out of curiosity. Downloaded lazarus, tried to do something and then I was drawn to some other things. Life matters :)

So I made a test .dll in lazarus (downloaded one for windows), compiled, mounted dll in a system (wrote some additional interface code) and let it work. WOOOOOW! it worked where all others failed. And it worked STABLE. I left it working for a whole week, with all computer going to sleep and waking up. NO CRASH! I was awed.

Again, I was drawn away by other things I had to do in the meantime and started designing a new system that is mixture of dlls, socket connectors, management, calculations.... still yet on paper / drawing board but once i make all decisions code will unfurl. I have said let me make some socket examples ... some client some server and see maybe I will use web server maybe sql db maybe nothing of that at all, but lets go basic - make socket example.

Number of years ago I was writing some chat and some kind of remote controller in VB on windows sockets. It was frustrating, but it was fun in the same time, and at the end it was working fine. Socket (internet) programming shall be kinda separate programming course IMHO as much as web programming is.

What initially I did not realize that beneath Lazarus there was some strange animal that was taking many forms. Actually very soon I have realized that Lazarus on its own is not Pascal compiler (unlike Delphi and Turbo Pascal). Rather Lazarus lean on multifaceted animal called FPC or Free Pascal Compiler.

So I set to quest to explore it further. Then I really got awed!!! FPC was rare kind of animal that have enriched my programming world! FPC works on Windows, Linux, Mac, can write programs for iOS too, did not find anything for android as yet but do not take for granted that it would not support that too (like iOS, android is linux/unix derivate). Can Cross-Compile (compile for one platform on another one). Can mimic Turbo Pascal, Delphi, Objective Pascal, MAC Pascal... it can make code for MacClassic as much as it can make code for MacOSX both carbon and coccoa, of course it has strong Windows 32 and 64 bit support (looks very native to windows) and also do the same trick on Linux. Is it a time to go back to PASCAL? I think its worth exploring.

Oh yes, documentation is quirky, in some parts not explained in much detail, some examples may not be working, community seems not large and populated with game developers??? as it looks like. But do not forget some things. MacOS Classic is fully written in Pascal. Skype is written in Pascal. And this compiler is for at least 10 years on the road. Does not look too buggy! Some lab tests are required.

And oh yes two. I made small example of client and server working with sockets. Compiled, debugged on windows, until happy proof of concept, then I wandered what Mac will do, moved code to Mac, compiled on mac and made socket connection. Guess what? It worked. Not only that it worked, but the SAME SOURCE that I have compiled on windows, i compiled on Mac with NOT A SINGLE CHANGE, compiled the same like it was always on mac. And worked as it was written on mac. This I find really awesome! OK you may say its not the same when you write application with windows controls etc, this is simple console application, and Yes I will agree that when you wish to make some decent application you need to interact with user with windows and mouse, show some data, fonts and graphics, but if I can write at least 60% of code to be same between platforms I am already happy as puppy!

One more significant thing is that FPC is OPEN SOURCE!!!! You may have new official Pascal bangs and whistles from Borland called embracadero http://www.embarcadero.com/products/delphi but if you do not feel forking out many $$$ and you wish to have good pascal compiler that can do many things and do it well explore FPC Free Pascal Compiler ....

And yes, in a new year they have just released latest version 2.6.0. Even versioning looks convincing. Not to low not to high....

Some links where you can start from:

http://www.freepascal.org/download.var get compiler here
http://www.freepascal.org/docs.var equip yourself with PDF books/manuals here (html online manuals sometimes get handy too)
if you get confused ask questions here http://community.freepascal.org:10000/
Want IDE? get lazarus http://lazarus.freepascal.org/

that shall cover most of your bases. Cheers! Happy New Year!!!!

Wednesday, December 21, 2011

Identify yourself! :)

We rarely think about how other see us. When I started with Internet in some mid 80ties, internet was fantastically anonymous. Soon afterwards this anonymity was ridiculed in many ways. Then suddenly in 2000+ things take amazing turn: Instead of preserving anonymity, whole approach turned upside down and suddenly people registered to Internet as themselves. Not only that, but they started bluntly sharing their personal lives with others. Once someone's personal life becomes public life, rules of the game change. Someone can actually look what you think, what you like, what tick you. Of course if they are interested in you, which many put forward as an argument. Additionally since you declared that this is yourself on the internet you can use it as some sort of ID. And voila suddenly we have OpenID ... http://openid.net/ extremely useful but double edge sword web facility.

There is another side of the coin too. Do you google yourself? What google knows about you someone will also research if they are interested in you. Who that may be? One very important player in your life - your employer! Internet savvy employers may screen candidates by their digital footprint. So I will ask you again: do you google yourself sometimes? I found out that I am contributor to some church in Vancouver area :) I am not of course, but searching my name and surname brings lot of funny outcomes. Even photos!!!

To take this thing lightheartedly and see benefit of it rather than dark side it does pay a little bit of attention what you publicly say....

On the other hand you may gain something else ... being recognized. How to do that read on http://www.avc.com/a_vc/2011/12/lightweight-identity.html

Tuesday, December 20, 2011

Sunday, December 18, 2011

Life rummage

It has been ages that I have written something here. Its about time, as few new developments are worth noting...

First, blast from the past. Some almost 30 years ago I have participated in Computer revolution by being a member of the team that have built these computers http://en.wikipedia.org/wiki/Galaksija_Plus and later http://en.wikipedia.org/wiki/TIM-011 what wikipedia tells you is not really true, as behind Tim 011 there was only 3 persons that were not from the Institute Mihajlo Pupin. But that is political matter. Official history is not always true. But that is life matter. (it also puts me to thinking how many "facts" on wikipedia may be untrue) However, something has happened that has made me smile and that was this one:

http://galaksija.petnica.rs

I find this move of authors ingenious... Galaksija that in our case has spawned plus version and later TIM computers has actually been forgotten for nearly 30 years. In the meantime Z80 processor that has been heart of so called home computer revolution of early 80ties has found its place in most unexpected places: telephones, advanced calculators, tv sets, all sorts of micro controllers, etc...

Riding bad political vibe but excellent explorers vibe I wish and will strive to give my tribute to this project as to make some kind of life circle.

This small package is surprise on its own.

Webbing

I have put aside for a while working on web development, although I finally stepped on some great stuff. Would like to draw your attention to couple of web places I find increasingly amusing.

http://www.wolfcms.org/ - why I find it amusing? Because it is at the right middle between some web framework and over-bloated CMSes like joomla, drupal or typo3. For ones that need a website that they can extend with their web wizardry this one is more than recommended.

Web framework quest

Ones that have read my previous posts could have noted my Oddysey through web frameworks while trying to find something that would help me to write web applications quicker and more standardized. If you haven't done so, read previous posts, to find discussion of the requirements that I sought. Finally and almost accidentally I stepped on this, I must say, ULTRA FINE approach to framework:

http://www.slimframework.com/

Its simply a piece of WEB ZEN! If you are after small web app that may grow, consider not starting from an empty code page in editor but starting with the Slim Framework and you could get amazed what it can actually offer to you.

Re-Microsofting

People that know me know that I'm not particularly fond of Microsoft. I never was. Its also true that programming Microsoft stuff has paid some of my life periods. I could be hitting such period again, not too happy about it but also amazed with some movement within Microsoft area. I will point you to two for me pretty amusing areas, but before I do lead you into Microsoft dark forest :) I'd like to mention another aspect of my understanding. I never liked Java as well. More world has been pushed towards Java i felt more animosity against it. Poor Java, it is not that bad language with good intentions and dirty business games. Microsoft .NET answer to that made me not even thinking of starting to do something with either of them....

Time passed and my animosity towards these approaches kinda wearied off. I was not pushed to use them, they could exist aside from me and I could perfectly spend my time on HTTP waves and web applications. But... recently I got request to re-think some system, and being old school of windows programmer that spent time with COM and COM inproc's started wading trough new MSDN. To my amazement I found some neat new stuff while noting that MSDN of some 12-14 years ago at which I would swear at was chamomile tea compared to over-written-under-meaning msdn of today. But somehow I find it fun to start writing windows service in vb.net and explore these two things I want to mention as things worth noting:

First one, which I did not go deep to explore but understood potential was a new command shell for windows called Power Shell....

http://msdn.microsoft.com/en-us/library/windows/desktop/aa973757(v=vs.85).aspx

do not be a-strayed with MS definiton of it. It is fine programming tool that DOS shell (or 4DOS shell) was attempting to be and WSH (windows scripting host) was too much of a programming approach. I believe for ones that would like to blend programming with the system administration and creating solutions out of business rules and procedures I would recommend spending some time studying Power Shell.

Second thing that has caught my attention quite strongly is another aspect of .net world. But before I explain what it is let me go back a bit into world of early MacIntosh computers. I know you'd murmur WTF? But i will be bold and toss in first generation of digital mobile phones, old Netscape browser and WWW into the soup and claim they have all attempted the same! I could possibly hear louder WTF? has Microsoft, Old MacIntosh, Netscape, cell phones may have in common. And I will say - DECOUPLING! Story begins with HyperCard on an old Mac's - HyperCard was possibly the most humane software ever built for information processing - that was never understood until WWW proved to be success - but WWW was only a HyperCard concept put on a network... First generation of cell phones have had WAP system that was conceptually based on stacks of presentation cards - almost a clone of HyperCard on post stamp size screen, Netscape made simillar attempt with web page editor built into the browser and putting JavaScript both on client and server side. All of them attempted decoupling we call today MVC paradigm (Model View Controller), in my understanding this shall be rather called VCM by seeing first View of a stuff, then through Controller understand Model of a database (or knowledge storage). Where is in all that soup a .net? It is not actually .net itself but something called Windows Presentation Foundation (see http://en.wikipedia.org/wiki/Windows_Presentation_Foundation) to be more particular something that I find rather usable is XAML:

http://en.wikipedia.org/wiki/Extensible_Application_Markup_Language

The idea that you can build webbish like front end which is decoupled is rather fine stuff that Microsoft has jumped on. And voila, you'll see that this thing will drive new windows things like Metro on cell phones and Windows 8. It smells strongly to be in that direction. But I will recommend to dwell a bit into XAML, and if MSDN is dry and boring place to read about it (as on):

http://msdn.microsoft.com/en-us/library/ms752059.aspx

then you could have some entertainment and watch this 4 year old and mostly undernoticed video about Vista... it was not Vista!!!! it was about Windows Presentation Foundation!!!

http://www.youtube.com/watch?v=MTfM5pmUrnU

Hope I have got your attention.

Wednesday, May 25, 2011

Mobile web

I am contemplating how to adopt a web site to be more suitable for the mobile phones. I have stepped on a set of solutions that may provide an answer to this question and cover more than one phone type.

http://mashable.com/2010/08/11/cross-platform-mobile-development-tools/

Writing application for each phone seems a bit tedious business. I guess that producers will hit the wall of cross compatibility. It is cool to have a native app for your phone, but multi-phone development is costly, and maintenance of several lines of mutually exclusive phone os-es applications even more. Thus I guess we will go to a deadend with specific apps (except for games and system utilities for each phone). Already top 10 apps on iPhone are games - I've seen nothing serious.