All posts by admin

Number Tease Brain Game

In this modern day of iEverything, I wanted to go old-school on you with this fun and simple brain teasing number challenge. So turn off the T.V., print this page, grab a pencil and let’s see what you can do here. I’ve had this in a simple TXT file for over 20 years. This beauty has made its way from one hard drive to another as I’ve upgraded computers over those years; it’s too good to let go. I wish I could remember where I got this.

If you can’t get them all, get in touch with me and I’ll help you out. And, if you can add any to the list, please send them to me and I’ll update the post.

INSTRUCTIONS:
Each question below contains the initials of a word that will make it correct.

EXAMPLE: 16 = O. in a P. Ounces in a Pound

1.    26 = L. of the A. ______________________________________________________

2.    7 = W. of the A.W. ____________________________________________________

3.    1001 = A.N. ___________________________________________________________

4.    12 = S. of the Z. ______________________________________________________

5.    54 = C. in a D. (with the J.) __________________________________________

6.    9 = P. in the S.S. _____________________________________________________

7.    88 = P.K. ______________________________________________________________

8.    13 = S. on the A. F. ___________________________________________________

9.    32 = D. F. at which W. F. ______________________________________________

10.    18 = H. on a G.C. ______________________________________________________

11.    90 = D. in a R. A. _____________________________________________________

12.    200 = D. for P. G. in M. _______________________________________________

13.    8 = S. on a S. S. ______________________________________________________

14.    3 = B. M. ( S. H. T. R.) _______________________________________________

15.    4 = Q. in a G. _________________________________________________________

16.    24 = H. in a D. ________________________________________________________

17.    1 = W. on a U. _________________________________________________________

18.    5 = D. in a Z. C. ______________________________________________________

19.    57 = H. V. _____________________________________________________________

20.    11 = P. on a F. T. _____________________________________________________

21.    1000 = W. that a P. is W. ______________________________________________

22.    29 = D. in F. in a L. Y. _______________________________________________

23.    64 = S. on a C. ________________________________________________________

24.    40 = D. and N. of the G. F. ____________________________________________

Good luck.

Want more brain fun? Check out http://www.brainbashers.com/games.asp

New domain highlights plastic shredders

Plastic Shredder Equipment

Having recently acquired the domain www.PlasticShredder.com, we’ve begun adding content to a few pages on the new site to highlight the special capabilities of our twin shaft shredders to the shredding of plastic materials. Many manufacturing process today deal with plastics or similar materials like HDPE or PVC, and every one of them require shredding or grinding of the plastic materials at some point to prepare them for extruding, molding, or other manufacturing process. These heavy duty twin shaft shredders are designed for high production rates and offer flexibility in particle size by changing the cutting knives or screens. In contrast to many foreign equipment options like those listed at http://shredder-china.com/industrial-shredder-introduction, these machines are manufactured in the United States using precision CNC machines. Videos are available on the site which show the shredders at work in many test cases like plastic buckets, shredding hoses, plastic films and other materials.

 

Value in reclaiming scrap materials

In many plastics manufacturing processes, once the parts or material is complete, it’s often necessary to shred or grind these materials to allow them to be recycled or reused in the manufacturing process. The value of this oil-based material is is quite high and increases in direct proportion to the cost of oil. Therefore, most production lines require a shredder or high speed grinder to prepare the material for further processing. We wanted to break out a special site dedicated to dual shaft shredders and how they can be used in plastic grinding and shredder systems to help with the growing focus on “going green” and clean manufacturing.

Visual FoxPro on Windows 8

Want to know if Visual FoxPro 9 will run on Windows 8?  Well, find out below…

I downloaded the Windows 8 Developer Preview the first evening that Microsoft made it available to the public. I had watched the BUILD keynote during the first day of the conference on September 14, 2011, and I was impressed with most of what Microsoft has done on the developer platform for their new OS. So, sure, Windows 8 looks all cool and I am sure we’ll all have some fun building these new “Metro” style apps for it. I’m looking forward to it, just as I’ve looked forward to every new programming journey I’ve tackled lately, like learning C#, WPF, ASP.Net MVC, and Ruby on Rails. I love it all. Bring on more!

However, I am a long-time FoxPro developer, and I imagine I’ll still be developing and maintaining my primary corporate app in FoxPro for a few more years, so I wanted to make sure that Visual FoxPro 9 SP2 + HotFixes would install and run properly in Windows 8. Let’s see if it does (I’ll give you the answer now…. It does!)

image

According to http://fox.wikis.com/wc.dll?Wiki~CurrentVersion~SoftwareEng , the latest, fully patched version of Visual FoxPro 9 is 09.00.0000.7423.

image

So, the answer is YES, Visual FoxPro 9 SP2 works in Windows 8.

Now, I’m just waiting for the release of the “Metro for FoxPro” framework on VFPx. Anyone?

 

Anyone?

I Love Me Some Business Objects

Here is the beautiful stack of Business Object classes for my Line of Business CRUD app (see image below).

The Job object (highlighted in the screenshot), in particular, is populated with tons of little worker methods to handle all the processes my Job oriented forms need. Most of these methods were created by taking little bits of procedural code from various forms and procedure files that had become strewn about all over my app code, and tucking it away into methods on the Job class.

Now, I can easily create a Job object with one line of code, and then call any of its handy methods to quickly create a cursor containing the desired child records, or return a value from some other calculation, or any other tasks that my business app needs to handle. 

So follow this rule: If you’re writing processing code in form methods or methods on UI controls (yikes!), you should consider creating a Business Object and adding methods to it instead. It will be much more re-usable and maintainable.

 

Code sample:

oJob = CreateBusObject(‘Job’) && Call a Dictionary method to get the class

oJob.Get(‘TheJobNumber’)

If oJob.lFound = .T.

   oJob.GetLineItemsForInvoice(‘CursorName’)

Else

   *– Handle Not Found situation

EndIf

 

SNAGHTML9aff7fe7

BarCamp Birmingham 5 Sessions

imageI attended BarCamp Birmingham 5 on Saturday, August 6 2011. This was my first time attending an un-conference, also known as a “user conference”. In a BarCamp conference, the sessions are proposed on the morning of the conference by attendees who have a topic they’d like to share. Each topic is recorded on a sticky note, and then a very informal “vote” occurs to select the session list for the day. I was a little skeptical of sacrificing a full day away from my family to attend a conference where I could not review the sessions ahead of time. However, I was very pleased with the sessions, speakers, and attendees. The entire event was great, and I was inspired by many of the speakers who were obviously as passionate about their careers and work in the software field as I am.

There were 111 registrants for the conference. It was held and UAB School of Business and Engineering complex. Every attendee received a BarCamp Birmingham T-shirt, free soft drinks, and and free lunch from Jim-N-Nick’s. The twitter hashtag is #BarCampBham.

Below, I’ve recorded the sessions that were chosen, and have listed the speaker’s name and contact info for the ones that I could reconstruct. I took iPhone photos of the sticky notes that were arranged to lay out the schedule.

If you can help me fill in any of the missing speaker info, please ping me with the information.

Morning Sessions

9:30

10:10

10:50

11:30

Room 1 The Hitchhikers Guide to Web Development at Midnight in the Garden of Good and Evil
Chris
WordPress Optimization for Shared Host Environments.

Paul OFlaherty
@pauloflaherty

Into to PhoneGap
Matt R.
5 Things You Should Know About PhotoShop
Tammy Hart
@TammyHart
Room 2 Basics of SEO
Cathy Reisenwitz
@CathyReisenwitz
Non-Technical Intro to Google+
Dave Barger
@lalunablanca
Tips From a PM:
4 reasons why programmers should NEVER talk to clients.
Daniel Walters
Group Discussion on Gamification.
Room 3 Start-ups and Screw-ups – How to Beat the Odds
Andra Walker
@andreafwalker
Filming, Editing, and Publishing Great Videos on the iPod and iPhone With No $
Chris Davis
@chriscreates
Convergence Trends and Relevancy of the Modern Still Image
Josh Self
@joshself
Brief History of Japanese Occupation of Taiwan

Jason Chucong

Afternoon Sessions

1:40

2:25

3:00

3:35

Room 1 Discussion Group –
How to Grow the Digital Community
Chris Davis
@chriscreates
Cutting the Chord – Ways to get rid of cable and Direct TV
Kevin Gatgens
@kgatgens
5 “Guidelines” of Improv
Capt. Daniel Walters
@BlazeDaDragon
PCI Compliance – Risks and why it’s so hard to achieve
Matt Hellinger
Room 2 Open Source – What I’ve learned: – Git
– VIM
– JavaScript
Tom Brander
@dartdog
Conversation about Mobile Design and UX
Brian Cauble
@briancauble
There is NO Tablet Market
Matt Hellinger
Critical Thinking 098 – How to start being less sure and more right
M. Alvis
Room 3 Discussion – What is AWESOME?

Jason

CSS – Advanced and Intro
Brian Moon
HTML Email
– Design
– Strategy
– Code

Link:
Slide DeckJulia Anderson
@Blueys
Idea Driven Design
Giovanni DiFeterici
@giodif

Creating a Parent Business Object with wwBusinessPro

When using a wwBusProParent, you set properties on the Parent that tell it about the Child class.
Then, the Parent will create the Child class for you.
You do not create the Child when writing your code, let the Parent do that.

You need to create a VCX library and put a Child class for each Child collection in there,
with its Child properties already set up. This allows the Parent to create the Child when he
needs it. If you follow the path of the Get() method, you will see that the Parent creates a
Child class object and attaches it to its oLineItems property. So, once your Child classes are
configured in a VCX, you will not actually have to write any code to access them (unless you are
doing some special case, custom coding), you just set up the Parent so he can find them.
The Parent will handle all that for you, including the fetching of the related Child records.

You can also put your Parent objects in the VCX and set their properties in the VCX file.
This sample code is shown here simply to show which properties are required to make it all work.


*=================================
* == Sample to  show a Parent BO configured to use a String lookup and work with related Child Records
*=================================

Local loSrHead AS ‘cSrHead’

Set ClassLib To MyMainLibrary Additive
Set ClassLib To MyBoLibrary Additive  && Include your Business Object ClassLibrary

loSrHead = CreateObject(‘MyInvoiceBoClass’) &&  A Parent class found in your BO Library VCX

*– These settings are native to the base wwBusiness operation
loSrHead.cFileName = ‘tblSrHead’ && The table name (.dbf file or Sql Server table name)
loSrHead.cAlias = ‘csrSrHead’  &&  Local alias name to use when opening file
loSrHead.nDataMode = 0  && Data access mode for the business object. 0 – Native Fox dbf, 2 – SQL Server
loSrHead.cPKFIeld= ‘PK’    && Points to the unique Key value column in the table. Usually an Integer column.

*– This code section is part of wwBusinessPro feature set wwBusinessPro allows for String-based lookups and related Child cursors…
loSrHead.cLookupField = ‘storeno+docno’  && This is an example of a compound string unique key lookup value.
loSrHead.cAdditionalFilter = ‘mtype = [0]’  && (Optional) Provides a way to further filter the record locating process.
loSrHead.cPKFIeld= ‘storeno+docno’           && Set to same value as cLookupField if no Integer PK is available in the table.

loSrHead.lLoadLineItems = .t. && Tells it load Child records when getting the Parent record.
loSrHead.lAllowEditLineItems = .t.  && Tells it create a ReadWrite cursor when creating the Child record cursor

