Recent posts
Recent comments

None

Calendar
<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

Yes, I know. I have not written anything in a whileeeee! After I got married and graduated from school, have not had much time for myself.

But today at work, after an hour of debugging an ASP.NET application and trying to find an answer why the GridViewRow.RowState property was acting wierd, I learned something new and I wanted to share it. I learned that the RowState property is actually checking the value using bit logic. I had not used bitwise operator since school and found interesting that I finally find an use for it. 

My problem was that I wanted to modify all the rows but the ones marked as RowState.DataControlRowState.Edit in the RowDataBoud event and at first I was doing it wrong:

 If e.Row.RowType = DataControlRowType.DataRow And (e.Row.RowState <> DataControlRowState.Edit) Then ...

It looked fine to me, but it didn't work.  An that's how I discovered I had to use bit logic because that is how the RowState property stores its values. The correct way to do this is:

 If e.Row.RowType = DataControlRowType.DataRow And ((e.Row.RowState And DataControlRowState.Edit) <> DataControlRowState.Edit) Then ...

By using the AND bitwise operator you are actually checking is the value is in the "bucket" (this term is well explained in the link I provide below) and then comparing the bit value. It's pretty easy once you understand the concept. And the concept was well explained in this article.

http://weblogs.asp.net/alessandro/archive/2007/10/02/one-bit-masks-for-access-control-setting-permissions-in-your-asp-net-applications.aspx

Hope it helps somebody.

jdavila 13. December 2008, 15:53

It has been a while since the last time I wrote something; it’s always like this. Time is still precious and I have not learned how to manage it. And to be more ironic, this is the point in life I have least available time ever; I am in finals, so next week will finish the semester and one of my Associates in Science degrees. Yayyy!

Two or three weeks ago one of my favorite IDEs reached an important update which incorporated support for a beloved PHP language. Although we had seen Netbeans with Early PHP Access earlier this year, this new release has become a great milestone for the Netbeans followers like me :)


Netbeans is free and offers support for several programming languages. Its PHP support comes in the flavors of intellisence, syntax highlighting, support for OOP, support for MySQL editing and “querying”, PHPdoc capability providing the developer documenting tools, a debugger, instant rename, code templates, automatic code completion and many other features that make this IDE a great free editor. You can even “adapt” support for JavaScript and PHP frameworks; I personally enjoy the benefits of the JavaScript editor with JQuery, which comes with browser compatibility check. It also integrates very well with CSS and HTML editors making web development a breeze. Uff…

Netbeans Netbeans keeps getting better. I feel its interface running faster…and of course, you get all the benefits of this complete framework, allowing you to create or install plug-ins, thus extending its functionality. There are many plugins already written, both from the Netbeans team and the community. You can also take advantage of the support for other technologies in your web development projects, like XML and UML. And with this IDE –I really love this!- you can develop in any platform. So when I am in my Ubuntu box, I still have the same IDE!

Yes, I know, I just like it. There are many options up there, both free and commercial to do web development with PHP and MySQL; but netbeans has become a terrific alternative for those of you that just want to jump right into the coding!