Converts a number of seconds into days, hours, minutes, and second?.

i am trying to Convert a number of seconds into days, hours, minutes, and seconds. using pointers but something seems wrong . can somone tell me what is the problem and how to solve it. it keeps telling me
error: function definition is not allowed here

#include <stdio.h>
#include <stdlib.h>

void to_dhms(int total_s, int *d, int *h, int *min, int *s);


int main(void)
{
  int seconds_in, days, hours, minutes, seconds, scan_count;

  printf("Enter a number of seconds that is >= 0: ");
  scan_count = scanf("%d", &seconds_in);  
  if (scan_count != 1) 
  {
    printf("Unable to convert your input to an int.\n");
    exit(1);
  }
  if (seconds_in < 0) 
  {
    printf("%d s is out of range!\n", seconds_in);
    exit(1);
  } 

  printf("Doing conversion for input of %d s ... \n", seconds_in);

  int main(void)
  {
    printf("That is %d day(s), %d hours(s), %d minute(s), %d second(s).\n",
         days, hours, minutes, seconds);

  return 0;
  }

}
void to_dhms(int total_s, int *d, int *h, int *min, int *s);
{
  days = seconds_in / 86400;
  seconds = seconds_in % 86400;
  hours=seconds_in / 3600;
  hours= hours %3600;
  minutes= seconds_in / 60;
  minutes= seconds_in %60;
  seconds = seconds_in% 60;

}

Bought a laptop after 2 weeks later its locked

I bought a high end laptop off a guy I met in a pub he showed me the laptop and it was working fine and everything seemed absolutely fine, however 2 weeks later I goto login and it has been locked by the company it has been stolen from so the dodgy gut sold me a stolen laptop, now I know I should just take the loss as I bought a stolen laptop but I didn't know that and it was literally the last money I had which was for a laptop, I have tried resetting it but its definitely a lot harder to unlock than simply installing a new operating system I need to somehow find out how to hack into it to unlock it, I know this is morally wrong so I'm not expecting a lot of replies but I need to ask as I can't afford to just lose it, thanks for your help, Kind Regards Gareth

The HeroPress Network Launches as a Multi-Project Portal

Husband-and-wife duo Topher and Cate DeRosia announced the launch of the The HeroPress Network earlier today. It is a collection of content from various sites they are working on in a centralized location.

“Its overarching goal is to be a hub,” said Cate DeRosia. “It will display the newest items from around the HeroPress Network, as well as news from the community (to be added in shortly). We can also post information that we think is helpful or educational.”

The “hub” will incorporate content from at least eight projects:

The team launched WP Podcasts two weeks ago, making over 7,000 current episodes from dozens of WordPress shows available in one place. Find It WP is currently in beta and will be the next project to launch on or before October 19. They will soon launch the public Slack group with dedicated channels for different types of professionals.

Screenshot of a portal-style website that pulls in content from various sources.
The HeroPress Network homepage.

“You could say it’s like the portals of yesteryear,” said DeRosia. “With HeroPress expanding into 8+ or more entities, we wanted one place for people to go and get the most current glimpse of what’s happening.”

She also teased the idea of expanding their educational offerings in the announcement post. However, news on that will have to wait until they build out the projects currently underway.

The team will open funding options on October 24. The HeroPress Network is a for-profit company, but its goal is to make all of its content available for free to the community as a whole.

The original HeroPress.com website did not hit its funding goal in 2015. It attracted 33 backers who pledged $21,855 of its $60,000 AUD goal on Kickstarter. There was some early pushback, particularly from WordPress lead developer Andrew Nacin who cited its “unambiguous hero worship” and the initial male-only lineup of speakers as problems. However, much has changed in the six years since the fundraiser.

DeRosia called the first fundraising event a test to see how the community would receive it. The project has never been funded financially since then. Hosting and resources have been provided for the project, and a few other companies have occasionally donated toward their time and tools.

Despite failing to raise their initial funds, the project continued onward. Today, HeroPress has been a success by simply providing a platform for people to share their journeys in the WordPress world.

Andrey “Rarst” Savchenko wrote the first essay in March 2015. Since then, the site has published over 200 others.

“It’s always been a challenge to figure out how to fund the project,” said DeRosia. “When the pandemic hit and sponsors had money they couldn’t use on WordCamps, they started some conversations with us. We’ve been kicking around ideas since then and feel The HeroPress Network gives us the best resource for reasonable funding. We want to be giving value back to both the community and supporters, and the diversity of what makes up the Network provides more options.”

If everything falls into place, DeRosia herself or one of their daughters could have a salaried position for the project. Her background is in English and journalism, and she described it as a “dream job.”

I asked DeRosia why she was personally vested in this project. What was it that got her up every morning to build it?

“Topher and I both grew up rural poor here in the US,” she said. “We come from communities dying because there aren’t jobs. WordPress has always been such an excellent answer to this.

“With HeroPress.com we’re able to provide a stage where people can tell their stories of how they’ve built their lives regardless of where they lived or what circumstances they were living in. That’s great, but it only goes so far.

“Now with The HeroPress Network, we can provide simplified, searchable access to practical tools that anyone can use to craft the life they want using the WordPress platform. We can also demonstrate how community and business can work together to get the best for both.

“If the option for something better is out there, I want to help people find it. Helping new people get started in WordPress brings a richness to the community that it needs to thrive. Helping established businesses connect with people and resources continues the growth.

“It’s just so incredible to have the privilege to see people build relationships that allow them to flourish. And who wouldn’t get out of bed every morning to do that?”

Websites We Like: MD Nichrome

Here’s a beautiful website: it’s a type specimen for Mass-Driver’s ever-so-lovely type family MD Nichrome. There’s a ton of nifty animations and graphics explaining all the features inside…

If you’re wondering how those animations work, they’re actually styled <video> elements.

There’s lots of great graphic design touches as well, such as how the letters below trail off and fade away…

That little bit of CSS is neat. It makes sure that each <h1> stays on a single line with white-space, then sets hidden overflow on them so the heading trails off. The fading is courtesy of a linear gradient that incorporates transparency. The gradient is actually a mask-image in this case. That’s a good reminder that CSS gradients are images generated by the browser.

h1 {
  white-space: nowrap;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, black 75%, transparent);
}

In the image above you can also see how Mass-Driver is advertising the OpenType features of the font. That’s stuff like fractions or alternate letters that gives your text superpowers. By default, these sections show what the feature is, but when you hover over them they do the following:

.element {
  font-feature-setting: unset;
}

I don’t think I’ve ever used unset before but this is a great place to use it—show what the feature looks like up front and then when you hover show what the default is. Smart stuff.

But the part that caught my eye—besides the kick ass typography—is the background. It’s made up of two parts: a shimmery animation that makes the page look like paper, and the gradient that’s stacked on top of it. And after digging around in DevTools I realized that shimmering effect is a PNG image where the background-position property moves the picture around slightly to animate it like a GIF. It’s hard to see in pictures, so here’s a copycat demo I made with the opacity turned off to make it easier to see:

See that lovely fuzziness? It gives the background a kind of… texture… that I haven’t seen for a long time, perhaps since around 2008 when everyone was trying to make buttons look like real, analog buttons on the web. Geoff covered the same sort of technique a while back where you can get a deep dive into how it works.

The other part of the design of this website is the gradient in the background. How are those so smooth? Well, Rutherford Craze, the designer behind this ingenious bit of web design, made a thread explaining how he got this effect to work in the browser. He created a gradients tool that lets you create a similar effect:

Rutherford writes:

Conventional CSS gradients plot a straight line through colour space, interpolating directly from the start to the end colour. This tool applies the principles of bézier curves, the basis of digital fonts, to this operation.

By introducing ‘control points’ along the gradient, you can more finely control the interpolation and produce a smoother end result. The tool then samples this ‘bézier gradient’ to produce a linear gradient you can work with in CSS.

What Rutherford is describing above is what’s known as the “Gray Dead Zone” of gradients, where often in a linear gradient there’s this gray color that forms in the middle.

Another small detail that I almost didn’t catch was the sticky navigation: when you first load the website you just see the logo with nothing else, but then as you scroll you’ll see the nav and it locks into place:

Notice how sticky positioning is also used later on to demonstrate the font’s glyphs.

CSS makes this sort of thing so easy. Declare sticky positioning on the element, then offset the stickiness if the element should start sticking at a certain spot.

.sticky-thing {
  position: sticky;
  top: 75px;
}

Since they want you to focus on the letters first and not all the rest of the UI, it makes a ton of sense to put the navigation off to one side, only when you need it. And this makes the overall design feel incredibly focused and straightforward, barely worth commenting on at all perhaps, but when most websites are so full of distractions then I think it’s worth celebrating quiet websites like these.


The post Websites We Like: MD Nichrome appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

The Single Page App Morality Play

Baldur Bjarnason brings some baby bear porridge to the discussion of Single Page App (SPA) vs. Multi Page App (MPA).

Single-Page-Apps can be fantastic. Most teams will mess them up because most teams operate in dysfunctional organisations. Multi-Page-Apps can also be fantastic, both in highly functional organisations that can apply them when and where they are appropriate and in dysfunctional ones, as they enforce a limit to project scope.

Both approaches can be good and bad. Baldur makes the point that management plays the biggest role in ensuring either outcome.

Another truth: there are an awful lot of projects out there that aren’t all-in on either approach, but are a mixture. I feel that. I also feel like there is a strong desire to declare a winner or have a simple checklist to decide which approach to go for, and that just ain’t gonna happen because the landscape is too shifty and there are just too many factors. Technology: it’s complicated.

A recent episode of Web Rush went into all this as well:

Direct Link to ArticlePermalink


The post The Single Page App Morality Play appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

How to Scale Engineering Processes w/ Twitter’s VP of Engineering

Maria Gutierrez is the VP of Engineering for Strategy and Operations at Twitter. She joins a special livestream of the Dev Interrupted podcast to share her career journey, her strategies for sustainably scaling engineering teams and the three pillars of engineering processes. 

In a first for the Dev Interrupted podcast, I hosted this episode live in front of a virtual audience during the INTERACT engineering leadership conference. Maria was a fantastic guest, sticking around after her interview to take questions from the audience. Her lessons on team management, building company culture, hiring and mentorship are not to be missed!

Real Devices vs Emulators: Where Do You Test App Performance?

When testing the performance of a native Android or iOS app, choosing the right set of devices is critical for maximizing your chances of success. Differences in OS, screen size, screen density, and hardware can all affect how an app behaves and impact the user experience. In order to ship new updates of your app with confidence, you should efficiently analyze app performance during development to identify issues before they reach the end-users. This post will discuss what the best approach is to using emulators versus real devices for mobile performance analysis. 

Mobile Performance on Emulators/Simulators

Emulators are often free and easy to install. They can be useful for testing development processes, but they don’t always do a thorough job of testing app performance. Here are five key reasons why using emulators isn’t the best approach for testing native app performance:

First Look at WordPress’ Upcoming Twenty Twenty-Two Default Theme: “The Most Flexible Default Theme Ever Created for WordPress”

Twenty Twenty-Two, the new default theme coming in WordPress 5.9, was unveiled today on WordPress.org. The design goes full steam ahead in support of full site editing and new customization capabilities.

Like its predecessor, Twenty Twenty-One, the new default theme makes some bold design choices wrapped around a central theme. In this case it’s bird illustrations, complemented by Source Serif Pro for headlines, and a delicious array of patterns for limitless combinations.

Image Credit: Introducing Twenty Twenty-Two

The theme will be developed on GitHub until it’s ready to be merged into core. Kjell Reigstad, an Automattic sponsored full-time design contributor to WordPress.org, is leading the design with Jeff Ong leading development. In the announcement he sets expectations high for users to be able to make the theme their own.

“With the advent of Full Site Editing and Global Styles, themes are changing structurally and functionally to enable far more avenues for customization than users have come to expect in the past,” Reigstad said. “To take advantage of these new abilities, Twenty Twenty-Two has been designed to be the most flexible default theme ever created for WordPress.”  

In addition to the wide variety of patterns expected to ship with this theme, Twenty Twenty-Two will offer a lively selection of six pre-designed color palettes. Reigstad shared a video preview of how they instantly change the character of the theme. (see below) Combine this with the promise of being able to manipulate every aspect of the theme’s appearance through global styles, and users are in for a treat with WordPress 5.9.

“Twenty Twenty-Two will take advantage of a wide network of page templates, headers, footers, and other patterns so that users can easily make the theme their own,” Reigstad said. “In another nod to the behavior of birds everywhere, these will offer a balance between fun and utility: some are irregular and unpredictable, while others are straightforward and traditional. Together, these patterns will act as a window into all of the possibilities that the theme enables.”

The design preview for Twenty Twenty-Two has received overwhelming positive feedback on Twitter and in the comments of the announcement. Many users were excited to see a default theme that can be quickly transformed for so many applications. Too many default themes have only been applicable to a narrow set of use cases. In the past, users had little hope of being able to change things around to make the design work for their needs. Unrelenting progress on the block editor and full site editing has made it possible for Twenty Twenty-Two to become the most user-empowering default theme in WordPress’ history.

Reigstad said the theme will be “built for Full Site Editing first,” with as little CSS as possible, and all theme styles configurable through theme.json wherever possible, so users can edit them through Global Styles.

“Twenty Twenty-Two is designed with the acknowledgement that its default appearance is not most people’s endpoint,” Reigstad said. “Everyone deserves a truly unique website, built on a solid, well-designed foundation, and Twenty Twenty-Two aims to help them achieve that.”

Lyniate Launches New Healthcare API Gateway

Lyniate, a provider of healthcare data interoperability services, today announced the introduction of Lyniate Rapid. Rapid is a purpose-built healthcare API gateway and manager designed to help health teams create and safeguard APIs, including Fast Healthcare Interoperability Resources (FHIR)-based APIs like those required by the CMS Interoperability and Patient Access Rule.

Mule Runtime 4.4 Features

Mule runtime engine 4.4 provides important enhancements and fixes. Deploy all your new and existing applications to Mule 4.4 to benefit from all the improvements in this version.

Correlation ID Management

Mule 4.4 enables you to modify the correlation ID associated with a Mule event. You can also change the algorithm Mule uses to generate each correlation ID.

Audio Retrieval Based on Milvus

Sound is an information-dense data type. Although it may feel antiquated in the era of video content, audio remains a primary information source for many people. Despite long-term decline in listeners, 83% of Americans ages 12 or older listened to terrestrial (AM/FM) radio in a given week in 2020 (down from 89% in 2019). Conversely, online audio has seen a steady rise in listeners over the past two decades, with 62% of Americans reportedly listening to some form of it on a weekly basis according to the same Pew Research Center study.

As a wave, sound includes four properties: frequency, amplitude, waveform, and duration. In musical terminology, these are called pitch, dynamics, tone, and duration. Sounds also help humans and other animals perceive and understand our environment, providing context clues for the location and movement of objects in our surroundings.

Dive Into OAuth Grant Types and OpenID Connect Flows

In my last article, you could read about the differences between OAuth, SAML, and OpenID Connect. Today I want to continue the topic. We will dive deeper into the processes of authentication and authorization offered to us by respectively (OpenID Connect) and (OAuth). However, we will start with a few words about the naming conventions in both.

GrantTypes vs Flows — Semantic Difference

In general, both terms are correct and can be used simultaneously. Both of them describe the same thing – a process of obtaining an Access Token. Just keep in mind that the term “Grant Type” is more strongly related to OAuth, while the term “Flow” is more related to OpenID Connect. As a side note, I can add that the term “Flow” rarely occurs in the OAuth specification.

I want change this code(python) to c++ or c

print("Enter number of columns:",end=" ")
cols=int(input())
print(cols)
print("Enter number of rows:",end=" ")
rows=int(input())
print(rows)
print("")
side="right"0
print("[5][5] is cleaned")
for i in range(rows):
if side=="left":
    for j in range(1,cols):
        print("Move forward")
        print("[{i}][{j}] is cleaned".format(i=i,j=j))
else:
    for j in range(cols-2,-1,-1):
        print("Move forward")

        print("[{i}][{j}] is cleaned".format(i=i,j=j))
if(i!=rows-1):
    if side=="left":
        print("Turn right")
        print("[{i}][{j}] is cleaned".format(i=i+1,j=cols-1))
        side="right"
else:
    print("Turn left")
    print("[{i}][{j}] is cleaned".format(i=i+1,j=0))
    side="left"

Introduction To Pragmatic Functional Java

The Pragmatic Functional Java (PFJ) is an attempt to define a new idiomatic Java coding style. Coding style, which will completely utilize all features of current and upcoming Java versions and involve compiler to help writing concise yet reliable and readable code.

While this style can be used even with Java 8, with Java 11 it looks much cleaner and concise. It gets even more expressive with Java 17 and benefits from every new Java language feature.