Search found 32 matches

by dwarduk2
Tue Sep 03, 2013 1:09 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9968
Views: 1951677

Re: Coding: Fleeting Thoughts

Visual Studio regex syntax can be funky , but otherwise it works most of the time. Sometimes I've had the SQL Server Management Studio give fucked up results for long lists of data (e.g. when turning a list emails or something into a comma separated list, I would do a simple find for \n and replace...
by dwarduk2
Sun Sep 01, 2013 8:52 pm UTC
Forum: Coding
Topic: Missing a Pretty Big Fundamental [ C / C++ / Java ]
Replies: 16
Views: 4742

Re: Missing a Pretty Big Fundamental [ C / C++ / Java ]

For C, gcc. For C++, g++. For Java, javac. I highly doubt you'll find a compiler to handle all three, though both C and C++ isn't uncommon. Your question, especially now you mention PHP, seems to be more about the development environment, though. On Ubuntu, you basically just need a text editor, pre...
by dwarduk2
Mon Aug 26, 2013 8:36 pm UTC
Forum: Logic Puzzles
Topic: Can you crack this?
Replies: 12
Views: 7611

Re: Can you crack this?

If it encodes differently each time, how would the intended recipient decode it? Is there some time-based seed that is somehow communicated separately?
by dwarduk2
Thu Aug 01, 2013 11:28 pm UTC
Forum: Computer Science
Topic: Windows Calculator "invalid input for function"
Replies: 18
Views: 16702

Re: Windows Calculator "invalid input for function"

Just as a sidenote, I use ghci as a calculator for ridiculous things like this. Its output is http://pastebin.com/N8KJBEwQ
by dwarduk2
Fri Jul 26, 2013 12:07 am UTC
Forum: News & Articles
Topic: Anita Sarkeesian used footage from "Let's Play" videos
Replies: 226
Views: 50258

Re: Anita Sarkeesian used footage from "Let's Play" videos

So I just watched the videos because of this post, and I can't see what the fuss is about. Sure, she used some LP clips without permission, a whole second here and there. Nothing unique to the LPers except that exact recording of the game was used. No strategies, playstyles, anything, just enough to...
by dwarduk2
Sat Jun 29, 2013 9:44 pm UTC
Forum: Mathematics
Topic: Exclusive or problems
Replies: 12
Views: 1677

Re: Exclusive or problems

Sorry, I assumed when I saw \cupdot. My bad.
by dwarduk2
Sat Jun 29, 2013 2:11 am UTC
Forum: Mathematics
Topic: Exclusive or problems
Replies: 12
Views: 1677

Re: Exclusive or problems

I'm not sure about the disjoint union; the way I learnt it was that it gives you tuples to ensure that the union is disjoint, rather than taking elements found in only one set. Say A, B and C are indexed by J = {1,2,3}, then the disjoint union is equal to the union of (a \in A, 1), (b \in B, 2), (c ...
by dwarduk2
Fri May 31, 2013 3:42 pm UTC
Forum: Mathematics
Topic: Calculus assignment help?
Replies: 3
Views: 2024

Re: Calculus assignment help?

These look like chain rule questions; the basic pattern is to find two related rates of change and multiply them to find the rate of change overall. So let's look at the first question. Overall you need to find the rate of change of the height of the water with respect to time, but expressed in term...
by dwarduk2
Thu May 02, 2013 11:44 pm UTC
Forum: Mathematics
Topic: Backward Euler Method
Replies: 9
Views: 3806

Re: Backward Euler Method

You can in many cases try using an approximation for the derivative instead of the exact derivative if you want to use Newton's method. I tend to use [f(x+h)-f(x-h)]/2h as my approximation. iirc, the error is O(h^2), so you should make h a small number for best results. It won't generally work for q...
by dwarduk2
Wed Apr 17, 2013 1:38 pm UTC
Forum: Coding
Topic: New to C: Please help!
Replies: 5
Views: 7973

Re: New to C: Please help!

For multiplication, write out two numbers in binary and do long division by hand. Then think about how that could decompose into binary operators. You need bit-shifts, btiwise-AND, addition, an if or ? operator, and a loop construct. You don't need -all- of those, but it's a pain if you cut some of...
by dwarduk2
Sun Apr 14, 2013 2:29 am UTC
Forum: Computer Science
Topic: Level of education
Replies: 11
Views: 7898

Re: Level of education

Just getting towards the end of the first year of my bachelor's in Computer Science, so not far. Gradually starting to feel less like a hobbyist here :)
by dwarduk2
Sun Apr 14, 2013 2:27 am UTC
Forum: Mathematics
Topic: Rearranging y=x^a-x^b
Replies: 6
Views: 4750

