How do I find the two largest elements in an array?

I'm having trouble in my assignment
Assignment :: TwoLargestElements
Complete the following program so that it computes and writes out the two largest elements in the array.
It always display "12" on both largest and largest2

import java.io.* ;    
public class TwoLargest  {      
 public static void main ( String[] args ) 
                     throws IOException    {      
 int[] data = {3, 1, 5, 7, 4, 12, -3, 8, -2};            
 int largest = 0, largest2 = 0;                       
  for ( int index = 0; index < data.length; index++)      
  if(largest < data[index]) {
  largest = data [index];
  }
  for ( int index = 0; index < data.length; index++)
  if (largest2 < largest) {  
    largest2 = largest;
  }
  System.out.println("The largest number in the array is: " + largest);
  System.out.println("The second largest number in the array is: " + largest2); 
 }
}

Fluent-API: Creating Easier, More Intuitive Code With a Fluent API

We know that, in a software project, nothing replaces good documentation. However, it is also necessary to pay attention to how intuitive the written code is. After all, the simpler and more natural the code is, the better its experience for users.

In the simple "programming rule", in which we will forget everything we have to remember, an API that "forces" you to remember is crucial proof of failure.

Jumble word through user input

(Jumble word program) (plz guys help me to make this program)

user enter few characters randomly, then press enter, (your program stores 50 names of your class fellows)
if by rearranging your entered characters it matches to the names stored,
then it will show it, otherwise it will show that name does not exist.

for example.... user enter llohe
correct name already declare (hello) program show this name

Theme Authors Should Be Able To Opt Out of Any Design Feature

As I debugged issues with the new block gap feature added in Gutenberg 11.4 last week, I found the ticket introducing it. And, there was already a new ticket for one problem I had hit. However, there was some discussion over whether themes should be allowed to opt-out, rolling their own solution. There was no way to do it at the time.

It felt like a no-brainer, something I would not think twice about. I quickly chimed in:

Should theme authors be able to opt out? If this is ever a question that comes up, the answer is always: Absolutely, 100%, yes!

The front end of a site is the theme author’s domain. Ultimately, they define how things work there. At least, this is how it has always been. Before the advent of the block system, there were cases where WordPress added its own spin to front-end features, such as styles for the gallery shortcode and emoji JavaScript-image replacement. Themes have always had methods for disabling those.

With the introduction of the Gutenberg project and its evolving feature set, WordPress continues stepping into front-end design. This carries the benefit of standardizing the relationship between the platform, themes, and users. It makes things like block patterns universal, and it will continue doing so as we get into more advanced layout tools. This is a future that I am eager to witness because it will make theming much easier.

However, within the in-ticket discussion, I came across one of the fundamental rifts between some people working on Gutenberg and third-party developers:

I disagree with this take. This means that everything should be optional in WordPress and goes against the decisions not options. some things need to be options but not everything…I don’t think it should be a rule to have an opt-out for everything personally. For instance for structural styles, I’d rather have the themes rely on Core always instead of reinventing their own. Themes are here to bring personality and design but not to define what “horizontal alignment” means for instance.

Riad Benguella

If such a stance becomes one of the cornerstones of block theme development, it will turn many traditional themers away.

I agree with the principle that this should be the foundation, the default way that theming works in WordPress going forward. The more pieces that we can standardize, the better. But, as a rule of thumb, theme authors should be able to opt out of any design-related feature. Then, we make rare exceptions to that rule when the need arises.

Regardless of what Gutenberg and, ultimately, WordPress does, theme authors will find a way around it. Let us pretend that “horizontal alignment” is defined by CSS flexbox in core. I guarantee that someone will come along and use CSS grid.

In the case of the “block gap” feature introduced in Gutenberg 11.4, it is essentially a fancy name for a global top margin that gets applied to blocks (not to be confused with the actual CSS gap property). In essence, it is a system for defining part of the default vertical rhythm.

This feature has long been on my wish list, but the idea of mandating it never crossed my mind. If you want to see a heated discussion, throw a handful of web designers in a room and have them discuss the myriad ways of handling vertical spacing between elements. I am in the top margin camp.

Fortunately, theme authors will be able to enable or disable the block gap feature. But, that is merely one battle.

I had planned to reply in-ticket, but I did not want to get too far off-topic. I also wanted to give some consideration to the other side. However, I could think of few instances where WordPress should always be the deciding factor on front-end design.

From that position, I envision little more than theme authors creating workarounds for what they will see as a broken system. There is nothing wrong with WordPress defining the defaults. However, it should always be from the mindset that developers will want to venture out. The best way to keep them happy is to not get in the way. Build a system that they want to use, not that they must use. And, for those who decide to go a different route, make it easy. Even if we think those rebel designers are creating a broken user experience, that is OK. It is their project to make or break.

