And how I would do one with Javascript.. so I did. Here's a list of some books I've read semi-recently. The scores are not super well-considered.
show 4 per page
show all
You can have more than one per page, and it's easy to add them. This line of code will do it:
var table = new SortableData( data, headings, settings );
- data is a list of data objects. Each object corresponds directly to a row in the table. An example of the data object:
{ author: 'Alastair Reynold', score: 8, book: 'Chasm City' }
- headings is an array of data objects. Each describes a column of the table. An example of a heading data object:
{ key: 'author', value: 'Author', type: 'String' }
- settings is an object whose values are used to overwrite the SortableData object's defaults. You can specify fields like page_size, and page. An example of a settings object:
{ page_size: 5 }
The SortableData.js file must be included, as it describes the object.
So for each table we instantiate a new SortableData object. That guy takes care of writing and updating HTML, and the paging. But how do we reference the object for the necessary onclick events (clicking a heading to sort by a column, or a page link to view that page)? I chose to do is maintain a static instances array within SortableData. On instantiation, each object assigns itself a unique ID, and adds itself to the instance array.
Static SortableData functions handle the click events. Each function takes, as one of its parameters, a SortableData instance ID and calls the appropriate functions on the instance with that ID. And it even works! First try, in fact!
Then some CSS to style the HTML outputted, and that's it! We're done.
It'd be easy to write a wrapper object that loads data via AJAX, ideally receiving appropriately formatted JSON, but I am pretty lazy. And really, what use do I have for a sortable table?
Dev, being helpful to people less experienced than myself in the ways of the world; mostly in the ways of the web actually
Books, Javascript, Web Development
Blogging every second day is difficult. Not so much for lack of content, but just plain remembering to blog. When it was once per day, I could ask myself: Have I yet blogged this day? Now it’s more along the lines: Did I blog yesterday or was that the day before? And you know how days run together. Telling one from the next, when both in the past, is whatsit… confusing.
Embarrassing.
I was looking for a book to read. I figured it was time. But I have very particular tastes, and I am unforgiving.
After scanning for interesting cover on amazon, and checking a few lists, as per JB’s suggestion, I visited Alastair Reynolds’s blog — as I have had very good luck with some of his fiction in the past. Chasm city is one of my favourite books.
The idea was to scan through the most recent posts in search of any book recommendations or references that looked promising. Instead, I got distracted by the most recent entry re: the Myers-Briggs test. His test resulted in a score of INTP.
I got INTJ :S
Thoughts?
Results?
No luck on the book front, as yet.
Personal, Uncategorized
Books
I, as one rightly should, filter books by their covers. If they catch my eye, by being pretty or intriguing, rather than ugly, I will read that bashful text taking refuge on the book’s far side. if Interest remains by my side, if it has not skipped merrily off (as it has so many times before), I will often scan a portion of the prose contained between those aesthetically pleasing covers. Yes, choosing a book can be a long, and arduous process. And, to be honest, many times you will be disappointed.
Often, I feel as if authors have not put as much thought into the book’s universe, or the characters’ histories, as I’d like. My solution: skipping the first book altoghether.
I mean, sure, you may no know what’s going on, at first – or even later – but the universe will seem far more vast and detailed, and the characters far more complex.
The trick, I believe, is referencing past situations and events with as little elaboration as possible – allowing the reader’s imagination to spin off, fueled by wonderment and possibilities.
Unrelatedly, I made a three (or four) page comic, but it wasn’t very good, so I probably won’t post it.
Opinions
Books