Archive
Running an App from Ares to a real Palm Pre
How cool is this, there is an “easter egg” in the palm pre, if you type upupdowndownleftrightleftrightbastart you enter developer mode
Which allows you run apps direct from Palm ares to the palm pre via a USB cable.
I’ve also updated my app, so that it can run in multiple orientations, has validation, and responds properly once the AJAX call returns…
Palm App store awaits
function MainAssistant(argFromPusher) {}
MainAssistant.prototype = {
setup: function() {
Ares.setupSceneAssistant(this);
},
cleanup: function() {
Ares.cleanupSceneAssistant(this);
},
btnSendTap: function(inSender, event) {
// Make an Ajax call to FreebieSMS.co.uk
Mojo.Log.info(“btnSendTap invoked”);
var xref=this;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState!=4) return;
if (xmlhttp.status != 200)
{
Mojo.Controller.errorDialog(xmlhttp.responseText.split(“\n”)[0]);
Mojo.Log.info(xmlhttp.responseText);
xref.controller.get(‘btnSend’).mojo.deactivate();
// hide spinner
}
if (xmlhttp.status == 200)
{
xref.controller.showAlertDialog({
onChoose: function(value) {},
title: “Success”,
message: “SMS message sent successfully”,
choices:[
{label: “OK”, value:””},
]
});
xref.controller.get(‘btnSend’).mojo.deactivate();
}
}
// Ensure that a Destination is provided
if (this.$.tfTo.getValue().indexOf(“0044”)!=0)
{
Mojo.Controller.errorDialog(“Recipients phone number must start with 0044.”);
xref.controller.get(‘btnSend’).mojo.deactivate();
return false;
}
// Ensure From-Mobile number is international format
if (this.$.tfFrom.getValue().indexOf(“00”)!=0)
{
Mojo.Controller.errorDialog(“Your phone number must begin with an international prefix (0044 for UK).”);
xref.controller.get(‘btnSend’).mojo.deactivate();
return false;
}
// Ensure names are filled in
if (this.$.tfFromName.getValue().length<3 || this.$.tfFromName.getValue().length>11)
{
Mojo.Controller.errorDialog(“Your name must be between 3 and 11 letters long.”);
xref.controller.get(‘btnSend’).mojo.deactivate();
return false;
}
// Ensure message is not blank
if (this.$.tfMessage.getValue().length==0)
{
Mojo.Controller.errorDialog(“Your message is blank. Please type a message in the box provided”);
xref.controller.get(‘btnSend’).mojo.deactivate();
return false;
}
if (this.$.tfFrom.getValue() == this.$.tfTo.getValue())
{
Mojo.Controller.errorDialog(“You cannot send a text to yourself”);
xref.controller.get(‘btnSend’).mojo.deactivate();
return;
}
var strUrl = “http://www.freebiesms.co.uk/sendsms.asmx/SendSms?”;
strUrl += “FromName=” + this.$.tfFromName.getValue();
strUrl += “&FromNumber=” + this.$.tfFrom.getValue();
strUrl += “&ToNumber=” + this.$.tfTo.getValue();
strUrl += “&Message=” + this.$.tfMessage.getValue();
strUrl += “&locale=en-GB”;
xmlhttp.open(“GET”,strUrl,true);
xmlhttp.send();
// Show waiting spinner
}
};
Sending SMS from Palm Ares in WebOS
One of my first forrays into using the Palm Ares online IDE for the Palm pre, is to create an app that can send SMS. So, I created a basic interface, to / from / Message, and Send button.
Attaching an event to the send button is easy, just select the button, go to the events tab, then select onTap. I also named all the labels and text fields properly.
The WebOS code then is as follows (much of it is auto-generated, except for the onTap event)
function MainAssistant(argFromPusher) {}
MainAssistant.prototype = {
setup: function() {
Ares.setupSceneAssistant(this);
},
cleanup: function() {
Ares.cleanupSceneAssistant(this);
},
mainTap: function(inSender, event) {
},
button1Tap: function(inSender, event) {
},
btnSendTap: function(inSender, event) {
// Make an Ajax call to FreebieSMS.co.uk
this.$.lblMessage.setLabel(“btnSendTap invoked”);
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4)
{
this.$.lblMessage.setLabel(xmlhttp.responseText);
}
}
var strUrl = “http://www.freebiesms.co.uk/sendsms.asmx/SendSms?”;
strUrl += “FromName=” + this.$.tfFromName.getValue();
strUrl += “&FromNumber=” + this.$.tfFrom.getValue();
strUrl += “&ToNumber=” + this.$.tfTo.getValue();
strUrl += “&Message=Hello+From+ARES”;
strUrl += “&locale=en-GB”;
this.$.lblMessage.setLabel(“strUrl created”);
xmlhttp.open(“GET”,strUrl,true);
xmlhttp.send();
this.$.lblMessage.setLabel(“AJAX called”);
}
};
The full project, as it stands can be downloaded from
https://sites.google.com/site/freesmsuk/Home/palm-ares-sms
Once it’s more complete, then I’ll post it on my SMS blog
The joys of installing TFS
The core infrastructure for Team Foundation Server was configured successfully. However, there was a problem or delay during the creation of your initial Team Project Collection. Launch the Team Foundation Administration Console, and review the current status on the Team Project Collection node.
Important Information:
You must create at least one team project collection before you can use the features of Team Foundation Server. You can create a team project collection by using the New Team Project Collection Wizard from the Team Foundation Administration Console. For more information, see this topic on the Microsoft Web site: How to: Create a Team Project Collection.
Before you run the New Team Project Collection Wizard, you should open the configuration log and then review and correct any errors and warnings about the failure.
Warning TF205018: An error occurred when attempting to save the mapping from the SharePoint Web application to Team Foundation Server. The SharePoint Web application is: http://fiach/. The error is: TF250067: No connection could be made to Team Foundation Server at the following address: http://fiach:8080/tfs. Either the specified URL does not point to a server that is running Team Foundation Server, the server is not available, or the service account for SharePoint Products does not have sufficient permissions on that server. The service account for SharePoint Products might not have been added to the required group in Team Foundation Server. For more information, see the Microsoft Web site (http://go.microsoft.com/fwlink/?LinkId=161206)..
Warning [2010-10-07 10:58:40Z] Servicing step Configure SharePoint Settings failed. (ServicingOperation: Install; Step group: Install.TfsSharePoint)
Warning TF255271: The team project collection could not be created. The number of steps before the completion of project creation is: 120. The number of steps completed before the failure was 0.
Information During the process of configuring SharePoint Products for use with Team Foundation Server, a new IIS Application Pool was created for the following Web site: ‘localhost’. If you had applications running on that Web site, they might have been affected.
Information Firewall exception added for port 8080
Information The time allowed for Windows services to start was increased from 30 seconds to 600 seconds. This affects all Windows services on this server. (The registry value set is HKLM\SYSTEM\CurrentControlSet\Control\!ServicesPipeTimeout.)
Information Firewall exception added for port 17012
Information Firewall exception added for port 80
TF250034: An access grant could not be found between Team Foundation Server and the SharePoint Web application that you specified. The Team Foundation Server ID is: 4bc24d2f-64ca-49b8-b1c0-c251bacee4d9. The SharePoint Web application is: http://fiach/sites/Test. You must grant access for the Web application in the Team Foundation Administration Console.
[2010-10-07 11:16:57Z][Error] TF252031: A SharePoint site could not be created for the team project collection. The following error occurred: TF250034: An access grant could not be found between Team Foundation Server and the SharePoint Web application that you specified. The Team Foundation Server ID is: 4bc24d2f-64ca-49b8-b1c0-c251bacee4d9. The SharePoint Web application is: http://fiach/sites/Test. You must grant access for the Web application in the Team Foundation Administration Console.
TF252031: A SharePoint site could not be created for the team project collection. The following error occurred: TF250034: An access grant could not be found between Team Foundation Server and the SharePoint Web application that you specified. The Team Foundation Server ID is: 4bc24d2f-64ca-49b8-b1c0-c251bacee4d9. The SharePoint Web application is: http://fiach/sites/Test. You must grant access for the Web application in the Team Foundation Administration Console.
[Info @11:17:20.073] [2010-10-07 11:16:57Z][Informational] Microsoft.TeamFoundation.TeamFoundationServerException: TF252031: A SharePoint site could not be created for the team project collection. The following error occurred: TF250034: An access grant could not be found between Team Foundation Server and the SharePoint Web application that you specified. The Team Foundation Server ID is: 4bc24d2f-64ca-49b8-b1c0-c251bacee4d9. The SharePoint Web application is: http://fiach/sites/Test. You must grant access for the Web application in the Team Foundation Administration Console. —> Microsoft.TeamFoundation.TeamFoundationServerException: TF250034: An access grant could not be found between Team Foundation Server and the SharePoint Web application that you specified. The Team Foundation Server ID is: 4bc24d2f-64ca-49b8-b1c0-c251bacee4d9. The SharePoint Web application is: http://fiach/sites/Test. You must grant access for the Web application in the Team Foundation Administration Console. —> System.Web.Services.Protocols.SoapException: TF250034: An access grant could not be found between Team Foundation Server and the SharePoint Web application that you specified. The Team Foundation Server ID is: 4bc24d2f-64ca-49b8-b1c0-c251bacee4d9. The SharePoint Web application is: http://fiach/sites/Test. You must grant access for the Web application in the Team Foundation Administration Console.
— End of inner exception stack trace —
at Microsoft.TeamFoundation.Client.SharePoint.SharePointTeamFoundationIntegrationService.HandleException(Exception e)
at Microsoft.TeamFoundation.Client.SharePoint.SharePointTeamFoundationIntegrationService.CheckUrl(String absolutePath, CheckUrlOptions options, Guid configurationServerId, Guid projectCollectionId)
at Microsoft.TeamFoundation.Client.SharePoint.WssUtilities.CheckUrl(ICredentials credentials, Uri adminUrl, Uri siteUrl, CheckUrlOptions options, Guid configurationServerId, Guid projectCollectionId)
at Microsoft.TeamFoundation.Server.Servicing.TFCollection.SharePointStepPerformer.CheckCreateSite(TeamFoundationRequestContext requestContext, Uri adminUri, Uri siteUri)
— End of inner exception stack trace —
at Microsoft.TeamFoundation.Server.Servicing.TFCollection.SharePointStepPerformer.CheckCreateSite(TeamFoundationRequestContext requestContext, Uri adminUri, Uri siteUri)
at Microsoft.TeamFoundation.Server.Servicing.TFCollection.SharePointStepPerformer.ConfigureSharePoint(String stepData, ServicingContext servicingContext, Boolean validateOnly)
at Microsoft.TeamFoundation.Framework.Server.TeamFoundationStepPerformerBase.Microsoft.TeamFoundation.Framework.Server.IStepPerformer.ValidateStep(String servicingOperation, String stepType, String stepData, ServicingContext servicingContext)
at Microsoft.TeamFoundation.Framework.Server.ServicingStepDriver.PerformServicingStep(ServicingStep step, ServicingContext servicingContext, ServicingStepGroup group, ServicingOperation servicingOperation, Boolean validateOnly)
[Info @11:17:20.073] [2010-10-07 11:16:57Z] Servicing step Configure SharePoint Settings failed. (ServicingOperation: Install; Step group: Install.TfsSharePoint)
[Info @11:17:20.073] [2010-10-07 11:16:57Z][Informational] Clearing dictionary, removing all items.
[Error @11:17:20.073] The servicing operation failed.
Rarely shown due to low quality score
I spotted this text appearing in Google Adwords “Rarely shown due to low quality score”, and tried to uncover why ads were not displaying in Google’s main search.
- Keyword relevance: No problems
- Landing page quality: Poor
- Landing page load time: No problems
- usefulness and relevance of information provided on the page
- ease of navigation for the user
- page loading times
- how many links are on the page
- how links are used on the page
Discount coupon for Application lifecycle management
Get a 40% discount off this book “Professional Application Lifecycle management” by quoting ALMVS to Jeffry Parker at jparker@wiley.com
Change the framework version without restarting the W3SVC service
When changing the .NET version on the ASP.NET tab of IIS, this popup appears, asking to restart IIS, or run aspnet_regis -norestart to change the scriptmap without restarting.
1. Download metabase explorer, as part of the IIS6 resource kit here
http://www.microsoft.com/DownLoads/en/details.aspx?familyid=56fc92ee-a71a-4c73-b628-ade629c89499&displaylang=en
2. Run Metabase explorer, Select LM then W3SVC
3. Find the ID that matches the site you want to upgrade
4. Go to C:WINDOWSMicrosoft.NETFrameworkv4.0.30319 with Command Prompt
5. type aspnet_regiis.exe -norestart -s W3SVC/<ID>/ROOT where <ID> is from step 4.
6. Clicking the ASP.NET tab in IIS, it should now be .NET 4.
Make a HTTP request from SQL server
**Update**
A better approach is listed here: https://blog.dotnetframework.org/2019/09/17/make-a-http-request-from-sqlserver-using-a-clr-udf/

Here is a UDF that allows HTTP GET requests from SQL server, for example
select dbo.GetHttp(‘http://fiachsapp.appspot.com/’)
A few “Gotcha’s” are;
* The HTML Content must be less than 8000 bytes, otherwise you get the error:
0x8004271A ODSOLE Extended Procedure Error in srv_convert.
* The COM object WinHttp.WinHttpRequest.5.1 must be installed on the server, some typical variations are WinHttp.WinHttpRequest.5
and WinHttp.WinHttpRequest. A search for the CLSID in Regedit should find the one you are using.
* You have to enable OLE Automation on the SQL server as follows;
sp_configure ‘show advanced options’, 1;
GO
RECONFIGURE;
GO
sp_configure ‘Ole Automation Procedures’, 1;
GO
RECONFIGURE;
GO
Alter function GetHttp
(
@url varchar(8000)
)
returns varchar(8000)
as
BEGIN
DECLARE @win int
DECLARE @hr int
DECLARE @text varchar(8000)
EXEC @hr=sp_OACreate ‘WinHttp.WinHttpRequest.5.1’,@win OUT
IF @hr <> 0 EXEC sp_OAGetErrorInfo @win
EXEC @hr=sp_OAMethod @win, ‘Open’,NULL,’GET’,@url,’false’
IF @hr <> 0 EXEC sp_OAGetErrorInfo @win
EXEC @hr=sp_OAMethod @win,’Send’
IF @hr <> 0 EXEC sp_OAGetErrorInfo @win
EXEC @hr=sp_OAGetProperty @win,’ResponseText’,@text OUTPUT
IF @hr <> 0 EXEC sp_OAGetErrorInfo @win
EXEC @hr=sp_OADestroy @win
IF @hr <> 0 EXEC sp_OAGetErrorInfo @win
RETURN @text
END
Find when a stored procedure was last modified
SELECT * FROM [database].sys.objects WHERE type = ‘P’
This gives the following fields:
name
object_id
principal_id
schema_id
parent_object_id
type
type_desc
create_date
modify_date
is_ms_shipped
is_published
is_schema_published
How to: Make Thread-Safe Calls to Windows Forms Controls without delegates
private void SetText(string text)
{
// InvokeRequired required compares the thread ID of the
// calling thread to the thread ID of the creating thread.
// If these threads are different, it returns true.
if (this.textBox1.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(SetText);
this.Invoke(d, new object[] { text });
}
else
{
this.textBox1.Text = text;
}
}
Which omits the code for the SetTextCallback delegate, which over time, can clutter up your application.
Instead, I would suggest using an Action<T> as follows:
var d = new Action<string>(SetText);
DNS round robbin with failover
I’ve noticed that NS records in DNS also work on a round robbin feature, NS records also alternate.
This implies that you could create a distributed load balancer with failover using only DNS
Server A ip (Multihomed; 1.1.1.1 and 1.1.100.1)
NS NS1.SERVER.COM
NS NS2.SERVER.COM
A NS1 1.1.1.1
A NS2 1.1.100.1
A www 1.1.1.1
Server B ip (Multihomed; 2.2.2.2 and 2.2.200.2)
NS NS1.SERVER.COM
NS NS2.SERVER.COM
A NS2 2.2.2.2
A NS1 2.2.200.2
A www 2.2.2.2
SERVER.COM delegated with nameservers NS1.SERVER.COM and NS2.SERVER.COM
Now, the A records are not load balanced but the NS records are.
So theoretically, a DNS client, connecting randomly to NS1 or NS2 will be given either 1.1.1.1 or 2.2.2.2 as an IP address, depending
on what nameserver it contacted.
If the DNS on NS1 goes down, then the client will automatically contact NS2. and be given server 2’s IP address. The logic being, that if the DNS
server is down, the webserver probobly is too.
In this case, the A records are not load balanced but the NS records are.
I assume this would not get past ZoneCheck for delegation of some top level domains like .fr, .de or .no, but it might work for a .com
