Tag Archive for size

formatBytes

function formatBytes($bytes, $precision = 2) {
$units = array('B', 'KB', 'MB', 'GB', 'TB');

$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);

$bytes /= pow(1024, $pow);

return round($bytes, $precision) . ' ' . $units[$pow];
}

source

Use Linux Find and Awk to Locate Large Files

find / -type f -size +20000k -exec ls -lh {} ; | awk '{ print $NF ": " $5 }'

source

Sort folders by size

du --max-depth=1 /home/ | sort -n -r

source

Increase SharePoint list template size limit

stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 50000000

source

ANGEL Lesson Icon Size

table.dirgrid
td.dircell
a img.largeIcon,
ul.directory
li.diritem a
img.largeIcon	{ width: 128px!important; left: -128px; }
ul.directory    { padding-left: 134px; } /* width + 6px */
#divAddContentObjects ul li,
#divAddContentMoreOptions ul li,
#divAddContentExtenions ul li,
ul.directory
li.diritem		{ height: 128px; }

source

Web.config – define max. upload size

<system.web>
<httpRuntime maxRequestLength="10000" />
</system.web>

// size is in kilobytes
// default upload size iz 4 megabytes
// max upload size is 100 megabytes

source

FF default headline sizes and their 1.2em equivalents

h1 {display: block;font-size: 2em;font-weight: bold;margin: .67em 0;}     // 32px
h2 {display: block;font-size: 1.5em;font-weight: bold;margin: .83em 0;}   // 24px
h3 {display: block;font-size: 1.17em;font-weight: bold;margin: 1em 0;}    // 19px
h4 {display: block;font-weight: bold;margin: 1.33em 0;}                   // 16px
h5 {display: block;font-size: 0.83em;font-weight: bold;margin: 1.67em 0;} // 13px
h6 {display: block;font-size: 0.67em;font-weight: bold;margin: 2.33em 0;} // 11px

h1 {font-size:2.667em;}
h2 {font-size:2em;}
h3 {font-size:1.583em;}
h4 {font-size:1.333em;}
h5 {font-size:1.083em;}
h6 {font-size:0.917em;}

source

AS2 リサイズ時の処理 フルFLASHでのリサイズ

Stage.align = "TL";
Stage.scaleMode="noScale";
Stage.addListener(this);
this.onResize = function() {
/*	リサイズ時の処理〜〜*/
head_shadow_mc._width = Stage.width;
underwhiteline_mc._width = Stage.width;
movie_mc._x = Stage.width/2 - movie_mc._width/2;
scroll_mc._x = Stage.width/2 - scroll_mc.mask_mc._width/2;
};
this.onResize();

source

Calculate directory size

/**
* Calculate directory size.
* @param   string  $path   without trailing '/' or '' (eg. '/users/sampleUser', not '/users/sampleUser/')
* @return  int 	size in bytes
*/
function calc_dir_size($path)
{
$size = 0;

if ($handle = opendir($path))
{
while (false !== ($entry = readdir($handle)))
{
$current_path = $path . '/' . $entry;
if ($entry != '.' && $entry != '..' && !is_link($current_path))
{
if (is_file($current_path))
$size += filesize($current_path);
elseif (is_dir($current_path))
$size = calc_dir_size($current_path);
}
}
}
closedir($handle);
return $size;
}

source

Get the width and height of an image using a function in PHP

<?php

list($width, $height, $type, $attr) = getimagesize("image_name.jpg");

echo "Image width " .$width;
echo "<BR>";
echo "Image height " .$height;
echo "<BR>";
echo "Image type " .$type;
echo "<BR>";
echo "Attribute " .$attr;

?>

source