What makes WordPress so uniquely WordPress is that the platform has always catered to those who want to extend it in just about any imaginable way. If it starts creating stumbling blocks that need not be there, we have done a poor job as stewards of the software.

Build Pivot Tables in MySQL Using User Variables

One of the most prominent tasks when dealing with databases is to properly filter and extract meaningful data from the underlying database. Due to that, there can be requirements to pivot the data from rows to columns leading to the creation of pivot tables to visualize data better.

Some databases like Microsoft SQL Server or Oracle come with inbuilt functionality to create a pivot table using the inbuilt pivot() function. However, this function is not available in some databases such as MySQL and MariaDB. In this post, we will discuss how to create pivot tables in MySQL without depending on any special functions.

Pipe Wrench Publication Releases New Native Land Search Plugin for WordPress

Pipe Wrench, an online publication that dissects different topics through longform stories, reactions, interpretations, and asides, has released a free WordPress plugin called Native Land Search. The publication commissioned the plugin from Alex Gustafson, a subscriber and contributor to the magazine.

Native Land Search offers a search block or “Native Lands Aside” block pattern that users can add to the post content. Site visitors can search an address to discover if it is on indigenous lands.

Pipe Wrench implementation of the Native Land Search block

On the Pipe Wrench publication, the content authors have added a Cover block with a background image and put the search block inside the Group block.

Here is an example of the output for a Florida location:

The search results are powered by the native-land.ca API and Google Geocoding API. Native Land Digital, a non-profit organization, created the maps with the following mission:

We strive to map Indigenous lands in a way that changes, challenges, and improves the way people see the history of their countries and peoples. We hope to strengthen the spiritual bonds that people have with the land, its people, and its meaning.

We strive to map Indigenous territories, treaties, and languages across the world in a way that goes beyond colonial ways of thinking in order to better represent how Indigenous people want to see themselves.

Native Land Digital notes that the maps do not represent or intend to represent official or legal boundaries of any indigenous nations.

“All kinds of sites — magazine, newspaper, personal blog, academic hub, nonprofit — can use the block to add depth to all kinds of content involving Indigenous groups,” Pipe Wrench Editor Michelle Weber said. “LandBack, residential schools, climate change, general history — offering this search tool helps non-indigenous folks uncover and understand vital histories with ongoing ramifications.”

The Native Land Search Plugin is available for download from WordPress.org and contributions can be submitted on GitHub. It may never have a million active installs but the plugin could be an important tool for sites involved in education or advocacy efforts.

Building a High-Performance Data Lake Using Apache Hudi and Alluxio at T3Go

T3Go is China’s first platform for smart travel based on the Internet of Vehicles. In this article, Trevor Zhang and Vino Yang from T3Go describe the evolution of their data lake architecture, built on cloud-native or open-source technologies including Alibaba OSS, Apache Hudi, and Alluxio. Today, their data lake stores petabytes of data, supporting hundreds of pipelines and tens of thousands of tasks daily. It is essential for business units at T3Go including Data Warehouse, Internet of Vehicles, Order Dispatching, Machine Learning, and self-service query analysis.

In this blog, you will see how we slashed data ingestion time by half using Hudi and Alluxio. Furthermore, data analysts using Presto, Hudi, and Alluxio saw the queries speed up by 10 times. We built our data lake based on data orchestration for multiple stages of our data pipeline, including ingestion and analytics.

Kessel Run: Smuggling DevOps into the Department of Defense

To fight the wars of the future the US Air Force tasked a small group of software engineers with a simple job - revolutionize the way the military thinks about software development.

The group tasked with this not-so-tiny problem came to call themselves “Kessel Run” after the famed smuggling route used by Han Solo in Star Wars.

How to Be an Engineering Leader: A letter to my past self

Everyone has their own definition of true leadership. What I didn't understand at the start of my leadership journey was that each of us is a leader. Regardless of intent, we influence and impact our communities, industries, workplaces, and relationships. Yet, often we don't understand the importance or impact of simply being present. So I wanted to write a message to anyone looking to grow into engineering leadership. This was the letter the younger version of myself needed and I hope that it will highlight the importance of self-empowerment in your journey.

To Whom it may concern,

Anyone remember by history has taken it upon themselves to venture down their own path. In some instances, these individuals stood their ground and continued forward in the face of violence, war, political and economic systems, beliefs, and stereotypes never before challenged. And so they changed the perspectives and consequently the lives of individuals around them. These individuals didn't stand out by being just like everyone else. Instead, they took up the metaphorical shovel and paved their path by taking actions in alignment with what they believed and desired.

