Developing A Game Engine with Perl : Part 4 - UEFI vs OpenSuSE Installer

I'm still learning so remember... I DO NOT KNOW WHAT I AM DOING.

If you want to start reading from the beginning. Check out the first article in this series

Continuing on with the last article let's talk about old hardware with UEFI. It can be difficult (for me) to know how to get Linux OpenSuSE installed properly.

  • Mouse Input Support
  • Hardware Failure
  • Server Upgrade
  • UEFI vs OpenSuSE Installer
  • 32bit -> 64bit & Perl's Storable

A small computer and almost destroying it...

My Favorite Warnings: experimental

Perl has had experimental features ever since I started using it at about version 5.6. These were things that were considered useful, but about which there was doubt -- about their final form, whether a satisfactory implementation existed, or whatever.

Until Perl 5.18, experimental features were simply documented as experimental. At that point, an experimental warning category was added, with sub-categories experimental::lexical_subs, experimental::lexical_topic, experimental::regex_sets, and experimental::smartmatch.

Most of the features covered by the original Perl 5.18 warning categories were actually introduced in Perl 5.10 as back-ports from Raku (or Perl 6, as it was then called), and not documented as experimental. My impression was that the relevant experimental:: warnings were introduced becaue the corresponding features were recognized as being more experimental than originally believed. Programmers already familiar with a feature might not notice an extra sentence in the documentation, but they will surely notice if their code starts spitting out experimental warnings.

Perl Weekly Challenge 190: Capital Detection and Decoded List

These are some answers to the Week 190 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a few days from now (on November, 13, 2022 at 23:59). This blog post offers some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 1: Capital Detection

You are given a string with alphabetic characters only: A..Z and a..z.

Write a script to find out if the usage of Capital is appropriate if it satisfies at least one of the following rules:

1) Only first letter is capital and all others are small. 2) Every letter is small. 3) Every letter is capital.

Example 1

Input: $s = 'Perl'
Output: 1

Example 2

I finally start to translate Japanese Perl Zemi to English.

I finally started to translate Japanese Perl Zemi to English.

Perl Zemi | Perl Zemi|Perl Installation, Perl Tutorial, Many Examples

Perl Zemi is Japanese Perl Tutorial site which is well known and red in Japan. Most of all Japanese Perl users know Perl Zemi and read the document repeatedly.

The volume of content is large and has a reputation for being easy to understand.

This site is originally Japanese. I started to translate this site into English at 2021-11 using an automatically translation tool. I plan that the not very good descriptions and examples by the automatic translation will be gradually fixed until 2023-01.

I'm really going to achieve it.

Let's enjoy Perl with me!

Developing A Game Engine with Perl: Part 3 - Hardware Failure & Server Upgrade

Remember... I DO NOT KNOW WHAT I AM DOING.

Continuing from the last article, let's talk about the hardware failures and server upgrade.

  • Mouse Input Support
  • Hardware Failure
  • Server Upgrade
  • UEFI vs OpenSuSE Installer
  • 32bit -> 64bit & Perl's Storable

All your bad sectors are belong to us.....

Ugh, seeing these sort of log errors screams panic to me

Nov 25 03:44:25 Dev smartd[627]: Device: /dev/sda [SAT], Self-Test Log error count increased from 3 to 4
Nov 25 03:44:25 Dev smartd[627]: Device: /dev/sda [SAT], previous self-test completed with error (read test element)
Nov 25 03:44:25 Dev smartd[627]: Device: /dev/sda [SAT], Failed SMART usage Attribute: 184 End-to-End_Error.
Nov 25 03:44:25 Dev smartd[627]: Device: /dev/sda [SAT], 136 Offline uncorrectable sectors
Nov 25 03:44:25 Dev smartd[627]: Device: /dev/sda [SAT], 136 Currently unreadable (pending) sectors

TWC 138: Partition-free Weekends

Placeholder for overdue explanation of my solution to Task#2, using regex exponential exhaustion.

A dream resyntaxed

