Sponsored Content
Full Discussion: Coronavirus maths anyone?
The Lounge What is on Your Mind? Coronavirus maths anyone? Post 303044928 by hicksd8 on Monday 9th of March 2020 09:02:06 AM
Old 03-09-2020
Coronavirus maths anyone?

This is a really interesting watch.............. (well worth a few minutes of your time)

YouTube
These 6 Users Gave Thanks to hicksd8 For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with Maths

Heres a script i wrote as a bit of practise. What it does is insert a line in the middle of a file. The line being $1 and the file being $2 #!/bin/bash rm tempfile touch tempfile count=1 linenum= `wc -l < $2` if then echo $1 >> $2 else even=`expr "$linenum" % 2` if then... (3 Replies)
Discussion started by: Quesa
3 Replies

2. Shell Programming and Scripting

Perl - maths equation - need help

if input to the perl program is ' ( p * ((a+b) * (c+d))) + q ' it shuld give the output as ' pac + pad + pbc + pbd + q ' .can anyone suggest a way to do this ? (7 Replies)
Discussion started by: Anuj8584
7 Replies

3. Shell Programming and Scripting

Maths with variables

Hello, I'm trying to write a while loop for a decimal value in tcsh which I know can't be done. Instead I want my increments to be one order of magnitude too large and then divide it by 10 when I use the variable. However, I don't know how to divide my variable and set it as another. set... (1 Reply)
Discussion started by: DFr0st
1 Replies

4. Shell Programming and Scripting

Using IF statements with maths where the input is not an integer

Hi All I've made a few scripts which using GDAL extract the value of a pixel within a given raster. The purpose is to work out the combine value of every pixel. I thought there may have been an easier way to do this but alas! The code below extracts the pixel value at position X Y. The... (3 Replies)
Discussion started by: StudentFitz
3 Replies

5. Shell Programming and Scripting

Simple maths calculator loop.

Hi, I am trying to make a maths calculator that: 1. Prompts the user for a number. 2. Prompts the user for an operation (add, subtract, divide or multiply) 3. Prompts the user for a number. 4. Prompts the user for another operation (same as above) OR the option to get the result for the... (4 Replies)
Discussion started by: johnthebaptist
4 Replies

6. Shell Programming and Scripting

Maths in shell scripts

Hi, Need help on this. I need to increment a variable by 1 but retain as 2 characters. I am using expr to do additions: NEWSERIAL=`expr $SERIAL + 1` $SERIAL can range from 01-99. After adding "1", I need the result to be 2 characters, eg: 02+1 = 03. By default expr will truncate the... (4 Replies)
Discussion started by: vchee
4 Replies

7. Shell Programming and Scripting

Calculate the constant e to 14+ decimal places using integer maths.

Hi guys... I am loving this integer maths thing. 64 bit systems are certainly easier than 32 bit, but hey, I don't intend to leave out my fav' platform. Using one of the 'Brothers' methods, URL inside the code. #!/bin/sh # # #!/usr/local/bin/dash # e_constant.sh # Brother's formula . #... (2 Replies)
Discussion started by: wisecracker
2 Replies

8. Programming

Wuhan Coronavirus Status for China - Rapid Prototype Blynk App with ESP8266

Here is a rapid prototype app I just put together which might be of interest to some people. Basically, I have parsed the data from a Chinese web site which is tracking the Wuhan coronavirus, and cache that data every minute via a local cron file and make a simple API available to a Blink app. ... (6 Replies)
Discussion started by: Neo
6 Replies

9. Programming

Wuhan Coronavirus Status App for China - Rapid Prototype using MQTT and the IoT OnOff IOS App

With a little bit of work, was able to build a nice "Wuhan Coronavirus Status" app using MQTT and the IoT-OnOff app. More on this technique here: ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages The result turned out nice, I think. I like the look and... (10 Replies)
Discussion started by: Neo
10 Replies
Lingua::Stem::En(3pm)					User Contributed Perl Documentation				     Lingua::Stem::En(3pm)

NAME
Lingua::Stem::En - Porter's stemming algorithm for 'generic' English SYNOPSIS
use Lingua::Stem::En; my $stems = Lingua::Stem::En::stem({ -words => $word_list_reference, -locale => 'en', -exceptions => $exceptions_hash, }); DESCRIPTION
This routine applies the Porter Stemming Algorithm to its parameters, returning the stemmed words. It is derived from the C program "stemmer.c" as found in freewais and elsewhere, which contains these notes: Purpose: Implementation of the Porter stemming algorithm documented in: Porter, M.F., "An Algorithm For Suffix Stripping," Program 14(3), July 1980, pp. 130-137. Provenance: Written by B. Frakes and C. Cox, 1986. I have re-interpreted areas that use Frakes and Cox's "WordSize" function. My version may misbehave on short words starting with "y", but I can't think of any examples. The step numbers correspond to Frakes and Cox, and are probably in Porter's article (which I've not seen). Porter's algorithm still has rough spots (e.g current/currency, -ings words), which I've not attempted to cure, although I have added support for the British -ise suffix. CHANGES
1999.06.15 - Changed to '.pm' module, moved into Lingua::Stem namespace, optionalized the export of the 'stem' routine into the caller's namespace, added named parameters 1999.06.24 - Switch core implementation of the Porter stemmer to the one written by Jim Richardson <jimr@maths.usyd.edu.au> 2000.08.25 - 2.11 Added stemming cache 2000.09.14 - 2.12 Fixed *major* :( implementation error of Porter's algorithm Error was entirely my fault - I completely forgot to include rule sets 2,3, and 4 starting with Lingua::Stem 0.30. -- Benjamin Franz 2003.09.28 - 2.13 Corrected documentation error pointed out by Simon Cozens. 2005.11.20 - 2.14 Changed rule declarations to conform to Perl style convention for 'private' subroutines. Changed Exporter invokation to more portable 'require' vice 'use'. 2006.02.14 - 2.15 Added ability to pass word list by 'handle' for in-place stemming. 2009.07.27 2.16 Documentation Fix METHODS
stem({ -words => @words, -locale => 'en', -exceptions => \%exceptions }); Stems a list of passed words using the rules of US English. Returns an anonymous array reference to the stemmed words. Example: my @words = ( 'wordy', 'another' ); my $stemmed_words = Lingua::Stem::En::stem({ -words => @words, -locale => 'en', -exceptions => \%exceptions, }); If the first element of @words is a list reference, then the stemming is performed 'in place' on that list (modifying the passed list directly instead of copying it to a new array). This is only useful if you do not need to keep the original list. If you do need to keep the original list, use the normal semantic of having 'stem' return a new list instead - that is faster than making your own copy and using the 'in place' semantics since the primary difference between 'in place' and 'by value' stemming is the creation of a copy of the original list. If you don't need the original list, then the 'in place' stemming is about 60% faster. Example of 'in place' stemming: my $words = [ 'wordy', 'another' ]; my $stemmed_words = Lingua::Stem::En::stem({ -words => [$words], -locale => 'en', -exceptions => \%exceptions, }); The 'in place' mode returns a reference to the original list with the words stemmed. stem_caching({ -level => 0|1|2 }); Sets the level of stem caching. '0' means 'no caching'. This is the default level. '1' means 'cache per run'. This caches stemming results during a single call to 'stem'. '2' means 'cache indefinitely'. This caches stemming results until either the process exits or the 'clear_stem_cache' method is called. clear_stem_cache; Clears the cache of stemmed words NOTES
This code is almost entirely derived from the Porter 2.1 module written by Jim Richardson. SEE ALSO
Lingua::Stem AUTHOR
Jim Richardson, University of Sydney jimr@maths.usyd.edu.au or http://www.maths.usyd.edu.au:8000/jimr.html Integration in Lingua::Stem by Benjamin Franz, FreeRun Technologies, snowhare@nihongo.org or http://www.nihongo.org/snowhare/ COPYRIGHT
Jim Richardson, University of Sydney Benjamin Franz, FreeRun Technologies This code is freely available under the same terms as Perl. BUGS
TODO
perl v5.10.1 2010-06-13 Lingua::Stem::En(3pm)
All times are GMT -4. The time now is 07:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy