Connect with us

Publications

Man’s death after police shooting outside Wendy’s in Atlanta sparks investigation and protests

Published

on

Protestors gather on University Ave near a Wendy’s restaurant, Saturday, June 13, 2020 in Atlanta.

Steve Schaefer | Atlanta Journal-Constitution via AP

The death of a 27-year-old man who died following a police shooting Friday night in the parking lot of a Wendy’s restaurant in Atlanta has sparked an investigation and protests.

The shooting occurred just after 10:30 p.m. after Atlanta police were called for a report of a man asleep in the drive-thru, forcing customers to go around his vehicle, according to the Georgia Bureau of Investigation.

The GBI identified the man who died as Rayshard Brooks.

Officers responding to the Wendy’s administered a field sobriety test to Brooks, which the GBI says he failed. During an attempted arrest, he resisted and a struggle ensued, the agency said.

“The officer deployed a Taser. Witnesses report that during the struggle the male subject grabbed and was in possession of the Taser,” according to the GBI’s press release. “It has also been reported that the male subject was shot by an officer in the struggle over the Taser.”

Brooks was taken to the hospital where he died after undergoing surgery. An officer was also injured in the incident and released from the hospital, the release states.

Two officers who were involved in the shooting have been removed from duty pending the outcome of the investigation, according to NBC affiliate WXIA in Atlanta. Their names have not been released.

The Atlanta Police Department could not immediately be reached by NBC News.

The GBI said Saturday that it had no further comment, and was aware of video posted on social media that captured the incident.

Fulton County District Attorney Paul L. Howard Jr. said in a statement Saturday that the GBI will turn over its findings to his department, but that his office has already launched its own “intense, independent investigation of the matter.”

“Lastly, our thoughts and our sympathies are extended to the family of Rayshard Brooks as we must not forget that this investigation is centered upon a loss of life.”

In cellphone video posted on social media by people who said they were at the scene, Brooks appears to be on the ground struggling with two officers before getting up and running away.

One of the officers appears to use a stun gun while running after Brooks. Moments later, gunshots can be heard.

A crowd of people gathered at the scene to peacefully protest the shooting on Saturday. The Georgia NAACP called for Mayor Keisha Lance Bottoms to relieve Police Chief Erika Shields of duty.

“The body cam footage and all surveillance video from surrounding buildings need to be released immediately,” the organization  Saturday. “@Atlanta_Police has had a culture of excessive use of force. Now #RayshardBrooks is dead. We demand immediate accountability.”

This is the 48th officer-involved shooting in 2020 that the GBI has been asked to investigate, the agency told NBC News.

Source: https://www.cnbc.com/2020/06/13/mans-death-after-police-shooting-outside-wendys-in-atlanta-sparks-investigation-and-protests.html

Publications

How To Use Decorators and Mixins in Salesforce Lightning Web Components

Published

on

It’s safe to say that every modern web application these days relies to some degree on three foundational web standards: HTML, CSS, and JavaScript. While HTML has largely stabilized since the HTML5 standard, both CSS and JavaScript continue to evolve to meet developers’ and users’ needs.

The evolving nature of these three technologies has lead to the introduction of web components, a cross-browser solution for building complex web apps. On top of this open source standard, Salesforce developed Lightning Web Components (LWC) as a fast, enterprise-grade wrapper around vanilla web components. The result is a thin, performant, and feature-packed framework built entirely on the open web.

LWC is not only built on top of the ECMAScript standard, it also provides some nifty syntactic sugar that can transpile into standard JavaScript. Because of this, the LWC framework is able to incorporate proposed language features, which simplifies app development by future proofing your code in the always evolving JavaScript ecosystem. In this post, we’ll take a closer look at two relatively recent features—mixins and decorators—and see how they can be used in your LWC apps.

What is a Mixin?

In many object-oriented programming languages, classes can “receive” additional methods through a feature called inheritance. For example, if you have a

Vehicle

class with the methods

go

and

stop

, subclasses like

Bicycle

and

Car

can implement them directly:

class Vehicle { void go(); void stop();
} class Bicycle < Vehicle { void go() { usePedal(); } void stop() { stopPedal(); }
} class Car < Vehicle { void go() { useEngine(); } void stop() { stopEngine(); }
}

Inheritance affects the composition of an object by changing its hierarchy. Every

Bicycle

and

Car

is now also a

Vehicle

. But what if you merely wanted to add in common methods to objects without dealing with any parent class? That’s what a mixin does.

In a JavaScript context, mixins can add behaviors to JavaScript classes, which is useful, because classes can only extend from one other class, while multiple mixins can be added to a class. Mixins take advantage of the

Object.assign

method, which copies all of the properties from one object onto another:

// mixin
let greetingsMixin = { sayHi() { alert(`Hello ${this.name}`); }, sayBye() { alert(`Bye ${this.name}`); }
}; class User { constructor(name) { this.name = name; }
} // copy the methods
Object.assign(User.prototype, greetingsMixin);
User

can now call

sayHi

and

sayBye

natively. Per JavaScript rules,

User

can also inherit from just one class, while including properties and function) from any number of mixins:

class User extends Person { // ...
} Object.assign(User.prototype, greetingsMixin);
Object.assign(User.prototype, someOtherMixin);

However, writing out

Object.assign

is somewhat akin to littering your code. What’s worse is figuring out what the method is doing isn’t very intuitive. Through some native JavaScript syntax, you can actually create a “subclass factory” with mixins, and declare which mixins you’re using right at the top:

class User extends greetingsMixin(Person) { // ...
}

(For more information on this technique, check out this article.)

Now,

User

includes the

greetingsMixin

and inherits from the

Person

class, all in one line.

This technique is more than syntactical sugar: it’s actually the one which LWC regularly prefers. For example, the

Navigation Mixin

provides methods that are useful to navigational UI elements, but ultimately, each class that includes it should also derive from a plain

LightningElement

:

import { LightningElement } from 'lwc';
import { NavigationMixin } from 'lightning/navigation'; export default class TestComponent extends NavigationMixin(LightningElement) { // ...
}
NavigationMixin

provides functionality that’s crucial to components dealing with navigating through pages, while

LightningElement

provides all the base functionality for every component. Thus,

TestComponent

will need to include

NavigationMixin

and subclass from

LightningElement

, and can do so in the easy-to-see, single-line format.

What is a Decorator?

Decorators are currently a proposal to add to JavaScript, but they’re so incredibly useful that many frameworks already support them. In essence, a decorator is a function that can modify a class, or any of its properties and methods. That’s a pretty high-level definition, so let’s take a look at what that means in practice.

Suppose we have a class like this:

class User { constructor(firstName, lastName) { this.firstName = firstName; this.lastName = lastName; } getFullName() { return `${this.firstName} ${this.lastName}`; }
}

Now, any code which makes use of this class can create a user:

let user = new User("Jane", "Eyre");
user.getFullName(); // returns "Jane Eyre"

But because of the way JavaScript is designed, a developer could inadvertently change the

getFullName

method if they so desired:

let user = new User("Jane", "Eyre");
user.prototype.getFullName = function() { return "not the name!;"
}
user.getFullName(); // returns "not the name!"

Now, this is obviously a trite example, but the danger still remains. You can write code to make a class property read-only, like this:

Object.defineProperty(User.prototype, 'gettFullName', { writable: false
});

This works, but it’s obviously cumbersome to write for multiple properties.

Enter decorators. You can define a decorator function to apply any behavior you want to a target property. For example, to set a target as

writable: false

, you could do this:

function readonly(target) { target.descriptor.writable = false; return target;
}

We just defined a decorator called

readonly

which, when passed a target, sets its

descriptor.writable

property to

false

. This can be applied to our

User

class like this:

class User { // ... @readonly getFullName() { return `${this.firstName} ${this.lastName}`; }
}

Voila! The same functionality, in a single line of code.

LWC provides several decorators for developers to use. They are:

  • @api

    : by default, every property is hidden and private.

    @api

    exposes it publicly.

  • @track

    : this marks a property as reactive, which means that when its value changes, the web component will re-render and display the new value.

  • @wire

    : this is a decorator which signifies that we want to read Salesforce data.

