Wednesday, November 26, 2008

w3c mimetype tired of looking for them when i need them

# This is a comment. I love comments.

# This file controls what Internet media types are sent to the client for
# given file extension(s). Sending the correct media type to the client
# is important so they know how to handle the content of the file.
# Extra types can either be added here or by using an AddType directive
# in your config files. For more information about Internet media types,
# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type
# registry is at .

# MIME type Extensions
application/activemessage
application/andrew-inset ez
application/applefile
application/atom+xml atom
application/atomcat+xml atomcat
application/atomicmail
application/atomsvc+xml atomsvc
application/auth-policy+xml
application/batch-smtp
application/beep+xml
application/cals-1840
application/ccxml+xml ccxml
application/cellml+xml
application/cnrp+xml
application/commonground
application/conference-info+xml
application/cpl+xml
application/csta+xml
application/cstadata+xml
application/cybercash
application/davmount+xml davmount
application/dca-rft
application/dec-dx
application/dialog-info+xml
application/dicom
application/dns
application/dvcs
application/ecmascript ecma
application/edi-consent
application/edi-x12
application/edifact
application/epp+xml
application/eshop
application/fastinfoset
application/fastsoap
application/fits
application/font-tdpfr pfr
application/h224
application/http
application/hyperstudio stk
application/iges
application/im-iscomposing+xml
application/index
application/index.cmd
application/index.obj
application/index.response
application/index.vnd
application/iotp
application/ipp
application/isup
application/javascript js
application/json json
application/kpml-request+xml
application/kpml-response+xml
application/mac-binhex40 hqx
application/mac-compactpro cpt
application/macwriteii
application/marc mrc
application/mathematica ma nb mb
application/mathml+xml mathml
application/mbms-associated-procedure-description+xml
application/mbms-deregister+xml
application/mbms-envelope+xml
application/mbms-msk+xml
application/mbms-msk-response+xml
application/mbms-protection-description+xml
application/mbms-reception-report+xml
application/mbms-register+xml
application/mbms-register-response+xml
application/mbms-user-service-description+xml
application/mbox mbox
application/mediaservercontrol+xml mscml
application/mikey
application/moss-keys
application/moss-signature
application/mosskey-data
application/mosskey-request
application/mp4 mp4s
application/mpeg4-generic
application/mpeg4-iod
application/mpeg4-iod-xmt
application/msword doc dot
application/mxf mxf
application/nasdata
application/news-message-id
application/news-transmission
application/nss
application/ocsp-request
application/ocsp-response
application/octet-stream bin dms lha lzh class so iso dmg dist distz pkg bpk dump elc
application/oda oda
application/oebps-package+xml
application/ogg ogg
application/parityfec
application/pdf pdf
application/pgp-encrypted pgp
application/pgp-keys
application/pgp-signature asc sig
application/pics-rules prf
application/pidf+xml
application/pkcs10 p10
application/pkcs7-mime p7m p7c
application/pkcs7-signature p7s
application/pkix-cert cer
application/pkix-crl crl
application/pkix-pkipath pkipath
application/pkixcmp pki
application/pls+xml pls
application/poc-settings+xml
application/postscript ai eps ps
application/prs.alvestrand.titrax-sheet
application/prs.cww cww
application/prs.nprend
application/prs.plucker
application/qsig
application/rdf+xml rdf
application/reginfo+xml rif
application/relax-ng-compact-syntax rnc
application/remote-printing
application/resource-lists+xml rl
application/riscos
application/rlmi+xml
application/rls-services+xml rs
application/rsd+xml rsd
application/rss+xml rss
application/rtf rtf
application/rtx
application/samlassertion+xml
application/samlmetadata+xml
application/sbml+xml sbml
application/scvp-cv-request scq
application/scvp-cv-response scs
application/scvp-vp-request spq
application/scvp-vp-response spp
application/sdp sdp
application/set-payment
application/set-payment-initiation setpay
application/set-registration
application/set-registration-initiation setreg
application/sgml
application/sgml-open-catalog
application/shf+xml shf
application/sieve
application/simple-filter+xml
application/simple-message-summary
application/simplesymbolcontainer
application/slate
application/smil
application/smil+xml smi smil
application/soap+fastinfoset
application/soap+xml
application/sparql-query rq
application/sparql-results+xml srx
application/spirits-event+xml
application/srgs gram
application/srgs+xml grxml
application/ssml+xml ssml
application/timestamp-query
application/timestamp-reply
application/tve-trigger
application/ulpfec
application/vemmi
application/vividence.scriptfile
application/vnd.3gpp.bsf+xml
application/vnd.3gpp.pic-bw-large plb
application/vnd.3gpp.pic-bw-small psb
application/vnd.3gpp.pic-bw-var pvb
application/vnd.3gpp.sms
application/vnd.3gpp2.bcmcsinfo+xml
application/vnd.3gpp2.sms
application/vnd.3gpp2.tcap tcap
application/vnd.3m.post-it-notes pwn
application/vnd.accpac.simply.aso aso
application/vnd.accpac.simply.imp imp
application/vnd.acucobol acu
application/vnd.acucorp atc acutc
application/vnd.adobe.xdp+xml xdp
application/vnd.adobe.xfdf xfdf
application/vnd.aether.imp
application/vnd.amiga.ami ami
application/vnd.anser-web-certificate-issue-initiation cii
application/vnd.anser-web-funds-transfer-initiation fti
application/vnd.antix.game-component atx
application/vnd.apple.installer+xml mpkg
application/vnd.audiograph aep
application/vnd.autopackage
application/vnd.avistar+xml
application/vnd.blueice.multipass mpm
application/vnd.bmi bmi
application/vnd.businessobjects rep
application/vnd.cab-jscript
application/vnd.canon-cpdl
application/vnd.canon-lips
application/vnd.cendio.thinlinc.clientconf
application/vnd.chemdraw+xml cdxml
application/vnd.chipnuts.karaoke-mmd mmd
application/vnd.cinderella cdy
application/vnd.cirpack.isdn-ext
application/vnd.claymore cla
application/vnd.clonk.c4group c4g c4d c4f c4p c4u
application/vnd.commerce-battelle
application/vnd.commonspace csp cst
application/vnd.contact.cmsg cdbcmsg
application/vnd.cosmocaller cmc
application/vnd.crick.clicker clkx
application/vnd.crick.clicker.keyboard clkk
application/vnd.crick.clicker.palette clkp
application/vnd.crick.clicker.template clkt
application/vnd.crick.clicker.wordbank clkw
application/vnd.criticaltools.wbs+xml wbs
application/vnd.ctc-posml pml
application/vnd.cups-pdf
application/vnd.cups-postscript
application/vnd.cups-ppd ppd
application/vnd.cups-raster
application/vnd.cups-raw
application/vnd.curl curl
application/vnd.cybank
application/vnd.data-vision.rdz rdz
application/vnd.denovo.fcselayout-link fe_launch
application/vnd.dna dna
application/vnd.dolby.mlp mlp
application/vnd.dpgraph dpg
application/vnd.dreamfactory dfac
application/vnd.dvb.esgcontainer
application/vnd.dvb.ipdcesgaccess
application/vnd.dxr
application/vnd.ecdis-update
application/vnd.ecowin.chart mag
application/vnd.ecowin.filerequest
application/vnd.ecowin.fileupdate
application/vnd.ecowin.series
application/vnd.ecowin.seriesrequest
application/vnd.ecowin.seriesupdate
application/vnd.enliven nml
application/vnd.epson.esf esf
application/vnd.epson.msf msf
application/vnd.epson.quickanime qam
application/vnd.epson.salt slt
application/vnd.epson.ssf ssf
application/vnd.ericsson.quickcall
application/vnd.eszigno3+xml es3 et3
application/vnd.eudora.data
application/vnd.ezpix-album ez2
application/vnd.ezpix-package ez3
application/vnd.fdf fdf
application/vnd.ffsns
application/vnd.fints
application/vnd.flographit gph
application/vnd.fluxtime.clip ftc
application/vnd.framemaker fm frame maker
application/vnd.frogans.fnc fnc
application/vnd.frogans.ltf ltf
application/vnd.fsc.weblaunch fsc
application/vnd.fujitsu.oasys oas
application/vnd.fujitsu.oasys2 oa2
application/vnd.fujitsu.oasys3 oa3
application/vnd.fujitsu.oasysgp fg5
application/vnd.fujitsu.oasysprs bh2
application/vnd.fujixerox.art-ex
application/vnd.fujixerox.art4
application/vnd.fujixerox.hbpl
application/vnd.fujixerox.ddd ddd
application/vnd.fujixerox.docuworks xdw
application/vnd.fujixerox.docuworks.binder xbd
application/vnd.fut-misnet
application/vnd.fuzzysheet fzs
application/vnd.genomatix.tuxedo txd
application/vnd.google-earth.kml+xml kml
application/vnd.google-earth.kmz kmz
application/vnd.grafeq gqf gqs
application/vnd.gridmp
application/vnd.groove-account gac
application/vnd.groove-help ghf
application/vnd.groove-identity-message gim
application/vnd.groove-injector grv
application/vnd.groove-tool-message gtm
application/vnd.groove-tool-template tpl
application/vnd.groove-vcard vcg
application/vnd.handheld-entertainment+xml zmm
application/vnd.hbci hbci
application/vnd.hcl-bireports
application/vnd.hhe.lesson-player les
application/vnd.hp-hpgl hpgl
application/vnd.hp-hpid hpid
application/vnd.hp-hps hps
application/vnd.hp-jlyt jlt
application/vnd.hp-pcl pcl
application/vnd.hp-pclxl pclxl
application/vnd.httphone
application/vnd.hzn-3d-crossword x3d
application/vnd.ibm.afplinedata
application/vnd.ibm.electronic-media
application/vnd.ibm.minipay mpy
application/vnd.ibm.modcap afp listafp list3820
application/vnd.ibm.rights-management irm
application/vnd.ibm.secure-container sc
application/vnd.igloader igl
application/vnd.immervision-ivp ivp
application/vnd.immervision-ivu ivu
application/vnd.informedcontrol.rms+xml
application/vnd.intercon.formnet xpw xpx
application/vnd.intertrust.digibox
application/vnd.intertrust.nncp
application/vnd.intu.qbo qbo
application/vnd.intu.qfx qfx
application/vnd.ipunplugged.rcprofile rcprofile
application/vnd.irepository.package+xml irp
application/vnd.is-xpr xpr
application/vnd.jam jam
application/vnd.japannet-directory-service
application/vnd.japannet-jpnstore-wakeup
application/vnd.japannet-payment-wakeup
application/vnd.japannet-registration
application/vnd.japannet-registration-wakeup
application/vnd.japannet-setstore-wakeup
application/vnd.japannet-verification
application/vnd.japannet-verification-wakeup
application/vnd.jcp.javame.midlet-rms rms
application/vnd.jisp jisp
application/vnd.joost.joda-archive joda
application/vnd.kahootz ktz ktr
application/vnd.kde.karbon karbon
application/vnd.kde.kchart chrt
application/vnd.kde.kformula kfo
application/vnd.kde.kivio flw
application/vnd.kde.kontour kon
application/vnd.kde.kpresenter kpr kpt
application/vnd.kde.kspread ksp
application/vnd.kde.kword kwd kwt
application/vnd.kenameaapp htke
application/vnd.kidspiration kia
application/vnd.kinar kne knp
application/vnd.koan skp skd skt skm
application/vnd.liberty-request+xml
application/vnd.llamagraphics.life-balance.desktop lbd
application/vnd.llamagraphics.life-balance.exchange+xml lbe
application/vnd.lotus-1-2-3 123
application/vnd.lotus-approach apr
application/vnd.lotus-freelance pre
application/vnd.lotus-notes nsf
application/vnd.lotus-organizer org
application/vnd.lotus-screencam scm
application/vnd.lotus-wordpro lwp
application/vnd.macports.portpkg portpkg
application/vnd.marlin.drm.actiontoken+xml
application/vnd.marlin.drm.conftoken+xml
application/vnd.marlin.drm.mdcf
application/vnd.mcd mcd
application/vnd.medcalcdata mc1
application/vnd.mediastation.cdkey cdkey
application/vnd.meridian-slingshot
application/vnd.mfer mwf
application/vnd.mfmp mfm
application/vnd.micrografx.flo flo
application/vnd.micrografx.igx igx
application/vnd.mif mif
application/vnd.minisoft-hp3000-save
application/vnd.mitsubishi.misty-guard.trustweb
application/vnd.mobius.daf daf
application/vnd.mobius.dis dis
application/vnd.mobius.mbk mbk
application/vnd.mobius.mqy mqy
application/vnd.mobius.msl msl
application/vnd.mobius.plc plc
application/vnd.mobius.txf txf
application/vnd.mophun.application mpn
application/vnd.mophun.certificate mpc
application/vnd.motorola.flexsuite
application/vnd.motorola.flexsuite.adsi
application/vnd.motorola.flexsuite.fis
application/vnd.motorola.flexsuite.gotap
application/vnd.motorola.flexsuite.kmr
application/vnd.motorola.flexsuite.ttc
application/vnd.motorola.flexsuite.wem
application/vnd.mozilla.xul+xml xul
application/vnd.ms-artgalry cil
application/vnd.ms-asf asf
application/vnd.ms-cab-compressed cab
application/vnd.ms-excel xls xlm xla xlc xlt xlw
application/vnd.ms-fontobject eot
application/vnd.ms-htmlhelp chm
application/vnd.ms-ims ims
application/vnd.ms-lrm lrm
application/vnd.ms-playready.initiator+xml
application/vnd.ms-powerpoint ppt pps pot
application/vnd.ms-project mpp mpt
application/vnd.ms-tnef
application/vnd.ms-wmdrm.lic-chlg-req
application/vnd.ms-wmdrm.lic-resp
application/vnd.ms-wmdrm.meter-chlg-req
application/vnd.ms-wmdrm.meter-resp
application/vnd.ms-works wps wks wcm wdb
application/vnd.ms-wpl wpl
application/vnd.ms-xpsdocument xps
application/vnd.mseq mseq
application/vnd.msign
application/vnd.multiad.creator
application/vnd.multiad.creator.cif
application/vnd.music-niff
application/vnd.musician mus
application/vnd.muvee.style msty
application/vnd.ncd.control
application/vnd.ncd.reference
application/vnd.nervana
application/vnd.netfpx
application/vnd.neurolanguage.nlu nlu
application/vnd.noblenet-directory nnd
application/vnd.noblenet-sealer nns
application/vnd.noblenet-web nnw
application/vnd.nokia.catalogs
application/vnd.nokia.conml+wbxml
application/vnd.nokia.conml+xml
application/vnd.nokia.isds-radio-presets
application/vnd.nokia.iptv.config+xml
application/vnd.nokia.landmark+wbxml
application/vnd.nokia.landmark+xml
application/vnd.nokia.landmarkcollection+xml
application/vnd.nokia.n-gage.ac+xml
application/vnd.nokia.n-gage.data ngdat
application/vnd.nokia.n-gage.symbian.install n-gage
application/vnd.nokia.ncd
application/vnd.nokia.pcd+wbxml
application/vnd.nokia.pcd+xml
application/vnd.nokia.radio-preset rpst
application/vnd.nokia.radio-presets rpss
application/vnd.novadigm.edm edm
application/vnd.novadigm.edx edx
application/vnd.novadigm.ext ext
application/vnd.oasis.opendocument.chart odc
application/vnd.oasis.opendocument.chart-template otc
application/vnd.oasis.opendocument.formula odf
application/vnd.oasis.opendocument.formula-template otf
application/vnd.oasis.opendocument.graphics odg
application/vnd.oasis.opendocument.graphics-template otg
application/vnd.oasis.opendocument.image odi
application/vnd.oasis.opendocument.image-template oti
application/vnd.oasis.opendocument.presentation odp
application/vnd.oasis.opendocument.presentation-template otp
application/vnd.oasis.opendocument.spreadsheet ods
application/vnd.oasis.opendocument.spreadsheet-template ots
application/vnd.oasis.opendocument.text odt
application/vnd.oasis.opendocument.text-master otm
application/vnd.oasis.opendocument.text-template ott
application/vnd.oasis.opendocument.text-web oth
application/vnd.obn
application/vnd.olpc-sugar xo
application/vnd.oma-scws-config
application/vnd.oma-scws-http-request
application/vnd.oma-scws-http-response
application/vnd.oma.bcast.associated-procedure-parameter+xml
application/vnd.oma.bcast.drm-trigger+xml
application/vnd.oma.bcast.imd+xml
application/vnd.oma.bcast.notification+xml
application/vnd.oma.bcast.sgboot
application/vnd.oma.bcast.sgdd+xml
application/vnd.oma.bcast.sgdu
application/vnd.oma.bcast.simple-symbol-container
application/vnd.oma.bcast.smartcard-trigger+xml
application/vnd.oma.bcast.sprov+xml
application/vnd.oma.dd2+xml dd2
application/vnd.oma.drm.risd+xml
application/vnd.oma.group-usage-list+xml
application/vnd.oma.poc.detailed-progress-report+xml
application/vnd.oma.poc.final-report+xml
application/vnd.oma.poc.groups+xml
application/vnd.oma.poc.optimized-progress-report+xml
application/vnd.oma.xcap-directory+xml
application/vnd.omads-email+xml
application/vnd.omads-file+xml
application/vnd.omads-folder+xml
application/vnd.omaloc-supl-init
application/vnd.openofficeorg.extension oxt
application/vnd.osa.netdeploy
application/vnd.osgi.dp dp
application/vnd.otps.ct-kip+xml
application/vnd.palm prc pdb pqa oprc
application/vnd.paos.xml
application/vnd.pg.format str
application/vnd.pg.osasli ei6
application/vnd.piaccess.application-licence
application/vnd.picsel efif
application/vnd.poc.group-advertisement+xml
application/vnd.pocketlearn plf
application/vnd.powerbuilder6 pbd
application/vnd.powerbuilder6-s
application/vnd.powerbuilder7
application/vnd.powerbuilder7-s
application/vnd.powerbuilder75
application/vnd.powerbuilder75-s
application/vnd.preminet
application/vnd.previewsystems.box box
application/vnd.proteus.magazine mgz
application/vnd.publishare-delta-tree qps
application/vnd.pvi.ptid1 ptid
application/vnd.pwg-multiplexed
application/vnd.pwg-xhtml-print+xml
application/vnd.qualcomm.brew-app-res
application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb
application/vnd.rapid
application/vnd.recordare.musicxml mxl
application/vnd.recordare.musicxml+xml
application/vnd.renlearn.rlprint
application/vnd.rn-realmedia rm
application/vnd.ruckus.download
application/vnd.s3sms
application/vnd.sbm.mid2
application/vnd.scribus
application/vnd.sealed.3df
application/vnd.sealed.csf
application/vnd.sealed.doc
application/vnd.sealed.eml
application/vnd.sealed.mht
application/vnd.sealed.net
application/vnd.sealed.ppt
application/vnd.sealed.tiff
application/vnd.sealed.xls
application/vnd.sealedmedia.softseal.html
application/vnd.sealedmedia.softseal.pdf
application/vnd.seemail see
application/vnd.sema sema
application/vnd.semd semd
application/vnd.semf semf
application/vnd.shana.informed.formdata ifm
application/vnd.shana.informed.formtemplate itp
application/vnd.shana.informed.interchange iif
application/vnd.shana.informed.package ipk
application/vnd.simtech-mindmapper twd twds
application/vnd.smaf mmf
application/vnd.solent.sdkm+xml sdkm sdkd
application/vnd.spotfire.dxp dxp
application/vnd.spotfire.sfs sfs
application/vnd.sss-cod
application/vnd.sss-dtf
application/vnd.sss-ntf
application/vnd.street-stream
application/vnd.sun.wadl+xml
application/vnd.sus-calendar sus susp
application/vnd.svd svd
application/vnd.swiftview-ics
application/vnd.syncml+xml xsm
application/vnd.syncml.dm+wbxml bdm
application/vnd.syncml.dm+xml xdm
application/vnd.syncml.ds.notification
application/vnd.tao.intent-module-archive tao
application/vnd.tmobile-livetv tmo
application/vnd.trid.tpt tpt
application/vnd.triscape.mxs mxs
application/vnd.trueapp tra
application/vnd.truedoc
application/vnd.ufdl ufd ufdl
application/vnd.uiq.theme utz
application/vnd.umajin umj
application/vnd.unity unityweb
application/vnd.uoml+xml uoml
application/vnd.uplanet.alert
application/vnd.uplanet.alert-wbxml
application/vnd.uplanet.bearer-choice
application/vnd.uplanet.bearer-choice-wbxml
application/vnd.uplanet.cacheop
application/vnd.uplanet.cacheop-wbxml
application/vnd.uplanet.channel
application/vnd.uplanet.channel-wbxml
application/vnd.uplanet.list
application/vnd.uplanet.list-wbxml
application/vnd.uplanet.listcmd
application/vnd.uplanet.listcmd-wbxml
application/vnd.uplanet.signal
application/vnd.vcx vcx
application/vnd.vd-study
application/vnd.vectorworks
application/vnd.vidsoft.vidconference
application/vnd.visio vsd vst vss vsw
application/vnd.visionary vis
application/vnd.vividence.scriptfile
application/vnd.vsf vsf
application/vnd.wap.sic
application/vnd.wap.slc
application/vnd.wap.wbxml wbxml
application/vnd.wap.wmlc wmlc
application/vnd.wap.wmlscriptc wmlsc
application/vnd.webturbo wtb
application/vnd.wfa.wsc
application/vnd.wmc
application/vnd.wordperfect wpd
application/vnd.wqd wqd
application/vnd.wrq-hp3000-labelled
application/vnd.wt.stf stf
application/vnd.wv.csp+wbxml
application/vnd.wv.csp+xml
application/vnd.wv.ssp+xml
application/vnd.xara xar
application/vnd.xfdl xfdl
application/vnd.xmpie.cpkg
application/vnd.xmpie.dpkg
application/vnd.xmpie.plan
application/vnd.xmpie.ppkg
application/vnd.xmpie.xlim
application/vnd.yamaha.hv-dic hvd
application/vnd.yamaha.hv-script hvs
application/vnd.yamaha.hv-voice hvp
application/vnd.yamaha.smaf-audio saf
application/vnd.yamaha.smaf-phrase spf
application/vnd.yellowriver-custom-menu cmp
application/vnd.zzazz.deck+xml zaz
application/voicexml+xml vxml
application/watcherinfo+xml
application/whoispp-query
application/whoispp-response
application/winhlp hlp
application/wita
application/wordperfect5.1
application/wsdl+xml wsdl
application/wspolicy+xml wspolicy
application/x-ace-compressed ace
application/x-bcpio bcpio
application/x-bittorrent torrent
application/x-bzip bz
application/x-bzip2 bz2 boz
application/x-cdlink vcd
application/x-chat chat
application/x-chess-pgn pgn
application/x-compress
application/x-cpio cpio
application/x-csh csh
application/x-director dcr dir dxr fgd
application/x-dvi dvi
application/x-futuresplash spl
application/x-gtar gtar
application/x-gzip
application/x-hdf hdf
application/x-latex latex
application/x-ms-wmd wmd
application/x-ms-wmz wmz
application/x-msaccess mdb
application/x-msbinder obd
application/x-mscardfile crd
application/x-msclip clp
application/x-msdownload exe dll com bat msi
application/x-msmediaview mvb m13 m14
application/x-msmetafile wmf
application/x-msmoney mny
application/x-mspublisher pub
application/x-msschedule scd
application/x-msterminal trm
application/x-mswrite wri
application/x-netcdf nc cdf
application/x-pkcs12 p12 pfx
application/x-pkcs7-certificates p7b spc
application/x-pkcs7-certreqresp p7r
application/x-rar-compressed rar
application/x-sh sh
application/x-shar shar
application/x-shockwave-flash swf
application/x-stuffit sit
application/x-stuffitx sitx
application/x-sv4cpio sv4cpio
application/x-sv4crc sv4crc
application/x-tar tar
application/x-tcl tcl
application/x-tex tex
application/x-texinfo texinfo texi
application/x-ustar ustar
application/x-wais-source src
application/x-x509-ca-cert der crt
application/x400-bp
application/xcap-att+xml
application/xcap-caps+xml
application/xcap-el+xml
application/xcap-error+xml
application/xcap-ns+xml
application/xenc+xml xenc
application/xhtml+xml xhtml xht
application/xml xml xsl
application/xml-dtd dtd
application/xml-external-parsed-entity
application/xmpp+xml
application/xop+xml xop
application/xslt+xml xslt
application/xspf+xml xspf
application/xv+xml mxml xhvml xvml xvm
application/zip zip
audio/32kadpcm
audio/3gpp
audio/3gpp2
audio/ac3
audio/amr
audio/amr-wb
audio/amr-wb+
audio/asc
audio/basic au snd
audio/bv16
audio/bv32
audio/clearmode
audio/cn
audio/dat12
audio/dls
audio/dsr-es201108
audio/dsr-es202050
audio/dsr-es202211
audio/dsr-es202212
audio/dvi4
audio/eac3
audio/evrc
audio/evrc-qcp
audio/evrc0
audio/evrc1
audio/evrcb
audio/evrcb0
audio/evrcb1
audio/g722
audio/g7221
audio/g723
audio/g726-16
audio/g726-24
audio/g726-32
audio/g726-40
audio/g728
audio/g729
audio/g7291
audio/g729d
audio/g729e
audio/gsm
audio/gsm-efr
audio/ilbc
audio/l16
audio/l20
audio/l24
audio/l8
audio/lpc
audio/midi mid midi kar rmi
audio/mobile-xmf
audio/mp4 mp4a
audio/mp4a-latm
audio/mpa
audio/mpa-robust
audio/mpeg mpga mp2 mp2a mp3 m2a m3a
audio/mpeg4-generic
audio/parityfec
audio/pcma
audio/pcmu
audio/prs.sid
audio/qcelp
audio/red
audio/rtp-enc-aescm128
audio/rtp-midi
audio/rtx
audio/smv
audio/smv0
audio/smv-qcp
audio/sp-midi
audio/t140c
audio/t38
audio/telephone-event
audio/tone
audio/ulpfec
audio/vdvi
audio/vmr-wb
audio/vnd.3gpp.iufp
audio/vnd.4sb
audio/vnd.audiokoz
audio/vnd.celp
audio/vnd.cisco.nse
audio/vnd.cmles.radio-events
audio/vnd.cns.anp1
audio/vnd.cns.inf1
audio/vnd.digital-winds eol
audio/vnd.dlna.adts
audio/vnd.dolby.mlp
audio/vnd.everad.plj
audio/vnd.hns.audio
audio/vnd.lucent.voice lvp
audio/vnd.nokia.mobile-xmf
audio/vnd.nortel.vbk
audio/vnd.nuera.ecelp4800 ecelp4800
audio/vnd.nuera.ecelp7470 ecelp7470
audio/vnd.nuera.ecelp9600 ecelp9600
audio/vnd.octel.sbc
audio/vnd.qcelp
audio/vnd.rhetorex.32kadpcm
audio/vnd.sealedmedia.softseal.mpeg
audio/vnd.vmx.cvsd
audio/wav wav
audio/x-aiff aif aiff aifc
audio/x-mpegurl m3u
audio/x-ms-wax wax
audio/x-ms-wma wma
audio/x-pn-realaudio ram ra
audio/x-pn-realaudio-plugin rmp
audio/x-wav wav
chemical/x-cdx cdx
chemical/x-cif cif
chemical/x-cmdf cmdf
chemical/x-cml cml
chemical/x-csml csml
chemical/x-pdb pdb
chemical/x-xyz xyz
image/bmp bmp
image/cgm cgm
image/fits
image/g3fax g3
image/gif gif
image/ief ief
image/jp2
image/jpeg jpeg jpg jpe
image/jpm
image/jpx
image/naplps
image/png png
image/prs.btif btif
image/prs.pti
image/svg+xml svg svgz
image/t38
image/tiff tiff tif
image/tiff-fx
image/vnd.adobe.photoshop psd
image/vnd.cns.inf2
image/vnd.djvu djvu djv
image/vnd.dwg dwg
image/vnd.dxf dxf
image/vnd.fastbidsheet fbs
image/vnd.fpx fpx
image/vnd.fst fst
image/vnd.fujixerox.edmics-mmr mmr
image/vnd.fujixerox.edmics-rlc rlc
image/vnd.globalgraphics.pgb
image/vnd.microsoft.icon
image/vnd.mix
image/vnd.ms-modi mdi
image/vnd.net-fpx npx
image/vnd.sealed.png
image/vnd.sealedmedia.softseal.gif
image/vnd.sealedmedia.softseal.jpg
image/vnd.svf
image/vnd.wap.wbmp wbmp
image/vnd.xiff xif
image/x-cmu-raster ras
image/x-cmx cmx
image/x-icon ico
image/x-pcx pcx
image/x-pict pic pct
image/x-portable-anymap pnm
image/x-portable-bitmap pbm
image/x-portable-graymap pgm
image/x-portable-pixmap ppm
image/x-rgb rgb
image/x-xbitmap xbm
image/x-xpixmap xpm
image/x-xwindowdump xwd
message/cpim
message/delivery-status
message/disposition-notification
message/external-body
message/http
message/news
message/partial
message/rfc822 eml mime
message/s-http
message/sip
message/sipfrag
message/tracking-status
message/vnd.si.simp
model/iges igs iges
model/mesh msh mesh silo
model/vnd.dwf dwf
model/vnd.flatland.3dml
model/vnd.gdl gdl
model/vnd.gs.gdl
model/vnd.gtw gtw
model/vnd.moml+xml
model/vnd.mts mts
model/vnd.parasolid.transmit.binary
model/vnd.parasolid.transmit.text
model/vnd.vtu vtu
model/vrml wrl vrml
multipart/alternative
multipart/appledouble
multipart/byteranges
multipart/digest
multipart/encrypted
multipart/form-data
multipart/header-set
multipart/mixed
multipart/parallel
multipart/related
multipart/report
multipart/signed
multipart/voice-message
text/calendar ics ifb
text/css css
text/csv csv
text/directory
text/dns
text/enriched
text/html html htm
text/parityfec
text/plain txt text conf def list log in
text/prs.fallenstein.rst
text/prs.lines.tag dsc
text/red
text/rfc822-headers
text/richtext rtx
text/rtf
text/rtp-enc-aescm128
text/rtx
text/sgml sgml sgm
text/t140
text/tab-separated-values tsv
text/troff t tr roff man me ms
text/ulpfec
text/uri-list uri uris urls
text/vnd.abc
text/vnd.curl
text/vnd.dmclientscript
text/vnd.esmertec.theme-descriptor
text/vnd.fly fly
text/vnd.fmi.flexstor flx
text/vnd.in3d.3dml 3dml
text/vnd.in3d.spot spot
text/vnd.iptc.newsml
text/vnd.iptc.nitf
text/vnd.latex-z
text/vnd.motorola.reflex
text/vnd.ms-mediapackage
text/vnd.net2phone.commcenter.command
text/vnd.si.uricatalogue
text/vnd.sun.j2me.app-descriptor jad
text/vnd.trolltech.linguist
text/vnd.wap.si
text/vnd.wap.sl
text/vnd.wap.wml wml
text/vnd.wap.wmlscript wmls
text/x-asm s asm
text/x-c c cc cxx cpp h hh dic
text/x-fortran f for f77 f90
text/x-pascal p pas
text/x-java-source java
text/x-setext etx
text/x-uuencode uu
text/x-vcalendar vcs
text/x-vcard vcf
text/xml
text/xml-external-parsed-entity
video/3gpp 3gp
video/3gpp-tt
video/3gpp2 3g2
video/bmpeg
video/bt656
video/celb
video/dv
video/h261 h261
video/h263 h263
video/h263-1998
video/h263-2000
video/h264 h264
video/jpeg jpgv
video/jpm jpm jpgm
video/mj2 mj2 mjp2
video/mp1s
video/mp2p
video/mp2t
video/mp4 mp4 mp4v mpg4
video/mp4v-es
video/mpeg mpeg mpg mpe m1v m2v
video/mpeg4-generic
video/mpv
video/nv
video/parityfec
video/pointer
video/quicktime qt mov
video/raw
video/rtp-enc-aescm128
video/rtx
video/smpte292m
video/ulpfec
video/vc1
video/vnd.dlna.mpeg-tts
video/vnd.fvt fvt
video/vnd.hns.video
video/vnd.motorola.video
video/vnd.motorola.videop
video/vnd.mpegurl mxu m4u
video/vnd.nokia.interleaved-multimedia
video/vnd.nokia.videovoip
video/vnd.objectvideo
video/vnd.sealed.mpeg1
video/vnd.sealed.mpeg4
video/vnd.sealed.swf
video/vnd.sealedmedia.softseal.mov
video/vnd.vivo viv
video/x-fli fli
video/x-ms-asf asf asx
video/x-ms-wm wm
video/x-ms-wmv wmv
video/x-ms-wmx wmx
video/x-ms-wvx wvx
video/x-msvideo avi
video/x-sgi-movie movie
x-conference/x-cooltalk ice
application/x-httpd-php php
application/x-httpd-php-source phps

