Topics - Renegade [ switch to compact view ]

Pages: prev1 ... 150 151 152 153 154 [155] 156 157 158 159 160 ... 201next
771
Living Room / Microsoft Formats Causing Issues Again...
« on: January 24, 2011, 04:58 PM »
http://www.theaustralian.com.au/australian-it/government-hits-back-over-claims-of-microsoft-favouritism/story-e6frgakx-1225993876379

THE Australian Government Information Management Office has taken to Twitter and the blogosphere after being criticised for an IT policy seemingly biased in favour of Microsoft.

AGIMO last Wednesday finalised its Common Operating Environment policy for desktops and laptops.

According to AGIMO, the policy "defines the principles and standards that will apply to agency desktop operating environments" and ensure desktop standardisation across agencies.

The policy covers a range of areas, but what riled the software community was that document formats seemed to mandate a Microsoft-only environment.

Open source software advocate Jeff Waugh described it as an "arse-covering" exercise, an attempt by AGIMO to avoid using the word "Microsoft" in the policy. "I suspect that use of the term 'ECMA-376' (document standard) is almost entirely an arse-covering exercise, when what they really mean is docx and friends (including .doc) created with Microsoft Office 2007," he wrote on the Linux Australia list, comments that were repeated to the The Australian.

Here we go again...

772
My wife came to me and wanted to resize a photo. Well, we've been through this before... She's got software to do it, but it's not easy enough. I showed her again, but she doesn't like IrfanView because it's simply too complicated. So...

The all new Renegade Photo Resizer! ed. Super Simple Photo Resizer

Photo-Resizer.png

Is it easy enough to use? I'm looking to make it stupidly simple. So simple that a politician could use it~!

I had options and stuff in there... but I figured that it was just crap that isn't needed. Who cares about JPG ratios? 80% is good enough. Exact sizes? BAH! Slider. Close enough. How many people actually know that you must have your photo dimensions as multiples of 16 in order to minimize quality loss? Not many... I take care of the little stuff and leave only the MAJOR decisions to the user.

It requires .NET v4 though. There's no installer. Just the EXE.

(It's not final quality yet -- a few tiny things to tweak.)

UPDATE 2011-03-25:

I've posted follow up in this thread.

773
Ahem...

http://googleblog.blogspot.com/2011/01/google-search-and-search-engine-spam.html

January brought a spate of stories about Google’s search quality. Reading through some of these recent articles, you might ask whether our search quality has gotten worse. The short answer is that according to the evaluation metrics that we’ve refined over more than a decade, Google’s search quality is better than it has ever been in terms of relevance, freshness and comprehensiveness. Today, English-language spam in Google’s results is less than half what it was five years ago, and spam in most other languages is even lower than in English. However, we have seen a slight uptick of spam in recent months, and while we’ve already made progress, we have new efforts underway to continue to improve our search quality.

,,,

One misconception that we’ve seen in the last few weeks is the idea that Google doesn’t take as strong action on spammy content in our index if those sites are serving Google ads. To be crystal clear:

    * Google absolutely takes action on sites that violate our quality guidelines regardless of whether they have ads powered by Google;
    * Displaying Google ads does not help a site’s rankings in Google; and
    * Buying Google ads does not increase a site’s rankings in Google’s search results.

These principles have always applied, but it’s important to affirm they still hold true.

WHAT? Ahem... B^!!$#!+~!

I cannot count the spam I get from Google. They regularly rank sites in the top 10 that are nothing more than ripping content from other sites. This is particularly bad for tech topics in programming where there are TONS of sites that do exactly that.

They all serve Google Ads as well. What is anyone supposed to think?

If they are being genuine, they're not doing what they say they do very well then. Spam is worse than ever.

But it's not "low-quality" content. It's STOLEN content. To me, that seems like spam.

774
Well, I'm still working on some requests for Duplicate Photo Finder, but I'm encountering some odd memory problems.

I'm getting "Out of memory" exceptions, and in particular, "A generic error occurred in GDI+".

If the above sounds interesting, read on, otherwise don't because it gets ugly.

I'm running through photos and processing them in threads in a threadpool. I basically queue up several hundred, then let it go.

What happens is that it very happily rips through the photos, then all of a sudden, memory usage spikes real quickly (over say 1~5 seconds), and then I get the GDI+ error. What's happening there is that I run out of memory. The application sucks up 200~500 MB while running (I have 8 GB of RAM), but when it spikes, it dies at 1 GB to 1.4 GB of RAM (from Task Manager).

During those few seconds when the program begins to blow up, the number of threads that it's working on triples out of the blue. It goes from 6~8 threads to BOOM! 24, 26, 28, 30, 31 CRASH~! It hits the GDI+ error.

I've run "memprofiler" and cannot locate any memory leaks. It tells me:

Disposed instance (Ignore...)
5 types have instances that have been disposed but not GCed.
Investigate the types below for more information.
System.Drawing.Bitmap, System.Drawing.Graphics, System.Drawing.Region, DeviceContext, WindowsFont

Instance queued for finalization (Ignore...)
One type has instances that are queued for finalization. This can indicate that a Finalizer method is stuck, which will prevent instances from being finalized and cause memory leaks.
Investigate the type below for more information.
DeviceContext

Pinned instance (Ignore...)
3 types have instances that are pinned in memory.
Investigate the types below for more information.
System.Object, System.Object[], System.String

Instance indirectly rooted by finalizer queue (Ignore...)
2 types have instances that are indirectly rooted by the finalizer queue. This can indicate that a Finalizer method is stuck, which will prevent instances from being finalized and cause memory leaks.
Investigate the types below for more information.
System.Collections.Stack, System.Object[]

Large instance (Ignore...)
2 types have instances that are located in the large object heap.
Investigate the types below for more information.
System.Byte[], System.Object[]

Undisposed instances (unclassified) (Ignore...)
16 types have instances that have been garbage collected without being properly disposed.
Investigate the types below for more information.
SafeTokenHandle, SafeWaitHandle, System.Drawing.Bitmap, System.Drawing.Font, System.IO.BinaryReader, System.IO.MemoryStream, UnmanagedMemoryStream, ResourceReader, RuntimeResourceSet, ExecutionContext, (...)


Here's enough code to see what's going on. I've edited it somewhat to make it shorter (e.g. remove Console.WriteLine & debugging stuff.)

Code: C# [Select]
  1. private void QueueHashWorkItem(DirectoryInfo di, bool isOriginal, int count, bool exactImageDataComparison)
  2. {
  3.         int indexer = -1;
  4.         foreach (FileInfo fi in di.GetFiles())
  5.         {
  6.                 if (fi.Extension.ToLower() == ".jpg")
  7.                 {
  8.                         indexer++;
  9.                         // HashWorkItem is a struct to hold info
  10.                         HashWorkItem hwi = new HashWorkItem(di.FullName, fi.FullName, isOriginal, count, exactImageDataComparison);
  11.                         hwi.DirectoryName = di.FullName;
  12.                         hwi.FileName = fi.FullName;
  13.                         hwi.Index = indexer;
  14.                         hwi.IsOriginal = isOriginal;
  15.  
  16.                         // get hashes in threads
  17.                         ThreadPool.QueueUserWorkItem(new WaitCallback(GetHashForItem), hwi); // see below
  18.                 }
  19.         }
  20. }
  21.  
  22. private void GetHashForItem(object state)
  23. {
  24.         // do the work
  25.         HashWorkItem hwi = (HashWorkItem)state; // This is a struct to hold information.
  26.         ImageConverter converter = new ImageConverter();
  27.         long pressure = new FileInfo(hwi.FileName).Length;
  28.         GC.AddMemoryPressure(pressure);
  29.         Bitmap bmp = new Bitmap(1, 1); // I actually release the bmp below with bmp.Dispose(), so init here
  30.  
  31.         #region TRY block
  32.         try
  33.         {
  34.                 bmp = (Bitmap)Bitmap.FromFile(hwi.FileName); // zero problems here
  35.                 byte[] bytes = new byte[1];
  36.  
  37.                 if (!hwi.CompareExactImageData)
  38.                 {
  39.                         // ****************************************************************
  40.                         bytes = (byte[])converter.ConvertTo(bmp, bytes.GetType()); // #0 THIS IS WHERE I GET THE GDI+ ERROR
  41.                         // ****************************************************************
  42.                 }
  43.                 else if (hwi.CompareExactImageData)
  44.                 {
  45.                         // ****************************************************************
  46.                         bytes = GetBytesFromBitmap(bmp); // #1 THIS IS WHERE I GET THE GDI+ ERROR -- See method below
  47.                         // ****************************************************************
  48.  
  49.                 }
  50.  
  51.                 SuperFastHashUnsafe sfh = new SuperFastHashUnsafe();
  52.                 hwi.ItemHash = sfh.Hash(bytes);
  53.  
  54.                 try
  55.                 {
  56.                         // invoke the delegate to store the results
  57.                         this.Invoke(new StoreHashResultsDelegate(StoreHashResults), hwi);
  58.                 }
  59.                 catch
  60.                 {
  61.                         // NEVER happens
  62.                 }
  63.         }
  64.         catch (OutOfMemoryException memEx)
  65.         {
  66.                 Console.Write("***** Out of memory: " + hwi.FileName + " *** " + memEx.Message);
  67.                 Thread.Sleep(2000);
  68.                 // queue the item again...
  69.                 ThreadPool.QueueUserWorkItem(new WaitCallback(GetHashForItem), hwi);
  70.         }
  71.         finally
  72.         {
  73.                 if (bmp != null)
  74.                 {
  75.                         bmp.Dispose();
  76.                         bmp = null;
  77.                         GC.Collect(); // this makes no difference it seems
  78.                 }
  79.         }
  80.         #endregion
  81.  
  82.         GC.RemoveMemoryPressure(pressure);
  83. }
  84.  
  85.  
  86. public delegate void StoreHashResultsDelegate(HashWorkItem hwi);
  87.  
  88. public void StoreHashResults(HashWorkItem hwi)
  89. {
  90.         // blah - here for reference - zero problems here
  91. }
  92.  
  93. /// <summary>
  94. /// Get a byte array of pixel data from a Bitmap.
  95. /// </summary>
  96. /// <param name="bmp">The bitmap to get the pixel data from.</param>
  97. /// <returns>A byte array of pixel data from a bitmap.</returns>
  98. private static byte[] GetBytesFromBitmap(Bitmap bmp)
  99. {
  100.         byte[] result = null;
  101.         if (bmp == null)
  102.                 return result;
  103.         // Create a memory stream to hold the bitmap.
  104.         MemoryStream ms = new MemoryStream();
  105.         // ****************************************************************
  106.         bmp.Save(ms, ImageFormat.Bmp);  // #2 THIS IS WHERE I GET THE GDI+ ERROR
  107.         // ****************************************************************
  108.         result = ms.ToArray();
  109.  
  110.         return result;
  111. }

Does anyone have any ideas how to troubleshoot that?

I've spent about 2 days on this and I'm not getting anywhere.

I've run around looking into everything I can, including LHO (Large Heap Objects), but so far no joy.

BTW - I'm running through directories of photos that are around 4~7 MB each (10 MP camera JPGs) with around 500 photos per directory. The program craps out randomly, sometimes ripping through 200, or 300 or 400 or 500 before dying. Directories are around 3 GB.

Any ideas, pointers or whatever would be appreciated.

Hey, and just for fun, I'll put a $10.00 donation bounty on it for the first person to point me to a solution~! :D


775
Living Room / AVG Infecting in the Wild!
« on: January 18, 2011, 05:58 AM »
Yes. It's true. AVG infections have been found in the wild...

AVG Infections in the Wild

:D

Read at your own risk!
A virus which shut down production at a Tasmanian abalone farm has been detected in the wild, the state government says.

Production at an abalone farm at Bicheno, on the state's east coast, and a processing plant at Margate, south of Hobart, when cases of abalone viral ganglioneuritis (AVG) were found last Friday.


Pages: prev1 ... 150 151 152 153 154 [155] 156 157 158 159 160 ... 201next
Go to full version