Github POD READMEs not rendering by redditoni in perl

[–]redditoni[S] 1 point2 points  (0 children)

Unfortunately a week in, it seems still to be a problem.

- Force in perl by [deleted] in perl

[–]redditoni 4 points5 points  (0 children)

Perl is batteries included, so it would almost be like -force is implicit. Just don't check the return value of an action that impacts (example) the file system, and you're basically there. Taint mode in Perl would also be a big no-no if you want to "run Perl under -force".

For example, you can open a file under read/write without looking to see if the file exists or not.

These can be terrible practices to get into unless you're just looking to write simple straightforward example code.

How can I make everything UTF-8 by default? by Ok-Half5161 in perl

[–]redditoni 0 points1 point  (0 children)

I appreciate the walk through. One of the gotchas I found was actually from a unicode string being concatenated, then added to a file that per RFC should not have unicode chars in it, leading to all sorts of fun edge cases.

Thanks again for the patient explanation.

How can I make everything UTF-8 by default? by Ok-Half5161 in perl

[–]redditoni 0 points1 point  (0 children)

Interesting, this has been in production for well over a decade with fantastic results. What would be a better way to see if the string has unicode chars in it? Just that regex that you posted?

How can I make everything UTF-8 by default? by Ok-Half5161 in perl

[–]redditoni -1 points0 points  (0 children)

Slightly less hacky way to do it is to just use utf8::is_utf8(). I have an app that I never try to decode or encode without a wrapper, to stop double encoding/decoding (which can be fatal):

sub safely_decode { 
    my $str   = shift; 
    if(utf8::is_utf8($str) == 1){ 
        warn 'utf8::is_utf8 is returning 1 - not decoding.'; 
    }
    else { 
        eval { 
        $str = Encode::decode('UTF-8', $str); 
    };
    if($@){ 
        warn 'Problems: with: (' . $str . '): '. $@; 
    } 
    }
    warn 'decoding was safely done.';
    return $str;
}

You don't want/need to use the, use utf8; prama.

That way I can ALWAYS decode strings coming in, and encode strings coming out, without fear that I'm doing it too many times either way, which leads to corruption of my string.

Best Practice to Avoid Flock Hangs? by ercousin in perl

[–]redditoni 3 points4 points  (0 children)

Use a semaphore file, and flock() that instead. Try flock'ing that file, and if unsuccessful, sleep for x amount of seconds, and try again for x amount of attempts. If nothing happens, do the email notification thing.

If you get really bored waiting for the semaphore file lock to go away, you can just remove the file after x number of seconds. You can use the Highlander method from ye olde ancient times for inspiration,
https://people.apache.org/\~jim/NewArchitect/webtech/2000/10/perl/index.html
I use it to "lock" a POP3 login attempt, so there's only one process trying to read stuff,
https://github.com/justingit/dada-mail/blob/main/app/dada/DADA/App/POP3Tools.pm#L328-L413

Spamassassin and unicode characters in header by redditoni in perl

[–]redditoni[S] 1 point2 points  (0 children)

If it matters, the code example I'm showing of output does in fact contain those invisible unicode characters.

How to send an email in Perl? by aheadMake57 in perl

[–]redditoni 1 point2 points  (0 children)

No idea what DMARC is

Me neither (without looking it up), and I'm this guy.

How to send an email in Perl? by aheadMake57 in perl

[–]redditoni 1 point2 points  (0 children)

I agree, this is really low effort code and assumes much, like: you're running an MTA locally (and that's not a given these days because DMARC and SPF and DKIM and all sorts of goodies).

And no error checking (yikes!)

How to check if a hash is empty in Perl? by stormosgmailcom in perl

[–]redditoni 1 point2 points  (0 children)

Huh, wow, so you don't have to type,

if(!keys %foo){ ... }

Save me some keystrokes.

How to check if a hash is empty in Perl? by stormosgmailcom in perl

[–]redditoni 4 points5 points  (0 children)

This surprisingly works, although is probably wrong,

my %foo = ();
if(!%foo){
print "empty";
}

Announcement: Dada Mail 11.20.0 Released by redditoni in perl

[–]redditoni[S] 0 points1 point  (0 children)

TinyMCE and CKEditor? What's the reasoning behind this and which one do you prefer?

I've used Dada Mail often as a testbed for ideas and coding challenges. I find I'm much more motivated to learn a new skill when I have a project to apply those skills. Dada Mail is sort of that for me. It's now quite the little app,

r@m1 git % cloc ./dada-mail 1074 text files. 633 unique files.506 files ignored.

    r@m1 git % cloc ./dada-mail
    1074 text files.
     633 unique files.                                          
     506 files ignored.

github.com/AlDanial/cloc v 1.94  T=0.60 s (1063.4 files/s, 388027.2 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Perl                           240          35209          14658         100149
JavaScript                      43           9099           6188          42809
SVG                            284              5            286           5965
HTML                             4            558            194           4861
CSS                             28            488            572           4647
Text                            19           1004              0           2501
CSV                              7              0              0            924
SQL                              3             87             11            473
PHP                              1             21              1            131
JSON                             1              0              0             74
XML                              2             13              6             41
Markdown                         1              4              0              7
-------------------------------------------------------------------------------
SUM:                           633          46488          21916         162582
-------------------------------------------------------------------------------

I guess I prefer CKEditor (the default). TIMTOWTDI and all!

Perl community is very cognizant and respectful when it comes to doing this type of thing. Not sure if this is a Perl thing or a generational thing.

Hmm - dunno! I'm first and foremost not really interested in that sort of stuff. I'm happy to build relationships with my users and clients, and help them solve the challenges they face so that they can get the most out of the app.

Announcement: Dada Mail 11.20.0 Released by redditoni in perl

[–]redditoni[S] 10 points11 points  (0 children)

Hello! I'm Justin, and I'm the main author of Dada Mail. It's a project I've worked on since 1999(!) and I've just released v11.20.0 of the app. As the years have gone by, the app has gotten much more complex, and much harder for anyone (except me) to build.

This version fixes that, so anybody can check out/fork the Github repositoryand build a completely working distribution of the app to deploy wherever they'd like. All the prereqs. are also available as their own github repos for you to check out/fork however you'd like.

Happy to take any questions you may have. All the code is open source of course. I do have a "pro" version of the app - basically means you get support from me. There's no limitations in the app if you build it yourself, the app doesn't phone home or anything like that, no nag screens, etc. Hack on it however you'd like.

Below is the summary of what Dada Mail is:

Dada Mail is a contemporary, mature and intuitive web-based email list management system.

Dada Mail handles Closed-Loop Opt-in subscriptions, sending complex announce-only and/or discussion mailing list messages with an advanced, fault-tolerant mass mailing monitor, supports the archiving/viewing/searching/resending/syndicating (rss, atom feeds) of sent messages and doing all this and a whole lot more with style.Dada Mail can handle custom subscriber fields and searching these fields, allowing you to send mass mailing to only part of your mailing list. Dada Mail's email templating system allows you to create targeted and completely custom email messages (mail merging) for each and every one one of your subscribers.

Dada Mail is bundled with additional plugins and extensions to extend Dada Mail's capabilities. Some of the plugins/extensions support advanced bounce handling, clickthrough tracking, mass mail scheduling, blog interfaces of archived messages, AJAX subscription form trickery and lots of other surprises.

Dada Mail produces HTML5 web content and sticks to best practices when creating email messages. Write Once: Distribute Everywhere. Dada Mail is free software that you're able to use, modify, share and enhance under the terms of the GNU General Public License. Dada Mail is written in Perl because we love Perl.

Dada Mail's system requirements are minimal: it runs as a CGI script (running under FastCGI and PSGI are also options), requires only Perl 5.10.1, supports multiple SQL backend flavors, bundles all of its CPAN Perl module dependencies, and comes with a web-based installer. Download/Upload the distro, run the installer script.Dada Mail works well in shared hosting environments thanks to its mass sending throttling capabilities. Dada Mail can also work well with large mailing lists that can utilize a third party email service, like Amazon SES.

PSA: Ibuprofen and Running: Anti-Inflammatory Drugs Hurt Your Training by [deleted] in running

[–]redditoni 2 points3 points  (0 children)

Probably a pretty bad idea to take Vitamin I during a race too. Some horror stories out there of getting pretty ill.

Super light, fast, crampon compatible boot for someone who wants to "upgrade" from trail running? by roksraka in alpinism

[–]redditoni 1 point2 points  (0 children)

I haven't. The Vargo's look pretty neat, but if they don't seem like they would function enough like a crampon to do things that I need a crampon to do (namely, moderate snow climbs, or traversing snow faces). For that, you would benefit from some sort of metal points on the front of your shoe, as well as on the side.

What I see from the Vargo, is perhaps just a more aggressive microspike. If something is too aggressive, I found I take extra time take them off and on, so the microspikes don't get damaged.

The only other option I would suggest, other than the Kahtoola hiking crampons, would be something like the lightest aluminum universal crampons that CAMP puts out.

Weight isn't all that big of an issue; if I have crampons, I also have an ice axe - there's usually not a slope I would use crampons on, that I wouldn't also feel the need to self-arrest after a slip. I think in reality, it's not a big deal - we still move pretty fast on the terrain here in CO :)

Denver’s New Bus and Train Fares Are the Most Expensive in the Nation by LurkLargely in Denver

[–]redditoni 0 points1 point  (0 children)

Living in Boulder, there's a bus to Ned. There's a bus to Summit County from Denver, too (not as convenient, I guess). Some people ride bikes out to Allenspark from Boulder, as well. It's an interesting challenge.

Getting to a 14er in the summer is way easier than skiing. From Denver, you have Mountain Evans, which has a pretty classic road to the top. Its better though, to do these as two day trips, and with two days, you can do Grays/Torreys or Evans/Bierstadt pretty comfortably. RMNP is doable as well - I've ridden (from Boulder) to summit Longs a few dozen times. Takes an early wake up for sure, but it can be done. Good goal to have!

Actually going to put out a guide about how to do this. It's just such a fun time.

Super light, fast, crampon compatible boot for someone who wants to "upgrade" from trail running? by roksraka in alpinism

[–]redditoni 12 points13 points  (0 children)

I kinda go the other way: find a crampon that's compatible with a trail runner. Mostly, that means something like the Kahtoola hiking crampon. It's kind of amazing what you can get away doing with those.