Question: I'm been looking for some tutorials or atleast a guide how to load an image from url.
Well locally it's quite pretty easy.. So if anyone has suggestions or an idea where I can start, please share.

I tried the SmartImageView and followed in the documentation but still failed...:(

```
        protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    image = (ImageView)findViewById(R.id.imageView1);
    text = (TextView)findViewById(R.id.textView1);
    text.setText("Show image by url");

    SmartImageView myImage = (SmartImageView) this.findViewById(R.id.my_image);
    myImage.setImageUrl("http://icons.iconarchive.com/icons/yellowicon/game-stars/256/Mario-icon.png");
    text.setText("Status: " + myImage);
}

```

And this on the activity:

```
      <com.loopj.android.image.SmartImageView
     android:id="@+id/my_image"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_alignLeft="@+id/textView1"
     android:layout_below="@+id/imageView1"
     android:layout_marginLeft="14dp"
     android:layout_marginTop="37dp" />

```

Permission : yes

```
   <uses-permission android:name="android.permission.INTERNET" />

```

Answer: 
You are probably looking for permutation with repetition and Ruby's `Array` from standard library luckily [implements this](http://www.ruby-doc.org/core-2.1.0/Array.html#method-i-repeated_permutation):

```
[1,2].repeated_permutation(3).to_a
# [[1, 1, 1], [1, 1, 2], [1, 2, 1], [1, 2, 2], [2, 1, 1], [2, 1, 2], [2, 2, 1], [2, 2, 2]]

```
A slight variant of your answer:

```
class Array
  def **(n)
    product( *([self]*(n-1)) )
  end
end

[1,2]**3
  # => [[1, 1, 1], [1, 1, 2], [1, 2, 1], [1, 2, 2],
  #     [2, 1, 1], [2, 1, 2], [2, 2, 1], [2, 2, 2]] 

```