Phil 5.29.13

8:00 – 1:00 SR

  • Backups
  • There was a demo today! Was invited in towards the end to talk about data security and roles.
  • Had a good idea about how to run the PA/RA code on one of our (Dreamhost? Steadfast?) servers and let the labs input their data directly. We could then ingest the data nightly. Need to research this a bit.

1:00 – 4:00 FP

  • Finished rolling up the SampleSounds(s) into BasicAudio.
  • Starting on 3D audio, using How to: Integrate X3DAudio with XAudio2
    • Adding the 3D calls to the main() in ConsoleSound2, just after the BasicAudio class has been initialized.
    • Had to add x3daudio.lib to the project and <x3daudio.h> to the #includes.
    • This looks to be the meat of the calculation. It looks like X3DCalculate() works on the relative position of an Emitter and the Listener and uses that to populate a DSP. Once that’s done, then the Audio2 source is manipulated appropriately.
    •         X3DAudioCalculate( g_audioState.x3DInstance, &g_audioState.listener, &g_audioState.emitter, dwCalcFlags,
                                 &g_audioState.dspSettings );
      
              IXAudio2SourceVoice* voice = g_audioState.pSourceVoice;
              if( voice )
              {
                  // Apply X3DAudio generated DSP settings to XAudio2
                  voice->SetFrequencyRatio( g_audioState.dspSettings.DopplerFactor );
                  voice->SetOutputMatrix( g_audioState.pMasteringVoice, INPUTCHANNELS, g_audioState.nChannels,
                                          g_audioState.matrixCoefficients );
      
                  voice->SetOutputMatrix(g_audioState.pSubmixVoice, 1, 1, &g_audioState.dspSettings.ReverbLevel);
      
                  XAUDIO2_FILTER_PARAMETERS FilterParametersDirect = { LowPassFilter, 2.0f * sinf(X3DAUDIO_PI/6.0f * g_audioState.dspSettings.LPFDirectCoefficient), 1.0f }; // see XAudio2CutoffFrequencyToRadians() in XAudio2.h for more information on the formula used here
                  voice->SetOutputFilterParameters(g_audioState.pMasteringVoice, &FilterParametersDirect);
                  XAUDIO2_FILTER_PARAMETERS FilterParametersReverb = { LowPassFilter, 2.0f * sinf(X3DAUDIO_PI/6.0f * g_audioState.dspSettings.LPFReverbCoefficient), 1.0f }; // see XAudio2CutoffFrequencyToRadians() in XAudio2.h for more information on the formula used here
                  voice->SetOutputFilterParameters(g_audioState.pSubmixVoice, &FilterParametersReverb);
              }

