mo

Polypyrrole modified magnetic reduced graphene oxide composites: synthesis, characterization and application for selective lead adsorption

RSC Adv., 2020, 10,17524-17533
DOI: 10.1039/D0RA01546F, Paper
Open Access
Zhanmeng Liu, Zhimin Gao, Lichun Xu, Fengping Hu
Compared to Fe3O4/rGO, the PPy-FG composites showed desirable adsorption capacity and selectivity for Pb(II) from water.
The content of this RSS Feed (c) The Royal Society of Chemistry




mo

Selective modification of Ti6Al4V surfaces for biomedical applications

RSC Adv., 2020, 10,17642-17652
DOI: 10.1039/C9RA11000C, Paper
Open Access
Gabriela Melo Rodriguez, James Bowen, Mischa Zelzer, Artemis Stamboulis
The surface of a medical implant is required to interact favourably with ions, biomolecules and cells in vivo, commonly resulting in the formation of the extracellular matrix.
The content of this RSS Feed (c) The Royal Society of Chemistry




mo

Effect of temperature and large guest molecules on the C–H symmetric stretching vibrational frequencies of methane in structure H and I clathrate hydrates

RSC Adv., 2020, 10,17473-17478
DOI: 10.1039/D0RA02748K, Paper
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Go Fuseya, Satoshi Takeya, Akihiro Hachikubo
Temperature effect on C–H symmetric stretching frequencies of CH4 in water cages of sI and sH clathrate hydrates were clarified.
The content of this RSS Feed (c) The Royal Society of Chemistry




mo

Position-locking of volatile reaction products by atmosphere and capping layers slows down photodecomposition of methylammonium lead triiodide perovskite

RSC Adv., 2020, 10,17534-17542
DOI: 10.1039/D0RA03572F, Paper
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Fengshuo Zu, Thorsten Schultz, Christian M. Wolff, Dongguen Shin, Lennart Frohloff, Dieter Neher, Patrick Amsalem, Norbert Koch
Gas pressure and capping layers under ultrahigh vacuum prevent methylammonium lead triiodide photo-degradation due to efficient back-reaction of volatile compounds.
The content of this RSS Feed (c) The Royal Society of Chemistry




mo

Work function modification of PEDOT:PSS by mixing with barium acetylacetonate

RSC Adv., 2020, 10,17673-17680
DOI: 10.1039/D0RA02575E, Paper
Open Access
K. L. Woon, W. S. Wong, N. Chanlek, H. Nakajima, S. Tunmee, V. S. Lee, A. Ariffin, P. Songsiriritthigul
Modification of poly(3,4-ethylenedioxythiophene)polystyrene sulfonate as electron injection layer.
The content of this RSS Feed (c) The Royal Society of Chemistry




mo

A novel series of phenolic temozolomide (TMZ) esters with 4 to 5-fold increased potency, compared to TMZ, against glioma cells irrespective of MGMT expression

RSC Adv., 2020, 10,17561-17570
DOI: 10.1039/D0RA02686G, Paper
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Leroy Shervington, Oliver Ingham, Amal Shervington
The standard of care treatment for patients diagnosed with glioblastoma multiforme (GBM) is temozolomide (TMZ).
The content of this RSS Feed (c) The Royal Society of Chemistry




mo

Correction: Influence of co-cultures of Streptococcus thermophilus and probiotic lactobacilli on quality and antioxidant capacity parameters of lactose-free fermented dairy beverages containing Syzygium cumini (L.) Skeels pulp

RSC Adv., 2020, 10,16905-16905
DOI: 10.1039/D0RA90046J, Correction
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Sabrina Laís Alves Garcia, Gabriel Monteiro da Silva, Juliana Maria Svendsen Medeiros, Anna Paula Rocha de Queiroga, Blenda Brito de Queiroz, Daniely Rayane Bezerra de Farias, Joyceana Oliveira Correia, Eliane Rolim Florentino, Flávia Carolina Alonso Buriti
The content of this RSS Feed (c) The Royal Society of Chemistry




mo

Enhanced methane gas storage in the form of hydrates: role of the confined water molecules in silica powders

RSC Adv., 2020, 10,17795-17804
DOI: 10.1039/D0RA01754J, Paper
Open Access
Pinnelli S. R. Prasad, Burla Sai Kiran, Kandadai Sowjanya
Rapid 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




mo

Selenium modulates cadmium-induced ultrastructural and metabolic changes in cucumber seedlings

RSC Adv., 2020, 10,17892-17905
DOI: 10.1039/D0RA02866E, Paper
Open Access
Hongyan Sun, Xiaoyun Wang, Huimin Li, Jiahui Bi, Jia Yu, Xianjun Liu, Huanxin Zhou, Zhijiang Rong
Intensive insight into the potential mechanisms of Se-induced Cd tolerance in cucumber seedlings is essential for further improvement of vegetable crop cultivation and breeding to obtain high yields and quality in Cd-contaminated soil.
The content of this RSS Feed (c) The Royal Society of Chemistry




mo

CSS image replacement. One more time.

An accessible image replacement method using pseudo-elements and generated-content. This method works with images and/or CSS off, with semi-transparent images, doesn’t hide text from screen-readers or search engines, and provides fallback for IE 6 and IE 7.

Known support: Firefox 1.5+, Safari 3+, Chrome 3+, Opera 9+, IE 8+

What’s wrong with current methods?

The two most widely used image replacement techniques are the Gilder/Levin Method and the Phark Method. Both have different flaws.

The Gilder/Levin Method requires the addition of presentational HTML (an empty span) and doesn’t work with transparent images as the default text shows through. The Phark Method uses a negative text-indent to hide the text and so it is not visible when CSS is on and images are off.

Resurrecting the NIR method

Using pseudo-elements and generated-content as an image replacement technique isn’t a new idea. It was proposed and demonstrated by Paul Nash back in 2006. This is the Nash Image Replacement method.

<h1 class="nir">[content]</h1>
.nir {
   height: 100px; /* height of replacement image */
   padding: 0;
   margin: 0;
   overflow: hidden;
}

.nir:before {
   content: url(image.gif);
   display: block;
}

The height value is equal to that of the replacement image. Setting overflow:hidden ensures that the original content is not visible on screen when the image is loaded. The replacement image is inserted as generated content in the :before pseudo-element which is set to behave like a block element in order to push the element’s original content down.

What about IE 6 and IE 7?

Neither browser supports :before; if you need to support them you’ll have to rely on the Phark method. This can be done using conditional comments or safe IE6/7 hacks to serve alternative styles to legacy versions of IE .

<!--[if lte IE 7]>
<style>
.nir {
   height: 100px;
   padding: 0;
   margin: 0;
   overflow: hidden;
   text-indent: -9000px;
   background: url(image.gif) no-repeat 0 0;
}
</style>
<![endif]-->

Using the NIR method allows you to keep your HTML semantic and deliver improved accessibility to users of modern browsers. The Phark Method can then be served to IE 6 and IE 7.

Improving the NIR method

The first problem with NIR is that if images are disabled all browsers leave whitespace above the element’s content. Opera 10.5 even displays the text string “image”! If the height of the element is small enough this whitespace causes the element’s content to overflow and be partially or completely hidden when images are disabled.

Another consideration is what happens if an image doesn’t exist or fails to load. Safari and Chrome will display a “missing image” icon that cannot be removed. Once again, this can cause the element’s content to overflow and become partially or completely hidden to users.

A more robust version of the NIR method is the following modification:

.nir {
   height: 100px; /* height of replacement image */
   width: 400px; /* width of replacement image */
   padding: 0;
   margin: 0;
   overflow: hidden;
}

.nir:before {
   content: url(image.gif);
   display: inline-block;
   font-size: 0;
   line-height: 0;
}

Setting font-size and line-height to 0 avoids the whitespace problems in all browsers. Setting the element’s width equal to that of the replacement image and getting the pseudo-element to act as an inline-block helps minimise the problems in webkit browsers should an image fail to load.

Ideally browsers would avoid displaying anything in a pseudo-element when its generated-content image fails to load. If that were the case, the original NIR method would be all that is needed.

What about using sprites?

One of the most common uses of image replacement is for navigation. This often involves using a large sprite with :hover and :active states as a background image. It turns out that using sprites is not a problem for modern browsers. When using the modified-NIR method the sprite is included as a generated-content image that is positioned using negative margins.

This is an example that rebuilds the right-hand category navigation from Web Designer Wall using a sprite and the modified-NIR method.

<ul id="nav">
  <li id="nav-item-1"><a href="#non">Tutorials</a></li>
  <li id="nav-item-2"><a href="#non">Trends</a></li>
  <li id="nav-item-3"><a href="#non">General</a></li>
</ul>
/* modified-NIR */

#nav a {
  display: block;
  width: 225px;
  height: 46px;
  overflow: hidden;
}

#nav a:before {
   content:url(sprite.png);
   display:-moz-inline-box; /* for Firefox 1.5 & 2 */
   display:inline-block;
   font-size:0;
   line-height:0;
}

/* repositioning the sprite */

#nav-item-1 a:hover:before,
#nav-item-1 a:focus:before,
#nav-item-1 a:active:before {margin:-46px 0 0;}

#nav-item-2 a:before        {margin:-92px 0 0;}
#nav-item-2 a:hover:before,
#nav-item-2 a:focus:before,
#nav-item-2 a:active:before {margin:-138px 0 0;}

#nav-item-3 a:before        {margin:-184px 0 0;}
#nav-item-3 a:hover:before,
#nav-item-3 a:focus:before,
#nav-item-3 a:active:before {margin:-230px 0 0;}

/* :hover hack for IE8 if no a:hover styles declared */
#nav a:hover {cursor:pointer;}

For some reason IE8 refuses to reposition the image when the mouse is over the link unless a style is declared for a:hover. In most cases you will have declared a:hover styles for the basic links on your webpage, and this is enough. But it is worth being aware of this IE8 behaviour.

The addition of display:-moz-inline-box; is required to reposition the sprite in versions of Firefox prior to Firefox 3.0. They are very rare browsers but I’ve included it in case that level of legacy support is needed.

If you want image replacement in IE 6 and IE 7 the following additional styles can be served to those browsers using conditional comments.

/* Phark IR method */

#nav a {
   text-indent: -9000px;
   background: url(sprite.png) no-repeat;
}

/* repositioning the sprite */

#nav-item-1 a:hover,
#nav-item-1 a:active { background-position: 0 -46px; }

#nav-item-2 a        { background-position: 0 -92px; }
#nav-item-2 a:hover,
#nav-item-2 a:hover  { background-position: 0 -138px; }

#nav-item-3 a        { background-position: 0 -184px; }
#nav-item-3 a:hover,
#nav-item-3 a:active { background-position: 0 -230px; }

/* hack for IE6 */
#nav a:hover { margin: 0; }

The changes are fairly simple. But IE 6 applies the margins declared for a:hover:before to a:hover and so they need to be reset in the styles served to IE 6.

See the modified-NIR (using sprites) demo.




mo

“Mobile first” CSS and getting Sass to help with legacy IE

Taking a “mobile first” approach to web development poses some challenges if you need to provide a “desktop” experience for legacy versions of IE. Using a CSS pre-processor like Sass can help.

As of Sass 3.2, there is another way of catering for IE, described by Jake Archibald.

One aspect of a “mobile first” approach to development is that your styles are usually gradually built up from a simple base. Each new “layer” of CSS adds presentational adjustments and complexity, via CSS3 Media Queries, to react to and make use of additional viewport space. However, IE 6/7/8 do not support CSS3 Media Queries. If you want to serve IE 6/7/8 something more than just the base CSS, then you need a solution that exposes the “enhancing” CSS to those browsers.

An existing option is the use of a CSS3 Media Query polyfill, such as Respond.js. However, there are some drawbacks to this approach (see the project README), such as the introduction of a JavaScript dependency and the XHRing of your style sheets, which may introduce performance or cross-domain security issues. Furthermore, adding support for CSS3 Media Queries is probably not necessary for these legacy browsers. The main concern is exposing the “enhancing” CSS.

Another method, which Jeremy Keith has described in his post on Windows mobile media queries, is to use separate CSS files: one basic global file, and an “enhancing” file that is referenced twice in the <head> of the document. The “enhancing” file is referenced once using a media attribute containing a CSS3 Media Query value. This prevents it being downloaded by browsers (such as IE 6/7/8) which do not support CSS3 Media Queries. The same file is then referenced again, this time wrapped in an IE conditional comment (without the use of a CSS3 Media Query value) to hide it from modern browsers. However, this approach becomes somewhat cumbersome, and introduces multiple HTTP requests, if you have multiple breakpoints in your responsive design.

Getting Sass to help

Sass 3.1 provides some features that help make this second approach more flexible. The general advantages of the Sass-based approach I’ve used are:

  1. You have full control over how your style sheets are broken up and reassembled.
  2. It removes the performance concerns of having to reference several separate style sheets for each breakpoint in the responsive design, simply to cater for IE 6/7/8.
  3. You can easily repeat large chunks of CSS in separate compiled files without introducing maintenance problems.

The basic idea is to produce two versions of your compiled CSS from the same core code. One version of your CSS includes CSS3 @media queries and is downloaded by modern browsers. The other version is only downloaded by IE 6/7/8 in a desktop environment and contains no CSS3 @media queries.

To do this, you take advantage of the fact that Sass can import and compile separate .scss/.sass files into a single CSS file. This allows you to keep the CSS rules used at any breakpoint completely separate from the @media query that you might want it to be a part of.

This is not a CSS3 Media Query polyfill, so one assumption is that IE 6/7/8 users will predominantly be using mid-size screens and should receive styles appropriate to that environment. Therefore, in the example below, I am making a subjective judgement by including all the breakpoint styles up to a width of 960px but withholding those for any breakpoints beyond that.

The ie.scss file imports numerous other files, each containing a layer of CSS that builds upon the previous each layer of CSS. No CSS3 @media queries are contained within the files or the ie.scss file. It then compiles to a single CSS file that is designed to be served only to IE 6/7/8.

// ie.scss

@import "base";
@import "320-up";
@import "480-up";
@import "780-up";
@import "960-up";

The style.scss file imports the code for each breakpoint involved in the design (including any beyond the limit imposed for legacy versions of IE) but nests them within the relevant CSS3 @media query. The compiled version of this file is served to all browsers apart from IE 6/7/8 and IEMobile.

// style.scss

@import "base";
@media (min-width:320px) {
    @import "320-up"; }
@media (min-width:480px) {
    @import "480-up"; }
@media (min-width:780px) {
    @import "780-up"; }
@media (min-width:960px) {
    @import "960-up"; }
@media (min-width:1100px) {
    @import "1100-up"; }

The resulting CSS files can then be referenced in the HTML. It is important to hide the ie.css file from any IE-based mobile browsers. This ensures that they do not download the CSS meant for desktop versions of IE.

<!--[if (gt IE 8) | (IEMobile)]><!-->
<link rel="stylesheet" href="/css/style.css">
<!--<![endif]-->

<!--[if (lt IE 9) & (!IEMobile)]>
<link rel="stylesheet" href="/css/ie.css">
<![endif]-->

This Sass-enabled approach works just as well if you need to serve a basic style sheet for mobiles without CSS3 Media Query support, and prevent those devices from downloading the CSS used to adapt the layout to wider viewports. For example, you can avoid importing base.scss into the ie.scss and style.scss files. It can then be referenced separately in the HTML.

<link rel="stylesheet" href="/css/base.css">
<link rel="stylesheet" href="/css/style.css" media="(min-width:320px)">

<!--[if (lt IE 9) & (!IEMobile)]>
<link rel="stylesheet" href="/css/ie.css">
<![endif]-->

You’ll notice that I didn’t wrap the style.css reference in a conditional comment to hide it from legacy versions of IE. It’s not necessary this time because the value of the media attribute is not understood by legacy versions of IE, and the style sheet will not be downloaded.

In different circumstances, different combinations of style sheets and media attribute values will be more appropriate.

Summary

Even if you want to don’t want to use any of the Sass or SCSS syntax, the pre-processor itself can help you to write your CSS in a “mobile first” manner (with multiple breakpoints), provide a “desktop” experience for IE 6/7/8, and avoid some of the performance or maintenance concerns that are sometimes present when juggling the two requirements.

I’m relatively new to using Sass, so there may be even better ways to achieve the same result or even to prevent the inclusion of IE-specific CSS unless the file is being compiled into a style sheet that only IE will download.




mo

Moving from London to San Francisco

I recently moved from London to San Francisco to work at Twitter, as a Software Engineer. This is a rough guide – in the spirit of @chanian’s tutorial for Canadians – based on my experience of relocating, the mistakes I made along the way, and some information I wish I’d had. Use it at your own risk – don’t assume any legal truths; research things for yourself before making decisions!

I’m not going to cover anything about the US visa process. The company that has offered you employment in the US is likely to work with immigration lawyers who will handle (or guide you through) the visa application and processing. I’m also going to assume that your employer is providing temporary accommodation or that you are organising your own (e.g., via Airbnb) while you search for an apartment. Most of this article relates to things you will need to do once you arrive in San Francisco and soon after, but that you should spend some time thinking about beforehand.

Get a phone

You’ll need a US mobile/cell number pretty quickly, especially if you’re apartment-hunting.

The US telecom market isn’t great and will leave you nostalgic for the halcyon days of the EU-regulated, pro-consumer market you’ve left behind. For example, it’s now illegal to unlock a phone from a carrier unless you have that carrier’s permission to do so. Furthermore, if you do get a phone from a carrier (as part of your contract deal), you should be aware of whether or not you will be locked into a proprietary network, like Verison’s CDMA. Without a US credit history, you should expect to pay a sizable deposit when entering into a contract.

One way to reduce the cost of a phone contract is to bring your own phone to the party. If you bring a phone from the UK, make sure to check that your charger will work on US voltage. With an unlocked, GSM-supporting phone you can look to carriers like T-Mobile who offer various “value” and no-annual-contract plans. These prices are significantly cheaper because they don’t subsidise the purchase of a new phone. You’re likely to find “unlimited” data plans easier to come by than they are in the UK.

You’re shit-out-of-luck if you’re thinking you’d prefer a European-style pay-as-you-go (PAYG) approach. The options are thin on the ground. Any airtime you buy means just that – any time you spend talking or texting – so you pay to send and receive calls or SMS’s. My experience suggests that some networks recycle phone numbers or sell on your details. I still receive random texts addressed to previous owners of my phone number, and get messages from marketing companies who have miraculously acquired my personal details, an irritation that is compounded by the fact that it costs you money to be harassed.

If you’re determined to go the PAYG route, the nearest US equivalent is probably AT&T’s GoPhone SIM or Net10. You’ll have to purchase a phone and credit up front; top ups can be purchased in store, at some supermarkets, or done over the phone. This may also be the first time you encounter the US concept of a “restocking fee” – a method of dissuading you from returning items by charging you to do so. The restocking fee for the burner phone I first purchased was almost as much as the phone itself.

Open a bank account, transfer money

Make this a top priority. You should open a bank account as soon as you arrive in the US, especially as some banks will initially let you do so without a Social Security Number or permanent address.

Until you open a US bank account, you’ll be haemorrhaging money on fees levied by your UK bank for dollar transactions, and subject to poor exchange rates.

Choose a bank

San Francisco has a large range of different bank brands to choose from, but you’re probably best sticking to the big name banks that have branches and ATMs throughout the city, such as Bank of America, Chase, or Wells Fargo. There are co-ops and niche services if that’s your thing. Be sure to do some preparatory research on which bank is best suited to your needs. It’s also worth checking if your bank in the UK has a reciprocal agreement with any bank operating in San Francisco; it may cut down the cost of moving your money. Friends recommended going with either Bank of America or Chase. I went with Bank of America, where the customer service was personal and friendly.

Banking fees are a matter of course in the US. In contrast to the UK, you’ll almost certainly be charged for withdrawing money from any ATMs that aren’t owned by your bank. You have to buy cheque books (“check” in American English) and pay a fee to transfer your money to accounts outside your bank. Accounts usually involve a monthly fee, although this is waived in certain situations, such as setting up your salary to be directly deposited. Expect to set up a current (“checking”) and savings account, and to be asked to make a minimum cash deposit to complete the process (at Bank of America it was $100).

Once you’re all set up, your debit card will be sent in the post – so make sure you’ll be at that address for at least another week. In the meantime you may get a temporary cash card to get at what you’ve already deposited. Even if you transfer more money in, your bank can limit the amount you can withdraw within the first 30 days of the account being open – presumably to combat fraud/laundering.

Transfer money

It’s essential that you transfer money from your UK bank as soon as possible. There are many factors to consider when calculating how much money you want to transfer.

  • You may enter the US up to 10 days before your visa is valid and you can start work.
  • You need money for food, transport, going out, a phone (and deposit), apartment applications, an apartment deposit, buying furniture, etc.
  • You might not be able to get paid until you have a Social Security Number.
  • You’re unlikely to get paid until the middle or end of the month you start working.
  • You’re very likely to get your first pay cheque given to you as a real cheque; your bank is then likely to withhold the vast majority of the cheque’s value for up to 28 days.
  • It will cost you several thousand dollars – a deposit and at least one month of rent – to secure an apartment. In general, landlords will not accept a UK banking cheque.
  • You’ll have to buy furniture and general household items if you aren’t shipping any from the UK.

All in all, this means you may end up without any significant US-earned money in your account for 30-45 days while making some of the biggest expenses you’re likely to have made for a while.

Transferring money to a US bank account can be done online via wire transfer between banks. Unfortunately, my bank in the UK – Santander – didn’t allow online wire transfers so I had to look for alternatives. You may want to research this prior to leaving the UK!

The Post Office provide a simple, secure, and fee-free service, but a poorer exchange rate. Looking around, I came across Currencyfair – a peer-to-peer currency exchange service. They provide online quotes without the need to sign up, they were very prompt and helpful in their replies to questions I had, and the exchange rate was very good. Overall, I saved quite a bit of money and I’d rely on them in the future.

Get a Clipper card

The Clipper card is San Francisco’s equivalent of London’s Oyster card. Getting one will take some of the pain out of using the various modes of public transport in San Francisco. You can get a Clipper card online and I’d suggest setting up “Autoload” (you’ll need a bank account) to get the card for free and never worry about remembering to top up your credit. Alternatively, you can buy them on the high street from shops like Walgreens.

Get a Social Security Number

Social Security recommend that you only apply for a Social Security Number once you’ve been in the US over 10 days.

My experience was that the process is quick and simple. You complete a short SSN application form ahead of time and take it to the nearest Social Security office along with the documentation they advise you to bring. Arrive first thing in the morning to avoid any wait. It can take a few weeks for your Social Security card to arrive so you may want to have it sent to your employer’s address if you don’t have a permanent address yet.

Once you have your Social Security Card, you should keep it safe and be judicious in giving your SSN out. However, you should provide it to your bank and employer as soon as possible.

Find somewhere to live

Living in the city of San Francisco is just one of the (more expensive) options available to you. I chose to live in the city but many of my friends and colleagues live in other areas, like the East Bay. Have a look around before making up your mind.

Rent is very expensive in San Francisco, even compared to prices in London, especially since it’s very rare to find furnished accommodation. It also appears to be rising at a staggering rate. However, buildings constructed before June 1979 are covered by San Francisco Rent Control which heavily constrains the rate at which your rent can increase once you become a tenant. Therefore, it’s worth taking the time to find somewhere that you could imagine living for a few years.

The rental market is extremely competitive. Many places rely on one-off, brief, herd-style viewings where you’re in the apartment with half a dozen other desperate people at the same time, and more arriving every minute. People hand over all their paperwork and a cash application fee (if applicable) there and then.

Things are made slightly harder because you’re unlikely to have any US credit history, which is something quite important over here. But an offer letter and salary details from a tech company seems to put you in good shape. It’s in your best interest to put together a dossier of papers to provide alongside any application you make. You should include scans of your employer’s offer letter, your visa, and ideally character references from a previous landlord, etc. Print out several copies to take with you to viewings. You might have to pay $30-$40 to make an application (which is meant to cover credit history checks), but I never did.

I found that using Craigslist or a listing aggregator like Lovely was the best way to find apartments for rent in the city. They will also help you to narrow your focus to the neighbourhoods that you’re most interested in (spend some time learning about the city). Before moving to San Francisco, I heard a lot of stories about how it was essential – if you are to have any hope – to be “first” to make contact with the poster of a listing, but my experience was that you’re generally given the date and time of a mass-viewing to attend. This means that making a good impression in person, and having a bit of a chat with your potential landlord or building-manager, is likely to improve your chances and help you make a decision. Be prepared for it to take a while to find an apartment – it took me over a month of searching.

Once you’ve found a place to rent and signed all the paperwork, call PG&E to create an account to pay for your heat and electricity. You can set up e-bills and automatic payments online once your account has been processed. It’s a good idea to sort out an ISP before you move in – I went with Sonic.net. Again, the monthly cost (which I was told includes 17 different taxes and “renting” of the router) is a little higher than you’d expect in the UK, and you can expect to pay an installation fee. Other things to do: get Renters Insurance and have your bank automatically mail out your monthly-rent check to your landlord or building manager. All these things are quick and easy to do.

If you’re interested in your renters rights, you can search the California Department of Consumer Affairs for information.

Buying stuff for your place

You’re going to need furniture and basic household items. There’s always Ikea, which is located in Emeryville across the bay. If you have any previous Ikea experience, you’ll know that it’s one of the most stressful shopping experiences imaginable. The Ikea in Emeryville is even worse but the prices are pretty good. You can get there by bus from San Francisco and have large items delivered, or sort out your own transport.

Other stores to look at include West Elm and Crate & Barrel; they sell nicer things but are significantly more expensive. Alternatively, there are a lot of independent and second-hand furniture shops in San Francisco, particularly in the Mission district and a few along Van Ness. They’re well worth checking out. Van Ness also has 3 or 4 stores that sell mattresses – Sleep Train came particularly well recommended. I’d suggest that you leverage the lower costs of similar mattresses online in order to significantly reduce the price of your purchase, while benefiting from the great service, free delivery, and returns policy of the high-street stores. And if you have no idea what you’re doing: home decor tips, infographics, and cheat sheets

Get a California I.D.

Once you have your SSN and have found a permanent address, you should apply for a California I.D. at the DMV. This is handy if you don’t want to carry your passport (with visa) around and don’t have alternative I.D., such as a driver’s licence. You should register for an appointment to avoid a long wait in line. It can take up to 60 days for your California I.D. to arrive.

Get a credit card

The U.S. revolves around consumer credit. You need to start building up a credit history as soon as possible if you want to avoid paying large deposits or higher prices. Ask your bank about the soonest that you can apply for a credit card and then start using it – buying on credit even if you don’t need to.

Inform HMRC and the Student Loans Company

Once you’re settled, you should make time to inform HMRC that you’ve left the UK. They’ll be able to assess your tax status. If you are repaying student loans, after 3 months in the US you’re expected to contact the Student Loans Company by completing an overseas income assessment form. They will then work out your repayments.

Welcome to the United States of America

Hopefully you settle in within a couple of months and get to know San Francisco. There are many faces to this city, but the social scene is pretty diverse and there are many restaurants, bars, cafes, parks, and attractions – plenty of places to explore and things to do while you find your feet.




mo

Redux modules and code-splitting

Twitter Lite uses Redux for state management and relies on code-splitting. However, Redux’s default API is not designed for applications that are incrementally-loaded during a user session.

This post describes how I added support for incrementally loading the Redux modules in Twitter Lite. It’s relatively straight-forward and proven in production over several years.

Redux modules

Redux modules comprise of a reducer, actions, action creators, and selectors. Organizing redux code into self-contained modules makes it possible to create APIs that don’t involve directly referencing the internal state of a reducer – this makes refactoring and testing a lot easier. (More about the concept of redux modules.)

Here’s an example of a small “redux module”.

// data/notifications/index.js

const initialState = [];
let notificationId = 0;

const createActionName = name => `app/notifications/${name}`;

// reducer
export default function reducer(state = initialState, action = {}) {
  switch (action.type) {
    case ADD_NOTIFICATION:
      return [...state, { ...action.payload, id: notificationId += 1 }];
    case REMOVE_NOTIFICATION:
      return state.slice(1);
    default:
      return state;
  }
}

// selectors
export const selectAllNotifications = state => state.notifications;
export const selectNextNotification = state => state.notifications[0];

// actions
export const ADD_NOTIFICATION = createActionName(ADD_NOTIFICATION);
export const REMOVE_NOTIFICATION = createActionName(REMOVE_NOTIFICATION);

// action creators
export const addNotification = payload => ({ payload, type: ADD_NOTIFICATION });
export const removeNotification = () => ({ type: REMOVE_NOTIFICATION });

This module can be used to add and select notifications. Here’s an example of how it can be used to provide props to a React component.

// components/NotificationView/connect.js

import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { removeNotification, selectNextNotification } from '../../data/notifications';

const mapStateToProps = createStructuredSelector({
  nextNotification: selectNextNotification
});
const mapDispatchToProps = { removeNotification };

export default connect(mapStateToProps, mapDispatchToProps);
// components/NotificationView/index.js

import connect from './connect';
export class NotificationView extends React.Component { /*...*/ }
export default connect(NotificationView);

This allows you to import specific modules that are responsible for modifying and querying specific parts of the overall state. This can be very useful when relying on code-splitting.

However, problems with this approach are evident once it comes to adding the reducer to a Redux store.

// data/createStore.js

import { combineReducers, createStore } from 'redux';
Import notifications from './notifications';

const initialState = /* from local storage or server */

const reducer = combineReducers({ notifications });
const store = createStore(reducer, initialState);

export default store;

You’ll notice that the notifications namespace is defined at the time the store is created, and not by the Redux module that defines the reducer. If the “notifications” reducer name is changed in createStore, all the selectors in the “notifications” Redux module no longer work. Worse, every Redux module needs to be imported in the createStore file before it can be added to the store’s reducer. This doesn’t scale and isn’t good for large apps that rely on code-splitting to incrementally load modules. A large app could have dozens of Redux modules, many of which are only used by a few components and unnecessary for initial render.

Both of these issues can be avoided by introducing a Redux reducer registry.

Redux reducer registry

The reducer registry enables Redux reducers to be added to the store’s reducer after the store has been created. This allows Redux modules to be loaded on-demand, without requiring all Redux modules to be bundled in the main chunk for the store to correctly initialize.

// data/reducerRegistry.js

export class ReducerRegistry {
  constructor() {
    this._emitChange = null;
    this._reducers = {};
  }

  getReducers() {
    return { ...this._reducers };
  }

  register(name, reducer) {
    this._reducers = { ...this._reducers, [name]: reducer };
    if (this._emitChange) {
      this._emitChange(this.getReducers());
    }
  }

  setChangeListener(listener) {
    this._emitChange = listener;
  }
}

const reducerRegistry = new ReducerRegistry();
export default reducerRegistry;

Each Redux module can now register itself and define its own reducer name.

// data/notifications/index.js

import reducerRegistry from '../reducerRegistry';

const initialState = [];
let notificationId = 0;

const reducerName = 'notifications';

const createActionName = name => `app/${reducerName}/${name}`;

// reducer
export default function reducer(state = initialState, action = {}) {
  switch (action.type) {
    case ADD_NOTIFICATION:
      return [...state, { ...action.payload, id: notificationId += 1 }];
    case REMOVE_NOTIFICATION:
      return state.slice(1);
    default:
      return state;
  }
}

reducerRegistry.register(reducerName, reducer);

// selectors
export const selectAllNotifications = state => state[reducerName];
export const selectNextNotification = state => state[reducerName][0];

// actions
export const ADD_NOTIFICATION = createActionName(ADD_NOTIFICATION);
export const REMOVE_NOTIFICATION = createActionName(REMOVE_NOTIFICATION);

// action creators
export const addNotification = payload => ({ payload, type: ADD_NOTIFICATION });
export const removeNotification = () => ({ type: REMOVE_NOTIFICATION });

Next, we need to replace the store’s combined reducer whenever a new reducer is registered (e.g., after loading an on-demand chunk). This is complicated slightly by the need to preserve initial state that may have been created by reducers that aren’t yet loaded on the client. By default, once an action is dispatched, Redux will throw away state that is not tied to a known reducer. To avoid that, reducer stubs are created to preserve the state.

// data/createStore.js

import { combineReducers, createStore } from 'redux';
import reducerRegistry from './reducerRegistry';

const initialState = /* from local storage or server */

// Preserve initial state for not-yet-loaded reducers
const combine = (reducers) => {
  const reducerNames = Object.keys(reducers);
  Object.keys(initialState).forEach(item => {
    if (reducerNames.indexOf(item) === -1) {
      reducers[item] = (state = null) => state;
    }
  });
  return combineReducers(reducers);
};

const reducer = combine(reducerRegistry.getReducers());
const store = createStore(reducer, initialState);

// Replace the store's reducer whenever a new reducer is registered.
reducerRegistry.setChangeListener(reducers => {
  store.replaceReducer(combine(reducers));
});

export default store;

Managing the Redux store’s reducer with a registry should help you better code-split your application and modularize your state management.




mo

Coronavirus | Indore remains worst hit in Madhya Pradesh with 3 more deaths

Bhopal, by comparison, has so far reported 679 cases and 24 deaths, with 354 patients, or more than half of those infected, having recovered.




mo

Air India employees move HC over pay cut

They say it violates Centre’s directive




mo

Former J&K Minister’s detention extended by 3 months

With a view to prevent him from acting in any manner prejudicial to the maintenance of public order, Naeem Akhtar detention is being extended, an order said.




mo

Coronavirus | 30 more test positive in J&K, cases mount to 823

