IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1825.68 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-07-27
[20:57]<prnn>can't get the object from the method?
[20:58]<prnn>if you could you could call Invoke on it, etc
[20:58]<azyfm>it would be nice if C# had some kind of "reflection literal" mechanism
[20:58]<azyfm>`SomeType.SomeProperty` would give you a PropertyInfo for that property, for example
[20:59]<azyfm>that way you could have strongly-typed reflection
[20:59]<prnn>yeah
[21:01]<txyzmlbz>what is reflection?
[21:01]<txyzmlbz>when the code analyzes its own code?
[21:01]<azyfm>pretty much
[21:01]<azyfm>it's the ability to query types at runtime about their methods, properties, fields and so on, and also access them
[21:01]<prnn>and how about MyInvoke(richTextBox1, richTextBox1.AppendText, "foo"); ?
[21:02]<gwaglvyjg>What's that
[21:02]<prnn>I'm trying to write some sort of function wrapper around
[21:02]<prnn>richTextBox1.Invoke((MethodInvoker)delegate { richTextBox1.AppendText("foo"); });
[21:04]<awjzdd>omg!~
[21:04]<gwaglvyjg>Method that calls another method of specified object with specified parameters?
[21:05]<prnn>yeah
[21:05]<prnn>it's always calling Invoke
[21:05]<gwaglvyjg>It looks interesting and easy in implementation, isn't it
[21:05]<gwaglvyjg>*doesn't
[21:05]<prnn>yes
[21:07]<gwaglvyjg>And in C# 3.0 we can easily declare such a method as Extension so we can access it with the same syntax as we access all methods: myObject.DoInvoke("method", params)
[21:07]<prnn>that way I wouldn't have to write a wrapper for every method, or use the long above syntax
[21:08]<gwaglvyjg>C# 3.0 extensions are really cool feature
[21:08]<prnn>will vista ship with net 3.0
[21:08]<azyfm>Exception: that doesn't really give you much
[21:08]<vynvyv>naw, vista will ship with 7.0
[21:08]<azyfm>You could do it today as myObject.GetType().Invoke(...)
[21:08]<vynvyv>in the year 2016
[21:09]<gwaglvyjg>Who knows.. Maybe it will.. But I don't think .NET 3.0 will be available as soon as stable version of Vista
[21:09]<vynvyv>Exception: obviously you don't read slashdot
[21:09]<rxrcr>er, .net3 is coming before vista
[21:09]<gwaglvyjg>Yes, of course I could, but it's syntax sugar and it can be useful :)
[21:09]<gwaglvyjg>Oh
[21:10]<anuynnn>Hello, would anyone be willing to take a look at a small app that i wrote and point out anything i could do to optimize performance?
[21:10]<gwaglvyjg>I mean _Vista_ will not be available as soon as .NET
[21:10]<gwaglvyjg>)
[21:11]<gwaglvyjg>What do you mean saying 'little'
[21:11]<vynvyv>i don't think he said that
[21:11]<gwaglvyjg>*small
[21:11]<anuynnn>http://www.nomorepasting.com/paste.php?pasteID=65832
[21:12]<gwaglvyjg>:)
[21:12]<anuynnn>lol
[21:13]<azyfm>cruizer: not much point in optimizing data access code
[21:13]<azyfm>the database will be so much slower than the code calling it anyway
[21:13]<gwaglvyjg>Why to use char.Parse? Just type '\n'
[21:14]<anuynnn>its just that when running the app it uses 50 CPU in task manager and is forever eating more and more memory
[21:14]<gwaglvyjg>Do you really think anyone can clearly undertand your code?
[21:14]<gwaglvyjg>I mean 20th line
[21:14]<anuynnn>i realise that the while(true) loop would have something to do with it
[21:15]<gwaglvyjg>And I suppose programming with SqlCommands is a bad style.
[21:15]<azyfm>indentation sucks
[21:16]<anuynnn>agreed i will eventually use stored proc
[21:16]<azyfm>You have to use an IDbCommand to access aa sproc too...
[21:16]<gwaglvyjg>I really love ORM like the DLinq... +)
[21:16]<gwaglvyjg>Ya
[21:16]<vynvyv>wow that background image is totally not annoying </sarcasm>
[21:17]<gwaglvyjg>But even programming with IDb... looks quite better than with Sql.. cause you have to change the code for database migration
[21:17]<anuynnn>line 20 is just parsing out the excess data so i am left with USERNAME and IPADRESS instead of User Name: USERNAME and Source Network Address: IPADDRESS
[21:17]<anuynnn>im willing to listen to any suggestions for improvement
[21:18]<azyfm>fix the indentation first so people can read it :-P
[21:18]<gwaglvyjg>Why not to call things with their names? "EventLog test" :)
[21:19]<anuynnn>good points but those things will be changed after debugging, i am just concerned about the constant growing memory usage
[21:19]<gwaglvyjg>Better use System.Windows.Forms.Application.DoEvents instead of this loop..
[21:20]<gwaglvyjg>You have an infinite loop. What do you want?! It eats all memory
[21:20]<anuynnn>does do events exist in .net 1.1?
[21:20]<azyfm>One nice thing about the VS 2005 editor, especially in a team environment, is that it *forces* proper indentation on you
[21:20]<azyfm>events have existed from day one
[21:20]<gwaglvyjg>Of course yep
[21:20]<gwaglvyjg>Really it does?
[21:21]<gwaglvyjg>Haha =)
[21:21]<rxrcr>its a feature
[21:21]<rxrcr>I'll often replace the last bracket of a file, just to make sure
[21:22]<gwaglvyjg>Can anyone tell me what's purpose for categories at nomorecopypasting? Do they think somebody is going to browse them?!
[21:23]<txyzmlbz>haha why not
[21:23]<gwaglvyjg>%)
[21:23]<txyzmlbz>i read them in the morning with my coffee
[21:23]<txyzmlbz>that's my routine
[21:23]<azyfm>Yeah, I guess it's nice to have something to turn to since thedailywtf is only updated once per day...
[21:25]<prnn>Arild why couldn't the function be written so that it accepts MyInvoke(richTextBox1, richTextBox1.AppendText, "foo");
[21:25]<prnn>it has the object, the method and the argument
[21:25]<azyfm>because the compiler would interpret it as trying to access the property .AppendText on the richTextBox
[21:25]<azyfm>and since it's not a property, it will scream at you
[21:26]<kjr>did someone need the topic fixed?
[21:27]<azyfm>think it was something about the MSDN documentation being freely downloadable now
[21:27]<txyzmlbz>yeah can you put 'no fags' up top
[21:27]<kjr>ThirdLBR: excuse me?
[21:27]<txyzmlbz>oh right you have ops
[21:27]<txyzmlbz>scarrrry
[21:27]<txyzmlbz>dear kog, fuck you?
[21:27]<txyzmlbz>haha
[21:27]<txyzmlbz>fag
[21:27]<txyzmlbz>ghead
[21:27]<kjr>ThirdLBR: who are you and why are you being an idiot?
[21:27]<txyzmlbz>just making a joke is all
[21:27]<txyzmlbz>happy hump day
[21:27]<kjr>no, see jokes are funny - you're just being an idiot
[21:27]<txyzmlbz>haha owned
[21:28]<kjr>oh wait. you're in a CSS channel, that would explain the stupid sense of humor







