ubuntu commands
http://bondseo.com/traffic/
cd / - for going
inside folder
cd var/
is – to show files
sudo chmod 777 -R
/var/www/webdav - to give permission
chmod 777 <directory>
display
property.display
is CSS's most important property for controlling layout. Every
element has a default display value depending on what type of element it is.
The default for most elements is usually block
or inline
. A block element is
often called a block-level element. An inline element is always just called an
inline element.div
is the standard block-level element. A block-level element
starts on a new line and stretches out to the left and right as far as it can.
Other common block-level elements are p
and form
, and new in HTML5 are header
, footer
, section
, and more.span
is the standard inline element. An inline element can wrap some
text inside a paragraph <span> like this </span> without disrupting the flow of that paragraph. Thea
element is the most
common inline element, since you use them for links.none
. Some specialized
elements such as script
use this as their default. It is commonly used with JavaScript
to hide and show elements without really deleting and recreating them.visibility
. Setting display
to none
will render the page as though the element does not exist. visibility: hidden;
will hide the element, but the element will still take up the
space it would if it was fully visible.list-item
and table
. Here is an exhaustive list. We'll discuss inline-block
and flex
later on.li
elements for horizontal
menus.SELECT * FROM Employee Emp1 WHERE (1) = ( SELECT COUNT(DISTINCT(Emp2.Salary)) FROM Employee Emp2 WHERE Emp2.Salary > Emp1.Salary)
You can probably see that Emp1 and Emp2 are just aliases for the same Employee table – it’s like we just created 2 separate clones of the Employee table and gave them different names.Understanding and visualizing how the query above works
Let’s assume that we are using this data:
Employee ID | Salary |
3 | 200 |
4 | 800 |
7 | 450 |
SELECT * FROM Employee Emp1 WHERE (1) = ( SELECT COUNT(DISTINCT(Emp2.Salary)) FROM Employee Emp2 WHERE Emp2.Salary > 200)
CREATE VIEW printdetails AS
SELECT prints.id,title,price,size,description,src,givenname,familyname,aka
FROM prints INNER JOIN artists ON prints.artistid = artists.id
function createThumbs( $pathToImages, $pathToThumbs, $thumbWidth, $thumbHeight ) { // open the directory $dir = opendir( $pathToImages ); // loop through it, looking for any/all JPG files: while (false !== ($fname = readdir( $dir ))) { // parse path for the extension $info = pathinfo($pathToImages . $fname); // continue only if this is a JPEG image if ( strtolower($info['extension']) == 'jpg' ) { //echo "Creating thumbnail for {$fname} "; // load image and get image size $img = imagecreatefromjpeg( "{$pathToImages}{$fname}" ); $width = imagesx( $img ); $height = imagesy( $img ); if ($width > $height){ // Create a landscape thumbnail // calculate thumbnail size $new_width = $thumbWidth; $new_height = floor( $height * ( $thumbWidth / $width ) ); // create a new temporary image $tmp_img = imagecreatetruecolor( $new_width, $new_height ); // copy and resize old image into new image imagecopyresampled( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height ); // save thumbnail into a file imagejpeg( $tmp_img, "{$pathToThumbs}{$fname}" ); imagedestroy($tmp_img); imagedestroy($img); }else { // Create new portrait sized thumbnail // calculate thumbnail size $new_width = $thumbHeight; $new_height = floor( $height * ( $thumbHeight / $width ) ); // create a new temporary image $tmp_img = imagecreatetruecolor($new_width, $new_height ); // copy and resize old image into new image imagecopyresampled( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height ); // save thumbnail into a file imagejpeg( $tmp_img, "{$pathToThumbs}{$fname}" ); imagedestroy($tmp_img); imagedestroy($img); } } } // close the directory closedir( $dir ); }
To call the function from within your php code:
Path to images is the path to where the images are kept and path to thumbnails is the where the thumbnails will be kept, tumbnail width is the width of the landscape images while thumbnail height is the height of the protrait images.
createThumbs( "images/", "images/thumbs/", 200, 150 );
If you have any comments or ways to make this better leave a comment below.
function toggle() { var ele = document.getElementById("toggle"); var text = document.getElementById("display"); if(ele.style.display == "block") { ele.style.display = "none"; text.innerHTML = "Show Map"; } else { ele.style.display = "block"; text.innerHTML = "Hide Map"; } }
This goes in the body of your code.
<a id="display" href="javascript:toggle();">Show Map</a>
<script type="text/javascript"> $(document).ready(function() { $('#example').tooltip(); }); </script>
You can add an number of customisations to suit your needs here in the code. Your choices are listed here. For anyone just learning it might look like this.
<script type="text/javascript">[
$(document).ready(function(){ $("#example").tooltip({ placement: "left", title: "tooltip on left", }); }); </script>
This just makes the tooltip go to the left and places a default title if you have not added it to the code as we previously did with the data-original-title.
Hope that helps.
<form id="ajaxform" name="ajaxform" action="assets/ajax/enquiry.php" method="post"> <div class="form-group name"> <label class="sr-only" for="name">Name</label> <input name="name" id="name" type="text" class="form-control" placeholder="Name:"> </div><!--//form-group--> <div class="form-group email"> <label class="sr-only" for="email">Email</label> <input name="email" id="email" type="email" class="form-control" placeholder="Email:"> </div><!--//form-group--> <div class="form-group message"> <label class="sr-only" for="message">Message</label> <textarea name="message" id="message" class="form-control" rows="6" placeholder="Message:"></textarea> </div><!--//form-group--> <button class="btn btn-lg btn-theme ">Send Message</button> </form><!--//form-->
This is where the results from the form that was submitted will be sent back to after being processed by the php script.
<!-- Results will be sent back to this div -->
<div id="result"></div>
This is the javascript / ajax call which is placed at the bottom of the HTML page.
<script type="text/javascript">
$("#ajaxform").submit(function(e){
var postData = $(this).serializeArray();
var formURL = $(this).attr("action");
$.ajax({
type: "POST",
url: formURL,
data: postData,
dataType: "json",
success: function(dataType){
// Successful result will be sent to the result div id.
$("#result").html(dataType);
},
complete:function(){
//Clear the form
$('#ajaxform')[0].reset();
}
});
e.preventDefault(); //STOP default action
e.unbind(); //unbind. to stop multiple form submit.
});
$("#ajaxform").submit(); //Submit the FORM
</script>
The form data is sent to this php script as directed in the form action. The php script receives the form information and then anything is possible. This short piece of code just verifies that the information has been received and sends back the return message to the orginal form.
if(!empty($_POST['name'])){
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
//Could insert this into the database.
$returnMessage = "The form has been submitted: $name ";
echo json_encode($returnMessage);
}if(!empty($_POST['name'])){
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
//Could insert this into the database.
$returnMessage = "The form has been submitted: $name ";
echo json_encode($returnMessage);
}