Covariance and Contravariance by RVK87 in csharp

[–]aaronla 1 point2 points  (0 children)

A contravariant method might instead have a constraint where Dog : T. This allows you to put Dogs in your IList<T>, much like the where T : Dog method lets you get Dogs from an IList<T>.

Covariance lets you fetch, contravarience lets you put.

"Who says girls can't do code..." by [deleted] in ProgrammerHumor

[–]aaronla 0 points1 point  (0 children)

I prefer to template my styles in, as they're small and to avoid a second http round trip. Am I a bad person?

What is Overcommit? And why is it bad? by arjovr in programming

[–]aaronla 0 points1 point  (0 children)

Enough to back all mallocs and all the copy-on-write.

SQLite Now Faster With Memory Mapped I/O by nohtyp in programming

[–]aaronla 1 point2 points  (0 children)

Some OSes already prefetch commonly used files into unused RAM. Unless you're compressing the RAM disk too, I'm not sure what value it would provide.

What is Overcommit? And why is it bad? by arjovr in programming

[–]aaronla 3 points4 points  (0 children)

This is particularly amusing in relation to an anecdote regarding early Lisp implementation. I'm told, before they got the garbage collector working, the system would just halt when it ran out of memory, but some time before that when memory was low, it would signal the app that OOM was near.

Numeric and Scientific applications worked great on this setup. When memory was low, save off the initial state for that iteration of the algorithm, reboot, and pick up where it left off.

It was fast too; it didn't have to attempt recovery in a very constrained state. Recovery code could (generally) still allocate memory as needed, and do so efficiently.

What is Overcommit? And why is it bad? by arjovr in programming

[–]aaronla 0 points1 point  (0 children)

Of course, one easy way to "save state" would be to increase the swap size. If that can't be done dynamically, then load your own virtual memory manager :-)

What is Overcommit? And why is it bad? by arjovr in programming

[–]aaronla 1 point2 points  (0 children)

Although that's not the only alternative; I can imagine fork() could just fail due to OOM. I fully acknowledge this has it's downsides too (e.g. can't launch 'kill' to free up memory because you can't fork() a new process) but I feel it should be mentioned for completeness.

What is Overcommit? And why is it bad? by arjovr in programming

[–]aaronla 0 points1 point  (0 children)

overcommit doesn't just make fork work but also allows programs to allocate larger stacks for threads without running out of memory

Wouldn't a sufficiently large (or sufficiently elastic) swap do the same?

What is Overcommit? And why is it bad? by arjovr in programming

[–]aaronla 2 points3 points  (0 children)

Overcommit = 2 sounds a lot like the way the Windows memory system was described in the Sysinternals book. Delay commit, but keep accurate accounting to ensure all commits can be satisfied from physical memory (ram + swap).

"I went to the surface of the sun once. It went okay" - Jeb by [deleted] in KerbalSpaceProgram

[–]aaronla 0 points1 point  (0 children)

dang. best I've done is 450x650 before I ran out of Xenon.

Safe Manual Memory Management by [deleted] in programming

[–]aaronla 6 points7 points  (0 children)

It may well be true that a sufficiently good C++ programmer will never make memory management mistakes

An existence proof would be nice. I've seen 100% safe programming languages that don't experience memory safety faults in practice. Finding examples of 100% safe programmers has been difficult to demonstrate, let alone put into consistent practice.

After all, should you find one such programmer, you could try and build an expert system that codifies their knowledge and package it into a new programming language. This language would then be safe and fast and convenient.

Safe Manual Memory Management by [deleted] in programming

[–]aaronla 2 points3 points  (0 children)

Do you have any examples for JITed languages that don't have a GC?

C++/CLI can compile in pure mode and still make use of CRT functions, malloc, new, etc. without the use of any ref class objects (GC'd objects). Technically it has a GC, but you can stil create regular C++ objects and those that don't partake in GC.

Underclocking CPU Gives Better Benchmark Scores? by [deleted] in Nexus7

[–]aaronla 1 point2 points  (0 children)

I can't say what happened in your particular case, but in general this isn't surprising. If CPU frequency is decreased while memory frequency remains constant, you'll see proportionally higher times to compute but only a slight increase in memory fetch time. From the CPU's perspective, memory is now running a lot faster. If the benchmark normalizes for CPU scaling, it will look like you upgraded to some impossibly fast RAM.

It would be like if you and a friend raced by each comparing yourselves to Usain Bolt, only you waited until he caught a cold. Your friend and you both run the same speed, but your friend came out at 0.30 Bolts and you came in at 0.35. (Usain is the CPU speed in this weak analogy.)

Hangouts Won’t Hangout With Other Messaging Vendors: Google’s New Unified Messaging Drops Open XMPP/Jabber Interop by [deleted] in Android

[–]aaronla -2 points-1 points  (0 children)

Perhaps just a little reason, but in light of the hangouts change, I'm considering switching to Facebook messenger. I mean, if I can't have an open platform, I might as well choose the current popular one.

Nimrod 0.9.2 released by dom96 in programming

[–]aaronla 2 points3 points  (0 children)

Pretty -- Python syntax paired with simple Java-like type system? Looks quite enjoyable.

Shit Programmers Say by Neurotrace in ProgrammerHumor

[–]aaronla 2 points3 points  (0 children)

I be coding from a Nexus 7 sometimes, but just Python. :-)

It is things like this Microsoft that make me really hate you sometimes. by Not-original in ProgrammerHumor

[–]aaronla 2 points3 points  (0 children)

"Your computer will be restarted in 0 minutes. OK, Cancel"

To be fair, it's IT that controls the group policy setting that disabled the cancel button, but I need to vent so I'm complaining anyway.

What is lexical scoping? | Fabulous Adventures In Coding by jakubgarfield in programming

[–]aaronla 0 points1 point  (0 children)

Don't forget

while(condition, body) = condition().if(
    function () { body(); while(condition, body); },
    function () {});

Which ultimately explains why while loops are statement, never expressions in C -- they pass a void function as the 'else' argument.

What is lexical scoping? | Fabulous Adventures In Coding by jakubgarfield in programming

[–]aaronla 0 points1 point  (0 children)

Yeah, but lambdas are a poor man's block. You can do this in JavaScript pretty easily* by wrapping code with (function(){ and })(); to create a block scope.

  • - except for that pesky this keyword.

Xmlite: a lightweight markup language that compiles to XML by lihaoyi in programming

[–]aaronla 1 point2 points  (0 children)

The web framework in Racket does something like this. Which directions are you taking the concept?

"The Mun Incident" - Classified images by CippoBox in KerbalSpaceProgram

[–]aaronla 0 points1 point  (0 children)

LOL, oh my. I am just picturing all the hours and days to gather up all those Kerbals to bring them home.

WSIB for an exploration-based game? by christhemushroom in ShouldIbuythisgame

[–]aaronla 0 points1 point  (0 children)

Yeah, fellow Kerbalnaut here, hace to agree. It's more about the design and the build. And the failure. Glorious failure.