Tuesday 30 June 2015

How to show an alert view in Swift Programming Language?

To show an alert in Swift programming language, you need to first import the UIKit framework then use UIAlertController object. A UIAlertController object displays an alert message to the user. To Read complete information about alert view in Swift Programming Language visit FindNerd.
As it is an effective technology forum, so here you can also ask questions & look for various programming queries along with their solutions including android, php, java, c programming questions and answers etc. 

Friday 26 June 2015

How to implement underline textfield in Xcode

Hi, The tutorial will help you to set underline textfield in Xcode.
  1. #import <UIKit/UIKit.h>
  2. @interface UnderlinedTextField : UITextField
  3. @end
To Read complete information about “implement underline textfield in Xcode ” visit FindNerd. As it is an effective technology forum, so here you can also ask questions & look for various programming queries along with their solutions including android, php, java, c programming questions and answers  etc.

Thursday 25 June 2015

Send Push Notification to iPhone device from Java Server Side

This blog will help you to send Push Notifications to iPhone devices from server side where server side code is written in Java.
Follow the below code in order to send Push Notification:
Define the below dependency in you pom.xml, if you are using maven:
com.github.fernandospr
javapns-jdk16
2.2.1
To Read complete information about “Send Push Notification to iPhone devices” visit FindNerd . Apart from this ,you can also ask questions & look for various programming queries along with their solutions including android,php, c, java programming questions and answers etc.as it is an effective technology forum also.

Wednesday 24 June 2015

External Dependencies in Maven Project

Dear programmers,
There may many chances when you try to add external dependencies in your Maven project. Let’s learn this how we can add our own jars or external jars in a project with an example.
There are many Maven plugins available, And one of them is install-file, witch could be use to fix the problem. It creates and adds external jar to a local repository and make available to use in Maven project.
To Read complete information about “External Dependencies in Maven Project” visit FindNerd . As it is an effective technology forum, so here you can also ask questions & look for various programming queries along with their solutions including android, c,java,php programming questions and answers etc.

Tuesday 23 June 2015

How to use UISearchBar with TableView in iOS

If we have a huge list of items and want to search a item from the list then we use the UISearchBar with TableView and the item will be displayed in the table which have the matching value with the search text .
Here are the steps:
Step1: Add UITableView to the main.storyboard.
Step2: set the delegate and dataSource for the tableView
Step3: Create the outlet for tableView with following Syntax __weak IBOutlet UITableView *myTableView;
To Read complete information about “UISearchBar with TableView in iOS” visit FindNerd . Apart from this ,you can also ask questions & look for various programming queries along with their solutions including android, c,java,php programming questions and answers etc.as it is an effective technology forum also.

Monday 22 June 2015

Spring JAXB Integration

JAXB stands for Java Architechture for XML Binding. JAXB is a popular api for the Java object mapping with the xml. With JAXB we can map a Java object to it’s corresponding XML document. It is also called an OXM (Object XML Mapping) or O/M framework provided by Sun.
To Read complete information about “Spring JAXB Integration” visit FindNerd. Apart from this, you can also ask questions & look for various programming queries along with their solutions including Android, Java, Php, c programming questions and answers etc. as it is an effective technology forum also.

UIImage Cropping in Objc

Sometimes we click picture from ios camera but it does not return us the same image as appears inside the camera frame. Use below function to get an image of exact size which was visible through camera.
Follow these Steps:-
Step 1. First of all set the captured image to an UIImageView.
Step 2. Pass that camera uiview to below function so that we can get visible frame of opened camera view.
Step 3. Also pass the UIImage (captured photo) as a param to below function.
To Read complete information about “UIImage Cropping in Objc” visit FindNerd. As it is an effective technology forum, so here you can also ask questions & look for various programming queries along with their solutions including Android, C, Java, php programming questions and answers etc.

Friday 19 June 2015

How to use new fonts in iPhone SDK?

Following are the steps to add new fonts which not available in iOS sdk.
1) Download the font file and add that file in resource folder
2) go to App- info.plist and add key “Fonts provided by application” and in value add the name in that font.
To Read complete information about “How to use new fonts in iPhone SDK?” visit FindNerd. Apart from this, you can also ask questions & look for various programming queries along with their solutions including Android, Java, Php, c programming questions and answers etc.as it is an effective technology forum also.

Spring OXM Castor Example

Spring OXM Castor Example
Spring OXM using Castor : Spring has the feature of xml/object binding. To bind the Object/XML spring use different api. Castor XML mapping is a way to binding the Java object to XML document. It allows to transform the data in java object into/from an XML document. Castor allows the user to specify the some of it’s configuration of marshalling/unmarshalling behaviors using a xml mapping file.
To Read complete information about “Spring OXM Castor Example” visit FindNerd. As it is an effective technology forum, so here you can also ask questions & look for various programming queries along with their solutions including Android, C, Java, Php programming questions and answers etc.

Wednesday 17 June 2015

Accessing JNDI DataSource with JSTL from JSP

JSTL Sql tags with JNDI datasource : In this article we will show you how to create the JNDI datasource and access it using the JSTL tag library. We will use the tomcat DBCP Connection Pool defined in context.xml, to execute an SQL query and output the data using JSTL in a JSP page.
Steps to create JNDI datasource and code :
Step 1: First you need to have some important jar files inside your project’s lib
To view full blog of  Accessing JNDI DataSource with JSTL from JSP please visit FindNerd .

JSTL Sql Tag

JSTL Sql setDataSource Tag : Jstl provides the facility to deal with database. JSTL has the separate sql tag library which provides the tags to do database operations. JSTL provides the <sql:setDataSource> tag which is used to create the database connection. JSTL setDataSource tag create the connection with database and holds that connection in the local variable to use it later with the help of scope attribute.
Click here “JSTL Sql Tag” to know more. For more Java blogs visit our java development blogs section.
FindNerd is providing programing queries solutions. Visit us post your query of Android, Php, Java, c programming questions and answers etc., on our ask question section and get instant solution.

WooCommerce Or Magento - What to use and when?

Magento and WooCommerce are currently the top two frameworks in use for e-commerce websites over the web. Both are backed by strong open-source communities developing plugins for various functionalities a shopping site might need – Magento, through Magento Connect and Woocommerce, through being an all-out open-source themed marketplace. Owing to these and many other factors, it sometimes becomes overwhelming to tackle the question – “Which one to use for my shopping site?!”
To Read complete information about “Woocommerce Or Magento” visit FindNerd. Apart from this, you can also ask questions & look for various programming queries along with their solutions including Android, Php, C, java programming questions and answers etc.as it is an effective technology forum also.

Tuesday 16 June 2015

Some keyboard shortcuts in Xcode







Xcode provides many keyboard shortcuts that can save our lot of time.
Here is a list of few shortcuts that you might want to try out:
cmd+shift+o Open quickly
ctrl+cmd+left arrow Go Back
ctrl+cmd+right arrow Go Forward
To Read complete information about “Some keyboard shortcuts in Xcode” visit FindNerd. Apart from this, you can also ask questions & look for various programming queries along with their solutions including Android, C, Java, php programming questions and answers etc.as it is an effective technology forum also.

Monday 15 June 2015

How to set Camera view aspect ratio in iOS

Sometimes we face problem with Camera view aspect ratio in ios. Solution to this problem is here.. Set its aspect ratio property to AVLayerVideoGravityResizeAspectFill. It actually preserve aspect ratio; fill layer bounds.
  1. AVLayerVideoGravityResizeAspectFill may be used when setting the videoGravity
  2. property of an AVPlayerLayer or AVCaptureVideoPreviewLayer instance.
For full blog of  “How to set Camera view aspect ratio in iOS” visit FindNerd & for more iPhone blogs visit our iPhone development blogs section.
You can also ask questions & look for various programming queries along with their solutions including Android, C, Java, php programming questions and answers etc. as it is an effective technology forum also.

Friday 12 June 2015

Make UIImage White Background Transparent in iOS

If you came across to a requirement where you want to make UIImage Background Transparent then use below method to achieve it.
  1. +(UIImage *)changeWhiteColorTransparent: (UIImage *)image{
  2. CGImageRef rawImageRef=image.CGImage;
  3. const CGFloat colorMasking[6] = {222, 255, 222, 255, 222, 255};
To Read complete information about “Make UIImage White Background Transparent in iOS” visit FindNerd. Apart from this, you can also ask questions & look for various programming queries along with their solutions including Android, C, Java, Php programming questions and answers etc. as it is an effective technology forum also.

Thursday 11 June 2015

Accessor Methods in iPhone

Accessor methods is used to access or set an object’s properties:
Syntax-
  1. NSString *firstName = [somePerson firstName];
  2. [somePerson setFirstName:@”Johnny”];
These accessor methods are by default and automatically synthesized by the compiler, therefore, now you only have to declare the property using @property in the class interface.
To Read complete information about “Accessor Methods in iPhone” visit FindNerd .
For more iPhone blogs you can visit to our iphone development blogs section. As it is an effective technology forum, so here you can also ask questions & look for various programming queries along with their solutions including Android, Php, Java, c programming questions and answers etc.

Wednesday 10 June 2015

Setup Facebook app invites of an iOS app

Hello reader's !
If you want to setup Facebook App Invites of an iOS app then follow these steps.
  • Using Facebook graph API , make a request to get facebook app_access_token (app_access token is not login access_token) . I m using google chrome postman to make request as shown :-


    alt text
  • To Read complete information about “Setup Facebook app invites of an iOS app” visit FindNerd . Apart from this ,you can also ask questions & look for various programming queries along with their solutions including android,php, c, java programming questions and answers etc.as it is an effective technology forum also.

Tuesday 9 June 2015

How to Upload Spring File in JAVA


FindNerd is social programming platform for java developers, you can learn and post your java programming questions and get answers from FindNerd Java developer forum, Now let’s focus on our topic.





Spring is a framework which provides almost all types of functionality. Spring has feature to stream based file upload. Spring file upload is very easy and maintainable. Spring provides the api to upload file streams. Like java IO spring has some classes to process file streams. 

To Read complete information about “How to Spring File Upload in JAVA” visit FindNerd.
For more java blogs you can visit to our Java development blogs. As it is an effective technology forum, so here you can also ask questions & look for various programming queries along with their solutions including Android, C, Java, php programming questions and answers etc.

How to check if the email is valid in iOS sdk

Many apps require email validation in iOS. Here the function that can be used to check if email string is valid or not. It can be achieved by NSPredicate like following:
  1. -(BOOL)isValidEmail:(NSString *)checkString
  2. {
  3. long numberOfAtPieces = [[checkString componentsSeparatedByString:@"@"] count];
  4. if (numberOfAtPieces > 2){
  5. return NO;
  6. }
  7. BOOL stricterFilter = NO;
  8. NSString *stricterFilterString = @"[A-Z0-9a-z\\._%+-]+@([A-Za-z0-9-]+\\.)+[A-Za-z]{2,4}";
  9. NSString *laxString = @".+@([A-Za-z0-9-]+\\.)+[A-Za-z]{2}[A-Za-z]*";
  10. NSString *emailRegex = stricterFilter ? stricterFilterString : laxString;
  11. NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
  12. return [emailTest evaluateWithObject:checkString];
  13. }
Just past the checkString as email you want to validate and it returns 'YES' if email is valid else returns 'NO'.


For such more Blogs you can visit to http://findnerd.com/NerdDigest

Thursday 4 June 2015

Protocol Inheritance

Like classes and controllers, protocols itself can also be extended and can be used to produce new protocols.
Here we are creating a base Protocol with superset methods.
We can also call it original protocol. it is inherited from NSObject, like other classes in C.
  1. @protocol BaseProtocolDelegate <NSObject>
  2. - (void)testProtocol;
  3. @end
  4. @interface BaseViewController : UIViewController
Here we are creating a child Protocol inheriting Base protocol
  1. @protocol ChildProtocol <BaseProtocolDelegate>
  2. - (void)testChildProtocol;
  3. @end
  4. @interface FirstViewController : BaseViewController
  5. @property (nonatomic, retain)id <ChildProtocol> childProtocol;
we can call/use methods of protocols like:
  1. [childProtocol testProtocol];

For such more Blogs you can visit to http://findnerd.com/NerdDigest

Wednesday 3 June 2015

Difference between "==" and "isEqual:" in objective C

These two operators or function can be used to check equity of objects or operands. "==" is used to check if pointer values of objects are same. However "isEqual:" is used to test if both objects are having same values. So "==" works on reference and "isEqual" works on value. It can be easily understand by following example:
  1. NSMutableArray *array1 = [[NSMutableArray alloc]initWithObjects:@"A", @"B", nil];
  2. NSMutableArray *array2 = [[NSMutableArray alloc]initWithObjects:@"A", @"B", nil];
  3. if (array1 == array2) {
  4. NSLog(@"==");
  5. }
  6. if ([array1 isEqual:array2]) {
  7. NSLog(@"isequal");
  8. }
It will print "isEqual" because pointer values for both array1 and array2 are different
Second case:
  1. NSMutableArray *array1 = [[NSMutableArray alloc]initWithObjects:@"A", @"B", nil];
  2. NSMutableArray *array2 = [[NSMutableArray alloc]init];
  3. array2 = array1;
  4. if (array1 == array2) {
  5. NSLog(@"======");
  6. }
  7. if ([array1 isEqual:array2]) {
  8. NSLog(@"isequal");
  9. }
It will print "isEqual" and "==" because reference and value for both array1 and array2 are same
Third case:
  1. NSMutableArray *array1 = [[NSMutableArray alloc]initWithObjects:@"A", @"B", nil];
  2. NSMutableArray *array2 = [[NSMutableArray alloc]init];
  3. array2 = [array1 mutableCopy];
  4. [array1 addObject:@"C"];
  5. if (array1 == array2) {
  6. NSLog(@"======");
  7. }
  8. if ([array1 isEqual:array2]) {
  9. NSLog(@"isequal");
  10. }
It will print nothing because reference and value for both array1 and array2 are changed

For such more Blogs you can visit to http://findnerd.com/NerdDigest

Php Developer forum to find 10 Useful Plugins in CakePhp

In this blog you will get to know 10 useful plugin in cakePhp which are very useful for php developers whether they are fresher’s & experienced. All these plugin’s make your web application perform better with enhanced functionalities. This is one of the startup php blog from Findnerd.com which is a C,JAVA,.NET,JAVA SCRIPT, php developer forum and contained alot more information on web technologies & the registered user’s can explore more php programming questions and answers.

Now let’s focus on the complete blog:

CakePHP allows us to set up a combination of models,views ,controllers and release them as a packaged application called Plugins which can be used in the CakePHP applications.

Some of the useful Plugins in CakePhp web application are as follows:-

1) Search Plugin-
This Plugin is used for the searching of the data from various tables of the database. This Plugin consists of a Behavior that makes a custom ‘search’ find type available to the Models, with special options for database filtering and highlighting results.

