Exploring the depths and potentials of ASP.NET RSS 2.0 or Subscribe to .BenRush by Email
 Sunday, March 12, 2006

    ....for those who find it interesting, my dishwasher is, indeed, hosed. The motor leaks water through one of the seals at the bottom of the base cover for the whole sprayer assembly. There is a little metal doohickey (yes, techn-babble) that has a seal that looks as though it was literally poured into the base itself to keep leaks from occuring - well, that seal is now dried and cracked. The only way to fix it is to get a new motor....so, I'm looking now....oh well....I learned a little about dishwashers, I guess....



kick it on DotNetKicks.com
Sunday, March 12, 2006 4:29:19 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Personal Adventures

    I was running into some issues trying to get a strongly-typed reference to a master page one of my content pages used; I remember blogging about this at one point in the past, but I want to do it again to remind myself (and anyone else) that may encounter this issue.

    If you want to access your master page in a strongly-typed fashion (without the need for late-binding or reflection), simply add this to your content page's .aspx file:

    <%@ MasterType VirtualPath="<virtual_path_to_your_master_page>.master" %>

    You can then access all the properties, methods, etc. that you have added to your master page without late-binding and other such nasties. Visual Studio can be retarded at times and fall behind in terms of intellisense until you recompile the solution. The end-effect looks like this, then:

    Me.Master.<whatever>()

    An interesting side-effect of this is that if you reference a particular type in your master page file and that isn't referenced by the content page (such as a user control [.ascx file]), you can get a compiler error that looks like this:

Error    1    c:\blah\blah.aspx.vb(23): error BC30652: Reference required to assembly 'App_Web_lyipwsg9, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' containing the type 'blah.blah'. Add one to your project.    c:\blah\blah.aspx.vb    1   


    The reason is you now expose types through get/set properties, return values or parameters utilized by your master page file to the content page. The above compiler error is a bit weird to look at and doesn't make sense at first glimpse. To fix this, reference those types in your content (.aspx) pages the same way you reference them in your master (.master) files.


kick it on DotNetKicks.com
Sunday, March 12, 2006 4:21:19 PM (Central Standard Time, UTC-06:00)  #    Comments [1] - Trackback
Computing
 Friday, March 10, 2006

    I discovered this, probably someone else out there might find it interesting.....but, it's a bad idea to have several round-trips to the database when you want to insert many records (rows). It would be nice to build an array of values to insert with one statement. This can be done easily using ADO.Net:

                comm.CommandText = "insert into blah_lnk (asdf,asdfasdf) values (:1,:2)"
                comm.ArrayBindCount = <array_length>

                Dim id_arr(<array_length>-1) As System.Int32
                For c As System.Int32 = 0 To id_arr.Length - 1
                    id_arr(c) = CType(Session("asdfasdf"), System.Int32)
                Next

                Dim orap As New Oracle.DataAccess.Client.OracleParameter("1", OracleDbType.Varchar2)
                orap.Value = id_arr
                orap.Direction = ParameterDirection.Input
                comm.Parameters.Add(orap)

                Dim orap2 As New Oracle.DataAccess.Client.OracleParameter("2", OracleDbType.Varchar2)
                orap2.Value = arr.ToArray()
                orap2.Direction = ParameterDirection.Input
                comm.Parameters.Add(orap2)

                comm.ExecuteNonQuery()

...anyway, the idea is that you can execute the statement on the array, and allow yourself only one round-trip to the database. I'm not a DB programmer, so this is probably well known, but I didn't know it....


