Archive for the 'Other stuff' Category

Simple send-to-all TCP server in LUA

Friday, July 25th, 2008

I did a lot of boring stuff yesterday so in the evening I felt I deserve a small treat. I decided to finally get more familiar with 2 of the C* words - coroutines and closures . I know partially what they are and used them here and there, but haven’t really gotten deeper in. Lua can do these without blinking so I decided to make a simple tcp server with it and see if I can use them on the way there.

click here to see the current Lua code

send-to-all server and clients

The code works but it’s not in any final state yet. The server accepts any number of TCP connections which it then keeps open and when it recieves a text from any of them it sends that text to all clients. If I would add nicknames you would have a simple chat server (but I made enough of those already). I also made quick GUI client for testing in REBOL, code here and a quick stress test script in REBOL too ( code here )

I did use a closure in a rather cool way (I think), and I implemented coroutines but in the current code they have no meaning to be there. They will get needed if I will extend the thing into something more interesting. I will write more about some interesting parts of the code next time.

Zemanta Pixie

Make a quick html data extractor with REBOL (code)

Monday, July 21st, 2008

This is the REBOL code from video in previous post. A nicer version can be seen here

page: read http://www.avto.net/2004/motornaKolesa/zadetki_zadnjih100.asp
ads: make block! 110
parse adspart [ some [ to <tr> copy ad to </tr> ( if find ad {<a HREF="oglas.asp?} [ append ads ad ] ) ] ]

ads-rule: [ thru </td> thru {<a href="} copy _link to {"} thru ">" copy _title to </a> thru <small> copy _descr to </small> ]
clean-html: func [ a ] [ replace/all a "&nbsp;" " " ]
foreach ad ads [
    parse ad ads-rule
    print clean-html _title
]

Make a quick html data extractor with REBOL (video)

Saturday, July 19th, 2008

image from wiki en: Summary:Carl Sassenrath, 2...Image via WikipediaI will soon need to make some sort of web-spider. It seems to me that a very good choice for making one is REBOL. I was programming in REBOL years ago so I forgot most of things. REBOL recently released a very much awaited version 3 (I was a little afraid it is more of a “vaporware” ), and after few years showed that Carl Sassenrath still “means business” with it. So my interest in this interesting language is renoved too. Another big plus is that 3.0 greatly solves some issues that I had with the original REBOL (general closeness, artif. limits in Core version, async stuff). I decided to make a quick video of the procedure so that I get you interested in this excellent language too. Yes you, who did you think I was talking about ;)

I do the following in the video: I load a webpage of a “last 100 motorbike ads” thru HTTP, I parse the unnecesarry html away first then I parse the table that holds the ads into separate rows first and then each row into concrete data.

Interesting tidbits: do you see how I don’t enquote http address (REBOL has many datatypes and URL is one of them) or XML tags (the same reason). Most of the time I just use the parse word which moves me into parse DIALECT. Most languages have functions, classes but rebol also has dialects. parse dialect is just one of them and you can create your own as you can create your own functions for example.

I used only the most basic features of parse dialect here. It’s an unbelievably powerfull feture.

Zemanta Pixie

Good video about web-app security

Friday, July 18th, 2008

Yes, the usual web-app security themes, SQL Injections, XSRF and XSSI but very well presented, with practical examples. And I admit learned some new details about all 3 topics.


Schobbia Battles (the cards game)

Monday, July 14th, 2008

tree mannimalJust to inform you there is a new project going on here. It’s a project where no programming is needed (at least for now). It’s a card battle game, but not the trading cards battle kind. I tried to make it easy to learn and hard to master. We learned my wife yesterday in few minutes and next thing she beat us because we weren’t careful. So the rules I think are still very minimal while allowing enough combinatorial complexity that the thing is interesting. My sister is drawing the cards images now and once that is done we will start making it more public. I made a very simple website where I will update info about the game.

Schobbia Battles

There are 3 elements in the game, each element has element creatures and magics. Next to that are Extras which are some sort of special case cards and weapons not bound to the elements. The game has two strategical parts, one is picking the cards - the other is battle. Picking of cards is made in a way I haven’t seen anywhere (but I don’t know many cards games). You also need a dice to play. OK, that’s it for now.. more updates will follow.

Not the most utterly nice thing from kiberpipa, but meh

Sunday, July 13th, 2008

Osho („Rajneesh“ Chandra Mohan Jain)Image via WikipediaI said I have one more of these “bullcrap” post to write before I go to a cleaner version of posts. I wanted this guy to come from vacation before I write it because I don’t want to ruin a fraction of his time or good feeling over there, because all in all, it’s not a big thing.

Ok. I have made some chat server which I wanted to use as a basis for making more interesting apps. I got some idea some day that could be used at cultural and other events.. that would make them more of a dual (real + online) events. The idea was basically simple and not something groundbreaking and also didn’t require any massive coding besides using my chat + some streaming video stuff + other ready available stuff.

it goes like this:
1) Event is happening .. for example a kiberpipa lecture
2) Video is streamed and available on a webpage in realtime
3) Besides the video, chat would also be embedded on that webpage so people who watch the video can chat one to another
4) Chat is projected on a wall in the room where the real event is happening
5) Near is a computer or two with chat loaded so that people from event can also chat back
6) Chat application could have some special funcionalities like voting for questions to ask the lecturer .. etc

So I proposed this to one guy from kiberpipa, I said I can do the chat part for free (they already do stream video). My reason was that I want my (open sourced) chat server to be used and progress somewhere and it would be a cool reference. The guy didn’t reply back, which is no problem to me, the idea can not sound so good to him, or whatever..

But a week or two later kiberpipa was organizing a big Firefox 3 Release Event, with talks, lectures and a party, etc… and I got a newsletter from them saying also (if I translate) “if you can’t join you can watch a video stream of the event here”, “you can join us in our IRC chatroom”, “chat will be projected on the wall, so we won’t miss a thing”.

So, WTH, I don’t care.. nice to see my ideas roughly in action without having to move an finger. Yes, maybe they (A)got the same idea at the same time totally independently of what I wrote, or maybe (B) I “inspired” them (as it’s often called in indie game community). In each case they could of written me at least a line back if they intended to use something like it. This post is just so it’s known that I know and the story can be closed to me here. If something is troubling me with someone I usually write him/she directly not post it publicly, but I would feel stupid writing an email to a person again if he didn’t reply the first one anyway.

Otherwise, this doesn’t change anything to me. I love and am utterly happy with what Kiberpipa does and that it exists. They are the great and one of rare voices and meeting points of young, innovative tech crowd in Slovenia. And they have lectures, meetings, various stuff multiple time per week, so a lot of good will must go into running the thing. I will of course still visit it when I have time. Good thing I was reading too many Osho books once and totally dissolved my Ego by accident (joking).


Update: The guy who I wrote to replied me and explained that my mail wasn’t seen by anybody else and that he wasn’t involved in organizing the FF3 release day. I believe him, so this seems to be just a case of 2 things happening at the time that made it look like it could be option B I mentioned upthere, but it’s A.

Zemanta Pixie

My dear diary

Thursday, July 10th, 2008

I noticed that my blog lately was more of a a mix between “my dear diary, I saw the blonde chick again today and I have to tell you how I feel right now” and “I have this opinion you know, and I am so smart and all that you are all dying to hear it.”. I will try to revert back to exotic languages code samples and announcement about my “numerous” products which is why I started this blog more or less.

I have a little problem writing any cool language examples lately, because… I went into ultra-practical and business wise mode, or to say it in more direct way “what the fuck - stop playing around - earn some fucking money and get a life”.

So I am making new web-project in PHP (I planned to do it in Factor in my “young idealistic” days (2 weeks back)). I am not working on Ask Robi right now which was one source of some interesting code.

I am programming a semi-casual game in BlitzMax which is… well a Basic (I hate Basics, but this is the only reasonable choice besides c++ that gets the job done well because at (casual) indie games, distribution and compatibitilty the most important thing (I ditched c++ because I hated all the compiler options that was more complex to me than the code)).

So no time an Ocaml game, or even Java or Clojure game :| … and no time to make progress with waterisk game, because frankly I know it’s not a game you make to earn something.

So the conclusion is that I will be hopefully writing a little less posts now. Well I have just one such post to write when I find time.

Zemanta Pixie

Technological singularity here and now

Thursday, July 10th, 2008

Moore's Law, The Fifth Paradigm.Image via WikipediaI worry about many things but I don’t worry about technological singularity thing. I discovered just recently on twitter that this term even exists. My response on twitter sums it ok:

@someperson - meh, until people think AIML is about AI you have to fear squirrels surpassing human intellect more than computros :)

Not that good example but if you want to see how stupid computers can be watch this video (this guy tries to write a small pearl script using vista voice recognition.. MEGA FAIL):


But I admit they are almost surpassing the humans ability to make me laugh.

And another thought. Did you ever hear the quote.

"These next-gen games... they keep improving graphics but AI in this [insert latest FPS] is as dumb as few years back. Why the hell don’t they work on AI at least 30% as on graphics”.

I can try to answer (but don’t take this for granted if you have some I).

Because they can't, because we don't know how to make a better functional AI yet. And most of what you see in these advanced games is not much of "AI" anyway, it's just smoke and mirrors that gives an impression of some intelligent behaviour.

Zemanta Pixie

Moje sožalje vsem v Sevnici

Wednesday, July 9th, 2008

Vsi vemo kaj se je zgodilo prejšnji teden zato tega ne bom ponavljal. Ne živim več v Sevnici, kjer sem živel in rastu gor vendar bom po srcu vedno Sevničan in ponosen na to. Moje sožalje vsem svojcem!

From Russia with Code

Friday, June 27th, 2008

At some web-project, where I was main coder for 2-3 years, we were seeking additional local coders few times. But we had no real long term luck. It just seems hard finding good committed and professional programmers here. You know, the ones who go, think and then DO it. Not the ones who say, but we should use X templating engine or Y framework or Z something in the middle.

Well but things are looking a little better now… we used oDesk and we found a company from Ukraine which offers programming services. And so far, they DID it. They have a “manager” to which you talk to and who manages a bunch of programmers. You ask him “Do you prefer any of the web frameworks specially, can you code without it?” and he answers “We can code in any of them or without”. He asks “What are your coding guidelines, what structure you like?” and stuff. That is professional attitude, you accommodate to the project.

You can’t come to a 40.000 LOC project, that has been online for 2 years, to do some well rounded simple thing and say, “but I like smarty templating engine, let’s change all this to smarty first”. I hate big frameworks/systems and it doesn’t get much bigger than Typo3 CMS, but when it was needed, I did code a big app in it and I did code it the Typo3 style. Contract programming is not about your personal likes and dislikes, “and my framework has bigger MVC pattern than yours” shit… It’s about doing it..

We are starting with a bigger and quite complex part of applications with coders from Ukraine next week. I hope it will go well.

Just to be clear, when I wrote “say” upthere, I am not against saying, having ideas, proposing things, any-things. Contrary to that, I am the one who thinks that not being afraid of being “wrong” or “stupid” is one of the greatest personal features. By “say” I mean, “let’s use X. No? Then, byebye.”

And btw, anyone who is using Typo3 (I think our government uses it) is, well.. a little crazy (to be polite).
Zemanta Pixie

Re-confused with Seaside a little

Sunday, June 15th, 2008

After I thought I have web-development all figured out, I got a little confused about my state of mind about it today. I watched some videos and played with Seaside a little more than before and now I don’t know. Things there are much different than my style is, but I can’t decide…

..is that really good and cool or not? Are my theories still solid? Do I code on too low level without the need to do so? what is really the right level of abstraction??? I thought I knew…

Inflatable Sunny days to come

Monday, June 9th, 2008

Me and my wife had a hard-shell canoe once, we drove it on few lakes and rivers around Slovenia. It was nice, amongst other things my sister and her b-f discovered the Bohinj monster in it and the legend now passes to younger generations.

Then 3 guys, drunk, took it to for the ride on Sava damn at HE Breg (near Sevnica) without asking anyone. They lost balance in the middle of the dam, fell in and almost drowned. The canoe sunk and was never found again.

Now I decided not to take my whitewater kayak with us on a Switzerland trip, but we bought an inflatable mini raft/canoe from Gumotex (Sunny) to deliver ourselves some family friendly adventures on lakes, seas and rivers in the future. While the hard-shell canoe was huge to put on a car and a project to get with it anywhere this thing is even more durable, doesn’t sink, weights just 16kg and I can pack it into just a special backpack. It can also totally accomodate to paddling in solo or duo.


gumotex sunny
Image is from this page, good info about IK-s

Can’t wait to try it on a water… Although ultra practical I still have some prejudice about inflatable stuff on water.

I found out that Euro football something is happening right now in Austria and Switzerland where we intended to go. So we are switching to Italy - South Switzerland instead.

Tripping for little earthlings

Friday, June 6th, 2008

Me and my then-GF-now-wife went to a 1 month trip through the side roads of Italy, France and Spain when-we-were-young and beautiful (and both had long hair). We drove an old yellow diesel VW golf (Mk 1). It marked us and it was sort of trip of a lifetime.

Well, hopefully not. We two + our 2y. son Miha bought a smallest used Adria’s camping trailer last week, and now are going for a shor trip through Austria to Switzerland next week. The idea is to be even more mobile than with a tent, and dryer in this monsume summer we seem to have. You stop, pull the handbrake and go to sleep :) - at least that’s the idea.. too bad even smaller trailers don’t exist here.

Buying the trailer, fixing up the pulling hook to the car and all the bureaucracy attached to it has stopped all my work except contract jobs for last week or two, but what can you do?

Too bad pics from the trip to Spain are all in non-digital formats.

flex 403 upload ioError 2032 php

Wednesday, May 21st, 2008

I was deploying FotoLOAD to the first customer/beta tester. It all worked on some of my test servers but it threw some exception at the end of uploading an image on some of mine and it gave me same exception on this customer`s server.

The fact that you can’t print out the returned response at ioError didn’t help. I dug out that you can set up an event listener to http status so I at least found out that it was returning me 403 (forbidden). I had no idea why it does this as I could contact that file and upload in any other way without any 403.

disp.addEventListener(flash.events.HTTPStatusEvent.HTTP_STATUS, onStatus);

With proxyTrace and a lot of googling I came to this explanation (ctf+F for 403) and solution.

<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>

It works. I also made the admin part for FotoLOAD midi and this is the screenshot:

fotoload admin

I have written this so someone else with this problem might find it quicker than I did.

Predavanje na dnevu iger v FERI Maribor

Friday, May 16th, 2008

Včeraj je bil Dan Iger na FERI v Mariboru. Predavalnica je bila skoraj polna in vzdušje je bilo super. No, rekel sem da bom objavil predstavitev online:

Priporočam vam da malo po-googlate in preskusite kakšen demo igre ki jih naštevam, kakšen “engine” ali pa si pač ogledate kakšnega razvijalca…

Rekel sem tudi da bom objavil linke do mojih iger in cel intervju z Andyjem (saj dosti ga tuki ne manjka).. To bom naredu danes zvečer ali jutri dopoldne. Kr neki linkov do mojih iger pa lahko najdete na Janko’s “products”. Rekel sem da ne delam samo iger za otroke, nekaj takega je WATERISK samo na njem še delam..

This is the presentation from talk at “Day of games” about indie game development at FERI faculty in Maribor.