tag:blogger.com,1999:blog-61655706111200231542008-12-11T17:08:19.085+02:00Byte HellWe live in a hell of bits & bytes. Now listen; we are all surrounded! They are getting more and more crowded every day! Kilos, megas, gigas, teras, petas, it's even getting harder to find new names! This is their world now! They plan an invasion!..
And that's a good thing... I like it. Right, this is just another personal blog of a code warrior...Onur Safakhttp://www.blogger.com/profile/11512497686392117032noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-6165570611120023154.post-38444784407539091382008-07-13T21:07:00.008+03:002008-08-18T18:36:42.356+03:002008-08-18T18:36:42.356+03:00SyntaxHighlighter mod for xhtml, css and blogger support.<p><span style="font-weight: bold;">Update :</span></p><p>New version of the mod is available under the name 'gembox'. It supports xhtml, doesn't require manually including brush files, and can be run within the header. You can get it from :<span style="text-decoration: underline;"><br /></span></p><p><span style="text-decoration: underline;"></span><a href="http://onursafak.com/projects/gembox/">http://onursafak.com/projects/gembox/</a><br /></p><p>More description about the usage will be available soon.</p><p>The post below is kept for historical purpose<br /></p><p></p><hr /><br /><p></p><p>Anybody remember the revolution of the 16 color computer displays?</p><p><a href="http://code.google.com/p/syntaxhighlighter/" target="_blank">SyntaxHighlighter</a> by Alex Gorbatchev is a well written client side syntax highlighter which uses javascript to colorize output from different languages on web pages, using customizable brush files for language definitions. I've found it's a good alternative for my needs and switched to it. Now it's used by Byte Hell for colorized outputs.</p><p>Before this I made a little modification on the code for some features which are asked by current users of this nice tool. </p><h4>For people already know about SyntaxHighlighter :</h4><p>With the modification HighlightAll function gets the same parameters. It now checks for the <em>'class'</em> attributes of the tags to highlight. This way it supports xhtml and blogger.com, keeps the name attributes available, and allows space seperated multiple styles in the class attribute, giving us the chance to attach custom styles to containers.</p><p>With the new syntax, the tags should be formed as below :</p><code><pre class="hl:sql">......</pre></code><p>Like before, options can be added to the class tag like: <em>'hl:sql:collapse'</em>, where <em>'hl'</em> is the name which is passed to the <em>'HighlightAll'</em> command, and <em>'sql'</em> is the language alias.</p><p>The xhtml mod can be found at :</p><p><a href="http://www.onursafak.com/tools/shx/shCore.js">http://www.onursafak.com/tools/shx/shCore.js</a></p><p>You can download the package from it's homepage and just replace this file.</p><p>Have a colorful day. </p>Onur Safakhttp://www.blogger.com/profile/11512497686392117032noreply@blogger.com4tag:blogger.com,1999:blog-6165570611120023154.post-86658807997410530362008-07-07T15:58:00.015+03:002008-07-20T10:12:34.767+03:002008-07-20T10:12:34.767+03:00Hide email links from spam bots - works with blogger.<p>Most of us are aware of spam bots, which scan the web and other media for email addresses to send unsolicited emails. So we avoid putting direct email addresses on the web.</p><p>Thinking about hiding, a few options come to mind. We can ;</p><ul> <li> Type it like 'darkwingduck -at- superhero.com', giving the reader an idea about the real address 'darkwingduck@superhero.com'</li>
<li> Use an image for the '@' character in html.</li>
<li> Use a contact form instead of giving an email address.</li>
<li> Use a script to build the address on the fly, which won't appear in the source files.</li>
</ul><p>I've choosen the last option for my blog pages. I usually use a single command javascript to build the address, like ;</p><pre class="hl:xml"><script language='javascript'>
document.write('foo' + '@' + 'bar.org');
</script>
</pre><p>This prints the address to the page on the fly. However this doesn't work in blogger somehow. So I've written a little script which will build the address after the page is completely loaded. This will work on nearly any web page including the blogger.</p><div class="fullpost"><p>It can be placed anywhere on the page, so we don't have to mess with the template html, and simply put it on the layout using an html widget.</p><p>Before saving it, we need to change the 'user' and the 'domain.com' fields in the script to match our address. Then we can write our email address anywhere on the page, including html tags like 'mailto:' links, using the syntax :</p><code>!myemail!</code><br />
<p>This will get replaced by the script to match our email address. Here is an example :</p><pre class="hl:xml">Please write me at<br />
<a href="mailto:!myemail!">!myemail!</a></pre><p>The script supports multiple email addresses and has an option for better performance. To make it perform better, you may wrap the area including emails with a span tag. Like :</p><pre class="hl:xml"><span id='myemailwrapper'>
Please write me at
<a href="mailto:!myemail!">!myemail!</a>
</span>
</pre><p>Note that if you only want to use your address in a link and not show it on the page, then you can just use :</p><pre class="hl:xml"><a href="#" onClick="SendMail('john','mywebsite.com');">
Write me!
</a></pre><h4>Here is the script :</h4><pre class="hl: js;">function SendMail(User,Domain) {
parent.location="mailto:" + User + "@" + Domain;
}
function RevealEmails() {
DoReplace('user','domain.com','myemail');
}
function DoReplace(MailBox, MailDom, FieldName) {
const TrySpan = true;
var RootItem;
if (TrySpan) RootItem = document.getElementById(FieldName + "wrapper");
if (!RootItem) RootItem = document.body;
RootItem.innerHTML = RootItem.innerHTML.replace(eval("/!" + FieldName + "!/gi"),MailBox + "@" + MailDom);
}
if (window.addEventListener) window.addEventListener("load", RevealEmails, false);
else if (window.attachEvent) window.attachEvent("onload", RevealEmails);
else {
if (window.onload != null) {
var oldOnload = window.onload;
window.onload = function ( e ) {
oldOnload( e );
RevealEmails();
}
}
else window.onload = RevealEmails;
}
</pre></div>Onur Safakhttp://www.blogger.com/profile/11512497686392117032noreply@blogger.com0tag:blogger.com,1999:blog-6165570611120023154.post-36755221757779760072008-07-01T06:05:00.010+03:002008-07-07T09:56:13.083+03:002008-07-07T09:56:13.083+03:00OuchI would NEVER do that. I like my face.<br /><br /><img style="cursor: pointer; width: 400px;" src="http://i259.photobucket.com/albums/hh299/martinstarflash/00033929.gif" alt="" border="0" />Onur Safakhttp://www.blogger.com/profile/11512497686392117032noreply@blogger.com3tag:blogger.com,1999:blog-6165570611120023154.post-84365072445421016892008-07-01T03:51:00.010+03:002008-07-04T20:38:21.808+03:002008-07-04T20:38:21.808+03:00How to hide the Site Meter button?Most web authors use hit counters / site statistics services to watch their site traffic. Most of the free services add a button or a banner to the pages they have been attached on. You may be using such a service and need to remove the image because of design considerations.<br /><br />For Site Meter (www.sitemeter.com) you can wrap the given html code as follows :<br /><blockquote><span><div style=“visibility:hidden;”></span><span style="font-weight: bold;"><br />-your sitemeter code-<br /></span></div><br /></blockquote>And just bookmark the entrance page to easily jump there.<br /><br />Anyway I recommend you give them some credits in your design to better support them, or perhaps keep it as is if it's not really needed.Onur Safakhttp://www.blogger.com/profile/11512497686392117032noreply@blogger.com0tag:blogger.com,1999:blog-6165570611120023154.post-12334132183943498882008-06-30T23:35:00.006+03:002008-07-03T09:19:17.012+03:002008-07-03T09:19:17.012+03:00New Yahoo Mail domainsA few days too late, Yahoo Mail now offers two new public email domains; <span style="font-weight: bold;">"rocketmail.com"</span> with some flavour of nostalgia, which was the former address of the service before it was acquired by Yahoo, and <span style="font-weight: bold;">"ymail.com"</span>.<br /><br />I checked it out but was a few days too late to catch a few very short names (a 4 letters name is a disadvantage this time), just found one for a friend.<br /><br />So if you are looking for a neat free email address, your chances are still very good, <a href="http://mail.yahoo.com/">jump in</a> !<br /><br />They also support moving your current e-mail address to a new one. Here is the <a href="http://www.ymailblog.com/blog/2008/06/new-domains/">entry from the Yahoo Mail blog</a>.Onur Safakhttp://www.blogger.com/profile/11512497686392117032noreply@blogger.com0tag:blogger.com,1999:blog-6165570611120023154.post-68736468664414003942008-06-29T09:32:00.010+03:002008-07-01T01:08:51.106+03:002008-07-01T01:08:51.106+03:00Farewell XM, Hail AOL Radio!One late note for people who have enjoyed listening to AOL radio (formerly known as Spinner and Netradio) on their winamps in the past, which presented a high number of well categorized stations, but then instantly replaced with free XM demo stations. XM had some good stations but they've cropped the list day by day to a few, as it was just a demo to their pay service. Some of you may have stopped using the service or switched to Shoutcast radio after XM.<br /><br />Now XM's agreement is over and they've decided to stop using winamp to demonstrate their service. Some people was unhappy with this since it was their only chance to listen to XM in the European countries. But the great news is AOL is back on Winamp with their good quality stations. That made me happy, giving me a lot of choices from the rock, electronic and the jazz stations, along with the others.<br /><br />So in case you are one of those who've stopped checking the service for updates, check it out, blow the dust off of your winamp, and of your ears!<br /><br />Just wanted to inform others after having a good feast of music (power metal this time).Onur Safakhttp://www.blogger.com/profile/11512497686392117032noreply@blogger.com0tag:blogger.com,1999:blog-6165570611120023154.post-63345832185378080652008-06-29T09:01:00.008+03:002008-07-01T07:11:44.009+03:002008-07-01T07:11:44.009+03:00Ida Pro textbox bugOn Ida Pro disassembler, there is a bug which makes it painful to edit a text in a textbox. When you want to change a part of the text, you select the part as usual, then with a keypress all text gets replaced with an MRU entry beginning with the entered letter. So you need to avoid selecting text parts and use -del- key instead.<br /><br />Sometimes I can't see how some wide spread, well recognized software can have some very simple and obvious implementation errors or bugs like this. And there are worse others...<br /><br />No doubt Ida Pro is the best disassembler today, but it also has one of the worst interface designs I know of.Onur Safakhttp://www.blogger.com/profile/11512497686392117032noreply@blogger.com0tag:blogger.com,1999:blog-6165570611120023154.post-4644180016395771572008-06-29T05:18:00.005+03:002008-06-29T07:48:09.881+03:002008-06-29T07:48:09.881+03:00Hello World !Finally I created a web log.<br /><br />I was organizing my email accounts under Google and thought having a web log, just in case wouldn't hurt. I don't think this thing will be used much as I don't have much spare time, but from time to time I may post some quick tips which may save the day for people who search for some info on the web. I know a few situations saved mine...Onur Safakhttp://www.blogger.com/profile/11512497686392117032noreply@blogger.com0