Daily Programmer project

This is an older one, but it was interesting to play around with.

https://www.reddit.com/r/dailyprogrammer/comments/2z68di/20150316_challenge_206_easy_recurrence_relations/

Avoided a massive if/else construct, while still allowing all binary operators, by building a string and using eval.  The recurrence function could probably be exploited due to that eval, I really should follow up on that comment I put there about protecting it.  It simplifies the code, but eval lets you execute arbitrary strings.

If the code is used as intended, by calling the last function, the int() cast, along with only keeping the first character as a string, breaks any attempt at an exploit that I’ve tried.  But I can’t guarantee use as intended in Python, certainly not easily.

#Daily Programmer 206e Recurrence Relations

def recurrence(n, op_list):
    """Applies the recurrence relation in op_list to n
    op_list is a list of tuples, op[n][0] is an operator,
    op[n][1] is an integer"""

    result = n
    for op in op_list:
        operator, operand = op[0], op[1]
        #Should probably do something to protect this eval
        result = eval('{}{}{}'.format(result, operator, operand))
    return result

def get_nth_term(recurrence_relation, relation, first_term, n):
    if n == 0:
        return first_term
    else:
        return get_nth_term(recurrence_relation,
                            relation,
                            recurrence_relation(first_term, relation),
                            n-1)

def recur_n_times(relation, first_term, n):
    op_list = [(x[0],int(x[1:])) for x in relation.split()]

    return get_nth_term(recurrence, op_list, first_term, n)

John A Lejeune’s Birthday Message to the Marine Corps

On November 10, 1775, a Corps of Marines was created by a resolution of the Continental Congress. Since that date many thousand men have borne the name Marine. In memory of them it is fitting that we who are Marines should commemorate the birthday of our Corps by calling to mind the glories of its long and illustrious history.

The record of our Corps is one which will bear comparison with that of the most famous military organizations in the world’s history. During 90 of the 167 years of its existence the Marine Corps has been in action against the Nation’s foes. From the battle of Trenton to the Argonne, Marines have won foremost honors in war, and in the long eras of tranquility at home generation after generation of Marines have grown gray in war in both hemispheres, and in every corner of the seven seas, that our country and its citizens might enjoy peace and security.
In every battle and skirmish since the birth of our Corps Marines have acquitted themselves with the greatest distinction, winning new honors on each occasion until the term “Marine” has come to signify all that is highest in military efficiency and soldierly virtue.

This high name of distinction and soldierly repute we who are Marines today have received from those who preceded us in the corps. With it we also received from them the eternal spirit which has animated our Corps from generation to generation and has been the distinguishing mark of Marines in every age. So long as that spirit continues to flourish Marines will be found equal to every emergency in the future as they have been in the past, and the men of our Nation will regard us as worthy successors to the long line of illustrious men who have served as “Soldiers of the Sea” since the founding of the Corps.

John Lejeune
Lieutenant General
U.S. Marine Corps

Sometimes initialisms get too long

An acronym/initialism that gets too long becomes a barrier, rather than aid, to communication. It almost becomes encryption rather than a concise summary of what is being discussed. Some of the extensions to LGBT go way past this point.  How is understanding aided when you have to explain the initialism every time you use it?  Who decides which order various identities get placed in?

There should be a better term, rather than trying to include everything specifically, go for a broader term. That’s the only way to actually cover everyone without full page strings of seemingly random characters. Ideally not a reclaimed slur- while I have no issue with the concept of reclaiming slurs, that’s always going to be controversial among some parts of a given community so something should exist that doesn’t run into that issue.

I wish I had a good candidate.  I do like reclaiming “queer” as an umbrella term, but as I said, that’s going to be controversial in some quarters, especially if it’s something cishets use to refer to us(which I’d have some issues with with ‘queer’).

Source: The Gauntlet / There will never be a letter for every identity

Extorting money from Ashley Madison customers is actually pretty easy | Ars Technica

1.05 bitcoins, or $243, is a low enough price to avoid further embarrassment.

