Monday, December 29, 2008

Lumines Mobile

Enough with programming, let's talk about games, one of my favorites is the Lumines, i do have the mobile version, that is in game play very similar to other versions (basically just lacks some musics and the time bar doesn't change speed within the same music) This game is very similar to tetris, but adds some tricks that make it one of the best arcade games ever invented. Mobile version has several modes: Arcade (with easy, medium and hard), Challenge ( beat 999.999 points), vs. CPU (the last guy is quite hard), Single Skin (one music, one skin - gets boring after a while), Time Attack (make more in less time), Puzzle (make some shapes on screen - mobile version has only a few), Shuffle (pretty much challenge but in a random fashion). I also made a version for TI-89 (a long, LONG time ago - i kept it on one of my backups), is kinda simple and lacks a menu... but works... Now... about hi-scores >:D ... i wonder if someone who has this game can beat mine:
  • I have gold in all arcade levels... so i'll just skip the score of arcade (heck that would made the list quite long)
  • I have the 999.999 in challenge mode (several times actually - in PSP/PS2 this would have an extra 9)
  • I have 81 Blocks in 90 secs, 132 in 180, 230 in 300 and 432 in 600 for time attack mode... this is the mode i play now that i beat the game.
I think this will make a nice challenge for the ones who have the game on mobile phone (or even in PSP or PS2) and finished it already... I think this is my last post this year, soo ... happy new year! ;p

Saturday, December 20, 2008

JS, Base64, png's...

And now for something totally diferent: PNG JS Encoder Have fun >:D PS: Sorry if this makes you're browser crash .... it's supposed to run well on any decent browser and to show an color pick like image....

Friday, December 19, 2008

Exaustion...

So... i just delivered my assignment... i lost 3 weeks to nothing i guess... is just like a huge amount of code that does a lot of stuff in background, but it does little to be shown to user, so my guess is that i'll have a negative grade or something - teachers usually only look to the interface - go figure... Oh! And teacher requested us to do an webpage to show the work we have done... yeah... he can go to a certain place i know if he thinks we have time to do it.... Well, even if teacher allow to proceed the development in case of negative grade i won't do it, cos i simple have no time: i have to finish another work 'till 10th january (this includes a report and quite some code) and to study to finals (2 classes), not to forget my thesis (that is barelly started), so.... i'll just forget the pratical side of this class, and just study for the finals and do the other work. Yeah.. while unlikely, i'm angry and exausted both physically and mentally... so sorry if my english is not the best .... and sorry for rant about this ... but is better than yell it out loud.... That's all.... i'll just take some - very long - vacations over .NET and C#... now ... i only look to VHDL, C and javascript - they are like my puppies x3, VHDL to have stuff done in hardware, C to do just the stuff i like for most of the stuff, and JS to prototype algorithms or just mess around with browsers... >__>'' good old times.... Damn! I can't even draw now... my tablet is dead and i don't think i'll get a new one so soon.... *sigh* sorry again for the rant... bare with me while i yell at my problems ...

Wednesday, December 17, 2008

Working with .NET again

If you want a little piano for your Windows Mobile PDA you can get it here (copy-paste to install - works on WM2003 and later), it was made as a test for my sound control class, enjoy ;p Sorry for the 'bad' piano tones (it looks more like a guitar) but i didn't have time to mess with audacity and get a nice tone ... Well ... nothing else to report for now.... *goes back to work* PS: Well... today is my birthday... tsh ... i'm getting too old...

Thursday, December 11, 2008

C# a quanto obrigas...

Sim, claro ... após 600 linhas de codigo para fazer um servidor não há muito que possa estar mal além de uns typos ... certo? .... errado... estaria certo se estivesse a falar de C .... o velhinho C .... mas com o C# aquilo que parecia estar certo pode estar errado ... muito errado... (e de notar que este problema aqui descrito nem foi o pior ... apenas o mais simples de entender). Vejamos como exemplo o seguinte pedaço de codigo: foreach (ClientInfo client in clientList) { if (clientSocket == client.socket) { client.state = ClientInfo.State.READY; } if (client.state == ClientInfo.State.READY) { msgToSend.current++; } } onde clientList é um ArrayList da struct ClientInfo (podia ser um List mas havia problemas semelhantes, mesmo tentando com clientList[index].state).... e onde está o problema? simples, dentro de um foreach podem apenas ler .... yep .... aprendi isso da pior forma.... ou seja, após ter finalizado toda a implementação e testado tudo o resto ... eu definitivamente não me dou bem com OO... Parece que não fui o unico (mais detalhado)... >.< ... bem problema resolvido ... struct pra class ... hora de implementar o cliente ... (definitivamente não vou acabar isto a horas)

Wednesday, December 10, 2008

.NET Framework

While the development of the application for CM classes has stalled due to extreme complexity, i did not stop searching solutions to simplify the application (i don't think i'll finnish the application on time anyway). Regarding network comunication using .NET Framework i found two very nice samples that may provide some help, i share my findings here with you. I hope to post my own solution in the future (or just failing epically as i usually do in high-level languages). Samples are both in C#. Links: A Chat Application Using Asynchronous TCP Sockets A Chat Application Using Asynchronous UDP sockets

Tuesday, December 9, 2008

Firefox 3: Add-ons

