Greatness is not about overnight success but multiple periods of repeatable habits. It is not about being better than someone else but about being dependable, disciplined and earned.
Many people want to be great but do not want to put in the effort over a sustained period of time to get there.
Success comes from hard work, consistency and intentional inputs that lead to expected outputs. The best way to achieve this is to focus on small wins consistently rather than trying to achieve perfection. By doing small things a great number of times, one can achieve greatness.
Continuous improvement and developing a habit of progression are essential to achieving greatness. Stop speculating and start taking action, focusing on tangible progress and developing repeatable habits to transform into greatness.
Throughout our lives, we encounter various levels of success and failure. As we accumulate more experiences, it’s natural to wonder which ones were genuinely great and why.
Surprisingly, it’s often not the sudden, dramatic achievements that stand out, but the incremental, sustained efforts that lead to significant achievements over time.
In other words, greatness is not about overnight successes but about periods of repeatable habits.
This article seeks to explore the true nature of greatness, the importance of consistency, and the process of building a habit of progression to rise above mediocrity and achieve lasting success.
The Foundations of Greatness
Before delving into the heart of the article, let’s establish two fundamental principles:
Greatness is not instantaneous.
Greatness is earned.
The following story tries to establish those.
Story Warren Buffett
One of the most clear examples of a person achieving greatness through compounding effort and habits over a long time is Warren Buffett. Warren Buffett is one of the most successful investors in the world, known for his disciplined approach to investment and his philosophy of buying and holding.
Buffett started investing when he was just 11 years old and learned about the power of compounding at a very young age. He was not an overnight success. His wealth and success have grown slowly and steadily over the decades, thanks to his consistent investment habits and the magic of compound interest.
Buffett’s investing principles involve patience, long-term thinking, and a focus on fundamentals, including the quality of the business, its management, and its potential for long-term profitability. This strategy allowed him to make consistent, measured investment decisions, often going against popular trends.
He is known for reading extensively, up to 500 pages per day, to increase his knowledge and understanding of different businesses and industries. This is a habit he developed early in life and has maintained throughout his career.
Additionally, he has been a strong advocate of living frugally and prioritizing saving and investing over excessive consumption. He still lives in the same house in Omaha, Nebraska, that he bought in 1958 for $31,500.
Buffett’s consistent investment strategies and frugal lifestyle habits, sustained over several decades, have allowed his wealth to compound and grow exponentially. As of my last knowledge cut-off in September 2021, Warren Buffett’s net worth was approximately $100 billion, making him one of the wealthiest people in the world. This success story is a testament to the power of compounding effort, disciplined habits, and long-term thinking.
Becoming great starts with acknowledging that you’re not already great and recognizing that greatness is not achieved in a single moment or through a stroke of luck. Instead, greatness is a reflection of consistent effort put in over time.
Additionally, greatness is not about being better than others. It’s about being reliable, disciplined, and continuous progress towards mastery.
In short, greatness is earned through hard work persisted over a long period.
The Role of Consistency in Achieving Greatness
One common misconception is that success or notoriety is achieved through flashy and unconventional methods.
This idea arises from the media’s focus on outliers – events or personalities that deviate from the norm. This portrayal can mislead people into aspiring for notoriety solely for the sake of it, or believing that the success of these outliers is solely due to their unorthodox approaches.
In reality, the most reliable and effective path to success is through consistency. Consistency may not be the easiest way to achieve success, but it provides a higher level of certainty and a more predictable outcome rather than relying on a lucky break or being “discovered.”
Check out the following example that beautifully illustrates these considerations.
The Art Class – Quantity vs Quality
James Clear, the author of “Atomic Habits,” provides an insightful example highlighting the importance of consistency.
A study in a photography class divided students into two groups – “quantity” and “quality.”
The quantity group would be graded based on the number of photographs they submitted, while the quality group would be graded on the excellence of a single image.
Surprisingly, the best photographs were produced by the quantity group. Rather than merely theorizing about perfection, they consistently tested and refined their skills through practice.
Developing a Habit of Progression
The journey to greatness requires the development of a habit of progression. In other words, you need to become accustomed to consistently improving even when faced with obstacles or setbacks. The key here is to ensure that your habits and efforts are focused on the right inputs, as consistency in the wrong direction will still lead you astray.
Nothing goes up into the right forever. Greatness is achieved when pushing forward with action when you doubt your future success the most.
If you’re struggling to identify the right path forward, try creating more opportunities for optimization. Instead of making significant life changes annually, be open to trying new things monthly or even weekly. Test various options and, when you’ve found a path that seems to work, double down.
Simple algorithm: Do more of what works.
Remember, the objective is not perfection but rather continuous and incremental improvements. Learn to be satisfied with being “good” at something and then working towards making those “good” habits second nature.
In time, these small, sustained efforts will be what sets you apart from those who merely aspire to greatness without putting in the necessary work.
Maintaining Patience and Perspective
Another key ingredient in achieving greatness is patience.
Recognize that progress may be slow, and that’s okay. In most cases, significant changes happen incrementally and often without fanfare. The key is to stay dedicated to your practice and improvement, even during periods where it feels like you’re not making any headway.
Additionally, avoid the temptation of getting bogged down in the search for an optimal plan or strategy.
While it’s essential to learn from your experiences and make informed decisions, it’s also crucial not to become paralyzed by the desire for a perfect approach. Focus instead on taking action, learning from the results and iterating your tactics accordingly.
The Power of Repeated Small Wins
One powerful strategy for achieving greatness is to accumulate small, consistent wins.
Rather than aiming for grandiose accomplishments, aim for reliable successes that you can build upon over time. These small and often unremarkable successes might not make headlines, but they add up and compound to significant achievements in the long run.
The Story of British Athlete Sir Chris Hoy
Sir Chris Hoy, one of Britain’s most successful Olympians, is an excellent example of how small, consistent wins can lead to greatness. Hoy didn’t burst onto the scene as an unstoppable force. Instead, his success was built slowly and steadily over time through disciplined training and continuous improvement.
Born in Edinburgh, Scotland, in 1976, Hoy was always athletic but did not start competitive cycling until his late teens. His early career was marked by consistent performances and modest successes, but he was not an immediate superstar.
Hoy’s approach to training emphasized incremental improvements. He followed a principle called the “aggregation of marginal gains,” which was popularized by Dave Brailsford, the British Cycling performance director. The idea was simple: find a 1% margin for improvement in everything you do. Instead of looking for one area to improve by 100%, Brailsford and Hoy sought hundreds of areas to improve by 1%, accumulating small, consistent wins.
From adjusting his training routines and optimizing his sleep patterns to tweaking the ergonomics of his bike, Hoy focused on these marginal gains. These small changes might not have made headlines, but they added up and compounded over time into significant improvements in performance.
The result? Hoy became one of the most decorated cyclists in history. He has six Olympic gold medals and eleven World Championship titles to his name. He was knighted by Queen Elizabeth II for his services to cycling.
Sir Chris Hoy’s story encapsulates the power of small, consistent wins.
His approach underscores the idea that the best things in life and the most successful endeavors are not usually the result of miraculous events, but rather of carefully planned and executed strategies born from dedication, consistency, and gradual improvement.
His story highlights that focusing on the process and developing the right habits can help achieve and sustain greatness.
Remember, the best things in life and the most successful endeavors are typically not miraculous events but carefully planned and executed strategies born from dedication, consistency, and gradual improvement.
By focusing on the process and developing the right habits, you’ll forge yourself into the person who can not only reach but also sustain greatness.
The Pursuit of Greatness …
… is not about achieving sudden, monumental successes but rather about embracing the power of consistency and adopting habits that foster continuous improvement and progression.
By staying focused on the process, learning from your experiences, and remaining patient, you’ll set yourself apart from those who only dream of greatness without ever putting in the work.
Remember: greatness is simply good, repeated consistently over time. By cultivating this mindset and dedicating yourself to the process, you’ll discover the true essence of greatness and see it reflected in your own accomplishments.
QR code (Quick Response code) is a machine-readable pictorial format containing black and white squares. It is used for storing information like URLs, product ID, etc. It is a type of matrix barcode or a two-dimensional barcode.
It is a convenient form of storing and retrieving simple data and has become even more popular with the advent of smartphones. The camera in the smartphone can act as a reader and read the QR code and help to decipher the data stored in it.
This article gives many examples if you want a solution to generate QR codes in PHP. There are a lot of PHP libraries available to generate QR codes. This article uses the PHP QR code library.
1. Quick example
This quick example returns the QR code to the browser in one line. It produces the output as a PNG stream.
<?php
require_once __DIR__ . '/vendor/phpqrcode/qrlib.php'; // Displays QR Code image to the browser
QRcode::png('PHP QR Code :)');
Installing PHP QR code library
Download the latest library version and extract it into your application vendor folder. The source code downloadable in this article has the library.
All the examples in this article have the code to include the suitable library file to use its feature.
In a previous article, we have seen code for a PHP QR code generator using the tc-lib-barcode library.
2. Display the QR code using an HTML image
To display the QR code using an HTML image tag, link the HTML image source to the PHP file that returns the QR code PNG data.
The generate.php file returns the QR code in the below code using the PHP QrCode library. The HTML image refers to this file to show the QR code in the browser.
show-qr-code-in-HTML-img/generate.php
<?php
require_once __DIR__ . '/vendor/phpqrcode/qrlib.php'; // Displays QR Code image to the browser
QRcode::png('PHP QR Code :)');
<?php
require_once __DIR__ . '/../vendor/phpqrcode/qrlib.php'; // outputs image as PNG that can be refered to a HTML image 'src'
QRcode::png('PHP QR Code :)');
?>
show-qr-code-in-HTML-img/view.php
<img src="generate.php" />
2. Passing arguments to the QR code generator
Passing parameters to a QR code generator helps to perform dynamic processing about the parameter.
For example, we can pass a contact id to retrieve contact information to bundle it with the QR code output.
This example shows how to send parameters and process them in the QR generator.
The view.php file prepares the QR code parameter in PHP. Then, it sends it to the generate.php in query. This URL with the QR code parameter is specified to an HTML image source.
show-qr-code-in-html-img/view.php
<?php
// initialize PHP parameter to send to the QR code generator
$QRParameter = 1234;
?>
<img src="generate.php?id=<?php echo $QRParameter; ?>" />
In this generate.php file, it does simple manipulation to the passed argument. It prefixes a string with the GET parameter received and bundles the manipulated line to the QR code PNG.
show-qr-code-in-html-img/generate.php
<?php
if (empty($_GET['id'])) { echo "<b>ERROR:</b> Bad request. Required parameters are missing."; exit;
} else { require_once __DIR__ . '/../vendor/phpqrcode/qrlib.php'; $inputString = $_GET['id']; // Do not return anything to the browser ob_start("callback"); // Process the input string $codeText = 'DEMO - ' . $inputString; // end of processing $debugLog = ob_get_contents(); ob_end_clean(); // outputs QR code as a PNG data QRcode::png($codeText);
}
?>
3. Save the QR code on the server
This example saves the generated QR code on the server.
It defines the QR code data and the png file name suffix in an array. Then, it uses them while creating the target to save the QR code.
4. Configure QR code ECC Level, Zoom factor, and Frame size
The PHP QRCode Library defines constants for different ECC levels, Zoom factor, and Frame size. These factors are used for the following purposes when generating a QR code.
This program creates QR codes in L, M, Q, and H levels with appropriate QR constants.
ECC level is the allowed percentage of damage without affecting reading data.
Zoom factor is the allowed resolution that can be changed based on the use cases.
Silent zone Frame size – The silent or quiet zone frame size varies based on different matrices. Setting the QR code above or equal to 4 blocks is recommended.
qr-code-ecc-level.php
<?php
require_once __DIR__ . '/vendor/phpqrcode/qrlib.php';
require_once __DIR__ . '/vendor/phpqrcode/qrconst.php'; $qrContent = 'Demo data to bundle into a QR code'; $target = "uploads/ecc-level/"; // generating QR code in the 4 ECC level
QRcode::png($qrContent, $target . 'l.png', QR_ECLEVEL_L);
QRcode::png($qrContent, $target . 'm.png', QR_ECLEVEL_M);
QRcode::png($qrContent, $target . 'q.png', QR_ECLEVEL_Q);
QRcode::png($qrContent, $target . 'h.png', QR_ECLEVEL_H); ?>
<img src="<?php echo $target; ?>l.png" />
<img src="<?php echo $target; ?>m.png" />
<img src="<?php echo $target; ?>q.png" />
<img src="<?php echo $target; ?>h.png" />
This program adds the zoom factor 1 to 4 with the QR_ECLEVEL_L ECC constant.
qr-code-pixel-zoom-factor.php
<?php
require_once __DIR__ . '/vendor/phpqrcode/qrlib.php'; $qrContent = 'Demo data to bundle into a QR code with zoom factor'; $target = "uploads/pixel-zoom-qr-code/"; // generating QR code with 4 ECC level and zoom factor
QRcode::png($qrContent, $target . 'l_1.png', QR_ECLEVEL_L, 1);
QRcode::png($qrContent, $target . 'l_2.png', QR_ECLEVEL_L, 2);
QRcode::png($qrContent, $target . 'l_3.png', QR_ECLEVEL_L, 3);
QRcode::png($qrContent, $target . 'l_4.png', QR_ECLEVEL_L, 4); ?>
<img src="<?php echo $target; ?>l_1.png" />
<img src="<?php echo $target; ?>l_2.png" />
<img src="<?php echo $target; ?>l_3.png" />
<img src="<?php echo $target; ?>l_4.png" />
This program creates QR codes with all these factors ECC, Zoom, and Frame constants of the library.
silent-zone-frame-size.php
<?php
require_once __DIR__ . '/vendor/phpqrcode/qrlib.php'; $qrContent = 'Demo data to bundle into a QR code with frame size'; $target = "uploads/pixel-zoom-qr-code/"; // generating // frame config values below 4 are not recommended !!!
QRcode::png($qrContent, $target . 'l_3_4.png', QR_ECLEVEL_L, 3, 4);
QRcode::png($qrContent, $target . 'l_3_6.png', QR_ECLEVEL_L, 3, 6);
QRcode::png($qrContent, $target . 'l_3_10.png', QR_ECLEVEL_L, 3, 10); // displaying
?>
<img src="<?php echo $target; ?>l_3_4.png" />
<img src="<?php echo $target; ?>l_3_6.png" />
<img src="<?php echo $target; ?>l_3_10.png" />
5. Add phone, email, and contact info to a QR code
This section has PHP examples to create QR codes to attach contact information. It prepares the QR code content with the “tel:”. “sms:” and “mail:” links and attaches it to the QR code.
[www.indiegala.com] The beloved and critically acclaimed Ghostbusters video game is back! Join the Ghostbusters team, fight monsters, capture ghosts, search for artifacts and have a blast destroying almost everything around you in this Remastered version of the third-person adventure Ghostbusters: The Video Game. https://www.youtube.com/watch?v=CUHjGQy0XDs&ab_channel=SaberInteractive
The Whisperer - Free GOG Game Login / Register Visit the store page of The Whisperer https://www.gog.com/game/the_whisperer Click Add to cart Click Check out now Verify that the price is 0 Click Pay for your order now Thats it, the game will be added to your account
Let’s! Revolution! is a colorful roguelite puzzle mashup about stopping a narcissistic King from ruining your world. Flip tiles to uncover the hidden path to the King. Use deductive reasoning to avoid his cronies or take them all down in strategic turn-based combat.
Quarkus: Modernize “helloworld” JBoss EAP quickstart, Part 1
Quarkus is, in its own words, “Supersonic subatomic Java” and a “Kubernetes native Java stack tailored for GraalVM & OpenJDK HotSpot, crafted from the best of breed Java libraries and standards.” For the purpose of illustrating how to modernize an existing Java application to Quarkus, I will use the Red Hat JBoss Enterprise Application Platform (JBoss EAP) quickstarts helloworld quickstart as sample of a Java application builds using technologies (CDI and Servlet 3) supported in Quarkus.
It’s important to note that both Quarkus and JBoss EAP rely on providing developers with tools based—as much as possible—on standards. If your application is not already running on JBoss EAP, there’s no problem. You can migrate it from your current application server to JBoss EAP using the Red Hat Application Migration Toolkit. After that, the final and working modernized version of the code is available in the https://github.com/mrizzi/jboss-eap-quickstarts/tree/quarkus repository inside the helloworld module.
The name of the quickstart is a strong clue about what this application does, but let’s follow a scientific approach in modernizing this code, so first things first: Try the application as it is.
Deploy helloworld
Open a terminal and navigate to the root of the JBoss EAP directory EAP_HOME (which you can download).
Start the JBoss EAP server with the default profile by typing the following command:
$ EAP_HOME/bin/standalone.sh
Note: For Windows, use the EAP_HOME\bin\standalone.bat script.
After a few seconds, the log should look like:
[org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.2.0.GA (WildFly Core 6.0.11.Final-redhat-00001) started in 3315ms - Started 306 of 527 services (321 services are lazy, passive or on-demand)
Following instructions from Build and Deploy the Quickstart, deploy the helloworld quickstart and execute (from the project root directory) the command:
$ mvn clean install wildfly:deploy
This command should end successfully with a log like this:
[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8.224 s
The helloworld application has now been deployed for the first time in JBoss EAP in about eight seconds.
and then refresh the web page in the browser to check the message displayed changes, as shown in Figure 3:
Figure 3: JBoss EAP’s Hello Marco.
Undeploy helloworld and shut down
If you want to undeploy (optional) the application before shutting down JBoss EAP, run the following command:
$ mvn clean install wildfly:undeploy
To shut down the JBoss EAP instance, enter Ctrl+C in the terminal where it’s running.
Let’s modernize helloworld
Now we can leave the original helloworld behind and update it.
Create a new branch
Create a new working branch once the quickstart project finishes executing:
$ git checkout -b quarkus 7.2.0.GA
Change the pom.xml file
The time has come to start changing the application. starting from the pom.xml file. From the helloworld folder, run the following command to let Quarkus add XML blocks:
The property <quarkus.version> to define the Quarkus version to be used.
The <dependencyManagement> block to import the Quarkus bill of materials (BOM). In this way, there’s no need to add the version to each Quarkus dependency.
The quarkus-maven-plugin plugin responsible for packaging the application, and also providing the development mode.
The native profile to create application native executables.
Further changes required to pom.xml, to be done manually:
Move the <groupId> tag outside of the <parent> block, and above the <artifactId> tag. Because we remove the <parent> block in the next step, the <groupId> must be preserved.
Remove the <parent> block: The application doesn’t need the JBoss parent pom anymore to run with Quarkus.
Add the <version> tag (below the <artifactId> tag) with the value you prefer.
Remove the <packaging> tag: The application won’t be a WAR anymore, but a plain JAR.
Change the following dependencies:
Replace the javax.enterprise:cdi-api dependency with io.quarkus:quarkus-arc, removing <scope>provided</scope> because—as stated in the documentation—this Quarkus extension provides the CDI dependency injection.
Replace the org.jboss.spec.javax.servlet:jboss-servlet-api_4.0_spec dependency with io.quarkus:quarkus-undertow, removing the <scope>provided</scope>, because—again as stated in the documentation—this is the Quarkus extension that provides support for servlets.
Remove the org.jboss.spec.javax.annotation:jboss-annotations-api_1.3_spec dependency because it’s coming with the previously changed dependencies.
Note that the above mvn io.quarkus:quarkus-maven-plugin:0.23.2:create command, besides the changes to the pom.xml file, added components to the project. The added file and folders are:
The files mvnw and mvnw.cmd, and .mvn folder: The Maven Wrapper allows you to run Maven projects with a specific version of Maven without requiring that you install that specific Maven version.
The docker folder (in src/main/): This folder contains example Dockerfile files for both native and jvm modes (together with a .dockerignore file).
The resources folder (in src/main/): This folder contains an empty application.properties file and the sample Quarkus landing page index.html (more in the section “Run the modernized helloworld“).
Run helloworld
To test the application, use quarkus:dev, which runs Quarkus in development mode (more details on Development Mode here).
Note: We expect this step to fail as changes are still required to the application, as detailed in this section.
Now run the command to check if and how it works:
$ ./mvnw compile quarkus:dev [INFO] Scanning for projects... [INFO] [INFO] ----------------< org.jboss.eap.quickstarts:helloworld >---------------- [INFO] Building Quickstart: helloworld quarkus [INFO] --------------------------------[ war ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloworld --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ helloworld --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- quarkus-maven-plugin:0.23.2:dev (default-cli) @ helloworld --- Listening for transport dt_socket at address: 5005 INFO [io.qua.dep.QuarkusAugmentor] Beginning quarkus augmentation INFO [org.jbo.threads] JBoss Threads version 3.0.0.Final ERROR [io.qua.dev.DevModeMain] Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors [error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.jboss.as.quickstarts.helloworld.HelloService and qualifiers [@Default] - java member: org.jboss.as.quickstarts.helloworld.HelloWorldServlet#helloService - declared on CLASS bean [types=[javax.servlet.ServletConfig, java.io.Serializable, org.jboss.as.quickstarts.helloworld.HelloWorldServlet, javax.servlet.GenericServlet, javax.servlet.Servlet, java.lang.Object, javax.servlet.http.HttpServlet], qualifiers=[@Default, @Any], target=org.jboss.as.quickstarts.helloworld.HelloWorldServlet] at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:841) at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:214) at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:106) at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:249) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at io.quarkus.deployment.ExtensionLoader$1.execute(ExtensionLoader.java:780) at io.quarkus.builder.BuildContext.run(BuildContext.java:415) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426) at java.lang.Thread.run(Thread.java:748) at org.jboss.threads.JBossThread.run(JBossThread.java:479) Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.jboss.as.quickstarts.helloworld.HelloService and qualifiers [@Default] - java member: org.jboss.as.quickstarts.helloworld.HelloWorldServlet#helloService - declared on CLASS bean [types=[javax.servlet.ServletConfig, java.io.Serializable, org.jboss.as.quickstarts.helloworld.HelloWorldServlet, javax.servlet.GenericServlet, javax.servlet.Servlet, java.lang.Object, javax.servlet.http.HttpServlet], qualifiers=[@Default, @Any], target=org.jboss.as.quickstarts.helloworld.HelloWorldServlet] at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:428) at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:371) at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:206) ... 14 more
It failed. Why? What happened?
The UnsatisfiedResolutionException exception refers to the HelloService class, which is a member of the HelloWorldServlet class (java member: org.jboss.as.quickstarts.helloworld.HelloWorldServlet#helloService). The problem is that HelloWorldServlet needs an injected instance of HelloService, but it can not be found (even if the two classes are in the very same package).
It’s time to return to Quarkus guides to leverage the documentation and understand how @Inject—and hence Contexts and Dependency Injection (CDI)—works in Quarkus, thanks to the Contexts and Dependency Injection guide. In the Bean Discovery paragraph, it says, “Bean classes that don’t have a bean defining annotation are not discovered.”
Looking at the HelloService class, it’s clear there’s no bean defining annotation, and one has to be added to have Quarkus to discover the bean. So, because it’s a stateless object, it’s safe to add the @ApplicationScoped annotation:
@ApplicationScoped public class HelloService {
Note: The IDE should prompt you to add the required package shown here (add it manually if need be):
Please, pay attention to the fact that the ./mvnw compile quarkus:dev command is still running, and we’re not going to stop it. Now, try to apply the same—very trivial—change to the code and see how Quarkus improves the developer experience:
Save the file, and then refresh the web page to check that Hello Marco appears, as shown in Figure 6:
Figure 6: The Quarkus dev Hello Marco page.
Take time to check the terminal output:
INFO [io.qua.dev] (vert.x-worker-thread-3) Changed source files detected, recompiling [/home/mrizzi/git/forked/jboss-eap-quickstarts/helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java] INFO [io.quarkus] (vert.x-worker-thread-3) Quarkus stopped in 0.003s INFO [io.qua.dep.QuarkusAugmentor] (vert.x-worker-thread-3) Beginning quarkus augmentation INFO [io.qua.dep.QuarkusAugmentor] (vert.x-worker-thread-3) Quarkus augmentation completed in 232ms INFO [io.quarkus] (vert.x-worker-thread-3) Quarkus 0.23.2 started in 0.257s. Listening on: http://0.0.0.0:8080 INFO [io.quarkus] (vert.x-worker-thread-3) Profile dev activated. Live Coding activated. INFO [io.quarkus] (vert.x-worker-thread-3) Installed features: [cdi] INFO [io.qua.dev] (vert.x-worker-thread-3) Hot replace total time: 0.371s
Refreshing the page triggered the source code change detection and the Quarkus automagic “stop-and-start.” All of this executed in just 0.371 seconds (that’s part of the Quarkus “Supersonic Subatomic Java” experience).
Build the helloworld packaged JAR
Now that the code works as expected, it can be packaged using the command:
$ ./mvnw clean package
This command creates two JARs in the /target folder. The first is helloworld-<version>.jar, which is the standard artifact built from the Maven command with the project’s classes and resources. The second is helloworld-<version>-runner.jar, which is an executable JAR.
Please pay attention to the fact that this is not an uber-jar, because all of the dependencies are copied into the /target/lib folder (and not bundled within the JAR). Hence, to run this JAR in another location or host, both the JAR file and the libraries in the /lib folder have to be copied, considering that the Class-Path entry of the MANIFEST.MF file in the JAR explicitly lists the JARs from the lib folder.
To create an uber-jar application, please refer to the Uber-Jar Creation Quarkus guide.
Run the helloworld packaged JAR
Now, the packaged JAR can be executed using the standard java command:
$ java -jar ./target/helloworld-<version>-runner.jar INFO [io.quarkus] (main) Quarkus 0.23.2 started in 0.673s. Listening on: http://0.0.0.0:8080 INFO [io.quarkus] (main) Profile prod activated. INFO [io.quarkus] (main) Installed features: [cdi]
As done above, open the http://0.0.0.0:8080 URL in a browser, and test that everything works.
Build the helloworld quickstart-native executable
So far so good. The helloworld quickstart ran as a standalone Java application using Quarkus dependencies, but more can be achieved by adding a further step to the modernization path: Build a native executable.
Install GraalVM
First of all, the tools for creating the native executable have to be installed:
As stated in the Building a Native Executable—Producing a native executable Quarkus guide, “Let’s now produce a native executable for our application. It improves the startup time of the application and produces a minimal disk footprint. The executable would have everything to run the application including the ‘JVM’ (shrunk to be just enough to run the application), and the application.”
To create the native executable, the Maven native profile has to be enabled by executing:
$ ./mvnw package -Pnative
The build took me about 1:10 minutes and the result is the helloworld-<version>-runner file in the /target folder.
Run the helloworld native executable
The /target/helloworld-<version>-runner file created in the previous step. It’s executable, so running it is easy:
$ ./target/helloworld-<version>-runner INFO [io.quarkus] (main) Quarkus 0.23.2 started in 0.006s. Listening on: http://0.0.0.0:8080 INFO [io.quarkus] (main) Profile prod activated. INFO [io.quarkus] (main) Installed features: [cdi]
As done before, open the http://0.0.0.0:8080 URL in a browser and test that everything is working.
Next steps
I believe that this modernization, even of a basic application, is the right way to approach a brownfield application using technologies available in Quarkus. This way, you can start facing the issues and tackling them to understand and learn how to solve them.
In part two of this series, I’ll look at how to capture memory consumption data in order to evaluate performance improvements, which is a fundamental part of the modernization process.
[Oracle Blog] Micronaut Framework 4: Faster, More Cloud Native, Better Than Ever
Micronaut® framework 4 is here! And it's faster, more cloud native, and better than ever! Oracle is thrilled to share some notable features in Micronaut framework 4 developed in collaboration with the Micronaut Foundation.
Posted by: xSicKxBot - 08-13-2023, 01:18 AM - Forum: Python
- No Replies
[Tut] Auto-GPT vs Agent GPT: Who’s Winning in Autonomous LLM Agents?
4/5 – (1 vote)
In the realm of AI agents and artificial general intelligence, Auto-GPT and Agent GPT are making waves as innovative tools built on OpenAI’s API. These language models have become popular choices for AI enthusiasts seeking to leverage the power of artificial intelligence in various tasks.
Auto-GPT is an experimental, open-source autonomous AI agent based on the GPT-4 language model. It’s designed to chain together tasks autonomously, streamlining the multi-step prompting process commonly found in chatbots like ChatGPT.
Agent GPT boasts a user-friendly interface that makes AI interaction seamless even for individuals without coding experience.
AgentGPT is more expensive as you need to subscribe to a professional plan whereas with Auto-GPT you only need to provide an OpenAI API key without paying a third party.
While Auto-GPT pushes the boundaries of AI autonomy, Agent GPT focuses on a more intuitive user experience.
I created a table that subjectively summarizes the key similarities and differences:
Feature
Auto-GPT
Agent GPT
Similarities
Differences
Autonomy
Can operate and make decisions on its own
Same. From time to time needs human intervention to operate
Both are powered by GPT technology
Auto-GPT can be fully autonomous. Agent GPT not fully.
User-Friendliness
Less user-friendly compared to Agent GPT
More user-friendly due to its intuitive UI
Both are designed to make AI accessible
Auto-GPT more technical. Agent GPT easier and non-technical.
Functionality
Designed to function autonomously
Can create and deploy autonomous AI agents
Both can generate human-like text
Both worked the same in my case. Auto-GPT more customizable.
Intended use cases
Best suited for individuals with programming or AI expertise
More accessible to individuals without programming or AI expertise
Both can be used for a range of applications, including chatbots and content creation
Auto-GPT for technical users who want more control. Agent GPT ideal for non-technical users
Pricing
OpenAI API pricing ($0.03 per 1000 tokens)
$40 per month for a few agents
Both are relatively cheap for what they provide
AgentGPT free for trial but more expensive than Auto-GPT for non-trivial tasks
Auto-GPT and Agent GPT Overview
In the realm of AI-powered language models, Auto-GPT and Agent GPT are two prominent technologies built on OpenAI’s API for automating tasks and language processing. This section provides a brief overview of both Auto-GPT and Agent GPT, focusing on their fundamentals and applications in various fields.
Auto-GPT Fundamentals
Auto-GPT is an open-source interface to large language models such as GPT-3.5 and GPT-4. It empowers users by self-guiding to complete tasks using a predefined task list. Requiring coding experience to be effectively used, Auto-GPT operates autonomously, making decisions and generating its own prompts .
With core capabilities in natural language processing, Auto-GPT applies to areas like data mining, content creation, and recommendation systems. Its autonomous nature makes it an ideal choice for developers seeking a more hands-off approach to task automation.
In contrast, Agent GPT is a user-friendly application with a direct browser interface for task input. Eliminating the need for coding expertise, Agent GPT provides an intuitive user experience suited for a broader audience. While it depends on user inputs for prompt generation, it still boasts a powerful language model foundation.
Agent GPT finds applications in various fields, including virtual assistants, chatbots, and educational tools. Its user-friendliness and customizability make it an appealing choice for non-technical users seeking artificial general intelligence (AGI) support in their projects.
Technology Comparison
In this section, we will compare Auto-GPT and AgentGPT, focusing on their Language Models and Processing, Autonomy and Workflow, and User Interface and Accessibility. These AI agents have distinct advantages and offer a range of features for different user needs.
Language Models and Processing
Auto-GPT and AgentGPT both utilize OpenAI’s GPT-3 or GPT-4 API, which handles natural language processing and deep learning tasks. As a result, they can handle complex text-based tasks effectively. The primary difference lies in their implementation and target audience.
Autonomy and Workflow
Auto-GPT is designed to function autonomously by providing a task list and working towards task completion without much user interaction. This is ideal for developers with coding experience looking to automate more technical tasks in their workflow.
In contrast, AgentGPT is more user-friendly, requiring input through a direct browser interface. This makes AgentGPT a better choice for those without programming or AI expertise, as it simplifies the adoption and integration of the AI-powered tool in everyday tasks.
Autonomy of both is similar although you can keep Auto-GPT running much longer in your shell or terminal. Having the browser tab open in Agent GPT will only get you so far…
User Interface and Accessibility
Auto-GPT’s open-source nature means that it requires coding experience to be used effectively. While this may be perfect for developers, it can be a barrier for non-technical users.
On the other hand, AgentGPT offers a straightforward browser interface, enabling users to input tasks without prior coding knowledge. This increased accessibility makes it a popular choice for individuals seeking AI assistance in a variety of professional settings.
Key Features
Generative AI and Content Creation
Auto-GPT and AgentGPT are both AI agents used for generating text and content creation, but they have some differences.
Auto-GPT is an open-source project on GitHub made by Toran Bruce Richards. AgentGPT, on the other hand, is designed for user-friendliness and accessibility for those without AI expertise, thus making it perfect for non-programmers.
These AI agents employ advanced natural language processing algorithms to generate and structure content efficiently. They are optimized for various tasks, such as writing articles, creating summaries, and generating chatbot responses.
Machine Learning and Data Analysis
Both Auto-GPT and AgentGPT rely on cutting-edge machine learning algorithms to analyze and process data. Auto-GPT utilizes GPT-4 API for its core functionalities, while AgentGPT doesn’t rely on a specific GPT model.
Through their machine learning capabilities, these AI agents can not only create content but also analyze and process it effectively. This makes them perfect for applications like sentiment analysis, recommender systems, and classifications in a wide range of industries, from marketing to healthcare.
To sum up, Auto-GPT and AgentGPT are powerful and similar AI tools with a minor number of distinct features that cater to different needs. They both excel in generative AI and content creation, as well as machine learning and data analysis.
Personally, I found that AgentGPT is more fun!
Pricing and Costs
AI agents like Auto-GPT and AgentGPT have become increasingly popular for automating tasks, but the security concerns surrounding them and their API access need to be taken into account. In this section, we will discuss securing AI integration and obtaining an OpenAI API key for these AI agents.
AgentGPT is more expensive as you need to subscribe to a professional plan whereas with Auto-GPT you only need to provide an OpenAI API key without paying a third party.
Here’s a screenshot of the product pricing of AgentGPT:
The pricing of OpenAI API is very inexpensive, so Auto-GPT will be much cheaper for larger projects:
Use Cases and Industries
This section explores the distinct applications of Auto-GPT and AgentGPT in various industries, focusing on automation, marketing strategy, and customer service. We will examine how these AI agents can streamline tasks and enhance decision-making, contribute to marketing initiatives, and improve customer service through chatbots.
Automate Tasks and Decision-Making
Auto-GPT excels at autonomous operation, making it a powerful choice for automating tasks and decision-making.
Industries like finance, manufacturing, and logistics can benefit from Auto-GPT’s ability to process vast amounts of data, identify patterns, and execute decisions based on predefined goals.
On the other hand, AgentGPT requires a higher amount of human intervention but excels in more user-friendly applications, providing an intuitive interface that non-experts can easily navigate. I have yet to see somebody running Agent GPT for days whereas it’s easy to do with Auto-GPT.
Marketing Strategy
In the realm of marketing, AgentGPT’s intuitive user interface makes it the more suitable choice for strategizing and creating content.
Digital marketers can leverage the language model to develop relevant and engaging materials for various platforms, including social media, email campaigns, and blog posts.
While Auto-GPT can also generate content, its autonomous nature might not be as ideal for crafting customized and targeted marketing messages.
Development and Future Prospects
In the rapidly evolving field of AI, Auto-GPT and Agent GPT are two key players making significant strides. This section explores their open-source interfaces, repositories, and future research involving GPT-4 and beyond, delving into how these developments might shape the future of large language models.
By the way, if you’re interested in open-source developments in the large language models (LLM) space, check out this article on the Finxter blog!
In the world of artificial intelligence, open-source interfaces facilitate broader access to cutting-edge technology. Auto-GPT is one such agent, available as an open-source project on GitHub.
Developed by Toran Bruce Richards aka “Significant Gravitas”, its accessibility to those with coding experience helps to foster innovation in AI applications.
On the other hand, Agent GPT is a more expensive and user-friendly platform geared toward a wider audience, requiring less technical know-how for utilization.
GPT-4 and Future Research
As AI research continues, the focus has shifted to larger language models—like GPT-4—that are expected to outperform their predecessors.
Auto-GPT, as a self-guiding agent capable of task completion via a provided task list, is primed for incorporation with future GPT iterations. Meanwhile, BabyAGI is another emerging language model, developed simultaneously with agents like Auto-GPT and Agent GPT, in response to the growing generative AI domain.
TLDR; Auto-GPT and Agent GPT contribute to a brighter future in AI research, with the former offering a more technical approach that’s inexpensive and highly customizable and the latter catering to a less code-oriented user base that is willing to pay more for the convenience.
The introduction of GPT-4 represents a step toward more advanced and efficient AI applications, ensuring that the race for better language models continues.
OpenAI Glossary Cheat Sheet (100% Free PDF Download)
Finally, check out our free cheat sheet on OpenAI terminology, many Finxters have told me they love it!
This article has HTML templates for contact form pages. All these templates are responsive to fit any viewports.
On a responsive page, the site header menu can be toggled. Template 1 and 2 of this example has JavaScript function to perform the toggle events for a sliding menu in the mobile view.
Contact Form Template 1
This template has the contact form in the site footer. The footer contains three columns to show the contact form details.
If you are creating a contact form page, it should clearly show the location and the contact details.
In this template, the footer columns show these details with a contact form.
The site header contains menu links and a hamburger icon. The hamburger icon can be seen in the mobile view only.
The header dropdown menu will be shown on clicking that icon in the site banner.
This contact template shows the contact details, address, phone, and email. It offers a form with primary fields to let the user communicate with the site owner.
This template has two columns in the site content area. The contact details and the contact form are shown in these two columns, respectively.
Template 3 is a simple and clean theme for a contact form page. It displays a contact form with a few primary fields. Also, it shows only the vital contact details on the page.
A simple contact template will encourage the end user to connect with you and increase the conversion rate.
[www.indiegala.com] The definitive MK11 experience! Take control of Earthrealm's protectors in 2 acclaimed, time-bending Story Campaigns as they race to stop Kronika from rewinding time & rebooting history. Feat. the complete 37-fighter roster, incl. Rain, Mileena & Rambo. https://www.youtube.com/watch?v=f8o9bysnzoQ&ab_channel=MortalKombat