Re: Rearranging y=x^a-x^b

I have a hunch that this is actually really hard. Any pointers? If all you care about is solving this, where y is some constant or other, you can probably get pretty good numerical solutions using Newton's method. But we can get somewhere symbolically too. Firstly, y = x^a (1- x^{b-a}) ln(y) = a ln...
by dwarduk2
Sat Apr 13, 2013 2:55 pm UTC
Forum: Mathematics
Topic: Rearranging y=x^a-x^b
Replies: 6
Views: 4750

Re: Rearranging y=x^a-x^b

I was trying to rearrange an equation of the form y= x a - x b so that x is the subject. a and b can be any real number. I have a hunch that this is actually really hard. Any pointers? First off that you can't necessarily solve it exactly for a or b >= 5. Sorry to be a party pooper, but it's not po...
by dwarduk2
Wed Apr 10, 2013 11:00 pm UTC
Forum: Mathematics
Topic: Simple (probably) triangle problem (need help)
Replies: 20
Views: 3405

Re: Simple (probably) triangle problem (need help)

Vectors would seem the way to do it, though I don't know how to use them, and I don't know what a scalar is. And I wouldn't have the first idea how to convert the maths into programming. As you can tell mathematics is not my strong point! I don't think you really need to convert the maths into prog...
by dwarduk2
Wed Apr 10, 2013 10:08 pm UTC
Forum: Mathematics
Topic: Simple (probably) triangle problem (need help)
Replies: 20
Views: 3405

Re: Simple (probably) triangle problem (need help)

EDIT2: WARNING! Bad maths ahead. This does not work at all; leaving the content for posterity I'd solve it using a vector method, myself. If we find a vector going from p1 to p2, or p1 to p3 and take the scalar product of that vector with one of length 1 in the direction of the line you want, you ge...
by dwarduk2
Wed Apr 10, 2013 2:00 pm UTC
Forum: News & Articles
Topic: Transsexual man admits 'tricking' 2 girls into sex
Replies: 342
Views: 29581

Re: Transsexual man admits 'tricking' 2 girls into sex

There is no legal expectation to reveal anything about your past in order to obtain consent [...] even if you've had STDs (as far as I know). I seem to remember that unprotected sex leading to STI transmission without full disclosure* can lead to a bodily harm prosecution in the UK. HIV infection h...
by dwarduk2
Mon Apr 08, 2013 1:28 am UTC
Forum: Logic Puzzles
Topic: A formula to work out a logic puzzle
Replies: 20
Views: 8450

Re: A formula to work out a logic puzzle

So, the first person needs 5 separate jars for their pennies. They put 1 penny in each jar and leave. The second person can reuse one jar, and the 4 other pennies each need 4 new jars. The third person can reuse two jars, and needs 3 more jars. Long story short, the 4th needs two more jars, and the...
by dwarduk2
Mon Apr 08, 2013 12:12 am UTC
Forum: Mathematics
Topic: Different Way of Counting...?
Replies: 15
Views: 2502

Re: Different Way of Counting...?

Just a quick note: if you have an k-digit Gray code, you can generate a k+1-digit Gray code by putting a zero onto the front of all of them, then follow this by putting a one onto the front of the reversed list. E.g. a 2-digit Gray code is 00, 01, 11, 10; from this, a 3-digit Gray code is 0 00, 0 01...
by dwarduk2
Sat Apr 06, 2013 9:00 pm UTC
Forum: Mathematics
Topic: Probabilities with Ω={}
Replies: 12
Views: 2561

Re: Probabilities with Ω={}

P(X or X) = P(X)+P(X)-P(X and X) Another of the axioms I'm using is for disjoint events E, P(union of E) = sum(P(E)) Except the OP already has P({}) = 0 as an axiom. You have a problem right from the start with the implication 0 = 1. You don't want to do any work after that. Thanks for this! This i...
by dwarduk2
Sat Apr 06, 2013 2:45 am UTC
Forum: Mathematics
Topic: Probabilities with Ω={}
Replies: 12
Views: 2561

Re: Probabilities with Ω={}

EDIT: Rereading your post, you can deduce that P(emptyset) = 0 if the sample space is not empty, using an argument like above and the above two axioms, which I consider more "natural". You don't need it as an axiom. Right, thanks for an answer! Out of interest, I tried assuming P(emptyset...
by dwarduk2
Thu Apr 04, 2013 4:42 pm UTC
Forum: Mathematics
Topic: Probabilities with Ω={}
Replies: 12
Views: 2561

