Thursday, March 3, 2011

Learning and Applying

Its been forever until my last post, but I just didn't have time to give some thoughts to write. I have been busy in school and college, but I still have so many ideas to write. I am still on my promise to write the last basic post for Visual Basic and then I may dig deeper into more learning. I am trying to find a good book for people in my age and beginners about programming or software engineering in general, just for the sake of knowledge. I know there are many references in the internet, but I like to have the book with me all the time rather than going to the website and read.

This quick post is only about few pictures I enhanced few days ago in Camera Raw and Photoshop. I just felt I didn't posted my photographs since months, and I needed to do that. I have more pictures to share but I need to fix them first. Here are few images I like to share:

I love the drops on the flower. I sharpened them and used different blending modes to have this result. I used macro lens and without a tripod! I got this image by my luck laying down on the ground in a rainy day.

This is heavy processed. I took it to Camera Raw and played with the temperature, then into Photoshop with using different blending modes and blur too.

My sister look like an old lady after editing with wrinkles under eyes ( sorry sofie! )
The pupil had the most attention in this picture. I kept using different sharping to get a little bit of reflection. I am still not very satisfied with it, but I just chose to share it.

I learned this trick of Black and White from The Mac Lab Video Tip of the Day from my Digital Arts class. I liked it and it is so easy... it gave a whole lot meaning to the picture.

Thats all I wanted to say for now. Hopefully this weekend I have another update for programming or photography.

Friday, November 26, 2010

Programming- Lesson #6 ~ Creating Your Own Classes

“Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves.”- Alan Kay

I did not write any post about programming since long time ago and I keep delaying because it requires time because I read, learn, then write about what I've understood. Here is one post about Lesson #6, and there should be one more post to finish up the basics.

So what is Classes? and are we able to build them our own? Yes, you can. Classes are the structure of your program. The Hello World program is simple and small, you would find your way around even if it wasn't organized, but when you start doing more complex programs, you probably want your codes organized in classes so you find them easily. So it is important to understand how to create those classes. There is no right or wrong in making your classes.. Imagine you are in the library, and there are so many books...you want to find a specific novel... the librarian may organized the books collection based on the alphabetic names, or the most recent books. So you can organize your program in any way you like.

In our small Hello World program, we will create a greeting class (just like how we greeted Diana, Hannah and Alex here).

Here is how you create a class in your program:

My application called " MyFirstApplication " , so whatever you names your file name, go toSolution Explorer window, right-click on the project you have then point at Add, then clickClass. Name it anything you like, I named it " Greeting.vb " then after that, you would see a window opened with the a class called " Public Greeting Class. "

For now, copy below to your new class and then we will explain it later on and why it looks this way.

Also, Modify your SubMain as follows:

When you run th program, you will see that nothing it changed, it is just this boring Hello Eric greeting, but the way we does this greeting is completely different as you noticed. We wrote the code in a very different way. This is how it will looks like:

As you saw in the code above, there is Dim theGreeting As Greeting. This is our new Main Sub. So now you are wondering " whats the difference between this type of greeting and the ones we did before?"

In this line of our class Dim theGreeting As Greeting the difference is the type of variable. Remmeber in the previous lessons here and here when we talked about Strings and Integers? Our variable here is Greeting not string or integer, there is no numbers or anything, right? It can't hold anything except the Greeting value, therefore; the 'slot' is empty and we have to fill it with something after the ( = ) sign like we did above. Here is what we added: Dim theGreeting As Greeting. This is an object that identify the greeting and what type it is. It is a class of an object. Our new object called instance of the greeting class. So when you want to use this term in VB, you call it instantiation. So we are instating a class here. See the module below.

This module shows the class we created and in what we will fill it. The property of the greeting is Recipient. So in order to do that we have to set he recipient to greet Eric like this: theGreeting.Display()

There should be one more post and we will finish the first part ( and basics ) for Visual Basic.

Friday, October 8, 2010

The Moon

Suddenly I was interested in taking pictures for the Moon. It was pretty fun; running from room to room to see which spot is the best to capture a clear picture for it. In the beginning; it wasn't easy for me to figure out the setting and where to stand to capture the entire circular moon. My friend had experiment it before and told me which is the exact setting for such images. I wasn't sure which one of those below pictures are the best, so I decided to post the best three.

The setting are:
Lens- Canon 70-300 IS
F-stop- f/22
Exposure time- 1/100 sec
ISO speed- 100
Focal length- 263 mm
White Balance- auto
Exposure program- manual



Thursday, September 9, 2010

A New Year MacLabing

Wohoo ! a new year in the mac lab, what a great year it would be. I almost thought I wont be in this class for this year but Mr.Skocko saved my life and got me in :)

I'm ready to whatever the Mac Lab will throw at me, I'm sure there will be many cool stuff that we will learn especially we have Photoshop CS5 and other programs that would make designing so much easier and creative. I'm willing to work on Photoshop more than anything else because it makes art pieces rich of colors and improvements. Also photography will take first priority from my time, I will be borrowing different type of lenses to capture amazing shots.

From Last year, I did the same thing and I took many pictures throughout the year. Some of them were worth looking at and my teacher added it to his Photography Gallery in the blog. One of them had been in the District Art Show. Well, I didn't win but I was happy that it was there for people to see. Click here here if you want to see it.

Different topic. I said I will be posting two more posts ( Lesson 6 and 7 ) about programming but I didn't have time for that. I hope I will be writing those posts sometime soon.

That's all I wanted to say. I hope this year in the Mac Lab will have students that create amazing art . Fun begins!

Wednesday, August 18, 2010

Programming- Lesson #5 ~ The For...Next Loop

"Good code is short, simple and symmetrical -the challenge is figuring out how to get there" - Sean Parent

Good programmers will choose the best path to complete a program. It's a good practice if you write concise or minimal code to achieve. This can be achieved by mastering the language features and learn by experience what the most efficient approach to achieve results is. But the problem is here; sometimes we can't know how to make it easy and simple to get the results we want, so we take the hard path and get to complicated steps. By experience and skill, it will be easy to figure out how write codes in a simple, short and symmetrical way.

The previous lesson is how to repeat or lets say " loop " the code block for many times. What if we want to repeat this block code only 2 times or for a certain number? Let's modify the Main method and greet 4 people only ( which means , the loop will be repeated 4 times only ). Look at the image below:

Let's link to the previous lessons and see how this example worked.

The counter variable i to the start value which is 1. VB will test it and see that it is less or equal than th end value, which is 4 here. If the start value is less than or equal the end value then the loop will work and the block code will be executed. When you press Enter ( after running the program ); VB will add 1 to the counter variable i and this way the For Loop will continue working and printing the certain number of statements on the screen. And the program will do the same steps again, see the block code if it is equal than or greater than and print the next statement and so for and so on.

The counter variable (i) is the tool that makes the loop repeat for certain number of times. If it is 1 time then it do it's own work, if it was 2 then it will do it's work also. Here is a table of the value variable (i) for the For Statement to check if it will loop again or not.

You can use any numbers you want for the start and end value. That was just an example of how many times you want the statement to stay looped or repeated.

School will start soon and I'm willing to write two more lessons and then I will try to keep giving lessons of the things I'm reading although I know I will be busy in my senior year and won't have that much time like now. The next lesson will be about classes and how to create your own.

Tuesday, August 17, 2010

Photography Update

Here's another photography update. Today I was trying to take pictures for the Float Project for my Digital Art class... I don't think I got good ones but this is the first day I started and I like to share them. Here are two pictures I took for my sister.

By using Fish Eye Lens, I lay down on the ground under the heated sun. I tried to get the sun beams clear but I couldn't do it in this picture.

I wanted to make them look like cartoons, so I just played with the sliders of contrast, brightness, shadow , saturation and the highlights. I did the same things for the first two pictures. Those are the camera information.

F-stop: f/7.1 , Exposure Time: 1/400 sec , ISO speed: ISO 100 , Flash Mode: No Flash, compulsory , Focal Length: 15mm , Mattering Mode: Partial , Attributes: A , Exposure Program: Manual



F-stop: f/22 , Exposure Time: 1/60 sec , ISO speed: ISO 100 , Flash Mode: No Flash, compulsory , Focal Length: 15mm , Mattering Mode: Partial , Attributes: A , Exposure Program: Shutter Priority

If you noticed; the sun beams are clear here and thats because the Exposure time and the F-stop are different in this picture. I liked how the body is curved with the jump.



This is not for my Float Project, it is just a picture I took in my father's birthday, but I guess it is good enough to include it in this post. I edited it of course by giving it black and white effect then kept the colors on the top fire of the candle.

F-stop: f/9, Exposure Time: 1/200 sec , ISO speed: ISO 400 , Flash Mode: Flash, Auto , red-eye , Focal Length: 40mm , Mattering Mode: Pattern , Attributes: A , Exposure Program: Normal


You can see those new pictures and the recent ones on my photoshop site
Comment and tell me what you think! :)

Tuesday, August 10, 2010

Programming- Lesson #4 ~ Looping and Iteration

" If you don't think carefully, you might think that programming is just typing statements in a programming language." - Ward Cunningham

When I first started leaning programming which is few months ago, I didn't know there is so much to learn and understand. We have to pay attention to each inch of the code because any mistake may cause an error. Programming isn't about writing a statement with wired signs only, it is an artificial language that designed for a computer only to understand. Programming language create programs that control the machine itself. They have form, meaning and errors. Don't be fooled by the statements that you only see, there is much more than what it looks!

What is looping? and what does it do with programming? Basically,the programs needs to do and preform tasks repetitively sometimes, the program itself do this. We call this behavior Looping. When there is instructions that are repeating, it will stop repeating till a current condition is met, and thats called a Loop. There is usually Boolean Expression in a loop so we know if it will continue looping or not. Here is an example of the whole thing I have:
Do you see the line where it says " Please enter your name " ? That's what we are talking about today; how to make one code or a task be repeated more than one time. When you run the program, it will tells you " Please enter your name: " you write any name you like and then press Enter. It will greet the name you wrote by Hi or Hello. You can try it as many times you like, and when you get bored just press Enter (without writing any name ) to dismiss the program. Let's take a look at the program.



Now, what is Console.Write and Console.ReadLine? Console.Write is similar to Console.WriteLine but it does not add aline that breaks the text. Console.ReadLine reads the console not write it and we use it when we keep pressing Enter so the same line gets repeated ( or in other words, the program pasues till the user press Enter).

The loop works this way...when we run the program, the Boolean expression ( false or true value ) will evaulate the code and tells us wether this value is false or true. When we run the program the expression will tell us the value is wrong and do the follwoing which is " enter your name ", when we enter the name and press Enter, the code will loop again ( go back ) and do the same thing, which is enetring the name and it.


As I noticed while experimenting the program above, I pressed Enter without writing anything...for exmaple, I run the program and it told me " Please enter your name". I didn't write any name and pressed enter.. that way the expression will be false and the return value from Write.ReadLine is empty string.

The next lesson will be also about loops. I hope I am making it as simple as possible.