Can you help me with my payroll program

I am trying to use many employees, but I do not how I can use case in my arrays. Could you help me, please?
 program StaffSal(input, output);
uses
  Crt;

const
  SalRate = 0.1;
  A   = 150;
  B   = 85;
  C   = 95;
  D   = 120;
type
  Employee = record
Names, Position: string;
OctSales, NovSales, DecSales, JanSales, MarchSales, AprilSales,
TotalSales, Salary, thPay: Real;
  end;

var
  Staff       : array[1..6] of Employee;
  q           : integer;
  TotalSalary : real;

begin

  for q := 1 to 6 do begin
Write('Enter Employee name : ')              ;         readln(Staff[q].Names);
Write('Horas laborales del da lunes: ')   ; readln(Staff[q].OctSales);
Write('Horas laborales del da martes: ')   ; readln(Staff[q].NovSales);
Write('Horas laborales del da mircoles: '); readln(Staff[q].DecSales);
Write('Horas laborales del da jueves: ');     readln(Staff[q].JanSales);
Write('Horas laborales del da viernes: ');     readln(Staff[q].MarchSales);
Write('Horas laborales del da sbado ');     readln(Staff[q].AprilSales);

Write('Ingresa categoria : ');     readln(Staff[q].Position);

Staff[q].TotalSales := (Staff[q].AprilSales + Staff[q].MarchSales + Staff[q].OctSales + Staff[q].NovSales + Staff[q].DecSales + Staff[q].JanSales);

//Staff[q].Salary := Staff[q].TotalSales * SalRate;

if Upcase(Staff[q].Position) = 'A' then     
 Staff[q].thPay := Staff[q].TotalSales * A
else
        Staff[q].thPay := Staff[q].Salary * D;    

   end;   

  TotalSalary := 0;
  for q := 1 to 6 do
    TotalSalary := TotalSalary + Staff[q].Salary;

  for q := 1 to 6 do
writeln('The total sales for the quarter is : ',
  Staff[q].Names, Staff[q].TotalSales: 10: 2);

  for q := 1 to 6 do
  begin
    writeln('Name ',          Staff[q].Names);
writeln('categoria ',     Staff[q].Position);
//writeln('Salary ',        Staff[q].Salary: 8: 2);
writeln('Take home pay ', Staff[q].thPay: 8: 2);
  end;

  writeln('Type the word FINISH to end the program :');
  readln;
  readln;

end.

How to Italicize Text

HTML and CSS offer us the ability to italicize text. I’m talking about text like this. Let’s cover everything you’ll need to know.

What is italic text and why would you italicize text?

You italicize text most often to call attention to it. Literally to emphasize a word, so that someone reading the sentence will give that word or phrase some extra oomph, as you might intend as the writer. Or, it might be following a particular style guide, like italicizing the title of something, say a published article.

Use the <em> tag

The “em” in <em> literally stands for emphasis. Browsers will, by default, make italicize text that is wrapped in HTML <em> tags.

<p>
  That was a <em>wonderful</em> party, Bebe.
</p>

Imagine the sound of that sentence, where the reader is emphasizing that word giving the sentence a different feel that if they didn’t.

Use the <i> tag

The <i> element is to apply italics to text without implying emphasis. It’s to visually set some text apart from other text without implying that a reader is applying extra weight to those words. Perhaps something like:

<p><i>Miranda thought:</i> What an interesting metaphor on the global economy.</p>
<p><i>Chris thought:</i> Is that mustard?</p>

What’s the difference between <i> and <em>?

One more time:

  • <em> is for emphasis
  • <i> is for italic text without the emphasis

If you’re tempted to use <i> for the title of something, like:

<p>
  The book 
  <!-- Not the end of the world, but... --> 
  <i>Mr. Penumbra's 24-Hour Bookstore</i>
  is good.
</p>

<p>
  The book 
  <!-- ...this is more semantically correct. --> 
  <cite>Mr. Penumbra's 24-Hour Bookstore</cite>
  is good.
</p>

Fortunately browsers italicize content wrapped in <cite> tags, just like <i> does, so no further work is required there if you’re citing a work (e.g. Moby Dick) or a publication (e.g. The New York Times).

Use your own HTML class and CSS

If the goal is set text apart visually, then we don’t have to reach for the <i> element. Spans have no semantic meaning and can be styled for visual emphasis:

<p>
  Shoes are <span class="emphasis">on sale</span> this week!
