Chrome, Safari ignoring max-width in table

Max-width applies to block elements. <table> is neither block nor inline. Ambiguous enough? haha. You can use display:block; max-width:1000px and forget about width:100%. Chrome and Safari follow the rules! Edit May 2017: please note, this comment was made 7 years ago (in 2010!). I suspect browsers have changed a bunch over the years (I wouldn’t … Read more

How to scale down a UIImage and make it crispy / sharp at the same time instead of blurry?

Merely using imageWithCGImage is not sufficient. It will scale, but the result will be blurry and suboptimal whether scaling up or down. If you want to get the aliasing right and get rid of the “jaggies” you need something like this: http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/. My working test code looks something like this, which is Trevor’s solution with … Read more

Scaled Bitmap maintaining aspect ratio

This will respect maxWidth and maxHeight, which means the resulting bitmap will never have dimensions larger then those: private static Bitmap resize(Bitmap image, int maxWidth, int maxHeight) { if (maxHeight > 0 && maxWidth > 0) { int width = image.getWidth(); int height = image.getHeight(); float ratioBitmap = (float) width / (float) height; float ratioMax … Read more

Scaling solutions for MySQL (Replication, Clustering)

I’ve been doing A LOT of reading on the available options. I also got my hands on High Performance MySQL 2nd edition, which I highly recommend. This is what I’ve managed to piece together: Clustering Clustering in the general sense is distributing load across many servers that appear to an outside application as one server. … Read more

How to scale SVG image to fill browser window?

How about: html, body { margin:0; padding:0; overflow:hidden } svg { position:fixed; top:0; bottom:0; left:0; right:0 } Or: html, body { margin:0; padding:0; overflow:hidden } svg { position:fixed; top:0; left:0; height:100%; width:100% } I have an example on my site using (roughly) this technique, albeit with 5% padding all around, and using position:absolute instead of … Read more

Why isn’t my vector drawable scaling as expected?

There is new info about this issue here: https://code.google.com/p/android/issues/detail?id=202019 It looks like using android:scaleType=”fitXY” will make it scale correctly on Lollipop. From a Google engineer: Hi, Let me know if scaleType=”fitXY” can be a workaround for you , in order to get the image look sharp. The marshmallow Vs Lollipop is due to a special … Read more

Can anyone explain me StandardScaler?

Intro I assume that you have a matrix X where each row/line is a sample/observation and each column is a variable/feature (this is the expected input for any sklearn ML function by the way — X.shape should be [number_of_samples, number_of_features]). Core of method The main idea is to normalize/standardize i.e. μ = 0 and σ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)