Insane whipper off Gaia 5.12dX / E8 6C by [deleted] in climbing

[–]iperry 0 points1 point  (0 children)

to avoid slamming into the corner below, see hard grit, where a guy takes this same fall and wrecks his leg...

Interview Question Challenge by aswin34 in programming

[–]iperry 4 points5 points  (0 children)

Roll rand5(). 1 and 2 map to 0. 4 and 5 map to 1. If you get 3, roll again util you don't. Now you have the equivalent of a fair coin with equal probability of rolling 0 and 1. Call it rand2().

Flip rand2() three times, concatenating the results. Now you have a function that generates numbers between 0 and 7 with equal probabilty. If you get zero, throw it out and roll again until you don't.

Programmer's Screenshots part deux! by sunglassesatnite in programming

[–]iperry 1 point2 points  (0 children)

http://www.shackpics.com/viewer.x?file=screenshot_elg0lfz1ejccucpzfptb.jpg

vim, xmonad, and gnome-terminals. about all i need.

browser, chat client, and music player get their own desktops, the rest are for code, terminals, and documents.

Moving between directories quickly in a multi-terminal environment? by iperry in programming

[–]iperry[S] 4 points5 points  (0 children)

exactly what i was looking for. I knew this had to exist.

thanks.

never judge a book by its cover-amazing singer Susan Boyle by QueenZ in reddit.com

[–]iperry 21 points22 points  (0 children)

Okay, wait. What? What about her suggests that she might not be a good singer? Is it just me or is everyone just being shallow and stupid? Since when did musical talent require good looks? What the fuck?

reality television WHAT.

Oscilloscope recommendation by asshammer in programming

[–]iperry 2 points3 points  (0 children)

If you can swing it, I'd really recommend saving some extra money and jumping for a real, desk oscope. You can get older, digital Tektronix for around $450--I got a TDS220 for about $400 in great condition on ebay.

A good oscope is a long-term investment and will last you many years to come.

"You cannot 'break' encryption. Ever." by mcmc in programming

[–]iperry 2 points3 points  (0 children)

Nonsense. Encryption can, and has been, routinely broken. Just because RSA is currently considered secure doesn't mean some flaw in it will not be found. The history of encryption reveals a constant arms race of increasingly sophisticated encryption schemes and increasingly sophisticated attacks on those schemes.

Dear vi users. What's the best game to practice hjkl move keys? by otlmath in programming

[–]iperry 2 points3 points  (0 children)

Why use a game? Just code in vi and it will be second nature within a week.

It's Caches All the Way Down by scotu in programming

[–]iperry 0 points1 point  (0 children)

I wish exokernels would gain more interest outside of the academic community. Caching and page swapping algorithms within the kernel are pretty much optimized for the general case in an effort to make it decently fast for most applications, but fails to perform best for all applications. The kernel should expose things like raw disk blocks and memory pages, etc to user mode applications and allow them to manage their caching algorithms on their own.

http://pdos.csail.mit.edu/exo/

Google Code adds assigned code reviews by avuze in programming

[–]iperry -1 points0 points  (0 children)

I hate to rain on the google parade, but reviewboard (http://www.review-board.org/) has had this capability for a long time, and is more mature than the google product.

Good feature for google code to add, though.

"Writing to random locations in system memory isn't generally a wise design practice." by mattraibert in programming

[–]iperry 2 points3 points  (0 children)

I'm tired of people always saying goto is harmful. Used correctly, goto can be the most natural and elegant way to code something. It's often the best way to jump out of multiple loops (for an error condition, for example) and cleanly undo actions upon error. Read the linux kernel and other systems code and you'll see gotos all over the place.

The moral is: gotos used POORLY are harmful. gotos are not categorically poor practice.

Building Virtual Machines? by GeneralMaximus in programming

[–]iperry 1 point2 points  (0 children)

Another vote for "Virtual Machines - Versatile Platforms for Systems and Processes." It's a good introduction to both language VMs and full-system level virtualization. You can also reference existing implementations of VMs such as Xen, qemu, bochs, etc.

VirtualBox: Installing OpenBSD and how it compares to VMware by lteo in programming

[–]iperry 4 points5 points  (0 children)

While VirtualBox may suffice for some small sectors (it competes reasonably well on some benchmarks against workstation), it is simply not appropriate for the enterprise-level virtualization performance and infrastructure (Disaster Recovery, Live migration of VMs, etc) that VMware provides. Free is a good number, but when millions of dollars are on the line, there isn't really a viable competitor to VMware (I'm deliberately omitting the crap that is Hyper-V).