These three decorators, which are unique to LWC, aim to help reduce rewriting the same code while easily providing common functionality.

Conclusion

Since LWC is built on web standards, it can leverage native APIs and languages in order to make developers immediately productive, since they’re using existing skills rather than learning proprietary techniques.

If you’d like to take a closer look at Lightning Web Components, Salesforce has a boilerplate app that’s built in TypeScript. There’s also a Trailhead lesson to help you learn about web components in less than an hour. Or, feel free to check out the LWC dev docs for more specific reference information.

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.

Coinsmart. Beste Bitcoin-Börse in Europa
Source: https://hackernoon.com/how-to-use-decorators-and-mixins-in-salesforce-lightning-web-components-8m1l351q?source=rss

Continue Reading

Publications

NAB’s API: The Big Reveal

Published

on

image

Scott Middleton Hacker Noon profile picture

@scottmiddletonScott Middleton

Scott is the CEO and founder of Terem, Australia’s leading tech product development firm.

We’re working on a more detailed follow up to the high-level research we did into APIs and the ASX100. As part of the follow-up, I’m looking into the APIs offered by ASX100 companies and, for no scientific reason, chose to start with an analysis of NAB’s developer portal.

This post isn’t a strict analysis, rather it’s a sharing of thoughts as I step through NAB’s API with a longer view of gaining a better understanding of API best practices in the wild. 

Overall, NAB’s API is surprisingly good for a bank. Easy to follow, easy to get started.

First Impressions and Portal Home Page 

First impressions of NAB’s API are promising. 

Language is one of being product-led – “register, experiment, go-live” and “open beta”. There is even a hackathon tab.The registration link and documentation links are prominent and easy to navigate. You get the feeling that starting to use it will be straightforward.I get the sense that this is a modern API designed for developers. Actually a little surprised/impressed and excited to play around with it.

Registration

The registration process for NAB had a simple form that only required the most essential fields. It didn’t even ask for an organisation or phone number (quietly impressed). 

image

The process overall was:

Simple registration form (5 fields) – the name fields could be combined but that’s nitpicking

Verify my email addressLogin

The whole process took under 5 minutes. 

Getting Started

As soon as I logged in I could easily see where to get started. I clicked Getting Started and found my Sandbox API Key. You might wonder why this is worth noting, it’s because many APIs, especially those offered by enterprises and enterprise software providers are bizarrely not this straight forward.

I was able to query NAB locations (i.e. where there is an ATM) within 2 minutes in postman, but I wasn’t easily able to start querying anything that required authentication in postman. When I put my x-nab-key in, I got back “400 Invalid Request” and when I tried the sandbox OAuth flow, I had some errors come back. I could see how to resolve this by writing actual code.

image

API Documentation

The API endpoint documentation is broken up in an understandable way. It breaks up the API into some high-level, logical areas like Locations, FX and Accounts. It then uses verbs for the titles of the API endpoints themselves (e.g. “Get List of Accounts”) making it easy to see what I can do and what is relevant for me.

Verbs – like “Get” or “Delete” – are generally the actions or tasks that a developer is trying to do. So using language like this matches what they need.

Sample code is provided in multiple languages/technologies: json, curl, java. 

image

There wasn’t a way to test the endpoints inline. 

API Design

URL Standard

The NAB API follows the RESTful standard closely. Using the HTTP verbs to describe the action being taken – GET – and the URL to describe the resource the action is being applied to – e.g. GET …/accounts/

This makes the APIs easy to follow.

Other APIs sometimes include the verb in the URL itself or don’t follow any standard. The NAB API is a good example of a restful API in the wild.

Variable/Parameters Names

The NAB API’s parameter and variable names were mostly easy to follow and understand. They were usually full names that described themselves. 

There were some exceptions to this like the “apca” attribute on the Get List of Accounts endpoint. It’s unclear what this variable is.

There were some redundant descriptions – e.g. the attribute accountToken has a description of “Account Token” adding no additional information or insight into what this attribute is, what it’s used for or how it’s formed.

Versioning