kick it on DotNetKicks.com
Friday, March 10, 2006 2:14:51 AM (Central Standard Time, UTC-06:00)  #    Comments [4] - Trackback
Computing
 Thursday, March 09, 2006

    It was literally cataclysmic...

    I took a long walk tonight - I love walks, there's something about them that can really clear a person's head. I was rolling thoughts around in my head, thinking through things pretty deeply as I often times do. I looked up and saw a street sign that I had seen a hundred times before that suddenly took on a whole new meaning under the cloud of thought I currently had, it said "Keep Right". Suddenly all these desparate thoughts in my mind came together in what felt like a supernova explosion of insight - and I suddenly saw why burnout happens and how people can prevent it. On the same token I realized I had also seen what motivates people to carry on and accomplish things that seem, to many of us, super-human. It all made sense suddenly - I hope you feel the same way....

    But I digress - first, what is burnout? Burnout is, quite simply - a feeling of hopelessness and dispair: you feel loss of control, loss of hope and loss of energy. When burnout happens, you are burned out of the energy that allows you to be actualizing - to get done things, and to be kinetic. The opposite of burnout is energized and focused, it's that state you're in when you can work for hours and hours, go to bed, wake up, and be energetic about "working" again. The opposite of burnout is this passion. Someone who has burned out before (like me) would know that it's one of the most depressing feelings in the world to have, and that it can be straight-up frightening. You see the world in front of you, but it lacks the depth it did before - the possibilities are gone, you just feel there...nothing more.

    You see, life is somewhere around 100% psychological - there is always a level of abstraction regarding our emotions and feelings and reality itself - reality is rarely the thing that causes angst or anxiety or depression, but our reaction to it; or, as Dr. Albert Ellis would say, "The best years of your life are the ones in which you decide your problems are your own. You do not blame them on your mother, the ecology, or the president. You realize that you control your own destiny." If you fear burnout or if you feel under-energized or under-focused, you fear or are experiencing something that is quite literally within your own control, it's not something external to you - it's still totally and wholly under your power. "But energy is not something I can just switch on" you might say - and this is true, it's not something that you can switch on because this opposite of burnout, this energy you might desire, is a side-effect of something else; and focusing on it (or your lack of it) will cause even more problems as you start to feel dispair. Alright....

    ....it is the belief, the feeling, the strong faith you have in yourself that you, or those around you, have a special insight and are right (and the 'others' are wrong) about doing something or the way of doing something that prevents you from burning out. So, in a sense - it's your ability to keep "right" that will keep you going. It is this belief in you're right'ness that also motivates you to pull the long hours, to push the envelope and to accomplish things that most people think impossible. So much is possible by each of us, though, because so much that is seen as impossible is psychological from the get-go; the impass or wall isn't real. If you look back on younger days when you were filled with energy (really think about those days) you probably knew that you were right and everyone else (or most everyone else) was wrong - you were out to prove how right you were and believed so much in yourself and your cause that you took on feets that, in later years, you wonder how you ever accomplished. It is also the ability to do "right" that gives us a feeling of accomplishment and honor - so that when we feel like we have no aim, it's really because we have no idea of the "right" we want to stand for and get....

If you feel like you are on the edge of your last bit of energy - ask yourself if you really believe in what you're doing; and if not, ask why you're still doing it. What's worth something to you in this world is worth doing. That's what keeps you moving.

Anyway....my hero (in case you haven't already realized it) is Richard Feynman. I'll end with a quote of his:

"In the physics, one of the things I have to do in trying to surmount one of these apparently insurmountable problems that all the other guys are also working on [...], I have to think that I have some sort of inside track, that I'm thinking of a way that they're not thinking of. [...] I fool myself into thinking that I have an inside track, or that I have some special mathematical trick that I'm going to use which they don't have, or some kind of a talent, a way that I'm going to do it [...]. I appreciate the possibility that it is in indeed an illusion, but I don't bother myself about that - I work myself up into thinking I'm on that inside track."


kick it on DotNetKicks.com
Thursday, March 09, 2006 10:39:07 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Ranting

....then don't hard-code your connection strings into the data source control. For example, rather than writing:

    <asp:SqlDataSource ID="SqlDataSource_Checkbox" runat="server" SelectCommand="select friendly_rolename from roles"
        ConnectionString="Data Source=blah;Persist Security Info=True;User ID=blah;Password=blahblah" ProviderName="Oracle.Data.DataClient">
    </asp:SqlDataSource>

...place everything in a web.config file and do this instead:

    <asp:SqlDataSource ID="SqlDataSource_Checkbox" runat="server" SelectCommand="select friendly_rolename from roles"
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>">
    </asp:SqlDataSource>

If I see another instance of someone thinking "no code" means "no brains" and copy a damn connection string to forty places in the declarative statements, I'm going to scream....


kick it on DotNetKicks.com
Thursday, March 09, 2006 11:55:38 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing

....someone created an interesting post reflecting on his experience with Expression. Read it here.


kick it on DotNetKicks.com
Thursday, March 09, 2006 1:45:42 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing

.....check this out if you're interested in Gadgets.


kick it on DotNetKicks.com
Thursday, March 09, 2006 1:40:16 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing

Excuse me 'mam, would you mind helping me with my furry lobster?


kick it on DotNetKicks.com
Thursday, March 09, 2006 12:57:39 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback

Computers Blogs - Blog Top Sites

Archive
<March 2006>
SunMonTueWedThuFriSat
2627281234
567891011
12131415161718
19202122232425
2627282930311
2345678
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Benjamin Rush
Sign In
Statistics
Total Posts: 444
This Year: 0
This Month: 0
This Week: 0
Comments: 127
Themes
Pick a theme:
All Content © 2008, Benjamin Rush
DasBlog theme 'Business' created by Christoph De Baene (delarou)