Monkey Song (Endah N Rhesa Cover)


https://youtu.be/y2o8_rw34QI
Using Telecaster on Yamaha AG06 Mixer.

I use Guitar channel with default effect on and the Amp Sim off.

Recorded using iPhone 5 (using mixer USB out).

http://www.nugroho.life

The Lyrics
Monkey Song
(Endah N Rhesa)

There’s a monkey who lives somewhere far away, far away from here
Maybe we can call the place the Eden of the East
The Monkey climbs a tree and sees a rainbow in the sky
And sees the jungle from the top of that Dreaming Tree

He is looking for a banana tree, it’s so hard to find
He will never stop until the night has come
Swinging from the vines

Swing and sway, seize the day
You will find the way
Swing and sway, everyday?Lighten up your day

Finally he found the banana tree… Yes, he is so happy
But there’s only one that’s ripe, he can’t wait to eat it
The monkey climbs the tree and grabs the banana with his hand
But when he wants to eat, he sees little monkey on the ground

Little monkey can’t jump, he just stares at him
And cries, he is starving

The monkey thinks so hard and doesn’t bear to ignore him
And then he gives the banana to the little monkey
Oh he is so insane..
What a life… is to care and share

“Auto” Gauss Naif in Delphi.

After do this in Python, now it’s time to bring it back to Delphi, where all of this is started, 🙂

The heart of code lay on this one

procedure tform1.gauss;
var i,j,k:integer; temp:real;
begin
  for i:=1 to 9 do begin
    for j:= 1 to i do begin
      if t[i,j]<>0 then begin
        temp:=t[i,j];
        for k:= 1 to 10 do begin
          if i=j then
            t[j,k]:=t[j,k]/temp
              else t[i,k]:=t[i,k]/temp - t[j,k];
        end;
      end;
    end;
  end;
  //back subtitution
  for i:=9 downto 1 do begin
    x[i]:=t[i,10];
    for j:=9  downto i do begin
      if i<>j then
        x[i]:=x[i]-x[j]*t[i,j];
    end;
  end;


You could say that it consists of zeroing lower tringle and normalizing the diagonal and then subtituting the value.

There’s little failsafe code here, that is if we already have zero cell, don’t proceed, or it will gave divided by zero error.

The rest of the code is here.

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, StdCtrls;

type
  TForm1 = class(TForm)
    StringGrid1: TStringGrid;
    StringGrid2: TStringGrid;
    Button1: TButton;
    procedure bacaMatrik;
    procedure gauss;
    procedure tulisMatrik;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  t:array[1..9,1..10]of real;
  x:array[1..9]of real;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var i,j:integer;
begin
  for i:=1 to 9 do begin
    x[i]:=0;
    for j:=1 to 9 do begin
      t[i,j]:=0;
    end;
  end;
  for i:=1 to 9 do begin
    for j:=1 to 9 do begin
      if i=j then begin
        t[i,j]:=-2;
        if j<>1 then t[i,j-1]:=1;
        if j<>9 then t[i,j+1]:=1;
      end;
    end;
    t[i,10]:=1;
  end;
  t[1,10]:=1-100;
  t[9,10]:=1-25;

  tulisMatrik;
end;
procedure tform1.bacaMatrik;
var i,j:integer;
begin
  for i:=1 to 9 do begin
    for j:=1 to 10 do begin
      t[i,j]:=strToFloat(stringgrid1.Cells[j-1,i-1]);
    end;
  end;

end;
procedure tform1.tulisMatrik;
var i,j:integer;
begin
  for i:=1 to 9 do begin
    stringgrid2.Cells[i,0]:=floatToStr(x[i]);
    for j:=1 to 10 do begin
      stringgrid1.Cells[j-1,i-1]:=floatTostr(t[i,j]);
    end;
  end;
  stringgrid2.Cells[0,0]:='100';
  stringgrid2.Cells[10,0]:='25';

end;