There is a bit of confusion on the NAB API endpoints with versioning. The version is listed in both the URL and at the end in the query parameters. On the Get List of Accounts endpoint, the endpoint seems to be both version 2 and version 1 at the same time. The variables need different names or the version in the query parameters needs to be removed (what is its purpose?).

Going Live to Production

I didn’t go down the path of getting production access due to time constraints on my part. 

Product Strategy

After walking through the API I stepped back, sipped my coffee and contemplated the API more broadly through the lens of the API as a digital product. Some thoughts:

  1. The API appears to be the same API they are using internally for their own digital experience. This is exactly what you want as a company and a third-party developer.
  2. The API appears to be useful to startups and more established partners making it more likely to be available in the long run. On the home page, some startups are shown but the functionality appears useful by an enterprise looking to incorporate NAB data into their digital product.

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.

Coinsmart. Beste Bitcoin-Börse in Europa
Source: https://hackernoon.com/nabs-api-the-big-reveal-tg1935mb?source=rss

Continue Reading

Publications

An Easy README Makeover In 3 Simple Steps

Published

on

image

Oh yeah! We’re giving your README a makeover!

The README will be one of the first things someone sees when they view your project. Think of it as the subject line to your email, or the elevator pitch to your presentation. The README is the opportunity to get someone interested in your open source project, or to convince them that you’re an awesome developer or simply to show off the cool project you’ve been working on in your spare time.

Yet, sometimes the README is forgotten. I get it, the code just needs to work sometimes. But, I highly encourage you to take a look at your project’s READMEs and iterate on them.

Here are 3 areas to focus on when updating or creating your project READMEs.

Describe Your Project

I know, this probably sounds obvious, but you would be surprised. Dig deep enough into my Github profile and you’ll find a few repos with the default, outdated content, or—gasp—no READMEs at all. Writing about your work is a whole, big topic I’ll go into detail on another time. But, for your README, it can be straightforward.

Some questions to ask yourself when writing your project description include:

  • What technologies does this project use?
  • How can someone else use it?
  • Why was it created? Or, what problem does it solve?
  • Is this repo part of a bigger project or does it exist on its own?

Overall, a few lines explaining what your project is, what you used to build, and why, may be all you need to include. Think of the description as a concise, one-paragraph summary to your project to entice someone to know more.

Installation Instructions

Raise your hand if you’ve come across a README that had vague installation instructions!

To help save someone else from experiencing this, with my projects, I like to take a literal step by step approach to getting it up and running locally. I’ll start by doing a fresh clone of my repo on my Desktop or anywhere other than where I usually work on the project locally.

Then, write down exactly the next step is to getting it up and running. Include if there are any packages to include or API keys to fill in or if a certain command needs to be run in a specific directory. I like including the exact terminal commands in tick marks, for example 

git clone https://github.com/scrabill/cactus-buddy,

for easy copy and pasting from the README.

Link To a Live Version

This may not apply to all projects, but it’s something to think about. If the goal of creating personal projects is to have something to show potential employers, you cannot always expect someone to be able to—or have the time to—clone it to their machine, get it up and running and then navigate the codebase.

In my bootcamp experience, a stretch task was to have the portfolio project built deployed online so that they can be used/viewed in the browser. Not only does this make a project easier to look at, experience, evaluate by others, but it also shows additional skills at being able to use cloud applications like Netlify, Heroku or Amazon Web Services.

Summary

If you can, I encourage you to take a critical eye at your own READMEs and do an audit. Put yourself in the shoes of someone who is coming across your project for the first time, with no context on what it’s about.

Some things to think about:

  • Does your README accurately explain what your project is?
  • What about how you built it?
  • If the project is open to contributions, does the README clearly state that?
  • Are the installation instructions missing any gaps or not work as expected?

Consider getting a friend, technical or non-technical, to take a look at your README and offer their initial thoughts. Other developers will likely be seeing your project, but so may potential hiring managers and recruiters. They may only have a few seconds to look at your project’s README to evaluate if you have the technical and communication skills they are looking for in an individual contributor.

What updates will you make to your README today?

Previously published at https://shannoncrabill.com/blog/improve-your-project-readme/

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.

Coinsmart. Beste Bitcoin-Börse in Europa
Source: https://hackernoon.com/an-easy-readme-makeover-in-3-simple-steps-xv1335bm?source=rss

Continue Reading

CNBC

Tide is making the first laundry detergent for space

Published

on

Astronauts don’t have the luxury of tossing clothes in the hamper after a single use — without laundry equipment, they’re often left wearing items multiple times. Tide thinks it can come to the rescue, though. The Procter & Gamble brand has teamed with NASA to develop the first laundry detergent meant for space. The fully degradable detergent should take care of stains and odors while working properly in a closed-loop water system like the one you’d find aboard the International Space Station.

It won’t take long before you see a rea world (or rather, real off-world) trial run. NASA will test Tide’s detergent aboard the ISS in 2022. “Mission PGTide,” as it’s called, will gauge ingredient stability in space as well as the effectiveness of the stain removal ingredients using Tide’s pens and wipes.

Other studies will explore the possibility of a washer-dryer combo that could be use for long-term Moon and Mars missions.

The advantages for space are fairly self-evident. Those lunar and martian explorers won’t have any choice but to clean their clothes — this detergent could make that possible without subtracting from their precious water supply. It could also save weight and space aboard both the ISS and cargo capsules, as NASA wouldn’t need to send so many clothes into orbit.

 This could also be helpful for laundry back on Earth, for that matter. A fully degradable detergent would be more environmentally friendly, reducing waste and conserving water. Don’t be surprised if you eventually buy detergent that’s kind to the planet precisely because it’s designed to be used off-planet.

All products recommended by Engadget are selected by our editorial team, independent of our parent company. Some of our stories include affiliate links. If you buy something through one of these links, we may earn an affiliate commission.

Coinsmart. Beste Bitcoin-Börse in Europa
Source: https://www.engadget.com/tide-laundry-detergent-for-space-151235606.html?src=rss_b2c

Continue Reading
Esports3 days ago

Select Smart Genshin Impact: How to Make the Personality Quiz Work

Blockchain3 days ago

Bitmain Released New Mining Machines For DOGE And LTC

Esports5 days ago

How to complete Path to Glory Update SBC in FIFA 21 Ultimate Team

Blockchain4 days ago

Digital Renminbi and Cash Exchange Service ATMs Launch in Beijing

Aviation4 days ago

Southwest celebrates 50 Years with a new “Freedom One” logo jet on N500WR

Start Ups4 days ago

Zenefits Payroll Glitch Results In Delayed Paychecks For Small-Business Employees

Blockchain4 days ago

Bitcoin isn’t as Anonymous as People Think it is: Cornell Economist

Blockchain5 days ago

Blockchain Intelligence Firm TRM Labs Secures $14 Million in Funding

Aviation4 days ago

Delta Air Lines Drops Cape Town With Nonstop Johannesburg A350 Flights

AR/VR5 days ago

Larcenauts Review-In-Progress: A Rich VR Shooter With Room To Improve

Blockchain4 days ago

Index Publisher MSCI Considers Launching Crypto Indexes

Esports4 days ago

All Characters, Skills, and Abilities in Naraka: Bladepoint

Energy1 day ago

Inna Braverman, Founder and CEO of Eco Wave Power Will be Speaking at the 2021 Qatar Economic Forum, Powered by Bloomberg

Blockchain4 days ago

Paraguay Follows El Salvador In Tabling Bitcoin Bill, The Crypto Revolution Is Happening

Blockchain4 days ago

Paraguayan Official Confirms: In July We Legislate Bitcoin

Blockchain4 days ago

U.K’s crypto-users are growing in number, but do they even understand the asset class?

Aviation4 days ago

Breaking: British Airways 787 Suffers Nose Gear Collapse

Esports4 days ago

TFT Reckoning 11.13 patch preview highlights Nidalee, Kayle, and Trundle rework

Blockchain4 days ago

Spanish Banking Giant BBVA to Launch Bitcoin Trading and Custodial Services in Switzerland

Start Ups4 days ago

Clair Labs Targets $9M Seed On Contactless Patient Monitoring

Trending