David Croushore

A Man in Progress

Finishing the AMP Stack

Yesterday, I learned what it meant to set up a server and an application server in order to start doing some web development.  Today, I learned how to do it.

An “AMP Stack” is a group of three, free software components that make it possible to do web development.

The A stands for Apache, the server software I set up yesterday.

The M stands for mySQL, a database program from Oracle that you can get for free.

The P stands for PHP, the server side scripting language that can be used to build web applications.

Finally, I downloaded the mySQL workbench, which allows for easy creation and use of mySQL databases.  Tomorrow, I’ll begin working on learning how to use these software packages to start doing web application development.

Comments

The Difference Between a Server and a Web Application Server

Another thing I should probably have known…

When your browser goes out on the Interwebs to find the webpage www.davidcroushore.com, it sends out a request to a server and that server finds the page and sends back some HTML, which the browser then renders as a beautifully simple white page with a lot of text on it.

Sometimes, though, you go to a site that’s a little more involved than just a bunch of text and pictures, and so your browser doesn’t just ask for some HTML, it gives some information to a server that needs to be processed by some web application before the HTML can get sent back.  That’s where an application server comes in.

Today I installed Apache on my local drive, which is a server.  Tomorrow, I’ll get PHP working (I already have mySQL for those who might be curious), which will let me set up an application server.  Of course, since this is just on my personal computer it won’t do a whole lot.  I can do some development, but nothing can really go into production that way. 

Still… it’s a start.

Comments

How to Make Jury Duty Suck Less

Today was my first experience with jury duty.  I’ve always heard that it isn’t hard to get out of jury duty, and today I learned some things about the proper way to approach a jury summons.  Unfortunately, since I’m leaving DC before I’ll have the chance to get called again, this will probably be worthless, but maybe it will help someone else.

The summons says to report at 8am, but they don’t actually do anything until 9, and they don’t do anything important until 10, so tip #1: sleep in.

If you do get called, take your time going down the stairs/escalator.  Law clerks don’t understand crowd management, so if you walk fast like I do you’ll end up in the front of a block of people and everyone who gets called will run into you as they go by. 

Finally, when you go chat with the judge and lawyers, just tell them that whatever issue they find “probably” won’t effect your ability to be impartial.  Since you would have to be lying to say this with any certainty anyway, the hedging is, in fact, the only truthful response, but it will make the lawyers uneasy and they won’t select you.

And that’s how I will make jury duty suck less if there ever is a next time in the District of Columbia.  I wish someone had told me all of this before today.

Comments

Intro to CSS and XHTML

I’ve played with CSS and XHTML before.  Mostly by using a WYSIWYG editor like Adobe Dreamweaver and playing around with the CSS to see what the effects were.  That’s a great way to get acquainted, but if I’m going to take on a web development project, like redesigning this blog for instance, I’m going to need a more structured understanding of CSS and XHTML.

So today I picked up some of the basics.  First, I learned the proper syntax of a CSS rule.  I didn’t even know to call it a rule, so that’s probably a good start.  Here’s a quick rule I can use:

h1 { color: #333; font-size: x-large; }

Where h1 is the selector, color and font-size are properties, and #333 and x-large are values for those properties. 

Using a list of rules, I can set up a style sheet that will format every element of my website the same way on every page, which makes it much easier to build multiple pages without having to get bogged down in the code for each one.

Soon, I’ll figure out how to actually create a style sheet for this blog, but until then, it’s good to have the basics down.

Comments
[Flash 10 is required to watch video]

Today…. I learned to Dougie

Comments

How to Calculate the Gini Coefficient

Gini Coefficient

So week one of this challenge is turning into a “Dave shamefully admits that he doesn’t know things he should definitely know already” party, and today (yesterday) is no different.

(Quick note: Tumblr was down last night, thus this post had to be pushed back to the morning)

For those of you who are unaware, and among readers of my blog that is probably not many of you, the Gini coefficient is a measure of inequality within a given country.  It’s expressed as a ratio that falls between 0 (perfect equality) and 1 (perfect inequality).

In general, countries in the Southern Hemisphere (except Australia and New Zealand) have high Gini coefficients, and countries in Western Europe and Scandinavia have the lowest.

So here’s how to calculate it.

Start with two axes.  The vertical goes from 0% to 100% and represents the percent of income earned in a country.  The horizontal axis goes from 0% to 100% and represents the percentage of the population receiving that income. 

Thus, in the perfect equality scenario, we have a 45 degree line representing that for every 1% increase in income, 1% of the population receives it.  Thus for any n% of income, n% of the population receives it, thus everyone receives the same => Perfect equality. 

The other boundary scenario is where one individual has all of the income.  This curve follows the horizontal axis all the way out to the 99.99% mark then jumps to the 100% level at the very end.  

The area bounded by these lines is a triangle whose area makes up the denominator of the Gini coefficient.

To find the numerator, the curve representing the country’s income distribution is plotted on this axis and the area between that curve and the “perfect equality” curve is calculated.  That area is the numerator. 

Thus, the Gini coefficient is the ratio between the cumulative difference between the actual income distribution and perfect equality, and the total area under the perfect equality curve.  (See above for graphical illustration from Wikipedia, which admittedly does a better job explaining this than I do).

Comments

The MS Excel Blitz Continues!

Today I picked up a lot of mini-Excel-skills, mostly concerning formatting.

For example, if you do a bunch of formatting in one place and then want to do it somewhere else, F4 does it for you (whoa! I know right?).  Similarly, while I fell in love with the format painter last year, I just learned that you can double-click it and apply the format to more than one place.  That would have saved me about 90 hours over the last year (at least).

Probably the most useful trick I picked up today was learning how to use Excel’s auto-outline function to make it easier to navigate a workbook or display it in a useful, meaningful way. 

Oh, and one more fun little nugget: for those of you who (like me) are constantly frustrated by your printer’s inability to retain its ink, it turns out that printing in the “Century” font uses 20% less ink than printing in other fonts.  Now you know (that’s half the battle).

For those who haven’t figured it out yet, I’m kind of on an Excel kick.  Still have quite a bit of Excel work to do, but I’m going to start peppering in some powerpoint and web development in the next few days. 

Comments

Find & Select in MS Excel

There’s a button in MS Excel that is so important, the people at Microsoft decided it deserved to go on the “Home” tab.  Yet, until today, I never really paid any attention at all to it.  It sits way off on the right rather inconspicuously, but today I realized that this button is a powerful tool that makes it much easier to navigate, update, and search any Excel worksheet.  

The “Find & Select” button should not have evaded my attention for so long.  Whether you want to know what cell values are hard coded versus which are calculated using formulas, you need to find hidden data validation criteria that someone else set up without leaving nice little comments to warn you, or you simply want to search for a given element, the “Find & Select” button does it all.   

So why didn’t anyone tell me about this in the past?  For one, the icon on the “Find & Select” button is completely non-intuitive.  It’s supposed to be a pair of binoculars but it looks like a Lego castle.  Additionally, some of the basic functions like “Find” and “Replace” are habitual keyboard shortcuts I’ve been using for years (Ctrl + F and Ctrl + H respectively) so I never needed to find the icon that brought up those options.  Finally, it’s probably because Microsoft has had a long history of putting the crap that no one needs or wants all the way to the right, so I generally keep my vision away from that side of any office applications.   

In any case, the “Find & Select” button will be a nice weapon for me to use against people who like to construct non-intuitive worksheets.

Comments

Day 1: Using Group By and Order By in SQL

To satisfy my 30 day skill development mission for day 1, I learned how to use the Group By and Order By clauses in SQL, specifically, when calling PROC SQL in SAS. 

Order By was fairly straightforward and probably shouldn’t count, but Group By presented a unique challenge that did take some effort to figure out.

My problem with Group By

The first time I tried playing with the Group By clause, SAS converted it to an Order By because I didn’t include a summary function.  That was easy enough to figure out and I just changed my select statement from select A.Amount to select sum(A.Amount), but that didn’t quite work since I still needed to name the new variable.

The proper command “Select sum(A.Amount) as Total_Amount fixed that.

Finally, I got the group by to summarize the amount field as I was hoping, but it printed a line to my new table for every input line, which wasn’t at all what I was going for, since I was expecting more of a “proc summary” kind of output.  I figured out that by adding “Unique” to my select clause I was able to eliminate the duplicates.

So, not moving mountains, but this is certainly an essential skill that I’ll need once I start querying the Atmo data to examine our user statistics.

1 day down, 29 to go

Comments

30 Skills in 30 Days

Today is May 11th and for the next 30 days I am going to do one thing every day.

Every day, I am going to acquire a new skill.

It might be learning how to use javascript to enhance a website (this blog will likely be the testing ground).  It might be learning how to use a new feature in Microsoft Excel or Powerpoint.  It might even be learning how to cook a new type of food. There are only 2 criteria:

1. I must do something that I was incapable of doing at the start of the day

2. I must post about it here

In order to help me meet this goal, I have registered it with stickk.com.  For those of you not familiar with stickk.com, that means that if I fail to achieve the goal, $100 will be donated to a charity I oppose.  I chose the NRA as my Anti-charity. 

My referee will determine whether or not I have been successful in my challenge, but I will need your help.  If you haven’t seen a post on this blog by 6pm any day between now and June 11th, do whatever you must to harass me into compliance.

Here we go.

Comments