Connect video card to TV with HDMI

I got a GeForce 9800 GT video card, and I connected it with my HDTV with HDMI cable, everything works with except no audio.

The problem is 9800 GT itself only transfer video over HDMI, if we want to audio also transfer over HDMI, we need use Internal S/PDIF Digital Audio Cable to connect mother board with video card.
This is the cable. My mother board actually does support S/PDIF output, so just connect the white side of the cable to video card, and the black side to mother board S/PDIF output connection header, something like
You need check your mother board manual to make sure which port is which port, and make sure SPDIF port to SPDIF and GND to ground.

Now pull off your other audio attachment to PC, and restart the computer, you should have audio over HDMI now.

loading log4j.properties

String resource = "/log4j.properties"; // / is necessary
URL configFileResource = Log4JTest.class.getResource(resource);
PropertyConfigurator.configure(configFileResource);

log4j.properties

#default one
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender

log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%p [%t] %c{2} (%M:%L) - %m%n


#under package example
log4j.logger.example=INFO, A2

log4j.appender.A2=org.apache.log4j.FileAppender
log4j.appender.A2.File=${user.home}/test.txt

log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n

Init with Array or ArrayCollection

I am trying to use repeater to create a set of checkbox, at first, I am trying to use Array as repeater's data provider. If the array is hard coded, it works, but if I initialized the data for the array in init() method, it will not work. I changed the array to array collection, and it magically works!!!

That's quite strange...

Flex Style Explorer

http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html#

Install Flash Builder as a plugin for Eclipse

Link

  1. Install Flash Builder standalone
  2. Navigate to the installed Flash Builder installation location and open the utilities folder.
  3. Run the executable Adobe Flash Builder 4.6 Plug-in Utility.exe.
  4. Select the language and click on OK.
  5. Select the Flash Builder installation location if prompted.
  6. Select the Eclipse folder into which you want Flash Builder 4.6 to be plugged into and click Next. (Note: Your copy of Eclipse must be version 3.6/3.6.1/3.6.2/3.7, 32-bit and must contain a folder named “dropins”, even though your FB 4.6 is 64 bits)
  7. Review the pre-Installation summary and click on Install
  8. Following installation, it is recommended that you edit the eclipse.ini file for your Eclipse instance, so that it includes the following settings: 
-vmargs -Xms256m -Xmx512m -XX:MaxPermSize=256m -XX:PermSize=64m 

Get key/value from Flex Object

Ok, so we got a Flex object, let's suppose it's a map object, how could we retrieve the key/value from it?
//retrieve keys
for (var key:String in obj) 
{
   trace(key);
}

//retrieve values
for each(var value:String in obj) 
{
   trace(value);
}

The for..in loop iterates through the properties of an object, or the elements of an array. For example, you can use a for..in loop to iterate through the properties of a generic object (object properties are not kept in any particular order, so properties may appear in a seemingly random order):

The for each..in loop iterates through the items of a collection, which can be tags in an XML or XMLList object, the values held by object properties, or the elements of an array. For example, as the following excerpt shows, you can use a for each..in loop to iterate through the properties of a generic object, but unlike the for..in loop, the iterator variable in a for each..in loop contains the value held by the property instead of the name of the property:

Print out object in Flex

In Flex, object could be a lot of things, check here, you can see a flex object could be a Java map or dictionary. To check out its content could be really desirable, here is a useful function:
import mx.utils.ObjectUtil;

trace(ObjectUtil.toString(obj));
This will print out the content of the object very neatly.

Debugger Version of Flash Player + trace()

Recently I am working on a Flex project, and found that trace() is not working. Trace() method is equivalent of System.out.println() at Java, without making it work, it's a huge blow to debug on Flex. After some search, here are my foundings:

1. You need make sure your web browser has a debugger version of Flash Player.
Go to here, if you see "Debugger version of Flash Player", congratulations, otherwise, you need go to here to download a debugger version, be aware that Chrome has a build-in flash player, but it's not a debugger version, I have not figured out how to install a debugger version in Chrome yet, but here is a link which might help.
2. You need run your web server in debug mode.
3. You need invoke the web application from Eclipse's debug mode.

After that, trace() will print out whatever you want to see beautifully in your console.

---Update:
Sometimes, you need uninstall your current non-debugger version first before installing debugger version:

http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html

Create war file for Flex/Java project

SpringSource Tool Suite
File->Export->Web (War File)