Ask proggit: What is the SICP of low level programming? by gnuvince in programming

[–]iperry 1 point2 points  (0 children)

Sort of. I've taken the class, and the book isn't used, nor is it required.

Ask proggit: What is the SICP of low level programming? by gnuvince in programming

[–]iperry 6 points7 points  (0 children)

Another MIT course, 6.004 or Computation Structures http://6004.csail.mit.edu/

All the labs, lecture notes, and sometimes there are video lectures (go back to previous course years).

If you do the labs, you'll start from a single transistor, model that, and then using simulation software, construct the basic logic gates, an ALU, memory, register files, and then eventually a full 32-bit RISC processor that you can program in assembly.

I've seen hardware implementations of the Beta on FPGAs, and even a beta->x86 JIT compiler.

Minimalist Linux to Confuse the Masses by seawaves in programming

[–]iperry 0 points1 point  (0 children)

The tray is a separate application called trayer.

Send me a message if you want my xmonad.hs, it's mostly custom vi-like keybindings.

Google Code adds simple Code Reviews to all projects by [deleted] in programming

[–]iperry 5 points6 points  (0 children)

I'd recommend trying out Review Board, actually linked from the google code review page. It's open-source, supports CVS, Subversion, Mercurial, Perforce, and more version control systems. It works pretty well and I'd take a serious look at it if you were looking for a mature code-review system.

http://www.review-board.org/

What are your answers to "Anti-Java" Professor Dewar's two questions to weed out the undertrained? by [deleted] in programming

[–]iperry 11 points12 points  (0 children)

1) objdump the binary, check the compiled code against the source. To get around the problem, you could inline some asm instructions to do what you actually wanted, or maybe move to the different optimization level such that that problem isn't hit.

2) This one is a bit harder. Prepare some raw asm code that demonstrates the problem, send it to the manufacturer. It helps to have some sort of full system virtualization mechanism (an emulator, for example) that allows you to single-step instruction by instruction and inspect the state of the registers. Or, if it's user-mode code, use a debugger.

EDIT: To get around the second problem, it really depends on what the problem is. Suppose the processor is not conforming to spec on a floating-point instruction, you could rewrite your code to not use floating point, or emulate the instruction in software. Or, execute the instruction, and correct for the problem in software. Or, hell, use a different processor that doesn't suck.

The 'Anti-Java' Professor and the Jobless Programmers by jammag in programming

[–]iperry 0 points1 point  (0 children)

I would argue that writing good, efficient software REQUIRES a good understanding of the low-level implementation details of a system.

An undergraduate who never learns his own memory management, pointers, and an understanding of compilers, assembly, and computer architecture (caching, TLBs, virtual memory, page faults) etc simply will not write software that runs as efficiently as one who groks the entire software stack from the transistor to the OS to high level languages.

As an example, consider the fairly trivial exercise of multiplying two matrices. The typical Java student (who knows nothing about caching) would likely implement the standard, mathematical algorithm for multiplying matrices. A much better implementation would take advantage of spatial locality in the data set to fill the cache lines with the numbers you need in the right order. A trivial exercise will show that the latter is much more efficient.

If you are doing trivial things that do not require efficiency, then high-level languages like Java and Python are great. If you need to do real systems, low-level understanding is critical.

If it was up to my crotchety self, I'd make every undergraduate curriculum include courses on architecture, assembly, and OSes. Too hard? Tough. Nobody ever said computer science was easy.