Feeds

Brett Cannon: MVPy: Minimum Viable Python

Planet Python - Sun, 2022-08-14 17:19

Over 29 posts spanning 2 years, this is the final post in my blog series on Python&aposs syntactic sugar. I had set out to find all of the Python 3.8 syntax that could be rewritten if you were to run a tool over a single Python source file in isolation and still end up with reasonably similar semantics (i.e. no whole-program analysis, globals() having different keys was okay). Surprisingly, it turns out to be easier to list what syntax you can&apost rewrite than re-iterate all the syntax that you can rewrite!

  1. Integers (as the base for other literals like bytes)
  2. Floats (because I didn&apost want to mess with getting the accuracy wrong)
  3. Function calls
  4. =
  5. :=
  6. Function definitions
  7. global
  8. nonlocal
  9. return
  10. yield
  11. lambda
  12. del
  13. try/except
  14. if
  15. while

All other syntax can devolve to this core set of syntax. I call this subset of syntax the Minimum Viable Python (MVPy) you need to make Python function as a whole. If you can implement this subset of the language, then you can do a syntactic translation to support the rest of Python&aposs syntax (although admittedly it might be a bit faster if you directly implemented all the syntax 😉).

If you look at what synatx is left, it pretty much aligns to what is required to implement a Turing machine:

  1. Read/write data (=,  :=, integers and floats)
  2. Make decisions about data (if,  while, and try)
  3. Do things to that data (everything involving defining and using functions)

You might not be as productive in this subset of the language as you would be with all the syntax available in Python 3.8 (and later), but you should still be able to accomplish the same things given enough time and patience.

Categories: FLOSS Project Planets

Moshe Zadka: On The Go

Planet Python - Sun, 2022-08-14 17:00

Now that travel is more realistic, I have started to optimize how well I can work on the go. I want to be able to carry as few things as possible, and have the best set-up possible.

Charging

The "center" of the mobile set-up is my Anker Power Bank. It serves two purposes:

  • It is my wall-plug charger.
  • It is my "mobile power": I can carry around 10k mAH of energy.

The charger has two USB-C slots and one USB-A slot.

Compute

For "compute", I have three devices:

  • M1 MacBook Air
  • Galaxy Samsung S9+ (I know it's a bit old)
  • FitBit Charge 4

The S9 is old enough that there is no case with a MagSafe compatible back. Instead, I got a MagSafe sticker that goes on the back of the case.

This allowed me to get a MagSafe Pop-Socket base. Sticking a Pop-Socket on top of it lets me hold the phone securely, and avoids it falling on my face at night.

Ear buds

For earbuds, I have the TOZO T10. They come in multiple colors!

The colors are not just an aesthetic choice. They also serve a purpose: I have a black one and a khaki one.

The black one is paired to my phone. The khaki one is paired to my laptop.

I can charge the TOZO cases with either the USB-C cable or the PowerWave charger, whichever is free.

Charging

In order to charge the M1 I have a USB-C "outtie"/USB-C "outtie" 3 foot wire. It's a bit short, but this also means it takes less space. The FitBit Charge comes with its own USB-A custom cable.

For wireless charging, I have the Anker PowerWave. It's MagSafe compatible, and can connect to any USB-C-compatible outlet.

The phone is only charged by the wireless charging. The USB-C input is wonky, and can be incompatible with humid climates.

I connected a Pop Socket to the back of the PowerWave charger. This means that while the phone is charging, I can still hold it securely.

Together, they give me a "wireless charging" battery. The PowerWave connects to the phone, and the Power Bank has plenty of energy to last for a while while not connecting to anything.

I cannot charge all devices at once. But I can charge all devices, and (almost) any three at once.

Hub

The last device I have is an older version of the Anker 5-in-1 hub. This allows connecting USB Drives and HDMI connectors.

Case

All of these things are carried in a Targus TSS912 case. The laptop goes inside the sleeve, while the other things all go in the side pocket.

The side pocket is small, but can fit all of the things above. Because of its size, it does get crowded. In order to find things easily, I keep all of these things in separate sub-pockets.

I keep the Power Bank, the MagSafe charger, and the USB-C/USB-C cable in the little pouch that comes with the Power Bank.

The hub and FitBit charging cable go into a ziplock bag. Those things see less use.

The earbud cases go into the pocket as-is. They are easy enough to dig out by rooting around.

I wanted a messenger-style case so that I can carry it while I have a backpack on. Whether I am carrying my work laptop (in the work backpack) or a travel backpack, this is a distinct advantage.

The case is small enough to be slipped inside another backpack. If I am carrying a backpack, and there's enough room, I can consolidate.

Conclusion

I chose this set up for options.

For example, if my phone is low on battery, I can connect the PowerWave to the bank, leave the bank in the side-bag's pocket, and and keep using the phone while it is charging, holding it with the PowerWave's pop-sockets.

If I am listening to a podcast while walking around, and notice that the ear bud's case is low on battery, I can connect the case to the bank while they are both in the side-bag's pocket.

When sitting down at a coffee shop or an office, I can connect the bank to the wall socket and charge any of my devices while sitting there. As a perk the bank is charging while I'm sitting down.

Categories: FLOSS Project Planets

#! code: Drupal 9: Creating A Category Menu Using Derivers

Planet Drupal - Sun, 2022-08-14 13:54

Derivers in Drupal are one of the ways in which you can inform Drupal about the presence of plugin types. This allows you to generate multiple custom types of a plugin so that it can be represented as multiple different plugins within the system.

Perhaps the most useful deriver example I have seen is the menu deriver. This allows us to use the Drupal plugin architecture to generate custom menu links.

If you want to create a menu link for your module then you would normally add them one at a time to a *.links.menu.yml file. This is an example of using the menu links plugin system to inform the menu system about the links you want to add.

For example, the core config module has a single option in the config.links.menu.yml file that adds the "Configuration synchronization" menu item to the administration menu. Here is the contents of that file.

config.sync: title: 'Configuration synchronization' description: 'Import and export your configuration.' route_name: config.sync parent: system.admin_config_development

Instead of doing this, we can use a menu deriver to tell the menu system to look at a class that will then inject menu links into the menu. This saves us from adding them one by one and also means we can dynamically create menu links without hard coding them into the *.links.menu.yml file.

In this article, I will look at setting up a menu deriver and then using that deriver to inject custom elements into the menu.

Setting Up A Menu Deriver

The first thing to do is setup a menu deriver class. This should implement a method called getDerivativeDefinitions() which will return the plugin derivatives. As we are calling this from the menu system we need to return an array of menu links from this method so that they are understood by the menu system.

Read more.

Categories: FLOSS Project Planets

<Weeks 9> Storing OCR result

Planet KDE - Sun, 2022-08-14 10:41

This week, I implemented two ways to store the output text.

The first way is that output text will be recorded and saved as a text file. I implement the method saveTextFile(const QString& filePath, const QString& text) of Ocr Tesseract Engine; this function uses QTextStream’s streaming operators, so we can conveniently write and update text into the file. The text file is located with the same path as the Url image.

The second way is to save the text in XMP. I implement the method saveXMP(const QString& filePath, const QString& text) to do this task. XMP uses a structured container to host similar metadata. An alternative language string is an entry in the XMP tree (based on XML) which will be an additional property for a title or caption tag. A new language version of a label is appended to XML. There is no limit in size and char encoding. XMP is hosted in the image to a dedicated chunk outside the image data/properties.

This is precisely where digiKam stores the comment entered by the user in the right sidebar named Captions & Tags from the icon view. The advantage of seeing this place is the capability to set more than one text in different languages if the translation is available. In all cases, the default language must be x-default; variant will be hosted in de-DE for German, fr-FR from French, it-IT for Italian, etc. Furthermore, translating and storing recognized text in the new language is an attractive feature too. My mentor prepared the class QOnlineTranslator to be included in digiKam core.

QOnlineTranslator

These two methods are also encapsulated in slotUpdateText(), a function that is called in response to a particular signal “clicked” on a button “Save” after post-processing text in the text editor.

Categories: FLOSS Project Planets

Dirk Eddelbuettel: RcppArmadillo used by 1001 CRAN Packages

Planet Debian - Sun, 2022-08-14 10:08

It is with a mix of pride and joy, but also some genuine astonishment and amazement, that we can share that the counter of reverse dependencies at CRAN for our RcppArmadillo package for R just crossed 1000 packages [1]:

Conrad actually posted this a few weeks ago, by my count we were then still a few packages shy. In any event, having crossed this marker this summer, either then or now, and after more than a dozen years of working on the package is a really nice moment. Google Scholar counts nearly 500 citations for our CSDA paper (also this vignette), and that ratio of nearly a citation for every two packages used is certainly impressive. We have had the pleasure of working with so many other researchers and scientists using RcppArmadillo. Its combination of performance (C++, after all, and heavily tuned) and ease-of-use (inspired by ‘another popular flavour for matrix computing’ that is however mostly interpreted) makes for a powerful package, and we are delighted to see it used so widely.

Working on this with Conrad has been excellent. The (upstream) package (now at this GitLab repo) has received numerous releases at a rate that is in fact so high that we now ‘slow it down’ to not exceed a monthly cadence of uploads to CRAN. But the package should always be in release condition at its GitHub repo, and is frequently also installable in ‘rc’ versions via the Rcpp drat repo.

So with that, a big Thank You! to Conrad, to Romain for all the early work laying the package foundations, and to all the users of (Rcpp)Armadillo for helping us along with testing, suggestions, extensions, and bug reports. Keep’em coming!

If you like this or other open-source work I do, you can now sponsor me at GitHub.

[1] The code snippet shows that we remove some possible duplicates in the count (mostly for the total of packages). This is a correction we use across packages for consistency. It does not have an effect for RcppArmadillo.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

Categories: FLOSS Project Planets

Jamie McClelland: Web caching is hard

Planet Debian - Sun, 2022-08-14 08:27

Web caching is hard. And also, maybe I’m not that good under pressure? In any event, I made the following mistakes while trying to debug a web site using our nginx cache that bit the dust under heavy load today:

Action: I ran curl -I https://website.org/ and it hung.

Wrong assumption: Something is wrong with nginx. Why else would it just hang?

Reconsidered conclusion: The resource (the home page) is a MISS, so nginx has to retrieve it from the origin, but the origin is over-loaded and timing out, so my request is also timing out. Maybe something is wrong with the nginx caching configuration since the home page really should be a HIT… but that’s another problem.

Action: I changed the configuration from our normal caching set of directives to our aggressive caching set of directives, reloaded nginx and curl -I https://website.org/ still hung.

Wrong assumption: aggressive caching isn’t working and I need a different configuration.

Reconsidered conclusion: The home page still has failed to be loaded from the origin, so every request for it is going to be a MISS, and is going to hang, until nginx is able to fill the cache with it. The configuration change might be the right change; we just need the origin to calm down before we will know.

Action: I restarted PHP on the origin to free up PHP processes so my home page request can fill the cache … and still curl -I https://website.org/ hangs.

Wrong assumption: WTF! The world is ending!

Reconsidered conclusion: The regular traffic which is accessing other pages (not the home page) consumed all the available PHP processes on the origin before my request for the home page could complete, so nginx is still unable to fill the cache with the home page.

Action: Once we got things under control, I changed the caching level from aggressive back down to normal. I ran curl -I https://website.org/ and it was HIT’ing. I concluded that we don’t need the aggressive cache after all. Got some coffee, came back later and ran it again and it consistently showed MISS.

Wrong assumption: What?!? Did something change on the origin to stop the cache from working??

Reconsidered conclusion: The aggressive cache set the cache for 5 minutes. Even after changing to normal caching, the home page was still cached so it was served from the cache. After 5 minutes, the cache expired. Now, the normal cache setting are in play to determine whether the request would be cached or not. In other words, you have to wait for the cache to expire (or bust the cache) before you can effectively know if the new cache settings are working.

Categories: FLOSS Project Planets

Podcast.__init__: Remove Roadblocks And Let Your Developers Ship Faster With Self-Serve Infrastructure

Planet Python - Sun, 2022-08-14 06:58
The goal of every software team is to get their code into production without breaking anything. This requires establishing a repeatable process that doesn't introduce unnecessary roadblocks and friction. In this episode Ronak Rahman discusses the challenges that development teams encounter when trying to build and maintain velocity in their work, the role that access to infrastructure plays in that process, and how to build automation and guardrails for everyone to take part in the delivery process.Summary

The goal of every software team is to get their code into production without breaking anything. This requires establishing a repeatable process that doesn’t introduce unnecessary roadblocks and friction. In this episode Ronak Rahman discusses the challenges that development teams encounter when trying to build and maintain velocity in their work, the role that access to infrastructure plays in that process, and how to build automation and guardrails for everyone to take part in the delivery process.

Announcements
  • Hello and welcome to Podcast.__init__, the podcast about Python’s role in data and science.
  • When you’re ready to launch your next app or want to try a project you hear about on the show, you’ll need somewhere to deploy it, so take a look at our friends over at Linode. With their managed Kubernetes platform it’s easy to get started with the next generation of deployment and scaling, powered by the battle tested Linode platform, including simple pricing, node balancers, 40Gbit networking, dedicated CPU and GPU instances, and worldwide data centers. And now you can launch a managed MySQL, Postgres, or Mongo database cluster in minutes to keep your critical data safe with automated backups and failover. Go to pythonpodcast.com/linode and get a $100 credit to try out a Kubernetes cluster of your own. And don’t forget to thank them for their continued support of this show!
  • Your host as usual is Tobias Macey and today I’m interviewing Ronak Rahman about how automating the path to production helps to build and maintain development velocity
Interview
  • Introductions
  • How did you get introduced to Python?
  • Can you describe what Quali is and the story behind it?
  • What are the problems that you are trying to solve for software teams?
    • How does Quali help to address those challenges?
  • What are the bad habits that engineers fall into when they experience friction with getting their code into test and production environments?
    • How do those habits contribute to negative feedback loops?
  • What are signs that developers and managers need to watch for that signal the need for investment in developer experience improvements on the path to production?
  • Can you describe what you have built at Quali and how it is implemented?
    • How have the design and goals shifted/evolved from when you first started working on it?
  • What are the positive and negative impacts that you have seen from the evolving set of options for application deployments? (e.g. K8s, containers, VMs, PaaS, FaaS, etc.)
  • Can you describe how Quali fits into the workflow of software teams?
  • Once a team has established patterns for deploying their software, what are some of the disruptions to their flow that they should guard against?
  • What are the most interesting, innovative, or unexpected ways that you have seen Quali used?
  • What are the most interesting, unexpected, or challenging lessons that you have learned while working on Quali?
  • When is Quali the wrong choice?
  • What do you have planned for the future of Quali?
Keep In Touch Picks Closing Announcements
  • Thank you for listening! Don’t forget to check out our other shows. The Data Engineering Podcast covers the latest on modern data management. The Machine Learning Podcast helps you go from idea to production with machine learning.
  • Visit the site to subscribe to the show, sign up for the mailing list, and read the show notes.
  • If you’ve learned something or tried out a project from the show then tell us about it! Email hosts@podcastinit.com) with your story.
  • To help other people find the show please leave a review on iTunes and tell your friends and co-workers
