tag:blogger.com,1999:blog-8855416526458193042024-03-19T09:48:29.968-07:00FyreWolfe's Web LogJohan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-885541652645819304.post-48456878642294314332011-05-26T02:40:00.000-07:002011-05-26T04:18:44.184-07:00Using SQLite as a data store in C++There are various advantages in a using a SQLite as a database with the best being that it’s small, fast and reliable.The best way to use SQLite is to embed it in the game using the recommended amalgamation source code available on sqlite.org, but it is also available as a library for Windows (DLL) or Linux (shared-library .so ) .From a licensing point of view, using SQLite in any commercial gameJohan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-20253979762437636972011-05-24T01:17:00.000-07:002011-05-24T01:58:08.003-07:00It all starts with an ideaThis piece is taken directly from my blog post over at goagri.com. It applies to game development as well and I thought it best to share it here again.While I was studying IT back in 1997 one of the projects I had to do was to develop a software application for a subject of my choice. I chose to develop a dairy farming application. The reason why I chose farming was because I grew up on a farm Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-48027857145798039012011-04-04T00:36:00.001-07:002011-04-04T00:42:32.340-07:00Wika 2011 Video on YoutubeOver the weekend I uploaded my first video to youtube. Jay! :)Video follows:Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-16649606697115873042010-09-13T05:17:00.000-07:002010-09-13T05:46:15.336-07:00Joomla 1.5 - Created date to mySqlJoomla! allows you to set date values through the Joomla! framework whenever you want to save a date to the database.To use a the current date/time in your JModel entended class, do the following.In the store() method after the $row->bind() method, add://Get a JDate object $createdate = &JFactory::getDate();//Create a date in MySQL's datetime format$row->created = $createdate->toMySQL();//PS:Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-10864041989319298782010-09-06T07:12:00.000-07:002010-09-08T06:53:44.209-07:00Joomla 1.5 Additional select tag valuesThis continues on my blog post on how to add a select tag through the Joomla! framework. The code that follows will show you how to add to the ObjectList for a Select tag. This is especially useful where you have to use a select tag in a search form.I normally use a value of 0 to indicate a search of "All Values".The first thing you do is create a class at the top of your page as follows:<?Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-89452430881954957692009-10-14T07:42:00.000-07:002009-10-14T07:53:18.155-07:00Joomla 1.5 - Creating RAW output for the front endIf you want your component to create RAW output on the front end, like xml data to be returned for an AJAX POST/GET, then this is what you have to do.1. In your component's views/view/ folder, add a view.raw.php file. E.g. if your component has a view called smile your will add view.raw.php to your views/smile/ folder . i.e. com_mycomponent/views/smile/view.raw.php2. Whenever you call your Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-3220697548827735482009-08-10T06:51:00.000-07:002010-02-11T12:11:17.838-08:00Joomla 1.5 Raising Errors, Notices and Warnings through codeSometimes it is neccessary to inform an user that incorrect information was entered, like with a login or form validation or sometimes the users needs to be notified what fields needs to be filled in when the form gets loaded.Making use of Joomla!'s JError class it is possible to display this kind of messages theough the Joomla! framework. To use simply call the JError::raiseError, JError::Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-89437990064474648092009-05-25T09:34:00.000-07:002009-05-25T09:55:29.032-07:00Joomla! 1.5 Fixing the Tabs for IEThe basic tabs style does not really display properly in Internet Explorer. See my tutorial on how to create tabs through the Joomla! framework.In Internet Explorer the dd and dt tags does not stack properly while it display properly in Firefox, Chrome, Opera and Safari.To fix this issue, an IE only style is created and included in the site template's index.php file, or the existing ieonly.css Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-68086873277865658372009-05-21T13:10:00.000-07:002009-05-22T06:38:48.126-07:00Joomla! 1.5 Adding to the Breadcrumb/PathWay through the Joomla FrameworkJoomla's JPathway class allows you to add a new item to the pathway to be displayed in the Breadcrumb.The first thing to do is to access the global JApplication object, then get a reference to the JPathway object.<?php global $mainframe;$breadcrumbs = &$mainframe->getPathWay();?>Adding a breadcrumb is now as simple as calling the JPathway::addItem() method. The addItem method takes a Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-21590933643751232752009-01-27T01:29:00.000-08:002009-01-27T02:28:24.572-08:00Joomla! 1.5 How to create Tabs through the Joomla FrameworkIt is quite easy to create tabs through the Joomla's Framwork.According to the Joomla API documentation the class to use is the JPane class, specifically an instance of a JPaneTabs class.The folloing code get the instance of a JPaneTabs class<?php //Inform Joomla we want to make use of panes jimport('joomla.html.pane'); //Get JPaneTabs instance $myTabs = & JPane::getInstance('tabs', Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-84308259355308013382008-12-16T23:16:00.000-08:002008-12-16T23:54:02.477-08:00Joomla! 1.5 How to create a Select tag through the Joomla FrameworkToday I needed to display a list of towns from a database table. Nowhere on the Joomla! documentation could I find an example on how to achieve that, so I had to go figure it out once again.I have a database table that contains all my towns. First I had to create a query to retrieve the towns and put them in an object list.The code for that follows.<?php$db =& JFactory::getDBO();$query = 'Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-52675091216059485542008-12-04T12:59:00.001-08:002008-12-04T13:08:38.627-08:00Joomla! 1.5 How to cloak an email through code.This one I figured out for myself and I am sure you will be able to do the sime... right. :)Say for example you have a custom field in the database that stores an email and you want to display that email on a page somewhere. You don't really want to allow every spam or virus harvest bot out there to come and grab the email. That is why Joomla! created the cloak function. It just makes sense to Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-28107866396049880432008-10-22T05:58:00.000-07:002008-10-22T06:35:22.471-07:00Joomla! 1.5 Getting the modal dialog to workToday I quickly want to show you how to get the Joomla! 1.5 Modal Dialog (SqueezeBox - Expandable Lightbox) to work in any of your components or modules. It's actually quite easy to do since the Joomla! team did such a great job at making mootools part of the solution. JHTML to the rescue! :)In this example I'm going to make a normal anchor open up a Modal dialog. Are you ready?Within your php Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-48636059761063555042008-09-05T02:27:00.000-07:002008-09-05T02:40:01.680-07:00goAgri.comToday I added a facebook group for a farming website I founded. Head on over to http://www.new.facebook.com/group.php?gid=24487333117 should you wish to join my group.I've got quite a few ideas which I have gathered over the years. Join me as I start to implement these ideas on the world wide web. Be part of something not seen before in the agriculture sector, world wide!For the goAgri.com Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-13750713825179553592008-07-25T03:05:00.000-07:002008-07-25T04:13:03.178-07:00How to get the active component in Joomla! 1.5.xFor some time now I have been struggling to figure out how to get the active component in Joomla! 1.5.x without going through the GET/POST Requests. This problem was specifically for the frontpage.What happens on the frontpage is that it is not possible to echo JRequest::getVar('option') and have the code tell you that you are on the frontpage. Instead the text that will be displayed will simply Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-21167164451782288412008-07-14T14:01:00.000-07:002008-07-14T14:18:40.575-07:00keeprToday I would like to introduce keepr, a php cms/framework I am working on in my free time.It all started in May/June 2007. I was without a job and needed something to help me deliver projects faster without forcing me to change the way I like to code. It impliments the way I see Model-View-Controller for the web environment using PHP XTemplateI launched a GNU GPL version 3 at the following url Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-72642650892717325532008-03-13T02:17:00.000-07:002008-03-13T02:29:03.757-07:00SQLite and SOCINow that I know that I can do SQL queries agains the SQLite database, my first objective is to create a C++ dataobject that will allow my yet to be created framework to interact with the database. But first I need to be able to actually access SQLite through code.My search led me to SOCI which is a C++ Database Access Library. I quote from their website:The idea is to provide C++ programmers a Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-26732865887172185142008-02-07T00:40:00.000-08:002008-02-07T02:28:26.081-08:00SQLite - Updating TablesWhat if I need to make changes to the data in my table? As an example, I forgot to insert Armourette's birthday and Johan is not active yet. This mean I will have to run an update query on the table.SQLite query:SQLite version 3.5.4Enter ".help" for instructionssqlite> .schema personCREATE TABLE person('ID' INTEGER PRIMARY KEY AUTOINCREMENT,'FIRSTNAMES' TEXT,'SURNAME' TEXT,'NAME' TEXT,'BIRTHDATE'Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-81053507410112378592008-01-16T06:27:00.000-08:002008-01-17T06:46:17.431-08:00SQLite - Creating TablesWhat is a database without tables?My next chalenge in SQLite is to create tables. Using the SQLite create table documentation I am able to create tables without any hassle.Say for example I want to store data about a person in the database and to do that I want to create a table with fields for firstnames, surname, preferred name, birthdate,title and some sort of primary reference that should be Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-40214526158329205072008-01-09T02:12:00.000-08:002008-01-09T03:57:19.963-08:00SQLite - my journey startsI do C++ programming in my free time and one of the challenges I am facing at the moment is databases. I have a project that require me to use a database for storing data.Most of my development is taking place on my gaming PC with Windows XP Professional (Although I also work a bit on Fedora Linux)My search led met to SqliteSqlite is :Free as in the public domain which means that everybody can Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-41718920875894980022007-12-19T01:10:00.000-08:002007-12-19T01:20:23.361-08:00FreeRange stockMost web designers are always looking for backgrounds or just images to compliment a certain web design. There are allot of sites that offer stock images, but at a price. Meet freerangestock.comFreerange Stock was formed with the goal to provide quality stock photos for commercial and non-commercial use. For free. We feel that free stock photos can be good photos. Freerange is an advertising Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-2430471433716828072007-12-18T05:43:00.000-08:002007-12-18T06:28:50.654-08:00Naymz.comWhile searching on the internet I stumbled upon http://www.naymz.com which I think is a very good idea. Naymz.com helps to empower reputable professionals, in short, Naymz allows you to maximize your professional opportunities by promoting your good name in the Naymz Reputation Community.Naymz.com - Be sure to invite me to your network ;)Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-63759103826203646022007-12-12T22:57:00.000-08:002007-12-12T23:00:39.031-08:00Iron ManThis game is going to be friggen cool! Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-82013011305272325832007-11-13T05:12:00.000-08:002007-12-18T06:29:17.926-08:00StarUML - Open Source gem!Today while searching for a free and open source UML modelling tool I came upon StarUML which imho is one of the best out there for Windows. It was actually developed to be better than Rational Rose!http://staruml.sourceforge.net/en/Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.comtag:blogger.com,1999:blog-885541652645819304.post-49211797071232110922007-11-12T04:45:00.000-08:002007-11-12T05:30:26.093-08:00window.open() woesToday while working with some javascript I discovered just how different Internet Explorer and Mozilla really are.I had this very simple piece of code:window.open('test.html', "Test Window");For some reason it didn't want to open up in Internet Explorer. On Mozilla it worked perfectly but IE just simply raised an invalid argument error.I solved the problem by removing the space in the WindowName Johan Strydomhttp://www.blogger.com/profile/07052185648342379429noreply@blogger.com