dalecosp Everyday is a school day
Today I learned
Life's throw a few variations of this lesson at me before. This one was a total surprise. Political firing.
Today I learned that you are all still here!
Elizabeth Today I learned you're back! Or are you just dropping by?
Weedpacket just wanted to see how you were all doing
NogDog retirement sounds delightful! I hope you get there very soon
- Edited
Unfortunately, not sure it's in the cards for me yet (you did just remind me my investment advisor called last week and I need to return her call).
I do have a "someday" project that the recent life lesson might allow me some time to work on, though.
Good to see you, @Elizabeth !
dalecosp Sometimes the universe whispers in our ear and if we don't listen, it gives us a little shove. Looks like it's time to get on that pet project! Those are the most fun to work on anyway Great to see you all!
- Edited
TIL (or forgot I knew?) that PHP will let you use array index notation with a function that returns an array, e.g.:
$test = [[1, 2], [3, 4], [5, 6]];
echo end($test)[1];
// outputs "6"
- Edited
NogDog $test = [[1, 2], [3, 4], [5, 6]];
echo end($test)[1];
// outputs "6"
You can do the same thing with a function that returns a function.
function shorten_to(int $maxlength)
{
return fn(string $str) => substr($str, 0, $maxlength);
}
echo shorten_to(14)("Remove the cap after engaging the safety latch.");
And for that matter, an array element that contains a function: $ops['delete']($id)
.
YIL that the destructuring operator ...
can be used on Traversables, not just arrays (basically anything foreach
can use, i.e. for which is_iterable
returns true).
function shuffles(int $length, array $elements)
{
for($i = 0; $i < $length; ++$i) {
shuffle($elements);
yield $elements;
}
}
$flattened = array_merge(...shuffles(5, ['a', 'b', 'c', 'd']));
echo join($flattened);
- Edited
Elizabeth Believe it or not, I am working on that project (24 hours/week) ... the other 16 I'm sitting at a desk and earning some wages. So, a PT contract isn't a bad thing compared to $0/hour until next year; it will keep Mrs. Dale from feeling like I'm being worthless while she's at work 4 days/week.
The pet project is pretty fun. Recently selected a domain name for it, and I have started the process of content production and enlisted a friend from LONG AGO to help with that in his "spare" time....
It bears a question: given a ton of responsibilities, (e.g. you're the CEO, the programmer, the media producer, the marketing agent, and the janitor), does your preferred work style do each in turn for a few hours or a day, then on to the next task for a similar time period, or do you do one for a week or a month and then switch, for productivity's sake? Anyone have that kind of experience?
Steve_R_Jones Hmm...has our admin's account been cracked by a spammer? :/
NogDog - Nope... I'm hoping the old theory is correct.... AND that bots will gather that address and SPAM it.
It's from a SPAMMER.
Steve_R_Jones
Would prefer a spam filter that isn't pants. (They're easy enough to recognise; where's @sneakyimp's project when we need it?)
@Weedpacket I never moved the spam filter into production , but I'm happy to share my findings -- if I can just remember where I put everything. IIRC, I tested two versions. One implemented a Support Vector Machine, the other an Artificial Neural Network. They mostly achieved the same results. NOTE that the filter works solely by checking the presence of absence (0 or 1 )of certain words. Intuitively, I suspect this would make the filter vulnerable to gaming somehow. It might be worthwhile to add additional signals (e.g., a 0 or 1 if the post has a link to a remote website, or if the post links to certain top level domains). The key is to have a large corpus of ham/spam examples to train the filter. The challenge is that training a filter requires a lot of number crunching and it's tricky to get PHP to do fast matrix multiplication.
sneakyimp NOTE that the filter works solely by checking the presence of absence (0 or 1 )of certain words.
Well, you've seen the sort of spam that has been coming through: big blocks of spurious text (sometimes in Chinese), an <img> tag so the server gets pinged when the spam is viewed, a link to some phone-list sharing site chucked in the middle. So it's not so much the absence or presence of certain words, but the overall appearance. It's weird the current spam filter is so ineffective.
Do you need a copy of my "bots.php"?? ... I'm sure it's up to date, if your system timezone is set to 12 years ago.
Although I was making a bit of a joke there, a central point of logic does exist, "consider the source." It's why RBLs exist.