Posts filed under ‘Uncategorized’
My Grandfather’s Recollections as Grand Jury Member that Indicted Clay Shaw on the Assignation of John F Kennedy
Before he died, on one of my yearly pilgrimages back to my home town (New Orleans), my grandfather gave me this document along with all his historical and personal memorabilia.
First page sample of the above document:
April 21, 2017
intalling watir headless chrome on Ubuntu 16
apt-get update
apt-get install ruby
apt-get install ruby-dev
apt-get install xvfb
gem install watir
gem install headless
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
apt-get update
apt-get install google-chrome-stable
apt-get install unzip
wget -N http://chromedriver.storage.googleapis.com/2.26/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
chmod +x chromedriver
echo $PATH
mv chromedriver /usr/local/sbin/
March 18, 2017
Using QtCreator for generic c and c++ projects
QtCreator is an excellent IDE and it works great for generic c and c++ projects. There is no need to use Qt libraries at all when using QtCreator. Here is a sample template for a non-Qt program. The c_template.pro file specifies the project and explicitely removes any linkage to Qt libraries. QtCreator typically finds the native gcc/g++ compiler by default.
June 18, 2014
WPF 3D Video Example using DiffuseMaterial and MediaElement
This was supposed to be so easy according to the books and examples provided by microsoft. Just add a MediaElement and specify the video source. Only it took me 6 hours to figure out what I got nothing on the screen but no errors reported. Additionally, when I implemented this with a media player class and called its “hasVideo()” method, the method always returned false. I tried half a dozen video files I had, re-converted the codecs and containers to all the popular formats, and still no video. But it always played just fine with the windows media player stand-alone application. I finally stumbled on the solution : my video’s were non-standard sizes. This only works with (I am guessing) standard width by height formatted videos, such as 720×480, as opposed to something like 854×480 which was one of my videos. So I used ffmpeg to crop my videos down to standard sizes and now its as easy as it supposed to be.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<ModelVisual3D> <ModelVisual3D.Content> <GeometryModel3D x:Name="video1"> <GeometryModel3D.Geometry> <!-- position lowerleft, lower-right, upper-right, upper-left --> <MeshGeometry3D Positions="-20 0 0 -10 0 0 -10 2 -15 -20 2 -15" TriangleIndices="0 1 2 0 2 3" TextureCoordinates=" 0,1 1,1 1,0 0,0" /> </GeometryModel3D.Geometry> <GeometryModel3D.Material> <DiffuseMaterial> <DiffuseMaterial.Brush> <VisualBrush> <VisualBrush.Visual> <MediaElement Name="VideoControl" Width="200" Height ="400" Source="s:\david\projects\vs_3d_surface\movie.mpg" > </MediaElement> </VisualBrush.Visual> </VisualBrush> </DiffuseMaterial.Brush> </DiffuseMaterial> </GeometryModel3D.Material> </GeometryModel3D> </ModelVisual3D.Content> </ModelVisual3D> |
The code-behind C# method of using a media player object. diffuseMat is the x:Name given to the DiffuseMaterial object in the xaml code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
videoUri = new Uri("S:/david/projects/vs_3d_surface/video.mpg", UriKind.Absolute); mp = new MediaPlayer(); mp.Open(videoUri); vd = new VideoDrawing(); vd.Player = mp; Console.WriteLine("has video: "); Console.WriteLine(Convert.ToString (mp.HasVideo)); Console.WriteLine("width: "+Convert.ToString(mp.NaturalVideoWidth)); Console.WriteLine(", height: "+Convert.ToString(mp.NaturalVideoWidth)); db = new DrawingBrush(); db.Drawing = vd; diffuseMat.Brush = db; vd.Player.Play(); |
February 18, 2013
David’s Principles of Software Development
1. Have extremely well understood goals for the software functionality.
2. Have a robust design upfront – even if that means prototyping first, discarding the prototype, then designing.
3. Each developer has a chunk of functionality he owns. Each developer is associated with a functional module. A development team is associated with large product or large library.
4. Have well defined interfaces between modules and hence between developers.
5. Avoid meaningless and ridiculous schedules – they are huge de-motivators.
6. Have an architect that supervises the design and does little to no coding.
September 1, 2012