tim

Theatre & time / David Wiles

Wiles, David, author




tim

Working From Home For The First Time in 3 Years – Expect Some Writing/Open Source From Me

Like many of you I’m working from home for a while. As a mental health strategy, I’m going to do some writing and coding in the hour or so I get back each day from not having to commute. The first post, which will follow today, will be my thoughts on working from home. I […]




tim

Real-Time Search in JavaScript

What I meant was scanning the DOM of a page for text equivalents and showing the actual parts of the page, as well as hiding the irrelevant ones. I came up with the technique when I was designing Readerrr’s FAQ page. Take a look at the example:

I have also implemented the solution here on my blog.

How it works

All simple. Let’s take the FAQ page as an example. Here’s a typical markup:

<h1>FAQ</h1>
<div class="faq">
	<input type="search" value="" placeholder="Type some keywords (e.g. giza, babylon, colossus)" />
	<ul>
		<li id="faq-1">
			<h2><a href="#faq-1">Great Pyramid of Giza</a></h2>
			<div>
				<p>The Great Pyramid of Giza <!-- ... --></p>
				<!-- ... -->
			</div>
		</li>
		<li id="faq-2">
			<h2><a href="#faq-2">Hanging Gardens of Babylon</a></h2>
			<div>
				<p>The Hanging Gardens of Babylon <!-- ... --></p>
				<!-- ... -->
			</div>
		</li>
		<!-- ... -->
	</ul>
	<div class="faq__notfound"><p>No matches were found.</p></div>
</div>

I wrote a tiny piece of JavaScript code to handle the interaction and this is how it works:

  1. When the page loads, the script indexes the content of all li’s into browser’s memory.
  2. When a user types text into the search field, the script searches for equivalents among the indexed data and hides the corresponding li’s where no equivalents were found. If nothing found, a message is shown.
  3. The script highlights the text equivalents by replacing phases, for example, babylon becomes <span class="highlight">babylon</span>.

Now, try it yourself:

Demo

Taking it further

Since I chose FAQ page as an example, there are some issues to deal with.

Toggling the answers

It is a good practice to hide the answers by default and show them only when user needs them, that is to say when they press the question:

.faq > ul > li:not( .is-active ) > div
{
	display: none;
}
$( document ).on( 'click', '.faq h2 a', function( e )
{
	e.preventDefault();
	$( this ).parents( 'li' ).toggleClass( 'is-active' );
});

In the CSS part I use child combinator selector > because I don’t want to select and, therefore, to hide the elements of an answer, which may contain lists and div’s.

What if JavaScript is disabled

The user won’t be able to see the answers. Unless you show them by default or develop a JavaScript-less solution. To do this, take a closer look at these fragments of the markup:

  • <li id="faq-1">
  • <a href="#faq-1">

The usage of fragment identifiers enables us to take the advantage of CSS’s pseudo selector :target:

.faq > ul > li:not( :target ) > div
{
	display: none;
}

Furthermore, the real-time search is not possible as well. But you can either provide a sever-side search possibility or hide the search field and so as not to confuse the user:

<html class="no-js">
	<head>
		<!-- remove this if you use Modernizr -->
		<script>(function(e,t,n){var r=e.querySelectorAll("html")[0];r.className=r.className.replace(/(^|s)no-js(s|$)/,"$1$2")})(document,window,0);</script>
	</head>
</html>

I added a class name no-js to <html> element. The <script> part removes that class name. If JavaScript support is disabled in a browser, the class name won’t be removed; therefore:

.no-js .faq input
{
	display: none;
}

The no-js is a very handy technique, you can use it site-wide.

Improving UX

If there is only one list item that matches user’s query, it is a good practice to automatically show the content of that item, without requiring to press the title. To see what I mean, head over the GIF at the beginning of the post.

Hidden keywords

Here on my blog I have a filterable list of blog post titles only. Each post has some related keywords assigned. So, during the search, how do I make an item discoverable even if the title does not consist of a particular keyword? For example, how can I make the entry “Real-Time Search in JavaScript” visible if a user entered “jquery”? Yes, exactly, that is adding keywords and hiding them with CSS:

