Skip to main content

Posts

Showing posts from July, 2013

CSS: Mirror an Image

On this post, I'll show you how to implement CSS3 transform property, especially the scale to mirror or flip an image ( img ), and text wrapped in div element. For example, we have this remarkable penguin (transparent PNG) image : Now, we want to flip the image (horizontally), and place it on the left side of the original image. Something like this: It's the same image, but I put inline CSS scale transformation for the left image. The HTML (with the inline CSS) looks like this: display: inline-block there means that element's block will be displayed inline with each other. Take a closer look at the transform property. There are those prefixes: -webkit- (Chrome and newer Opera), -moz- (Firefox), and -o- (old Opera). The -moz- (for latest Firefox) and -webkit- (for latest Chrome/Opera) aren't needed anymore, just in case. And the current Opera is also prefix-free. The latest Safari, iOS Safari, and Android browser also do not need -webk...

Math: Integral (ln x), 1/(ln x), 1/(x.ln x), and 1/(x².ln x)

We want to find the solution for the indefinite integral from: 1. $∫ (\ln x)\ dx$ 2. $∫ 1/(\ln x)\ dx$ 3. $∫ 1/(x.\ln x)\ dx$ 4. $∫ 1/(x^{2}.\ln x)\ dx$ We have to keep in mind that: $∫ 1/x\ dx = \ln |x| +\ C$ To solve those, we can use different methods: Integral by parts $∫ u.dv = u.v - ∫ v.du$ Substitution - of $1/u$ $∫ 1/{u}\ du = \ln u +\ C$ Using (table look-up, or probably remembering some) integral table 1 st problem $∫ (\ln x)\ dx$ The solution can be achieved using integral by parts. So then, u = ln x dv = dx du/dx [derivative of u] = 1/x switch the (dx) to right side ► du = (1/x) dx v [integral of dv ► ∫ 1 dx] = x Substitute those variables: ∫ u.dv = u.v - ∫ v.du ∫ (ln x) dx = (ln x).x - ∫ x.(1/x) dx = x.(ln x) - ∫ 1 dx = x.(ln x) - x + C So, ∫ (ln x) dx = x.(ln x) - x + C Or, ∫ (ln x) dx = x(ln x - 1) + C This solution is al...

Math: Calculus (Integral) Proof 0 ≠ 1

A "fun time". This is from Mudd Math Fun Facts . More of the Calculus "trick", integral form. Quoted Consider the following integral: ∫(1/x) dx -------------------------------------------------- Perform integration by parts: Let u = 1/x dv = dx du = -1/x² dx v = x -------------------------------------------------- Then obtain: ∫(1/x) dx = (1/x).x - ∫x(-1/x²) dx = 1 + ∫(1/x) dx (?) Let's take a look at that last line, and continue that: The last line: ∫(1/x) dx = (1/x).x - ∫x(-1/x²) dx = 1 + ∫(1/x) dx -------------------------------------------------- Continue: ∫(1/x) dx = 1 - ∫(-1/x) dx = 1 + ∫(1/x) dx -------------------------------------------------- Or, simplified: ∫(1/x) dx = 1 + ∫(1/x) dx (?) ---------------------------------------------------- Subtract both sides with ∫(1/x) dx, resulting: 0 = 1 (?!) Where did we get that 1 number on the right side ...

Math: The Proof 1 ≠ 0

This is just for fun. Math is one of my diversified hobbies. Excellent choice of hobby indeed. I'm gonna find what's wrong with the "proof" on Mudd Math Fun Facts www.math.hmc.edu/funfacts/ffiles/10001.1-8.shtml Quoted Consider two non-zero numbers x and y such that x = y ------------------------------------------------------------ Then x² = xy (multiplied by x) Subtract the same thing (subtracted with y²) from both sides: x² - y² = xy - y² ------------------------------------------------------------ Dividing by (x-y), obtain x + y = y Since x = y, we see that 2y = y ------------------------------------------------------------ Thus 2 = 1, since we started with y nonzero. ------------------------------------------------------------ Subtracting 1 from both sides: 1 = 0 It looks so COOL at first. BUT, there was a subtle, but actually a giant, flaw in it. The 'error' occurred in the division part. Since x = y, if ...