## Search found 115 matches

Sun Jun 15, 2008 5:33 pm UTC
Forum: Coding
Topic: The "what does it do?" thread!
Replies: 11
Views: 1965

### Re: The "what does it do?" thread!

Notch wrote:Very simple, very useful:

Code: Select all

`public int f(int a, int b){    return ((a&0xfefefefe)>>1)+((b&0xfefefefe)>>1);}`
Spoiler:
Packed average of unsigned 8-bit integers, rounding down?
Sat Jun 14, 2008 3:40 am UTC
Forum: Coding
Topic: The "what does it do?" thread!
Replies: 11
Views: 1965

### Re: The "what does it do?" thread!

Ok, I think I figured this one out. My answer inside the spoiler. I believe that function2 returns true if any of the 4 bytes of x are 0. What the heck is this used for? Correct! Explanation in the spoiler: Its used when you need to, well, determine if any of 4 8-bit elements is zero. Its far faste...
Sat Jun 14, 2008 2:29 am UTC
Forum: Coding
Topic: The "what does it do?" thread!
Replies: 11
Views: 1965

### The "what does it do?" thread!

Here we post low-level hacks--assembly, C, whatever--perhaps they're ingenious, or ugly, depending on how you look at them. But the challenge is to figure out what in the world they do. No obfuscation, as that is sort of against the point, IMO. Here's my challenge, which is from an open source proje...
Wed Jun 11, 2008 4:20 am UTC
Topic: 0435: "Purity"
Replies: 649
Views: 199247

### Re: "Purity" Discussion

This reminds me of a discussion I had with a coworker about where the hell video encoding and compression technology falls on the spectrum of various sciences and college majors. Its mostly done by electrical engineers, but that's only because they're the signal processing gurus; they often don't kn...
Sat Apr 12, 2008 9:18 pm UTC
Forum: Coding
Topic: Best C++ compiler for a beginner
Replies: 17
Views: 2393

### Re: Best C++ compiler for a beginner

g++, cygwin.
Mon Apr 07, 2008 6:57 pm UTC
Forum: Religious Wars
Topic: Best language for n00bs
Replies: 261
Views: 107805

### Re: Best language for n00bs

I learned C when I was in third grade. Its an easy language simply because it has so few syntax elements and libraries. Now, doing complex things in it can be more difficult--but the basic concepts can be summed up in a couple pages. I'd say the best three newbie languages are C (NOT C++), Java, Pyt...
Wed Mar 26, 2008 5:35 am UTC
Forum: Coding
Topic: Big O notation
Replies: 16
Views: 3429

### Re: Big O notation

If I have a sorting algorithm that runs in O(n^2) time, that means that the amount of time to complete it grows exponentially If it grew exponentially, it'd be O(2^n) or similar. The word you're looking for is "quadratically". If adding a single element to the array doubles the number of ...
Tue Mar 18, 2008 4:20 pm UTC
Forum: Coding
Topic: Worst (Best?) Hacks
Replies: 50
Views: 7740

### Re: Worst (Best?) Hacks

This hack was proposed to avoid memcpying a struct. It was not implemented :lol: . Instead I ended up just writing a fast aligned memcpy that beat the Windows one by about 4x in speed. 1. Copy struct into XMM/MM vector registers. 2. Pass the original struct to the function that would have otherwise ...
Tue Mar 18, 2008 3:59 pm UTC
Forum: Coding
Topic: Summer of Code 2008
Replies: 8
Views: 2030

### Summer of Code 2008

I'm quite surprised there isn't an SoC 2008 thread yet; the announcements on which organizations were accepted were sent out yesterday! Who here is planning to apply for SoC? I'm mentoring for x264's SoC , sponsored by VideoLan. ffmpeg and Videolan have already gotten quite a number of interested st...
Fri Feb 29, 2008 11:29 pm UTC
Forum: Gaming
Topic: best space RTS
Replies: 26
Views: 6414

### Re: best space RTS