<li>
	<h2><a href="/real-time-search-in-javascript">Real-Time Search in JavaScript</a></h2>
	<p class="hidden-keywords" aria-hidden="true">jquery filter input html css</p>
</li>
.hidden-keywords
{
	display: none;
}

A simple trick but not always that obvious.


You will find two versions of the code in the source of the demo: without dependencies and jQuery-dependent. These versions are also divided into three groups of code so you can adapt only what your project needs.

Demo




tim

How to Display Publish Dates as Time Since Posted

It’s common to present dates on the Web in a format such as "Published on September 12th, 2015", or "09/12/2015 09:41:23".

Each of these examples tells the full date and/or time of some kind of activity – be it a published article, or a reader comment, or perhaps an uploaded video.

Date formats like this might seem perfectly reasonable. After all, they’re informative and human-readable. Well yes, but “human-readable” doesn’t necessary mean users will readily be able to understand how recently the activity has occurred. The Web is a fast-moving place, and giving your content a sense of freshness could be the key to engaging with your audience.

I combined my ideas and practical solutions into an article which you are very welcome to read on SitePoint.

Read the article

See the Demo




tim

Nanopores for bioanalytical applications: proceedings of the international conference / edited by Joshua Edel, Tim Albrecht

Hayden Library - TA418.9.N35 I5737 2013




tim

Coronavirus Pandemic: WhatsApp limits forwarding to one chat at a time to curb fake news

WhatsApp is also working directly with NGOs and governments, including the WHO and over 20 national health ministries, to help connect people with accurate information.






tim

'It is intimidating to kiss another man'

'It's not easy being an actor for anyone.''Every actor, even the most successful ones, are waking up with the same insecurity.' 'If you're on top, you're worried about coming down.''If you're fit, you're worried about your stomach coming out.'





tim

'Most of my films are ahead of their time'

'Everyone thought I was a good-looking boy with chocolate hero looks, and was offered such roles only. I was so depressed when people said that a singer's son cannot be an actor; that he should be a singer. I needed a film to showcase my talent.'




tim

'An actor can't do his own thing all the time'

'Hopefully, I will become more evolved as a performer in the future.'




tim

'I don't want to waste time on Kangana'

'Both Kangana and Rangoli really love me and that's because they give me so much of time and attention from their lives.'





tim

Lata Mangeshkar: 5 songs you must hear at this time

'Listen to my songs if they make you happy at home.'




tim

Hyperbolic and kinetic models for self-organised biological aggregations: a modelling and pattern formation approach / Raluca Eftimie

Online Resource




tim

Biological clocks, rhythms, and oscillations: the theory of biological timekeeping / Daniel B. Forger

Hayden Library - QH527.F66 2017




tim

The Ultimate Guide to Office Color Psychology

Skillful use of colors in the office can boost your productivity, health, and even happiness. Learn all about color psychology in this article.




tim

[ASAP] Safety Assessment of Nanomaterials for Antimicrobial Applications

Chemical Research in Toxicology
DOI: 10.1021/acs.chemrestox.9b00519




tim

The music of time : poetry in the twentieth century / John Burnside.

London : Profile Books Ltd., 2019.




tim

Justin Timberlake and Amanda Seyfried Talk In Time

Stars from Andrew Niccol's latest Sci-Fi thriller explain the plot.




tim

Wake Up, Geek Culture. Time to Die

The Angry Nerd bemoans the mainstreaming of Nerd-dom. Everything is ruined.




tim

Game|Life - Giant Lego X-Wing Fighter Lands in Times Square

Lego unveils a massive full-scale replica of Star Wars X-Wing Fighter in Times Square. This 5.3 million brick behemoth weighs in at over 23 tons and is the largest Lego construction ever built in the world. Before the curtain was opened to the public, Game|Life got a behind-the-scenes first hand look at the mother of all Lego projects.




tim

WIRED Live - Bill Gates & President Bill Clinton: Looking Forward and Maintaining Optimism-Exclusive Interview

Passion and optimism often go hand-in-hand, which couldn’t be truer for Bill Gates and President Bill Clinton when it comes to their outlook on the future. The two share their thoughts on the rapid pace and excitement of today’s innovations, and how humanity’s balance between conflict and cooperation will continue to fuel economic opportunity for years to come. For more from Bill Gates and President Clinton, check out the December 2013 issue of WIRED.




tim

Angry Nerd - Giving Thanks for TV Shows That End Before Their Time

It’s the time of the year for counting blessings and giving thanks. And the Angry Nerd is most thankful for the cancellation of Futurama—because it let the show go out on a high note (and avoid a slow decline, like so many other one-time favorites).




tim

Angry Nerd - Chris Baker’s Favorite Christmas Movie of All Time

A quest for films that genuinely reflect the spirit of the holidays leads the Angry Nerd to create an all-new celebration in honor of the best Christmas movie-maker of all time: Shane Black.




tim

Inside Innovation - Makey Makey: Making a Better World…One Carrot Keyboard at a Time [Sponsored Content]

Jay Silver and his co-founder's concept was simple: Hook up everyday objects to small circuits and turn them into touchpads. See how their MaKey MaKey invention kit is changing the way we interact with the world. Brought to you by Intel.




tim

WIRED Live - Neil deGrasse Tyson on Cosmos: A Spacetime Odyssey

Astrophysicist Neil deGrasse Tyson sits down to talk about the cultural importance of Carl Sagan’s Cosmos: A Personal Journey, and how he plans to carry on the legacy with his new version of the transformative science exploration show.




tim

Angry Nerd - The Madness of the Timeline Mashup in the New X-Men

Angry Nerd has been to the future and he brings back an important message: don’t see the new X-Men movie. With a scrambled timeline and inclusion of too many sub-franchises, the film adds a new dimension to the “days of future past” continuum: straight confusion.




tim

Angry Nerd - Chris Nolan's First Time at Comic-Con, the Interstellar Trailer & Elizabeth Olsen's Mutant Flub

Chris Nolan showed up to #SDCC2014 to promote his new sci-fi flick Interstellar and Angry Nerd has a few choice words for him. Watch as he gives Nolan a piece of his mind, talks to a few cosplay fans, and gives advice to the Marvel world.




tim

Angry Nerd - What Makes "Doctor Who" Great Are the Sidekicks, Not the Time Lord

Scripts for upcoming episodes of Doctor Who have leaked online, but should you read them before they air? It doesn't matter! The scripts aren't the secret to the Doctor's longevity. It's the companions that make or break any given episode, arc, or season, and Angry Nerd can prove it.




tim

RetroGrade - Skip the Apple Watch, Go for the Casio Timepiece Calculator

Apple recently announced its new timepiece, but the tech giant was hardly the first to make a foray into smartwatches. In the early '80s Casio debuted a dual watch-calculator, paving the way for multipurpose, wearable gadgets.




tim

WIRED December 2014: Space, Time, and Multiple Dimensions. A special issue directed by Christopher Nolan.

Few Hollywood directors can match Christopher Nolan’s ambition, skill, and mind-bending story sense. For our December issue, the man behind Memento, Inception, the Dark Knight trilogy, and Interstellar brings his formidable talents to WIRED as our guest editor.




tim

RetroGrade - When Was the Last Time You Left a Message on an Answering Machine?

“Please leave a message after the ….” It’s a phrase we all know, but in 1971 the PhoneMate 400 took voicemail to the next level. Find out why the hi-tech machine changed the answering machine game.




tim

Design FX - Once Upon A Time: Inside the Fairytale Sets and Character Animations

On ABC’s “Once Upon a Time,” Disney characters like Snow White, the Queen of Hearts, and Peter Pan are set against a modern backdrop. Realistic visual effects bring to life the magic and mystery of Storybrooke—the town they now inhabit. Mike Seymour from fxguide goes behind the stunning FX and animation that are needed to create the fairytale mashup.




