
Featured
-
How Regression Testing Detects Integral Errors In Business Processes
Humans are forever changing and evolving and so to
by kristina.rigina -
Get Display Banner Advertising Opportunity on FindNerd Platform
“Do you have a product or service that nee
by manoj.rawat -
Android O Released with Top 7 New Features for App Developers
Android was founded by Andy Rubin, Rich Miner, Nic
by sudhanshu.tripathi -
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP
by abhishek.tiwari.458 -
Objective C or Swift - Which Technology to Learn for iOS Development?
Swift programming language is completely based on
by siddharth.sindhi
Tags
How to save and get image from parse database in iOS app
To save image or video into parse database, parse has provided a class PFFile. It can also be used to save documents, music files or any binary data file (upto 10 megabytes only).
To save image first convert image to NSData, assign it to PFFil...
Laravel 5.0 Giving Alias in routing
In route in laravel we can create alias for a url. Laravel provide us the facility for giving alias for an url. We can use this url alias any where in our view
routes.php
Route::get("admin/department/{id}", ['as' => 'department.edit', 'u...
Sorting in Ruby
Using sort method we can sort any string, numbers, even classes either in ascending order or descending order .To sort an array ,you need to compare its element using <, >, <=, >= .
return -1 if x < y
return 0 if x = y
return ...
Localization in Laravel 5.x
In Laravel 5.x we have lang class which will help us to retrieving string in different languages that will help us to easily support multiple languages.
The folder structure for /resources/lang files are
/resources
/lang
/en
...
Change Status Bar Color
Hi All,
To change statusBar color in any view controller, you need to follow three steps:-
First - Set the UIViewControllerBasedStatusBarAppearance to YES in the .plist file.
Second - In viewDidLoad function of your UIViewController
...
What is the difference between '|' and '||' operators
Hello Reader's you might have seen the coding standard with the common syntax | and || is used. These are the syntax used for checking the conditions and sub conditions. The first | is called as bit wise Operator. It is used to make the conditio...
Delete object from Parse table in iOS.
If you want to delete an object from Parse DB then you have to run a query to fetch that object and then run a loop to delete it. If you already have that object then just call delete method. Here is the complete code.
PFQuery *query = [PFQuer...
Laravel 4.x Carbon Class
The Carbon class is inherited from the PHP DateTime class.
Example:
<?php
class Carbon extends \DateTime
{
// code here
}
?>
There are n number of situation when we want to get the 1 day or 2 days old data. For this we w...
PHP :- Scraping Data From Youtube Video URL
You can also get the data i.e title, description, thumbnail_url, etc from the Youtube video url by using following script. Remember you need to put the YOUR_GOOGLE_DEVELOPMENT_KEY which you can generate by creating account in Google Developer Con...
Post/Blog Sharing time formats like Facebook, Twitter in iOS.
There are several posting time formats available, social sites are using their own styles of post time display. But the logic behind each posting is same, basically it depnds upon the date and time difference. Here is the function to calculate th...
How to enable Socket Transport SSL in PHP
Hello reader's If are using the Windows environment and developing the SSL based websites then you might have to enable the SSL for PHP for the first time. So to enable that you just need to perform the following tasks steps:-
Step1: Renam...
Check for Internet Connection
Hi All
To check internet connection using objective c you can use this function.
There may be a plethora of reasons that you need to check whether or not the device that is using your application has an internet connection. If checking whet...
Get thumbnail image from a recorded video in iOS
If you want to get thumbnail image from the recorded video in iOS then you can cut a small frame from that video to generate an image. You just need to send video output URL to below method as a parameter. This method willl return you NSData. Lat...
How to get variable with same name in POST using PHP
Hello Reader's if have a html form with the variable of same name then you can get them indevisaly by POST
Change the names of your inputs:
<input name="name[]" value="Address" />
<input name="name[]" value="Number" />
<in...
The initialize method in Ruby
This method is like a constructor of other object oriented programming languages.
when you want to initialize some class variables while creating an object, we use this method..
like any other ruby method,it starts with def keyword
class abc...
Property List of MPMoviePlayerController for iOS
There are several properties available for MPMoviePlayerController in iOS. We just need to use them to play the movie according to our need.
You can access these properties like this:-
Create property in .h file
@property (strong, n...
Data pass between two viewcontrollers
Hi All,
If you need to pass data from one ViewContrlloer to other ViewController then first make properties in second ViewController in which you need that data For example:-
In SecondViewController.h
@interface SecondViewController : ...
break and next keyword
If i want to break our loop at specific condition then it is same as other languages .
In Ruby continue doesn't work , in this there is equivalent keyword i.e next
class Number
def looping(d)
while(d!=50)
puts d
d = d + 1 ...
Laravel 5.0 Defining Different Named Fields as CREATED_AT And UPDATED_AT
In Laravel two fields are auto filled or modified they are created_at and updated_at but what if your table have different named fields example created and modified in it's place they won't be auto filled or modified automatically. So to make the...
How to sort an given array by it's any key index
Hello Reader's! if you have an given array on with you want to sort with any selected key index as show below:-
Array
(
[0] => Array
(
[configuration_id] => 10
...
How to disable user interaction of an iOS app
In iOS application there are only few ways to disable user interaction for the whole screen or UI. Some developers use property (User Interaction Enabled) for a specific control, some uses MBProgressHud class by displaying spinner or some uses us...
How to Add items Dynamically in RecyclerView?
RecyclerView is works just like listview but more well organised, felexible to customize and optimize to work and in rendering the view of large data set. So in this tutorial we will see how to add items Dynamically in RecyclerView.
...
How to extract website tittle using the given URL
Hello Reader's! If you having a set of given url's you need just the title of them, then you can use the PHP code below to extract title
<?php
function TitleURL($YourURL){
$str = file_get_contents($YourURL);
if(strlen($str)>0)...
Migration in laravel 4.x
Migrations has very important role in Laravel 4.x. By using Migrations we can create and update our database and by using Migration we can save time because it will create schema by using single command.
Migrations Creation:
In Laravel 4.x M...
How to destroy user session automatically in PHP if he don't log out
Hello Reader's!
If you have to destroy or unset the user's session automatic then the better way is to set with time dependency
session_start();
if (!isset($_SESSION['EXPIRES']) || $_SESSION['EXPIRES'] < time()+1800) {
session_destr...
Create classes in ruby
Ruby is a pure object oriented language and everything in ruby is an object of some class. In ruby we can create classes and create objects of the classes. In the below example we will create 3 classes Person, Address and Company. An object of...
MYSQL, PHP :- Query Concatenating Fields To Make Date And Running Between Query On It
Recently, I faced a problem when the date was saved in different fields month, year and date. I need to club all these fields together and run a between query on it.
Another issue which was there was that Date has '0' contacted if the value ...
Uses of class and objects
Use of classes and objects in ruby id different to other languages . And tell how to declare and define function in ruby and how to call the functions .
Example : In below example i am creating a program of simple arithmetic program .
class A...
.to_a in Ruby
.to_a is used to specify range. It is a method that converts an object into an array
Example
$, =", " # Array value separator
range1 = (1..10).to_a
range2 = ('bar'..'bat').to_a
puts "#{range1}"
puts "#{range2}"
Output
1, 2, 3,...
String Methods
Reverse ( ) Method : This method is used to reverse the entire string.
Example :
var1 = 'mukesh'
var2 = 'tomar'
var3 = '....hello mukesh'
puts var1.reverse
puts var2.reverse
puts var3.reverse
puts var1
...
Create a PIe Chart in iOS
The main use of a pie chart is to show comparison. When items are presented on a pie chart, you can easily see which item is the most popular and which is the least popular.
you can create the pie chart in iOS by using the following methods...
How to use NSMutableAttributedString
Hello Friends,
NSMutableAttributedString allows to set different attributes(font size,font color) for different parts of the string.
To use NSMutableString you may use the following code:
//Create an object of NSMutableAttrinbuteString and ass...
Make a Call using swift
Hi All,
To call any number with code using swift you can use this function.
private func dialNumber(phoneNumber:String) {
let phoneUrl:NSURL = NSURL(string: "tel://\(phoneNumber)")!
let application:UIApplication = UIAppli...
How to integrate google reCAPTCHA in your html form?
To integrate reCAPTCHA in your HTML form, you need a public & secret key.
You can get the both keys from this URL https://www.google.com/recaptcha/admin and it will look like
Public Key: 9Madr_cSZZADgLy9zeFTEraGn9ogHhxuh_6pquJUHYyt
...
Queue in laravel 5.x
Laravel Queue is one of the best feather of Laravel 5.x. When we want to make our site fast and we have to fetch and store large amount of data then we will run our query on back end. In Laravel 5.x by using queue we can run time consuming on bac...
Creating Your First Module
Creating module is easy in drupal
Steps you need to follows are as below.
Creating the module directory
Creating the .info file
Creating the .module file
Where does your custom module goes?
Its always better to keep contrib and cu...
Quick Sort library function in C
Quick sort can be very useful to you if you want to sort your array efficiently.
The Time complexities for quick sort
Best Case performance : O(n log n)
Average Case Performance : O(n log n)
Worst Ca...
Utc time to Local time conversion
If you are working on meeting schedule functionality in your android app and you are stuck with the timezone then this example can guide you.
If you are getting the time, timezone from server and time is in UTC then you should not have to ap...
Variable Number of Parameters
If you declare a method that takes two parameters, on This method call , you need to pass two parameters along with it.
But, Ruby facilitates to declare methods that can work with a variable number of parameters.
Example
def evon (*t)...
Pagination in Laravel 5.x
It is very painful to use pagination in other framework but In Laravel 5.x it is very easy to implement pagination. By using paginate method on the query builder we will takes care of setting the proper limit and offset based on the current page ...
fibonaci series using arrays in Ruby
It is a series of Whole number where we have to find sum of the two preceding numbers. It Begins with 0 and 1, the sequence goes like this 0,1,1, 2, 3, 5, 8, 13, 21, 34, etc. using the formula n = n(-1) + n(-2), where the n(-1) is the the l...
Routing in Laravel 5.x
In any project routing plays an important role.In Laravel 4.x we will define our routes in routes.php which is in app/Http/routes.php which is loaded by the App\Providers\RouteServiceProvider class. In Laravel 5.x the basic routes consist of a UR...
Applying limit and offset to array
In rails we can apply limit and offset to arrays in different ways.
1> Using "slice" method.
slice takes 2 arguments, the first one being the "starting_index" & the second one is the "number_of_elements".
syntax :-
arrayob...
Laravel 5.0 Creating Download CSV Link
In Laravel, many times we may need to create a link to download sample CSV file. So that user can download sample CSV file from our website and upload correct formatted file.
It's a very simple task and to accomplish that we need to follow fo...
URLs in laravel 4.x
There are n number of functions of URLs in laravel 4.x which is used to perform action that are
action:
action is a function which is used to generate a URL for a given controller action.
Example:
$url = action('HomeController@getInde...
Laravel 5.0 Creating Custom Middleware For Different Roles
Laravel provide us the facility to create our custom middleware for user's authentication. We can create different MIddleware for different roles. To accomplish it we need to follow the following steps.
Step 1st:- Creating new Middleware for...
Strings in laravel 4.x
There are n number of functions of strings in laravel 4.x which is used to perform action in string that are
camel_case:
camel_case is a function which is used to convert the given string to camelCase.
Example:
$camel = camel_case('fo...
Laravel 5.0 Grouping Similar Routing Requets Requests
In Laravel many times we need to group together many routing requests having same middleware, controller, suffix, etc. We can achieve that by using Route::group. The syntax of it is stated below.
Syntax :-
Route::group(["middleware" =&g...
Spring Security 4: Auto login with annotation
Spring security gives us the feature to auto login into the system just after creating an account.
Other way is to register then go to login page, and then login to the system. When we login login mechanism spring automatically creates the sess...
Laravel 5.0 Creating Request Handler
In Lavarel one of the best practice is to use form validation rules to validate the submitted data. There are number of ways to do it . One way is to create form validation rules both in the controller or we can create a separate file under the a...