Watch out for the mental shocks of ending Covid-19 lockdown

Watch out for the mental shocks of ending Covid-19 lockdown:

It’s easy to predict many of the pains that are going to hit business as the UK attempts to follow its neighbours in re-opening from lockdown. Businesses face a new and awkward world where social distancing will throw many of their old assumptions out of the window. Decisions must be made on how much homeworking will continue. The accrued ‘technical debt’ must be paid back in full.

Then there’s the human aspects. What will happen to those who have been furloughed – will they still have jobs to come back to, and will the business be able to pay them if it’s already burned through its cash reserves? Will they even want to come back to the office, now that we’ve all been taught to avoid getting too close to other people?

Goodwill won’t last

And something that’s easily forgotten or missed: how much has the business been relying on goodwill in order to get through an urgent crisis? That goodwill is inevitably going to expire once people no longer feel the urgency – and it’s already faded significantly, thanks to the selfish and/or arrogant actions of a number of high-profile individuals.
Freeform Dynamics has surveyed a lot of organisations about Covid-19 and lockdown recently. We’ve talked about the sudden demand for laptops and the network capacity needed for massive amounts of work-from-home (WFH), and we’ve seen the changes that lockdown has enforced, even in organisations where managers were previously allergic to letting their people work remotely.
In short, we can confirm the truth of Microsoft boss Satya Nadella’s statement that he’s seen it drive “two years of digital transformation in two months.”

The debts are not just technical

Our research confirmed too that this rapid transformation has left organisations of all kinds with significant ‘debt’, especially in areas such as technology and regulatory compliance. That’s the things we had to do in a hurry to enable WFH as rapidly as possible. Whether it was allowing access to sensitive company data over home broadband, the use of free videoconferencing for meetings, or not worrying as much as usual about GDPR or employee health and safety legislation, much of it will need to be fixed or revised in the months following reopening.
The effect on individuals could be just as stark, however. Some of us will have loved being able to WFH for the first time, while others may be suffering severe cabin-fever and be desperate to get back to the office. And in either case, we may be stretching our partner’s goodwill – and the rules on safe and healthy workspaces – as we clutter up the dining room or the kitchen table.
This coming out of lockdown is going to be harder than we expect for many of us. We will need to make readjustments, both mental and physical, and issues that we’ve pushed onto the back burner for the last few months may return to the boil. That sense of common purpose is slipping away, and all those debts are going to start coming due. So be ready for the shocks, whether that means offering help to the others around you, or indeed asking for it for yourself.

from Tumblr https://generouspiratequeen.tumblr.com/post/622353399775723520

What CISOs can learn from Covid-19

What CISOs can learn from Covid-19:

Mike Lloyd, CTO at Redseal, holds 21 cyber security patents and a PhD in stochastic epidemic modelling from Heriot-Watt University in Edinburgh, so is probably the man to talk to when it comes to cyber security in the world of Covid-19

More than three months into the global Covid-19 coronavirus pandemic, we have all become familiar with the advice on how not to catch this mysterious and horrible disease, which some people seem to be able to shake off with ease, but for thousands of other survivors now appears to have life-changing consequences.
same precautions you might take to avoid a mild cold: wash your hands, don’t touch your eyes or mouth, keep some distance from others, avoid crowded indoor spaces, wear a face mask.
To a security professional, this advice might seem a little familiar to some degree: change your password, don’t click on unsolicited links in your email, don’t plug USB drives into your PC – all basic and easy-to-understand advice that it seems to be very hard to get people to pay attention to.
But then, after all, there is a reason why computer viruses are called computer viruses. Helpfully, at the intersection of biological virology and computer virology sits Mike Lloyd, who as CTO of cyber risk services provider Redseal and a doctor of epidemiology, has a unique view of both fields.
Good security is about the basics, it’s about hygiene, it’s about washing your hands,” he says as we chat via video-conferencing app Zoom across eight time zones, Lloyd in his kitchen at home in California, me in my south London flat. “That’s why there are such strong analogies with the virus. Basic hygiene, not some high-tech super pill, is the main way we have of combating Covid-19.
“Often in security we have the same role as dentists talking to people about flossing. We have to keep going over the same advice, over and over again, because people find behaviour modification difficult.”
Before the arrival of Covid-19 at the start of 2020, the biggest killers in the Western world were preventable diseases caused by choices related to poor diet, lack of exercise, or excessive use of alcohol or tobacco, all of which are fixable with behavioural modification.
“But we just don’t do that – we’re terrible at behaviour modification,” says Lloyd. “Then along came this disease that threatened grandma and suddenly it turns out that hundreds of millions of people can change their behaviour.
“I think there’s something in there that is a useful human story. We are far, far better at behaviour modification when it’s not about us, when it’s about some greater mission, such as care for the elderly or care for the community, or however you want to frame it.
“If I map that into something more CISO-specific, of course we’ve all been trying to get people to do behaviour modification by training them about clicking on links and so on, and it really hasn’t worked very well. So you can see a glimmer of hope for security there, I think.
“The point is that humans change their behaviour when they see a mission greater than themselves and I think that’s an interesting point.”
But it is abundantly clear from the constant stream of data breaches and security incidents that even if humans do change their basic behaviours, there is no guarantee that the network will remain free of infection – just as washing your hands does not guarantee protection from Covid-19.
“Viruses are extremely efficient little machines for making more viruses and while the threats security professionals face are people, not biological viruses, cyber criminals are also super-efficient, and they go for the easiest and biggest payoff,” says Lloyd. “When they see very fragile infrastructure, they use very simple attacks.”
The way cyber criminals move laterally through their target networks is also very similar to how a virus like Covid-19 moves through the human body. In the case of the coronavirus, governments tried to stop lateral movement through their networks of humans by isolating humans in their homes. Lloyd thinks security professionals can learn a thing or two about how cyber threats propagate from this.
“It is very clear that we can’t patch humans,” he says. “Humans depend critically on trust, and that trust can be exploited, so you can continue to get people to click on links no matter how many training classes we put them through.”
This means there will still be breaches and points of infection in networks, just as in people, and what security professionals need to do is accept this and focus on stopping subsequent lateral movement, just as doctors try to limit the damage Covid-19 causes in the body, says Lloyd.
From a technical perspective, nobody has got the solution quite figured out yet, he says. “You still see a lot of organisations where once you get deep enough inside, it’s all free and clear for lateral movement. That creates a playground for an attacker – or a biological virus. The analogies are so close that it’s difficult to tease apart when we’re talking about lateral movement of a disease and when we’re talking about lateral movement of attackers. They really do behave in the same way.”

Adaptability and evolution

But the lessons that security professionals can take away from the pandemic do not just relate to changing behaviours. Lloyd says the coronavirus crisis could spark a period of evolutionary change in cyber security, and he turns to the history of human biology to make the point.
“One of the questions around how humans came about is what force was there in evolutionary terms that made humans the way we are?” he says.
“One of the better explanations I’ve seen is that it was variability itself – the climate’s gone through many periods of change, but in the last million years or so, variability went up and when variability goes up, that means the climate changes a lot.
“That means there’s an evolutionary advantage, not to the fittest, but to the most adaptable, which may be what makes humans so successful because we are uniquely adaptable creatures.”
This is reflected in the world of cyber security in this way: pre-pandemic, CISOs tended to think of security in terms of best practices to fit a specific need and then bought the security solutions that would best adhere to those practices – firewalls, endpoint protection agents, SIEM services, or whatever.
“There’s a long list of examples where we can’t just flick a switch and put everything in the cloud”
Mike Lloyd, Redseal
But in a post-pandemic world, where every business will have to respond differently because of the vastly differing requirements across sectors in terms of social distancing, remote working and so on, the ability to adapt will be key.
“It feels very easy for those of us who have laptops and have figured out how to make our work mobile, but really there are quite a lot of industries for which that is difficult,” says Lloyd. “There’s a long list of examples where we can’t just flick a switch and put everything in the cloud.”
This will lead to something of a division in the security world, he says, as CISOs will no longer be able to adopt someone else’s playbook on the assumption that what worked well for someone else will work for their organisation.
Perhaps more concerningly, it may force many down the hybrid route, securing on-premise and cloud-based services with cumbersome, increasingly fragile security stacks.
“The chain is only as strong as its weakest link and if you add more and more links to the chain, if you have more and more ways of doing business, as everything becomes more and more hybrid, then you have an increasing security problem,” says Lloyd.
“This is quite an abstract point, but I think it matters because CISOs still have to make networks as flexible, as adaptable, as resilient as possible, and the pursuit of digital resilience is the most important thing when we’re heading into a world where we know the rules are going to continue to change.”

How to achieve digital resilience

For Lloyd, the most important step towards achieving a digital resilience that can deal with the fact that the world we all thought we knew has changed so radically – and by the way, he adds, other novel security issues around artificial intelligence (AI), the internet of things (IoT) or 5G aren’t going away – is to know your organisation inside and out at both the organisational, business process level, and at the infrastructure level. That is a big ask.
“It’s actually really surprising how difficult both of those things can be,” he says. “It’s very hard for an organisation to capture how it really works. But resilience is the ability to take a punch and then to be able to recover function, so you need to understand how your organisation works.”
The first step is to audit the processes that are intrinsic to your organisation. Appropriately, Lloyd uses a medical example here – an ophthalmologist would struggle to examine a patient’s eyeball over Zoom, but for a basic GP consultation, telemedicine is probably fine. The second step is to map those factors onto the IT infrastructure and figure out how it helps achieve those processes.
“Resilience is the ability to take a punch and then to be able to recover function”
Mike Lloyd, Redseal
“Until you have done that, you can’t possibly achieve resilience or adaptability, and I think for people who don’t do this every day, it can be really hard to appreciate how hard it is to know how the organisation really works,” he says. “That’s why I emphasise something so fundamental.”
The adage that security leaders need to make themselves indispensable to the organisation’s board, and if possible fight for a seat at the top table, has been repeated so often that it has become something of a cliché.
However, a true understanding of how the business works requires security leaders to show up to board meetings, and to make sure they are not just there as a scapegoat when something has gone wrong.
“There clearly have been organisations that wanted a CISO to attend board meetings so they knew who to fire when something went wrong,” says Lloyd. “How do you prevent that dynamic? You have to actually be achieving something in terms of resilience – that means not educating the board on how you will perfectly protect everything, but educating the board on how you will help recovery when shocks occur.”
Perhaps, he muses, the wider shock of the Covid-19 crisis will be the spur that convinces wider organisational leadership to listen to their security teams. “Right now, it’s not hard to get a board member to appreciate that there can be extrinsic shocks to a business outside of your control,” he says.

from Tumblr https://generouspiratequeen.tumblr.com/post/622353283932110848

Pandemic Programming Survey Results Show Negative Impact of COVID-19 Changes

Pandemic Programming Survey Results Show Negative Impact of COVID-19 Changes:

The Pandemic Programming survey looked at the ways that developers’ lives have been impacted by the lockdowns and changes caused by COVID-19.   Over 2200 people from 52 countries answered the questionnaire to assess their wellbeing and productivity before and while working at home.   The results show that well-being and productivity are suffering with some groups, particularly women, parents, and people with disabilities, are much more negatively impacted than others.  The researchers provide advice to software companies to help mitigate the negative impact. 
Dr Rashina Hoda of the HumaniSE lab in the Faculty of IT at Monash University is one of a group of 17 researchers who conducted the Pandemic Programming survey into the impacts of the sudden shift to remote working on computer programmers around the world. The survey looked at the ways that developers’ lives, particularly around well-being and productivity, have been impacted by the lockdowns and changes as a result of COVID-19. 
The conclusions from the research are:
  • Developers’ well-being and productivity are suffering
  • Productivity and well-being are closely related
  • Better home office ergonomics help well-being and productivity
  • Women, parents, and people with disabilities may be disproportionately affected
  • Different people need significantly different kinds of support
From the results the researchers came up with some advice for software companies on how they can support their developers:
  • DO support developers’ emotional wellbeing; it will help their productivity
  • DO ask employees what they need (e.g., equipment, professional training)
  • DO help employees improve the ergonomics of their home work spaces
  • DON’T expect normal productivity during the pandemic; it’s unrealistic
  • DON’T pressure employees to be productive; it will make matters worse
  • DON’T make any decisions (e.g., layoffs, promotions) based on productivity during the pandemic
The full data set and complete paper including analysis approach and statistical approach is available here and a one-page summary here.
InfoQ spoke to Dr Hoda about the results.
InfoQ: What was the background to the research – why was it conducted?
Rashina Hoda: We wanted to study how the pandemic is affecting software practitioners, in particular developers, as they moved to working from home. We also wanted to gain insights into steps organisations are taking to support their staff and what is seen to be helping.
InfoQ: The results seem to be fairly obvious – many of our readers will look at them and say, “Isn’t this just common sense?” What should they take from the results and can you add any additional information to the results?
Hoda: The study shows much needed empirical evidence to support some of what appears to be common sense conclusions. Another aspect here is that many of our findings and recommendations such as don’t pressurise developers on productivity under the covid19 scenario are only ‘common sense’ to the managers and companies who are reasonable and doing the right things. There may be companies out there focusing on productivity at this time when they should be focusing on well-being instead. I.e. common sense isn’t universally common and needs to be shared out loud with research evidence.
InfoQ: Please tell us more about the overlap with emergency and disaster management and the implications for software development.
Hoda: With this study, we have explored the interface between emergency and disaster management and the field of software engineering. Both from a research and practice perspective, the study sets precedence for approaching developers’ well-being and productivity issues in the face of emergencies/disasters with guidance on what employers can do to help. More generally, we open avenues for further work into human-centric issues in software development in the face of uncertainty and defining the ‘new normal’, e.g. Twitter accepts remote working as a norm.
InfoQ: What are some practical steps that managers of software developers can take to support their people?
Hoda: Understanding the relationship between well-being and productivity is key. Managers can help focus on their developers’ well-being through regular team catch-ups, one-on-ones, virtual lunches, virtual social gatherings, and so on to tackle issues arising from physical and social isolation related to remote working. Managers can also cater to the very practical needs of helping set up the home environment for working conditions, including sponsoring ergonomic furniture, keyboards, mice, headsets, and additional internet packages to supplement increased demands on the home network. Managers can also help by taking the circumstances of women, those with disabilities, those with carer responsibilities, and other vulnerable groups into special consideration as they are more likely to be disproportionately disadvantaged during such a crisis.

from Tumblr https://generouspiratequeen.tumblr.com/post/622353008293003264

Fake 3D Effect in CSS Using a Single Div

Fake 3D Effect in CSS Using a Single Div:

I recently came across an article titled Faking 3D Elements with CSS by Bradley Taunt. It’s a very easy-to-understand article on how to create a fake 3D effect using not more than 2 divs.
I decided to recreate a similar effect using just a single div, and I guess the result seemed quite close enough. So, let’s have a look at how we can achieve it.
As mentioned, we’ll only require a single div. In your HTML, add a div and give it a class of circle.
Now, let’s start working on the CSS. First we’ll add the below styles to the div with the class of circle
.circle{
  height: 400px;
  width: 400px;
  background: linear-gradient(#f00202 0%, #bd0404 10%, #7d0404 50%, #4a0202 100%);
  border-radius: 50%;
}
Add a few flexbox properties to the body to vertically and horizontally center the circle on the page.
body{
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
Now, we’ll require one more circle that will be placed inside the main circle. This inner circle will be mainly responsible for producing the desired fake 3D effect. To create the inner circle we will be using the ::before pseudo element.
.circle::before{
  content: "";
  height: 360px;
  width: 360px;
  background: linear-gradient(#f06060 0%, #a30505 60%, #4d0202 100%);
}
Place it exactly at the center of the main circle by adding the necessary flexboxproperties to the center class.
.circle{
  ...
  ...
  display: flex;
  justify-content: center;
  align-items: center;
}
By now, we have something that looks like this
For the final 3D effect, add the below two CSS properties to the ::before pseudo element.
.circle::before{
  ...
  ...
  border-radius: 50%;
  filter: blur(18px);
}
And lastly, let’s give the body a background-color of #990000, which is a shade of red.
body{
  ...
  ...
  background: #990000;
}
Hold on. We are still missing one final thing – the drop shadow. We’ll achieve it by using the ::after pseudo element.
.circle::after{
  content: '';
  position: absolute;
  width: 100%;
  height: 60px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6  );
  bottom: -60px;
  z-index: -1;
  filter: blur(10px);
}
Notice that the ::after pseudo element has been given the position of absolute. Make sure that it is positioned in relation to the main div with the class of circle. So, give the main div a position of relative.
.circle{
  ...
  ... 
  position: relative;
}
And our fake 3D effect is ready. Pretty simple, isn’t it?
Below is the final code

HTML

CSS

body{
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #990000;
}

.circle{
  height: 400px;
  width: 400px;
  background: linear-gradient(#f00202 0%, #bd0404 10%, #7d0404 50%, #4a0202 100%);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.circle::before{
  content: "";
  height: 360px;
  width: 360px;
  background: linear-gradient(#f06060 0%, #a30505 60%, #4d0202 100%);
  border-radius: 50%;
  filter: blur(18px);
}

.circle::after{
  content: '';
  position: absolute;
  width: 100%;
  height: 60px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6  );
  bottom: -60px;
  z-index: -1;
  filter: blur(10px);
}

from Tumblr https://generouspiratequeen.tumblr.com/post/622352861076078592

Apple iPhone to Unlock New Automated Features with BMW

Apple iPhone to Unlock New Automated Features with BMW:

Apple’s Worldwide Developer Conference 2020 will be remembered for many things, most notably for the absence of any audience in attendance for this year’s event. Sandwiched between announcements of Apple’s migration to its own silicon for Macs, iOS 14 and macOS Big Sur, and a multitude of iEverything else within the Apple universe, the Cupertino giant also showed off a feature that will soon give BMW owners – and hopefully numerous other auto owners – the ability to use their iPhones as a fully digital car key.

Demoed using the 2021 BMW 5 Series, the Tanzanite Blue Metallic adorned sedan opened wirelessly using the iPhone’s built-in NFC, and starting with only a tap of a button once the iPhone was set across the car’s charging pad.
If you’ve used Apple Wallet to pay, you’ll have no problem using CarKey, a digital car key technology designed to unlock your auto and start it with nary a key fob in sight. Using the same built-in NFC chip and biometric security features as Apple iPhone’s digital wallet, CarKey resides alongside other virtual payment accounts in iOS Wallet, granting access to automobiles only when Face ID or Touch ID authentication is verified (there’s an option to skip authentication if you’re feeling especially trusting).

Additional features offered via Apple + BMW Digital Key include: Storage in the Secure Element of your iPhone and access through Apple Wallet, power reserve for iPhone where car keys will still function for up to five hours if the iPhone turns off due to low battery, the option to share access with up to 5 friends via iMessage, and Apple Watch compatibility.
Apple’s new CarKey will also grant users the ability to virtually toss the car keys over to other family member or other trusted contacts via iMessage, granting use with or without restrictions – access/use time, top speed, horse power, maximum radio volume, and more.
BMW will be the first car brand to use the iPhone+iOS as a fully digital car key solution (dubbed, BMW Digital Key, by the automaker), but it’s almost certain to spread across the industry soon afterward – especially across the luxury segment – where monied Apple iPhone users will appreciate one less thing to forget, misplace, or scratch their device.

from Tumblr https://generouspiratequeen.tumblr.com/post/622352709740265472

Post-pandemic security market still set for growth, but slower

Post-pandemic security market still set for growth, but slower:

Frost & Sullivan report says the global security industry will withstand the economic crash caused by the Covid-19 pandemic, but growth will be slower for a few years

The global security sector still presents “tremendous investment opportunities” in spite of the global economic crash forced by the Covid-19 coronavirus pandemic, and is expected to rebound after a brief slowdown, although growth will be slower than previously predicted, according to analysis by Frost & Sullivan.
In their report, Post-pandemic growth opportunity in the global security industry, Frost & Sullivan predicted that in the best-case recovery scenario, the industry would grow at a compound annual growth rate (CAGR) of 4.3%, hitting $140.6bn (€123bn/£112.4bn) in 2025 from $109.3bn in 2019.
A more conservative prediction would be that the market sees a CAGR of 3.1%, taking it to $131.bn. Without Covid-19, it was expected to have grown 7.1% in the same period to $165bn.
“Covid-19 will cause a brief slowdown in the security market after almost a decade of uninhibited progress,” said Danielle VanZandt, aerospace, defence and security industry analyst at Frost & Sullivan.
“Additionally, while some security sectors may find themselves experiencing a slower recovery than others, much of the industry will witness a shift to more service-based solution offerings after years of hesitance by customers to adopt these solutions.”
Frost & Sullivan said that remote and cloud-connected access to security systems and monitoring tools would see a dramatic rise in demand, while an increased emphasis on contactless technologies will bring good opportunities around identity and access management.
Earlier in June, Gartner reported that worldwide spending on cyber security and risk management technology would slow dramatically in the second half of the year. Having previously forecast growth of 8.7% in 2020, it has now revised this back to just 2.4% for a total market value of $123.8bn.
Meanwhile, analysts at Canalys have reported that the cyber security industry has seen a bumper year so far – up 9.7% in the first quarter of 2020 to $10.4bn – with a particularly strong showing for endpoint protection technology and web and email security, at the expense of network security, reflecting the transition to remote working.
This said, growth will slow in the last six months of the year as IT budgets are reassessed to account for worsening economic conditions, with many planned increased in cyber security spending expected to be scaled back or stopped altogether, although their may be some uplift as free trials and special pandemic offers expire.
Fewer upfront payments for multi-year contracts may also be another limiting factor in the coming months, although this will be less of a problem for those that have shifted to more predictable subscription models.
Canalys said that this would likely impact the security market landscape, with suppliers backed by private equity at particular risk of cost-cutting measures, while startup owners will accelerate their exit plans, giving rise to a more small acquisitions by large, stable players.

from Tumblr https://generouspiratequeen.tumblr.com/post/622260765492183040

5 new css tricks to learn

5 new css tricks to learn:

This year has been very productive for me as i developed numerous UI/UX apps and websites. On the way i’ve picked up some useful tricks to enhance my designs.

1. CSS Variables

CSS variables are useful when we want to apply the same style to common elements. Instead of adding a complex box-shadow, for example, to common elements we can initialize a variable and use that variable everytime we want to apply that style to an element
We initialize CSS variables with :root and the property we want to set, like so:
:root {
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}
And we can then use it in any element we want to apply this box-shadow to:
.container {
   box-shadow: var(--shadow);
}

2. Media Queries

Besides for screen width media queries, we can also apply screen height media queries, so devices with smaller screen height can be responsive. As well, when a device rotates its screen, the screen height changes and we need to reflect those changes for responsive purposes.
@media only screen and (max-height: 800px) {
    .container {
        height: 95%;
    }
}
For screens at 800 or less pixels will change the grid element’s height.

3. Calc Function

The CSS calc function can be very useful when setting dynamic widths. Say we want an element’s width to be based on another element’s width.
.container {
    width: calc(100%-300px);
}
The width of our container element will be based on 100% of its parent container minus 300px, so if a container next to it is 300px, our dynamic container will respond accordingly.

4. Vertical Alignment

There are many ways to align an element vertically, But sometimes it can get complicated and not work, due to positioning complications of the parent element. One such method that works everytime is to position an element we want to align vertically, as absolute position and apply the following styles.
.container {
    position:absolute;
    top: -50%;
    transform: translateY(50%);
    margin: auto;
}
This will vertically align the element to its parent container.

5. Border-Box Property

.container {
    box-sizing: border-box;
}
Border box is one of the most useful properties in CSS. It allows us to create padding on elements while keeping the dimensions of the element uniform. So if we have a container with 300px width and 300px height and a padding of 30px, by default CSS will add those 30px to the container’s dimensions thus causing many problems of alignment and other issues in our design. By applying a box-sizing: border box property, we can make all containers uniform in size.
box-sizing can also be used to make inputs, textareas and select boxes, the same size as well, to create a uniform look to our elements.

from Tumblr https://generouspiratequeen.tumblr.com/post/622260523233378304

What you need to know about JavaScript ES6

What you need to know about JavaScript ES6:

ES6 is the next generation of JavaScript syntax with some added features that make your code more modern and readable. In this article, I will go over some of the most essential features of ES6 so you too can write less and do more.

const and let

I won’t go into detail here since I’ve already written another blog post on the uses of var, let, and const here. The gist is that your go-to identifier in Javascript should be const. However, if you know or think you’ll need to reassign it (in a for-loop, switch statement, or in algorithm swapping, for example), use let.

Template Literals

Template literals are very useful because they let you create strings without the need to concatenate the values. For example,
const book = {
    name: 'The Martian'
}
console.log('You are reading ' + book.name + '., \n and this is a new line…'
We can improve the syntax of the previous console.log with the following code:
console.log(`You are reading ${book.name}., and this is a new line…`)
Note that template literals are enclosed in back-ticks. To interpolate a variable value, simply set the variable name inside a dollar sign and curly braces. 
As you saw in the example, template literals can also be used for multiline strings. There is no need to use \n anymore. Simply hit Enter on the keyboard to take the string to a new line.

Arrow Functions

Arrow functions are great for simplifying the syntax of functions. For example:
function myFunc(name) {
    return 'Hello' + name
}
console.log(myFunc('World'))
With ES6, we can simplify things like so:
const myFunc = name => {
    return `Hello ${name}`
}
Or if the function has a single statement like our example, you can simplify it even further by omitting the keyword return and the curly brackets like so:
const myFunc = name => `Hello ${name}`
In addition, if the function does not receive any argument, we can use empty parentheses:
const hello = () => console.log('Hello!')

Default Parameters

With ES6, it’s possible to define default parameter values for functions.
function sum(x = 1, y = 2) {
    return x + y
}
console.log(sum(3)) // 5
In the above example, since we did not pass y as a parameter, it will have a value of 2 by default. So, 3 + 2 === 5.

Destructuring

Destruction allows us to initialize multiple variables at once.
let [x, y] = ['a', 'b']
Array destructuring can also be used to swap values at once without the need to create temp variables which is very useful for sorting algorithms.
[x, y] = [y, x]
Another useful functionality is called property shorthand.
let [x, y] = ['a', 'b']
let obj = {x, y}
console.log(obj) // { x: 'a', y: 'b' }
One last functionality we’ll go over is called shorthand method names. This allows us to declare functions inside objects as if they were properties.
const hello = {
    name: 'World', 
    printHello() {
        console.log('Hello')
    }
}
console.log(hello.printoHello())

Spread and Rest Operators

In ES5, we could turn arrays into parameters using the apply() function. ES6 has the spread operator (…) for this purpose. For example, consider a sum function that sums three values:
let params = [3, 4, 5]
console.log(sum(...params))
The spread operator can also be used as a rest parameter like so:
function restParameter(x, y, ...a) {
    return (x + y) * a.length
}
console.log(restParameter(1, 2, 'hello', true, 7)) // 9

Classes

ES6 also introduced a cleaner way of declaring classes. Consider the following:
function Book(title, author) {
    this.title = title
    this.author = author
}
Book.prototype.printTitle = function() {
    console.log(this.title)
}
With ES6, we can simplify the syntax like so:
class Book {
    constructor(title, author) {
        This.title = title
        this.author = author
    }
    printAuthor() {
        console.log(this.author)
    }
}
With ES6, we can use a simplified syntax for inheritance between classes using the keyword extends. As you’ll see in the following example, we can also use the keyword super inside the constructor to refer to the constructor superclass.
class ITBook extends Book {
    constructor(title, author, technology) {
        super(title, author)
        this.technology = technology
    }
}

Conclusion

I hope you found this guide helpful for reviewing some of what I consider to be very useful features of ES6. 

from Tumblr https://generouspiratequeen.tumblr.com/post/622260414522195969

How to Create, Write, Read, and Delete Files in PHP

How to Create, Write, Read, and Delete Files in PHP:

In this tutorial, we are going to learn file handling in PHP. I’ll show you how to create, read, write, and delete files in PHP by using the built-in file handling functions.
File handling is something that you will need to do very often as a PHP developer.
You could use PHP file handling functions to manipulate files in different ways. These functions could be used to build features in your applications that range from custom error logging to storing cached files. Examples of utility tools that you could build with these functions are:
  • custom logging and debugging tools
  • application configuration storage
  • front-end and application caching
  • localization support
  • and many more
PHP provides several file handling functions that allow you to perform various operations, like:
  • create and open a file
  • write into a file
  • read from a file
  • delete a file
  • close a file
Today, we’ll go through each and every file operation, along with examples of how to use them. I would encourage you to try out the examples in this tutorial as you follow along, so that you can actually learn and understand how they work. And if something doesn’t work as expected for you, feel free to post your queries by using the feed at the end of this tutorial.
In this section, we’ll see how to create and open a file.
When it comes to creating a file, it’s the fopen function which you’ll end up using most of the time. It may seem a bit confusing to use the fopen function to create a file. In fact, the fopen function does two things: it creates a file if it doesn’t exist and also opens it for reading or writing.
Let’s go through the following example to understand how it works.
1
2
3
<?php
$file_handle = fopen('/home/tutsplus/files/tmp.txt', 'w');
?>
In the above example, the fopen function will check if the /home/tutsplus/files/tmp.txt file exists, and if it exists, it’ll open it for writing. By supplying 'w' in the second argument, we specify that we will be writing to the file. If the file doesn’t exist, it’ll be created right away. It’s important to note here that the /home/tutsplus/files/ directory in the above example must be writable by the web server user for the fopen function to be able to create a file.
The first argument of the fopen function is the filename which you want to open. In the above example, we’ve supplied the /home/tutsplus/files/tmp.txt filename in the first argument. Again, it’s important to note that we’ve supplied an absolute path name.
The second argument is the mode, which specifies the type of access you require to the opened file. The fopen function provides different modes you can choose from. For example:
  • use the r mode to open a file for reading
  • the r+ mode for both reading and writing
  • a mode for reading and appending
In our example, we’ve used the w mode, which opens the /home/tutsplus/files/tmp.txt file for writing only. Feel free to go through the official documentation to see different modes supported by the fopen function.
fopen returns a file system pointer, which is used for the other file functions like reading and writing.
The fopen function isn’t just for local files. It also supports other protocols and can open files from elsewhere on your network or the web. If you’ve enabled the allow_url_fopen directive in PHP, you could open remote files as well.
1
2
3
<?php
$file_handle = fopen('https://your-website-url/tmp.txt', 'r');
?>
It’s really important to note that when you enable the allow_url_fopen directive, you are creating some security risks, since it opens the door for remote file execution and other attacks. So make sure you take extra security measures in your application if you’re going to enable this directive.
There are a couple of different ways you can write to a file with PHP.
First and foremost is the fwrite function, which allows you to write string contents to the file stream referenced by the file handle. Let’s go through the following example to understand how it works.
1
2
3
4
5
6
7
<?php
$file_handle = fopen('/home/tutsplus/files/tmp.txt', 'a+');
fwrite($file_handle, 'Tuts+ is a great online resource to learn skills you want!');
fwrite($file_handle, "\n");
fwrite($file_handle, 'Visit tutsplus.com to know more!');
fclose($file_handle);
?>
First, we’ve opened the /home/tutsplus/files/tmp.txt file with the a+ mode, which opens it for reading and writing, with the file pointer placed at the end of the file. Thus, our content will be appended to the end of the file, after any other contents. Next, we’ve used the fwrite function to write a string. 
The first argument of the fwrite function is the file system pointer returned by fopen—this is how fwrite knows where to write into. And the second argument is a string which we want to write into a file. As you can see in the above example, you can use the fwrite function multiple times to write a series of strings before you close the file.
Finally, we’ve used the fclose function to close the file. It takes only one argument, the file pointer that you want to close. It’s always a good practice to close files by using the fclose function once you’ve finished with your file operations.
In the previous section, we discussed the fwrite function, which is used to write into a file. You would have noticed that, if you want to write into a file, you need to open it with the fopen function in the first place. After that, you need to use the fwrite function to write your data into a file, and finally you need to use the fclose function to close the file.
If that sounds too much to you, there’s a shortcut: file_put_contents. The file_put_contents function allows you to write data to a file in a single call.
Let’s see how it works.
1
2
3
<?php
file_put_contents('/home/tutsplus/files/tmp.txt', "Tuts+ is a great online resource to learn skills you want! \n Visit tutsplus.com to know more!");
?>
The first argument of the file_put_contents function is a filename, and the second argument is a string which you want to write into a file. If the file doesn’t exist, it’ll be created.
As you can see, the file_put_contents function is a shortcut when you just want to write a piece of data to a file.
Now you know how to create and write into a file. In this section, I’ll show you how to read from a file.
The fread function allows you to read from a file. It’s similar to fwrite, but you need to provide the length in bytes you want to read.
Let’s have a look at the following example to understand how it works.
1
2
3
4
5
<?php
$file_handle = fopen('/home/tutsplus/files/tmp.txt', 'r');
$contents = fread($file_handle, filesize('/home/tutsplus/files/tmp.txt'));
fclose($file_handle);
?>
As we want to read from the /home/tutsplus/files/tmp.txt file, we’ve opened it with the r mode. Next, we’ve used the fread function to read all the contents of the file into the $content variable.
The first argument of the fread function is the file system pointer, so that it knows where to read from. The second argument is the length in bytes you want to read from a file. In our case, we want to read all the contents of the /home/tutsplus/files/tmp.txt file, and thus we’ve used the filesize function to measure the size of the file.
In the previous section, we discussed the fread function, which allows you to read a file by specifying the length in bytes you want to read. If you want to read an entire file at once, there’s a function which allows you to do just that: file_get_contents.
Let’s see the file_get_contents function in action!
1
2
3
<?php
$contents = file_get_contents('/home/tutsplus/files/tmp.txt');
?>
As you can see, it’s pretty straightforward to use the file_get_contents function—just provide a filename in the first argument.
In this last section, we’ll see how you can delete files. To delete a file in PHP, use the unlink function. Let’s go through an example to see how it works.
1
2
3
4
5
6
7
<?php
If (unlink('/home/tutsplus/files/tmp.txt')) {
  // file was successfully deleted
} else {
  // there was a problem deleting the file
}
?>
The first argument of the unlink function is a filename which you want to delete. The unlink function returns either TRUE or FALSE, depending on whether the delete operation was successful.
In this post, we discussed the basics of file handling in PHP. Throughout the article, we discussed different operations you can perform by using file functions in PHP. If you have any queries or suggestions leave a comment below

from Tumblr https://generouspiratequeen.tumblr.com/post/622145150221729792

UX Website Audit: How UX Tests Can Make your Site Like a 5-Star Resort

UX Website Audit: How UX Tests Can Make your Site Like a 5-Star Resort:

You’ve just set foot in the five-star vacation resort where you’ll be spending the next week.
The lobby smells like fresh linens, the check-in desk is easy to find, and the lighting is warm. The comfort you feel upon entering the resort makes you trust your surroundings, and the beauty makes you want to indulge in a swim — or maybe even a visit to the all-inclusive spa.
The way you feel when you enter a five-star resort is similar to the way users should feel when they enter your website. And a UX website audit can help you determine if visitors are likely to get cozy and spend some time on your site or bounce to the next best thing.
On this page, we’ll give you a UX website audit checklist to help you ensure that users get the best possible experience on your site. We’ll also talk about some ways you can perform usability testing on your website!
To have access to more content just like this, don’t forget to sign up for Revenue Weekly, our email newsletter!
We’ve got a lot to cover, so keep reading for your UX website audit checklist!

What is UX and why is a UX website audit important?

As a website owner, it’s crucial to understand UX and why performing a UX website audit is vital to the success of your online presence.

What is UX?

UX is an abbreviation for user experience, which refers to the visit quality users have when they view your website.
UX is important to the success of your online presence for a few reasons:
  • A great UX keeps users on your site longer — encouraging them to read more of your content, learn more about your company, and purchase more of your products
  • Providing a fantastic UX keeps users from bouncing from your site and potentially finding your competitors’ websites
  • An aesthetically pleasing website can help increase credibility — 75% of opinions on website credibility come from website design
  • Increased credibility due to a great UX can help you sell more products
  • When you sell more products, you’ll likely see an uptick in positive word-of-mouth marketing over time
  • Positive user experiences can improve essential metrics that Google uses to determine how to rank your website in search engines

Why is a UX website audit important?

If you want to ensure that your online presence drives success for your business, a UX website audit can help.
When you perform a UX website audit, you can find the weak spots in your website design and create a game plan to improve them.
For example, a UX website audit could help expose page load issues or shed light on unsuccessful content formatting.
In the next section, we’ll provide you with a UX website audit checklist which can help you understand how to improve your site for both users and search engines.
We don’t just want to tell you about the beautiful work we do.

Your 7-point UX website audit checklist

1. Check the ambiance

The first thing you notice when you walk into a five-star resort is the effortless ambiance. Everything works together to create a memorable, unique experience — from the color palette to the location of the hotel restaurant.
Your website should follow the same rule of thumb — when users enter your website, their first impression should be a positive one.
The answers to these questions can help you determine if your website has a positive “ambiance”:
  • Is your color palette carried throughout your site?
  • Do your colors work together?
  • Is your font easy to read?
  • Does the style of your website match the style of your brand?
These high-level questions can help you understand where to start when it comes to website improvements. After all, 94% of first impressions come from web design.
UX website audit action item: Write down your honest, overall, first impression of your website and take note of things that you didn’t like. From there, you can come up with a game plan on how to fix them.

2. Organize your most important pages like a tidy, welcoming hotel lobby

Would you feel better walking into a hotel where there are luggage carts strewn about that lobby or one that had them nicely organized in the corner?
Luggage carts cluttering the lobby is comparable to cluttered landing pages and home pages. Whether most people enter your site through the homepage or click an ad that takes them to a landing page, it’s crucial that they’re clean and uncluttered.
Landing page definition: A landing page is where users end up when they click an ad for your products. Your home page is the “front cover” of your website.
If users land on your home page and it’s cluttered and unorganized, they could become overwhelmed and bounce from your site. The same goes for your landing pages.
And while we’re at it, we’ll also suggest that you keep your hallways and rooms clean and organized, too! Just like vacationers want a clean, tidy, and aesthetically pleasing room, site visitors want to see web pages with the same qualities.
That said, you should take the following steps to ensure that you have organized pages on your site:
  • Organize your content using headings and subheadings so that readers can easily scan through it
  • Include images and multimedia to break up your text, but don’t use too much, or you’ll end up with cluttered pages
  • Use white space to give adequate breathing room between elements on your page to keep visitors from becoming overwhelmed
UX website audit action item: Make sure that every page on your website is organized and easy to navigate.

3. Make sure your navigation bar is easy to locate, like the main desk

Nothing is more frustrating than walking into a hotel and being unable to find the check-in desk. Without a check-in attendant, you won’t be able to get the keys to your room, and you likely won’t know where to go.
You can think of a check-in desk at a five-star resort as your navigation bar on your website.
Here’s why a navigation bar is so important:
  • It helps users find what they want
  • It guides users throughout your site
  • It organizes your site’s content by categories
Ensuring that your navigation bar acts as a front desk for your website ensures that users can find what they’re looking for without becoming frustrated. Without one, users could bounce from your site.
UX website audit action item: Place your navigation bar at the top of your website and make sure that it’s not too cluttered.

4. Offer high-quality, speedy services

If you must wait for room service for more than a half-hour, you may be disappointed in your five-star resort. Unfortunately for websites, you have even less time to keep users happy — site visitors expect pages to load in two seconds or less, and if it doesn’t, they’ll likely bounce.
In addition to making sure your site pages load quickly, you’ll also want to make sure that you offer the best experience possible.
You can do this by:
  • Implementing high-quality graphics and videos
  • Writing and sharing informational, beneficial content
  • Creating a strong internal linking structure
  • Creating an organized navigation bar
  • Testing forms to make sure they work
  • Making sure calls to action (CTAs) take users to the right place
UX website audit action item: Run page speed tests to ensure that your site loads quickly and take note of low-quality graphics that you could replace and low-quality content that you could update or rewrite.

5. Make your signage clear

Signage leads visitors throughout your resort, and without it, it’ll be hard for them to find common locations like the restaurant, bar, pool, arcade, gift shop, or even bathrooms.
Signage of a five-star resort compares to actionable CTAs within your website.
Just like a sign by the pool might say “Come and splash your cares away!”, CTAs on your website encourage site visitors to take specific action as well.
You should have at least two to three CTAs on every page. They could be any of the following, but are certainly not limited to our list:
  • Click to see our pricing
  • Fill out this form for a free quote
  • Submit your email address for weekly email updates
  • Try our free tool
  • Read more content like this
  • Learn more about our pricing packages
These are just some of the ways you could encourage users to take the next step in the buyer journey.
UX website audit action item: Create a variety of custom CTAs that you can easily implement on a variety of pages. Think through the messaging to ensure that you encourage users to take the action that you want them to take.

6. Offer something that only you can

Offering something unique is what makes a five-star resort (and a website) memorable. Remember that infinity pool? Or that restaurant that offered unlimited sushi platters while you were fed grapes by the bunch?
Similar to how you’d remember all of your favorite parts about a resort, users remember their favorite things about a website.
The goal of creating a website is to establish an online storefront, provide a place for you to inform users with content, and to build your brand. Depending on your website’s purpose, you may adopt one or all three of these goals.
Regardless of what you want to accomplish with your website, one of the best ways to do it is by providing something unique.
Here are a few places on your website that offer you the opportunity to blow visitors away with unique elements:
  • Unique animations, infographics, and videos
  • Your blog
  • Your pricing modules
  • Your product pages
  • Free, proprietary tools
  • A new website design
  • Decorative fonts
  • “About Me/Us” page
There is no limit to how creative you can be with your website — and if you need help bringing your custom design to life, we suggest hiring a professional web design and development agency, like WebFX!
UX website audit action item: Take stock in your website and make sure that you offer at least one ultra-unique element. If not, make a list of potential updates that would make your website more unique.

7. Look at your numbers

Similar to the way that resorts use sales numbers to ensure that they’re on track, you should do the same with your website.
During a UX website audit, one of the most critical action items is to dig into the analytics of your site. You can use a tool like Google Analytics to help.
You’ll want to look at metrics like:
  • Organic traffic: Traffic that finds your website from search engines
  • Time on page: How long a user spends on a single page
  • Bounce rate: Percentage of site visitors who leave your site after only viewing one page
  • Dwell time: How long a user spends looking at a page after they’ve clicked the link in the SERPs
These numbers can give you a well-rounded idea of areas that might need some work on your site.
For example, if your organic traffic is down, it’s a sign that you most likely need to opt for search engine optimization (SEO) services. Still, your website could also benefit from a professional UX website audit.
On the other hand, if your bounce rate is exceptionally high, it should be a red flag to take a good look at your site pages to ensure you’re not overwhelming customers and providing them with the info they expect.
I

Usability testing for any website

Usability testing is one of the most critical parts of your UX website audit template since it can help reveal bottlenecks in your web design. When you opt for usability testing on your website, it means that real people will interact with your website, and you’ll get to watch.
There are a few different kinds of usability testing, and they’re usually paired like this:

Moderated vs. unmoderated

These kinds of usability testing refer to a test that is given by a trained researcher who guides the process. They answer user questions and ask follow-up questions.
Unmoderated UX testing is done independently without the input of a host.

Remote vs. in-person

Remote UX testing is done from someone’s home — either on their personal computers or over the phone.
On the other hand, in-person usability testing is completed next to a researcher or moderator so that they can physically see how participants interact with a website.

Explorative vs. comparative

Explorative user testing takes place when participants fully immerse themselves in a website. They can give opinions about the site and give feedback on concepts and specific design elements.
Comparative user experience tests ask participants to compare two different solutions on a website and choose which they like best. This test is typically put in place when you want to compare your solution to a competitor’s.
Each strategy has its benefits, depending on what you want to accomplish.
For example, if you’re looking for instant, real-time feedback on your website’s user experience, moderated usability testing is a great option.
If you’d like to get a full-length synopsis of what users think when exploring your site, explorative usability testing could be a great option.

from Tumblr https://generouspiratequeen.tumblr.com/post/622144803885416449