India’s CoWIN Portal Adds New Vaccination Status Look-Up API

CoWIN, a portal for COVID-19 vaccination registration created by the Indian Ministry of Health and Family Welfare, has been updated to include a new API that will allow businesses to look up the vaccination status of customers and clients. The tool allows individuals to authorize access to this health data on behalf of businesses.

Help implementing a simple program using Queue Data Structure

We are tasked to simulate a simple printing queue, where users take turn at printing their files/documents. We just need to put each of user's name, ID, and number of pages and then output the queue in the program.

We need to do it by using Queue with Array. So there's definitely enqueue (putting the users details - name, Id, pages) and dequeue to remove them and move to the next. My problem is how to actually start.

The clue given to us is to create a class will hold a user's name, ID, number of pages. Then another class where I could add the users to the queue and print their details and like who's first and next so I could put many user details.

And the program will output their details. Then if I put a dequeue it will show in the output that they are removed.

I don't know how I could use arrays to implement the queue since I'm not sure how to put multiple values in a queue (name, user ID, etc.)

I hope someone could help me start with it, in how I could create the classes and stuff.

Export Mulesoft Application Logs To Amazon Cloudwatch

Application logging plays an important role in any software development projects. As much as we’d like our software to be perfect, issues will always arise within a production environment. When they do, a good logging strategy is crucial because it contains information about application events, messages, errors, and warnings, along with a few other informational events.

This article will provide deep insight on how you can export your application logs to other monitoring & operational metrics tools such as Amazon CloudWatch. We will be using the popular Log4j2 library in this example.

Provisioning High-Performance Storage for NoSQL databases with OpenEBS

Modern applications rely on multiple data models that generate different data types. To help such use cases, NoSQL (Not only SQL) databases allow for the storage and processing of different data types in a non-tabular fashion. NoSQL databases process unstructured data using flexible schemas to enable efficient storage and analysis for distributed, data-driven applications. By relaxing data consistency restrictions of SQL-based databases, NoSQL databases enable low latency, scalability and high performance for data access.  

The performance of SQL databases varies with the cluster size, the application’s configuration and network latency. This means that developers don’t have to worry about optimizing data structures, indexes and queries to achieve peak performance from the storage subsystem. NoSQL databases are popular with modern cloud applications since they use APIs for the storage and retrieval of data structures. This makes it easy to interface NoSQL databases with a host of microservice-based applications for agile, cloud-native deployment.

How AI Is Changing the IT and AV Industries

AI in the IT and AV Industries

As the IT (information technology) and AV (audiovisual) industries further develop their usage of artificial intelligence (AI), there is going to be an incredible amount of change that goes with it. AI has already transformed how we use computers and has lasting impacts on the future of several industries. This is especially true for sectors that rely heavily on technology.

Something to consider is how AI is affecting these two industries. Information Technology, for example, seems to be more focused on commercial clients, but AV tends to trend more towards residential clients (although there are plenty of business needs as well). This leads to a different approach to implementing AI in the technology and applications used within IT and AV.

base of Instagram accounts

Hello everyone.

I saw services on the Internet where you can search for keywords in the Instagram biography.

These services have their own base and they search for it and sell it later.

Are there forums on the Internet where there is already a parsed database in the form of a file, where I can search for myself by a keyword?

Open AI Codex Challenge Seen By the Participants

On the 12th of August, Open AI hosted a hackathon for all those interested in trying out Codex. Codex is a new generation of their GPT-3 algorithm that can translate plain English commands into code.

We at Serokell thought it would be interesting to try this out: right now free access to the beta is accessible only to a small group of people. One of our teammates got access to it after being on the waiting list for over a year.

query problem no error..(companyID=? doesn’t work)

  $company_id = $_SESSION['compid'];
  $sql="SELECT * FROM `movies` WHERE companyID = ? AND name LIKE '%$search%' OR description LIKE '%$search%' " ;
$stmt=mysqli_stmt_init($conn);
  if (!mysqli_stmt_prepare($stmt,$sql)) {
header("location:main.php?error=stmt failed");
exit();
}
mysqli_stmt_bind_param($stmt,"i", $company_id);
mysqli_stmt_execute($stmt);
$result = $stmt->get_result();

React Hooks vs. Redux: Choosing the Right State Management Strategy

In my day job, I work with a lot of React developers. When I ask them about their preferred state management strategy, I get a mixed response. Some rely on Redux, the popular state container for JavaScript applications, while others prefer React Hooks.  

In this article, I’ll explore both and introduce a hybrid third approach. Throughout, I’ll make useful recommendations based on experience and discussions I’ve had with developers building production-grade data visualization tools with our React SDKs.