Archive for January, 2013

A fast and beautiful solution.  🙂

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WorkDays
{
class WorkDays
{
private static DateTime[] holidays = { new DateTime(2012, 12, 24), new DateTime(2012, 12, 25), new DateTime(2012, 12, 26),
new DateTime(2012, 12, 30), new DateTime(2012, 12, 31), new DateTime(2013, 01, 01) };

static void Main(string[] args)
{
// 5. Write a method that calculates the number of workdays between today and given date, passed as parameter.
// Consider that workdays are all days from Monday to Friday except a fixed list of public holidays
// specified preliminary as array.

Console.WriteLine(“Method that calculates the number of workdays between today and given date, passed as parameter.  \n\n”);

Console.WriteLine(“What is the past date:”);
DateTime StartDate = DateTime.Parse(Console.ReadLine());

int nWorkingDays = CalculateWorkDays(StartDate);
if (nWorkingDays > 0)
Console.WriteLine(“Number of work days is {0}”, nWorkingDays);
else Console.WriteLine(“Invlid dates!”);

}

private static int CalculateWorkDays(DateTime StartDate)
{
DateTime TodayDate = DateTime.Now;
int nWorkingDays = 0;

if (TodayDate.Date > StartDate.Date)
{
DateTime day = StartDate.Date;
while (day <= TodayDate.Date)
{
if (day.DayOfWeek != DayOfWeek.Saturday && day.DayOfWeek != DayOfWeek.Sunday
&& !holidays.Contains(day))
{
nWorkingDays++;
}

day = day.AddDays(1);
}
}

return nWorkingDays;
}

}
}

Using the LESS Preprocessor

Posted: January 6, 2013 in CSS
Tags: ,

Using the LESS Preprocessor

Using the LESS Preprocessor for smarter style sheets

Sass

Posted: January 6, 2013 in CSS
Tags: ,

Getting started with Sass

Getting started with Sass

Infuse your CSS with Sass and LESS

Posted: January 6, 2013 in CSS

It is useful for me as I am learning now CSS3. Thanks. 🙂

The WordPress.com Blog

CSS (Cascading Style Sheets) is a handy tool to separate the presentation from the content of your website — you write the content, and the CSS controls the look and formatting. CSS is great for giving your website a custom look, but it can also become complicated to maintain.

The solution to this? CSS preprocessors.

(If you’re new to CSS, you might want to stop here and check out some CSS basics. If you’re already knee-deep in selectors, read on to learn how CSS preprocessors can streamline your styling.)

Example of LESS

CSS preprocessors are extensions to CSS that make it easier to manage your site’s styles. They have features like reusable variables, selector nesting, and functions, which allow you to easily reuse styles and apply them to different selectors. Put simply, a CSS preprocessor is like a friendly robot that automatically handles all of the copying and pasting you used to…

View original post 116 more words

My three cats

Posted: January 4, 2013 in Personal Info
Tags: , , ,

My three cats

We are waiting for our dry food, don’t fool us with cooked food!

My three cats

Posted: January 4, 2013 in Personal Info
Tags: , , ,

My three cats

Every day I rest in different wash-basin but in the same company. 🙂

My Three Cats

Posted: January 3, 2013 in Personal Info
Tags: , ,

My Three Cats

My favourite place for rest, my favourite company.