</p>
.emphasis {
  background: lightyellow;
  font-style: italic;
}

The CSS property font-style is the one you need for making text italic, which you can apply to any selector you like.

Watch out for “Faux Italic”

Not all fonts have italicized characters. Or, you might be in a situation where the italic version of the font isn’t loaded. In either case, the browser will try to fake it anyway, which almost always looks awful (or at least much worse than using an actual italic font). 

Nothing is going to warn you about this — you kinda just need an eye for it. Here’s an example of the font Merriweather in faux italic:

Unicode italics

There are a zillion characters available in Unicode, including letters that have an italic vibe.

You might use this when you don’t have HTML control to do things like italics like, say, on Twitter when composing a tweet.

The accessibility of this is awful. It will reach each character individually, making it (presumably, to me) hard to understand the word. Be very careful when using this, if you e even use it all.

Italics in variable fonts

This is a bit of an advanced concept, but there are things called variable fonts. They offer customization right in the browser. So rather than a second font file for the bold version, they have information in them to bold themselves with that one file. But “bold” is just an example of what a variable font might offer. Not all of them necessarily do.

A variable font might have a “slant” or “italic” option and you could apply that look that way.

v-fonts.com

There it is, five different answers to the question of when to italicize text. Hopefully this also helps with the next logical question: Which method should I use?


The post How to Italicize Text appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

All in One SEO Pack Plugin Patches XSS Vulnerability

All in One SEO Pack patched an XSS vulnerability this week that was discovered by the security researchers at Wordfence on July 10. The popular plugin has more than 2 million active installs, according to WordPress.org.

Wordfence researchers categorized it as “a medium severity security issue” that could result in “a complete site takeover and other severe consequences:”

This flaw allowed authenticated users with contributor level access or above the ability to inject malicious scripts that would be executed if a victim accessed the wp-admin panel’s ‘all posts’ page.

Version 3.6.2, released on July 15, 2020, includes the following update in the changelog: “Improved the output of SEO meta fields + added additional sanitization for security hardening.”

All in One SEO Pack users are strongly recommended to update to the latest version. At the time of publishing, just 12% of the plugin’s user base is running versions 3.6.x, which includes the three most recent versions. This leaves more than 1.7 million installations (88% of the plugin’s users) vulnerable.

Many users don’t log into their WordPress sites often enough to learn about security updates in a timely fashion. Plugin authors often don’t advertise the importance of the update on their websites or social media. This is the type of situation that WordPress 5.5 should help to mitigate, as it introduces admin controls in the dashboard that allow users to enable automatic updates for themes and plugins.

WPCampus Online 2020 Conference Features Accessibility and Higher Education Topics, July 29-30

WPCampus, a community focused on WordPress and higher education, will host its 5th annual in-person conference as a free, online event this year. The two-day event will feature sessions, lightning talks, sponsor demonstrations, and trivia, July 29-30, 2020.

Although the WPCampus community is no stranger to hosting online events (they usually host a virtual conference in January), current events have forced educational institutions to rely more heavily on those who maintain their digital infrastructure. Many WPCampus members fall into this category and are operating under a great deal more stress as compared to previous years. The community has more than 1,116 members representing 688 institutions.

“In higher ed, ‘wearer of many hats’ is a common saying,” WPCampus director Rachel Cherry said. “Per usual, most who work in our space are already going above and beyond to cover numerous job roles. For example, I was always a team of one: I designed the site, programmed the site, performed QA, and managed content editors. With the pandemic forcing many universities to increase their online presence, higher ed web professionals are busier than ever, working to help with the transition while bearing the stress of lowered budgets, working from home, and whether or not their physical campus will open for the fall semester.”

As many institutions are moving to make their courses available online, Cherry said ensuring that vital resources are accessible has become even more critical.

“The pandemic forced a vast majority of our society’s processes and interactions to go online, and it’s shining a spotlight on how inaccessible a lot of our systems are,” she said. “For example, online event platforms became a necessity for conferences. But the vast majority of these platforms are inaccessible. Crowdcast, for instance, is nearly impossible to use if you can’t use a mouse. Using inaccessible online platforms for your event is no different from denying attendee access at the door because the building doesn’t have a wheelchair ramp.”

WPCampus Online 2020 will include a selection of sessions from accessibility experts on topics such as justifying the budget for accessibility initiatives, accessibility for non-developers, Gutenberg accessibility, end-to-end accessibility testing, and mobile site and native app accessibility testing guidelines. If you are looking to deepen your knowledge of accessibility, this conference features more sessions on this topic than most WordCamps.

