fabiochiu/medium-articles huggingface dataset:
$500 Billion 🚗
Tags: Tesla, Business, Electric Car, Elon Musk, Stock Market

Tesla stock has been on a wild ride over the past few years. After being the first publicly traded car company to reach a $100 billion valuation and its recent introduction to the S&P 500 scheduled for December 21st, it’s crazy to think what could be next for the company. On Tuesday, the company passed a major milestone with Tesla’s market capitalization breaching $500 billion for the first time ever.

This news has taken Bill Gates out of the number 2 spot of richest people in the world and cements Elon Musk as being one of the most powerful billionaires on planet earth. Compared to a year ago, Tesla shares are up over 730% and they are up over 550% year to date.

Back in October, Tesla broke another company record. It was the fifth consecutive profitable quarter for the company with revenues coming in at a monster $8.77 billion. Simultaneously, Tesla had delivered 139,300 vehicles in the quarter which was also a new record for the carmaker.

At this point, the question is this: “How much more is there to go for Tesla?” “Do you believe it’s valuation could hit $1 trillion?” As it keeps smashing through previous records, along with a brilliant leader like Elon Musk- the sky could be the limit for this company over the long term.

Keep in mind, many other carmakers are pushing towards electric as well so there will be some serious competition on the horizon.

I am not a financial advisor and my comments should never be taken as financial advice. Investments come with risk, so always do your research and analysis beforehand.
We have owned an EV for 5 years.
By: Nicholas Flann
Tags: Electric Car

We have owned an EV for 5 years. We love the convenience of NOT having to go to a gas station. Every morning our car has a full tank. The only time we use charging stations is on long trips.

As others have said, EVs require a new way of thinking. Having gas stations turn into charging stations is unnecessary.
Electric cars: the road to a greener future?
Tags: Electric Cars, Transport, Viewnews

The Prime Minister has confirmed plans to ban the sale of new petrol and diesel cars by 2030.

Boris Johnson’s scheme is part of the Government’s “green industrial revolution” to tackle climate change — but figures show that only 30% of drivers will be ready by then.

With the ban on petrol and diesel cars impending, it is clear drivers will need to make the switch to an electric vehicle in the future.

Demand for electric vehicles has increased in the last four years; in 2020 they account for over 10% of new registrations — an increase of 7% since 2016, according to Statista.

Data from Statista.com

However, these figures illustrate that demand for electric cars is not high enough if new petrol and diesel engines are set to be banned in just 10 years.

An increase of 7% over four years shows that if demand continues to grow in the same pattern, by 2030 approximately only 30% of passenger car registrations in the UK will be electric.

BEVs (Battery Electric Vehicles) only account for 1.6% of the market, but hybrid electric vehicles are currently more popular, making up 4.2% of the market share.

A hybrid vehicle combines an electric motor with a petrol or diesel engine, but they too are set to be phased out by 2035.

The plan to ban petrol and diesel engines comes after transport accounted for a third of all UK greenhouse gas emissions in 2018.

With no emissions out of an exhaust, electric cars greatly reduce pollution in cities and over their lifecycle will produce 20% less emissions than the average petrol car.
Let’s Kill The Car!
Tags: Electric Car, Green Energy, Branding, Brand Strategy, Positioning

(Almost weekly) tongue in cheek take on business, tech and brand. #robertsrants

by Robert Leinders-Krog

2025. The year Norway will ban sales of any combustion vehicles in the country. 2030. The same applies to the United Kingdom. And of course, the car industry is up in arms because they have not figured out the technology yet to make this actually work in a sustainable and not the least, profitable, way. They have shot themselves in the foot by making cars that live A LOT longer now than only a few decades ago.

Clearly, in this scenario, Tesla is miles ahead, and at todays valuation, a few hundred billion dollars ahead of anyone else.

But none of this really matters.

Industries change, innovation will demand some sacrifices and some players are bound to loose the fight for position and customer decision. And let’s not forget that the electric car is not all green flowers and lush meadows of clean fresh air.

The real question is how we can manage city and suburban life without the car. Urbanization comes in all shapes and forms, and our cities are growing by the minute. We have to cover larger distances to and from work (if we ever go back there that is), we are more dependent on making our schedule work, and somehow, the car makes a lot of this happen. Not entirely like this little weird commercial homage on the car in Norway is trying to portray: https://vimeo.com/479581503

Nevertheless politicians and car brands are fighting about access to bus lanes, taxies and cars that are / will be banned from city traffic. Politicians believe life without cars is better for everyone, and car brands, well, obviously disagree.

What is lacking in these conversations is a holistic approach to changing our habits, fostering and scaling technology that makes it easier to chose differently, and embrace different types of mobility in different times of the day, the week or the year.

