MySQL | How to support European characters on database level

Author - Parminder Kaur

European characters like è é å ñ ü ,à, è, ì, ò, ù – À, È, Ì, Ò, Ù, ™, © ,• , ∑, α, β, «, » do not get inserted correctly in MySQL by default. To fix it, we need to change the character set (fixed collection of symbols) and collation (set of rules that determine how data is sorted and compared).

To insert and retrieve european characters change character set to utf Read more…

MYSQL | #1293 – Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP

Author - Ishpreet Kaur

Suppose we want to have columns created_date and last_modified_time with default timestamp in any table in MySQL/Phpmyadmin.

Let us take an example of Students table.

Create table Students using following query :
CREATE TABLE students(
id INT AUTO_INCREMENT PRIMARY KEY ,
first_name varchar(20) NOT NULL,
last_name varchar(20) NOT NULL Read more…

CakePHP | How to implement Internationalization in CakePHP 3.X

Author - Rita

To implement Internationalization, CakePHP will pick all your strings which start with “__(“ double underscore ) and generate a default file for you.

For Example: one of the strings defined in our project is as below:
echo __ ( ‘ Gift Cards Not available’ );
Replace all your normal string with (__ Read more…

Selenium | How to perform search with Selenium script

Author - Namisha

In this post I will give an example of how to perform search with Selenium script on a webpage. Below is the screenshot of the webpage:

Code to automatically enter a keyword “paint” in the textbox and then click Search button (or enter key) is given below. Go through the Read more…

PHP | Convert Special Characters to HTML entities without using htmlspecialchars( ) function

Author - Kritika Sood

We can’t use special characters like >,<,”,’ etc directly in code because browser mixes these characters with HTML tags and gets confused. So we can use HTML entities if we want to use special characters in our code.

Below are some common entities which we can use Read more…

Bootstrap | How to show Caret symbol on hover event

Author - Rita

How to show Caret symbol on hover event in the Bootstrap navigation bar as shown in the figure below:

Solution: We created a bootstrap navigation bar with ul and li tags. One of the li element within the ul for reference is given below:
<ul class=”row Read more…

How to access javascript array in php on submit

Author - Kritika Sood

Suppose you have a Javascript array and want to send it to the server side on page submit then you can use this method.

Suppose we have a Javascript array with 3 elements:
var test = [“test1”, “test2”, “test3”];
Now create a hidden variable in HTML. This variable will Read more…

PHP – Possible reasons of “Allowed memory size exhausted” error

Author - Rita

Most of the times when we get memory exhausted error, we normally think that the memory allocated for php program execution in php.ini file is not sufficient and raise this limit to try to fix the error.

However, code inefficiency could be the reason behind the error. Some examples Read more…

Selenium Webdriver | Locating elements

Author - Webner

Selenium Webdriver lets us locate elements in a web page in many different ways. Some of them are:

By id: If the HTML element to be located has a unique id one can use this id to locate the element in the code. Java statement for this will Read more…

How to add combobox in editable datagrid using jQuery EasyUI

Author - Webner

Following is the code to add Combobox in editable data grid:

Index.html:
<table id=”dg” title=” Combobox in editable datagrid ” style=”width:100%;height:700px”
toolbar=”#toolbar” pagination=”true” rownumbers=”true” fitColumns=”false” singleSelect=”true” autoSave=”true” data-options=”pageSize:50″>
<thead>
&lt Read more…

JQuery | Change background color on hover

Author - Webner
|
0 Comments
|

Suppose on an HTML page we have a list of menu items as shown in the image on the left below (Customers, Projects, Invoices etc) and on hover over these menu items we need to change the background color to green, like shown in 2nd image:

This is the sample Read more…

3 special features of jQuery

Author - Richa

1. Fetching coordinates of current location of the mouse:

Below is the code to retrieve the coordinates of the mouse at any position on the webpage and display inside a div with id getCoords:
<script>
$(document).ready(function()
{
$(document).mousemove(function(e){
$(‘#getCoords Read more…

Background colors of CSS shapes not showing with window.print()

Author - Kritika Sood

In one of our projects we are working on, we were trying to print a page using Javascript window.print() method. Strangely the page was not showing the colors of various CSS shapes like rectangle, circle etc when print preview was shown. It was working when viewed on browser.

The Read more…

PHP | Adding text over an image

Author - Richa

In order to add text over an image, following PHP code can be used. Read the comments to understand purpose of code statements:

<?php
header (“Content-type: image/jpeg”); //setting the content type

//variable containing the string to be written on the image
$txt = “Here goes the text to Read more…

Salesforce | document.getElementById(‘id’).value not working for apex:outputtext

Author - Webner

If you have an apex:outputtext and you try to get its value in Javascript using document.getElementById(‘id of outputtext’).value(), that won’t work. The reason is apex:outputtext is translated to HTML SPAN element.

So

<apex:outputtext value=”Amount” id=”amntId”/>

becomes

<span id Read more…

PHP | better way to include a file

Author - Kiran Preet

Have a look at this folder structure:

Test
Folder1
Abc.php
Folder2
Qwerty.php

Now in Abc.php file, try to include Qwerty.php using the following code:
Abc.php
include(‘../Folder2/Qwerty.php’)
It will give this error:

Fatal error: Failed opening required Read more…

PHP | How to install CakePHP 3.0

Author - Deepika

These are the steps to install CakePHP 3.0 on Ubuntu machine:

Make sure you have PHP 5.5.9 (CLI) or higher installed. Check php version on your system using this command:

php -v

Run the following commands:

1. Download the composer installer in your Read more…

Totara | Hide Administration block

Author - Neha Mishra
|
0 Comments
|

1. Turn editing On and click on the settings icon of the administration block as shown below:

2. Click on configure Administration link. This screen will open:

3. Change the drop-down value from “Assessment information page” to “ Edit Assessment page” so that only admin users could see this block Read more…

HTML | Using CSS for animation

Author - Webner
|
0 Comments
|

With recent evolution in CSS, we can try animations. Below is a sample code where in which have used latest CSS features and will give the illusion of animation. Just copy paste the code below in an HTM file and and view it in browser.

Code:

<html>
&lt Read more…

Get Salesforce SObject name through Salesforce Record Id

Author - Webner

Description: We have Salesforce recordId but need to identify what is the type of Subject corresponding to this record id.

Solution: We can get Sobject name from recordId with getSobjectType() function, sample code below:

Apex Code:
public void echoSObjectName(String RecID) {
objName = RecID.getSobjectType Read more…

‹ Prev page1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 Next page ›
Send your message