Needed to add a hover effect on some table rows and wanted to make it look nice. Think I managed to get it quite smooth in the end and thought I could share it.
In PHP there is a very handy function called ucfirst which
Returns a string with the first character of str capitalized, if that character is alphabetic.
Would you like to grab some server-side data through an AJAX call? For example by using the handy jQuery.ajax method?
So, I was fooling around the other day with an HTML table and wanted to make the odd rows slightly darker. Figured I could use for example an 80% transparent black PNG to do that (or could have just assigned a darker color, but where’s the fun in that?). Either way, ended up making a little something that I thought I could share just for the fun of it. I learned a few things, so maybe someone else can too 🙂
So, here’s how to make a small transparent PNG filler image on-the-fly using PHP 🙂
Sending a basic email message in a C# application is quite easy thanks to a class called SmptClient. We simply need an address to send to, an address to send from, the message we want to send and the address of an SMTP server, hand it all to the SMTP client, and you’re done:
var to = new MailAddress("email@example.com", "You");
var message = new MailMessage(from, to)
Subject = "Greetings!",
Body = "How are you doing today?",
var client = new SmtpClient("smtp.example.com");
catch (SmtpException e)
That was pretty simple, wasn’t it? But what if we need to authenticate with our server? And what if we want to send our message in a more secure manner?
Say you have an
IEnumerable<t></t> of some sort and you want to check if it contains any duplicates. How do you do that?
When writing C#, in Visual Studio, using generics… have you ever tried checking for null? I have always found that a bit of a hassle.
Say we have this method which returns the subject if it is not null, and the result of a
createNew() function if it is null.
if (subject == null)
Not claiming this is a very useful method, but it was the simplest thing I could come up with 😛 Anyways, in Visual Studio you will now probably have a blue (is blue here at least) squiggly line under the equality operator. It states you are doing a Possible compare of value type with ‘null’, which of course is reasonable and correct. We could just ignore it and move on… but we don’t really like squiggly lines, do we? I sure don’t… so lets get rid of it.