PHP Spell Checker v1.1

February 16th, 2010 by Dragos No comments »

A new version of PHP Spell Checker is available.
The new feature is checking the spelling with Google’s “Did you mean” feature, so not a big update, but useful non the less.

The syntax is the same:

<?php

// include the class
require_once(dirname(__FILE__)."/../GDYMSpellChecker.class.php");

// instantiate the class
$spellCheck = new GDYMSpellChecker();

$textWithErrors = "PHP: the quik browm fox jumps over the lazi dog lazi today"; // this text has 3 errors
$result = $spellCheck->checkSpelling($textWithErrors, "en-US"); // will return an array with the wrong words with associated suggestions
//$result = $spellCheck->checkSpelling($textWithErrors, "en-US", false); // will return an array with the wrong words without associated suggestions
//print_r($spellCheck->getWarnings());// get all warnings
//print_r($spellCheck->getErrors());// get all errors
if (count($result) == 0) {
	print "Text is OK !<br/>";
} else {
	print "Text has errors !<br/>";
	print "<pre>";
	print_r($result);
}

?>

For further reading about the PHP class [p2p type="id" value="20" text="read this post"].

Download the class from here

VN:F [1.9.22_1171]
Rating: 7.9/10 (14 votes cast)

PHP FIFA Manager online editor project

December 2nd, 2009 by Dragos 1 comment »

I am a fan of the FIFA Manager game, i play it every year and every year i would like to install all the “database extensions” (community database improvements) available out there, but the problem is that i have to keep track of all fan sites and choose carefully as some databases, club badges, player pictures, etc collide with each other.

In this regard I started the FIFA Manger online editor. The aim is to create a web application for editing the database of the game and allow contributors to upload all the images (club badges, player’s pictures, etc) into one place, aggregate everything in one place.

This is a big project in the way that there is a lot of data to parse and even harder to understand the internal database structure.

Until now i have a small draft of how the application will look like and also I have already written the parser for some details.
You can take a look and test it here: http://fmed.protung.ro/
For now only England is available for testing (not with the full database).
For now you can see a list of all countries, clubs in that country, all players of the clubs and some details of the players.
The referees are also parsed but there is no interface to see them for now.

Everybody that is interested in this project and has a few hours per week free is more than welcome to join. I need as much help as possible in order to complete this project before the 2011 release ;-)

One of the biggest problems now is the user interface, there are just so many buttons, input fields and windows. So if you are an ExtJS developer and want to create a nice, clean and fast interface for this project do not hesitate to contact me.

Have a nice game, and more about this project soon.

VN:F [1.9.22_1171]
Rating: 6.0/10 (7 votes cast)

Simple XML Parser Namespace support

October 27th, 2009 by Dragos 6 comments »

I have added support for namespaces to the parser.
What this means, you are now able to register a namspace in order to be able to parse the XML.

Also the usage of this class changed.

<?php

$xml = "http://www.protung.ro/feed/atom/"; // parse an Atom feed

// create a new object
$parser = new SimpleLargeXMLParser();
// load the XML
$parser->loadXML($xml);

// register the namespace
$parser->registerNamespace("atom", "http://www.w3.org/2005/Atom");
// this will get an array of entries
$array = $parser->parseXML("//atom:feed/atom:entry");

?>

As always, you can download the new version from here.

VN:F [1.9.22_1171]
Rating: 8.5/10 (14 votes cast)

New PHP Simple Large XML Parser version

October 2nd, 2009 by Dragos No comments »

I have added support for node attributes to the PHP Simple Large XML Parser class.

Now it’s possible to retrieve the structure of the XML document with the attributes of the nodes. If you choose to get the nodes also the structure of the result array will be different from the non-attribute array.

The new structure will be like this:

<?php

array('value'=> 'another node / value' ,
     'attributes'=>array('attribute name'=>'attribute value',
                    'another attribute'=>'some value',
                    'yet another attribute'=>'other value'
                    )
);

?>

In order to get the array with attributes you need to pass the 3rd parameter as true:

<?php

   SimpleLargeXMLParser::parseXML($xml, "//myFirstNode", true);

?>

You can download the new version from here.

Please [p2p type="id" value="180" text="read this post"] for more information about the functionality of the class:

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)

Simple score board with PIC16F690 & 7 segment display

September 22nd, 2009 by Dragos 10 comments »

Today i finished my second PIC project The first one was a LED Cube, but i didn’t published anything about it just because there are a lot of similar projects out there.
So my project is a simple score board. Two 7 segments displays with a button for each one, the full source code (assembler) and schematics.

PIC16F690 score board 1

This is a screen shot of the final assembly (yes, i soldered 2 flags :lol: )

To build this board you need 2 330Ω, 7 220Ω and 2 10KΩ resistors, 2 NPN transistors, a PIC16F690, two 7 segment display (i used in my build a common cathode, if you use a common anode you have to change the schematics and code a little)  and 2 push buttons.

On my board i didn’t connected the decimal point (DP) from the displays, so if you want to connect yours then you have to get another 200Ω resistor for it and connect it to port B7.

» Read more: Simple score board with PIC16F690 & 7 segment display

VN:F [1.9.22_1171]
Rating: 6.9/10 (14 votes cast)

PHP Yahoo Messenger Archive Decoder v1.5

September 10th, 2009 by Dragos No comments »

A new version of PHP Yahoo Messenger Archive Decoder is available for download.

I know 2 years have passed since the release (or actually any other modifications), but a friend asked me to modify it so he can use it to parse conference history files. So this is what’s new in this version.

I really don’t think a new version will be added, unless it will not work anymore with the latest yahoo messenger version (it still works with version 10 beta)

VN:F [1.9.22_1171]
Rating: 8.4/10 (8 votes cast)

PHP simple large XML parser

September 6th, 2009 by Dragos 4 comments »

I needed a simple PHP script to parse large XML files fast and without huge memory consumption, so I’ve written a small class for this.

This class can be used to parse large XML files (it works with small one also) fast and with minimum of memory consumption.
It can parse any valid XML and convert it to an array. What it does not do is to get the attributes of the nodes.
If you need it, contact me and i can implement it for you if you want.

You can parse any part of the XML as it supports XPath with the same performance as parsing the entire XML (well, a little bit faster as it’s less data to parse)

» Read more: PHP simple large XML parser

VN:F [1.9.22_1171]
Rating: 10.0/10 (3 votes cast)

PHP WSDL Generator new version work in progress

September 1st, 2009 by Dragos 3 comments »

i started working on a new (improved) version of PHP WSDL Generator.
Many people have asked for new features and better output this is what the new version will have.
I will also rewrite almost all the code.

The new PHP parser is almost done. Now you can also add classes without specifying files. Just include them in your code and tell the generator to also use those classes. Of course the old way to add classes (by specifying files with PHP code) will still be available, but unlike before when the content of the files was parsed, now the files first will be included (using require_once() ). I know this is not ideal if you have other code that must not arbitrary execute, but then again it’s good practice to have the classes separated from any other code. The new parser will be much faster and more accurate.

That’s all for now, I will post more news about this after more work is done.

Please don’t ask when the release will happen as I don’t know. I do this in my free time witch is somehow limited right now.

VN:F [1.9.22_1171]
Rating: 8.3/10 (35 votes cast)

Sound level meter with K8055 (video)

August 20th, 2009 by Dragos No comments »

I have implemented a new custom control in the K8055 Full Demo application that can send signals on outputs (analog or digital) based on the sound input in your microphone.

The control also has a sensitivity track bar witch allow you to make the microphone more or less sensitive to input.

Based on the sound level (and sensitivity adjustments) the program sends signals (you can see the LEDs light up) on a number of channels. So if the sound that is coming into the microphone is 6 the first 6 digital outputs are set (first 6 LEDs light up).

The same thing applies to the analog outputs, but instead of setting the output to ON or OFF it sent the voltage between 0-5V. For example if the sound level is 5 (this means the input in the microphone is around 127) it sends ton the analog channel a 127 signal that translates to 2.5V

» Read more: Sound level meter with K8055 (video)

VN:F [1.9.22_1171]
Rating: 5.8/10 (9 votes cast)

PHP Web Commander

August 19th, 2009 by Dragos No comments »

PHP Web Commander is an application designed for web server usage.
The basic idea of the program concerns the possibility to manage files, ftp accounts, database, etc.
Similarly to the populars files managers, the utility is endowed with an user-friendly interface, ensuring the same level of functional procedures.
Supporting a wide range of plugins, the application allows the user to configure his own Web Commander system, through miscellaneous commands.

Download it from here. Changelog here.

VN:F [1.9.22_1171]
Rating: 8.5/10 (6 votes cast)