Categories
Learning Tech

What does this actually means: Warning: The signer’s certificate is self-signed. POSIX file permission and/or symlink attributes detected.

If you encounter this warning message on CLI

What does this actually means: Warning: The signer's certificate is self-signed. POSIX file permission and/or symlink attributes detected. These attributes are ignored when signing and are not protected by the signature.

on after your local Android APK build for release version, basically it means, as learned from AI source to understand it real cause of the warning, so no need to worry much, you can continue reading the details for more understandings.

It indicates that the certificate used to sign the file is self-signed, meaning it was generated by the developer rather than being issued by a trusted certificate authority.

Additionally, the warning mentions POSIX file permission and/or symlink attributes. POSIX refers to the Portable Operating System Interface, which defines a standard set of APIs for compatibility between different Unix-like operating systems. The warning suggests that the file permissions and symbolic links present in the file are ignored during the signing process and are not protected by the digital signature.

This warning is informational and does not necessarily indicate an error or problem. Self-signed certificates are commonly used during development or testing stages, but for production or public distribution, it is recommended to use certificates issued by trusted certificate authorities.

If you are encountering this warning while signing an APK file, you can consider obtaining a certificate from a trusted certificate authority to replace the self-signed certificate. This will provide users with more confidence in the authenticity and integrity of the application. However, if you are using a self-signed certificate for personal or internal use, you can generally ignore this warning as long as you trust the source of the file and its contents.

It’s important to note that the warning regarding POSIX file permission and symlink attributes being ignored during signing does not have a significant impact on the functionality of the signed file. The signature primarily ensures the integrity of the file contents and detects any modifications made after signing.

Happy Learning!

Categories
Learning Social

YouTube Key Color #FF0000


YouTube was founded by three former PayPal employees: Chad Hurley, Steve Chen, and Jawed Karim. They created the platform in February 2005 and launched it to the public in November 2005. The idea for YouTube came about when the founders had difficulty sharing videos from a dinner party, inspiring them to create a platform where users could easily upload, share, and watch videos online. The website quickly gained traction and popularity, eventually becoming the largest online video-sharing platform in the world.

Let
‘EM
VIDEOS

Chad Hurley, Steve Chen, & Jawed Karim

Categories
Learning Social

Facebook Key Color #1877F2

Facebook was founded by Mark Zuckerberg, along with his college roommates Eduardo Saverin, Andrew McCollum, Dustin Moskovitz, and Chris Hughes. Mark Zuckerberg, a Harvard University student at the time, launched Facebook in February 2004 as a social networking website initially limited to Harvard students. It later expanded to other universities, and eventually became available to the general public, gaining widespread popularity and becoming one of the largest social media platforms in the world.

Let
‘EM
NETWORKING

Mark Zuckerberg

Eduardo Saverin, Andrew McCollum, Dustin Moskovitz, and Chris Hughes

Categories
Learning Social

Instagram Key Color #833AB4


Instagram was founded by Kevin Systrom and Mike Krieger. They launched the photo-sharing platform in October 2010. Kevin Systrom initially developed the idea for Instagram as a location-based social network called “Burbn” before pivoting to focus on photo-sharing, which eventually led to the creation of Instagram as we know it today.

Let
‘EM
Roll

Kevin Systrom & MIKE KRIEGER

Categories
Javascript Learning Tech

Function getStaticPaths, How to create paths in getStaticProps function If you have no access to create paths in getStaticPaths, NEXTJS

Hello,

Hope this is very interesting question of scenario you might be facing to solve with next js and

  • when you don’t want to use “function getServerSideProps” to pass dynamic (data as) props to the page components
  • when you don’t want too make a extra API calls to generate the paths for products or whatever list of thing you are creating in “function getStaticPaths”

Here is the quick things we need to work out to work this out of box for specially the scenario were are showing product detail view page which is of route like in Nextjs as “page/product/[id].js

First in function getStaticPaths() we just need to do this and pass fallback as “true” as we our dynamic path is not pre-rendered!

export async function getStaticPaths() {
    // Empty array since paths will be dynamically created in getStaticProps
    return {
        paths: [],
        fallback: true, // Set to true if there are dynamic paths that are not pre-rendered !! 
    };
};

Next, we need to edit our “getStaticProps” function and then voila;


export async function getStaticProps({ params }) {
    const product = await getProduct(params && params.id);
    if (!product) {
        return {
            redirect: {
                destination: '/',
                permanent: false,
            },
        }
    }

    return {
        props: {
            product,
            error: resp.error ? true : false
        }
    };
}

Boom you are done, and just use those props in your page component like



return (<PhotoProvider
        key={'photoprovider-key-' + product?.id}
        speed={() => 600}
        easing={(type) => (type === 2 ? '' : 'cubic-bezier(.25, 1, .30, 1)')}>

/*...other codes*/
</PhotoProvider>

you will find you page up and working, fine!

Hope this simple steps helps to solve our complex situations arises in the development work of software building on planet earth!

I would also like to the above situation, why we can’t just do the same thing simply with getServerSideProps in single function, I am facing the issue to build using next build && next export for android package, as dynamics cannot be rendered as html files due to getServerSideProps sitting in between, and also as per the Next JS docs we can’t do anything what I have found of my learnings.

Happy Learning! Thanks for reading.

Keep coding & Develop Wonderful.

To Follow help out to know: uidevwork

Categories
Javascript Learning Tech

What is forwardRef and how its helps in react?

Hello, lets quickly take a review on React forwardRef, what it in actual,

In React, the forwardRef function is a utility that allows you to pass a ref through a component to one of its children. It’s commonly used when you need to access the underlying DOM node or React component instance of a child component from the parent component.

When you create a component using functional components in React, you can use the useRef hook to create a ref object. This ref object can then be passed as a prop to child components. However, when you pass the ref as a prop to a child component, React does not automatically pass it down to the underlying DOM element or custom component. This is where forwardRef comes into play.

By using forwardRef, you can create a component that accepts a ref and forwards it to one of its children. Here’s an example:

const ChildComp = React.forwardRef((props, ref) => {
  // Use the ref object to access the underlying DOM node or component instance
  return <input ref={ref} />;
});

const ParentComp = () => {
  const inputRef = React.useRef(null);

  const handleClick = () => {
    // Access the input element using the ref
    if (inputRef.current) {
      inputRef.current.focus();
    }
  };

  return (
    <div>
      <ChildComponent ref={inputRef} />
      <button onClick={handleClick}>Focus Input</button>
    </div>
  );
};

In the example above, the ChildComponent uses forwardRef to forward the ref prop to the <input> element. In the ParentComponent, a ref is created using the useRef hook and passed to ChildComponent using the ref prop. This allows the ParentComponent to access the input element and call the focus method when the button is clicked.

By using forwardRef, helps to bridge the gap between functional components and the imperative DOM or component operations that sometimes require direct access to child component element.

Note here we are accessing child’s component dom node not child component here as ref object, i.e can be consider as subtle difference to understand for our mind.

Hope this helps to clear out the basic concept behind using forwardRef in React.

Happy Learning!

Categories
Javascript Learning Tech

How to fix nextjs appending http://localhost:3000/_next/image? to the image srcset how to remove for production build for images?

Hello,

Welcome to the question and for the search, facing this issue? lets quickly see how we can fix this, with and in next.config.js file.

In Next.js, when using the next/image component, the src attribute is automatically transformed to a URL that goes through the Next.js image optimization pipeline. During development, this URL may include http://localhost:3000/_next/image? to indicate the local development server.

However, for production images, you can configure Next.js to remove the http://localhost:3000/_next/image? prefix. Here’s how you can achieve that:

Create a custom loader for Next.js images:

  • Open next.config.js and add the following code:
    • module.exports = {
    • images: {
      • loader: 'imgix',
      • path: '', // Remove the path prefix for production images
    • }, };
  • This configuration sets the loader option to use the imgix loader, which removes the http://localhost:3000/_next/image? prefix. The path option is set to an empty string, this will leave the prefix for image urls and left blank

Now you can easily build your project and test to images are loading fine with absolute url path if applied so.

Hope this help to solve the issue.

Happy Learning!

Categories
Learning Learning Tech

How to sync generated next.js out folder build to android/android studio in capacitor?

Hello, Welcome to the feel and question.

Here is a quick way do it out!

Build the Next.js project: Run the build command for your Next.js project, which typically generates a production-ready build in the “out”/ “build” folder.

npx next build && npx next export

Locate the build output: Once the build process is finished, locate the generated “out” folder in your Next.js project directory.

Copy the build output: Copy the entire contents of the “out” folder, including any subfolders and files.

Paste the build output in the Android project: Navigate to the root directory of your Android project in Capacitor. The default location is usually the “android” folder within your Capacitor project.

Paste the build output: Paste the contents of the “out” folder into the appropriate location in your Android project. By default, you can paste it into the “app/src/main/assets/public” directory of your Android project.

Sync the Android project: After pasting the build output, trigger a sync operation in Android Studio to ensure the changes are recognized. This can be done by clicking on the “Sync Project with Gradle Files” button or by selecting “File” -> “Sync Project with Gradle Files” in the Android Studio menu.

Build and run the Android project: Once the sync operation is complete, you can build and run your Android project to deploy the updated Next.js web application within your Capacitor app.

Voila you are done!.

Hope this question and learning helps.

Happy Learning!

Categories
Learning Learning Tech

Laravel getting error: Target class [App\Http\Controllers\GurbaniReadingController::class] does not exist. But file already exists!!

Hello Guys,

Facing this issue and struggling to find the cause?, okay then lets direct jump in to the fix I found or more precisely mistake I found!

In picture you might seeing controller name is different than I have mentioned below; I am changed it to Book, so don’t get confuse.

In my case I was wrapped the loading on controller in web.php route with single quotes!

Line of code causing this error:

Route::get('/book-readings/upload-photos', ['App\Http\Controllers\BookReadingController::class', 'uploadPhotos']);

Very carefully watch in above code code was wrapped in quotes: ‘App\Http\Controllers\BookReadingController::class’,
Controller should be loaded without single quotes;

And second important reason is it, this line should shall fall before the resource route if you have similar to this controller, in my case it was :

Route::resource('/book-readings', App\Http\Controllers\BookReadingController::class); 
// this line was defined before the above route I wanted to work! (I am not sure why this line causing to stop showing the page :/)

Finally I make these changes so everything started working smoothly & all routes loading fine and up!.

// Upload Audio Files:
Route::get('/book-readings/upload-photos', [App\Http\Controllers\BookReadingController::class, 'showPhotos'])->name('book-readings.upload-photos');
Route::post('/book-readings/upload-photos', [App\Http\Controllers\BookReadingController::class, 'uploadPhotos']);
Route::delete('/book-readings/upload-photos/{id}', [App\Http\Controllers\BookReadingController::class, 'destroyPhoto']);

Route::resource('/book-readings', App\Http\Controllers\BookReadingController::class);

Hope this will give you a hint to point the issue you might come up like this mostly when we are new and learning and developing new things!

Happy Learnings

Categories
Blog Learning

Curios Question: Wanted to know how much rate would cost me running 10W Laser Machine for 14 mins?

Hello

Welcome here, If you also wondering how much it would cost us for running certain electrical appliance at home for our small work or business and you wondering how to make those calculations to find the rate for that mins or hours of machine running assuming just its running in your home nothing else.

If you were looking for similar answer, lets dive how I have tried to find it out myself with help of latest tech programs online!

Lets Dig In!

Here how I frame my question using the data from my latest Electricity Bill (In India, I am using Tata Power the great source of electricity provider to the nation!)

Based on following data 101-300 Units Energy Charge: 5.65 rupee /kwh, RA charges 0.00 rupee /kwh, CSS charges: 0.35 rupee /kwh, Wheeling Charges : 2.21 rupee /kwh, Fixed Demand Charges: 125.00 rupees, ED 16.00%, Tose: 0.2604 rupee /kwh
If I am running a single machine of 10W laser for 14 mins how much my electricity bill would be?

Question I formed to put in the mouth of AI tool 😛

Here is how AI calculated from the above that and calculate out the result for me:

To calculate the electricity bill, we need to convert the power consumption of the machine from Watts to kilowatts and then multiply it by the energy rate per unit.


10 W = 10/1000 kW = 0.01 kW

The time period is 14 minutes, which we need to convert to hours:

14 minutes = 14/60 hours = 0.2333 hours

The total energy consumption can be calculated as:

Energy consumed = Power x Time = 0.01 kW x 0.2333 hours = 0.002333 kWh

Now, we can calculate the energy charges, demand charges, and other charges as follows:

Energy Charges = Energy consumed x Energy rate per unit
= 0.002333 kWh x 5.65 Rs/kWh = 0.0132 Rs

Fixed Demand Charges = Fixed Demand Charges per billing cycle
= 125.00 Rs (for a single machine)

Wheeling Charges = Energy consumed x Wheeling charges per unit
= 0.002333 kWh x 2.21 Rs/kWh = 0.0051 Rs

CSS Charges = Energy consumed x CSS charges per unit
= 0.002333 kWh x 0.35 Rs/kWh = 0.0008 Rs

ED Charges = Energy charges + Wheeling charges + CSS charges
= 0.0132 Rs + 0.0051 Rs + 0.0008 Rs = 0.0191 Rs

Taxes and Other Surcharges = Energy charges + Wheeling charges + CSS charges + ED charges x Tose rate
= 0.0191 Rs x 0.2604 = 0.00498 Rs

Total Electricity Bill = Energy Charges + Fixed Demand Charges + Wheeling Charges + CSS Charges + ED Charges + Taxes and Other Surcharges
= 0.0132 Rs + 125.00 Rs + 0.0051 Rs + 0.0008 Rs + 0.0191 Rs + 0.00498 Rs
= 125.043 Rs (rounded off to two decimal places)

Therefore, if you run a single 10W laser machine for 14 minutes, your electricity bill would be approximately 125.043 Rs.

Then I said Wow so nice and quick, isn’t it?

But then thought & put my attention on the Fixed Demand Charges which 125/-, would it be a for day? then I thought No its for a month, so how it would calculate for a day? it simply as you would also know this to divide in my number of days in a month, right?

So to see if AI response the result back with more in detail with assuming and consuming similar data passed before, here is reframed question I have put (in the mouth of AI tool)

can you do this divide fixed charges by month of days and return everything again?

question for AI tool

This is what it finally answered back;

Sure, to calculate the fixed demand charges per day, we can divide the monthly fixed demand charges by the number of days in the month.

Assuming a 30-day billing cycle, the fixed demand charges per day would be:

Fixed Demand Charges per day = Fixed Demand Charges per month / Number of days in the month
= 125.00 Rs / 30 days
= 4.1667 Rs per day

Now, we can calculate the updated energy charges, wheeling charges, CSS charges, ED charges, and taxes and other surcharges per unit of energy consumed, which would be:

Energy Charges = 5.65 Rs /kWh
Wheeling Charges = 2.21 Rs /kWh
CSS Charges = 0.35 Rs /kWh
ED Charges = Energy charges + Wheeling charges + CSS charges
= 5.65 Rs/kWh + 2.21 Rs/kWh + 0.35 Rs/kWh
= 8.21 Rs/kWh

Taxes and Other Surcharges = ED charges x Tose rate
= 8.21 Rs/kWh x 0.2604
= 2.1384 Rs/kWh

To calculate the total electricity bill for running a 10W laser machine for 14 minutes per day, we can use the same method as before, but now we have updated values for the fixed demand charges, ED charges, and taxes and other surcharges.

Energy consumed per day = Energy consumed per hour x Hours per day
= 0.01 kW x 0.2333 hours/day
= 0.002333 kWh/day

Energy Charges per day = Energy consumed per day x Energy rate per unit
= 0.002333 kWh/day x 5.65 Rs/kWh
= 0.0132 Rs/day

Fixed Demand Charges per day = Fixed Demand Charges per month / Number of days in the month
= 125.00 Rs / 30 days
= 4.1667 Rs/day

Wheeling Charges per day = Energy consumed per day x Wheeling charges per unit
= 0.002333 kWh/day x 2.21 Rs/kWh
= 0.0051 Rs/day

CSS Charges per day = Energy consumed per day x CSS charges per unit
= 0.002333 kWh/day x 0.35 Rs/kWh
= 0.0008 Rs/day

ED Charges per day = Energy charges per day + Wheeling charges per day + CSS charges per day
= 0.0132 Rs/day + 0.0051 Rs/day + 0.0008 Rs/day
= 0.0191 Rs/day

Taxes and Other Surcharges per day = ED charges per day x Tose rate
= 0.0191 Rs/day x 0.2604
= 0.00498 Rs/day

Total Electricity Bill per day = Energy Charges per day + Fixed Demand Charges per day + Wheeling Charges per day + CSS Charges per day + ED Charges per day + Taxes and Other Surcharges per day
= 0.0132 Rs/day + 4.1667 Rs/day + 0.0051 Rs/day + 0.0008 Rs/day + 0.0191 Rs/day + 0.00498 Rs/day
= 4.2098 Rs/day

Therefore, if you run a single 10W laser machine for 14 minutes per day, your electricity bill would be approximately 4.2098 Rs/day

Hurray! Isn’t it fun?

Hope you enjoyed this puzzle solving question answer game when really you want to know the difficult question you have all time in our head, but latest techs help’s out in secs with such quick answers!

Keep exploring keep learning!

Source : Open AI Chat GPT

P.S. Not sure what it calculated it reflect exact what we are looking, I assuming it calculated to be accurate!