Quasar's Doomworld Forums Blog

Quasar's Doomworld Forums Blog

You darn kids February 28, 2013, 2:00 pm
You kids and your damn object-oriented virtualized sanitized BDSM languages and APIs:
[QUOTE]
Incidentally, although Final Cut Pro X has been fully rewritten as a 64-bit Cocoa application, it was missing a significant number of features found in the discontinued Carbon version.
[/QUOTE]
Everybody's forced to upgrade to the 'newest thing' but the newest thing is too much of a fuckin' pain in the ass - so slow, so abstracted, so bothersome, so bloated, so Brobdingnagian - that when something finally does get rewritten, it's a half-assed shell of what it once was.

Respect your elders. We wrote assembly on bare metal and instructed the machine in its own language. But our programs worked and did not sacrifice functionality for gloss or hipster bullshit like social media integration - the program WAS the functionality. And we sure as hell didn't pay $100 a year to kiss the ass of some self-proclaimed god of the platform for the right to code, and our programs didn't ship as encrypted, signed, DRM'd interpreted bytecode either.

Actually, I'm being (mostly) sarcastic/facetious/cantankerous for the sake of it ;)
11 Comments

Just an observation of mine January 9, 2013, 11:23 am
You might remember the top image was created a while back by some random person on the internet to illustrate what might have been the end result of the lack of net neutrality - "channelization" of the internet into regulated sets of "sites", each operating in a proprietary manner and possibly charging its own fees for access.

All hail the Brave New World of the app store, bringing us the same compartmentalized environment regardless of net neutrality, while being replete with regulated, licensed development, signed interpreted code, strictly controlled access to vastly neutered and terribly inefficient APIs, and most importantly, an anti-trust-laws-defying racket by which the owning company gets to siphon profits off of all software development targeted at that platform.

Welcome to your worst nightmares.

35 Comments

My precious Nikki December 16, 2012, 12:23 am
My sweet precious cat Nikki passed on this evening at around 10:55 central time. She had been terminally ill with heart failure and kidney failure for the last 3 or so days, after suffering a stroke that mostly disabled her back legs. She died a natural death, due to heart attack, and we were with her comforting her as much as we could.

I will be working on an online tribute for her, as she was my best friend for 20 years and I loved her like I would my own child. I'll post a link to it here when it is ready.
8 Comments

C++11 Properties November 11, 2012, 1:04 am
Here's a method I worked out for duplicating the semantics of Borland Delphi/C++Builder-style properties under C++11, via the use of lambda functions which capture "this" by-value:

/** @file VIBProperties.h
*
* VIB Class Library - C++11 Properties Implementation
*
*/

#ifndef VIBPROPERTIES_H__
#define VIBPROPERTIES_H__

#include <functional>

namespace VIB
{
template<typename T> class Property
{
protected:
typedef std::function<T (void)> Getter;
typedef std::function<void (const T &)> Setter;

Getter get;
Setter set;

public:
/** Default constructor, you must initialize get and set later. */
Property() : get(), set() {}

/** Provide get and set callbacks at instantiation. */
Property(const Getter &pGet, const Setter &pSet) : get(pGet), set(pSet)
{
}

/** Late-initialize the callbacks. */
void initCallbacks(const Getter &pGet, const Setter &pSet)
{
get = pGet;
set = pSet;
}

/** Cast operator, invokes get() and returns its value. */
operator T() { return get(); }

/** Assignment operator, invokes set with the provided value, returns this object. */
Property<T> &operator = (const T &nv) { set(nv); return *this; }

/**
* Invokes get, assuming it returns a pointer that can be used with the
* deref-access arrow operator. If not, you will cause a compile-time error
* by trying to use it.
*/
T operator -> () { return get(); }
};

template<typename T, typename A> class ArrayProperty : public Property<T>
{
public:
/** Default constructor, you must initialize get and set later. */
ArrayProperty<T, A>() : Property<T>() {}

/** Provide get and set callbacks at instantiation. */
ArrayProperty<T, A>(const Getter &pGet, const Setter &pSet)
: Property<T>(pGet, pSet)
{
}

A operator [] (int i) { return this->get()->operator[](i); }
};
}

#endif

To set one up involves code like this:

class Foo { public: Property<int> SomeProperty; Foo(); ... };
Foo::Foo() : SomeProperty()
{
SomeProperty.initCallbacks(
[=] () { return someMethod(); },
[=] (const int &i) { doSomething(i); });
}

This allows expressions such as "bar.SomeProperty = 1;" or "int x = bar.SomeProperty;".

The usual objection to similar implementations without this-capturing lambdas, which act like anonymous private methods of the containing class, is that the class itself isn't notified of the access to the property object. This design above completely resolves that problem with a minimum requirement for boilerplate.

BTW, I designed this at work as part of a system that exposes the Borland-specific IBExpress API, for interacting with InterBase compatible libraries such as the open-source Firebird, to other compilers such as Visual C++, freeing it from dependence on the nearly unusable C++Builder IDE.
0 Comments

Hi from Indianapolis February 13, 2012, 7:55 pm
Just posting to let everybody know I am in Indianapolis for the week for some training on a lab system.

I am a little too full of wine at the moment to explain much more than that :P
17 Comments

Crazy query October 21, 2011, 5:46 pm
Here's the *partially completed* Firebird SQL query that will export Prometheus' demographics info into the Allscripts EHR ;)

select
/*ID */ P.id patient_external_id,
/*NAMES */ substring(PN.first_name from 1 for 20) patient_first_name,
substring(PN.middle_name from 1 for 1) patient_middle_initial,
substring(PN.last_name from 1 for 20) patient_last_name,
substring(PN.suffix from 1 for 8) patient_suffix,
/*PTSTRT1*/ substring(coalesce((MA.line1 || coalesce((' ' || MA.line2), '')), (HA.line1 || coalesce((' ' || HA.line2), ''))) from 1 for 40) patient_street1,
/*PTSTRT2*/ case when MA.id is not null and HA.id is not null and substring(MA.zip from 1 for 5) = substring(HA.zip from 1 for 5)
then substring((HA.line1 || coalesce((' ' || HA.line2), '')) from 1 for 40) end patient_street2,
/*PTCITY*/ substring(coalesce(MA.city, HA.city) from 1 for 30) patient_city,
/*PTSTATE*/ coalesce(MAILST.item, HOMEST.item) patient_state,
/*PTZIP*/ substring(coalesce(MA.zip, HA.zip) from 1 for 5) || coalesce(substring(coalesce(MA.zip, HA.zip) from 7 for 4), '') patient_zip,
/*PTPHONE*/ (select first 1
case when substring(IPCI.phone_number from 1 for 1) = '1' then substring(IPCI.phone_number from 2) else IPCI.phone_number end
from person_contact_info IPCI
where IPCI.id in (HP.id, HA.id, MA.id)
order by IPCI.last_update_stamp desc) patient_phone,
/*WKPHONE*/ (select first 1
case when substring(IPCI.phone_number from 1 for 1) = '1' then substring(IPCI.phone_number from 2) else IPCI.phone_number end
from person_contact_info IPCI
where IPCI.id in (WP.id, WA.id)
order by IPCI.last_update_stamp desc) patient_work_phone,
/*PTEMAIL*/ (select first 1 substring(IPCI.email_address from 1 for 40)
from person_contact_info IPCI
where IPCI.id in (HA.id, MA.id, HP.id, WA.id, WP.id) and IPCI.email_address like '%@%'
order by IPCI.last_update_stamp desc) patient_email_address,
/*GENDER */ substring(GT.item from 1 for 1) patient_sex,
/*SSN */ P.social_security_number patient_ssn,
/*DOB */ (extract(year from P.birth_date) || LPAD(extract(month from P.birth_date), 2, '0') || LPAD(extract(day from P.birth_date), 2, '0')) patient_date_of_birth,
/*MR# */ '' patient_medical_record_no,
/*MRLID */ '' patient_medical_record_loc_id,
/*MRLDESC*/ '' patient_medical_record_loc_desc,
/*MARITAL*/ case when MT.item = 'SEPERATED' then 'X' else substring(MT.item from 1 for 1) end patient_marital_status,
/*STUDENT*/ '' patient_student_status,
/*EMPSTAT*/ '' patient_employment_status,
/*COMMENT*/ '' patient_comment,

/* TODO: PROVIDER FIELDS */
/* TODO: INSURANCE POLICIES */

/* CUSTOM FIELDS*/
/*CELL*/ case when substring(CP.phone_number from 1 for 1) = '1' then substring(CP.phone_number from 2) else CP.phone_number end patient_cell_phone
from people P
inner join person_names PN on P.person_names_id = PN.id
left join person_contact_info MA on MA.id = P.mailing_address_id and MA.current_id >= 3
left join person_contact_info HA on HA.id = P.home_address_id and HA.current_id >= 3 and HA.id is distinct from MA.id
left join person_contact_info HP on HP.id = P.home_phone_id and HP.current_id >= 3 and HP.id is distinct from HA.id and HP.id is distinct from MA.id
left join person_contact_info WA on WA.id = P.work_address_id and WA.current_id >= 3 and WA.id is distinct from MA.id and WA.id is distinct from HA.id and WA.id is distinct from HP.id
left join person_contact_info WP on WP.id = P.work_phone_id and WP.current_id >= 3 and WP.id is distinct from WA.id and WP.id is distinct from MA.id and WP.id is distinct from HP.id
left join person_contact_info CP on CP.id = P.cell_phone_id and CP.current_id >= 3 and CP.id is distinct from MA.id and CP.id is distinct from HA.id and CP.id is distinct from WP.id and CP.id is distinct from HP.id
left join gender_types GT on P.gender_id = GT.id
left join marital_types MT on P.marital_id = MT.id
left join state_types MAILST on MA.state_id = MAILST.id
left join state_types HOMEST on HA.state_id = HOMEST.id
where
P.id > 0 and
PN.first_name <> '' and
exists (select * from tasks T where T.person_id = P.id and T.date_of_task >= '1/1/2008') /* Modified RE: Boren's request - visit in last 3 calendar years */
order by P.id
2 Comments

31 June 19, 2011, 11:24 am
18 Comments

What happens when you have a lousy schema with poor data integrity June 14, 2011, 5:08 pm
You get to write SQL code like this:

where cob_tasks.date_of_task >= '1/1/2010' and
(upper(OT.specialty) like '%DME%' or exists(select * from services_provided SP where SP.tax_entity_id = OT.id and SP.service_id = 80)) and
(OT.id <> 19 or (upper(visit_tasks.task_comments) like '%AID%' and upper(visit_tasks.task_comments) not like '%IV%' and upper(visit_tasks.task_comments) not like '%LOSS%')) and
(OT.id <> 1018 or
upper(visit_tasks.task_comments) like '%PURCHASE%' or
upper(visit_tasks.task_comments) like '%WALKER%' or
upper(visit_tasks.task_comments) like '%MASK%' or
upper(visit_tasks.task_comments) like '%CPAP%')
and OT.id not in (2522,2878,2844)

BLECH >_<
2 Comments

CVSNT problem on Ubuntu production server... March 14, 2011, 9:08 am
I have a problem in that my CVS repo is corrupt and needs to be restored from a .tar.bz2 backup and my boss seems to have gone missing as I have not heard a single word from him for 4 days. The way it got corrupt is when I tested committing only to see that it couldn't write to most/any of the files under CVSROOT because the filesystem permissions are setup completely wrong (not my fault :P) - yet of course it went ahead and changed the source files anyway since CVS doesn't have atomic commits... ugh.

I'm a little bit lost so I wondered if anybody has experience with what has to be done. Stopping the server process is probably a good idea, but I have to do it without shutting down or otherwise interfering with the server as a whole - it also has the Firebird production database running on it with a few hundred people connecting to it.

Also I find this a little bit troubling :P

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
15706 paul 20 0 32048 3872 1380 R 100 0.0 5492:43 perl
0 Comments

VCL does it again... December 7, 2010, 12:08 pm
Check out this tortured stack dump:
CC3250MT.DLL @ 3257E14F
WinMain
TApplication::ProcessMessage
(user32.dll calls x 5)
Forms::_16460
TToolBar::WndProc
TWinControl::IsControlMouseMsg
TControl::Click
TformRecordGeneric::buttonAClick
TformRecordGeneric::DataSave
TformRecordObservationResponseSet::ScreenLock
TformRecordObservationResponseSet::comboQuestionSetChange
obs_row_container::load_entries
DebugSql
EditSql
TformSpecialSqlViewer::Launch
TformSpecialGeneric::ShowTaskModal
TApplication::ProcessMessage <- Here is where the shit hits the proverbial fan
(user32.dll calls x 5)
Forms::_16460
TTimer::TTimer
TformPrometheusMenu::timerNetworkRefreshTimer
classNetworkRequestHandler::Check
classRequest::Fulfill
TformRecordObservationResponseSet::AtlasRefreshListViews
TformRecordObservationResponseSet::comboQuestionSetChange
obs_row_container::load_entries <- OH SHIT EXPLOSION!

The resulting error from this completely unpredictable recursion is creation of a duplicate frame control, failure to attach child frames to it because they have names the same as existing ones, followed by a complete utter meltdown of the entire VCL framework due to an apparent glitch in its ref-counting scheme for control names. Fabulous.
9 Comments

Next