Category: Programming

My “experience” with web-programming languages

Listen to this Post. Powered by iSpeech.org

HeyHey reviewsHey reviews ho guys, I want to write about my OWN experience in different programming languages. This is only MY personal view. So don´t take it to serious :) (Oh and its from the view of web development )

Java: This language was made for persistent client side applications which are aimed for portability. Java was never intended on a “per” request base. Like other web programming languages. Java is like regex in greedy mode. There scenarios where it might be useful to use it, but in general it is to much. (RAM, CPU power and so on)

RubyRuby reviewsRuby reviews: If you say Ruby, you have to say Rails (Ruby on Rails: RoR). Ruby is an awesome programming language. Maybe THE best web-programming language out there. It is a pleasure to program and code in RoR. The only drawback is, if you want to extend RoR. With all its hooks, API calls and “standard” over configuration paradigm. You have to crawl deeply into he API to extend it. I don´t mean simple MVC “extensions”. This is by far the easiest (And probably) the best way to extend it. But if you want more complex, more independent project plugins, it is a pain. Beside this problem RoR is slow, sure you could cache, cache and even more cache. But I think caching should be a boost to your application. Not a solution of a problem.

PHPPHPPHP: The world leader, the world best and well known web programming language out there. There is no problem which could not be solved with php. It is fast, reliable and “spread” around the world on nearly all servers out there. And if the server can´t run PHP, you could extend it, to run PHP. There plenty of frameworks out there for PHP ( If I remember right, someone counted 130). Which are written in an opensource license. If you don´t like one, just chose another. If you want a job in web programming, it is like a guarantee to get one. This are the good points of PHP, now the drawback(s): It has a sluggish and splattered not well written “API”. Sometimes functions which do string manipulation are written with underscore, sometimes without. (As an example). The OOP in PHP is more like an addon and not well integrated. There still hosts/servers out there which only run PHP4 (PHP without real “OOP”)

PythonPythonPython: This is a programming/ script language which gets more and more attention. I am just starting to get in touch with this programming language. So my points maybe something like a hype or not really from experience. This language looks also a bit sluggish,with strange signs in code :) . But it looks very promising, feels fast and expendable and is well documented. I would say to sum it up: If you don´t like Java, Ruby or PHP, this looks like the perfect balance between performance and OOP for web programming languages.

I will never return to RoR or Java, mybe I will return to ruby if something better than RoR would come out, but my personal favorite at this moment is python/ django!

Short overview PHP 5.3 Frameworks

Listen to this Post. Powered by iSpeech.org

YesterdayYesterday reviewsYesterday reviews I started crawling around the net, about new Frameworks which are build around the new PHPPHPPHP 5.3 version ( formally known as 6 )

Things I found (Later on I will write a few words about them)

Symfony 2.0: the big leader
Shozu: the mini enemy
FatFree ( F3): Another mini
FLOW3: EnterpriseEnterprise reviewsEnterprise reviews “grade” framework

Well, I dont think I had to write much about Symfony 2.0. At this moment it is one of the “big” candidates which will lead over any other 5.3 framework. At this moment there is a sandbox where you could play around with Symfony 2.0 ( but undocumented, or better: No tutorials or something like this ) And a buggy (at least for me) Repository which dont looks often updated at this moment.  This framework should be released at the end of this year (2010). At this moment the symfony foundation  is in contact with phpbb which wants to use symfony 2.0 for its next version as the backend framework. Which dont seems to be a bad idea. And last but not least, the benchmarks about this framework sounds very promising. Ok I know those benchmark are more “fake” then real, or better: They are tweaked for Symfony, but at least it will be faster than Symfony 1.4 :)

Another good candidate is Shozu, ok this one is not real a framework. Its more like a “micro” framework. But it has something really interesting integrated, it is called ReadBean, this is an ORM with automated TABLETable reviewsTable reviews and ROWRow reviewsRow reviews creation. So, no more hazzle around with “inis” yaml setup or whatever you normally use on ORMs like doctrine. just setup the connection and go on with whatever you want. The only problem is see is while you develop, you sometimes  change the database setup. Which would lead to “unused” rows, or even tables. Or if you misspell something, and create two similar rows, where on has only one entry, and the rest is in another row. It could be hard to find the error, why you get a nearly empty page… But maybe this is not a big problem, or there is a solution for build in it but I dont found it. But it has everything you need from a “basic” framework: ORM, Jquery, caching, URL rewriting for clean URLs, and ImageImage reviewsImage reviews manipulation. For a better Jquery experience it has taconite integrated, and a small example.

FatFree is another mini framework, which is (in there words) condensed in one 60K file. So far it looks like a basic framework. Without really “cool” features. Only basic MVC, but there are a few plugins which you could “activate”. The other problem is that you get a special license. The code is released under “GPL” but if you want to use it “commercial”, you have to pay for it. Another problem is that the dont tell you how much you will pay for it. SO I dont recommend it as your standard framework. Only if you want to learn from sourcecode or you just want to experiment with it….

FLOW3 looks like another “big hope” in PHP 5.3 scenario, it looks really thought out, complete and promising. Another problem is that it looks really complex (but Zend is also complex) So I guess it could be competitor to Zend (they dont claim it) but I guess they want to compete versus Zend. Sure it is a hard target they (maybe) set. But they are the creators of typo3, so I guess they know what they are doing :)

Last but not least: Dont chose “your” framework, based on performance or popularity. Chose the framework you like!

Say No2SQL or NoSQL – MongoDB

Listen to this Post. Powered by iSpeech.org

One year ago ( or even more ) I found which was called MongoDB. This database  concept is designed around “NoSQL”. The first time I saw it i thought: Uh, why the hell should I use it? And even the syntax it is used to get access to the stored data locked weird to me. You access your data like an array ( In general ). And I thought: It must be slow, if you compare MySQL, for example, against MongoDB. The idea was, as every language when you remove int, string and so on, the engine must first find out, which type of data is stored. But after reading a few benchmarks and tutorials about it. I can´t admit, that this database “type”. Is pretty powerful, easy to use and amazingly fast.

But you might still think: Why should I use, learn or even keep an eye on it?

Well, most users forgot, or at least: don’t want to know what happened to the MySQL developers. ( They were bought by SUNSun reviewsSun reviews/ OracleOracle reviewsOracle reviews ) They promised to keep MySQL alive as it is. And want to keep it opensource. But we all know that this is just a promise… The EU still keep an on SUN/ Orcale and MySQL. Cause they fear the same thing as many users fear. I dont think they could “close” MySQL now or later. But they could do other things. Reduce resources, introduce buggy versions. Stopping to work with the community and much more.

But now I don´t fear the death of MySQL, MongoDB is getting better and better. And if MySQL lose users, MongoDB will get more users :)

LinkLink reviewsLink reviews: http://www.mongodb.org/

The tutorial/ blog, which opened my eyes: PHP-Classes-MongoDB

Ecoder – webbased “ide”

Listen to this Post. Powered by iSpeech.org

Hello guys,

sorry for the lack of posts, or (never ) answering comment questions. I was too addicted to Allods and “HeroesHeroes reviewsHeroes reviews of Newerth”. Both are realy cool games. But Allods did too many mistakes and… failed :( . But this is another story.

TodayToday reviewsToday reviews I want to write about something useful, which could be called a “Web-IDE”. This small tool is perfectly for “quick and dirty” editing of files on your server. Or if you want to code from your IPhoneiPhoneiPhone or something similar. While you are on the way to your girlfriend in your train :)

Sure it is not perfect, but is amazingly fast and small. It has everything you need for your dirty trix on the fly.

Summary:

  • File-Browser
  • Syntax-highlighting ( Which works in real-time! )
  • Tabbed file opening
  • File-Uploading
  • Generalgeneral reviewsgeneral reviews file modifying ( open, close, rename, new, rename… )
  • And shortcuts to make your life easier ( The about on there website claims:
    keyboard short-cuts lend it the feel of a locally installed application. )

LinkLink reviewsLink reviews: Ecoder

Note: This project look like it is dead, but on the sourceforge forum the author claimed that he “restarted” his project.

3 Vars on 3D games

Listen to this Post. Powered by iSpeech.org

Hello,

here is the tutorial I promised, it lacks graphics or formulas. Iam not a math or nor a graphic pro :)

What you will “learn”:

Normaly, in a 3D game, for example in a 3D MMORPG. You use some variables to set and set positions of heroes. And in which direction they look. This could like this:

Y13,X12, Z16

This is the postion, but cause it is 3D you need to know, in which direction the hero is looking into ( at). Normally this also a 3D position, lets say:

Y12, X13, Z15

With the system I will try to explain. You could set position and direction in which the hero looks at with only three variables. Two are for postion. And one is for the direction looking into.

This could look like: 130A, 13B, 200C ( Lets call it a,b, c)

Lets start with a globe ( Or a ball ) in middle we set a point. ( In xyz i could be something like: oY, 0X ) This point is where verything starts. From this point we draw “endless” lines to the end of the globe/ ball. Every line gets a number.

The Number “1″, is the out “Ball” position. While the Number two is the “Line” number. So the upper line cold be called 1,1. But we dont need the line number. We just need the “outer” Number. Now we just need the position: Lets say from middle top end of globe is 1000 pixel. The middle would be: 500px. Now we could set a postion in a 3D world with two numbers:

This could look something like this:

Here we have: Line number, 1 and postion 400. We would get: 1A, 400B. Now lets say the heroe looks at bottom to line nuber 2. We would get: 1A, 400B, 2C

With this system you can even further reduce the variables needed: Just send “moving” information of the object: Example: 1A, 400B, 2C moves to 4C, 400 px per sec. I would suggest something like: 1A, 400B, 2C, then two times moving information: 5C, 400pxs, 6C, 350pxs, then position: 15A, 330B, 3C and so on…

DRAWBACKS: Many calculations on client side: Well a joy for fast and multi core CPUs. The bigger the globe and closer to middle. We will get Many line numbers which would be “true”. But I think here we can use quantum mechanic laws? Maybe? :)

The rest is up to you, if you have questions feel free to post them. If you devlop the formula for this. Do whatever you want to do with it  -_- ( GoodGood reviewsGood reviews would be if you share this information, but well…. )

Quick note

Listen to this Post. Powered by iSpeech.org

On 01.01.2010 I will publish an interesting article. Which could be useful for 3D programmers. Iam not quite sure how “practical” this is. Or something like this exist. (As far as I know, it dont  )

It will explain, how you could send the information about an player: Where he is ( In X,Y,Z ) And in which direction he looks. Normally also ( X,Y,Z ). With just three numbers :)

This system could be used on 3D models, to reduce the information. ( Size )

Some things I learned in web-development

Listen to this Post. Powered by iSpeech.org

Here I want to write about some common mistakes in web-development. Those things aren´t programming related. More “good” practice things.

If someone make the wesite design. And someone else have to code the “html/css” you should:

Name the elements by site/page and position

For example, if you designed a news background header. Which is seen when a news is shown, you should call it: news_show_header_background.jpg
Or another example, some things need/ have a border. On top, left, right and bottom. For listing news.
you could call it: news_list_border_top.jpg

If you have to show a table. You should determine if the data is scanned vertical or horizontal. Or even both.

Here is an example

row_1

As you see, the vertical line are thicker as the horizontal lines. Which make it easier for the eyes to read the vertical data. The numbers are right aligned. Which makes it easier to compare them. You could even alter the colors, of each row. But use only “slight” different colors. So just a little bit brighter/ darker.

You have to remove both lines, if Data should be read vertical AND horizontal. But try to avoid things like this. Better make two tables.
Well the last case should be easy to know. Make horizontal lines thicker and the vertical lines thiner.

Try to do queries at the end of script ( or other external things like soap/ xml ) So the user see something when it may”stop”

This is  more “ui” related, try to build with as less points as possible. And everything reachable with two clicks

The points thing. An example:

BadBad reviewsBad reviews:

[table]
[tr]
[td]THING ONE[/td]
[td]THING TWO[/td]
[/tr]
[tr]
[td]THING THREE[/td]
[td]EMPTY FIELD ( NOT SEEN)[/td]
[/tr]
[/table]

Better like this:
[table]
[tr]
[td]FIELD ONE[/td]
[td]FIELD TWO[/td]
[td]FIELD THREE[/td]
[/tr]
[/table]

So the eyes have to move “less”

  • The so called F navigation system is the most excepted “site style”
    Top navigation, left sub navigation, and in the middle the content.
  • Use everywhere the same header and bottom design. So the user knows where  the content starts and ends.
  • The most start position for a mouse on a website is top left.
  • The eyes move from: Dark to bright, from big objects to small objects.

movement binds the user to look at. so try to create movements which “aid” the eyes. SimplestSimplest reviewsSimplest reviews example are arrow. AND stop the movement after 2 secs or less. ( OR if there is no way to stop it, or it must move) add a stop button or make it “slow”.

So don´t use big “rectangles” where you just place “eye candy”

Some people know how colors “create” reactions on people. But most of them don´t know that different countries, have different color “feelings”. It is no problem if you write in German for example, or in ChineseChinese reviewsChinese reviews language. Those sites are “targeted”. But if you write in English, people could come from everywhere. If you don´t want to “annoy” Chinese people ( Just an example ) Try to use very bright or dark colors. Or avoid colors at all :) . Cause very bright colors, or dark colors don´t “trigger” the color emotions. If you take a look at mc donalds, amazon or ebay. They use bright colors. And have much “white” background.

With this way, they don´t create emotions, which they don´t want to create.

Another thing is: Try to avoid faces. Or forms which could look like a face ( If you write in English ). FacesFaces reviewsFaces reviews create different emotions, from different persons. The only exceptions are womens. ( Sorry, but sex sells ) Or if you are a model agency, or sell clothes. Or it is your “personal” blog. Faces make things like this more “personal”. Or a small firm.

I hope, I could help some people with this, if you have any questions, feel free to ask!

mysql.sock vanished on my vserver

Listen to this Post. Powered by iSpeech.org

ManMan reviewsMan reviews,

the horror story no one wants. My mysql server stopped working. And I got a warning message from my “server watch” service.
First I thought, ok lets see whats up.  And browsed to my site. To see:

The mysqli error was: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2).

Man, and then I tried to fix this problem, but something must gone wild. Cant reinstall mysql, no way to purge it. Or remove it.
Every time I tried to reinstall a new problem went up. Nothing worked. The problem stays. Try to link it, recreate it, reinstalled, purged,
copied and so on. No chance…. I have no clue whats wrong. Even the “almighty” google wasnt a help. All solutions doesnt worked. so I have
to reinstall my vserver :(

And I still dont know why my mysql.sock vanished. I dont touched the server in the time where it could happened….

GD Image Rotation Low Quality / Poor Performance error on debian

Listen to this Post. Powered by iSpeech.org

If you get a error message like this one:

The installed version of PHP GD does not support image rotations. It was probably compiled using the official GD libraries from http://www.libgd.org instead of the GD library bundled with PHPPHPPHP. You should recompile PHP –with-gd using the bundled GD library. See: http://www.php.net/manual/en/image.setup.php. An implementation of imagerotate in PHP will used in the interim.

And you run a debian LinuxLinuxLinux server and you have access to it. And you don´t want to recompile (it) . Here is the solution for it:

You could use the dotdeb repository. It has everything you need. Just set this sources:

deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all

In your:  /etc/apt/sources.list file

RunRun reviewsRun reviews apt-get or aptitude, and your done

Drupal domain access module

Listen to this Post. Powered by iSpeech.org

Well, tried hard to get the fine module to work. But I cant… ProblemsProblems reviewsProblems reviews I run into:

After adding a node returned to wrong domain ( main domain ) fixed by ucommenting out the $base_url variable
in settings.php

ContentContent reviewsContent reviews not shown on right site ( all sites ), every time all “pages” are shown on all sites.
Or they where only shown on one site, even when all sites are selected.
This could be fixed by using “views”. But this would mean much work.
Cause you have to create MANY views…

well, I will use the normal, multi site setup of DrupalDrupalDrupal

LouiseBrooks theme byThemocracy