Homeworld 1, period.
Thu Feb 21, 2008 12:57 am UTC
Forum: Gaming
Topic: Touhou!
Replies: 141
Views: 34800

### Touhou!

Some of you may have heard of Touhou, some not. For those of you who haven't, your typical gameplay session looks something like this: http://i26.tinypic.com/1zml6ah.jpg Touhou is a series of Japanese "curtain fire"/"bullet hell" shooters from the mysterious developer ZUN, who ha...
Thu Feb 21, 2008 12:50 am UTC
Forum: Gaming
Topic: EVE Online
Replies: 4828
Views: 656135

### Re: EVE Online

I'm juggling World of Warcraft with EVE Online's free trial, and so far EVE Online has a lot of just watching your space ship fly around. At least in games where you travel on foot, you have some scenery in place of the vast void of space. I'm traveling around looking for asteroids that carry ore o...
Fri Feb 01, 2008 5:59 am UTC
Topic: 0378: "Real Programmers"
Replies: 201
Views: 58945

### Re: Real Programmers Discussion

Real programmers subconsciously alter the laws of the cosmos so that their code does what they want it to do, regardless of correctness.

Or they more blatantly alter the cosmos to summon a superintelligent alien that fixes their code for them.
Wed Jan 30, 2008 10:08 pm UTC
Forum: General
Topic: Logical fallacies/douchebaggery in commercials.
Replies: 4973
Views: 760886

### Re: Logical fallacies/douchebaggery in commercials.

Habanero wrote:Heard this one the other day. I'm still wrapping my head around it. It was an advertisement for a "paranormal reality show". Paranormal reality? That reminds me of my second marriage.
The world's most popular paranormal/supernatural reality show, obviously.
Wed Jan 30, 2008 9:35 pm UTC
Forum: General
Topic: Logical fallacies/douchebaggery in commercials.
Replies: 4973
Views: 760886

### Re: Logical fallacies/douchebaggery in commercials.

Bad commercials: apply directly to brain.
Bad commercials: apply directly to brain.
Bad commercials: apply directly to brain.
Bad commercials: apply directly to brain.
Bad commercials: apply directly to brain.
Wed Jan 30, 2008 1:31 am UTC
Forum: General
Topic: Unbelievable video compositing/3D animation skills.
Replies: 15
Views: 2543

### Re: Unbelievable video compositing/3D animation skills.

I'm absolutely stunned by this. I cannot imagine how one could even start on such a thing--or what programs one would use--but its hilarious nonetheless. Feel free to skip about 3 minutes in to where the fight starts--but the huge laughs don't begin until you see the weapon used in place of Neo's p...
Tue Jan 29, 2008 9:54 pm UTC
Forum: General
Topic: Unbelievable video compositing/3D animation skills.
Replies: 15
Views: 2543

### Re: Unbelievable video compositing/3D animation skills.

Colin's Bear is superior. OH. MY. GOD. That is WAY superior... The fight video is good however, especially the way the hair moves naturally with the movements :D The hair was good, but those upskirts have changed the way I think about the matrix. I think it was pretty much impossible to avoid that ...
Tue Jan 29, 2008 8:33 am UTC
Forum: General
Topic: At what ages have you experienced changes of faith?
Replies: 160
Views: 11978

### Re: At what ages have you experienced changes of faith?

I've always been agnostic since I first considered the question, as I go by the logic that one cannot possibly prove God's existence (or non-existence), or more importantly, the existence of a particular brand or type of God. In particular, I've always strongly doubted the existence of a God exactly...
Tue Jan 29, 2008 5:38 am UTC
Forum: General
Topic: Unbelievable video compositing/3D animation skills.
Replies: 15
Views: 2543

### Re: Unbelievable video compositing/3D animation skills.

Every version I found on Youtube had out of sync audio. I'm guessing its because the original has a somewhat odd framerate scheme (possibly VFR or with null frames) that screws up Youtube's converter.
Tue Jan 29, 2008 3:32 am UTC
Forum: General
Topic: Unbelievable video compositing/3D animation skills.
Replies: 15
Views: 2543

### Unbelievable video compositing/3D animation skills.

I was browsing Nicovideo (Japanese Youtube-like site) the other day when I came across one of the most amazing videos I've seen in ages. Remember the scene in The Matrix Reloaded, where Neo fights off dozens of copies of Agent Smith? Well, the video was of that scene--except Neo was replaced . Yes.....
Tue Jan 22, 2008 3:56 am UTC
Topic: 0373: "The Data So Far"
Replies: 243
Views: 44143

### Re: The Data So Far Discussion

Haruhi might disagree with this comic.
Fri Jan 18, 2008 3:07 am UTC
Forum: General
Topic: Video editing
Replies: 10
Views: 1637

### Re: Video editing

Doom9 isn't just a good resource for DVDs--its a good resource for everything related to video, period.
Thu Jan 17, 2008 3:48 am UTC
Forum: Coding
Topic: How many programming languages do you know?
Replies: 119
Views: 36130

### Re: How many programming languages do you know?

Use daily:

C
Bash

Use often:

Java
C++
Python

Use rarely:
Scheme
Prolog
Basic
x86 Assembly
Mon Jan 14, 2008 7:08 pm UTC
Forum: Computer Science
Topic: Lossy non-frequency-based image compression methods
Replies: 0
Views: 2022

### Lossy non-frequency-based image compression methods

Let us take this 16x16 macroblock from a video I recently encoded: http://i6.tinypic.com/733e91u.png It was encoded using H.264, which has the best intra prediction of all modern video codecs. Using 4 8x8 DCTs and CABAC compression, it was compressed down to... wait for it ... 2399 bits at QP15. Tha...
Sat Jan 12, 2008 7:07 pm UTC
Forum: Coding
Topic: AVI- Writing an video analyzer - Help
Replies: 12
Views: 2554

### Re: AVI- Writing an video analyzer - Help

You can use Avisynth's interface for handling video analysis; its relatively easy to code a plugin with the Avisynth API.
Fri Jan 04, 2008 5:14 am UTC
Replies: 125
Views: 29315

Your mom told me that she thinks there have been too many "your mom" XKCD comics lately.
Fri Jan 04, 2008 3:23 am UTC
Topic: 0365: "Slides"
Replies: 45
Views: 12441

### Re: "Slides" Discussion

alt-text: "Did you know they can actually physically throw you out of SIGGRAPH? If only they were that forceful at other conferences. I spent half an hour watching this terrible short film at OOPSLA in October that had the production values of a 10th grade student project. She followed it up b...
Thu Jan 03, 2008 3:08 pm UTC
Forum: Coding
Replies: 98
Views: 10610

I don't really see anything wrong with that. Yes, it looks dumb, but if this class does all those things, it should be implementing all of those (I'm also assuming those are nontrivial interfaces and that they are used more than once in the whole project. If this came from INDIA or China, that's pr...
Thu Jan 03, 2008 3:44 am UTC
Forum: Coding
Replies: 98
Views: 10610

public class ScheduleItemDisplay implements MessageListener, ErrorListener, HelpRequestListener, OpenScheduleListener, AttributeBigListListener, OKListener, DeleteScheduleListener, RefreshScheduleListListener, ScheduleWeekChangeListener, NetworkChangeListener, ScheduleItemListener, LayoutChangedLis...
Thu Jan 03, 2008 12:18 am UTC
Topic: 0365: "Slides"
Replies: 45
Views: 12441

### Re: "Slides" Discussion

alt-text: "Did you know they can actually physically throw you out of SIGGRAPH? If only they were that forceful at other conferences. I spent half an hour watching this terrible short film at OOPSLA in October that had the production values of a 10th grade student project. She followed it up b...
Sun Dec 30, 2007 4:22 am UTC
Forum: Computer Science
Replies: 31
Views: 15221

### Re: Have you read SICP

http://mitpress.mit.edu/sicp/full-text/book/book.html
best book around for anyone who hopes to become an EXPERT PROGRAMMER!

Somehow I suspect the OP of this thread posts on /prog/.

Just somehow

Mon Dec 03, 2007 1:11 am UTC
Forum: Religious Wars
Topic: Is there anything better than Lisp?
Replies: 56
Views: 11896

### Re: Is there anything better than Lisp?

The basic concept of Lisp is genius. The implementation is mediocre. The usefulness is zero.

However, even though Lisp is useless for real programming, it is still the only way to achieve Satori.
Sat Dec 01, 2007 9:31 am UTC
Forum: Coding
Topic: Program in C/C++? Ultimate optimization tool!
Replies: 17
Views: 3175

### Re: Program in C/C++? Ultimate optimization tool!

Anpheus wrote:So what exactly does this measure?
It measures the average time it takes to reach STOP_TIMER from START_TIMER in the tenths of clock cycles.
Sat Dec 01, 2007 8:28 am UTC
Forum: Coding
Topic: Program in C/C++? Ultimate optimization tool!
Replies: 17
Views: 3175

### Re: Program in C/C++? Ultimate optimization tool!

EvilSporkMan wrote:Uhhh, isn't the number of cycles for a NOP just the length of the pipeline?
Theoretically yes, but I'm pretty sure the Core 2's pipeline is neither 65 nor 6.5 clock cycles deep (I think its 12 or 14?)
Sat Dec 01, 2007 4:11 am UTC
Forum: Coding
Topic: Program in C/C++? Ultimate optimization tool!
Replies: 17
Views: 3175

### Re: Program in C/C++? Ultimate optimization tool!

Cool but it should be decacycles. (Tens of cycles.) I think as a profiling tool this is neat but the accuracy is a little poor, there are numerous code profiling methods that provide far greater accuracy. This is just a 'quick and dirty' test if you don't have any existing profiler. 2 clock cycles ...
Fri Nov 30, 2007 9:38 pm UTC
Forum: Coding
Topic: Program in C/C++? Ultimate optimization tool!
Replies: 17
Views: 3175

### Program in C/C++? Ultimate optimization tool!

Program in C++/C and can't decide whether that early termination threshold is more trouble than its worth, or whether turning that nested if into a switch actually helps? Are your changes too negligible to measure effectively with the time command? Then try this .h file, from FFMPEG! #include <stdio...
Tue Nov 27, 2007 9:57 am UTC
Forum: Coding
Topic: Trying to write a log function
Replies: 10
Views: 2376

### Re: Trying to write a log function

If you really want fun, write up some libraries for fixed-point integer-math versions of common complex floating point operations (log, sqrt, cos, etc) using a combination of fuzzy math and lookup tables

Its quite good for programs that don't need flawless accuracy but need to run fast.
Tue Nov 27, 2007 9:55 am UTC
Forum: Coding
Topic: Detecting CPU instabilities using a CPU stressing program.
Replies: 4
Views: 1403

### Re: Detecting CPU instabilities using a CPU stressing program.

If you want to maximize CPU load, you want:

a) As many of the processing units on the CPU engaged at once as possible (FPU, integer, everything).
b) NO time lost on branch mispredictions.
c) MINIMAL time lost fetching things from memory

This is why Prime95 is so good.
Mon Nov 26, 2007 3:52 pm UTC
Forum: Coding
Topic: Assembly... BUH BUM BAAHH
Replies: 90
Views: 23898

### Re:

I thought that the JIT compiler used by modern Java VMs pretty much settled this issue. Is Java still slower than C++? Last time I looked (maybe 7 years ago) there was only a 10% difference between the two. But yet nobody sane would ever consider writing, say, a video encoding in Java. I wonder why...
Sat Nov 24, 2007 5:41 am UTC
Forum: Coding
Topic: Fun with cache lines!
Replies: 2
Views: 1870

### Re: Fun with cache lines!

'; DROP DATABASE;-- wrote:I remember reading this on The Daily WTF, and wanting to reply "The real WTF is Intel", but not being registered. So there you go.

Yay for crossposting to multiple forums read by the same people