code logs -> 2013 -> Mon, 06 May 2013< code.20130505.log - code.20130507.log >
--- Log opened Mon May 06 00:00:47 2013
00:14 You're now known as TheWatcher[T-2]
00:20 You're now known as TheWatcher[zZzZ]
00:20 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Client closed the connection]
00:20 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
00:51 himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code
00:51 mode/#code [+o himi] by ChanServ
01:16 Derakon[AFK] is now known as Derakon
01:39
<&McMartin>
http://bigocheatsheet.com/
01:52 RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
02:16
< sshine>
McMartin, I just saw that sheet a couple of hours ago. is there a reason you link to it?
02:16
<&McMartin>
I felt it might be of general interest
02:24
< sshine>
right. it's pretty neat.
02:26
<@Reiv>
I complain that the Data Structures specifies O(logn) as good as O(1) when there is no 'fair' result on that column anyway
02:29
<&ToxicFrog>
What? No it doesn't.
02:29
<&ToxicFrog>
Oh wait wrong chart
02:33
<@gnolam>
Reiv: ?
02:46 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
03:07 AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has joined #code
03:12 Derakon is now known as Derakon[AFK]
03:13
<~Vornicus>
74447y66666666y vvvf
03:14
<@Azash>
I, for one, welcome our new feline overlords
03:15
< AverageJoe>
hi Haeroe
03:15
<@Azash>
Sup AJ
03:17 * McMartin mutters as he attempts to modify some old code to instead dump prettily-formatted JSON.
03:18
<@Azash>
McMartin: You mean prettily formatted as in readable?
03:19
<&McMartin>
Also nicely vertically lined up and with lines that are a bit short
03:19
<@Azash>
Hm
03:20
<&McMartin>
Before it just printed stuff out in tables
03:20
<&McMartin>
So making it be technically legal JSON would be pretty easy, but I'd like it to, you know, look good.
03:21
<&McMartin>
Context: Ten years ago I designed a mesh format based on IFF. I want to turn it into JSON so that I can write viewers in WebGL.
03:21
<@Azash>
What language are you working in?
03:22
<&McMartin>
C, because that's what the original code was in and it's easier to just adapt that than write a new file parser &c
03:23
<@Azash>
Hm..
03:24
<&McMartin>
This isn't *difficult
03:24
<@Azash>
I can't think of any ways that aren't painful, sorry
03:24
<&McMartin>
*
03:24
<&McMartin>
It's just a matter of counting spaces.
03:24
<&McMartin>
The mesh format was pretty rigid.
03:24
<&McMartin>
And I don't have to *parse* JSON later.
03:27 Arsonist [NSwebIRC@5E691D.2E3702.5A8720.190CB5] has joined #code
03:27
< Arsonist>
do I have to do strcpy to take a pointer to a string and get it into a character array? (in C)
03:27
< Arsonist>
I'm new to C, so I'm not sure if that even makes sense
03:27
<&McMartin>
It almost makes sense.
03:27
< Arsonist>
yay :)
03:27
< Arsonist>
what part doesn't?
03:28
<&McMartin>
You used the word "string"~
03:28
< Arsonist>
err yeah
03:28
< Arsonist>
ok, a pointer to a character
03:28
<&McMartin>
I think the question is thus... "Do I have to do strcpy to take a pointer to a character array and copy those characters into some other character array?"
03:28
<&McMartin>
The answer there is "mostly, yes"
03:28
<&McMartin>
There are two caveats
03:29
<&McMartin>
(a) This assumes the string is known to be null-terminated and smaller than your target array.
03:29
<&McMartin>
(b) This assumes the string contains no other nulls.
03:29
< Arsonist>
nice
03:29
< Arsonist>
glad I assumed those :)
03:29
< Arsonist>
thanks for the help!
03:29
<&McMartin>
Caveat (a) is actually a huge problem, and you are well advised to use strncpy instead.
03:30
< Arsonist>
ah, I'm assuming the n is max length?
03:30
<&McMartin>
Caveat (b) is often less important, but when it matters, memcpy is the way to go
03:30
<&McMartin>
Kinda
03:30
<&McMartin>
It's the size of the buffer, but it will not actually set the terminator for you
03:30
<&McMartin>
So...
03:30
<&McMartin>
char foo[BUFSIZ];
03:30
< Arsonist>
so I'd still need to set the null char at the end if it's longer?
03:30
<&McMartin>
strncpy(foo, s, BUFSIZ);
03:30
<&McMartin>
foo[BUFSIZ-1] = 0;
03:30
<&McMartin>
That'll do it
03:31
< Arsonist>
nice
03:31
<&McMartin>
You can just force-set the last element, that's always right
03:31
<&McMartin>
It'll copy the null if there's room
03:31
<&McMartin>
Your timing is good
03:31
<&McMartin>
I have to take off now, but string messiness in C is something I'm doing in the other window *right now*.~
03:31 * McMartin ducks out for a bit
03:31
< Arsonist>
You're the most helpful person I've ever met on IRC
03:31
< Arsonist>
straightforward and to the point
03:34 Kindamoody[zZz] is now known as Kindamoody
03:41 xxXxxXxx [dan@5E691D.2E3702.5A8720.190CB5] has joined #code
03:41 Arsonist [NSwebIRC@5E691D.2E3702.5A8720.190CB5] has quit [[NS] Quit: Page closed]
03:42 syksleep is now known as Syk
03:49 AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has quit [Ping timeout: 121 seconds]
04:03
<&McMartin>
Ok, I think I've got it.
04:05 Derakon[AFK] is now known as Derakon
04:07
<&McMartin>
https://hkn.eecs.berkeley.edu/~mcmartin/ascii_ships.txt
04:08
<@Azash>
Nice
04:18 cpux [cpux@Nightstar-98762b0f.dyn.optonline.net] has quit [Client closed the connection]
04:19 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
04:32 Derakon_ [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
04:35 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
04:36 Derakon_ is now known as Derakon
04:36 mode/#code [+ao Derakon Derakon] by ChanServ
04:41 Turaiel [Brandon@Nightstar-7dc8031d.mi.comcast.net] has joined #code
04:59 Kindamoody is now known as Kindamoody|out
05:15
< mac>
anybody know how to send an array of objects to a function?
05:15
<@Azash>
What language?
05:16
< mac>
c++
05:17
<~Vornicus>
An array is a pointer is an array.
05:17
<@Azash>
^
05:17 * Turaiel facepalms
05:17
< Turaiel>
Maaaac.
05:17
<@Azash>
Have the function accept an object pointer
05:17
<~Vornicus>
Unfortunately, arrays don't have any way to detect the size.
05:17
<~Vornicus>
So you'll have to pass that in separately.
05:18
<~Vornicus>
I'm not entirely sure what drugs the creators of C/C++ were on when they thought htat was a good plan.
05:18
<@Azash>
Oh, arrays aren't null-terminated?
05:18 * Azash is not a C++ person
05:18
< Turaiel>
Noep.
05:18
< Turaiel>
Except argv.
05:18
<@Azash>
You'd have thought that was high up on Stroustrup's list
05:19
<~Vornicus>
Null termination sucks too
05:19
< Turaiel>
It's understandable that K&R and ANSI C arrays are not null terminated. Space was of the essence. I'd expect at least something to the effect in C99 and C++ though.
05:20
< Turaiel>
The world is not perfect, however.
05:20
< Turaiel>
Well, maybe in the later versions of C++...
05:21
< Turaiel>
I didn't realize it was as old as it is.
05:29 xxXxxXxx is now known as Arsonist
06:13 ErikMesoy|sleep is now known as ErikMesoy
06:28 Syk [the@Nightstar-9533f290.iinet.net.au] has quit [Ping timeout: 121 seconds]
06:33 Derakon is now known as Derakon[AFK]
06:56
<&McMartin>
21:16 <@Azash> You'd have thought that was high up on Stroustrup's list
06:56
<&McMartin>
std::vector is your criend
06:56
<&McMartin>
*friend
06:56
<&McMartin>
As is const std::vector&, which is a pointer to a sized array that you can't mess with.
07:06 * Vornicus pokes at this code. Why is he encoding and decoding integers instead of using simple tuples, which are trivial to unpack
07:19 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
07:21 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
07:21 mode/#code [+qo Vornicus Vornicus] by ChanServ
07:22 himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds]
07:44 Syk [the@Nightstar-73b8b699.iinet.net.au] has joined #code
07:45 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [Connection reset by peer]
07:54 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
07:54 mode/#code [+qo Vornicus Vornicus] by ChanServ
08:00 Turaiel is now known as Turaiel[Offline]
08:32
<&jerith>
I am insane: https://github.com/jerith/claypellet
08:38
<@froztbyte>
jerith: I recommend you indicate what "current" is for the CFFI part
08:38
<@froztbyte>
so that when the info page gets stale, people don't wonder
08:46 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has quit [Connection closed]
08:47
< jeroud_>
froztbyte: Anything newer than yesterday afternoon will do.
08:53
<@froztbyte>
jeroud_: but 3 months down the line I'd need to check the commit date for the readme, and -devel might be broken in some other fashion then
08:53
<@froztbyte>
that's more the situation I was alluding to
08:54
<&jerith>
froztbyte: arigato and fijal don't habitually have broken code in their dev branches.
08:55
<&jerith>
But now, to work.
09:07 Chutzpah [Moltare@583787.FF2A18.190FE2.4D81A1] has quit [Client closed the connection]
09:13 Chutzpah [Moltare@583787.FF2A18.190FE2.4D81A1] has joined #code
09:24 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
09:36 You're now known as TheWatcher
10:03 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
10:03 mode/#code [+o himi] by ChanServ
10:06
<@froztbyte>
http://repos.e-x-a.org/view.cgi/rash/
10:39 thalass [thalass@C2A270.1179B7.313116.5683D7] has joined #code
12:25 thalass [thalass@C2A270.1179B7.313116.5683D7] has quit [[NS] Quit: Leaving]
12:25 thalass [thalass@C2A270.1179B7.313116.5683D7] has joined #code
13:29 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
13:35 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
13:48 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
13:48 mode/#code [+o himi] by ChanServ
14:15 thalass [thalass@C2A270.1179B7.313116.5683D7] has quit [[NS] Quit: flargle]
14:18 froztbyte [froztbyte@Nightstar-dc394964.za.net] has quit [Operation timed out]
14:21 froztbyte [froztbyte@Nightstar-dc394964.za.net] has joined #code
14:21 mode/#code [+o froztbyte] by ChanServ
14:58 ToxicFrog is now known as ToxicFrog|W`rkn
16:10 ErikMesoy [Erik@A08927.B4421D.403BAA.818DC8] has left #code []
16:44 Tarinaky_ [tarinaky@Nightstar-dd7e4a05.net] has joined #code
16:44 Tarinaky_ [tarinaky@Nightstar-dd7e4a05.net] has quit [[NS] Quit: leaving]
16:48 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
16:48 mode/#code [+ao Derakon Derakon] by ChanServ
16:51 Derakon[AFK] [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
17:29 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
17:29 mode/#code [+o celticminstrel] by ChanServ
17:50 Syk is now known as sykslep
17:59 RichyB [richardb@58734C.5279B7.EA7DF8.107330] has joined #code
19:17 jeroud_ is now known as jeroud
19:50
<&ToxicFrog|W`rkn>
...
19:50
<&ToxicFrog|W`rkn>
There is an entry in the bugtracker titled "unspecified leek-based catastrophe"
19:51
<@Azash>
Is that a memory leek or a TOR problem?
19:53 * Tamber ties a specimen of Allium Ampeloprasum to TF.
19:57 Kindamoody|out is now known as Kindamoody
20:19 Kindamoody is now known as Kindamoody[zZz]
21:34 sykslep [the@Nightstar-73b8b699.iinet.net.au] has quit [Ping timeout: 121 seconds]
21:44 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
21:44 mode/#code [+qo Vornicus Vornicus] by ChanServ
21:51
<@froztbyte>
http://www.alexstjohn.com/WP/2013/04/29/found-directx-time-capsule/
21:56
<@gnolam>
"Direct3D would never have been necessary to create if it weren't for the inter-group rivalry between Windows95 and WindowsNT that caused the NT group to refuse to share their OpenGL license with the Windows95 team."
21:58
<@froztbyte>
it's kinda awesome to see someone write frankly about all these components
21:59
<@froztbyte>
and to know that they are, in fact, as god-awfully terrible as they've always impressed people with being
21:59
<@froztbyte>
(and have just as terrible a lineage)
22:01
<@froztbyte>
I recall first struggling with COM stuff being broken when I was 11 or so
22:01
<@froztbyte>
maybe even younger
22:01
<@froztbyte>
win95 desktop that had gone retarded
22:01
<&McMartin>
COM is an attempted solution to a problem with no good solutions >_<
22:02
<@froztbyte>
I had 0 clue about /anything/ programming related and it seemed like a very rickety pile of fail
22:40
<&ToxicFrog|W`rkn>
For a minute there I thought you were talking COM as in windows/dos serial port jackassery and was very confused
22:40
<@froztbyte>
haha
22:40 ToxicFrog|W`rkn is now known as ToxicFrog
22:52
<&McMartin>
That COM is no better or worse than any other solution involving serial ports, which is admittedly pretty bad~
22:52 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
22:53
<@froztbyte>
I recently had some slight adventure with code on windows
22:53
<@froztbyte>
was trying to write some twisted (as in, the python framework) code that would interact with a serial port on windows
22:53
<@froztbyte>
later we decided that windows is just a crappy way to run the base system (for networking and whatnot), reloaded it with linux and put the windows in a VM
22:54
<@froztbyte>
so fortunately that problem was entirely shitcanned
22:54
<@froztbyte>
but holy shit was that painful and full of dumb spiders :/
22:54
<&McMartin>
Did the Linux code also have to work with the serial port?
22:54
<@froztbyte>
getting it going well in linux was literally a couple of seconds of work
22:54
<@froztbyte>
McMartin: yeah
22:54
<@froztbyte>
identical system
22:55
<&McMartin>
Huh. What was the difference?
22:55
<@froztbyte>
I literally just had to spend a couple of seconds tweaking the existing code, updated the character device info of where twisted would have to find the port, and tada
22:55
<&McMartin>
Do the Linux drivers sneak in error correction, or
22:55
<@froztbyte>
McMartin: combination of reactor differences and code+documentation in various stages of migration to the new endpoints-based architecture that twisted is moving to
22:56
<&McMartin>
Aha, OK, so, twisted-specific
22:56
<@froztbyte>
yes, somewhat
22:56
<&McMartin>
(I've only touched serial devices in kernel code, which is spiderful, but, well)
22:56
<@froztbyte>
I did investigate the python serial module a bit too
22:56
<@froztbyte>
and it seems that even there I may have had some specific pain points
22:56
<@froztbyte>
but didn't end up testing it
22:57
<@froztbyte>
but...yeah
22:57
<@froztbyte>
serial devices are really a shitton easier to deal with in linux
22:57 * McMartin nods
22:57
<@froztbyte>
the 'everything is a file' thing works bloody wonders for treating serial as a character device
22:58
<@froztbyte>
and I think that by and large, most RS232 sort of things are extremely well-supported, or using the barest of functionality to get by
22:58
<&McMartin>
Yeah
22:58
<@froztbyte>
in the "8n1, baud, off you go" sense
22:58 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
22:58
<@froztbyte>
RS485 is a bit more exotic
22:58
<&McMartin>
The issue I ran into, IIRC, is that some serial ports would drop characters if you weren't careful about it
22:58
<@froztbyte>
yeah
22:59
<@froztbyte>
there's a bit of signalling and synchro crap you can run into
22:59
<@froztbyte>
but that's the usual controller/hardware issue with this stuff
23:00
<@froztbyte>
(I know we have some people in channel who do spend a lot more of their time dealing with these things, so I just want to make it clear that I by no means claim to be an expert on this topic, just know enough to get by reasonably painlessly for most of my uses)
23:00
<&McMartin>
Yeah
23:00
<&McMartin>
I've also only used this on machines running in VMs
23:00
<@froztbyte>
mmmmmm
23:00
<&McMartin>
And in a VM the virtual serial port is often a literal character stream and life is way, way easier
23:00
<@froztbyte>
that *specific* mode is one I haven't actually tested much
23:01
<&McMartin>
It's ezmode, AIUI
23:01
<@froztbyte>
but I'm fairly certain it breaks some things very particularly
23:01 * McMartin nods
23:01
<&McMartin>
I can just throw stuff at it, though, and then read out of a domain socket, and then victory is mine
23:01
<@froztbyte>
in the sense of the VM emulating a fairly specific piece of hardware, or "reference implementation" perfect hardware
23:01
<@froztbyte>
and then subtle mismatches happen elsewhere
23:02
<@froztbyte>
handoff timings, chip default negotiations, etc
23:02
<@froztbyte>
and because none of these tools are built to be fairly explicit about the stuff...
23:02
<@froztbyte>
McMartin: btw, ttywatcher
23:02
<@froztbyte>
err, I think it was that one
23:03
<&McMartin>
Right
23:03
<&McMartin>
I mean, the code I was writing is always in a VM *when deployed*
23:03
<&McMartin>
So I get to have 'perfect' hardware
23:03
<@froztbyte>
ah yes, ttylog and ttywatcher
23:03
<@froztbyte>
very useful things when reverse engineering some serial :)
23:04
<@froztbyte>
McMartin: ah, cool
23:04
<@froztbyte>
VM-based deployment is an interesting idea
23:04
<@froztbyte>
you get a lot of "here's our software demo" approaches to it
23:05
<@froztbyte>
but I do think there's a place for VM-based shipping on large enough sort of projects
23:05
<@froztbyte>
perhaps especially so in the academic world where people almost universally seem less familiar with the toolchains around
23:05
<&McMartin>
The company I work for uses VM-based deployments as a Desktop-as-a-service kind of thing.
23:06
<@froztbyte>
how so? citrix model, or something else?
23:07
<&McMartin>
We're in some sense one of their competitors. We focus more on central policy control stuff, so we seem to be more popular with guys that do BYOD etc
23:08
<@froztbyte>
hmm
23:08
<@froztbyte>
I don't actually know where you work
23:09
<@froztbyte>
and had for some reason thought you were one of the few people who worked in academia and had clue
23:11
<&McMartin>
I did; I'm at MokaFive now, have been for some time.
23:12
<&McMartin>
Their general story is having the corporate environment be a movable bubble of sorts, so that you have a workable intermediary level between "corporate desktop" and general anarchy
23:12
<&McMartin>
So encrypted VM image is the "transport layer", basically.
23:13 Reiv [NSwebIRC@A3BDC3.5BE3EC.B8847E.5ADB9D] has quit [Ping timeout: 121 seconds]
23:13
<&McMartin>
But it's not the thing being sold the way it was with, say, Pocket ACE
23:13
<@froztbyte>
yeah, I get the model
23:14
<@froztbyte>
and that's exactly the kind of situation I had in mind
23:14
<&McMartin>
Yeah
23:14
<@froztbyte>
"too much effort/cost to try roll it out on all desktops, but customer still wants product" makes VMs a damned good middleground
23:14
<&McMartin>
Yup
23:15
<@froztbyte>
especially with how far the VM tech on commodity hardware has gotten in the last 15 years
23:15
<@froztbyte>
McMartin: so, aside
23:15
<@froztbyte>
have you guys got people bitten by the SDN bug yet?
23:21
<@TheWatcher>
Still Does Nothing?~
23:22
<@froztbyte>
lulz
23:22
<@froztbyte>
Software Defined Networking
23:22
<@TheWatcher>
Aah.
23:22
<@froztbyte>
it's ..... weird
23:22
<@froztbyte>
the tech has a bunch of cool potential
23:23
<@froztbyte>
but I expect to see a hell of a lot of brokenness as a result of morons trying to use it badly
23:23
<@froztbyte>
(in a sense, I expect it might be the "cpanel of networking")
23:23
<@froztbyte>
http://packetlife.net/blog/2013/may/2/what-hell-sdn/
23:23
<@froztbyte>
that said, I need to bail for slep
23:23
<@froztbyte>
\o
23:24
<@TheWatcher>
Ni
23:24
<@froztbyte>
McMartin: do share comments if there are, though, I'll read in the morning :)
23:25 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Client closed the connection]
23:26 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
23:32
<&McMartin>
This stuff seems pretty unfamiliar to me, though I suppose my official position on a lot of it would be "it'd be cool if we seamlessly interoperated with it without having to care"
23:34
<&McMartin>
We have no published products that make a big deal out of this technology as far as I know, but it also feels like it operates at a level "below" us.
23:47 You're now known as TheWatcher[T-2]
23:53 You're now known as TheWatcher[zZzZ]
--- Log closed Tue May 07 00:00:02 2013
code logs -> 2013 -> Mon, 06 May 2013< code.20130505.log - code.20130507.log >

[ Latest log file ]