dorchadas: (Office Space)
So on Friday last week, I arrived at work, booted up our database program, got to work, and immediately received a "number precision too large" error. So I fired off an email to support and waited. I heard nothing, but I was only there for a half-day since it was [personal profile] schoolpsychnerd and my ten year wedding anniversary. I figured they'd work on it and I'd come back on Monday and it'd be fixed.

Narrator voice: It was not fixed.  photo shaking_fist_emoticon.gif

It is now Tuesday, and I've gotten two emails, one of which asked me if it worked now (it did not), and the other saying they had escalated the problem up the ladder. It still does not work. This is pretty much confirming my preconceptions about corporate projects, where the new database was six months late, has a terrible UI, is less efficient than the 19-year-old internal software it replaced...and currently doesn't work. Good job. Congratulations all around.

And of course, all the people who originally pushed this project have left the organization. They made their dramatic mark, but deal with the aftermath? Pfft.

We'll see how long our new fancy database software doesn't work. Will it be down for a week? Tune in later and find out!
dorchadas: (Office Space)
For the last couple of years, we've been ramping up to switch database software at work. This makes sense--the old database software was 19 years old and has been running on twine and duct tape for roughly the last decade, never conclusively overhauled because we were just going to replace it, so why put too much effort into it? Well, we finally replaced it.

You can tell from the title what I think of it.

Some of it is sour grapes. They made an effort to ask us what we thought of the new system and get our input on its development as we did testing, and as far as I can tell, they completely ignored every suggestion we made. For my part, the UI is still garbage. The new system is completely mouse-driven to the point that it doesn't accept hitting enter and you have to click the Search button like some kind of animal. The search window hides the original record and can't be moved, so checking to refine the search requires cancelling the search and losing the results, and searching takes long enough that I just have to chant the other bits of data myself to remember them like some kind of Leibowitzian monk.

A lot of old complaints don't even seem to be fixed--searches are still slow and it crashes roughly twenty times as often. It still offers suggestions for matches that are completely unrelated--different name, different state of residence, different specialty, different everything--to the record in question. Furthermore, the old database kept sending us the same records to research month after month with no way to tell the system that no, we were never going to find out who this physician is so stop asking, and the new system does the inverse by repeatedly popping up people who are already identified and asking me to identify them.  photo _thisorthat__or__compare__by_brokenboulevard-d4tole3.gif

And this leads to my main complaint. My work doesn't have great social value and I'm not saving the lives or children or anything, but at least I was accomplishing something. There was data, and I sorted through it, and I made the resulting output better than the raw input was. I no longer have any indication that's the case. I come in and I have 500 records to look through, around 99% of which the system already seems to know the answer to but just wants to waste my time with, and that number goes down as I work. But when the system inevitably crashes or logs me out for no reason and I login again and get back to work, that number is back to 500 again. Every day I am moving sand from one pile to another, one grain at a time, and then the wind blows it all back overnight.

And this is the system after it was delayed for six months.  photo emot-psyduck.gif
dorchadas: (Dreams are older)
Yesterday I saw an article on Twitter about how video games are better than real life, and it got me thinking.

I'm lucky enough now to have a job with reasonable pay and excellent benefits, but something I'm always conscious of is that my job exists as a stop-gap. I do data quality curation, so my day is checking the results of machine algorithms and dealing with what they can't handle--since we get millions of records a month, there's no way they could all be checked by hand and no need to do it when well over 99% of the work can be automated. But automation keeps getting better, and that means the space for what I do now is continually shrinking. Eventually, it'll be gone. Not this year, probably not in the next five years, but almost certainly before I retire.

(Incidentally, this is one reason why I save so much of our income. I'm trying to get ahead of the curve while I can  photo latest.gif)

And then I think about the last year we were in Japan, after Suzugamine cancelled its contract with Lang due to a shrinking student body (shrinking so much that it later merged with another school and changed its name), when I was out of work. [personal profile] schoolpsychnerd told me to treat it like a vacation, and that I could get a job when we got back to America and she was in grad school. We made an attempt to look for work closer to Chiyoda, but there wasn't much to be found, and in the end that's what I did. I taught the eikaiwa we had, but otherwise I studied Japanese, walked around the neighborhood, and played video games.

Like the article says, it was fine. I really enjoyed much of that year, though in the end I was having serious sleeping problems and it was clearly having an effect on me. But while I regret not doing more Japanese studying during that year, playing games was fun. It was interesting and challenging. The lack of a job didn't bother me at all. And why not? Unlike life, video games are fair. They have understandable rules that can be challenged and mastered, and predictable results from those rules. And if they don't fit those criteria, they're often bad games, and there are other games to play. There's no other lives to life.  photo darksouls.001.gif

That's one of the few things that provides me some hope about the automation apocalypse. Large groups of unemployed young men is usually a route to massive social unrest, if not outright revolution. If those young men are fine without work as long as they get to play video games, and if robots can do the work, well...why not let them? With some kind of basic income scheme rather than having people fight over increasingly dwindling jobs, which is what we're currently having people do? There will be massive social hurdles to overcome--"what do you mean, I'm working and my taxes are paying for him to play World of Warcraft 2?!"--but it seems like the only option that doesn't end in massive bloodshed or social unrest.

That part I'm less optimistic about. But at least I have a little hope.
dorchadas: (Office Space)
So, I think my motherboard is going bad.

Background--I noticed on Tuesday and Wednesday when I went to use my computer after work that it had restarted sometime in the middle of the night. That's not normal behavior, and at first I thought it might be something weird due to the new mouse I bought and the software to configure it, so on Wednesday I uninstalled that, did some basic tests--sfc, chkdsk, and so on--and all of them came back with no problems. Alright, I thought, let's try to hibernate the computer and see what happens.

Disaster, that's what happened.  photo emot-byodood.gif

The computer hibernated. Then it shut down. Then when I booted it up again and logged into my account, Firefox crashed with an out of memory error as soon as it opened. Then the comptuer froze. Then trying to log in gave me a "something went wrong" message and it dumped me into a temporary profile. I ran MemTest and stopped the testing when it passed 5000 errors because even one was too many. This...was bad.

After removing RAM sticks, swapping them around, and testing with MemTest again, I have one 8 gb stick in slot 2 that works fine and returns no errors. But so far I've tested two sticks in slot 4 and each time I got 7 errors, all of which showed up after hours of testing. I'm going to test another stick tonight, and if it also returns 7 errors, either there are hidden errors in the stick in slot 2 that I thought was safe that only show up when the RAM is running in dual channel mode, or slot 4 is bad. Either of those is not good. My computer is fortunately still under warranty, but if I have to ship the whole thing in, especially over the holidays, it'll probably take three or four weeks to get back to me and I have two weeks of vacation coming up soon.  photo emot-nyoron.gif

My computer current works fine, though it does run noticeably slower with 8 gb of RAM rather than 32 gb. Fortunately, everything I want to do with the computer can easily be accomplished with 8 gb. Editing LiberOffice documents, putting dialogue in my BGII Let's Play, and playing pixel-art games like Stardew Valley and Pokemon Fire Red do not take a lot of RAM. But it is having serious problems, it is under warranty, and if I can't isolate the problem to the RAM, I'll have to send it in eventually. Just hopefully after the New Year.

I have everything backed up now, both in the cloud and locally, so I haven't lost any data other than my browser tabs. My saved games and screenshots are still around. My RPG work is still fine. I nearly had a panic attack for the entire day on Thursday--at elast, it felt like it--but I'm doing better now that my computer is working, even if in a crippled state.

I'm going to update the BIOS today and run another MemTest with the last stick I haven't tried tonight. Hopefully that comes up clean, but if not... Well, I'll deal with that if it happens.

Also, I asked my father to give me some advice, and we had this exchange when I managed to make a new user account and move my old data over after the last one got corrupted:
Me: "I think I got it working thanks to legacy workarounds."
My father: "Good. Now go and sin no more."
dorchadas: (Broken Dream)
Yesterday I came across this article by Andrew Sullivan about the downsides of constant digital connection. A lot of it is the same stuff that keeps popping up in articles everywhere, about how no one pays attention to each other anymore, and maybe we should put our phones down and actually talk to those next to us, and oh no why are people texting instead of calling, and the standard jeremiads about how smartphones are ruining the youths.  photo c9a2ed93dbfb11e324f5b3e281e5e1b2.gif All of that ignores how I can keep in contact with friends from around the world, study Japanese while standing on a packed train, find my way around a foreign country without having to carry paper maps or wander the streets, make restaurant reservations in seconds, tell [ profile] softlykarou how long it will be until I can meet her in real time, and...well, if you're reading this, I don't have to keep elaborating because you know.

Multitasking degrades performance and people who read the news are more depressed, and it sounds like that was a lot of Andrew Sullivan's problems right there. But the part of the article that really drew my attention was this:
That Judeo-Christian tradition recognized a critical distinction — and tension — between noise and silence, between getting through the day and getting a grip on one’s whole life. The Sabbath — the Jewish institution co-opted by Christianity — was a collective imposition of relative silence, a moment of calm to reflect on our lives under the light of eternity. It helped define much of Western public life once a week for centuries — only to dissipate, with scarcely a passing regret, into the commercial cacophony of the past couple of decades. It reflected a now-battered belief that a sustained spiritual life is simply unfeasible for most mortals without these refuges from noise and work to buffer us and remind us who we really are. But just as modern street lighting has slowly blotted the stars from the visible skies, so too have cars and planes and factories and flickering digital screens combined to rob us of a silence that was previously regarded as integral to the health of the human imagination.
I don't currently have much silence in my life. Nearly every second of every day, I'm listening to a podcast. Even when I'm reading in bed at night, there's usually a podcast and some music going, since I'm trying to listen to and rate most of my music. And there are definitely times when I realized that I've been listening to a podcast for an hour and can't remember what any of it was.

Is that a problem, that I just want podcast noise in the background sometimes? Would I be better served by just setting Rain Rain on rain-on-roof and thunder sounds while I read? Obviously this doesn't apply in all situations--I remember work before I started listening to music and then podcasts, and it seemed to last a lot longer and was far more boring--but am I doing myself a disservice by eschewing silence elsewhere?

I remember the nights in Chiyoda. Living in the suburbs or the city as I had until that point, I hadn't really understood how quiet and dark the night was. I can just imagine my ancestors in England in winter during the new moon, when everything was deathly silent and pitch black, huddled indoors by the fire. That's why we lit the night (and why we, unlike the Japanese, have central heating). But I do remember going for walks in the hills around Chiyoda, and while it wasn't silent, the only sounds were the wind and the cicadas, the frogs, or the crunch of leaves or snow. Japanese has a word for that: 森林浴 (shinrinyoku, "forest bathing").

Sometimes I look forward to the day when I will have listened to all my podcasts. I wonder if my brain is trying to tell me something?  photo ashamed2.gif
dorchadas: (Office Space)
Got a new computer at work as part of the upgrade process for our upcoming database overhaul. The computer itself is pretty neat. It's about as wide as my hands together and square, and then maybe 3 cm thick, and it works great. But.

(Of course there's a but)

There's a suite of applications I need to do my job that auto-loads with the computer, and then I log in. And for some reason, the new computers--all of them--can't log in to those applications. We get security errors and then get locked out.

IT has a solution, though. They're having us do remote login to the database, from our own work computers, because that's a different validation process and that lets us actually access the system. And it works. It's slow, the interface looks like it hasn't been updated since Windows XP, and it sometimes randomly logs me out and I have to restart the process, but it works.

dorchadas: (Dreams are older)
I signed up with the iPhone upgrade program last year when I got a 6S, so my time had come, and yesterday I made an appointment and went down to the Apple Store to pick up a 7.

If I had gotten a 128gb model last year, I wouldn't have bothered to get get a new phone. It's not a huge upgrade in performance or battery life and the removal of the headphone jack is an active inconvenience for me, since I listen to podcasts for my entire time at work and thus go through about a battery and a half in a workday. But the other active inconvenience for me is that every smartphone I've ever bought, I've never had enough space on it. I've always thought that I'd have plenty of space when I updated phones and I've always been wrong, so this time I sprung for the 256gb model...and now I have 150gb unused after stuffing it full of podcasts and putting almost all my music on it. It does mean I'm future-proofed, at least.

The actual process went fine, other than the AT&T activation, which required none of the info I had brought and did require info I didn't have. Though the account password turned out handy, when I had to log into AT&T after my phone had already been reset to get my father's cell phone number since I was calling from the saleman's phone and so my parents didn't pick up because it was an unregistered number. Once it was all sorted out and I had tested it by calling [ profile] softlykarou, I got home, updated the backup, and everything was good to go.

I'm amazed that I'm still using the same information from my first iPhone from 2008, but I've never had a phone get corrupted or anything get reset. For me, it really does Just Work.

Also already ordered a case that's in tune with my aesthetic.
dorchadas: (Dreams are older)
Over a year ago, we switched to JIRA at work. If you're not familiar, JIRA is a project-tracking software suite for assigning projects, marking progress, giving credit to different people who do different parts of said projects, and providing metrics for efficiency and accuracy.

It's the last bit that's why I'm annoyed. The old system that kept track of my work was intra-group emails and screenshots, which I suspect wasn't super efficient because people had to look at the screenshots and enter the data manually, but I got an email every day with a breakdown of my work from the previous day, how efficient I was, and how much work I got done. I still got those for a bit after we switched over, but they stopped because my supervisor is much busier now. Okay, that's fair.

But nothing has replaced them. Using JIRA takes (a little) extra time for me to enter in record counts and time taken, which means that all that data is in the system and I should theoretically be able to call up a progress tracking chart that's updated in real time. But for some inexplicable reason, I don't have access to that data. I brought it up in a meeting when the division manager mentioned that they wanted to install monitors near the printers showing real-time metrics for the group's progress, since I think it's only reasonable that I be able to see that data from my own computer if it's visible to passersby. And yesterday, I learned that at least part of what I want is currently managers only. I can get a list of all the tickets I processed, and a list of the time I took on each one and how many records they had, but if I want a simple analysis of records/hour, I need a spreadsheet or a calculator.

Hopefully this gets corrected soon, but it's always funny to me to hear how "data-driven" we are when under the old management team, I had far more data on my own performance than I have now.
dorchadas: (Dreams are older)
I set my new computer up, as well as the external hard drive that Newegg paid me to take off their hands--it cost $90 for a 2 TB external hard drive, and I got a -$120 sale credit for the bundle, and with an offer like that, how am I going to turn it down--and spent Thursday to Friday taking all the data off my old computer and transferring it to my new one. As of the time of this post, it's pretty much done. I have a Backup folding sitting on my desktop with some of my old User folder in it still in case there are any saved games or setting files that I'm going to want, but once the Backblaze backup of my new computer is finished, I'm going to wipe the external HD and copy over my new computer's settings, and everything will be fixed.

I have run into a few problems with the new computer, though, mostly related to finally have separate OS and data drives and using Windows 10. Here's some thoughts:
  • Rarely have I longed for the days of DOS games, where everything was stored inside the game directory in a folder marked "Save," as much as I did when copying user files over. The User folder is a snarled mess of data from programs everywhere, and I have basically no hope of ever untangling it. Steam Cloud saves got most of them back and the only other games I'm in the middle of are games that do store their saves in a folder mark Save, but I wish people would come up with some kind of system.

  • Now that I have the OS on a smallish SSD, I have to worry about programs that don't give you a choice of where to install them. Windows lets you move the Documents, Music, and so on folders, which takes care of a lot of it, but I had to solve the problem of iTunes storing all backups on the OS drive, which is a problem with a 64 gb iPhone, a 128 gb iPad, and 128 gb SSD. I found a program that makes an NTFS Junction automatically and lets you decide where the backups go, so I moved them onto D: where they belong. But really, as multi-drive setups like this get more common, this is only going to happen more and more often.

  • I only have six USB ports here. The old computer had ten, which means I don't have enough for all my peripherals. Fortunately, I don't need them all at the same time, but it still requires me to do more plugging and unplugging than I had to.

  • The lack of start menu is disconcerting, and I didn't realize that Cortana had taken over the start menu's functions, though with a ton of clutter from the internet. Once I cut off all of Cortana's internet access, the box says "Search Windows," which is exactly what I want.

  • Goodreader wifi sync to my iPad doesn't work anymore. I have no idea whose fault this is.

That said, I'm pretty happy overall. Modded Skyrim, which on my old computer hit the VRAM memory limit all the time just with walking around the countryside, runs smooth as butter with the High-rez texture pack enabled on my new machine. It's fast and quiet, with even the GPU under load not making much noise (and speedfan tells me it doesn't get above 80 C, which is what it's supposed to do since NVidia has a program designed to overclock it to that temperature). As long as it doesn't collapse into flames in the first thirty days, I should be set for a while.

I named it after Sovereign, the only Reaper who was actually interesting. I think it's time to go back to my old tradition of computers named after AIs. Skynet and Helios never gave me any problems at all.
dorchadas: (Grue)
Yesterday, my computer died. Right after I finished playing Shatterhand--literally, like two minutes afterward--the screen went black. Restarting the computer produced a restart loop where the dark colors had an alternating pattern of blues lines, and while it booted into safe mode and worked fine when I uninstalled the graphics drivers (well, relatively fine since the blue lines were still there), installing a new graphics driver in an attempt to figure out if it was a corrupted driver installation caused it to completely shit the bed.

When I left this morning, it had run a full CHKDSK and found nothing, then failed to start Windows and Startup Repair wasn't able to fix the problem. I left it running MemTest this morning, but even if that does find and fix a problem, my computer's days are now sharply numbered. Now that it's catastrophically failed--there was no warning and no performance problems, it just stopped working--I can't trust it.

Fortunately, I've got backups. I know that backups are like Schrödinger's cat and they are of indeterminate quality until used, but most of my stuff is redundant. I have a full cloud backup, a lot of my books and documents are backed on my iPad, my music is on my phone and an external HD (where my media is as well, plus another backup of the documents), some stuff is on [ profile] softlykarou's computer as well...I certainly have plenty of places to go to get my information from. The only problem will be getting it onto the new computer, since pulling down 1 TB of backup will take forever. Though not as long as it took to upload it!

I already ordered a new computer and paid a bit extra for faster shipping and same-day processing. The computer that just failed I built, and it worked for five years, with the only problems that ever cropped up when I tried to play heavily-modded Skyrim and the budget Nvidia GFX 570 I bought in 2011 couldn't handle it. Other than that, my gaming tastes have changed. Now, the games I anticipate are ones like Chasm or Eitr or I Am Setsuna, games that I'm pretty sure my old computer could run flawlessly. Of course, my stomach is trying it gnaw its way out of my body with worry--what if I wasted my money, what if it arrives defective, what if it fails just outside the warranty, what if, what if--but there's nothing I can do except wait and remind myself that the ratings on that particular model are good and the tales of computers arriving with massive problems are not automatically representative.

Well, it was five years old and it served me well. I was planning on replacing it anyway, just not for another month or two. In the meantime, I still have my phone and my tablet, so I guess I'll be doing more reading for the next couple of days.
dorchadas: (Chicago)
And it wasn't nearly as boring or terrible as I expected it to be.

Without being too boring myself, we're replacing a system at work that I use to do my job, so my boss and I went into the consultant's office and dialed in to the vendor who's working on the replacement. Half the conference call was the vendor demonstrating how the system is supposed to work, and the other half was me demonstrating how it currently doesn't work.

It looks like some of my concerns are related to the way that the current system works but will go away with the new system, so it's nice to have that allayed. But I felt kind of bad for the vendor as she asked me to demonstrate what I had done and then she got to see the system she was working on completely choke under the effects of a simple database search. It's one thing to not optimize until all the features are in place, but it's another thing to be so unoptimized that the user cannot effectively test it at all.

There's another call scheduled in a couple months. Hopefully I'll have more constructive feedback than, "I can't test it because it doesn't work" then.
dorchadas: (Gendowned)
So Steam fucked up big.

I got kind of lucky in that [ profile] softlykarou and I were at my parents' house, so I wasn't on Steam at all, and I only learned about the problem when scrolling through Twitter and someone retweeted a Kotaku tweet telling people to go in and remove their payment info. Except that's literally the worst thing they could have said, because as the top article says, it was page-caching error, and logging in would probably just give you someone else's page while adding your own page to the cache and letting other people see it. And you still couldn't make changes. Oops. It didn't expose people's credit card information as far as I know, but full name and address was visible.

I still haven't gotten an e-mail or anything from Valve about this, by the way.

This is just feeding into my conviction that computer security doesn't exist for the end user. You can make things worse, by using the same password everywhere or running unsecured Java or whatever, but unless you rigidly practice OPSEC when feeding information to different websites, you're only as secure as the company you deal with who cares the least about security is. And none of them will care that much until the cost of breaches is higher than the cost of letting things slide, because for the average end user, on the security <---> usability sliding scale, things are already too far toward the security end.

It's why I talk about "security through apathy." Your best defense is hoping that no one cares enough to target you personally. And most of the time you'll be right, but if you're not...  photo Kirby_Shake_WaddleDee_Emoticon_by_D.gif
dorchadas: (Do Not Want)
This post is borne out of my annoyance with this article titled The Tragedy of Mozilla and with various comments on the internet complaining about how mean people are being to Eich, how if we decide to boycott Mozilla then what happens when "they" decided to boycott something we agree with, when will it end, stop the madness, but free speech lol, and so on.

And another example, here's Andrew Sullivan making the "but both sides!" argument:
When people’s lives and careers are subject to litmus tests, and fired if they do not publicly renounce what may well be their sincere conviction, we have crossed a line. This is McCarthyism applied by civil actors. This is the definition of intolerance. If a socially conservative private entity fired someone because they discovered he had donated against Prop 8, how would you feel? It’s staggering to me that a minority long persecuted for holding unpopular views can now turn around and persecute others for the exact same reason.
Of course, as the subject line I mentioned above should tell you, I think this is an incredibly sophomoric view.

You can read plenty of opinions that agree with me here on Sullivan's Facebook page, but I'll quote a bit from Marco Arment because he's one of the hosts of the Accidental Tech Podcast, which is great and you should totally listen to it if you're interested in tech news. Anyway:
Suppose, rather than fund an anti-gay-marriage bill, Eich had instead funded a fringe bill that prohibited black people from getting married. Or suppose he said during a press conference that he believed women shouldn’t have the right to vote.

Would it be reasonable for the public to be outraged and call for his firing then?

Assuming your answer is yes (I don’t think I can really help you if it’s not), why is that different from funding an anti-gay-marriage bill?
More here.

The main thrust of a lot of those internet arguments is basically this:

That all opinions should be freely expressed, and that by not letting Eich talk about his views we will slide ever-downward on a slippery slope toward some kind of censorship hell. Where will it end, asks the straight white male (and it's almost always someone who won't be personally affected by these opinions, though Sullivan's piece above shows that's not the entirety of the counterpoint), and cue the wringing of hands and the gnashing of teeth.

Here's my response to that:

And there's a number of reasons for that.
  1. Someone leaving a company because their behavior reflects badly on that company isn't censorship, it's capitalism. It's just that usually it's poor people getting fired and no one cares, but when the rich have to do it, all of a sudden people are up in arms. Hmmm.

  2. As I said in the subject, not all opinions are of equal value, and treating them as if they are is an abrogation of moral responsibility. "Let's give people their civil rights" is not the equivalent of "those people are subhuman and do not deserve civil rights." Some opinions deserve condemnation whenever they appear. As Marco Arment says above, if Eich had donated to the KKK this wouldn't even be a controversy. The only reason people are freaking out is because of societal bigotry.

  3. Similarly, bigot organizations like One Million Moms boycott equality groups all the time. Boycotts are not some kind of horrible censorship unless you think that capitalists are morally entitled to our money. They're one of the few methods that the powerless have to affect the behavior of the powerful.

  4. Prop 8 wasn't some kind of mere disagreement among ivory tower intellectuals. The proponents' ads in favor were full of insulting bullshit about gay people being too dangerous to allow around children. Slate has an article about it here.

  5. If firing people for their opinions is so bad, how about we repeal right-to-work laws and work to institute employment protections across the entire United States, conservatives? Does that sound good? I think we can work together on this to...hey, where are you going? Were you even listening to me? Again, Slate to the rescue.

  6. It is still legal in 29 states to fire QUILTBAG people for existing. The situation is not remotely comparable, and pretending like it is is...well, see above about the abrogation of moral responsibility.

American culture loves its Golden Mean Fallacy, to the extent that we have rich people apparently sincerely arguing that pointing out that they're destroying democracy and the middle class and leading us toward a nightmare cyberpunk dystopian future is exactly like the treatment of Jews before the Shoah. That's obviously ludicrous, though. Context matters, and treating this like some kind of horrible witch hunt does an incredible disservice to the actual substance of the argument.
dorchadas: (Kirby sweatdrop)
I've been reading books and listening to podcasts about cognitive biases and psychology (examples: Thinking Fast and Slow or the You Are Not So Smart podcast), and while a lot of it just covers the kind of things I already knew, it's still destroying what little faith I had left in the human race, which wasn't much to begin with.

Not too long ago, though, I read Willpower: Rediscovering the Greatest Human Strength, which is all about how willpower is a limited resource, works like a muscle in that it can get tired and not be there when you need it and be strengthened by exercise, and also that there's one kind of willpower that isn't subdivided by type of activity, so having to resist eating chocolate makes you more likely to rage when someone cuts you off in traffic.

The real name for that is ego depletion, for the curious.

Where this meshes with utopianism is that I have what I call a cynically utopian view of the best possible future, in that I think human minds are so flawed that the only way we'll get a government and society that's more than "great for a few, adequate for some, horrible for the majority" would be turning all important functions over to AIs, much like Iain M Banks' Culture.

The problem comes in when it turns out that self-control and resilience, or what's lately been called grit, are the personality traits that consistently predict success better than any other traits (not counting stuff like parental income here). And while we aren't sure where grit comes from and why some people have more and some less, I think it's not an unreasonable assumption that it develops through adversity and exercising it, because that's how willpower can be strengthened as well. That gets in the way of the ideal future being a crystal spires and togas civilization where robots do all the work and humans are free to devote themselves to the life of the mind, since it'd probably just end up with people watching holovision all the time and slowly falling into barbarism while a small percentage of the population keeps the flame of knowledge alive through the Long Night that follows.

What's more, apparently our grandparents' advice is correct and one of the best ways to resist temptation is simply never to be exposed to it in the first place. The best way to avoid eating chocolate is to not keep any chocolate in the house, and the best way to avoid civilization from descending into a decadent orgy of bloodsport and barbarism is to make sure that...okay, that's not the best analogy, both because individual brain activity can't really be broadly applied to society that way and also because it's trivially easy for civilization to descend into a decadent orgy of bloodsport and barbarism no matter what the technology level is. It's really easy for humans for decide to be terrible to each other for no reason.

Then again, if we can get to the point where we can make superintelligent AIs to rule us, maybe we can hack our brains to remove these problems, so maybe there's still hope. And this does rely on a supposition on grit, though if it turns out to be unalterable then that rapidly heads into Gattica-style dystopia. So at least I can maintain my cynicism unchallenged, and use confirmation bias to reserve my mental energy for other tasks!
dorchadas: (Pile of Dice)
And I haven't backed it because if it looks too good to be true, it very well might be.

I wrote before about a lot of the stuff I do include in the moddable CRPGs I play, like food and water or encumbrance systems or disease rules or lighting and visibility levels affecting attacks, has too much of an opportunity cost to use in a tabletop RPG. The fiddliness inherent in calculating and updating all that by hand makes it way too annoying for too little gain to use in a pen-and-paper medium, but a computer one? A computer one designed to be run like a tabletop one? That could work!

But there isn't much information about it. That pitch video is basically "This is going to be Your New Favorite Game because it's totally awesome. And Robin Laws. Woo!"

Now, Robin Laws is awesome and having him write the rules implies that it's not going to have tens of thousands of lines of code for combat but social mechanics that boil down to "I don't know, make something up," but there's just not that much info except that it's skill-based and multi-genre, other than what can be drawn from the screenshots. The first update has more info, but even there it's pretty vague.

Alright, what can I learn from those screenshots and the update?

  • Stats have a 3x3 grid like in White Wolf games, though the third category is called "Spirit" instead of "Social," but apparently covers the same ground with stats like "Presence" and "Influence."

  • Skills are percentile, or at least expressed to the player in terms of percentage of success.

  • Character creation ranges from "slap on a few templates and go" to "design everything by hand."

  • There are multiple possible models for the same character, with different armor, clothing, weapons, hairstyles, and so on, so the Invincible Sword Princess can wear a ballgown at a court event and then heavy armor when out in the countryside.

  • There's a system of Qualities, like Fearless or Undead.

  • Injury effects exist, as do wounds, and a bunch of situational modifiers like lighting, armor penalties, encumbrance, and so on.

  • Asymmetric player information is possible. If one character notices something but the others don't, everyone isn't automatically informed.

There's a lot that's not there, though. The first "genre pack" is fantasy, and apparently it's orc-dwarf-elf fantasy from that first update, but how does the magic system work? How customizable are skills or qualities--or the races, since "minotaurs" is a stretch goal? Are there combat maneuvers like disarming people or is it just attack->attack->attack? Is the environment manipulable?

What's more, there's a response about how they're not releasing a rules PDF because the rules would be way too complicated to use at the table. That may be true, but in playing MMOs and reading about RPGs I've learned that the collective knowledge of the player base is often larger than the knowledge of the developers, and if there's anything there that's potentially exploitable, someone will find it if the info is available. That's especially true in complicated systems, since the amount of rules interaction--and thus, the potential for an edge case to make everything explode--grows geometrically as the rules grow arithmetically.

I don't know enough to commit yet, but I'll be watching this one like a hawk.
dorchadas: (Dreams are older)
Well, that's finished, then. You can play my final project in the form I submitted it here--click the arrow in the upper left to start the game.

In some ways, the fears I expressed in previous posts were correct. A lot of the syntax we learned dealt with the specific implementation of Python that was used for the class that is not going to be the same anywhere else. Ways to load images, and take in mouse clicks and keyboard commands, and implement elements of the GUI, and so on. It's possible that they're similar to some kind of standard interpretation, but if so, I have no idea because we didn't learn about that. But programming isn't all just memorizing specific commands. It's more about learning ways of thinking and problem-solving skills that you can transfer over into any other programming language other than the one you started learning on, though this is obviously more or less difficult depending on the construction of the particular language.

I did run into some fun moments when I was developing this:

That was how it looked after I implemented multiple asteroids spawning and multiple missiles firing, but before I included anything about collisions. I messed around with it not just for the picture, but also to see if it was possible to have so many objects on the screen at one time that the game crashed, which it didn't. It did suffer from a lot of slowdown, which you'll also see if you try to play the finished version, but fixing that is one of the things I want to mess with now that the actual course is done. Right now it checks for collisions 60 times a second and it doesn't take position into account at all so it checks the entire screen every time even if there's only two objects on opposite ends of the screen. Hacking that down to maybe 4 times a second would probably make it work a lot better. See, an increasing number of objects becomes geometrically more intensive, because each object has to check for collision with everything already there, and everything already there has to check collision with it. Doing that when there's 12 asteroids and a ship and a few missiles and it's all being done through a browser-based code implementation which already slows everything down anyway is overkill.

On a further subject, look at the explosions in the game above. They weren't required as part of the assignment, but they were listed as a bonus step if we felt like we would be able to implement them, and I figured I'd give it a try. It only took about 15 minutes and was pretty easy. It was just loading the game, shooting things, getting an error message, fixing that, repeat until I finally didn't get any error messages. It was pretty much the perfect ideal of what bug-fixing should be like. Though once it worked, the explosion graphic was cycling through the various frames way too quickly and in the wrong location for the sprites, so that had to be fixed, but that just required checking how big the sprite was to make sure that I would cycle through to the next frame properly.

There's still more I want to do now, for my own personal improvement. Make the playing area bigger and the ship and missiles smaller. Maybe add powerups, that make missiles go further, or that shoot out two or three missiles with each press of the fire button, or a shield that blocks a single hit. A limited teleport that moves the ship elsewhere. Make the asteroids only spawn near the edge of the screen and drift toward the center instead of randomly appearing out of nowhere. Porting it over to regular Python instead of Codeskulptor's version of it.

Would I recommend this class? Not really. Even for a free class, I think it focused far too much on the idiosyncrasies of the class's specific implementation of Python and had several lazy practices, like the use of global variables because the GUI can't handle input any other way. That's not to say that I thought it was worthless, because it wasn't, but there are a bunch of other free sources for learning programming if, like me, you're cheapassunwilling to spend money.
dorchadas: (Kirby Walk)
a.k.a.: Lasers, pew pew!

This week and next week are the same project. We're doing an implementation of the old classic asteroids, though our version has sounds and actual sprite-based graphics because the professors programmed a GUI capable of handling such things.

It only took a couple hours to do, though I ran into a problem not based on programming but on math (to the extent that there's a difference anyway). So, you want to move a spaceship in the vacuum of space. That makes you need to take Newtonian mechanics into account, unless you're making X-Wing and want World War II dogfights in space, but we aren't. Except for the friction. We have friction in space. It's in the design requirements for the program.

I guess this like how in Power Rangers the moon has an atmosphere.

Anyway, Newtonian mechanics. If you don't know what I mean, it means that if you go forward, and then go left, you maintain your forward inertia and end up traveling at an angle, so I needed to calculate properly to make sure that happens when you're moving the ship around. In summary, the movement keys control acceleration, not velocity (at least for forward movement). Fortunately, it turns out that it's possible to turn an angle into a movement vector as long as you have the angle in radians, using the cosine and the sine of the angle. The problem I ran into was in correctly adding that to current movement to produce the new movement and make it look smooth, which took an hour and turned out to be incredibly simple, much like my problem with brackets and list comprehensions earlier. Just...add them. And include a constant to make sure the movement is smooth and scales up to the maximum possible velocity slowly, but that's easy enough. I'm starting to wonder how much of programming time is wasted in making simple problems harder than they should be. I guess that's why the Ballmer Peak is a real thing.

This is why I described programming as "math with more words" on Facebook. Even though the programs do the actual calculations for you, you still need to understand enough math to write the equations correctly. Or enough to Google how to write the equations correctly. Ahem.

Also, I wrote this method for the Ship class that handles the behavior of the player's ship:
def chargin_mah_lazor(self, pew_pew_pew):
global a_missile
lazor_bank = [self.pos[0] + angle_to_vector(self.angle)[0] * self.image_size[0] / 2, self.pos[1] + angle_to_vector(self.angle)[1] * self.image_size[1] / 2]
if pew_pew_pew == True:
a_missile = Sprite(lazor_bank, [self.vel[0] + angle_to_vector(self.angle)[0] * 3,
self.vel[1] + angle_to_vector(self.angle)[1] * 3],
self.angle, 0, missile_image, missile_info, missile_sound)

(indents not preserved during copying)
We can always use more laz0rs in our games, right? The documentation calls them missiles, but it's not like they have missile graphics. They're little blue star-shaped energy balls. That's as close to an 8/16-bit laser as makes no difference.

On the topic of things I learned this week, I learned about Magic Numbers, which are when you find random inexplicable numbers in the code whose value seems to be pulled out of nowhere. I did that when I wrote Pong and got called out for it, and almost did that this week when I was trying to make sure flying off one side of the screen would put the ship back on the other side. I was all ready to write in the raw numbers of the size of the playing field when I realized that the program template had set the Width and Height as globals precisely so that I could just say, for example, “pos[0] %= WIDTH” and then if I ever changed the size of the playing field, the rest of the code takes that into account and I don’t have the ship randomly disappearing and reappearing in other places.

Next week--the last week of the course--we deal with actually making the asteroids collide with the ship, making laz0rs blow up the asteroids, spawning new asteroids, keeping score, and so on. And then we're done! Though at the moment, my current plan is to keep tinkering with it. Adding some kind of limited-quality teleport, maybe adding powerups, other ships that try to kill you, that kind of thing. Sure, it's derivative, but it'll be a good learning experience.
dorchadas: (Green Sky)
This week was all about classes and objects and object-oriented programming.

Hmm. It's a good thing this class doesn't cover hardware or I'd be writing about master/slave systems.

Anyway, this week we programmed a graphical implementation of Blackjack. To my surprise, the graphical part was really easy--it was the logic of getting the cards to work that was hard and required some banging of my head against the wall. The way they suggested we did it involved three object classes: a Card class that handles the individual cards, including assigning values and suits to each of them and retrieving the proper image for drawing a single card to the GUI, all of which was implemented already in the program template we got; a Hand class that combines cards into a hand, deals with drawing new cards from the deck, and calculates the value of the hand for comparison, and a Deck class that assembled the proper 52 cards into a deck, figured out which card was on top and passed that card to each hand, and shuffled itself when starting a new game. Each class also had a method to report its contents which wasn't useful in the final program but was really, really helpful when I was trying to figure out what the hell was going wrong.

And oh, did things go wrong. Not with the graphical part--that was actually really easy to implement. But getting Hand and Deck to work was an adventure. First I couldn't get it to properly calculate the value of a hand, so it was a wildcard whether you won or lost. Then it was ignoring the ace special rules completely, so the classic blackjack hand was only worth 11. Then the Deck wasn't properly drawing cards, so I was pulling cards aren't that weren't on the top. Then when I fixed that and got both hands implemented, hitting worked, but standing caused an Index Out of Range error on an attempt to access a relative list element (blahblah[-1], which should get the last element in the list no matter how long the list is). Then I went and fiddled with something totally unrelated to fix the problem that after a single game the hands weren't cleared, so a new game would start with the hands from the previous game plus two new cards for each player. When I fixed that, all of a sudden the list index stopped returning errors because reasons, and despite extensive testing I couldn't get the index errors to show up again. Then I had a problem with calculating the score properly because sometimes I was doing it one way and sometimes another way, and sometimes the testing statement I printed showed the one way when it was actually using the other way, which is why you shouldn't rely entirely on print statements to debug your code. Then I extensively tested the program as an implementation in the console and made sure everything worked.

Then I implemented the GUI without problems. Crazy, right?
dorchadas: (Dreams are older)
This week was programming an implementation of Memory (the card game) and a big lesson on lists and dictionaries. There was also a lecture that was mostly devoted to the concept of iterative improvement and how important it is to programming.

The name does basically say it all, but I'll describe it anyway to avoid any confusion--don't do everything at once. Unless you are The One, destined to obtain power over the Matrix and defeat the machines, the programs you write will have errors. Some of them will be obvious because the program won't work at all, and modern languages tend to be reasonably good at telling you where a program breaks if the syntax is wrong. Sometimes the program works but it just provides a bad output, and if the entire program is all crafted at the same time, it's incredibly difficult to figure out exactly where the point of failure is. Much better to do step 1, make sure it works, do step 2, make sure that works with step 1, etc., until the entire thing works together.

Though as a story, sometimes syntax errors just screw things up. I was reading a forum thread where someone was trying to add a Coptic culture to Crusader Kings II and ended up with most of England filled with Noculture kingdoms speaking Noculturian. A later post in the thread suggested an unmatched parenthesis as the most probable cause. Oops.

I still have 100% in the course, though some feedback I got on last week's project was enlightening. I wrote Pong, and there were variables for the width of the paddle, the radius of the ball, the height of the paddle, and so on. When I calculated when score should be counted and when the ball should bounce back, I tended to calculate it in absolute distance by eyeballing it and adjusting the pixel count, and in the end, the program worked, so I submitted it. The feedback suggested I use the variables and that my code was hard to read because I hadn't used them, and until I saw that sentence, calculating the point where a score would be granted as if ball_pos[0] < PAD_WIDTH + BALL_RADIUS: instead of using the direct numerical values, because while it didn't matter here, it's best practices in the future to make sure that if the size of the playing field gets changed, then everything still works properly.

I also relearned the importance of math. For Memory, it's obviously important to know which card the player clicks on, and in the beginning all I could think of was needing a giant if statement--like, if click[0] > 0 and click[0] < 50:, and so on for every group of 50 for each of the cards, but I knew that there had to be an easier way, so I headed to the class forums. Someone there had the same problem, and a comment mentioned integer division, after which the light bloomed in my head and the rest of the coding was pretty easy. Since the cards are a standard width, just divide the X coordinate of the mouseclick by that width using integer division and the whole number left will tell me what card was clicked on. 382 // 50 = 7, so that's the 8th card, because 31 // 50 = 0, so the first card is the 0th card when checking the list of cards.

Incidentally, I think I've learned why Python list indices start at 0 instead of 1.
dorchadas: (Broken Dream)
I don't have as much to report this week. We learned how to use lists and tuples (etymology if, like me, you had no idea what that was), and programmed Pong.

Well, more like pseudo-Pong. See, our implementation doesn't keep track of the ball bouncing off the sides or corners of the paddle by using a "gutter" that's the same width as the paddle. That allows us to avoid having to do complicated math to figure out what direction the ball would have to bounce if it hit the edge, and by going all elementary physics and treating the ball as a spherical object in a vacuum--which, well, it is--we can just reverse the appropriate components of the velocity. It's pretty simplistic, though it was good practice for proper ordering of if-statements and a reminder that copying and pasting code can often be more trouble than just re-writing the same code. I spent ~15 minutes trying to figure out why the paddles were working in one direction but going berzerk in the other until I realized that when I copied the movement code from one paddle to the other, I didn't change all the variables, so the right paddle controlled itself and the left paddle controlled itself and the right paddle. Oops.

If you want to play an awesome version of Pong, don't play my version. Play Plasma Pong.

The overuse of global variables continues, and seems to be completely due to lazy coding for the GUI they're using. As near as I can tell, most UI elements that take player input cannot accept any input other than from the UI itself and can't call other functions, which makes passing variables around among functions difficult at best. It's something I'll have to keep in mind when I try to become a programmer, motherfucker.
dorchadas: (Drop Bear)
There was a forum thread (link provided even though it might be inaccessible) where one of the people in the class mentioned that a lot of the code they were reading was pretty inelegant and clunky, specifically citing the example of using a boolean global variable instead of using the timer.is_running() function to determine whether to award points in the stopwatch game, and that they had provided suggestions of how to improve the person's code while still only grading them on what was in the grading rubric.

Since I already wrote about timer.is_running I won't repeat myself, but I was kind of surprised at the reception the poster got. Even though they specifically said that they didn't take points off for inelegant code, they got downvoted like crazy and some kind of hostile comments, mostly about how this is an introductory course etc. etc. And that's true, but there's no reason to teach bad habits that people will just have to unlearn later. It's easier to learn than it is to unlearn and then learn something different.

I guess it's like the quote goes:
The trouble with most of us is that we'd rather be ruined by praise than saved by criticism.
-Norman Vincent Peale
Huh. Re-reading the thread, things are better now. When I first looked, the OP's posts were all getting downrated quite heavily. Perhaps I was too quick to judge.
dorchadas: (Green Sky)
I'm growing increasingly concerned that the processes I'm learning in this class aren't necessarily transferable, though I suppose that's also true of people who spend a long time with one company and have to work with their proprietary systems. See, the class is about learning to program through making games, and to facilitate this, the teachers made a bare-bones GUI that we use to get images and text to appear. That's all well and good, but I'm running up against programming best practices here. Global variables are bad, but as near as I can tell, the GUI requires the use of global variables to function at all, since some of the functions for manipulating the GUI don't take any inputs. It give me an added impetus to make sure I understand the underlying principles rather than just blinding writing random things until it works.

This week was just learning more ways to manipulate the GUI, though I did learn that graphics coordinates are measured from the upper left of the plane rather than the lower left as one might expect, apparently because of the way old CRTs scanned--from top to bottom and left to right. The actual program was a stopwatch game--stop the stopwatch on a whole number, get a point--and the program dealt with storing the time in deciseconds as an integer, converting that into a minutes:seconds.deciseconds format, and then properly accounting for 60 seconds becoming a new minute, prevent ~.1 from awarding points due to improper rounding, and prevent the player from spamming the stop button on ~.0 to rack up their score.

It's the last one that was a bit concerning. The teachers suggested using a global boolean variable to track whether the stopwatch was running and preventing it from increasing the score if it wasn't, which, okay. The problem is that the GUI includes a timer.is_running() function to innately determine that, which I learned about by reading the documentation, so I just used that. Why didn't the teachers mention that, since they programmed the damn GUI themselves? You'd think that would be relevant in the first assignment where we learned how timers work.


In other news, I ran into a really odd situation during peer evaluation of last week's project. In the comments on the project, the guy who wrote it copyrighted it. I wouldn't have thought that this was more than an odd quirk of his personality--you're copyrighting a guess the number game? Sure, whatever, dude--except his code didn't even work. And I don't mean in some subtle way that required me to dig into it to figure it out, I mean that I pressed the "Random number 1-100" button and the program threw an error and quit. Not only that, but it was supposed to cycle through again after you ran out of guesses, so you could just keep playing over and over again if you want. His program didn't do that. It went through two cycles, but then threw an error and quit. Not only that, but getting the number correct on the last guess didn't properly credit you. The game just told you you lost and then started over, and then the second cycle was impossible to win because it errored out. I mean, this would have taken literally seconds to figure out from a cursory test, but he didn't do it.

I suppose this is how QA people feel all the time.

Edit: Poking around the class forums on the topic of global variables, I found this quote:
In event driven programming you need to keep state around between event handlers. Using global variables is the easiest way to do this at the beginning level. At the end of the course, I will discuss how you can migrate towards using better practices.

Global variables are bad because they lead to insidious problems that are often hard to track down in larger programs. In the small programs that we are writing here, they are often manageable, even if they are not really desirable (and still can lead to bugs).
So, we'll see how that turns out.
dorchadas: (Office Space)
Wherein I learn not to blindly trust advice from people who are supposed to be my betters!

So, context. This week, we're writing a program that plays a simple "guess the number" game. Using the GUI library that they wrote for the class, we have to make it pop up a window, provide two buttons that changes the range of the game from 1-100 or 1-1000, and an input field for the player to put in their guesses. Then the program gives the player a set number of guesses--because, for example, any number between 1 and 100 can be found in seven guesses using binary searching--and when the player runs out, the game fails the player, prints out what the number was, and starts over.

It's the last part that was giving me trouble. Following the instructions suggested by one of the instructors, I wrote the main part of the program like so:
>>>Call global variables into the function
>>>If statement to check if the player has no guesses left and end the game if that was true.
>>>Decrement the guess counter
>>>Turn the player's input from a string into an integer so it can be compared to the computer's choice.
>>>If statement to do the actual comparing. If the player is wrong, print "higher!" or "lower!" and run through the loop again. If the player is right, tell them they win and start a new game.

The problem I kept running into was that either the game would end after (number of guesses you were supposed to get - 1), or that the player would get the number of guesses they were supposed to, and then the game would ask for one more input, which would end the game no matter what even the player made that guess correctly. Can you see where I went wrong here?

The problem is the order I set up the operations. Since the checking for how many guesses are left comes before the actual processing of the guesses, it means that after the final guess, the only place to go is back to the beginning of the loop and wait for more input. Then it gets that input, realizes that guesses are zero, and quits the game before it processes the guess, so the player gets the correct number of guesses but has to input a last futile guess to correctly end the game.

Originally, I tried moving the decrement to above the if statement, but that doesn't change the order of processes. All it did was meant that the player got one fewer guess than they were supposed to. Only moving the processing of the guess to the end of the function properly kicked the player out after the last guess. At the very beginning, I had put the check as part of a single if statement that also checked the guess for correctness, but that didn't work, and it took me a while to figure out why. The reason is that it's an if statement, not a "perform one or more of the following as may apply" statement, so it had the same problem as my implemenetation above--namely, that it needed an input to realize that the player had no guesses left.

Apparently there's also a while operator, and I could have jammed the whole thing under while guess_count > 0 [blah blah blah] else: print "LOL UR BAD" / new_game(), but we haven't actually covered that and I didn't want to mess with it, though I might go back and screw around with logs to figure out how many guesses the program gives the player instead of hard-coding in the two possibilities--seven guesses for 1-100 and ten for 1-1000.

And I'm sure there are other ways to implement this. One of the things that peer grading the first assignment showed me is that the obviously correct answer that I, of course, used in my personal implementation of the project was not the only possible way to do it. I don't recall where I read it, but I read a quote that said that you can become an adequate programmer working by yourself, and even a good one, but you'll never become a great programmer unless you work on other people's code and have other people work on yours. There aren't any group projects in this class, but grading each other's assignments at least exposes us to the way other people code.

Also, it's the only possible way to do it because the class has thousands of students and nowhere near enough instructors to evaluate everyone's assignments, but the principle still applies.
dorchadas: (Gendowned)
I'm pretty sure this is the week that a lot of people flee in terror when they realize that programming is just math with more words. And not only that, the words are things like "random.randrange()" and "print" and "def" and "if/elif/else" and not actual sentences.

Fucking random.randrange().

Let me explain. In Python, there are two main ways to get a random integer (well, there's probably more, but there are two I know of). There's random.randint(), which returns everything from X to Y inclusive, and random.randrange, which returns everything from X to (Y-1). Forgetting that distinction let me to some problems in my program that I had to go back and fix because the program wasn't returning the full range of possible answers.

The assignment this week was to make a program that plays Rock-paper-scissors-lizard-Spock, has the computer make a random guess, and determine the winner. We haven't learned how to implement dynamic input yet, or how to implement a GUI, so it just takes hardcoded player "guesses" and then returns a range of responses, and it's up to us to show that those responses are properly random and the program interprets who wins and who loses correctly. This takes math.

The hard way is to implement a giant if/elif/else statement using Booleans that takes into account every possible combination of throws, which is really long and annoying, and the easy way is to convert the throws into numbers and use math, since it's possible to plot the throws on a wheel--as in the wiki article linked above--and assign them numbers. Subtract, interpret the number to determine winner or loser, and boom. It didn't take all that long, fortunately, but I do need to go back and look into doing modulo operations with negative numbers. 3 mod 5 is 3, because there's 3 left over after the 0 times 3 is divisible by 5 in integer division, but -2 mod 5 is also 3 because ??? Because of floor division and the difference between 2 and 5? Doing other mod operations makes it seem like that's the case, but I don't want to have developed a rule-of-thumb that turns out to be inaccurate later.

That's the thing--the computer only does what you tell it to, so you need to have at least some understanding of the underlying math or you won't be able to tell when the answer seems wrong. In this week's quiz, I had to build programs to calculate inputs into these formulas: ¼ n s2 / tan(π / n) and f(x) = -5x5 + 69x2 - 47 . Those are the kind of cases where knowing what the answer should be, even as a rough ballpark, is really handy.
dorchadas: (For the Horde!)
I typically like to use the kanji for my tags even if there's a kana equivalent, just because I think it looks more elegant, but sometimes I just don't have a choice because the kana version is far, far more common than the kanji one. Computer programming is one such tag.

So yesterday I started that programming class I mentioned a few months ago. Well, it's not actually the same class, since the original one that I wanted to take ended up being removed or vanishing for no obvious reason, but the new one might be a better fit for maintaining my interest. It's all about using Python for programming games. This week is "Week 0" and so I basically don't have to do anything--my assignment is to submit a program that's one line--but at least it's giving me a nice intro into the format of a Coursera class and what exactly to expect.

There's a custom implementation of Python they built to make it easy to submit programs you can play around with here if you want.


dorchadas: (Default)

June 2017

    123 4
5 67 8 910 11
12 131415 1617 18
192021 22232425


RSS Atom


Expand Cut Tags

No cut tags
Page generated Jun. 23rd, 2017 12:14 pm
Powered by Dreamwidth Studios