Ralph Corbett, M.S.

Web DesignerSoftware Engineer



C

++


Cin >> Inside Loops

This is how to reduce the number of lines of code.
Insert the cin >> into the error-checking loop. These will all check the integer x to see if it is 6 or greater. If not, then the phrase "Enter number less than 5:" will be displayed over and over until 6 or greater is displayed.





if(cin)
IF is not really a loop, but it does work with
the cin >> inside it.

#include "stdafx.h"
#include < iostream >

using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
int x =0;

instead of:

cin >> x;
if (x > 4)
cout << "Enter number less than 5\n;";


use this:

if(cin >> x, x > 4)
cout << "Enter number less than 5\n;";

return 0;
}

while(cin)
while(cin >> x, x > 4)
{
cout << "Enter number less than 5\n";
}


do...while(cin)
do
{
cout << "Enter number less than 5:\n";

} while(cin >> x, x > 4);



for(cin, x, cin)
for (cin >> x; x > 4; cin >> x)
{
cout << "Enter number less than 5:\n";
}



The Translation Dictionary. Created over 1000 HTML webpages using C++

Find it here for easier reading, as there are over 1200 lines of code: The Code.




Java

Script


How to change a tag from li to p and back again


The code


Tiddly

Space and JavaScript


Part of my graduate assistant for the 2012 presidential election, was to create a macro to change the CSS of a
tiddler (blog entry) based on the tags for that tiddler. As the CSS for the entire site was fixed – it was difficult to change only small parts of it.

After looking at the source code, every tiddler was in a div tag. So, I searched the div tags for the class name, and added a custom class based on a tag with a JavaScript "match" method. The hard part was to clear the array of all empty spaces, the NULL and "Undefined" parts. The JavaScript plugin for this is very basic, and the normal "clear
empty array parts" methods were not working. After a few days of this, I "went out of the box" into the realm of
absurd, and came up with some code that actually works; skip the counter over the empty parts. Scary.

Here is the scary part, followed with the entire macro.

This code can be witnessed at my TiddlySpace resume found at: http://ralphcorbett.tiddlyspace.com/.






Net

working


Demonistartiin my Networking.
Should a person wish to visit my first webpage done in college, they could take the links ralphcorbett.com -> doodles -> scroll down to steampunk and click the link.
Or if you are a frequent visitor to this site, (and I thank you), you would type in the address bar: www.RalphCorbett.com/steampunk. To make sime simpiler, a subdomain has been added. Now use this steampunk.ralphcorbett.com