Re: Probabilities with Ω={}

Are you trying to ask what would the probability would be of not getting a result when you roll a 0-sided die or ask a rock what it's favorite color is? I'd say it's undefined as it's not technically a trial/experiment/whatever in the first place. Operations performed on the empty set (as a set of ...
by dwarduk2
Thu Apr 04, 2013 4:10 pm UTC
Forum: Mathematics
Topic: Probabilities with Ω={}
Replies: 12
Views: 2561

Probabilities with Ω={}

Suppose there were an experiment with sample space {}. What would be the value of P({})? I'm a first year reading computer science, studying for my end-of-year exams; it's just a weird case I found mildly interesting probably because it's so useless. Our lecture notes have P(Ω) = 1 and P({}) = 0 bo...
by dwarduk2
Wed Dec 19, 2012 8:05 pm UTC
Forum: Computer Science
Topic: How do I compute this number sequence?
Replies: 10
Views: 7533

Re: How do I compute this number sequence?

Ah, of course. I can see how that works, though I still have a feeling that it doesn't matter, but that may be the reason my code to try out the problem is failing.
by dwarduk2
Wed Dec 19, 2012 5:11 am UTC
Forum: Computer Science
Topic: How do I compute this number sequence?
Replies: 10
Views: 7533

Re: How do I compute this number sequence?

Correct me if I'm wrong, but subtraction never actually has an effect, does it? Any subtraction of two natural numbers will result in an integer less than or equal to the greatest operand: assume a-b > a, then (a-b-a) > 0. -b > 0, so b < 0, so b can't be a natural number. That alone should reduce yo...
by dwarduk2
Tue Dec 11, 2012 1:05 am UTC
Forum: Coding
Topic: emailing multidimensional arrays?
Replies: 5
Views: 1922

Re: emailing multidimensional arrays?

$str = ""; foreach($_POST as $key => $value) { $str .= "$key=$value\n"; } That should do the trick. I've tested it with $_GET and it appears to work just fine. For POST as an array of arrays, you can do similar with: $str = ""; foreach($_POST as $akey => $array) { $str...
by dwarduk2
Sun Nov 11, 2012 2:11 am UTC
Forum: Coding
Topic: Help Request: Triangulation in 3D
Replies: 9
Views: 3164

Re: Help Request: Triangulation in 3D

You're welcome! And sorry; I messed it up the first time and edited it but clearly forgot to update the conclusion as well as the earlier information. To my shame, I got azimuth and heading the wrong way round originally :lol:
by dwarduk2
Fri Nov 09, 2012 10:53 am UTC
Forum: Coding
Topic: Help Request: Triangulation in 3D
Replies: 9
Views: 3164

Re: Help Request: Triangulation in 3D

As thoughtfully says, if you know that your lines actually do intersect, simultaneous equations is probably the easiest way to do it. With rounding errors, if you choose different variables in this you may get slightly different answers, but that shouldn't matter beyond rounding errors. Let's call t...
by dwarduk2
Sat Oct 13, 2012 6:49 pm UTC
Forum: Religious Wars
Topic: Gamers: The inverted Y-axis poll
Replies: 87
Views: 140662

Re: Gamers: The inverted Y-axis poll

With a mouse, I never invert; with a gamepad, I always invert.
by dwarduk2
Wed Sep 12, 2012 9:52 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1107: "Sports Cheat Sheet"
Replies: 178
Views: 35455

Re: 1107: "Sports Cheat Sheet"

What about the tennis mania? I suppose that's a singular event again in Britain (Wimbledon!), but it still eclipses football (soccer)
by dwarduk2
Tue Sep 11, 2012 1:10 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1106: "ADD"
Replies: 121
Views: 30226

Re: 1106: "ADD"

-snip-
by dwarduk2
Thu Mar 08, 2012 11:51 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1026: "Compare and Concave"
Replies: 74
Views: 31319

Re: 1026: "Compare and Contrast"

I read this thread, and the confusion over thou/thee is really annoying me. The basis is that there are three main forms a pronoun can take in English I'd say there's five: I, me, my, mine, myself you, you, your, yours, yourself it, it, its, its, itself he, him, his, his, himself she, her, her, her...
by dwarduk2
Thu Mar 08, 2012 1:26 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1026: "Compare and Concave"
Replies: 74
Views: 31319

Re: 1026: "Compare and Contrast"

I read this thread, and the confusion over thou/thee is really annoying me. The basis is that there are three main forms a pronoun can take in English: subject, object, possessive; these are analogous to German ich, mich, mir. For instance, the second person plural and polite pronoun was ye, you, yo...

Go to advanced search