The event’s schedule also includes other topics of interest to those in higher education with sessions on managing multiple WordPress sites, building a self-publishing platform, extending the WP REST API, automation tools, data visualization for WordPress, and improving website performance.

In lieu of giving away swag for the event, WPCampus is coordinating a fundraising effort for the Black Lives Matter movement and those struggling with COVID-19. The organization will match donations to the following organizations:

  • Black Lives Matter
  • The American Civil Liberties Union (ACLU)
  • NAACP Legal Defense Fund
  • Black Girls Code
  • Feeding America

Cherry reports that more than 350 people have registered so far and she anticipates 500-600 attendees online this year. WPCampus will stream the session videos on YouTube and they will be recorded and available after the event. Registration is free, thanks the the event’s sponsors, which include many WordPress agencies, hosts, and contributing individuals.

Despite the disappointment at not being able to meet in-person in New Orleans this year, Cherry said she is grateful for the “more in-depth than usual” time the community will have to spend together during the virtual conference. WPCampus members have found camaraderie and encouragement in their community by sharing stories and asking each other for help during this profoundly challenging time.

“We’ve become a family,” Cherry said. “And not just with higher ed and other web professionals, but with the vendors that support us and want to invest in our growth. Because of our events and community, we were able to sponsor the Gutenberg accessibility audit and play a huge role in improving the accessibility of the WordPress platform. I am incredibly proud of the ever-increasing focus, education, and advocacy our community has placed on accessibility.”

Should WordPress Themes Add a Top-Level Admin Menu Item?

WordPress has almost always provided a top-level admin menu item for themes. It is clearly labeled “Appearance.” It is the single location that all WordPress users know to visit to modify any appearance-related things for their WordPress site. However, there is a movement within the Themes Team to allow themes to place an additional top-level menu link in the admin. The big question: should this idea move forward?

When the Themes Team (originally called the Theme Review Team) was formed, its members created a set of guidelines that would be shaped and reshaped over the years. They were a set of living guidelines that could always be changed with the times.

One of the oldest guidelines required that themes must place any custom admin pages under the Appearance menu item. It made sense. WordPress provided a standard location for any theme-related pages. The custom header and background features lived under Appearance. Widgets, also defined by the current theme, were housed as a sub-page. Eventually, WordPress’s custom nav menu system came along and was — you guessed it — situated under Appearance. The core developers even put the customizer link in the same place.

For over a decade, there was a well-defined standard. Sure, commercial themes outside of the official directory would sometimes break the mold. However, themes from the directory followed the pattern.

Now, the Themes Team is proposing that themes should be able to break from tradition.

The discussion arose after a question of whether themes should be able to add a custom panel to the block editor sidebar, which is not allowed.

“To keep the editor free from clutter, advertising and upsell, with the customizer being used less, and no dashboard widgets being allowed, can we give theme authors a better place to include their information, and limit upsell to that area?” wrote Carolina Nymark in last week’s team meeting notes.

The proposal seems to settle on the idea that themes will lose visibility as WordPress moves toward full-site editing and the customizer becomes less important. The customizer is not an ideal place for anything but theme options, but that notion seems to have been overlooked in the discussion. Nevertheless, the original guideline that disallowed themes from creating top-level menu items preceded the advent of the customizer by several years. Advertising, documentation, plugin recommendations, and similar pages were always allowed under the existing Appearance menu. The usefulness of the customizer was never a necessary part of that conversation.

Ultimately, the question should be about what is best for users. There is no data to support making the change or sticking with the status quo. However, we do have a standard that has existed for years.

The Proposed Guidelines

The proposal would create several new guidelines for theme authors to follow and reviewers to check, assuming the theme created a top-level admin menu item:

  • No admin menu priority may be used.
  • No UI or color changes are allowed for the menu item.
  • The title must be kept short and not include spam.
  • No more than three sub-pages.
  • Child themes are limited to one sub-page or can remove the parent’s pages and add its own.

Some of these make sense and follow along with existing guidelines, such as not spamming or changing the admin UI. However, others could be problematic.

If moving forward with the proposal, setting a menu item priority should be required rather than not allowed. If anything, it would make sense to require a specific priority to place the custom menu item immediately after the existing Appearance item. This would at least group them together by default. If changing the place where users are accustomed to seeing theme-related pages, it is probably best not to break too far from the standard location.

