my presentation at devworld – video footage

Posted in javascript on July 16th, 2009 by gmunteanu

the guys from acumlive.ro have archive of their transmissions and i found the devworld here:
http://acumlive.ro/arhiva.php?event=71 , you can see me starting with minute 76:00.

altctrl 0.8.1 – esal bug fix

Posted in javascript on May 30th, 2009 by gmunteanu

esal big prices were in the format DD DDD.DD [D = figure] , all the others have DD.DDD.DD or DD,DDD.DD . spotted it watching the stats page, and esal had prices such as .1 ron, or 0.2 ron. now this is fixed. good to know that the update from 0.8 to 0.8.1 happened automatically [2 friends confirmed], so that is tested too.

now i continue, as previously said in the 0.8 post, with the unit tests [i am sure it will save me in the future] , and amazon.back to work.

altctrl 0.8

Posted in javascript on May 27th, 2009 by gmunteanu

as this extension started to be used by many other people i don’t know , making it easy updatable through the firefox system was mandatory. there are still many people using old versions of my extension [mozilla statistics show me there are people using even 0.3 version]. i urge you all to move to 0.8. it is my fault, not thinking of this before, but now it is here. so, if you want to keep updated with the latest, and have bugs fixed easily, uninstall your altctrl version now, and move to 0.8 .

you can get it here: altctrl.e-forum.ro

new things in this version:

  1. preferences, with a right click you can get the possibility to disable some of the stores you don’t like.
  2. the stores are now ordered starting with the lowest price.
  3. you can see products that are searched for here: altctrl.e-forum.ro/stats.php

good. for the next version there will be amazon and ebay added, plus more .ro stores, also i am developing a unit test system so i can easily find bugs and errors.

i will also be present tomorrow morning at opencoffee.ro where i will present the extension to some people. if you want to join, you cand find detailed info on their website.

altctrl – after devworld

Posted in javascript on May 13th, 2009 by gmunteanu

i received a lot of feedback after presenting altctrl at http://devworld.ro . acting upon it will take some time. in the meantime i list here my priorities for it:

1. make the updates of the extension work. as all of you know, updates through mozilla,org website doesn’t work as it is still listed as experimental due to lack of reviews, so i will host the extension myself and make it updatable. i need https  and run sha1 on it, so i guess i will move it to its own domain [https://altctrl.e-forum.ro most probably].

2. add preferences. this is related to the fact that some users have a set of preferred shops and they do not want to search for prices at the other shops. also it is good because the list of supported online shops will grow and maybe users won’t like to search for all anyway.

3. the results will be ordered by price in ascending order.

4. the product that is searched for will be twitted anonymously on my account [jgabios] untill i find a better one  , i see altctrl is taken on twitter . i am new to twitter and “i haven’t absorbed that yet [cusack on high fidelity]“. i also think i will make a web page where you can see what people are shopping for.

many other things will come, for now it is enough. back to work.

altctrl 0.7

Posted in javascript on April 29th, 2009 by gmunteanu

in this version [update: latest here], you can be on any page, and if you see the product model number, you can select it, right click, and click on the ALTCTRL item. it will search for the prices on the romanian stores.

also, now i have separated the data from the main code, and it is downloaded from my domain e-forum.ro, evaledinsandbox, and processed. this way, if i add another store, you won’t need to download the extension again. below you can see a screenshot of it in action.

also, some minor bug fixes, especially for esal. good, back to work.

altctrl 0.6

Posted in javascript on April 24th, 2009 by gmunteanu

UPDATE: if you took it from mozilla website, updates won’t work, you should manually uninstall it and install it again from https://addons.mozilla.org/en-US/firefox/addon/11290.altctrl is still experimental addon, and it needs reviews on the mozilla website in order to go to public state. so if you like it, you can add some review there. [11 have 0.3, 8 have 0.4, 12 have 0.5] and now comes 0.6 version. so please mind this detail when installing.

version 0.6.

you can get the latest here [update: latest here], or you can wait to get it through the addons.mozzila.com website on monday i hope.

done:

  1. added esal.ro
  2. added newegg reviews

to do:
1. sort the rows so that cheapest is at the top, and the not found ones at the bottom
2. fix errors with escape url characters like space and others, especially for esal.
3. add sigmanet.ro
4. move from vbox to XHR, but i doubt it will work.
5. improve caching on the server.
6. make the anonymously cached product info available on a website.
7. move store specific data from client to server, and make it updatable in the xpi.

altctrl detailed description

Posted in javascript on April 3rd, 2009 by gmunteanu

UPDATE: if you took it from mozilla website, updates won’t work, you should manually uninstall it and install it again from https://addons.mozilla.org/en-US/firefox/addon/11290.altctrl is still experimental addon, and it needs reviews on the mozilla website in order to go to public state. so if you like it, you can add some review there.

so, you want to get the best deal on products from romanian online stores. install the extension from the link shown in the previous post, and then the magic happens.

User guide: after you install it, there should be a statusItem at the right bottom of firefox , on the status bar. it should read altctrl. go to any of the 5 .ro online stores, and get to a product detailed page. then if you are not happy with the price, or you just want to check the other prices, click on the altctrl statusItem, and a popup will appear. it will go to the other stores and get the prices if it finds them. if not, “##” is shown. if an error occurs “**” occurs. The color of the row where each store is shown also has a meaning: green for “in stock” and red/brown for “out of stock”. if you wait too much for a store to show the price, you can cancel it from the right-most button.

Hacker guide: the internal of the extension is  simple. in a XUL iframe, i placed 5 browser objects with images and js disabled. upon click event, the product code on the page is taken , and a search is initiated on the other websites in the browsers we have already. the result pages is parsed with Sizzle and shown in the popup. in order not to stress the store web servers too much i also cache the results on my server at http://www.e-forum.ro:8080/altctrl . more info you can get by studying the code. it is released as gnu-gpl version 3. have fun!

firefox extension for comparing prices for romanian online stores

Posted in java, javascript on December 24th, 2008 by gmunteanu

UPDATE: if you took it from mozilla website, updates won’t work, you should manually uninstall it and install it again from https://addons.mozilla.org/en-US/firefox/addon/11290.altctrl is still experimental addon, and it needs reviews on the mozilla website in order to go to public state. so if you like it, you can add some review there.

you can take it from here:

altCtrl [if you have mozilla account] or from my server here [update: latest here]

info: i have included 4 ,5 stores untill now: emag.ro,pcgarage.ro, evomag.ro, marketonline.ro, dc-shop.ro  , more will come as time permits. after you install it, you go to a store, browse to a product page, and click on altctrl statusBarItem you see on the right of your status bar. a div will appear with the prices from the other stores. if the row is green, then the product is available, red means otherwise. it is still in alpha stage, but it is usable. anyway nobody reads this blog , and i will tell only my friends about this post, so this release should be called friendly beta.

enjoy and save some money with this economic crisis .

bomberman javascript multiplayer

Posted in javascript on October 22nd, 2008 by gmunteanu

this post is a documentation briefing about the project that runs here:
http://www.e-forum.ro:8080/dynagame/index

In order to provide the platform for users to play against users bomberman online, we have to :
1. create the possibility that a user can create a game, or join a game created by others
2. we must let the user choose the variant of the game he wants to play, or let him customize the game
3. the game can be customized in different ways: max number of players, filter the users that can play the game, arrangement of the rocks , with or without monsters, time limit or not, with powerups or not, etc …

Architecture::
we have a GamesContainer that hold all the games.
when a user cretes a game, you add it to the GamesContainer.
you can retrieve a game from it by providing the id of the game.
you can also obtain a list of all games on the server.
a game is represented by the Game class.
it has an id, which is a number autogenerated, and incremented by 1 , and starts from 1 upon every restart of the servlet container.
a game has a status, it has a creator, players, viewers.
it also has a map, with rocks and walls, and powerups, and monsters.
the game class must be able to transmit that to the browser, so that the js code can paint the map.

Communication done to assure the game can be played by users across the internet.
the philosophy:
the first client sends a request to the server in order to create the game.
then, the other players will just join the game, so their first request will be to join the game.
this is done by providing 2 links:
1. create new game and
2: a page with all active games existing on the server and a small status on those games: how many number of players are in that game.
upon first request they must tell the server the following info:
- username
- gameid : null if the game is to be created, or an int X the gameid already existing on the server.
- in case game is to be created, properties of the game are to be sent if the user wants to customize the game
- number of cols and rows, monsters yes or no, powerups yes or no, etc … , arrangement of fake walls
The server does the following upon getting the initial request:
- it locates the game / creates a new one
- adds a new player to the game -
it positions the new player so that in doesn’t stands on a wall, and safely away from the other players.
The server responds upon initial request with: – the game arrangement: walls, powerups, players’ positions and attributes, etc…


Game ideas:
1. a game map huge, where anybody can join and kill other real players.
2. players can team up, and teams can play against players or other teams.
Technical observations:
1. the http header the browser and the server are sending must be reduced drastically, in order to have a packet sent through the wire as small as possible, like in the tcp socket based games.
2. there will be 2 connections: one long polling connection , that will wait for the server to send some info based on an event generated by the other players and another one that will go with a request to the server informing that this player just generated an event. the events here are 6, all keyboard type:
4 arrows [keydown event]
keyup event [meaning stop any movement]
and space – bomb launch.
these key events generate game events and act on the character and through the server on the character on the other web pages related to this game.
3. the client code will adjust the positions of the other players and other state variables [fakewall destroyed, speed increased for player X] according to the server. the server sends state [ex: x,y of players] + the state counter, and the client game takes that info into account if and only if server state counter > last server state counter applied. the real process should be like this: any client page, has a game with 1 character [its hero] controlled by the user and X other characters controlled by the server [actually other players]. the code on this page is master reference for the hero, and the server listens to this code about the hero; and the other code on other client’s pages listen to the server about this hero state. the game running on every page has a stateCounter, and the server game object has one too. when an user generates an event , the eventCode [ keyCode in my implementation] is sent to the server + the hero’s state [x,y for now]. this info, generates an event on the server, and all other requests that are suspended by jetty’s continuation mechanism are resumed, and the hero’s info is sent to the other players’ browsers. this way , the eventCode reaches all web pages linked to the game, and the js code takes care of acting on characters. if the state is not the same as the one on the server, then the js code adjust it. this usually happens not only because of network delays but mainly by the fact that setInterval doesn’t execute the same on all machines , unfortunately.
4. when one sends messages too fast [fast arrows changing in the game] , the others do not have time to reconnect to get subsequent messages. for this, a stack of events for these things will be created on the server, and the whole series of events gets sent upon reconnection of the interested parts.

my first gnu/gpl project – a game in javascript

Posted in javascript on July 4th, 2008 by gmunteanu

it is a clone of bomberman, or dyna blaster if you know the game by that name and you can find the latest developments here:
http://code.google.com/p/js-blaster/

i welcome members that can help me make this game return in glory :) .