viernes, 4 de abril de 2014

Developing Challenge #1

Intended for: C# Developers

Today I want to share with you a piece of code that in a common inspection of a current proyect in which I'm involved.

Is true: everyone makes mistakes, and I'm the first one; this fail is so hard that I think that must be here as a post-challenge inside my blog.

I explain you the context: current function brings us the HTML code of a webpage that previously have been automatized.

Now the challenge itself: What makes the following code snippet? Which value returns the function?


Please, give your answers inside the comments place in the blog.

Thank you very much!
C# and Developing

miércoles, 19 de febrero de 2014

Mainlines about usability and application UI design

Intended for: all platform developers

Usability and application UI design is a factor that we use to leave to the end of a project, it's because developers often think that is not an important part of our daily job (this is not my). Due to current times, most spaniard companies (my country, I don't know outside) analyst/developers are: architects (senior and junior people), designers of our own application and test people, all in one.


In 90's this was revolutionary... but now...

Is not common in big companies where have departments for all this project areas, but in small and medium ones we have to fight with all of these by ourselves; is what it is. For testing is commonly accepted that the developer can't make good tests over their own creations because you'll never accept your own mistakes until other one tells you. If this is always the same ... Why don't we understand the same concept when we made user interfaces?

Is a real fact that developers have a straight tendency to make horrible interfaces that only we understand. We have to break that rule and start to make things right, as final users desire to be: this is the key to success. We can make an application with a huge performance, that optimizes the results of other companie's  software a 80% better that do the same: if user don't understand it or if he doesn't feel comfortable using it... the application will be a total fail.


User's anger must be present in our daily job


Now I'm going to explain the dogmas that must be present before making a correct user interface, in web or in desktop:
  1. You always have to be in the final user's seat. For this task we can't make a general rule, because it depends on the user for that application: is not the same a defense environment, a bank environment or intended for developer users as we can be. Do you think in Visual Studio designed in the same way of a banking system? I can imagine that and... what a mess!
  2. Make an effort in our application understanbility, mainly because everything is outside our environment (because our business is every business). Understand this is very important. Everyone outside computing science doesn't have the knowledge about operating systems and more important: they don't have to have it. Our applications must be used by the people intended to be used: storage staff, secretaries, bank staff, army men, etc.... and there will be people there with advanced computing knowledge but mainly not!
  3. Have a criteria for designing on-screen controls: use logic for placing things, maintain this through application. If we not follow that criteria, fails during its use will be a big set; that leaves users to say something like: - This is a big sh*t! - or something else.
  4. The last one in this set of basic concepts, but not the less important one: an elegant and functional design. Is not good to have a well-functional application if its design not reflects that is it true. Technology is evolutive and application user interfaces evolutionate with them: interfaces such as Windows 3.11 are completely obsolete...
Here I bring you the basic principles were I use to work over user interfaces. In next articles I will explain some of my secrets to make good-look applications to be used by any kind of user. My experience in this field have been usefull for any company were I have worked; I hope this will be the same usefull for you.
C# and Developing

jueves, 5 de diciembre de 2013

Windows 8.1 - The good look and feel OS!



Intended for: All kind of users

As it is becoming usual, Microsoft has bring us a simple, beautiful and optimized to the top in order to make our daily tasks.

Is true: Windows Vista was a bitter taste that remember to that marvellous version of Windows called Millenium and its less than a year lifetime (because it smells like shit), bringing to the front to XP. Windows Vista performance was very bad because aero interface eats lots of resources of our old machines (not as resource-skilled as today).

The time has passed and our loved Windows 7 was better than before. Everything was working as a swiss-clock, more optimized and with the same aspect than Vista, but better made.

Now we have a version that optimizes better the resources, we ha a Windows 8.1 more intended for the general public. The idea of showing again Start Menu (in version 8 they have removed it, big mistake!), they move the interface to big and short set of buttons and with sort texts. If you are a common Windows user you need to take some time to understand the new Windows standard's of use; moreover menus are intended for tactile interfaces: but is the same, is amazing to see how the did it!

I have to recognize that I have one of this at home (completely legal) and I have to say that I'm amazed with it. Bring an opportunity to Redmond guys!!!

One more thing: Microsoft HAVEN'T hire me!!!
Windows

miércoles, 27 de noviembre de 2013

Delegates and Lambda Expressions... fearless

Intended for: .NET medium-skilled developers

Delegates


Before we start this entry, we have to warn you about this is not a book so, we don't explain with details this theme. Its frequent to watch developers with fear to this concepts because are hard to understand even with a book in your hands. I've try to explain this in a simple way.


A deletate is a function definition to be used as a parameter to other one. Is as easy as the previous phrase explains it. Maybe you can find better explained definitions about delegates; but they could be more confusing than this.

public delegate bool DelegateFunction(int parameter1, int parameter2);

This is the way to declare a delegate, is enough. It is usefull as a "shell" to be passed as parameter another function with this kind of declaration: two integers as entry and a boolean as returned type.

Now I'm going to create a function that uses the delegate as parameter:

public string ExampleFunctionWithParameterDelegate(DelegateFunction df, int p1, int p2)
{
if (df(p1, p2))
{
return String.Format("Function condition accomplished df using {0} and {1}",
                    p1,
                    p2);
}
return String.Format("Function condition NOT accomplished df using {0} and {1}",
                    p1,
                    p2);
}

This drives us to understand how delegates works. Now we have to create functions that have the entry and return parameters as follows:

public bool DelegateExampleFunctionP1IsLessThanP2(int parameter1, int parameter2)
{
return parameter1 < parameter2;
}

public bool DelegateExampleFunctionP1IsMoreThanP2(int parameter1, int parameter2)
{
return parameter1 > parameter2;
}

Now, we have to connect everything with the following calls:

var p1 = 5;
var p2 = 2;
var returned1 = ExampleFunctionWithParameterDelegate(
DelegateExampleFunctionP1IsLessThanP2, p1, p2);
var returned2 = ExampleFunctionWithParameterDelegate(
DelegateExampleFunctionP1IsMoreThanP2, p1, p2);


Can you imagine what are the values for the variables returned1 and returned2 after the execution of the instructions? These values are the following ones:

returned1 = "Function condition NOT accomplished df using 5 and 2"
returned2 = "Function condition accomplished df using 5 and 2"

As we can see, this allows us to make flexible functions, even "mutants". Now I'm going to explain Lambda expressions, using the same example as delegates.

Lambda Expressions


Following the previous idea here is an example of Lambda expression that is usefull  to know how they work, making comparitions with the previous develop I've mark in yellow Lambda expressions:


var returned1 = ExampleFunctionWithParameterDelegate(
DelegateExampleFunctionP1IsLessThanP2, p1, p2);
var lambdaReturned1 = ExampleFunctionWithParameterDelegate(
(parameter1, parameter2) => { return parameter1 < parameter2; }, 
         p1, p2);

var returned2 = ExampleFunctionWithParameterDelegate(
DelegateExampleFunctionP1IsMoreThanP2, p1, p2);
var lambdaReturned2 = ExampleFunctionWithParameterDelegate(
(parameter1, parameter2) => { return parameter1 > parameter2; },
p1, p2);


We observe that the difference between the previous delegates code and now is that now we don't need the auxiliary created functions, I've made it "on the fly" and without direct define inside the call parameters of the call of main function with the delegate.

As you can imagine, the following is the result that is the same than the previous one:

returned1 = "Function condition NOT accomplished df using 5 and 2"
lambdaReturned1 = "Function condition NOT accomplished df using 5 and 2"
returned2 = "Function condition accomplished df using 5 and 2"
lambdaReturned2 = "Function condition accomplished df using 5 and 2"

Lambda expressions and delegates are implemented in several functionallities inside the framework elements. One of the most frequent places to be founded is inside the objects of System.Collections.Generic class, for example inside the lists and it will be usefull to be used in the querys over that collections.
C# and Developing

jueves, 14 de noviembre de 2013

Secure File Deletion under Windows - File Predator



Intended for: all kind of users


I don't want to scare you but, Windows file deletion (and its recycle bin deletion) IS NOT SAFE. In fact, it never have been secure, so you have to take care with your files when you use a classic file deletion your files never be really deleted until that files where completely overwritten.

Before starting this entry, I will explain how Windows delete the files over hard disk, in order to understand why is so important to delete files in a correct manner, more important if you send to trash the hard disk itself. I have to explain that I'm using my memory to recover the Operating System's of my carreer so the explanation couln't be a hundred percent accurate; my idea is to explain to anyone without a big set of details. I accept any comment to improve this post.

Cómo se distribuyen los ficheros a lo largo del disco duiro
In a Windows OS (same than Linux) files are stored in the hard disk in a sequential mode (this is not exactly, but approximately). Everything are bit sequences (zeros and ones). Part of this information is the i-node that
is readed by operating system to identify the basic information of the file: the memory position where the file starts and their metadata as the file lenght.
Dos ficheros eliminado en el anterior esquema del disco duro
The only thing that Windows do is to remove the i-node  in both steps (send to bin and cleanup it) and the files are kept in the hard disk until Windows overwrites the data with new one. This can happen in a short time or... never!!!
Cómo las aplicaciones recuperan los datos

There are lots of simply and cheap tools (even free) that are capable to recover these data after formatting the hard disk (always if is not a low level format), beacuse of that I repeat: Windows data deletion IS UNSAFE. That tools read the hard disk and test which files are i-node orphans and recreate a new one for them in order to Windows shows them normally. If that files aren't overwrited partially or totally, restore applications make the file recover. About these recovery tools we talk in the following post: How to recover lost files; but now we are looking at the safe file deletion.

Presentación File Predator
To help us to cleanup our files in a safe way, I have take the chance of create an application by myself.There are more and different, and not free. Mine is free an you can download it here:


Before start you have to be agree with these points and the agreement inside the application files:

  • This application is totally free and you can't pay or sell it. This is a non commertial application.
  • You can put it in any website, but remember that you have to link to this blog and the entry post. You can't modify the content inside the rar file inside my web and the license file inside them.
  • Use it carefully! If you erase something with this application you'll never can recover them!
  • You're using this UNDER YOUR OWN RESPONSIBILITY.
  • I don't have any responsability on any trouble that you can have: not viruses inside the exe files, not errors of the application itself and not human errors during the application management.
If you're not agree with the previous, don't download it and don't use it! I'm completely clear: is not my problem. This is a present for you, it costs to me effort and work and I bring to you "AS IS". Of course I will always trying to make a free-bug application but, as everyone knows, there are lots of bugs that make big companies loose lots of money; so obviouslly a free application could contain it (sure it have). If you detect fails and want to report them, please comment at the end of this post.

The use of application is very simple and intuitive, I left it to you in order to you discover it and is further posts I'll explain you how to do it. I left the compilation to be uncompressed (in rar format) and in next posts I'll explain you how to use it, .NET framework 4.0 is requiered.

In next entries I'll explain how to make your own secure file deletion algorithms to add to your application. Don't lose this opportunity!


Windows

martes, 3 de septiembre de 2013

Protect your PC from viruses and other trash FOR FREE



Intended for: Rookies

I have been watching the lack of knowledge and even people clumsilness in the protection of their own PC's. I don't want to scare anyone but is HARDLY DANGEROUS use a PC with a Windows OS without a suitable protection. I compare this with having bunny-like sexual relations in the middle of Africa without using comdoms... sounds hard? Is what it is, hard as life.

When you buy a PC, it could have or not a demo version of any protection that they used to finally charge
to your account. This protection costs about 50€ or even more for a year subscription. In that moment you don't receive new viruses definitions so, your machine starts to collapse!

A virus as a simplified description is an application that pretends to make troubles in your machine and infecto files in order to not being removed and turn them useless. An spyware application is a software designed for get your personal information and send it to other people for obvious reasons.

There are people that makes this work totally free (I'm one of these, but outside my work) and publishes antivirus and anti-spyware for free. Today I'm going to show you two totally free applications that I used to use diary and work very well.

Before start to install, we have to uninstall previous antivirus versions that we have. Two antivirus in the same machine makes conflicts and it could be possible to have to reinstall the OS. For that poupose we have to go Control Panel, Add or remove programs (in newer Windows, Programs) and find in the list the application to remove, selecting it and clicking over Uninstall. There is an antivirus which uninstall is a complete caos: Norton antivirus in any version. They have their own application to do this and here you can download it: Symantec Removal Tools

Once uninstalled, we have to download this software:



Why this applications and no other one? The antivirus is provided from Microsoft and is more efficient than othe applications (my experience is that it works fast as a bullet, your user experience is not affected). It's true that they could be not as updated to virus definitions as companies that make this work, but they're serious.

Spybot S&D is an old application and is for home users totally free.

Other possitive point for them is the user's ignorance, I mean that the user doesn't have to make anything until applications detect any anomalous behaviour.

All this protection is enough for a normal internet use (not for pirate pages or bizarre pornography).

Never use your PC without any protection, you maybe regret.
Windows

viernes, 23 de agosto de 2013

I want feedback!


This blog is beign accepted very well! I love this! But I have to ask you for some help: I want to know your opinion about my posts. Please, comment in the footer of the articles everything that you think: for me is the most important thing.

Thank you very much for your help,
 Enrique Diaz
Info

 

Friendly Websites:

  • Manuel Enrique Díaz Rodríguez
  • CuRadio
  • Copyright © DotNet Pathways 2015
    Distributed By My Blogger Themes | Designed By Templateism