I'm a Java programmer certified by Oracle, here for lifelong learning away from social cliques. 🐦🔥
Don't wanna be here? Send us removal request.
Text
Real user feedback for Perl Kit v.10
Question
Did you receive any feedback from real users?
Answer
Yes, I received an email when the project started to compile again. At the point of stating the obvious, the whole development process was done in 1997. Nevertheless, the development continues, as Perl 1 doesn't compile without warnings. There has been a social media post about this project, but I don't try to maintain any contact.
Check out the original Q&A.
0 notes
Text
First impression of Perl Kit v1.0
Question
Can you give us your first impression of the Perl 1 compiler?
Answer
My first impression would be that what's in Perl 1 is often bogus. It's from the year 1987, and therefore, you must be careful about using it anyhow. Numerical operations can lead to an unexpected error nowadays. Perl 1 isn't written in Perl, contrary to new versions of Perl that are written in Perl. One should know translation methods to understand it better and understand what YACC does. The code would give a pretty good impression to somebody skilled in Perl programming and compilers.
Check out the original Q&A.
0 notes
Text
Automatic discovery of German grammar
Let's consider using Apache OpenNLP to analyse a German crime story entitled "Sein letzter Fall." First, Apache OpenNLP has to be downloaded and unzipped to a separate folder. The German tokens model also has to be downloaded separately. In the Apache OpenNLP directory, one can create a folder 'Grammatik' with a subfolder 'models'. It's a destination directory to copy the opennlp-de-ud-gsd-tokens-1.2-2.5.0.bin file. This file should be renamed to modelsde-token.bin. Next, the sein-letzter-fall-1.txt has to be obtained, best by using an OCR software on the first page. That's it, the software is ready to partially discover the German grammar. To obtain tokens, the following command can be used.
..\bin\opennlp TokenizerME models/de-token.bin < sein-letzter-fall-1.txt > output-tokens.txt.
Here's the output, although most of the text has been removed.
Loading Tokenizer model … done (0,338s)
Der Wasserkocher piept laut . Samantha ist noch sehr müde . Sie geht in die Küche , nimmt einen Teebeutel und macht sich eine große Tasse Darjeeling . Average: 14,9 sent/s
Total: 1 sent Runtime: 0.067s Execution time: 0,446 seconds
To get the tags, opennlp-de-ud-gsd-pos-1.2-2.5.0.bin has to be obtained and copied to the 'grammatik/models' directory. This file should be renamed to de-pos-maxent.bin. The valid command to discover tags is:
..\bin\opennlp POSTagger models/de-pos-maxent.bin < output-tokens.txt > output_pos_tags.txt
Here's the output file with most of the content removed.
Loading POS Tagger model … done (0,295s)
Loading_PROPN Tokenizer_PROPN model_VERB …_PUNCT done_ADJ (0,338s)_NOUN
Der_DET Wasserkocher_NOUN piept_VERB laut_ADP ._PUNCT Samantha_PROPN ist_AUX noch_ADV sehr_ADV müde_NOUN ._PUNCT Sie_PRON geht_VERB in_ADP die_DET Küche_NOUN ,_PUNCT nimmt_VERB einen_DET Teebeutel_NOUN und_CCONJ macht_VERB sich_PRON eine_DET große_PUNCT Tasse_NOUN Darjeeling_PROPN .
Total:_PROPN 1_NUM sent_VERB Runtime:_PROPN 0.067s_ADP Execution_NOUN time:_PUNCT 0,446_NUM seconds_DET
Average: 52,6 sent/s
Total: 10 sent Runtime: 0.19s Execution time: 0,532 seconds
The next step would be to obtain a model of the German language and then parse the input text.
0 notes
Text
What are you doing with Perl Kit v1.0?
Question
Can you explain what has been done with the Perl 1 repository? I mean the recent commits made by @Stagyrite.
Answer
The refreshed Perl 1 is supposed to run on modern operating systems. It wasn't even compiling at first. A non-compiling AWK to Perl translator was also taken care of. It now compiles on several modern operating systems, and that includes Windows (Cygwin). Multiple compiler warnings were eliminated.
Check out the original Q&A.
0 notes
Text
Other versions of Perl Kit v1.0
Question
Are there any other repositories with Perl 1 available?
Answer
Yes, there are other versions of Perl 1, and other pages as well. Here's a quite complete list of them.
GitHub/Stagyrite/Perl-1.0
GitHub/eltikia/Perl-1.0
GitHub/Stagyrite/perl-1.0_16
GitHub/eltikia/perl-1.0_16
CPAN/perl-1.0_16
GitHub/kaworu/perl1
GitHub/eltikia/perl1
ETLA/perl1
GitHub/AnaTofuZ/Perl-1.0
Check out the original Q&A.
0 notes
Text
Proof of concept for Perl Kit v1.0
Question
Is there any proof that it works?
Answer
Yes, there are tests in the 't' subdirectory and this is their output.
./base.cond
1..4 ok 1 ok 2 ok 3 ok 4
./base.if
1..2 ok 1 ok 2
./op.unshift
1..2 ok 1 ok 2
Check out the original Q&A.
0 notes
Text
Known bugs in Perl Kit v1.0
Question
Are there any known bugs or limitations?
Answer
Yes, there are, and here's an example. Let's assume you check how much memory 'postgres' uses. This can be done by executing:
echo "q" | top -b | grep "postgres" | awk -F " " '{ memory += $10 } END { print memory }
Let's assume the numbers were: 0.2, 3.6, 3.5, 0.1, 0.0, 0.0, 3.7, 1.0, 0.6, 0.4, 2.4, 2.5, 2.3, 2.5, 0.4, and 0.4. The output number is 23.6, and it's a valid percentage value. Here's a Perl 1 program generated with the Awk to Perl translator from the 'x2p' subdirectory. It's a slightly modified version of it.
#!./perl eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_]+=)(.*)/ && shift; # process any FOO=bar switches $, = ' '; # set output field separator $\ = "\n"; # set output record separator while (<>) { ($Fld1,$Fld2,$Fld3,$Fld4,$Fld5,$Fld6,$Fld7,$Fld8,$Fld9,$Fld10) = split(' '); $memory += $Fld10; } print $memory;
The output number is now 23.599999999999997868, and that is a slightly different result. The difference is 0.000000000000002132.
Check out the original Q&A.
0 notes
Text
When scanning a list of old websites, I discovered this video. It was black-and-white, but I colored it with an online tool called Kolorize.
0 notes
Text
Compiling Perl Kit v1.0
Question
How to compile it?
Answer
Start by installing the required packages ('gcc', 'yacc' and 'make') in a target system. It might not compile when you have an old version of make. If you're on Cygwin, check that you have GNU Make 4.4.1 or so.
Fetch the files from GitHub. The project can't built when sources have CRLF line endings. Either don't fetch with CRLF line endings or convert line endings to LF.
git config --global core.autocrlf false git init git remote add origin https://github.com/Stagyrite/Perl-1.0.git git pull origin main
Now you can compile a 'perl' program.
./Configure make depend make
The same can be done in the 'x2p' subdirectory.
cd x2p cp ../Configure . ./Configure make depend make
One might want to run all tests from the 't' directory, as those all pass, at least on Cygwin.
Check out the original Q&A.
0 notes
Text
Other developer platform for
Perl Kit v1.0
Question
Is there any other developer platform where I can find those sources?
Answer
Yes, it's on Bitbucket. This process of importing Perl 1 even has its history. Perl 1 was pushed to Bitbucket a long time ago. The author of the push made that particular version better in terms of compiling errors. Then, the repository was removed from Bitbucket, and people pushed it to GitHub. That GitHub repository was left almost intact and forked this year. The forked repositories were fixed to compile. Finally, the valid code was imported back to Bitbucket.
Check out the original Q&A.
0 notes
Text
Resolve the types of a method's parameters
Question
Given a Java method with two parameters of type int and a second method with two parameters of type int and long, when I call them passing 41 and 63 as their arguments, which one is called? Of course, those two methods are named the same and are in the same class, thus raising a question about that ambiguity.
Answer
Let's assume that the methods are named 'typeOf'. Thus, candidates for method call typeOf(41, 63) are:
void typeOf(int, int)
void typeOf(int, long)
The right method call is the one of type 'void typeOf(int, int)'. Let's assume that the methods should write either 'Integer' or 'Long' depending on the second argument type. Here's what an example class should look like.
class TypeDetector { static void typeOf(int numberX, int numberY) { System.out.println("Integer"); } static void typeOf(int numberX, long numberY) { System.out.println("Long"); } }
The output is always 'Integer', as one can try in JShell.
| Welcome to JShell -- Version 17.0.10 | For an introduction type: /help intro jshell> class TypeDetector { ...> ...> static void typeOf(int numberX, int numberY) { ...> System.out.println("Integer"); ...> } ...> ...> static void typeOf(int numberX, long numberY) { ...> System.out.println("Long"); ...> } ...> ...> } ...> | created class TypeDetector jshell> TypeDetector.typeOf(41, 63); Integer
0 notes
Text
A trivial math question
Question
I have a trivial math question, although things might get tricky in Java. Given two variables, one of type Integer, and the second of type Short. When I add them and cast the result to a String object, then what happens? Does it throw a class cast exception in this particular case?
Answer
Of course, it won't throw a class cast exception. Compilers or a Java course can help to understand that. I recommend testing it out in The Java Shell tool (JShell). It's a tool available in modern Java. As one can see, it wouldn't even compile because no integer can be cast to a String. Those two variables sum to an integer, and therefore can't be cast to a String.
| Welcome to JShell -- Version 17.0.10 | For an introduction type: /help intro jshell> Short one = 1; one ==> 1 jshell> Integer two = 2; two ==> 2 jshell> String three = (String)(one + two); | Error: | incompatible types: int cannot be converted to java.lang.String | String three = (String)(one + two); | ^---------^
The same can be shown with a Java class.
public class TypeTest { public static void main(String []args) { Short one = 1; Integer two = 2; String three = (String)(one + two); } }
Let's try to compile it, and we'll see the compile-time error.
javac TypeTest.java TypeTest.java:6: error: incompatible types: int cannot be converted to String String three = (String)(one + two); ^ 1 error
The expression can be converted from an integer to a string by wrapping using 'String.valueOf()'. Another way is to concatenate the result with an empty string. Here's how it looks in JShell.
| Welcome to JShell -- Version 17.0.10 | For an introduction type: /help intro jshell> Short one = 1; one ==> 1 jshell> Integer two = 2; two ==> 2 jshell> String three = String.valueOf(1 + 2); three ==> "3" jshell> three = one + two + ""; three ==> "3"
1 note
·
View note
Text
Throwing an Error exception in Java
Question
What kind of exception is the Error exception? I'm also curious about inheriting it.
Answer
First, Error doesn't inherit from the RuntimeException class. Therefore, one can't call it a runtime exception. Nevertheless, it can be called an unchecked exception. Of course, it's not a checked exception.
As for inheriting it, one can create another Error. It's meant to be for unrecoverable errors like a thread death. One can't possibly bring a thread back to life.
Java 1.7 brought yet another constructor for this particular class. One can disable suppressing exceptions and thus any effect of the 'addSuppressed()' method. One can also disable filling in the execution stack trace, which means an error can come without a stack trace written in it.
0 notes
Text
["About, "me"] | stdout
I spent many of my early years in Kalisz, where I still ride my all-terrain bike, and that’s just for instance. I studied Computer Science at the University of Wrocław and at the Wrocław University of Science and Technology. For several years, I worked as a Java programmer at Unity Group or, more currently, Univio. Even more currently, I’m a senior Java developer working near Wrocław. At the risk of repeating myself, I’m now a certified Java programmer.
My private hobbies include 🌲🌑 hiking, 🏕️🌒 camping, 🎥ξ going to the cinema, 🇺🇸🇩🇪 foreign languages, and 🛼☀️ inline skating.
As for the computer games, they can turn into a copylefted GitHub page, although just for instance. Along with starting Emacs, Standard ML programming would be my professional hobby, although its purpose may differ greatly. Additionally, I prefer Raku (Perl 6) to be my professional hobby, as script programming matters.
1 note
·
View note