<html>
<head>
<style>
html, body{margin:0; padding:0;border: 0;outline: 0;}
</style>
</head>
<body>
<!--The problem-->
<div style="margin:0; width:100%; background-color:#060;">
Header 1
</div>
<div style="margin:0 auto; width:1000px; background-color:#03C;">
Text Line 1
</div>
<br /><br />
<!--Fix-->
<div style="margin:0; width:100%; min-width:1000px; background-color:#060;">
Header 2
</div>
<div style="margin:0 auto; width:1000px; background-color:#03C;">
Text Line 2
</div>
</body>
</html>
Don't forget padding widths when calculating min width.
Thursday, February 13, 2014
div losing background color/image when resizing the browser window
When you have div width 100% it apply to browser viewpoint only not the max page width. This can be a problem when you have another div with a fixed width length. The fix is to put a min-width with max possible page width.
Wednesday, February 12, 2014
Cannot login to Games for Windows LIVE
Login issue for me was caused by two-step verification. you can either disable it temporally till you finish game or you can use a App password that you can find in your Live account under "Security info".
GFWL can be very annoying at times. I had problems with it every time it was required to play a specific game. Wish they at least give a detailed error message without wasting my time for hours looking for fixes.
GFWL can be very annoying at times. I had problems with it every time it was required to play a specific game. Wish they at least give a detailed error message without wasting my time for hours looking for fixes.
Thursday, February 6, 2014
HD 7750 cypto coin mining experience
HD 7750 is a entry level card for mining any kind of coin. suitable for casual mining while you do other stuff in the pc. I mine Feathercoin (FTC) as it has a very low difficulty but I think Litecoin will give the same return when converted to Bitcoins. I get around 2.5FTC per day with wemineftc.com pool.
My HD 7750 punch 134 khash/s on Intensity level of 13 in GUIminer-scrypt
GPU clock increased to 825MHz (core speed 800)
Memory clock speed decreased to 700Mhz to reduce temperature. you can change card settings using amd catalyst control center.
It can easily go over 150 Khash/s with more GPU overclocking and increasing the intensity level. I haven't tried to push the card that far since increase core speed make temperature go over the roof.
My HD 7750 punch 134 khash/s on Intensity level of 13 in GUIminer-scrypt
GPU clock increased to 825MHz (core speed 800)
Memory clock speed decreased to 700Mhz to reduce temperature. you can change card settings using amd catalyst control center.
It can easily go over 150 Khash/s with more GPU overclocking and increasing the intensity level. I haven't tried to push the card that far since increase core speed make temperature go over the roof.
How to get all results without the first row from a MySQL table
To exclude first row you have to use MySQL limit clause.
You can pass 2 values to limit clause first one is the starting row. Row index start with 0 so you have to put 1 to remove first row. Second parameter is the number of result u need to retrieve. Put a number that is larger than max rows of table.
select * from table limit 1, 10000000
You can pass 2 values to limit clause first one is the starting row. Row index start with 0 so you have to put 1 to remove first row. Second parameter is the number of result u need to retrieve. Put a number that is larger than max rows of table.
Sunday, September 15, 2013
Disable other_vhosts_access.log in ubuntu
Check the following location for apache2.conf and other-vhost-access-log
/etc/apache2/apache2.conf
/etc/apache2/conf.d/other-vhost-access-log
Open those files and check for the line with other_vhosts_access.log and comment them out with # sign in front of the line.
Restart Apache.
/etc/apache2/apache2.conf
/etc/apache2/conf.d/other-vhost-access-log
Open those files and check for the line with other_vhosts_access.log and comment them out with # sign in front of the line.
Restart Apache.
Monday, April 1, 2013
Fixing MP4 not playing until full video loads in browser
I had a problem where my mp4 videos were not played by video.js player until the video was fully downloaded by the browser. after some searching I found out it was because mp4 file metadata ( moov atom) is on the end of the file and the player cannot locate it for streaming when initially played.
I was saved by this small php library http://code.google.com/p/moovrelocator/
This will read a video and move MOOV-Atom to the front of the mp4 file.
there is a demo in _demo folder. if you get errors finding the paths, try giving direct paths like this in index.php
$inFile = '../../videos/'.$tempv;
// output (processed file)
$outFile = '../../new_videos/'.$tempv;
if you get zend errors try giving direct paths in Moovrelocator.class.php
// atom poc class
require_once 'atom/Atom.class.php';
// bytearray to operate direct on bytes in memory just to simulate Adobe's AS3 Bytearray
require_once 'bytes/Bytearray.class.php';
// transform (taken from php-reader)
require_once 'bytes/Transform.class.php';
you may also want to change your php.ini max execute time and memory use if you are looping through lot of videos in a folder.
I was saved by this small php library http://code.google.com/p/moovrelocator/
This will read a video and move MOOV-Atom to the front of the mp4 file.
there is a demo in _demo folder. if you get errors finding the paths, try giving direct paths like this in index.php
$inFile = '../../videos/'.$tempv;
// output (processed file)
$outFile = '../../new_videos/'.$tempv;
if you get zend errors try giving direct paths in Moovrelocator.class.php
// atom poc class
require_once 'atom/Atom.class.php';
// bytearray to operate direct on bytes in memory just to simulate Adobe's AS3 Bytearray
require_once 'bytes/Bytearray.class.php';
// transform (taken from php-reader)
require_once 'bytes/Transform.class.php';
you may also want to change your php.ini max execute time and memory use if you are looping through lot of videos in a folder.
Sunday, October 28, 2012
php file upload error messages in a php array
Hope this will be useful to someone, all the php file upload error codes and messages in an array.
<?php
$error_codes = array(
0=>"There is no error, the file uploaded with success",
1=>"The uploaded file exceeds the upload_max_filesize directive in php.ini",
2=>"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form",
3=>"The uploaded file was only partially uploaded",
4=>"No file was uploaded",
6=>"Missing a temporary folder",
7=>"Failed to write file to disk",
8=>"A PHP extension stopped the file upload"
);
/* Posssible Usage */
if($_FILES["userfile"]["error"] > 0){
$code = $_FILES["userfile"]["error"];
echo $error_codes[$code];
}
else{
//do the processing
}
?>
Tuesday, October 23, 2012
How to change default timezone in Ubuntu command-line
In a Ubuntu / Debian based Linux system you can use the following command to run the timezone setup to change the default timezone
dpkg-reconfigure tzdata
Subscribe to:
Posts (Atom)

