27/10/2006

Its been over a year… :)

Filed under: General, Programming — Mulyadi @ 10:16 pm

Its been exactly 1 week and 1 yr since the submission of my last assignment in RMIT :) It was really the most fun assignment I ever had. To design and develop a full fledge e-commerce site based on PHP and MySQL. Worked in a group of 6 people. Reza, Iwen, Dzung, Matthew, Veron and myself. I couldn’t be more happy than I already am at that time when I formed this group. They’re a very nice bunch of people to work with. Creative and very technically inclined.

The project didn’t really did as well as we expected it to but nonetheless, everyone was happy with it. I was lucky that the skills of my group members were very diverse. We have Reza, whos the main web designer. His creativity really shows in the templates of the website itself. Gd color combination and excellent layouts. We have Iwen and Dzung. The DBAs for the project. The optimisation of the database structure was brilliant. Well placed indexes and well normalised table structures enabled the site to function at an optimum speed :) Then there was Matthew and Veron. Brilliant coding… very clean and well optimised. Makes it easy for the others to pick up where they left off. As they say, “keep it simple stupid”. They fully understand what it means and its a joy to work with them :) man.. I miss them all.. I wonder if we’ll ever get together again to work on another project. It was my pleasure to be the team leader of a wonderful team :)

Oh and btw, I eventually had my root canal done at the pte clinic today. No way I’m gonna wait till next yr for my appointment. Wonder what would have happened to my tooth by than. So there goes a major chunk of my bonus.. BYE BYE BONUS!!!! :( I’ll see ya again next year same time… sigh…


end of post

19/10/2006

Wrongly Configured Platform

Filed under: General, Technology, Programming — Mulyadi @ 3:35 pm

lol… It all boils down to that. An incorrectly configured unix platform, which caused EEM to fail every single day at 5pm. Who would have thought that such a small mistake like this, will actually cause such a massive problem :| After all the code changes to manage and optimised the memory issues of the application, and many developers working round the clock to fight this problem, my team finally found the root of it all. Muahahahahaa…. not before the EEM manager taking heavy fire for not ensuring his team produces quality work though. really pity that guy.

Well after the new code changes last week, EEM was still failing every single day. Pouring over the log file, the problem was still the same. Insufficient memory. Thats the challenge. To find out whats causing these memory problems. DBA issues? Coding inefficiency? Well these does affect the memory problems but eventually it was found out that the server was incorrectly configured. Whoever set up the production server set the application to use only 256mb of memory instead of the 512 mb memory which was specifically allocated to it. hahahaa… upon changing it back to 512mb, everything worked fine :P What a week… lol


end of post

11/10/2006

Memory leakage…

Filed under: General, Programming — Mulyadi @ 8:04 pm

Finally! Its been narrowed down to that. EEM has been failing everyday due to buggy codings where cursors makes use of memory and then do not return it back to the pool. A memory leakage where eventually, the application runs out of free memoery and just crashes. LOL! The developers are so in deep shit. Hahahaaa..

Its still failing everyday. Today, I deployed the new version once more onto the Unix cluster. Apparently, the developers claim to have fixed the memory leakage but we’ll have to see. Today has been bout the 10th day it failed. Users in UK have been pretty mad bout this critical application going down every day under heavy load. Recovery steps to bring back the app to life is still as painful but I’m much better at this now. Wheee… :)


end of post

24/3/2006

Paging a Repeater in ASP.Net/C#

Filed under: General, Technology, Programming — Mulyadi @ 12:37 pm

Those who code ASP.Net web pages will probably already know, the DataGrid Server Control has built-in paging features. This means that to implement paging in a DataGrid control, all you need to do is set a couple of the DataGrids properties. This is quite easily done in Visual Studio.Net (vs.net) 2003. Go to the design screen, click on DataGrid and drag it to the page, right click the DataGrid controls and choose property builder. From there, you can easily set the pagination properties. Easy.. Can this be done too, for a DataList or Repeater controls??

