eEcho blog

is een halte van de gedachte

Keeping Clear and Consistent Interfaces

You may hate seeing the word consistency again, but for designing interfaces it’s a criti-
cal piece in the mosaic of programming.
Unfortunately, an example of how not to do it can be found in PHP itself.
When you’re driving a car, the gas pedal is on the right and […]

Adding Comments

We can’t stress it enough—even though while programming you may think it’s the
dumbest thing to do—commenting is substantial when producing high-quality code.
When solving complicated problems, seldom do two people think the same way.What
may be totally obvious to one is obscure to the other. Comments are very helpful in
these situations, and they should be added to […]

Making Your Code Easy to Read

- Indent all blocks with tabs (ideally, set the tab width to no less than 4).
- Leave spaces between keywords and key characters, especially when doing
- calculations.
Group logical chunks of code within […]

Coding Conventions

- Make your code easy to read.
- Add comments wherever possible.
- Choose speaking variable names wherever appropriate.
- Keep clear and consistent function interfaces.
- Structure your code into logical function groups.
- Abstract separate chunks of code.
- Use files to group […]

The Importance of Planning

When working on a professional project, it’s very important that you think about
what you’re doing. Know your enemy—never underestimate him. Although your project
isn’t really an enemy, the point still applies. Know all your project’s specifications, its
target platform(s), its users, and never underestimate the significance of small problems
that you haven’t evaluated completely […]

PHP for Me?

Have you ever asked yourself why there are so many programming languages? Apart
from such “mainstream” languages as C, C++, Pascal, and the like, there are others
such as Logo, Cobol, Fortran, Simula, and many more exotic languages. Most software
developers don’t really think about alternative programming languages when outlining
a project; they have their preferred language (maybe a […]

Sound Recording Ubuntu

Om opname te maken van een geluid die van een bron komt (zoals: CD, Microfoon, Video, Phone, Playback, Aux, Mix Mix mono)
met kwaliteit (wav, flac, ogg, speex) kunt u
sudo gnome-sound-recorder
Bijvoorbeeld:
Met instellingen: opname invoer = Mix, opnemen als WAV kunt u webbrowser of geluiden van het systeem opnemen.

libming-util Ubuntu Debian

Library to generate SWF (Flash) Files - Utilities
It is written in C, with wrappers for C++, Perl, Python,
PHP and experimental support for Ruby and Java.
This package contains some utilities like:
swftophp - SWF to PHP converter
makefdb - Font Definition Ripper
listfdb - List Font Definition
[…]

FLV <-> SWF transcoder

This isn’t directly related to ffmpeg, but I’d like to announce an
open source FLV SWF transcoder I wrote in Perl. Because the SWF
and FLV file formats support the same media types (H.263, MP3, etc),
the transcoder just has to move bits around rather than do any
encoding or decoding of media.
http://search.cpan.org/dist/FLV-Info/
I mention […]

URL-codering JavaScript

Vraag: Hoe zet ik een string naar URL-codering?
Antwoord: Ombouwen van een string met de URL-gecodeerde vorm die geschikt is voor verzending als een query string (of, in het algemeen, als onderdeel van een URL), gebruik dan de escape-functie. Deze functie werkt als volgt: cijfers, latijnse letters en tekens + - * / . _ @ […]

D-Bus

D-Bus (Desktop Bus) allows programs to register on it for offering services to others. It also offers client programs the possibility to look up which services are available. Programs can also register as waiting for events of the kernel like hot swapping hardware.
D-Bus is implemented as a daemon. Users can run several instances of it, […]

CORBA Links

http://www.omg.org/technology/documents/idl2x_spec_catalog.htm
Corba language mapping specs., including Corba.
http://omniorb.sourceforge.net/docs.html
omniORB 4.1.x omniORB user’s guide . omni thread abstraction omniNames omniORB utilities omniidl for back-end authors
http://www.gnome.org/projects/ORBit2/python/dynamic_idl.html Dynamic IDL Compiling
Python is a dynamic language, so why not take advantage of it? O-P doesn’t use stubs or skeletons like most other ORBs, but instead compiles IDL files at run-time. This means […]

CORBA python Ubuntu

The Common Object Requesting Broker Architecture (CORBA) is a standard defined by the Object Management Group (OMG) that enables software components written in multiple computer languages and running on multiple computers to work together.
CORBA is a mechanism in software for normalizing the method-call semantics between application objects that reside either in the same address space […]

PHP Mysql utf-8

Controleer instellingen met
SHOW VARIABLES LIKE ‘character_set%’
Minimaal character_set_database utf8 zou moeten voorkomen.
als het niet het geval is dan pas het aan met opdracht:

CREATE DATABASE db_name
CHARACTER SET utf8
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci
DEFAULT COLLATE utf8_general_ci
;
ALTER DATABASE db_name
CHARACTER SET utf8
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci
DEFAULT COLLATE utf8_general_ci
;
ALTER TABLE tbl_name
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci
;
Gegeven moeten ook in juiste codering […]

Links JavaScript

http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256C85006A6604
Format Time, Format Date, Round to 0 or .5, Days Between Dates, Repeat String, Printer Friendly Pages, Fill In Blank Table Cells, Is Valid Time, Custom No Documents, Found Message, Selecting check box highlights entire row, Time Zones, Order Of Execution, Number Of Weekdays Between Dates, JavaScript Sorting, parseInt Bug, isArray Function, Move […]

JavaScript Sorting

OPMERKING: op basis van de feedback die we hebben ontvangen, deze tip is gewijzigd. Het lijkt erop dat we het voorbeeld gaf degradeert na een paar iteraties. Het lijkt verband te houden met het hergebruik van de variabelen “a” en “b” in de aangepaste sorteer-functies. We zijn veranderd de onderstaande code en het voorbeeld op […]

mysql_real_escape_string PHP

mysql_real_escape_string — Escapes special characters in a string for use in a SQL statement
Omschrijving:
string mysql_real_escape_string ( string $unescaped_string [, resource $link_identifier ] )
Escapes speciale tekens in de unescaped_string, rekening houdend met de huidige tekenset van de verbinding, zodat het veilig is om deze te plaatsen in een mysql_query (). Als binaire gegevens dienen te […]

Php Sql Injection

Probleem:
Toepassing beveiligen tegen sql injection. Sql injection is een manier om in get of post argumenten sql doorgeven. Zoals bijvoorbeeld:
$wachtwoord = $_POST[’wachtwoord’];
// maak verbinding met DB
$result = query(”SELECT geheimeinfo FROM tabel WHERE
wachtwoord=’$wachtwoord’”);
Dan als we nu doorgeven in plaats van wachtwoord ‘a’ OR ‘1′ dan zal altijd True gekeerd worden.

Oplossing:
1. escape de ‘$wachtwoord’ […]

PHP string to int

Soms is het belangrijk te beschikken over de waarde van een variabele in int formaat. Voorbeeld als uw bezoekers invullen een formulier met de leeftijd veld dat moet worden voorzien in een int. Maar in de $ _POST array krijgt u het als een string.
Ombouwen van een PHP-string naar int is vrij eenvoudig. Wij […]

php get post

Eenvoudig voorbeeld
Als in url zijn er arguments te vinden http://www.eecho.info/test.php?name=Sergej Dergatsjev&age=25
<?php echo $_GET["name"]; ?>
U bent <?php echo $_GET["age"]; ?>
Dan deze script zal op de pagina afdrukken

Sergej Dergatsjev
U bent 25

Ook hetzelfde is geldig voor
Welcome <?php echo $_POST["name"]; ?>.<br />
You are <?php echo $_POST["age"]; ?> years old!
Dus post en get is afhankelijk van http method meestal in […]

Home | info@eecho.info | Voorwaarden | Blog