procedure tform1.gauss;
var i,j,k:integer; temp:real;
begin
  for i:=1 to 9 do begin
    for j:= 1 to i do begin
      if t[i,j]<>0 then begin
        temp:=t[i,j];
        for k:= 1 to 10 do begin
          if i=j then
            t[j,k]:=t[j,k]/temp
              else t[i,k]:=t[i,k]/temp - t[j,k];
        end;
      end;
    end;
  end;
  //subtitusi balik
  for i:=9 downto 1 do begin
    x[i]:=t[i,10];
    for j:=9  downto i do begin
      if i<>j then
        x[i]:=x[i]-x[j]*t[i,j];
    end;
  end;

end;
procedure TForm1.Button1Click(Sender: TObject);
begin
  bacaMatrik;
  Gauss;
  tulisMatrik;
end;

end.

.

from Blogger http://ift.tt/2oLOSqK

When You Love Someone (Endah N Rhesa Cover)


https://youtu.be/vzVIeHI6Fnc
http://www.nugroho.life

When You Love Someone
(Endah N Rhesa)

I love you but it’s not so easy to make you here with me
I wanna touch and hold you forever
But you’re still in my dream
And I can’t stand to wait ‘till nite is coming to my life
But I still have a time to break a silence
When you love someone
Just be brave to say that you want him to be with you

When you hold your love
Don’t ever let it go
Or you will loose your chance
To make your dreams come true…

I used to hide and watch you from a distance and i knew you realized
I was looking for a time to get closer at least to say… “hello”
And I can’t stand to wait your love is coming to my life
When you love someone
Just be brave to say that you want him to be with you

When you hold your love
Don’t ever let it go
Or you will loose your chance
To make your dreams come true…

And I never thought that I’m so strong
I stuck on you and wait so long
But when love comes it can’t be wrong
Don’t ever give up just try and try to get what you want
Cause love will find the way…
When you love someone
Just be brave to say that you want him to be with you

When you hold your love
Don’t ever let it go
Or you will loose your chance
To make your dreams come true…

Gauss Naif in Python

Okay, we’ve done the manual one, how about automatize it?

It’s actually just a matter of finding the pattern on that code and after we found the loop, we just have to well… loop it, 🙂

Here’s the automatic code, it could be used on any size of matrices.

from random import uniform

def showIt(a):
    print 'The matrix'
    print a[0][0], a[0][1],a[0][2], a[0][3]
    print a[1][0], a[1][1],a[1][2], a[1][3]
    print a[2][0], a[2][1],a[2][2], a[2][3]
a = []
x = []
for i in range (3):
    a.append([])
    x.append(0.)
    for j in range (4):
        a[i].append(uniform(.1,10))
        
showIt(a)

#Elimination of lower triangle
print ''
print 'lower triangle elimination'
for i in range(3):
    for j in range(0,i+1):
        temp = a[i][j]
        for k in range(4):
            if (i==j):
                a[i][k] /= temp
            else:
                a[i][k] =a[i][k]/temp - a[j][k]
        
showIt(a)

#back subtitution
for i in range(2,-1,-1):
    x[i] = a[i][3]
    for j in range(2,i,-1):
        x[i] -= x[j]*a[i][j]

print ''
print x

And the result is

Nugrohos-MacBook-Air:blog nugroho$ python gaussAuto.py 
The matrix
2.9253100656 5.50024585256 7.54933211423 0.802045271906
7.46608768407 7.19037200354 4.96635482944 5.77225324671
4.34208584906 9.64108592095 6.96107863057 0.5016396771

lower triangle elimination
The matrix
1.0 1.88022661845 2.58069467678 0.274174447809
-0.0 1.0 2.08852903767 -0.544024465595
-0.0 -0.0 1.0 -0.0156447726138

[1.2760025294980237, -0.5113499037034588, -0.015644772613790357]
Nugrohos-MacBook-Air:blog nugroho$ 

.

from Blogger http://ift.tt/2pm45Ty

Manual Gauss Jordan in Python.

What if we didn’t do back substitution on Gauss Naif method but eliminate the rest instead? Nah, we get the Gauss Jordan here.

The idea is after we do operation to make the  lower-triangle have zero value,  we continue the operation until all the component in the upper-triangle have zero value too, and the diagonal have value of one.

Basically, the matrix becomes identity matrix. This way, we didn’t need subtitution at all since all variables already has the exact value on the right side, 🙂

Here’s the modificatian

from random import uniform

def showIt(a):
    print 'The matrix'
    print a[0][0], a[0][1],a[0][2], a[0][3]
    print a[1][0], a[1][1],a[1][2], a[1][3]
    print a[2][0], a[2][1],a[2][2], a[2][3]
a = []
x = []
for i in range (3):
    a.append([])
    x.append(0.)
    for j in range (4):
        a[i].append(uniform(.1,10))
        
showIt(a)

#manual operation on lower triangle
temp = a[0][0]
a[0][0] /= temp
a[0][1] /= temp
a[0][2] /= temp
a[0][3] /= temp

temp = a[1][0]
a[1][0] = a[1][0]/temp - a[0][0] 
a[1][1] = a[1][1]/temp - a[0][1] 
a[1][2] = a[1][2]/temp - a[0][2] 
a[1][3] = a[1][3]/temp - a[0][3]

temp = a[1][1]
a[1][1] /= temp
a[1][2] /= temp
a[1][3] /= temp

temp = a[2][0]
a[2][0] = a[2][0]/temp - a[0][0] 
a[2][1] = a[2][1]/temp - a[0][1] 
a[2][2] = a[2][2]/temp - a[0][2] 
a[2][3] = a[2][3]/temp - a[0][3]

temp = a[2][1]
a[2][1] = a[2][1]/temp - a[1][1] 
a[2][2] = a[2][2]/temp - a[1][2] 
a[2][3] = a[2][3]/temp - a[1][3]

temp = a[2][2]
a[2][2] /= temp
a[2][3] /= temp
print ''
print 'Manual Operation on lower-triangle Result'
showIt(a)
print ''
temp = a[1][2]
a[1][3] = a[1][3]/temp-a[2][3]
a[1][2] = a[1][2]/temp-a[2][2]
a[1][1] = a[1][1]/temp-a[2][1]

temp = a[1][1]
a[1][1] /= temp
a[1][3] /= temp

temp = a[0][2]
a[0][3] = a[0][3]/temp - a[2][3]
a[0][2] = a[0][2]/temp - a[2][2]
a[0][1] = a[0][1]/temp - a[2][1]
a[0][0] = a[0][0]/temp - a[2][0]

temp = a[0][1]

a[0][3] = a[0][3]/temp - a[1][3]
a[0][2] = a[0][2]/temp - a[1][2]
a[0][1] = a[0][1]/temp - a[1][1]
a[0][0] = a[0][0]/temp - a[1][0]

temp = a[0][0]
a[0][0] /= temp
a[0][3] /= temp

print 'operation on upper-triangle result'
showIt(a)

print 'the result'
x[0] = a[0][3]
x[1] = a[1][3]
x[2] = a[2][3]
print x



And the result is here

Nugrohos-MacBook-Air:blog nugroho$ python gaussJordanManual.py 
The matrix
0.325152138961 4.70653216428 5.62293611004 0.355298420178
3.77212266843 5.01372896476 2.44600829577 5.16166288251
6.01821316098 3.642737365 1.98942519502 0.891669926919

Manual Operation on lower tringle Result
The matrix
1.0 14.4748614581 17.2932465645 1.09271438691
0.0 1.0 1.26617773562 -0.0209693160516
0.0 0.0 1.0 -2.06355734268

operation on upper triangle result
The matrix
1.0 0.0 0.0 -0.7385092664
0.0 1.0 0.0 2.59186104743
0.0 0.0 1.0 -2.06355734268
the result
[-0.7385092664002817, 2.5918610474291373, -2.063557342678102]
Nugrohos-MacBook-Air:blog nugroho$ 



.

from Blogger http://ift.tt/2pkqeBM

Francesco Toni Prayitno Bertolozzi.

@DeeLestari .

Ehm, jika dia menggantikan Alfa, maka dia juga peretas mimpi. Karena dia hacker, maka dia bisa memprogram kandi sedemikian sehingga tak bisa diterobos Firas/Bumi yang memiliki kemampuan hingga bisa menembus dimensi kandi.

(BelumMoveOnDariSuperNova, 😀 )

Manual Gauss Naif Elimination using Python

How about some manual matrix using manual Gauss just like always, but in Python? Okay, here it is.

I use tuple, I think it’s just the same as array for this purpose.

I created matrix a with random value.  It’s like linear equation system; three unknown variables with three equation. The purpose of this code is to find x1, x2 and x3.

Oh, in this case, its x0, x1 and x2, 🙂

Anyway

from random import uniform def showIt(a): print 'The matrix' print a[0][0], a[0][1],a[0][2], a[0][3] print a[1][0], a[1][1],a[1][2], a[1][3] print a[2][0], a[2][1],a[2][2], a[2][3] a = [] x = [] for i in range (3): a.append([]) x.append(0.) for j in range (4): a[i].append(uniform(.1,10)) showIt(a) #manual operation temp = a[0][0] a[0][0] /= temp a[0][1] /= temp a[0][2] /= temp a[0][3] /= temp temp = a[1][0] a[1][0] = a[1][0]/temp - a[0][0] a[1][1] = a[1][1]/temp - a[0][1] a[1][2] = a[1][2]/temp - a[0][2] a[1][3] = a[1][3]/temp - a[0][3] temp = a[1][1] a[1][1] /= temp a[1][2] /= temp a[1][3] /= temp temp = a[2][0] a[2][0] = a[2][0]/temp - a[0][0] a[2][1] = a[2][1]/temp - a[0][1] a[2][2] = a[2][2]/temp - a[0][2] a[2][3] = a[2][3]/temp - a[0][3] temp = a[2][1] a[2][1] = a[2][1]/temp - a[1][1] a[2][2] = a[2][2]/temp - a[1][2] a[2][3] = a[2][3]/temp - a[1][3] temp = a[2][2] a[2][2] /= temp a[2][3] /= temp print '' print 'Manual Operation Result' showIt(a) print '' print 'back subtitution result' x[2] = a[2][3] x[1] = a[1][3]-x[2]*a[1][2] x[0] = a[0][3]-x[2]*a[0][2]-x[1]*a[0][1] print x

And the result is

The matrix 6.93963542354 5.98187429665 5.87719944611 7.80205223834 6.50704604012 8.35799256599 1.97135638303 4.32696464128 5.37640622053 3.00929263631 9.01774536141 4.12795952375 Manual Operation Result The matrix 1.0 0.861986823739 0.846903199867 1.12427408101 0.0 1.0 -1.28755030345 -1.08720754634 0.0 0.0 1.0 -1.5528377879 back subtitution result [5.09995513948545, -3.0865643113717116, -1.5528377879039497]

.

from Blogger http://ift.tt/2pvhUjz

Wish You Were Here (Endah N Rhesa Nylon Acoustic Guitar Cover)


Nugroho’s Channel
http://www.nugroho.life

The original lyrics:

Wish You Were Here
(Endah N Rhesa)

I always be here waiting for you come in back home
I keep our flowers grow, since we planted the seed many years ago

And I stare at the moon and hope we’ll meet there, hope we’ll meet there?
‘cause I miss you

I wish you were here
I know it’s hard for you to stay and so I let you go
But you promised to never let me down and said that you love me so

And I stare at the moon and hope we’ll meet there, hope we’ll meet there
‘cause I miss you?
I wish you were here

Make your dreams fulfilled,
and don’t forget to take me with you someday