How to stop adblock plus blocking images in HTML page

I’m assuming that you’re not talking about Adsense here but images hosted on your server and hard coded into your page. If so they’re probably being blocked because of the file name and/or path. Adblock will block images with common ad dimensions in the file name, e.g. ‘myimage_720_90.png’ or ‘myimage_300x250.jpg’. with common ad keywords in … Read more

How to save a base64 image to user’s disk using JavaScript?

HTML5 download attribute Just to allow user to download the image or other file you may use the HTML5 download attribute. Static file download <a href=”/images/image-name.jpg” download> <!– OR –> <a href=”/images/image-name.jpg” download=”new-image-name.jpg”> Dynamic file download In cases requesting image dynamically it is possible to emulate such download. If your image is already loaded and … Read more

How to insert a picture into Excel at a specified cell position with VBA

Try this: With xlApp.ActiveSheet.Pictures.Insert(PicPath) With .ShapeRange .LockAspectRatio = msoTrue .Width = 75 .Height = 100 End With .Left = xlApp.ActiveSheet.Cells(i, 20).Left .Top = xlApp.ActiveSheet.Cells(i, 20).Top .Placement = 1 .PrintObject = True End With It’s better not to .select anything in Excel, it is usually never necessary and slows down your code.

How to combine multiple PNGs into one big PNG file?

Create a large image which you will write to. Work out its dimensions based on how many rows and columns you want. BufferedImage result = new BufferedImage( width, height, //work these out BufferedImage.TYPE_INT_RGB); Graphics g = result.getGraphics(); Now loop through your images and draw them: for(String image : images){ BufferedImage bi = ImageIO.read(new File(image)); g.drawImage(bi, … Read more

Including images in javadocs

A bit far fetched, but you can inline the images in the documentation by converting them into Base64. It would look like this: <img src=”data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA…” /> There are online tools available to do the conversion: http://www.base64-image.de http://www.freeformatter.com/base64-encoder.html

How can I programmatically change the background in Mac OS X?

From python, if you have appscript installed (sudo easy_install appscript), you can simply do from appscript import app, mactypes app(‘Finder’).desktop_picture.set(mactypes.File(‘/your/filename.jpg’)) Otherwise, this applescript will change the desktop background tell application “Finder” set desktop picture to POSIX file “/your/filename.jpg” end tell You can run it from the command line using osascript, or from Python using something … Read more

Detect text region in image using Opencv

import cv2 def captch_ex(file_name): img = cv2.imread(file_name) img_final = cv2.imread(file_name) img2gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ret, mask = cv2.threshold(img2gray, 180, 255, cv2.THRESH_BINARY) image_final = cv2.bitwise_and(img2gray, img2gray, mask=mask) ret, new_img = cv2.threshold(image_final, 180, 255, cv2.THRESH_BINARY) # for black text , cv.THRESH_BINARY_INV ”’ line 8 to 12 : Remove noisy portion ”’ kernel = cv2.getStructuringElement(cv2.MORPH_CROSS, (3, 3)) # … Read more

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