Bandipora tops the list with 134 cases, followed by Srinagar at 129




mo

Odisha drafts more than 2 lakh people into COVID-19 workforce

8,023 doctors, 8,296 staff nurses, 4,105 paramedics and lab technicians have been identified as dedicated COVID-19 service providers




mo

Lock down or lock up! Brimful misery for commoners




mo

Rumour charge: AIUDF MLA arrested




mo

Stop complainers and energy drainers [electronic resource] : how to negotiate work drama to get more done / Linda Byars Swindling

Swindling, Linda Byars, 1965-




mo

Strategische personalentwicklung in der praxis [electronic resource] : instrumente, erfolgsmodelle, checklisten, praxisbeispiele. / Christine Wegerich

Wegerich, Christine, author




mo

The strategy of execution [electronic resource] : the five-step guide for turning vision into action / Liz Mellon and Simon Carter

Mellon, Elizabeth




mo

Stress less. achieve more [electronic resource] : simple ways to turn pressure into a positive force in your life / Aimee Bernstein

Bernstein, Aimee




mo

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




mo

The talent assessment and development pocket tool kit [electronic resource] : how to get the most out of your best people / Brenda Hampel and Anne Bruce

Hampel, Brenda




mo

Tapping into unstructured data [electronic resource] : integrating unstructured data and textual analytics into business intelligence / William H. Inmon, Anthony Nesavich

Inmon, William H




mo

Thinkers 50 management [electronic resource] : cutting edge thinking to engage and motivate your employees for success / Stuart Crainer + Des Dearlove

Crainer, Stuart




mo

Time management in an instant [electronic resource] : 60 ways to make the most of your day / Karen Leland & Keith Bailey

Leland, Karen




mo

Toda suma [electronic resource] / Ángel Aledo ; prólogo de Santiago Álvarez de Mon

Aledo, Ángel, author




mo

Trade to win [electronic resource] : proven strategies to make money / Thomas L. Busby with Patsy Busby Dow

Busby, Thomas L., 1951-




mo

The truth about motivating your employees [electronic resource] : the essential truths in 20 minutes / Martha I. Finney

Finney, Martha I., author




mo

Truth, growth, repeat [electronic resource] : (a business manual for generation why) / by Mike Edmonds with Ronnie Duncan

Edmonds, Mike, author




mo

Tussle between maintaining customer satisfaction and supply chain constraints [electronic resource] : IGNYS automotive / Chuck Munson with Satish Kumar and Dileep More

Munson, Chuck, author




mo

Using the project management maturity model [electronic resource] : strategic planning for project management / Harold Kerzner, Ph.D

Kerzner, Harold, author




mo

Perfect phrases for virtual teamwork [electronic resource] : hundreds of ready-to-use phrases for fostering collaboration at a distance / Meryl Runion with Lynda McDermott

Runion, Meryl




mo

Waltzing with bears [electronic resource] : managing risk on software projects / Tom DeMarco & Timothy Lister

DeMarco, Tom, author




mo

We are Market Basket [electronic resource] : the story of the unlikely grassroots movement that saved a beloved business / Daniel Korschun & Grant Welker

Korschun, Daniel




mo

Web development with MongoDB and Node JS [electronic resource] : build an interactive and full-featured web application from scratch using Node.js and MongoDB / Mithun Sathessh, Bruno Joseph D'mello, Jason Krol

Satheesh, Mithun, author




mo

Ein Weg zu Industrie 4.0 [electronic resource] : Geschäftsmodell für Produktion und After Sales / Myriam Jahn

Jahn, Myriam, author




mo

What great salespeople do [electronic resource] : the science of selling through emotional connection and the power of story / Michael Bosworth, Ben Zoldan

Bosworth, Michael T




mo

What would Drucker do now [electronic resource] : solutions to today's toughest challenges from the father of modern management / Rick Wartzman

Wartzman, Rick




mo

Which way forward? [electronic resource] : people, forests, and policymaking in Indonesia / edited by Carol J. Pierce Colfer and Ida Aju Pradnja Resosudarmo




mo

Wise money [electronic resource] : how the smart money invests using the endowment investment approach to minimize volatility and increase control / Daniel Wildermuth

Wildermuth, Daniel




mo

Your success in the retail business (collection) [electronic resource] / Richard Hammond, Barry Berman

Hammond, Richard, author




mo

Zero space [electronic resource] : moving beyond organizational limits / Frank Lekanne Deprez, Rene Tissen

Deprez, Frank Lekanne




mo

Zip! tips [electronic resource] : ZIPs for Outlook, iPad, iPhone, Gmail, Google, and much, much more! / Mike Song ; edited by Rachel Metzger

Song, Mike, 1964-






mo

JAMA Neurology : Effect of Dextroamphetamine on Poststroke Motor Recovery

Interview with Larry B. Goldstein, MD, author of Effect of Dextroamphetamine on Poststroke Motor Recovery: A Randomized Clinical Trial