ROBINHOOD.PL (99 KB)
This program converts Robinhood's 1099 forms to CSV format. If you trade stocks, you will have to report your sales to the IRS. During tax season, Robinhood's platform allows you to download the trades in PDF form. Most PDF viewers allow you to convert the PDF to TXT. And this Perl script will convert the TXT to CSV so you can import it into Excel. If you make a lot of trades, this tool comes handy. It can save you days of tedious work and do it in 5 seconds. This program can also be useful for accountants who have to enter a lot of Robinhood trades. This tool makes it super fast to process a large number of trades. The output will show the security name, number of shares, date acquired, date sold, profit or loss, cost basis, wash sale, etc.
If you use Windows, you may download the Offline Installer (1.2 MB) which will install and run this perl program. More Info
When you download the offline installer, you'll save it as a text file
on your desktop. You see that the file name ends with .TXT,
which indicates that it's a plain text file. You'll have to
change that .TXT ending to .JS by renaming the file. Once
you have renamed it, you'll just double-click on it,
and the program will run. It's that simple!
It will automatically unpack Robinhood.pl and TinyPerl 5.8 into a folder called C:\PERL58 on your hard drive.
Three files will be created. This takes approximately half a second.
HOW TO RENAME A FILE IN WINDOWS
Normally, Windows hides end of file names, so you won't see the
.TXT ending, and you can't change it. To work around this,
press the Ctrl and Alt keys together. Hold them down.
Press the Delete key once. And now release both Ctrl and Alt.
A blue screen will appear. Click on Task Manager.
Then click on the File menu >> Run New.
Enter the following command and press Enter:
This should bring up File Explorer settings.
Click on the View tab, and scroll down a little bit where
you see this line: "Hide extensions for known file types"
Make sure there is no check mark next to this line!
Then click on OK and close Task Manager. Now, go back to the
desktop, and now you'll see that the file you downloaded earlier
is actually named robinhood_offline_installer.txt. It ends with txt!
Rename it to robinhood_offline_installer.js and then double-click on it to run.
This program is the same as the one above, but this works for 1099 tax PDF files released by Charles Schwab brokerage firm. This program takes TXT files and converts them to CSV.
This ZIP file contains Notepad2, TinyPerl 5.8 for Windows (executable) and Robinhood.pl and Schwab.pl. It's 12 megabytes. This is all you need to run my perl scripts. Expand to a folder called C:\PERL and follow the instructions in README.TXT. (Note: Perl was invented by Larry Wall, and TinyPerl was built by Graciliano M. P. in 2003. Notepad2 was created by Florian Balmer.)
This perl script compares two directories. It compares directory1 and directory2, and displays a list of files and directories that do not exist in directory2.
This command-line utility reads one or more BMP image files and prints everything that one could possibly find out by analyzing the BMP file's header. It tells you a lot more than just the image width and height and the number of colors. It also displays the colors in the palette. Displays a health % so you can see if the header is damaged at all. It prints data pointers, color masks, format, encoding, print size, padding, header size, Bitmap version. Has an /S switch so it can automatically find BMP files in sub-directories as well.
This program displays the uptime, processes, threads, the amount of free memory, used memory and total memory in the system. It has been tested on Windows XP/7, Ubuntu Linux and MacBook. (It did not work on the MacBook.)
KNAPSACK1.PL and KNAPSACK2.PL
This script solves the knapsack problem. The knapsack problem goes something like this: You have 100 items each with different size. And you have a bag which you must fill all the way to the top. You have to figure out how to fill the bag in a way that you end up with the least amount of empty space. This script tries to find a combination of numbers whose sum equals 500. The random numbers are between 1 and 500.
The first script solves the problem step by step, displaying what happens at each step. The second script just solves the problem and displays the results without "debug" messages.
This tiny script was a programming exercise I saw somewhere. It sorts email addresses by domain.
This Perl script deletes duplicate JPG files within a directory. Sounds like a great idea at first, but it's not. If I have 3 identical JPG files called "Charles.jpg" and "Copy of Charles.jpg" and "Florida.jpg" then I want to keep the first one, but the program doesn't know how to come to that decision. So, it will ask the user each time what to do. This makes the program really slow. If you have thousands of duplicate files, it will take forever...
This Perl script can read any kind of BMP file and converts the image to a HTML TABLE element, allowing you to post pictures in PerlMonks or other forums where the HTML IMG tag is not allowed but the TABLE element is allowed. See an example here.
This Perl script demonstrates the QuickSort algorithm. This program sorts an array of numbers.
This program reads all HTML files in the current directory and extracts META tags and saves them in an output file. (This program can be used to extract other things from HTML files as well, not just META tags.)
Similar to the program above, this program reads all HTML files in the current directory and extracts all the links and writes them to a file.
Displays the contents of a directory.
Analyzes file contents and displays what percentage of a file is binary vs plain text.
This script converts all Linux/Apple text files in the current directory to DOS format.
This perl script can package a bunch of perl modules and perl scripts into a single JS file that can execute on a Windows computer that does not have Perl installed yet. (The JS script works like an offline installer that unpacks TinyPerl 5.8 on the Windows computer and then executes the custom scripts without any prompts or questions. Just double-click & run.) WARNING: THIS SCRIPT IS BIG. Don't open the link unless you're ready to download a 1.2 megabyte perl script. It's that big, because it contains a copy of TinyPerl 5.8 Windows executable! (The Robinhood offline installer mentioned above was generated by this tool.)
This function converts any binary string to plain text format that contains nothing but letters and numbers. The algorithm tries to compress the string by using a simple RLE algorithm and grouping characters depending on how often they are used. So, in some cases, the output will be shorter than the input. Most of the time the result will be smaller than what we can achieve using the escape() function or string2hex() function or base64 encoding.
This is a very simple product database script. Click here to see it in action.
This script displays the prime numbers under 1 million, and it contains functions for factoring numbers and finding the common factor.
This script calculates the first 15 digits of PI using the BBP formula which was discovered in 1995 by Canadian mathematician Simon Plouffe.
I use TinyPerl 5.8 on Windows XP. Unfortunately, many of the modules are not working on my computer, so I write my own subroutines. I use this Perl "toolbox" file to grab what I need.
This file includes the following subroutines:
_filename() escapeinit() jstimestamp() shiftrstr() _ismatch() escapestring() lastchar() shiftstring() abort() everyother() lc() shortdate() about() execx86() lcase() shuffle() add() exit() localtime1() shufflestr() addsuffix() expand7to8() localtime2() shufflestring() appendfile() extractbigint() localtime3() simplifyfraction() appendtextfile() extractduplicates() localtime4() simplifypath() arraytolowercase() extractfirstword() localtime5() slice() arraytouppercase() extractlist() localtime6() solveknapsack() backwardshuffle() factorthis() localtime7() sortnumbers() beep() filesize() localtime8() speak() between() find() localtime9() spitbmp() bigint2bin() findchar() localtimea() spitcolorbmp() bin2hex() findhighest() localtimeb() split() bin2str() findinarray() longeststring() splitab() buildpdiffstring() findlowest() lspace() splitalong() capitalize() flipvertical() mag() splitalongdiffchar() ceil() float2str() makeinteger() splitat() ceil() floor() makepath() splitgroup() center() floor() max() splitline2() changecolor() fmod() min() splitlines() chararray2string() forceint() mod_2() splitnumbers() charset() formatdate() movecursor() splitparagraphs() charstats() formatpath() nicejoin() splitpath() chdir() forwardshuffle() nicepath() spliturl() checksum() fract() nospace() splitwords() chopint() fstr2hex() num2set() startswith() choplineafter() getabsolutepath() numberlength() startswithchar() clearab() getargint() openfileforreading() str2bin() cls() getargstring() openphotoeditor() str2float() cmp() getargvalue() pause() str2hex() collapsearray() getchar() percentageoftext() str2int() collapsespace() getcharcode() poweroftwo() str2txt() collapsewhitespace() getcommonfactor() print_safehtml() strafter() collapsewhitespace2() getconsolesize() printpowersoftwo() strbefore() collapsewhitespace3() getcurrentdirectory() printrows() strchr() color2str() getcurrentdrive() printstrptr() strfilter() commify() getdrivelist() printsubs() string2chararray() compactarray() getfilename() printtime() stringpattern() compactperl() getformdata() processquerystring() strquote() compress8to7() getkey() qsort() strxor() containsdigits() getnumbers() quotepath() suffix() countchar() getos() randombinary() sumofall() countchars() getpath() randomchar() swap() countstr() gettime() randomcolor() swapchar() cprintf() getword() randomintlist() swapchars() crc() group() randomstring() swapnum() crc16() hex() readdir() test() createcanvas() hex2bin() readdir2() textdump() createfile() hex2int() readfile() timestamp() createreversetable() hex2int2() readline() titlecase() cut() hex2int3() readlines() tobin() decode() hex2str() readtextfile() tobin16() decodeb64() hexchar() readtil() tobin8() decodecookie() hexcode() redirect() tobinunlimited() decodeinteger() hexdigitat() removeblanklines() tobinx() decodeintrange() hexdump() removeprefix() tohex() decodetext() hexint() removesuffix() tohex() decodeurl() hextime() removetail() tohexcolor() decryptchar() hr() replace() tohexlong() decryptstring() include() resetcolor() toint() demotex() indexof() reversecase() tonumber() die() insertbetweenchars() rgb() toperlstring() diff() int2str() rgb2str() tosafehtml() div_2() invertcharset() rnd() totitlecase() div_3() ip2hex() rol16() tr() div_5() is64bitos() rol32() trim() div_by_digit() isanyof() rol8() trimchar() drawbox() isbigint() ror16() truncatestr() drawrandomboxes() isbin() ror32() txt2str() drawrandomdots() isdec() ror8() uc() encode() isfilename83() rors() ucase() encodeb64() isfromcharset() round() unescape() encodeinteger() ishex() rspace() unescapestring() encodeintrange() isinteger() rtrim() updatescreen() encodetext() islc() savebmp() usetimer() encodeurl() isletter() say() writefile() encryptchar() ismatch() self() writetextfile() encryptstring() isnumber() selfpath() xchg() endswith() isreadonly() sentencecase() xcrypt() endswithchar() istext() set2num() xor() endswithslash() isuc() setbgcolor() xorstr() endwith() isutffilename() setpixel() env() joinfrom() sgi_compress() escape() joinpath() sgi_expand()
These are subroutines for working with files... This is a minimized version, which means spaces have been removed.
It includes the following subroutines: