Browse Author: biserx

Does more/better equipment means better photos?

When I was a kid, before I went to school, my aunt was very ambitious to teach me how to read, and that resulted in me knowing how to read and write in preschool. But then in the first grade we had these stickers with the alphabet, and we were doing exercises where teacher proposed some word and we had to recreate that word using stickers. I had these stickers, but unfortunately I didn’t have this nylon holder as you can see on the photo, and every time we had to create proposed words, I had to search for the letters through the pile which made me the slowest kid in the class.

Slovarica-za-prvi-razred_slika_O_39262133

The situation got so serious that teacher thought I have problems with studying and called my parents. The problem was that this nylon holder was hard to find, and my parents had to order it from somewhere far away, so it introduced an extra delay in delivery. At the end everything was good, but I still remember all my frustration back then.

So how do I find the correlation between this incident and photography? Well, many times I have a great idea or opportunity for a photo, but I am unable to realize it because of the lack of the equipment. Sometimes it’s possible to improvise, sometimes it’s not, and here are just a couple examples of what am I talking about.

Tripod

A tripod is a great piece of equipment even though many young photographers underestimate it. Especially now when cameras go up to ISO 12800, so it’s possible to shoot with shorter expositions even in dark places. But once when all that noise, which high ISO causes, starts to bother, the only option which remains is to find some steady spot and shoot with longer expositions.

So here is an example from when I was visiting Lapland with friends, and wanted to make some photos of auroras. When we finally got a chance to see some, I made couple test shoots and determined the best* setup. While I was doing that, friends already laid down and watched the show, so I decided to change the frame and put them into it.

Aurora borealis by Aleksandar Beserminji on 500px.com

 

 * This photo was shot at ISO 400, with 30 second exposition and aperture f3.5. I would go for higher f-number and lower ISO, but I didn’t have a remote trigger with myself (big mistake!), and camera settings didn’t allow longer expositions without the trigger.

In this situation I was lucky to have a tripod with me. I remember other friends improvising with bags, chairs, even making stands out of snow. It can work, but tripod really helped me out in this situation.

Beside this responsibility of tripod to help you take long exposure photos, you can also use one for keeping the camera steady while making HDR photos, for selfies and also for defense of wild animals that might attack you while photographing in a wild. In that situation, it’s a life saver 🙂

Lenses

Usually, when people buy their first exchangeable lens camera, they get some kit lens with it. Most of the time it’s 18-55mm f3.5-5.6 kit lens. It’s pretty good lens for the beginners, I’m using it quite much as my all around lens, but it has its own limitations. The photo above was made with a Nikon 10-24mm at its widest 10mm. I tried to shoot with a mentioned kit lens first, but photos weren’t that ‘nice’. They just didn’t transfer that feeling I had back then. TBH it wasn’t even my camera as I was shooting with Canon back then, so I had to borrow everything from a friend.

Following photo was made with a telephoto lens. I had my digital camera with me, but as I had only my kit lens for it, I was also carrying an old Zenite SLR with 200mm lens mounted on it. I could call it a half-way improvisation, and in this case it worked.

7009632527_a0a593675e_o

Flash

The built in flash can be useful in some situations, but in many times it’s useless. Some of the weakness of a built in flash are its power and fact it could not be taken off. You can find some solution how to use built in flash in a better way (sry it’s on Serbian, translation in progress), but there is a reason why they make external flashes.

So here is another example.

DSC_5880

I made this one with flash positioned behind the subject instead on the top of the camera, turned to shoot at the background. It was some old flash from some old camera and it was triggered by improvised cable. Way too much time spent on trying and trying, but at the end, I caught some nice moments, which would not be that nice if I shoot with built in flash. One more time, equipment wins.

Conclusion

I believe this gives you an idea, which you can apply to any piece of equipment. The more/better equipment gives you an opportunity to take specific shots, therefore you can make some good photos. Though in this blog, I presented examples which do require some specific equipment, it doesn’t mean you need all that equipment immediately when you buy a camera. In order to make great photos, you need to know first which equipment to use in which situation and how to properly utilize that equipment.

So when is it the right time to get new equipment?

For me it works the best when I get a feeling of limitation, when I cannot create the shoot I want with the equipment I have. Then I need to figure out how to get over it. Sometimes I finish improvising, sometimes I buy a new piece of equipment.

Flying with ATtiny and ESP8266

So I decided to make an RC airplane and to make it as simple as possible. No sensors, no autopilot, just raw commands from the remote executing on the airplane. I’m not saying that’s a good idea, but I decided to go like that.

attiny

Anyway, I wanted the airplane to be as most simple as possible. So there are servos, engine, battery, receiver and the micro controller. Initially, the idea was to use the Arudino Pro Mini, but in the meantime, I remembered that somewhere in my boxes I have ATtiny25. I wasn’t sure will it fit and on the first sight it didn’t. Most specifications I was able to find on the internet was saying that there are just two PWM outputs, and I needed one more of them. I also needed some sort of communication port like serial port which was not discussed in the datasheet. I lacked knowledge about that micro controller and I knew that. And I didn’t allow that to discourage me. I believed it should be able to do a job for me. I did a little research till late morning hours and it happened that I was right 🙂

Programming the ATtiny25

I didn’t have programmer for this ATtiny and I wanted to program it with my Arudino. I heard somewhere it is possible.

