si A poly(allylamine hydrochloride)/poly(styrene sulfonate) microcapsule-coated cotton fabric for stimulus-responsive textiles By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17731-17738DOI: 10.1039/D0RA02474K, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Zhiqi Zhao, Qiujin Li, Jixian Gong, Zheng Li, Jianfei ZhangThis study reports a stimulus-responsive fabric incorporating a combination of microcapsules, containing polyelectrolytes poly(allylamine hydrochloride) (PAH) and poly(styrene sulfonate) sodium salt (PSS), formed via a layer-by-layer (LBL) approach.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Computational study on the polymerization reaction of D-aminopeptidase for the synthesis of D-peptides By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17582-17592DOI: 10.1039/D0RA01138J, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Joan Gimenez-Dejoz, Kousuke Tsuchiya, Ayaka Tateishi, Yoko Motoda, Takanori Kigawa, Yasuhisa Asano, Keiji NumataWe studied the molecular mechanism of D-aminopeptidase for the synthesis of polypeptides incorporating D-amino acids.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si A chitosan-based edible film with clove essential oil and nisin for improving the quality and shelf life of pork patties in cold storage By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17777-17786DOI: 10.1039/D0RA02986F, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Karthikeyan Venkatachalam, Somwang LekjingThis study assessed chitosan (CS)-based edible films with clove essential oil (CO) and nisin (NI) singly or in combination, for improving quality and shelf life of pork patties stored in cold conditions.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Effect of Zn doping on phase transition and electronic structures of Heusler-type Pd2Cr-based alloys: from normal to all-d-metal Heusler By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17829-17835DOI: 10.1039/D0RA02951C, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Xiaotian Wang, Mengxin Wu, Tie Yang, Rabah KhenataBy first-principles calculations, for Heusler alloys Pd2CrZ (Z = Al, Ga, In, Tl, Si, Sn, P, As, Sb, Bi, Se, Te, Zn), the effect of Zn doping on their phase transition and electronic structure has been studied in this work.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Microwave roasting of blast furnace slag for carbon dioxide mineralization and energy analysis By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17836-17844DOI: 10.1039/D0RA02846K, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Zike Han, Jianqiu Gao, Xizhi Yuan, Yanjun Zhong, Xiaodong Ma, Zhiyuan Chen, Dongmei Luo, Ye WangThis paper highlights the potential of microwave roasting in solid-waste treatment and carbon dioxide storage.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Enhanced methane gas storage in the form of hydrates: role of the confined water molecules in silica powders By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17795-17804DOI: 10.1039/D0RA01754J, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Pinnelli S. R. Prasad, Burla Sai Kiran, Kandadai SowjanyaRapid and efficient methane hydrate conversions by utilising the water molecules confined in intra- and inter-granular space of silica powders.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Synthesis, characterization and corrosion inhibition behavior of 2-aminofluorene bis-Schiff bases in circulating cooling water By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17816-17828DOI: 10.1039/D0RA01903H, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Wenchang Wei, Zheng Liu, Chuxin Liang, Guo-Cheng Han, Jiaxing Han, Shufen ZhangTwo new bis-Schiff bases, namely 2-bromoisophthalaldehyde-2-aminofluorene (M1) and glutaraldehyde 2-aminofluorene (M2) were synthesized and were characterized, the potentiodynamic polarization curve confirmed that they were anode type inhibitors.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Facile synthesis of a direct Z-scheme BiOCl–phosphotungstic acid heterojunction for the improved photodegradation of tetracycline By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17369-17376DOI: 10.1039/D0RA02396E, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Haijuan Tong, Bingfang Shi, Shulin ZhaoA one-step hydrothermal approach for synthesizing BiOCl–phosphotungstic acid (BiOCl–HPW) heterojunctions is proposed. The prepared BiOCl–HPW heterojunction exhibited good stability and photocatalytic activity.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Correction: Narrowing band gap and enhanced visible-light absorption of metal-doped non-toxic CsSnCl3 metal halides for potential optoelectronic applications By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17869-17869DOI: 10.1039/D0RA90054K, Correction Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Jakiul Islam, A. K. M. Akther HossainThe content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Effect of new carbonyl cyanide aromatic hydrazones on biofilm inhibition against methicillin resistant Staphylococcus aureus By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17854-17861DOI: 10.1039/D0RA03124K, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Xueer Lu, Ziwen Zhang, Yingying Xu, Jun Lu, Wenjian Tang, Jing Zhang2e and 2j with strong p-NO2 and p-CF3 at phenyl ring had the lowest MICs against S. aureus and MRSA. 2e displayed unaided or synergistic efficacy against MRSA, especially combined with ofloxacin. EM revealed that 2e destroys biofilms and cell membranes.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Research on the controllable degradation of N-methylamido and dialkylamino substituted at the 5th position of the benzene ring in chlorsulfuron in acidic soil By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17870-17880DOI: 10.1039/D0RA00811G, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Fan-Fei Meng, Lei Wu, Yu-Cheng Gu, Sha Zhou, Yong-Hong Li, Ming-Gui Chen, Shaa Zhou, Yang-Yang Zhao, Yi Ma, Zheng-Ming LiThese results will provide valuable information to discover tailored SU with controllable degradation properties to meet the needs of individual crops.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Nitrogen-doped RuS2 nanoparticles containing in situ reduced Ru as an efficient electrocatalyst for hydrogen evolution By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17862-17868DOI: 10.1039/D0RA02530E, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Yan Xu, Xiaoping Gao, Jingyan Zhang, Daqiang GaoThe reasonable design that N-doping and in situ reduced Ru metal enhances the performance of N-RuS2/Ru for HER.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Lithium metal deposition/dissolution under uniaxial pressure with high-rigidity layered polyethylene separator By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17805-17815DOI: 10.1039/D0RA02788J, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Shogo Kanamori, Mitsuhiro Matsumoto, Sou Taminato, Daisuke Mori, Yasuo Takeda, Hoe Jin Hah, Takashi Takeuchi, Nobuyuki ImanishiThe use of a high rigidity separator and application of an appropriate amount of pressure are effective approaches to control lithium metal growth and improve its cycle performance.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Synthesis of heteroatom-containing pyrrolidine derivatives based on Ti(O-iPr)4 and EtMgBr-catalyzed carbocyclization of allylpropargyl amines with Et2Zn By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17881-17891DOI: 10.1039/D0RA02677H, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Rita N. Kadikova, Ilfir R. Ramazanov, Azat M. Gabdullin, Oleg S. Mozgovoj, Usein M. DzhemilevThe Ti(O-iPr)4 and EtMgBr-catalyzed regio and stereoselective carbocyclization of N-allyl-substituted 2-alkynylamines with Et2Zn, followed by deuterolysis or hydrolysis, affords the corresponding methylenepyrrolidine derivatives in high yields.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
si Using HTML5 elements in WordPress post content By nicolasgallagher.com Published On :: Wed, 24 Feb 2010 16:00:00 -0800 Here are two ways to include HTML5 elements in your WordPress post content without WordPress’ wpautop function wrapping them in p tags or littering your code with line breaks. HTML5 has several new elements that you may want to use in your post content to markup document sections, headers, footers, pullquotes, figures, or groups of headings. One way to safely include these elements in your posts is simple; the other way is a bit more complicated. Both ways rely on hand-coding the HTML5 markup in the WordPress editor’s HTML view. If you are adding HTML5 elements to your post content then you should use an HTML5 doctype. Disable wpautop for your theme This is the simple way. Disable the wpautop function so that WordPress makes no attempt to correct your markup and leaves you to hand-code every line of your posts. If you want total control over every line of your HTML then this is the option for you. To disable wpautop entirely add these lines to your theme’s functions.php: remove_filter('the_excerpt', 'wpautop'); remove_filter('the_content', 'wpautop'); However, wpautop is generally quite useful if most of your posts are simple text content and you only occasionally want to include HTML5 elements. Therefore, modifying wpautop to recognise HTML5 elements might be more practical. Modify wpautop to recognise HTML5 elements WordPress’ wpautop is part of the core functions and can be found in this file within your WordPress installation: wp-includes/formatting.php. It controls how and where paragraphs and line breaks are inserted in excerpts and post content. In order to create a modified version of WordPress’ core wpautop function I started off by duplicating it in my theme’s functions.php file. What I’ve experimented with is disabling wpautop and adding a modified copy of it – which includes HTML5 elements in its arrayss – to my theme’s functions.php file. Add the following to your theme’s functions.php file and you’ll be able to use section, article, aside, header, footer, hgroup, figure, details, figcaption, and summary in your post content. (Probably best to try this in a testing environment first!) /* ----------------------------- MODIFIED WPAUTOP - Allow HTML5 block elements in wordpress posts ----------------------------- */ function html5autop($pee, $br = 1) { if ( trim($pee) === '' ) return ''; $pee = $pee . " "; // just to make things a little easier, pad the end $pee = preg_replace('|<br />s*<br />|', " ", $pee); // Space things out a little // *insertion* of section|article|aside|header|footer|hgroup|figure|details|figcaption|summary $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend|section|article|aside|header|footer|hgroup|figure|details|figcaption|summary)'; $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', " $1", $pee); $pee = preg_replace('!(</' . $allblocks . '>)!', "$1 ", $pee); $pee = str_replace(array(" ", " "), " ", $pee); // cross-platform newlines if ( strpos($pee, '<object') !== false ) { $pee = preg_replace('|s*<param([^>]*)>s*|', "<param$1>", $pee); // no pee inside object/embed $pee = preg_replace('|s*</embed>s*|', '</embed>', $pee); } $pee = preg_replace("/ +/", " ", $pee); // take care of duplicates // make paragraphs, including one at the end $pees = preg_split('/ s* /', $pee, -1, PREG_SPLIT_NO_EMPTY); $pee = ''; foreach ( $pees as $tinkle ) $pee .= '<p>' . trim($tinkle, " ") . "</p> "; $pee = preg_replace('|<p>s*</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace // *insertion* of section|article|aside $pee = preg_replace('!<p>([^<]+)</(div|address|form|section|article|aside)>!', "<p>$1</p></$2>", $pee); $pee = preg_replace('!<p>s*(</?' . $allblocks . '[^>]*>)s*</p>!', "$1", $pee); // don't pee all over a tag $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee); $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee); $pee = preg_replace('!<p>s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee); $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)s*</p>!', "$1", $pee); if ($br) { $pee = preg_replace_callback('/<(script|style).*?</\1>/s', create_function('$matches', 'return str_replace(" ", "<WPPreserveNewline />", $matches[0]);'), $pee); $pee = preg_replace('|(?<!<br />)s* |', "<br /> ", $pee); // optionally make line breaks $pee = str_replace('<WPPreserveNewline />', " ", $pee); } $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)s*<br />!', "$1", $pee); // *insertion* of img|figcaption|summary $pee = preg_replace('!<br />(s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol|img|figcaption|summary)[^>]*>)!', '$1', $pee); if (strpos($pee, '<pre') !== false) $pee = preg_replace_callback('!(<pre[^>]*>)(.*?)</pre>!is', 'clean_pre', $pee ); $pee = preg_replace( "| </p>$|", '</p>', $pee ); return $pee; } // remove the original wpautop function remove_filter('the_excerpt', 'wpautop'); remove_filter('the_content', 'wpautop'); // add our new html5autop function add_filter('the_excerpt', 'html5autop'); add_filter('the_content', 'html5autop'); The results are not absolutely perfect but then neither is the original wpautop function. Certain ways of formatting the code will result in unwanted trailing </p> tags or a missing opening <p> tags. For example, to insert a figure with caption into a post you should avoid adding the figcaption on a new line because an image or link appearing before the figcaption will end up with a trailing </p>. <!-- this turns out ok --> <figure> <a href="#"><img src="image.jpg" alt="" /></a><figcaption>A figure caption for your reading pleasure</figcaption> </figure> <!-- this turns out not so ok --> <figure> <a href="#"><img src="image.jpg" alt="" /></a> <figcaption>A figure caption for your reading pleasure</figcaption> </figure> Another example would be when beginning the contents of an aside with a paragraph. You’ll have to leave a blank line between the opening aside tag and the first paragraph. <aside> This content could be a pullquote or information that is tangentially related to the surrounding content. But to get it wrapped in a paragraph you have to leave those blank lines either side of it before the tags. </aside> Room for improvement Obviously there are still a few issues with this because if you format your post content in certain ways then you can end up with invalid HTML, even if it doesn’t actually affect the rendering of the page. But it seems to be pretty close! Leave a comment or email me if you are using this function and find there that are instances where it breaks down. I ran numerous tests and formatting variations to try and iron out as many problems as possible but it’s unlikely that I tried or spotted everything. Hopefully someone with more PHP and WordPress experience will be able to improve upon what I’ve been experimenting with, or find a simpler and more elegant solution that retains the useful wpautop functionality while allowing for the use of HTML5 elements in posts. Please share anything you find! Full Article
si Jump links and viewport positioning By nicolasgallagher.com Published On :: Fri, 12 Nov 2010 16:00:00 -0800 Using within-page links presses the jumped-to content right at the very top of the viewport. This can be a problem when using a fixed header. With a bit of hackery, there are some CSS methods to insert space between the top of the viewport and the target element within a page. Demo: Jump links and viewport positioning Known support: varies depending on method used. This experiment is the result of a post Chris Coyier made on Forrst. Chris’ method was to add an empty span element to the target element, shift the id attribute onto the span, and then absolutely position the span somewhere above it’s parent element. That method works but it requires changes to the HTML. The comments on Chris’ post suggested the use of psuedo-elements or padding. This experiment expands on, and combines, some of those suggestions to show the limitations of each method and document their browser support. Simplest method If you need to jump to an element with simple styling then using the :before pseudo-element is a quick and simple approach. #target:before { content: ""; display: block; height: 50px; margin: -30px 0 0; } The drawbacks are that it requires browser support for pseudo-elements and it will fail if the target element has a background colour, a repeated background image, padding-top, or border-top as part of its rule set. More robust method The more robust method uses a transparent border, negative margin, and the background-clip property. If a top border is required then it can be mimicked using a pseudo-element, as described in Multiple Backgrounds and Borders with CSS 2.1. #target { position: relative; border-top: 52px solid transparent; margin: -30px 0 0; -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; } #target:before { content: ""; position: absolute; top: -2px; left: 0; right: 0; border-top: 2px solid #ccc; } There are still drawbacks: it requires browser support for background-clip if there is a background color, gradient, or repeating image set on the target element; it requires browser support for pseudo-elements and their positioning if a top border is desired; and it interferes with the standard use of margins. To see these methods in action – as well as more details on the code, browser support, and drawbacks – have a look at the demo page. Please let me know if you know of better techniques. Full Article
si Better float containment in IE using CSS expressions By nicolasgallagher.com Published On :: Mon, 25 Apr 2011 17:00:00 -0700 Research into improving the cross-browser consistency of both the “clearfix” and “overflow:hidden” methods of containing floats. The aim is to work around several bugs in IE6 and IE7. This article introduces a new hack (with caveats) that can benefit the “clearfix” methods and the new block formatting context (NBFC) methods (e.g. using overflow:hidden) of containing floats. It’s one outcome of a collaboration between Nicolas Gallagher (that’s me) and Jonathan Neal. If you are not familiar with the history and underlying principles behind methods of containing floats, I recommend that you have a read of Easy clearing (2004), Everything you know about clearfix is wrong (2010), and Clearfix reloaded and overflow:hidden demystified (2010). Consistent float containment methods The code is show below and documented in this GitHub gist. Found an improvement or flaw? Please fork the gist or leave a comment. Micro clearfix hack: Firefox 3.5+, Safari 4+, Chrome, Opera 9+, IE 6+ .cf { /* for IE 6/7 */ *zoom: expression(this.runtimeStyle.zoom="1", this.appendChild(document.createElement("br")).style.cssText="clear:both;font:0/0 serif"); /* non-JS fallback */ *zoom: 1; } .cf:before, .cf:after { content: ""; display: table; } .cf:after { clear: both; } Overflow hack (NBFC): Firefox 2+, Safari 2+, Chrome, Opera 9+, IE 6+ .nbfc { overflow: hidden; /* for IE 6/7 */ *zoom: expression(this.runtimeStyle.zoom="1", this.appendChild(document.createElement("br")).style.cssText="clear:both;font:0/0 serif"); /* non-JS fallback */ *zoom: 1; } The GitHub gist also contains another variant of the clearfix method for modern browsers (based on Thierry Koblentz’s work). It provides greater visual consistency (avoiding edge-case bugs) for even older versions of Firefox. The only difference from existing float-containment methods is the inclusion of a CSS expression that inserts a clearing line-break in IE 6 and IE 7. Jonathan and I found that it helps to resolve some of the visual rendering differences that exist between these browsers and more modern ones. First I’ll explain what some of those differences are and when they occur. Containing floats in IE 6/7 In IE 6 and IE 7, the most common and robust method of containing floats within an element is to give it “layout” (find out more: On having Layout). Triggering “layout” on an element in IE 6/7 creates a new block formatting context (NBFC). However, certain IE bugs mean that previous float containment methods don’t result in cross-browser consistency. Specifically, this is what to expect in IE 6/7 when creating a NBFC: The top- and bottom-margins of non-floated child elements are contained within the ancestor element that has been given “layout”. (Also expected in other browsers when creating a NBFC) The bottom-margins of any right-floated descendants are contained within the ancestor. (Also expected in other browsers when creating a NBFC) The bottom-margins of any left-floated children are not contained within the ancestor. The margin has no effect on the height of the ancestor and is truncated, having no affect outside of the ancestor either. (IE 6/7 bug) In IE 6, if the right edge of the margin-box of a left-floated child is within 2px of the left edge of the content-box of its NBFC ancestor, the float’s bottom margin reappears and is contained within the parent. (IE 6 bug) Unwanted white-space can appear at the bottom of a float-container. (IE 6/7 bug) There is a lack of consistency between IE 6/7 and other browsers, and between IE 6 and IE 7. Thanks to Matthew Lein for his comment that directed me to this IE 6/7 behaviour. It was also recently mentioned by “Suzy” in a comment on Perishable Press. IE 6/7’s truncation of the bottom-margin of left-floats is not exposed in many of the test-cases used to demonstrate CSS float containment techniques. Using an IE-only CSS expression helps to correct this bug. The CSS expression Including the much maligned <br style="clear:both"> at the bottom of the float-container, as well as creating a NBFC, resolved all these inconsistencies in IE 6/7. Doing so prevents those browsers from collapsing (or truncating) top- and bottom-margins of descendant elements. Jonathan suggested inserting the clearing line-break in IE 6/7 only, using CSS expressions applied to fictional CSS properties. The CSS expression is the result of many iterations, tests, and suggestions. It runs only once, the first time an element receives the associated classname. *zoom: expression(this.runtimeStyle.zoom="1", this.appendChild(document.createElement("br")).style.cssText="clear:both;font:0/0 serif"); It is applied to zoom, which is already being used to help contain floats in IE 6/7, and the use of the runtimeStyle object ensures that the expression is replaced once it has been run. The addition of font:0/0 serif prevents the occasional appearance of white-space at the bottom of a float-container. And the * hack ensures that only IE 6 and IE 7 parse the rule. It’s worth noting that IE 6 and IE 7 parse almost any string used as CSS property. An earlier iteration used the entirely fictitious properties “-ms-inject” or “-ie-x” property to exploit this IE behaviour. *-ie-x: expression(this.x||(this.innerHTML+='<br style="clear:both;font:0/0">',this.x=1)); However, this expression is evaluated over and over again. Using runtimeStyle instead avoids this. Sergey Chikuyonok also pointed out that using innerHTML destroys existing HTML elements that may event handlers attached to them. By using document.createElement and appendChild you can insert the new element without removing all the events attached to other descendant elements. Containing floats in more modern browsers There are two popular methods to contain floats in modern browsers. Creating a new block formatting context (as is done in IE 6/7 when hasLayout is triggered) or using a variant of the “clearfix” hack. Creating a NBFC results in an element containing any floated children, and will prevent top- and bottom-margin collapse of non-floated children. When combined with the enhanced IE 6/7 containment method, it results in consistent cross-browser float containment. The other method, known as “clearfix”, traditionally used a single :after pseudo-element to clear floats in a similar fashion to a structural, clearing HTML line-break. However, to prevent the top-margins of non-floats from collapsing into the margins of their float-containing ancestor, you also need to use the :before pseudo-element. This is the approach taken in Thierry Koblentz’s “clearfix reloaded”. In contemporary browsers, the micro clearfix hack is also suitable. The method presented in this article should help improve the results of cross-browser float containment, whether you predominantly use “clearfix” or the NBFC method. The specific limitations of both the “clearfix” and various NBFC methods (as outlined in Thierry’s articles) remain. Problems Using a CSS expression to change the DOM in IE 6/7 creates problems of its own. Obviously, the DOM in IE 6/7 is now different to the DOM in other browsers. This affects any JavaScript DOM manipulation that may depend on :last-child or appending new children. This is still an experimental work-in-progress that is primarily research-driven rather than seeking to become a practical snippet of production code. Any feedback, further testing, and further experimentation from others would be much appreciated. Thanks to these people for contributing improvements: Jonathan Neal, Mathias Bynens, Sergey Chikuyonok, and Thierry Koblentz. Full Article
si Responsive images using CSS3 By nicolasgallagher.com Published On :: Wed, 18 May 2011 17:00:00 -0700 Future CSS implementations should allow for some form of responsive images via CSS alone. This is an early idea for how that might be done. However, a significant drawback is that it would not prevent both “mobile optimised” and larger size images from being requested at larger screen resolutions. Note that the CSS presented here is not supported in any browsers at the time of writing. This method relies on the use of @media queries, CSS3 generated content, and the CSS3 extension to the attr() function. The principles are basically the same as those underpinning Filament Group’s work on Responsive Images. The source image is “mobile optimised” and the urls of larger size images are included using HTML data-* attributes. <img src="image.jpg" data-src-600px="image-600px.jpg" data-src-800px="image-800px.jpg" alt=""> Using CSS @media queries you can target devices above certain widths. Within each media query block, images with larger alternatives can be targeted using an attribute selector. CSS3 generated content allows you to replace the content of any element using the content property. At the moment, only Opera 10+ supports it. In CSS 2.1, the content property is limited to use with the :before and :after pseudo-elements. By combining the content property with the CSS3 extension to attr(), you will be able to specify that an attribute’s value is interpreted as the URL part of a url() expression. In this case, it means you will be able to replace an image’s content with the image found at the destination URL stored in a custom HTML data-* attribute. @media (min-device-width:600px) { img[data-src-600px] { content: attr(data-src-600px, url); } } @media (min-device-width:800px) { img[data-src-800px] { content: attr(data-src-800px, url); } } Fork the Gist Issues Unfortunately, there are a number of issues with this technique. It doesn’t prevent multiple assets being downloaded at larger screen widths because network activity kicks in before CSS is applied. That means, for example, that desktop environments would make 2 HTTP requests for an image and have to load more assets than if they had been served only the larger image in the source. It makes the assumption that wider screens are tied to better internet connections. It forces authors to create and maintain multiple image sizes for each image. At present, using the context menu (or drag and drop) to copy the image will result in the source file being copied and not the replacement image. It doesn’t account for devices with different pixel densities. Full Article
si A simple Git deployment strategy for static sites By nicolasgallagher.com Published On :: Wed, 01 Jan 2014 16:00:00 -0800 This is how I am deploying the build of my static website to staging and production domains. It requires basic use of the CLI, Git, and SSH. But once you’re set up, a single command will build and deploy. TL;DR: Push the static build to a remote, bare repository that has a detached working directory (on the same server). A post-receive hook checks out the files in the public directory. Prerequisites A remote web server to host your site. SSH access to your remote server. Git installed on your remote server (check with git --version). Generate an SSH key if you need one. On the server Set up password-less SSH access First, you need to SSH into your server, and provide the password if prompted. ssh user@hostname If there is no ~/.ssh directory in your user’s home directory, create one: mkdir ~/.ssh. Next, you need to copy your public SSH key (see “Generate an SSH key” above) to the server. This allows you to connect via SSH without having to enter a password each time. From your local machine – assuming your public key can be found at ~/.ssh/id_rsa.pub – enter the following command, with the correct user and hostname. It will append your public key to the authorized_keys file on the remote server. ssh user@hostname 'cat >> ~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub If you close the connection, and then attempt to establish SSH access, you should no longer be prompted for a password. Create the remote directories You need to have 2 directories for each domain you want to host. One for the Git repository, and one to contain the checked out build. For example, if your domain were example.com and you also wanted a staging environment, you’d create these directories on the server: mkdir ~/example.com ~/example.git mkdir ~/staging.example.com ~/staging.example.git Initialize the bare Git repository Create a bare Git repository on the server. This is where you will push the build assets to, from your local machine. But you don’t want the files served here, which is why it’s a bare repository. cd ~/example.git git init --bare Repeat this step for the staging domain, if you want. Write a post-receive hook A post-receive hook allows you to run commands after the Git repository has received commits. In this case, you can use it to change Git’s working directory from example.git to example.com, and check out a copy of the build into the example.com directory. The location of the working directory can be set on a per-command basis using GIT_WORK_TREE, one of Git’s environment variables, or the --work-tree option. cat > hooks/post-receive #!/bin/sh WEB_DIR=/path/to/example.com # remove any untracked files and directories git --work-tree=${WEB_DIR} clean -fd # force checkout of the latest deploy git --work-tree=${WEB_DIR} checkout --force Make sure the file permissions on the hook are correct. chmod +x hooks/post-receive If you need to exclude some files from being cleaned out by Git (e.g., a .htpasswd file), you can do that using the --exclude option. This requires Git 1.7.3 or above to be installed on your server. git --work-tree=${WEB_DIR} clean -fd --exclude=<pattern> Repeat this step for the staging domain, if you want. On your local machine Now that the server configuration is complete, you want to deploy the build assets (not the source code) for the static site. The build and deploy tasks I’m using a Makefile, but use whatever you feel comfortable with. What follows is the basic workflow I wanted to automate. Build the production version of the static site. make build Initialize a new Git repo in the build directory. I don’t want to try and merge the new build into previous deploys, especially for the staging domain. git init ./build Add the remote to use for the deploy. cd ./build git remote add origin ssh://user@hostname/~/example.git Commit everything in the build repo. cd ./build git add -A git commit -m "Release" Force-replace the remote master branch, creating it if missing. cd ./build git push -f origin +master:refs/heads/master Tag the checked-out commit SHA in the source repo, so I can see which SHA’s were last deployed. git tag -f production Using a Makefile: BUILD_DIR := ./build STAGING_REPO = ssh://user@hostname/~/staging.example.git PROD_REPO = ssh://user@hostname/~/example.git install: npm install # Deploy tasks staging: build git-staging deploy @ git tag -f staging @ echo "Staging deploy complete" prod: build git-prod deploy @ git tag -f production @ echo "Production deploy complete" # Build tasks build: clean # whatever your build step is # Sub-tasks clean: @ rm -rf $(BUILD_DIR) git-prod: @ cd $(BUILD_DIR) && git init && git remote add origin $(PROD_REPO) git-staging: @ cd $(BUILD_DIR) && git init && git remote add origin $(STAGING_REPO) deploy: @ cd $(BUILD_DIR) && git add -A && git commit -m "Release" && git push -f origin +master:refs/heads/master .PHONY: install build clean deploy git-prod git-staging prod staging To deploy to staging: make staging To deploy to production: make prod Using Make, it’s a little bit more hairy than usual to force push to master, because the cd commands take place in a sub-process. You have to make sure subsequent commands are on the same line. For example, the deploy task would force push to your source code’s remote master branch if you failed to join the commands with && or ;! I push my site’s source code to a private repository on BitBucket. One of the nice things about BitBucket is that it gives you the option to prevent deletions or history re-writes of branches. If you have any suggested improvements, let me know on Twitter. Full Article
si Custom CSS preprocessing By nicolasgallagher.com Published On :: Wed, 12 Mar 2014 17:00:00 -0700 Did you know that you can build your own CSS preprocessor with Node.js libraries? They can be used alongside established preprocessors like Sass, and are useful for defining tasks beyond preprocessing. Libraries like Rework and PostCSS let you create and assemble an arbitrary collection of plugins that can inspect or manipulate CSS. At the time of writing, Twitter uses Rework to perform various tasks against our CSS source code for twitter.com. Creating a CSS preprocessor with Rework At its core, Rework is a module that accepts a string of CSS, produces a CSS abstract syntax tree (AST), and provides an API for manipulating that AST. Plugins are functions that have access to the AST and a Rework instance. Rework lets you chain together different plugins and generate a string of new CSS when you’re done. The source string is passed into the rework function and each plugin is applied with .use(fn). The plugins transform the data in the AST, and .toString() generates the new string of CSS. Below is an example of a custom preprocessor script using Rework and Autoprefixer. It’s a simplified version of the transformation step we use for twitter.com’s CSS. var autoprefixer = require('autoprefixer'); var calc = require('rework-calc'); var rework = require('rework'); var vars = require('rework-vars')(); var css = fs.readFileSync('./css/main.css', 'utf-8'); css = rework(css) .use(vars) .use(calc) .toString(); css = autoprefixer().process(css); fs.writeFileSync('./build/bundle.css', css) The script runs rework-vars, rework-calc, and then passes the CSS to Autoprefixer (which uses PostCSS internally) to handle the addition of any necessary vendor prefixes. rework-vars provides a limited subset of the features described in the W3C-style CSS custom property spec. It’s not a polyfill! Variables can be declared as custom CSS properties on the :root element, prefixed with --. Variables are referenced with the var() function, taking the name of a variable as the first argument and an optional fallback as the second. For example, this source: :root { --width-button: 200px; } .button { width: var(--width-button); } yields: .button { width: 200px; } There are many different Rework plugins that you can use to create a custom preprocessor. A more complete list is available on npm. In order to limit the chances of long-term divergence between our source code and native CSS, I’ve chosen to stick fairly closely to features that are aligned with future additions to native CSS. Creating your own Rework plugin Rework plugins are functions that inspect or mutate the AST they are provided. Below is a plugin that rewrites the value of any font-family property to sans-serif. module.exports = function plugin(ast, reworkInstance) { ast.rules.forEach(function (rule) { if (rule.type != 'rule') return; rule.declarations.forEach(function (declaration, index) { if (declaration.property == 'font-family') { declaration.value = 'sans-serif'; } }); }); }; Rework uses css-parse to create the AST. Unfortunately, both projects are currently lacking comprehensive documentation of the AST, but it’s not difficult to piece it together yourself. Beyond preprocessing Since Rework and PostCSS expose an AST and provide a plugin API, they can be used for other CSS tasks, not just preprocessing. At Twitter, our CSS build pipeline allows you to perform custom tasks at 2 stages of the process: on individual files and on generated bundles. We use Rework at both stages. Individual files are tested with rework-suit-conformance to ensure that the SUIT-style CSS for a component is properly scoped. /** @define MyComponent */ :root { --property-MyComponent: value; } .MyComponent {} Bundles are preprocessed as previously described, and also tested with rework-ie-limits to ensure that the number of selectors doesn’t exceed IE 8/9’s limit of 4095 selectors per style sheet. Other tasks you can perform include generating RTL style sheets (e.g., css-flip) and extracting detailed information about the perceived health of your CSS (e.g., the number of different colours used, duplicate selectors, etc.). Hopefully this has given you a small glimpse into some of the benefits and flexibility of using these tools to work with CSS. Full Article
si How to test React components using Karma and webpack By nicolasgallagher.com Published On :: Sat, 16 May 2015 17:00:00 -0700 I’m working on a project at Twitter that uses React and webpack. After a few conversations with @sokra last year, this is the setup I put in place for testing React components (authored using JSX and ES6) using Karma. Dependencies You’ll need to install various packages. It looks like a lot of dependencies, but all the non-Karma packages will be necessary for general module bundling during development. Full set of required packages: babel-core: to transform JSX and transpile ES6. babel-loader: webpack loader for Babel. karma: the test runner. karma-chai-plugins: assertion library (or your library of choice). karma-chrome-launcher: Chrome browser launcher. karma-cli: CLI tool for Karma. karma-mocha: adapter for the Mocha testing framework. karma-sourcemap-loader: sourcemap loader. karma-webpack: to use webpack with Karma. react webpack: module bundler webpack entry file If you use webpack-specific features in your modules (e.g., loaders, plugins) you will need to use webpack to build a test bundle. The fastest and simplest approach is to create a single, test-specific entry file. Create a file named tests.bundle.js. Within this file, you create a webpack context to match all the files that conform to a naming pattern – in this case *.spec.js(x). var context = require.context('.', true, /.+.spec.jsx?$/); context.keys().forEach(context); module.exports = context; Next, you point Karma to this file. Karma config Karma is configured using a karma.conf.js file. The browsers, plugins, and frameworks are specified in the standard way. Point Karma at the tests.bundle.js file, and run it through the relevant preprocessor plugins (see example below). The karma-webpack plugin relies on 2 custom properties of the Karma config: webpack and webpackMiddleware. The value of the former must be a webpack config object. module.exports = function (config) { config.set({ browsers: [ 'Chrome' ], // karma only needs to know about the test bundle files: [ 'tests.bundle.js' ], frameworks: [ 'chai', 'mocha' ], plugins: [ 'karma-chrome-launcher', 'karma-chai', 'karma-mocha', 'karma-sourcemap-loader', 'karma-webpack', ], // run the bundle through the webpack and sourcemap plugins preprocessors: { 'tests.bundle.js': [ 'webpack', 'sourcemap' ] }, reporters: [ 'dots' ], singleRun: true, // webpack config object webpack: { devtool: 'inline-source-map', module: { loaders: [ { exclude: /node_modules/, loader: 'babel-loader, test: /.jsx?$/ } ], } }, webpackMiddleware: { noInfo: true, } }); }; Rather than duplicating your webpack config, you can require it in the Karma config file and override the devtool value to get sourcemaps working. var webpackConfig = require('./webpack.config'); webpackConfig.devtool = 'inline-source-map'; module.exports = function (config) { config.set({ ... webpack: webpackConfig }); }; That’s all you need to do to configure Karma to use webpack to load your JSX, ES6 React components. Full Article
si Using canvas to fix SVG scaling in Internet Explorer By nicolasgallagher.com Published On :: Mon, 18 May 2015 17:00:00 -0700 Internet Explorer 9–11 suffer from various bugs that prevent proper scaling of inline SVG’s. This is particularly problematic for SVG icons with variable widths. This is the canvas-based hack I’ve been using to work around the issue. A popular way to use SVG icons is to generate a spritemap of SVG symbol‘s that you then reference from elsewhere in a document. Most articles on the topic assume your icon dimensions are uniformly square. Twitter’s SVG icons (crafted by @sofo) are variable width, to produce consistent horizontal whitespace around the vectors. Most browsers will preserve the intrinsic aspect ratio of an SVG. Ideally, I want to set a common height for all the icons (e.g., 1em), and let the browser scale the width of each icon proportionally. This also makes it easy to resize icons in particular contexts – just change the height. Unfortunately, IE 9–11 do not preserve the intrinsic aspect ratio of an inline SVG. The svg element will default to a width of 300px (the default for replaced content elements). This means it’s not easy to work with variable-width SVG icons. No amount of CSS hacking fixed the problem, so I looked elsewhere – and ended up using canvas. canvas and aspect ratios A canvas element – with height and width attributes set – will preserve its aspect ratio when one dimension is scaled. The example below sets a 3:1 aspect ratio. <canvas height="1" width="3"></canvas> You can then scale the canvas by changing either dimension in CSS. canvas { display: block; height: 2rem; } Demo: proportional scaling of canvas. Fixing SVG scaling in IE This makes canvas useful for creating aspect ratios. Since IE doesn’t preserve the intrinsic aspect ratio of SVG icons, you can use canvas as a shim. A canvas of the correct aspect ratio provides a scalable frame. The svg can then be positioned to fill the space created by this frame. The HTML is straightforward: <div class="Icon" role="img" aria-label="Twitter"> <canvas class="Icon-canvas" height="1" width="3"></canvas> <svg class="Icon-svg"> <use fill="currentcolor" xlink:href="#icon-twitter"></use> </svg> </div> So is the CSS: .Icon { display: inline-block; height: 1em; /* default icon height */ position: relative; user-select: none; } .Icon-canvas { display: block; height: 100%; visibility: hidden; } .Icon-svg { height: 100%; left: 0; position: absolute; top: 0; width: 100%; } Setting the canvas height to 100% means it will scale based on the height of the component’s root element – just as SVG’s do in non-IE browsers. Changing the height of the Icon element scales the inner SVG icon while preserving its 3:1 aspect ratio. Demo: proportional scaling of svg in IE. Creating an Icon component The hack is best added to (and eventually removed from) an existing icon component’s implementation. If you’re generating and inlining an SVG spritemap, you will need to extract the height and width (usually from viewBox) of each of your icons during the build step. If you’re already using the gulp-svgstore plugin, it supports extracting metadata. Those dimensions need to be set on the canvas element to produce the correct aspect ratio for a given icon. Example React component (built with webpack): import iconData from './lib/icons-data.json'; import React from 'react'; import './index.css'; class Icon extends React.Component { render() { const props = this.props; const height = iconData[props.name.height]; const width = iconData[props.name.width]; // React doesn't support namespaced attributes, so we have to set the // 'use' tag with innerHTML const useTag = `<use fill="currentcolor" xlink:href="#icon-${props.name}"> </use>`; return ( <span className="Icon"> <canvas className="Icon-canvas" height={height} width={width} /> <svg className="Icon-svg" dangerouslySetInnerHTML={{__html: useTag}} key={props.name} /> </span> ); } } export default Icon; When I introduced this hack to a code base at Twitter, it had no impact on the the rest of the team or the rest of the code base – one of the many benefits of a component-based UI. Full Article
si Coronavirus | Odisha records 52 cases, highest single-day spike By www.thehindu.com Published On :: Fri, 08 May 2020 23:29:46 +0530 43 cases from Ganjam district; State’s total mounts to 271 Full Article Other States
si AMU academic session from Aug. By www.thehindu.com Published On :: Fri, 08 May 2020 23:53:25 +0530 1,300 students of the varsity leave for home by special train Full Article Other States
si PNB scam: HC rejects bail plea of accused who tested positive for COVID-19 By www.thehindu.com Published On :: Sat, 09 May 2020 01:43:26 +0530 Court says Hemant Bhatt needs to be treated at a govt. hospital Full Article Other States
si Coronavirus | 30 more test positive in J&K, cases mount to 823 By www.thehindu.com Published On :: Sat, 09 May 2020 02:01:16 +0530 Bandipora tops the list with 134 cases, followed by Srinagar at 129 Full Article Other States
si Tablighi Jamaat: 10 Indonesian nationals granted bail By www.thehindu.com Published On :: Sat, 09 May 2020 02:31:55 +0530 Mumbai civil and sessions court gives anticipatory bail to two others who are in quarantine Full Article Other States
si Punjab police arrest gangster Baljinder Singh By www.thehindu.com Published On :: Sat, 09 May 2020 02:46:59 +0530 He is wanted for murder, attempt to murder and smuggling of weapons and drugs Full Article Other States
si COVID19 positive goes up to 16 By www.assamtimes.org Published On :: Wed, 01 Apr 2020 16:25:21 +0000 Full Article
si COVID19 patient dead in Silchar By www.assamtimes.org Published On :: Fri, 10 Apr 2020 03:29:02 +0000 Full Article
si Strategic excellence in the architecture, engineering, and construction industries [electronic resource] : how AEC firms can develop and execute strategy using lean Six Sigma / Gerhard Plenert and Joshua J. Plenert By prospero.murdoch.edu.au Published On :: Plenert, Gerhard Johannes, author Full Article
si The strategy of execution [electronic resource] : the five-step guide for turning vision into action / Liz Mellon and Simon Carter By prospero.murdoch.edu.au Published On :: Mellon, Elizabeth Full Article
si Streamlining business requirements [electronic resource] : the XCellR8 approach / Gerrie Caudle By prospero.murdoch.edu.au Published On :: Caudle, Gerrie Full Article
si Stress less. achieve more [electronic resource] : simple ways to turn pressure into a positive force in your life / Aimee Bernstein By prospero.murdoch.edu.au Published On :: Bernstein, Aimee Full Article
si The stress test every business needs [electronic resource] : a capital agenda for confidently facing digital disruption, difficult investors, recessions and geopolitical threats / Jeffrey R. Greene, Steve Krouskos, Julie Hood, Harsha Basnayake, William Ca By prospero.murdoch.edu.au Published On :: Greene, Jeffrey R., author Full Article
si The subjective well-being module of the American Time Use Survey [electronic resource] : assessment for its continuation / Panel on Measuring Subjective Well-Being in a Policy-Relevant Framework, Committee on National Statistics, Division of Behavioral an By prospero.murdoch.edu.au Published On :: Full Article
si Succeeding in the project management jungle [electronic resource] : how to manage the people side of projects / Doug Russell By prospero.murdoch.edu.au Published On :: Russell, Doug Full Article
si Succeeding with SOA [electronic resource] : realizing business value through total architecture / Paul C. Brown By prospero.murdoch.edu.au Published On :: Brown, Paul C Full Article
si Success in selling [electronic resource] : developing a world-class sales ecosystem / Reza Sisakhti By prospero.murdoch.edu.au Published On :: Sisakhti, Reza, author Full Article
si Successes and failures of knowledge management [electronic resource] / edited by Jay Liebowitz, Distinguished Chair of Applied Business and Finance, Harrisburg University of Science and Technology, Harrisburg, Pennsylvania By prospero.murdoch.edu.au Published On :: Full Article
si Supplier selection at Kerneos, Inc. [electronic resource] / Chuck Munson ; with Ling Li, Erika Marsillac, and Ted Kosiek By prospero.murdoch.edu.au Published On :: Munson, Chuck, author Full Article
si Supply chain design (collection) [electronic resource] / Marc J. Schniederjans [and six others] By prospero.murdoch.edu.au Published On :: Schniederjans, Marc J., author Full Article
si Supply chain management process standards [electronic resource] : deliver processes / Council of Supply Chain Management Professionals By prospero.murdoch.edu.au Published On :: Council of Supply Chain Management Professionals, author Full Article
si Supply chain management talent development [electronic resource] : acquire, develop, and advance processes / Council of Supply Chain Management Professionals By prospero.murdoch.edu.au Published On :: Council of Supply Chain Management Professionals, author Full Article
si Sustainable engineering [electronic resource] : concepts, design, and case studies / David T. Allen, David R. Shonnard By prospero.murdoch.edu.au Published On :: Allen, David T Full Article
si Talent-Gespräche [electronic resource] : Worum es geht, weshalb sie wichtig sind, wie sie richtig geführt werden / Roland Smith und Michael Campbell By prospero.murdoch.edu.au Published On :: Smith, Roland, 1951- author Full Article
si Talking to crazy [electronic resource] : how to deal with the irrational and impossible people in your life / Mark Goulston By prospero.murdoch.edu.au Published On :: Goulston, Mark Full Article
si Tapping into unstructured data [electronic resource] : integrating unstructured data and textual analytics into business intelligence / William H. Inmon, Anthony Nesavich By prospero.murdoch.edu.au Published On :: Inmon, William H Full Article
si The Tech Professional's Guide to Communicating in a Global Workplace [electronic resource] : Adapting Across Cultural and Gender Boundaries / by April Wells By prospero.murdoch.edu.au Published On :: Wells, April. author Full Article
si Technology entrepreneurship [electronic resource] : taking innovation to the marketplace / Thomas N. Duening, Ph.D, El Pomar Chair of Business and Entrepreneurship, Director, Center for Entrepreneurship, College of Business, University of Colorado at Colo By prospero.murdoch.edu.au Published On :: Duening, Thomas N Full Article