Tuesday, July 14, 2009

Additional Blog for Mobile Updates

I started a blog for my cell phone. It has a qwerty keyboard and camera and I seem to often encounter mildly entertaining hilarity. The internets must know about this.

Peep justin-berke.blogspot.com.

Monday, July 13, 2009

Website Ideas: FML-Style Web Sites

In the style of FML and TFLN, where users submit short, text based hilarity, I'd like to build three web sites.

One is dedicated solely to "That's what she said" opportunities from inappropriate situations. As much as I would like to shout it across a meeting with my division director, or at my roommate's mother when she walks into a giant bucket of hilarity, I'm often bound to a puritanically imposed sense of of tact.

The second is simply a compilation of quasi-believable erroneous facts. For instance, skin is actually an acronym for its composing elements: Sodium Potassium Iron & Nitrogen. The human body contains exactly 100 bones (101 if you count the skull). Fire ants prefer hickory BBQ sauce. Pi is exactly 3. That sort of thing. See Look Around You.

In an xkcd stylee of nerdiness, the last is a site dedicated to user-submitted equations, algorithms, functions, statistical inferences, etc. that model everyday occurrences or nuisances. For instance, Matt's First Law of Mexican Restaurants states that "The quality of cuisine at a Mexican restaurant is inversely proportional to the cleanliness of its bathrooms," or my postulation that "the likelihood of vegetarian options existing on a given menu decreases as the number of televisions at a restaurant increase." Yeah, statistics jokes are GOLD these days. Also, jokes involving computer programming/coding or diagrams (chemical, physical, electrical, etc.) are fair game. OpenWetWare has a cool santax for creating diagrams.

I created new blog called Unnecessary Modeling. For now I'm using the graph builder at GraphJam for my templates, but they're not showing up as well as they could, so I might switch over to Google Docs soon.

These are not really that great but I would like to learn basic web based database management programming. I love LAMP!

Thursday, July 9, 2009

Website Idea: Marriage pools

How many weddings have you been to that have ended in divorce? How many are probably on their way out? I haven't really been to many, but I'm looking at .500. Not a great statement for the high standards of the sanctity of the "eternal bond" is it?

Wouldn't it be nice to stop loosing money on showers, gifts, and weekends of preparation? I propose a website that will allow friends, family, and other random weirdos to throw down a few bucks and make a bet on how long a marriage will last. Conversely, one can wager that a marriage will last forever. HA! Seriously though, you can make money on others misery. God bless America.

It can work along the lines of general things like how long will it last to tie breaker to more of a point system, with topics like picking the reason of termination, who was at fault, etc. The more people who enter, the better the outcome will be, of course. Pools can be open or closed, which leads to the more public option: CELEBRITY WEDDINGS!

All information is confidential so the couple or other family members don't have to know which of their greedy friends and family are betting for or against them.

The closest thing I found on the web is weddingbetting.com which seems to be some sort of Hot or Not for weddings. Miss.

Monday, July 6, 2009

Calling the Save As / Open / Common Dialog

NOTE: I'm experiencing an error when I distribute ArcMap projects using this method. I am fairly sure this is because I have Visual Basic (Studio) 6 installed on my main development workstation, and I'm attempting to call a control from Visual Basic Studio (VB6). Calling that control without VB6 installed separately will cause the application to fail when distributed to other machines.

I am currently looking for a VBA solution to this, but the code will indeed work well in VB6.
- Updated 10/29/2009




VB has been wonderful to me so far, however I'm trying to do some exporting and needed to figure out how to navigate around the hard drive for a directory to which I can save some files. The Common Dialog is the place to look to launch the specialized dialog boxes that let a user navigate around the hard/network drives on a computer.

The CommonDialog (one word, in the Visual Basic Editor toolbox) needs to be added to the VB Toolbox, then that control needs simply to be added to your form to be called by various procedures. Here's how it works:
  • Open a new Visual Basic project
  • Insert a new UserForm, then add the following controls
    (If it's not already open, activate the VB toolbox: View :: Toolbox)


Component/Property
Command Button
Command Button
Text Box
Text Box
Name
cmdOpen
cmdSaveAs
txtOpen
txtSaveAs


  • If it's not already open, activate the VB toolbox
  • Right click in an empty gray area on the toolbox and choose Additional Controls
  • Scroll down and put an X next to "Microsoft Common Dialog Control, version x" and click OK
  • Add a CommonDialog control to the form (named CommonDialog1 by default)
  • Enter the following code for the command buttons to call the respective dialog boxes:
Private Sub cmdOpen_Click()
'Show the Open dialog
CommonDialog1.ShowOpen

'Show the selected file to open
txtOpen.Text = CommonDialog1.FileName
End Sub
_____________________________________

Private Sub cmdSaveAs_Click()
'Show the Save As dialog
CommonDialog1.ShowSave

'Show the Save As filename
txtSaveAs.Text = CommonDialog1.FileName
End Sub


Run the form, and test it by launching the Open/Save As dialogs from the respective command buttons. Selecting a file will print the path in the adjacent text box.

From here one can call CommonDialog1.FileName in the place of a static/predefined path when opening or saving files from a form.

Other Show- methods include ShowColor (see MS Paint), ShowFont, ShowHelp, and ShowPrinter.

Keywords:
ArcObjects, VBA, VB6
common dialog, CommonDialog
OpenFile
SaveFile
Save As dialog
Open dialog