How to take object reflection in water drop photo

 

DSC_3709_R DSC_3741_R DSC_3752_R DSC_6586

 

To take a shot like above you need following tools

Tools Required

1) injection syringe
2) Sugar mixed with water
3) Object which will reflect
4) Micro Lens(I used Nikkor 105mm)
5) Light
6) Tripod (Optional)

Setup

1) First put the focusing object and use syringe to put a drop on it. Try with multiple drops to make it perfect. If you use the syringe you can really drop a nice round shape water drop. And mixing sugar will let the drop stick to the surface.

2) Put the reflected object just behind the drop. In my case it was just 5-10 cm. Move the light to have a good reflection.

3) Now move your camera front and back to get a good reflection. macro focusing rails will work great for this purpose.

4) After getting a good focus set your camera to Aperture priority and f9-f16 to get a sharp drop.

Enjoy photography … :)

Better Quality Pictures

http://500px.com/photo/35047580

http://500px.com/photo/35061672

http://500px.com/photo/35061674

http://500px.com/photo/24685067

How to take picture of object covered with bubbles

Hi I was trying to shoot fruits with bubbles around it. After couple of try I came up with following result.

Lemon with bubbles

Orange with bubbles

 

 

 

 

 

 

 

 

 

 

 

To achieve the above result you need following items.

1) 7up or any type of sparkling water.

2) Toothpick

3) Slice of fruit

4) Light

5) Micro Lens (I used Nikkor 105mm)

6) Colorful papers

7) Square shape glass (I don’t have one I used drinking glass. To get better result use square glass)

8) Optional you can use tripod

 

Below is my setup

Lemon Bubbles Setup

Lemon Bubbles Setup

 

 

 

 

 

 

 

 

First hang up the slice with toothpick and then fill up the glass with sparkling water(7up etc..). Becareful don’t put cold water as it will make vapor outside of the glass and picture won’t be clear enough. And after that wait for sometime for the bubbles appear on top of the fruit slice.

You need to setup your camera in Aperture priority and use f9 – 15 to make the bubbles edges sharper.

You might need to use some photo editing software to remove the noise if any. Enjoy …. :)

Get HREF Atribute of anchor tag by class name in PHP

I was looking for extracting href value from html link(a) tags in PHP. Came up with the following solution. It’s useful to extract links from a website


function get_href_attribute("Google","a","my_tag")

function get_href_attribute($html,$tag,$class)
{

   // Load the HTML in DOM
   $doc = new DOMDocument();
   $doc->loadHTML($html);

   // Then select all anchor tags
   $all_anchor_tags = $doc->getElementsByTagName($tag);
   $href_array = array();
   foreach ($all_anchor_tags as $_tag) {
      if ($_tag->getAttribute("class") == $class) {
         // If match class get the href value
         $href_array[] = $link->getAttribute("href");
      }
   }
  return $href_array;
}

Call JavaScript functions from Flash AS3

For one of my project clients want to use Lightbox in there website which is fully build of Flash AS3. I was wondering how to do that?
It will take time to make a gallery in Flash like Light Box. I was looking online if is there any way to call JavaScript functions from Flash.
Following is the simplest way to call JavaScript from Flash AS3.

The code which is required to call the function in AS3 is

import flash.external.ExternalInterface;
ExternalInterface.call("myFunction()");

Here myFunction() is the JavaScript function which is already there in my HTML page.
Very simple to call JS fuctions. By this I made my life easier by giving the almost same
feelings to my client of Flash and JQuery animations. Which might take more effort if
I try to make the same animation in Flash.

Download sample Example

test.zip

Software Engineering Interview with Google

1st Interview

 

It was 27th April 2011 I was just checking out my linkedin profile,  I noticed someone viewed my profile from Google Engineering Recruiter. I got the person email address and just sent my CV to the person. After that immediately the person replied and ask some questions about skills. We exchanged emails regarding my skills several time.

 

Then she was pleased with my skills and asked for available time for phone interview. We agreed on 5th May 2011 for the interview. The interview was friendly and I was really amazed from her friendly behavior. It was about 30 minutes interview just to check out if I am ready for a technical interview with a Software Engineer or with the team they are looking for.

 

Interview topics was related to the pure Computer Science Subjects. It includes Memory Management, Database, Registers of the Processors, Assembly Language, Number Conversions, Algorithms etc. If you are planning for the interview or you are scheduled for one just review those subjects. It’s not an interview to how to code it’s more core subjects of Computer Science. My interview was fare( my point of view). After this interview I received an email on 12th May 2011 stated that “We carefully reviewed your background and experience, and though we do not have a position that is a strong match with your qualifications at this time, we will be keeping your resume active in our system.”… :P . But honestly that was a great experience and for the first time I felt that I am giving an interview… :)

 

That was the end of my interview process. I was happy that at least they took a phone interview while I left C/C++ coding almost for more than 4 years ago.

 

2nd Interview

 

On 20th June I received an email from another recruiter stating that he saw in their database I chatted with a recruiter on May but my CV is good enough to fit for the post so he want me to give another chance for telephone interview. We exchanged some emails regarding the location I would like to relocate. I choosed Australia. Then he contacted Google office Australia for vacancy and forwarded my email there.

 

From Australia Google office a Software Engineer contacted me and scheduled a technical telephone interview on 7th July 2011. I was excited that time that they contacted second time and it’s now technical interview with a Software Engineer. There communication and behavior was so friendly that they were helping me whatever they can.

 

The recruiter sent me the resource for the preparation of the interview that amazed me most. They really want to hire people and they are doing that often. So he sent me the following preparation tools. I think there was no agreement with me about sharing this resources and it’s public. Just sharing with you if you really want to prepare yourself for the interview with Google.

 

The phone interview is designed to test your CS fundamentals (Big-O notation, coding, algorithms, etc.). I have included some tips and hints about the process below.

TIPS:
* Our interview style may differ from what you’ve experienced elsewhere, and tends to be highly technical. The interviewer will be interested in the specifics of your past projects, implementations and how you arrived at your conclusions. Interview may cover data structures and algorithms (i.e. Big-O Notation). You will be asked to write code.

* Many of the questions asked in Google interviews are open-ended because our engineers are looking to see how you engage the problem. Be sure to talk through your thought process about the questions you are asked, as well as your approach to problems and solutions. Ask specific questions if you need more clarification.

* Think about ways to improve the solution you’ll present. In many cases, the first answer that springs to mind may need some refining. It is worthwhile to talk about your initial thoughts to a question. A brute force explanation will be received less well than taking time to compose a more efficient solution.

LINKS:
Interviewing at Google
Google Products
Google Labs
The Official Google Blog: Baby steps to a new job by Gretta Cook (Google Engineer)
How to Get Hired by Dan Kegel (Google Engineer)
How to get a job at Google, interview questions, hiring process (Google Engineer)
Five Essential Phone Screen Questions by Steve Yegge (Google Engineer)
Types of algorithm questions Google asks (more C++ focused):Top Coder Tutorials
Industry News:Search Engine Land

BOOKS:
(#2 was highly recommended by several engineers and quite representative of the types of coding questions asked)

1. Review of Basic Algorithms: Introduction to the Design and Analysis of Algorithms by Anany Levitin
2. Types of coding questions Google asks:  Programming Interviews Exposed; Secrets to Landing Your Next Job (Programmer to Programmer) by John Mongan, Noah Suojanen, and Eric Giguere

Software Engineers:

Coding
-construct / traverse data structures
-implement system routines
-distill large data sets to single values
-transform one data set to another

Algorithm Design / Analysis
-big-O analysis
-sorting and hashing, searching
-handling obscenely large amounts of data
-also see topics listed under ‘Coding’

System Design
-feature sets
-interfaces
-class hierarchies
-designing a system under certain constraints
-simplicity and robustness
-tradeoffs

Open-Ended Discussions
-biggest challenge faced
-best / worst designs seen
-performance analysis and optimization
-testing
-ideas for improving existing Google products

 

As I was lazy I didn’t prepare for the interview.

On the scheduled day Software Engineer called me on my cell and they sent a link of Google Doc online where I can code. He was like a friend. He introduced himself that he is currently working on Google+ project. First he just asked me some basic questions what I do and what I am working on currently. Then he gave me some problems and asked me to solve that problems using any programming language. As I am now programing in PHP so I code it in PHP and he helped me lot for making the code perfect. It was almost 1 hour interview. I didn’t faced any problem on the interview. Solved all the problems perfectly.

After that interview I received an email on 18th July 2011 same email like before that I am not currently fit for the position….:P

I just shared it with you that it’s not a big deal to apply in Google for Software Engineering position. If you are a graduate of CS or CSE then you can apply. Doesn’t matter you have experience or not. Just apply. Even if you are not planning to work with them at least face the interview it’s a good experience. Google interview was the only interview I felt that I am giving an interview… :)

 

How to apply at Google (my experience)

First just look for an Google Engineering recruiter in linkedin or facebook send him/her the CV with a proper cover letter.

And prepare yourself for the interview by covering the topics they mentioned to me. Very simple as like that.

You are failure al ready why you want to miss the chance of success. There is nothing to loose… ;)

OnTextChanged function in C# for ASP Text Box in ASP.NET

I tried to write a function while OnTextChanged of ASP TextBox but it didn’t work. I came up with that you have to write AutoPostBack=”true” to call the function. I want it because one of my client ask for showing preview while they changed the article before publishing or saving it. So it’s helpful while they change something in text box they can see the preview immediately. You can do this by calling a simple function.

<asp:TextBox ID="page_name_en" OnTextChanged="change_title" autopostback="true" runat="server"  />
preview here

C# Code

protected void change_title(object sender, EventArgs e)
{
//Get the text from text box
string text = ((TextBox)sender).Text;
//Preview the text and show it in Div
preview.InnerHtml = text;
}

My notes on “Getting Real” Book by 37signals

Getting Real is one of the great book by 37signals for developer, designer or entrepreneur. I love the book. A must read book. I wrote some notes from the book for myself.
So I can review it anytime. I thought it might be helpful for others so I shared my notes down. You can read the book free online Getting Real. All the credits goes to 37signals.
Thanks for writing this book.

My Notes for review

The Starting Line Chapter 2-3

  1. Deal with the actual problems you’re trying to solve instead of your ideas about those problems.
  2. Do less than your competitors to beat them.
  3. Solve your own problems. You’ll be the target audience and you’ll know what’s important and what’s not.
  4. Focus on building a quality tool that you and your customers can live with for a long time.
  5. Scope down. It’s better to make half a product than a half-assed product.
  6. Best way to know what your app should be is to know what it shouldn’t be.
  7. Keep your app small and manageable so you can actually enjoy the process.
  8. Let’s focus on what we need to focus on right now.
  9. The leaner you are, the easier it is to change.
  10. Start with a developer, a designer, and a sweeper (someone who can roam between both worlds).
  11. Metcalfe’s Law, that “the value of a communication system grows at approximately the square of the number of users of the system,”
  12. Let limitations guide you to creative solutions.
  13. Smaller companies are closer to the customer by default.
  14. Differentiate yourself from bigger companies by being personal and friendly.

    Priorities Chapter 4

  15. What does your app stand for? What’s it really all about?
  16. Work from large to small. Always.
  17. Don’t waste time on problems you don’t have yet
  18. Find the core market for your application and focus solely on them
  19. If you try to please everyone, you won’t please anyone
  20. Don’t think about scaling problem until you have one.

Feature Selection Chapter 5

  1. Build half a product, not a half-ass product
  2. Cut out the work and thinking that just don’t matter, you’ll achieve productivity you’ve never imagined.
  3. Innovation is not about saying yes to everything. It’s about saying NO to all but the most crucial features.
  4. Build something you can manage. It’s easy to make promises. It’s much harder to keep them.
  5. Build software for general concepts and encourage people to create their own solutions.
  6. Let your customers remind you what’s important. You can’t forget what’s important when you are reminded of it every day.
  7. Ask people what they don’t want. If you could remove one feature, what would it be?

Process Chapter 6

  1. Get something real up and running quickly. It’s ok to do less, skip details and take shortcuts in your process if it’ll lead to running software faster.
  2. Work in iteraions. Don’t expect to get it right the first time. Let the app grow and speak to you.
  3. Come up with ideas (Brainstorm), Sketch it in paper, Make mock up html and then go for coding.
  4. Avoid Preferences like chosing 25,50 or 100 results per page. Don’t put the burden on users while it’s your responsibility.
  5. Value the importance of moving on and moving forward. Take Decisions quickly as accepting that mistakes will happen and realize it’s no big deal as long as you can correct them quickly.
  6. Test your app via real world usage. Get real data, Get real feedback then improve based on that info.
  7. Break the Project in smaller chunks. Break 30 hours into smaller 6-7 hours.

The Organization chapter 7

  1. Unite the team. Hire people with multiple talents who can wear different hats during development.
  2. Make or manage some time at least half of your working time alone without any interruption like email response, phone call, making coffee etc. Make this time completely alone and concentrate in your work.
  3. Don’t have meetings. Reduce meetings as much as you can.
  4. Seek and celebrate small victories. “What can you do and release in 4 hours?” . A simple feature or update and release it.

Staffing Chapter 8

  1. Don’t hire unless you feel extreme necessity.
  2. Give a test project to your new employee.
  3. Hire based on open source contribution.
  4. Hire someone who can wear different hats. Designer who can also write and programmers who understand design.
  5. Hire someone who’s enthusiastic. Someone you can trust to get things done.
  6. If there is few people to fill a position hire good writers.

Interface Design Chapter 9

  1. Design the interface before start programming. Sketch it or making html is cheap and easy to change.
  2. Start designing from core of the project(epicenter). The most important piece of content first then go for 2nd important, 3rd…etc.
  3. Design for regular(The screen people see always), Blank(The screen people see first time) & Error(The screen people see when something goes wrong).
  4. Don’t focus only regular state focus also on blank slate. Because this is the first impression of your project for the users.
  5. Design for when thing goes wrong. Defensive design is like defensive driving.
  6. Consistency is not necessary. Give people what they need, when they need it and get rid of what they don’t. It’s better to be right than to be consistent.
  7. Every letter matters. You need to speak the same language as your audience too.
  8. One Interface for admin and public interface. Just build add, edit and delete function to regular application interface.

Code chapter 10

  1. Less software, less code. Keep your code as simple as possible.
  2. Choose tools that keep your team excited and motivated.
  3. Listen to your code. It will offer suggestions, it will push back and it will tell you where the pitfalls reside.
  4. Regularly put aside some time to pay off your code and design debt.
  5. Open the door for your app. Get data out into the world via RSS, APIs…etc..

Words chapter 11

  1. Don’t write a functional specifications document.
  2. Eliminate unnecessary paperwork.
  3. Write a quick story instead of details.
  4. Insert actual text instead of lorem ipsum.
  5. Think of your product as a person and give it a personality(strict, funny, serious etc..). Use them to guide copywriting, interface and the feature set.

Pricing and Signup chapter 12

  1. Give something away for free.
  2. Make it as easy as possible to get in and get out of your app for the user. Make signup and cancellation a painless process.
  3. No one likes long term contracts, early termination fees, or one time set-up fees. So avoid them. Try to make products bill on a month to-month basis.
  4. Soften the blow of bad news with advance notice and grandfather clauses.

Promotion chapter 13

  1. Go from teaser to preview o launch.
  2. Promo Site with overview, tour, screen captures and videos, manifesto , case studies, buzz, forum, pricing & sign-up and weblog.
  3. Blogging is be more effective than advertising and it’s cheaper.
  4. Share your knowledge with the world and promote through education.
  5. New or interesting features are a great way to generate buzz for your application.
  6. Check who’s is talking about you? Who’s bitching about you? Leave comments on those blogs and thanks people for posting your link.
  7. Promote upgrade opportunities inside the app.
  8. Give your app a name that’s easy to remember instead of a big name. Don’t sweat it if you can’t get the exact domain name

Support chapter 14

  1. Developers/Designers should act as also support with customer. They should hear and answer the customer.
  2. Use inline help and FAQ’s so you wont’ need a manual or training for your customers.
  3. Answer quick to your to your customer email. Don’t use more that 1 hour to answer them.
  4. Don’t consider all the request from the customer. Try to say no.
  5. User forums or chat to let customers help each other. You’ll be surprised how much want to help one another.
  6. Get bad news out to customer as soon as possible. Be honest to your customer. Good news should be trickled out slowly.

Muslim Prayer World Map

One of my professor Dr. Meyassar Al-Haddad in his research he came up with that we can represent our prayer times in a line. So we can know what is the prayer times going on right now. Which part of the world is praying Fajr/Duhur/Asr/Maghrib/Isha right now. It’s
very helpful for the people who is traveling and don’t know what prayer time is going on as they are in air or water but by this line
if they know which locaion they are they will know what prayer they should perform.

So me and Mr. Sohail Ahmed helped the professor to make it happen.  With the continuous support and guidelines of Mr. Sohail we reached our goal. We tried best to make it perfect. But still it needs more work to be accurate. Click on the following picture to see the map.

Prayer Time Map

If your computer time is accurate it will show you accurate result. You can see the lines representing which area of the world is praying which prayer. Your feedback will be very helpful to improve the map. This is a gift to Muslim Community. Free for everyone to share and give feedbacks so we can make it a perfect Muslim prayer time world map. All the credits goes to Dr. Meyassar Al-Haddad. May Allah bless him with great reward.

How & Where to Start iOS Development?

Check out my presentation at DevDay on “How & Where to Start iOS Development?”

I tried to focused on general questions regarding how to start iOS development for beginners and I shared my experience while tried to register for iOS developer program and submission  of apps in iTunes Store. It might be helpful for some of you…. :)