First, you need to upload a sketch to your Arduino to act like the ISP:

Then here is how to connect the ATtiny to the Arduino:

http://highlowtech.org/?p=1706

And after that, you’ll need some libraries, to explain your Arduino software how to program the ATtiny. If you have ATtiny 45/85 then I think this should work a job for you:

http://highlowtech.org/?p=1695

I had ATtiny25 so I also needed this:

https://code.google.com/p/arduino-tiny/

Getting one more PWM on the output

So as I said, there are two PWM outputs, and I wanted one more. I found the solution here:

http://www.technoblogy.com/show?LE0

It involved some advanced levels of Arudino programming (something weird on the first sight) but it’s worth it.

Getting serial Rx channel

My ATtiny needed only Rx line on Serial, for receiving the commands. As it turned out, it was not that simple to get one, and after looking what serial libraries are used, there was no support for the Rx, only for Tx. By default it was using TinyDebugSerial library which always returns -1 when Serial.available() is called. SoftwareSerial was too big for ATtiny, so I had to google something new. I found the solution here:

https://code.google.com/p/nerdralph/source/browse/#svn%2Ftrunk%2Favr%2Flibs%2Fbbuart

http://nerdralph.blogspot.com/2014/01/avr-half-duplex-software-uart.html

-assembler-with-cpp option does not exist

After installing mentioned library, I got this error. And it was easy to fix. The solution is here:

https://github.com/arduino/Arduino/issues/1807

After that, all I had to connect ATtiny to ESP8266 via serial port. And ofc to put everything together with servos, engine, wings etc.

At the end, I think it was possible to fly only with ESP8266 (some versions have more outputs), but that’s for some other story.

CSS Search box/field with icon

Couple days ago I had to help my friend with some web project he was finishing. He asked me if I’m familiar with CSS and the first thing that came to my mind was this:

 

family-guy-window-blinds
CSS

 

 

But I was like “Challenge accepted!”. There were more tasks and one of them was to create search box. And to keep story short, here is the result:

Animation
Animation

You can download the source code here. Feel free to post your opinions/bugs in the comments 😉

Better way of using parseJSON

While doing on some project I found myself in situation where, when parsing JSON data,  if server thrown an error (syntax error for example), I finished with only parsing error. Without information what happened wrong (without data that server returned), I was unable to solve the problem. So I decided to create function parseJSON2. Not to much creative name, but it did the job. Here it is:

jQuery._parseJSON2 = function(data) {
	var parsed = null;
	try {
		parsed = $.parseJSON(data);
	} catch(err) {
		console.error(err);
		console.error(data);
	}
	return parsed;
}

I modified my code to use this function instead of regular parseJSON function. This way, when server returned error, I had it printed in my console.

So feel free to use this function if you find it useful.

Edit:

Now here is another idea: When some error happen at the client side, send it to server.

During testing period, you may miss some use cases where error is hidden. But clients will for sure find that little bug.

That way you can track when some errors occurs at client side, which you did not reproduced earlier. And you can solve them.

Using prepared statement in PHP

So this is the result of using prepared statements in PHP on not so comfort way. Each time when I had to perform some query, I had something like this in my code

<?php
	$stmt = $con->prepare("SELECT * FROM table WHERE id = ?");
	$stmt->bind_param("i", $id);
	$stmt->execute();
	$results = $stmt->get_result();
?>

First problem occurred when I wanted to use this code on server where MySQL native driver for PHP was not enabled. When driver is not enabled, using get_result() function is not possible. It was free server, something I was doing just for fun, so it was not possible either to contact support or to install it by myself. Then I had to change the way I get results. And I had to do that on every single line in a code where I had query. A lot of work.

Second problem was a lot of repeating code which I don’t like. And I wanted to catch errors (which I didn’t do from the beginning). Again, I had to change my code on every place where I had query executing.

So I decided to create function, which will do executing queries instead of me.  I Googled a little bit, and found this.

That allowed me to create function like this:

<?php
	function prepareAndExecuteQuery($con, $query, $bindString, $bindArgs) {
		if (!is_array($bindArgs)) 
			exit ("prepareAndExecuteQuery - bindArgs not array");

		$n = strlen($bindString); 
		if ($n != count($bindArgs))
			exit("prepareAndExecuteQuery - bindString params count not equal to the bindArgs count");

		$a_params = array();
		$a_params[] = & $bindString;
		for($i = 0; $i < $n; $i++) 
			$a_params[] = & $bindArgs[$i];

		$stmt = $con->prepare($query);

		call_user_func_array(array($stmt, 'bind_param'), $a_params);

		if (!$stmt)
			exit("prepareAndExecuteQuery - Binding parameters failed");

		if(!$stmt->execute())
			exit("prepareAndExecuteQuery - Execute failed - " . $stmt->error);

		$result = $stmt->get_result();
		$stmt->close();
		if (!$result) 
			exit("prepareAndExecuteQuery - No results - " . $stmt->error);

		return $result;
	}
?>

Now when I have to execute some query I do it this way:

<?php
	$sql = "SELECT * FROM table WHERE id = ?";
	$result = prepareAndExecuteQuery($con, $sql,"i"', array($id));
?>

Less code and much more flexibility. If one day I decide to change something in execution of queries, I’ll have to do it just at one place.

I hope it will be helpful to someone else too 😉

 

  • 1
  • 2