Current Stories
Sunday, June 8th 2008
Remote desktop at home and port numbers12:01 PM I am a HUGE fan of remote desktop, My server lab used to contain swarms of computers, mostly junk, used for single purpose, often I would go months without using one or the other, but, when I needed it I could just turn it on and have a pre-configured {fill in the blank} server that is up and running to play with.
Enter Virtualization.
My number of test machines has absolutely exploded, I now have single purpose virtual machines, I can clone easily dispose of failures quickly, come back to successes later.
Each of my test machines is just a few files on a 6 drive, Quad core server at home, which also serves as a hardware mirror for a production server.
As my dependancy increased, my productivity "away" decreased, when I'm on the laptop, I found myself connecting to one machine at home, then from there daisy chaining to another machine so, I have an RDP session inside an RDP session. Although this works, its not as productive as having direct connections.
My home router does port forwarding and I get to "choose" which machine or virtual is becomes the weakest link.
Recently, I've discovered the registry keys (on XP) to move the RDP service to an alternative port. By default RDP is on port 3389, for my purposes, I change the last two digits of the port number to the last two digits of the IP address.
So, for the machine that would have the IP address 192.168.1.15 at home would be on port 3315. This allows me to save RDP connection files for homeaddress:3315 and connect directly to that machine.
Here are the registry keys that I use:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List]
"3389:TCP"="3389:TCP:*:Enabled:@xpsp2res.dll,-22009"
'this key is only necessary if you are using windows firewall
'I change this to:
"3315:TCP"="3315:TCP:*:Enabled:@xpsp2res.dll,-22009"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
"PortNumber"=dword:00000d3d
'00000d3d is the hex value for 3389, the Hex value for 3315 is cf3
Once those values are changed when the machine reboots, it comes back up using the new port, then all that is needed it to perform port forwarding at the router
(1) Tuesday, September 4th 2007
Screen capture, the easy way.09:56 AM Have you read a page, thinking that you would come back to it, but, later can't find it, or any reference of it, or any external confirmation that it was not just completly imaginary?
I've been asking everyone I know, "did I tell you about..." followed by, "did I send you a link to...?"
The JingProject allows you to capture either a screen, or video from your screen, similar to other products, with a difference of allowing very tight integration with their a web host.
After you complete your capture, it allows you to upload your video or screen capture directly to their web server and a URL is left on your clipboard.
Think Instant Message.
You're in a converstaion with someone, trying to describe something unsucuccessfully.
Click a hotkey (I chose control+alt+J)
Select the window or screen region that you want to capture
Click Video
Perform the action
Click Stop
Click Share
go back to your chat window and paste the URL
Its magic and exceptionally cool and simple. (3) Friday, August 31st 2007
Freebie SNTT for the Californians! Validating mailing addresses.12:05 AM Well the whole west coast actually, Im pretty sure its already tomorrow in Asia.
I recently inherited a database that, at one time had a bad input translation formula (no relation to previous post), but, as the result, all the zip codes on all the documents were zapped, proir to my comming on board..
There really was not that much data, but, I figured it was time to dig into google maps api and come up with a programatic solution.
I know that I get pretty good results pasteing partial addresses into the search bar, it comes back with whatever it can, formatted as well as it can.
I was quite amazed at how much data I could forget, and still come back with valid results.
I bookmarked this one a while ago, I new that I would come back to it at some time and it ended up being today.
http://econym.googlepages.com/example_geo.htm
Most importanly when I click the "Go!" button, while fiddler is running it shows me the data that goes back and forth, its pretty clear what the URL syntax is and what the parsing method is.
In the case of the example, they use, what years ago, I called dynamic javascript. Now that this sort of thing is in vogue, Im sure its got a flashy name, but I don't know what it is. I'm pretty sure that even though it has JSON in the URL, its not "real" JSON because its directly executed, but, none the less, I digress. I'm really much less interested in the name than how it works.
On to the code!
(0) Thursday, August 30th 2007
Consistant formulas11:19 PM By my watch, in central time, its still thurday, so I'm posting this as SNTT even though theres very little Thursday left.
I sometimes I just fustrated performing the same tasks over and over again inside the domino designer.
Often times this can't be helped, like when you have a whole bunch of rows and each one of them gets a slightly different hide formula, or a separate cell class on each cell in a column or whatever.
I recently ran into a case where I was doing a web survey, with radio buttons that should formatted the same throughout the form, but, "the same" was going to change.
I know that we needed consistent spacing and I was almost positive that domino radio button rendering would not do.
There were several things that I knew up front.
1. Whatever I put up in phase 1 would be wrong.
2. The wrong stuff specified by #1 needed to look consistant and when the new stuff comes in (likely several iterations), it also would need to be consistent.
3. I know up front that I hate, hate, hate going back and pasteing in one field after another.
Which lead me to think about the @eval function. I've been around for for a while and I've never used it. I also can't remember seeing anyone else using it, so, I thought I would give it a try.
Long story -> short it worked awsome, I was able to store a "template" for the formula of rendering my HTML then evaluate that over and over.
Well, it accomplished the goal, but, the needs were not very universal and the solution, however cool to me, was not very portable.
Soon thereafter I stumbled upon by very own personal addressbook. Look at all those phone numbers, some of them clearly were imported from outlook, some of them came from add to local addressbook within some companies domain and all of them, across the board were formatted differenly.
I'm a "data" guy, I can't help myself from wanting a consistent format. One thing for sure, is that the moment that I draw a line in the sand and state, "this is my format" I will meet someone in a new country, and the formatting will need to be updated. But, since I've done it everywhere, I will need to apply the same fix to all the places that I did previously (and don't forget any)
This seemed to me to be another oportunity for my new friend the @eval function.
I started out putting my formula in a Computed for Display field, I did my testing, it all worked fine, I did some tweeking, etc it was a wonderfull thing.
Then, at the view level I thought about selecting all then hitting my homegrown ToolsRefreshSelectedDocs, toolbar icon, but stopped because that will not work. (or maybe it will, but, I know that the lotusscript compute with form will not work), so, instead, I created a CFD field that would update a profile document that contains the formula. Profile documents are always there and rockin fast.
So, heres how I did it.
In every phone field I put this formula in the input translation formula.
@Eval( @GetProfileField( "Input";"PhoneTranslation"))
What that does is gets the string of text from the profile document and treats it like a formula and comes back with a result.
Then at the top of the form, I generated a computed for display field (marked as hidden) It had this formula.
Translate := @GetProfileField(
"Input";"PhoneTranslation");
@If( Translate!="";@Return("Set.AlreadyDone");"");
ProfileValue := "
FieldVal := @ThisValue;
WellFormed := \"{+}+{0-9-}{ }{(}+{0-9}{)}+{0-9-}\";
Extention := \"{ }{e}{ }+{0-9}\";
@If(
@Matches( FieldVal; WellFormed); @Return(FieldVal);
@Matches( FieldVal; WellFormed +Extention); @Return(FieldVal);
\"\");
StripFormat := \"+\":\" \":\"(\":\")\":\".\":\"-\":\" \";
NoFmt := @ReplaceSubstring( FieldVal;StripFormat;\"\");
RTNValue := @If(
@Left( NoFmt;1) = \"1\" & @Length( NoFmt) = 11;
\"+1 (\" +@Middle( NoFmt;1;3) + \")\" + @Middle( NoFmt;4;3) + \"-\" + @Middle( NoFmt;7;4);
@Left( NoFmt;1) != \"1\" & @Length( NoFmt) = 10;
\"+1 (\" +@Middle( NoFmt;0;3) + \")\" + @Middle( NoFmt;3;3) + \"-\" + @Middle( NoFmt;6;4);
FieldVal);
@return(RTNValue);
";
@SetProfileField(
"Input";"PhoneTranslation";ProfileValue);
Translate := @GetProfileField(
"Input";"PhoneTranslation");
@If(
Translate!="";
@Return("Set.Success");
@Return("Set.Failed")) |
I've got 12 minutes, so, Im gonna be quick about it.
If there is already a profile document stored in the database, then don't do anything, just exit out with the @return function, if that part of the @if statement is evaluated, nothing else after it, in the formula will be evaluated.
Directly after that I set the value for the ProfileValue field, notice that there is an opening quote on the first line, then that statement goes on until the closing quote & semicolon several lines down.
Thats the part that I expect will need to change later, but, I don't know how. When it does change it will need to change everywhere.
So, I set the value into the profile field in the next line, directly after that I read it back.
Now, I didn't do any testing here, but, I assumed that "SOMETHING" could go wrong. I'm not sure what could go wrong in my personal addressbook, but, just in case I check the value, then promptly do nothing with the result of my check.
Wow, and me with 2 minutes to spare. (0) Friday, July 20th 2007
Hiding Column Formulas - Development tip01:11 PM Most of my work recently has been web based, and the users don't have client access to the databases. All maintenance and other nondevelopment activity is done over the web.
So, sometime I don't hide HTML based view columns, I just leave them showing so, as I'm developing if I need to look at the raw generated HTML its very easy.
Recently I've had the desire for a "visible sometimes" column, which leads me to this quick post. If the concept was any more difficult, I would take forever to make the post, then finally quit writing before completion.
On the column properties (beanie tab) use this formula:
@Environment( "ShowHiddenColumns" )!="Yes"
Then create a toolbar button with this formula:
EnvName:="ShowHiddenColumns";
NewVal:=@If(@Environment( EnvName )="Yes";"No";"Yes");
@Environment( EnvName ;NewVal)
The only thing that is missing is refreshing the view, currently, I have to switch to a different view, then back to the one with the "sometimes hidden" column
Bonus tip:
I always label my column headers beginning with "H-" and change the label color to red. Since this is only seen in then designer its helpful to separate programmatic columns VS display columns.
Bonus tip 2:
For hidden columns that are used to return data (like @implode(fullname:address:city:state:zip;"~")), the column number is important, concider putting it in the label like this:
H-Column 5-Lookup
Also concider puting the lookup values in column 1 if your not sorting on it. That allows your lookup views to also be used and customized for developer maintenance too.
Anyone still reading?
(3) Tuesday, February 13th 2007
Initial thoughts about rprwyatt and dominofile SPAM01:03 PM My first contact with rprwyatt was through spam that I received from dominofiles. My gut feel is that any company that's product is not able to stand on its own without resorting to spam, is probably not very good, but, I have no knowlege whatsoever about them as a company (other than they've shown me they work with spammers).
Bruce blogged about dominofiles last month .
I sent my opt out request to dominofiles (twice), but, to no avail, they bounced the first one back to me and didnt act on the second.
I've chatted with Bruce and he tells me that he does not get dominofiles spam anymore, so, it seems that I must blog about this problem to get it resolved. (worked for Bruce!)
I don't believe it is my responsiblity to beg and plead to be removed from a list. Any reputable company would not want to annoy a potential customer, which leads me to believe dominofiles may not be reputible, and possibly rprwyatt by association.
It reflects poorly on rprwyatt and any other companies that choose to use dominofiles as an advertising medium.
I believe that honest mistakes happen and a company's virtues can be measured, by their reaction when it's drawn to their attention.
What do you think blogosphere?
Should rprwyatt be held accountable for the actions of the vendors they choose?
(2) Monday, November 13th 2006
Don't Debug Lotusscript03:35 PM The last time I blogged (is that a word?) was about 2 months ago, I was burried in a project, but I proposed a solution to the problem, where a developer is using the debugger, then has to switch gears and read or write an email.
Invariably for me, I forget to turn the debugger off and have to hit the continue button to in the lotusscript debugger to be able to actually do, what I wanted.
The solution that I proposed was to set the design hidden flag in the mailfile.
Now that I've got a little time, I was able to write the code for it here, its real rough code, but, it does the job.
Unfortunatly, it does not work.
What notes is actually using it the existence of a field called $$FormScript on the form design element.
I wrote the code that does that here and it seems to work fine.
When you run it, it works like a toggle.
If the agent has run before, it reverts out the changes it made previously
If the agent has not run before, it will make backup copies of the $$FormScript item on the "Memo", "Reply" and "Reply With History" forms and protect them from the designer task that runs on the server at night.
Its designed to be placed as an agent in your mailfile.
(2) Wednesday, September 6th 2006
How do I set this database property?09:24 AM Yesterday, I recieved an email with the subjet "How do I set this database property?" and a link to this graphics
http://www.domnotes.de/heini/home.nsf/perma?OpenView&RestrictToCategory=6-09-05-134346
I should state for the record that, I have an API background and have been able to pull stuff out of, um, well, my ear in the past for this guy, so, I took the request seriously. I researched it and came to the conclusion that the graphics was a photoshop job, a fake!
Then it was brought to my attention that, it was a joke, he knew it was a fake and I should have found it funny. I was in a heads down coding mode and was just too dense to see the humor. I seriously wanted the feature. When I'm coding, I live with the LotusScript Debugger on, then someone sends me an email and I forget the debugger is on, you know the story, it's not a crisis, but, it is quite a pain in the ear.
I was also too dense to let it drop.
So, heres how you set the property.
When replacing design, you can optionally hide the design of your database. That will disable debugging of LotusScript
Tada!
Now, I'm a developer and I like to see the design of my mail file from time to time, I'll look at one thing of the other in the mail file design. But, I think this is a trade-off that I'm willing to make, when I need to look at the design, I can look at the template.
(2)