Tuesday, November 8, 2011

Public properties in ASP.NET custom web controls ...

Came across a problem at work today ... it's related to public properties in ASP.NET custom web controls.
How and where does ASP.NET stores custom public properties in Web Forms? and how should we handle it?
The short answer is memory, thus if a post-back is done, the information will be gone.

There's 3 ways to mitigate this issue:
1) Session variable - stores the property in session ... if you need to access the property somewhere else in the session (like another page)
2) View state - stores the property in view state ... this should work if you would like to preserve the state of the page (and that you're not navigating away from the page)
3) Control state - saves the information in Control state (i think this is page of viewstate), but will still works even if viewstate is turned off. This also might be a better idea if you don't want to manually manage the view state of the variables. However, this will require more work because you will have to write your own custom ControlState methods to load/store the control state. I guess they all have its trade offs.
Here's a couple of example on how to do this:
http://aspnetresources.com/blog/how_to_preserve_control_state - great example
http://msdn.microsoft.com/en-us/library/1whwt1k7.aspx - comparison of view state v. control state

see Q&A on StackOverflow ... great answers by many by the way.
http://stackoverflow.com/questions/8057042/where-is-the-public-properties-of-a-asp-net-web-control-saved

Here's a quick update on this topic:
http://haacked.com/archive/2007/03/16/gain-control-of-your-control-state.aspx
Phil did a great great job explaining the control state and how to implement it and it works great !
The store multiple values in the control state please take a look at the comments, one of the commentator
gave a tip on how to do that.


Happy Coding!
Daniel.

Wednesday, October 5, 2011

Release notes?

I've been looking for resources on how to write good release notes and I came across this article that proof to be helpful:

http://blog.davingranroth.com/2010/03/how-to-write-release-notes/

also, i found the release notes from TextPad very helpful as well because it's concise, to the point and suitable for a project that has multiple releases that has somewhat of a rapid cycle ... and it does follow the principal laid out in the blog post mentioned above.

http://www.textpad.com/support/relnotes.html

Happy coding and writing awesome release notes !

Daniel.

Monday, June 20, 2011

Update .... From operations in Oracle

Who knew that an update statement (with inner joins) in Oracle could be complicated?
Here's a good primer if you're looking for an "Update ... from" alternative in Oracle.


Code'em.
Daniel.

Thursday, March 31, 2011

More on LINQ

in case you're wondering if you could ever get more about LINQ ... the .NET Guru Jon Skeet had decided to give it another look and some more explanation, he has a new ebook out about LINQ (or best yet, reimplementing them)

read the explanations here -> http://msmvps.com/blogs/jon_skeet/archive/2011/03/18/edulinq-the-e-book.aspx
read the e-book here -> http://code.google.com/p/edulinq/downloads/list

Tuesday, March 22, 2011

I'm back

With my last post, I guess this blog is officially back!
I'm currently working as a software developer and I mostly work with ASP.NET/C# and occasionally some VB.NET. I'm learning ASP.NET MVC and it definitely looks like a pretty awesome framework.

More binary thoughts to come...

Daniel.

Linq bridge, LINQ for .NET 2.0

I was pretty excited when I saw this .... if you've been using LINQ and love the ease of it and wished it existed for .NET 2.0 (for older projects), you're not out of luck.

This website -->  http://www.albahari.com/nutshell/linqbridge.aspx explained why it is possible to use LINQ on top of .NET 2.0 and provided a DLL for it.
Also see their Google Code page --> http://code.google.com/p/linqbridge/ it has some good examples on their WIKI site as far as how to use LINQ Bridge ...


whooop! (a  Texas Aggie jargon for excitement.)

until next time.
Daniel.

Tuesday, June 17, 2008

FF 3.0 British Version .....

if .... you can't wait .... (i know the servers is US is really really overloaded ... )
try the British version ...

http://www.mozilla-europe.org/en/firefox/

Wine and Firefox's overloaded .... overcrowded ...

apparently on the release day of Firefox 3 and Wine 1.0 ...
it's almost impossible to access their website and get a copy of the hottest stuff ...

see the slash dot post for their descriptions and news ...
meanwhile, i'll just get'em tonight.

http://tech.slashdot.org/tech/08/06/17/1547241.shtml --> Wine 1.0
http://tech.slashdot.org/tech/08/06/17/1250229.shtml --> FF 3.0

have fun.

daniel

Friday, May 23, 2008

Re-introduction to Javascript ...

this might be an older article (published in 2006) ... but it's a must for web developers or whoever is interested in Javascript ... re-introduced yourself to this confusing yet amazing language!

http://developer.mozilla.org/en/docs/A_re-introduction_to_JavaScript

i've been working with Javascript on and off during the last year, it has been quite an experience because it's unconventional (it's not like C# or C++ or HTML), but it's powerful.

More thoughts to come on a later date ...

Friday, May 16, 2008

thoughts on Canvas ....

i guess i haven't wrote anything technical ... in a long while .... please check out my other blogs ....

anyways ... i came across this new element in HTML that's been kind of interesting ... the canvas tag it's ! it allows the real time drawing of rectangles and other arbitrary shapes ... check these references out ..

there aren't too much stuff out there ... (mainly it's driven by Mozilla, Apple , Google ... )
here's the main tutorial page -
http://developer.mozilla.org/en/docs/Canvas_tutorial

here's a shell to try your code on -
http://mozilla.doslash.org/stuff/canvas/shell.html

here's an implementation on Internet Explorer -
http://excanvas.sourceforge.net/

... peace out ...

Monday, April 2, 2007

more on graphs ..

just fyi - to plot in different kinds of graph in Octave .. there are several different keywords .. such as

for bar graph
bar(x,y) ... etc

this page is a great resource ->
http://www.network-theory.co.uk/docs/octave/octave_120.html



daniel

Friday, February 9, 2007

Plotting in Octave

i've been trying to look for help as far as plotting goes in Octave -
especially plotting a function ... over a range of numbers ...

if you are a beginner like me ... this is what i tried, and it has worked so far for a
2d plot.

to plot a function over a range of numbers ... first create the function ...

function y=f(x) y=x.^3+(5*x.^2)-(10*x)+23; end

and then ..
specify the variable ..
linspace = linear space ...
x = linspace(-2,5);

then just plot it ..

plot(x,f(x)) ...

the result should be something like this ....














to add more options to the graph - like grid or title ...
simple do .. options like grid on or title('y vs x') ...

and to plot multiple functions on the same plot ...
trying using the command hold on ...

here's an example ...
given another function

function y=e(x) y = (3*x^.2)+(10*x); end

try

plot(x,f(x))
hold on
plot(x,e(x),'c')




use
hold off

to turn off this option
btw , the 'c' in earlier function meant that to plot the graph in the color cyan.

and last but not least ...
to print the graph onto a gif ...

try
gset terminal gif
gset output "something.gif"
replot

when done do
replot close


that's about it ...

here are some really awesome resources for octave ...
http://www.37mm.no/mpy/octave-r.html (great cheat sheet)
http://octave.sourceforge.net/index/plot.html
(more plotting packages like fplot and multiplot, awesome addition to the standard octave library)

and obviously ...
http://www.gnu.org/software/octave/

Octave is a great alternative to Matlab and such ...
i had it installed on my Windows XP laptop on top of Cygwin ,
and usually run it on top of Cygwin X when graphing ...
resources for Cygwin X and how to get its GUI desktop to show up ...
try http://en.wikipedia.org/wiki/Cygwin/X

have fun =)
God bless.

Thoughts sharings ... and code

so i've decided to post up things/code/tricks that i've learned through different experience and trial and error (especially those that've taken me a while to figure it out ....)
so here we go ...
for my personal blog - http://aggietech.blogspot.com ...
this blog will be purely technical.


daniel