Wordpress 2.7 final to be released

3 Dec

If you use wordpress, you may be happy. The 2.7 will go final in two days from now. The good news is this: old browsers are not supported anymore. Yes, IE6 is included in “old browser” category!

I already update this blog to 2.7 RC because i just messed up feed.

What i did? Well.. In my “have more money than Bill Gates” race, i wanted to put some ads in RSS feeds. I set up this in adsense account but… The problem is that i screw things up :( Ads are displayed, but in reader you can see a small excerpt. I spend over two hours to find a fix (including removing the ads!) but with no luck. So… If you know how to fix and you want to help me, be my guest!

Tags: Comments (2)

Bookmark this article!

Del.icio.usDiggStumbleUponFurlRedditTechnorati

SlashDotWindows LiveYahooGoogleFacebookBlogLines

I don’t use CS4. Not yet.

1 Dec

Everyone knows (ok, not everyone, but most people know) that i’m not a design guy. When i have some free time (rarely and rarely :( ) i start to play with colours and try to make a great design. I never did until now, but i’m a perseverant guy.

Anyhow, let’s get back on CS4. Even CS4 was released officially few days ago, all suite is available on certain sites since two months ago (give or take). I don’t know why, but CS4 was one of the most waited (by me) version of Photoshop. I’m not a photographer or a designer, but… i’m just dying to see it at work.

When i finally have it, i was like.. uhm… that sucks! Because of numerous bugs and flaws, Photoshop was a BIG disappointment. Some parts were good, but the bad parts were… awful :(

Good things:

  • 64 bit support. I own 8gb of ram but CS3 can’t handle more than 3.2Gb. Actually this is a limitation of all 32bit programs (yes, including windows!). Adobe fix this with a 64bit release of photoshop.
  • Using GPU for processing. Again, it’s a great thing, but you need a decent video card. I owned a 7600GT from nvidia but no use. With my new 9800Gtx, works great :P
  • Canvas slide (i don’t know how is named exactly) - you drag the canvas (with hand tool) and the canvas will move with a nice slide. Not necessary a workflow improvements, but it’s some kind of eyecandy.
  • Rotate canvas - if you use a tablet pc or a Wacom Cintiq. Not for regular users though.
  • Content aware scale - you can resize your image with AMAZING results. Great for photographers, for me… Not so great (actually isn’t good or bad)

Bad things:

Well.. Not so many bad things. But those who are here, are enough to make me not to use CS4. I use Photoshop mostly to slice layouts so here is what i found wrong:

  • You can move a slice over the canvas boundaries. You can’t make it directly bigger, but you can resize/move. After you make a huge slice, you can’t resize it back (only double click, change width/height).
  • On “save for web” window, if you pick gif/png format and you want to pick colours that will be transparent with color picker, you can’t SHIFT+drag on colors for multiple selections. I use this function kinda frequently, because it’s more easy that creating a “chroma key” layer. On the other hand, on “color table” box, you can pick multiple colors. Nice, but useless because i can’t guess colors…
  • Photoshop CS4 64bit used to crash after 1-2 minutes. After i google it, i found the problem: if you had Guitar Pro installed, you have to remove “Guitar pro*.ttf” from c:\windows\fonts folder. I deleted that and i have no problem now :P

Overall, i’m happy with CS4 for only one big reason: 64bit and more than 3Gb ram support. Sometimes i get some huge files to slice (over 50Mb) and every single MB of ram is important. But those problems with slice make the whole program useless for me :(

I don’t use any other software from CS4, but i heard that Fireworks have some big problems too. Adobe was in big hurry to launch this, and it succeed to mess things up. I hope an update will be launched soon, otherwise CS4 will have the lowest sells in Adobe history.

Tags: Comments (1)

Bookmark this article!

Del.icio.usDiggStumbleUponFurlRedditTechnorati

SlashDotWindows LiveYahooGoogleFacebookBlogLines

How do you format your code?

28 Nov

I’ve been asked few times how do i format my code. I try to stick to a easy to read and understand style. Sometimes i do, sometimes i don’t. Let’s talk first about those times i do :D

CSS Code

Each child is indented with a tab. So, i have this style:

1
2
3
4
5
6
7
8
9
#header {
 
}
	#search {
 
	}
		#search button {
 
		}

When you read only CSS you know that #header is the parent, #search is his child and the parent for button. Easy to read, easy to understand, right? :P

I try to avoid code like:

#parent #another_parent #header #search button { }

Because is kinda bogus.

I saw some guys who wrote their code on single line, without any indentation. Even if you have a less KB file, the result is hard to read and edit. Even though, i use very rarely one line code when i have to add one-two rule to a selector ( something like .element { color:red } ).

HTML Code

Actually… Somehow, i have same rule here: every child have a one tab indent:

1
2
3
4
5
<div id="header">
	<form action="" method="get" class="search">
		<button type="submit">Button</button>
	</form><!--/.search-->
</div><!-- /header-->

As an extra info: when i have large blocks of code (div, forms), on closing tag i add a comment with the id or class name: if the block has a class, the closing comment is /.class name and if is an id /id name

Again, easy to read and to maintain, especially when you reuse some of your code.

Javascript/jQuery Code

Well.. Probably is already clear enough how do i do:

1
2
3
4
5
6
7
8
9
10
11
function function_name() {
	var someVar = 1;
	if( someVar === 1 ) {
		alert('someVar is 1!');
		for(i=0;i<10;i++){
			alert(i);
		}
	} else {
		alert(':(');
	}
};//function_name

Conclusion

The main keywords are: indent and comments. You don’t have to overuse indent, because the code will be impossible/hard to read. Also, don’t over-comment your code. Don’t comment the obvious :

var foo = 'bar'; // the 'foo' get 'bar' value

Well.. I can’t say nothing else but „happy coding!”.

Tags: , Comments (6)

Bookmark this article!

Del.icio.usDiggStumbleUponFurlRedditTechnorati

SlashDotWindows LiveYahooGoogleFacebookBlogLines

Some links

26 Nov

I hope you like it guys!

Tags: Comments (8)

Bookmark this article!

Del.icio.usDiggStumbleUponFurlRedditTechnorati

SlashDotWindows LiveYahooGoogleFacebookBlogLines

A nice sortable trick (jQuery UI)

20 Nov

On a recent project i had to use sortable a LOT. I mean over 3-4 different sortable on page. So, how i manage to avoid heavy code?

One function to rule them all:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$('.sortable').each(function(){
	var _t = $(this);
	_t.sortable({
		handle:'.move',
		items:'dd',
		update:function(){
			$.ajax({
				type: "POST",
				url: $(this).find('a.move:eq(0)').attr('href'),
				data: _t.sortable('serialize'),
				cache: false
			});
		}
	});
});

The HTML markup (for two sortables) is this:

1
2
3
4
5
6
7
8
9
10
<dl class="sortable">
	<dd id="sotableEl1-1"><a href="updateUrl.php?id=sortableID-1" class="move">move</a></dd>
	<dd id="sotableEl1-2"><a href="updateUrl.php?id=sortableID-1" class="move">move</a></dd>
	<dd id="sotableEl1-3"><a href="updateUrl.php?id=sortableID-1" class="move">move</a></dd>
</dl>
<dl class="sortable">
	<dd id="sotableEl2-1"><a href="updateUrl.php?id=sortableID-2" class="move">move</a></dd>
	<dd id="sotableEl2-2"><a href="updateUrl.php?id=sortableID-2" class="move">move</a></dd>
	<dd id="sotableEl2-3"><a href="updateUrl.php?id=sortableID-2" class="move">move</a></dd>
</dl>

This means that you don’t need to use an ID for each sortable. Instead, you add the id to the update URL, on MOVE handler (which MUST be a link). I think this is pretty simple and useful trick.

Tags: , Comments (1)

Bookmark this article!

Del.icio.usDiggStumbleUponFurlRedditTechnorati

SlashDotWindows LiveYahooGoogleFacebookBlogLines

« Newer Posts | Older Posts »