Sunday, November 16, 2008

Crypto++ to PHP

This article if following one article that I wrote about using libcurl or wget to post data to a coldfusion and php server. In my sample data were sent in a clear form to the server which is NOT the best things to do.
When submitting sensitive data to a server over HTTP using HTTP Post Request it is highly recommended to use encryption or any sort of obfuscation of your own using xor and rotation etc... to encapsulate data inside your http key/value form data.
A c++ client can achieve this thanks to the great C++ library Crypto++. There are various encryption type out there some more stronger than other... Which means some can be broken super fast some will require more CPU time. I like asymetric encryption in a sense that the client doesn't store a unique key which has to be hidden inside the client code but use a key pair instead and just the public key is stored inside the client whereas the server will store the private key... Although,
I have not found any PHP implementation of RSA so far and I think mcrypt didn't support RSA for copyright issues I guess... I would love to see a complete support of crypto++ written in PHP or available as a PHP module. If you find anything out there let me know. As a great alternative, since mcrypt support ECB a DES_EDE3 encryption solution which is also supported by crypto++ here is a good way to encrypt data in C++ and decrypt data in PHP.

Here we go !

Client Side using ECB - DES_EDE3
==================================

#include "cryptlib.h"
#include "modes.h"
#include "des.h"
#include "base64.h" <-- any base64 encoder/decoder i found the usage of crypto++ base64 class a bit hard to use since you have to know how many byte are taken to encode a byte in base 64...
#include "hex.h"