Not really. For DataList, the property builder has no pagination options and for Repeater, you don’t even have a property builder. All codes have to be written in the code view. So how do you actually paginate them? Was googling it up and realised that the PagedDataSource Class is actually used to provide the DataGrids paging features and this Class can be used directly to facilitate paging on any type of DataBound control. Awesome… :) Below is how you can do this..

1) Get the data that you want to page through. This can be an array, a DataSet, a DataReader, or any other object that can be assigned to a data Web control’s DataSource property.

2)Create the PagedDataSource instance, and assign the data to page through to the PagedDataSource’s DataSource property.

3) Set the PagedDataSource class’s paging properties, such as setting AllowPaging to True, and setting PageSize (to indicate how many records per page to show).

4) Assign the PagedDataSource instance to the data Web control’s DataSource property and call the data Web control’s DataBind() method and Voila! Instant pagination support for a Repeater. Its not too hard to understand.


// initialise all the page variables
int curr_page;


// setting the current page and the record to start from
if (Request.QueryString["page"] == null
|| int.Parse(Request.QueryString["page"]) < 1)
{ tcurr_page = 1; }
else
{ curr_page = int.Parse(Request.QueryString["page"]); }


//All your initialisation of the stored procedure goes here


// Setting a new DataAdapter to use the GetBooks
// stored procedures
SqlDataAdapter myAdapter = new SqlDataAdapter(GetBooks);


// Use a DataSet - required for paging in a PagedDataSource
// object and populating it with data from the DataAdapter
DataSet ds = new DataSet();
myAdapter.Fill(ds);


// Populate the PagedDataSource with the DataSet ds
PagedDataSource pds = new PagedDataSource();
pds.DataSource = ds.Tables[0].DefaultView;


// Indicate that the data should be paged
pds.AllowPaging = true;


// Set the number of items you wish to display per page
pds.PageSize = 3;


// Set the PagedDataSource's current page
pds.CurrentPageIndex = curr_page - 1;


// Binding the PagedDataSource to the BookList DataRepeater
BookList.DataSource = objPds;
BookList.DataBind();

Cool thing bout the PagedDataSource Class is that you can make use of the available methods such as PageCount(), IsFirstPage(), IsLastPage() etc…. Makes your life easier rather than to manually calculate if the current page you are in is the last or first or how many records there are in the Repeater :)


end of post

30/8/2005

Geek talk..

Filed under: General, Programming — Mulyadi @ 2:43 pm

Been coding a lot recently. Namely in PHP and C#. IDE ( Integrated Developement Environment ) for C# is really excellent. Man…. I’ve never had such a good IDE before for any of the codes I’ve written :shock: . Visual studio has got to be one of the best IDE available for programming ever.

Imagine writting a line of code and its underlined with a red curly line if u have a syntax error. Or how bout typing out a class name, and a drop list appears showing u all the methods associated with that class :shock: . A link list class already built in so no need to code your own link link classes. Just use the ArrayList. Dynamic memory management means u no longer have to manually free a memory space after deleting a node in the ArrayList, unlike C++ and C. The IDE is really excellent and its making me such a lazy programmer. Hehhee.. if only they have such an IDE for PHP 5 so I can play around more with the oop style.

Been coding a lot with PHP too. Been playing around with PEAR IT templates for PHP and finally getting the hang of it. Makes my codes look clean, especially my HTML and SQL queries. What this templating system does is to seperate all SQL queries from my HTML codes, and dump the queries in another file. WHat happens in the end is a template file which has the layouts and presentation, and a php file with all the queries and the programming codes. Allows you to create a basic layout and give it to a designer to completely design the page for you, while you just work on the backend. End result??? Nice looking HTML pages which is valid HTML and a easy to maintain backend. Cool.. :mrgreen:


end of post
Older Entries »