O firefox tem milhares de add-ons disponiveis, alguns são lixo, mas outros são insubstituiveis, assim deixo aqui a minha lista de add-ons favoritos, alguns deles já mencionados anteriormente, deixo também umas dicas de utilização deles:
  • Downthemall (leia-se down them all e não down the mall) - gestor de downloads, permite aceleração através de multi-part até 10 ligações (pode acelerar até uma maximo teorico de 10x). Permite ainda criar batches de downloads, fazendo a tarefa de tirar ficheiros numerados algo trivial.
  • Firebug (e FireCookie) - Indispensavel para quem desenvolve paginas relativamente complexas, permite debug e alteração do HTML DOM, visualização dos pedidos HTML GET e POST (e com isso é possivel ver os links para os ficheiros de video usados nas aplicações flash - aka.: youtube - ou chamadas de XML de aplicações AJAX), possui ainda uma consola onde é possivel correr comandos JS, e permite a edição de HTML, CSS e script de uma pagina carregada, em conjunto com o firecookie permite ainda a rapida visualização dos cookies de uma pagina.
  • GreaseMonkey - Se o firebug é optimo para ver tudo o que uma pagina tem, o greasemonkey é optimo para alterar de forma automatica tudo o que uma pagina tem. Permite a utilização de scripts em JS para editar o conteudo de paginas carregadas, alterar estilos, adicionar informação, automatizar tarefas, tudo é possivel com este add-on.
  • Classic Compact Theme e Classic Compact Options - Para quem quer o máximo de area disponivel sem sacrificar a usabilidade, a interface superior do meu firefox ocupa apenas 41 pixeis com o menu ficheiro e menu de tabs incluidos, mais 17 pixeis para a barra de estado, o que significa uma area util de 1280x727 para visualização da pagina no meu portatil com um ecrã de 1280x800 - batendo assim o google chrome (1276x722)!
Existem outros add-ons que são bastante uteis, o Ad Block Plus, é um a destacar, mas como as paginas que visito raramente têm pop-ups ou ads intrusivos optei por não usa-lo (ele 'papa' um bocado o cpu quando uma pagina carrega).

Sunday, December 7, 2008

Blog layout

I really hate doing layouts... but i did it because my posts are a bit ..... freaking huge sometimes... well, the sidebar is off-screen in IE7 so bare with it - or just use Firefox, Opera, Safari, Konqueror or Chrome that works properly. Yep IE is nasty... but that you should knew it already...

Opera 10

*stares* http://www.opera.com/browser/next/

DataSet.WriteXml

Let's talk about .NET Framework (Compact Framework to be more specific) .... again... After spent several hours trying to put my XML file control class to work properly i finnally had some success. When i saw the methods WriteXml and ReadXml for DataSet object i said to myself: "Zeca take a note here... this is pretty usefull!"... only for after a few minutes of coding bash to find out that it didn't quite work like i wanted... things is quite simple to be explained, at least the problem, i check if file exists (Sistem.IO.File.Exists(filepath) - or similar), if not, create a new one with default data on it, then return the data, if file exists, use ReadXML on DataSet and get the data... well ... this works pretty well, ok, now i loaded data into some forms (a settings form) then modify some and exit the form to main menu, when i exit i store the changes on DataSet, and do a WriteXml at the end, simple right? Well it works .... until you do the drill a second time.... it reads correctly, it calls WriteXml at exit, it seems to save the changes .... but it doesn't! Now my solution: Don't use the same DataSet! Create a new one, and yes i tried commitChanges methods before trying this solution... in the end this was the only thing that work. I don't know why this happens, anyway it could be a file open mode problem - when reading the information the file is openned in read mode, and later when writing on it, DataSet.WriteXML uses the same file handler to do the job... failing silently... If anyone had the same problem or know what i was/am doing wrong please fell free to comment it out. Thanks in advance. PS: I really start to hate ALL object oriented languages - not all object-able languages

Saturday, December 6, 2008

Blogging and organization...

In the next minutes i'll be organizing my tags on blog post, so that you can find stuff easier (like you ever need that) PS: A visit from Brazil in my blog? That was trully unexpected... =3

.NET Compact Framework experiences

Today i made my first custom control for .NET Compact Framework, nothing too fancy and mostly was copy-paste from msdn website. Well, it does the job and is compatible with Visual Studio interactive designer (that was the tricky part actually). A few days ago i made some experiences with sound on managed code, i found out an awsome class for playing .wav files, the API is just amazingly simple. System.Media.SoundPlay is it's name, you can find all info about it on msdn library, it allows syncronous or assyncronous playback of .wav files, but please remember that .wav files must be encoded in PCM and that big .wav files means huge resources being allocated, so don't just put that 10min studio quality audio pcm file and expect the handheld to be all fine, but is quite useful for little sound effects. Adding to that i adapted a class i found on the internet to manage XML files in such a way that can make them behave as small databases for persistency on the device.

Wednesday, December 3, 2008

Xmas list.... right...

Well... i know i'll never get those ... but since i hope to finish my studies and get a job on this next summer (thinking too ahead i know >__>''), i can start by making a list to where my savings should go (hoping some generous soul that won the lottery has nothing to do to the money - right....)... well here it goes - some of the stuff is not even available yet:
  • Nokia 5800 XpressMusic (i could ask for a N97... but is too heavy and expensive)
  • Sony Alpha 350k (i'm not being greedy ... really!)
  • Sony HDR-SR11E (i could ask for more ... but this is just overkill already)
  • Samsung SyncMaster 2233SW (i could use one to replace my old CRT)
  • Intuos3 A5 Wide USB "Special Edition"
  • Pandora Handheld (this one gonna be VERY tricky to get)
  • Some free time... to use all the suff above =3
So ... anyone with a heavy felling in the pocket? I know, i know: "Keep dreaming...". Note: please keep in mind that this was done just because i was bored and lacking sleepiness at 5h00 am