// Encode the data using the handy Crypto++ base64 encoder. Base64 uses
// 3 characters to store 2 characters.
const int BUFFER_LENGTH = 255;
byte plaintext[BUFFER_LENGTH];
byte ciphertext[BUFFER_LENGTH];
byte newciphertext[BUFFER_LENGTH];
byte decrypted[BUFFER_LENGTH];

CryptoPP::Base64Encoder base64Encoder;
CBase64Coding base64Coder;
CString MySensitiveDataUncrypted;
CString MySensitiveData;

// Set up the same key and IV
const int KEY_LENGTH = 24;
const int BLOCK_SIZE = CryptoPP::DES::BLOCKSIZE;
byte key[KEY_LENGTH], iv[CryptoPP::DES::BLOCKSIZE];
memset( key, 0, KEY_LENGTH);
memcpy( key, "012345678901234567890123", KEY_LENGTH );
memset( iv, 0, CryptoPP::DES::BLOCKSIZE);
memcpy( iv, "01234567", CryptoPP::DES::BLOCKSIZE );
memset( plaintext, 0, BUFFER_LENGTH);
memset( ciphertext, 0, BUFFER_LENGTH);
memset( newciphertext, 0, BUFFER_LENGTH);
strcpy((char*)plaintext,MySensitiveDataUncrypted.GetBuffer(0));
// now encrypt
CryptoPP::ECB_Mode::Encryption ecbEncryption(key, sizeof(key));
ecbEncryption.ProcessString(newciphertext, plaintext, BUFFER_LENGTH);
// your own base64 encoder/decoder
base64Coder.Encode((char *)newciphertext,BUFFER_LENGTH,(char *)ciphertext);
MySensitiveData.Format(_T("%s"),ciphertext);

// MySensitiveData can now be send over http


Server Side in PHP using ECB - DES_EDE3
=========================================

// $MyBase64EncodedSecretString will receive/store the encrypted string which will also be base64Encoded for HTTP protocol convenience

$key = "012345678901234567890123";
$iv = "01234567";

// Set up an "encryption" descriptor. This is basically just an object that
// encapsulates the encryption algorithm. 'tripledes' is the name of the
// algorithm, which is simply the DES algorithm done three times back to
// back. 'ecb' describes how to encrypt different blocks. See, DES
// actually only encrypts 8-byte blocks at a time. To encrypt more than 8
// bytes of data, you break the data up into 8-byte chunks (padding the
// last chunk with NULL, if need be), and then encrypt each block
// individually. Now, ECB (which stands for "Electronic Code Book", for
// whatever that's worth) means that each 8-byte block is encrypted
// independently. This has pros and cons that I don't care to discuss.
// The other option is CBC ("Cipher Block Chaining") which links the blocks,
// such as by XORing each block with the encrypted result of the previous
// block. Security geeks probably really get excited about this, but for my
// needs, I don't really care.
$td = mcrypt_module_open( 'tripledes', '', 'ecb', '' );
mcrypt_generic_init( $td, $key, $iv );

// Grab some interesting data from the descriptor.
// $maxKeySize = 24, meaning 24 bytes
// $maxIVSize = 8, meaning 8 bytes
$maxKeySize = mcrypt_enc_get_key_size( $td );
$maxIVSize = mcrypt_enc_get_iv_size( $td );
//echo "maxKeySize=$maxKeySize, maxIVSize=$maxIVSize\n";

// let's decrypt it and verify the result. Because DES pads
// the end of the original block with NULL bytes, let's trim those off to
// create the final result.
$MyEncodedSecretString = base64_decode( $MyBase64EncodedSecretString );
$MyDecodedString = rtrim( mdecrypt_generic( $td, $MyEncodedSecretString ), "\0" );

// And finally, clean up the encryption object
mcrypt_generic_deinit($td);
mcrypt_module_close($td);


Client Side Stronger Encryption using RSA
=========================================

First you will need to generate a public/private key pair using crypto++ keygen console application then your client code should be something like

// Client Side Using RSA
#include "cryptlib.h"
#include "rsa.h"
#include "hex.h"
#include "randpool.h"
#include "filesource.h"

CString MyNotverySecretStringInMemory;
CString MySensitiveData;
char pubFilename[128];
char seed[1024], message[1024];

// MAX = 19999991
strcpy(seed,"12345");

CString tmpPath;
TCHAR appPath[MAX_PATH];
::GetModuleFileName(NULL,appPath,MAX_PATH);

tmpPath = appPath;
tmpPath = tmpPath.Left(tmpPath.ReverseFind('\\')+1);
tmpPath += "public.key"; // 1024 key length for higher security.

strcpy(pubFilename,tmpPath.GetBuffer(0));
strcpy(message,MyNotverySecretStringInMemory.GetBuffer(0));
CryptoPP::FileSource pubFile(pubFilename, true, new CryptoPP::HexDecoder);
CryptoPP::RSAES_OAEP_SHA_Encryptor pub(pubFile);
CryptoPP::RandomPool randPool;
randPool.IncorporateEntropy((byte *)seed, strlen(seed));
std::string result;
CryptoPP::StringSource(message, true, new CryptoPP::PK_EncryptorFilter(randPool, pub, new CryptoPP::HexEncoder(new CryptoPP::StringSink(result))));
MySensitiveData.Format(_T("%s"),result.c_str());

// Server code will need to use private.key to decode the hexencode rsa string


Didn't find any PHP implementation yet if anyone heard about one shoot me an email.

Use it at your own certitude :)) to think your solution is going to be more secure. I would say one sentence about security. All is a matter of time given to put yourself or your solution in a "SAFE" zone until the code is broken.
The longer time it takes to break the solution the more bullet proof your solution is.

Thursday, October 30, 2008

FLV Cuepoints in Flash CS3 with Flash Video Encoder versus FLV and F4V Cuepoints in Flash CS4 with Adobe Media Encoder Best Practice

This article is aimed to clarify:

How Cuepoints and which cuepoints type are presented to the user in Flash CS3 for FLV

and
How Cuepoints and which cuepoints type are presented in Flash CS4 for FLV and F4V.

View Cuepoint In Flash CS3
==========================

FLV:

Cuepoints when available are inported at the end of the Import Video Wizard workflow.
User are able to see their cuepoints by selecting the FLVPlayback Control on stage and after showing the Component Inspector panel (dockable panel). The cuepoints are visible in the cuepoint property of the Component Inspector. Cuepoints are sorted based on the SMPTE time at which they have been created. User can insert Event or Navigation Cuepoints using Flash Video Encoder. Cuepoints are embedded in the FLV.

Codewise, Flash Developers have the option to use Action Script 2 or Action Script 3 in order to interpret Cuepoints (Event and Navigation) at runtime (when the SWF is playback by Flash Player 9 or Flash Player 10). I am not going to cover the onCuepoint Callback (timed based event cuepoint callback) which applies to FLV only but rather focus on the use case where all cuepoints are preloaded/received at once. The following code is Action Script 3 code using NetStreem to attach a _metadata class in order to receive Metadata through onMetaData event callback. In onMetaData Cuepoints are returned in an Array.


connection.connect(connectURL);
stream = new NetStream(connection);
//assign metadata client
stream.client = _metadata;
var video:Video = new Video();
video.attachNetStream(stream);
stream.seek(0);

........

_metadata.onMetaData = function(eventObj:Object):void {
var cuePoints:Array = eventObj.cuePoints;

//cuepoints are returned as an Array
}

Callback Sequence
=================

For FLV the callback sequence will be

Callbacks: onMetaData


View Cuepoints In Flash CS4
===========================

FLV:

FLVs now contains two types of Cuepoints. Two types of Cuepoints are encoded in the FLV. "Flash CS3" Cuepoints and Cuepoints encoded as a subset of an XML Track


first < has been replace by { and > by } because google blog text editor is retarded..

{xmpDM:trackName}AME Markers{/xmpDM:trackName}
{xmpDM:frameRate}f254016000000{/xmpDM:frameRate}
{xmpDM:markers}
{rdf:Seq}
{rdf:li rdf:parseType="Resource"}
{xmpDM:startTime}7695905817600{/xmpDM:startTime}
{xmpDM:name}Title1{/xmpDM:name}
{xmpDM:type}FLVCuePoint{/xmpDM:type}
{xmpDM:cuePointType}Navigation{/xmpDM:cuePointType}
{xmpDM:cuePointParams}
{rdf:Seq}
{rdf:li rdf:parseType="Resource"}
{xmpDM:key}Title{/xmpDM:key}
{xmpDM:value}Star Trek{/xmpDM:value}
{/rdf:li}
{rdf:li rdf:parseType="Resource"}
{xmpDM:key}Color{/xmpDM:key}
{xmpDM:value}Blue{/xmpDM:value}
{/rdf:li}
{/rdf:Seq}
{/xmpDM:cuePointParams}
{/rdf:li}
{/rdf:Seq}
{/xmpDM:markers}
{/rdf:li}
{/rdf:Bag}
{/xmpDM:Tracks}

The cuepoint type are the same than the one defined in the FLV spec part of Flash CS3. The FLV Cuepoint Track (AME Markers in the above sample XMP block) follows
a "well defined" XML syntax, namely the XMP subset of RDF. The RDF spec uses a BNF-like grammar, not an XML DTD. The XML syntax described above is compliant with Flash CS4 integration of Cue Points through the Cue Points dialog and the Component Parameters Cue Points Property. This is assuming you are calling Adobe Media Encoder from Flash CS4 at encoding time.
For FLVs to ensure backward compatibility with Flash CS3, Flash CS4 presents the FLV Cuepoints encoded in the "non XMP form", like wise they were encoded in Flash CS3 and earlier, and WON'T present FLV XMP Cuepoints in the Component Inspector at all if the FLVs have been encoded by Adobe Media Encoder. If Flash Designers and Developers change XMP Cuepoints in their FLVs they have to bare in mind to maintain the non XMP cuepoints as well encoded in the file if they want to see them in Flash CS4 using Adobe SDK and Adobe Software. If Flash Developers prefer to preload XMP Cuepoints only in their SWFs for FLVs, they can rely on Adobe Bridge CS4 or the Import and Export XMP feature available in Adobe Media Encoder CS4 to edit/replace their Cuepoints. They need to preload their Cuepoints at runtime all the time through the onXMPData callback. As far as synchronisation of Cuepoints is concerned they can use a timer and video polling techniques when loading Cuepoints through onXMPData in order to provide accurate synchronization of Event and Navigation Cuepoints with Action Scripts. If they don't want to preload XMP Cuepoints but still want to use Cuepoints in their SWF they need to preload Cuepoints at runtime through onMetadata and proceed with timer and video polling techniques to perform the synchronization of their Action Scripts Code or rely on OnCuepoint which is an SMPTE timed based event callback notification available in Flash CS3 as well and Flash Player 9 but only for FLV.

F4V:

F4Vs also contains XMP Metadata in order to represent "FLV Cuepoints" as well when the F4Vs are encoded by Adobe Media Encoder

For F4Vs Flash CS4 present XMP Cuepoints in the Component Inspector in the order they appears in the RAW XMP Metadata block embedded in the F4V and in the Cuepoints dialog, Cuepoints params are listed in the order they appears in the RAW XMP Metadata block. User can alter XMP Cuepoints using Software and Human Interface such as Adobe Media Encoder or Adobe Bridge CS4 by exporting/modifying/importing XMP files.

Codewise, Flash Developers have the option to use Action Script 2 or Action Script 3 in order to interpret FLVs and F4Vs "FLV Cuepoints" at runtime (when the SWF is rendered by Flash Player 10). As far as synchronisation of Cuepoints is concerned they HAVE to use a timer and video position polling techniques when loading Cuepoints through onXMPData and they have to do their own Action Script synchronization for event and navigation cuepoints.


The following code is Action Script 3 code using NetStream to attach a _metadata class in order to receive Metadata through onMetaData event callback as well as the new callback onXMPData.

Callback Sequence
=================

For F4V the callback sequence is

Callbacks: onMetaData -> onXMPData -> onMetadata

For FLV the callback sequence is

Callbacks: onMetaData -> onXMPData


connection.connect(connectURL);
stream = new NetStream(connection);
//assign metadata client
stream.client = _metadata;
var video:Video = new Video();
video.attachNetStream(stream);
stream.seek(0);

........

_metadata.onMetaData = function(eventObj:Object):void {
var cuePoints:Array = eventObj.cuePoints;

// For F4V First and Third callback call in the callback sequence listed above
// For FLV First call in the callback sequence listed above
}

_metadata.onXMPData = function(info:Object):void {
trace("raw XMP =\n");
trace(info.data);
// For F4V Second call in the callback sequence listed above info.data contains raw XMP block
// For FLV Second call in the callback sequence listed above info.liveXML contains raw XMP block
}

Note: Flash CS4 will import Cue Points stored in the info.data object only not info.liveXML but your AS3 code in your custom player will receive the data as listed above with Flash Player 10

Overall : It is possible with both FLV and F4V cuepoints to have frame accuracy with Event and Navigation Cuepoint

XMP Resources and spec

XMPCore http://partners.adobe.com/public/developer/xmp/topic.html
XMP http://www.adobe.com/devnet/xmp/

Flash CS4 Video Playback http://www.adobe.com/devnet/flash/articles/flvplayback_fplayer9u3_04.html

FLV and F4V http://en.wikipedia.org/wiki/Flash_Video

XMP http://en.wikipedia.org/wiki/Extensible_Metadata_Platform

http://www.adobe.com/products/xmp/

Some useful resource regarding RDF and triple store

http://www.w3.org/TR/rdf-schema/
http://simile.mit.edu/reports/stores/

and finally a great use case of what can be done using XMP cuepoint : Interactive FLV and F4V Video

http://younsi.blogspot.com/2008/12/interactive-video-in-flash-using-f4v.html

Tuesday, October 21, 2008

HTTP Post behavior between a C++ CURL client and IIS running Coldfusion 7 not as good as PHP but still providing the functionality

I found that PHP is way more advance when it comes to parse HTTP post request send towards a web server from a C++ client using CURL. HTTP form data are very handy when you want to send data such as cookie, login, password, files, custom command to fit your own underlying protocol between your client and your server. The test that i performed consisted in posting data using form-data towards a IIS/ColdFusion 7 server script from a C++ Client using CURL and i did the same with IIS/Apache/PHP.

To validate my test i also used wget command line tool to post form data using the follwoing command.

wget-1.11.4b>wget --header="Content-tye:multipart/form-data, boundary=--========00000003640" --post-file=postdata.txt http://www.fullyqualifydomainname.com/post.cfm

where the file postdata.txt is :

--========00000003640
Content-Disposition: form-data; name="SessionID"
Content-Type: text/plain
--========00000003640
Content-Disposition: form-data; name="UserName"
Content-Type: text/plain
test
--========00000003640
Content-Disposition: form-data; name="UserPassword"
Content-Type: text/plain
test
--========00000003640
Content-Disposition: form-data; name="EOF"
Content-Type: text/plain
EOF
--========00000003640—

The conclusion of my test was that it is not easy to retrieve all post data into an array in one single call in ColdFusion something which is working great and easy to achieve in PHP. Something the coldfusion team should concider for future APIs... !

ColdFusion Script post.cfm
==========================

first < has been replace by / and > by \ because google blog text editor is retarded..

/cfset x = GetHttpRequestData()\

/cfsavecontent variable="y"\
/cfoutput\
/table cellpadding = "2" cellspacing = "2"\
/tr\
/td\/b\HTTP Request item//b\//td\
/td>/b>Value//b//td\ //tr\
/cfloop collection = #x.headers# item = "http_item"\
/tr\
/td>#http_item#//td\
/td>#StructFind(x.headers, http_item)#//td\ //cfloop\
/tr\
/td\request_method//td\
/td\#x.method#//td\//tr\
/tr\
/td>server_protocol//td\
/td>#x.protocol#//td\//tr\
//table\
/b>http_content --- #x.content#//b\
//cfoutput\
//cfsavecontent\

working post.php script
=======================

#begin script

error_log("post.php Enter");

$debug = 1;
$ua = $_SERVER["HTTP_USER_AGENT"];
$server_request_uri = $_SERVER['REQUEST_URI'];
$server_name = $_SERVER['HTTP_HOST'];
$remote_addr = $_SERVER['REMOTE_ADDR'];
$server_addr = $_SERVER['SERVER_ADDR'];
$server_port = $_SERVER['SERVER_PORT'];
$server_request = $_SERVER['REQUEST_METHOD'];
$server_request_time = $_SERVER['REQUEST_TIME'];
$server_protocol = $_SERVER["SERVER_PROTOCOL"];

error_log("=============================");
error_log("");
error_log("POST $server_request_uri HTTP/1.0");
foreach ($headers as $header_entry=>$header_value)
{
error_log("$header_entry: $header_value");
}
error_log(print_r($_POST,true));

#end script


WORKING PHP LOG
===============

21-Oct-2008 09:15:39]
[21-Oct-2008 09:16:29] post.php Enter
[21-Oct-2008 09:16:29] =============================
[21-Oct-2008 09:16:29]
[21-Oct-2008 09:16:29] POST /post.php HTTP/1.0
[21-Oct-2008 09:16:29] Host: www.fullyqualifydomainname.com
[21-Oct-2008 09:16:29] Content-Length: 655
[21-Oct-2008 09:16:29] Content-Encoding: ISO-8859-1
[21-Oct-2008 09:16:29] Content-Type: multipart/form-data; boundary=========00000024328
[21-Oct-2008 09:16:29] Accept: text/html, *.*
[21-Oct-2008 09:16:29] Expect: 100-continue
[21-Oct-2008 09:16:29] Array
(
[SessionID] =>
[version] => 1.0
[UserName] => test
[UserPassword] => test
[EOF] => EOF

)

on the other hand

wget http://www.fullyqualifydomainname.com/download/update.cfm --post-data="UserName=test&UserPassword=test" works fine with ColdFusion 7 and the previous script assuming that you will have to parse UserName=test&UserPassword=test as a ByteArray

Thursday, September 25, 2008

Canon EOS 5D MKII - Reverie

Wow !!! I love H.264

http://blog.vincentlaforet.com/

The reverie HD video is available on the smugmug CDN

http://www.smugmug.com/photos/best-video-sharing/

http://vincentlaforet.smugmug.com/gallery/6961015_exAjb/1/450568576_iAAka/Large

Quoting Vincent :

The H.264 mov files that you will see are straight out of the prototype camera.
(You will be able to see that these are indeed raw clips for yourself in the embedded EXIF info) and will prove all of the skeptics wrong - not a single color, tonal, noise, exposure - or ANY adjustment was made to any of the footage at any time).

Wednesday, September 17, 2008

Green Energy

I use to live in Arizona and i was just shocked to see that nobody was adopting solar energy in those cities as a great add on to electricity supply.

As a matter of fact some nuclear plants are used to provide enough electricity for all those old and ugly AC/Units just for the month of June,July,august and September.
Well we all know that you can't use solar energy to provide enough "juice" for AC/unit but a nice panel could provide enough electricity to run your computers the all year, provide lighting and provide electricity for some of your utilities...

So what cities like Phoenix, Texas, Las Vegas are waiting for......
When the government will provide really good tax return intensive plan for people willing to installed solar panel ?

http://www.sunpowercorp.com/For-Homes.aspx

Okay so for Phoenix here are the numbers if you get yet an other loan of 25 years...

Gross Cost: $38,000
Federal Tax Credit: $7,140
State/Utility Rebate: $13,950
Net Cost: $16,910
First Year Bill Savings: 36%

Assuming that you don't have any problems with the panel after 5 years which use to be the average medium time before failure for older generation of solar panel you will pay per month :

With SunPower Without SunPower
Monthly Loan Payment $112.73 $0.00
Tax Savings * -$31.35 $0.00
Monthly Electric Bill $66.99 $105.00
Monthly Net Cost $148.38 $105.00

Per year 456 USD of saving.

This system seams to be good for people who can afford to pay in full.
It seams that best is to pay cash and yet the system should be fare if the
customer would get Federal Tax Credit EVERY year not only at purchase time.
Let's say your electric bill cost 66 USD instead of 105 USD. Your
clean saving net worth is 33 USD per month. Government should give
you 1/3 of the 33 USD of money back every month at least equivalent to
1 month of free energy per year.

Well it's a start...

http://www.energystar.gov/index.cfm?c=products.pr_tax_credits
http://www.gapminder.org/

Monday, September 08, 2008

Apple itunes installer ??

http://blog.wired.com/geekdad/2008/09/why-im-no-longe.html

Wednesday, September 03, 2008

Interactive H264 Video for Flash Player 10

Stay tuned this article will show you how to create interactive Video for Flash Player 10 using XMP Metadata Encapsulation

http://younsi.blogspot.com/2008/12/interactive-video-in-flash-using-f4v.html

Thursday, August 28, 2008

iPhone has the big head but apple misses a point....

The UK banned a TV ad where Apple claims to "completely surf the web",
though it doesn't support Flash or Java.


http://www.crn.com/retail/210201022

Wednesday, August 20, 2008

OGG VORBIS and MOD tracker in Action Script 3

I just found out about this project and i love what have been done
in Flash

http://blog.joa-ebert.com/2008/07/24/as3-vorbis-encoder/

http://blog.andre-michelle.com/

Tuesday, August 19, 2008

Stop making scrollbars in SWF when displaying Text

Quoting Hoss Gifford text from his SWF sample

http://hossgifford.com/resizer/

This is a plea to you, the Flash developer community,
to stop making your own fucking scrollbars. They are fiddly,
non-standard and unintuitive to the average web user.

The thing is, all browsers already have scrollbars. And they
work really well. And everyone knows how to use them. But the
biggest criticism that Flash sites get again and again is their
fixed ‘letterbox’ format with text scrolling within an area of
that letterbox using some proprietary means of interactivity.

