Sometimes when developing we want our program to process items continually. This can be a fairly simple concept: the script sits in a loop and constantly does what we need it to until there are no items to process. Then our program is finished. If we want to run more items, we need to start the script again. As you can see, this could be a tedious, laborious, and potentially inefficient system.
Continue reading "LDC #69: Running in the Background" »Friday, January 26. 2018
LDC #69: Running in the Background
Friday, January 19. 2018
LDC #68: Application Shutdown Script
Way back in LDC #39, we discussed the file “ApplicationInitialize.ls” and how any script functions in it are run at application startup. With GoFiler 4.21b’s release on January 16, 2018, we’ve added support for a similar file, “ApplicationShutdown.ls”. As the name suggests, this file is called when GoFiler shuts down. This is a pretty powerful feature because it lets you do things to “clean up” your environment if you’ve modified it with other scripts or if you want to return the system to a desired state after using the application.
Continue reading "LDC #68: Application Shutdown Script" »
Friday, January 12. 2018
LDC #67: Legato Program Design Best Practices
In past blog entries I’ve written, the topic is often about simple scripts. It’s covered a couple hundred lines of code, and the script usually handles a single function. This means that every script that’s been covered so far has been relatively simplistic in structure, with no more than 10 or so separate functions. With so little code, a script can still be easily maintainable even if no thought is given to how it’s put together. The design of the application is less important in these cases. However, what if you want to do a larger project? What if your script is going to include multiple UI screens and integrate with multiple systems? This is where you would want to pay some attention to design and apply some software design practices to the script to ensure that you get the best possible result. The blog post this week will not contain an example of the script but will rather discuss how we can apply some software engineering principles to Legato design to avoid common pitfalls.
Continue reading "LDC #67: Legato Program Design Best Practices" »
Friday, January 05. 2018
LDC #66: CSV - The Simplest Data Format
Comma delimited data is perhaps the simplest way of representing a table of information. Many applications that export data will produce a CSV file, allowing for simple and fast extraction of data. However, despite the fact that CSV is a common format, it is not standardized. Reading and writing may also seem simple, but there are sticking points, such as how to handle commas and line returns that occur in the data itself. Wouldn’t it be nice to have tools to deal with CSV data? Legato does.
Continue reading "LDC #66: CSV - The Simplest Data Format" »Friday, December 29. 2017
LDC #65: It's Almost The New Year
It’s nearly the day where we all stare at the clocks waiting for the time to strike midnight. I’m talking, of course, about New Year’s Eve. A new year means new beginnings and new adventures. So to count us down to midnight I created a Legato script to inform you how long it is until the new year.
Continue reading "LDC #65: It's Almost The New Year" »Friday, December 22. 2017
LDC #64: Stripe tables, not candy canes!
Maybe you can stripe candy canes too, given it’s the season. However, this blog post is talking about striping tables! We had another feature request for GoFiler last week that we thought would make a good blog post. This request concerned developing a way for GoFiler to start striping the table after the first dollar sign in the table instead of at the normal body position that GoFiler detects. There are two ways we could do this: we could spend a lot of time modifying a core function of GoFiler, the Polish Table function, or we could make a Legato script that fires on post-process and re-does the striping of the table. The latter is preferable because it doesn’t affect other uses who perhaps don’t want or need this feature. Anyone who does can simply add this script to the extensions folder and that user can get the benefits of a new features.
Continue reading "LDC #64: Stripe tables, not candy canes!" »
Friday, December 15. 2017
LDC #63: Promoting Underlines To Table Cells
Here at Novaworks, we often get requests for features to add to GoFiler. Our topic this week is a client request that I think is another good example of how to use Legato to do some HTML parsing and modification. The original request was to have a way to detect paragraphs within table cells with underlines (border-bottom property) or underline tags in them. It would be great to remove the underlines from the paragraphs and put them on the table cell with the paragraphs instead. This script will work with two selection modes in an HTML file: you can either drag-select the table cells on which you want to run it, or you can click in a cell and run the script without selecting anything. Our script takes the start of your selection and finds the previous table cell. Then, working from that point until the end of the current cell or your selection, it locates any paragraphs with underlines or underline tags. If it finds them, it removes them and puts them in the table cell instead.
Continue reading "LDC #63: Promoting Underlines To Table Cells" »Friday, December 08. 2017
LDC #62: Too Many Links and Not Enough Time
If you have ever wanted to download a bunch of HTML files from a website, you either need to do it manually (yuck!) or find some browser extension to help you along. Today we can offer a third option: using Legato. Since Legato can parse HTML files, you can quickly make a script that reads a website and decides what links to follow and which ones to ignore. Many browser extensions only let you filter by type of file, but with Legato the sky is the limit.
Continue reading "LDC #62: Too Many Links and Not Enough Time" »Friday, December 01. 2017
LDC #61: Logging: Leaving Your Mark
Today we’re going to talk about logs. Legato provides a number of input and output (I/O) methods. The choice and style of I/O can vary as much as programmers and users. Logs are a convenient method of keeping and relaying data without establishing a complex data formatting regiment. They are useful for reporting information to a user (such as the number of instances a search and replace operation changed the text, for example, or whether or not there were errors in an procedure). They are also employed by many high-level application functions, such as a validation function indicating a list of possible notices, warnings, and errors.
Continue reading "LDC #61: Logging: Leaving Your Mark" »Friday, November 24. 2017
LDC #60: Messy Code? No problem!
Sometimes HTML code can be hard to read. While this isn’t an issue for editors and viewers that work with the rendered results, it can be a problem when advanced editing needs to happen. For example, a client sent over an HTML file that looks nice in the browser but it contains coding errors. When you go into the code to fix the errors, it’s hard to make the necessary changes because of problems like poor spacing.
Continue reading "LDC #60: Messy Code? No problem!" »
Friday, November 17. 2017
LDC #59: The Program Before the Program
Programming can contain many layers of abstraction. A useful layer is to change manner in which the computer actually sees your program. Language ‘directives’ do just that. In this article we will explore three of the commonly used program directives and discuss how they can be used with Legato.
Continue reading "LDC #59: The Program Before the Program" »Friday, November 03. 2017
LDC #58: Bulk Importing CIKs into a Series and Classes Library
When using GoFiler to do filings that have series and classes in them, using the library function is a lot faster than manually adding each series and each class one at a time. The GoFiler series/class library also has the ability to look up a single CIK at a time and download the series and class information associated with it from the SEC. But what if you have a large list of CIKs, and want to add all of them to the series and classes library at once? Well, using Legato, we can run a lookup on each CIK in the input list and, with the response, build a library file which we can then import into GoFiler.
Continue reading "LDC #58: Bulk Importing CIKs into a Series and..." »
Friday, October 27. 2017
LDC #57: More CSS Property Editing With Legato
Last week, we explored editing SGML properties with Legato. By using some of the Legato SDK functions, we can read the properties of an SGML tag and change those properties to new values. This is pretty simple and straightforward. However, what if we want to do something based on a particular setting? For example, what if we want to employ an “Indent Body of Paragraph” function, where the first line of the paragraph doesn’t move but the subsequent lines are indented? We can’t simply read the indent value and add to it because we cannot guarantee that the same unit of measurement is being used. We need to read the unit, normalize it into a standard unit, add to it, convert it back to the original measurement style, and write it back out. It’s a bit more involved than simply setting properties, but it lets us perform some pretty interesting operations.
Continue reading "LDC #57: More CSS Property Editing With Legato" »
Friday, October 20. 2017
LDC #56: Editing CSS Properties With Legato
In past blog posts, we’ve used Legato to remove HTML tags or to add new ones. One function we haven’t really explored is looking at a tag and changing its properties. Editing CSS properties with Legato is extremely powerful because it lets us change the document’s appearance in clean, interesting, and intelligent ways. This week’s script is a very basic but very powerful example of this concept.
Continue reading "LDC #56: Editing CSS Properties With Legato" »
Friday, October 06. 2017
LDC #55: Protecting Your CCCs With Encryption Part 2
Last week, we covered a script that could take a single folder, search it, and encrypt (or redact) CCCs in project files and XML files. After thinking more about the problem, we realized that the script (while a good start) didn’t go far enough to solve the situation. First, the script only worked with EDGARLink Online XML and GFP files. Any file where the CCC appeared on a different line of the code than the tag declaring it a CCC would not have been obscured. Also, backup files created by GoFiler would not have been obscured. There are several ease of use items that should be addressed as well. The changes made to this newer version are enumerated below:
Continue reading "LDC #55: Protecting Your CCCs With Encryption..." »
Quicksearch
Categories
Calendar
December '24 | ||||||
---|---|---|---|---|---|---|
Mo | Tu | We | Th | Fr | Sa | Su |
Sunday, December 22. 2024 | ||||||
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |