Open-source News

Lenovo Yoga C630 Snapdragon Laptop Seeing Fresh Linux Improvements

Phoronix - Tue, 08/16/2022 - 17:23
When it comes to Linux on Arm laptops the recent excitement has been around the Asahi Linux porting work for the Apple M2 MacBooks and Linux 6.0 supporting the Qualcomm Snapdragon 8cx Gen3 and the flagship Lenovo ThinkPad X13s Arm laptop. Launched a few years ago though was the Lenovo Yoga C630 powered by a Qualcomm Snapdragon 850 and thanks now to the work of Linaro that older Arm laptop is seeing Linux support improvements...

My practical advice for new programmers

opensource.com - Tue, 08/16/2022 - 15:00
My practical advice for new programmers Sachin Samal Tue, 08/16/2022 - 03:00 1 reader likes this 1 reader likes this

Have you ever been stuck or gone blank trying to solve a problem related to something that you just learned from YouTube or Google tutorials? You seem to understand every line of the code, but without the tutorial, you find yourself in a difficult position. If you have looked at problem-solving in HackerRank or LeetCode, you can relate to how an aspiring programmer feels seeing those challenges for the first time. Everything seems out of the box! Being unable to apply what you learned from a tutorial might make you doubt your knowledge and abilities as you begin to understand the basics of the programming language you're learning.

Putting programming tutorials into practice

Should you start back at the beginning? If you do that, you may soon find that you've covered those topics more than enough times. Starting from scratch is not necessarily a waste, but how can you be more efficient?

Memorization is simply not the solution in programming. Having said that, you cannot neglect the importance of getting used to syntaxes. There is a significant difference between memorizing and making a habit. The latter is difficult to break. Make a habit of playing around with the programming language's regular syntaxes, functions, methods, patterns, paradigms, and constructs to ace it. Acing a programming language involves a lot of creativity and practice. It is essential to practice syntaxes until they flow as smoothly in your brain as the blood runs through your veins.

How problem-solving works

How you approach solutions depends on many factors. These factors could be anything from technical constraints to user needs. The world has innumerable problems and there are many ways of solving each. Deciding on the best way involves extensive problem-solving skills.

Here is a simple example. You need to achieve a result of 6 by adding two numbers. You can accomplish this several ways:

3+3=6 or 4+2=6 or 5+1=6

Similarly, say you need to achieve a result of 6 by using two numbers and either subtraction, division, or multiplication. You have many options, including:

8-2=6 or 12/2=6 or 3*2=6

Each solution may have a different constraint. You must consider all of these when developing effective real-world solutions. Is the solution feasible? Accessible? Interoperable? Scalable? Minimizing the constraint and developing an optimal solution depends on the business need and type of problem.

Programming and development Red Hat Developers Blog Programming cheat sheets Try for free: Red Hat Learning Subscription eBook: An introduction to programming with Bash Bash shell scripting cheat sheet eBook: Modernizing Enterprise Java Practice matters

The goal of programming is much more than problem-solving. Understanding how the code functions from an engineering perspective is always an advantage. That's where code reviews come into play at an enterprise level. The bare minimum requirement in programming is to have basic coding knowledge, including the language's syntaxes, functions, and methods. At the end of the day, coding is what you do, so practicing always helps improve your skills. Fluency in writing and developing complex solutions comes with consistent practice and learning.

Learning to code

My goal for writing and sharing this article is to encourage new programmers to seek the great problem solver in themselves. Please don't stop believing in yourself.

There are many habits to nurture for successful coding. Here are my ways of staying effective while learning to code:

  1. A cheat sheet of syntaxes, methods, and functions can come in handy.
  2. Break problems into smaller parts to make them easier to follow.
  3. Try to understand the core concept of how code functions.
  4. Try to improvise with your solutions but always stick to the basics in the beginning.
  5. Create as many applications and components as possible while practicing.
  6. Never copy/paste code from open platforms like stack overflow/exchange, especially without understanding the context.
  7. After following the tutorial, try to build everything from scratch. If you manage to accomplish half of it by yourself, that's still an achievement.

Good luck to all of us.

Being an efficient and curious problem-solver will help you succeed as a programmer.

Image by:

Opensource.com

Programming What to read next 5 ways to learn C programming on Linux Why I'm enjoying learning Rust as a Java programmer Learn JavaScript by writing a guessing game This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

A look inside an EPUB file

opensource.com - Tue, 08/16/2022 - 15:00
A look inside an EPUB file Jim Hall Tue, 08/16/2022 - 03:00 Register or Login to like Register or Login to like

eBooks provide a great way to read books, magazines, and other content on the go. Readers can enjoy eBooks to pass the time during long flights and train rides. The most popular eBook file format is the EPUB file, short for "electronic publication." EPUB files are supported across a variety of eReaders and are effectively the standard for eBook publication today.

The EPUB file format is an open standard based on XHTML for content and XML for metadata, contained in a zip file archive. And because everything is based on open standards, we can use common tools to create or examine EPUB files. Let's explore an EPUB file to learn more about it. A guide to tips and tricks for C programming, published earlier this year on Opensource.com, is available in PDF or EPUB format.

Because EPUB files are XHTML content and XML metadata in a zip file, you can start with the unzip command to examine the EPUB from the command line:

$ unzip -l osdc_Jim-Hall_C-Programming-Tips.epub
Archive: osdc_Jim-Hall_C-Programming-Tips.epub
Length Date Time Name
--------- ---------- ----- ----
20 06-23-2022 00:20 mimetype
8259 06-23-2022 00:20 OEBPS/styles/stylesheet.css
1659 06-23-2022 00:20 OEBPS/toc.xhtml
4460 06-23-2022 00:20 OEBPS/content.opf
44157 06-23-2022 00:20 OEBPS/sections/section0018.xhtml
1242 06-23-2022 00:20 OEBPS/sections/section0002.xhtml
22429 06-23-2022 00:20 OEBPS/sections/section0008.xhtml
[...]
9628 06-23-2022 00:20 OEBPS/sections/section0016.xhtml
748 06-23-2022 00:20 OEBPS/sections/section0001.xhtml
3370 06-23-2022 00:20 OEBPS/toc.ncx
8308 06-23-2022 00:21 OEBPS/images/image0011.png
6598 06-23-2022 00:21 OEBPS/images/image0009.png
[...]
14492 06-23-2022 00:21 OEBPS/images/image0005.png
239 06-23-2022 00:20 META-INF/container.xml
--------- -------
959201 41 files

This EPUB contains a lot of files, but much of this is content. To understand how an EPUB file is put together, follow the process flow of an eBook reader:

  1. eBook readers need to verify that the EPUB file is really an EPUB file. They verify the file by examining the mimetype file at the root of the EPUB archive. This file contains just one line that describes the MIME type of the EPUB file:

    application/epub+zip
  2. To locate the content, eBook readers start with the META-INF/container.xml file. This is a brief XML document that indicates where to find the content. For this EPUB file, the container.xml file looks like this:

    <?xml version="1.0" encoding="UTF-8"?>

    To make the container.xml file easier to read, I split the single line into multiple lines and added some spacing to indent each line. XML files don't really care about extra white space like new lines and spaces, so this extra spacing doesn't affect the XML file.

  3. The container.xml file says the root of the EPUB starts with the content.opf file in the OEBPS directory. The OPF extension is because EPUB is based on the Open Packaging Format, but the content.opf file is really just another XML file.

  4. The content.opf file contains a complete manifest of the EPUB contents, plus an ordered table of contents, with references to find each chapter or section. The content.opf file for this EPUB is quite long, so I'll show just a bit of it here as an example.

    The XML data is contained within a block, which itself has a block, the data, and a block that contains the eBook's table of contents:

    <?xml version="1.0" encoding="UTF-8"?>
    unique-identifier="unique-identifier" version="3.0" xmlns="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:opf="http://www.idpf.org/2007/opf">
    >
    id="unique-identifier">osdc002>
    >Tips and Tricks for C Programming>
    >Jim Hall>
    >English>
    property="dcterms:modified">2022-06-23T12:09:13Z>
    content="LibreOffice/7.3.0.3$Linux_X86_64 LibreOffice_project/0f246aa12d0eee4a0f7adcefbf7c878fc2238db3 (libepubgen/0.1.1)" name="generator"/>
    >
    >
    ...
    href="sections/section0001.xhtml" id="section0001" media-type="application/xhtml+xml"/>
    href="images/image0003.png" id="image0003" media-type="image/png"/>
    href="styles/stylesheet.css" id="stylesheet.css" media-type="text/css"/>
    href="toc.ncx" id="toc.ncx" media-type="application/x-dtbncx+xml"/>
    ...
    >
    toc="toc.ncx">
    idref="section0001"/>
    idref="section0002"/>
    idref="section0003"/>
    ...
    >
    >

    You can match up the data to see where to find each section. That’s how EPUB readers do it. For example, the first item in the table of contents references section0001 which is defined in the manifest as located in the sections/section0001.xhtml file. The file doesn’t need to be named the same as the idref entry, but that’s how LibreOffice Writer’s automated process created the file. (You can see in the metadata that this EPUB was created with LibreOffice version 7.3.0.3 on Linux, which can export content as EPUB files.)

The EPUB format

EPUB files are a great way to publish content using an open format. The EPUB file format is XML metadata with XHTML content, inside a zip container. While most technical writers use tools to create EPUB files, because EPUB is based on open standards means you can create your own EPUB files in some other way.

EPUB files are a great way to publish content using an open format.

Image by:

Lewis Cowles, CC BY-SA 4.0

Linux Documentation What to read next How I use the Linux fmt command to format text How I use the Linux sed command to automate file edits Old-school technical writing with groff Create beautiful PDFs in LaTeX A gentle introduction to HTML Writing project documentation in HTML Level up your HTML document with CSS How ODT files are structured This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

LZ4 v1.9.4 Achieves 20~70% Speedups For Some CPUs & Configurations

Phoronix - Tue, 08/16/2022 - 07:22
LZ4 v1.9.4 is out today as the first point release in nearly two years for this BSD-licensed, speedy, lossless compression algorithm...

Qualcomm Posts "QAIC" DRM Accelerator Driver For Linux

Phoronix - Tue, 08/16/2022 - 03:00
After Qualcomm announced their Cloud AI 100 Accelerator back in 2019, in 2020 during the early days of the pandemic they posted a Linux driver for this accelerator. That driver didn't get picked up for the mainline Linux kernel and two years later there still is little fanfare around the Qualcomm AI Cloud Accelerator hardware. However, now they have posted a new Linux driver that goes the DRM driver route...

Pages