In some cases we have to get global information about application environment programmatically. We will get package name, version name, version code, application info and last updated time using the PackageInfo class which contains all of the inf...
Hello Reader! If you having an multidiamensnal array and you want to get the max value from a single element key then you see the example below:-
[0] => stdClass Object
(
[id] => TRF1254
[cust] => CUST9897
...
In this blog I am going toexplain how to export mysql data to CSV file using php. CSV stand for comma separated values. Using the below code you can easily download CSV file and use anywhere.
<?php
function exportMysqlToCsv($table,$...
Hi friends,
If you are using PDO in php , Now you can Authenticate user using simple code.
include 'conn.php';
try
{
$username = $_POST['user'];
$password = $_POST['pass'];
$smt=$conn->prepare("SELECT * FROM signup WHER...
Hello Readers! if you want to find out the type of file encoding using php then the code below will help you:-
//check string strict for encoding out of list of supported encodings
$enc = mb_detect_encoding($str, mb_list_encodings(), tr...
With more and more people now preferring to use smartphones over PCs, it often becomes a conundrum for businesses to choose between web apps and native apps to provide users a pleasing experience they always expe...
Hello friend,
Whenever we share a any URL on our Facebook, Web crawlers will surely visit this website to get some specific information about the linked page (the page link which we have shared on FB wall), for example title, text and image.
...
Here I have created change backgraund color View app. when we select any radio button then it will change the backgraund color. In the below example i have use four radio button on diffrent colour id. You can use the below code to change backgrau...
[zipedit]Social media is the collection of many online websites & applications that allows people to share their ideas, career interest, pictures/videos and to create, exchange or share information in their social communities & networks. ...
Hello Readers! If you are developing the dynamic website in which the image color will be the background color then you can see it doing in PHP :-
<?php
$filename = $_GET['filename'];
$image = imagecreatefromjpeg($filenam...
Here I have created Popup function , Popup function can be used to display menu item list, anchor text and listitem etc. In the below example when we clicked on menu button the popup will be open and if we click outside the popup it will disappea...
Hello Guys,
Facebook has provided us facility to custom profile URL but some time we need some Facebook ID number for any reason.
So, Below are the step by step procedure /screenshots to get your fb profile ID number:
Step 1:
Open the Pro...
It's very well said, sometimes easy thing are more strenuous to apply, this one is the same, ones I am trying to show the date format of on my system same like below screenshot-
on goggling I found the below tutorial... Easy and hel...
1)Suppose we have a Button and a TextView in XML:
activity_main.xml
<Button
android:id="@+id/btnGet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GET IMAGES" />
<TextVi...
Hello Reader!, On printing the url in plain text, they do not appears as hyper linked but using PHP you can perform this.
Let's see the example below that takes a plan url as input and return the hyperlinked url:-
<?
function createHyper...
Blow code get list of Emails account from AccountManager.
AccountManager manager = (AccountManager) mActivity.getSystemService(mActivity.ACCOUNT_SERVICE);
Account[] list = manager.getAccounts();
if (list.length &g...
I want to display location (lat & lng) markers in Android google map using volley library by selecting the category.
I am not able to get individual selected item locations but I am able to get all locations markers in map. Please help in ...
For just the functioning part both the syntax will work the same but by writing session_unset will clears the $_SESSION variable but will not destroy the variables and it will initialize to this stage:-
$_SESSION = array();
session_destro...
To make JSON call we use getJSON method. Here is the syntax and description of it.
Syntax :
$.getJSON( url, [data], [callback] )
Description
1. url : It is URL where the request is send and which emits out JSON.
2. data : this ...
To call javascript function write the following lines :
NSString *getStringvalue=[webView stringByEvaluatingJavaScriptFromString:@"getName()];
Where getName() is a JavaScript function which return a String value.
and to send Objective C...
As In my previous post I have already described How much SMO (Social media optimization) and marketing is important along with SEO, I just came across with this wonderful article describing how social media and search engine optimization can prod...
I am encountering some problem with Cordova Camera plugin and Android, When taking picture in Android (e.g. in portrait mode) the image is rotated by -90, i am facing this problem only in Samsung Galaxy.
Hello reader! If you have a to check the url is correct or not (not giving the status 404), Then you can get all the details of any url by using 'get_headers' in print_r.
Let's see the example below:-0
<?php
stream_context_set_default(
...
Android provides Date and Time Picker dialog, user can select appropriate date and time as per his need.
With DatePickerDialog we can select date, month and year using Calendar class. setMaxDate(long maxDate) and setMinDate(long minDate) meth...
Hello Reader! If you want to remove all of the special charracter from a given string then PHP offers you to use 'preg_replace';
Lets see the example below:-
$GivenString = 'a2|"dM!@PO^&$f 12~';
$NewString = preg_replace('/[^A-Za-...
If you want to customize seekbar in Android then follow the steps mentioned below:-
1) To customize seekbar background create a new xml file in your project's drawable folder .
seekbar_background.xml
<?xml version="1.0" encoding="utf-...
Call a procedure with in procedure in SQL server :-
While working in sql Some times you need to Calling one stored procedure within another stored procedure. So you can implement this using below sample code:---
//Store Procedure 1
CREATE...
Showing a pop-up div on a button click is a very simple task. Below is the code for showing and closing(hiding) a div and use it like a popup using jquery.
<!DOCTYPE html>
<html lang="en"><head>
<meta charset="utf-8...
Here I have created Toast with alertDialog code function, according to below code both function runs in same time and display same time when we clicked listview item. In the below code I have explain how to make toast with AlertDialog function in...
Hello Reader!, You might have seen people using the '@' in the PHP coding. The operator '@' is used when you don't want to show the error messages even if they occur.
By using '@' the errors will be hidden.
Let's see the two syntax below:-
...
Hello Readers!, If you have an array whose key index are missing then you could use the 'array_values' function to easily reindex the array.
Let's see the example below:-
<?php
$array = array( 0 => 'string1', 2 => 'string2',...
Hello Reader! If you want to detect the OS version of user though the web browser.
Then you can use the library code below:-
<?php
$OSList = array
(
// Match user agent string with operating systems
'Windows 3.11' => 'Win16',
'Wi...
This operator is used when we want specific pattern from a column in a table .
% : This is called wildcards , it is used before and after the pattern .
Syntax :
select column_name1 .......column_nameN from table_name where column_name like p...
HTML events happen to HTML codes. When we add Javascript in HTML pages, Javascript then react to those HTML pages.HTML event does by the browser or a user.
Some common HTML events are -->>
Here is a list of some common HTML events:
1...
defautl keyword is used in two situations
1)switch statement.
2)export statement.
1) example of switch statement
switch (expr) {
case "Oranges":
console.log("Oranges are my 1st choice.");
break;
case "Apples":
console...
For running multiple jQuery methods within a single statement,we make use of chaining.
here is the example:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"...
hello friends,
if you would like to Load custom cell(Xib) in UITableView in swift ,you may use the following code ->
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return array.count; //...
You can check if( [empName length]==0 || [[empName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0) this will return 1 else 0
NSString *empName;
if ([empName length]==0 || [[empName stringByTrimmingCharac...
These operators are used where we want to get records based on more than one condition .
And : From this operator we can get data if both the condition ( i.e first and second condition ) are true .
Or : From this operator we can get data if eit...
For adding new HTML elements, following methods are used:
1)append().
2)prepend().
1)append
This method is used to insert content at the end of the selected elements.
<!DOCTYPE html>
<html>
<head>
<script src=...
Hello,
I have a question regarding the best approach to using Java to compress an MP4 music file. My approach is to use Java NIO to input the MP4 file into RAM as a stream and parse the bits to find a specific bit pattern. When I find the bi...
.htpasswd file is just a simple text file which contains user name and encrypted password. It is Apache based login which protects and secure the specific directory on website and provide more security with the help of user name and password. ...
If you would like to convert .ppk file into .pem file, the process are given below:
1) Open terminal and make your login
2) sudo apt-get install putty-tools
3) puttygen /var/www/html/abc.ppk -O private-openssh -o /var/www/html/abc.pem
4) c...
Hello Guys,
Today we will learn how to convert the local time period into UTC format :
We will create a function with offset and time as parameter.Below is the code:
function
convertToUTC($DateTimeZone,$offset){
$DateTimeZone='201...
If you are going to connect server via linux terminal or putty and you are getting error, "Permissions are too open" this mean your .ppk file have some wrong permission. You need to correct the file permission as below:
chmod 400 abcxyz.pem
Expandable listview is used to categorise data in some specific type. Expandable list can have a two level scrolling list. Using ChildDivider feature we divide list items with drawables or colors, and ChildIndicator & GroupIndicator is for st...
Hello all ,
To run any API in ios 9 ,a key should be added in info.plist in supporting files folder in any project.
First select info.plist and open as source code and add this code starting of ...
<key>NSAppTransportSecurity</...
1)In your XML,make a ListView:
<ListView
android:id="@+id/mylist"
android:layout_width="match_parent"
android:layout_height="match_parent"></ListView>
2)Go to menu.xml and add a Search Button:
<item an...
This tutorial will help user learn how to integrate the jQuery fullcalendar in our web application blogs etc.Below are the steps to integrate the fullcalendar:
Step 1:Write an action in an Eventcontroller let us say, event_calendar
path...
Hello Readers
overloading and overridding in php
In php overloading define functions have similar signatures but thy have different parameters.
Overriding means one class may have override the another methods where the parent class defin...