Auto-scaling in Azure with PowerShell Cmdlets

by Doug Finke on February 7, 2010

in Azure, PowerShell

This post Auto-scaling in Azure shows a proof of concept for auto-scaling an Azure Solution and the different options that you have for implementing a similar solution.

At the end, the author provides a PowerShell example using the Windows Azure Service Management CmdLets

Add-PSSnapin AzureManagementToolsSnapIn            

Get-HostedService $serviceName -Certificate $cert -SubscriptionId $subId |
Get-Deployment -Slot Production |
Set-DeploymentConfiguration `
  {$_.RolesConfiguration[$roleName].InstancesCount+=1}
            

{ 0 comments }

Gesture Cube

by Doug Finke on February 7, 2010

in Gesture Cube, Microsoft Surface

A portable Microsoft Surface? No need to touch – just give it a wave!

{ 0 comments }

There clearly needs to be a successor to Java

by Doug Finke on February 7, 2010

in Groovy, Java, Scala

Will Groovy++ spell the end of Scala?

As much as we all "try to be friends", the successor to Java (and there clearly needs to be one) "battle" continues

via blue train software

Groovy++ adds to Groovy static typing with very little in terms of trade off (meta programming)

  • Allowing mixing of static and dynamic code in the same application.
  • Same speed as Java – sometimes faster, sometimes slower depending on how the problem is expressed.
  • Groovy++ is really Java ++ and is thus a natural and easy path for the millions of Java programmers.
  • Groovy not being controlled by the boffins at Snoracle hopefully means innovation in the platform can happen much faster and address real developer needs.

Others in the community counter that Scala is ~50 times faster than Groovy++.

{ 1 comment }

Rockford Lhotka has a three part series here discussing the benefits and usage of the SQL Server Modeling technologies in the context of his CSLA .NET framework. It is a framework for building the business logic layer in your applications.

He demonstrates modeling, a DSL (domain specific language), code savings, reduced testing burden, and consistency of the user experience.

{ 0 comments }

PowerShell New-PSCustomObject

by Doug Finke on January 24, 2010

in New-Object, PSObject, PowerShell

Karl Prosser posts a PowerShell script quick and dirty new custom object as a way to create PowerShell objects on the fly. I’ve come across the need for this and posted an approach PowerShell Function Factory after reading up on Managing Records in Python.

Yet Another Approach To Building Custom Objects

This function peels off two items at a time placing them in $key and $value, $list gets the remainder (it has two fewer items now). Then key/value pair is added to the $Properties hash table. The while loop continues until $list is empty.

After the $Properties hash table is built up, a new PSObject is returned with those properties created and populated by using the –Property parameter on New-Object.

Function New-PSCustomObject ($list) {
    $Properties = @{}            

    while($list) {
        $key, $value, $list = $list
        $Properties.$key = $value
    }            

    New-Object PSObject -Property $Properties
}            

Function ql {$args}            

New-PSCustomObject ( ql Name "John Doe" Age 10 Height (6*12) )

Result

image

Still rolling this around in my head. Love to hear other approaches. Plus, this may show up in PowerShell Version 3.

UPDATE

Thanks to Nivot Ink for a terser approach.

while($key, $value, $list = $list) {
    $Properties.$key = $value
}                        

{ 5 comments }

WCF WebHttp Services in .NET 4

by Doug Finke on January 24, 2010

in .NET 4.0, WCF, WebHttp

Introducing WCF WebHttp Services in .NET 4

Have your used WCF 3.5 or the WCF REST Starter Kit to build non-SOAP services?

WCF WebHttp Services is the vehicle that brings these technologies forward to .NET 4.

New to WCF or have only used WCF for building SOAP-based services, this series of blog posts will bring you up to speed quickly.z

{ 1 comment }

9-Year-Old is World’s Youngest Microsoft Certified Systems Engineer

via Twitterville

{ 1 comment }

Techniques, Tools, Languages, and Platforms.

What Are the Trends in Technology Today?

{ 0 comments }

Andy Bryant has some ActionScript Puzzlers over here. So, let’s try them in PowerShell.

So the question is what does the call to loopy() return?

The answer is BEE,BOP,BOP,BOO. The extra BOP is the same result as the ActionScript and the same reason:

Although it appears that caps is defined only within the for loop, it is actually defined at the scope of the function. Therefore for the second null in the array, caps was not overwritten, but instead retained its value from the previous iteration of the loop.

Function loopy {
    $names = $null, "bee", "bop", $null, "boo"
    $result = @()            

    $names | % {
        if($_) {
            $caps = $_.ToUpper()
        }            

        if($caps) {
            $result+=$caps
        }
    }            

    $result -join ","
}            

loopy

Good stuff. Hope to get more time to check out the other puzzles. If you add $caps = “” before the first if statement the extra BOP is solved.

{ 3 comments }

Charles Fleischer delivers a hysterical send-up of a time-honored TED theme: the map. Geometry, numbers, charts and stamp art also factor in (somehow), as he weaves together a unique theory of everything called "Moleeds."

{ 1 comment }