Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

pryrt's scratchpad

by pryrt (Abbot)
on Mar 18, 2016 at 23:38 UTC ( [id://1158293]=scratchpad: print w/replies, xml ) Need Help??

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

  • Short, Self-Contained, Correct Example = [id://1177642]
  • %:: hash contains all the top-level, and %::Win32:: contains all the entries in the Win32 namespace. oh, right, documented in Symbol Tables
  • Floating Point

  • What Every Computer Scientist Should Know About Floating-Point Arithmetic = [https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html| What Every Computer Scientist Should Know About Floating-Point Arithmetic]
  • Data::IEEE754::Tools = [metamod://Data::IEEE754::Tools]
  • ?node_id=3989;BIT=floating;a=pryrt = [href://?node_id=3989;BIT=floating;a=pryrt]
  • Devel::Peek::Dump() for showing NV, IV, ...

  • Monastery HowTo

  • Help for Free Nodelet Settings = Free Nodelet help
  • Good Intentions: Wikisyntax for the Monastery = Free Nodelet code to allow WikiSyntax for posting in the Monastery

    Long-Term Bookmarks

  • Book: Higher Order Perl
  • Perl REPL suggestions -- BUK's includes windows memory usage sub mem { `tasklist /nh /fi "PID eq $$"`=~ m[(\S+ K)$] }
  • Re: Moving from scripting to programming
  • bug in eval: eval { die }; if($@) {...} might not work; use eval { die; 1 } or do {...} or Try::Tiny instead
  • Perl Debugging aids:
  • Handling Windows 'Junctions'
  • KeePass
          ▶ 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
  • CGI: FCGI + CGI::Fast | alt hippo++ | CGI::Lite (core) CGI::Simple CGI::Minimal CGI::Thin | Mojolicious::Lite Tutorial and Cookbook | Mojo+ParPacker | includes link to some mojo docs I haven't looked at
  • Websockets:
  • afoken's root-config-file editing daemon description
  • Getopt::Long + POD::Usage combo
  • stevieb's test structure, with Travis-CI
  • stevieb's test structure, with GitHub Actions
  • stevieb's creating XS from Inline::C
  • stevieb's cpan -autobundle for using same modules across perl distros
  • BrowserUK's math: 3d screw | HSV sigmoid
  • SQL over SSH Tunnel
  • Re^4: Turning a questionable string into a numberRe^3: unicode in windows → for win32 unicode access of files, use open(my $fh, '<...', $fn) or open(my $fh, '>...', $fn), where ... is :raw:utf8, :raw:encoding(utf16le), or :raw:encoding(utf16be) (as appropriate): modern note: open shows :encoding(UTF-8) as well; PerlIO indicates that :utf8 doesn't validate sequences on input, so :encoding(UTF-8) should be used instead (PerlIO::encoding)
  • Re^2: Find Created and Last Modified Date of Excel xls file
  • Re: Avoid keeping larger lists in Memory
  • Re: Eliminating userid/passwords in code
  • Re^5: Using a controllerless servo on the Raspberry Pi with Perl
  • Automated CPAN Testers reporting on Mac OS X available => 1nickt will run perlbrew--exec cpamn My::Module, and auto-load results to CPANTS
  • Re: regex for nested "<"/">' => choroba's simple and understandable example of Marpa::R2 grammar parser in action
  • Silence CPAN Testers on obviously broken platforms? => CPAN Testers: PASS/FAIL vs UNKNOWN vs NA (and how to return each to CPAN Tester Matrix)
  • Re^2: Paws S3 Download Object? => wrapping Shell commands in oo notation: I had seen IPC::Run3::Shell from haukex, but not IPC::Run3::Shell::Wrapper, which does the next step, and could be used for my wrapping of openssl and similar, I think.
  • Log::Any goes in .pm, Log::Any::Adapter goes in the calling .pl application; if you want to redirect application STDERR to the Adapter, then use Log::Any::For::Std in the .pl application
  • as well
  • Permutations/Combinations:

  • 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

    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; ^
    ... I am not sure that it will properly hash. (the 32bit perl installations didn't have that error, and so didn't need --force)

    PAR::Packer quirks


    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


    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
    Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others scrutinizing the Monastery: (7)
    As of 2024-04-23 10:49 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found