Search found 2904 matches

by Xenomortis
Tue Sep 20, 2016 4:09 pm UTC
Forum: Coding
Topic: faster function than 1/x?
Replies: 18
Views: 9099

Re: faster function than 1/x?

I seem to remember reading that the union variant is only safe in GCC, but I never really properly understood the logic around union aliasing rules from the standard.
by Xenomortis
Tue Sep 13, 2016 2:25 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9907
Views: 1858308

Re: Coding: Fleeting Thoughts

Eclipse 'Problems' tab wrote:Warnings (100 of 8365)

Yeah...

Actually, this wasn't highlighted in a warning.
And to be fair, testing for referential equality on objects may be something you really want to do, although it's almost certainly not what you have in mind when Strings are involved.
by Xenomortis
Tue Sep 13, 2016 1:25 pm UTC
Forum: Science
Topic: Science-based what-if questions
Replies: 622
Views: 104631

Re: Core orbiting planet.

Magmar, obviously.
by Xenomortis
Tue Sep 13, 2016 11:39 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9907
Views: 1858308

Re: Coding: Fleeting Thoughts

Oh, I've known for a long time. But typing "==" is so instinctive that I often trip up (excluding Strings, equality testing for non primitives is really quite rare in our codebase, and it works as expected in every other language I've used). That it sometimes "appears" works is w...
by Xenomortis
Tue Sep 13, 2016 10:05 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9907
Views: 1858308

Re: Coding: Fleeting Thoughts

I've just fixed a bug in some code I wrote that compared Java strings using == instead of String.equals(...). This is ridiculous. String overloads "+" to do the "intuitive" thing, but not "==". But that's not the worst bit; the worst bit is that "==" will actu...
by Xenomortis
Tue Sep 06, 2016 4:29 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9907
Views: 1858308

Re: Coding: Fleeting Thoughts

*Looks at a Java interface with a "write" method*
*Clicks, "Search for References" in Eclipse*
*Gets given a result of all calls to methods called "write", ignoring the interface*

Why do I bother with IDEs again?
by Xenomortis
Thu Aug 25, 2016 9:00 am UTC
Forum: Coding
Topic: Why does .NET seem so ugly?
Replies: 5
Views: 5683

Re: Why does .NET seem so ugly?

However, whenever I have to spin up a Visual Studio IDE, it's overwhelming and very complicated. ... even Eclipse seem intuitive. Eclipse is more intuitive than Visual Studio? I guess it's possible with a Java background... So, starting up Visual Studio, I count about six clicks to get something th...
by Xenomortis
Wed Aug 24, 2016 3:15 pm UTC
Forum: Mathematics
Topic: Goahead52's Math Posts
Replies: 148
Views: 16575

Re: Goahead52's Math Posts

The following is an identity - it is true for all (real) x:
sin2(x) + cos2(x) = 1
This is a useful identity, but it places no constraints on x.

The following is not an identity - it is not true for all x.
sin(x) + cos(x) = 1
This equation tells us x is an integer multiple of pi/2.
by Xenomortis
Fri Aug 19, 2016 9:30 am UTC
Forum: Coding
Topic: Bettering vs Bloat?
Replies: 19
Views: 7699

Re: Bettering vs Bloat?

Don't confuse features with bloat. By today's standards, Doom 1 was a relatively simple project. Here are a few statements that I strongly suspect to be true: * Doom 3's physics engine is an order of magnitude more complex than all of Doom 1 combined. * Doom 3's network code is more complex than al...
by Xenomortis
Wed Aug 17, 2016 9:56 pm UTC
Forum: Mathematics
Topic: Goahead52's Math Posts
Replies: 148
Views: 16575

Re: New Theorem (prime numbers)?

I think you can prove a slightly stronger statement, that is mu(n * phi(n)) != 0 implies n is prime. My maths is a little rusty, but I'll give it a go. Suppose n is *not* prime. Case 1: n is not square-free Then n * phi(n) is not square-free, hence mu(n*phi(n)) = 0 Case 2(a): n is square-free and ha...
by Xenomortis
Wed Aug 17, 2016 3:27 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1721: "Business Idea"
Replies: 55
Views: 10306

