Create your own. Just give them the link to an image on the web.
I grabbed the Sydney Harbor Bridge, pasted it in the site and embedded the script here.
Zoom.it runs on Windows Azure. Plus, they have and API.
{ 0 comments }
Create your own. Just give them the link to an image on the web.
I grabbed the Sydney Harbor Bridge, pasted it in the site and embedded the script here.
Zoom.it runs on Windows Azure. Plus, they have and API.
{ 0 comments }
Chris Lovett posts From Research to Product
I really love taking the coolest stuff that comes out of research, and finding ways to productize that and ship it in our products…
Three years ago I blogged about the Microsoft Research tool PowerShell + GLEE – Graph Layout Execution Engine.
Since then it
{ 0 comments }
I’ve been working with OData and decided to build, and make available on CodePlex, an OData PowerShell Explorer that let’s you access and drill down on a service from either the command line or the GUI.
The Open Data Protocol (OData) is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today.
One of the many interesting parts of this open source module is, it is a GUI written in PowerShell built on top of PowerShell code. You can either use the GUI to navigate the data or do it directly at the command line. Both are driven by the OData PowerShell module.
Another interesting note is the GUI’s ‘Drill Down’ buttons dynamically change depending on which service and collection you are viewing.
Same goes for the command line objects. The objects methods are dynamically built on the fly as you navigate the details of a collection and drill down.
Using the OData PowerShell module at the command line blends the power of Open Data Protocol for sharing and PowerShell’s great range of cmdlets to slice, dice, transform and store data.
In a few lines of PowerShell you can fetch information from several data services and then export them to Excel, Databases, XML and more.
The PowerShell OData module also supports OData query options like $expand, $filter, $top, $skip and more. So for example you could do this:
Import-Module C:\CodePlex\psodata\trunk\modules\OData.psm1 $netflix = New-ODataService "http://odata.netflix.com/Catalog" $netflix.People("`$filter=endswith(Name, 'Abbott')") # Results Id Name -- ---- 189 Bruce Abbott 190 Bud Abbott 196 George Abbott 20006674 Mark Abbott 20013692 Philip Abbott 20017929 John Abbott 20018086 David Abbott 20031575 Abdul Malik Abbott 20038388 Diahnne Abbott 20045891 Annie Abbott 20057657 Jennifer Abbott 20057988 Norman Abbott .....
There are many ways to subset the data. This is faster because there is less data returned from the remote server. An alternative would eliminate the $filter query option and use PowerShell’s Where-Object {$_.name.EndsWith(‘Abbott’)}. The tradeoff being that all the data is fetched from the server and then subsetted.
I’ll continue to grow the PowerShell module to encompass additional features and surface them in the GUI as well.
Meanwhile grab the code and let me know what you think.
{ 1 comment }
I enjoyed reading Rob Conery’s post The Reasons I Like Ruby. He has a nice example where he wants to import a list of countries from an online file.
$url = "http://openconcept.ca/sites/openconcept.ca/files/country_code_drupal_0.txt" $wc = New-Object Net.WebClient ($wc.DownloadString($url)).Split("`r`n") | ForEach { $countryCode, $countryName = $_.Split('|') New-Object PSObject -Property @{ CountryCode = $countryCode CountryName = $countryName } }
$url = "http://openconcept.ca/sites/openconcept.ca/files/country_code_drupal_0.txt" $wc = New-Object Net.WebClient $wc.DownloadString($url) | ConvertFrom-Csv -Delimiter "|" -Header CountryCode, CountryName
Both versions return an array of objects (.NET objects), each object has two properties. CountryCode, CountryName
# Results CountryName CountryCode ----------- ----------- AF Afghanistan AL Albania DZ Algeria AS American Samoa AD Andorra AO Angola AI Anguilla AQ Antarctica
It’s safe to say that with C# and System.Net it’s just a bit longer. Not that much longer – but you’d have to have a pretty practiced hand to get through the "machine noise" that begins to creep in. – Rob Conery
{ 2 comments }
I am enjoying Rob Conery’s posts, his latest is Why I Like Ruby, Part 2: Blocks.
Code blocks and closures are nothing new to programming – you can find them in most OO (object oriented) languages – Rob Conery
What we call scriptblocks in PowerShell are called anonymous functions or sometimes lambda expressions in other languages. A number of languages, including Python and dialects of LISP, still use lambda as a language keyword.
Windows PowerShell in Action – Bruce Payette
This example shows how to use PowerShell scriptblocks to reduce repetitive code. It is also the application of the DRY Principle, Don’t Repeat Yourself.
Download the Chinook Database for the sample XML.
$xml = [xml][system.io.file]::ReadAllText( "C:\ChinookDatabase1.1\SampleData\ChinookData.xml" ) Write-Host "Loading artists" $xml.ChinookDataSet.Artist | foreach { "{0} {1}" -f [int]$_.ArtistId, $_.Name } Write-Host "Loading genres" $xml.ChinookDataSet.Genre | foreach { "{0} {1}" -f [int]$_.GenreId, $_.Name }
The code works but it’s not pretty and repeats itself. Also, say you were to change the name of the dataset from ChinookDataSet to TempDataset you’d have to do it in two places. Let’s improve it.
$xml = [xml][system.io.file]::ReadAllText( "C:\ChinookDatabase1.1\SampleData\ChinookData.xml" ) function Parse-Key ($key, $code){ $xml.ChinookDataSet.$key | foreach { & $code } } Parse-Key Artist { "{0} {1}" -f [int]$_.ArtistId, $_.Name } Parse-Key Genre { "{0} {1}" -f [int]$_.GenreId, $_.Name }
Here we are calling the Parse-Key function and passing in the name of the key we want, Artist. We are also passing in a scriptblock. In the ForEach, we use the call operator & to execute that scriptblock and leverage closures. The $_is evaluated in the context of the ForEach in Parse-key function.
A closure is a first-class function with free variables that are bound in the lexical environment.
{ 2 comments }
The New York Times Developer Network released the Congress API back in January, Announcing the Congress API.
Lets developers access information about Congressional representatives and their votes
Here is their write up Using the Congress API With Spreadsheets.
First, you’ll need and API key. Using the .NET Webclient namespace makes easy work of grabbing the XML and displaying it in Out-GridView.
$url = "http://api.nytimes.com/svc/politics/v3/us/legislative/congress/111/house/members/leaving?api-key=<YOUR KEY>" $wc = New-Object Net.Webclient $xml = [xml] ($wc.DownloadString($url)) $xml.result_set.results.members.member | select first_name,last_name, party, state, status, note | sort last_name | Out-GridView
$url = "http://api.nytimes.com/svc/politics/v3/us/legislative/congress/111/house/members/leaving?api-key=$apiKey" $wc = New-Object Net.Webclient $xml = [xml] ($wc.DownloadString($url)) $xml.result_set.results.members.member | group party -NoElement # Results Count Name ----- ---- 26 D 22 R
{ 1 comment }
The company I was with for the last 3 years went bananas. Seems they merged with a new company and migrated their client base.
The migration was less than optimal. Slower network and they lost a bunch of my data. Every interaction with customer support was turned around saying I had a browser problem, cookie issues or network delays on my side.
{ 0 comments }
Into double digits.
I heard the same thing about VBScript years ago, about C++ a decade earlier, and being aware that I am dating myself here, about C, Pascal, Windows Programming, VI, Emacs, punch cards, VT100 terminals and about rubbing two sticks together to start a fire.
{ 0 comments }
Based on the ancient art of origami, the sheets are edged by foil actuators–thin, solid-state motors–that contract or expand when they receive an electric current from flexible electronic circuits embedded in the sheets. After they achieve their preprogrammed shape, the sheets are held in place by tiny magnets on the edges of the fold joints.
{ 0 comments }
CodeStock 2010 is over. Lots of PowerShell sessions (and others) plus great speakers. Should be some good decks and samples popping up this week.
Get-ChildItem | ForEach {$_} |
|
{ 0 comments }