Posts

Reading Strings in C

Image
This code is an implementation of a function which reads a string from standard in using pure C code that I did in high school for a programming class. The test.c program is used to test the function works properly. The code is limited to reading strings of 255 characters long and there is no error handling or reporting. get_string.c/******************************************************************* * get_string * * char* get_string(const char* prompt, char* buffer, char* default); * * a function that will read from the the keyboard and return a * string in a buffer to be read by the user. default is a string * to be returned on the case that the user types only an enter * key. * ********************************************************************/#include <stdio.h>#include <stdlib.h>#include <string.h>char*get_string(constchar prompt[256],char buffer[256],char error[256]){//declare the variablesint counter;//print the users promptprintf("%s",prompt);//befo…

Mobile Pages with AMP

Image
Today marks the first day that AMP is enabled on all articles on the site. This feature will allow the pages on this website to appear in the Google Discover feed and new app and should greatly improve performance of the website on mobile devices.As a continuation of the article, Optimizing the Site, the Google mobile optimization tool known as AMP was installed to help increase performance of the website on the limited shared hosting resources that are available right now due to budgetary constraints.
In order to accomplish this, the community version of wbAMP was installed in Joomla. This plugin generates an AMP mobile page for everything on the website. Unfortunately, all articles have to meet strict metadata specifications. This involves adding special size image thumbnails for all pages on the website and adding additional metadata tags using tags such as the following.{ wbamp-meta name="image" url="images/elbertv2_2.jpg" height="1200" width="120…

How to Install LAMP in Ubuntu

Image
LAMP is an acronym that stands for Linux, Apache, MySQL, and PHP. Together, these applications are one of the most popular website hosting platforms. It is free, open-source, and easy to get started. This tutorial will show the process for how to get up and running quickly in Ubuntu 19.04 or other related Linux distributions.
Install LinuxDownload an Ubuntu 19.04 iso from their website and burn the iso to a disk or flash the image to a flash drive. Boot the server to the installer and follow the on-screen instructions.Update RepositoriesIn the terminal application in Ubuntu, enter the following command to update the repositories.sudo apt updateInstall Apachesudo apt install apache2Install MySQLsudo apt install mysql-serverInstall PHPsudo apt install php

Doubly Linked List Database Application in C

Image
This was a project from high school done with a friend that implemented a doubly linked list and used this list to manage a database of school records.Compile with gcc *.c
This is the entry point of the program. At launch, it allocates memory for the database and prompts the user for an action. #include "project.h" COURSE array[255];//Declare global Variables COURSE* FIRST; COURSE* LAST;char filename[255];voidmain(void){char choice;//Declare Variablesint i =0; BOOLEAN quit = FALSE; FIRST = NULL;//Initialize variables LAST = NULL;for(i =0; i <256; i++)InitializeRec(&array[i]); filename[0]='\0'; i =0;do//menu open until quit = TRUE{ choice =DisplayMainMenu();//Display Main Menu and Get Main Menu Choiceswitch(choice)//Menu swithc{case'o':OpenData();break;case'a':AddRec();break;case's':SearchData();break;case'b':BrowseData();break;case'd':printf("\nDelete Record\n");break;case'c&#…