Bra_Apps

Apps mobiles

Our mobiles Apps which was buid on various platforms (Windows Phone and Windows 8, iOS and Android).

See Apps »

BratchedLogoWordpress250x100

Code Source

Technical articles,
source code and feedback on our developments.

See code »

BratchedLogoWordpress250x100

News

News
and information about our activities.

See news »


LINQ to XML makes it relatively easy to read and query XML files. For example consider the following XML file:

Suppose you would like to find all records with groupid > 2. You could be tempted to [...]

Wed, May 19, 2010
Source: dev.bratched.com – en Category: DEV

Have you ever been in a situation where you needed to upload multiple files to a remote host and pass additional parameters in the request? Unfortunately there's nothing in the BCL that allows us to achieve this out of the box.

We have the UploadFile method but it is restricted to a single file and doesn't allow us to pass any additional parameters. So let's go ahead and write such method. The important part is that this method must comply with RFC 1867 so that the remote web server can successfully parse the information.

First we define a [...]

Sun, Nov 21, 2010
Source: dev.bratched.com – en Category: DEV

If there was a single feature I would like to see in ASP.NET MVC 4 that would be to remove/deprecate ViewBag/ViewData. Those two constructs lead to very ugly code in the views and should be avoided. Here are few of the things I hate about them:

They are not strongly typed and you need to cast in your views in order to obtain the actual type They are not refactor friendly because they rely on magic strings They lead to brittle unit tests because of the magic strings They lead to spaghetti code in the views

Here's the diff patch I would love to see [...]

Sun, Feb 20, 2011
Source: dev.bratched.com – en Category: DEV

In this blog post I will illustrate how you could convert an XHTML page into PDF using the flying-saucer library. This is a Java library so we need to first step would be to convert it to a .NET assembly.

I will use the IKVM.NET Bytecode Compiler (ikvmc.exe) for this purpose. So go ahead and download both the flying-saucer library and the IKVM project. Then run the following command:

ikvmc.exe -target:library -out:CoreRenderer.dll iText-2.0.8.jar core-renderer.jar

This will generate the CoreRenderer.dll assembly which could be used. And finally we would create an application which would use it [...]

Wed, Mar 02, 2011
Source: dev.bratched.com – en Category: DEV

I've updated the sample MVC project I wrote for using ASP.NET MVC 3 and the Razor view engine.

A minor change is that I no longer use the FluentValidationModelValidatorProvider but the standard one. So I decorate the view model with the necessary data annotations :

[Validator(typeof(UserViewModelValidator))] public class UserViewModel { public int Id { get; set; } [DisplayName("First name *")] public string FirstName { get; set; } [DisplayName("Last name *")] public string LastName { get; set; } public int? Age { get; set; } }

And [...]

Mon, Feb 20, 2012
Source: dev.bratched.com – en Category: DEV

The purpose of this post is to show a tutorial about creating a multilingual website in WordPress using the multisite feature.

Advantages of the proposed solution :

Lots of flexibility for content translation and presentation of the articles in different languages Different themes based on country Search Engine Optimization Step 1 : Creating multisite WordPress

Add the following line in wp-config.php.

define ('WP_ALLOW_MULTISITE', true);

This will activate a new option in the Dashboard: Tools -> Network Setup.

All that's left is to follow the instructions.

Choose the default folder options in order to have urls of the following pattern www.monsite.com/fr/mapage.html

2 actions are necessary :

Copy/Paste some code inside wp-config.php Copy/Paste some code [...]
Sun, May 11, 2014
Source: dev.bratched.com – en Category: DEV
Windows Phone 7.x, 8.0 and 8.1

3 major versions of Windows Phone exist since April: 7.x, 8 and 8.1.

The 8.1 version allows among others to create ‘classic' Windows Phone 8.1 applications called 8.1 – Silverlight (SL) and also Universal applications that can be shared between Windows 8.1 and Windows Phone 8.1.

Having common codebase was already partially possible with the PCL (Portable Class Libraries). The compiled assembly can be used in Windows Phone 7.x, WP8 and Windows 8 project for example.

With Universals Apps the UI code can also be shared.

Visual Studio 2013 allows for creating PCL compatible with WP8, W8, WP8.1, W8.1 [...]

Sat, May 17, 2014
Source: dev.bratched.com – en Category: DEV

When profiling a web application I have noticed constant delays of about 200ms on some HTTP calls it was making to an external API. Both the web application and the API were on the same network segment and thus network latency was out of the question. Besides the target API has previously been subject to jMeter load tests and proven to handle 1500req/s. What was even more peculiar in this situation was that only the POST requests were exhibiting this delay. GET requests were pretty fast as expected.

It turned out that those delays were caused by the [...]

Sat, May 17, 2014
Source: dev.bratched.com – en Category: DEV
The Portable Class Library (PCL)

The portable Class library (PCL) will allow us to share a large part of the code across projects.

It is possible for a few years to share the PCL code between projects (Sliverlight and WPF, Windows Phone, Windows 8,…).
More projects are different, the more shared classes decreases.

It is important to see that this Library can be used for projects compatible with the selected options.

Note also the visual studio Express editions do not create a PCL, but instead accepts their use in a project.

This Library may use a library which would not have at least the same options [...]

Sat, May 24, 2014
Source: dev.bratched.com – en Category: DEV

I continue to explore different techniques of displaying images in Windows Phone and this time I will show some possible implementations of fetching them from the web using the HTTP protocol.

Classic implementation:

public static void GethttpImage1(string urlImage, Action action) { var request = (HttpWebRequest)WebRequest.Create(urlImage); request.BeginGetResponse(result => { using (var sr = request.EndGetResponse(result)) { Deployment.Current.Dispatcher.BeginInvoke(() => { var image [...]
Sat, Jun 28, 2014
Source: dev.bratched.com – en Category: DEV