Fumbling in the darkness of politics and commercial players.

We will be fumbling around for decades if different countries create different rules, allow or prohibit different technologies, demand a different set of rules for users, carmakers, mobility suppliers and cities.

We need to create International standards, work together with the Lyfts, the Ubers, the Tiers and the Volkswagens of this world and create best practices that can be adopted, copied and embraced.

Only then, we can change the narrative, and move towards sustainable and practical solutions that can be embraced by the general public, developed and perfected.

And maybe, just maybe, for the ones that want to, we can take our old and cherished (and loud and stinky) icons out for a pleasure drive every third Sunday of every month.

See ya out there. Maybe. Once every month or so.

Disclaimer: I love anything on wheels. From electric bikes and cars to motorcycles and cars that were made 50 years ago. I just miss a good constructive dialogue.
The Electric Vehicle Scene in India
By: Arghyadeep Das
Tags: Ecofriendlyproductsindia, Covid 19 Crisis, Electric Vehicles, Electric Car, Environmental Issues

Covid 19 pandemic has taught us how fragile our ecological balance is and any attempt to disrupt this would be deadly for the entire humankind. Consequently, the leaders around the world have raised voice for a Greener Planet and have encouraged the use of Green Technology.

My country, India, like many others has started to shift from Petrol/ Diesel vehicles to EVs or Electric Vehicles. They provide a pollution-free solution to the existing problem that India faces. We have set ourselves goals to become all-electric vehicle nation by 2030.

Thus, there is a big scope in the Electric Vehicles market and our entrepreneurs and engineers have accepted the invitation with open hands.

Jezza Motors is one such example.

Having setup in 2014 as a sub brand of Vani Motors, Jezza Motors is up there as one of the top e-rickshaw manufacturers in India. Based in Kolkata, Jezza boasts its state-of-the-art technology in the e-rickshaw manufacturing catering to the needs of almost all major cities of the country.

What’s best about them is that they have a wide range of products — each having its own unique purpose!

You can visit their site : www.jezzamotors.com to know more about their range of products and get insights about the e-rickshaw industry.

E-Rickshaw is the future of the short distance eco-friendly commute for a healthier and happier planet!
World’s Smallest EV Hyundai revealed the worlds smallest EV, Concept 45 to the world!!!
Tags: Electric Car

World’s Smallest EV

Hyundai revealed the worlds smallest EV, Concept 45 to the world!!!
How many miles do you need to drive your electric vehicle to offset CO2 emissions?
By: Ricardo Alonso Esparza Gamez
Tags: Climate Change, Clean Technology, Energy, Electric Car, Environment

Electric Vehicles (EV) are often hailed as one of the solutions to reduce pollutants. However, most of the emissions from an Internal Combustion Engine (ICE) vehicle come from their operation, whereas a larger share of the EV emissions come from its production compared to the former. The reduction of emissions of an EV, therefore, depends largely on the fuel mix of the electricity they are charged on. Using the United States as an example, how much do you need to drive per State to offset emissions?

If we take a gasoline-powered ICE, there are a myriad of different sources of pollution coming off the exhaust: from carbon dioxide, to particulate matter, carbon monoxide, benzene, nitrous and Sulphur oxides, and more. On the other hand, the electricity grid relies on a variety of fuels and energy sources that differ by states, and while you can find most of the previous pollutants, it is in general easier to control pollution over large centralized power plants, in addition to the mix having several non-emitting sources like nuclear, hydro, solar or wind. Nonetheless, for ease of comparison, we will focus on offsetting carbon dioxide emissions (CO2).

The U.S. Environmental Protection Agency (EPA) considers that on average, the typical gasoline-powered passenger cars emits 251 g CO2 per km driven. Using Temporelli et al. (2020) comparison of an 40 kWh EV (commercial example, Nissan Leaf) to a similar petrol car, we can estimate the CO2 eq. emissions from production and maintenance of both types of vehicles, and compare it using US grid emission rates by state and the average emission rates for gasoline. This study considers 49.3 g CO2 eq./km for gasoline cars excluding fuel usage, and as much as 104.2 g CO2 eq./km for the EV with a life of 210,000 km for both. This means that ICE have embodied emissions of 10,353 kg CO2eq. and EV 21,882 kg CO2 eq. We will add 59.1 g CO2 eq./km to account for gasoline production as per the study mentioned, ending with 310 g CO2/km for the ICE. The EV requires 16.8 kWh per 100 km.