Source: Extorting money from Ashley Madison customers is actually pretty easy | Ars Technica

I wouldn’t bother paying, no matter how much I wanted it kept quiet.

The data is just out there. It’s not under the control of any one party. Maybe you’d want to risk wasting the money if it was only the blackmailer- sure, they might screw you and expose you anyways, but for a small enough amount maybe it’s worth the risk.

But multiply that amount by all the unethical people who have access to this data, and you could bankrupt Bill Gates.

Anyone concerned about exposure should really be making plans to own up to it voluntarily. It’s pretty much impossible to prevent exposure at this point, but controlling the how and to some extent the when is still possible, and would be the best bet for minimizing embarassment and other problems.

Well, that’s for the people just cheating.  Gay people and abuse victims might need to come up with a cover story about why their info showed up, but keep quiet until said story is needed.  They face a lot worse than embarassment, they could actualyl be killed in some cases.  So they should probably keep it quiet but be ready to deny if challenged and possibly have a cover story about a prankster friend or something.

Food chain Chipotle sued over its “GMO free” claims | Ars Technica

“Free” is a relative term, as Chipotle uses meat and dairy products fed GMO feeds.

Source: Food chain Chipotle sued over its “GMO free” claims | Ars Technica

Unless that animal feed can be proven to be mutagenic(good luck with that), I don’t see a case that could be made on that.

The drinks, though… If Chipotles ads are simply saying GMO free, and the information on drinks is shoved into a mention on their website… There might be an argument regarding false or misleading advertising.

Easily fixable with fine print in ads such as “While Chipotle prepared and branded items are GMO free, items provided by other vendors, such as soft drinks, may contain GMO”. If their ads already include such a disclaimer, though, then there’s no case at all.

Of course, the whole anti-GMO thing is based on nonsense. There’s some reason to distrust Monsanto, but the basic science and the GMO foods that actually enter our food supply(there is, actually, testing) is all fine. Still, if you’re going to claim GMO free, you have an obligation to actually be GMO free and/or make sure your advertising is clear about an exceptions to the general policy.

Diablo III takes place in the Stargate universe

So, I’ve long had a theory that World of Warcraft takes place in the Stargate universe.(discussed here: https://behind-blue-eyes.us/2013/09/18/6-insane-video-game-fan-theories-that-make-total-sense-cracked-com/ )

A new one?  Diablo takes place in the Stargate universe as well.

I don’t think the Goa’uld are involved here.  I suspect the Eternal Conflict involves Ancients and Ori in open conflict. The High Heavens is the home of the Ancients faction, the Burning Hells, the Ori faction.

The Nephalem would have been the result of some Ancients and Ori remembering that once, they were the same people… and taking steps to rebuild their previous society and end the long war.  Hell… Perhaps, Sanctuary eventually becomes known as Earth, after the Ancients and Ori call a truce.  A lot of how the Ori were raising hell was specifically planned to minimize the chances of Ancients getting involved, perhaps it wasn’t general caution but a specific treaty, ending the Eternal Conflict, they were staying just on the right side of?

Leah would have been something similar to an Orici, a prepared vessel through which the Ori can intervene on the mortal plane.

Tyrael, like other ascended beings, was able to choose to descend into mortal form, albeit at the cost of his social standing among the Ancients and some memory blocks.

One of these days I should take these wacky theories I come up with and start writing fanfic based on them.  Obviously, Diablo isn’t meant to take place in the Stargate universe(though it wouldn’t shock me if there’s an idea or two inspired by Stargate), but still, it’s fun to think about.

Get me copies of Starcraft and Starcraft 2, and I could probably find a way to make the third major Blizzard franchise work as part of the Stargate unvierse.

With a little harmonization work with another theory I’ve come up with(but haven’t written about in detail), I can bring Doctor Who and both Battlestar Galactica series into the same shared universe.

Sense8 Season 2 prediction

Some spoilers here, so it’s all behind a cut.

Read more of this post