Nugroho's blog.

Wednesday, June 25, 2014

Tajam atau Tumpul

Banyak yang bicara lantang bahwa kemacetan, karena tak bisa dihindari, dapat dianggap sebagai alat untuk menajamkan mental kita, mengasah kesabaran kita.

Namun ada juga yang mengatakan kemacetan justru menumpulkan kemanusiaan kita;  menerobos lampu merah, memotong jalan, menyerobot lajur kanan, mengklakson sesuka hati, belajar kata-kata umpatan baru, tanpa peduli dengan pengendar sekitar, tanpa memberi kesempatan pejalan kaki yang akan menyeberang.

Saya sendiri lebih memilih berdamai dengan kemacetan dengan cara memilih jalur lain, lebih jauh memang, tetapi bisa meninjak pedal gas dengan leluasa, tidak diserobot, dan tak ada klakson bunyi tiap sepersekian detik, damai dan tekanan darah tetap normal, :)




Tuesday, June 24, 2014

Pornografi Resmi

Tanpa sadar kita sering melihat konten porno di laman-laman web berita online.

Tanpa sadar atau mungkin sadar tetapi tidak begitu 'ngefek' karena saking seringnya.

Masalahnya, laman-laman tersebut meski telah memberi peringatan semacam 'klik hanya jika usia anda 18+', namun hal tersebut menjadi semacam formalitas saja, komputer tidak akan tahu usia pengguna.

Lebih parah lagi di bagian 'lifestyle' atau 'selebritis', gambar-gambar pemakai baju minimalis dan atau adegan-adegan ciuman diumbar bebas untuk dilihat semua kalangan (blog ini ditulis dengan membuka tab baru di browser yang sedang mengakses laman itu, :) )

Sunday, June 22, 2014

Supporter

Jika mendengar suporter yang bilang semacam "ayo Argentina kalahkan iran 3-1 saja" saya selalu tergelitik untuk menganalisa kalimat-kalimat semacam itu.

"Ayo..., kalahkan..." -> cukup logis

"...3-1 saja..."  -> nah ini dia, apa maksudnya? Membuat tiga gol itu sungguh sangat sulit sekali, tetapi masih wajar. Yang agak mengganjal adalah kata "3-1" bisa diartikan "masukkan/buat tiga gol dan biarkan lawan memasukkan 1 gol" :)


Monday, June 16, 2014

DIY HLA Cleaning on my 323F Astina

open engine cover

one bolt free

two bolt free 

third bolt is easy too

 …, and the last bolt is… 

worn out…, not hexagonal anymore,

couldn’t be turned with any type of wrench, oh dear

Grab a hammer and chisel, and "do" it




And it's break free..., :)




HLA, I'm coming... (there it is, big coin-head-shaped HLA, not small bullet-shape one )

 wait, .....

Open the manual book, 

Have to remove timing belt first, whatch out the mark, it must not changed on the assembly,

And then distributor have to be remove too, .....

....
...
ToDo cancelled, ..., maybe next weekend, :)









Gonna to do like this one

The Perfect Race

What a race. Rossi is back.

What a respect, Marquez let Pedrosa get through him after he out of track at first corner and had to cut the track; bypassing corner

And heartbreaking final lap, :)

Thursday, June 12, 2014

[Java Android] Array of Pseudo Random Integer on TextView (just for self documentation)

Here the code, the random numbers  generated at the creation and at "Start" button click

package com.nugnux.array;


import java.util.Random;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity{

private static String text = "heheh...";//for use as the tag when logging

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_main);

proses();

Button buttonStart = (Button)findViewById(R.id.buttonStart);
buttonStart.setOnClickListener(startListener); // Register the onClick listener with the implementation above

Button buttonStop = (Button)findViewById(R.id.buttonStop);
buttonStop.setOnClickListener(stopListener); // Register the onClick listener with the implementation above

}

private void proses(){

TextView tulisan = (TextView)findViewById(R.id.tulisan);
tulisan.setText("tadaa...\n");
tulisan.append("this is array\n");

Random r = new Random();
int[]arr = new int[5];

for(int i=0;i&ltarr.length;i++)
{
arr[i] = Math.abs(r.nextInt()%255) +1;
tulisan.append(arr[i] + "\t\t");
}

}

//Create an anonymous implementation of OnClickListener
private OnClickListener startListener = new OnClickListener() {
public void onClick(View v) {
proses();
Toast.makeText(MainActivity.this, "The Start button was clicked.", Toast.LENGTH_LONG).show();
}
};
// Create an anonymous implementation of OnClickListener
private OnClickListener stopListener = new OnClickListener() {
public void onClick(View v) {
Toast.makeText(MainActivity.this, "The Stop button was clicked.", Toast.LENGTH_LONG).show();
TextView tulisan = (TextView)findViewById(R.id.tulisan);
tulisan.setText("tadaa...");
}
};
}

[Java Android] Create Circle and Line using Canvas on Eclipse with ADT (just for self documentation)

here it is,

I just create new Android app and go straigth to MainActivity.java without setting up the interface, so res/value/strings.xml  and res/layout/* is left as is

and my activity is mainly in MainActivity :)



package com.nugnux.gambar;

import android.app.Activity;
//import android.app.ActionBar;
import android.app.Fragment;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
//import android.os.Build;
import android.widget.Toast;

public class MainActivity extends Activity {

private String tulisan="";
private final int interval = 3000; // 1 Second
private Handler handler = new Handler();
private Runnable runnable = new Runnable(){
public void run() {
Toast.makeText(MainActivity.this, "Tadaa...", Toast.LENGTH_SHORT).show();
}
};
DrawView drawView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
tulisan = Long.toString(System.currentTimeMillis());
Toast.makeText(MainActivity.this, "Heheh..."+tulisan, Toast.LENGTH_SHORT).show();

drawView = new DrawView(this);
drawView.setBackgroundColor(Color.WHITE);
setContentView(drawView);

//handler.postAtTime(runnable, System.currentTimeMillis()+interval);
handler.postDelayed(runnable, interval);
//handler.postDelayed(r, delayMillis)

}
class DrawView extends View {
Paint paint = new Paint();

public DrawView(Context context) {
super(context);
paint.setColor(Color.BLUE);
}
@Override
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawLine(10, 20, 30, 40, paint);
canvas.drawLine(20, 10, 50, 20, paint);
canvas.drawCircle(100, 100, 10, paint);
}
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {

// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}

/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {

public PlaceholderFragment() {
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container,
false);
return rootView;
}
}
}
 
...still figuring how to create moveTo lineTo since it'll come handy for drawing curve (sine, cosine, some exotic function) and animating it :)

 

323f (5) amp (1) android (12) apple (7) arduino (18) art (1) assembler (21) astina (4) ATTiny (23) blackberry (4) camera (3) canon (2) cerita (2) computer (106) crazyness (11) debian (1) delphi (39) diary (286) flash (8) fortran (6) freebsd (6) google apps script (8) guitar (2) HTML5 (10) IFTTT (7) Instagram (7) internet (12) iOS (5) iPad (6) iPhone (5) java (1) javascript (1) keynote (2) LaTeX (6) lazarus (1) linux (29) lion (15) mac (28) macbook air (8) macbook pro (3) macOS (1) Math (3) mathematica (1) maverick (6) mazda (4) microcontroler (35) mountain lion (2) music (37) netbook (1) nugnux (6) os x (36) php (1) Physicist (29) Picture (3) programming (189) Python (109) S2 (13) software (7) Soliloquy (125) Ubuntu (5) unix (4) Video (8) wayang (3) yosemite (3)