Urbano's Blog

Words from Alejandro U. Alvarez

RSS Feeds

  • Home
  • About me
  • Contact me
  • Plugins
    • Custom Fonts WordPress Plugin (v 5)
    • Nospam (v.1)
  • Advertise on Urbano’s Blog

Developing more intelligent algorithms

Nov 22nd

Posted by alex in General talk

No comments

First of all, what do we call intelligence when talking about algorithms? Well, if we have an algorithm that is able to forecast when it is going to rain and when it will be sunny, we might call that intelligent, but it depends on some other variable, the time and effort it took for it to get those results. Thus the faster and lower number of variables our algorithm needs to return the same or even better results, the more intelligent it is.
That is a rule of thumb, but how do we do that?

Well, many scientists say "Copy nature", and that is indeed a good solution, why? Because nature know how to do perfect algorithms. I'll take simple animals to explain this, for example the ants. If we were to program ants, we would say it is too hard, but are we sure?
How nature did them was by "programming" the simplest possible set of rules (Apart from the moving/eating/basic functions), which put together create the complex societies we see them live in.

Say we want to program ourselves an animal, and we want it to always be safe. Then, instead of programming complex recognition software, or advanced algorithms that determine the surroundings, why don't we try nature's approach, the simplistic approach?
Of course we need to build some "complex" systems, for understanding certain objects, lighting conditions, wet/dry states... Now, we give its algorithms a set of rules, to call them somehow:
First, don't run out of battery. So it has to learn how to plug itself, or any other charging method right?
Second, escape from moving objects.
Third, shade is safer.

Another requirement is that we give the robot the ability to store information, so it can learn what places are better and which ones are not. Now if we set it to "on" and watch what happens, the robot will cautiously start moving toward safer environments, and whenever battery runs lower, it will leave the safe place to look for a plug.

This sounds ok right? Now from this base we could start building better intelligence, but the base is this. We need something basic, some sort of default behavior.

If I have time I will build a java applet or something of the sort to test this out,

Best regards,
Alex

ai, ant, artificial intelligence, bot, robot
The Programmers Hierarchy

The Programmers Hierarchy

Nov 18th

Posted by alex in Programming

No comments

The Programmers Hierarchy

The Programmers Hierarchy

I hope you enjoy this ;)

hierarchy, javascript, jquery, programmers, rotate, tabs, ui

Our of the oven Flash Templates:

Nov 3rd

Posted by alex in Graphic Design

No comments

Flash MintI was building a site for a relative new company a couple weeks ago, and they wanted "A professional looking, brilliant display" for their products, I know Flash, and can do decent stuff with it, but seriously, how long does it take to do something really cool?

So I headed to the only place where I know this can be found for sure, Flash Mint, it was right then when I realized how much I had grown accustomed to it, the ease of use and friendliness of the design, and always full of new stuff!

You can even customize the products, get full website designs, and many flash templates for almost anything (Along with HTML, CSS, WordPress themes... etc) the list looks almost endless haha

Not so long ago I even bought a WordPress theme for a client I didn't have enough time to spend on. He was looking for something like that and I told him I could offer him a better price if he bought a pre-made template, so I showed him the ones that best fit his description and he ended up getting the "Personal Blog Theme", which looked really nice and fitted my client perfectly,

So if you are in a rush, or simply need a professional-looking Flash Movie, Template, or anything of the sort, this is a great alternative!

javascript, jquery, rotate, tabs, ui

Perfect jQuery UI rotating tabs

Oct 20th

Posted by alex in CSS

No comments

Tabs are nice. They create a very elegant interface, and jQuery UI does this marvelously, here we have a little preview of this:

jQuery UI Tabs

jQuery UI Tabs

How to do that?

Include the files

With jQuery and jQuery UI it is dead simple. First, load the JS libraries, I recommend using the hosted files at Google for jQuery:

 
<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="path/to/jquery UI" type="text/javascript"></script>
 

Remember to include also the CSS files for the UI Theme! Otherwise the tabs won't seem to work!

The HTML for the tabs:

We need a little HTML for our tabs to work:
A wrapper, a few divs with the content, and an unordered list with the tabs:

 
<div id="tabs-rotate">
<ul>
<li><a href="#tab1"><span>Tab 1</span></a></li>
<li><a href="#tab2"><span>Tab 2</span></a></li>
<li><a href="#tab3"><span>Tab 3</span></a></li>
</ul>
<div id="tab1">Tab 1 content</div>
<div id="tab2">Tab 2 content</div>
<div id="tab3">Tab 3 content</div>
</div>
 

