Posts

Showing posts from June, 2017

CSS to show first 10 characters remaining as 3 dots of word or sentence

Just use this CSS class [code language="css"] .ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } [/code] This will result [code language="html"] <span class="ellipsis">Hello, am dhanu</span> [/code] Hello, am ...

Codeigniter with Admin LTE

Admin LTE template with PHP Codeigniter 3.2.1 latest version integration Download the code from the repository. Unzip the zip file. Open browser; goto localhost/PHPMyAdmin. Import the file "db.sql" in that database. Copy the remaining code into your root directory Open browser; goto localhost/[project-folder-name] and press enter The login screen will appear. To login, I am going to provide the user email ids and password below. System Administrator Account: Email:  admin@bewithdhanu.in Password: 123456 Manager Account: Email:  manager@bewithdhanu.in Password: 123456 Employee Account Email:  employee@bewithdhanu.in Password: 123456 Once you logged in with System Administrator account, you can create a user or edit the previous user if you want. Dependencies NAME VERSION WEB REPO CodeIgniter 3.1.0 Website Github AdminLTE 2.3.5 Website Github Bootstrap 3.3.7 Website Github Ion Auth 2.6.0 Website Github jQuery 2.2.4 Website Github Font Awesome 4.6.3 Website Github Yo...

creating Federated mysql table with username password and host

Usage of character as like these @ is not suggested in passwords and a similar discussion on this issue is available here. You can work-around the above limitation by using CREATE SERVER statement as shown in the example below: CREATE SERVER federatedTablelink FOREIGN DATA WRAPPER mysql OPTIONS (USER 'USERNAME', HOST 'Host_IP', DATABASE 'DB_NAME', PORT '3306',Password 'PASSWORD'); Once the server Link is created using the step above, you can use the following to create table that uses this connection: [sourcecode] CREATE TABLE test ( id INT(20) NOT NULL AUTO_INCREMENT, name VARCHAR(32) NOT NULL DEFAULT '', PRIMARY KEY (id), INDEX name (name), INDEX other_key (other) ) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='federatedTablelink/test'; [/sourcecode] MySQL documentation that refers to similar topics are as follows: https://dev.mysql.com/doc/refman/5.6/en/federated-usagenotes.html https://dev.mysql.com/doc/refman/5.1/en/fed...

How to add a class to body tag?

This should do it: $('body').addClass("newClass"); If you want to remove class from it: $('body').removeClass("newClass"); it will be same with html element "id" or "class" or "type"..

How to add javax.conn package to java

firstly download this rar file http://www.mediafire.com/?557o7j1133bhonu Password: javax.comm Steps: Make Sure You have alredy installed java(JDK) in you pc Copy comm.jar to C:\Program Files\Java\jdk1.7.0\lib C:\Program Files\Java\jdk1.7.0\jre\lib\ext Copy win32com.dll to C:\Program Files\Java\jdk1.7.0\bin C:\Program Files\Java\jdk1.7.0\jre\bin C:\Windows\System32 Copy javax.comm.properties to C:\Program Files\Java\jdk1.7.0\lib C:\Program Files\Java\jdk1.7.0\jre\lib That's It..

Serial Port Communication with Java

Here am showing the simple serial port communication program, here i will show you how to get list of all available serial and parallel ports available FIrstly,By default java does not contains javax.comm package so we need to install it into our pc java follow this link to know How to add javax.conn package to java after adding this package to the java just run the below code to get available serial and parallel ports [sourcecode language="java"] package in.mjtech.serial; import java.util.Enumeration; import javax.comm.*; public class ListSerial { public static void main(String[] args) { // SerialParameters params=new SerialParameters(); // System.out.println(CommPortIdentifier.PORT_SERIAL ); Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList .nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) { System.out.println(portI...

program to find out the total number of jumps he will make to escape from the jail

your friend planned to escape from Tihar jail. He is basically a monkey man and he is able to jump across the wall. He practiced to cross a wall and he is able to jump 'X' meters, but because of slippery wall he fall 'Y' meters after each jump. To escape from jail he has to cross 'N' number of walls where height of each wall is given in an array. Write a program to find out the total number of jumps he will make to escape from the jail. input specification: 1.distance up in meter 2.distance slipped in meter 3.store the height of the wall in an array [sourcecode language="python" wraplines="false" collapse="false"] <?php function getjumps($x=0,$y=0,$z=array()){ $r=0; if(count($z)>0){ if($x>$y){ foreach($z as $a){ $b=floor($a/($x-$y)); if(($a-($b-1)*($x-$y))<=$x){ $r+=$b; }else{ $r+=$b+1; } } } } return $r; } echo getjumps(7,3,[21,16...

AdminLTE left menu auto selection for ul and li tags

Here is code if you want to create active state on AdminLTE menu AdminLTE left menu script to auto arrange in selections [code language="javascript"] var url = window.location; // for sidebar menu entirely but not cover treeview $('ul.sidebar-menu a').filter(function() { return this.href == url; }).parent().addClass('active'); // for treeview $('ul.treeview-menu a').filter(function() { return this.href == url; }).closest('.treeview').addClass('active'); [/code]