Categories

Archives

Syndication


Archive for December, 2007

Google releases a new great API

10
Dec
Posted in Internet

Google has just released a new, very interesting API, check it out:
http://code.google.com/apis/chart/

HTML 5 preview

6
Dec
Posted in Internet, Programming

The web is evolving like never before and HTML 4 has been around for almost a decade. Developers and publishers want a new technique to provide enhanced functionality.

To give us, the publishers, more flexibility, HTML 5 will introduce a wide range of new, exciting features such as form controls, APIs, multimedia and some new structure.

The work on HTML 5 started 2004 is held by W3C HTML WG and WHATWG. There are also a couple of other representatives from the major browsers; Mozilla, Opera, Microsoft and Apple.

HTML 5 is still a work in progress and got plenty of more developing hours left before release. This article is written as a brief of “What to come” for all us, the developers and publishers.

The HTML 5 structure

Allmost all HTML 4 pages is dividing the pages into headers, footers, containers, sidebars, contents, etc. Yeah, you name it and they have it. In this case we use what is called a “div element”. In the new HTML 5, we are introduced to new elements that represent this sections. Instead of using:

<div class="header">

We can now use another method, which structures it all far better:

<header>

A theoretical page could in HTML 5 look like:

<body>
  <header>This is the header text</header>
  <nav>This is our navigation</nav>
  <leftsidebar>This is our left sidebar</leftsitebad>
  <content>This is the main content</content>
  <rightsidebar>This is our right sidebar</rightsidebar>
  <footer>The footer..</footer>
</body>

I think you get the point here..

The video and Audio elements

Since the startup of sites such as YouTube, the demand of good video and audio elements have been increasing. HTML 4 is lacking in the matter of successfully embedding and controlling multimedia. Therefore, most sites have been using flash to provide with those functionalities. Flash is currently the only widely used plugin which is cross-browser compatible and have the desired APIs for the developers.

The new HTML 5 video and audio elements have the purpuse of making this easy. Opera has already released a build with partial support for video elements. With this, you use the video element and then the browser will provide the user with a default user interface. An example of code in this matter is:

<video src="myvideo.ogv" controls width="400" height="300">
   <a href="myvideo.ogv">Download my video</a>
</video>

The controls attribue is a boolean variable which asks whether you want the inbuilt browser UI or not. In this case, we want!

It’s also as easy to implement audio into the page. The attribues between

<audio src="mymusic.oga" controls>
   <a href="mymusic.oga">Download my video</a>
</audio>

As you see, it looks about the same.. Of course you cant choose the width and height of the audio-sample.

Another good idea of this new elements are that you can choose different sources of the media depending on what codecs the user have. To implement this action you just add another source, with another video type:

<video>
    <source src="myvideo.3gp" type="video/3gpp" 
    media="handheld">
    <source src="myvideo.ogv" type="video/ogg;
    codecs="theora, vorbis">
    <source src="myvideo.mp4" type="video/mp4">
</video>
<audio>
  <source src="mymusic.oga" type="audio/ogg">
  <source src="mymusic.mp3" type="audio/mpeg">
</audio>

Some more resources on this project can be found here:
* Event Streaming to Web Browsers (Opera)
* Improve your forms using HTML5! (Opera)
* An HTML5-style “Google Suggest” (Opera)
* Making legacy pages work with Web Forms 2 (Opera)

* http://www.456bereastreet.com/archive/categories/html_5/

Great programming and hacking tutorials

4
Dec
Posted in Internet, Linux, Programming

The computer science portal csdir.org has published another good tutorial. This one is about hacking and tells us what an exploit is, how to compile one and how to use it. This hacking tutorial is of great use for newbies and avarage users. This site also has a couple of other great tutorials;

The bash tutorial which is a complete guide of how to use bash to script useful scripts. This tutorial is probably the best in the area.
It can be found here: http://csdir.org/tutorials/bash-tutorial/

The third tutorial they offer is the Ansi C tutorial which is a great starting tutorial for programmers that want to know more about the C programming language. The ANSI part is just meaning the American National Standards Institute.

We on cdsrc really recommend those three tutorials.

Quicktime vulnerability exploited by hackers

3
Dec
Posted in Internet, Software, Programming

Hackers have started to exploit a vulnerability whole in Apples software Quicktime. This whole is still not fixed since Apple has not yet released a patch.

So far are only Windows-users targetted, but Mac-users are not safe either. The vulnerability whole was discovered 23 November and was achieved because Quicktime doesnt validate incoming data securely. This time it’s connected with the rtsp protocol which is used for streaming video.

The hackers can with this method make a takeover of the targetted computer. Failed attacks will cause DOS (denial of service) conditions.

The hack itself is a buffer-overflow that targets the Header Content-length.

For more information of how to secure it, take a look at symantec.

The code for the hack itself can be found at milw0rm.

Differences between PHP and C++?

2
Dec
Posted in PHP, Programming

There are some major differences between PHP and C++. PHP is significantly less strict than C++ and it supports dynamic typich which allows you to assign values of different types to the same variable. There are also no pointers in PHP, instead you use a mechanism of references.

When you take a look on the object-oriented fact, PHP is kind of inferior to C++, but in the newer editions, PHP 5.X, PHP has started to think of it more and more.

If you compare the operators, there is a small difference there as well. In PHP you a string might return NULL if a substring is not found or 0 if the string starts with the substring. In C++ it’s not possible to distinguish 0 and Null.

One other difference is that PHP is far inferior to C++ in the aspect of performance. You shouldn’t make any complicated and sophisticated softwares with PHP since C++ is superior in the performance part. On the other hand, PHP is the standard in dynamic web page processing, which leads PHP to be almost more used then C++, therefore there are more resources available for PHP.