A few days ago I found a totally new syntax like
auto ClassName::functionName() -> something.
Then I started to find out what does it mean and got my answer. Today I am going to share this.
Lets we have a class as
what do you think? is there any problem?
Actually there is a problem. The enum Type declared inside the Class and when we will try to define the function outside the class, compiler will not found the Type there. In this case
will cause an error.
Now there is a solution to avoid this error is to define the function inside the class. But what if you we don’t want to do that. How can we define such functions outside the class?
here comes the syntax We talked about.
This is the feature of C++11.
in our case our function will be
auto Problem::getType() -> Type
Posted in C++
Tagged auto, C#, C++11
Today I am going to share how to detect the human skin using YCbCr color space in OpenCV. It is very easy. Here I made an class that will detect the skin.
Last day I needed to check the UITextField ‘s text whether it is from English language or other Unicode character form other language. And also how many characters are form English language and how many from others?
Here is how I solved this problem.
for(int i=0;i<[textField.Text length];i++)
unichar lastChar = [textField.Text characterAtIndex:i];
if(lastChar >= 0x000 && lastChar <=0x255)
unichar is the type for Unicode characters and if its value is from 0x000 to 0x255 then this character is from English language. Otherwise it is from other language.
If you know any better solution please share with us.
Sometimes we need an accessory view of uitextfield to perform some action like hide the keyboard. To solve this I create a class which will add a toolbar on top of the keyboard holding a done button. If done button is pressed then keyboard will be hide.
The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.
Here’s an excerpt:
4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 33,000 views in 2012. If each view were a film, this blog would power 8 Film Festivals
Click here to see the complete report.
Today I face a problem in developing my app for iPad. I am checking the current orientation of my device using the following function and checking weather it is in Portrait or Landscape mode. This was working for iPhone 5.1 simulator properly but when I am checking this for iPad Simulator 5.1 it’s not working.