No more than three sub-pages? Surely there will be a theme with a top-level admin menu item that needs four sub-pages at some point. If giving theme authors the freedom to take up valuable real estate in the admin, a limit of three sub-pages seems like a rule to fix the mistake of allowing the top-level item in the first place. It is an arbitrary number at best. There would be no reason to cap it once making the guideline change. It also adds one more item that the team will need to police.

The limitation of sub-pages for child themes seems just as arbitrary. No such limitation exists when placing sub-pages under the standard Appearance screen.

The entire proposal is little more than extra work on a team that is already strained for resources.

Instead of the simple rule that has existed for years, the proposal adds a new rule with several sub-rules. If the team desires the extra work, I suppose this point doesn’t matter.

The Elephant in the Room

There is one aspect of this discussion that everyone knows about but few are willing to broach. Underneath all the guidelines from the Themes Team and whether most theme authors support a particular decision is how this affects the financial bottom line. When we talk about visibility of a theme’s admin pages, we are primarily talking about providing another avenue for commercial upsells.

Some of this discussion on visibility is shrouded in concepts such as surfacing end-user documentation or adding a visible readme for the user’s benefit. These are legitimate concerns, especially when theme developers have watched tickets to address such downfalls seemingly dwindle into obscurity over the years. Whether a top-level admin menu item makes sense for exposing theme documentation might be worth discussing, but there is no world in which this would be the primary use case.

The topic of visibility rests on the idea of upselling the pro version of the theme, add-ons, or other services.

Far too many plugins already go overboard, creating a billboard of the WordPress admin. One of the things users could almost be assured of is that themes from the official directory were constrained enough that they were not the hot mess that plugins have become as of late. However, that could all change.

Do we really want an extra top-level admin menu item that will be, for all intents and purposes, to advertise?

Maybe it doesn’t matter in the end. Users are so accustomed to the clutter produced by the dozens of plugins on their sites. One more may not matter at this point.

Or, should we be having a different conversation altogether? If this ultimately boils down to advertising, are there ways we can open this up for theme authors while still creating a user experience that keeps the WordPress admin free of clutter?

CSS Painting Order

Usually, when I see terms like “painting order” or “stacking context” my brain will start to shut off and my eyes will gloss over. Not that my brain doesn’t normally shut off more often than not, but that’s another topic for another time.

Martin Robinson over at Igalia touches on these concepts using an example that’s pretty easy to grok, even for me. He starts with two boxes that overlap with negative margins.

Then he introduces a third box that’s a child of the green box. The green box is given a z-index of -1. As you might expect, both the green and yellow boxes stack below the blue box.

Here’s where my brain started melting. If the z-index of the green box stays the same at -1 but we give it’s child a massive value, say 1,000, things look… exactly the same.

I’m sure many of you can already guess (or simply flat out know) why the blue box stays on top, even though changing the yellow box’s z-index implies it should be on top instead, but I sure didn’t. Martin found the technical answer in the CSS2 specification buried deep down in Appendix E, which he graciously linked up — otherwise, I’m sure I’d never have found it.

We learn from the Appendix E that a stacking context is an atomically painted collection of page items. What does this mean? To put it simply, it means that things inside a stacking context are painted together, as a unit, and that items outside the stacking content will never be painted between them. Having an active z-index is one of the situations in CSS which triggers the creation of a stacking context. Is there a way we can adjust our example above so that the third element belongs to the same stacking context as the first two elements? The answer is that we must remove it from the stacking context created by the second element.

So, yeah. As long as the yellow box is a child of the green box, the two form a stacking context that the blue box has no part of. Getting yellow above blue requires removing it from blue’s stacking context.

That’s the crux of Martin’s post, but he takes it even further and it’s worth heading over there. If you do, you’ll see how stacking order leads to some bonafide CSS tricks.

It’s not the first time we’ve linked up proof that z-index is not a level playing field so I’m going to try to commit this to memory the next (and inevitable) time I wrestle with stacking elements.

Direct Link to ArticlePermalink


The post CSS Painting Order appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

Why COVID-19 Makes App Security More Important than Ever

The United States is still hoping to fully reopen, but COVID-19 is more prevalent than ever, with the nation and many states reporting record daily infection rates. Even though employment has recovered somewhat, the country is still facing a more than 10% unemployment rate, and while many restaurants, stores and other physical businesses have reopened, people are not yet returning to them in the same numbers as before the pandemic.  

Develop, Preview, Test

Guillermo:

I want to make the case that prioritizing end-to-end (E2E) testing for the critical parts of your app will reduce risk and give you the best return. Further, I’ll show how you can adopt this methodology in mere minutes.

His test is:

  1. Spin up Puppeteer (Headless Chrome) and Chai
  2. Go to the homepage
  3. Test if the homepage has his name on it.

YES.

Just one super basic integration goes a long way. If your site spins up, returns a page, and renders stuff on it that you expect, a lot is going right. Then, once you have that, you can toss in a handful more where you navigate around a little and click some things. And, if it still works, you’re in pretty good shape.

I’ve had a little trouble with Cypress over the years, but you’ll probably have better luck than I did. Overall, I think it’s the nicest player in the integration test market.

Direct Link to ArticlePermalink


The post Develop, Preview, Test appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

Explaining the Difference Between Web and Mobile App Testing

If a product has a web and a mobile version of an application, their functionality is almost identical. The app QA process, however, will flow differently for each platform due to their particularities.

A mobile application has become an umbrella term that covers three different types of apps – native, PWA, and hybrid. Each is coded in a specific way and has some distinctive features. 

Why Builder Is Often an Antipattern and How to Replace it With Fluent Builder

The Builder Pattern is extremely popular in Java applications. Unfortunately, it's often misunderstood and incorrectly applied, which results to runtime errors.

Let's remember the purpose of Builder: set only necessary fields in some object and keep remaining fields set to default values. For example, if we're preparing a configuration object, then it's convenient to change only the necessary parameters and keep other parameters set to default values. 

Managed Scheduled Executor Service vs EJB Timer

Over the past years, I always used EJB Timer Service to implement scheduled tasks in my Java Enterprise applications. Since Java EE7, the ManagedScheduledExecutorService is a new pattern to implement a scheduler service. The ManagedScheduledExecutorService is part of the SE ScheduledExecutorService and provides methods for submitting delayed or periodic tasks for execution.

Implementing a ManagedScheduledExecutorService is quite simple. See the following example:

Security With Falco

Introduction

Securing a container platform is a multi-step process spanning from development to production. The process of securing containers is continuous. It should be integrated into your development process, automated to remove the number of manual touchpoints, and extended into the maintenance and operation of the underlying infrastructure. Container security thus is the process of implementing security tools and policies to ensure that your container is running as intended.  

docker containerThere are a lot of Docker security practices and Kubernetes security practices. But there are gaps: there could be Image vulnerabilities or container abnormalities still. Some of these can be captured and addressed using various static container image scanning tools. But there is a need to analyze the container behavior at run-time to detect any bogus configurations, which are intentional or not, leading to data loss, security intrusions, and eventually leading to different vulnerabilities. If a container is not running as expected, then it could attack that exploited an existing vulnerability. So the run-time container scanning is essential to detect any action that deviates from the norm.

Ultimate Guide for Using Redux With React Native

Redux is a popular React and React Native state management library, meant to be used in complex React and React Native apps where sharing state between multi-level components can get extremely difficult to manage. In this article we are going to learn how to use Redux with React Hooks by building a real React Native app.

This is how the final app will look like:

Best Practices in Software Development: Interface Overuse

“Program to interface, not to implementation” doesn't mean you should pair each and every one of your domain classes with a more or less identical interface. In doing so, you are violating YAGNI, and lowering the readability and maintainability of your codebase.

Extracting an interface from a class just so it has one, has this annoying feature that whenever you try to navigate using your IDE, you end up in the interface rather than the implementation itself. I see no practical use case in jumping to the signature declaration instead of the implementation itself. It’s annoying, a waste of time, a huge overkill, and completely useless, in general. What would you say to an experienced developer that adds an interface to a DTO class?!

Java High Availability With WildFly on Kubernetes

Legacy Java Applications

With the advancement of the dockerization of applications, Kubernetes has become a standard in the market, but we must remember that there are still thousands of legacy applications that depend on certain features provided by the application servers. So, if you need to use session replication, you will surely need Wildfly instances to be clustered. To solve this smoothly, you can use the “Kubernetes discovery protocol for JGroups” aka “KUBE-PING”. KUBE_PING is a discovery protocol for JGroups cluster nodes managed by Kubernetes: jgroups-kubernetes.

Walkthrough

I assume you already have a Kubernetes cluster, so let’s just focus on WildFly settings.