Skip to content

Margus Roo –

If you're inventing and pioneering, you have to be willing to be misunderstood for long periods of time

  • Cloudbreak Autoscale fix
  • Endast

Kongruentseteks mooduli m järgi

Posted on July 28, 2015 - July 28, 2015 by margusja

Teoreem jäägiga jagamisest ütleb, et mis tahes täisarvu a on võimalik jäägiga jagada suvalise positiivse täisarvuga m , s.t fikseeritud täisarvude a ja m > 0 korral leiduvad üheselt määratud täisarvud q ja r nii, et a = q *m + r , kusjuures 0 <= r < m (Abel jt, 2006).

Kui kaks täisarvu a ja b annavad jäägiga jagamisel positiivse täisarvuga m ühe ja sama jäägi r nii, et a = q * m + r, b = q1 * m + r  , 0 <= r < m ja q , 1 q ja r on täisarvud, siis nimetatakse arve a ja b kongruentseteks mooduli m järgi ning tähistatakse kujul a =(samaväärne) b (mod m). Kirjutist a = b (mod m) nimetatakse kongruentsiks ja loetakse eesti keeles „Arv a on kongruentne arvuga b mooduli m järgi“.

 

modulus

 

Viide: http://matdid.edu.ee/joomla/images/materjalid/artiklid/rakendused/abel_vilt.pdf

Posted in Math

Find your forgotten WIFI password

Posted on July 27, 2015 by margusja

Screen Shot 2015-07-27 at 15.08.02

Posted in IT

List of active ports in MacOsX

Posted on July 1, 2015 by margusja

margusja@IRack:~$ sudo lsof -i -n -P | grep TCP

Posted in Linux, Mac

Arduino and GPRS shield

Posted on June 24, 2015 - June 28, 2015 by margusja

Made first prototype used GPRS shield SIM900

http://positrontech.in/uppdf/GSM/SIM900%20%20Module.pdf

500px-GPRS_shield_v1.4

http://garden.seeedstudio.com/images/a/a0/SIM900_ATC_V1_00.pdf

First I had to disable SIM pin1

Screenshot 2015-06-25 20.13.10

 

List of operators

Screenshot 2015-06-25 23.08.48

 

So I made one call and send one SMS to Varulla.

2015-06-24 20.37.57

 

2015-06-26 21.12.10

 

Now we have dial pad prototype.

2015-06-28 20.19.51

Posted in Elektroonika

Apache-Spark first steps

Posted on June 16, 2015 - June 17, 2015 by margusja

There are two main operations in Spark:

1. Transformations – apply some function to all records in dataset. In example map – mapping input to some new output.

2. Actions – runs some computation and aggregation operation and returns result to driver. In example count and reduce.

Spark’s transformations are lazy. It means if you do not use any action you do not get any results after transformations.

Spark recomputes transformation again before each action. In case you do not want it you can save dataset into memory calling:

> transformationDataSet.persist()

 

Load data

scala> val data = sc.textFile(“./demo.csv”) // load datafile

var csvData = data.map(l => l.split(“,”).map(_.trim)) // apply split(“,”) to each row in file. Apply trim to each element in row.

inFile.map(x => x.split(‘ ‘)(0)).reduce((a,b)  => a)

Here we apply transformation map to each line in inFile dataset. We split each row using ‘ ‘ and take first element. Then we apply action reduce where real staff actually happens due the laziness.

reduce – aggregates elements in dataset using function which takes two arguments and returns one. The function should be commutative and associative so that it can be computed correctly in parallel.

scala> foo
res94: List[Int] = List(1, 2, 3, 4, 5, 6)

scala> foo.reduce((a, b) => a+b)
res95: Int = 21

As I pointed out function have to be associative. In example (1+6)+(2+5)+(3+4)=21 or (2+6)+(1+5)+(3+4)=21

filter (action)

scala> foo
res51: List[Int] = List(1, 2, 3, 4, 5, 6)

scala> foo.filter(x => x > 3)
res52: List[Int] = List(4, 5, 6)

scala> csvData.map(l => l(0).toInt).map(_+1).map(_-1).reduce((a,b) => a+b) // one pointless example how to pipe transfer operations.

Anonymous functions (An anonymous function is a function that is not stored in a program file, but is associated with a variable whose data type is function_handle . Anonymous functions can accept inputs and return outputs, just as standard functions do. However, they can contain only a single executable statement)

scala> val increment = (x: Int) => x + 1

scala> increment(1)
res157: Int = 2

scala> csvData.map(l => l(0).toInt).map(increment(_)).reduce((a,b) => a+b)

scala> val sum2 = (x: Int, y: Int) => x + y

scala> csvData.map(l => l(0).toInt).map(increment(_)).reduce((a,b) => sum2(a,b))

Posted in Machine Learning, Math

Clear to land

Posted on June 14, 2015 by margusja

cleartoland

Posted in Fun

IoT – Raspberry Pi2 and hc-sr04

Posted on May 27, 2015 - May 28, 2015 by margusja

Lately I discovered IoT and Clayster for my self.

One good way to learn new things is to resolve some problem using new technology. So I thought to build system detects is somebody is behind in my display. And I’d like to detect it over XMPP.

So for prototyping Raspberry Pi is suitable piece of hardware. Also I used ultrasonic sensors – hc-sr04

2015-05-27 15.34.52

 

Connected with RP using schema

hc-sr04-tut-2

Source: http://www.modmypi.com/blog/hc-sr04-ultrasonic-range-sensor-on-the-raspberry-pi

 

And I can read readings over XMPP

 

 

 

 

 

Screenshot 2015-05-27 15.30.55

 

And finally the most coolest thing – HomeArena by Clayster

Screenshot 2015-05-28 13.15.54

 

Posted in Elektroonika

Build gpio command for Raspberry PI

Posted on May 27, 2015 by margusja

git clone git://git.drogon.net/wiringPi
cd wiringPi
./build

Posted in Elektroonika

Just nice gpio raspberry pi2 output

Posted on May 20, 2015 by margusja

Screenshot 2015-05-20 12.25.01

Posted in Elektroonika

Voltage divider formula

Posted on May 20, 2015 by margusja

Screenshot 2015-05-20 11.27.02

Posted in Elektroonika

Posts navigation

Older posts
Newer posts

The Master

Categories

  • Apache
  • Apple
  • Assembler
  • Audi
  • BigData
  • BMW
  • C
  • Elektroonika
  • Fun
  • Hadoop
  • help
  • Infotehnoloogia koolis
  • IOT
  • IT
  • IT eetilised
  • Java
  • Langevarjundus
  • Lapsed
  • lastekodu
  • Linux
  • M-401
  • Mac
  • Machine Learning
  • Matemaatika
  • Math
  • MSP430
  • Muusika
  • neo4j
  • openCL
  • Õpetaja identiteet ja tegevusvõimekus
  • oracle
  • PHP
  • PostgreSql
  • ProM
  • R
  • Turvalisus
  • Varia
  • Windows
Proudly powered by WordPress | Theme: micro, developed by DevriX.