« first day (981 days earlier)      last day (4029 days later) » 

4:00 PM
yeah.... sometimes it's bad though. Like this code I found at my previous job:
if(someCondition)
{
    // some block of code
    // .
    // .
    // .
#ifdef 32BIT_REGS
    foo(1);
}else
#else
}
#endif
bar(2);
And I needed to go in there and add a statement before foo(1); and before bar(2);
 
is that thing actually valid?
 
Yes
// If 32BIT_REGS is defined, then it compiles to:
if(someCondition)
{
    // some block of code
    // .
    // .
    // .
    foo(1);
}else
bar(2);
// If 32BIT_REGS is not defined, then it compiles to:
if(someCondition)
{
    // some block of code
    // .
    // .
    // .
}
bar(2);
 
the directive inside the things confused the hell out of me
 
Oh yeah. So don't get clever when reducing your 6 lines to 4
 
which "}" belongs to the if statement?
I'd obviously not do it to make something like this, no worries :P
oh no my bad
nvm
 
4:04 PM
Both do, just depends on the #ifdef
 
I finally managed
to read it
yeah
 
Yeah...
 
makes sense now
I'd honestly extract two different methods from that
and if I had to use the directive it would be like
#ifdef 32BIT_REGS
firstmethod();
#else
secondmethod(); #endif
it's much more readable
 
yeah, but foo() only runs if it's 32BIT_REGS and if someCondition is true
and bar(2) runs if it's either (32BIT_REGS && !someCondition) || (!32BIT_REGS)
 
gimme a sec
 
4:08 PM
I found a reasonable way to unwind everything and add the statements I needed, but I can't remember what i did
I think it simply involved making a local variable that contained the state of 32BIT_REGS, then used a normal if statement with FULL braces. It's a pet peeve
 
Is using the directive twice wrong for you?
you could avoid having the #else near else thingy and make it more readable with
if (someCondition)
{
GeneralBlockOfCode();
#ifdef 32BIT_REGS
foo(1);
#endif
}
#ifdef 32BIT_REGS
else
{
foo(2);
}
#else
foo(2);
#endif
it's now obvious: foo(1); gets called if it's defined
the else branch only when it's defined
otherwise it compiles without it
and with the foo(2);
the else#else got me in your code lol
but this might seem more readable to me only
 
it works, and yeah, the hanging else was interesting
 
in case I could live with a bit of code duplication (not breaking the law of three!)
I would make two functions
containing the someCondition check
function one()
{
if (someCondition)
{
GeneralBlockOfCode();
foo(1);
}
else
{
foo(2);
}
}
function two would be the other one
and use a single directive
#ifdef ... functionone() #else functiontwo(); #endif
naming them appropriately like
functionFor32Bit or something
would also improve things and somehow excuse the code dupl.
lol
loved the refactoring problem you gave me <3
made me forget about my geometry exam
which unfortunately is not as exciting
 
4:26 PM
I think I solved it like so:
bool 32BitRegs;
#ifdef 32BIT_REGS
32BitRegs = true;
#else
32BitRegs = false;
#endif

if(someCondition)
{
    // some block of code
    // .
    // .
    // .
    if(32BitRegs)
    {
        foo(1);
    }
}

if(!32BitRegs || !someCondition)
{
    bar(2);
}
 
that looks good too
it makes no use of an extra function and is more readable than my #ifdef else { } #else foo(2); #endif
it does the 2nd if check all the time though but it's no issue
yup, like yours more
 
but it also depends on how complex someCondition is, and potentially how large some code block is. If either are long, I might use a variable to store the result then use it twice
 
makes sense, yeah
 
Hmmm.
I should really figure out a sensible way of calculating combat from unit stats.
 
dice rolls!!!
 
4:39 PM
It will be chance based. :P
It's just, I need to figure out exactly how.
 
iirc AD&D rules can be used by anyone
copy the crap out of them
 
Like. ATK/DEF. 1/1 vs 1/1 would be a 50/50 chance of either side winning.
 
@BogdanMarginean I'm pretty sure you can't. But you can use Paladin or... something. Let me find the info
 
But... If one attacker was ranged, the other units ATK wouldn't count if the ranged attacker was greater than the attacking units DEF.
 
yeah you're right, not sure where I read they're open or something
then again
you can still copy them
 
4:41 PM
12
Q: Is it legal to develop a game using D&D rules?

MaxFor a while now I've been thinking about trying my hand at creating a game similar in spirit and execution to Baldur's Gate, Icewind Dale and offshoots. I'd rather not face the full bulk of work in implementing my own RPG system - I'd like to use D&D rules. Now, reading about the subject it seem...

 
and say it's not AD&D based
 
I could simply use OGL for it.
But this isn't a combat simulation where the player controls units.
 
@JohnMcDonald that clears things, thanks :D
 
It's just a matter of who's got the strongest army according to some arbitrary rules.
 
can you give me some real life examples?
 
yup
I should use the reply function more often
 
Indeed. :P
I don't know what you mean by real life example though.
 
say
attacker has 3 ATK, defender has 2 DEF
attacker has a chance of...
75% to successfully hit
 
That's exactly what I'm trying to figure out. :)
I just know a balance in ATK/DEF should result in a 50/50 chance of the battle going either way.
 
4:45 PM
No healthpoints either.
 
fuck yeah pokemons
 
or check around for sample formulas until you get an idea
 
Something along the lines of Magic Cards would be suited.
 
like in TCGs?
 
4:46 PM
I know of very few TCGs and in those that I know of it's usually like
if attack > defense take health equal to attack - defense
 
But in a way that doesn't involve picking a defending unit.
Heroes of Might and Magic auto battle mechanics comes to mind.
 
I always wondered if the autocombat actually ran a chess-like simulation
or just compared stats
 
Pretty sure it's just stats.
 
and calculated a percentage for the chance to win
 
I know auto combat would lose units that could be avoided with the simplest of tactics.
 
4:48 PM
yeah
when that happened I always thought autocombat can't play
:P
 
I could go with something more advanced like picking what to attack. But then I'm making this SIMPLE project less simple.
 
I have too little experience to give advice other than take a look at what others did and copy the best parts
after imitating one's work a number of times you end up gaining enough experience to build upon it
or create something entirely new from scratch
at least now you know what would be really 'new'
 
I did get some decent results from pitting each units stats against each other, tally it, and then calculate a chance based on that.
This way a ranged unit would have a greater advantage over a group of melee units rather than a group of ranged units.
 
@William'MindWorX'Mariager I have Heroes 3 installed and you're soo tempting me to play it right now.
 
Haha
Me too. :P
With expansions. :P
 
4:52 PM
yup :D
I'd install WoG, but I remember it changes the original files too
I really liked the new creatures when I used to play it
now I'm sticking with the original campaigns in the complete edition
never finished them
 
Merchants and Marauders uses an interesting dice technique. The higher your ability, the more dice you get to roll, 5 & 6 count as success.
so Attack 3 vs Defence 2 would yield 3 dice vs 2 dice where 5's and 6's are considered successful
kinda different
 
so it's like Risk sorta
 
Well... if it's 6 attack vs 3 defence, it's 6 dice vs 3
 
risk caps out at 3/2 for offense/defense I think
 
the attacker might roll 2 successes (and 4 fails), and the defender might only roll 1 success and take 1 damage (2-1)
 
5:05 PM
hmm i see
 
They added an other layer where each point of damage had to then roll for a location
 
so it's more like each point gives 33% chance of success. It's ATK - DEF with randomness
 
This is a pirate game, so mast, crew, cargo, hull, etc.
yeah
 
how do you normally do collision checking for lines of sight? do you just perform raycasts inside the cone or somehow use a conical shape for collisions?
I wonder if I can't use some sort of formula given the camera's FOV
the camera's position
and distance between it and objects
that geometry exam would help :P
 
you have to raycast/scan if you want to take occlusion into account
 
5:08 PM
I'm working under unity if it helps: I could just make an invisible mesh with a conical shape and attach colliders to it, but it seems like overkill
 
since just checking the frustum would still give you things that are hidden by other things
 
yeah, good point there
I don't want that
I'm trying to mimic the behavior of the Ignite spell in Arx Fatalis
when the player casts it, all flammable objects in his FOV (up to a given distance) get lit
but those behind walls don't
 
@JohnMcDonald I feel like I've seen this code before :P
 
You have
:p
 
if (someCondition)
{
	 // some code
}
if (32BitRegs && someCondition)
	foo(1);
else
	bar(2);
that's my solution, btw.
 
5:14 PM
with the whole conversion from a define to a bool I assume. Not bad
 
takes note
 
yeah, I just spent like 30 seconds staring at it thinking "I suspect foo and bar are mutually exclusive" but it was impossible to tell in the original version
 
5:39 PM
Fantastic news from my web hosting provider!
We have been investigating this issue and can see the slowness you are reporting.

There has been a service pack developed for our Control Panel which is currently going through testing. The new service pack should vastly speed up the control panel.

Should you wish to use IIS management directly this can be done.
My issue is not because I'm on the cheap plan and apparently there is direct IIS management that I can do. Double win.
 
anyone seen gameplay from Transistor? the new game from Bastion's devs?
looks damn amazing
 
so far the combat looks sketchy but the ambient music is awesome
 
I find the combat to be the most interesting part
 
the narrator voice might need some work though, he's not nearly as distinctive as Old Man Bastion was
 
it's like a combination of... Frozen Synapse
and...
not sure but it reminds me of Septerra Core
maybe because of the time bar
yeah the narrator is a bit unimpressive
 
5:46 PM
my problem with the time bar is I dont' want this to be "Bastion-but-harder-so-here's-some-time-tricks"
 
they could hire morgan freeman :P
 
I think it's the same VA as Old Man Bastion, they're just trying to work out a "theme" currently for the narrator.
 
might be
 
anyone use / recommend an online password storage service?
 
@ToddersLegrande is lastpass desktop only?
I hear people like that
 
5:48 PM
@ToddersLegrande That sounds risky.
 
@ShotgunNinja Yep, wouldn't store my passwords anywhere other than a USB stick under my pillow lol
 
I like lastpass
 
We've got a server here at work and I was just curious if there was something people used for personal use. Would be nice to not have to carry a USB stick around with me :P
 
Then store the master password on something that people won't get to
It's just a pain when one of my computers loses the lastpass login, and I'm like, at work or something.
 
I can probably remember the master password
assuming I get to choose it
 
5:50 PM
you do
 
Yay for pass phrases
 
It's pretty neat too, that if someone gets access to your email, and manages to reset your lastpass password it drops any password changes that are recent (since your last change I think). has some nice stuff that warns you when you attempt to use a password that you have used before (assuming you don't use the generator)
 
@BogdanMarginean @Noctrine Thanks. I'll check that one out
 
6:14 PM
Lastpass does seem pretty cool
 
6:25 PM
Feels like a winner. Thanks guys
 
Guys, what |= operator means? :)
 
x |= b is x = x | b
 
OLD MAN BASTION!
I want that guy to narrate my life.
 
Thanks
 
@Jimmy there is no such an operator (at least in C++)
 
6:30 PM
"Kid rages for a while..."
 
@Gajoo in C# there is
 
And in Java
 
|= <- from C++ :)
 
Programming languages typically support a set of operators: operations which differ in the calling of syntax and/or the argument passing mode from the language's functions. Common examples that differ by syntax are mathematical arithmetic operations, e.g. ">" for "greater than", with names often outside the language's set of identifiers for functions, and called with a syntax different from the language's syntax for calling functions. Common examples that differ by argument passing mode are boolean operations, e.g. a short-circuiting conjunction that only evaluates later arguments if ear...
 
hmmm according to this table it does exist in C++
 
6:31 PM
Stupid auto-thingie. That links to a chart that shows different operators and what they do in different languages.
 
@Jimmy 15
 
@Jimmy maybe I've mistaken it with &&=
 
yes, we have bitwise assignment operators, not boolean
 
Ooo. I know I said I didn't want to carry around a USB stick but the premium account does have multifactor authentication with a "YubiKey" - this is interesting
Or it seems you can turn any USB drive into a form of multifactor authentication
 
Do they have an android app instead?
 
6:41 PM
Looks like (on premium) they have an app for all the mobile operating systems
$1 a month for premium
 
If they could have some fancy desktop authentication mechanism that plugged passwords into games as well this would be perfect
But at least I can log in and view passwords for that
 
Right now, my weak point is my phone. If I lose my phone, and someone breaks the lock on the phone, they have access to my Google authenticator, and from there have access to Gmail and therefore: my life
I suppose if I ever lose my phone, I should immediately fix that in Google
 
My phone isn't secure :(
 
Well... even then, they'd still need to know my password
 
6:48 PM
They'd have my email and could just read / recover passwords from the phone
 
:/ yeah
hmm... if I change my Gmail password, I'd need to type it in on my phone, right?
That would be my first step
 
why is the authenticator not one of two factors?
isn't that the point of an authenticator? (I've never used one)
 
Well, you have certain devices, like my phone and home PC that are authorized and won't bug you for an auth code very often
Blizzard wants you to enter in the auth code every week (at most)
Google is more like a month
UNLESS It's a new device
 
Mine is set to prompt me every time for Blizzard. It's not much of a bother to me
 
