So four hours later, after some Battlefield 4, I log back in to find a whole bunch of new directories had been made and again nothing in the logs to indicate how they were created. So I contacted my hosts and asked them to check the ownership of the directories and the files they contained. They eventually got back and told me they had been created via my FTP account from an an IP address in Poland, 77.114.120.185. Given my username and password are not simple things I scanned my computer to make sure it hadn’t been compromised. Two different anti virus programs and no malware found. Then I remembered that about a month or so ago I tested three FTP apps on my Android phone. One didn’t seem to work but the other two worked just fine after some messing with the settings. So by logical deduction I suspect this is how my account details got compromised. I checked the Play Store and only two of the three apps I tested are still listed which is another sign that this was the problem.
The moral of the story, if you need to FTP from your mobile device or anything else that requires your sites login details stick with trusted names or those that have a lot of reviews both good and bad. I was lucky but they could of done some serious damage.
]]>Anyway all fixed now.
]]>I also added a new function, toggleSlide, which means instead of needing a link to call the slideDown and then one to call the slideUp you can just call toggleSlide and it will either slide it up or down depending on it’s current state.
And so I am offering my version of the script here since I think some people might be in the same boat as me and find my solution useful and also because the original source is no longer available.
/* Originally from http://www.harrymaugans.com/2007/03/06/how-to-create-an-animated-sliding-collapsible-div-with-javascript-and-css/ Update by Carbonize - http://carbonize.co.uk Date: Sun, 10 March 2013 20:15:24 GMT To use simply use slidedown(objects ID) to slide it down/open or slideup(object ID) to make it slide up/closed Or simpler yet I have added toggleSlide(object ID) so you can just call one function and it will automatically slide the object up or down depending on it's current situation Please remember to set the elements overflow to hidden as in overflow: hidden; otherwise it's contents will be visible. And you might want to add return: false; when you call it to stop the link you are using from doing anything. */ var timerlen = 5; var slideAniLen = 250; var timerID = new Array(); var startTime = new Array(); var obj = new Array(); var endHeight = new Array(); var moving = new Array(); var dir = new Array(); function slidedown(objname){ if(moving[objname]) return; if(document.getElementById(objname).style.display != "none") return; // cannot slide down something that is already visible moving[objname] = true; dir[objname] = "down"; startslide(objname); } function slideup(objname){ if(moving[objname]) return; if(document.getElementById(objname).style.display == "none") return; // cannot slide up something that is already hidden moving[objname] = true; dir[objname] = "up"; startslide(objname); } function startslide(objname){ obj[objname] = document.getElementById(objname); startTime[objname] = (new Date()).getTime(); if(dir[objname] == "down"){ obj[objname].style.height = "1px"; } obj[objname].style.display = "block"; endHeight[objname] = parseInt(obj[objname].scrollHeight); timerID[objname] = setInterval('slidetick(\'' + objname + '\');',timerlen); } function slidetick(objname){ var elapsed = (new Date()).getTime() - startTime[objname]; if (elapsed > slideAniLen) endSlide(objname) else { var d =Math.round(elapsed / slideAniLen * endHeight[objname]); if(dir[objname] == "up") d = endHeight[objname] - d; obj[objname].style.height = d + "px"; } return; } function endSlide(objname){ clearInterval(timerID[objname]); if(dir[objname] == "up") obj[objname].style.display = "none"; obj[objname].style.height = endHeight[objname] + "px"; delete(moving[objname]); delete(timerID[objname]); delete(startTime[objname]); delete(endHeight[objname]); delete(obj[objname]); delete(dir[objname]); return; } function toggleSlide(objname) { // Pointless going any further if we are already sliding the object if(moving[objname]) return; if (document.getElementById(objname).style.display == 'none') { // div is hidden, so let's slide down slidedown(objname); } else { // div is not hidden, so slide up slideup(objname); } } |
Here’s some example HTML
<a onclick="toggleSlide('myDiv'); return false;" href="somewhere.php">Toggle Div</a> |
In the European Union alone, thousands of children are still missing. They run away from conflicts at home, are the victims of parental abductions, disappear after having travelled across the EU alone, or are abducted by criminals. But there is a way you can help, namely by installing the Notfound application. By doing this, automatically, a picture of a missing child will be posted on every 404 page of your website. This is how you can help Child Focus spread a maximum number of photos and help all missing children find their way home.
Discover the application on www.notfound.org.
]]>function randomString($strLen = 32) { // Create our character arrays $chrs = array_merge(range('a', 'z'), range('A', 'Z'), range(0, 9)); // Just to make the output even more random shuffle($chrs); // Create a holder for our string $randStr = ''; // Now loop through the desired number of characters for our string for($i=0; $i<$strLen; $i++) { $randStr .= $chrs[mt_rand(0, (count($chrs) - 1))]; } return $randStr; } |
Using it is simply a case of calling it and specifying how long to make the string otherwise it uses the default length of 32 characters.
echo randomString(12);
To also make it use symbols you just change the array_merge to
// If we want letters, numbers and symbols
$chrs = array_merge(range('a', 'z'), range('A', 'Z'), range(0, 9), array('!','£','$','%','^','&','*','(',')','-','=','+','@','#','~','?'));
Now for the JavaScript version. JavaScript has neither a range() function nor an easy way to shuffle an array so the code here is a little longer.
function randomString(len) { // Just an array of the characters we want in our random string var chrs = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; // Check that a length has been supplied and if not default to 32 len = (isNaN(len)) ? 32 : len; // The following section shuffles the array just to further randomise the output var tmp, current, top = chrs.length; if(top) { while(--top) { current = Math.floor(Math.random() * (top + 1)); tmp = chrs[current]; chrs[current] = chrs[top]; chrs[top] = tmp; } } // Just a holder for our random string var randomStr = ''; // Loop through the required number of characters grabbing one at random from the array each time for(i=0;i<len;i++) { randomStr = randomStr + chrs[Math.floor(Math.random()*chrs.length)]; } // Return our random string return randomStr; } |
Now close Firefox and when you restart all your extensions should be working again.
]]>Just remember the code is far from perfect and was created to do a simple job.
It also has one nice extra function you might find useful…
The directMail function will look up the recipients SMTP server and try to deliver the email directly to it thereby bypassing the need for you to have access to an SMTP server to send through. Just remember your host may frown upon the use of this function.
/* * SMTP Email Sending * By Stewart Souter * Date Created: Thurs, 11 August 2011 17:15:37 GMT * Last Updated: Fri, 19 August 2011 10:54:35 GMT * email: [email protected] * * By using this script you are agreeing to leave this * comment and agreement in place and untouched. If you * use any part of this code you must make it clear where * it came from and give credit where it is due. */ $mailCfg['Server'] = ''; // Servername $mailCfg['User'] = ''; // SMTP username if needed $mailCfg['Pass'] = ''; // SMTP Password if needed $mailCfg['Port'] = 25; // SMTP server port. 25 is the usual and 465 if using SSL $mailCfg['popServer'] = ''; // Name of the pop server. Leave empty if POP Auth not required $mailCfg['popPort'] = 110; // Port for the pop server. 110 is the usual and 995 if using SSL $mailCfg['SSL'] = 0; // Does your SMTP server need you to use SSL or TLS? 0 = no, 1 = SSL, 2 = TLS // This function delivers the email directly to the recipients mail server so bypassing the need for your own function directMail($mailTo, $mailSubject, $mailMsg, $mailHeaders = '', $mailFrom = '', $mailCfg) { if(empty($mailFrom)) { return false; // No from address == no sending } $mailParts = explode('@', $mailTo); // Seperate the parts of the email address @getmxrr($mailParts[1], $mxHosts, $mxWeight); // Get the MX records for the emails domain for($i=0;$i<count($mxHosts);$i++) // Put the records and weights into an array { $mxServers[$mxHosts[$i]] = $mxWeight[$i]; } asort($mxServers); // Sort the array so they are in weighted order foreach($mxServers as $key => $value) { $mailCfg['Server'] = $key; // Set the SMTP server to the current MX record if(smtpMail($mailTo, $mailSubject, $mailMsg, $mailHeaders, $mailFrom, $mailCfg)) // Send the email using the MX server { return true; // The email was successfully sent } } return false; // Houston we have a problem } // This function connects to the SMTP server and does the AUTH if needed. Can also do a POP login if server requires that. function smtpMail($mailTo, $mailSubject, $mailMsg, $mailHeaders = '', $mailFrom = '', $mailCfg ) { if(empty($mailFrom)) { return false; // No from address == no sending } $timeout = '30'; // How long to keep trying to connect $localhost = 'localhost'; // How to identify ourselves $logArray = array(); // For storing the replies /* * * * POP Login if required * * */ if(!empty($mailCfg['popServer'])) // Can't really do POP Auth without a server { $ssl = ($mailCfg['SSL'] != 0) ? (($mailCfg['SSL'] == 1) ? 'ssl://' : 'tls://') : ''; // If SSL or TLS add it $popConnect = @fsockopen($ssl.$mailCfg['popServer'], $mailCfg['popPort'], $errno, $errstr, $timeout); // Connect if(!$popConnect) // If we fail to connect... { $logArray['POPconnect'] = $errstr . '(' . $errno . ')'; // Log the given reason... logMailError($logArray); // And output to the log file. return false; } else { $logArray['POPconnect'] = @fgets($popConnect, 515)); // POP servers only return single line replies. Or should. if(!mailPackets('AUTH LOGIN', $popConnect, 'SMTPauth')) //Request Auth Login { return false; } if(!mailPackets('USER ' . $smtpUser, $popConnect, 'POPuser')) // Send username. POP is plaintext { return false; } if(!mailPackets('PASS ' . $smtpPass, $popConnect, 'POPpass')) // Send password, again in plaintext { return false; } if(!mailPackets('QUIT', $popConnect, 'POPquit')) // Say bye to the server { return false; } fclose($popConnect); // Close connection } } /* * * * End of POP Login * * * * */ /* * * * Start of SMTP stuff * * * */ $ssl = ($mailCfg['SSL'] != 0) ? (($mailCfg['SSL'] == 1) ? 'ssl://' : 'tls://') : ''; // Set the encryption if needed $smtpConnect = @fsockopen($ssl.$mailCfg['Server'], $mailCfg['Port'], $errno, $errstr, $timeout); // Connect if(!$smtpConnect) // If we fail to connect... { $logArray['SMTPconnect'] = $errstr . '(' . $errno . ')'; // Add the reason to the log... logMailError($logArray); // Then output the log return false; } else { $cnectKey = 0; // A counter for when we receive multiple lines in reply do { $smtpResponse = @fgets($smtpConnect, 515); // Get the reply $cnectKey++; // Increment the counter $logArray['SMTPconnect' . $cnectKey] = $smtpResponse; // Log the response $responseCode = substr($smtpResponse, 0, 3); // Grab the response code from start of the response // If we get an error terminate the connection and log the results so far if($responseCode >= 400) { logMailError($logArray, $smtpConnect); return false; } } while((strlen($smtpResponse) > 3) && (strpos($smtpResponse, ' ') != 3)); // Loop until we get told it's the last line $ehlo = mailPackets('EHLO ' . $localhost, $smtpConnect, $logArray, 'SMTPehlo'); // Let's try using EHLO first if($ehlo != 250) // Server said it didn't like EHLO so drop back to HELO { if(!mailPackets('HELO ' . $localhost, $smtpConnect, $logArray, 'SMTPhelo')) // Send HELO. No EHLO means server doesn't support AUTH { return false; } } if(!empty($mailCfg['User']) && ($ehlo == 250)) // We have a username and server supports EHLO so send login credentials { if(!mailPackets('AUTH LOGIN', $smtpConnect, $logArray, 'SMTPauth')) // Request Auth Login { return false; } if(!mailPackets(base64_encode($mailCfg['User']), $smtpConnect, $logArray, 'SMTPuser')) // Send username { return false; } if(!mailPackets(base64_encode($mailCfg['Pass']), $smtpConnect, $logArray, 'SMTPpass')) // Send password { return false; } } if(!mailPackets('MAIL FROM:<' . $mailFrom . '>', $smtpConnect, $logArray, 'SMTPfrom')) // Email From { return false; } if(!mailPackets('RCPT TO:<' . $mailTo . '>', $smtpConnect, $logArray, 'SMTPrcpt')) // Email To { return false; } if(!mailPackets('DATA', $smtpConnect, $logArray, 'SMTPmsg')) // We are about to send the message { return false; } // First lets make sure both the message and additional headers do not contain anythign that might be seen as end of message marker $mailMsg = preg_replace(array("/(?<!\r)\n/", "/\r(?!\n)/", "/\r\n\./"), array("\r\n", "\r\n", "\r\n.."), $mailMsg); $mailHeaders = (!empty($mailHeaders)) ? "\r\n" . preg_replace(array("/(?<!\r)\n/", "/\r(?!\n)/", "/\r\n\./"), array("\r\n", "\r\n", "\r\n.."), $mailHeaders) : ''; // Create the default headers, attach any additonal headers $mailHeaders = "To: <".$mailCfg['To'].">\r\nFrom: <".$mailCfg['From'].">\r\nSubject: ".$mailCfg['Subject']."\r\nDate: " . gmdate('D, d M Y H:i:s') . " -0000".$mailHeaders; if(!mailPackets($mailHeaders."\r\n\r\n".$mailMsg."\r\n.", $smtpConnect, $logArray, 'SMTPbody')) // The message { return false; } mailPackets('QUIT', $smtpConnect, $logArray, 'SMTPquit'); // Say Bye to SMTP server fclose($smtpConnect); // Be nice and close the connection return true; // Return the fact we sent the message } } // This function sends the actual packets then logs the reponses and parses the reponse code function mailPackets($sendStr,$mailConnect,&$logArray,$logName = '') { $newLine = "\r\n"; // LEAVE THIS ALONE $keyCount = 0; // Just an incremental counter for when we get more than a single line response @fputs($mailConnect,$sendStr . $newLine); // Send the packet do // Start grabbing the responses until we either get a terminal error or told we are at the end { $mailResponse = @fgets($mailConnect, 515); // Receive the response $keyCount++; // Incrememnt the key count $logArray[$logName . $keyCount] = $mailResponse; // Put the response in to the log array $responseCode = substr($smtpResponse, 0, 3); // Grab the response code from start of the response // Check for error codes except on ehlo, auth, and user details as they are not always fatal if((($logName != 'SMTPauth') && ($logName != 'SMTPuser') && ($logName != 'SMTPehlo') && ($logName != 'SMTPpass')) && ($responseCode >= 400)) { logMailError($logArray,$mailConnect); return false; } elseif((substr($responseCode, 0, 1) == 4) || ($responseCode >= 521) && ($logName != 'SMTPehlo')) { logMailError($logArray,$mailConnect); return false; } } while((strlen($mailResponse) > 3) && (strpos($mailResponse, ' ') != 3)); // Loop until we get the end response return $responseCode; // Return the response code } function logMailError(&$logArray, $mailServer = false) { if($mailServer) { fclose($mailServer); // Be nice and close the connection } $fd = @fopen ('smtplog.txt', 'a'); // open the log file $mailResults = print_r($logArray, true); // Create a nice printable version of logArray @fwrite($fd,$mailResults); // Write the log @fclose ($fd); // Close the file } |
To disable it in the browser go to Internet options by either clicking the gear cog on the right hand side of IE9s toolbar or go to your control panel. Once open click on the Advanced tab. The very first option is Use software rendering instead of GPU rendering* so tick that. You will then have to restart IE9. Hopefully Zuma Blitz will be a bit more tolerable now.
To disable it in Flash simply go to a web page that has Flash in it and right click on the flash. From the menu that appears select Settings… and then deselect the Enable hardware acceleration option.
So first try disabling one. If that doesn’t work re-enable the one you disabled and disable the other one. If it’s still jerky try disabling them both.
If all else fails you can always just uninstall IE9 and go back to IE8 or try one of the other browsers such as Firefox, Chrome or Opera.
]]>
If you want to do more than one file simply repeat steps 1 – 7 before clicking Encode. So now you now how simple it is to get MKV to play on Xbox 360.
Just a minor update. I forgot that the Xbox does not like 5.1 audio so if your original file is using 5.1 audio you will have to convert to stereo. If you do you need to do this then simply setting the Modus under Audio to convert instead of copy should work just fine as the default is stereo.
Warning! – The latest version of Xmedia recode, 3.0.3.0, has a bug where selecting Video copy will result in an empty file being created. I have informed them of this bug. Appears to have been fixed in version 3.0.3.4.
Now on to the downsides.
Their video tag will only play .h264 files. Originally the specifications stated that the video tag would use the open source OGG codec but then Apple complained and so any codec could be used. Not that the fact both Apple and Microsoft own parts of the .h264 licences or anything. Now Google has purchased a company that was working on a new codec called WebM and has made it freely available with Firefox already supporting it as well as Chrome. Microsoft say they refuse to support WebM until Google can guarantee there will be no patent claims against WebM in the future. This is typical MS hypocrisy since their own licence for letting you use .h264 clearly states they offer no such guarantee themselves.
No support for the text-shadow CSS despite the fact Internet Explorer has offered text shadow as one of it’s filters since IE5.5.
Flash can be very laggy. My current favourite game, Zuma Blitz, is damn near impossible to play due to it being so jerky. This is possibly down to the hardware acceleration as Firefox 4 also suffers from this.
Still I think for most people who only use IE this will be a major breath of fresh air.
]]>