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-20
Pages: < Prev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Next >
[12:51]<dzrrjgd>rikkus: object[]
[12:51]<mjzymygo>rikkus: use overloading
[12:51]<mjzymygo>or Object[]
[12:52]<zyccus>ta
[12:52]<zyccus>I could use overloading
[12:52]<mjzymygo>optional parameters slow down the CLR, so the C# team decided not to allow it in C# as the framework is purely coded in it
[12:52]<dzrrjgd>the pass as multiple vars as new Object[]{ string a = "blah, string b = "blah2" }
[12:52]<zyccus>but I'm wanting to do something similar to String.Format
[12:52]<[dam]>function(params Array[] intVals) ?!?
[12:52]<zyccus>which is ok... just means a lot of code... might optimise it later
[12:53]<dzrrjgd>function( Object[] prams )
[12:53]<mjzymygo>string format uses overrides... 5 of them.
[12:53]<zyccus>k
[12:53]<dzrrjgd>Moridin8: whas everything i just typed correct?
[12:54]<mjzymygo>and string format is just a wrapper to StringBuilder anyway
[12:54]<dzrrjgd>i mean about the Object[] crap
[12:54]<mjzymygo>so if you want a speed boost, just use StringBuilder
[12:54]<mjzymygo>DragonD... yeh.
[12:54]<mjzymygo>but overloads are better as they are faster and don't force boxing
[12:54]<dzrrjgd>cool, then i am actually learning...
[12:54]<mjzymygo>also the end developer knows exactly what the methods accept
[12:55]<zyccus>I'm actually going to attempt to implement String.Format("The {animal} sat on the {floorcovering}", "animal", "cat", "floorcovering", "mat")
[12:55]<zyccus>though I don't like that syntax too much
[12:55]<zyccus>suggestions appreciated
[12:55]<mjzymygo>then don't use it ase StringBuilder ;)
[12:56]<mjzymygo>http://pastebin.ca/93268 <-- this is string.Format
[12:56]<mjzymygo>notice that VB converts the last param to the VB optional parameters.
[12:57]<mjzymygo>messy... nasty boxing issues with value types
[12:57]<zyccus>Perhaps String.Format("The {animal} sat on the {floorcovering}").Arg("animal", "cat").Arg("floorcovering", "mat") ... don't like that much either
[12:57]<zyccus>that's what Qt does (or did)
[12:57]<pzaanavqt0w2>FUCK
[12:57]<pzaanavqt0w2>no .Name property for the members of an ArrayList :(
[12:57]<mjzymygo>yeh, that forces 3 extra heap allocations/stack walks
[12:58]<zyccus>I suppose I could have: String.Format("The {animal} sat on the {floorcovering}", "animal:cat", "floorcovering:mat")
[12:58]<zyccus>would be simple if you say that keys have to match [a-z]+
[12:58]<zyccus>or similar
[12:59]<mjzymygo>rikkus: what are you trying to achieve?
[12:59]<zyccus>I think I quite like that version
[12:59]<pzaanavqt0w2>wtf can i find a list of all the .NET-defined exception types?
[12:59]<zyccus>Moridin8: the equivalent of String.Format, but with 'named parameters' instead of numbered
[12:59]<mjzymygo>ah...
[13:00]<mjzymygo>makes you wonder why M$ didn't have a reg-ex overload huh
[13:00]<pzaanavqt0w2>regex overload?
[13:00]<pzaanavqt0w2>what for?
[13:00]<mjzymygo>rikkus: you could always code one up.
[13:00]<zyccus>Moridin8: that's what I'm intending doing
[13:00]<mjzymygo>as I said, String.Format uses StringBuilder... nothing stopping you doing the same
[13:00]<mjzymygo>Project2501b: for easier pattern matching
[13:00]<pzaanavqt0w2>dang.
[13:01]<pzaanavqt0w2>how much more easier can pattern matching be?
[13:01]<zyccus>Moridin8: I probably will... I'm just trying to decide the best user syntax
[13:01]<mjzymygo>Project2501b: you might be suprised if you actually knew regex ;)
[13:01]<pzaanavqt0w2>you just read the "regular expressions" book by o'reilly, and you're good to go for ages.
[13:01]<zyccus>oh StringBuilder's AppendFormat... dunno if that'll be usable
[13:02]<mjzymygo>ah me == STFU ;)
[13:02]<mjzymygo>the stringbuilder appendformat matches against numbers only... =/
[13:02]<mjzymygo>but either way it's still in c# and not a native internal call.
[13:03]<mjzymygo>nothing stopping you creating your own version of appendformat then either.
[13:03]<mjzymygo>DragonD: you still lurking?
[13:04]<mjzymygo>rikkus: see line 967: http://dotnet.di.unipi.it/Content/sscli/docs/doxygen/fx/bcl/stringbuilder_8cs-source.html
[13:04]<zyccus>ta
[13:04]<mjzymygo>stringbuilder is faster than concats...
[13:05]<mjzymygo>(well, < than 5/6 concats is fine, anything over and stringbuilder rips)
[13:05]<zyccus>that's not concats
[13:05]<zyccus>compiler turns that into "constantstringanotherconstantstring"
[13:05]<[dam]>wow.. that.. a concatenation!
[13:06]<zyccus>so unless it's faster than 0 microseconds at runtime, it's slower :P
[13:06]<mjzymygo>rikkus: good point... VB.NET didn't used to do that tho
[13:06]<mjzymygo>(again probably out of date)
[13:06]<mjzymygo>VB.NET's constant folding ability used to suck butt
[13:06]<zyccus>I measured StringBuilder performance when I first started with .NET... (using 1.1) - I got the same conclusion - after about 6 concats, it makes a difference
[13:08]<fyfuym-syfggag>rikkus I have to agree with you
[13:08]<zyccus>I made a StringBuilder for VB6 when I had to work on it recently
[13:09]<zyccus>some idiot was doing concats in a tight loop and taking 10 minutes to do something that ended up being done in 10 seconds
[13:10]<zyccus>and that's with my naive, not-very-optimised implementation
[13:11]<zyccus>damieng: morning
[13:11]<dzrrjgd>Moridin8: yeah i'm still kinda here, lurking, why?
[13:12]<drdyrrr>lo
[13:12]<drdyrrr>or gutten morgen
[13:12]<fyfuym-syfggag>or stfu?
[13:12]<fyfuym-syfggag>how goes damieng :)
[13:13]<pzaanavqt0w2>Moridin8: hmmm
[13:13]<drdyrrr>yeah not bad.
[13:13]<drdyrrr>38'C here though, hot
[13:13]<dzrrjgd>is there a was to compile C# so someone doesn't have to have .net to run it? i asked the a day or two ago, and noone gave me a useable answer.
[13:13]<fyfuym-syfggag>hehe
[13:13]<fyfuym-syfggag>its like 17 here
[13:13]<pzaanavqt0w2>Moridin8: may i please have a copy of your ORM solution? i wanna skim through it.
[13:13]<mjzymygo>DragonD: just wondering if you've learned much what hangiong here...
[13:13]<zyccus>DragonD: no, you need .NET
[13:13]<mjzymygo>it's interesting that the code for .NET is available online huh ;)
[13:13]<fyfuym-syfggag>DragonD erm smoke some more stuff?
[13:13]<zyccus>DragonD: just like with Delphi, you need the Delphi runtime
[13:14]<mjzymygo>Project2501b: maybe ;)
[13:14]<pzaanavqt0w2>Moridin8: not the code, but the framework :)
[13:14]<mjzymygo>I gotta cut lots of shite out of it first
[13:14]<pzaanavqt0w2>Moridin8: do i have to perform sexual favors for you?
[13:14]<pzaanavqt0w2>ah, ok.
[13:14]<mjzymygo>Project2501b: no... but it's got stuff attached to it that don't belong to me atm
[13:14]<mjzymygo>I have to remove it