Links

The intro and outro music is from Requiem for a Fish The Freak Fandango Orchestra / CC BY-SA

Categories: FLOSS Project Planets

How to use Angelfish as touch-friendly web browser in Steam Deck’s Game Mode

Planet KDE - Sun, 2022-08-14 03:53

For whatever reason Steam Deck pretty much has two default browsers: Google Chrome in Game Mode and Firefox in Plasma aka. Desktop Mode. Firefox is absolutely unusable in Game Mode. Chrome (probably most other Chromium variants as well, I’ve only tried a handful) work okay-ish – at least they don’t go ballistic on touch events but they are not a truly nice experience either.

Readers of Planet KDE probably already know that some KDE applications have convergent GUIs thanks to Plasma Mobile, including the Angelfish web browser. It took some fiddling but after a while I managed to get it into a shape that’s very usable in Game Mode. Without any tweaks Angelfish defaults to use its desktop GUI and thereby runs just fine in Plasma Desktop, perhaps docked to a monitor.

First step is to enter Desktop Mode and install Angelfish from Flathub via Discover and then add it to Steam.

Then within Steam under Properties of Angelfish add this in the Target line to the beginning of the command to force mobile user interface, loading icons, and enlarging the interface elements:

env QT_QUICK_CONTROLS_MOBILE=1 QT_QPA_PLATFORMTHEME=KDE QT_SCALE_FACTOR=2

The resulting command line looks something like this

Next step is to enter Game Mode and select the Web Browser controller layout:

Web Browser controller layout

Here’s a few screenshots of Angelfish running:

Main menu Page menu Tab overview Main view

In all fairness, Angelfish is a bit barebones. The Chromium-derived rendering engine is fine but there is no way to sync bookmarks and passwords with other browsers or at least import them. An ad blocker is built in but there’s also no support for WebExtensions or User Scripts, as far as I can tell. Keyboard does not automatically pop up on text inputs, you’ll need to press X every time. Despite all the downsides, it’s miles ahead of using a desktop-focused browser in Game Mode. You can also just launch Angelfish from Plasma Desktop without the above tweaks and just continue to use the same tabs, sessions, etc.

I can’t speak for the Plasma Mobile team but I hope they’ll embrace platforms like Steam Deck to lure in a few new contributors. Many of the other Plasma Mobile apps look potentially useful on handheld PC platforms as well.

Other Plasma Mobile apps may work using the same method but I’ve not tested any of them, yet.

PS: Angelfish also has a tablet UI that you can enable by replacing QT_QUICK_CONTROLS_MOBILE with KDE_KIRIGAMI_TABLET_MODE but I did not find it particularly working well with Game Mode.

Categories: FLOSS Project Planets

