Development by Davis

Headlines

jueves, 14 de marzo de 2013

Development by Davis: “Open Thread: Evolving the library for the 21st century” plus 11 more

Development by Davis: “Open Thread: Evolving the library for the 21st century” plus 11 more


Open Thread: Evolving the library for the 21st century

Posted: 14 Mar 2013 02:00 AM PDT

open thread thursday

Chances are good that you've been to a library and used its resources. Kids check out colorful, educational books; adults seek out entertainment and information; and academics of all ages use libraries as a place to work, meet, and discover resources.

Today, there is a national discussion around the role of libraries in public and academic sectors.

read more

Retrieving RSS feeds for Twitter and Facebook

Posted: 14 Mar 2013 01:32 AM PDT

You might need to analyze RSS feeds from different pages in order to get information and latest news from a channel. Facebook and Twitter are probably the most interesting, but there's no easy specific API.

Fortunately it is possible to retrieve the RSS feed 2.0, that is XML, in a pretty easy way. The following URL allows retrieving the RSS feed of a Facebook page (not user profile):

https://www.facebook.com/feeds/page.php?id=pageidnumber&format=rss20

Where pageidnumber is the id of the desired page. For instance, the Facebook address for my VB community in Italy is the following:

https://www.facebook.com/feeds/page.php?id=295804250449780&format=rss20

About Twitter, you can retrieve a feed like this:

https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=username

Where username is the account name of the person you are following. For instance, this is the RSS feed for the profile of my Italian VB community:

https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=vbtipsandtricks

You might find this useful 

Alessandro

Windows Phone: picking up contacts in code

Posted: 14 Mar 2013 01:25 AM PDT

In Windows Phone apps, you can easily pick up contacts from the contact list in code. You simply need to use a chooser called Microsoft.Phone.Tasks.AddressChooserTask.

You define an instance:

    Private contattoSelezionato As String         Dim WithEvents addressChooser As AddressChooserTask         Public Sub New()          InitializeComponent()          Me.addressChooser = New AddressChooserTask       End Sub

Then you invoke Show to start the chooser:

addressChooser.Show()  