Using the average US 2019 grid, you need to drive an electric vehicle ~48,000 km or 30,000 miles to breakeven the emissions in comparison to a similar petrol car. The lowest figure is 37,250 km or 23,300 miles from Vermont, and the highest 75,000 km or 46,900 miles in Wyoming. Here’s how the map looks by State for the continental USA (for Alaska, the figure is 53,900 km and for Hawaii 62,800):
Electric Vehicles, a Green Choice for the Environment
By: Applied Technology Review
Tags: Electric Vehicles, Technews, Electric Car, Technology, Environment

Source — Applied Technology Review

Electric Vehicles have introduced a future where green technology is in high use and demand. As technology becomes more prevalent, electric vehicles are likely to become even more efficient and sustainable.

The world is in a new era of transportation where cleaner cars are no more an imagination. Across its life cycle, an electric vehicle emits fewer greenhouse gases and air pollutants when compared to petrol or diesel equivalent. Emissions are commonly higher in the production phase of electric cars, which are more than offset by lower emissions in the use phase over time. An electric vehicle also uses battery power to drive the motor, burns no gasoline or other fossil fuels and therefore is zero carbon emissions vehicles. Any emissions created are indirect, coming from the source of electricity.

The European Environment Agency’s new Transport and Environment Reporting Mechanism (TERM) report came to the necessary conclusion that when it comes to climate change and air quality, electric vehicles are preferable over fuel vehicles. Contrary to some public doubts and uncertainties about its environmental benefits, the fact is increasingly clear, and these benefits will further increase going forward as the use of renewable energy increases.

One of the significant reasons for the introduction of electric cars is the concern over greenhouse gas emissions and their contribution to global warming. The impact of reduced carbon emissions can benefit urban areas, where a vast majority uses cars. Decreased air pollution due to the absence of the exhaust pipe promotes more sustainability for electric vehicles, which in turn dramatically reduces the negative impact of transportation needs on the environment.

Overall electric vehicles are significantly cleaner and safer for the environment than conventional cars. The most considerable risk to the environment from fuel-powered cars are air pollution, depletion of the ozone layer from emitted chemical substances, and the occasional oil and radiator chemicals leakage, which usually seep into the soil, water supply thus harming all living organisms eventually. Pollutants found in car exhaust cause health issues and chemicals like carbon monoxide and benzene prevents oxygen intake and are linked to severe illnesses like cancer.

Embracing the electronic vehicle revolution will not only help reduce environmental impacts but adds to public health benefits and fuels technological innovation. It is high time to embrace the change and look towards the future.
Circular world, Welcome!
By: Claudio Geyken
Tags: Clean Meat, Climate Change, Circulareconomy, Renewable Energy, Electric Car

Circular world, Welcome!

The curtains open and you see, finally, a circular world. A beautiful circular world.

A place where the human use of 1) land, 2)water and 3)air and 4)created pollution as well as a 5)negative impact on other species is as small as possible.

An important reminder: At the core of all human activity are energy and materials.

Today, fossil fuels are gone and everything has been electrified. Electricity is used to produce green hydrogen still needed in some applications. Electricity will be generated from solar and wind. In a minor way and where possible hydropower, geothermal power and biomass will be used. Energy storage will come from electric mobility, stationary storage and green hydrogen. Global warming is stopped.

Any material, even the one used to produce renewable electricity, is extracted at first. To minimize the negative impact of extraction and production; we share, reduce, reuse and recycle everything as much as possible. Mines are properly reforested. No waste is created.

Life and economic activities are less materialistic and energy-intensive. Instead of building a consumeristic economy and one with fast and far away travel, now slower travel and experiences that require fewer resources are predominant.

For all uses there are low impact technologies:

Mobility is completely electric and shared, except for rockets and maybe planes which use green hydrogen. Urban spaces that were used for parking, widespread personal mobility and shopping are instead converted to green areas for recreation.

Domestic heating and cooling come from heat pumps. Industrial heat is produced with green hydrogen. There is no industrial pollution. Water can be produced via reverse osmosis.

Water is desalinated with reverse osmosis using renewable electricity.

Any animal product is produced with plants instead of animals thanks to companies like Beyond Meat, so we don’t use animals as sources of food anymore. Not using animal products we freed agricultural area allowing for healthier food, forests and much more than the 15% of the land protected in 2020.

Voilà, but how do we get there? That will be determined by policies, education, technologies and action which will be explored in separate articles.

Thanks for sharing, clapping and following to get new articles.
Top Use For Electric Cars in 2020
By: Tod Bookless
Tags: Drive Thru, Tesla, Electric Vehicles, Electric Car, Curbside Pickup

Waiting for Curb-Side Library Books

When most automotive journalists do a review of electric cars, they focus on topics like range, zero to sixty times, and charging times. While those things are interesting and easy to discuss because they have metrics associated with them, they are missing out on how real people will actually use cars.

I am currently driving my second electric car and it is my opinion that they have improved to the point that discussions about range and speed are now meaningless. Most modern electric cars have plenty of range for normal driving, and most people charge their cars at home. In the city, you almost never get to drive quickly, and electric cars are as fast or faster than any gas car. The result is that none of those range and speed metrics matter for day to day driving.

In 2020, with the COVID-19 and the increase in curb-side delivery and drive-throughs, I find that I frequently use my electric car to wait for things. I wait for groceries, retail purchases, drive-in movies, ferry boats, pizza, take-out, and even library books from my son’s grade school. What is the big deal? Gas cars need to have the engine running to make heat or power the A/C, but not electric cars. How many times have you left a gas engine idling to warm up or cool down the car? You are burning gas to stay comfortable, and making smog while you do it. Some places, like the Washington Stage Ferry, require you to turn off your gas car while you wait, but electric cars are no problem because they do not create fumes.

I went to a drive-in movie and the electric car had a clear advantage over the gas cars. There was a double-feature, and it was the summertime. I was able to sit in my car with climate control on and listen to the movie over the car’s radio for more than four hours with no issue. The drive-in staff had jumper cables and spare batteries to help all of the gas cars that could not start after sitting with their radios on for that long, but my car drove home without issue. I have performed some experiments with my Tesla and I estimate that I could keep the climate control on for at least 2 days before the battery drained to twenty percent and the car shut the HVAC down to save power. Each car will vary depending on the ambient temperature and the battery size, but the point is that you can run the heater or air conditioner while you wait for your groceries without worry.

Whatever electric car you have, they are happy to sit there using a tiny amount of battery to run the climate control while someone in a mask brings you things. With curbside delivery the new normal, an electric car is pretty handy and very comfortable. Lots of new models are coming out next year, too, so there is more choice available. Honestly, little creature comforts like this are what will make owners of electric cars refuse to go back to gas cars.

If you want your own Tesla, here is my referal link that will give is both a few miles of Supercharging.
“GM has made the much-overlooked claim that by mid-decade, it expects to commercialize the most exotic of the stretch futuristic batteries currently on electric vehicle drawing boards.”
By: Steve Levine
Tags: GM, Battery, Tesla, Electric Car

“GM has made the much-overlooked claim that by mid-decade, it expects to commercialize the most exotic of the stretch futuristic batteries currently on electric vehicle drawing boards.” Steve LeVine Nov 20, 2020·1 min read

As I wrote today on my new blog, The Mobilist, GM has fired a surprising salvo in the Battery War — a vow that it will beat Tesla, VW, and everyone else to the superbattery. Yesterday, GM executives claimed they would win one of the biggest battles of all — to master and commercialize the metallic lithium-based battery. GM says it will have such a battery in its EVs by the middle of the decade. When I asked battery experts about that, one emailed back to say, “that’s bullshit.” A second, on WhatsApp, said, “that’s just crazy.”
Tesla, Lucid, Rivian, and others join forces to create ZETA: a push for electric cars only by 2030
By: Tony Cowger
Tags: News, Tesla, Electric Car, Carbon Emissions, Environment

“Twenty-eight companies in the electric vehicle industry, including big names like Tesla, Lucid, and Rivian, have joined forces to create a new organization called ZETA, with the goal to push for 100% electric vehicle sales by 2030.

Several markets have recently announced plans to move new car sales to electric vehicles only.

These initiatives, also referred to as bans on the sale of new gasoline-powered vehicles, have taken many forms on different timelines.

Most recently, we saw California move to put in place a plan to ban new gasoline-powered vehicle sales by 2035.

Now, 28 companies in the electric vehicle business are asking for an even bigger goal to be put in place: 100% electric vehicle sales throughout the light-, medium-, and heavy-duty sectors by 2030.

They created the Zero Emission Transportation Association (ZETA) to push the effort at a national level in the US.

Joe Britton, who spent 15 years working in the U.S. Senate, has been named Executive Director of ZETA. He commented:

‘For the first time in a generation, transportation is the leading emitter of U.S. carbon emissions. By embracing EVs, federal policymakers can help drive innovation, create hundreds of thousands of new jobs and improve air quality and public health. ZETA’s formation recognizes a pivotal moment for national leadership and reflects the will of the growing clean transportation sector.’ Britton added: ‘The next decade will be critical in implementing federal policies that accelerate the transition to zero emissions vehicles and help address these problems head-on. The clean vehicle sector already boasts hundreds of thousands of jobs but, if we encourage its growth, the United States can decisively win the global race to develop a new clean transportation economy and employ hundreds of thousands of Americans right here at home.’

Here are some of the things ZETA plans to push for as an organization:
Spring Dependency Injection. So what exactly is Dependency…
By: Niluka Sripali Monnankulama
Tags: Spring, Dependency Injection, Programming

So what exactly is Dependency Injection?

“The dependency inversion principle — The client delegates to call to another object the responsibility of providing its dependencies.”

Let’s say, for example, suppose you want to buy a car, this car is factory built on demands. We do not need to ask the factory how to make a car for us. That means the factory has everything ready and build.

They actually inject all of the dependencies for the cars. That is basically dependency injection. Simply out source the constructions and injections of the objects to external entities.

Dependency: Something as “Helper Objects”

So how it works in Spring world.

We know that, Spring has Object factory, So if you want to get object (ex: carObject), that “ carObject” may have some additional dependencies, these dependies such as a helper objects. These dependencies really just helper objects. will help us to perform some operations.

This is like, instead of manually build the carObject & all of dependencies, Spring Framwork, Spring factory do this work for us,

Its like there is car and ready to drive car You only have to worry about driving.

Here, you have objects ready to use.

Manly we used 2 different dependency injection types,

Constrctor Injection Setter Injection

Deployemnet Process : Constructor Injection

Define the dependency interface & class Create a constructor in a class for injection Configure the dependency injection in spring cofig file

So This is the very basic of Dependency injection, we can use this to easy in Spring world developments.😊
RabbitMQ + Spring Work Queues(равномерное распределение доставки сообщений нескольким слушателям) (2 часть)
By: Наталья Кавнатская
Tags: Rabbitmq, Spring, Java

RabbitMQ tutorial - Work Queues - RabbitMQ

This tutorial assumes RabbitMQ is installed and running on localhost on the standard port (5672). In case you use a…
IoC (Inversion of Control) Containers
By: Barış Dalyan Emre
Tags: Eğitim, Yazılım, Spring, Türkçe, Java

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Hibernate V.S. MyBatis
By: Victor Tsai
Tags: Hibernate, Jpa, Mybatis, Spring, Java

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Spring, DigitalOcean, GitHub & Docker
By: Moritz Mitterdorfer
Tags: Docker, Digitalocean, Github, Spring, Java

The App

Let’s start by creating the API! Therefore, we use Spring Initializr (https://start.spring.io/) for setting things up. Just click on the link and enter your preferred settings. We’ll use Java 8 & Maven. We’ll also need a dependency: Spring Web (add it via clicking on ‘Add Dependency’).

Spring Initializr

Download the project (click ‘Generate’) and move it into your preferred directory. Then, we’re ready to open it with IntelliJ IDEA! 🎊

Opening the project might take a few seconds. Next step: writing the controller that manages client requests.

What’s a controller? Rest controllers manage client requests and return a response. For instance, some user might request /hello and the controller is the part of the application that manages this request and returns “hello world”.

Let’s say we want to write a controller that returns a random number. The request will hit the ‘/random/numbers’ endpoint. Therefore, we simply create a package called controller and create our first controller called RandomNumberController in it.

We also annotated the controller class with @RestController to tell Spring that it is a controller. Then, we are ready to write our method (annotated with @GetMapping). The method just returns a random double. Perfect :)

Screenshot made with https://carbon.now.sh

Now, we’re ready to run the app locally on the computer. Go into AppApplication and run the main method. Then, you’ll see the logs of the application.

Testing the app is also quite easy! Go into your browser and hit http://localhost:8080/random/numbers. One thing you might have noticed is, that our application runs on port 8080 on the computer.

Wuhuu, it works!! 🥳 Now, we want to dockerize that app.
Spring
By: Liane White
Tags: Haiku, Love, Spring, Poetry

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
It is not winter yet
By: Randy Cooper
Tags: Flowers, Macro Photography, Spring, Snapshots, Butterfly

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
[Spring] Rest API의 Request, Response 핸들링
Tags: Spring, Java

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Testing Java Microservice EP 1.5
By: Bruce Hsu
Tags: Test, Microservices, Spring, Test Driven Development, Java

I'm a Java engineer, eager to learn new skills, technique and willing to take challenges.
JPA Auto-Generated Values
By: Vivek Pandey
Tags: Hibernate, Jpa, Hibernate Jpa, Spring, Java

@GeneratedValue annotation with @Id on any field specifies that values will be autogenerated for that field. AUTO is the default generation type and lets the persistence provider choose the generation strategy, most commonly used generation strategies are below:

IDENTITY:

Autoincrement on-demand, efficient due to database internal lightweight locking but does not work very well with hibernate due to “transactional write-behind” flushing strategy adopted by Hibernate.

SEQUENCE:

preallocate values to improve performance, supports well hibernates “transactional write-behind” flushing strategy.

TABLE (SEQUENCE):

One or multiple tables can be used to hold the identifier sequence counter. But it means trading write performance for database portability.

Lets dive into these strategies:

Identity Strategy is a very light efficient weight process and uses database internal lightweight locking.

@GeneratedValue(strategy = GenerationType.IDENTITY)

The only drawback with this strategy is that we can know the value before insert statement which is not good for hibernate adopted transaction write-behind strategy in which transactional commit is delayed as long as possible. initially, writing is done only to the cache. The write to the backing store is postponed until the modified content is about to be replaced by another cache block.

SEQUENCE is a database object that generates incremental integers on each successive request. Sequences are more flexible because it is table free and can pre-allocate values to improve performance.

@Id

@GeneratedValue

(strategy = GenerationType.SEQUENCE,generator = "book_generator")

@SequenceGenerator

(name="book_generator", sequenceName = "book_seq",

initialValue = 1,

allocationSize=50)

private Long id;

The above parameter will create a sequence which starts with 1 and incremented by 50. It means that it will do only one query for the next value of the sequence and it will be used for the next 50.

Table strategy uses one or multiple tables for generating values which mandate ACID, for synchronizing multiple concurrent id generation requests. This is made possible by using row-level locking which comes at a higher cost than IDENTITY or SEQUENCE generators.

@GeneratedValue(generator = "table", strategy=GenerationType.TABLE)

private Long id;

The GenerationType.TABLE gets only rarely used nowadays. It simulates a sequence by storing and updating its current value in a database table which requires the use of pessimistic locks which put all transactions into sequential order. This slows down your application
Understanding Basic Concepts Of Enterprise Integration Patterns
By: Syam Dorjee
Tags: Enterprise Integration, Spring, Spring Integration

It is really important to know the basic concepts of The Enterprise Pattern If you ought to create any messaging system. Spring integration is also based on enterprise patterns.

If you like to read about all the enterprise patterns. Enterprise Integration Patterns is a book by Gregor Hohpe and Bobby Woolf. Though our software industry has evolved and there are many good books to read.

Well, Enterprise integration patterns are all about messaging. The first thing we should be understanding is what is a message.

Message

So basically, a message contains 2 parts. Header and payload.

Payload- It is actual content a sender wants to send to the receiving end.

Header- It contains metadata like timestamp, id and etc.

Messaging Channel

Message Channel

A messaging channel is an abstract idea of delivering a message from sender to receiver. Queues can be taken as an example that implements the messaging channel. There are 2 types of messaging channels.

1. Point to point: P2P is when a specific sender sends a message to a specific receiver.

2. Publish subscribe: When a message needs to be delivered to multiple receivers.

Message Endpoints

Message Endpoint

While implementing a messaging system. Message endpoints provide a way to connect sender and receivers. It is just a part of code that helps to messaging system consume and produce messages. There are different types of endpoints. Example- Adapters, Gateway service.

Message Transformers

Message Transformer

Message transformers are really an important part of the system. Suppose sender sends data in XML format and receiver consumes data in JSON format. So, it is the responsibility of the message transformer to convert XML to JSON. There are several message transformation patterns are described in the book Enterprise Integration Patterns like envelope wrapper and message translator.

Message Routing

The role of the message router is to decide to find out which receiver gets the message and this process is called message routing. There can be a system that delivers a message to multiple users and the message router decides the receiver based on some header value.

Sometimes messages will not be delivered and dropped and the message filtration component is responsible for that work. There are different routing patterns like Dynamic router and Message filters
VMware Spring Professional 2020/2021: A list of 9 Free mocks exams (450 questions)
By: Ad Satour
Tags: Pivotal, Vmware, Spring, Mock Exam, Dumps

VMware Spring Professional 2020/2021: Mock Exam 1 100% Free

I prepared this updated mock exam with answers! A total of 50 questions with answers. It will help you nail your…
Spring-mass Fourier Transform
By: Rostislav Persion
Tags: Fourier Transform, Resonance, System, Mass, Spring

Fourier transform converts an amplitude over time data set into a amplitude over frequency data set. An example of its application is the equalizer in a sound system. The equalizer takes a sample of the sound and converts it into an amplitude over frequency bar graph. Every sample of an analog wave form can be broken down into a set of sine waves. It is even possible to make something as complex as a square wave by combining multiple sine waves together. There are many mathematical models and algorithms to accomplish this task, however there aren’t many mechanical analogies for the process. Using a mechanical analogy, Fourier transform can be accomplished by setting up a row of tuning forks which pick up sound from a piano as seen in Figure 1. You can set up a tuning fork for each note which will resonate with the music. When you press the C key, the tuning fork which resonates with the C key will begin to vibrate while the others are at a stand still. In order to simulate a tuning fork inside of a computer program, the software engineer must create a model which works the same way. The best and most simple method is to simulate a spring-mass system which also has the property of having a mechanical resonance and behaves the same way as a tuning fork. In Figure 2, you can see a model of a spring-mass tuning fork analogy. Using Hooke’s law and a one dimensional projectile simulation you will have all the elements necessary to make the simulation work. Each spring-mass element can be fed an analog signal and will resonate if it is exposed to a sine wave component which matches it. An amplitude over frequency data set can be created by measuring the maximum velocity or maximum deflection of each oscillating mass, which is used as the output of the transform.
May-Flower
Tags: Poetry, Flowers, Spring, Poem, Poetry On Medium

Pink, small, and punctual,

Aromatic, low,

Covert in April,

Candid in May,

Dear to the moss,

Known by the knoll,

Next to the robin

In every human soul.

Bold little beauty,

Bedecked with thee,

Nature forswears

Antiquity.
[Hibernate 5] Naming Strategy 설정
Tags: Spring

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
La Taza
By: Jonathan James Anderegg
Tags: Winter, Search, Beauty, Poetry, Spring

Frozen fields of flowers bloomed too soon, I wandered

in a car that didn’t have a radio.

planes of brown and white, a soil bisecting, wasn’t

blessed with views, I watch the clouds race by as if

Where do I go, towards life? Who bears such gifts? A song

worth dying for, a cup contained and never dry

forever flowing outward, do not fear your need

of her, for there is wisdom. There is crafted compassion.
My favorite end of the year holiday is the Winter Solstice.
Tags: Hope, 2021, Winter Solstice, Spring

My favorite end of the year holiday is the Winter Solstice. It’s actually the reason we celebrate most of the other ones. Ancient civilizations across the planet all celebrated the return of the light. They were star gazers and the night skies were their computers, portraying mythological gods, calculating their calendars, and telling them spring was indeed on its way.

It’s my habit to note how much daylight we gain each day after we pass this milestone, starting with seconds and rapidly growing to minutes as January goes by. My mood changes as the days lengthen and brighten. And it’s almost here.
Kotlin and Dependency Injection Using Spring Value Annotation
Tags: Spring, Software Engineering, Kotlin, Java, Programming

Field Injection

Once you have the above, go and open the KotlinspringvaluedemoApplication.kt file. This class has the main function that starts up the Spring application. We are going to add some fields and a method to this class like so:

KotlinspringvaluedemoApplication.kt — Field Injection

Alright, let’s discuss what we have done here. So, we added two fields ( storeName and storeAddress ) whose values are going to be injected from the application.properties via the @Value annotation.

You can see that we put store.name and store.address as the value parameter for the annotation. This tells Spring to inject the values that have the keys as store.name and store.address in the application.properties file to their respective fields.

If you are a Java developer, you might notice that the $ character is escaped \ here and wonder why. The reason is that in Kotlin, $ is a reserved character and used for string interpolation.

Lastly, we also added a method annotated with @PostConstruct . This annotation essentially sends a signal to Spring to execute the annotated method after the dependency injection is finished. The purpose of this method in this exercise is to demonstrate that the injection works.

Let’s go ahead and run the main function:

Result of running the main function

Ta-da! We can see that Spring injected the values and our getStoreInfo printed them as expected.

Spring component field injection

We don’t usually inject values into the main class but rather into other classes within our application. Essentially, as long as the class is a Spring-managed bean, we can leverage the @Value annotation for injection. Let’s see an example of this.

Go ahead and create a new class called StoreConfiguration . The content of the file is as follows:

Here, we annotate the class with @Component . By doing this, we are telling Spring that this class is to be considered as a candidate for auto-detection when it performs class path scanning. In other words, the class will be managed by Spring as a Spring bean.

Similarly to what we did with the main class, we annotate a field size with @Value so that its value will be injected from a property that has the key store.size-in-meter-square .

Let’s run the main function and see if the value of the size gets printed with the value that corresponds to store.size-in-meter-square in application.properties :

Main function prints StoreConfiguration size value

Perfect. We can see the value of the store size gets printed, which means the injection worked.
Developer Roadmap: Zero to Java Jedi
By: Артур Клезович
Tags: Senior Developer, Spring, Junior Developer, Roadmap, Java

Some text goes here.
PowerMock : How to test a private method
By: Dinesh Arora
Tags: Powermock, Spring, Testing, Junit

“I HAVE THE POWER!!” — I had this feeling a few days ago. I will be honest that at work I do not get time to write unit test cases for each and every piece of code that I write. Often when I do have time, I make an effort to write test cases even for the trivial piece of code blocks such as — Check if properties file is present.

