How to add a browser tab icon (favicon) for a website?

There are actually two ways to add a favicon to a website. <link rel=”icon”> Simply add the following code to the <head> element: PNG favicons are supported by most browsers, except IE <= 10. For backwards compatibility, you can use ICO favicons. Note that you don’t have to precede icon in rel attribute with shortcut … Read more

Convert HTML to PDF in .NET

I want to generate a PDF by passing HTML contents to a function. I have made use of iTextSharp for this but it does not perform well when it encounters tables and the layout just gets messy.

What does “javascript:void(0)” mean?

The void operator evaluates the given expression and then returns undefined. The void operator is often used merely to obtain the undefined primitive value, usually using “void(0)” (which is equivalent to “void 0”). In these cases, the global variable undefined can be used instead (assuming it has not been assigned to a non-default value). An … Read more

Searching the student-t distribution table for values using python

For a meaningful interpolation, you would first need to define a 2D inperpolation function (bilinear, bicubic). For better resutls directly use the scipy implementations of the percent point function (i.e. the inverse cumulative distribution function). Result is v: 2.57058 so the result is the same as the 2.571 from your table. This code reproduces your … Read more

What does enumerate() mean?

The enumerate() function adds a counter to an iterable. So for each element in cursor, a tuple is produced with (counter, element); the for loop binds that to row_number and row, respectively. Demo: By default, enumerate() starts counting at 0 but if you give it a second integer argument, it’ll start from that number instead: … Read more

Calculate business days

Here’s a function from the user com ments on the date() function page in the PHP manual. It’s an improvement of an earlier function in the comments that adds support for leap years. Enter the starting and ending dates, along with an array of any holidays that might be in between, and it returns the … Read more

What is the difference between an ORM and an ODM?

192 MySQL is an example of a relational database – you would use an ORM to translate between your objects in code and the relational representation of the data. Examples of ORMs are nHibernate, Entity Framework, Dapper and more… MongoDB is an example of a document database – you would use an ODM to translate … Read more

What is an ORM, how does it work, and how should I use one? [closed]

Introduction Object-Relational Mapping (ORM) is a technique that lets you query and manipulate data from a database using an object-oriented paradigm. When talking about ORM, most people are referring to a library that implements the Object-Relational Mapping technique, hence the phrase “an ORM”. An ORM library is a completely ordinary library written in your language … Read more