Alan Turing’s computer-generated music gets restored after 65 years

Alan Turing is considered to be one of the fathers of computer science. He played a crucial role in World War II counter intelligence and worked for the Government Code and Cypher School at Bletchley Park. He was also responsible for breaking a large number of Nazi ciphers, including the German Enigma code. After the war, Turing continued his work as a pioneer computer engineer, and developed what’s considered to be one of the first designs for a stored-program computer. But it seems code breaking wasn’t Turing’s only talent. Now…

Read More

Custom editor render for Xamarin on iOS

In Xamairin the Editor component doesn’t have a border on iOS. If you want to add one in the iOS project just added the following code. using UIKit; using WordBankEasy.iOS.Renderers; using Xamarin.Forms; using Xamarin.Forms.Platform.iOS; [assembly: ExportRenderer(typeof(Editor), typeof(CustomEditorRenderer))] namespace PSC.iOS.Renderers { public class CustomEditorRenderer : EditorRenderer { protected override void OnElementChanged( ElementChangedEventArgs<Editor> e) { base.OnElementChanged(e); if(Control != null) { Control.Layer.BorderColor = UIColor.FromRGB(204, 204, 204).CGColor; Control.Layer.BorderWidth = 0.5f; Control.Layer.CornerRadius = 3f; } } } } Happy coding!

Read More

Preserve data when deploying Xamarin.Android app

By default all your data from your previous runs is deleted when you’re deploying an Xamarin.Android app. In many cases you don’t want the data to be deleted. Visual Studio To preserve data go to Tools -> Options -> Xamarin -> Android Settings and check “Preserve application data/cache on device between deploys”. Xamarin Studio To preserve data go to Tools -> Options -> Android and check “Preserve data/cache between application deploys”. Happy coding!

Read More

“System.IO.FileNotFoundException” using controls from another assembly in Xamarin Forms on iOS.

I was building a Xamarin solution with my components like that: All my components (PSC.Xamarin.Controls.*) are working fine in other solutions.Always fine for Windows or UWP solutions. A problem was born when I started to deployed my solutions on iOS. When on the app I opened a page with my controls I always received an error like: System.IO.FileNotFoundException: Could not load file or assembly ‘PSC.Xamarin.Controls.BindablePicker’ or one of its dependencies. The system cannot find the file specified. I can check my references and deployment settings in all ways, it turns…

Read More

What is the difference between Xamarin.Form’s layout options?

In Xamarin.Forms every View has the two properties HorizontalOptions and VerticalOptions. Both are of type LayoutOptions and can have one of the following values: LayoutOptions.Start LayoutOptions.Center LayoutOptions.End LayoutOptions.Fill LayoutOptions.StartAndExpand LayoutOptions.CenterAndExpand LayoutOptions.EndAndExpand LayoutOptions.FillAndExpand Apparently it controls the view’s alignment on the parent view. But how exactly is the behavior of each individual option? And what is the difference between Fill and the suffix Expand? Theory The structure LayoutOptions controls two distinct behaviors: Alignment: How is the view aligned within the parent view? Start: For vertical alignment the view is moved to…

Read More

Android required permissions

In Visual Studio 2015 if you checked same permissions on your project properties and when reopen it, your checks are disappeared, you have two ways: Is the manifest file marked as ‘read only’ in Windows Explorer? You have to select the Properties directory and un-tick ‘read only’ for the entire folder. Add manually in AndroidManifest.xml file same new rows: <?xml version=”1.0″ encoding=”utf-8″?> <manifest xmlns:android=”https://schemas.android.com/apk/res/android”> <uses-sdk android:minSdkVersion=”15″ /> <application android:label=”$safename$”> <meta-data android:name=”com.google.android.maps.v2.API_KEY” android:value=”yourcode” /> </application> <uses-permission android:name=”android.permission.INTERNET” /> <uses-permission android:name=”com.google.android.providers.gsf.permission.READ_GSERVICES” /> <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” /> <uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION” /> <uses-permission android:name=”android.permission.ACCESS_COARSE_LOCATION” /> <uses-permission…

Read More

All Windows 10 PCs will get Windows Holographic access next year

Windows 10 users will be able to dive into mixed reality starting next year, with an update planned that can let any “mainstream” Windows 10 PC run the Windows Holographic shell the company first revealed in January 2015. The update will allow users to multi-task in mixed reality environments, which combine traditional 2D Windows 10 apps with immersive, 3D graphical environments. These will be enabled via a range of “6 degrees of freedom devices,” input devices that add positional tracking to other more traditional forms of input, like clicking and…

Read More

Custom ContextAction with Xamarin Forms

