Using datatables.js with Get()

It’s been a while since I’ve posted in the Software Development category, but here’s the solution to something that’s been a thorn in my team’s side for a few days. We’re working with datatables.js, which provides a nice interface to tabular data. We’re using it to Get() data from an API we’re building, and out of habit we were just returning data in a JSON object (btw, if you’re not using Swagger, start doing so now):

"normal" JSON API response

Unfortunately, this just kept showing us a frustrating “No data available in table” message.

After much digging, we realized that datatables really wanted the data in a completely different format:

API Response format for datatables.js

Notice that each data “row” is now basically an array, and there is just one “data” element in the JSON.

Continue reading “Using datatables.js with Get()”

Between the World and Me, by Ta-Nehisi Coates

quoting another reviewer:Between the World and Me

Between the World and Me is written as a letter/essay from Coates to his fifteen-year-old son, trying to come to terms with what it means to grow up as an African American male in 2015. …no sugar-coating, no careful racial diplomacy, no worry about mediating opinions to cater to what white people might be able to hear. it’s a heartfelt, raw, painful and honest letter from a father to a son, laying plain Coates’ worry, anger, frustration, and fear for his son’s future in light of Coates’ own past and the world his son will grow up in.

I don’t know that, if everyone in the U.S. read this book, anything would change with regard to “race relations,” or “civil rights.” I do believe that at least some percentage of people would begin to think about- and perhaps try to understand though likely fail more often than they think – the way others feel about the way they are treated.

In that hope, I will recommend reading Between The World And Me, especially when you find it difficult to do so.

[aside: The first rule of Privilege Club: you don’t know you’re a member of Privilege Club. The second rule of Privilege Club: when told you’re a member of Privilege Club, you don’t believe it.]

Zombie Baseball Beatdown, by Paolo Bacigalupi

More zombie cows, this time in the United States. Zombie Baseball Beatdown book coverIt sounds like one of those books you think will be silly, gross and the perfect book for middle-school boys. And yes, that is true, but there’s more to Zombie Baseball Beatdown.

“There could be millions! Total zombie apocalypse!” Joe said then he looked thoughtful. “That would be pretty cool, actually. I mean, if they didn’t all want to chew our brains out.”
Trust Joe to find the bright side of the zombie apocalypse.

Rabi is an Indian-American, and is bullied by others on his baseball team. When things go wrong at the town meat packing plant, he and his friends Miguel and Joe get quite an adventure. Along the way Rabi (and the readers) get lessons in how power works in a capitalist society, what it’s like to live in fear of deportation, and some of the seedier sides of the factory farm industry.

That’s not to say this isn’t a fun book; it is, and of course a little violent and gross. Isn’t that why we read zombie books?

Apocalypse Cow, by Michael Logan

It started with the cows.Apocalypse Cow book cover Flesh-eating, sex-crazed zombie cows. In England. That right there should be enough of a review to get you reading. And to give you enough warning — should you feel that you need it — that there will be gore and violence of a somewhat cartoon variety.

I picked this up based solely on the title and cover, and I was not disappointed. The characters are somehow simultaneously caricatures and yet believable, the action is good, the comedy is ever-present, and the cows… well, the cows are hungry.

Apocalypse Cow is a downright fun book to read.

Just keep an eye on the animals.

Alice, by Christina Henry

In the hospital, there is a woman. Her hair, once blond, hangs in tangles down her back. She doesn’t remember why she’s in such a terrible place – just a tea party long ago, and long ears and blood…

Suffice to say, this is not Walt Disney’s “Alice in Wonderland,” and not a book for children nor anyone who is bothered by violence including rape and torture.

Alice, by Christina HenryThis a much different tale than anything wonderland-related you’ve read or seen before. Alice, from Christina Henry, tells us of a deeply disturbed girl, having been found “covered in blood, babbling about tea and a rabbit” and subsequently thrown in an institution. She doesn’t remember much, and her only friend is the inmate in the next room who speaks to her through a mouse-hole in the wall.

What follows isn’t quite a horror story, it’s not frightening as such; but much of what we learn has happened to Alice and continues to happen in the Old City is truly horrible.

So, the question becomes… Is this the true story of Alice — Is the “wonderland” with which we’re so familiar just a product of her mind trying to protect herself from the truth?

We’re All Damaged, by Matthew Norman

Of the books I read while on vacation this past week – or all the books I’ve read yet this year – this is my favorite. We're All Damaged, by Matthew Norman

We’re All Damaged is a novel that, in my mind at least, goes in the same category as The Junk-Drawer Corner-Store Front-Porch Blues and The Art of Racing in the Rain: introspective novels that delve into the reality of life, and the fact that all’s not always sunshine and unicorns.

Andy, Matthew Norman‘s main character, is definitely damaged, having lost his wife, his job, and his way. A family emergency pulls him back from New York, where he’s hiding from himself (though he’d probably not admit it), into the mess of his life.

Maybe it’ll just… work itself out.”
“That’s stupid,” I say. But maybe it isn’t. Maybe, in fact, it’s brilliant. My parents are Catholic. Technically Jim and I are Catholic, too. Maybe this is how Catholics do it. We accept a certain level of unhappiness—like we have an unhappiness equilibrium built into our brains—and then, one day, we drop dead.

While dealing with – or not – the family and friends and his history with them, he meets someone who will change everything.

But not in the way you might expect.

Be You. Do Good., by Johnathan David Golden

Johnathan David Golden is the founder of Land Of A Thousand Hills coffee, a company who’s tagline “Drink Coffee. Do Good.” is more than a slogan, it defines their mission. Working directly with farmers in war-torn Rwanda, they provide us delicious coffee and the farmers with sustainable, profitable business.

Be You. Do Good.Golden encourages us, in his new book Be You. Do Good.: Having the Guts to Pursue What Makes You Come Alive, to examine our lives and our livelihood. Our work should be an outpouring of our passion, not just something to fill in the day and our bank accounts – “If you try to find all of your meaning or purpose in something you do from 9:00 until 5:00, you’ll be disappointed.”

As a Christian, it’s often tempting to say “I’ll go when God sends me,” but Golden points out that we’re sent every day, and that journeys all begin with a single step. There are some that don’t require that we even know the eventual destination, just an initial inkling of direction.

“You can move. You are not a tree.”

Black Hat Jack, by Joe R. Lansdale

Joe R. Lansdale’s “Black Hat Jack” is an… interesting western about an African American Cowboy and his partner exploring the great west and getting into trouble with Native American Tribes. Black Hat Jack, by Joe R. Lansdale

I wouldn’t exactly recommend it to kids nor adults who are squeamish about rough language, but it’s a good tale.
The writing style reminded me a bit of Mel Brooks’ Blazing Saddles, a bit of Quentin Tarantino’s Django Unchained – take that as an indication of the language and attitudes of some of the characters – as rough as it seems genuine to the place and period.

The Lathe of Heaven, by Ursula K. Le Guin

A man comes to you, saying that some of his dreams come true. The Lathe Of Heaven, by Ursula  K. Le GuinNot in a “I dreamed I’d get a new car and the next day I won a sweepstakes” sort of way; he says that he’s actually changing the past, and that what we remember isn’t real. Or wasn’t real. Or something.

On the surface “The Lathe of Heaven,” by Ursula K. Le Guin, is an interesting short novel. Decent science fiction, and a fun read.
When you sit back and think about it, perhaps reading it again, you realize that there’s more depth to the novel, much more. It’s not as much about George, the dreaming man. The story is told from his point of view as he’s manipulated by his doctor, and it’s exploring the temptation we have to “play god” and attempt to change the world “for the better.”

Summer Reading

Flying Saucer at the Hyattsville Branch Library, Hayattsville MDAs a youngster I spent a whole bunch of time, especially during the summer, at the public library. Libraries, actually, plural – my mom would take me to several in the area though my favorite was always “the library with the flying saucer.” I’m pretty sure she even had a job there for a while; I seem to remember her showing me the switchboard she worked.

One great thing that Public libraries do every summer to encourage kids to read more is to host a Summer Reading Club. They weren’t really “clubs” per se, there were no meetings or anything like that, but it was a fun way to track how many books I read through the summer months. That’s probably at least partially what lead me, as an adult, to join Goodreads. Of course, there were incentives – prizes of about the Cracker-Jack box variety, but they were prizes – if you read at least some number of books or were the kid who read the most. Summer Reading ProgramOnce our children got reading on their own, my wife and I signed our sons up as well.

As an adult though you were pretty much out of luck until recently. Goodreads is great for tracking, and even has had a yearly reading challenge for the past several years.

Today I just learned that our friends at the Atlanta-Fulton Public Library (twitter: @AFPLS) have a treat for adults – a summer reading program just for us. Yup, the Adult Summer Reading Program! We get to sign up and then write a review for each of the books we read during the months of June and July… and there are prizes! There’s nothing about it that I can find about it on their website, and you’ve got to fill out forms using paper and pen for each book you read, but if you’re in the Atlanta area be sure to stop by your local branch and check it out.

Thank You, AFPLS

——

some of the books I’ve submitted: