Cpp: Formatting

Posted in Google, Open Source, Programming, Software | 6 Comments »

As a programmer and designer I always try my hardest to get my code clear,concise and pretty. Mainly for my own benefit for looking over projects that have dust on them, and also for the publics benefit for when I release code as open-source. In this post I’m going to take a slightly less formal route and try and find out your preferences when coding to get an understanding of commonly used methods when working on a project.

Parenthesis

void function_name(int nCount, float val);       // No spacing
void function_name( int nCount, float val );     // Spacing

Code Blocks

void function_name(int unused){
    // Blank
}

void function_name(int unused)
{
    // Blank
}

Tab Width

void function_name( void )
{
  string tab_space;

  tab_space = "2";
  cout << "Tab Space:" << tab_space << endl;                // Two 

    tab_space = "4";
    cout << "Tab Space:" << tab_space << endl;              // Four 

        tab_space = "8";
        cout << "Tab Space:" << tab_space << endl;          // Eight
}

Function & Variable Naming

void function_name(int nCount, float val);    // Underscore
void functionName( int nCount, float val );   // Capitals

int my_variable;
int myVariable;

My personal preference is underscores for variables and function names, 4 space tab width and spacing between parenthesise, however these are just a few formatting methods on my mind, if your a coder and you are reading this, leave a comment below saying what you prefer, If you have any alternative methods please share I’d love to hear them!

CSS: Line-Height

Posted in Design, Programming, Web | 3 Comments »

Viewing of text based content is a major aspect of web design, the smallest of tweaks can make your content more accessible and visitors will gain a greater interest in it. One major aspect of text based content is the spacing between each line- adjusting this space can be done with the CSS tag ‘line-height’.

Value Description
normal Tells user agents to set the used value to a “reasonable” value based on the font of the element.
length The specified length is used in the calculation of the line box height. Negative values are illegal.
number The used value of the property is this number multiplied by the element’s font size.
percentage The computed value of the property is this percentage multiplied by the element’s computed font size.

Above is a table of properties for line-height. You can read more on line-height in detail here.

Usage

Now we know the properties of line-height, we can start applying it to our content, I am going to assume if you are reading this you have some CSS knowledge so I won’t go into detail on the code. Below is a sample of text with line-height:normal.

line-height:normal;

We’ve survived by hiding from them, by running from them. But they are the gatekeepers. They are guarding all the doors, they are holding all the keys. Which means that sooner or later, someone is going to have to fight them.

line-height:180%;

We’ve survived by hiding from them, by running from them. But they are the gatekeepers. They are guarding all the doors, they are holding all the keys. Which means that sooner or later, someone is going to have to fight them.

line-height:1.5em;

We’ve survived by hiding from them, by running from them. But they are the gatekeepers. They are guarding all the doors, they are holding all the keys. Which means that sooner or later, someone is going to have to fight them.


Endnotes

As you can see, the variance between spacing makes a huge difference when reading the text. ( For those unaware, em is a measurement used in CSS. 1.0em is equal to the font size, 2.0em is double the font size and so on – This is useful for dynamic websites. )

If you haven’t yet experimented with this, give it a shot and see what you can produce. Finding the ideal mix of compact vs. readable content will help towards creating a elegant, viewable design.

Python Project

Posted in Open Source, Programming, Python | 4 Comments »

Screenshot

Whilst picking up a new language – Python, I decided to whip up a basic paint like tool using PyGame. As you can see above it looks basic, You can click and drag to draw, and right click to remove. If a key is pressed, the image is stored in a text file with ‘pixels’ represented with a specific symbol.

The grid cell size can be changed along with colours, the code is not too advanced however it is slightly messy, if your new to python or an existing user check it out and see what you can do with it.


Downloads

Source ( .tar.gz )
Source ( .zip )

40th Anniversary Sesame Street

Posted in Google | 4 Comments »

We all love Googles-doodles on the homepage, some with meaning and some without – however this one caught my I today, whilst growing up I would sit in front of the television watching it for hours. This image below of the cookie monster has become quite popular amongst diggers today however when I reached the homepage I found a second image of Bert and Ernie.

Cookie Monster

Read the rest of this entry »

You Digg Me?

Posted in Media, Social, Web | 3 Comments »

With the ever increasing amount of websites and blog’s launched each day, thousands of people join the race to become popular and make a name for themselves online, potentially generating funds on their ad-filled websites. With websites such as Digg, Slashdot and Reddit proving user submitted news, everyone has a chance to show the world their content, however what makes these sites brilliant is that we don’t see the useless junk, we only see what people like across the web.

Most site owners dream of having there site on the front page of one of these major websites, and instead of focusing on producing high quality content they just throw shabby work around and try there hardest to get people to like it. To me, if the content is good enough, people will vote for it regardless, and recently when browsing the web I stumbled upon a site called youdigg.me.

youdigg.me

The idea of this site goes entirely against what I believe in, it works in a way similar to the old ad-sense scams. You create an account and digg each article that pops up, in return you receive credit that can be used towards a campaign for one of your own articles.

I personally want to put a stop to this website, I use Digg to find funny,useful and informative news from around the web – I don’t want digg to end up full of dead end websites full of ad’s.

What do you think? Leave a comment below!

Subconscious Shortcuts

Posted in Linux, Social, Software | 3 Comments »

OLED - Keyboard

We all use computers, and most of us use hundreds of different shortcuts without even realising we are doing it, from browsing the Internet to escaping from a crashed Windows machine. In this article I have chosen my favourite and most used keyboard shortcuts that you probably use everyday without realising.
Read the rest of this entry »

Google In Two Minutes

Posted in Google | 2 Comments »

Nearly all of us use Google on a daily basis, Google has become highly successful in such a short period of time and is globally recognised for being a search engine. With millions of users only a small percentage know the history of it, the video below sums up Google in two minutes, the design team must have had a field day with this one!

What are your views on Google? – Leave a comment below!