I using a Xamarin Forms ListView and I want to enable or disable the Context Actions based on a certain binding or in the code behind. The way I found is to use BindingContextChanged in a ViewCell. I show you an example <?xml version=”1.0″ encoding=”utf-8″ ?> <ContentPage xmlns=”https://xamarin.com/schemas/2014/forms” xmlns:x=”https://schemas.microsoft.com/winfx/2009/xaml”> <ContentPage.Content> <StackLayout> <ListView x:Name=”listDictionaries” ItemsSource=”{Binding DictionariesList}” IsVisible=”{Binding ShowList}” HorizontalOptions=”FillAndExpand” VerticalOptions=”FillAndExpand” HasUnevenRows=”true” IsPullToRefreshEnabled=”true” RefreshCommand=”{Binding Refresh}” SeparatorVisibility=”Default” ItemTapped=”OnItemTapped” IsRefreshing=”{Binding IsBusy, Mode=OneWay}”> <ListView.ItemTemplate> <DataTemplate> <ViewCell BindingContextChanged=”OnBindingContextChanged”> <ViewCell.View> <StackLayout> <Grid Padding=”10″ ColumnSpacing=”10″> <Grid.RowDefinitions> <RowDefinition Height=”*” /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width=”Auto” /> <ColumnDefinition Width=”*” /> </Grid.ColumnDefinitions>…

Read More

Android.Content.Res.Resources+NotFoundException: Resource ID #0x0

I’ve just created a simple MasterDetailPage and in the code I inserted an icon for the left page with: public MainPage() { InitializeComponent(); BackgroundColor = Color.FromHex("#007acc"); Icon = "settings.png"; } I tried to deploy my app on an Android emulator but I can’t deploy it because Android.Content.Res.Resources+NotFoundException: Resource ID #0x0. I checked everthing and evething seemed fine. The problem is the icon! You have to remove Icon from the code and in the XAML page type the following code: <ContentPage.Icon> <OnPlatform x:TypeArguments=”FileImageSource”> <OnPlatform.iOS>settings.png</OnPlatform.iOS> </OnPlatform> </ContentPage.Icon> Happy coding!

Read More

Visual Studio updates Xamarin

When you open Visual Studio 2015 and there is a pop windows to invite you to click on it for updating Xamarin and you click, nothing happends. There is a bug but clicking the update available popup was fixed in one of the recent releases. You can manually update in the Options menu under Tools. As for the errors, I get those all the time. Support packages can often be a problem. Update to the latest XF package. Try deleting bin, obj, and the contents of packages folders and rebuild.

Read More

Start Edge Animate when is in the screen

