When I tried to print to a network printer, the anti-virus firewall software would block it automatically. The printer queue will shows the document failed to print.
To test, I temporarily disabled Kaspersky and I could print fine.
It turned out the cause had to do with my network being “public network”. Once I change it to “local network”, then I could print fine even with Kaspersky running.
I ran into this error “Unable to generate an explicit migration because the following explicit migrations are pending”.
Common causes include:
- You really have some pending migrations. You can do “update-database –verbose” to apply the pending migrations.
- Your solution have multiple projects (e.g. WebAppProject, DataModelProject) and the wrong project is set as the start up project. So just go to Visual Studio and select the right project and then set it as a startup project.
- You changed the ContextKey value in the Migrations\Configuration.cs. You can always check the [dbo].[__MigrationHistory] entries to see if the ContextKeys match. If Configuration.cs does not have a ContextKey, that should be fine.
I have 2 .tiff image files and I want to merge them into one .tiff file. I use TIffBitmapEncoder. I use TiffBitmapDecoder to decode the file memory stream and add to encoder.Frames.
When I try to use the encoder to Save() to the output filestream, I get an argument exception saying “The image has corrupted metadata header.” with an inner exception “The image metadata header is unrecognized.”
Load the input memory stream into a bitmap and save it to another temporary memory stream. It seems to fix the header. Then you use this fixed memory stream for the decoder.
Below is some of my partial code. You need to create the output filestream and close all the memory stream and dispose, etc.
1: TiffBitmapEncoder encoder = new TiffBitmapEncoder();
3: encoder.Compression = TiffCompressOption.Default;
5: MemoryStream convertedMemoryStream = new MemoryStream();
6: var bitmap = new Bitmap(ms); // input memory stream
8: bitmap.Save(convertedMemoryStream, ImageFormat.Tiff); // save it again as a tiff, hoping it fixes the header meta data
9: ms.Position = 0;
10: convertedMemoryStream.Position = 0;
12: var decoder = new TiffBitmapDecoder(convertedMemoryStream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
13: bitmapSource = decoder.Frames;
17: encoder.Save(sTiff); // sTiff is a FileStream to the output file
On my Windows 8.1, the taskbar works normal on the desktop. However, I have 2 extended desktop on 2 monitors.
On these extended desktops, any maximized windows would either cover the taskbar or covered by the taskbar. For example, the taskbar covers/overlaps the bottom of my maximized Excel, I cannot click on the bottom worksheet tabs easily.
- Right click on the taskbar, select Properties
- Check Auto-hide the taskbar. Click OK.
- Move your mouse to the bottom of the screen so it brings up the taskbar.
- Right click on the taskbar, select Properties
- Clear the checkbox Auto-hide the taskbar. Click OK.
- Any maximized windows and the taskbar should no longer overlap/cover each other.
If you see “_x003C_none_x003E_” in the output file (probably a CSV), it is because the value of the text qualifier is set to “_x003C_none_x003E_”. It is a bug.
You can fix it by opening the package with notepad and remove “_x003C_none_x003E_” from TextQualifier.
You can verify by checking it with Visual Studio:
Download online PDF file using Firefox.
By default, Firefox will open the online PDF in the built-in PDF viewer.
The following C# code will create a new Firefox profile and use it with selenium.
1: FirefoxProfile profile = new FirefoxProfile();
3: // custom folder
4: profile.SetPreference("browser.download.folderList", 2);
6: // download folder location
7: profile.SetPreference("browser.download.dir", "C:\\XXXX");
9: // for PDF, save to disk without asking
10: profile.SetPreference("browser.helperApps.neverAsk.saveToDisk", "application/pdf");
12: // disable Firefox's built-in PDF viewer
13: profile.SetPreference("pdfjs.disabled", true); // disable Firefox's built-in PDF viewer
15: var browserDriver = new FirefoxDriver(profile);
17: // save an online PDF
You can type “about:config” in Firefox browser address and create/search/view all these preference settings.
You can manually configure via Firefox’s Option –> Application. Then you locate and load the profile from local disk..
Gmail wants to promote the use of OAuth2 over simple username/password authentication.
If you use the password authentication, you may get an error saying “Web Login Required”.
If you don’t want to switch to OAuth2, then you need to go to your Google account’s setting (not Gmail setting). Under “Sign-In & security”, look for “Allow less secure apps” and turn it to “ON”.