[Author’s note: If you’ve read Curtis Poe’s most recent blog post, what follows is going to seem eerily familiar. This post uses the same concepts, arguments, and code examples as his, and reaches exactly the same conclusions. That’s because both posts originate from a long and wide-ranging email discussion between Curtis and myself, as I’ve been privately consulting with him over the past few months on the design of Corinna.

When I read Curtis’s post I almost decided to bin this one, as he managed to cover everything necessary in his usual succinct, eloquent, and engaging style. But he has encouraged me to post my version of this discussion too, as it provides a little more detail on some of the issues we’re addressing, and on the design rationale for the changes we are jointly proposing.

I made a calculator

I created a very basic calculator using wxGlade and the Wx Perl module on CPAN.

wxCalc.png

This is a short one. I've been playing around with wxGlade because it generates Perl code. It is pretty easy to get started on Ubuntu using the base perl.

  • sudo apt-get install wxGlade
  • sudo apt-get install libwx-perl

It took me a while to get the feel of wxGlade, so hang in there. The pay off is when you figure out how to:

  1. build a basic GUI using the builder tools
  2. generate Perl code to just show the GUI (with no actions)
  3. inspect the Perl code
  4. run Perl code
  5. start defining the event handlers

It also takes some time to get an idea about how the Perl code via wxGlade gets injected into the Perl file. I recommend experimenting with the different places in wxGlade you can put in code.

Creating the All Important Flow

Developing A Game Engine with Perl : Part 2 - Mouse Input

Let me start by saying.... I DO NOT KNOW WHAT I AM DOING.

Literally, developing a game engine is not on my resume... yet! So any code or ways of doing anything you read here, is just what I've figured out and works for me, which by no means should suggest to you that it is the proper way to do what ever it may be. Please consult your local guru first.

OK, now that we have that established... Please consider the following as entertainment and should you learn along the way with me, that's wonderful!

Now, by the time of writing this article, I am several months into this undertaking. I'll describe in future posts what the engine is capable of, but for today, let me tell you about what happened over the last 2 weeks. I will likely break them up into separate posts for easier consumption.

Here's a quick list of the accomplishments, disasters and discoveries.

  • Mouse Input Support
  • Hardware Failure
  • Server Upgrade
  • UEFI vs OpenSuSE Installer
  • 32bit -> 64bit & Perl's Storable

Mouse Input Support

Perl Weekly Challenge 138: Workdays and Split Number

These are some answers to the Week 138 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a few days from now (on November 14, 2021 at 24:00). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.

Task 1: Workdays

*You are given a year, $year in 4-digits form.

Write a script to calculate the total number of workdays in the given year.

For the task, we consider, Monday - Friday as workdays.

Example 1:

Input: $year = 2021
Output: 261

Example 2:

Input: $year = 2020
Output: 262

The Ephemeral Miniconf

The Ephemeral Miniconf is planned on thursday 18th of november 2021!

Have you heard about The Ephemeral Miniconf ?

flyeren2small.png

It's a Perl/Raku free and online miniconf that will take place on Zoom!
Think "TPRCiC" but smaller with only one track :)

I'm honored to have some experienced speakers about Perl, Github, Devops, LDAP etc... You will enjoy I promise!

More informations on my big blog serie about on devto or on the website.

I can give you already the connections informations:

Meeting ID: 818 6906 5466
Pass: 42

It's planned at 3pm UTC+1(Paris time) so check the timezone planner to know when it is for you.

It's in the morning if you're in US, in the afternoon if you're in Europe and very late if you're in Asia or Australia (sorry).

The planning will be something like this:
planningsmall.png

(it could last longer or change a bit inside the range, like shifting talks, but at the moment here it is)

I'm also possibly preparing some surprises that I don't want to reveal for now.

So my message is basically, it's coming, book your calendar and I'm looking forward to see you at The Ephemeral Miniconf!

My Favorite (?) Warnings - Ex-Warnings

Warning categories have proliferated since the warnings pragma was first introduced in Perl 5.6: from 50 in Perl 5.6.2 to 79 in Perl 5.35.5 (the latest as of this writing). But warnings have been removed as well as added. This post documents these -- mostly for historical interest on my part.

Developing A Game Engine with Perl

Perl? What... really?

To most in the know, coding a game engine with Perl would be a surprise. I've certainly been asked, "Why Perl?". You see, unlike C++, C#, Java and others, which are well established languages in game engine design, Perl is not (well) known for it's role in the development of games. Especially not as a game engine language. You are much more likely to see Perl managing the network infrastructure for the gaming industry then you are to see it powering your favourite video games.

So why use Perl then?

Because It's what I know. It's that simple. I've spent many years using Perl to solve many problems throughout my career. I've been fortunate to write Perl code that interacts with a wide variety of hardware, Linux servers and network services. But never a game engine. So I answer "Why Perl?" with "Why not Perl?"

Why design another game engine? Why not just use an existing engine to make games?

Perl Weekly Challenge 189: Greater Character and Array Degree

