How to add config transformations for a custom config file in Visual Studio?

Visual Studio transforms only web.config files by default. If you need custom config file with transformation for DEV, UAT, PROD, etc environments, then try to Use custom extensions for Visual Studio like SlowCheetah – XML Transforms for Config transformation preview functionality. Add for the project from Nuget SlowCheetah to provide build in transformation. A little … Read more

How to apply config transformations to an external config file

There are few workarounds: Workaround 1 Write AppSettings.Debug.config, AppSettings.Release.config with full values (not with transform attributes) In your web.config, using transformation, substitute with the appropriate file: web.debug.config <appSettings file=”AppSettings.debug.config” xdt:Transform=”SetAttributes” xdt:Locator=”Match(file)”/> web.release.config <appSettings file=”AppSettings.release.config” xdt:Transform=”SetAttributes” xdt:Locator=”Match(file)”/> Its less than ideal, kinda defeats the purpose of transforms but may be appropriate based on one’s situation than … Read more

Reverse Box-Cox transformation

SciPy has added an inverse Box-Cox transformation. https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.inv_boxcox.html scipy.special.inv_boxcox scipy.special.inv_boxcox(y, lmbda) = Compute the inverse of the Box-Cox transformation. Find x such that: y = (x**lmbda – 1) / lmbda if lmbda != 0 log(x) if lmbda == 0 Parameters: y : array_like Data to be transformed. lmbda : array_like Power parameter of the Box-Cox … Read more

Android image view matrix scale + translate

There’s a convenient method called Matrix.setRectToRect(RectF, RectF, ScaleToFit) to help you here. Matrix m = imageView.getImageMatrix(); RectF drawableRect = new RectF(0, 0, imageWidth, imageHeight); RectF viewRect = new RectF(0, 0, imageView.getWidth(), imageView.getHeight()); m.setRectToRect(drawableRect, viewRect, Matrix.ScaleToFit.CENTER); imageView.setImageMatrix(m); That should set the matrix m to have combo of scaling and translate values that is needed to show … Read more

Perspective transform of SVG paths (four corner distort)

This is my drag distort proposal (share you knowledge, Q&A-style). Live example is in http://jsfiddle.net/xjHUk/278/ and the main code is this: (only output window: http://jsfiddle.net/xjHUk/279/embedded/result/) function transferPoint (xI, yI, source, destination) { var ADDING = 0.001; // to avoid dividing by zero var xA = source[0].x; var yA = source[0].y; var xC = source[2].x; var … Read more

Advanced tasks using Web.Config transformation

As a matter of fact you can do this, but it is not as easy as you might think. You can create your own config transformation. I have just written a very detailed blog post at http://sedodream.com/2010/09/09/ExtendingXMLWebconfigConfigTransformation.aspx regarding this. But here are the hightlights: Create Class Library project Reference Web.Publishing.Tasks.dll (under %Program Files (x86)%MSBuild\Microsoft\VisualStudio\v10.0\Web folder) … Read more

bounding box of numpy array

You can roughly halve the execution time by using np.any to reduce the rows and columns that contain non-zero values to 1D vectors, rather than finding the indices of all non-zero values using np.where: def bbox1(img): a = np.where(img != 0) bbox = np.min(a[0]), np.max(a[0]), np.min(a[1]), np.max(a[1]) return bbox def bbox2(img): rows = np.any(img, axis=1) … Read more

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