The Salty Economist

Things I Should Have Learned in High School
posts - 56, comments - 0, trackbacks - 0

May 2014 Blog Posts

VMWare Workstation Windows 8

I hate Windows 8! On a new Windows 8 Box, I went to launch VMWare Workstation and was greeted with this garbage: “Not enough physical memory is available to power on this virtual machine with its configured settings. To fix this problem, increase the amount of physical memory for all virtual machines to 2311 MB or adjust the additional memory settings to allow more virtual machine memory to be swapped. If you were able to power on this virtual machine on this host computer in the past, try rebooting the host computer. Rebooting may allow you to use slightly more host memory to run virtual machines.” Rebooting...

posted @ Friday, May 30, 2014 9:46 AM | Feedback (2145) |

TSQL Paramaterized Views

I really like views in sql Server. Today, I ran into a case where I wanted create a view that joined to another view in one circumstance and another view in an alternative circumstance.  Specifically, I have a bunch on payment data stored in one view that I wish to sometimes join to an EMPLOYEES table and sometimes join to a VENDORS table.  I could Union the EMPLOYEES and VENDORS, but what I really wanted was a way of dynamically joining 2 tables in a view. After googling for a bit, I figured out a way to use a function that returns a...

posted @ Tuesday, May 27, 2014 6:41 PM | Feedback (373) |

Threading and Slow COM Objects

OK, so I got my multi-threaded app up and running. But, just one problem: It is really SLOWWWWW... After doing a little research, I discovered this gem: "All things being equal one of the most common causes of slower execution from one thread to another occurs when the code uses a COM object that is configured to run in a single thread apartment (STA) and meets one of the following other conditions. It is called from a thread other than the one that instantiated it. It is called from a thread configured to run in a multithreaded apartment (MTA). An expensive marshaling operation most occur on...

posted @ Tuesday, May 27, 2014 4:06 PM | Feedback (1697) |

Threading and SyncLock

So I have a program that calculates the pay for contractors that deliver logs to sawmills.  Every week a given mill might receive 500 to 1000 loads.  For each load, the mill might have to make separate payments to the trucker, the logging contractor, the landowner, etc.  Let's say for this example that the mill receives 1,000 loads and must make payments to 6 separate vendors, for a total 6,000 transactions.  Calculating the payment on each transaction is not simple and requires side calculations to contend with things like overloaded trucks, volume conserions, and rate schedule lookups based on the species, product type, location, terrain....

posted @ Saturday, May 10, 2014 3:58 PM | Feedback (2101) |

Powered by:
Powered By Subtext Powered By ASP.NET