code logs -> 2010 -> Tue, 20 Apr 2010< code.20100419.log - code.20100421.log >
--- Log opened Tue Apr 20 00:00:56 2010
00:15
< Rhamphoryncus>
weeeee major milestone in my python static analyzer (the interesting part of my python compiler). It can now count up to 6500000000000000000 instantaneously :D
00:17
<@Vornicus>
All right then.
00:18
< Tarinaky>
Instantaneously?
00:19 You're now known as TheWatcher[T-2]
00:19
<@McMartin>
"This loop does nothing, I can remove it and just assign the edge condition"?
00:19
< Rhamphoryncus>
What it's doing is storing a set (or interval) of possible values for a variable, but for math ops (like +) it rounds out to more interesting points
00:20
< Rhamphoryncus>
so if it sees an op that may produce a range of 1..10000 it expands that to 1..65536
00:21
< Rhamphoryncus>
There's an infinite range of numbers but the interesting values are fixed, so it goes through them in constant time
00:30 You're now known as TheWatcher[zZzZ]
01:25 GeekSoldier_ [Rob@Nightstar-e86e3e0d.ip.cablemo.net] has joined #code
01:27 GeekSoldier [Rob@Nightstar-e86e3e0d.ip.cablemo.net] has quit [Ping timeout: 121 seconds]
01:35 Attilla [Attilla@FBC920.174237.F3A31B.DDA933] has joined #code
01:35 mode/#code [+o Attilla] by Reiver
01:52 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?]
02:40 Attilla [Attilla@FBC920.174237.F3A31B.DDA933] has quit [Client closed the connection]
03:38 Derakon[AFK] is now known as Derakon
03:51 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [[NS] Quit: Leaving]
03:53 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
04:43 Julia [sdfsldfsfsd@Nightstar-8352314c.216-16-46.iw.net] has joined #code
04:43 Julia [sdfsldfsfsd@Nightstar-8352314c.216-16-46.iw.net] has left #code []
05:02 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
05:23 * Reiver struggles to work out the best way to track what component counts were used in constructing his tuples.
05:52 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!]
05:54 Vornicus is now known as Vornicus-Latens
06:01 Derakon is now known as Derakon[AFK]
06:07 AnnoDomini [annodomini@Nightstar-ed4135c3.adsl.tpnet.pl] has joined #code
06:07 mode/#code [+o AnnoDomini] by Reiver
07:04 You're now known as TheWatcher
07:41 Rhamphoryncus [rhamph@Nightstar-8931f88f.abhsia.telus.net] has quit [Client exited]
08:01<~Reiver> How to you get the length of an array?
08:01<~Reiver> In Java, rather.
08:07
<@McMartin>
a.length, I believe
08:09<~Reiver> McMartin! Aha!
08:10<~Reiver> You may be able to help me even better than that. You once threw a little, like, two-line snippet of code that parsed the command line arguements
08:10<~Reiver> Unfortunately the pastie I stored it in appears lost forever unless I can retrieve the URL. I was trying to rehandcraft the thing myself and got stuck on trying to find the array length as the for-loop limiter.
08:10
<@McMartin>
for (int i = 0; i < args.length. ++i) { processFile(args[i]); } ?
08:11<~Reiver> ... ok, so why did args.length not behave for me
08:11
<@McMartin>
full args stuff is beyond me at this hour
08:11<~Reiver> That's what I had. Hrm.
08:11
<@McMartin>
Is main()'s argument named args?
08:11<~Reiver> Yeah
08:11
<@McMartin>
public static void main(String[] args)?
08:11
<@McMartin>
Hm.
08:11
<@jerith>
Reiver: I think getopt is in Java's stdlib.
08:12
<@McMartin>
Yeah, there may be better ways now
08:12<~Reiver> Oh wate
08:12<~Reiver> Helps if I import Java.util doesn't it. >_>
08:12<~Reiver> Sorry~
08:12
<@jerith>
It's a crappy C-style method, but I'm pretty sure there isn't anything better without pulling in external libs.
08:14<~Reiver> wait, what am I doing here.
08:15<~Reiver> I have precisely two commandline instructions with a fixed order.
08:15<~Reiver> I don't need a for loop at all, do I...
08:16 You're now known as TheWatcher[afk]
08:17
<@jerith>
Quite.
08:17
<@jerith>
Although you'll want to validate them.
08:18
<@McMartin>
One nice thing about Java is that they start as Strings, which have a bunch of parser methods already handy.
08:18
<@jerith>
Quite.
08:18
<@jerith>
Although usually not the ones I actually want to use.
08:18
<@McMartin>
"file exists" or "is an integer" is typically what I end up with, personally
08:19<~Reiver> So. Is it a bad idea to just go "filepath = args[0]; totalCost = args[1];"? What checks would I be sticking on that?
08:19
<@McMartin>
Make sure args.length is is exactly 2.
08:19
<@McMartin>
First.
08:19<~Reiver> Yeah, that makes sense
08:19
<@jerith>
Reiver: Assert that the thing you're expecting to be an integer is an integer.
08:19
<@jerith>
Throw appropriate errors.
08:19
<@McMartin>
Or a Decimal, if Cost is a decimal thing.
08:20
<@McMartin>
Also assert the file is (if it's to be read) actually exists.
08:20
<@jerith>
For command line parsing, that ususally means printing to stdout and then exit(1) or whatever the Java equivalent is.
08:20
<@McMartin>
System.exit(1), I believe.
08:20<~Reiver> Decimal is a Float, correct?
08:20
<@McMartin>
Or, if you're lazy, just don't catch the exception you throw
08:21
<@McMartin>
Well, there's a Decimal *class* that does binary-coded decimal and ensures that there's no floating point instability
08:21
<@McMartin>
If you're doing money, this is the best way to do it if you need decimality.
08:21<~Reiver> hm, that's a good idea
08:21
<@McMartin>
(The cheap other way to do it is to use integers in the lowest denomination used)
08:21 * Reiver hunts.
08:21
<@McMartin>
I know of BigDecimal, don't know if there's a SmallDecimal
08:21<~Reiver> (Does it accept, eg, 72.50 as a valid number)
08:22<~Reiver> Is BigDecimal preferable to Double?
08:23
<@McMartin>
You can't represent 1/100 exactly with a double
08:24
<@McMartin>
It'll *probably* be OK, for homework
08:24
<@McMartin>
But if you're doing something with serious business logic you should either do everything in terms of cents, or use BigDecimal everywhere
08:30<~Reiver> hm
08:30<~Reiver> BigDecimal seems clumsy to use
08:32<~Reiver> Well, we'll see how I go.
08:32 * Reiver ponders Java and it's myraid methods for loading files, tries to figure out which is the tastiest to use today.
08:33<~Reiver> http://www.cs.waikato.ac.nz/~tcs/COMP317/Assignments/reliable3.dat - I want to be parsing each line as a new Device into an ArrayList<Device>.
08:33
<@jerith>
What are you wanting to read?
08:33
<@jerith>
Text or binary?
08:33<~Reiver> Text
08:34
<@jerith>
Then you want the Reader/Writer stuff.
08:34
<@jerith>
They make text.
08:34
<@jerith>
InputStream/OutputStream operate on byte arrays.
08:35
<@jerith>
Translating between the two requires lots of boilerplate and, in some cases, use of an API that has been deprecated for over a decade but still has no replacement.
08:35<~Reiver> right.
08:35
<@jerith>
</rant>
08:35
<@McMartin>
I really think we're going to globally standardize on UTF-8 before encoding APIs stabilize.
08:36
<@jerith>
McMartin: Sometime around the release of Ubuntu Zealous Zebra, perhaps?
08:36
<@jerith>
Or am I being optimistic?
08:36<~Reiver> But what about UTF-16~
08:36
<@McMartin>
UTF-16 can choke on a bag of phalli~
08:37
<@McMartin>
That said, Windows already standardized on it for its OS API. >_<
08:37
<@jerith>
As always, Legacy is the killer.
08:37
<@McMartin>
Still better than the 20 or so encodings that OS X uses =(
08:37
<@jerith>
Because all your files are still Latin-69 or whatever Windows likes to use.
08:37 * Reiver puzzles this. Been waaay too long since he's had to read crap in from a file as text. Fiddles.
08:37
<@McMartin>
Code Page blah blah blah
08:38
<@McMartin>
Modern Windows storage formats normalized on UTF-8 more or less, AIUI.
08:38
<@McMartin>
It's just the kernel that wants everything UTF-16.
08:38
<@jerith>
"Modern"?
08:38
<@McMartin>
"Windows 2000 or later"
08:38
<@jerith>
Ah.
08:39
<@McMartin>
Win9x used Code Page (4-digit something or other)
08:39
<@jerith>
Code Pages are mix'n'match because you only get 128 characters in each.
08:39
<@jerith>
And the default depends on your installation language.
08:40
<@McMartin>
Yeah. Boo for that.
08:40
<@McMartin>
And in UNIX you're evenly split between UTF-8 and Latin-1 for English-language stuff
08:40
<@McMartin>
Or "C" which is "wait, characters have eight bits? What is this rubbish?"
08:40
<@jerith>
Quite.
08:42
<@jerith>
Of course, Control as a modifier originally just suppressed bit 6 in the ASCII code or something.
08:42
<@jerith>
Or was it EBCDIC?
08:42
<@jerith>
And Meta just added bit 7.
08:44
<@jerith>
That's why ^B and ^C for mIRC colour codes pepper your services databases with 0x02 and 0x03, which are then rendered as the illegal(!) XML entities &#2; and &#3;
08:45
<@jerith>
Thus causing jerith a world of pain and a crapload of search/replace pre- and post-filtering in his script.
08:46
<@jerith>
Whoever added that little gem to the XML spec needs to die a fiery death of burnitude. :-/
08:46
<@jerith>
</rant>
08:48<~Reiver> hn
08:48<~Reiver> Is there a constant or equivalent in Java string parsing for 'whitespace'
08:48<~Reiver> Be it tab, space, whole string of spaces, etc?
08:48
<@jerith>
I don't think so, but I haven't looked at that stuff in ages.
08:49
<@jerith>
You could use regexen and "\s" if you need to, though.
08:49 * jerith heads to the office, which is hopefully actually an office.
08:50
<@jerith>
Hrm. I should fire up IM and check that first.
08:50<~Reiver> Other way of poking at it: I can use string[] args in commandline
08:51<~Reiver> Wherein spaces denote 'next bit in the array'
08:51<~Reiver> Nothing similar for filereading?
08:58<~Reiver> hm. .lineToParse.split() seems to do half of it, we'll see if that's enough.
09:25 AnnoDomini [annodomini@Nightstar-ed4135c3.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
09:27 AnnoDomini [annodomini@Nightstar-add4a1e1.adsl.tpnet.pl] has joined #code
09:27 mode/#code [+o AnnoDomini] by Reiver
09:56<~Reiver> arg, fuck this noise
09:57<~Reiver> BigDecimal is a leeging /pain/ to work with
09:57<~Reiver> Why can't it behave like, I don't know, Float and Integer and Double and the rest ¬¬
10:44 You're now known as TheWatcher
10:45
<@TheWatcher>
That'd be too useful!
10:52 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
--- Log closed Tue Apr 20 11:25:53 2010
--- Log opened Tue Apr 20 11:26:22 2010
11:26 TheWatcher [chris@Nightstar-b4529b0c.zen.co.uk] has joined #code
11:26 Irssi: #code: Total of 20 nicks [7 ops, 0 halfops, 0 voices, 13 normal]
11:26 mode/#code [+o TheWatcher] by Reiver
11:27 Irssi: Join to #code was synced in 56 secs
11:51 Attilla [Attilla@FBC920.174237.F3A31B.DDA933] has joined #code
11:51 mode/#code [+o Attilla] by Reiver
12:03 Orth [orthianz@Nightstar-01bc7420.xnet.co.nz] has quit [Client closed the connection]
12:09 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
12:27 cpux is now known as shade_of_cpux
14:55 You're now known as TheWatcher[afk]
15:09 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
15:19 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
15:41 SmithKurosaki [Smith@Nightstar-85fffd27.dsl.teksavvy.com] has quit [Connection closed]
15:44 SmithKurosaki [Smith@Nightstar-85fffd27.dsl.teksavvy.com] has joined #code
17:05 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
17:29
< celticminstrel>
I can't help wondering what idiot at Adobe decided it was a good idea to not support the Print Preview function on Mac.
17:30
< gnolam>
... it's Adobe.
17:30
< celticminstrel>
I can understand them not supporting Print to PDF. But Print Preview is kind of essential.
18:36 Rhamphoryncus [rhamph@Nightstar-8931f88f.abhsia.telus.net] has joined #code
18:36
< PinkFreud>
because the pdf *is* the 'preview'?
18:37
< celticminstrel>
Maybe not, if you've entered text into fields.
18:37
< celticminstrel>
Which, incidentally, Preview.app doesn't support.
18:37
< PinkFreud>
heh
18:46 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code
18:46 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [Client closed the connection]
18:48 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code
18:50 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [Client closed the connection]
18:50 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code
18:57 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [Client closed the connection]
18:58 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code
19:12 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [[NS] Quit: If the world didn't suck, we'd all fall off.]
20:39 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
21:09
<@McMartin>
Preview.app =(
21:12
< celticminstrel>
What's wrong?
21:12
<@McMartin>
Oh, it's just burned me several times in the past with its almost-PDF rendering.
21:13
< celticminstrel>
Any examples?
21:13
<@McMartin>
No easy ones; just the occasional horribly mangled document
21:13
< celticminstrel>
I see.
21:14
< celticminstrel>
So it's probably a good thing that I use Adobe Viewer usually?
21:14 * McMartin shrugs.
21:15
<@McMartin>
When it fails, it's generally pretty obvious
21:22
< gnolam>
Hmm.
21:22 * gnolam has apparently lost his Project Euler login.
21:23
<@jerith>
Heh. One our our vendor API documents only renders in Adobe Reader.
21:24
<@jerith>
Preview and whichever other one I tried both render the monospaced bits as random compositions of black-to-white gradients.
21:24
<@McMartin>
On the subject of PDF readers to not use, Sumatra PDF is amazingly terrible.
21:32
< gnolam>
It does tend to crap out on a lot of documents, yes.
21:33 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
21:34
< gnolam>
But it's not Acrobat. :P
21:37
<@McMartin>
It also jams printers
21:37
<@McMartin>
Because, ANAICT, it renders each pixel as a square of PostScript
21:37
<@McMartin>
I've had 300KB PDFs turn into dozens of gigabyte-sized print jobs when printed through Sumatra
21:40
< gnolam>
Hah.
21:40
< gnolam>
Never tried printing through it.
21:41
< gnolam>
http://www.google.com/governmentrequests/
21:42 GeekSoldier_ [Rob@Nightstar-e86e3e0d.ip.cablemo.net] has quit [Ping timeout: 121 seconds]
21:42 GeekSoldier_ [Rob@Nightstar-e86e3e0d.ip.cablemo.net] has joined #code
21:45
<@McMartin>
gnolam: Yeah, uh, don't~
21:45
<@McMartin>
It's vaguely OK as a viewer, but if you're trying to avoid Adobe, FoxIt is free too.
21:47
< gnolam>
Unfortunately, I have a policy against programs that attempt to advertise in their very title. :P
21:51
<@McMartin>
Heh
21:51
<@McMartin>
Hm. Actually. Can't gsview be put into a PDF-reading mode?
21:58 You're now known as TheWatcher
22:01 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
22:48
<@ToxicFrog>
...how is "foxit" advertising?
22:49
<@jerith>
48% of Firefox?
22:50
< Namegduf>
Just Foxit.
22:50
< Namegduf>
Their domain is "Foxit Software" and they describe it as "Foxit Reader"
22:50
< Namegduf>
And other PDF software.
22:51
< Namegduf>
So I don't know if I'd read it as "That's Firefox-related"
22:52
< gnolam>
It insists on not calling itself "Foxit" or "Foxit Reader", but "Foxit Reader, the best bla bla bla wharrgarbl!"+
22:52
< Namegduf>
Ah, I see.
22:56
<@ToxicFrog>
...actually, no, it just calls itself "Foxit Reader"
22:56
< gnolam>
Not the last time I used it.
22:56
< Namegduf>
Maybe they fixed it.
22:56
< Namegduf>
This is why bugtrackers are better than support.
22:56
< Namegduf>
You can file things like that which are clearly misfeatures as bugs.
22:56
< gnolam>
It might be a small annoyance, but "Open with ... Foxit Reader, the best bla bla bla wharrgarbl!" instead of just "Open with... Foxit" is still fscking annoying.
22:57
<@ToxicFrog>
I mean, it might say that somewhere on the website, which would put it in common with every piece of software released in the past 15 years
22:57
< gnolam>
I'm talking about the program itself.
22:57
< gnolam>
I don't care about the website.
22:57
< gnolam>
I used the goddamned thing for three years or so, and that was one thing that stayed constant between versions. :P
22:57
<@ToxicFrog>
But I've been using it since 2006 or so and have yet to observe this.
22:58
<@jerith>
Maybe only the Swedish version does it? :-P
22:58
<@ToxicFrog>
Not in the title bar, not in the start menu entries, not in the install path, the right-click entry is just "Open"...
22:59 AnnoDomini [annodomini@Nightstar-add4a1e1.adsl.tpnet.pl] has quit [[NS] Quit: I sleep.]
23:02 * gnolam does not care for shitty translations with made-up words (Microsoft and Nvidia were the worst offenders with that) and therefore uses English-language OSs and programs.
23:03
<@McMartin>
What's the best is when they translate the APIs too making various programs randomly suddenly not binary compatible. =(
23:04
< Namegduf>
Haha
23:04
<@McMartin>
(We've been burned by that a couple of times at my workplace; MS officially blames us since there are ways to have this not happen)
23:06 crem [moo@Nightstar-8ca3eea7.adsl.mgts.by] has quit [Ping timeout: 121 seconds]
23:07
< gnolam>
... translate the APIs?
23:09
<@McMartin>
System support programs sometimes have their names translated, and sometimes don't.
23:09
<@McMartin>
So if you ever shell out or use rundll32, the files might not be there under the names you expect.
23:37 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
23:37 shade_of_cpux is now known as cpux
23:40 cpux [Moo@Nightstar-20a84089.dyn.optonline.net] has quit [Client closed the connection]
23:41 cpux [Moo@Nightstar-20a84089.dyn.optonline.net] has joined #code
--- Log closed Wed Apr 21 00:00:11 2010
code logs -> 2010 -> Tue, 20 Apr 2010< code.20100419.log - code.20100421.log >