tim

Game|Life - The Best Video Games of ALL Time

WIRED editor Chris Kohler goes head-to-head with SMOSH Games to settle the age-old debate: what are the best video games of all time? From first-person shooters to 2D platforms, see which games are named the best of the best.




tim

Time Traveling with Black Nerd Comedy and Angry Nerd

It’s 2015 and we’re finally living in the future. At least, according to Marty McFly. This week Angry Nerd hosts Andre from Black Nerdy Comedy to talk about the new flick “Hot Tub Time Machine 2” and the rules of time travel, according to cinema.




tim

Battle Damage - Mac vs PC Ultimate Showdown

It’s one of the biggest tech rivalries of all time and we finally put it to the test. See which portable device comes out on top: Apple’s MacBook Air or Microsoft's Surface Pro 3.




tim

Unnecessarily Rushed Explanations - The Funniest Video Game of All Time

WIRED editor Chris Kohler breaks down why Sam & Max Hit the Road is the funniest video game of all time. What’s not to love about a duo of anthropomorphic “freelance police”?




tim

Unnecessarily Rushed Explanations - The Most Important Video Game of All Time: Super Mario Bros.

WIRED editor Chris Kohler explains why Super Mario Bros. is the most important video game in history. From rich graphics to expertly composed music to innovative game design, Super Mario Bros. set the standard for what makes a great video game.




tim

Unnecessarily Rushed Explanations - Best Music Game of All Time: Elite Beat Agents

Elite Beat Agents is based off a Japanese video game for Nintendo DS. But instead of male cheerleaders and Japanese pop songs, the U.S. version relies on “Men In Black”-like agents and good ol’ fashioned American hits from the Jackson 5 and Madonna. Chris Kohler explains why the stateside edition is the best music game of all time.




tim

Unnecessarily Rushed Explanations - The Most Disgusting Video Game of All Time: Hotline Miami

It’s reminiscent of old Grand Theft Auto games, but Hotline Miami is in a league of its own. It tricks you into thinking it’s cute, but don’t be fooled, it's one of the most gruesome and bloody video games of all time.




tim

Unnecessarily Rushed Explanations - The Most Difficult Video Game of All Time: Super Hexagon

Super Hexagon is not a video game for the easily discouraged. You die early and often until eventually (hopefully) you get into the swing of things. WIRED editor Chris Kohler explains why it’s the most difficult video game of all time.




tim

SB 100 - How Science Is Hacking the Ultimate Athletes

Through motion tracking, data driven exercise, and eventually DNA analysis, SI and WIRED explore how scientific advances in training may help create the perfect NFL athlete.




tim

Ridley Scott's Top 5 Sci-Fi Films of All Time

"The Martian" director Ridley Scott counts down his favorite sci-fi films of all time.




tim

The Surface Book Really Is the Ultimate Laptop

WIRED's David Pierce reviews the Surface Book, Microsoft's kick-ass laptop that the company figured out how to turn into a convertible hybrid PC.




tim

Gear Review: Pebble Time Round

A few days after I started wearing the Time Round, Pebble's ultra-thin new smartwatch, I shut off notifications. This was partly practical---I get too many notifications, and the iPhone offers no filtering control over them---but also a thought experiment. Right now most people see a smartwatch as nothing more than a notification machine, a slightly faster way to see what that buzz in my pocket was all about. What if we took that away? What else could it be?




tim

The Ultimate Star Wars Lego Destruction Mashup

An epic mash-up of all our crazy Star Wars Lego Destruction videos!




tim

The Ultimate Valentine’s Day Gift Guide for Women | Sponsored Content

Valentine’s Day is just around the corner. Blogger Christen Rochon breaks down her top three picks for the lucky lady in your life. Brought to you by eBay




tim

Absurd Creatures | A Bird Impaling Its Victims Is So Metal I Can't Even Stand It

The shrike may look like a songbird but the only tunes it knows are METAL! The cute little bird kills its prey then impales them on spikes.