To determine the returned contact, you handle the Completed event and you read the value only if the user has confirmed her choice (the TaskResult.OK value from the TaskResult enum):

    Private Sub addressChooser_Completed(sender As Object, e As AddressResultHandles addressChooser.Completed          If e.TaskResult = TaskResult.OK Then              Me.contattoSelezionato = e.DisplayName          End If      End Sub

Other than the DisplayName you can also retrieve the Address , which is actually the value that determines the difference between contacts with the same name or between elements belonging to the same contact.

Alessandro

A VS2012 extension to use the WinRT APIs in desktop apps

Posted: 14 Mar 2013 01:20 AM PDT

Anyone who has ever built for Windows 8 and the Windows Runtime probably wondered how it is possible to use WinRT in desktop applications.

Even though with some limitations, this is possible and requires some manual steps so that a project can reference Windows 8's libraries.

Lucian Wischik  has published an interesting extension for Visual Studio 2012, which adds a Console app project template which is ready to take advantage of WinRT.

Such an extension is available from the Visual Studio Gallery at this address, where you will also find hints for the usage.

Lucian has also published an article on CodeProject, where he provides detailed information about this scenario.

Remember that som APIs from WinRT cannot be used on the desktop for privacy and security reasons, especially those related to some devices and that work in a sandboxed environment.

Alessandro

WinRT: ho to solve if ListView and GridView lose their way

Posted: 14 Mar 2013 01:14 AM PDT

In a Windows Store App I've been working on, I had to face a particular problem. It is a problem that can randomly occur with the GridView and ListView controls and it probably depends on the DataTemplate you use.

Consider the following GridView:

                <GridView Name="MyView" ItemsSource="{Binding}" Margin="0,15,0,0" HorizontalAlignment="Left">                      <GridView.ItemTemplate>                          <DataTemplate>                              <!-- custom DataTemplate -->                          </DataTemplate>                      </GridView.ItemTemplate>                  </GridView>  

In this page I have this object; then I navigate to a secondary page. From the secondary page, I navigate back to the page where I have the GridView.

As a result, instead of showing items horizontally (as required), the control shows them vertically losing the original orientation.

I searched on the Internet but the only one taling about this problem is a guy at Microsoft, who provides a possible solution in this blog post. Unfortunately that solution did not work for me, so what I did is changing the template of the panel for the view. In this case I used a StackPanel. This works well for me because I have a few items and I don't need virtualization. In code:

                    <GridView.ItemsPanel>                          <ItemsPanelTemplate>                              <StackPanel Orientation="Horizontal"/>                          </ItemsPanelTemplate>                      </GridView.ItemsPanel>

In this way, everything worked correctly. In conclusion, if you face this problem remember to work on the ItemsPanelTemplate.

Alessandro

Playing media contents in loop with the MediaElement control

Posted: 14 Mar 2013 01:04 AM PDT

The MediaElement control is used to play media contents in Technologies like WPF, Silverlight, WinRT and Windows Phone.

You might have the need to play a content forever, with a loop. A very easy way to accomplish this is Handling the MediaEnded and restart from there.

For example, we declare a boolean variable to store the loop state (enabled/disabled):

Private isLoop As Boolean = False  

This can be useful if we associate the state of the loop to a button, which is just responsible to change its value:

    Private Sub LoopButton_Click(sender As Object, e As EventArgs)          isLoop = Not isLoop      End Sub

Somewhere else we'll start playing the content; the important thing is how we handle the event, like in the following example:

    Private Sub Media1_MediaEnded(sender As Object, e As RoutedEventArgsHandles Media1.MediaEnded          If isLoop = True Then              Me.Media1.Position = New TimeSpan(0)              Me.Media1.Play()          End If      End Sub

Basically the code first checks if the loop state is active, then it moves the position back to zero and restarts playing.

Alessandro

My first eBook: "Hidden WPF"

Posted: 14 Mar 2013 12:58 AM PDT

A few days ago, we have released my first eBook called "Hidden WPF: Secrets for creating great applications in WPF":

Hidden WPF: Secrets for Creating Great Applications in Windows Presentation Foundation

Published by InformIT (the online division of my publisher SAMS/Pearson), this is a different publication. It's a very small book, 99 pages, produced and thought for mobile devices. Here you will find tons of tips & tricks, suggestions, and real world implementations that I collected in my daily work, building applications with Windows Presentation Foundation.

Price is $ 7,99. You will find many info about working with PDF and XPS documents, suggestions to get the most out of the Visual Studio IDE with WPF, enhancing your debugging experience, improving the user interface performance, common requirements (e.g. ComboBox controls with lookup tables), descriptions of Productivity tools either free or paid, that you might have probably missed.

I'm aware that WPF has been definitely become very popular in the developer community Worldwide, so probably this publication can bring you some value. After all, we do not have to forget that WPF is the premiere technology about building apps for the Desktop, despite HTML5, the Web, and the apps for Windows 8.

Alessandro

Windows Phone: the SaveAppointmentTask class

Posted: 14 Mar 2013 12:50 AM PDT

The Windows Phone 8 SDK introduces new launchers, which are tasks on the phone that you can interact with via managed code. Among the Others, the new Microsoft.Phone.Tasks.SaveAppointmentTask class allows saving an appointment in the calendar or an activity in the specified time interval.

For instance, the following code creates an appointment in the calendar:

        Dim appointmentTask As New SaveAppointmentTask          With appointmentTask              .AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.OutOfOffice              .Details = "Going on vacations"              .StartTime = New Date(2013, 7, 1)              .EndTime = New Date(2013, 7, 18)              .Location = "Seaside"              .Reminder = Reminder.OneDay              .Subject = "I'm not available"              .Show()          End With

Properties are pretty self-explanatory, in particular focus on the AppointmentStatus one which allows chosing how we should appear to our contacts, by selecting a value from the Microsoft.Phone.UserData.AppointmentStatus. We can chose among OutOfOffice, Busy, Free, Tentative .

The Reminder property instead allows selecting a value from the Microsoft.Phone.Tasks.Reminder to set the reminder time. In this case, a reminder appears the day before (OneDay) but many are the available values. IntelliSense will help you as usual.

Of course the appointment will not be saved directly, but it will require interaction with the user who will be able to edit the appointment details via a familiar user interface, as demonstrated in the following figure:

Alessandro

Crowdfunded science exhibit encourages duplication

Posted: 14 Mar 2013 12:00 AM PDT

bees network

The United Nations Education, Science and Culture Organization headquarters in Paris recently hosted the launch of IMAGINARY, a new platform for collaborative mathematics and maths art, or open mathematicsThe launch was part of the Mathematics of Planet Earth Day and the opening of the first international crowdsourced science, open source exhibition hosted by the platform: Mathematics of Planet Earth.

read more

It keeps on getting better – Hortonworks highlights native Windows support for Apache Hadoop

Posted: 13 Mar 2013 08:10 AM PDT

Any time you can open up a platform to more options for interoperability, it's a great thing. It's even better if the platform is as popular as Apache Hadoop and the new option is one that has been accepted as a popular choice. And earlier today, HortonWorks announced another interoperability achievement for the Apache Hadoop project on their blog by highlighting how Hadoop now runs natively on Microsoft Windows platforms:

"One of the things we believe strongly in here at Hortonworks is community driven open source and, obviously, the bigger the community, the better. The community opens itself up to new members by the developmental choices it makes and last week the Apache Hadoop community voted to significantly expand itself by agreeing to accept enhancements into the core trunk that make Apache Hadoop run natively on the Microsoft Windows platforms including Windows Server and Windows Azure. These enhancements were the result of many, many months of joint engineering work from Microsoft and Hortonworks and we are glad to see the community accept and embrace them. So far, as is common in the Apache Hadoop project, we developed these in a development branch for over a year and once this work was complete, the community voted to incorporate these changes into the mainline trunk."

We at Microsoft Open Technologies, Inc., want to congratulate the teams at the Apache Software Foundation, HortonWorks and Microsoft Corporation that made this happen! We're excited to see where native support for Apache Hadoop on Windows Server and Windows Azure will take the community.

It keeps on getting better – Hortonworks highlights native Windows support for Apache Hadoop

Posted: 13 Mar 2013 08:10 AM PDT

Any time you can open up a platform to more options for interoperability, it's a great thing. It's even better if the platform is as popular as Apache Hadoop and the new option is one that has been accepted as a popular choice. And earlier today, HortonWorks announced another interoperability achievement for the Apache Hadoop project on their blog by highlighting how Hadoop now runs natively on Microsoft Windows platforms:

"One of the things we believe strongly in here at Hortonworks is community driven open source and, obviously, the bigger the community, the better. The community opens itself up to new members by the developmental choices it makes and last week the Apache Hadoop community voted to significantly expand itself by agreeing to accept enhancements into the core trunk that make Apache Hadoop run natively on the Microsoft Windows platforms including Windows Server and Windows Azure. These enhancements were the result of many, many months of joint engineering work from Microsoft and Hortonworks and we are glad to see the community accept and embrace them. So far, as is common in the Apache Hadoop project, we developed these in a development branch for over a year and once this work was complete, the community voted to incorporate these changes into the mainline trunk."

We at Microsoft Open Technologies, Inc., want to congratulate the teams at the Apache Software Foundation, HortonWorks and Microsoft Corporation that made this happen! We're excited to see where native support for Apache Hadoop on Windows Server and Windows Azure will take the community.

It keeps on getting better – Hortonworks highlights native Windows support for Apache Hadoop

Posted: 13 Mar 2013 08:10 AM PDT

Any time you can open up a platform to more options for interoperability, it's a great thing. It's even better if the platform is as popular as Apache Hadoop and the new option is one that has been accepted as a popular choice. And earlier today, HortonWorks announced another interoperability achievement for the Apache Hadoop project on their blog by highlighting how Hadoop now runs natively on Microsoft Windows platforms:

"One of the things we believe strongly in here at Hortonworks is community driven open source and, obviously, the bigger the community, the better. The community opens itself up to new members by the developmental choices it makes and last week the Apache Hadoop community voted to significantly expand itself by agreeing to accept enhancements into the core trunk that make Apache Hadoop run natively on the Microsoft Windows platforms including Windows Server and Windows Azure. These enhancements were the result of many, many months of joint engineering work from Microsoft and Hortonworks and we are glad to see the community accept and embrace them. So far, as is common in the Apache Hadoop project, we developed these in a development branch for over a year and once this work was complete, the community voted to incorporate these changes into the mainline trunk."

We at Microsoft Open Technologies, Inc., want to congratulate the teams at the Apache Software Foundation, HortonWorks and Microsoft Corporation that made this happen! We're excited to see where native support for Apache Hadoop on Windows Server and Windows Azure will take the community.

No hay comentarios:

Publicar un comentario