How to vertically align both image and text in a DIV using CSS?

Give both the image and the text a vertical-align: middle – the text needs to be contained in an element that is also display: inline. So markup like this: <div> <span><img src=”https://stackoverflow.com/questions/13408394/blah.jpg” /></span> <span>text text text</span> </div> div { display: table; } img { vertical-align: middle; display: table-cell; } span { vertical-align: middle; display: table-cell; … Read more

How can I enable keep-alive?

Configure Apache KeepAlive settings Open up apache’s configuration file and look for the following settings. On Centos this file is called httpd.conf and is located in /etc/httpd/conf. The following settings are noteworthy: KeepAlive: Switches KeepAlive on or off. Put in “KeepAlive on” to turn it on and “KeepAlive off” to turn it off. MaxKeepAliveRequests: The … Read more

Generate a pdf thumbnail (open source/free) [closed]

Matthew Ephraim released an open source wrapper for Ghostscript that sounds like it does what you want and is in C#. Link to Source Code: https://github.com/mephraim/ghostscriptsharp Link to Blog Posting: http://www.mattephraim.com/blog/2009/01/06/a-simple-c-wrapper-for-ghostscript/ You can make a simple call to the GeneratePageThumb method to generate a thumbnail (or use GeneratePageThumbs with a start and end page number … Read more

Square detection in image

Sharpen square edges. Load the image, convert to grayscale, median blur to smooth, and sharpen to enhance edges. Obtain binary image and remove noise. We threshold to obtain a black/white binary image. Depending on the image, Otsu’s thresholding or adaptive thresholding would work. From here we create a rectangular kernel and perform morphological transformations to … Read more

align an image and some text on the same line without using div width?

Floating will result in wrapping if space is not available. You can use display:inline and white-space:nowrap to achieve this. Fiddle <div id=”container” style=”white-space:nowrap”> <div id=”image” style=”display:inline;”> <img src=”https://stackoverflow.com/questions/11713176/tree.png”/> </div> <div id=”texts” style=”display:inline; white-space:nowrap;”> A very long text(about 300 words) </div> </div>​

Creating WPF BitmapImage from MemoryStream png, gif

Add bi.CacheOption = BitmapCacheOption.OnLoad directly after your .BeginInit(): BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.CacheOption = BitmapCacheOption.OnLoad; … Without this, BitmapImage uses lazy initialization by default and stream will be closed by then. In first example you try to read image from possibly garbage-collected closed or even disposed MemoryStream. Second example uses file, which is … Read more

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