*– Setup the Child properties on the Parent
loSrHead.cLineItemsClass = ‘cSrItems’  && Child class must exist in the MyBoLibrary.vcx
loSrHead.cLineItemsAlias = ‘curSrItems’ && Cursor name where you want the Child records to be stored

*– Fetch the Parent and create a Child Cursor
loSrHead.Get(‘TWU STORE RN2009100003’) && For String lookups
loSrHead.Get(12345) && For Integer lookups

If loSrHead.lFound = .f.
*– Add any Not Found handling code here
Endif

If loSrHead.nErrorCount > 0
*– Add any Error handling code here, if not already handled in your classes.
Endif

*– Make some changes to the loSeHead.oData object and to the Child cursor
*– and save the changes…
loSrHead.Save(.t.) && .t. Tells it to save changes to the Child records also

 

One more thing about the Child classes…

When setting up your Child in the VCX, these are the properties you need to set on it:

cFilename (Required. Name of the dbf or Sql Server table)
cAlias (Optional. Will use cFilename by default)
cPKField (Must be an Integer. See “Important Note” below)
cFKField (Must be an Integer. Maps to Parents PK field)
cLookupField (Optional. Maps to Parents cLookupField. Use when Parent uses for String lookups)
cOrderFld (Optional. Can be used to set the ordering of child records. i.e. a sequnce field)

These properties provide the info needed by the LoadLineItems() method work out of the box.
Sometimes you may want to overwrite the LoadLineItems() method with custom code, but the default
should work in basic configurations.

IMPORTANT NOTE:
In order to save changes on the Child records, they need a unique PK that can be used. See cPKField.
String cLookupField works fine to load the records in, but it does not guarantee uniqueness when
trying to save changes back.

Again, you can use cLookupField Stings for loading the records, but you must have Integer PKs
on your Child records to allow saving changes back.

wwBusinessPro–Parent Child collections in a wwBusiness business object

Note: This post if part of a complete series on the West Wind wwBusiness library.
Click here to see the full index

 

Before we start digging into parent/child data access with wwBusinessPro, let’s have a review of the basics. Suppose we want a Invoice object, and child set of Invoice Line Items that belong to that invoice. This is possible, even simple, with wwBusninessPro. In fact, in this post I’ll also show you how to handle a second child collection, like Invoice Payments, related to the Invoice. If you follow the example shown here, you’ll be able to handle cases where you have a single business objust with MULTIPLE child collections.

For example, here is what a really complex “aggregate” business object can look like. In my main business app, I have one complex business object that loads 4 additional child cursors in addition to the base oLineItems collection, and, it also loads customer and user info into oCustomer and oUser objects that I added onto the BO.

clip_image006

So let’s get started…

Parent and One Child Cursor

Parent class – Create your Invoice class as subclass of wwBusProParent.

At this point, you will see that it has *ONE* child collection object and related properties already built in. The oLineItems object will hold a object reference to the child item class. To make it active (so that it fetches child records every time you fetch a new parent object), you will need to set the cLineItemsClass, cLineItemsAlias, and lLoadtems properties.

The cLineItemsClassproperty points to a lineitems class that you must define in your VCX and it holds the table name of where the child records live and the key field name which links it to the PK on the parent.

The cLineItemsAliasproperty is the name of the cursor that where the child records will live.

Finally, be sure you set the lLoadLineItems property to .t. to make sure the main BO will load the line items each time you call the Get() method on the Parent.

Child Class – Create your InvoiceLineItems child class as a subclass of wwBusProItemList.

Set the properties cFilename and cFKField, which identify the Child table, and the field in the table that links back to the Parent PK in the invoice class.

So that’s it.  You’ve just set up the built-in functionality for the wwBusinessProParent class to handle the Parent BO and its set of child objects.

 

Need to handle MULTIPLE sets of child records?

Let’s say you also want to fetch all InvoicePayments records every time you load up an Invoice object…

After you’ve configured your “Invoice” and “InvoiceLineItems” classes as described above, and add the following properties and one method to cover the “Payments” collection:

New Properties:

  • cPaymentItemsClass
  • cPaymentItemsAlias
  • lLoadPayments
  • lAllowEditPaymentItems (optional, but something I include on my so I can enable or disable stuff in the UI layer)

New Method:

  • GetPaymentItems()

Now you need write two simple code blocks:

1. To populate the PaymentItems cursor (in addition to the LineItems cursor) every time you fetch an Invoice, you need to override the LoadRelatedData() method on the Invoice class like this:

 image

 

2. Define the GetPaymentItems() method like this:

image

That’s it.

Once you have brought this Invoice object to life, you will have 3 classes in your VCX:

Invoice (based on wwBusProParent)

InvoiceLineItems (based on wwBusProItemList) (this is what the default oLineItems will point to)

InvoicePaymentItems (based on wwBusProItemList) (this is what the above new properties and methods will point to)

When complete, your “Aggregate” Invoice Business Object will look like this:

Invoice

.oLineItems

.oPaymentItems

I know it might seem complicated at first, but once you understand what’s happening, it really not hard.

FoxPro Report FRX Table Structure

Visual FoxPro 9 Report (FRX) Table Structure

Here is a link to a table showing all the field names and details for Visual FoxPro 9 Report (FRX) files. This table also applies to Label (LBX) files.

Click here: FoxPro-Report-FRX-Structure.html

The HTML table in the above link was generated from the 90Frx.frx report in the Tools\Filespec folder of the Visual FoxPro installation folder.

Preview:

7-6-2011 10-07-41 PM

Here is a nice article with some deep technical info on advanced programming of Reports in VFP 9:

http://spacefold.com/articles/RSFundaments_part1.aspx

FoxPro Report FRX Table Schema

Here is a basic view of the table schema, but it does not contain all the field details of the full report above. 

The schema contains 75 fields:

Field Name Data Type
PLATFORM C(8)
UNIQUEID C(10)
TIMESTAMP N(10)
OBJTYPE N(2)
OBJCODE N(3)
NAME M
EXPR M
VPOS N(9,3)
HPOS N(9,3)
HEIGHT N(9,3)
WIDTH N(9,3)
STYLE M
PICTURE M
ORDER M
UNIQUE L
COMMENT M
ENVIRON L
BOXCHAR C(1)
FILLCHAR C(1)
TAG M
TAG2 M
PENRED N(5)
PENGREEN N(5)
PENBLUE N(5)
FILLRED N(5)
FILLGREEN N(5)
FILLBLUE N(5)
PENSIZE N(5)
PENPAT N(5)
FILLPAT N(5)
FONTFACE M
FONTSTYLE N(3)
FONTSIZE N(3)
MODE N(3)
RULER N(1)
RULERLINES N(1)
GRID L
GRIDV N(2)
GRIDH N(2)
FLOAT L
STRETCH L
STRETCHTOP L
TOP L
BOTTOM L
SUPTYPE N(1)
SUPREST N(1)
NOREPEAT L
RESETRPT N(2)
PAGEBREAK L
COLBREAK L
RESETPAGE L
GENERAL N(3)
SPACING N(3)
DOUBLE L
SWAPHEADER L
SWAPFOOTER L
EJECTBEFOR L
EJECTAFTER L
PLAIN L
SUMMARY L
ADDALIAS L
OFFSET N(3)
TOPMARGIN N(3)
BOTMARGIN N(3)
TOTALTYPE N(2)
RESETTOTAL N(2)
RESOID N(3)
CURPOS L
SUPALWAYS L
SUPOVFLOW L
SUPRPCOL N(1)
SUPGROUP N(2)
SUPVALCHNG L
SUPEXPR M
USER M