In my previous tutorial, I taught you how to build an HTML tag builder. The advantages of this method being:
- Reduce the number of code lines in your views.
- Implement complex input easy by using a simple function call.
- Ensure the consistency of the similar controls throughout the software.
- Greatly reduce the management time and the complexity over a long period of time.
The table builder allows to repeatedly generate all the buttons, inputs, and dropdown lists from the HTML tag builder in rows and columns format. The tabular presentation logic allows reducing furthermore the number of code lines in your views because it is amazingly easy to introduce abstraction for such structure. The tabular structure also reduces a lot the space required by the different controls on the user interface by logically grouping those controls. Finally. The tabular structure allows us to implement many cool features such as column sorting and research.
The example presented in this tutorial allows creating two types of table. Firstly, it is possible to generate the classic HTML table which is great to produce reports.
Secondly, it is possible to build structures which look like a table (div) in which each row is actually a form. The second structure is particularly interesting since it allows to interact (save, delete, etc.) with the content of each row individually. Based on my professional experience, the div tables are used on pretty much every graphic user interfaces (and often many times on the same interface) of a business management software.
Even more important than the creation of the table in itself, during this tutorial, I will put a special focus on the iterative development method; In other words, how to split a complex module into simple sub-functionalities which can be implemented step by step while keeping the end goal in mind. To do so, I keep the six versions of my Table builder class so you can easily understand how to use this methodology in your concrete projects.
The iterative development simply problems which would otherwise be too complicated when analyzed as a whole. Therefore, this approach is one of the best ways to achieve your end goal quicker and with higher quality coding (less redundancy and fewer bugs).
Beyond the pedological aspect of this tutorial, I’ve strived to offer you an off-the-shelf solution usable as it is in pretty much any of your web projects and which can easily be extended to support even more awesome functionalities specific to your software. To do so, I used a very sober implementation of Bootstrap 4 for the visual aspect of this API.
Finally, this project has been thoroughly tested with PHPUnit et Jasmine. The API presented in this tutorial is very similar to the one I implemented for a development Framework I created to build a repair shop management software. If I had to create a business management software, you can be sure I would use this API (with the jQuery UI part) to generate all my buttons, checkboxes, radio buttons, dropdown lists, tables, and so on.
You can use all the source code of this tutorial in any of your personal or professional projects without any royalties or copyrights.
Note: This API has not implemented of AJAX in order to be compatible with as many projects as possible. Even though AJAX is beyond the scope of this tutorial, I strongly suggest you use AJAX on all of your switches and buttons. Also, keep in mind that the sorting and research functionalities do not support AJAX connection to the database. Those are meant for small tables meant to be completely loaded on the page all at once. In general, I recommend to limit the size of your tables to a maximum of 100 rows and use AJAX to refresh the table based on the user search and sort criteria.
If this tutorial was useful, please like, comment, and share with your friends. Your support is much appreciated.
Thank you and have a great day,
Jonathan Parent-Lévesque de Montréal
Bootstrap 4: https://getbootstrap.com/docs/4.1/getting-started/introduction/
Compare plug-in: https://sourceforge.net/projects/npp-compare/
Free source code: https://drive.google.com/open?id=1IyMiOqclDhE0arR6bU8ThZaEr5wM7nn_
This site provides links to random videos hosted at YouTube, with the emphasis on random.
The original idea for this site actually stemmed from another idea to provide a way of benchmarking the popularity of a video against the general population of YouTube videos. There are probably sites that do this by now, but there wasn’t when we started out. Anyway, in order to figure out how popular any one video is, you need a pretty large sample of videos to rank it against. The challenge is that the sample needs to be very random in order to properly rank a video and YouTube doesn’t appear to provide a way to obtain large numbers of random video IDs.
Even if you search on YouTube for a random string, the set of results that will be returned will still be based on popularity, so if you’re using this approach to build up your sample, you’re already in trouble. It turns out there is a multitude of ways in which the YouTube search function makes it very difficult to retrieve truly random results.
So how can we provide truly random links to YouTube videos? It turns out that the YouTube programming interface (API) provides additional functions that allow the discovery of videos which, with the right approach, are much more random. Using a number of tricks, combined some subtle manipulation of the space-time fabric, we have managed to create a process that yields something very close to 100% random links to YouTube videos.
YouTube is an American video-sharing website headquartered in San Bruno, California. YouTube allows users to upload, view, rate, share, add to playlists, report, comment on videos, and subscribe to other users. It offers a wide variety of user-generated and corporate media videos. Available content includes video clips, TV show clips, music videos, short and documentary films, audio recordings, movie trailers, live streams, and other content such as video blogging, short original videos, and educational videos. Most content on YouTube is uploaded by individuals, but media corporations including CBS, the BBC, Vevo, and Hulu offer some of their material via YouTube as part of the YouTube partnership program. Unregistered users can only watch videos on the site, while registered users are permitted to upload an unlimited number of videos and add comments to videos. Videos deemed potentially inappropriate are available only to registered users affirming themselves to be at least 18 years old.
YouTube and selected creators earn advertising revenue from Google AdSense, a program which targets ads according to site content and audience. The vast majority of its videos are free to view, but there are exceptions, including subscription-based premium channels, film rentals, as well as YouTube Music and YouTube Premium, subscription services respectively offering premium and ad-free music streaming, and ad-free access to all content, including exclusive content commissioned from notable personalities. As of February 2017, there were more than 400 hours of content uploaded to YouTube each minute, and one billion hours of content being watched on YouTube every day. As of August 2018, the website is ranked as the second-most popular site in the world, according to Alexa Internet, just behind Google. As of May 2019, more than 500 hours of video content are uploaded to YouTube every minute.
YouTube has faced criticism over aspects of its operations, including its handling of copyrighted content contained within uploaded videos, its recommendation algorithms perpetuating videos that promote conspiracy theories and falsehoods, hosting videos ostensibly targeting children but containing violent and/or sexually suggestive content involving popular characters, videos of minors attracting pedophilic activities in their comment sections, and fluctuating policies on the types of content that is eligible to be monetized with advertising.