2)Re-Captcha Plugin Recaptcha Plugin is valuable for:


a)Automated scripts from accessing the application website.

b)Forums that want to prevent spam/ads from signing up

c)Protecting downloads from automated access by bots (which is not a security risk in itself, but a bandwidth drain)

3) ACL Plugin-We should have an application controlled by Auth and Acl. So the Users permissions are set at the group level. One can also set permissions on a global and per-controller and per-action basis. This Plugins gives you to have a reusable block of code to easily expand your ACO table as your applications grows.

4) Email MailGun Plugin-This Plugins allows you to send the email via a MailGun by using the provided SDK.

5) Paypal Plugin-
It's a plugin to interact with Paypal's "classic" and new REST APIs for payment processing..

- See full blog: http://findnerd.com/list/view/10-Useful-Plugins-in-CakePhp/2846/

Tuesday 2 June 2015

Objects and Method parameters and Return types in Objective C

Objects: In general objects are the real world entity. Earlier the two functions communicate with each other using the function call(say programming in c) but the programmer need more better approach for communication between the two functions or classes so the concept of object is implemented. Using the concept of objects the message passing is became more easier and programmer can use it in more effective way to pass the message from one class to another or for accessing the members of the class.
Usage of objects:
1) To allocate the memory.
2) To access the member of the class(that include member Function and member functions).
3) Reusability Of code.
how to Create Objects:
  1. @interface Person : NSObject
  2. @property NSString *firstName;
  3. @property NSString *lastName;
  4. -(void)showEmplRecord();
  5. @end
here we have created a class call person and it have some attributes like firstname and lastname and they are of string dataType… for accessing them use the object of that class for example…
  1. classname *objectname=[[classname alloc]init];
  2. object of the class will be created as:
  3. Person *perobj=[[Person alloc]init];
  4. And we can access the class member as:
  5. Perobj.firstName;
  6. Perobj.lastName;
Methods: A method is a procedure or process to get some task done with some specific instructions. In other language like C, the method name is refer to a block of code in receiver class by compiler. In Objective C language the receiver of message is identified at run time with the help of object on which the message being passed. That means at compile time message passing system do not check if there is any receiver of message to receive it or not. It can happen that the method for the message is not implemented in receiver class. In this case it will raise an exception.
Class Methods are called on the class name itself, independent of an instance: [classname methodName]; in above example method can be called as [Person showEmplRecord];

Parameter of a method: Arguments:  A argument is like a placeholder. When a function is invoked, you pass a value to the argument. This value is referred to as actual parameter or argument. The parameter list refers to the type, order, and number of the arguments of a method. Arguments are optional that is, a method may contain no argument. If the method has no argument is the parameter list will be blanked. And if the parameter has some argument they are listed after the method name like this-
Method with no argument: - (void) max;
Method with 1 argument: : - (void) max:(int) num1 ;
Method with More Than 1 argument: - (void) max:(int) num1 secondNumber: (int) num2 ;

Return type of a method: The return type of a function defines the type of the result that method needs to return if it was declared with a return type. The resultant return type must match the return type of method declaration. To return a value from method to message passing object return keyword must be used. If a function is declared with return type void, a return statement containing an expression generates a warning and the expression is not evaluated.  Simple code to under stand the concept of return:
  1. #import Foundation/Foundation.h>
  2. -(int)sum: (int )a secondPara:(int)b;
  3. int main (int argc, const char * argv[])
  4. {
  5. NSLog (@"Sum Of the No are=%d");
  6. return 0;
  7. }
  8. -(int)sum: (int )a secondPara:(int)b
  9. {
  10. return a+b;
  11. }
If a method is declared with any return type than it should return a value.. See In example the function sum declared with the int datatype so it is returning the int value(return a+b). and the main method is returning zero to the operating system that it is terminating normally.


For such more Blogs you can visit to http://findnerd.com/NerdDigest

Monday 1 June 2015

How to Compress Video File Through coding in iOS

  1. - (void)compressMyVideo:(NSURL *)videoPath completionBlock:(void(^)(id data, BOOL result))block{
  2. NSLog(@"compressing ====%@", videoPath);
  3. completionBlock = block;
  4. NSURL *videoURL = videoPath;//[NSURL fileURLWithPath:videoPath];
  5. NSLog(@"video url is== %@", videoURL);
  6. NSString *outputPath = [self outputFilePath];
  7. NSURL *outputURL = [NSURL fileURLWithPath:outputPath];
  8. [self convertVideoToLowQuailtyWithInputURL:videoURL outputURL:outputURL handler:^(AVAssetExportSession *exportSession)
  9. {
  10. if (exportSession.status == AVAssetExportSessionStatusCompleted)
  11. {
  12. printf("completed\n");
  13. completionBlock(outputURL, YES);
  14. }
  15. else
  16. {
  17. printf("error\n");
  18. completionBlock(nil, NO);
  19. }
  20. }];
  21. }
  22. // Getting the path of outPut file
  23. - (NSString *)outputFilePath{
  24. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  25. NSString *documentsDirectory = [paths objectAtIndex:0];
  26. NSString *path = [documentsDirectory stringByAppendingPathComponent:@"compressed.MOV"]; NSFileManager *fileManager = [NSFileManager defaultManager];
  27. // return path;
  28. if ([fileManager fileExistsAtPath: path])
  29. {
  30. [fileManager removeItemAtPath:path error:nil];
  31. }
  32. path = [documentsDirectory stringByAppendingPathComponent: [NSString stringWithFormat: @"compressed.MOV"] ];
  33. NSLog(@"path is== %@", path);
  34. return path;
  35. }
  36. // Actual compression is here.
  37. - (void)convertVideoToLowQuailtyWithInputURL:(NSURL*)inputURL
  38. outputURL:(NSURL*)outputURL
  39. handler:(void (^)(AVAssetExportSession*))handler
  40. {
  41. // [self startCompressingTheVideo:outputURL];
  42. //
  43. //
  44. // return;
  45. [[NSFileManager defaultManager] removeItemAtURL:outputURL error:nil];
  46. // AVAssetWriter
  47. AVURLAsset *asset = [AVURLAsset URLAssetWithURL:inputURL options:nil];
  48. AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetLowQuality];
  49. // exportSession.fileLengthLimit = 30*1024;
  50. exportSession.outputURL = outputURL;
  51. exportSession.outputFileType = AVFileTypeQuickTimeMovie;
  52. [exportSession exportAsynchronouslyWithCompletionHandler:^(void)
  53. {
  54. handler(exportSession);
  55. // [exportSession release];
  56. }];
  57. }

For such more Blogs you can visit to http://findnerd.com/NerdDigest