If you're on a new device, Blizzard and Google will always ask you for the auth code
yeah, I've set up Blizzard to ask once a week. I have like 2 games and $0 in my Blizzard wallet
With Google, you can print off one-time-use codes that you can use in the case of an emergency, or for traveling
And if you have a google account that you care about, I'd highly recommend setting up 2-factor authentication: codinghorror.com/blog/2012/04/make-your-email-hacker-proof.html
 
7:00 PM
@Blizzard - does anyone happen to have a downloadable Diablo 2 from battle.net? I'm curious if it works under Win 7
 
You don't need a smart phone either. The default behaviour is to send you texts
 
Due to suspicious activity, this account has been locked. A message has been sent to this account’s email address containing details on how to resolve this issue. Visit eu.battle.net/account/locked.html for more information.
so it was not spam after all
 
I love this part: "But I Don't Use Gmail: Either nag your email provider to provide two-factor authentication, or switch over"
<3 Coding Horror
 
@BogdanMarginean GENERALLY if you can look at the URL and determine its really battle.net its likely not spam.
 
:/ ummm no
Don't click on links in emails
 
7:07 PM
0
Q: Requesting tag synonyms

PolarNote: I could not already find a question on Meta answering this. If there is one, then please provide a link. I've been looking through the tags recently, and have seen a few that I think deserve to be synonyms. Of course, I don't have enough rep to suggest synonyms myself, but some tags (e.g. ...

 
@ToddersLegrande I only log in to battle.net once per year lol, so I dismiss any email as spam. Apparently I did not register using my real name. I can't recover my account. Damn.
Didn't lose much, I've got those Diablos in retail packaging too but
You have made too many unsuccessful attempts. In order to continue the password reset process, please contact Customer Support.
sounds like my best bet
should've done this from the start
 
@JohnMcDonald I guess to be clear, I hover over the link or copy the address, and see what it actually resolves to. I've never found one I actually wanted to click because they were all spam (MSN does for sure and I think gmail might too - mark Blizzard as verified anyway). I wouldn't ever click anything without determining the destination long before
 
:/ yeah. I did that once with a Facebook link once
Not doing that again
 
Haha. I recently had a conversation with my parents that anything they see on Facebook that looks like a good thing to click on, they should think instead that it reads like "Click me if you want to download a virus!"
 
7:14 PM
I'll get some more info for us
 
On the virus email I got
 
Ah
What I find interesting these days is that I am receiving spam email that appears to be from friends or relatives that are actually sent from obviously not their email addresses
 
I've gotten that too :( I wonder if it's related to those Facebook Like-phishing things
like, something has to be collecting names of actual friends but not actually have access to email or anything
Also, you can find a lot of real names on Twitter and figure out who their friends are that way
 
@Jimmy I'm guessings its exactly that as some people I'm not even friends with. I'm sure someone clicks a link / allows an app and it looks up friends and friends of friends until someone was smart enough to secure their account down
@JohnMcDonald I propose are scenario to you that maybe you have the solution to since you use this.
You set up Gmail to use the two factor authentication
Oh wait
Printable backup codes
nevermind
:P
 
7:20 PM
yes, Print those
 
Seems pretty good to me as long as you change your gmail account settings/password before the person gets a chance to get anything useful
 
yeah, if you can change your password before they can get sensitive data, you're golden. Hmm
 
Floyd warshell and Dijkstra's algorithm
Floyd warshell
just another
in the wall
 
But they'll have hours of access before you can do that, probably
@BogdanMarginean what?
 
someone posted on a website that he needed a C++ implementation of floyd warshell's algorithm
totally different from floyd-warshall
 
7:25 PM
ah, ic
 
it's hard to make the same mistake with roy-floyd
but I can still make a shitty pink floyd joke haha
 
 
it's been half a year since I managed to find something to do on oDesk
i don't get some people's logic
you ask for a 5-star programmer but you're only willing to pay him/her an incredibly small amount
it's even funnier when it sounds like
 
That's pretty solid (people) logic though, in a way, They want the very best, for the very least.
 
"need console hangman game, stellar programmers only please"
max bid: $5
 
7:31 PM
The reason is that if you ask for a decent programmer, all the terrible ones apply
 
@Noctrine well yeah from the employer's point of view it makes sense :P from mine it does not
 
even when you ask for a 5-star programmer, you still mostly get trash
at least, from the HR/employer's point of view
 
Maybe they should start using the programmer competency matrix?
Of course, even then, mostly trash will still apply.
 
or just try to pay more so their job postings seem attractive to programmers who don't spend 10 hours of coding for $10
it can't be that hard to weed out the bad ones during interviews
 
yeah, but i'd rather not waste my time interviewing people I don't have to
 
7:34 PM
That is also part of the problem, with sites like oDesk. There are people who will accept (and in some cases complete) ridiculously low-ball offers.
 
yeah, you're competing with the third world here
 
@Jimmy makes sense, but on programming jobs it's rarely the case of more than 10-15 applications.
don't have many other options, especially when it comes to gamedev
there's one job in 50 that does look good though, so maybe I'll get something soon enough
the mobile app dev section is even worse, apparently everyone needs android + ios + wp compatibility out of the box, and by the same programmer
used to be better a year ago, from an android dev's point of view
 
At least they don't want Blackberry also
 
I can do WP too, but iOS is so out of my reach
@Noctrine lol true
 
@BogdanMarginean developing for WP is really good
though you just need a W8 to develop for WP8
 
7:40 PM
Not to bad compared to really
 
@Gajoo Yep, was very nice the first time I did it (WP 7). Felt right at home: Visual Studio, C#, .NET. The XAML thing took me some time to get used to (I never WPFed either).
I have yet to do something serious for W8
 
you can just do the same things you did for WP7, as far as I know it's backward compatible
 
I personally find WP to be the friendliest platform for developers
it's really easy to develop for
Android comes second, but I bet it would be overtaken by iOS. problem is objective-c confuses the hell out of me.
 
in my opinion android is the last. not only between mobile devices but in general :P
 
the APIs are okay-ish, the real problem with android is the fact that it's so spread out on tons of devices
 
7:45 PM
iOS is not that bad, considering you can use MonoDevelop and C++
 
sometimes you just want to smash the keyboard and then write over your app "THIS ONLY WORKS WITH GALAXY S3. THANK YOU. BYE"
does the monodevelop support not cost extra? last time I checked it was a huge price
it would be more worth it to completely switch to apple with that money lol
apple also has that annoying requirement of $100 per year to even PACKAGE your app for distribution
or to test on a real device
you have your iThing near you and it's impossible to test your app on it unless you apply for their programme
I bought your damn iThing, is it not enough?!
/rant
made me hungry though
 
I wonder.
Should I mark the header of a page that only returns json with a doctype to indicate it?
You know, like how you can mark content text, html, xml, etc.?
 
@BogdanMarginean doesn't same rule apply for WP too?
 
@Gajoo only up to a certain extent. this was 2 or 3 years ago, but I remember being able to build my WP app for release and give it to my employer
 
how do you think diablo or games like that matches attack request packet and recieved damage packet to look like it happend as cause?
 
7:56 PM
@William'MindWorX'Mariager I've set my header content type (not <!doctype>) to: "application/json"
 
a lot of games probably send both at once
depends on whether damage resolution is asynchronous
 
JSON ( , ), or JavaScript Object Notation, is a text-based open standard designed for human-readable data interchange. It is derived from the JavaScript scripting language for representing simple data structures and associative arrays, called objects. Despite its relationship to JavaScript, it is language-independent, with parsers available for many languages. The JSON format was originally specified by Douglas Crockford, and is described in RFC 4627. The official Internet media type for JSON is application/json. The JSON filename extension is .json. The JSON format is often used for s...
"The official MIME type for JSON text is "application/json" "
 
You can also download a plugin for your browser that will handle json files, which is nice for debugging
Owch, looks like a pain to do this for IE though: stackoverflow.com/a/2492211/536974
heh
Not designed for developers
 
Man I wish VS would reuse tabs when I hit debug. :P
 
8:32 PM
:D I'm working on top of an Ingress portal now!
 
@William'MindWorX'Mariager what tabs?
you mean like IE tabs/
 
@Gajoo Tabs in firefox.
 
8:50 PM
God how I've missed LINQ to SQL.
Sweet sweet LINQ to SQL.
 
@William'MindWorX'Mariager MVC is more amazing. :P
 
But LINQ to SQL is at least the next best thing. :P
No dealing with anything. Just connect and treat the database as any other collection.
var db = new DataClassesDataContext(ConfigurationManager.ConnectionStrings["database"].ConnectionString);
db.Users.InsertOnSubmit(new User() { Username = username, Salt = salt, Password = hash });
db.SubmitChanges();
 
Upgrade yourself to the Entity Framework
It's like Linq to SQL but better
 
Looks pretty identical
What are the differences?
Seems like the Entity Framework is something more enterprise aimed.
 
9:14 PM
new email: Battle.net Account Locked - Action Required
Greetings,

Due to an unusual change...
y u no use my name
so I get to know what I should have used to recover my pass
 

« first day (981 days earlier)      last day (4029 days later) »