Yeah, I wish Lua hadn't taken undefined and nil to be the same thing given the way tables work in it. Most of the time it doesn't matter, thankfully. Sometimes you bump into it.
A sigil value can work too if you absolutely need it. ex:
undef = {}
function isundef(val)
return undef == val
end
The sigil value is truthy and makes your code more convoluted, though. ex:
If you want, you can add t.exists[key]=true, and check it if you really want to know if key exists despite it's value is nil.
function exists(t, k)
return t[k] ~= nil or t.exists[k]
end
t = { 1, 2, nil, 4, exists={ [3]=true } }
i = math.random(4)
if exists(t, i) then
...
That's pretty close to Perl's semantics, where undef is inoperable under 'use strict' but arrays/hashes can have them explicit. Also can move exists out of t easily with weak table.
local exists_t = setmetatable({ }, { __mode='k' })
function set_exists(t, k)
exists_t[t] = exists_t[t] or { }
exists_t[t][k] = true
end
function exists(t, k)
return t[k] ~= nil or exists_t[t][k]
end
That said, I really like math-like attitude of definitions in Lua. No bs like 'bloated for your convenience', you just use your logic skills to program.
I agree with this, mostly. I feel that Trump's campaign has already damaged the country in a very profound way that will take years for us to recover from as a people. But, I don't see Trump suddenly being the adult in the room given how he ran his campaign. At the very least, the tone has made people talking to each other very difficult.
I know people keep turning to hard data to try to explain the election. I think that's generally the right way to look at it. However, I think we all know people who have supported Trump. I feel like we should be sharing what they're thinking respectfully, even though it's feels more than likely many of his supporters would not reciprocate, however true or not true that may be. More viewpoints is better after all, right? They perceive us as aloof and disconnected from their problems. So, what do we do?
I don't want another election like this more than anyone else does, but it will happen again if something doesn't change. I have little faith in the protests ability to change people's minds. The people they need to talk to likely have never even been to the streets they're protesting on. All they're going to hear is that the protests in Oregon were deemed a riot and dispersed, and that will be that.
Within my family, not all voted for Trump, but most did and they come from different economic strata. So, I've seen multiple viewpoints on this. I think in order for me to understand the elections, I've made a separation between: 1.) economics, and 2.) race & culture. The people I know that voted for Trump might have responded to the dog whistling (can it really be called that when it's so unsubtle?). But, in their minds it's about 1. and not 2. I think when it comes to changing hearts, the only thing that matters is how you feel, so it's important to make that distinction. They don't see themselves as fomenting racial anxiety, even though the United States is inevitably becoming a more diverse place. They only care about the economy, and Trump made a point of opposing trade pacts that have hollowed away their traditional place in American society.
At home and at work, I feel like I occupy two totally different worlds that don't interact with each other at all. I come to work, and it's nice. It's a diverse workplace, people are kind, we're making money. It's nice. Then I go home and it's like 2008 is rumbling on. It really does feel to me like people don't humanize people they disagree with anymore because they filter their world through cable news & the internet. Maybe changing that might help change this?
But how do we do talk to them? To them it sounds like we're waiting for them to die off, which is profoundly insulting to them but also not true of us, or at least not of me. We aren't waiting for them to die off. To me, or us, it sounds like they're trying to turn back the clock on the progress we've made for a lot of people who have endured a lot of hurt. But to them, they're trying desperately to preserve a way of life. But the world is just changing around them. We're all uncertain about where we're going to from here.
So how do we talk to them about it? How do we make them not feel threatened? I'm really at a loss. I think it's hard for the left (or at least me) to appreciate how divergent our understanding of what constitutes racist/sexist behavior is from theirs too. What's unacceptable behavior to me is locker room talk or just crude humor to them. It's hard for me to not lose my temper about it. I'm not sure how to shrink the empathy gap between the two sides, but I don't see these conversations taking place, so somebody has to start, right? But how do we do it?
I know this is a difficult pill to swallow because it involves entreating people who frighten or even mean ill to our friends (or ourselves). I happen to be in a position of extreme privilege so this post is a little too easy for me to write. Consulting with people I disagree with presents no threat to me. Others definitely will not have that experience. I don't mean to suggest that people who feel at risk should try it. But I feel like there's not a whole lot of options available to me right now. I don't want my country to tear itself apart in two or four years from now. I'm really at a loss here as to what's the best way forward for everyone, and for the country.
I'm an OMSCS student. Udacity is fine. It serves its purpose. Sometimes it looks like the poor instructors are getting a double whammy of Georgia heat and hot spotlights, but the lectures are pretty high quality.
I'm not too far into the program, but the courses I've seen are built around readings, projects, and Piazza (a student forum for us to talk to each other in). Piazza is where most of the interesting stuff happens. For my class, there's the professor but also 5-10 TAs who are swarming Piazza at most hours of the day responding to questions. Once a week, there are office hours for a couple hours hosted on Hangouts. There's your normal midterm and final exam, but the courses seem very much structured around deadlines rather than mandatory participation week to week.
Here! Another OMSCS Student. I think, many of us associate ourselves with Georgia Tech than Udacity, even though we have some excellent staff who are full time employed by Udacity for our courses.
The technical infrastructure from Udacity is a low key here. But the partnership, enablement and opportunity in providing 1000s of qualified students to pursue masters is a phenomenal achievement.
Forever grateful to Udacity and Sebastian Thrun for this program.
Also an OMSCS student. Funny. On my iPad, it's less than straightforward to use Udacity on the website, and I've never been able to get the mobile app for the GT login. I have my IOS course bookmarked so I can watch the lectures on my tablet.
The people who Fox News caters to the most are suburbanites. Most people way out here are lukewarm on Fox News. They're just... different. They agree with some things that I imagine would be popular in big coastal cities, but disagree with other things that might surprise you, so.
Hey! I really love Lua. I'd recommend reading Programming in Lua (whatever the latest edition is) and Lua Programming Gems. Unfortunately, Lua is one of those languages that isn't written about a lot because its use case is usually for embedding. You'll have to do some legwork to read how other people write Lua. You probably want to read a lot of code on Github. Olivine Labs springs to mind here as an org that uses Lua quite a bit, but there are more. I got off the Lua train at 5.1, but 5.3 adds a lot of niceties.
Depending on how deep into the rabbit hole you want to go, reading the VM source code is instructive too (it's a pleasant read at ~10kloc. I'd actually recommend reading it on the website as they've hyperlinked much of the code.)
Yeah, I agree. I use emacs avidly. I still think for editing raw text it's a fairly nice experience. I like a lot of the features in emacs but I rarely need some of the more advanced ones. In order to leverage them, you need some highly specific use cases. Maybe my brain-meats aren't as myelinated as others, but most people don't want or need the universal pocket knife.
I don't think he would build a computer. 10k years ago was before writing. I imagine if anyone were transported that far back they'd want to focus on the stuff that has a huge impact (hygiene, food, basic medicine, potable water, writing, architecture, etc.) for the people at that time period.
There's a lot of common things we all know that we take for granted that would make a world of difference for people so long ago.
I'm from the South and hear this all the time. I have no idea how many people are actually descended from the Cherokee (they were one of the larger groups in the South). I have a different crackpot theory. Historically, admitting you were less than 100% white was a dicey proposition. Sometimes I wonder if there aren't actually a larger than obvious percentage of people who have Native ancestors, but since they were assimilated, their descendants are only dimly aware of it and use "Cherokee" as a catch-all for saying they have some Native American blood in them. I'm sure some people are getting confused or just retelling tales passed down, but the South did have a lot of Native Americans in it. Has anyone researched this?
My father (who is nominally 1/8th Cherokee; his well-remembered grandfather was half) has been working on our family's genealogy for decades. He believes that many of our ancestors not directly tied to his grandfather were partially Cherokee, and consistently under-reported. There were penalizations for various degrees of Indian blood, not just a binary thing, so this was quite common.
There were also apparently a lot of mixed-blood Cherokee/Scot or Irish ca. 1800 in southern Appalachia before Removal, and some of them were very successful. One of our ancestors, Chief Vann [1], became very wealthy though he was allegedly quite the drunken terror. He lead a sort of clan or tribe of Cherokees, mixed-bloods and some slaves that were associated with a Moravian mission/school (who took civil records that my dad has found on ancestry.com). Apparently there was a fair amount of mixing, as well as a lot if first-cousin marriages and possibly closer interbreeding that may have been a bloodline-perpetuation thing or may have been due to geographical or cultural isolation. I think the setup might actually be similar to modern small chiefdoms in Afghanistan. Vann was incidentally killed because of his bad behavior, in a way that reminds me of the fate of western Florida's Edgar J Watson [2] that Peter Matthiessen wrote so masterfully about[3].
But that's digressing a little bit...
By now, though, there has been enough dilution in my family that I don't think I would be any more than 1/8th; I think I'm probably more around 1.5/16ths. My mother's family, though having been in the Ozarks since the 1840s or so, has no indication of non-European blood.
Yeah, I'm from the south and was always told some ancestor was Cherokee. Never really believed it, since it really is the sort of thing most families say. But then 23andme confirmed Native American dna as a small percentage for me. Go figure. It might all be more true than most people think.
Well, I have the opposite story. I was always told I was 1/256 Cherokee, but according to 23andme, I have no Native American ancestry -- however, I'm about .4% African. .4% is pretty close to 1/256, so I think the race of one of my ancestors was, um, edited.
I think amttc is on the right track, but needs to take it a little farther.
I have a friend with North African ancestry (mother is Spanish) and neither of her sisters show the same (all with 23andme).
At that distance, it's entirely possible you have the ancestry claimed and the ancestry discovered, but the DNA which would show it is absent for your Native American ancestry.
Good point. You're right -- it's possible. I don't think any of my other family members have gotten analyzed. That would shed more light on the situation.
Edited to add: well, look at it this way. If one were part African in Alabama in the 19th century, one would be well advised to claim to be part Cherokee, if one's coloration and features were such that one could get away with it. Given that, I think Occam's razor inclines me toward the possibility I suggested.
I'm just one data point, but I'm from South Carolina, and one side of my family had a Cherokee ancestor myth when I was growing up. And, after having my DNA tested by 23andme, I found it was exactly that: A myth. I have no Cherokee (or otherwise Native American) ancestors, despite there being a belief in my family that there was a Cherokee ancestor.
I always suspected it was bogus; I actually kinda figured it was racist white folks' way to explain away dark skin and broad noses in our family tree without acknowledging black relatives. (But, it turns out my theory was also bogus. My family tree is Scottish, Irish, English, and Dutch.)
A sigil value can work too if you absolutely need it. ex:
The sigil value is truthy and makes your code more convoluted, though. ex: So, :/. I do love the language though.