ar

India cuts benchmark rate to lowest level on record

Central bank governor calls for ‘war effort’ as coronavirus shuts down country




ar

Indian coronavirus lockdown triggers exodus to rural areas 

Migrant workers head home in battle to survive after losing jobs 




ar

Indian Railways converts coaches into isolation wards for virus patients

Network to provide 80,000 mobile beds after national lockdown shuts passenger services   




ar

India’s lockdown extension sparks migrant worker protests

Demonstrations at a Mumbai railway station as people demand to return to their homes




ar

India takes first steps to restart economy after coronavirus lockdown

Industry groups warn strict conditions have discouraged many companies from resuming operations




ar

India’s coronavirus crisis hits country’s farmers and food supplies

Lockdown and restrictions on migrant workforce leave crops unpicked as demand collapses




ar

Franklin Templeton winds up $3bn of India funds after market turmoil

US investment group halts withdrawals in move that could rock asset management industry




ar

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




ar

Customizing File Inputs the Smart Way

And so it happened that I published the latest post of mine on Codrops, not here this time. It’s about styling <input type="file" /> by taking the advantage of <label>. The technique is not perfect – nothing is perfect that imitates native HTML elements – but having in mind its pros & cons, I found it to be the most appropriate solution for styling file inputs.

Read the article

See the Demo




ar

Enabling CodeIgniter's Garbage Collector

My session driver of choice for CodeIgniter is database. A while ago, I noticed millions of rows in the corresponding database table. That means that garbage collector was not working. I checked config.php for sess_regenerate_destroy, but it was already set to false. It was really weird because the problem seemed to have come out of nowhere – not much ago things were working just fine.

After a short investigation, I found out this was and still is a common problem for those who had upgraded their CodeIgniter version from 2.x to 3.x. Turns out, the later possesses heavy changes for Sessions library. And most importantly – fundamental changes in dealing with garbage: CodeIgniter 3.x relies on PHP's native grabage collector. So, in order to get things working again, we need to configure PHP properly.

The Solution

Today there are three PHP-native settings for dealing with session garbage collector. CodeIgniter's Session library has already taken care of one of them – gc_maxlifetime – so there's no need for an extra touch here. The problem lies within the rest: session.gc_probability and/or session.gc_divisor. These two determine when the garbage collector is running. Here's what php.net says:

session.gc_divisor coupled with session.gc_probability defines the probability that the gc (garbage collection) process is started on every session initialization. The probability is calculated by using gc_probability/gc_divisor, e.g. 1/100 means there is a 1% chance that the GC process starts on each request.

In my case, using ini_get() revealed the following values: 0 and 1000. The equation 0/1000=0 meant there was no chance the garbage collector would even run.

Finally, I solved the problem by using the values officially stated as default and by putting the following lines of PHP code into config/config.php file:

ini_set( 'session.gc_probability',	1 );
ini_set( 'session.gc_divisor',		100 );

Theoretically, this means that the garbage collector usually runs once every 100th request. It's more than enough, but it is up to you whether that causes too many unnecessary hits to database. An alternative solution for heavy-traffic websites could be having a 0% probability on the production site and a Cronjob-based script which removes database rows of the expired sessions.




ar

The Wiley Handbook of What Works in Violence Risk Management: Theory, Research, and Practice


 

A comprehensive guide to the theory, research and practice of violence risk management

The Wiley Handbook of What Works in Violence Risk Management: Theory, Research and Practice offers a comprehensive guide to the theory, research and practice of violence risk management. With contributions from a panel of noted international experts, the book explores the most recent advances to the theoretical understanding, assessment and management of violent



Read More...




ar

The Wiley Handbook of What Works in Violence Risk Management: Theory, Research, and Practice


 

A comprehensive guide to the theory, research and practice of violence risk management

The Wiley Handbook of What Works in Violence Risk Management: Theory, Research and Practice offers a comprehensive guide to the theory, research and practice of violence risk management. With contributions from a panel of noted international experts, the book explores the most recent advances to the theoretical understanding, assessment and management of violent



Read More...




ar

Polymer-carbon nanotube composites: preparation, properties and applications / edited by Tony McNally and Petra Pötschke

Hayden Library - TA418.9.N35 P65 2011




ar

Learning bio-micro-nanotechnology / Mel I. Mendelson

Hayden Library - TP248.25.N35 M46 2013




ar

Perspectivas sobre el desarrollo de las nanotecnologías en América Latina / Guillermo Foladori, Noela Invernizzi, Edgar Záyago Lau, coordinadores

Hayden Library - T174.7.P46 2012




ar

Molecular motors in bionanotechnology / James Youell, Keith Firman

Hayden Library - TP248.25.N35 Y68 2013




ar

Nanotech Conference & Expo 2013: technical proceedings of the 2013 NSTI Nanotechnology Conference and Expo: May 12-16, 2013, Washington, D.C., U.S.A. / NSTI Nanotech 2013 proceedings editors, Matthew Laudon, Bart Romanowicz

Hayden Library - T174.7.N79 2013




ar

Intelligent nanomaterials: processes, properties, and applications / edited by Ashutosh Tiwari ... [et al.]

Hayden Library - TA418.9.N35 I5685 2012




ar

Understanding the nanotechnology revolution / Edward L. Wolf and Manasa Medikonda

Hayden Library - T174.7.W65 2012




ar

Hydrogel micro and nanoparticles / edited by L. Andrew Lyon and Michael Joseph Serpe

Barker Library - TP248.25.N35 H93 2012




ar

Nanocarbon materials and devices: symposium held April 9-13, 2012, San Francisco, California, U.S.A. / editors, Markus J. Buehler ... [et al.]

Hayden Library - TA418.9.N35 N2465 2013




ar

Characterization of semiconductor heterostructures and nanostructures / edited by Carlo Lamberti and Giovanni Agostini, University of Torino, Department of Chemistry, Via Quarello 11, I-10135 Torino, Italy

Barker Library - QC176.8.N35 C43 2013




ar

Proceed with caution?: concept and application of the precautionary principle in nanobiotechnology / edited by Rainer Paslack, Johann S. Ach, Beate Lüttenberg, Klaus-Michael Weltring

Hayden Library - T174.7.P665 2012




ar

Physics, chemistry and applications of nanostructures: proceedings of the International Conference Nanomeeting--2013: reviews and short notes: Minsk, Belarus, 28-31 May 2013 / editors, V.E. Borisenko, S.V. Gaponenko, V.S. Gurin, C.H. Kam

Barker Library - QC176.8.N35 N35 2013




ar

Advances in nanoscience and nanotechnology: selected peer reviewed papers from the International Conference on Nanoscience and Nanotechnology (ICNN 2011), July 6-8, 2011, Coimbatore, India / edited by S. Velumani and N. Muthukumarasamy

Hayden Library - QC176.8.N35 I575 2011




ar

Innovative graphene technologies / editor, Atul Tiwari

Hayden Library - TA418.9.N35 I56 2013




ar

Carbon nanotubes, graphene, and related nanostructures / editor, Yoke Khin Yap

Hayden Library - QC176.8.N35 C372 2011




ar

Nanotech Conference & Expo 2012: Nanotechnology 2012: technical proceedings of the 2012 NSTI Nanotechnology Conference and Expo: June 18-21, 2012, Santa Clara, California, USA / NSTI Nanotech 2012 proceedings editors, Matthew Laudon, Bart Romanowicz

Barker Library - T174.7.N79 2012




ar

Solution synthesis of inorganic functional materials -- films, nanoparticles and nanocomposites: symposium held April 1-5, 2013, San Francisco, California, U.S.A. / editors, Menka Jain, Quanxi Jia, Teresa Puig, Hiromitsu Kozuba

Hayden Library - TA418.9.N35 S656 2013




ar

Carbon functional nanomaterials, graphene, and related 2d-layered systems: symposia held April 1-5, 2013, San Francisco, California U.S.A. / editors, Mauricio Terrones [and 14 others]

Hayden Library - TA418.9.N35 S972 2013




ar

Nanostructured materials and nanotechnology - 2012: symposium held August 12-17, 2012, Cancún, México / editors, Claudia Gutiérrez-Wing, Instituto Nacional de Investigaciones Nucleares, Ocoyoacac, México, José Luis Rodríguez-

Hayden Library - TA418.9.N35 N3664 2012




ar

Semiconductor nanowires: optical and electronic characterization and applications: November 25-30, 2012, Boston, Massachusetts, USA / editors J. Arbiol, P.S. Lee, J. Piqueras, D.J. Sirbuly

Hayden Library - TK7874.85.S474 2012




ar

The business of nanotechnology IV: November 25-30, 2012, Boston, Massachusetts, USA / editors, L. Merhari, D. Cruikshank, J. Wang, K. Derbyshire

Hayden Library - T174.7.B88 2012




ar

Nanotechnology toward the sustainocene edited by Thomas A. Faunce

Online Resource




ar

Advanced fabrication technologies for micro/nano optics and photonics VII: 3-5 February 2014, San Francisco, California, United States / Georg von Freymann, Winston V. Schoenfeld, Raymond C. Rumpf, editors ; sponsored by SPIE ; cosponsored by Samsung Adva

Online Resource




ar

Handbook of research on nanoscience, nanotechnology, and advanced materials / Mohamed Bououdina and J. Paulo Davim, editors

Hayden Library - T174.7.H367 2014




ar

Emerging nanotechnologies for manufacturing / edited by Waqar Ahmed, Mark Jackson

Barker Library - T174.7.A364 2014




ar

Smart systems integration for micro- and nanotechnologies: honorary volume on the occasion of Thomas Gessner's 60th birthday / Bernd Michel (ed.)

Barker Library - T174.7.S64 2014




ar

Introduction to nano: basics to nanoscience and nanotechnology / Amretashis Sengupta, Chandan Kumar Sarkar, editors

Online Resource




ar

Proceedings of the 14th International Conference of the European Society for Precision Engineering and Nanotechnology: June 2nd-6th, 2014, Dubrovnik, Croatia / editors, R. Leach ; proceedings compilation, N. Charlton, D. Nyman, D. Phillips

Barker Library - T174.7.I59 2014




ar

Commercializing nanomedicine: industrial applications, patents, and ethics / edited by Luca Escoffier, Mario Ganau, Julielynn Wong

Online Resource




ar

NANOFORUM 2013: Rome, Italy, 18-20 September 2013 / editors, Marco Rossi, Carlo Mariani, Maria Letizia Terranova ; sponsoring organizations, Sapienza University of Rome, in collaboration with Sapienza Nanotechnology and Nanoscience Laboratory [and 4 other

Online Resource




ar

Nanoscale materials and devices for electronics, photonics and solar energy / Anatoli Korkin, Stephen Goodnick, Robert Nemanich, editors

Online Resource




ar

Nanotechnology edited by Marvin V. Zelkowitz

Online Resource




ar

Applied Nanotechnology: The Conversion of Research Results to Products / Jeremy J. Ramsden, University of Buckingham, Buckingham, UK

Online Resource




ar

Fundamental principles of engineering nanometrology / Richard Leach

Online Resource




ar

MEMS and nanotechnology.: Proceedings of the 2015 Annual Conference on Experimental and Applied Mechanics / Barton C. Prorok, LaVern Starman, editors

Online Resource




ar

CRC concise encyclopedia of nanotechnology / edited by Boris Ildusovich Kharisov, Oxana Vasilievna Kharissova, and Ubaldo Ortiz-Mendez

Online Resource




ar

In-situ characterization of material synthesis and properties at the nanoscale with TEM: April 21-25 2014, San Francisco California, USA / editors, M. Chi

Hayden Library - TK7874.85.I55 2014




ar

Interim report on the second triennial review of the National Nanotechnology Initiative / Committee on Triennial Review of the National Nanotechnology Initiative, Phase II, National Materials and Manufacturing Board, Division on Engineering and Physical

Online Resource