code logs -> 2015 -> Wed, 25 Mar 2015< code.20150324.log - code.20150326.log >
--- Log opened Wed Mar 25 00:00:28 2015
--- Day changed Wed Mar 25 2015
00:00
<&Derakon>
Man, signals analysis has always made my head hurt.
00:20
<&McMartin>
I can just barely see the contours of grasping digital signal processing, and getting information out of frequency &c from that
00:20
<&McMartin>
Because I accept that Fourier analysis is a thing
00:21
<&McMartin>
But apparently you can embody it physically for analog and that's the part where I lose the plot.
00:21
<&McMartin>
But then wiki implies that the physics is something completely different and that this will have the effect of frequency mod/demodulation.
00:33
<~Vornicus>
From what I understand, you build a circuit where the, uh
00:33
<~Vornicus>
oh, how do I put this
00:33
<~Vornicus>
you can embody second-order differential equations physically with electronic components like capacitors
00:34
< [R]>
Is it technobabble hour?
00:34
<~Vornicus>
well, second-order differential equations with constant coefficients.
00:34
< [R]>
It is!
00:34
<~Vornicus>
No, this is technoactualstuff hour
00:38
<~Vornicus>
and when nothing's happening you get the homogeneous solution which (through conservation of energy) reduces to 0, but then you add a wave and the wave is the heterogeneous component, which gives a different solution, which you can toss at a speaker or whatever
00:39
<~Vornicus>
So then tuning, what you do (usually) is you have a variable resistor
00:40
<~Vornicus>
Which lets you change a coefficient
00:40 * Thalass reads that, goes crosseyed
00:41
<~Vornicus>
Math is amazing
00:42
<@Thalass>
Yes. Modulated signal goes in, goes through the detection circuit, which spits out the sum and difference products, and the one you want is selected for in the filtering. With AM that can happen several times (intermediate frequencies) before what's left is audio and that gets amplified to the speakers. In FM my memory is fuzzy but I think it's a bit more straightforward, hardware wise at least.
00:42
<@Thalass>
To be honest since I've discovered software defined radio I've started to forget the old ways :P
00:42 Thalass is now known as Thalaway
01:46 Thalaway is now known as Thalass
02:52
<&McMartin>
The fact that FM is the more straightforward one from an analog standpoint is one of the things that blows my tiny digital mind
02:57 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
03:01 macdjord|wurk is now known as macdjord
03:09 Alek [omegaboot@Nightstar-03ja8q.il.comcast.net] has quit [Ping timeout: 121 seconds]
03:15 Turaiel[Offline] is now known as Turaiel
03:20
<@Reiv>
McMartin: I understand that AM was simpler from a technology point of view, though?
03:20
<&McMartin>
It was certainly invented first
03:33 Alek [omegaboot@Nightstar-03ja8q.il.comcast.net] has joined #code
03:33 mode/#code [+o Alek] by ChanServ
03:33
<@Thalass>
The components needed to do FM, particularly in the MHz range, weren't really practical until semiconductors were invented.
03:34
<&McMartin>
AM is the one that looks like a giant inductor, right?
03:34
<@Thalass>
You can do AM with thermionic valves! Crazy primative things
03:34
<@Thalass>
The lower the frequency the larger the components, generally, yeah.
03:42 Thalass is now known as Thalasleep
03:44 Thalasleep [thalass@Nightstar-h1qmno.eastlink.ca] has quit [[NS] Quit: Leaving]
03:48
<~Vornicus>
iirc your most efficient transmitting antenna is 1/2 or 1/4 your wavelength. at 800kHz that's, um, 90 or 180 m. at 100MHz it's 0.75 or 1.5 m.
03:53
< Turaiel>
C++ question for you guys, if you're up to it
03:53
<&McMartin>
Fire away
03:53
< Turaiel>
I have a class which is comprised of only static members. The particular members in question are private, and I need to define their initial values in the C++ source
03:53
< Turaiel>
But I segfault when I do that
03:54
<&McMartin>
Is this source you can post?
03:54
< Turaiel>
Not fully
03:54
<&McMartin>
If not I can give general guidelines
03:54
< Turaiel>
An example: Semaphore* SynchConsole::readAvail = new Semaphore("read avail", 0);
03:54
<&McMartin>
That's enough to know.
03:55
<&McMartin>
It is not safe to do any "real" work in static constructors.
03:55
<&McMartin>
They run before the program is properly initialized, in effectively random order, and occasionally fuck up in hilarious ways anyway.
03:55
< Turaiel>
I see. What should I do instead?
03:56
<&McMartin>
There's a general class of techniques that usually gets glossed as "Singleton"
03:56
<&McMartin>
But that's more "reinventing global variables poorly" when done stupidly
03:56
<&McMartin>
This is a little tricky because your fields are apparently all private
03:56
<&McMartin>
So, uh, first, a digression
03:56
<&McMartin>
If all the members are private, what good are they?
03:57
< Turaiel>
There are two public methods
03:57
<&McMartin>
Or is it just the static parts that are private
03:57
<&McMartin>
Ah OK
03:57
< Turaiel>
Everything is static though
03:57
<&McMartin>
OK
03:57
<&McMartin>
Then there are two options here, basically
03:57
<&McMartin>
(a) have a third method to initialize the statics, call it in main()
03:57
<&McMartin>
(b) have calling either of the two methods check to see if everything's been initialized yet, and if not, do so
03:58
<&McMartin>
Note that for (b) you will need some extra synchronization to make sure that the thing is initialized atomically. boost::once is handy for that.
03:58
<&McMartin>
You didn't ask for this, but I'll volunteer it; if everything is static, consider using namespaces instead of classes
03:58
< Turaiel>
a and extra synchronization are out
03:58
< Turaiel>
The assignment calls for a class here
03:59
<&McMartin>
Oh, this is homework
03:59
< Turaiel>
Yeah
03:59
<&McMartin>
Your teachers are lying to you
03:59
< Turaiel>
It's a very /old/ assignment
03:59
< Turaiel>
I don't know if you've heard of the Nachos assignment. It's from 1992.
03:59
<&McMartin>
I am, in fact, aware of NACHOS.
04:00
< Turaiel>
The implementation of this class in particular is fully up to me. There's no skeleton or anything.
04:01
<&McMartin>
Well, beyond the two public methods, it sounds like.
04:01
<&McMartin>
Or, since we're being honest here
04:01
<&McMartin>
the two functions
04:01
< Turaiel>
Those are up to me as well
04:02
< Turaiel>
I'm just following the convention of "if it doesn't need to be public, it shouldn't be"
04:02
<&McMartin>
Why are you using statics, then?
04:02
< Turaiel>
I need to use a class that doesn't need to be instantiated
04:02
< Turaiel>
Because various methods elsewhere use the same console
04:03
<&McMartin>
Define "instantiated" here
04:03
< Turaiel>
I don't want to have an instance of it
04:03
< Turaiel>
I'm essentially trying to make a static class
04:03
<&McMartin>
That's called "a function and some global variables with inaccessible names"
04:03
<&McMartin>
However
04:03
<&McMartin>
http://en.wikipedia.org/wiki/Singleton_pattern
04:03
<&McMartin>
This is my formal answer here
04:04
<&McMartin>
You almost certainly want initialize on demand here
04:04
<&McMartin>
Particularly if attempting to create a mutex at static initialization time crashes the runtime.
04:05
<&McMartin>
SynchConsole::instance()->stuff()
04:05
<&McMartin>
And then instance() always returns the same object, creating it the first time and recycling it the remaining times.
04:05 Derakon is now known as Derakon[AFK]
04:05
<&McMartin>
static initializers in C++ run before main() begins in effectively random order, so you do not get to rely on anything more complex than, like, 2+2 while setting them up.
04:06
< Turaiel>
I see,
04:06
<&McMartin>
(This is also true for C but you don't run into it nearly as much there)
04:09
<&McMartin>
Unfortunately, these examples are in Java, which doesn't have the same need for them as C++, and only really has them due to language deficiencies around not having a global namespace for non-classes.
04:10
< Turaiel>
I found a couple examples on SO
04:10
< Turaiel>
Trying to understand them
04:11
< Turaiel>
I'm guessing that once I have the relevant instance stuff in there, I just need to remove all the statics
04:12
<&McMartin>
Pretty much
04:12
<&McMartin>
If you can guarantee that a unique thread will be setting you up - that is, that there won't be race conditions during first use - you can just put conditional intialization at the start
04:13
< Turaiel>
Gotcha
04:13
< Turaiel>
I don't know if I can guarantee that when Nachos is running a user program which makes calls to this
04:14
<&McMartin>
Without a pre-existing synchronization technique that doesn't require anything more complex than an integer, you *cannot* do it fully safely
04:15
<&McMartin>
(and a test-and-set or test-and-increment or compare-and-swap intrinsic)
04:15
<&McMartin>
If I were writing for an 8-bit chip, I'd disable interrupts during first initialization with something like the double-lock example.
04:16
< Turaiel>
I guess I can just try my luck with the initialization
04:16
<~Vornicus>
hooray critical sections
04:16
< Turaiel>
Since there isn't any synchronization available that I don't have to initialize
04:17
<&McMartin>
Wait
04:17
<&McMartin>
What happens if your static is not a pointer
04:17
< Turaiel>
What do you mean?
04:18
<&McMartin>
20:48 < Turaiel> An example: Semaphore* SynchConsole::readAvail = new Semaphore("read avail", 0);in
04:18
<&McMartin>
An equivalent: Semaphore SynchConsole::readAvail("read avail", 0);
04:18
< Turaiel>
Dunno. I was under the impression that all objects had to have new.
04:18
<&McMartin>
... no, this is C++
04:19
< Turaiel>
Right. That's what I thought was the case for C++.
04:19
< Turaiel>
To be honest, I have very little experience with C++
04:19
<&McMartin>
OK, I was about to ask if you had formal training in C++
04:19
< Turaiel>
My university teaches mainly C
04:19
< Turaiel>
C89 and C90
04:19
< Turaiel>
With a tiny bit of Java in the first year
04:20
<&McMartin>
OK, so, this is important
04:20
< Turaiel>
I haven't gotten around to teaching myself C++
04:21
<&McMartin>
OK, so, you can declare objects of any class the same way you declare, like, ints
04:21
< Turaiel>
Wait, if I set those things that need to be initialized to static, can I just create a new instance each time I need to use the console and have them remain initialized?
04:21
<&McMartin>
Um, that would be real bad for a Semaphore
04:21
<&McMartin>
You'll be leaking the old value that you're trashing
04:21
< Turaiel>
:/
04:22
< Turaiel>
I feel as though this shouldn't be as complicated as I'm making it.
04:22
<&McMartin>
C++ is a chainsaw with additional chainsaws for grips.
04:23
<~Vornicus>
objects you just make show up on the stack.
04:24
< Turaiel>
I tried changing them so they weren't pointers, and it's still segfaulting
04:24
<~Vornicus>
well, or in the grid
04:24
<&McMartin>
If you're actually doing OS hacking - and you are, that's what NACHOS is - and you aren't yet clear on the distinction between stack and heap objects - which you apparently aren't
04:24
<&McMartin>
So, you have tried starting it in GDB and getting a stack trace at the point of crash, right
04:25
< Turaiel>
I actually don't know how to use GDB
04:25
<&McMartin>
But, yeah, um, you need to give yourself a crash course in the basics of the language, or you're going to keep failing for no obvious reason and it will be a different one every time.
04:25
< Turaiel>
We got a brief overview in one of my classes once. I never had a reason to use it.
04:25
<&McMartin>
Yeah, that's not going to be good enough for literally writing OS components
04:26
< Turaiel>
I know my way around for the most part
04:26
<&McMartin>
I don't actually believe you on this point
04:26
< Turaiel>
It's just small details like this that are difficult to find answers to on Google
04:26
< Turaiel>
I can pick up a new language pretty easily just by using it most of the time
04:26
<&McMartin>
That's... that's really not a small detail.
04:27
<&McMartin>
That's like not knowing about .equals() in Java
04:27 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
04:27
< Turaiel>
I know the difference between heap and stack objects. I didn't know how new worked in C++.
04:28
<&McMartin>
21:11 < Turaiel> Dunno. I was under the impression that all objects had to have new.
04:28
<&McMartin>
This means you didn't know stack objects existed
04:29
< Turaiel>
The stack and heap are not things that generally cross my mind as I'm thinking about this stuff.
04:29
<&McMartin>
(since new exclusively[*] creates heap objects)
04:29
< Turaiel>
Every time I've seen an object created in C++, it had new. Therefore, I assumed that they all had to have new.
04:29
<&McMartin>
[*] Except for placement new, but don't go there
04:30
< Turaiel>
Sigh. This channel is feeling an awful lot like my FreeNode experience tonight
04:30 Xon [Xon@Nightstar-j72.ku7.252.119.IP] has quit [Client exited]
04:31
<&McMartin>
I'm serious about the "you should probably burn through a hit-the-high-notes basic tutorial for the language"
04:31
< Turaiel>
I don't have time for that.
04:32
< Turaiel>
Anyway, this isn't what I came here to discuss
04:32
<&McMartin>
Then you don't have time for me to try to teach you enough to not fail at your task, and that's more effort than I'm willing to spend
04:32
< Turaiel>
I appreciate your explanations
04:32
< Turaiel>
But you're being condescending to me. That does the opposite of help me.
04:33
< Turaiel>
It's also only very loosely related to the problem that I came in here to ask about.
04:33
<&McMartin>
OK, I'm not trying to be condescending. I'm trying to panic you, as it were.
04:33
< Turaiel>
Panic is not what I need at 12:30 AM.
04:33
< Turaiel>
I can already hardly code at this time
04:33
<&McMartin>
Right, I should be clear about that
04:33
< Turaiel>
I understand that there are things I don't know about this language
04:34
< Turaiel>
I'm able to pick up that knowledge by experiencing issues and asking about it. That's how I learn best.
04:34
<&McMartin>
Right, so, in this case, that's "you're failing during pre-main() initialization, probably because malloc() isn't ready to go yet"
04:35
< Turaiel>
gdb is showing that a completely unrelated component is segfaulting
04:35
< Turaiel>
Or very loosely related, I'm not sure.
04:35
<&McMartin>
But C++ has *so* many edge cases and surprising fatal behaviors and arcane semantics that learning by example is, in my actually professional opinion, a fool's errand
04:35
<&McMartin>
Post the backtrace
04:36
<&McMartin>
("bt" to repeat it if it's scrolled off)
04:36
< Turaiel>
It's very short.
04:36
<&McMartin>
I can't see it from here, nevertheless. Please post it.
04:36
< Turaiel>
http://pastebin.com/4x9DMBcn
04:36
< Turaiel>
I was working on it.
04:36
< Turaiel>
No need to be snippy. :/
04:37
<&McMartin>
Hrm. That's the crashpoint. Can you type "bt"?
04:37
< Turaiel>
http://pastebin.com/T1qzYD2E
04:38
<&McMartin>
OK.
04:38
<&McMartin>
From the bottom up
04:39
<&McMartin>
We're initializing the C/C++ runtime itself. Then we hit __do_global_ctors_aux - "Do Global Constructors". That includes the statics.
04:39
<&McMartin>
Your line 59 is calling Console's constructor, it seems.
04:40
<&McMartin>
And then that's trying to call Interrupt::Schedule before main() starts.
04:40
< Turaiel>
I see.
04:40
<&McMartin>
When you said SynchConsole had "only static members" did you mean you were only *adding* static members to a class that already existed and from which you were inheriting?
04:40
< Turaiel>
No. It does not inherit anything.
04:40
<&McMartin>
What is line 59?
04:40
< Turaiel>
Everything is static.
04:41
< Turaiel>
59 is in console.cc. That is outside my code.
04:41
<&McMartin>
What is line 11?
04:41
< Turaiel>
This file is synchconsole.cc
04:41
< Turaiel>
Console SynchConsole::console = Console(NULL, NULL,
04:41
< Turaiel>
SynchConsole::ReadAvail, SynchConsole::WriteDone, 0);
04:42
<&McMartin>
OK
04:42 AverageJoe [evil1@Nightstar-pqipp9.sd.cox.net] has joined #code
04:42
<&McMartin>
That is a constructor call.
04:42
< Turaiel>
Yes.
04:42
<&McMartin>
You are trying to create a Console object prior to main() starting. That is failing because it's not ready for that yet.
04:42
< Turaiel>
Right.
04:42
<&McMartin>
So Don't Do That.
04:43
< Turaiel>
And that's the part where we began looking for alternatives
04:43
<&McMartin>
I already posted it. The stock solution is a singleton that initializes on first use.
04:43
< Turaiel>
But you said that requires synchronization
04:44
<&McMartin>
Or ensuring that you are not multithreaded at the time, yes.
04:44
<&McMartin>
If you remove the console, does the semaphore correctly initialize? It may secretly just be an integer.
04:45
< Turaiel>
It does not segfault if I remove the console
04:45
< Turaiel>
So I guess that means I can use a singleton and synchronize it.
04:45
<&McMartin>
Yes.
04:47
<&McMartin>
Also, while it is not a complete tutorial, you may get some use out of the book "How Not To Program In C++", which is an exercise book of 111 subtly wrong C++ programs (and 3 working ones!) and puzzles posed about them.
04:51
< Turaiel>
Perhaps when I get around to buying books
04:51
< Turaiel>
I'm nearing graduation, so all my time is in finishing up my last classes :P
04:52
< Turaiel>
Hm. My program appears to have gotten angry
04:55
< Turaiel>
It apparently does not appreciate my initializing the mutex and initialization boolean at the start.
04:57
< Turaiel>
../userprog/synchconsole.cc:7: error: âSemaphore* SynchConsole::initMutexâ is not a static member of âclass SynchConsoleâ
04:58 Xon [Xon@Nightstar-j72.ku7.252.119.IP] has joined #code
04:58
<&McMartin>
That's a... pretty straightforward error message
04:59
< Turaiel>
Right, but didn't you say earlier that making the semaphores static was a bad idea?
04:59
< Turaiel>
Or did I misinterpret what you said?
04:59
<&McMartin>
I was saying calling new in statics was dodgy
04:59
<&McMartin>
In the "works if at all only by accident" sense
04:59
<&McMartin>
But if it was working it will probably be OK as long as you're running it on the machine it will be tested on.
05:00
< Turaiel>
Inside my initialization function, it's claiming that all of my private members are not declared
05:01
<&McMartin>
So, if the init function isn't in the class, it can't see private members
05:01
<&McMartin>
If you didn't declare those members static, a static function can't see them
05:01
< Turaiel>
The initialization function is a private class member
05:01
< Turaiel>
And the function is not static
05:02
<&McMartin>
keep going
05:02
< Turaiel>
Nor are any other variables except init and initMutex
05:02
<&McMartin>
keep going
05:02
<&McMartin>
(static in this sense works the way it does in Java, not the way it does in C)
05:03
<&McMartin>
You've got what you need to know in front of you; you just need to put the pieces together
05:03
< Turaiel>
Heh, I should have just put some globals somewhere and dealt with that xD
05:04
<&McMartin>
That was *my* first suggestion~
05:04
< Turaiel>
But I wanted to take the "better" route
05:04
<&McMartin>
That said, it is super important that globals in C++ start out as NULL or some constant
05:04
<&McMartin>
That's something you won't pick up from scanning code
05:04
< Turaiel>
I don't really know where I would put the globals anyway
05:04
<&McMartin>
You've used "static" in C, right?
05:05
< Turaiel>
I've only learned about it. I never had to use it.
05:05
<&McMartin>
it can also be used that way in C++, but the better way to do it is to wrap it in a nameless namespace.
05:05
< Turaiel>
And that was three years ago
05:05
<&McMartin>
namespace { int a; }
05:05
<&McMartin>
Now only the enclosing scope (usually the file) can see a.
05:05
<&McMartin>
But a is otherwise a "global"
05:06
<&McMartin>
That's actually better, IMO, than a class where every member is private static
05:06
< Turaiel>
I don't know which file would contain the globals
05:06
<&McMartin>
oh. yours, of course.
05:07
<&McMartin>
(since synchconsole is the only file you get to edit, right?)
05:07
< Turaiel>
I actually modify quite a few files
05:07
< Turaiel>
This is a tiny sliver of the assignment
05:07
< Turaiel>
The rest is implementing syscalls, exceptions, memory management, multiprogramming, and exec
05:09
<&McMartin>
well, good luck
05:09
< Turaiel>
That won't be much of a problem
05:10
< Turaiel>
I just needed to get into the swing of things today. It's been about a month since I last touched nachos and C++ (and programming in general).
05:10
< Turaiel>
I got most of the system calls done already. I've been prodding the SynchConsole on and off
05:11
< Turaiel>
Probably just sounds like excuses to you.
05:12
<&McMartin>
I'm used to NACHOS courses having as a prerequisite at least half a year of intensive data structures training and/or a C++ project course
05:12
<&McMartin>
And based on our conversation here if I were advertising for a C++ position you wouldn't have made it two questions past a phone screen :/
05:13
<&McMartin>
But, you know, you are literally a student
05:13
< Turaiel>
The only prerequisite for this course is Concurrent Programming (which is a C course)
05:13
< Turaiel>
Which in turn only requires Systems Programming (also C)
05:13
< Turaiel>
That said, I've taken most of the classes in the curriculum here.
05:14
< Turaiel>
This and Concurrent are the only ones that dabble in C++
05:14
<&McMartin>
And it sounds like it's one of the curricula that generally assumes you'll pick up the languages as you go along
05:14
< Turaiel>
That's right. It's designed to teach students to learn languages themselves.
05:14
<&McMartin>
I assume this is an OS course
05:14
< Turaiel>
Yep
05:14
< Turaiel>
Also my final CS course
05:15
<&McMartin>
Anyway, speaking as a former TA: "Given what's being asked of you and waht you've been asking here, I think you're behind the curve on this stuff ATM"
05:15
< Turaiel>
That's a shame.
05:16
<&McMartin>
So: good luck, and if C++ is part of the ultimate plan, find some books (I stand by the puzzle book from before, and the official Stroustrup C++ book is pricy but worth it)
05:16
< Turaiel>
From what I gather I'm actually one of the better programmers in my class (and that's not just me being narcissistic)
05:16
< Turaiel>
I'm (maybe unfortunately) a web developer by profession
05:16
< Turaiel>
C++ is on my list of things to work with on my own though
05:17
<&McMartin>
cplusplus.com is a superb library reference, but an awful tutorial.
05:17
< Turaiel>
I noticed xD
05:17
<&McMartin>
Stroustrup's core book is the best tutorial I know
05:17
< Turaiel>
I'd prefer books for learning languages
05:17
< Turaiel>
But as I said, no time for that now
05:17
<&McMartin>
Right
05:17
< Turaiel>
Once I have some down time when I'm back at my job and settled into my apartment
05:18
<&McMartin>
But I've actually been a systems and applications programmer at widely varying target levels for like a decade, almost all in C++.
05:18
< Turaiel>
(and not distracted by Reddit for the entirety of my free time)
05:18
<&McMartin>
I *still* consult that book I learned on at first, albeit a few editions later
05:18
<&McMartin>
It's *really good*
05:18
< Turaiel>
I actually did not want to go into web dev..
05:19
<&McMartin>
http://www.amazon.com/The-Programming-Language-4th-Edition/dp/0321563840
05:19
<&McMartin>
(My personal copy is actually the 2nd edition, IIRC)
05:19
< Turaiel>
I'll make a bookmark
05:21
< Turaiel>
I got C++ for Dummies back in middle school
05:21
< Turaiel>
Tried to start reading it again a few years ago and it's *awful*
05:21
<&McMartin>
The language has changed drastically over the years, several times
05:21
< Turaiel>
It's also just a terrible book in general
05:21
<&McMartin>
It didn't get any decent-quality compilers until 2005, by the usual standards of "decent quality"
05:22
<&McMartin>
(It had commercially usable compilers as far back as the 1980s)
05:22
<&McMartin>
(The 1990s were... interesting)
05:22
< Turaiel>
It's probably just that it's oversimplified which is an issue for me, being a generally experienced programmer.
05:23
< Turaiel>
http://i.imgur.com/Fpyq9XI.png <-- This is my collection of books
05:23
< Turaiel>
A lot of them I got for free or very cheap xD
05:24
<&McMartin>
Oh hey, Ullman
05:24
< Turaiel>
I actually had to use an edition of that book for my database course last semester
05:25
< Turaiel>
Mine's a first edition though, I think. I got a digital copy of the newer one from someone :P
05:26
< Turaiel>
Alright, I need to go to bed very badly. I need to be up in less than seven house.
05:26
< Turaiel>
hours*
05:26
< Turaiel>
Good night. Thanks for the help. I'm switching to globals tomorrow :P
05:26
<&McMartin>
Hide them in a namespace =P
05:26
< Turaiel>
I wil think about that
05:27 AverageJoe [evil1@Nightstar-pqipp9.sd.cox.net] has quit [[NS] Quit: Leaving]
05:27
< Turaiel>
Before I go though - are you suggesting to just put the variables in a namespace, or the whole thing?
05:28
<&McMartin>
The stuff that would have been private goes in an anonymous namespace so only that file can see it. the methods that people are supposed to call go outside of the namespace, as global-scale functions.
05:28
< Turaiel>
Gotcha
05:28
< Turaiel>
That's what I thought
05:28
< Turaiel>
Thanks.
05:28
<&McMartin>
Basically: "Encapsulation is great. You don't *actually* need OO to do it."
05:28
<&McMartin>
"But do it."
05:29
<&McMartin>
Named namespaces can be used in ways not unlike packages, but that's solving a different problem
05:29 Turaiel is now known as Turaiel[Offline]
05:32 Alek [omegaboot@Nightstar-03ja8q.il.comcast.net] has quit [Operation timed out]
05:57 Alek [omegaboot@Nightstar-03ja8q.il.comcast.net] has joined #code
05:57 mode/#code [+o Alek] by ChanServ
05:59 Kindamoody[zZz] is now known as Kindamoody
06:10 AverageJoe [evil1@Nightstar-pqipp9.sd.cox.net] has joined #code
06:15 celticminstrel [celticminst@Nightstar-gmujup.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
06:16 * McMartin deploys currying in JavaScript for no good reason.
06:35
<@Shiz>
s/currying in //
07:11
<&McMartin>
Oh, desploying JS *at all* is because it's lightweight dynamic web content.
07:16 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has quit [Connection closed]
07:30
< AverageJoe>
/
08:10 AverageJoe [evil1@Nightstar-pqipp9.sd.cox.net] has quit [[NS] Quit: Leaving]
09:04 macdjord is now known as macdjord|slep
09:07 Kindamoody is now known as Kindamoody|afk
09:46 kourbou [holoirc@Nightstar-hbh.1kg.164.37.IP] has joined #code
09:54 * TheWatcher readsup, eyes Turaiel's books, responds with the obligatory http://fleet.starforge.co.uk/images/bookshelf.jpg ~
09:54 kourbou|phone [holoirc@Nightstar-pvg.v2k.161.37.IP] has joined #code
09:58 kourbou [holoirc@Nightstar-hbh.1kg.164.37.IP] has quit [Ping timeout: 121 seconds]
09:59
<@Wizard>
Shiz might appreciate that as well
09:59
<@Shiz>
nice opengl books
10:00
<@TheWatcher>
Need to get the new ones, heyho
10:01
<@Shiz>
htts://up.shiz.me/OTU1YjZk.jpg
10:01
<@Shiz>
this is my tiny tiny library
10:02
<@Shiz>
err
10:02
<@Shiz>
https://up.shiz.me/OTU1YjZk.jpg
10:03 kourbou|phone [holoirc@Nightstar-pvg.v2k.161.37.IP] has quit [Ping timeout: 121 seconds]
10:03
<@TheWatcher>
(at some point I guess I should get the 4e of Stroustrup, too)
10:04 * TheWatcher eyes
10:06
<@Shiz>
and my *other* tiny library https://up.shiz.me/MGUyZDk3.jpg
10:06
<@Wizard>
Shiz: Nice, same versions of MOS and dragon that I have
10:06
<@Wizard>
Here's mine https://scontent-lhr.xx.fbcdn.net/hphotos-xpf1/l/t31.0-8/s2048x2048/10003630_102 05419360222408_4679512941356453170_o.jpg
10:07
<@TheWatcher>
Shiz: "Principles of chemsitry"?
10:07
<@Wizard>
The Art of UNIX Programming is a great book
10:07
<@Shiz>
TheWatcher: sure
10:08
<@Shiz>
uni course ;p
10:08
<@Shiz>
also nothing wrong with chemistry
10:08
<@Shiz>
Wizard: noice
10:08
<@Shiz>
i wish i had TAOUP
10:12
<@Wizard>
Shiz: I got most of mine raiding the obsoleted books when my uni library was being renovated
10:13
<@Wizard>
Like ancient X admin handbooks and case studies on obscure OSes nobody heard about again
10:13
<@TheWatcher>
Most of my bookshelf at home is taken up with Game Programming Gems and OpenGL books these days. I don't even want to think how much I spent on them >.<
10:13
<@Shiz>
i'm just getting into openg
10:13
<@Shiz>
l
10:13
<@Shiz>
it feels like entering a world of pain
10:14
<@TheWatcher>
You need to have a certain sort of mind, and be willing to lose it.~
10:14
<@Wizard>
Have you stayed in touch with one, Shiz?
10:15
<@Shiz>
anyway
10:15
<@Shiz>
at least it allows me to render cool cyberpunk backgrounds
10:15
<@Shiz>
https://up.shiz.me/MzE4MDEy.png
10:15
<@Shiz>
no further postproc needed
10:16
<@gnolam>
Wizard: "Märken och människor"?
10:16
<@Wizard>
I do love how proud the sprite looks there
10:16
<@Wizard>
gnolam: Hanken entrance exam
10:16
<@TheWatcher>
Shiz: that's, uh... yes.
10:16
<@Shiz>
you can cut at least 3 vaporwave album covers from this image
10:17
<@Shiz>
and people tell me opengl isn't efficient
10:18
<@Shiz>
Wizard: "i'll be your guide in this insane world"
10:20
<@Wizard>
You might as well use it for the radio background
10:39 * TheWatcher O.os at his build of emacs
10:39
<@TheWatcher>
Suddently it starts changing the mouse pointer to different shapes in different places, wtf
10:55 Red_Queen [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
10:55 mode/#code [+o Red_Queen] by ChanServ
11:10
<@Tarinaky>
Fsss...
11:11
<@Tarinaky>
I really hate it when I miss calls from withheld numbers.
11:11
<@Tarinaky>
GP surgery says it wasn't them.
11:11
<@Tarinaky>
Argh.
11:13
<@TheWatcher>
So much hate for that
11:13
<@Tarinaky>
Also: I'm not sure if the first panel of today's dilbert is supposed to make sense.
11:13
<@Tarinaky>
What do bitcoins have to do with Libor?
11:14
<@Tarinaky>
Libor is the rate at which banks trade Gold with each other isn't it?
11:14
<@Tarinaky>
Or have I just rammed two other things together.
11:16
<@TheWatcher>
You're right; libor is the london interbank offered rate
11:17
<@TheWatcher>
But I think the point of the first panel is that Wally is deliberately coming out with finance-babble to make it sound complicated and put the PHB off talking
11:18
<@Tarinaky>
libor involves gold though right?
11:18
<@Tarinaky>
Okay, just checking I'm not missing something.
11:21
<@TheWatcher>
It's the average interest rate that a bank would be charged if it borrowed from another bank.
11:21
<@Tarinaky>
Ah, okay.
11:30
<@Tarinaky>
http://www.st.ewi.tudelft.nl/~mbeller/publications/2015_beller_zaidman_karpov_th e_last_line_effect_preprint.pdf
11:32
<@Shiz>
of course zaidman would write about that
11:32
<@gnolam>
<Tarinaky> I really hate it when I miss calls from withheld numbers.
11:32
<@gnolam>
That's why you ignore all withheld numbers.
11:33
<@Tarinaky>
gnolam: I don't have that option.
11:33
<@Tarinaky>
Because medical establishments use withheld numbers.
11:33
<@Tarinaky>
And I am desperately waiting a referral to an oversubscribed specialist.
11:33
<@Tarinaky>
So, yeah.
11:47
<@TheWatcher>
I have never got the withheld number thing
11:48
<@Tarinaky>
It's because confidentiality, so the partners of battered women don't know they've seen a doctor.
11:48
<@TheWatcher>
If they're worried about people calling an internal line, they should use a fucking PBX that sends out the reception number
11:48
<@Tarinaky>
Or similar.
11:48 * TheWatcher blink
11:48
<@Tarinaky>
Or similar stuff.
11:49
<@Tarinaky>
Basically because the reception's number as a missed call would give you the knowledge that someone had seen a doctor.
11:49
<@Tarinaky>
Or sought medical advice.
11:49
<@TheWatcher>
Because calls from a withheld number aren't going to be suspicious at all
11:49
<@Tarinaky>
Well.
12:22
<@Tamber>
At least those could be handwaved as "More phone spam"
12:40 Irssi: #code: Total of 38 nicks [23 ops, 0 halfops, 0 voices, 15 normal]
12:41 * TheWatcher sighs vaguely, bolts another feature onto CODICIL WINTER HILL
12:41
<@TheWatcher>
At least this time it's only another two tables and maybe another 1000 lines of code or so...
12:44
<@gnolam>
I assume all withheld numbers are telemarketers and refuse to answer. :P
13:02
<@Tarinaky>
I only have a mobile phone, so I don't, generally, get too much telemarketting
13:02
<@Tarinaky>
Because it costs more to call me.
13:04
< abudhabi>
gnolam: Strange. The only withheld number I recall was from MS tech support. Telemarketers over here seem to have visible numbers.
13:28 Netsplit *.net <-> *.split quits: Orth, abudhabi, @Shiz, @Reiv, @Attilla, grindhold, @Xires, @Derakon[AFK], @froztbyte, VirusJTG, (+21 more, use /NETSPLIT to show all of them)
13:28 Netsplit over, joins: &Orth, @PinkFreud, VirusJTG, &jerith, &ToxicFrog, &jeroud, @Tamber, &Derakon[AFK], @Red_Queen, Syka (+21 more)
13:32 celticminstrel [celticminst@Nightstar-gmujup.dsl.bell.ca] has joined #code
13:32 mode/#code [+o celticminstrel] by ChanServ
15:51 Red_Queen [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
16:37 macdjord|slep is now known as macdjord|wurk
18:50 Turaiel[Offline] is now known as Turaiel
18:50
< Turaiel>
McMartin, you around?
18:51 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [Connection closed]
18:53 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
19:22
<@gnolam>
abudhabi: MS tech support or "MS tech support"?
19:24
<&ToxicFrog>
Turaiel: is this another C++ question?
19:24
< Turaiel>
It was, but it looks like I solved it
19:25
< abudhabi>
gnolam: Legit.
19:42 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has joined #code
19:42 mode/#code [+o Vash] by ChanServ
20:55 Turaiel is now known as Turaiel[Offline]
21:12 kourbou [holoirc@Nightstar-deqg8j.fbx.proxad.net] has joined #code
21:26 Kindamoody|afk is now known as Kindamoody
21:35 Reiv_ [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has joined #code
21:39 Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has quit [Ping timeout: 121 seconds]
21:44
< abudhabi>
Is Xfce good?
21:45
<&McMartin>
I used to use it as my low-power desktop environment, but lately I've used LXDE for that instead.
21:46
< abudhabi>
Well, I definitely want something that runs well on a relatively slow machine.
21:46
<&McMartin>
I've heard dark rumors that XFCE has been accreting Stuff
21:46
<&McMartin>
I would give XFCE and LXDE both a shot.
21:47
< abudhabi>
This... box... has 4GB RAM and four cores, but those four cores are like 1GHz each.
21:47
<&McMartin>
So, uh
21:47
<&McMartin>
You'll be fine with anything
21:48
<&McMartin>
The machine I'm typing on here has a single 1GHz core an 1GB of RAM and it can run GNOME 3 without flinching.
21:48
< abudhabi>
I'm running Cinnamon now, but it's a little bit laggy.
21:48
<&McMartin>
kk
21:48
<&McMartin>
Yeah, give both XFCE and LXDE a shot.
21:49
< abudhabi>
Definitely not the kind of performance I get on a desktop.
21:49
<&McMartin>
LXDE looks more like Cinnamon than XFCE does, if that makes any difference.
21:49
< abudhabi>
Which looks more like Windows? :P
21:49
<&McMartin>
LXDE.
21:50
<&McMartin>
Both have screenshots up on their wiki pages~
21:51
< abudhabi>
I'm currently over my bandwidth cap. Loading images is a pain.
21:51
< abudhabi>
I'm considering doubling the cost of my internets to quadruple the allotment.
21:53
< abudhabi>
But I'll see about that after my next apartment move. There might be better wifi there or something.
22:01 kourbou [holoirc@Nightstar-deqg8j.fbx.proxad.net] has quit [Connection closed]
22:14 Kindamoody is now known as Kindamoody[zZz]
22:16 kourbou [holoirc@Nightstar-deqg8j.fbx.proxad.net] has joined #code
22:16 * TheWatcher pushes out a new version of AEON HAND MAN, mutters about feature requests
22:25
<&McMartin>
AEON HAND MAN is not up to the standard of CODICIL WINTER HILL
22:26
<@TheWatcher>
I'd think up a better codename, but I am le tired.
22:27
<&McMartin>
Indeed
22:27
<&McMartin>
(POSTNAP MISSILE LAUNCH presumably too on-the-nose)
22:27
<@TheWatcher>
(Alas so)
22:31
<@TheWatcher>
That said, shameless pimping in case anyone runs mediawiki and may find it useful: https://www.mediawiki.org/wiki/Extension:InteractiveTimeline
22:36 * McMartin learns a thing from the footnote.
22:41 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
22:41 mode/#code [+qo Vornicus Vornicus] by ChanServ
22:44
<@TheWatcher>
(Javascript date stuff is made of hate and spiders)
22:44
<&McMartin>
That looks like "failed to implement a wacky quirk in an ISO standard I'd never heard of"
22:45
<&McMartin>
the quirk, that is. I've heard of the standard.
22:45
<@gnolam>
Er
22:45
<@gnolam>
That's totally standard.
22:45
<&McMartin>
2400?
22:45
<@gnolam>
Yes.
22:45
< abudhabi>
LXDE is fast!
22:45
<~Vornicus>
???
22:45
<~Vornicus>
for js date I recommend moment.js
22:45
< abudhabi>
But how do I set the keyboard layout?
22:45
<&McMartin>
I've always seen people pointedly pick 2359 precisely to duck this
22:48
<&McMartin>
abudhabi: Apparently there's a layout switch plugin you can install or something, but a quick google is all about hacking xorg.conf
22:49
<&McMartin>
I haven't had to use setxkbmap since, uh, Fedora Core 3 though
22:50
<&McMartin>
Good to hear that LXDE is zippy compared to the alternatives though
22:51 * McMartin is thinking about getting a new tiny computer to replace this ancient monstrosity, and LXDE was on the shortlist for Distro To Put On It
22:52
< abudhabi>
WTF. Terminal fired from the launch bar doesn't accept input.
22:53
<&McMartin>
Is focus following mouse?
22:53
< abudhabi>
What?
22:53
<@Tamber>
Move the mouse pointer to the window, and see if it works then?
22:54
<@TheWatcher>
Vornicus: somewhat overkill in the situation - if the browser writers actually made Date.parse() do its fucking job properly, there'd be no issue.
22:54
<&McMartin>
Speaking of Linux stuff, a side question: if I were to install Debian into a VM, which version of it should I be getting?
22:55
< abudhabi>
Found the issue: there is terminal and lxterminal.
22:55
< abudhabi>
The latter works.
22:55
<&McMartin>
...huh
22:55
<&McMartin>
That implies LXDE is doing some truly horrifying things with its launch bar
22:59
< abudhabi>
Impressions os far: LXDE is fast but awful on user friendliness.
23:00
< abudhabi>
I still haven't been able to set the layout.
23:00
<&McMartin>
Bleh
23:00
<&McMartin>
My impressions of Xfce are far enough out of date that I'm not confident in them, either. -_-
23:04 kourbou is now known as kourbou|zzz
23:15 kourbou|zzz [holoirc@Nightstar-deqg8j.fbx.proxad.net] has quit [Connection closed]
23:15 kourbou [holoirc@Nightstar-deqg8j.fbx.proxad.net] has joined #code
23:15 kourbou is now known as kourbou|zzz
23:59 Derakon[AFK] is now known as Derakon
--- Log closed Thu Mar 26 00:00:01 2015
code logs -> 2015 -> Wed, 25 Mar 2015< code.20150324.log - code.20150326.log >

[ Latest log file ]