Public Scratchpad | Download, Select Code To D/L |
Links for quick reference
2021-Feb-11: saw erzuuli CB [abbr://PM], so now I must test: try [abbr://PM] = PM or [abbr://Auto Abbrev|After Pipe] = After Pipe or [abbr://SSCCE] = SSCCE
include the codified version for easy copy/paste
Floating Point
- First mention of Data::IEEE754::Tools @ Re: Determining the minimum representable increment/decrement possible?
- Digits of decimal expansion of binary float @ Re^5: Variables are automatically rounded off in perl (humans)
Monastery HowTo
Long-Term Bookmarks
- Devel::Peek::Dump() for showing NV, IV, ...
- perl -c to compile without running
- Introspecting type informations? shows perl -MO=Deparse ... for rephrasing and -MO=Concise for the opcode tree
- [id://1178059] (2016-Dec)
- [id://1223819] (2018-Oct)
- private repo: https://subversion.assembla.com/svn/pryrt/trunk/perl/perlmonks/junctions.pl (2018-Oct)
▶ KeePassRest: access KeePass via REST-ful API (from thread Best way to store passwords) => please note that KeePassRest requires a license to a separate product
▶ Excellent discussion of passwords in scripts / w/ keepass
▶ Announcing WWW::KeePassHttp: my foray into Perl/KeePass integration
- per N++ GhostText request, I finally have something that might encourage me to try to write a Mojo-based server that handles websockets, and maybe start to understand what they're all about
- Mojo Websocket Example w/ DBI by jberger
- Mojolicious Websocket example -- reply links to jberger's github repo MojoliciousIntroduction, and provides some steps toward getting a working server (websocket '/echo') and client (the js embedded in the get '/' and index.html.ep)
- Algorithm::Permute - either iterator or callback; just permute
- Algorithm::Combinatorics - iterator; permutations, combinations, derangements, variations, subsets, ...
- Math::Combinatorics - iterator or dump; permute, combine, factorial
Windows and PAR::Packer
Inspired by this blog (which was linked from dasgar's post):
C:\TEMP> mkdir tmp C:\TEMP> echo blah >> tmp\a.txt C:\TEMP> echo blah blah >> tmp\a.txt C:\TEMP> echo blah blah blah >> tmp\a.txt C:\TEMP> pp -o hello.exe -a tmp -e "use File::Spec; BEGIN { if(exists +$ENV{PAR_TEMP}) { my $d = File::Spec->catfile($ENV{PAR_TEMP}, 'inc'); + chdir $d or die qq(chdir '$d' failed: $!); }; }; open my $fh, '<', 'tmp/a.t +xt' or die qq(tmp/a.txt: $!); foreach (<$fh>) { print qq(a: $_); }" C:\TEMP> cd .. C:\> TEMP\hello.exe a: blah a: blah blah a: blah blah blah
That's pretty cool. While testing that out, I was using both my "system" strawberry perl and my berrybrew perls, and discovered that I need to cpanm --force PAR::Packer, because of a compiler warning/error during one of the testing steps (of sha1.c). It installs and seems to work, but given the message
... I am not sure that it will properly hash. (the 32bit perl installations didn't have that error, and so didn't need --force)gcc -c -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS +-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-alias +ing -mms-bitfields -I"C:\usr\local\apps\strawberry\perl\lib\CORE" - +DPARL_EXE=\"parl.exe\" -DPAR_PACKER_VERSION=\"1.036\" -s -O2 boot.c In file included from mktmpdir.h:85:0, from mktmpdir.c:1, from boot.c:10: sha1.c: In function 'sha_transform': sha1.c:146:2: warning: right shift count >= width of type T >>= 32; ^
PAR::Packer quirks
- exe icon: aplonis:Re: Icon for pp on Strawberry ← pryrt:Re: Icon for pp on Strawberry ← swl:Re^2: How do I replace the camel icon on Windows exe built with pp? ← http://www.zewaren.net/site/?q=node/116
I was able to get a local-lib style par-packer that I could use
then, if I do a batch wrapper which runsstart cpanm -L .\locallib --look pp &rem will put the +`--look` shell in locallib mode copy some_other_icon.ico myldr\winres\pp.ico &rem update the ic +on; won't necessarily show updated icon in Explorer.exe unless you ru +n SHChangeNotify† cpanm --notest . &rem from same she +ll, so inherits the locallib from `--look` exit &rem leaves the `- +-look` shell
... I can call the locallib version of pp with its customized icon, thus ensuring that my out.exe has the customized iconsetlocal PATH=c:\path\to\locallib\bin;%PATH% set PERL5LIB=C:\path\to\locallib\lib\perl5 pp -x -o out.exe in.pl
†: SHChangeNotify(SHCNE_ASSOCCHANGED,SHCNF_IDLIST,NULL,NULL) will normally refresh icons for Explorer.exe - include all XS dlls: Very Odd Issue When Using pp to Create an .exe File Including Date::Calc -> pp -x -o out.exe in.pl
- include external DLLs: Re: PAR::Filter::Crypto Fails -> pp --link c:\path_to_strawberry\c\bin/zlib1__.dll -x -o out.exe in.pl
can use Sysinternals Process Explorer's ^D to view the DLLs of a process: any that the .exe is grabbing from the perl hierarchy needs the --link included
Login With ...
After recent discussions of Mojolicious::Lite login examples (first steps with Mojolicious::Lite and RFC / Audit: Mojo Login Example), and some of my recent thoughts about LDAP, the Need help with AWS Cognito question caught my eye: I would love to see one of the example M::L apps updated to use Login with Google, Login With Facebook, and similar for other OAuth providers (preferrably multiple providers at once).
This medium.com:@thomashelstrom article shows how he did a quick login-with-Google, which might be a good starting point.
Post Re: LWP::Authen::OAuth2 terminology describes possible procedure for using LWP::Authen::OAuth2 to login with google or similar
Even better, I decided to search Mojo for "OAuth2" and found Mojolicious::Plugin::OAuth2, which is exactly what I was thinking about without having to re-invent the wheel.
FFI::Platypus
I had seen mention of FFI::Platypus before, but Re^2: Modernizing the Postmodern Language? had me take a quick look from a different perspective -- I had thought it was supposed to provide a way to access external libraries, but from the documentation I had linked before, I got too confused. This time, I was able to find an example of accessing kernel32.dll ... and with that, it might be possible to replace my monster amalgamation of Win32::API, Win32::GUI, and Win32::GuiTest -- though I might still want GuiTest separate during the module tests, because it's a pretty clean way for remote-controlling the GUI
Strawberry newer than perl 5.32
- Build My Own Strawberry: Re: My favourite new Perl feature (in 2022) ... => Using MinGW to build perl on windows forcing it to expand * into glob in cmd.exe
- Newest Perl on Win without ActiveState or Strawberry
- Re: When might we see new releases of Strawberry Perl on Windows
- Re: When might we see new releases of Strawberry Perl on Windows
- 2023-Jul-10: v5.36.1 and v5.38.0 Released!!!!
Auto-added links
High Performance Game of Life
Re^2: How has Perl affected you?
Re: Command Shell
gpg using Crypt::OpenPGP
function fitting
EU::MM prereqs: specifying recommends and suggests (recommends is stronger than suggests, if I read it correctly)
Re: perl create database with folder system
Re: Execution hangs on File::Find: thanks to this article, and the linked http://perldoc.perl.org/perlvar.html#%24%7B%5EWIN32_SLOPPY_STAT%7D, I think I might be able to use that variable to speed up my at-home backup script...
Perl, Android web app, AJAX, JSON
Polygon Creation -- Request for Algorithm Suggestions
RFC: 100 PDL Exercises (ported from numpy)
Basic Neural Network in PDL
Conways Game of Life in PDL
Re^2: searching polygons not merged
Re^3: first steps with Mojolicious::Lite
haukex's scratchpad -- has multiple Mojo/Mojo::Lite examplesP
Dataflow programming on CPU and GPU using AI::MXNet http://blogs.perl.org/users/sergey_kolychev/2017/02/machine-learning-in-perl.html
Converting Hashes to Objects
dear Mom -
[RFC] Discipulus's step by step tutorial on module creation with tests and git
How to merge two different coverage reports remotely
RFC Tutorial: Adding and extracting VBA to and from Excel files
FAQ7: How do I clear a package?
Advice on learning Perl and graphics => it looks like Prima might be a useful GUI frontend... though the tester results on Windows leave me worried