The JavaScript:

Now comes the cool part, basically we want to have tabs. But although tabs are nice, people may not realize there is more content, or they might be just too lazy to browse through it, so, why not rotate through the tabs?
jQuery UI does that by itself with a very simple commant, but it is not perfect! So we need to program our tabs to rotate, unless the mouse is over them. This way when a user is looking for a link, the tab will wait!

So here is how this is achieved:

 
$(document).ready(function(){
	$("#tabs-rotate").tabs({ fx: { opacity: 'toggle' } }).tabs('rotate', 3000);
	$('#tabs-rotate').hover(function(){
			$(this).tabs('rotate', 0, false);
		},function(){
			$(this).tabs({ fx: { opacity: 'toggle' } }).tabs('rotate', 3000);
		}
	);
});
 

First we instruct jQuery UI to set up tabs in that div, and to rotate them. Then we use a hover event to control the rotation. On hover no rotation, and on out resume rotation.

See it in action

You can see it working on the DJs Music homepage

As with the best stuff, it's terribly simple ;)

Hope you enjoy,
Alex

javascript, jquery, rotate, tabs, ui

Stylish CSS trick for your Website

Oct 19th

Posted by alex in CSS

No comments

Maybe a few of you noticed this on some websites, maybe some of you even use it.
Right now this works in Safari, Opera, and Konqueror and Firefox 3.x. (I think it doesn't work in Firefox 1 or 2, correct me if I'm wrong)

What I'm talking about is the text-shadow, wisely applied to your design, it can give an great touch of elegance to your site.
Here you have an example:

Before -> After

And here you have a coded example:

Test shadow

The code

The CSS for this is very simple, we will simply apply a slight text-shadow, of 1px with no blur, to the text:

 
.elegant{
text-shadow:#FFFFFF 0 1px;
}
 

This effect works best with dark grey text over light grey background, and it is a very useful style for "2.0" designs.

Hope you enjoyed it!
Alex

css, elegant, shadow, stylish, trick
«12345»1020...Last »
  • Looking for something?

    • Popular posts
    • Archives
    • Tags
    • Categories
    • General talk (61)
      • Tips (5)
    • Graphic Design (28)
      • Branding (3)
      • Cool pics (5)
      • CSS (15)
      • Icons (2)
      • Photoshop (9)
    • OS (15)
      • Windows (14)
    • Programming (32)
      • C++ (1)
      • Javascript (7)
      • PHP (19)
      • XML (1)
    • Reviews (6)
    • Web-related (53)
      • Browsers (4)
      • Facebook (1)
      • Layout/Styling (9)
      • Security (1)
      • SEO (13)
      • Social Bookmarking (1)
      • Traffic building (5)
      • WordPress (10)
        • Plugin development (1)
    • Weird stuff (7)
      • Humor (2)
    ajax application best blog bot chat class codes control corners css design english Firefox food fun google handler ie image irc javascript jquery language photoshop php play plugins post redesign remote rotate rounded seo spanish tabs top tutorial ui upload url web weird Windows WordPress
    • March 2010 (2)
    • February 2010 (1)
    • January 2010 (2)
    • November 2009 (3)
    • October 2009 (3)
    • September 2009 (3)
    • August 2009 (2)
    • July 2009 (1)
    • June 2009 (3)
    • February 2009 (3)
    • January 2009 (3)
    • December 2008 (1)
    • November 2008 (7)
    • September 2008 (11)
    • August 2008 (7)
    • July 2008 (1)
    • June 2008 (10)
    • May 2008 (18)
    • April 2008 (25)
    • March 2008 (17)
    • PHP logging class v. 1.2 (25)
    • Best unobtrusive anti-spam technique (Not CAPTCHA) (19)
    • Country lists in most popular languages (14)
    • Did you mean… ? In php (13)
    • Best Photoshop brushes for web designers (12)
    • Quantum Universe Simulation – The Unique beings paradox (12)
    • Bad words list (458 words) (8)
    • sIFR – Use custom fonts in your website safely (8)
    • Creating an IRC bot in PHP from scratch (7)
    • Use Firefox to spell check your website (7)
  • About me

    I am Alex, a software and communications engeneering student. I currently live in the north of Spain.

    For the past years I have been working on software and application development, as well as sharing tips and tricks I find useful.

    Go to my homepage for more information ;)

© Alejandro U. Alvarez • All rights reserved
RSS Feeds XHTML 1.1 Top