Search found 2901 matches

by evilbeanfiend
Mon Jun 13, 2011 9:36 pm UTC
Forum: Coding
Topic: best way to store string of 0,s 1,s.
Replies: 11
Views: 4401

Re: best way to store string of 0,s 1,s.

what i dont understand from the descriptions so far is why it has to be as small as possible? the trivial ascii solution gives you < 2kB which is tiny by modern standards. the problem you are trying to solve seems to be to do with encryption, not compression? so why worry about a factor of 8 increas...
by evilbeanfiend
Fri Jun 10, 2011 9:16 pm UTC
Forum: Coding
Topic: junit testing vs system.out printing
Replies: 18
Views: 3533

Re: junit testing vs system.out printing

I'm not sure i can really conceive of a debugger which is harder to use than writing debug out wrapped in preprocessor statements, possibly including header/module to support the output (also in preprocessor statements) and then grepping the source code to remove it all afterwards. sure its possibl...
by evilbeanfiend
Fri Jun 10, 2011 8:04 am UTC
Forum: Coding
Topic: junit testing vs system.out printing
Replies: 18
Views: 3533

Re: junit testing vs system.out printing

#define DEBUG Problem of finding and removing debug code solved. You can now slap DEBUG behind any debug line or debug block. When you don't want it, you can define it to "if(0)", or easily identify the debugging code with grep. well you are 80% of the way to just using proper logging now...
by evilbeanfiend
Wed Jun 08, 2011 8:39 pm UTC
Forum: Coding
Topic: junit testing vs system.out printing
Replies: 18
Views: 3533

Re: junit testing vs system.out printing

Eh, printing stuff out is still my preferred way of debugging. Debuggers are too cumbersome to use. (Also, debuggers aren't. The bugs are still there even if you run a debugger on it.) *Good* debuggers are easy to use. If you are adding new code to diagnose something you either need to remember to ...
by evilbeanfiend
Wed Jun 01, 2011 9:48 pm UTC
Forum: Coding
Topic: junit testing vs system.out printing
Replies: 18
Views: 3533

Re: junit testing vs system.out printing

printing out stuff is more of a poor man's debugger than a poor man's unit test (though its actually logging) in industry we would use unit test to find out what is failing and debuggers to find out why. lastly there still is a place for 'printing stuff out' but we call it logging, it is primarily u...
by evilbeanfiend
Wed Jun 01, 2011 9:19 pm UTC
Forum: Computer Science
Topic: Frontiers in Data Indexing
Replies: 25
Views: 3126

Re: Frontiers in Data Indexing

Yes 2d and higher data structures are cool, and have many uses e.g. spatial indexing, but even this can be done in 1d if you want, you can have a 1d structure that maps to a space filling curve with with good locality. i must say i prefer the genuinely multidimensional structures myself though, they...
by evilbeanfiend
Fri Mar 04, 2011 2:55 pm UTC
Forum: Coding
Topic: What can I do with random numbers?
Replies: 23
Views: 3060

Re: What can I do with random numbers?

DSP simulation usually needs good quality random numbers to simulate noise
by evilbeanfiend
Sun Feb 06, 2011 2:12 pm UTC
Forum: Science
Topic: Non-alcoholic Flambe
Replies: 23
Views: 6206

Re: Non-alcoholic Flambe

how much alcohol would be left after you burnt it anyway?
by evilbeanfiend
Thu Jan 06, 2011 11:27 pm UTC
Forum: Science
Topic: scientific field
Replies: 22
Views: 2216

Re: scientific field

Thats a lot of time, during which you have no job security (for a lot of it, you'll be applying for work every two years or so). Most of the people I know trying to make it in the field are approaching 35, have nothing saved for retirement, have never made more than $45,000 a year, complain they ha...
by evilbeanfiend
Tue Aug 24, 2010 8:45 pm UTC
Forum: Science
Topic: Ok, seriously, rounding
Replies: 16
Views: 2201

Re: Ok, seriously, rounding

Bankers rounding is particularly good at eliminating bias from sums of numbers, assuming they aren't distributed to favour rounding in a particular direction, a rounding bias on a single numebr is small but if you have a bias in the same direction on potentially every number in a sum you accumulate ...
by evilbeanfiend
Sat Jul 31, 2010 9:15 am UTC
Forum: Coding
Topic: A Big Ask
Replies: 34
Views: 4494

Re: A Big Ask

vhdl support arbitrary starts and ends, and endianness, but that's just a little specialised
by evilbeanfiend
Fri Jul 30, 2010 6:51 am UTC
Forum: Coding
Topic: [Unnecessarily-] Compact coding tricks
Replies: 112
Views: 14282

Re: [Unnecessarily-] Compact coding tricks

the original unnecessary compact coding trick is probably APL :wink:
by evilbeanfiend
Wed Jul 28, 2010 10:00 pm UTC
Forum: Science
Topic: How does one become a famous scientist?
Replies: 84
Views: 13864

Re: How does one become a famous scientist?

Check out this Hertzsprung-Russel diagram for media stars. Someone on that blog plotted no. of publications against fame (no. of Google hits) 20100719_astronomer_HR_diagram.png Fantastic! but at the same time depressing! myleene klass is probably going to be a more famous physicist then anyone here...
by evilbeanfiend
Mon Jul 26, 2010 10:38 pm UTC
Forum: Coding
Topic: A Big Ask
Replies: 34
Views: 4494

Re: A Big Ask

It was made into a class mainly as practice for using them, maybe it should be kept as a function? either works but thats not the point, the point was you are currently doing the equivalent of practising using a screwdriver by using it to hammer nails, but i wouldn't worry about it worry about it t...
by evilbeanfiend
Fri Jul 02, 2010 5:03 pm UTC
Forum: Coding
Topic: Fastest membership testing in C#?
Replies: 4
Views: 738

Re: Fastest membership testing in C#?

probably a hashset is what you want http://msdn.microsoft.com/en-us/library/bb359438.aspx
by evilbeanfiend
Thu Jun 24, 2010 6:30 pm UTC
Forum: Coding
Topic: Baffling Error in C#?
Replies: 9
Views: 1161

Re: Baffling Error in C#?

class Test<T> where T : class { public T Recast(object instance) { return instance as T;} } not tested but i believe this is correct, the reason this is necessary is that as requires a reference type (it has to return null if the cast is not valid) hence you have to constraint your method to only e...
by evilbeanfiend
Mon Jun 07, 2010 6:18 am UTC
Forum: Science
Topic: Cancel Laser
Replies: 8
Views: 1408

Re: Cancel Laser

of course unless your beams are exactly out of phase, have exactly the same frequencies and amplitudes and are co-located they won't cancel everywhere at once.
by evilbeanfiend
Sat Jun 05, 2010 8:36 am UTC
Forum: Science
Topic: Sound can't travel in a vacuum. Can it travel in plasma?
Replies: 20
Views: 2951

Re: Sound can't travel in a vacuum. Can it travel in plasma

And I'm finding that I've had to question basic things that I was taught previously. That's fairly standard though, everyone is taught 'lies to children' at first, then later 'lies to teenagers' Currently I'm finding that the 'lies to bachelor students' are getting replaced by 'lies to people with ...
by evilbeanfiend
Wed May 26, 2010 8:34 pm UTC
Forum: Coding
Topic: Manufactoria - Make Turing Machines with Conveyor Belts
Replies: 350
Views: 81244

Re: Manufactoria - Make Turing Machines with Conveyor Belts

BobTheElder wrote:Also, can someone tell me why
Spoiler:
adding 3 reds

works for soldiers? I'm sure it's obvious but like I said, I can't think any more.


Spoiler:
left shift is the same as multiplying by the base, so by 2 for binary, adding 3 reds is 3 left shifts 2^3 = 8
by evilbeanfiend
Tue May 25, 2010 5:57 pm UTC
Forum: Coding
Topic: Why did you switch to Java?
Replies: 32
Views: 4086

Re: Why did you switch to Java?

why did it become popular? cos sun spent a lot of money marketing it
by evilbeanfiend
Tue May 25, 2010 5:01 pm UTC
Forum: Coding
Topic: Manufactoria - Make Turing Machines with Conveyor Belts
Replies: 350
Views: 81244

Re: Manufactoria - Make Turing Machines with Conveyor Belts

I still haven't got past the sorting one. The solution that I came up with works for the most part, but is prone to getting stuck in an infinite loop. (Which I guess means that it doesn't actually work). hint try first designing a machine that checks if the sequence is sorted also a number of my sa...
by evilbeanfiend
Tue May 18, 2010 10:40 pm UTC
Forum: Science
Topic: what would happen?
Replies: 6
Views: 809

Re: what would happen?

yes if it doesn't set it should eventually flow around the world. but don't knock the gravitational non-uniformity stuff it's fascinating in its own right -> http://www.pdana.com/AFiles/AF99.html
by evilbeanfiend
Tue May 18, 2010 9:36 pm UTC
Forum: Coding
Topic: Object Oriented Programming... In Java!
Replies: 12
Views: 2004

Re: Object Oriented Programming... In Java!

on why the OP failed, it sounds like their classes had to many responsibilities
by evilbeanfiend
Tue May 18, 2010 9:32 pm UTC
Forum: Science
Topic: what would happen?
Replies: 6
Views: 809

Re: what would happen?

it wouldn't be spherical for starters. for one the earth is rough a prolate ellipsoid, secondly it isn't uniformly dense, consequently even the mean sea level varies from the ellipsoid.

it would also suck to cover everything in tarmac :cry:
by evilbeanfiend
Tue May 18, 2010 8:48 pm UTC
Forum: Coding
Topic: Why God is so l33t
Replies: 64
Views: 6925

Re: Why God is so l33t

god does not exist, the universe bootstrapped itself.
by evilbeanfiend
Tue May 04, 2010 8:29 pm UTC
Forum: Science
Topic: Naturalness of homosexual behavior
Replies: 41
Views: 6079

Re: Naturalness of homosexual behavior

If lesbians account for even a conservative 5% of the population, you'd expect two randomly selected women to both be lesbians 1/400 of the time. Considering the number of people we all know, I'd say the unusual thing would be if no one posting in this thread knew anyone in that situation. everyone...
by evilbeanfiend
Sun May 02, 2010 7:53 pm UTC
Forum: Science
Topic: Naturalness of homosexual behavior
Replies: 41
Views: 6079

Re: Naturalness of homosexual behavior

Surgery with a placebo pain reliever? I'm gonna call [citation needed] on that, since I doubt such a study would pass many ethics boards... For your information, there was an appendectomy performed on an non-sedated patient who was under hypnosis on an episode of scrubs , or were you just talking a...
by evilbeanfiend
Sat Apr 17, 2010 9:01 pm UTC
Forum: Science
Topic: public misconceptions
Replies: 1073
Views: 130528

Re: public misconceptions

public misconception: it is a good idea to keep small animals (usually rodents) on wood shavings. wood shavings are linked to respiratory problems in humans and animals. also when mixed with urine will produce phenols (Mlle. Bean says she can draw the mechanism if anyone is interested) which are not...
by evilbeanfiend
Sat Apr 17, 2010 5:27 pm UTC
Forum: Coding
Topic: Linux C++ IDE Recommendations
Replies: 30
Views: 4348

Re: Linux C++ IDE Recommendations

yes some of them do, but may take some setting up iirc. personally i just stick with dabbrev-expand which is very simple but will complete from tests and comments

also http://freshmeat.net/projects/gccsense
by evilbeanfiend
Sat Apr 17, 2010 12:47 pm UTC
Forum: Religious Wars
Topic: Skynet
Replies: 44
Views: 10284

Re: Skynet

I hate to break it to you, but skynet already exists, and already has access to nuclear missiles: http://en.wikipedia.org/wiki/Skynet_%28satellites%29 skynet does not have access to nukes, and almost certainly isn't capable of arbitrary computation let alone becoming self aware (certainly the early...
by evilbeanfiend
Sat Apr 17, 2010 12:11 pm UTC
Forum: Coding
Topic: Linux C++ IDE Recommendations
Replies: 30
Views: 4348

Re: Linux C++ IDE Recommendations

Personally, I love using Emacs for C (zomg, the auto-indent is AMAZING), and I'd use it for everything if it had autocomplete, but of course it doesn't. er emacs has several auto-complete modes dabbrev-expand (M-/ by default iirc), hippie-expand, tags etc. http://www.emacswiki.org/emacs/CategoryCom...
by evilbeanfiend
Sat Apr 17, 2010 8:56 am UTC
Forum: Science
Topic: Physics vs Bio: Sensitivity
Replies: 36
Views: 3239

Re: Physics vs Bio: Sensitivity

isn't looking at the range without looking at the resolution rather pointless? should we not be looking at the total number of differentiatable states
by evilbeanfiend
Thu Apr 15, 2010 6:04 pm UTC
Forum: Science
Topic: Assumptions that the Scientific Method makes?
Replies: 45
Views: 4325

Re: Assumptions that the Scientific Method makes?

using this sort of argument http://www.ditext.com/carroll/tortoise.html there are innumerable assumptions that science has to make, no?
by evilbeanfiend
Wed Apr 14, 2010 8:29 pm UTC
Forum: Coding
Topic: Returning a string in C++
Replies: 7
Views: 1014

Re: Returning a string in C++

RVO & NRVO are the usual optimizaions
by evilbeanfiend
Wed Apr 14, 2010 5:29 pm UTC
Forum: Coding
Topic: Returning a string in C++
Replies: 7
Views: 1014

Re: Returning a string in C++

i'd say, unless you have reason not to, return by value. it will mean the string is copied but most of the time that is ok. if profiling shows you can't afford copying the string then look at doing something else.

oh and never ever return a local or temporary by reference, it is always wrong.
by evilbeanfiend
Sat Apr 10, 2010 12:22 pm UTC
Forum: Science
Topic: Humans born on Mars
Replies: 58
Views: 3887

Re: Humans born on Mars

I mean, at the poles, the magnetosphere doesn't protect, and there are huge radiation risks being there. got a reference for this? the only stuff I can find about radiation risk is about commercial airlines crew getting doses similar to those working in the nuclear industry, with a suggestion that ...
by evilbeanfiend
Fri Apr 09, 2010 5:22 pm UTC
Forum: Science
Topic: Humans born on Mars
Replies: 58
Views: 3887

Re: Humans born on Mars

So earth's magnetic field helps prevent cancer? Cool! How? It protects us from solar radiation. As you probably know, radiation isn't so great for the whole not-having-cancer thing. er isn't it actually the atmosphere itself that predominantly protects us from solar radiation? its also about 1.5 ti...
by evilbeanfiend
Fri Apr 09, 2010 4:52 pm UTC
Forum: Science
Topic: Is it possible to coordinate the color of your poop?
Replies: 22
Views: 2278

Re: Is it possible to coordinate the color of your poop?

I can state from experience that drinking large amounts of Blue Curacao results in a dark green colour, while eating large amounts of beetroot (specifically: Borscht) results in a red colour. I discovered when I was younger that large amounts of Grape Kool-Aid also results in green. I think it was ...
by evilbeanfiend
Tue Apr 06, 2010 7:18 am UTC
Forum: Coding
Topic: Random numbers are not random in C++
Replies: 15
Views: 2183

Re: Random numbers are not random in C++

to be fair he doesn't state what he is using rand for, in some dice games it is going to be important, and we did caveat that also the mod % applies somewhat to all deterministic algorithms to fit x*n+y states into n buckets if y != 0 by an argument similar to the pigeon hole principle (of course % ...
by evilbeanfiend
Sun Apr 04, 2010 10:03 pm UTC
Forum: Coding
Topic: Random numbers are not random in C++
Replies: 15
Views: 2183

Re: Random numbers are not random in C++

yes don't call srand everytime. secondly % will introduce a small bias towards numbers <= (RAND_MAX % 6), though this is going to be in the noise here. lastly if you need good quailty random numbers i.e. you are modelling signal noise, doing crypto stuff or money is at stake then you need a better R...

Go to advanced search