Wednesday, February 16, 2011

http://www.processing.org/learning/objects/

When a primitive value (integer, float, etc.) is passed in a function, a copy is made. With objects, this is not the case, and the result is a bit more intuitive. If changes are made to an object after it is passed into a function, those changes will affect that object used anywhere else throughout the sketch. This is known as pass by reference since instead of a copy, a reference to the actual object itself is passed into the function.

Tuesday, February 23, 2010

Why binary? Яагаад заавал 2тийн тоолол гэж?

* The logic that computers use is Boolean logic which is a two-valued logic, and thus the two states of a binary system can relate directly to the two states of a Boolean logical system.

* It was easier to make hardware which can distinguish between two values than multiple values. Imagine a light switch compared to a clock.

* Binary is slightly more efficient than decimal. Many early computers used decimal (usually in binary-coded decimal representation). This seemingly-natural approach was eventually largely abandoned due to the increase in processing circuitry (as compared to binary) which reduced reliability.

* Other bases have been tried. A few experimental computers have been built with ternary (base 3) representation, as it was thought it might be more efficient than binary.



* Компьютерийн ашигладаг логик нь 2 утгатай Булийн логик байдаг, тиймээс 2-тын тооллын системийн 2 төлөв /0 болон 1/ нь шууд Булийн логик системийн 2 төлөвтэй /худал мөн үнэн/ таардаг.

* Олон утгаас/үүнтэй харьцуулахад/ зөвхөн 2 утгыг ялгадаг техникийг хийх нь илүү амар байдаг. Унтраалгыг /зөвхөн унтраах асаах 2 төлөвтэй/ цагтай /маш олон бүрдэлтэй нарийн нийлмэл систем/ харьцуулаад үз.

* 2т нь 10таас харьцангуй үр ашигтай байдаг. Дээр үеийн маш олон компьютерүүд 10тыг ашигладаг байсан /ихэнхидээ BCD буюу 2тоор кодлосон 10т/. Сүүлдээ энэхүү энгийн хандалт нь схемээ ихэсгэснээр ажиллагааны найдвартай байдлыг бууруулж улмаар ашиглагдахаа больсон байна.

* Өөр тооллууд мөн туршигдсан байна. Цөөн хэдэн туршилтын компьютерүүд 2тоос илүү үр ашигтай байж болох таамаглалын дагуу 3тын тооллын системд суурьлагдан бүтээгдсэн байна.