Archive for August 27th, 2008

Duck and Cabbage Gyoza

For those of you in the know, Gyoza are the most delicious thing this side of italian food.  I mean, what could be better than little fried packets of vegetables and meat?  Seriously.  The only thing better than restuarant gyoza is homemade – its actually pretty easy, and if you are willing to spend the time, totally worth it.

This is an interesting twist on the standard gyoza recipe that uses chicken (ok) and/or pork (delicious) – instead we used some of the duck confit that’s been looking so good in the fridge.  If you don’t have duck, substitute about a 1/2 pound of ground pork.  This recipe will make about 30 gyoza, but can be portioned up or down easily.

Ingredients:

  • Meat from 1 duck confit leg, or about 1 cup depending on the size of the leg
  • 2 cups cabbage, finely chopped
  • 1 cup onion, finely chopped
  • 1/2 cup scallions (aka green onion), chopped
  • 4 garlic cloves, minced
  • 1 shallot, minced
  • 1 teaspoon grated fresh ginger
  • 1 teaspoon tamari
  • 3 tablespoons peanut oil
  • 1 egg
  • 1 4oz package of round gyoza wrappers (about 30 per pack, available at any asian grocery)

Making the Filling

1) Pick the meat off the duck leg.  There really is no clean way to do this, so don’t be afraid to get your fingers greasy.  Once you’ve picked all the meat from the bones, chop it into a medium fine dice.  Remember, it’s got to go inside gyoza, so make it small, but not too small that it gets lost.

2) Heat a large skillet or wok over medium heat and add 2 tablespoons of the peanut oil.  Once hot, add the onion, garlic, shallot and ginger.  Cook until tender, but not mushy, about 5 minutes.  Add the cabbage and continue to cook for another 4-5 minutes, or until the cabbage is soft.

3) Add the duck meat, scallions, tamari and egg to the pan and cook for 2 minutes more, or until the egg stops being runny.  Remove from the pan into a bowl.

Making the Gyoza
I usually prepare a space ahead of time for making the gyoza.  You’ll want a little dish of water, a towl to dry your hands, and a spoon.  The wrappers can get very sticky and tear easily if wet, so be sure to wipe off your hands if they get messy.

4) Take a gyoza wrapper and place flat on the work surface.  Moisten half the edge of the gyoza wrapper by dipping a finger in the dish of water and running it along the edge of the wrapper.

5) Next, place a half spoonful of the filling mixture in the middle of the gyoza wrapper and bring the edges together to form a taco shape.

6) Working from one side, bring the edges together and pinch them so they stick.  The water will make the inside edge slightly tacky, helping the process.  Create 5 crimps along the edge to ensure the sides stay joined.  Continue until all the filling and wrappers are used.

Cooking the Gyoza

7) Add the remaining tablespoon of the peanut oil to a heavy bottom skillet (I prefer cast iron) and heat on medium for a few minutes.  Once hot, add the gyoza to the pan, fold side up.  Cook for about 4 minutes on medium heat, or until the bottoms are crispy and brown.

8 ) Add 1/4 cup of water to the pan and cover immediately.  I usually add the water with one hand and have the lid in the other so I can cover quickly and minimize the hot oil spraying everywhere.  Continue cooking the gyoza until the water has cooked off, or about another 5 minutes.

9) Remove the lid and cook for 1 minute more to firm everything up.  Remove to a plate and serve immediately.

Writing Qt Debug Information to a File

Update: I’ve added some additional information on limiting logging when compiling in release mode.

Common problem: I’ve got a Qt app with debugging information, and have a bug that only appears when the code is compiled using the release makefile.

I’ve had this a happen a few times.  By default, the debugging information is written to the debugger console, but when running a compiled ‘release’ app, there is no debugging console and thus no way to get the output.

Solution: Turn on debugging messages in the release makefile and have Qt write the messages to a log file.

Step 1: Remove the -DQT_NO_DEBUG flag from your release makefile.  This will increase the size of the app, though by how much depends on the amount of debugging code in your app.

Step 2: Create a debug message handler function in your main.cpp file.  Here’s an example:

#include <iostream>
#include <fstream> 

#include ...

using namespace std;

ofstream logfile;

void MyOutputHandler(QtMsgType type, const char *msg) {
    switch (type) {
        case QtDebugMsg:
            logfile << QTime::currentTime().toString().toAscii().data() << " Debug: " << msg << "\n";
            break;
        case QtCriticalMsg:
            logfile << QTime::currentTime().toString().toAscii().data() << " Critical: " << msg << "\n";
            break;
        case QtWarningMsg:
            logfile << QTime::currentTime().toString().toAscii().data() << " Warning: " << msg << "\n";
            break;
        case QtFatalMsg:
            logfile << QTime::currentTime().toString().toAscii().data() <<  " Fatal: " << msg << "\n";
            abort();
    }
}

Step 2: Install the handler in your main function, like so:

int main(int argc, char *argv[])
{
    logfile.open("logfile.txt", ios::app);
    #ifndef QT_NO_DEBUG_OUTPUT
    qInstallMsgHandler(MyOutputHandler);
    #endif
    ...
}

Now all debug information will be written with the time to a log file called ‘logfile.txt’ in your application directory.

When compiling your final application, be sure to add the flags -DQT_NO_DEBUG and -DQT_NO_DEBUG_OUTPUT.  These will reduce the application size and ensure that the logfile isn’t used.  Alternately, you can keep NO_DEBUG_OUTPUT out of the makefile if you still want the logfile.