This says it all :)
No Comment
No Comment
"Hey!", you will shout, "You are Romanian, what do you know about the American mind?". And you would be right. I don't know much about the American mind, but I do know what I see on the news and in the movies. And three movies I've recently seen opened my eyes even more.
This is not one of John Saul's best books, but then again, when you say John Saul you say cliche book. All his books contain some sort of drama, usually concerning children, always in a backwater town or suburb, always playing the child in danger, family connection, deep instinctual fears, etc. But some of them are more interesting than others, me liking science related books more, even if I almost always relate to the mad scientists and their evil creations than to the pseudo-moral rednecks that fight against them. This one is plain boring.
I have been working recently with Page.LoadTemplate and ITemplate.InstantiateIn to add content from user controls to pages or other controls. This thing solves the problem of having to declare abstract classes in App_Code, but poses another problem linked to the lack of object references to the user controls you instantiate. What that means, among other things, is that you lose the ability to use events in your code.
I know it's bad taste, but it was too good not to blog about it. I just had this vision of this school bully, pushing kids around, hitting and scaring them. One day, one of the kids fights back and kicks the bully in the nads. So he crumbles to the floor, but then tells everyone how that attack was unmanly and cowardly and then beats the crap out of the kid.
Agent Smith from Matrix once said "I hate this place. This zoo. This prison. This reality, whatever you want to call it, I can't stand it any longer. It's the smell, if there is such a thing. I feel saturated by it. I can taste your stink and every time I do, I fear that I've somehow been infected by it" and that made me like him instantly.
The lead characters of this author seem to always be quiet guys, ready to accept anything and be taken anywhere by the story. The same incredible things happen, all narrated in a very calm way, making them real. The obsession for American or English music permeates everything. I've read two Murakami books, but also some reviews for other books, and the same situation seems to be repeating itself.
First of all there is no reason not to apply this method to any other templatable control like GridViews or DataGrids. The basic mechanism is the same.<asp:DataList id="dlMain" runat="server" OnItemCreated="dlMain_ItemCreated" >
</asp:DataList>
protected void dlMain_ItemDataBound(object sender, DataListItemEventArgs e)
{
ITemplate template1 = e.Item.ItemIndex % 2 == 0
? Page.LoadTemplate("~/ucTest1.ascx")
: Page.LoadTemplate("~/ucTest2.ascx");
e.Item.Controls.Clear();
template1.InstantiateIn(e.Item);
}
Check out this interesting piece of code:
javascript:document.body.contentEditable='true'; document.designMode='on'; void(0);
I just finished watching a very cool documentary, called The Human Behavior Experiments, that I highly recommend seeing. It describes some of the mechanisms of the human mind that make us behave inhumainely, or iresponsibly and the experiments to expose them. I found very interesting the information on Wikipedia about these experiments and I will post a list of links below.
Telemarketing is already embedded in the western popular culture, but in Romania, we didn't have it until recently, and only very rarely. Usually they didn't want to sell stuff, but to poll opinion. So I was immediately annoyed when a authoritative male voice started to talk to me about increasing the money I get from my insurance. That annoyance increased when the voice continued "if you want to... bla bla bla, press 1". They didn't even bother to put a human to give the phone calls, it was all automated. Swearing at a machine would have been ridiculous, so they took away the only possible emotional outlet. They have denied my anger!
One of the issues that largely remains unsolved in AJAX applications is the ability to bookmark (say, add to the Favourites) the page with all the AJAX added info on it. This very cool javascript library allows one to save the state of the page using the window.location.hash variable, which holds the string after the # character, also called a hash.window.location.hash='hash';will scroll the page there.
I have this Web User Control that has a simple function of displaying a customised grid and fill it with data. Since I had to email the rendered HTML I've added a static method to the Web User Control that would render itself based on some parameters. However, in Net 2.0 one cannot dynamically use the types declared in the codebehind of a user control or page inside another control or page, only types declared in App_Code. In pages this gets solved as in the link above, but what do you do when you want to use the type inside a class in App_Code or, like I needed to, in a web service (where register directives are not allowed)?UserControl uc = new UserControl();
uc = (UserControl) uc.LoadControl("~/Wuc.ascx");
MethodInfo mi = uc.GetType()
.GetMethod("GetHtml",BindingFlags.Static);
MethodInfo mi = uc.GetType()
.GetMethod("GetHtml");
string s = (string)mi.Invoke(uc, new object[] { i });