KDE Ships Frameworks 5.97.0

Planet KDE - Sat, 2022-08-13 20:00

Sunday, 14 August 2022

KDE today announces the release of KDE Frameworks 5.97.0.

KDE Frameworks are 83 addon libraries to Qt which provide a wide variety of commonly needed functionality in mature, peer reviewed and well tested libraries with friendly licensing terms. For an introduction see the KDE Frameworks release announcement.

This release is part of a series of planned monthly releases making improvements available to developers in a quick and predictable manner.

New in this version Attica
  • Pass the HTTP status code as the MetaData status code
  • Properly detect failed jobs
Breeze Icons
  • Add mimetypes/{16,22,32,64}/application-x-msdownload, which is used for DLLs
  • Remove monochrome versions of help-related app icons (bug 456737)
Extra CMake Modules
  • kde-modules/KDEGitCommitHooks.cmake - handle non-toplevel project
KActivities
  • Utilize std::optional instead of custom impl
  • Remove debug message for Consumer destructor
KArchive
  • k7zip: Merge two functions to the constructor
KCalendarCore
  • Deprecate deletion tracking support in CalFormat::fromString
  • Add plugin loader for KCalendarCore::CalendarPlugin
KCMUtils
  • follow symlinks for search of .desktop files
  • tools/kcmmetadatagenerator: Print out critical warning if file could not be opened
  • Make CMake import target of kcmdesktopfilegenerator relocatable
  • Add utility cmake method to generate KCM metadata desktop files
KCompletion
  • KCompletion: clean-up private class
  • KCompletion*: general clean-up
KConfig
  • Don’t inherit from containers
KConfigWidgets
  • [KCommandBar] Improve position and size
  • follow symlinks during search for help
  • Avoid tracking dangling KConfigDialogManager (bug 456630)
KCoreAddons
  • Deprecate KMessage system
  • KUserGroup: fix data race by porting from getgrgid to getgrgid_r
  • KUserGroup: centralize calls to getgrgid(), at least for constructors
  • KUser: fix data race by porting to getpwuid_r and getpwnam_r
  • KUser: use member initialization, call getpwuid in a single place
  • Add KRuntimePlatform as alternative for KDeclarative::runtimePlatform
  • Bump shared-mime-info to 1.8
  • make kprocess a more proper qprocess
  • new ksandbox function to start processes
  • Adapt libexec paths for KF6
KDeclarative
  • GridDelegate: Improve accessibility for inline buttons
KDELibs 4 Support
  • Remove unused X-KDE-ModuleType
  • Convert file to UTF-8
KDocTools
  • Add Han Young to the contributors list
KFileMetaData
  • Add PNG extractor
  • dump tool: Print extractor name
KGlobalAccel
  • GlobalShortcutsRegistry: don’t use a QHash for a couple of elements
KDE GUI Addons
  • QtWaylandClient is required when building with Wayland support
KHolidays
  • Use non-deprecated API unconditionally everywhere
  • Implement deprecated API by calling the new one
  • Make rawHolidays() with category filter also work with seasonal holidays
  • Actually implement HolidayRegion::rawHolidays()
  • Actually include seasonal holidays in rawHolidaysWithAstroSeasons()
  • Add methods to check for polar days/nights
KIconThemes
  • Do not use QIcon::setThemeName to set system theme
KImageFormats
  • Use right type on enums
  • PSD: Improve alpha detection (bug 182496)
  • PSD: LAB support
KIO
  • ScopedProcessRunner: Set scope name according to X-KDE-AliasFor
  • Template: have KIO worker bundle name match full lingo
  • Use QDateTime::fromSecsSinceEpoch instead of fromMSecsSinceEpoch(1000 *
  • KFileItem: save a useless multiplication
  • KRecentDocument: better prevent duplicate bookmark for same href (bug 456046)
  • KRecentDocument: Improve compat with Gtk File Picker (bug 456046)
  • Port kio_remote to WorkerBase
  • FileUndoManager: use emitRenaming where appropriate
  • FileUndoManager: fix job description when undoing a batch-renaming (bug 437510)
  • fix x-kde-protocol(s) filters for json based kpropertiesdialog plugins
  • Deprecate AskUserActionInterface::Sorry
  • Fix WidgetsAskUserActionHandler::requestUserMessageBox’s “Don’t ask again”
  • [KUrlNavigatorToggleButton] Load accept icon on demand
  • KPropertiesDialog: Handle non-existing file type in default handler label
  • KPropertiesDialog: Update enabled state for default handler label
  • KUrlNavigatorButton: use a struct instead of QPair
  • KFileItemActions: use a struct instead of QPair
  • kio_http: Use a struct instead of QPair
  • HostInfo: Use a struct instead of QPair
  • KFileItemActions: Add icon to “Open With…” action
  • port sandbox detection to ksandbox
  • [kfileitemactions] Pass parentWidget to JobUIDelegate
  • Rename view action and set its icon
  • Fix crash in DropJob (bug 454747)
  • Fix thumbnailer result for parent mime types being overwritten (bug 453480)
  • Port kio_help to WorkerBase
  • [knewfilemenu] Deprecate setViewShowsHiddenFiles
  • KDirOperator: only show preview on mouse hover
  • KImageFilePreview: if no current preview, don’t show last one on resize (bug 434912)
  • KImageFilePreview: only create QTimeLine member if needed
  • [knewfilemenu] Replace setPopupFiles with setWorkingDirectory
  • [KFilePlacesView] Fix condition for pointIsTeardownAction
  • Switch template to KIO worker
  • [BatchRenameJob] Add job description and report periodically
  • Adapt libexec search path to KF6
  • KFileWidget: remove location history dummy-entry related code (bug 452994)
  • Fix logic error in Qt6 offline detection
Kirigami
  • CardsGridView: enable Home/End key navigation
  • CardsListView: enable Home/End key navigation
  • Don’t use an alias and expose directly the children property
  • Rework CardsGridView leftMargin calculation
  • Use custom header for setting window
  • Deprecated view headers
  • Fix floating action button icon alignment when there is no main action
  • OverlaySheet: add workaround for Qt horizontal scrollview bug (bug 457223)
  • Also handle QML url value types in PageRow
  • Try to depend on the newer QQC2 version possible (bug 451240)
  • workaround on items without implicit size
  • libkirigami/units: Fix wrong implementation of property setter and getter of veryShortDuration
  • fix horizontal alignment for titleLayot
  • Improve Kirigami.Chip description and use case
  • PromptDialog: Change its content label to selectable counterpart
  • Add icon to UrlButton menu
  • Improve action name in UrlButton menu
  • SizeGroup: Hide implementations details (static list operations) as private
KJobWidgets
  • ui-server: Fix crash by only re-registering live KJobs (bug 450325)
KJS
  • Convert file to UTF-8
KJSEmbed
  • kjscmd5 is nongui
KNewStuff
  • [kmoretools] Don’t lowercase the desktop entry name (bug 417575)
  • Fixup 6d889ae0: move newlines out of translated string
  • Remove unneeded close button from window footer
  • Add a “try again later” message for transient errors
KNotification
  • Remove notificationplugin service type
  • Drop lib prefix when building for Windows (MinGW)
  • use ksandbox instead of hardcoding sandbox detection
KPackage Framework
  • Fix listing of KPackage structures (bug 456726)
  • README.md add dot at end of sentence
KPeople
  • Don’t install service type definitions
KPty
  • add the ability to disable ctty set up
KQuickCharts
  • Remove arcconfig
  • BarChart: de-duplicate some code
  • Remove an unused method
KRunner
  • Add note about alternative to Plasma::RunnerContext::setSingleRunnerQueryMode
  • templates/runnerpython: Add hint for multiline property
  • Fix Qt6 build
KService
  • Add property def for X-Flatpak key
  • Define HAVE_MMAP to 0 instead of undefining it (bug 456780)
  • KSycocaDict: don’t inherit from containers
  • use ksandbox to determine if we are inside a flatpak
KTextEditor
  • fix crash (bug 457392)
  • Pass parent widget to print preview dialog
  • fix crash in insertText
  • Make views for read-only themes read-only instead of disabling them
  • Cleanup: Remove unused members from KateStyleTreeWidget
  • Cleanup: use switch in defaultStyleName
  • Make defaultStyleCount reusable
  • Silence compiler warning when compiling without KAUTH
  • avoid crash on caret drawing if no view (bug 456508)
  • avoid accessing view pointer during printing (bug 456508)
  • remove unused library
KTextWidgets
  • Fix heading level line break handling with Qt 6.3
KWallet Framework
  • Remove duplicate header between cpp/h
  • Do not try to rename label twice in entryRenamed()
  • Do not create EntryLocation with empty key
  • Introduce Secret Service API
KWayland
  • Unset wl_display global filter upon filtered display destruction
KWidgetsAddons
  • [KMessageDialog] Emit notification sound just like KMessageBox
  • Make OK button configurable in KMessageBox::error/detailedError
  • Deprecate KMessage*::sorry
  • Remove declaration of unimplemented sorryWId(buttonOk) overload
  • Deprecate unsupported & unused KMessageBox::PlainCaption flag
  • Deprecate KMessageBox::about()
  • Add edit-clear-history icon to the Clear List action
KWindowSystem
  • Doc: Update WM spec URL
KXMLGUI
  • [KShortcutsDialog] Make it possible to reload shortcut schemes
  • [KShortcutsDialog] Make it possible to add a custom edit action
  • [KShortcutSchemesEditor] Fix bug introduced by refactoring in commit de0790fe
  • Fix crash of KMix in Legacy Tray
  • [KShortcutsDialog] Add icons for actions
  • KKeySequenceWidget: don’t use a QHash to hold a few elements
Plasma Framework
  • Update blur and other window effects when the dialog changes size (bug 457053)
  • Fix generated import versions for QtQuick Controls with Qt 6
  • ExpandableListItem: read Accessible.description from action
  • ExpandableListItem: give expand button a name and a tooltip
  • ExpandableListItem: add accessible properties
  • PC3/ToolTip: Sync to qq2-desktop-style: Copy delay & timeout implementations
  • PC3/ToolTip: Sync to qq2-desktop-style: Port to QtQuick.Layouts
  • PC3/ToolTip: Sync to qq2-desktop-style: Wrap text on label
  • PlaceholderMessage: use strict Javascript equality
  • Scope DialogShadows lifetime to application (bug 443706)
  • Use non-deprecated URL interceptors access with Qt 6
  • QMenuProxy::transientParent add null checks
Prison
  • Try lower ECC levels if we exceed the maximum QR code content size
  • prison-datamatrix unused local variable
  • Support ZXing 1.4.0
QQC2StyleBridge
  • Install style as a regular QML for Qt6
  • ToolTip: Sync to PC3: Strip out ampersands
  • ProgressBar,Slider: Adapt great precision to the harsh reality (bug 455339)
  • Fix QQC2 MenuBar theme (bug 456729)
  • properly reset the cursorshape (bug 456911)
  • Use QApplication::font with respective widget class
  • Wrap checkbox label
  • ToolTip: wrap text for long tooltips
  • TextArea,TextField: Remove not referenced id from background style item
  • TextField: Disable Undo for password fields, including its context menu
  • Remove dynamic QQC2 version selection
  • Fix: url types (like icon.source) are QVariant without length property
  • Nit: reformat long expressions
  • Menu: Fix wrong pixel metric being requested for verticalPadding
  • ProgressBar: Drop layout direction hack
Solid
  • [UDisksDeviceBackend] Port introspect to QXmlStreamReader
  • [UDisksDeviceBackend] Remove pointless QDBusInterface
  • udev/cpuinfo_arm: add more Apple part IDs
  • udev/cpuinfo_arm: change Apple part formatting
  • Drop lib prefix when building for Windows (MinGW)
Sonnet
  • Port to ECMQmlModule
  • Drop lib prefix when building for Windows (MinGW)
  • fix obsolete string
Syntax Highlighting
  • Jam: add block comments
  • Bash: add globany in Option ; add comment in [[ … ]] and other fixes for [[ … ]]
  • Zsh: add comment in [[ … ]] and other fixes for [[ … ]]
  • add CommonJS module and ECMAScript module extension for JS and TS
  • Add tool for matching lexers
  • Fix code regex and bump files version
  • Another bunch of languages hand mapped between minted and KDE
  • Fix some issues with code colouring when syntax was broken
  • Fix embedded lua code highlighting
  • Fix for lstlisting bug which prevented proper recognition of language
  • Fix regression for lstlisting
  • Add support for multiple minted and lstlistings languages
  • add rockspec file to Lua
  • Markdown: use zsh syntax for zsh code
  • Zsh: fix variable and string in a glob qualifier
  • Scheme: fix combined prefix number
  • add basic support of aspx and ashx (bug 437220)
  • Batch: fix many issues and add tests
  • R: add := operator (bug 450484)
  • Lua: new styles (Special Variable and Self Variable), remove hard color and fix special keywords in BlockComment
  • Disable spellcheck in systemd unit Files for non text Data
  • Disable spellcheck in SGML Files for non text Data
  • Disable spellcheck in Perl Files for non text Data
  • Disable spellcheck in git-rebase-todo Files for Comment Data
  • Disable spellcheck in fstab Files, except Comment Data
  • Disable spellcheck in .desktop Files, except Comment Data
  • Disable spellcheck in XML (Debug) Files, except Comment Data
  • Enable spellcheck for Comment Data in XML Files
  • Disable spellcheck in Bash Files for non text Data
  • Disable spellcheck in INI Files, except Comment Data
  • Simplify code by leveraging QMetaEnum::fromType
  • Use QMetaEnum to find number of available text styles
  • Introduce ThemeData::textStyle to share code
  • cleanup: share code to read Format colors from style or theme
  • Update atom-one-light.theme revision number
  • Fix atom-one-light.theme diff file colors
  • Fix atom-one-dark.theme diff colors
Security information

The released code has been GPG-signed using the following key: pub rsa2048/58D0EE648A48B3BB 2016-09-05 David Faure faure@kde.org Primary key fingerprint: 53E6 B47B 45CE A3E0 D5B7 4577 58D0 EE64 8A48 B3BB

Categories: FLOSS Project Planets

"Paolo Amoroso's Journal": Next Suite8080 features: trim uninitialized data, macro assembler

Planet Python - Sat, 2022-08-13 08:54

I decided what to work on next on Suite8080, the suite of Intel 8080 Assembly cross-development tools I'm writing in Python. I'll add two features, the ability for the assembler to trim trailing uninitialized data and a macro assembler script.

Trimming uninitialized data

Consider this 8080 Assembly code, which declares a 1024 bytes uninitialized data area at the end of the program:

# . . . data: ds 1024 end

For this ds directive, the Suite8080 assembler asm80 emits a sequence of 1024 null bytes at the end of the binary program. Similarly, dw emits 16-bit words. The executable file is thus longer and may be slower to load on the host system, typically CP/M.

The Digital Research CP/M assemblers, ASM.COM and MAC.COM, strip such trailing uninitialized data from binaries. After asking for feedback to r/asm, I decided to do the same with asm80. I should be able to implement this optimization by adding just one line of Python, so the feature is a low-hanging fruit.

Macro assembler

asm80 can accept source files from standard input, which makes it possible to combine the assembler with an external macro preprocessor to get a macro assembler. Thanks to its ubiquity, M4 is the clear choice for a preprocessor.

Assuming prog.asm is an 8080 Assembly source file containing M4 macros, this shell pipe can assemble it with asm80:

$ cat prog.asm | m4 | asm80 - -o prog.com

The - option accepts input from standard input and -o sets the file name of the output binary program.

The other Suite8080 feature I'm going to implement is a mac80 helper script in Python to wrap such a shell pipe and make assembling macro files more convenient. In other words, syntactic sugar wrapping asm80 and M4.

The script will use the Python subprocess module to set up the pipe, feed the proprocessed source to the assembler, and not much else.

#Suite8080 #Python

Discuss... | Reply by email...

Categories: FLOSS Project Planets

Pages