I was trying to get a matrix for a projection of any point to a line given by the following equotations:
After some time of research I’ve ended with the following result:
Let then
Of course the result isn’t new at all, it was just a big efford for me to do that at midnight – so I guess it may be worth saving it here.
Filed under: Mathematics, Problems, Science, Theory | Leave a Comment
Tags: 3d, algebra, line, math, matrix, point, projection
Assembler programming NO. 1

This post is meant to be a short introduction to a new science branch on my blog dedicated programming in Assembler.
One can think that the use of Assembler is deprecated these days, but there are still many reasons for a computer scientist to know this low-level language.
The primary reason to program in assembly language, as opposed to an available high-level language, is that the speed or size of a program is critically important.
For example, consider a computer that controls a piece of machinery, such as a car’s brakes. A computer that is incorporated in another device, such as a car, is called an embedded computer. This type of computer needs to respond rapidly and predictably to events in the outside world. Because a compiler introduces uncertainty about the time cost of operations, programmers may find it difficult to ensure that a high-level language program responds within a definite time interval—say, 1 millisecond after a sensor detects that a tire is skidding. An assembly language programmer, on the other hand, has tight control over which instructions execute. In addition, in embedded applications, reducing a program’s size, so that it fits in fewer memory chips, reduces the cost of the embedded computer.
Here is a picture illustrating the converting process for both high and low level languages.

Source for further reading: http://pages.cs.wisc.edu/~larus/HP_AppA.pdf
Filed under: Assembler, Informatics, Science | 2 Comments
Tags: Assembler, mips, Programming
Today, I noticed an amazing and worth memorizing thing. I turns out that fibbonacci series shows up also in graph theory in one of the simplest graphs:

Where’s Fibbonacci hiden here? Well, the graph can be represented as a folowing matrix:
By multiplying the matrix by itself and using induction we get:
Filed under: Mathematics, Science, Theory | 6 Comments
It’s a trick that makes posible to write polish characters on your mobile in Python editor using Nokia SU-8W. All that’s needed is PyS60 installed with appuifw2 module.
To write a polish letter press Alt Gr + Key, where Key is the usual key under which polish character is hiden.
Few things that I could not ommit – the letter “ź” is under key “q” instead of “x” and the capital letter “Ć” is under “W” instead of “C”
Use with the default “UK, US English” layout.
And here’s the pys60 code of the editor:
#Coded by Ranza from Ranza's Research
#published using GNUv3
#http://masteranza.wordpress.com
import key_codes, e32, appuifw2
app_lock=e32.Ao_lock()
def exit():
app_lock.signal()
appuifw2.app.exit_key_handler=exit
def capt(where,add):
if (add>0):
text.move(1, select=True)
#a
if (text.get_selection()[2]==u"\u00E1"):
text.cut()
text.insert(pos=where,text=u"\u0105")
#s
elif (text.get_selection()[2]==u"\u00DF"):
text.cut()
text.insert(pos=where,text=u"\u015b")
#c
elif (text.get_selection()[2]==u"\u00a9"):
text.cut()
text.insert(pos=where,text=u"\u0107")
#e
elif (text.get_selection()[2]==u"\u00e9"):
text.cut()
text.insert(pos=where,text=u"\u0119")
#l
elif (text.get_selection()[2]==u"\u00F8"):
text.cut()
text.insert(pos=where,text=u"\u0142")
#n
elif (text.get_selection()[2]==u"\u00f1"):
text.cut()
text.insert(pos=where,text=u"\u0144")
#z
elif (text.get_selection()[2]==u"\u00e6"):
text.cut()
text.insert(pos=where,text=u"\u017c")
#z`
elif (text.get_selection()[2]==u"\u00e4"):
text.cut()
text.insert(pos=where,text=u"\u017a")
#A
elif (text.get_selection()[2]==u"\u00c1"):
text.cut()
text.insert(pos=where,text=u"\u0104")
#C, tricky one
elif (text.get_selection()[2]==u"\u00C5"):
text.cut()
text.insert(pos=where,text=u"\u0106")
#E
elif (text.get_selection()[2]==u"\u00c9"):
text.cut()
text.insert(pos=where,text=u"\u0118")
#L
elif (text.get_selection()[2]==u"\u00D8"):
text.cut()
text.insert(pos=where,text=u"\u0141")
#N
elif (text.get_selection()[2]==u"\u00D1"):
text.cut()
text.insert(pos=where,text=u"\u0143")
#S
elif (text.get_selection()[2]==u"\u00a7"):
text.cut()
text.insert(pos=where,text=u"\u015a")
#Z
elif (text.get_selection()[2]==u"\u00c6"):
text.cut()
text.insert(pos=where,text=u"\u017b")
#Z`
elif (text.get_selection()[2]==u"\u00c4"):
text.cut()
text.insert(pos=where,text=u"\u0179")
text.clear_selection()
text.move(2)
text=appuifw2.Text(edit_callback=capt)
appuifw2.app.body=text
app_lock.wait()
Well this is not the best solution I’ve invented, but it’s all I could do. I’ve been searching all over internet for hours, trying things to make those characters work everywhere on the phone, but with no success.
Filed under: Informatics, Mobile, Nokia N95, Nokia N95 8GB, Nokia SU-8W, Python, Tweaks, pys60 | 1 Comment
Tags: character, layout, polish, pys60, s60, su-8w
Matrixes seem to have a lot of wonderful properties, for example they may help checking if given triangles represented each by three complex numbers (verticles) are simillar.
So, two triangles represented by complex numbers and
are similar if, and only if:
Proof coming soon.
Filed under: Science, Theory | 2 Comments
Tags: complex, det, determinant, math, numbers, similar, triangles
The beauty of Mathematics :)
True
However I would put physicists a bit nearer mathematicans
Filed under: Inspiration, Mathematics, Science | 3 Comments
God damn. I took me about a half of an hour to Google that out…
Things to do to fix Visual Studio C++ Express (Probably in most cases you don’t have to delete those entries first. (worked for me)):
- Go to Start -> All Programs -> Accessories -> Run, and type “RegEdit.exe”
- Locate the following folder/key: “HKEY_LOCAL_MACHINE\SOFTWARE\Classes\VsWizard.VsWizardEngine.9.0″
- Right click -> Permissions -> Advanced -> Owner (Should be getting alot of “No permission to do that” likely-errors)
- Click one time on “Administrators”, then click “OK”.
- Expand “VsWizard.VsWizardEngine.9.0″, Right Click CLSID and do the same. (Do that to all subfolders which is under “VsWizard.VsWizardEngine.9.0″ aswell, if any.)
- Right Click “VsWizard.VsWizardEngine.9.0″ and click “Delete”, choose yes if you get an confirmation window.
- Right Click “VsWizard.WizCombo.9.0″ and set permissions for that folder and subfolders, and delete that one too.
- If everything went fine, you shouldn’t have any folder called “VsWizard.WizCombo.9.0″ or “VsWizard.VsWizardEngine.9.0″ anymore.
- Goto: Start-> All Programs -> Accessories, Right Click “Command Promt” and click “Run as administrator”.
- Navigate to your Microsoft Visual Studio IDE folder, by using the “cd” command. (usually “cd C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE”)
- Type “RegSvr32.exe VsWizard.dll”. You should get a window telling that you’ve registered that dll file (or something like that).
- Start RegEdit.exe again (if you haven’t), and locate to “HKEY_LOCAL_MACHINE\SOFTWARE\Classes\VsWizard.VsWizardEngine.9.0″. This should have been added again.
- Right Click -> Permissions, you should see “Administrators” and “SYSTEM” or something, click them both and enable Full Control and Read.
- Do the same for subfolders (should’ve been done automatically), and then do it for “VsWizard.WizCombo.9.0″ and subfolders, which should’ve been added again.
- Close RegEdit.exe
- Start the version of visual studio you have, create a new project, and watch how it works!
uff… I hate Microsoft software…
Filed under: Informatics, Programming, Tips | 12 Comments
Tags: 2008, bug, c++, microsoft, project creation failed, solution, studio, visual, vs
This short video intends to show you shortly how to use IdeaList application and how can it simplify your daily time management.
IdeaList is completly free and open on GNU v3 licence.
Feel free to download it from:
code.google.com/p/idealist/
Mobiola Screen Capture demo (not working quite well) was used to do this video so it contains some bugs. I’ve done a lot of cut’s and a speech synthesizer was used as a voice-over, so the final result doesn’t look as it was supposed to look.
I’m currently working on Wiki pages in Google code and documentation. Some new archives should be available soon too.
However I don’t know if I will be possible to simplify the installation for s60 phones. If someone have some good knowledge about those things and would like to help, please contact me.
Filed under: IdeaList, Mobile, Nokia N95, Nokia N95 8GB, Projects, Python, pys60 | Leave a Comment
Tags: calendar, idealist, management, manager, Mobile, out, pys60, Python, quick, schedule, time
The polynomial argument is a very useful fact which can be used in order to prove, or justify a statement.
It bases on simple fact that non-zero polynomial of k degree, can have no more than k solutions, futhermore the difference of two polynomials of k degree can also have max of k solutions if only those polynomials weren’t identical, then they have infinite numbers of solutions.
So how to use that fact?
Let me show an example, with use of extended Newtons binominal for all real numbers defined as:
We will try to prove one of it’s properties using the properties of the normal binominal and the polynomial argument.
First, the folowing equality called the rule of absoption works for all real numbers :
. We will it into other form:
Next you can simply check the property of symmetry of the normal binominal isn’t extendable to our extended definition of the binomial: . However symmetry stays for all positive
values, so will call this propetry using symbol **.
Now the proper part, we’ll prove that for all real numbers
Proof:
Now probably most of people would disagree, since for proving something for all real numbers I used a property which works only for the positive integers. Well they are right, the missing part is the polynominal argument: Look at the left and right part of equotation like on a polynomial of degree then using using the property of correctness of this theorem for infinite number of arguments
, we can tell that both of this polynomials have to be identical ■
Quite clever isn’t it?
Filed under: Mathematics, Methods | Leave a Comment
Tags: absorption, argument, binominal, extended, math, newton, polynomial, proof, prove, symmetry
The proof for the limit points of the sequence haven’t given me a calm dream untill today.
Of course the limit points of that sequence (almost intuitively)
Lemma.
Lemma proof.
from floor function definition web have the following inequality:
Now we will prove that
Let where
So we have
Let
so of course
Lets consider
and look closer at
The following is true
It’s also simple to show (for example geometricly), that we can find such that the following inequality is satisfied
Now we will consider
From which
And that means that for all so
■
Proof.
We’ll show that
Lets take where
and
Then ( because the step is smaller then the range)
So when’ll take then
which satisfies the limit definition. ■
Filed under: Mathematics, Science | Leave a Comment
Tags: limit, points, sequence, sin, sin n, sinn
Project NO. 2 : IdeaList

I would like to announce that my second PyS60 project called IdeaList is near it’s first alpha release!
Today I’ve done another milestone in it’s developement and I decided to no longer keep the project secret.
So what does IdeaList do? Why did I create it?
Simply because I believe that there’s nothing more precious than time.
Do you remember the default Nokia calendar? The awful times when you’ve got to correct there something quickly, but it took minutes instead of seconds?
Do you remember the times when you’ve had a terrific idea and you’ve noted it somewhere on your phone, but then you forgot about it?
Idealist was designed to be a solution for those problems!
So how does the IdeaList differ from other time management applications?
- IdeaList is the first mobile non-colision day planner! That means the end with overlaping tasks and appointments
- IdeaList interface is done using a timeline conception, that means that you see what takes at most of your time
- Every event in IdeaList holds a referer to a todolist! That means that you can simply checkout your project milestones by entering an event todolist, called an IdeaBox
- Every event can be stretched and moved over days visually! No need to enter exact time!
- IdeaList allows you to note your Ideas by pressing just one key!
- Idealist analyzes the day and helps you entering your idea into the calendar, by highlighting the free spaces
It’s hard to explain all that it can do and how simple it is, so in few weeks I’ll add some Video demo’s how it works.
Other features:
- Scheduled sms sending
- Visual Reminders
- Two move modes
- The background gradient changes dynamicly every hour, so it becomes darker at night and lighter in the day
- Events and Ideas are sort by categories
- Every category has it’s own color which can be adjusted by the user
- Minimalistic signal and battery indicators
- Easy key shortcuts
- ….
However still there are some small things to do…
Like:
- Showing the new message alerts
- Saving the config file
- App Icon
- Beta testing on different phones
- Sis packing and signing
and of course optimalization, which takes the most of my time right now.
Filed under: IdeaList, Informatics, Mobile, Nokia N95, Nokia N95 8GB, Programming, Projects, Python, Science, pys60 | 9 Comments
Tags: calendar, handy, idealist, manager, managment, n85, n91, n95, n95 8gb, n96, project, pys60, quick, symbian, time
Method NO. 3 : Neat Integral
Today, I decided to post a very eye-catching method for calculating an integral which shows very often in Statistical Mechanics in Physics.
Let’s try to calc this
First let’s mark it with a name , then
What is just a double integral over the whole 2d surface. It can be also written in polar coordinate system as
What means that
Filed under: Mathematics, Methods | 7 Comments
Tags: coordinate, integral, math, method, pi, polar
Google Chrome for Linux w/o Wine
It’s all I wish for now.
I stopped using Firefox, only thing in which ff was better was my del.icio.us bookmarks integration plugin.
Looking forward with esperanza.
This post will be destructed when my dream will come true.
Filed under: Journal, Personal | Leave a Comment
Tags: browser, chrome, google, revolution, wine
After some trubles in doing dual boot and isntaling Fedora I decided to write this post so that other users won’t waste so much time as I did.
Firstly if you wan’t to have your remote control working on your XPS you don’t have to install Media Direct!
What’s more your remote will work on your Fedora as well!
So the biggest mistake you can do while reinstalling your system is to install the SHITY MEDIA DIRECT SOFTWARE!… but do not throw away the Media Direct Cd, we will need it later
Here is how my installation process looked like.
- Install Windows (I have Vista 32 bit- however I’m angry for dell for not allowing to choose the 64 bit edition)
- While installing drivers try always do a restart after installing each driver!
- Start installation Fedora 9 64 bit
- Install it on a primary partition and make a SWAP partition at least the size of your RAM memory, keep on track on which partition the windows is and where linux is being installed. For example if you’ve got windows on hda/sda2 then your partition number is 2. Write does down.
- When you’ve got the Time Setup popup uncheck the “My system has UTC time” option
- While installing grub choose an advanced option to install it on the partition that you have linux, DO NOT CHANGE MASTER BOOT RECORD
- Once you’ve installed Linux go to Windows (You will not be able to boot Linux yet), put the Media Direct CD in your CD Drive but do not install or run it, instead run the cmd.exe on Admin rights and type: X:\DellKit\rmbr.exe DELL Y Z where X is your Cd drive letter, Y the Windows partition number and Z the Linux partition number.
- Boot from the Media Direct Button – Linux should start
- Install all the updates for your system.
- While rebooting you can have an ISSUE 1. and get the system hanged on displaing message “Decompress Linux Done. Booting the Kernel.”. to solve change the kernel argument from quiet to verbose at GRUB. Should work now
- The Ethernet, wifi and sound should work, except the sound is set to Headphones output – try it.
- Install the nvidia drivers.Go to http://rpm.livna.org/rlowiki/ and install livna repository rpm for Fedora 9.
- Type yum install kmod-nvidia in console at root privileges.
- Restart. Adjust your settings using nvidia-settings. You can turn on Desktop Effects now if you want
ISSUE 2. Sometimes the selection rectangle on the desktop is running slow – try reenabling destkop effects. - Installing 32 bit flash player on Firefox 64 bit – download a normal rpm at adobe.com and after installing it run console at root rights and type: yum install nspluginwrapper.{i386,x86_64} libflashsupport.i386
- Now flash player should be working properly.
I will write more about installing hardware later. Currently I’m trying to change the shity media direct logo while booting Fedora.
Filed under: Dell XPS M1530, Informatics, Mobile, Science, Tweaks | 13 Comments
Tags: 32, 64, 9, booting the kernel, browser, dell, error, fedora, firefox, flash, install, installing, issue kernel, kmod-nvidia, livna, m1530, nspluginwrapper, nvidia, quiet, support, tweak, verbose, vista, xps, yum
Modeling
- I’ve measured all my furniture and I constructed it using simple boxes and cylinders objects
- Details on window frame, such as the pull
Materials
- There are two things i can be glad off, the rest is shit.
- First: the furniture glossy background. However I didn’t see the final render (I’m doing the render while writting this)
- Second the glossy handle of the window
Lights
- mr Sky Portal Settings: filter set to dark grey in order make some normal view outside the window
Rendering
- mr Photographic Exposure Control: changed preset to Daylight Indoor
- Final Gather Settings: In the main render bounces increased to 5, Image Precision: High, Final Gather Precision: High, in other renders everything is set to low with bounces 0.
Corrects
- The window handling added to the window
Notes
- I’ve got a lot of problems in applying a proper texture such that my table doesn’t get too much highlights
- I noticed that more glossy promaterials rather than the unfinished one don’t get completly white when directing a lighting on it, so all my furniture was set to glossy even if it’s not so glossy at all in real.
- To sum up, 3ds max is great for modelling things, however when it comes to materials the issue is fimiliar to building a computer from home made parts… (materials editor in 3ds max = shit)
- It took me 7 hours to render the main scene… Moreover vista user control and system update screwed my 3dsmax a couple of time… (mad)
Open for comments and suggestions.
Filed under: 3dsmax, Informatics, Science, Visualization | 1 Comment
Tags: 3d, 3dsmax, design, materials, max, mental ray, room, studio, Visualization, viz

It’s high time to support my physics by computers. Today I experimented with Newton’s Law of Gravitation for 3D and as far as it goes to one object it works great. However I didn’t managed to apply the force to the second object (The Sun).The movie which you can see above is a gif, cause of WordPress politics… The original animation looks much better.
Here’s my source code:
/* NEWTON'S GRAVITATION v. 0.1
The rule that makes the day and night
F = GMm/r^2
Two movieclips one called "planet" and the second called "sun" both should be exported for AS2
To get the best results get "planet" and the "sun" to the center of the movieclip
To make the planet move in third dimension I used the scale trick and I combine it with the Newton's formula.
Well we all know that Newton laws are symmetrical, so that the sun should also move a little, but I had no luck adjusting the params so I excluded it.
coder: Ranza
web: http://masteranza.wordpress.com
time: 00:26:31
*/
var sun:MovieClip = _root.attachMovie("sun","sun",1);
sun._x = Stage.width /2;
sun._y = Stage.height /2;
sun.mass = 20;
var planet:MovieClip = _root.attachMovie("planet","planet",2);
planet.Yspeed = -0.5;
planet.Xspeed = -0.1;
planet.Zspeed = -0.2;
planet.mass = 5;
planet._x = Stage.width /5;
planet._y = Stage.height /2;
planet.onEnterFrame = _root.PlanetPhysics;
function PlanetPhysics(){
//Never mind about the G
the speed is just for fun
sqrdistance = Math.pow(this._x-sun._x,2) + Math.pow(this._y - sun._y ,2) + Math.pow((100 - this._xscale),2);
this.Xacc = ((sun._x - this._x)/Math.sqrt(sqrdistance)) * this.mass * sun.mass / sqrdistance;
this.Yacc = ((sun._y - this._y )/Math.sqrt(sqrdistance)) * this.mass * sun.mass / sqrdistance;
this.Zacc = ((100 - this._xscale)/Math.sqrt(sqrdistance)) * this.mass * sun.mass / sqrdistance;
this.Xspeed += this.Xacc;
this.Yspeed += this.Yacc;
this.Zspeed += this.Zacc;
this._x += this.Xspeed;
this._y += this.Yspeed;
this._alpha = this._xscale = this._yscale += this.Zspeed ;
//The objects which are closer have to be on top
if (this._xscale > 100){
this.swapDepths(2);
}
else{
this.swapDepths(1);
}
}
By the way, I’ve invented a logo, shortly I will explain it’s symbolic meanings.
Filed under: AS2, Informatics, Physics, Programming, Science | Leave a Comment
Tags: as2, flash, gravitation, gravitational, law, newton, Physics
Writing everything on this blog has a lot of positive sights. Firstly I can easily and quickly find any information that I need, due to excellent tag system. I don’t have to worry (at least I believe so
) about the safety of my data, cause there are not in my drawer or even hard drive. Furthermore those data can be useful for someone who is reading my blog (is there anybody?
) and is interested in the topic…
Playing around with 3dsmax last days (and waiting long for the renders
) I decided to document the progress of my work.
Everything started from an urge to project a char handler which would carry my phone… I tried autoCAD, but it seemed to much effort to learn it and then I reminded myself that I’ve been experimenting with 3d studio max from my early childhood. When I turned 3dsmax again I felt so fascinated with its possibilities that I instantly changed my mind – I decided to do the whole my room in it.
Yes, I’m a beginner I’ve never tried to do realistic scenes before, but I’ve got time (lots of time since I’ve injured my leg unluckily), so don’t get my work too serious.
In all parts of this article I will try to use the same scheme to keep it clear. They will all start from a few pictures of the room from different angles with a short labels what I wanted to show.
Secondly it will contain a few categories, such as Modeling, Materials, Lights, Rendering and Corrects in which I will sum up my progress, on the end of each I will probably write some Notes… Let’s Blast Off!
Modeling
- I’ve measured my room walls and done a accurate model of them with a cut’s in places where the wall color changes.
- Window frame (A handle is still missing)
- Window sill
Materials
- I think that I’ve done the walls good enough, I mean that the color fits the original one and floor material too. However I can’t stop the wall from reflecting the color of the floor.
- Temporary I’ve assigned a material to the sill and to the window frame.
- I used the Max default ProMaterials, adjusting a little preferences mainly by enabling the Stain Application and changing the default texture.
Lights
- I used Max’s Daylight System and allowed him to enable Final Gather. I created also a mr Sky Portal on the window’s glass surface. The compass was set as in my real location and the time was switched to 12:17 13.08.2008
- mr Sun Settings: default
- mr Sky Portal Settings: increased Multipler to 1,5 and Shadow Samples to 64
Rendering
- Exposure Control: changed to mr Photographic Exposure Control
- mr Photographic Exposure Control: Exposure Value (EV) changed to 10,5
- Final Gather Settings: Bounces increased to 5, Image Precision: Medium, Final Gather Precision: Low
Corrects
- I’ve put all things in separate layers like furniture, lightning, walls etc..
Notes
- I enabled the viewport background to see the the lightning changes directly in viewport.
- There’s still 99% of work before me… I think that the biggest problem will be to do the proper materials and maps for my models. I wished to apply here some automatics too, for example to make a bed that changes to a sofa as I have in my room.
- I don’t render the scene at full settings cause there not much done yet so i don’t want to waste to much time. However the rendering of the Interior took me 17 minutes :]
Open for comments and suggestions.
Filed under: 3dsmax, Informatics, Visualization | 3 Comments
Tags: 3d, 3dsmax, architecture, lightning, materials, max, project, ranza, rendering, room, studio, Visualization, walls, window
Wires are the real scourge of our times and I suppose that everybody look at them with disgust, but is there any good substitute for them?
The answer is Blutooth 2.0. If you’re curious if it really does the job, read this article.
Filed under: Brands Prestige, Hardware Review, Mobile, Nokia BH-503, Nokia SU-8W | 35 Comments
Tags: 503, bh, bh-503, hardware, headphones, nokia, review
If you are about to buy a notebook computer this post can become helpful for you, because it’s about one of sleekest and fastest machines available in shops*.
I decided to write this review because the one that I read on the Internet doesn’t go over the reality test.
Specification:
-
Processor: Intel Core 2 Duo Processor T8300 (2.4 GHz, 3 MB L2 cache, 800 MHz FSB)
-
RAM Memory: 3 GB DDR 2 (667mhz)
-
HDD: 320 GB (7200 rpm)
- Graphics Card: NVIDIA GeForceTM 8600M GT 256MB DDR3
- Disc Drive: Nagrywarka DVD DUAL 8x Slim
- Screen: 15.4″ Wide Screen (1280 x 800)TrueLifeTM
- Operating system: Microsoft Windows Windows VISTA Ultimate
- Ethernet | wifi: LAN 10/100 MB | 802.11 n
- Others: remote, HDMI, FireWire
First impresion.
Filed under: Brand Support, Brands Prestige, Dell XPS M1530, Hardware Review, Mobile | 5 Comments
Tags: bioshock, bluetooth, computer, dell, direct, fedora, gaming, hardware, laptop, m1530, media, notebook, performance, review, service, speed, vista, xps

Today I finally started the experiments with Adobe Flash AS2 and here comes my first experiment.
All that’s needed is a black background and a movieclip called “code” exported for AS with a little green dynamic text area named “inside”.
Change the number of frames per second to 120 and copy this code to the first frame on the main timeline.
/* MATRIX BINARY CODE v. 0.1
You'll need: black background, movieclip "code" exported for AS, dynamic text "inside" inside the "code" movieclip
coder: Ranza
web: http://masteranza.wordpress.com
time: 00:09:26
*/
//function which varies the brightness
function setBrightness(col:Color, brightness:Number):Void {
var anum:Number = 100 - brightness;
var bnum:Number = 255 / 100 * brightness;
col.setTransform( {ra:anum, ga:anum, ba:anum, rb:bnum, gb:bnum, bb:bnum, aa:100, ab:0} );
};
var colMin:Number = 0; // min brightness
var colMax:Number = 50; // max brightness
var colVariance:Number = colMax - colMin;
var chars:Array = ["0","1"]
var depth:Number = 0;
var lastx:Number=0;
var chainlen:Number=0;
var lastspeed:Number =0;
//function which randomizes color
function nooCol(Void):Number {
return colMin + Math.random() * colVariance;
}
onEnterFrame = function(){
if (Math.floor(Math.random() * 1) == 0) { //how often to create new movieclips
depth++;
var noo:MovieClip = _root.attachMovie("code", "code" + depth, depth);
noo.inside.text = chars[Math.floor(Math.random()*chars.length)];
var col:Color = new Color(noo);
setBrightness(col, nooCol());
//the part responsible for creating chains
if (Math.floor(Math.random() * 10) == 0){
noo._x = Math.random()*Stage.width;
noo._y = -10;
chainlen = 0;
noo.speed = Math.random() * 3 + 1;
lastspeed = noo.speed;
}
else{
chainlen++;
noo._x = lastx;
noo._y = -10 - (noo._height*chainlen);
noo.speed = lastspeed;
}
lastx = noo._x;
noo.onEnterFrame = _root.flow;
}
}
//this function which was handled the onEnterFrame event makes our code move
function flow(){
this._y += this.speed;
if (this._y > Stage.height) {
this.removeMovieClip();
}
}
Gosh… How big was my furry when I noticed that there’s no way to upload swf files and insert as2 sourcecode on wordpress.com … That’s why my code isn’t as colorful as it should be. Damn.
Filed under: AS2, Informatics | 3 Comments
Tags: as2, binary, code, experiment, flash, lab, matrix