I’ve come across a few sites that will tie window scrolling with animation. When used in a subtle, small fashion, this is kind of cool. When used to change large portions of the view or really screw with scrolling, I detect it. Like most things, it all comes down to how you use it I suppose. But I was thinking recently – how can we do this with Edge Animate? Change edgePreload.js In a file calles something_edgePreload.js you find a line similar to the follow: if (AdobeEdge.bootstrapLoading) { signaledLoading =…

Read More

Microsoft REST API Design Guidelines

Microsoft is publishing its “REST API Design Guidelines” to the API community: https://www.GitHub.com/microsoft/api-guidelines/. These guidelines represent a multi-year, cross-company, collaborative process aggregating the collective experience of hundreds of engineers designing, operating, and running global scale cloud services from across Microsoft; and listening to feedback on our APIs from customers and partners.  We have attempted to incorporate those learnings along with industry best practices in the API space to create guidelines that API teams across Microsoft use on a daily basis. Our hope in publishing these guidelines to the greater API…

Read More

Continuous: C# and F# IDE for the iPad by Frank A. Krueger

Continuous gives you the power of a traditional desktop .NET IDE – full C# 6 and F# 4 language support with semantic highlighting and code completion – while also featuring live code execution so you don’t have to wait around for code to compile and run. Continuous works completely offline so you get super fast compiles and your code is secure. Continuous gives you access to all of .NET’s standard library, F#’s core library, all of Xamarin’s iOS binding, and Xamarin.Forms. Access to all of these libraries means you won’t…

Read More

How to update the data in listview in Xamarin.Forms?

First you add a new class as a ViewModel like: public class RoomViewModel : BaseViewModel { [here following code] } If you don’t have BaseViewModel try to download from nuget Refractored.MvvmHelpers. Then in your class define an observable collection like public ObservableCollection<RoomRecommandation> _roomSuggestionList = new ObservableCollection<RoomRecommandation>(); public ObservableCollection<RoomRecommandation> Recommendations { get { return _roomSuggestionList; } } In your ContentPage add a listview like: <ListView ItemsSource="{Binding Recommendations}"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <Grid Padding="10" RowSpacing="10" ColumnSpacing="10"> <Grid.RowDefinitions> <RowDefinition Height="" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <controls:CircleImage…

Read More

Docker opens up Docker for Windows beta to everyone

docker wallpaper

Programmers and developers have been anxiously waiting for an invite into the Docker application beta since earlier this year. During their announcement video, Docker shared that they had over 30,000 interested parties sign up within hours of the initial announcement. A grand total of 70,000 were able to join the beta to provide feedback and get a hands-on experience with the application. But for those that haven’t gotten in, today they can do so with the open beta announced for Docker on Mac and Windows. The Docker platform is one…

Read More

Xamarin Forms MasterDetail Page Navigation Recipe

In this recipe I will show you how to add a hamburger menu to your Xamarin Forms application using the MasterDetailPage class. The Xamarin.Forms MasterDetail Page consists of one page for the master and one or more pages for the detail. When used for the main navigation, as in this recipe, we will have a single master page and 4 detail pages. The code for this recipe comes from the Xamarin Forms CRM sample. I have simplified and streamlined the code, and a full Xamarin Studio solution is included at…

Read More

Xamarin Studio: complete uninstall on Mac

Remove these directories: /Applications/Xamarin Studio.app /Developer/MonoTouch /Developer/MonoAndroid /Library/Frameworks/Mono.framework /Library/Frameworks/Xamarin.Mac.framework /Library/Frameworks/Xamarin.Android.framework Locations in your user directory: ~/Library/Caches/Xamarin ~/Library/Caches/XamarinStudio-4.0 ~/Library/Developer/Xamarin ~/Library/Developer/XamarinStudio ~/Library/Logs/Xamarin ~/Library/Logs/XamarinStudio-4.0 ~/Library/Preferences/Xamarin ~/Library/Preferences/XamarinStudio-4.0 ~/Library/Xamarin ~/Library/Xamarin.Mac ~/Library/MonoTouch ~/Library/MonoAndroid ~/Library/XamarinStudio-4.0 That’s all there is afaik.

Read More

Electron 1.0

For the last two years, Electron has helped developers build cross platform desktop apps using HTML, CSS, and JavaScript. Now we’re excited to share a major milestone for our framework and for the community that created it. The release of Electron 1.0 is now available from electron.atom.io. Electron 1.0 represents a major milestone in API stability and maturity. This release allows you to build apps that act and feel truly native on Windows, Mac, and Linux. Building Electron apps is easier than ever with new docs, new tools, and a…

Read More

Introducing the IIS Administration API

The IIS team has been working on a new RESTful API to manage your IIS configuration. While still under development, the team was eager to share a preview of the new API. The API allows configuration of IIS resources such as authorization rules, modules, and applications. The API has been built with Hypertext Application Language (HAL) to allows APIs to have built-in discoverability. Starting at the root of the API, you can browse the entire API surface. In addition to the API, the IIS team has also built an API…

Read More

ASP.NET LinkButton: children disappears after postback

I have a LinkButton with image and label inside it or tags i and span as in the following picture. The code in the page is: <asp:LinkButton ID="LinkButton1" runat="server"> <i class="glyphicon glyphicon-plus"></i> <span class="js-add-button" runat="server" id="Span1">Add New</span> </asp:LinkButton> After a postback everything inside the LinkButton disappeared. I’ve spent two days to understand why and the solution is very easy. <asp:LinkButton ID="LinkButton1" runat="server"> <i class="glyphicon glyphicon-plus" runat="server"></i> <span class="js-add-button" runat="server" id="Span1">Add New</span> </asp:LinkButton> The tag i doesn’t have runat="server" and for that you lost all content inside the LinkButton. Happy coding!

Read More

Microsoft takes on IFTTT with Flow

IFTTT is one of the most useful online services. Today, Microsoft is taking on IFTTT with its new service called “Flow”. The company is launching the preview of Flow today, and it works almost like IFTTT. Unlike IFTTT, Flow isn’t mostly focused on consumers — instead, it’s mostly focused on enterprise integrations. Flow lets you automate your workflow, and be more productive. With Flow, you can setup GitHub to automatically send a Slack notification and add a card in Trello when a new issue is submitted. Additionally, you can also…

Read More

Remove multiple line in the same file with C#

Read the file, remove the multiple line (but it saves one of them) in memory and put the contents back to the file (overwriting) and create a backup file with the original file.   using System; using System.Collections.Generic; using System.IO; using System.Linq; namespace DelMultiLine { class Program { static void Main(string[] args) { if (args.Count() == 0 || args.Count() > 2) { Console.WriteLine(“\nDelMultiLine (by Enrico Rossini – puresourcecode.com)”); Console.WriteLine(“———————————————————————–“); Console.WriteLine(“Remove duplicate line in a file\n”); Console.WriteLine(“Usage:”); Console.WriteLine(” delmultiline <Filename> <resultFilename>\n”); Console.WriteLine(“filename: define a full path for the file you want…

Read More

Under the hood of Microsoft’s Windows Subsystem for Linux

Bash on Windows 10 was one of the big reveals at Microsoft’s recent Build conference. Since then, there’s been a lot of speculation about what Microsoft did to make this possible. Microsoft is starting to provide more details via blog posts and a new Channel 9 video on what’s going on under the covers. Spoiler alert: There’s no secret Linux kernel hidden in Windows 10. Instead, it’s the Windows Subsystem for Linux (WSL) that was developed by the Windows Kernel team is what provides the foundation that enabled the Linux…

Read More

Dijkstra’s Algorithm in C# with Generics

I recently needed to to implement a shortest-path algorithm (to identify preferred domain controllers using site link costs) and I found Dijkstra’s Algorithm Path class using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DijkstraAlgorithm { public class Path<T> { public T Source { get; set; } public T Destination { get; set; } /// <summary> /// Cost of using this path from Source to Destination /// </summary> /// /// Lower costs are preferable to higher costs /// </remarks> public int Cost { get; set; } } }…

Read More