code logs -> 2015 -> Sat, 13 Jun 2015< code.20150612.log - code.20150614.log >
--- Log opened Sat Jun 13 00:00:20 2015
01:17 Derakon[AFK] is now known as Derakon
02:17 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: ]
02:20 Derakon is now known as Derakon[AFK]
02:23 catadroid [catalyst@Nightstar-bh3nnt.dab.02.net] has joined #code
02:24 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has joined #code
02:24 mode/#code [+o Vash] by ChanServ
03:16
<@simon`>
in C#, I'd like to use a struct for passing the state of a state machine that operates using a recursive function. is there a way to refer to an existing struct but vary one of its properties to produce a new value?
03:37
<&McMartin>
I'd probably clone it then assign the property.
03:46
< khyperia>
simon`, like create a new copy of the struct but don't change the original? Or what?
03:47
<@simon`>
yeah, like Haskell's record syntax.
03:47
< khyperia>
Ah, no. You have to write such a function yourself. It's a common pattern (and might be built-in in C#7 or C#8), but yeah, no current syntax.
03:47
<@simon`>
data Foo = Foo { foo :: Int, bar :: String }; x = Foo 42 "Hello"; y = x { foo = 43 }
03:48
<@simon`>
okay. shoot.
03:48
< khyperia>
usually how I do it is have a constructor that takes another struct of the same type, then have "Struct WithX(int x) { return new Struct(this) { x = x }; }"
03:48
< khyperia>
but that makes the field not be readonly, which is dum
03:48
< khyperia>
although can improve performance in wonky edge cases
03:49
<@simon`>
I suppose with native support you get the advantages of immutability.
03:49
<@simon`>
like, less copying.
03:49
< khyperia>
well, your haskell example, y is a complete copy of x, same amount of copying
03:49
<@simon`>
oh, wait... struct fields are packed and are not pointers...
03:49
<@simon`>
nah
03:50
<@simon`>
I suppose it depends on the exact datatype definition. if there are any pointers, two values can share sub-structures.
03:50
< khyperia>
yes, true
03:51
< khyperia>
also if you have random questions about C#, feel free to poke me, I'm actually on the compiler team at MS.
03:52
<@simon`>
haha, ok.
03:53
< khyperia>
well, just an intern, but still :)
03:53 catadroid` [catalyst@Nightstar-5f4c9l.dab.02.net] has joined #code
03:54
<@simon`>
that's still pretty awesome. :)
03:55 catadroid [catalyst@Nightstar-bh3nnt.dab.02.net] has quit [Ping timeout: 121 seconds]
04:00
< ToxicFrog>
Argh, what kind of machine defaults to not having git or mlocate installed
04:00
<@simon`>
I'd expect to have to install git myself.
04:01
<@[R]>
ToxicFrog: FreeNAS
04:01
<@[R]>
Seriously, what fucker decided that a /NAS/ didn't need locate?
04:02
<@[R]>
It doesn't just lack mlocate, it lacks /any/ locate.
04:04
<@simon`>
does it have find?
04:05
<@[R]>
Not GNU find.
04:05
<@[R]>
AFAICT the find it ships understands the argument to scan a directory other than the CWD and no other.
04:20 Alek [omegaboot@Nightstar-03ja8q.il.comcast.net] has quit [Ping timeout: 121 seconds]
04:22
<@simon`>
so there's no -name, -iname etc. parameters?
04:23
<@simon`>
does it have grep then?
04:23 * simon` heads home to sleep.
04:23
<@simon`>
goodbye!
04:23 simon` [simon@Nightstar-a7j18s.static.netgroup.dk] has quit [[NS] Quit: Leaving]
04:26
<@[R]>
Yeah it's got grep
04:27
<@[R]>
Its find is horribly slow though, so I honestly just `find > .list.txt` then grep that.
04:27
<@[R]>
Since I don't add/remove stuff from it that often it works fine.
04:27 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
04:28 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
04:28 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
04:44 Alek [omegaboot@Nightstar-03ja8q.il.comcast.net] has joined #code
04:44 mode/#code [+o Alek] by ChanServ
05:52 NSGuest32673 is now known as ^Xires
05:53 Derakon[AFK] is now known as Derakon
06:01 Kindamoody[zZz] is now known as Kindamoody
06:03 ^Xires is now known as Xires
06:05 macdjord|slep is now known as macdjord
06:10
<@macdjord>
Hrm. A newbie programmer is asking for advice on what language to do a project in. Python is out, because the project is expected to be too resource-intensive for an interpreted language. C/C++ is out, because /fuck/ doing manual memory management in this day and age. Java is out, because it is a terrible language to learn programming in. So, what's a good compiled memory-managed language for a new programmmer?
06:11
<&McMartin>
Given the constraints you have listed, C# is the only one left.
06:11
<&McMartin>
However, I would not be so hasty as to discount Python, particularly if standard extensions are available.
06:11
<&McMartin>
Depending on the nature of the resource, Numpy or Pygame may close the gap.
06:12
<@macdjord>
What's C# like? I've never touched it.
06:12
<@macdjord>
And the project in question is a Dwarf Fortress Style intensive simulation.
06:13
<~Vornicus>
Why is a newbie programmer doing intensive simulation
06:14
<&McMartin>
C# is like Java but with several more iterations of refinement and a better VM.
06:14
<@macdjord>
And - I've heard of 'Pygame', but I don't know anything about it. From context, I'm guessing it's a bunch of game-useful functions implemented in fast C/C++, with Pything bindings?
06:15
<@Checkmate>
Knowing nothing of the properties of Lua, is it an option?
06:15
<@macdjord>
Vornicus: Because that is what he wants to do. The fact that he's a newbie is only relevent in that it excludes Java from the options.
06:16
<&McMartin>
Lua is more interpreted than Python
06:16
<&McMartin>
If you're going to actually seriously do an intensive simulation I'd say "you're stuck with C/C++" but it is worth noting that KSP is written in C# since it's Unity
06:17
<&McMartin>
If they have literally never written a program before, they should consider taking on a project they can actually finish
06:17
<@[R]>
<macdjord> What's C# like? I've never touched it. <-- it's an MSified Java. (Bear in mind MS understood that providing a good API was key to everything)
06:18
<&McMartin>
Until recently I'd also say "it addresses Java's glaring design flaws as well" but Java 8 is actually out now so there's more parity
06:19
<&McMartin>
If your idea of a glaring design flaw is "it requires you to use objects, classes, and namespaces", the problem domain requires that so this is not a disadvantage
06:19
<&McMartin>
My suggestion would be "python probably isn't out; maybe start with thousands of elements instead of hundreds of millions."
06:20
<&McMartin>
And if Python was good enough for Civ IV, years ago, a newbie will make do
06:23
<&Derakon>
Yeah honestly they are not going to make it to the scale that DF does without a lot more learning first, so performance is like their #last concern, not their #first.
06:23
<&Derakon>
This is the epitome of premature optimization.
06:23
<@macdjord>
<McMartin> If you're going to actually seriously do an intensive simulation I'd say "you're stuck with C/C++" but it is worth noting that KSP is written in C# since it's Unity
06:23
<@macdjord>
Again - we're talking 'Dwarf Fortress', not 'nuclear modeleing', so the requirement is 'compiled language', not 'every cycle counts'.
06:24
<&Derakon>
My suggestion then would be to prototype everything in Python, find the bits that are slow, and rewrite just those bits in C using Python's ctypes library to speak with the compiled language.
06:25
<&Derakon>
And that way you get to write all of the stuff that only runs a few hundred times per tick in an actually pleasant language, while the probably-very-simple bits that run millions of times per tick can be in a compiled language.
06:25
<&Derakon>
But first you prototype said millions-of-times bits in Python so you can get the behavior right.
06:26
<&Derakon>
Seriously, in this day and age if you are learning programming by writing a program from scratch and you are not using a scripting language, You Are Doing It Wrong.
06:26
<&McMartin>
And while we're at it
06:26
<&Derakon>
You have to learn to program before you can learn to program efficiently, there's approximately kabillion lessons between the newbie and actual performance problems that could be solved by changing languages.
06:26
<&McMartin>
Either Python is a compiled language, or Java isn't.
06:27
<&Derakon>
Anyway. Bedtime.
06:27 Derakon is now known as Derakon[AFK]
06:27
<@macdjord>
Night!
06:27
<&Derakon[AFK]>
Night.
06:27
<&McMartin>
(C# isn't a bad choice though, I don't think, other than that I bet we won't be able to help much here; but I've been poking at it as part of poking at Unity and I'm pretty happy with what I see)
06:27 Checkmate [Z@Nightstar-pdi1tp.customer.tdc.net] has quit [Ping timeout: 121 seconds]
06:29
<@macdjord>
Okay. Sounds lke the concensus is 'C#, or Python with the resource-intensive bits exiled to C after they are working.'
06:29
<@macdjord>
I'll pass that on.
06:31
<&McMartin>
Some of your qualms re: Java will apply to C#.
06:31
<&McMartin>
Note that some of your qualms may be misplaced.
06:31
<~Vornicus>
Personally qualm #1 is "you're going to build what."
06:32
<&McMartin>
This is less that than it often is
06:32
<&McMartin>
It does not, for instance, involve solving the natural language or computer vision problems.
06:32
<~Vornicus>
hahaha, that is the truth, at least.
06:33
<&McMartin>
In particular, it is "as hard as you want it to be", and so one can stop at any point
06:33
<&McMartin>
The whole problem with DF is that the author does not know how~
06:40
<&McMartin>
As for moderate-level simulation, I have "evolved, emergent behavior" sims from early-90s BASICs.
06:59
<@celticminstrel>
C++ doesn't require manual memory management,
06:59
<@celticminstrel>
Provided you use shared_ptr and such.
07:01
<&McMartin>
There's still no mark-and-sweep, and C++ has enough spiders in it that I would hesitate to teach it as a first language
07:01
<&McMartin>
If only because at some point they're going to discover std::forward, not to mention unique_ptr and std::sharable_from_this
07:01
<@celticminstrel>
As for pygame, if I'm not mistaken, it's basically SDL for Python. (Also, I found it impossible/difficult to install when I tried ages ago.)
07:02
<&McMartin>
It's got more than just that, but it's not quite to the level of, say, Love2D.
07:02 * celticminstrel also dislikes SDL in general. Probably because it's a C library.
07:02
<&McMartin>
But yes, if the system-level thing you are doing is "I need a framebuffer"
07:02
<&McMartin>
It will have you covered.
07:03
<&McMartin>
SDL2 is... different, and bears Valve's fingerprints on it rather prominently.
07:03
<@celticminstrel>
Oh?
07:03
<&McMartin>
(As it was they who pretty much forced the project to completion after hiring the primary developers.)
07:03
<&McMartin>
SDL is built around the assumption that you have a big old bag of pixels and you would like to set some of those pixels to be various colors.
07:04
<&McMartin>
SDL2 is built around the assumption that there's a GPU that's rendering a screen and you'd like to perform 2D-related tasks in that vein.
07:04
<&McMartin>
In practice, this often means that BlitSurface is going through a separate renderer object after you load it and "freeze" your SDL_Surface into a renderable object
07:04
<&McMartin>
But the endpoint is that AmigaOS is no longer supported but Android and iOS are.
07:05
<&McMartin>
But yes, the first major deployment of SDL2 was, um
07:05
<@celticminstrel>
Does anyone even still use Amiga?
07:05
<&McMartin>
Team Fortress 2 for Linux
07:05
<&McMartin>
Well, sure, I've got a Commodore 128 right here~
07:06
<&McMartin>
More seriously, AmigaOS development proceeded for quite a long time and it outlived BeOS
07:06
<&McMartin>
We got actual bug reports against it in UQM 0.3
07:06
<@celticminstrel>
Oh wow.
07:06
<@celticminstrel>
Though I don't know how long ago that actually was.
07:06
<&McMartin>
(Gateway bought the rights to Amiga after CBM went under and ported it to Intel)
07:06
<&McMartin>
Around when HL2 came out. :)
07:06
<&McMartin>
speaking of Valve
07:07
<&McMartin>
(So, maybe 10 years ago)
07:07
<&McMartin>
But yeah, IIRC the Amiga 500 was introduced nearly 30 years ago, and was one of the seriously-ahead-of-its-time desktop environments
07:08
<&McMartin>
They ultimately lost to the Macintosh, but it was hard-fought.
07:08
<&McMartin>
But yeah, the Amiga Workbench was a Really Big Deal, and that's a whole chapter of computing I know nothing about, because I was an MS-DOS kid
07:09
<&McMartin>
Well. An MS-DOS teen. I was a C64 kid. :)
07:13 * Vornicus was a c64 kid and a mac teen and a windows grownup
07:13
<~Vornicus>
oh and a linux stupid college student
07:13
<@macdjord>
mac kid, windows teen-to-present
07:13
<@celticminstrel>
Mac forever! But now I have Windows as a secondary.
07:14
<@macdjord>
I prefer to /develope/ in Linux, of course, but for day-to-day, too much of my stuff is Windows only not to use it as my primary.
07:15
<@celticminstrel>
I do also have a Linux, but it hasn't seen much use.
07:15
<@macdjord>
I was real disappointed when I hit Uni and used a Mac for the first time in years. I had previously only used Moc OS System 7, and it seemed like OSX had lost everything I liked about it while still being different enough from Windows to be awkward.
07:16
<@celticminstrel>
It's true it has lost a few things...
07:17 * abudhabi uses Linux for everyday stuff and Windows for gaming.
07:18
<@macdjord>
I'm honestly not sure /what/ those things I missed were, anymore - it's been 7 years since then. and 15 since my prior Mac experiance.
07:18
<@celticminstrel>
Bed.
07:19 celticminstrel [celticminst@Nightstar-uelp1m.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
07:39 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
07:57 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has quit [Ping timeout: 121 seconds]
09:08 catadroid` [catalyst@Nightstar-5f4c9l.dab.02.net] has quit [Ping timeout: 121 seconds]
09:12 Kindamoody is now known as Kindamoody|afk
10:24 kourbou_ [kourbou@Nightstar-deqg8j.fbx.proxad.net] has joined #code
10:24 kourbou_ is now known as kourbou
10:47 * TheWatcher readsup
10:50
<@TheWatcher>
My path was pretty much ZX81 -> ZX Spectrum -> Amiga 500 -> Amiga 1200 -> Amiga 1200 dual booting PowerPC linux -> intel PC with linux -> and then pretty much wehre I am today: some machines running linux, being connected to by, and exporting their displays to, windows machines running Cygwin.
10:51
<@TheWatcher>
Oh, wiht SPARC stations at the same time as the 1200 when I was at uni.
12:08 catadroid [catalyst@Nightstar-bil2u1.dab.02.net] has joined #code
13:01 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
13:03
<&ToxicFrog>
I missed all the ZX/Commodore/Amiga minicomputer stuff and went serial terminal attached to SysV -> X terminal ditto -> switch from Motorola to x86 chips -> from SysV to SCO -> from SCO to Linux
13:23 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
13:35 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [Connection closed]
13:57 kourbou [kourbou@Nightstar-deqg8j.fbx.proxad.net] has quit [[NS] Quit: Tip about keeping secrets: It's easier if you don't know them.]
15:33 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
16:03 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
16:03 mode/#code [+o Syloq] by ChanServ
16:51 celticminstrel [celticminst@Nightstar-uelp1m.dsl.bell.ca] has joined #code
16:51 mode/#code [+o celticminstrel] by ChanServ
16:51 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
16:52 mode/#code [+o Checkmate] by ChanServ
16:58 catadroid [catalyst@Nightstar-bil2u1.dab.02.net] has quit [Ping timeout: 121 seconds]
18:25 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
18:25 mode/#code [+qo Vornicus Vornicus] by ChanServ
19:13 mac [macdjord@Nightstar-r9vt2h.mc.videotron.ca] has joined #code
19:13 mode/#code [+o mac] by ChanServ
19:15 macdjord [macdjord@Nightstar-r9vt2h.mc.videotron.ca] has quit [Ping timeout: 121 seconds]
19:29 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has joined #code
19:29 mode/#code [+o Vash] by ChanServ
20:11
<@celticminstrel>
It's kinda nice that TextWrangler can open a tgz and let me view the files inside, but it'd be even nicer if it could save changes. I suppose that'd be pretty difficult though.
20:12
<@[R]>
Depends on the changes.
20:13
<@celticminstrel>
Well, it would have to rewrite the entire archive to save changes.
20:14
<@[R]>
Know what would be fucking award winning? A multi-archive compressor/decompressor that realizes that we don't want the .tar inside of a .tgz/tbz/tbz2/txz.
20:14
<@celticminstrel>
(If it was just a tar, you might be able to get away with seek-and-write.)
20:14
<@celticminstrel>
The decompressors I use automatically decompress tgz straight to a folder.
20:14
<@[R]>
Which ones?
20:15
<@[R]>
Winrar, winzip, 7zip all do a "okay, here's the .tar now"
20:15
<@[R]>
tar's the only thing that does the right thing (tm)
20:16
<@celticminstrel>
I'm not quite sure if 7-zip does it, but the built-in Mac one does, and so does The Unarchiver for Mac. (But The Unarchiver fails on my .boes files, giving me an extensionless tar archive.)
20:16
<@celticminstrel>
(This is weirdly one place where the built-in one is better.)
20:22
<@froztbyte>
<[R]> Know what would be fucking award winning? A multi-archive compressor/decompressor that realizes that we don't want the .tar inside of a .tgz/tbz/tbz2/txz.
20:23
<@froztbyte>
hageshii% mkdir asd
20:23
<@froztbyte>
hageshii% dd if=/dev/urandom of=asd/a bs=10M count=1
20:23
<@froztbyte>
1+0 records in
20:23
<@froztbyte>
1+0 records out
20:23
<@froztbyte>
10485760 bytes (10 MB) copied, 0.693914 s, 15.1 MB/s
20:23
<@froztbyte>
hageshii% apack asd.tgz asd; rm -rf asd
20:23
<@froztbyte>
asd/
20:23
<@froztbyte>
asd/a
20:23
<@froztbyte>
hageshii% file asd.tgz
20:23
<@froztbyte>
asd.tgz: gzip compressed data, last modified: Sat Jun 13 21:23:04 2015, from Unix
20:23
<@froztbyte>
hageshii% aunpack asd.tgz
20:23
<@froztbyte>
asd/
20:23
<@froztbyte>
asd/a
20:23
<@froztbyte>
asd.tgz: extracted to `asd'
20:23
<@froztbyte>
hageshii% gzip -d asd.tgz
20:23
<@froztbyte>
hageshii% file asd.tar
20:23
<@froztbyte>
asd.tar: POSIX tar archive (GNU)
20:24
<@froztbyte>
sorry, that should've been pastebinned
20:24
<@froztbyte>
all in a package called `atool`
20:24
<@froztbyte>
enjoy
20:24
<@[R]>
<3
20:24
<@[R]>
Does it handle .zip, .rar and .7z as well?
20:24
<@celticminstrel>
7-zip actually complains about the tars in my .boes.
20:24
<@celticminstrel>
It can handle them anyway, but it puts up some sort of error.
20:25
<@froztbyte>
[R]: a ton of formats
20:26
<@froztbyte>
it's got a little discovery/nameformat-parse routine
20:26
<@celticminstrel>
Does it work by header as well as by extension?
20:26
<@celticminstrel>
(Not that I need it personally, the tools I have work pretty well.)
20:26
<@[R]>
"atool identifies archives by their file extension. Sometimes this is not possible - for instance rar archives usually have varying numeric file extensions. In those cases when atool can't identify the format, file is used instead. (atool can be configured not to use file.)"
20:26
<@[R]>
From Savana.
20:27
<@froztbyte>
xz, ace, lzip/lrzip/l*zip, dpkg debs, jars, arc/arj/..., at a glance
20:27
<@celticminstrel>
Works.So yes.
20:27
<@[R]>
jar == zip
20:27
<@froztbyte>
pretty sure it's just by extension
20:27
<@froztbyte>
oh, metadata too
20:27
<@froztbyte>
nice
20:27
<@celticminstrel>
I meant to delete the first word, whoops.
20:27
<@froztbyte>
well, there you go then
20:27
<@[R]>
It fallback's to `file`.
20:27
<@celticminstrel>
So it can unpack a .uqm or something without changing the extension.
20:31
<@celticminstrel>
(Or a .boes)
21:01
<&McMartin>
I didn't actually realize that anyone other than 7zWin did the "Oh, surely you meant you wanted this .tar file" thing
21:03
<@[R]>
p7z is the same yeah
21:03 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
21:03
<@[R]>
That behavior's actually why I don't compress any small .tar that's likely to hit a Windows box.
21:12 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
21:28 celticminstrel [celticminst@Nightstar-uelp1m.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
21:28 celticminstrel [celticminst@Nightstar-uelp1m.dsl.bell.ca] has joined #code
21:28 mode/#code [+o celticminstrel] by ChanServ
21:57 Checkmate [Z@Nightstar-pdi1tp.customer.tdc.net] has joined #code
21:57 mode/#code [+o Checkmate] by ChanServ
22:05 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
22:05 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
22:21 mac is now known as macdjord
22:26 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
22:38 Derakon[AFK] is now known as Derakon
22:39 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: ]
23:27 catadroid [catalyst@Nightstar-kc6e78.dab.02.net] has joined #code
23:27 catadroid` [catalyst@Nightstar-sg8r5k.dab.02.net] has joined #code
23:29 Kindamoody|afk is now known as Kindamoody
23:31 catadroid [catalyst@Nightstar-kc6e78.dab.02.net] has quit [Ping timeout: 121 seconds]
23:32 catadroid` is now known as catadroid
23:39 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
23:39 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
23:49 Kindamoody is now known as Kindamoody[zZz]
--- Log closed Sun Jun 14 00:00:34 2015
code logs -> 2015 -> Sat, 13 Jun 2015< code.20150612.log - code.20150614.log >

[ Latest log file ]