Re: 1721: "Business Idea"

I really doubt that the addition of a hose-worth amount of petrol will hurt your diesel engine, given a full tank of the correct fuel (or vice-versa). I have heard that around 10-20% of the wrong fuel won't cause issues, but I haven't found a credible source (not that I've really looked). Sounds li...
by Xenomortis
Wed Aug 17, 2016 2:55 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1721: "Business Idea"
Replies: 55
Views: 10306

Re: 1721: "Business Idea"

In the UK, it is different hoses for the different grades of fuel. And its mostly self service, You'll find many a Scotsman draining the hose and shaking the last drop off the end. Australia too. I had never thought anyone would do otherwise, so I'd thought the idea in the comic was even less sensi...
by Xenomortis
Mon Aug 15, 2016 6:10 pm UTC
Forum: Mathematics
Topic: Decimal like Concepts in Other Bases?
Replies: 7
Views: 2532

Re: Decimal like Concepts in Other Bases?

17 is 16 + 1 (2 4 + 2 0 ), so that's 10001. 0.32 is a little more tricky - you need to work out 32 / 100 in binary (specifically, 100000 2 / 1100100 2 ) - you can do the long division if you want, the technique is the same as it is in base 10. It won't be terminating - easy decimal expansions seldom...
by Xenomortis
Mon Aug 15, 2016 5:02 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9907
Views: 1858308

Re: Coding: Fleeting Thoughts

TIL git automatically rewrites line endings... but only in the commits/compares and won't do it on disk... Though this is sort of disturbing, that means two different developers can have two different line ending settings in the same repository and cause each other headaches like this? Line ending ...
by Xenomortis
Mon Aug 15, 2016 4:50 pm UTC
Forum: Mathematics
Topic: Decimal like Concepts in Other Bases?
Replies: 7
Views: 2532

Re: Decimal like Concepts in Other Bases?

Digits in a decimal expansion merely represent multiples of a power of 10. So for instance: 17.32 is 1 * 10 1 + 7 * 10 0 + 3 * 10 -1 + 2 * 10 -2 That is "One 10, seven 1's, three 10ths, two 100ths". The idea is the same for other number bases, but instead of powers of 10, it's powers of th...
by Xenomortis
Thu Aug 11, 2016 3:30 pm UTC
Forum: Mathematics
Topic: N digit sequence within π
Replies: 12
Views: 2776

Re: N digit sequence within π

https://en.wikipedia.org/wiki/Normal_number
Pi is conjectured (but not proven) to be Normal - that all finite sequence of digits are equally likely to occur (in any base expansion).
by Xenomortis
Fri Jul 29, 2016 8:48 am UTC
Forum: General
Topic: Snappy Comebacks for Impudent Door-Holders
Replies: 17
Views: 5626

Re: Snappy Comebacks for Impudent Door-Holders

I usually say "Thanks" to whoever held the door - preempting the shame inducing "Your Welcome". Alternatives are "Cheers", "Ta". But if there are four doors in quick succession, you run out of options. (The article mentions being scolded before having a chance...
by Xenomortis
Thu Jul 21, 2016 9:22 pm UTC
Forum: Gaming
Topic: Overwatch
Replies: 173
Views: 44525

Re: Overwatch

http://us.battle.net/forums/en/overwatch/topic/20747185139 Added Ana. Buffed D.Va, McCree and Zenyatta. Self-healing charges ultimates (increased the cost correspondingly on a few heroes). The fall off damage for McCree's left click got reduced, greatly improving his damage output at range - Widowma...
by Xenomortis
Thu Jul 21, 2016 2:02 pm UTC
Forum: News & Articles
Topic: In other news... (humorous news items)
Replies: 15026
Views: 2436698

Re: In other news... (humorous news items, etc)

Perhaps I have like a mental filter that like automatically elides the word like.
Because I'm like that age where like was once really common.
by Xenomortis
Thu Jul 21, 2016 10:32 am UTC
Forum: News & Articles
Topic: In other news... (humorous news items)
Replies: 15026
Views: 2436698

Re: In other news... (humorous news items, etc)

I don't know, I'm having a hard time parsing that any other way.
by Xenomortis
Wed Jul 20, 2016 6:21 pm UTC
Forum: Gaming
Topic: Overwatch
Replies: 173
Views: 44525

Re: Overwatch

I've managed to play one quick match game with Ana (no way am I playing her when we have two on our team already). The ultimate is strong. The abilities seem decent too (although the sleep dart is hard to use in quick match - team mates wake enemies up too early). Her shots seem to be projectiles - ...
by Xenomortis
Mon Jul 18, 2016 5:27 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1708: "Dehydration"
Replies: 109
Views: 15373

Re: 1708: "Dehydration"

orthogon wrote:The claim that tea and coffee don't count because they actually dehydrate you is particularly ridiculous.

Indeed - Tea doesn't count because it occupies a different position in the hierarchy of needs. :wink:
by Xenomortis
Mon Jul 18, 2016 5:23 pm UTC
Forum: Gaming
Topic: Overwatch
Replies: 173
Views: 44525

Re: Overwatch

4th most played is Bastion. Please don't hate me. That's nothing, my most played in Quick Match is Hanzo. 8-) I have a fair amount of time on Reaper, Soldier and Pharah. Not that long on Mercy and very little on Lucio (< 1 hour). I don't really like playing support, especially in Quick Match. You'r...
by Xenomortis
Mon Jul 18, 2016 4:10 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1708: "Dehydration"
Replies: 109
Views: 15373

Re: 1708: "Dehydration"

I go by the rule of "if I feel thirsty, I have a drink".
That rule has worked for my ancestors, so it's good enough for me.
by Xenomortis
Mon Jul 18, 2016 2:37 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9907
Views: 1858308

Re: Coding: Fleeting Thoughts

Eh, over half of my frustrations at work are caused by the IDE (I spend a stupid amount of energy being angry with Eclipse). Not that much is spent being angry at the limitations of Java. For the past five or so weeks, I was working on a python project at work (the aforementioned "amazing_proje...
by Xenomortis
Mon Jul 18, 2016 9:29 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9907
Views: 1858308

Re: Coding: Fleeting Thoughts

Honestly, the most useful tests that guarded against regression were not the "unit" tests, but the "integration" tests. The unit tests had some value in development (I could quickly verify code I'd just written), but took required a fair amount of mental effort - a lot of mocking...
by Xenomortis
Sat Jul 16, 2016 8:58 pm UTC
Forum: Gaming
Topic: Overwatch
Replies: 173
Views: 44525

Re: Overwatch

So I've finally tried the competitive mode and gone through the 10 placement matches. The tie-break mechanism is terrible . It wouldn't matter so much, except it's really common for both teams to successfully complete all the objectives (unless one team is much stronger). The attacking team in sudde...
by Xenomortis
Fri Jul 15, 2016 12:33 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9907
Views: 1858308

Re: Coding: Fleeting Thoughts

TDD: a development technique for doubling the amount of code you have to maintain.

Code: Select all

> cd amazing_project
> sloccount src
1,500
> sloccount tests
3,500
by Xenomortis
Thu Jul 14, 2016 9:00 am UTC
Forum: News & Articles
Topic: British EU referendum in June [update: Leave wins 52% - 48%, politics ensue]
Replies: 1280
Views: 198144

Re: British EU referendum in June [update: Leave wins 52% - 48%, Cameron to resign by October]

David Davis' has shared some of his views on Brexit here: http://www.conservativehome.com/platform/2016/07/david-davis-trade-deals-tax-cuts-and-taking-time-before-triggering-article-50-a-brexit-economic-strategy-for-britain.html TL:DR - he's not a trade expert and is a little hopelessly optimistic, ...
by Xenomortis
Wed Jul 13, 2016 7:43 pm UTC
Forum: News & Articles
Topic: British EU referendum in June [update: Leave wins 52% - 48%, politics ensue]
Replies: 1280
Views: 198144

Re: British EU referendum in June [update: Leave wins 52% - 48%, Cameron to resign by October]

I don't think Boris is "that" crazy a choice. I'm not surprised to see him in cabinet and it's the "obvious" office (if a high one). I'm tempted to read this as an indication as to the sort of EU exit deal May is aiming for - Boris seemed to be for a "softer" exit. Of c...
by Xenomortis
Wed Jul 13, 2016 6:52 pm UTC
Forum: News & Articles
Topic: British EU referendum in June [update: Leave wins 52% - 48%, politics ensue]
Replies: 1280
Views: 198144

Re: British EU referendum in June [update: Leave wins 52% - 48%, Cameron to resign by October]

Cabinet positions are being slowly revealed, and Boris Johnson is Foreign Secretary.
Eh... not sure what I think of that.
by Xenomortis
Wed Jul 13, 2016 9:16 am UTC
Forum: News & Articles
Topic: British EU referendum in June [update: Leave wins 52% - 48%, politics ensue]
Replies: 1280
Views: 198144

Re: British EU referendum in June [update: Leave wins 52% - 48%, Cameron to resign by October]

It would be entirely legal, ministers are regularly replaced halfway through, and there's no rule saying the PM is different, but it is just not done. If the PM resigns, the entire cabinet resigns. Well a new PM means a new cabinet. We're going to see some familiar faces, sure, but also some new on...
by Xenomortis
Tue Jul 12, 2016 11:49 am UTC
Forum: News & Articles
Topic: British EU referendum in June [update: Leave wins 52% - 48%, politics ensue]
Replies: 1280
Views: 198144

Re: British EU referendum in June [update: Leave wins 52% - 48%, Cameron to resign by October]

The party leader directs the course of the party's (and hence the government's) position. Whilst we do not directly "elect" a PM, do not doubt that "Cameron vs Miliband" was a strong factor in the last election, regardless of policy positions. With a new PM, the Tory's strategy w...
by Xenomortis
Mon Jul 11, 2016 11:48 am UTC
Forum: News & Articles
Topic: British EU referendum in June [update: Leave wins 52% - 48%, politics ensue]
Replies: 1280
Views: 198144

Re: British EU referendum in June [update: Leave wins 52% - 48%, Cameron to resign by October]

Sorry for straying a bit off topic, but would you say that your view is widely held? I don't know - I'm fairly pragmatic, particularly compared with my peers (21-25 year old graduates). The reason I don't mind this outcome is because I do not want to see the Conservative party end up in the same si...
by Xenomortis
Mon Jul 11, 2016 11:23 am UTC
Forum: News & Articles
Topic: British EU referendum in June [update: Leave wins 52% - 48%, politics ensue]
Replies: 1280
Views: 198144

Re: British EU referendum in June [update: Leave wins 52% - 48%, Cameron to resign by October]

So Andrea Leadsom is no longer running to be leader of the Conservative Party (and the next PM), leaving Theresa May unopposed. In her speech, she wants May to take the leadership without having a campaign (some speculation that Gove would be allowed to reenter to allow the party membership a choice...
by Xenomortis
Fri Jul 08, 2016 4:08 pm UTC
Forum: Science
Topic: How do satellites not crash into each other?
Replies: 94
Views: 14938

Re: How do satellites not crash into each other?

Not all geosynchronous orbits are geostationary ones.
by Xenomortis
Fri Jul 08, 2016 1:13 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9907
Views: 1858308

Re: Coding: Fleeting Thoughts

The cmp instruction works via subtraction, so the carry flag is set appropriately. Intel syntax now: cmp rdx, 1 Subtract 1 from rdx and adjust flag register, but don't store result to rdx. If rdx > 0 then the carry flag will not be cleared. If rdx == 0 then the carry flag will be set (since the resu...
by Xenomortis
Fri Jul 08, 2016 12:28 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9907
Views: 1858308

Re: Coding: Fleeting Thoughts

I remember reading a stackoverflow answer where someone asked for a function (in x86) that returned the larger of two inputs. It was a homework question, but someone did give an answer that used a similar trick (using carry flags after subtractions) to avoid branches. I believe that someone was Raym...
by Xenomortis
Fri Jul 08, 2016 11:55 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9907
Views: 1858308

Re: Coding: Fleeting Thoughts

I admit I had to check up on the sbb instruction, but I think it's pretty clear (or it would be, if you used sensible syntax). :D
Spoiler:
esi will be -1 (all bits set) if the comparison is false?

Go to advanced search