I was working on new code where I had the luxury to write the code in peace (a rarity at my work place where every project is like a fire drill). While writing test cases I came across a situation where I had a class with two methods:

I wanted to write test cases for both the method. However Junit would not allow me to write a test case for a private method. I searched over internet forums and every one suggested that I use Java Reflection API to write my test cases or make my private method public, which I did not want to do.

That’s when POWERMOCK steps in and in a tiny little section of its documentation I noticed a piece of “**WhiteboxImpl” ** class which can help me test private methods.

So that’s what I am going to demonstrate in this tutorial.

STEP 1: Add Maven jar filesSTEP 2: Create a class MyClass.javaSTEP 3: Write a test case for public method : my _public _method

As you can see above that there is no issue with calling a public method and it will run successfully but when you try and call the private method, the code will show error that private method is not visible.

STEP 4: Use PowerMock’s WhiteboxImpl class to test a private method.

Before you do anything you need to make sure that you added Powermock annotations correctly.

@RunWith(PowerMockRunner.class) @PrepareForTest(MyClass.class)

The syntax is pretty simple WhiteboxImpl.invokeMethod(, “,input param1, input param2,…);

The WhiteBoxImpl class actually uses “ Java Reflection API” in the background to make a call, but for the lazy coders like me, who do not want to write Reflection API( Read hate Reflection API), the WhiteBoxImpl class is a small piece of coding heaven.

Now run the test class and you will see that test cases have passed.

~Ciao -Repeat the mantra — “I HAVE THE POWER{MOCK}!!!”
Spring boot : Mapstruct & Lombok. The Strike Team
By: Fahd Boudali
Tags: Lombok, Spring Boot, Mapping, Spring, Java

Introduction

The aim of this article, is to get familiar with the use of Lombok & Mapstruct, they are two dependencies that you will import into your project, and they will save you valuable time.

I can’t be objective about using them or not, because I can no longer live without them (Okay, that was exaggerated).

The shield : The strike team

The strike team is going to be : You, your IDE, Mapstruct and Lombok.

The project

Requirements to get your project up and running :

A favorite text editor or IDE : I do use IntelliJ IDEA, come on judge me.

JDK 1.8 or later

Maven 3.2+

A keyboard

No mouse 😁

For this project, we are going to skip the use of a database, the model is going to be just POJO with no link to any database whatsoever.
Circuits breakers dans une architecture microservices :
By: Rida Kejji
Tags: Circuit Breaker, Microservices, Spring, Software Engineering, Java

Master engineering and management student at Centrale Lille - ITEEM, passionate about scala and looking forward to discovering new things about it.
Ortam Kurulumu ve Hello Spring Örneği
By: Barış Dalyan Emre
Tags: Eğitim, Yazılım, Spring, Türkçe, Java

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
The First Azalea Bloom
Tags: Winter, Poetry, Florida, Poetry Prompt, Spring

Floridians slide through winter

like a butter knife through warm biscuits.



Winter isn’t a season here,

it’s a cluster of moments,

mostly in January.

Warm apple cider

and hot rum toddies

are luxuries —

appreciated and

discarded when

the first azalea blooms

in February.

My passion for winter

died long ago in Maine,

a state that glorifies

all that made me cold and

miserable for three years.

Is this a poem or

a series of cold thoughts

in a warm state?

We get cold here— believe me —

frost, even flurries —

well, almost never flurries,

but they’ve happened.

We have wicked cold winds,

unwelcome visitors from the north,

like the snowbirds that crowd the interstates.

We wear sweaters and parkas,

scarves, gloves, and hats —

once, twice, maybe, six times

before pulling out swimsuits.

Pots of spicy chili and

cinnamony pumpkin pies

remind you of the north

until we pour a margarita

to go with them.

Winter is confused here.

Never knowing if it's coming or going.

We are confused in winter.

Days in the 80s become

nights in 30s or 20s.

Our air-conditioner remains

on stand-by, used more

than the heater.

Beds clothed only in sheets

for most months now

don colorfully-confused comforters.

Some anxiously await

the cooler-ness of winter,

these are always the

real Floridians, the born-and-breds,

worn down by heat and humidity

like tires bald from the highway.

But, we transplants,

the ones who chose to be here,

often for the same reasons

the natives wish they weren’t,

we are wistful when summer fades

at the end of fall — too soon for us.

We become glum and despondent,

feeling like Florida abandoned us or

we were transported back to

a bleak, colorless place we left so long ago.

Yes, depression sets in for those

weeks — two, maybe, three —

before the first azalea blooms.