These are some answers to the Week 189 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a few days from now (on November, 6, 2022 at 23:59). This blog post offers some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 1: Greater Character

You are given an array of characters (a..z) and a target character.

Write a script to find out the smallest character in the given array lexicographically greater than the target character.

Example 1

Input: @array = qw/e m u g/, $target = 'b'
Output: e

Example 2

Input: @array = qw/d c e f/, $target = 'a'
Output: c

Example 3

Monthly Report - October

In the festive mood again ...

The festive season began already and I miss celebrating festivals with family and friends. But this is nothing new, I should get used to it now. Still sometimes it hurts really bad after all we are humans. In the past, we tried to be with family during festive season. The truth is it didn't feel the same. I don't know why. Could it be we are no longer carefree souls? But that can't be true. I have seen some of my friends on Facebook sharing celebration moments with family. It looks so beautiful and cute. The only difference I can think of is that they with family and I don't.

I would like to mention one friend from Nepal. We never met but I always watch his Facebook post having great time with his family. I think we became friends because of common love for Perl.

berrybrew version 1.36 released!

I've released version 1.36 of berrybrew, the Perlbrew for Windows. I've also reached out to see how I can become part of the Strawberry Perl team to get back on track with the release of new Strawberry Perls.

If you have any information on the release procedure for Strawberry, or know anyone on that team I might be able to contact to get things moving forward again, please let me know.

This release contains one significant new feature, the ability to use Powershell as the shell when opening or using a Perl. In the UI, when you "Open" your current Perl, or "use" any Perl you have installed, if the "Use Powershell" option is checked, instead of a cmd.exe shell, you'll be presented with a Powershell one instead (same applies for the command line berrybrew use $version.

berrybrew-ui_use_powershell.png

The other changes in this release enhance the unit testing infrastructure, and the tests themselves.

Other notable changes since my last blog post:

  • The berrybrew associate command now has an alias of assoc for fewer keystrokes
  • Better exception handling in several cases
  • Documentation clarifications
  • Removed the upgrade command. It's now recommended to use the Installer to manage upgrades
  • Fix issue when using berrybrew to manage file associations where arguments passed to perl were being handled incorrectly
  • Unit test infrastructure enhancements

open invitation to participate in Perl-OpenMP on Github

I've had https://github.com/Perl-OpenMP up for a while, but I only recently thought to post an open invitation for others interested in this exploration topic to join. #openmp on irc.perl.org exists, semi-related IRC channels inlcude: #native and #pdl .

My confidence in the value of this line of work was bolstered recently when I shoved in an old finite element of 2dheat conduction into a Perl script using, Two interesting examples follow:

The second of these examples takes an example from Inline::C::Cookbook that shows how to process an array reference, coupled with an OpenMP reduction by OMP_NUM_THREADS threads.

gcc has supported OpenMP's 4.5 specification as of version 7. So it's there and there are many ways that it can be leveraged via Perl.

Perl Weekly Challenge 188: Divisible Pairs and Total Zero

These are some answers to the Week 188 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Task 1: Divisible Pairs

You are given list of integers @list of size $n and divisor $k.

Write a script to find out count of pairs in the given list that satisfies the following rules.

The pair (i, j) is eligible if and only if
a) 0 <= i < j < len(list)
b) list[i] + list[j] is divisible by k

Example 1

Input: @list = (4, 5, 1, 6), $k = 2
Output: 2

Example 2

Input: @list = (1, 2, 3, 4), $k = 2
Output: 2

Example 3

Input: @list = (1, 3, 4, 5), $k = 3
Output: 2

Example 4

My Favorite Warnings: redefine

Sooner or later any programmer, writing in any language, will run across something like this Perl warning: Subroutine foo redefined. This is telling you that somehow, somewhere, you tried to create two subroutines with the same name.

Tracking this down can be tricky, and remediation equally so. The possibilities include:

  • If one of your own subroutines is involved, you can rename it.
  • If an imported subroutine that you do not need is involved, you can just not import it. This, of course, involves figuring out which imports you do need. The use of default import lists can make tracking this one down tricky.
  • You can use Importer to import a subroutine under a different name.
  • You can ignore the import mechanism and populate the symbol table yourself with something like BEGIN { require Some::Module; *foo = \&Some::Module::bar; }, after which bar() calls Some::Module::foo().

Reviving Net::Pcap

I've blogged a bit about my steps to get Net::Pcap to compile again - I won't paste the complete text here unless there is demand, but I'm posting the link to the article here :)

https://corion.net/blog/2021/10/26/reviving-net-pcap/

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.