Moving Text on a Curved Path

There was a fun article in The New York Times the other day describing the fancy way Elizabeth Warren and her staff let people take a selfie with Warren. But... the pictures aren't actually selfies because they are taken by someone else. The article has his hilarious line of text that wiggles by on a curved line as you scroll down the page.

Let's look at how they did it.

Movie:

The curved line is drawn in SVG as a <path>, and the <text> is set upon it by a <textPath>:

<svg width="100%" height="160px" viewBox="0 0 1098.72 89.55">
    <path id="curve" fill="transparent" d="M0.17,0.23c0,0,105.85,77.7,276.46,73.2s243.8-61.37,408.77-54.05c172.09,7.64,213.4,92.34,413.28,64.19"></path>
    <text width="100%" style="transform:translate3d(0,0,0);">
        <textPath style="transform:translate3d(0,0,0);" alignment-baseline="top" xlink:href="#curve">*The pictures are not technically selfies.</textPath>
    </text>
</svg>

The movement trick happens by adjusting the startOffset attribute of the textPath element.

I'm not 100% sure how they did it, but we can do some quick hacky math by watching the scroll position of the page and setting that attribute in a way that makes it move about as fast and far as we want.

const textPath = document.querySelector("#text-path");

const h = document.documentElement, 
      b = document.body,
      st = 'scrollTop',
      sh = 'scrollHeight';

document.addEventListener("scroll", e => {
  let percent = (h[st]||b[st]) / ((h[sh]||b[sh]) - h.clientHeight) * 100;
  textPath.setAttribute("startOffset", (-percent * 40) + 1200)
});

Here's a demo:

See the Pen
Selfie Crawl
by Chris Coyier (@chriscoyier)
on CodePen.

Text on a curved line is a cool design look for any number of reasons! It just isn't seen that much on the web, so when it is used, it stands out.

See the Pen
CodePen Challenge: Hearthstone Card
by wheatup (@wheatup)
on CodePen.

The post Moving Text on a Curved Path appeared first on CSS-Tricks.

Hibernate Mapping One-to-Many Using Annotations

In this example, you will learn how to map one-to-many relationship using Hibernate Annotations. Consider the following relationship between Student and Phone entity.

According to the relationship, a student can have any number of phone numbers.

How I Created a WhatsApp Bot to Talk With My Friends

Here is the full code if you want to jump right to it.

Why?

The title seems kinda rude and lazy, right? But if you think about the situation I am in, then you’ll understand. Here in India, it’s important to be socially active. If you don’t reply or send a few “good morning” messages in a few groups, people would think you are actually dead or taunt you for being busy and not spending time with them.

Work With RingCentral APIs

If you are using RingCentral products, you can simply integrate RingCentral products with your ideas through RingCentral APIs.

Create a RingCentral APP

In the first place, you need to register a developer account and create a RingCentral APP.

Simplified Time-Series Analytics Using the time_bucket() Function

If you are working with time-series data, you need a way to be able to easily manipulate, query, and visualize that data. Often times, time-series databases contain a number of time-oriented functions that aren't found in traditional databases.

These functions are meant to provide two key benefits: improved ease of use for time-series analytics, and improved performance. In this case, I'm going to demonstrate with two TimescaleDB functions time_bucket()and time_bucket_gapfill()

Want Better Collaboration at Work? You’d Better Tackle That Trust Problem First

The magic happens when good people come together for a common cause. Well, it does as long as there's a healthy dose of trust in place.

Improving or enhancing collaborative working is often one of the main reasons for choosing to implement online communication channels, such as Slack or Asana, but all too often, companies fail to get virtual teams and collaborative ways of working off the ground.

But why? There must be a reason why it is difficult to encourage virtual teams when you provide all the tools to facilitate it.

Trust and Openness Are Key to Innovation

Would you trust your team members in this scenario? Well, metaphorically speaking, you'd better if you want to be innovative.

Innovation thrives on openness. While it’s common to think that innovation largely consists of revolutionary breakthroughs, in reality, it is much more common for it to be a slow and iterative process of gradual improvements and remixing of existing technologies in new and novel ways. 

You may also like:  How to Shift Your Internal Culture Towards Innovation

As such, being open with your own insights, and others doing likewise, is crucial to the innovation process.

Five Ways Technology Is Revolutionizing Risk Management

In the realm of cybersecurity, risk management refers to the process in which organizations identify, analyze, and address various types of cyber risks that they may face in case their IT systems fail as a result of internal and external threats. These risks include the possibility of losing sensitive, private corporate data, experiencing disruptions in their day-to-day business operations, suffering reputational damages, and more.

Cyber risk management enables security teams to spot, measure, and evaluate vulnerabilities in their IT environment. Its connected systems and applications allow users to implement strategic ways to fix potential issues, thereby allowing organizations to avoid or reduce the impact of potential cyber risks. Unfortunately, many organizations find it difficult to implement cyber risk management effectively.

Comparing Postgres JSONB With NoSQL

The reality is that databases are converging, and in the last few years, it is becoming even more difficult to point out what are the best scenarios for each datastore without a deep understanding of how things work under the hood.

Postgres has been my favorite RDBMS for years, and I’m thrilled with the increasing popularity of its JSONB support. In my personal opinion, it will help developers to be more familiar with all the advantages of storing data as JSON instead of plain old tables.

Building a Recommendation System Using Deep Learning Models

In this article, I am going to explain how we integrate some deep learning models, in order to make an outfit recommendation system. We want to build an outfit recommendation system. We used four deep learning models to get some important characteristics of the clothing used by the user.

The recommendation systems can be classified into 4 groups:

Apache Flume and Data Pipelines

What Is Apache Flume?

Apache Flume is an efficient, distributed, reliable, and fault-tolerant data-ingestion tool. It facilitates the streaming of huge volumes of log files from various sources (like web servers) into the Hadoop Distributed File System (HDFS), distributed databases, such as HBase on HDFS, or even destinations like Elasticsearch at near-real time speeds. In addition to streaming log data, Flume can also stream event data generated from web sources like Twitter, Facebook, and Kafka Brokers.

The History of Apache Flume

Apache Flume was developed by Cloudera to provide a way to quickly and reliably stream large volumes of log files generated by web servers into Hadoop. There, applications can perform further analysis on data in a distributed environment. Initially, Apache Flume was developed to handle only log data. Later, it was equipped to handle event data as well.

BuddyPress 5.0 to Add Category for Storing BuddyPress Blocks

BuddyPress 5.0 will include a way for developers to organize their blocks under a BuddyPress blocks category. Mathieu Viet shared a code example on the BuddyPress Dev Updates blog, demonstrating how to set the category property of a block to BuddyPress when registering a block type. The blocks registered with this category will appear under the BuddyPress panel in the block inserter.

As the block ecosystem expands, keeping things organized inside the block inserter is becoming more important. BuddyPress having its own designated category helps user find blocks faster, especially if they don’t know the exact block name to search for, or if they are just browsing to see what blocks are available. With the BP REST API set to land in the 5.0 release, blocks will be easier for BuddyPress developers to create.

BuddyPress 5.0.0-beta1 is expected to be released around August 15. Subsequent release dates are yet to be confirmed following feedback on the beta.

What Happened to Hadoop? What Should You Do Now?

Apache Hadoop emerged on the IT scene in 2006 with the promise to provide organizations with the capability to store an unprecedented volume of data using commodity hardware. This promise not only addressed the size of the data sets, but also the type of data, such as data generated by IoT devices, sensors, servers, and social media that businesses were increasingly interested in analyzing. The combination of data volume, velocity, and variety was popularly known as Big Data.

Schema-on-read played a vital role in the popularity of Hadoop. Businesses thought they no longer had to worry about the tedious process of defining which tables contained what data and how are they connected to each other — a process that took months and not a single data warehouse query could be executed before it was complete. In this brave new world, businesses could store as much data as they could get their hands on in Hadoop-based repositories known as data lakes and worry about how it is going to be analyzed later.

Apache Spark: Resilient Distributed Datasets

RDDs represent both the idea of how a large dataset is represented in Apache Spark and the abstraction for working with it. This section will cover the former, and the following sections will cover the latter. According to the seminal paper on Spark, "RDDs are immutable, fault-tolerant, parallel data structures that let users explicitly persist intermediate results in memory, control their partitioning to optimize data placement, and manipulate them using a rich set of operators." Let’s dissect this description to truly understand the ideas behind the RDD concept.

Immutable

 RDDs are designed to be immutable, which means you can’t specifically modify a particular row in the dataset represented by that RDD. You can call one of the available RDD operations to manipulate the rows in the RDD into the way you want, but that operation will return a new RDD. The basic RDD will stay unchanged, and the new RDD will contain the data in the way that you altered it. The immutability requires an RDD to carry its lineage information that Spark leverages to efficiently provide fault tolerance capabilities.

Steps to Create, Test, and Deploy an Ethereum Smart Contract

Ever since Ethereum was introduced in 2015 by Canadian-Russian programmer, Vitalik Buterin, it has brought forth new decentralized applications (dApps). However, Ethereum’s success is significantly attributed to the implementation of smart contracts.

Many people believe that smart contracts are a new concept and have been invented with the Ethereum Blockchain Platform. However, they date back to 1996 when computer scientist, Nick Szabo, coined the term and defined them as:

AppSec Concerns

To understand the current and future state of application security, we obtained insights from five IT executives. We asked them, “Do you have any concerns regarding the current state of application security?” Here’s what they told us: 

  • Terminology is a concern, where different tools simply claim to be things that they are not and lead to a false sense of integration. For example, WAF vendors are a network tier: security in the front, application in the back. While they may claim visibility into the runtime, they do not actually achieve this and therefore cannot achieve accuracy.
  • Culture. Security has grown up with pen testing and modern tools, the software has grown with cloud and scale. We need to automate security. We need security to embrace automation.
  • 1) Internal threats (nothing new), 2) Machine Identity (due to Internet of Things/containers), 3) Security Vulnerability Administration and Patching strategy (due to more software and microservices, so more runtimes), 4) The risk of a hacker jumping from a low-risk component to a higher-risk component (due to microservices and containers, with bulkhead pattern being an example to safeguard against that).
  • We commonly see application security is only applied to a certain portion of a network, but a truly secure approach applies end-to-end. Our solution secures an application throughout a packet’s journey from source to destination.
  • AppSec is not getting better. Vulnerabilities are not being fixed fast enough. Every code fix has to go back and be tested for vulnerabilities, quality, and performance. Then, the entire application level needs to be tested. It takes a lot of time. There is a lack of understanding of how much testing is necessary, when to use tools instead of services, and how necessary vulnerability remediation is. DevOps is the right approach to develop applications, but today, it results in paying less attention to security. Adopt a security-first mindset.

Here’s who shared their insights: