Showing posts with label programing. Show all posts
Showing posts with label programing. Show all posts

Sunday, 5 February 2017

Can we create Matrix using AI?

Would it be possible for us to create real time world simulation?

We started using super computers with few thousands of processors, unbelievable number of RAM, insane Internet speed, and all that working as one unit.

We use them for predicting climate, solving problems, do different types of simulations, but can they run Matrix?
On first look you could think, ok, how hard it can be?

Let's try to think for few minutes what we need for building Matrix.
For this purpose we will speak in OOP world, so describing what kind of "objects" we need.

First we need "World", he will be filled with "People", "Animals", "Physics rules", "Oceans", "Nature", "Rivers", "Mountains", "Threes", "Cars", "Homes", ... and many other things.
Now you can think, ok, at some point I will create all of them, then you can think what to do next...?

What is the main ingredient for life itself? It's Sun. So we need to map our whole planetary system.
On then add "Sun", "Moon", "Mars" and others...
Create them and just add basic rules, all planets are circling around soon at some speeds, they are spinning at certain speeds, and we did that, perfect.

Now we have light on our planet, hmm, so now what we need is "Climate", some times we have sunny days, some days rain, some days wind, snow,...

Let's assume we did that too, now we have day and night zones, climate, so we can work on photosynthesis because we need oxygen. We did that too, ok, at this point it started to be very complex and we just started.

Let's say everything is done, let us concentrate only at one place, one city, and then on block.
How many people live there? How many streets, shops, jobs, cars, dogs, cats are there?
And you fill all that info, what is left is our SOUL!

We still can't create that good AI to simulate our way of thinking. Our way of getting knowledge, our way of getting friends, every person has something unique and that computer can't simulate. Still...

Best companies in the world didn't even scratch the surface what is our brain capable of.

When we count all necessary things we need to create in Matrix, your brain already started imagine that in your head, all the places, streets, different people, worlds and that machine can't do...

Machines are now just capable to use our data we provide them and manipulate in some sort to get a result we think it is good.
I hope it will stay like that for a long time, because if somebody do create that good program, we will all be without job :)

Let's say in we do create that good AI, what do we need more? Can you imagine how big data centers it will require, just to store memories of 1,000 people? Matrix is still out our reach, and it will take us some time to reach that goal, maybe we will never reach it but who knows, maybe where are we now is only one big simulation...

If you did like our story, and your are looking of more, please subscribe to our blog, post some comments, like us on Facebook, share it and enjoy.

Kind regards,
M.L.

Saturday, 8 February 2014

Do you know how simple is programming? Try it yourself. AutoIT

You don't need to be IT expert to write a program, you can write your own programs with this script language:

 

AutoIT



There are a lot of complicated programming languages​​, but there are also simple language that everyone can use, one of them is AutoIT script language.

He is very simple and easy to learn. You can write simple and complicated programs for whatever you need.

How to start with AutoIT? You need to do 1. and 3. step on this link. After that you are ready to write your own programs.

I will show you how to make program to open your CD drive and close it in a loop every 1 minute. :D
We all wanted in some point to be a hackers, this is a closest you can be a hacker without knowing anything about programing.

So how to start? You can do like this, go to your desktop or folder you want to make programs and click right click, from menu select "New" then select AutoIT script. Name it like "CD Drive" or something like that. After you name it, you need to right click on it and click on Edit Script, by default if you just open it i will run script and nothing will be executed because you don't have any code on script.

So we click on Edit Script and now you see Script Editor, all you need to do now is to write your code and use your imagination. :)
We are building CD script, so what do we need? Script gonna be in a loop because we want that CD open's every 1 minute. So how to make a loop?

You can do a loop very easy and intuitive like this:
While 1=1

Wait! What? :D Yes this is a loop, if you think about it loop will do code while condition is correct, in our example 1 is always equal to 1 so our loop will do this always! :)

So how will the loop know where is the end of our code? We need to add this:
WEnd

W - represents while loop and End - end of the loop so every simple for now. :D

Hmm we want to do this loop every 60 second so we need to pause or "sleep" our program for 1 minute, how we gonna do that? Just add this:    sleep(time in millisecond)
So we need to our program sleeps for 60 second, 1 second has 1000 millisecond so we just add sleep method:
while 1=1

sleep(60000)
WEnd

We have our loop who will execute code in every minute in just 3 line of code's :D How cool is that? :)
Now we need to open a CD drive, you can say hmm that is hard, hmm no! Programing is simple because all you need to do is to call method who will do something that we need, so we need method to get CD Drive.

$var = DriveGetDrive( "CDROM" ) 

In this variable called "$var" we get all CD drives on computer, if you think what is this "$" sign means, that is AutoIT thing to say what is variable, you don't need to know anything about that...

So we have all drives in one variable, now we need to open it, so we need to iterate through all cd drive's and open it. We will do it like this:
If not @error Then
For $i = 1 to $var[0]
    CDTray($var[$i] , "open")
Next
EndIf

We first ask is there some kind of error in calling CD Drive's? If not we use for loop to iterate through all CD drives, so if we have 3 drives, with for we go from 1 to 3, we now use 1drive call method to open it: CDTray($var[$i] , "open")When we are finished with first drive we call method Next it will give us next drive, so for loop will now do same thing with second drive, after second is finished we call Next and call it for third drive. So with that 5 lines of codes we open all CD drives on computer. Our code look like this now:

While 1=1

$var = DriveGetDrive( "CDROM" )
If not @error Then
For $i = 1 to $var[0]
    CDTray($var[$i] , "open")
Next
EndIf

sleep(60000)
WEnd

And we finish it :D If you want to close it and after a few second you can use that same code but change "open" to "close" for operation and add sleep between open and close about 20-30 second and you are good. :D

Now we need to create executive program that we can send someone to make a joke with him. :)
In Script Editor menu you have Tools tab, open it and click "Build". That will call AutoIT function to make our program become executive or .exe file. If you don't have any mistakes with your code in your folder or desktop where did you create this script will be file NameOfTheScript.exe and all you need to do now is to zip it or rar it and send it to someone you want to go insane. :P

You can run it on your computer as well, if you want to stop it just use Ctrl+Alt+Delete and kill the program... :) 

This is a tutorial how to make CD Room open's with 10 lines of code and you don't need to be programer to do that. 
If you want to learn more try to read AutoIT documentation or just leave comment bellow and we will make new tutorial how to do similar crazy stuff with AutoIT... :)

If you like this post please like us on Facebook, subscribe, share it, do whatever you want with it... :)
Have a good one. M.L.