Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

How to use array_rand() function php.?

What does array_rand() function in php.? The array_rand() function returns a random key from an array, or it returns an array of random keys if you specify that the function should return more than one key. Syntax of array_rand() function:a...

How to called except block to allow converting exceptions to arbitrary

To Called within an except block to allow converting exceptions to arbitrary responses. Anything returned (except None) will be used as response. use this code given below in openerp. def _handle_exception(self, exception): """Called ...

How to update multiple array elements in mongodb

Hello Everyone, In this blog we will discuss about how to update multiple array elements in MongoDb using a single query. Let say we have a collection in MongoDb named "Form" which consists of the below available documents: > db.Form...

Changing TextField Placeholder Color

Hello friends, We may change the text field placeholder color using either storyboard or using code. Using Storyboard: Choose the text field and under textfield runtime attributes click on the '+' button and add a key: _placeholderLab...

How to use Shared Perference in android?

Here I have created Shared Perference function. Shared PerFerence is used to display a screen with some text fields. Shared Perference saved value is used when we close application. The below code will clearly describe you how to use Shared Perfe...

Asynchronous Programming : Use of Async and Await

This is an introductory post on how to use the async and await keywords in C# to create asynchronous background tasks. It is a common practice to use multi-threading and asynchronous tasks to avoid performance bottlenecks and to keep the appl...

Please stop using the action hook wp_print_scripts to load JavaScript

Hello Readers, This plugin is using the wp_print_styles and wp_print_scripts action hooks to load all css and javascript. wp_print_scripts shootes with just about every page heap that can cause your javascript for you to heap everywhere whic...

Stack in C++

The std::stack class is a container adapter that gives the programmer the functionality of a stack - specifically, a FILO (first-in, last-out) data structure. The class template acts as a wrapper to the underlying container - only a specific s...

Replace default WordPress jQuery script from Google Library

Hello Readers, There are default scripts that is included with each WordPress installation. These types of scripts have reached disposal regarding style as well as plugin experts to make use of of their function. Via our experience, jQuery is ...

How to install open JDK on Ubuntu ?

You have to follow below Steps to install JDK (java developement kit) on Ubuntu Step 1: Installation of JDK sudo apt-get install openjdk-7-jdk Step 2: After the installation, Use command. apt-cache search jdk Step 3: Settin...

How to add Captcha with CakePHP

We can add captcha for blocking spams robots accessing our site or application. We can add captcha in our web application and website by using the below code -> <?php App::uses('AppController', 'Controller'); class PagesController exte...

MySQL subqueries examples

Subqueries are generally similar to Normal queries in databases like - They may return one column They may return more column They may return single rows They may return multiple rows Or it can be any of combination from above. ...

How to use password strength indicator on slider?

In this example, we used a variable named score to calculate the strength of password. If password contain 6 chars the score increases with 10 points, if it has at least one digit 10 points, has at least one ASCII symbol (!@#$%^&*) 10, mix...

Create custom user login using AJAX in WordPress

Hello Reader, If you want to create WordPress custom login using AJAX below example will help you. You just need to follow the steps one by one. 1.) copy the below line and paste it to header,php file under </head> section. <...

Create custom user signup using AJAX in WordPress

Hello Reader, The below example will help you to create user custom sign-up using AJAX. Please follow below steps to create WordPress custom sign-up. 1.) copy the below line and paste it to header,php file under section. <script t...

How to use array_keys() function php.?

What does array_keys() function in php.? The array_keys() function returns an array containing the keys. Syntax of array_keys() function: array_keys(array,value,strict) So, there are three main Parameter of array_keys(). These are foll...

How to make Text View with Rounded Corners in android?

In the below example I have created a Text View with Rounded Corners function. Here I have defined style to change background to textview. Below example will clearly describe how to make TextView with Rounded Corners. Step(1)-MainActivity- ...

How can do caching in Core PHP?

To implement caching in core php follow the below steps : - Step 1 - Firstly create a folder having write permission where we store the output of the page. Step 2 - At the start of file, please check whether we have already stored any...

How to display annotation on any Location in MKMapView

If we want to display the annotation point on any coordinates in MKMapView use the following functions- By using the annotation anyone can easily recognize the location.We can also set the Title here which will show when user click on that...

Send an email using Email Template in Zend Framework.

As we all knows email functionalities in websites is common and used in all web application. Either it is registration process or detail of any order, we always need to send an email to our valuable users and clients. For sending the email usi...

How to implemente confirm password functionality with jQuery?

At the time of registration or change password we need to provide password, so for this we usually implement Confirm password functionality. Example: In the below example I want to confirm password on form submit, so for this I have created a ...

How to retain the sorted value after refresh div?

Here, we are using both sessionStorage and localStorage to retain the values after refresh a div. The div named refresh (#refresh) get refresh after a time interval of 5s. Values in the array sort using updateContent(arr,$opts) function. These so...

How to save activity instance state

Every android activity follow a life-cycle. There are certain situation when an activity goes into pause state or in stopped state but at some particular time your application need to keep valuable state (i.e. data) This we can achieve by usi...

Prevent SQL-injection in PHP

User can prevent SQL- injection in php by using given 3 ways. Method1. By Using PHP inbuilt Functions. $name = mysql_real_escape_string($_POST["name"]); mysql_query("INSERT INTO users VALUES($name)"); Method 2. By Using MySqli instead...

What are Hooks in CakePHP ?

Hooks are the functions that we can call before and after doing any task in Models ( database related ). Like after finding data, before saving data etc. e.g beforeSave(), afterSave(), beforeFind(), afterFind() etc. <?php class Classnam...

How to use Flow Layout in UICollectionview

cells in UICollectionview can be of same Size or different sizes, so we use the flow layout. UICollectionViewFlowLayout manage items into a grid with header and footer view for every section. Here we define the flow layout-- -(void)viewDidL...

method for sanitizing user input with PHP?

Sanitize data means "Remove any illegal character from the data". Best methods for sanitizing in php are given below. Method 1 - Sanitize user-input when we are using Mysql Query. For this case you have to use real_escape_string of mysql...

Save MySQL query results into a text or CSV file

Hello Readers! MySQL provides an easy mechanism for writing the results of a select statement into a text file on the server. Given a query such as SELECT order_id,product_name,qty FROM orders which returns three columns of data, t...

SVG Matrix transformation

The SVG stands for "scalable vector Graphic" and below are the example for SVG matrix. The matrix looks like this: a c e b d f 0 0 1 There is only first 6 values can be specified, you only provide 6 values to the matrix transfo...

Importing a csv into mysql via command line

Hello Readers! MySQL have this load data function, where we can insert data to a table from external files like csv, txt etc. The process is quite simple, 1st lets login to mysql via terminal/console. mysql -u root -p Enters usernam...

Different ways to invoke method in ruby

Ruby provide with the following ways by which you can invoke the method based on your requirement : s= "ruby method" 1) Call a public instance method directly p s.length #=> 11 2) Other way is to invoke a method dynamically in ...

Virtual Host Setup In Window?

For setting up the virtual host on window system below are the steps - Lets suppose, http://localhost will access for all the projects in a file, http://qa11.localhost is for access to only one project and also it will set the document_...

lcfirst() and ucfirst() string functions in php

The string functions lcfirst() and ucfirst() are used in the cases when there is a need for manipulating your string first alphabet. These occurs when the string is like name or title. lcfirst() This function does the lowering of the first...

Upload CSV and Insert into Database Using PHP/MYSQL

Hello Readers ! We can simply upload upload CSV data into database by two simple ways. Step 1 Data Base Connection <?php $db = mysq_connect("Database", "username", "password") or die("Could not connect."); if(!$db) die("n...

How to set placeholder text in uitextview

If we want to set the placehoder text in uitextview then we have to use the delegates methods of textview because there is not an option to set the placeholder directly in xcode. Here is the methods-- - (void)viewDidLoad { [super vi...

How to use array_flip() function php.?

Why use array_flip() function in php.? The array_flip() function mainly used for exchanging all keys with their associated values in an array. Syntax of array_flip() function: array_flip(array) You can take reference form below examp...

String Function In PHP

String function in php To reverse a string strrev- It is used to reverse a string. <?php echo strrev("Hello world!"); // outputs !dlrow olleH ?> To search for a specific text in your string strpos- it return the characte...

Set Dynamic Size of button according to the Title text

if you want to change the size of UIButton according to the title text then use the following function-- -(void)setDynamicSizeOfButton:(UIButton *)button andSize:(CGFloat)Size { CGSize size = [button.titleLabel.text sizeWithAttributes: ...

How to use array_fill() function php.?

Use of array_fill() function in php. The array_fill() function is basically used for filling an array with values. Syntax of array_fill() function: array_fill(index,number,value) According to above syntax, there are three main Param...

Traits in PHP?

Traits in php are the mechanism for reusing the code in a single inheritance. Trait is as similar as a class, but only focus to group functionality in a consistent way to fine grained. We can not instantiate a Trait . It is for reducin...

How to use substr() function php ?

Definition of substr() function in php ? The mainly use of The substr() function returns a component of a string. Syntax of substr() function substr(string,start,length) You can see below example the use of substr() function. &l...

What is CSS box model

Hii, As we all know CSS is style sheet language used to give a beautiful look,Design to our document written in HTML. CSS is an abbreviation for Cascading Style Sheet. CSS is a kind of technology used by many websites to create attracti...

How to Show a pdf File from URL in a UIWebview in iOS

when we want to open the pdf file from a URL string then we use the UIWebView. In webview we can directly open the file by loading the url request.use the following function-- -(void)addWebViewOverLay:(UIWebView *)webView { webView = [[UI...

How to join table in cakephp

Most of cakephp developer write custom query to join two table of database but cakephp provides best facility to join more than one two table in single query using association . Let see an Example:- SELECT * FROM `messages` INNER JOIN user...

Some basic linux interview questions

Below are some linux basic questions which are generally asked by the interviewer. Question1: what we must check first if we get, cant connect to local MySQL server through socket /var/mysql/mysql.sock on typing at shell prompt mysql? A...

How to create first iOS application in Xcode?

How to create first iOS application in Xcode for iPhone with no programming experience where Ill help even the non-programmer to enjoy coding as an iOS developer. This is an XCode tutorial for beginners so Ill be going through where to downlo...

Queue in C++

The std::queue class is a container adapter that gives the programmer the functionality of a queue. It is a FIFO (first-in, first-out) data structure. In queue elements are inserted at the back and can only be accessed from the front and the ba...

What is umask command?

Umask is a number which define the default permissions that is not given on a file or any directory. How to Calculate Umask: We can subtract the umask from the base permissions to determine the final permission to any file. Please see b...

How to style BuddyPress pages than a regular WordPress page

Hello Readers, Most of the time when you work on the buddyPress, you wanted to style BuddyPress pages differently than a regular WordPress page, you need add a template file named buddypress.php to your themes directory and BuddyPress would us...

SpeechRecognizer.ERROR_NO_MATCH:

Hello guies, As i was working on and speech recognition module i encountered a mysterious bug while the listener called for the second time to listen for voice input. Bug detail :- When you call the listener of the SpeechRecognizer ins...
1 172 269
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: