Category: Programming

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/ Oracle ) 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

Drupal and multiste

Listen to this Post. Powered by iSpeech.org

TodayToday reviewsToday reviews I tried to install a multi site setup of drupalDrupalDrupal. And tried the “domains access” module. So far everything runs fine. But I cant
get the “domain” sharing of “nodes” activated. So that news from the main site are everywhere, and from the subsites are only
there available.

At this moment every node is everywhere available. Not really what I want…

But enough for today. Have to take some sleep :)

Better than piwik

Listen to this Post. Powered by iSpeech.org

I searched for something which could replace piwik. Cause it is not stable ( OsDate crashed with it )
I searched around and found on a blog a comment about open web analytics. A long time ago,
I saw this php website analytics tool. But I was not interested in something like this. And forogt about
this one.

Then I “re-found” it, and tested it. And I must say: Iam impressed. This tool works nearly out of the box.
You just have to make changes in the config file, related to your web-address and database settings. Add your site
Add your tracking code ( A javascript “similar” to google analytics ). And you are done, nice!

And the api looks much more “thought-out” than the one from piwik.

Here are the features from there website:

Invocation

  • PHP API – invoke OWA from within your PHPPHPPHP application. This allows for an easy way to build web analytics right into your application logic.
  • Javascript Tag – invoke OWA from Javascript. This allows for remote logging and integration with non PHP based applications .
  • WordPressWordPressWordPress v2.x plugin – full featured WordPress plugin seemlessly integrates OWA with the WordPress publishing platform and administration interface
  • MediaWikiMediaWikiMediaWiki plugin – provides tracking of MediaWiki articles and special pages.

Tracking/Reporting

  • Track Page views, visits, and unique visitors over time
  • TrackTRACK reviewsTRACK reviews unique, new, repeat visitors over time
  • Multiple Web Site Support – track any number of web sites and view statistics in aggregate or by site
  • ClickClick reviewsClick reviews-streams – view the actual click-stream of each visitor
  • Click Tracking – Track where exactly on a web page users are clicking and view clicks by browser type
  • Click Heat Maps – view a heat map of where users are clicking on your web pages
  • Google MapsGoogle MapsGoogle Maps – map your visitors on Google Maps
  • Google EarthGoogle EarthGoogle Earth (KML) – view your visitors in Google Earth via a KML file export
  • RSS/ATOM subscription tracking – track unique feed readers, reader types, and feed requests
  • Visitor Aging – understand the age of your repeat visitors.
  • Canned and Custom Time Periods – generate reports using pre-defined reporting periods or custom date ranges
  • Refering Page Analysis – View the title, anchor text, and surrounding text of inbound links from refering web pages
  • View visits by user agent
  • Track entry and exit pages
  • Track pages by custom page types

Development

  • Full MVC based framework
  • Module framework allows developers to extend OWA’s entitiies, events, reports, and graphs without modifying the base components.
  • Plugin framework for authentication, database access objects, data validation, and geo-location
  • Object Relational Mapping layer
  • Lite templating layer
  • Event handlers

Deployment

  • Events can be writen to the database asynchronously.
  • OWA to can run on multiple front end web servers and write to a remote database.
  • Event Logging and admin/reporting user interface can run on the same or seperate servers

WordPress Specific Features

  • Track visitors by WordPress user name or e-mail address they use in comments.
  • Track all Wordpress Page Types (Posts, PagesPages reviewsPages reviews, Authors, Archives, Categories, etc.)
  • Track the number of comments made by visit
  • Reporting accessable via Admin Dashboard
  • Track subscribers to RSS/Atom feeds

MediaWiki Specific Features

  • Track article , catageory and special pages.
  • Track all visitors by user name and email address.

Quite impressive, eh? :)

now I run crawltrack for, uhm, well crawler things. And OWA for website statistics.

The only problem so far is the “click-map/ heat map” It shows the click points. But not the website.
I hope they will fix this “small” issue :)

I dont know, why this both programs are not more popular? Together,
they create a VERY strong team!

LINKSLinks reviewsLinks reviews:
http://www.crawltrack.net/

http://www.openwebanalytics.com/

LouiseBrooks theme byThemocracy