This doesn’t have to be the case. This file is a demonstration
of a technique that resizes the flash movie within the html page
to fit the content within the movie. It’s free to use and abuse,
whether you copy and paste it verbatim into your work, or if you
hack and slash it into something that suits the specifics of your
project.

Props to Geoff Stearns for his wonderful swfObject which this latest
version uses to greatly simplify things. Please check
"http://blog.deconcept.com/" for the latest version of swfObject as I
offer no guarantee that the version here is the most recent.

"Hoss Gifford,"
Glasgow,
14/11/2005

http://www.hossgifford.com/downloads.htm

Saturday, August 16, 2008

Things i hate about Vista

This blog entry will focus on all the things that i hate about vista.

1 When copying and pasting folder with large amount of files EG 100 000 from one USB drive to an other a pop up dialog appears saying that there is not enough memory to perform the operation after some times.

2 Explorer.exe process still crashing no improvement since Windows XP

3 Thumbnail view of images and video in explorer are not working so use Adobe Bridge :)

4 Dual screen mode is just wrong and it is not possible to consistently run vista on a laptop with a broken screen for instance using only the external connector. If you want to connect your laptop running vista to an LCD TV through the VGA external connector of your laptop and then later on if you unplug the VGA cable because you want either to use the TV with an other laptop or simply put the laptop to sleep then next time you turn the laptop on after plugging the VGA connector vista will forget that you want your TV as the primary screen. The log in window will show up all the time on the laptop screen. It should be expected to use the last settings which is also the most used settings. It will reset to default settings which is just wrong. On the other hand all windows from the operating OS will open on the wrong screen the secondary screen. Same for control panel settings, if you open control panel on one screen (external screen) and then open the display settings the dialog will open on the wrong screen the "primary" laptop screen.

5 .... coming soon

Monday, July 21, 2008

Installing IIS on Windows XP Pro / Reminder

Since i always forgot

Installing IIS on Windows XP Pro

If you are running Windows XP Professional on your computer you can install Microsoft's web server, Internet Information Server 5.1 (IIS) for free from the Windows XP Pro installation CD and configure it to run on your system by following the instructions below: -

1. Place the Windows XP Professional CD-Rom into your CD-Rom Drive.

2. Open 'Add/Remove Windows Components' found in 'Add/Remove Programs' in the 'Control Panel'.

3. Place a tick in the check box for 'Internet Information Services (IIS)' leaving all the default installation settings intact.

4. Once IIS is installed on your machine you can view your home page in a web browser by typing 'http://localhost' (you can substitute 'localhost' for the name of your computer) into the address bar of your web browser. If you have not placed your web site into the default directory you should now be looking at the IIS documentation.

5. If you are not sure of the name of your computer right-click on the 'My Computer' icon on your desktop, select 'Properties' from the shortcut menu, and click on the 'Computer Name' tab.

6. Your default web directory to place your web site in is 'C:\Inetpub\wwwroot', but if you don't want to over write the IIS documentation found in this directory you can set up your own virtual directory through the 'Internet Information Services' console.

7. The 'Internet Information Services' console can be found in the 'Administration Tools' in the 'Control Panel' under 'Performance and Maintenance', if you do not have the control panel in Classic View.

8. Double-click on the 'Internet Information Services' icon.

8. Once the 'Internet Information Services' console is open you will see any IIS web services you have running on your machine including the SMTP server and FTP server, if you chose to install them with IIS.

9. To add a new virtual directory right click on 'Default Web Site' and select 'New', followed by 'Virtual Directory', from the drop down list.

7. Next you will see the 'Virtual Directory Creation Wizard' from the first screen click the 'next' button.

9. You will then be asked to type in an 'Alias' by which you will access the virtual directory from your web browser (this is the name you will type into your web browser after 'localhost' to view any web pages you place in the directory).

10. Next you will see a 'Browse...' button, click on this to select the directory your web site pages are in on your computer, after which click on the 'next' button to continue.

11. On the final part of the wizard you will see a series of boxes, if you are not worried about security then select them all, if you are and want to run ASP scripts then check the first two, followed by the 'next' button.

12. Once the virtual directory is created you can view the web pages in the folder by typing 'http://localhost/aliasName' (where 'aliasName' is, place the alias you called the virtual directory) into the address bar of your web browser (you can substitute 'localhost' for the name of your computer if you wish).

Wednesday, July 16, 2008

How to detect the selected language on Mac OS 10 Tiger/Leopard

I noticed many post on Apple Dev web site of people trying to know what is the current language selected on Mac OS 10 when doing a drag and drop of japanese language before english.

The following code tested on Tiger will work like a charm.

static Boolean s_curLangInited = FALSE;
static Boolean s_bJapanese = FALSE;

if (!s_curLangInited)
{
CFComparisonResult result;
CFStringEncoding encoding = kCFStringEncodingMacRoman; // = 0;
CFAllocatorRef alloc_default = kCFAllocatorDefault; // = NULL;

// a couple of c string literals.
const char cstr_ja[] = "ja_JP";

// convert from c string to CFString
CFStringRef cf_jaString = CFStringCreateWithCString(alloc_default,cstr_ja,encoding);
//CString curLangStr = AfxGetApp()->GetProfileString(_T("Settings"), _T("Language"), _T("nil"));
CFLocaleRef loc = ::CFLocaleCopyCurrent();
CFStringRef cf_lang = (CFStringRef)::CFLocaleGetValue (loc, kCFLocaleLanguageCode);

CFMutableArrayRef available_locales;
CFArrayRef intersected_locales;
char user_locale[50];
struct direct *file;
DIR *dir;
CFArrayRef prefered_languages;

CFLocaleRef user_locale_ref = CFLocaleCopyCurrent();
CFStringRef user_locale_string_ref = CFLocaleGetIdentifier( user_locale_ref );

/* the prefered language in System Preferences.app, because it can differ from CFLocaleCopyCurrent().
However this prefered language is stored using the general language denotation
that may not include the country code (en,fr,en-GB,...) which is not accepted
by setlocale (setlocale would expect en_US,fr_FR,en_GB,...).

So we retrieve possible locales from /usr/share/locale and intersect them
with the prefered languages using CFBundleCopyLocalizationsForPreferences.
*/
dir = opendir("/usr/share/locale");
available_locales = CFArrayCreateMutable(kCFAllocatorDefault, 0, NULL);
while ((file = readdir(dir)))
{
/* This filters the 'right' locales (xx_xx.UTF-8) */
if (strstr(file->d_name, ".UTF-8"))
CFArrayAppendValue(available_locales, (void*)CFStringCreateWithCString(kCFAllocatorDefault,
file->d_name, kCFStringEncodingUTF8));
}
closedir(dir);

CFPreferencesAppSynchronize(kCFPreferencesAnyApplication);
prefered_languages = (CFArrayRef)CFPreferencesCopyValue( CFSTR("AppleLanguages"), kCFPreferencesAnyApplication,
kCFPreferencesCurrentUser, kCFPreferencesAnyHost);

if (prefered_languages)
{
CFArrayRef intersected_locales = (CFArrayRef)CFBundleCopyLocalizationsForPreferences(available_locales, prefered_languages);
CFStringRef user_language = NULL;

if(CFArrayGetCount(intersected_locales))
user_language = (CFStringRef)CFArrayGetValueAtIndex(intersected_locales, 0);
if(user_language)
{
CFStringGetCString( user_language, user_locale, sizeof(user_locale), kCFStringEncodingUTF8 );

result = CFStringCompareWithOptions(user_language, cf_jaString, CFRangeMake( 0 ,CFStringGetLength(cf_jaString)), kCFCompareCaseInsensitive);
if (result == kCFCompareEqualTo) {

s_bJapanese = true;
}
else
{
s_bJapanese = false;
}

Tuesday, July 15, 2008

why didn't Apple let AT&T sell/activate the new iPhone over launch weekend?

good question !

http://www.flickr.com/photos/lasean/2668369038/

Monday, July 14, 2008

Papervision 3d

An interesting 3d engine alternative

http://www.papervision3d.org/

Tuesday, July 01, 2008

Modal Dialog using Carbon

Not a long time ago i was force to find a way to display an Alert Dialog on MAC OS X
and here is a basic sequence to display a modal dialog on the mac similar to Win32 MessageBox

{
DialogRef alert;
DialogItemIndex outHit;
CFStringRef errMsg;
CFStringRef errorExplanation;
UInt32 textLength;

alertStringExplanation = SomeUTF String
alertStringTitle = SomeUTF String

l1 = alertStringExplanation.length();
l2 = alertStringTitle.length();
textLength = l2;
errMsg = ::CFStringCreateWithBytes(NULL, (UInt8 *) alertStringTitle.get(), textLength, CFStringGetSystemEncoding(), false);
textLength = l1;

errorExplanation = ::CFStringCreateWithBytes(NULL, (UInt8 *) alertStringExplanation.get(), textLength, CFStringGetSystemEncoding(), false);
UInt32 numUnicodeChars = ::CFStringGetMaximumSizeForEncoding(textLength, kCFStringEncodingUnicode);

CreateStandardAlert(kAlertCautionAlert, errMsg, errorExplanation, NULL, &alert);
RunStandardAlert(alert, NULL, &outHit);

}

Indexing SWF file

http://seekingalpha.com/article/83397-adobe-ups-relevance-with-searchable-flash?source=yahoo

For most people on the Web, if Google or Yahoo cannot find something, it doesn’t exist. That has been one of the biggest drawbacks to creating a Website or application that displays itself as a Flash (SWF) file. Search engines could see the file, but they could not see what was in it. Until now.

Adobe has come up with a way for the search engines to read SWF files and index all of the information they contain. That means any text or links in a Flash application can now be indexed. This is a huge step forward for Adobe and anyone who develops in Flash/Flex. Michele Turner, Adobe’s VP of marketing for its platform business, explains:

We are releasing technology to Google and Yahoo that enables them to crawl and index SWF files. They are now searchable. This will open up millions of Flash files to search.

Adobe has created a special Flash player for the search engines that acts like a virtual user going through each application. It actually goes through the runtime of each Flash application and translates it into something the search engines can understand. So all of those fancy interactive Flash Websites and other rich Internet applications that have been invisible to search engines, can now be seen by them.

Turner acknowledges that this invisibility so far “has been a big problem for those developing rich applications.” After all, it doesn’t matter how pretty your Website is if nobody can find it. Flash applications and Websites (many ironically created by ad agencies) have not been able to take advantage of any of the search-engine juice that so many online ad campaigns depend upon. This should be seen as part of Adobe’s larger efforts to remove any remaining restrictions associated with Flash (in April, for instance, it opened up the Flash runtime as part of its the Open Screen Project).

Google is already rolling out the SWF-indexing technology, while Yahoo still “has some work to do,” says Turner. Even so, this won’t solve all the problems with Flash content showing up on search engines.

Google SWF

http://googlewebmastercentral.blogspot.com/2008/06/improved-flash-indexing.html

ADOBE SWF searchability

http://www.adobe.com/devnet/flashplayer/articles/swf_searchability.html

Thursday, June 26, 2008

Flash web sites sample that i like

Max 2007 award winning web site in movie'a category was just incredible using the best advantage of Flash 9 and Adobe Creative Suite. Can't wait to see what will be the result of upcoming web site taking advantage of the new Flash 10 as well as CS3 suite.

http://www.ilm.com/theshow/

Foxit PDF Preview Handler for Windows Vista, Office 2007 and Windows XP.

You’ve likely reached this page as a result of a search or a referral. This page contains the most current links to download the Foxit PDF Preview Handler for Windows Vista, Office 2007 and Windows XP.

The Foxit PDF Preview Handler is a piece of software written by Tim Heuer with sponsorship from Foxit Software (providing the license so that we all can enjoy). Special thanks to Ryan Gregg for help with the Windows XP version. These preview handlers are a part of Microsoft Windows Vista in the operating system as well as in Outlook 2007.

Tim Heuer wrote:

For example, in Outlook 2007, if you receive an attachment that is a PDF you can click it and get a preview of that document right within Outlook without having to open the document in another program. It is an extremely helpful feature of Outlook that I love and why I wrote this handler for PDFs. Microsoft did not provide a default one for PDFs as a part of Outlook or Vista. If you install Adobe Acrobat 8.1+ you will get one as well. However, I am not a fan of Acrobat Reader as I think it is a slow application for what I use PDFs for – reading only. For this I prefer Foxit Reader as it is super light-weight and fast.

http://timheuer.com/blog/archive/2008/05/09/foxit-pdf-preview-handler.aspx

About straight and premultiplied channels


Practical advice for developers
(from DVD-HQ.info)




This section is aimed mainly at software developers, but regular users should read it too, because it shows how simple it is to deal with these issues from a programming point of view.




It might sound a bit self-righteous to write an article telling Photoshop's or 3dsmax's programmers how to do their job but... well, someone has to, because it's pretty obvious they aren't going to get it right by themselves (both are up to version 9, and are still lacking basic alpha channel conversion abilities).




First, here are the formulas to convert between matted and non-matted alpha. They can deal with any matte colour and are easy to implement for any colour depth and in any language. The variables used in the formulas are:




Cm = Component (matted)

Cu = Component (unmatted)

Cb = Component (background / matte colour)

a = Alpha

amax = Maximum possible alpha value (ex., 1.0)




All values are assumed to vary between 0.0 and 1.0 (for 8-bit files this would be 0-255 and for 16-bit files it would be 0-65535; remember to divide by the scale if you use anything other than 0.0-1.0).




To convert from unmatted alpha to matted alpha:




Cm = ( Cu ∙ a ) + [ Cb ∙ ( amax - a ) ]




To convert from matted alpha to straight (unmatted) alpha:





If a = 0, then Cu = Cm

Else, Cu = [ Cm - Cb ∙ ( amax - a ) ] / a




The formulas should be applied once to each colour component (ex.: R, G and B) of each pixel.




Those formulas are enough to add support for alpha channel conversion (with any matte colour) to any application. The software can then either cache a "working format" version of the image (generally meaning a straight-alpha version) or it can perform the conversion whenever it needs to read a pixel's colour channel values. There is really no excuse for not including this basic ability in a professional-level application.




The second issue is how to determine the kind of alpha channel used by a file that the user has just imported. One solution is to simply ask the user, but that's a pretty poor solution; users have more important things to worry about. So let's look at how software can determine the type of alpha channel and, if it turns out to be a matted alpha channel, how it can determine the background colour.




First we look for a pixel that is 100% transparent (0% opaque). If one exists, store its RGB values. Look for another pixel that is 100% transparent. Compare its RGB values with the ones previously stored. Repeat until the end of the file. If all pixels with 0% opacity have the same RGB values, it's almost guaranteed that that colour is the one used for the matte (if indeed there is a matte). If the colour varies, there's a good chance that we're looking at a straight-alpha file, or that the file uses some sort of really weird encoding (like the background bitmap example given above).




Now, even if all 100% transparent pixels have exactly the same colour, the file might still use "straight" alpha, so it's time to take the "background" RGB values we found above, plug them into the matted / unmatted conversion formulas and see if they make sense.




No pixel can have less of the matte colour in its RGB values than its alpha value would allow. For example, a colour channel in a pixel that is only 10% opaque cannot deviate more than 10% from the same channel of the matte colour.




If this condition isn't met by every pixel in the file, then there is no matte. If it is met by every pixel in the file, there's a very good chance that there is a matte, using the background colour we determined earlier.




There are other ways to make these decisions, some of which are simpler, faster, and will also get it right most of the time (for example, the program might analyse only a few pixels, rather than every pixel in the image).




Software should perform these tests when a file is first imported, and use the results to pre-fill the source format (or "footage interpretation") settings. This means that, in 99% of cases, the user will only need to click "ok".




If the tests are inconclusive (ex., because there are no transparent pixels in the file), then the software should ask the user to make the choice.




In any case, the user should always be given the option to toggle the type of alpha channel (between straight and matted), to pick the matte colour (manually or from the image) or to have the software "guess" the alpha channel type and matte colour again. These options should be available at any moment; not just when the file is first imported. If the software uses working proxies, a change of source format settings would cause the file to be re-imported.



(end of quote from DVD-HQ.info © Rui del-Negro 2008)

Friday, June 20, 2008

AS3 Flash 3D Engine Aletrnativa Platforms Drops A Nuke - Isometric and FPS

Alternativa Platform,

http://blog.alternativaplatform.com/en/2008/04/18/alternativa3d-5-m1/

previously Alternativa Game, launched their Alternativa Platform milestone 1 and really one demo would have been enough but there are some great demos there that literally put them what appears a couple laps up on the 3d FPS style engine in Flash.

The engine is highly optimized and smooth, heavy on the processor, but using the ‘t’ key you can see some nice revealing triangle rendering. Also, playing with the field of view adds for some nice game effects. (try jumping on the fans in the half-life like room in the first demo)

iPhone and Flash

http://www.crunchgear.com/2008/06/17/adobe-already-has-iphone-version-of-flash-running-on-emulator/


Adobe already has a version of Flash for the iPhone running on emulation software, and would, fingers crossed, be able to bring that over to the phone itself if Apple allowed it. That’s what Adobe said yesterday at its Q2 conference call. Or:

We have a version that’s working on the emulation. This is still on the computer and you know, we have to continue to move it from a test environment onto the device and continue to make it work. So we are pleased with the internal progress that we’ve made to date.

But will Apple allow Flash for the iPhone? Steve Jobs has claimed in the past that the mobile version of Flash—presumably what Adobe would be porting over to the iPhone—isn’t powerful enough for use on the nimble and elegant iPhone. Integration with Safari?

This leaves Adobe, if it wants a piece of that sweet, sweet iPhone market, with a few options. It could simply release a stand-alone Flash application on the upcoming App Store, but that would be cumbersome to say the least. One of the big reason why Flash is so popular is because it “just works” in a browser. No having to download Hulu videos to your hard drive in order to view them, for example.

Adobe could also, somehow, convince Apple to let it release a plugin for Safari. That’d be the most seamless for consumers.

Adobe has always take advantage of QuicktTime API and now QTKit so there is really no reason why Flash won't be fast on the iPhone

XMP Metadata, XFL and Flash = Complete End To End Solution

XFL

Since its inception, the Flash authoring tool has stored documents in a binary source-file called .fla. Historically, interchanging source with the Flash authoring tool has been virtually impossible for third-party software because the specification for .fla has never been public. But things are changing in the next version of Flash. Flash CS4 will be able to export *and* import a new source format called XFL. An XFL file is a .zip file that contains the source material for a Flash document. Within the .zip file resides an XML file describing the structure of the document and a folder with the document's assets (graphics, sounds, etc). The exact details of the XFL format are not yet available, but Richard assures me that Adobe intends to document them publicly, allowing third-party tools to import and export XFL.

So in theory, you might one day edit the images of an XFL file directly in Photoshop without disturbing the timeline information also contained in that file. Or you might be able to import a page from a word processing document into a Flash presentation.

But perhaps even more exciting is the potential for the smaller, grass-roots community. Being XML-based, the new XFL format should be fairly easy to understand and generate. That means any small tool company, web agency, or even independent developer will be able to create a purpose-built authoring tool that can output XFL. Of course, the XFL file would then need to be opened in the Flash authoring tool for final .swf export. But a .jsfl script should be able to ease the workflow between an XFL-generating tool and the Flash-authoring .swf-compilation process.

The natural next step in the evolution of XFL authoring would be to take the Flash authoring tool out of the equation altogether. If Adobe were to offer a command-line XFL-to-SWF compiler along with XFL, nearly any decent programmer would be able to create a .swf-authoring tool, even in ActionScript. The Flash developer community itself would finally be able to create its own custom Flash-authoring tools. I wonder who would be the first to nostalgically make Flash 4 for AIR in ActionScript?

XFL might not have the instant appeal of inverse kinematics, but it could eventually prove to be the feature in Flash CS4 that has the greatest impact on the Flash industry. After all, its name has an "X' in it.

http://www.moock.org/blog/archives/000269.html

XMP

http://www.adobe.com/products/xmp/indepth.html

FLASH AS3 AND VIDEO for WebAnalytics

http://blog.ickydime.com/2008/05/flash-analytics-deep-linking-and-seo.html

You may be interested to read more about interactive video in Flash CS4 as well

http://younsi.blogspot.com/2008/12/interactive-video-in-flash-using-f4v.html

Thursday, June 05, 2008

how to disable intellisense

For those few folks who work with huge source code more than 500 000 line of code and have big project you might want to disable intellisense. Why because
If I try to debug flash while intellisense process is running in the background, it crashes Visual Studio 2005....which force me to wait for intellisense to be complete when i launch my project or anytime intellisense has decided to start processing things again...
Not sure what is the advantage of intellisense... but for those who want to disable it :

In VS 2005 it can be done by renaming or deleting the following file:
\VC\vcpackages\feacp.dll

Or

You can also control IntelliSense through macros, allowing you to enable/disable IntelliSense without restarting VS or renaming files. See this blog article for the macro details: http://blogs.msdn.com/vcblog/archive/2007/11/19/controlling-intellisense-through-macros.aspx

Thursday, April 10, 2008

Pros and cons of automatic update

Pros and cons of automatic update


Lately Microsoft has decided to push Silverlight on Vista SP1 and will certainly do the same things with Microsoft XP SP3. Nothing wrong about that. I have no objection with Automatic update at all since it is a great way to increase user experience but... only if the user has the choice... By combining all there fix in a Service pack they just find a way to update there platform.... When you install a software you can always see the software through the Add Remove Program for instance this is a good practice for stand alone runtime such as Visual Studio Runtime, .Net, Flash Player Active X Control, Air Runtime. But why Microsoft don't give this Option when user install the Service Pack.... Why not offering some component selection to the end user instead of installing a bunch of file with no report of what was really installed. Apple on Mac OSX offer this feature right(give the user a choice ). What i recommend is not to use automatic update or service Pack but rather check for available update and pick the one you really need or want !

Finally what i like with semi automatic update is not to seat in the tray icon and use my CPU but just be invoked by the application who need the service of the updater one time, ask the user.

Rebooting an XP machine and have to wait for udpates is not OPT-IN at ALL !

Tuesday, April 08, 2008

According to University of Utah researchers, using a larger monitor could save you 2.5 hours per day.

This study below suggests that your wall LCD would do wonders in the office. I hear people turn them on the side, for a portrait display, and they can look up and down the monitor at multiple documents.

According to University of Utah researchers, using a larger monitor could save you 2.5 hours per day.

Specifically, test subjects completed everyday tasks like editing documents and massaging spreadsheets 52% faster when using a 24-inch monitor than they did with an 18-incher.

http://www.fourhourworkweek.com/blog/2008/03/15/size-does-matter-bigger-monitors-save-25-hours-a-day/

How to add automatic updater to a null soft installer and the pros and cons of automatic updates

I really think that when it comes to windows installer the most convenient and easy to use installer suite available on the market is nullsoft installer.
To build an installer you only need to write a UTF-8 script using your favorites editor. When it comes to automatic update i really like a software written by a smart guy in Netherland. The updater can be purchase from http://www.catenalogic.com/

Once you get the updater you need to hook the updater into your installer.
To do so you need to provide a way to check for update from the start menu
using a shortcut towards the updater.exe. Your application should also execute the updater as well once in a while (periodic perdiod) or during each startup.

Here is what you need to add to your null soft script to provide a complete end to end update solution to you application.

First you need to compress the updater files and custom graphics such as top banner and left bitmap. Be carefull, the size of the graphics element are very important. One pixel off and you will see the default graphics instead.

!define CLIENT_VERSION "1.0"
!define CLIENT_NAME "MyHelloWorld Sample Application"
!define PRODUCT_NAME "${CLIENT_NAME}"
!define PRODUCT_VERSION "1.0.0.0"
!define SETUP_FILE "setup_1_0.exe"

!define APP_FILE1 "..\files\HelloWorld.exe"
!define UPDATER_FILE1 "..\files\updater.exe"
!define UPDATER_FILE2 "..\files\updaterbanner.bmp"
!define UPDATER_FILE3 "..\files\updaterleft.bmp"


Inside the Installer section of your script
you need to add script code to uncompress and copy the updater files
inside the target program file folder for your application. The one choosen
by the user or set by default under Program Files.

;script start

SetOverwrite ifnewer

CreateDirectory "$PROGRAMFILES\MyApp"

SetOutPath "$PROGRAMFILES\MyApp"

;HelloWorld.exe application file
File "${APP_FILE1}"

;UPDATER FILES TO EXTRACT
File "${UPDATER_FILE1}"
File "${UPDATER_FILE2}"
File "${UPDATER_FILE3}"

;you need to generate and update the settings.ini file
;used by the updater.exe so that the updater will know where to download
;the XML file on the update server. The updater will compare your
;application version set in the ini with the one available on the remote
;server. Because this call is self contain in the installer once you will
;uninstall and install a new version it will automatically update the up to
;date settings.ini

;Update Updater INI file with installation application path and product version
FileOpen $1 "$INSTDIR\settings.ini" w
;FileSeek $1 0 END $INI_SIZE
FileWrite $1 "[UPDATER]$\r$\n"
FileWrite $1 "runmode=full$\r$\n"
FileWrite $1 "logolarge=updaterleft.bmp$\r$\n"
FileWrite $1 "logosmall=updaterbanner.bmp$\r$\n"
FileWrite $1 "customnotification=false$\r$\n"
FileWrite $1 "[UPDATEINFO]$\r$\n"
FileWrite $1 "URL=http://www.yourwebserverforupdate.com/download/HelloWorld/full/update.xml$\r$\n"

;as you see the update.xml will provide a way for updater to get http path
;for update along with command (action) to execute in a chronological order.
;I will post a sample XML file in an other article.

FileWrite $1 "servertimeout=2000$\r$\n"
FileWrite $1 "[APPLICATION]$\r$\n"

StrCpy $KEY "name="
FileWrite $1 $KEY
StrCpy $VALUE "${PRODUCT_NAME}"
FileWrite $1 $VALUE
FileWrite $1 "$\r$\n"

StrCpy $KEY "version="
FileWrite $1 $KEY
StrCpy $VALUE ${CLIENT_VERSION}
FileWrite $1 $VALUE
FileWrite $1 "$\r$\n"

StrCpy $KEY "location="
FileWrite $1 $KEY
StrCpy $VALUE $INSTDIR\HelloWorld.exe
FileWrite $1 $VALUE
FileWrite $1 "$\r$\n"

FileWrite $1 "[PROXY]$\r$\n"
FileWrite $1 "type=autodetect$\r$\n"

FileClose $1

;last things you need to do is to create a shortcut.
;Te cool things with nullsoft when you create a shortcut is that
;it will use the last SetOutPath call as the working directory for your
;shortcut. Alternatively you can specify the path of the settings.ini

StrCpy $STARTMENU_FOLDER "MyHelloWorldApplication"

SetOutPath "$PROGRAMFILES\HelloWorld"
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Check for update.lnk" "$INSTDIR\updater.exe"

In your application code you will launch updater.exe from your application folder.
You can also read a registry key to get a custom path. This registry key will be set by the installer itself.



Finally what i like with semi automatic update is not to seat in the tray icon and use my CPU but just be invoked by the application who need the service of the updater one time, ask the user.



Hope you will find this Null Soft Updater Script for catenalogic useful !

Monday, March 17, 2008

Microsoft has licensed Flash Lite

Microsoft Corp. has licensed Adobe Systems Inc.'s software that lets cell phone users view online videos and other files, the companies said Monday.

Redmond, Wash.-based Microsoft (NASDAQ:MSFT) will distribute San Jose-based Adobe's (NASDAQ:ADBE) Flash Lite and Reader programs through cell phones that use its Windows Mobile software.

Financial terms of the deal were not disclosed, but the programs will be free for users.

Adobe said that more than half a billion mobile devices have shipped with Flash preinstalled, indicating 150 percent growth year over year.

Friday, February 22, 2008

Adobe Media Player

Adobe media player using AIR is out and the user experience is really cool
particully when hooked to a Plasma or LCD TV screen.
Everyone can enjoy playback of H264 and of course HD.

http://labs.adobe.com/technologies/mediaplayer/install/

For a full experience i recommend a Wireless Keyboard such as Apple
http://www.apple.com/keyboard/ or microsoft Wireless Entertainment Desktop 8000

Finally for those who want to encode MPEG2 HD content i recommend the On Air Solution USB adapter

Friday, January 25, 2008

Wurlf and Flash Lite

http://wurfl.admob.com/apache2-default/ts/flashlite/

How to detect Mobile device hitting your Web Server in PHP

by Andrea Trasatti

http://wurfl.sourceforge.net/index.php

PHP is a great platform for WAP development. Thousands of developers worldwide love PHP for its performance and for the semplicity of its model.
It should come as no surprise that some PHP developer quickly built the tools to tap the WURFL power from PHP.

One easy way to play with the WURFL, is to use what I call the "WURFL PHP Library". The package includes the library and some support files such as a readme (I STRONGLY SUGGEST EVERYONE TO READ IT), check_wurfl.php that will let you quickly read all the capabilities of a selected device and update_cache.php which will be better described later.

* wurfl_parser.php: parse the xml and put it in an Array and the other to work with the data collected. Before starting, make sure you have compiled PHP properly ( http://www.php.net/manual/en/ref.xml.php ), wurfl_parser.php uses the basic XML functions implemented compiling with expat.
* wurfl_class.php: this script lets you access the data in the wurfl array (see previous bullet) in an object-oriented fashion.
* wurfl_config.php: with the growing number of possible configurations in the PHP library, I am now introducing a single file for configuration. This should hopefully make it clearer where you need to configure the scripts and maybe also make it easier to integrate it with your central configuration files (if your application has any)


wurfl_parser.php

wurfl_parser.php: This is a VERY simple XML parser that reads WURFL and puts all the needed data into an array. Considering the time the parser was taking to parse the XML, I thought that using some kind of caching mechanism was probably a good idea. This will be discussed more later.
The generated Array is an associative array that looks like this:

$wurfl["devices"]["ericsson_generic"]["fall_back"]="generic";

The first key is "devices". Other possible values such as authors and contributors are probably not so interesting to you.

The second key is the UNIQUE ID assigned to each user agent. All other keys are related to the attributes or groups and capabilities of the device.

Of course, this may seem not so flexible in practice, since devices tell us their user-agent strings, not their WURFL IDs.
This is solved thanks to an additional array called $wurfl_agents, which is simply an associative array of user agents and the relative unique id. This array makes your life much simpler (and your search much faster). $wurfl_agents is cached too.
Let's look at a concrete example. Someone visits you site with, say, a Siemens S45 (user agent: "SIE-S45/24 UP.Browser/5.0"). In order to find the device ID, you would normally be required to cycle most of the $wurfl array and retrieve the ID, before you can look up the actual capabilities.
Thanks to $wurfl_agent, this is as simple as:

if ( in_array($id, $wurfl_agents) ) {
echo "The ID $id is known
\n";
}

Example to search an ID knowing the user agent:

$wurfl_user_agents = array_keys($wurfl_agents);
while ( $x = each($wurfl_user_agents) ) {
if ( $x[1] == $user_agent ) {
return $wurfl_agents($x[1]);
}
}


wurfl_class.php

wurfl_class.php was created to make our life simpler. Once we had the data ready in an array, we needed an easy way to access it and some methods to manipulate it. By looking closely at what had been done with the Java API, I reproduced many of those useful methods in PHP.

The class loads the parser automatically. To load the parser a defined must be set appropriately in the config file.

The class is initialized calling the constructor, wurfl_class and passing two variables that may be empty. The former is the full XML parsed (like the parser does) and the latter is the array of user agents and id's as generated by the parser. Pass two empty variables (or nothing) if you want them to be filled (when needed) or the real values if you already have them. The class will check the values and the cache files (if enabled) and decide what to do. Also check your configuration, because the behaviour will change.
Use the public method GetDeviceCapabilitiesFromAgent() passing the user agent to make the class search for the best fit and fill the object's properties. Once again, what the class does depends on your configuration, if you enabled cache files and so on.
Once you have instantiated the object and passed a user agent you may use all the class' methods.
Here is a list of properties:

$wurfl_class->_wurfl is the WURFL array (all of it)

$wurfl_class->_wurfl_agents is the associative array made of the user agents
and unique id's

$wurfl_class->user_agent the visitor's user agent

$wurfl_class->wurfl_agent the WURFL's best fitting user agent

$wurfl_class->id the corresponding id

$wurfl_class->GUI true if the device supports Openwave's GUI
extensions

$wurfl_class->browser_is_wap true if the device is WAP capable. It is here
only for legacy support, you should use the
is_wireless_device capability from WURFL.
browser_is_wap now has the same value as the
capability, when found. If you want to take full
advantage of this capability you should download
the web patch from the WURFL site or CVS!
$wurfl_class->capabilities the array of device's capabilities

Note: PHP (up to version 4.3) does not have any distinction between private and public methods. In the wurfl_class implementation, I named all private methods with a leading underscore to distinguish them from public methods without the underscore. If you are interested in knowing the details, just open the class, there are beautiful JAVADOC-like comments for each variable and method.
These libraries don't require register_globals anymore (from version 2 and up), but will not work with versions before 4.1.

wurfl_class($wurfl, $wurfl_agents) is the constructor. Built to work
best with the wurfl_parser.

GetDeviceCapabilitiesFromAgent($ua) given a user agent it will search WURFL
for the best fit

getDeviceCapability($capability) given a capability it will tell you the
value. Remember that capabilities might be string,
integer or boolean.

wurfl_config.php

The scope of this file is straight forward, modify it at your wish to configure the library to act as you like it best.
Please check the paragraph about caching for more info about cache files.
Here is a quick explanation of all the fields:

WURFL_CONFIG boolean, this is set to true by default, it's used as a simple
check to make sure the configuration was included. Add this to your
configuration files if you won't use wurfl_config.php, otherwise just
leave it as it is

DATADIR string, where all data is stored (wurfl.xml, cache file, logs, etc)

WURFL_FILE string, full path and filename of wurfl.xml

WURFL_PARSER_FILE string, full path and filename of wurfl_parser.php

WURFL_CLASS_FILE string, full path and filename of wurfl_class.php

WURFL_USE_CACHE boolean, true if you want to use a cache file (strongly
suggested). If only this parameter is set to true will be used
cache.php.

WURFL_USE_MULTICACHE boolean, true if you want to use Multicache files
instead of a single BIG cache file (cache.php)

MULTICACHE_DIR string, used only if you enabled Multicache, defines where
the cache files will be stored. WARNING: while cache.php will grow
in size but remain a single file, here the files will grow in
number. Expect more than 5000 tiny files.

MULTICACHE_SUFFIX string, suffix for the files generated using Multicache.
Useful if you use a caching system and don't want to load your
shared memory with a ton of tiny files.

CACHE_FILE string, with full path and filename of the cache file to use
(refreshed when a new WURFL is found, if WURFL_CACHE_AUTOUPDATE is
set to true)

WURFL_CACHE_AUTOUPDATE boolean, tells the class to automatically update the
cached files with a new XML is found. This is NOT suggested when
using MULICACHE because of the high number of files to be updated.
Race conditions are highly possible to happen. The use of
update_cache.php is strongly suggested for production
environments

WURFL_PATCH_FILE string, optional patch file for WURFL

WURFL_AGENT2ID_FILE string, used by wurfl_class.php. Used only when
WURFL_USE_CACHE is set to true

MAX_UA_CACHE integer, max number of user agents to store in
WURFL_AGENT2ID_FILE. Too high limits might give the opposite effect.

WURFL_LOG_FILE string, defines full path and filename for logging

LOG_LEVEL integer, desired logging level. Use the same constants as for PHP
logging

WURFL_AUTOLOAD boolean, true if you want the XML to be loaded at every
startup. If not, the XML will be loaded when needed.


Caching

Considering how slow PHP can be when parsing a big XML file, caching was a must.
Currently there are two caching systems. The older is activated when setting WURFL_USE_CACHE to true and uses DATADIR to store its files. The concept is quite simple, dump the array generated by the parsers in a big file, by default called cache.php (set by the define CACHE_FILE). In this file we also store the array called $wurfl_agents and a timestamp, useful to check if a new XML was deployed.
This system is very simple in its concept and worked well for quite some time. Considering the big size that cache.php was reaching it became a need (and in fact I always strongly suggested it) to use a caching system at PHP-level, such as Zend Accelerator, Turck cache, APC 2.0. Using such tools lets you store the cache file (cache.php) into shared memory and provides really good performances from the third hit on (first hit the XML is parsed: slow, second hit the cache is stored in shared memory: slow, third hit and on the cache is read from the shared memory: fast!).

The new caching system was dubbed "multicache" because instead of generating a single big cache file it generates 1 cache file for every device in WURFL. For this reason you will need to create a directory for this (or at least this is suggested) because the library will generate about 6000 tiny files when this feature is activated.
To activate the multicache system you will need to set WURFL_USE_CACHE to true.
CACHE_FILE will still be used, but the file will only contain the array $wurfl_agents and the timestamp.
Also set WURFL_USE_MULTICACHE to true, set the appropriate path for MULTICACHE_DIR, an absolute path is suggested. Don't forget the ending slash (for example '/tmp/cache/multicache/').
MULTICACHE_SUFFIX should be left unchanged in most cases. This will define the extension of the tiny files. You might want to set some strange extension if you want to avoid that those files are cached in shared memory by any PHP-cache, for example. Change it only if you know what you're doing!
The multicache system provides a MUCH faster data retrival, files are smaller and so it will take a way less time to read them. This will also mean a higher I/O on your system, consider returning to the older cache system if you have problems. Generating many tiny files also involves possible race conditions if a new XML is deployed and the library is configured to update automatically the cache. Read on for more info.

If WURFL_CACHE_AUTOUPDATE is set to true the library (specifically wurfl_class.php) will check the timestamp in cache.php against the file mtime of wurfl.xml. If the XML is newer than the cache it is reloaded. This is not suggested for production environments, if you have many concurrent hits you might have more than one process trying to refresh the same cache wasting a lot of resources. If you would like to avoid this you can set the automatic update to false and use the 'ad hoc' script called update_cache.php. This script was created to be called from command line (or a hidden URL if you'd like, but the command line is suggested when available) and force a cache update. This way the cache update will be prepared and the file will be changed at the very last second saving a lot of resources and having a single process do it. On sites with MANY hits you might also consider preparing the cache files on a separated system and moving them to the production server at once. There isn't a sccript to do this automatically at this time, but the new update_cache.php is already a step in that direction.

When setting WURFL_USE_CACHE to true you also enable another simple caching system (active both when using standard cache and multicache). When a user agent hits your site, this will most likely hit it again a few times. It would be stupid to search for all its capabilities at every second hit. For this reason we store the user agent and its capabilities in a file named after the value set in WURFL_AGENT2ID_FILE, this will make every second hit A LOT faster.
Storing all the user agents hitting your site will end up having a second full cache file and the benefit would reach zero. For this reason you can define a limit of user agents stored using MAX_UA_CACHE. The "perfect" value will change depending on your server's performances on the variety of user agents visiting your site and so on. A good number is between 30 and 50. I suggest you to start with 30 and maybe check the logs and see how often the cache is cleaned of the elder user agents and how often a user agent that is still visiting your site is cleaned and researched.

It's a direct consequence of the cache system that you will not need to read the entire XML and parse it every time you start the wurfl object. You may still want to force this for debug reasons for example. You can do this setting to true the define named WURFL_AUTOLOAD. If you are using any of the caching systems, I suggest you to disable this. If you're not using any cache, the XML will be loaded anyway, so just set this to true, if you'd like.


Logging

While logging is out of the scope of the WURFL PHP Libraries and I suggest you to integrate the libraries with your logging system (if you have any), a basic logging feature is included. This should work fine on Linux, Solaris and Windows.
Logging is done on a file as configured with WURFL_LOG_FILE. The log level is defined following the PHP contants and using the define named LOG_LEVEL. It used to be buggy in previous releases, check out how it has changed and it is now supposed to work properly. When set with the highest level the library might generate a log of logs.
Logs should anyway give you all the info you might need. This is a sample log when set at the highest detail level:

[LuckyTitan.local 327][constructor] Class Initiated
[LuckyTitan.local 327][GetDeviceCapabilitiesFromAgent] searching for SonyEricssonZ600/R601
[LuckyTitan.local 327][_cacheIsValid] cache file is outdated
[LuckyTitan.local 327][GetDeviceCapabilitiesFromAgent] cache enabled, WURFL is not loaded, now loading
[LuckyTitan.local 327][GetDeviceCapabilitiesFromAgent] loading WURFL from XML
[LuckyTitan.local 327][parse] No XML patch file defined
[LuckyTitan.local 327][GetDeviceCapabilitiesFromAgent] Searching in the agent database
[LuckyTitan.local 327][_GetFullCapabilities] searching for sonyericsson_z600_ver1_subr601
[LuckyTitan.local 327][_GetDeviceCapabilitiesFromId] reading id:sonyericsson_z600_ver1_subr601
[LuckyTitan.local 327][_GetDeviceCapabilitiesFromId] I have it in wurfl_agents cache, done

Wednesday, December 19, 2007

How to detect if Visual Studio 2005 SP1 is installed on Windows

If you don't need to be specific about a particular Visual Studio 2005 SKU, you can detect SP1 for a particular written language (for VSTS and TFS) or for a particular project language (for Express SKUs) using an older registry key under,

HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components\{PatchCode}

You can find the {PatchCode} in the .msp file. In Windows 2003 and earlier platforms, you'll see this as the Revision number property in the properties Summary tab in Windows Explorer. In all cases, you can query the Summary Information stream or open the .msp file in Orca, then click the View -> Summary Information menu item.

For the English Visual Studio 2005 Service Pack 1 for Standard, Professional, and Team editions (VS80sp1-KB926601-X86-ENU) an example of the registry key above follows.

HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components\{D93F9C7C-AB57-44C8-BAD6-1494674BCAF7}

You can also determine the service pack level of a more general, larger scope by reading a REG_DWORD registry value named SP from under,

HKEY_LOCAL_MACHINE\Software\Microsoft\DevDiv\[ProductFamily]\Servicing\8.0

…and for a specific language SKU using a sub-key,

HKEY_LOCAL_MACHINE\Software\Microsoft\DevDiv\[ProductFamily]\Servicing\8.0\[ProductEdition]\[ProductLanguage]

Product families are pretty broad in scope, and include for "Whidbey":

URT (.NET Framework, once known as the Universal Runtime)
VB (Microsoft Visual Basic 2005 Express)
VC (Microsoft Visual C++ 2005 Express)
VCS (Microsoft Visual C# 2005 Express)
VJS (Microsoft Visual J# 2005 Express)
VNS (Microsoft Visual Web Developer 2005 Express)
VS (Visual Studio 2005 Standard, Professional, Team Suite, etc.)
VSTF (Visual Studio 2005 Team Foundation Services)
An example using the English Visual Studio 2005 Team Suite Service Pack 1 of the registry keys above follows. Under each key you would find a registry value named SP set to 1.

HKEY_LOCAL_MACHINE\Software\Microsoft\DevDiv\VS\Servicing\8.0
HKEY_LOCAL_MACHINE\Software\Microsoft\DevDiv\VS\Servicing\8.0\VSTS\1033

Visual Studio 2005 Express SKUs will always use the ProductEdition of EXP, so you can combine the ProductFamily values documented above with EXP to form registry keys like the following, for Visual C# 2005 Express.

HKEY_LOCAL_MACHINE\Software\Microsoft\DevDiv\VCS\Servicing\8.0
HKEY_LOCAL_MACHINE\Software\Microsoft\DevDiv\VCS\Servicing\8.0\EXP\1033

Sunday, December 16, 2007

Locking header control in MFC to prevent the column to be resized

The way to prevent sizing is to eat this notification (without passing it to the header control), but as with many other Windows® messages and notifications, HDN_BEGINTRACK comes in two flavors: HDN_BEGINTRACKW (wide-character, Unicode) and HDN_BEGINTRACKA (ANSI). The "neuter" symbol is #defined to one or the other of these, based on the value of UNICODE defined in your project, as shown here:

// From commctrl.h
#ifdef UNICODE
#define HDN_BEGINTRACK HDN_BEGINTRACKW
#else
#define HDN_BEGINTRACK HDN_BEGINTRACKA
#endif


So when you implement a handler for HDN_BEGINTRACK, you're actually implementing it for HDN_BEGINTRACKA or HDN_BEGINTRACKW, depending on the value of UNICODE. But which message does the header control actually send? Remember, the header control is part of Windows, one of the common controls in comctl32.dll. Since the DLL is already compiled into executable code, changing the value of UNICODE in your project has absolutely no effect on its operation. How does the header control know which flavor of notification to send—A or W?

The answer lies in an oft-forgotten message, WM_NOTIFYFORMAT. When a control is first created, it sends a message to its parent, in effect asking, "do you want ANSI or Unicode notifications?" The parent responds with NFR_ANSI or NFR_UNICODE. If the parent doesn't handle WM_NOTIFYFORMAT, the Windows DefWindowProc responds based on the preference of the parent window or dialog itself. The default is Unicode. So I suspect the reason you had no luck trapping HDN_BEGINTRACK is that you compiled an ANSI program without handling WM_NOTIFYFORMAT. Your application is looking for HDN_BEGINTRACKA (ANSI) while the header control is sending HDN_BEGINTRACKW (Unicode).

One way to fix the problem is to implement a WM_NOTIFYFORMAT handler for your list control, one that returns NFR_ANSI. When I tried this, the header control did indeed send HDN_BEGINTRACKA and I was able to prevent sizing. But using NFR_ANSI broke other features. For example, the list control no longer repaints its columns while sizing.

A simpler, more reliable way to prevent sizing header columns is to implement handlers for both HDN_BEGINTRACKA and HDN_BEGINTRACKW. This not only obviates the need to process WM_NOTIFYFORMAT, it lets your code work in both ANSI and Unicode modes.



The header control sends HDN_XXX notifications to the parent (list control) window, but when using MFC you can use message reflection to handle the notifications in the header itself. Since the "lockable columns" feature is more a property of the header than the list control, this is the approach I chose. If you're not using MFC, you'll have to handle these notifications in the list control. To do message reflection, you can use ON_NOTIFY_REFLECT in your header control's message map or simply override the virtual function OnChildNotify, as shown here:

BOOL CLockableHeader::OnChildNotify(
UINT msg, WPARAM wp, LPARAM lp, LRESULT* pRes)
{
NMHDR& nmh = *(NMHDR*)lp;
if (nmh.code==HDN_BEGINTRACKW || nmg.code==HDN_BEGINTRACKA)
return *pRes=TRUE;
•••
}


Since OnChildNotify is virtual, there's no need for message map entries. All you have to do is implement it. In any given application, the header will send one or the other, not both. Either way, CLockableHeader eats the notification—that is, returns TRUE (handled) without passing on to the default header control. CLockableHeader controls locking through a flag m_bLocked which the app can set by calling CLockableHeader::Lock.

If you're going to prevent sizing, you should also disable the size cursor. Otherwise users may think your app is either broken or lame. Fortunately, it's trivial:

BOOL
CLockableHeader::OnSetCursor(
CWnd* pWnd, UINT nHit, UINT msg)
{
return m_bLocked ? TRUE :
CHeaderCtrl::OnSetCursor(pWnd, nHit, msg);
}


In other words: if the columns are locked, OnSetCursor returns TRUE without setting the cursor; otherwise, let the header control do its size cursor thing. Now when the columns are locked, Windows displays its standard arrow cursor instead of displaying the left-right sizing cursor.

Once you've implemented your custom header control by deriving from CHeaderCtrl, how do you get Windows to use it? The same way you would for any dialog control, by subclassing. The right place is in the parent window's OnCreate handler:

// CMyView is derived from CListView
int CMyView::OnCreate(LPCREATESTRUCT lpcs)
{
VERIFY(CListView::OnCreate(lpcs)==0);
return m_header.SubclassDlgItem(0,this) ? 0 : -1;
}


This works because the header control always has ID = 0. With all this in place, the only thing left to do is implement the command and UI update handlers for the View | Lock Columns command.

Sunday, December 02, 2007

How lucky you are if you read this text

Docteur Phillip M Harter, Professeur à l'école de Médecine de l'Université de Stanford .

Si on pouvait réduire la population du monde en un village de 100 personnes tout en maintenant les proportions de tous les peuples existants sur la Terre, ce village serait ainsi composé :

57 asiatiques,

21 européens,

14 américains (Nord, Centre et Sud)

8 africains.

Il y aurait :

52 femmes et 48 hommes

30 blancs et 70 non blancs

30 chrétiens et 70 non chrétiens

89 hétérosexuels et 11 homosexuels

6 personnes posséderaient 59% de la richesse totale et tous les 6 seraient américains

80 vivraient dans des maisons vétustes

70 seraient analphabètes

50 souffriraient de malnutrition

1 serait en train de mourir

1 serait en train de naître

1 posséderait un ordinateur

1 (oui, un seulement) aurait un diplôme universitaire

Si on considère le monde de cette manière, le besoin d'accepter et de comprendre devient évident.

Prenez en considération aussi ceci :

Si vous vous êtes levé ce matin avec plus de santé que de maladie, vous êtes plus chanceux que le million de personnes qui ne verra pas la semaine prochaine.

Si vous n'avez jamais été dans le danger d'une bataille, la solitude de l'emprisonnement, l'agonie de la torture, l'étau de la faim, vous êtes mieux que 500 millions de personnes.

Si vous pouvez aller à l'église ou dans un temple sans peur d'être menacé, torturé ou tué, vous avez plus de chance que 3 milliards de personnes.

Si vous avez de la nourriture dans votre réfrigérateur, des habits sur vous, un toit sur votre tête et un endroit pour dormir, vous êtes plus riche que 75% des habitants de la Planète.

Si vous avez de l'argent à la banque, dans votre portefeuille ou de la monnaie dans une petite boite, vous faite partie des 8% les plus privilégiés du monde.

Si vos parents sont encore vivants et toujours mariés, vous êtes des personnes réellement rares.

Si, enfin, vous lisez ce message, vous venez de recevoir un double cadeau parce que quelqu'un a pensé à vous et parce que vous ne faites pas partie des deux milliards de personnes qui ne savent pas lire...

Monday, November 26, 2007

How to create a def file for a dll

you can still create a def file using the output from the objdump program (from the MinGW distribution). Here's an example.

objdump -p mydll.dll > mydll.fil

Search for "[Ordinal/Name Pointer] Table" in mydll.fil and use the list of functions following it to create your def file.

Wednesday, November 21, 2007

Upload Video to Youtube

I am finally on the verge to integrate a youtube uploader tool to one of my side project. I just need to figure out how to log to gmail instead of youtube since there is two ways to authenticate with youtube.

About youtube :

When you upload a video to YouTube, it automatically converts it to a flash video file (.flv) with specific settings (see below, standard column). The contrast of the video is increased and video noise is suppressed. YouTube appears to respect the framerate of the uploaded file; Framerates will varie between 15 (minimum framerate to tell it is a video...), 24 frames (pal) and 30 frames per second (ntsc with no drop frame). It is hard to tell how long you have to wait for the video to be available but it is pretty fast !!. Once the video has been uploaded you can log to your account and from there you can check the status of your video. Usually you will see Uploaded (processing, please wait).


Video Profile

standard recommended possible
file extension : .flv (flash video)
total bitrate : ~320 kbits/sec 804.7 kbits/sec 2147.2 kbits/sec
audio codec : MPEG layer 3 (MP3)
audio format : Mono, 22.050 kHz Stereo, 44.100 kHz Stereo, 44.100 kHz
audio bitrate : ~67 kpbs/sec 128 kpbs/sec 128 kpbs/sec
video codec : Sorenson Spark (H.263)
video format : 320 x 240 px, 15-30 fps 320 x 240 px, 29.97 fps 640 x 480 px, 29.97 fps
video bitrate : ~250 kbps/sec 677.7 kbps/sec 2019.2 kbps/sec

You can save your own .flv files and upload them to YouTube. You can encode video with higher bitrates and resolution than YouTube compresses with. The only limitations I can tell are that the file must be under 100 MB and you must use the Sorenson Spark video codec and MP3 audio codec.

Monday, November 19, 2007

How to take advantage of Silverlight Marker to create hypervideo

Interesting article from Jesse Liberty also i worked on Hypervideo back in 1999.... Silverlight is finally well suited to turn HD video into interactive sequences.

http://silverlight.net/blogs/jesseliberty/archive/2007/10/24/hypervideo-2.aspx

Wednesday, November 14, 2007

silent install of the VC 8.0 runtime (vcredist) packages

if you have downloaded the standalone VC 8.0 redistributable packages, you will need to modify the command lines slightly. The following command lines can be used to install the original release of the standalone VC 8.0 redistributable packages:

For x86: vcredist_x86.exe /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
For x64: vcredist_x64.exe /q:a /c:"VCREDI~2.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
For ia64: vcredist_ia64.exe /q:a /c:"VCREDI~3.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
The following command lines can be used to install the Visual Studio 2005 SP1 release of the standalone VC 8.0 redistributable packages:

For x86: vcredist_x86.exe /q:a /c:"VCREDI~3.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
For x64: vcredist_x64.exe /q:a /c:"VCREDI~2.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
For ia64: vcredist_ia64.exe /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
If you would like to install the VC runtime packages in unattended mode (which will show a small progress bar but not require any user interaction), you can change the /qn switch above to /qb. If you would like the progress bar to not show a cancel button, then you can change the /qn switch above to /qb!

Some folks ask me what vcredist.msi..
Iy means that you want to extract the embedded msi from the self exe package and be able to run msiexec which is used to install the package. msiexec is the Microsoft Installer runtime.
MSI is the prefered format for microsoft installer. Installshield and Visual Studio 2005 and higher can generate MSI. Using the msiexec command. You can even log all the installer session to a file and you can verify and explore the content of the MSI using ORCA in order to look at the installer sequence, string table and in some cases embedded Visual Basic Script. Yes Visual Basic is not dead. Still used and convnient enough for scripting installer code :)

If you want to install the runtime from a Null Soft Installer NSI script with minimal UI and progress bar, here is what you want to do

;extract selft exe to temp
SetOutPath "$TEMP"
; uncompress
File "${RUNTIME_VCREDIST}"



;-------------------------------
; Test if Visual Studio Redistributables 2005+ SP1 installed
; Returns -1 if there is no VC redistributables intstalled
Function CheckVCRedist
Push $R0
ClearErrors
ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7299052b-02a4-4627-81f2-1818da5d550d}" "Version"

; if VS 2005+ redist SP1 not installed, install it
IfErrors 0 VSRedistInstalled
StrCpy $R0 "-1"

VSRedistInstalled:
Exch $R0
FunctionEnd


Section "Installer Sections" SecDummy
SetOverwrite ifnewer
Call CheckVCRedist

;IntCmp $0 5 is5 lessthan5 morethan5
IntCmp $R0 -1 noVCRuntime noVCRuntime VCRuntime
;force install
; IntCmp $R0 -1 noVCRuntime noVCRuntime noVCRuntime

noVCRuntime:


;extract VCRuntime to Temp
SetOutPath "$TEMP"
File "${RUNTIME_VCREDIST}"

;/qn for complete silent install
;/qb small progress dialog but does not require any user interaction
;StrCpy $VC_RUNTIME "$\"$TEMP\vcredist_x86.exe$\" /q:a /c:$\"VCREDI~3.EXE /q:a /c:$\"$\"msiexec /i vcredist.msi /qb!$\""
StrCpy $VC_RUNTIME "$\"$TEMP\vcredist_x86.exe$\" /q:a"

;MessageBox MB_ICONINFORMATION 'Need to install VCRuntime {$R0} {$VC_RUNTIME}'

ExecWait '$VC_RUNTIME' $0
;MessageBox MB_ICONINFORMATION 'Return Code {$0}'
;IntCmp $0 0 done

;MessageBox MB_ICONINFORMATION 'install complete'

Delete "$TEMP\vcredist_x86.exe"

Goto VCRuntime

VCRuntime:

SectionEnd


http://blogs.msdn.com/astebner/archive/2007/02/07/update-regarding-silent-install-of-the-vc-8-0-runtime-vcredist-packages.aspx

Sunday, November 11, 2007