Dong Shin 05.29.2013

  • continue working on FA/RA
    • few bugs from today
      • inconsistent display of parent/children projects list in Project Management fixed
      • parent/child connection is broken, child/parent looks fine fixed
      • Total Project Budget datagrid shrinks (scrollbar) after saving project
      • SQL error when saving projects with sub projects
      • Totals for parent/sub projects not adding up correctly
    • getting Projects View to work with the new database structure….
    • working on Status View – done!
    • working on Line Item View
    • query to get status for projects requisition data
      • SELECT p.center_name, p.center_number, p.capability, p.appropriation, p.type, c.*, 0 as a_uid, c.total_budget as amount, o.year, o.year_count, r.duration, o.uid as o_uid,
        IF (c.total_budget = 0 OR o.year + o.year_count – 1 > 2013, ‘IGNORE’, (IF(SUM(IF(ISNULL(month_1), 1, 0)) >= 4, ‘OVERDUE’, IF(SUM(IF(ISNULL(month_1), 1, 0)) > 0, ‘INCOMPLETE’, ‘CURRENT’)))) as month_1_status,
        IF (c.total_budget = 0 OR o.year + o.year_count – 1 > 2013, ‘IGNORE’, (IF(SUM(IF(ISNULL(month_2), 1, 0)) >= 4, ‘OVERDUE’, IF(SUM(IF(ISNULL(month_2), 1, 0)) > 0, ‘INCOMPLETE’, ‘CURRENT’)))) as month_2_status,
        IF (c.total_budget = 0 OR o.year + o.year_count – 1 > 2013, ‘IGNORE’, (IF(SUM(IF(ISNULL(month_3), 1, 0)) >= 4, ‘OVERDUE’, IF(SUM(IF(ISNULL(month_3), 1, 0)) > 0, ‘INCOMPLETE’, ‘CURRENT’)))) as month_3_status,
        IF (c.total_budget = 0 OR o.year + o.year_count – 1 > 2013, ‘IGNORE’, (IF(SUM(IF(ISNULL(month_4), 1, 0)) >= 4, ‘OVERDUE’, IF(SUM(IF(ISNULL(month_4), 1, 0)) > 0, ‘INCOMPLETE’, ‘CURRENT’)))) as month_4_status,
        IF (c.total_budget = 0 OR o.year + o.year_count – 1 > 2013, ‘IGNORE’, (IF(SUM(IF(ISNULL(month_5), 1, 0)) >= 4, ‘OVERDUE’, IF(SUM(IF(ISNULL(month_5), 1, 0)) > 0, ‘INCOMPLETE’, ‘CURRENT’)))) as month_5_status,
        IF (c.total_budget = 0 OR o.year + o.year_count – 1 > 2013, ‘IGNORE’, (IF(SUM(IF(ISNULL(month_6), 1, 0)) >= 4, ‘OVERDUE’, IF(SUM(IF(ISNULL(month_6), 1, 0)) > 0, ‘INCOMPLETE’, ‘CURRENT’)))) as month_6_status,
        IF (c.total_budget = 0 OR o.year + o.year_count – 1 > 2013, ‘IGNORE’, (IF(SUM(IF(ISNULL(month_7), 1, 0)) >= 4, ‘OVERDUE’, IF(SUM(IF(ISNULL(month_7), 1, 0)) > 0, ‘INCOMPLETE’, ‘CURRENT’)))) as month_7_status,
        IF (c.total_budget = 0 OR o.year + o.year_count – 1 > 2013, ‘IGNORE’, (IF(SUM(IF(ISNULL(month_8), 1, 0)) >= 4, ‘OVERDUE’, IF(SUM(IF(ISNULL(month_8), 1, 0)) > 0, ‘INCOMPLETE’, ‘CURRENT’)))) as month_8_status,
        IF (c.total_budget = 0 OR o.year + o.year_count – 1 > 2013, ‘IGNORE’, (IF(SUM(IF(ISNULL(month_9), 1, 0)) >= 4, ‘OVERDUE’, IF(SUM(IF(ISNULL(month_9), 1, 0)) > 0, ‘INCOMPLETE’, ‘CURRENT’)))) as month_9_status,
        IF (c.total_budget = 0 OR o.year + o.year_count – 1 > 2013, ‘IGNORE’, (IF(SUM(IF(ISNULL(month_10), 1, 0)) >= 4, ‘OVERDUE’, IF(SUM(IF(ISNULL(month_10), 1, 0)) > 0, ‘INCOMPLETE’, ‘CURRENT’)))) as month_10_status,
        IF (c.total_budget = 0 OR o.year + o.year_count – 1 > 2013, ‘IGNORE’, (IF(SUM(IF(ISNULL(month_11), 1, 0)) >= 4, ‘OVERDUE’, IF(SUM(IF(ISNULL(month_11), 1, 0)) > 0, ‘INCOMPLETE’, ‘CURRENT’)))) as month_11_status,
        IF (c.total_budget = 0 OR o.year + o.year_count – 1 > 2013, ‘IGNORE’, (IF(SUM(IF(ISNULL(month_12), 1, 0)) >= 4, ‘OVERDUE’, IF(SUM(IF(ISNULL(month_12), 1, 0)) > 0, ‘INCOMPLETE’, ‘CURRENT’)))) as month_12_status,
        0 as funded_budget,
        0 as funded_budget_flag,
        ‘contract number’ as contracts
        FROM budget_centers c, obligations_outlays o, appropriations r, projects p
        WHERE p.uid = 3 AND c.project_id = p.uid AND c.uid = o.funding_id AND p.appropriation = r.type
        AND o.type <> ‘Reported Outlay $:’ AND o.type <> ‘Outlay $ (Reported in FACTS)’
        GROUP BY c.uid, o.year, o.year_count
        ORDER BY c.uid, o.year, o.year_count

Phil 5.28.13

8:00 – 10:30 SR

  • Backups

10:30 – 4:00 FP

  • Comments on Ravi’s proposal
  • Working on getting multi buffer support. Done! Also got repeating sound working.
  • Going to put a basic Audio class together to manage SampleSounds.

Phil 5.24.13

7:30 – 11:00 SR

  • Backups. And to make sure that it’s possible to see the results of the db backup script, I added in a “pause.exe” at the end of the batch file.
  • Deployed the new FA and RA
  • RA was taking a *long* time to start up. It turns out that the reason was that there were 17,000 alerts that were going into a DataGrid. The temporary fix was to delete the old alerts, but there needs to be a mechanism for determining/limiting what to show.

11:00 – 4:30FP

  • Building a copy of XAudio2BasicSound, cleverly calling ConsoleSound2.
  • Since it depends on SDKwavefile, I had to pull SAFE_DELETE, SAFE_DELETE_ARRAY, and SAFE_RELEASE from dxut.h. It also requires dxerr.h. but that’s in the regular directx include directory.
  • Extremely empty code right now, but it compiles and links. On a side note, the compiler should accept the environment variable $(DXSDK_DIR), but it doesn’t. And adding macros is an enormous pain, as near as I can tell.
  • The code is ported over and works. It’s all stuck in a main() right now. I need to clean up and build an Audio class. Actually, looking at the way the code is set up, a WavSampleSound class might be better. It probably could extend from a SampleSound class, but I’ll break that out later…
  • Class is mostly done and running!
  •  ConsoleSound2

Dong Shin 05.23.2013

  • VizTool meeting – showed new capabilities from FA/RA
  • Deployed new FA/RA
    • managed to find a bug where the list of projects not showing up when Req’s/Obligations/Outlays were cleaned up – fixed
  • Continue working on FA/RA
    • fixed goals not showing up after Financial Data edit

Phil 5.23.13

7:30 – 10:30 SR

  • Backups, and it turns out that there was a bug with the project_portfolio_enh db, where a view that referenced tables that no longer exist was trying to be serialized. Dropping the view fixed the problem.
  • Deployed the new FA, and changed the db around a bit to accommodate. Which caused all the data to disappear from the client due to a null return of a query. Which caused us to want to restore from the backups. Which brought the backup error to light. Fortunately, it’s a test db, and very little actual work was lost.
  • Looked at the server info in Xacta, which was a new, exciting thing. It looks like our current authority to operate expires 3/25/2014. Need to keep an eye on that.
  • Meeting with the PIT crew from 7:30-8:00, which I missed due to the fact that I was uploading the new FA in preparation for the *scheduled* 8:00 meeting. Dong caught it though. He showed/described FA and RA to the team and they are actually quite happy.

10:30 – 3:30 FP.

  • More Audio3d.
  • Starting to add in the 3dAudio based on this and this and this.
  • Got an audio link error and chased that down, discovering a few things along the way.
  • There is directX help for C++ in (“C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Documentation\DirectX9\directx_sdk.chm”). I don’t know it it’s any good, but I’m going to look though it next. Note that this is DX9, not 11. I’m *hoping* that this is all up to date…
  • Pointed Configuration Properties->Linker->General->Additional Library Directories at (C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86), and added the following files to Configuration Properties->Linker->Input->additional dependencies”
    • d3d11.lib
      d3dx11.lib
      winmm.lib
      xinput.lib
      X3DAudio.lib
    • This is a change from the libraries that the demo book points at, which were dxd9 libs. Recompiled and ran the code with no problems. I did attempt to clean up the xact3dInstance pointer in ~Audio3d(), but delete[] threw an exception
  • Reading through the DX documentation, which, though it is in the DX9 folder, contains information about DX11. Whatever.
  • The documentation is kind of what you’d expect, but it let me find the tutorials and demos, which are quite nice. On my machine, the demos that I’m interested in are located here: (C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Samples\C++\XAudio2). It contains 4 projects:
    • XAudio2BasicSound
    • XAudioBasicStream
    • XAudio2CustomAPO
    • XAudio2Sound3D
  • Each project has source and MSVC2008 and MSVC2010 project files. I’ve just opened up the XAudio2Sound3D MSVC2010 project, and it compiled and ran just fine: XAudio2demo
  • This is almost exactly what I intend to build for the test environment, so that’s pretty cool. And using the buttons or the keyboard, I can drive the sound emitter around my head. Woohoo!
  • Next goal is to build up a copy of XAudio2BasicSound and then add the 3D components (without the graphics) from XAudio2Sound3D.

Phil 5.22.13

8:00 – 12:00, 3:00 – 4:00 SR

  • Backup.
  • ISSO Meeting – 8210 Dorsey Run Road, Jessup, MD
  • More resume variants
  • Meeting with Brad, our Program Manager.

12:00 – 1:30 Lunch with Greg

1:30 – 3:00 FP

  • Work on Audio3d class
  • It appears that you *have* to include <xact3.h> before <xact3d3.h>. It seems to be tied up with <x3daudio.h>, which is declared before <xact3.h> in <xact3d3.h>. If I reverse the order of those calls, no error messages. otherwise I get the following (included for the next poor soul who pastes this errot in Google):
    • 1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(6361): error C2146: syntax error : missing ';' before identifier 'ContextRecord'
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(6361): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(6361): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(12983): error C2065: 'PCONTEXT' : undeclared identifier
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(12984): error C2146: syntax error : missing ')' before identifier 'ContextRecord'
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(12984): warning C4229: anachronism used : modifiers on data are ignored
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(12984): error C2182: 'RtlCaptureContext' : illegal use of type 'void'
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(12984): error C2491: 'RtlCaptureContext' : definition of dllimport data not allowed
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(12984): error C2059: syntax error : ')'
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(13372): error C2143: syntax error : missing ';' before '__stdcall'
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(13372): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(13376): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(14982): error C3861: '__readfsdword': identifier not found
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(1048): error C2146: syntax error : missing ';' before identifier 'LPCONTEXT'
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(1048): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(1048): error C2378: 'PCONTEXT' : redefinition; symbol cannot be overloaded with a typedef
      1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winnt.h(13372) : see declaration of 'PCONTEXT'
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(1048): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(3610): error C2061: syntax error : identifier 'PCONTEXT'
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4449): error C2061: syntax error : identifier 'LPCONTEXT'
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4457): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(4457): error C2143: syntax error : missing ',' before '*'
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(15112): error C2143: syntax error : missing ';' before '__stdcall'
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(15112): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(15116): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  • And this is one of the reasons the Microsoft drives me so crazy…
  • …..and I got sucked into a meeting so that looks like it for the day.

Dong Shin 05.22.2013

  • continue working on FA/RA
    • working down the bug list
      • fixed Budget not showing properly when saved as new
      • fixed Project Budget Info not selecting previously selected data
      • fixed FACTS PE not setting correctly
      • fixed Total Budget / Total Allocated not showing correctly in Project Mgmt Panel
      • fixed Sub Projects Budget calculation
      • added additional information to the sub projects panel (total, funded, unfunded, available)

Dong Shin 05.21.2013

  • deployed new FA and RA, found few problems
    • When Update is clicked and not all fields are filled in, we might what to pop up a dialog box saying that they are not all filled in but allowing for a save
    • Add tooltips to buttons. In particular, we need to be clear about what saves and what cancels without saving.
    • Add a “Select All” to the SQL error dialog, now that we have QUERIES FROM HELL.
    • RA error string: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorExceptio: Unknown column ‘c.appropriation’ in ‘where clause’.
  • Continue working on FA/RA
    • setting up relations between projects, budget_centers, obligations_outlays tables
      • ALTER TABLE `budget_centers` ADD FOREIGN KEY ( `project_id` ) REFERENCES `project_portfolio_enh`.`projects` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE ;
        ALTER TABLE `obligations_outlays` ADD FOREIGN KEY ( `project_id` ) REFERENCES `project_portfolio_enh`.`projects` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE ;
        ALTER TABLE `obligations_outlays` ADD FOREIGN KEY ( `funding_id` ) REFERENCES `project_portfolio_enh`.`budget_centers` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE ;
    • found that saving “new” project doesn’t create obligations/outlays data correctly – fixed

Phil 5.21.13

8:00 – 1:00 SR

  • Backups
  • Deployed the new FA and RA for the first time. Had to make some changes to the DB to support. FA runs just fine, but there is a query problem in RA. Current bugs are:
    • When Update is clicked and not all fields are filledin, we might what to pop up a dialog box saying that they are not all filled in but allowing for a save.
    • Add tooltips to buttons. In particular, we need to be clear about what saves and what cnacels without saving.
    • Add a “Select All” to the SQL error dialog, now that we have QUERIES FROM HELL.
    • RA error string: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorExceptio: Unknown column ‘c.appropriation’ in ‘where clause’.
  • Cleaned up the blog a bit to accommodate FA and RA.
  • Had an interesting talk with Dimitri about his Master’s program. Thought for the day. What if access to a system was based on an Eliza-like conversation with the computer. There would be an initial “get acquainted” session, and then the “login” conversation would be shorter.
    • Store key patterns as well as the words.
    • Use a plagerism test to look for cut-and-paste replies from recorded sessions
    • Login discussions could be like Capchas in that they could be half test, half learning.

2:00 – 4:00 FP

  • I thought this tutorial would be the best way to get positional information, but it appears to be stale. The New Way seems to be this.
  • Close, but it’s actually part of the Windows API now?
  • Nope that’s C#. Still looking. Since I have xact3.h working, trying to stay in this space…
  • Ok, for tomorrow, I start writing a 3D version of Audio.h and then try calling that from the ConsoleSoundApp.

8:00 – 10:30 SR

  • Backups
  • I got an email saying the current Tomcat server is out of date, but I can’t find an actual ticket. Maybe it will show up later?
  • While poking around throug codeproject, I came upon an article for JavaScript game development that used a library called “ease”. Looks interesting…

ease.js is a Classical Object-Oriented framework for JavaScript, intended to eliminate boilerplate code and “ease” the transition into JavaScript from other Object-Oriented languages. Features include:

Download v0.1.1

(Released: 19 Jan 2013)

ease.js is a framework, not a compiler. It may be used wherever JavaScript may be used, including with other compilers/parsers. ease.js also provides support for older, pre-ES5 environments by gracefully degrading features (such as visibility support), but remaining functionally consistent.

10:30 – 4:00 FP

Looks like everything is working in the proof of concept! Here’s the code:

#include "stdafx.h"
#include <Windows.h>
#include <conio.h>
#include "audio.h"

int _tmain(int argc, _TCHAR* argv[])
{
	int keyIn;
	HRESULT hr;                 // standard return type
	LPTSTR buf;
	LPTSTR targetDir = "C:\\Programming 2D Games in DirectX 11\\Chapter 7 - Sound\\ConsoleSound\\ConsoleSound\\ConsoleSound";
	Audio *audio = new Audio();

	SetCurrentDirectory(targetDir);
	buf = (LPTSTR)calloc(256, sizeof(char));
	GetCurrentDirectory(256, buf);
	printf("Current dir: '%s'\n", buf);
	if (*WAVE_BANK != '' && *SOUND_BANK != '')  // if sound files defined
	{
		if( FAILED( hr = audio->initialize() ) )
		{
			if( hr == HRESULT_FROM_WIN32( ERROR_FILE_NOT_FOUND ) ){
				printf("Failed to initialize sound system because media file not found.\n");
				printf("hit return to exit\n");
				getchar();
				return -1;
			}
			else{
				printf("Failed to initialize sound system.\n");
				printf("hit return to exit\n");
				getchar();
				return -1;
			}
		}
	}

	printf("Type 'x' to quit, 1, 2, or 3 for sounds.\n");
	bool doit = true;
	while(doit){
		if(kbhit()){
			keyIn = getch();

			printf("key = %c\n", keyIn);
			switch(keyIn){
			case 'x' : doit = false; 
				break;
			case '1' : audio->playCue(BEEP1);                  // play sound
				break;
			case '2' : audio->playCue(BEEP2);                  // play sound
				break;
			case '3' : audio->playCue(BEEP3);                  // play sound
				break;
			}
		}
		audio->run();                       // perform periodic sound engine tasks
		Sleep(100);
	}
	SAFE_DELETE(audio);

	printf("hit return to exit");
	getchar();
	return 0;
	}

Tomorrow, we’ll try to add positional sound.

Dong Shin 05.20.2013

  • continue working on FA/RA
    • removed unecessary columns from budget_centers table
      • ALTER TABLE `budget_centers`
        DROP `center_number`,
        DROP `center_name`,
        DROP `capability`,
        DROP `expenditure_center`,
        DROP `investment_portfolio`,
        DROP `appropriation`,
        DROP `program_element`,
        DROP `facts_pe`;
    • working down the bug list from Lenny
      • save Requisition allows empty date fields
      • reworking Copy Project
        • removed Project menu items – more confusing
        • created stored procedure – copy_budget_centers, to copy all requisition and obligations/outlays data

Dong Shin 05.17.2013

  • continue working on RA/FA
    • working on Financial Data Editor
      • got filtering to work
      • editor works!
    • need to update the projects to have correct appropriations – done
    • cleaning up previous project budget/requistion information….