Wednesday, December 30, 2009

Cervical Mucus With White Clumps

From The Beginning (Part I)

"Software is like entropy : It Is Difficult to grasp, Weighs nothing, and obeys the Second Law of Thermodynamics, ie, it always increases."
- Norman Augustine
I'll

write a series of posts about the Entity Framework, focus on the new version of this tool, Entity Framework 4.0 (EF 4, from now on.) The intention is to address the use of this solution from the beginning and go icrementando some application examples.
In principle I will list some downloads that will allow us to follow the examples and testing.
utlimate Visual Studio 2010 Beta 2
ADO. NET Framework 4.0 Feature Entity Comunity Technology Preview 2
Microsoft SQL Server 2008 Express
Microsoft SQL Server 2008 AdventureWorks Sample Database Product 2008R2 November CTP
Once we have these tools we can put to work and begin testing, for testing with EF 4, I will use the database AdventrueWorks which have left the download link above. Here we can see a screenshot of SQL Management Studio that shows the tables in the database instance.

In this first post I will show how to generate a model from an existing database on my local instance of SQL Server 2008 Express, This first example is very basic and perhaps trivial but it is a first approach to using the Entity Framework and is aimed at those who perhaps did not even know the tool. It is for this reason that this example should not be taken as an example on how to build quality software, it is simply a useful example of knowing when EF 4. Now if we go to Visual Studio 2010 and create a new project (Class Library) that call and appoint DemoEF40.DataL DemoEF40 the solution. As seen in the first picture:

Creando el proyecto Seleccionando el template

Then we click on the project you just created and the Project menu, select Add Item and select the template there ADO. NET Entity Data Model. After selecting the template is going to open the Entity Data Model Wizard, there select the Generate From Database option and click Next. Once there we will find a wizard that will allow us to connect with our database, select a few tables in the database, those companies will then classes of our model and finally we click the Finish button! This series of steps can be seen in the following Imagna:

DemoEF.EntityWizard1 DemoEF4.EntityWizard2

DemoEF4.EntityWizard3 DemoEF4.GeneratedModel1

In the last picture we see the model generated from the tables selected in the wizard, in the Solution Explorer, see the class generated from T4 code generator, whose name in my case is DemoEF40Model.Designer.cs if right click on this item and its properties can navigate to see the following :

DemoEF4.ModelProperties

Now we have our model set up and ready for use, by clicking the right mouse button on DemoEF40 solution, then the option Add new project, add a console project to the solution which will call DemoEF40 . Console, with this project we will conduct tests to our data model and verify if it hits correctly in our database. The first thing that will prove to bring data from the database. To do this we will take into account:

  1. Let's add a reference in our project DemoEF40.DataL DemoEF40.Console the project in the Project menu by clicking on Add Reference.
  2. setear
    Let DemoEF40.Console project as Start Up Project.
  3. Let's add a reference to System.Data.Entity
  4. Let's copy the configuration file of the project App.conf DemoEF40.Console DemoEF40.DataL the project.

Now let's try a simple code to retrieve some items from the Products table, and the list sigiuente

Class Program {
 

static void Main (string [] args) {

AdventureWorksEntities AdventureWorksEntities ctx = new ();
foreach (Product b in ctx.Products)

{System.Console.WriteLine (b.Name)


}}}


In this code we can see how to list the products available in our company deals database, corresponding to the records in the Products table. Simple no? We highlight this code to next line:



 AdventureWorksEntities AdventureWorksEntities ctx = new (); 


In this line we see how we access context that surrounds our model by creating an instance of AdventureWorksEntities, looking at this class in the definition of the model is that we will see that it inherits from ObjectContex, for the moment we go into details on this topic in particular but in successive post we shall see in detail the kind ObjectContext.



Let's see how we can make very Simble consultations with Linq, as we do in the following list:



 
class Program {
static void Main (string [] args) {
AdventureWorksEntities
ctx = new AdventureWorksEntities ();
var s = from p in ctx.Products
WHERE p.ProductID \u0026lt;100
select p;
foreach (Product b in s) {

System.Console.WriteLine (b.Name +"["+ b.ProductID.ToString ()+"]" ;)}

System.Console.ReadLine ();
}}




Conclusion I've covered this post a first approach to the Entity Framework 4.0 for those who had never used this tool or some other ORM. We saw how to create a model through the Entity Model Wizard, from an existing database (a very common case) and how to bring data from the database to the conceptual model or objects raised and generated automatically. This example is only useful to know the effects of EF, since it has no value in the real world, we shall see in subsequent post as we approach a real world example of the new features of EF 4.



PS: This is the last post of 2009!!, I hope in the coming 2010 we continue sharing our passion for technology and fulfilling our deepest desires and coveted. Starting the year well. And Happy programming!

Wednesday, December 16, 2009

42 Wrapping Paper Storage

Reloaded Run 2009 - PART III (Final) Here began all

Architecture Tools
This is the last post in a series of three where the central theme are the improvements bring the new Visual Studio 2010 IDE, inspired in the event Reloaded Run 2009 that Microsoft made the last novimenbre month in Buenos Aires, Argentina and in which expert speakers showed us and discussed with us (the community) to use these new tools ; to the end of this series of posts I have left a very interesting improvement is the new architecture tools that brings incorporates its VS 2010. To try you need to download (free) the Ultimate version of Visual Studio 2010 beta 2. Visual Studio 2010 Beta 2 can be downloaded from HERE .
Microsoft offers a new versioning scheme for Visual Studio 2010 and is the following: Visual Studio

2010 Professional Visual Studio 2010 Premium
Visual Studio 2010
The Ultimate version is in which we have complete tools for architecture.
The main tools are:
  • Architecture Explorer (Explorer architecture)
  • UML Support (Support UML)
  • Layer Diagram (Diagram of layers)
To try these new tools have taken a draft Code Porject page, a site I recommend to everyone interested in software development as a rich source of the most varied resources. The project belongs to Marcelo Ricardo de Oliveira and consists of a Pool game called Snooker. can download the source code here .

Architecture Explorer
With this tool we can get different views of our solutions and Texts of the Draft, this tool is found in the new menu of Architecture.

In the picture we see how the menu is displayed Generate Dependency Graph, this chart as I can be generated by assemblies, by namespace, by class or custom. In this case I'm going to be generated by Namespace and I get the following:

In the picture we see how to generate the graph with the dependencies between each namespace.
CSharpSnookerCore.Model Now expand the node and see the items inside:

We can achieve even more depth if we expand, for example some kind within the previous node and see the methods of the classes Pocket-class example:

In the View menu you can see the Architecture Explorer, our architecture allows us to go so easy, intuitive, and set filters for items

can set filters to facilitate navigation within the elements of the form siquiente:

As we can see, the Architecture Explorer has many options and is a powerful tool that will allow us to expand our vision of poryecto in whole.


Support UML Support for UML (Unified Modeling Language) is a completely new tool in Visual Studio, the creation of models is through a template and we will see below how to make
A draft UML modeling is created like any new project in the File menu, New Project, Projects in the Modeling category there is only one template called
Modeling Project After creating the project we can see the UML Explorer window, which you can access through the View menu, there can add some elements to our model, right-clicking on the model we see the menu
Add

Add a new diagram to the model is as simple as adding any item to a project in the Project menu, Add New Item dialog box see to add a new diagram.

can use the toolbox window to add new elements to the plot or can we use elements that already exist in our model arrastrandalos the diagram.

the same way we can create different types of UML diagrams, using the toolbox items depending on the diagram that we are creating


Layered Diagram (Diagram Layers)
The proposed modeling if we add a diagram of layers (Layer Diagram) shows the following

To add a layer diagram, we can do from the Architecture menu, Add New Diagram, there you will see the following dialog

This diagram is useful because it allows us to group layered structure our project and verify the comunincacion between different layers. Performing the validation of the architecture.


I took the following picture of Skinner's Blog . And you can clearly see the performance of layered diagrams


conclucion
far I have presented the new architecture tools including Microsoft Visual Studio 2010 (remember that this is the Ultimate version and is in Beta 2). Which I think are very helpful and add much value to the IDE. One thing to improve is the lack of a tool that allows me to generate code from UML model (ideal would be the use T4 template? for it) maybe see these features in the final version of VS 2010. The first EXPERIENCE using this tool was very pleasant and very useful, I'm still testing the new VS 2010.
Greetings to all and happy programming!

Wednesday, December 9, 2009

Descente Ski Jacket Vancouver



"A journey of a thousand miles begins with one step"
Lao Tzu

This post has nothing to do with C # or the. Net Framework, or even with Microsoft or anything, at least for you, for me maybe if, as this post, this is my first contact with a computer, I got nostalgic!, particularly this first contact happened when a guy gift me a CZ Spectrum, this event was by now far beyond 1987, where I was a fledgling console gamer but (with my Atari 5200 ?!?!) but discovered that the world of computers thank my CZ Spectrum, and it would open doors for my programming languages, basic first, then the c, and later the assembler ... In that distant time I started to walk and heroic in this world of technology.

The CZ Spectrum was the Argentina version of the Sinclair ZX Spectrum, made in Parana, Entre Rios by Tadeo Czerweny.

Here some technical characteristics of that team:
  • Processor: Z80A - 8 bits to 3.25 Mhz Ram
  • : 2 KB expandable to 16 KB
  • Rom: 8 KB
  • Basic: Basic Sinclair (37 and 34 functions commands)
  • Keyboard: Membrane : 40 keys
  • Display (text): 32 x 22 characters
  • Display (graphical mode): 64 x 44 pixels

Thursday, December 3, 2009

In Sims 3 Where Is The Relic Of Eternity

Reloaded Run 2009 - Part II

Entity Framework 4

Continuing the series of post about the new benefits of VisualStudio 2010, some of which were presented by experts in the Run Reloaded 2009, is the turn of treating one of progress. according to my taste, but interesting in this new version of Visual Studio and Entity Framework. This post is based on very good chat with Daniel Laco introduce improvements in the Entity Framework 4 Reloaded Run 2009.
is possible that this product is one of the most imortant upgrade to VS 2010 as previously this did not come integrated into the IDE and AHRO if this
, this product actually just now acquires an interesting dimension, because the versions earlier had much to do, and everything is finally coming to light in this version, Entity Framework 4 is good news for Microsoft, bearing this version number to match that of other products (C # 4.0, etc), as previously knew the version 1. I'll make an exception at this point and remember for those who know and those not present, at one time much of the community of professionals related to this product from Microsoft, had issued a vote of no confidence, expressing their dissatisfaction Entity Framework with product 1 and the features aimed directly at which he was covered, by the time the team developing EF4 echoed this request and will cover the items that demand. can see the ADO. NET Entity Framewor Vote of NO CONFIDENCE HERE. Particularly
me very interested in the development of the Entity Framework since its first release and I'm pretty satisfied at least at the moment prior to its evolution.

A little history ... And in the beginning were only databases

Well to talk about the Entity Framework (from here on but I am going to use EF as abbreviation), we must first address synthetically why this whole thing, and why is a little on the type of software that pretends to be (I think now with some more successful than its predecessor versions, but not as much as it should) and this is an ORM (ORM English Object - Relational Mapping Mapping or Object - Relational in English), this software is to try to save a fairly automated impedance that exists between the concepts on which to lay the relational database and software development paradigm of object-oriented. In a nutshell this type of framework is to provide a solution to the problem of what to do to reconcile two dissimilar worlds: the world of tables, triggers, stored procedures and the views and objects with which we model the domain of a problem that our system solves software. In advance I want to clarify that ORMs are not the only solution to this problem as there are databases object-oriented (as db4objects which is very good!) I this clarification to not open a debate about which is the best option, which to me is very specific case, I do not want to think that this project does not use an ORM is worse than another, if vice versa. The ORMs are nothing more than another solution for the same problem.
Now we know to serve or that EF will help us, we must clarify that the ORM are intensive in the Java world, of all Hybernate stands out for its widespread use, and this extension came to the universe. net through its version for this Nhybernate. Hybernate is something like the king of the ORM, in EF hand has a long way to go, at least for me.
It is the intention of this post on a tour from scratch and deep on EF or the ORM, I'm going to do here is a description of the improvements introduced by EF 4, ie off that anyone reading this article, has a practical or theoretical knowledge, basic use of this tool.
Now if we go into the world of ORM specifically Entity Framework 4.
To carry out tests with code or to follow the examples that I will raise, must have Visual Studio 2010 Beta 2, which can (and heartily recommend) download from HERE . You must download the Microsoft ADO . NET Entity Framework Feature Community Technology Preview 2 HERE.
Let's see some of the major changes included in this new version of EF4:
Support
  • POCO (Plain Old CLR Objects), Persistence Ignorance and tracking Change
  • T4 Code generator
  • Soort Complex Type
  • Lazy Loading
  • Model - First Development
  • pluralization Self
  • Entities and support tracking N - Layers
Class Generation
Once we have designed an Entity Data Model, the designer fires a code generator that creates classes from the entities defined in the model, the Entity Framework first version of this code was run by System.Data.Entity.Design API, if you wanted to customize the code generation should study the API and create our own methods of generation that was really annoying. To EF4, using a code generator called T4 (Text Template Transformation Toolkit, introduced in Visual Studio 2008). Using T4
customize class generation from entities in the model is much simpler. VS 2010, no editor has a built-T4, but there are numerous third-party publishers are integrated with the IDE, I have installed the Tangible T4 Editor, which can be installed, if the IDE go to Tools -> Extension Manager, a Once there we went to select Tangible T4 Gallery Online Editor, we downloaded, installed and restart the IDE. Modifying the generation of classes from the model is a matter of modifying the template file is tt. I will not expand here on how to modify the template T4 because I will dedicate a post next only to this tool.

Lazy Loading
EF4 In this version finally includes this option that is present in many ORM, in a nutshell this means that when I bring for example from the database a set of Customer entities, which In turn, each customer has orders, just bring the entities Customer and if required at a later stage then I can bring to a specific customer orders, ie a demand model, the new EF4 this is achieved through of a new property of ObjectContext, as in the following line of code:

this.ContextOptions.LazyLoadingEnabled = true;

By default this option is false. One thing to keep in mind when using lazy loading is that EF, to undertake further consultations to bring the orders for each customer, this should be evaluated in depth since each time a customer must bring their orders involves a round trip to the database to retrieve the requested data. Support

POCO (Plain Old CLR Objects)
By default, classes derived from the model inherited from EntityObject, this provides the necessary mechanisms for the functionality of ORM. But there are developers who prefer to create simple classes that are not strongly linked to the framework. One of the major improvements in EF4 is that it allows developers to create simple classes (POCO) can still be used with EF, consider the following code:
 

public class Course {public int
CourseID {get, set;
} public string Title {get, set;} public string
Days {get; set;} public DateTime
Time {get, set;}
public string Location {get, set;} public int
Credits {get, set;
} public Department Department {get, set;}}


public class Department {public int
DepartmentID { get; set; }
public string Name { get; set; }
public decimal Budget { get; set; }
public DateTime StartDate { get; set; }
public int Administrator { get; set; }
public List Courses { get; set; }
}
public class SchoolEntities : ObjectContext
{
private ObjectSet _departments;
private ObjectSet _courses;
public ObjectSet Departments
{
get
{
return _departments;
}
}

public ObjectSet Courses
{
get
{
return _courses;
}
}
public SchoolEntities()
: base ("name = SchoolEntities", "SchoolEntities) {

CreateObjectSet _departments = ();
CreateObjectSet _courses = ();
}}


Here we see the conventions we must continue to use simple classes with our EF, we have two simple classes such as Course and Department entities have the same EF, then SchoolEntities is our class context, which should be placed on the same project as the EF model, but can be referenced classes who are another assembly.
far I have tried to name, discuss and explain in some cases some of the new Entity Framework 4. In a next post I will make a fine example 100% practical and much code from scratch, as this tool is warranted.
I leave some interesting links for the final
ADO. NET team blog (team responsible for developing the Entity Framework 4).
Diego Vega's Blog (Program Manager in the Entity Framework Team at Microsoft).

With this I leave to the next post. Happy programming for everyone!

Wednesday, December 2, 2009

Brazilian With Hemorrhoids

Reloaded Run 2009 - the new Visual Studio Spying 2010!

A week ago was in the Autonomous City of Buenos Aires Microsoft event Reloaded Run, a super cool event which took place on 2 consecutive days and each day was split to average theme during the morning was devoted to IT professionals and then by the afternoon it came time for developers. And it is precisely this space that I will write a series of posts where I will comment precencia and those talks seemed super interesting, they all have the same thread, the new features and improvements in Visual Studio 2010 and Framework. Net 4.0 . I do wish to say that the event I like a lot, and I believe the level of the speakers and attendees was very good. I really had a great two days I could attend. Just as I love the space where they perform, the UADE (Universidad Argentina de la Empresa). I completed this little introduction to introduce the themes that I will try in this series of posts, then:
  • . Net 4.0 C # new support for dynamic programming (Dynamic Programming)
  • Entity Framework 4
  • Visual Studio 2010 new architecture tools

C # 4.0 dynamic programming

This is the first subject addressed in this series of three which corresponds to one of the presentations made during the event mentioned above, in a talk I had the immense pleasure to attend and where they commented on some progress with the language that has C #, you play the track of dynamic types types, and this for me is one of the most significant advances of language in this new release. Before
see some examples of code, we see a bit of what we mean by dynamic languages, in short a dynamic language performs certain tasks at runtime to perform static languages \u200b\u200bat compile time, tasks such as analysis of expressions , redefinition and alteration of rates and verification of data types.
Now what is the benefit that this brings with? because in many aspects, including assessing real-time formulas and code, facilitate the creation of DSL's (Domain Specific Language) including I have spoken in a previous post in this blog, provide the loose coupling and enable greater productivity in programming.
before turning himself to examples of code for the implementation of dynamic programming specific to C # 4.0, if we look a little history of the evolution of language c # we will see that historically began on the opposite side of this paradigm, ie C # language has emerged as a strongly typed language, structured, perhaps those who have ever programmed in Visual Basic 6 highly value the virtues of c # as microsoft before birth. Net Framework poseeia only visual c + + as a strongly typed language suitable for Work Related to object-oriented paradigm, this clarification was made on the basis that I have heard some critical voices regarding the implementation of dynamic programming in c #, but I think we have to take into account that this implementation is to give us a new tool when programming in C #. Dynamic programming gives us a great power but (to paraphrase Spiderman)
ALL A GREAT BIG BEAR RESPONSIBILITY CAN
This was an issue that it was raised during the talk by one of the speakers attending, and was brilliantly cleared by them , and that is the spirit of constructive discucion what I want to convey here.
short, C # 4.0 implements a solution to provide dynamic programming (soon we get into this solution), this means that we put aside the strongly typed code which in my point of view must always be the first choice, nor to forget the good practice of programming static or that we move away from the concepts of object-oriented paradigm, just think we use the dynamic programming when we really report a real benefit and to achieve those objectives to which we could not get past the language and was very tedious to do.

New
Heraion called dynamic !

Ok, made these clarifications and introductions see how C # 4.0 implements the dynamic programming, which first thing to mention is the new dynamic keyword, Visual C # 2010 introduced this new type that allows me to skip the static type checking at compile time.

An example in code:
 

{namespace ConsoleApplication1

class Train {public void
Brake (int i) {

/ / some code here}


} class Program {

static void Main (string [] args) {
Train
myTren = new Train ();
/ / myTren.Freno (12, 29);
dynamic
dynamic_myTren = new Train ();
dynamic_myTren.Freno (12, 29 )
dynamic_myTren.Freno ();

}}}


In this simple example shows how to work with the new keyword dynamic, with the first two lines of code I create an instance of the class and invoke the method train brake with two integer arguments, this action generates a compile-time error. Since the brake method only accepts one parameter and only one.
The second invocation using the new dynamic type allows me to invoke the method of the newly created object with two parameter or none, this method will be determined at runtime.
error when compiling (F5), which as expected, I get is: No overload for
method 'brake' Takes 2 arguments
Consider what happens when I use the dynamic keyword, such as sengunda instance I believe is the dynamic type checking compiler does not perform the method at compile time to be leaving this action execution time, now the error is not postponed indefinitely but the way it is written, this code will cause an exception at runtime.
The magic behind this is a new API Framework 4.0 Beta 2 called Dynamic Language Runtime (DLR) this component is that it provides the necessary infrastructure to implement dynamic programming in C # 4.0, in the following figure shows the architecture of it:



The DLR is part of Framework 4.0 Beta 2 and we can obtain information about the here. Place where I extracted the image above.

another example with code

Suppose we have 3 classes
 class 
Mariposa

{public void Fly ()

{Console.WriteLine ("Flying Butterfly");

}} class Bird


{public void Fly ()

{Console.WriteLine ("bird flying");

}} {

Train
class public void brake (int i) {

/ / some code here}



} Note that none of these classes implement a common interface or inherit from abstract class alguan or other basis, this means that there is no code that allows me to relate in a strongly typed these three classes.
The following method returns an instance of Pajaro
 
ObtenerAlgoQueVuela public object ()

{return new Bird ();}


Note that the return type is an object, which is suitable to simulate the situation in the we can get an object and we know quite well its kind, we think that the object may come from a third party dll or be an object written in a dynamic as IronPhyton or IronRuby. Maybe the only thing we know the order we receive is that it has a method called Fly, a reference in C # is object, I have no way of invoking the method flying object, as this causes an error at compile time, Yet we know that the returned object has this method that we need to call, here comes to our aid our new super hero called dynamic, then invoke the method as follows:
 dynamic 
ObtenerAlgoQueVuela AlgoQueVuela = ();
AlgoQueVuela.Volar ();

Thus we assign the reference returned by the method to a variable of type dynamic. The dynamic type is similar to the object (in this case) but I can do things dynamic and operate in a free jumping type checking at compile time because the binding of a dynamic type occurs in Timpo of execution.
For once we have programmed using Reflection to work this way where we get an arbitrary object and we must "dive" ourselves to execute a method, dynamic gives us invaluable assistance.
If you invoke a method on an instance of dynamic type and the method does not exist, instead of getting an error at compile time I get an exception at run-time, and fortunately the exception message we get at runtime is the same error message you get at compile time. In the following snippet of code generates an exception at runtime:
 
ObtenerCosasQueVuelan public IEnumerable ()

{yield return new Bird ();
yield return new Butterfly ();
yield return new Train ();}

foreach (dynamic ObjetoVolador in ObtenerCosasQueVuelan ()) {

ObjetoVolador.Volar ();}


The problem here is that when iterating through the collection returned by the method, to get the return value and this is an instance of Train this method has no fly and method exception occurs there. Conclusion



In this first post try to dump the best possible one of the topics that showed us speakers on developments in the. Net Framework 4, which was the dynamic programming in C # 4.0. As I said before this is a feature well-publicized (see the light as the future of C # at PDC 2008) and in turn eagerly awaited by many programmers who needed this flexibilidada in C #, and that to me makes C # a language programming increasingly powerful and multipurpose which gives us the opportunity to work in a true multi-paradigm environment.
This was all for now, greetings to all and happy programming!

Saturday, October 3, 2009

Difference Between Rizla

115. Scotch Opening - Combative Defense, 4. ... f8-c5.

1. e2-e4 e7-e5
2. g1-f3 b8-c6
3. d2-d4 e5xd4
4. f3xd4
f8-c5 5. d4-f5 ...

Here is a theoretical mistake in that White may incur due to ignorance, as has been seen many times in practice. The black response, somewhat cold and spectacular, gives advantage to the second player in all forms. You have to play 5. c1-e3.

5. ... d7-d5!

Black has calculated line 6. e8-f8 f5xg7 + 7. g7-d8-h4 h5 8. h5-g3 g8-f6 9. f1-e2 c6-e5, 10. h2-h3 h8-g8 with better play and strong attack. But White can fall into a new error, which leaves everything resolved.

6. e4xd5? c8xf5
7. d5xc6 c5xf2 +

And at 8. e1-e2-g4 + \u200b\u200bf5, White has retired.

Sunday, September 27, 2009

Oops Hair Color Remover

83. Defense of the two horses - Attack old 4. f3-g5

1. e2-e4 e7-e5
2. g1-f3 b8-c6
3. f1-c4
g8-f6 4. f3-f8-c5 g5

of "fraudulent" qualified black Panov this ignorance of his weakness on f7, known as variant Wilkes Barre. Indeed it is tempting to hit 5. g5xf7 with simultaneous attack to queen and rook. But in that attack supports the black line, which is due to Traksler.

5. g5xf7 ...

is the right thing 5. c4xf7 +, e8-e7 6. -b3 f7, h8-f8, 7.0-0, d7-d6 8. b1-c3 h7-h6 9. c3-d5 +, f6xd5, 10. e4xd5, h6xg5; 11. d5xc6.

5. ... c5xf2 +!

6. e1xf2 f6xe4 +
7. f2-d8-h4 g1
8. g2-g3 ...

Now would be a bad plan 8. d1-f1? because of 8. ... H8-f8 and then 9. d2-d3, e4, d6, 10. f7xd6 +, c7xd6; 11. f1-e2-d4 c6 defeat is white.

8. ... e4xg3
9. h2xg3 h4xg3 +
10. g1-f1-f8 h8!
11. d1-h5 d7-d5
12.
c4xd5-b4 c6 13. b4xc2 d5-b3! Winning

.

Saturday, September 12, 2009

Sore Knees From The Treadmill

219. Sicilian Defense - Wing Gambit, 2. b2-b4

1. e2-e4 c7-c5
2. b2-b4 c5xb4
3. a2-a3 ...

The ideal of white women than white women would come into the line 3. ... B4xa3 4. b1xa3, ... c1-b2 parajugar after good compensation for the pawn down.

3. ... d7-d5!
4. d8xd5 e4xd5
5. g1-f3 e7-e5
6. f8xb4 a3xb4
7. b1-a3 ...

probably better 7. c1-a3 b8-c6 8. c6xb4 a3xb4 9. b1-c3 d5-c5, 10. f1-b5 + b4-c6; 11. a1-a5 f7-f6, 12. d1-a1 g8-e7 13. c5xc2 c3-e4, 14. d2-d3! ...

7. ... g8-F68. a3-b5 ... Now Black

tend the net for good fishing. Why you want a useless tower a8?

8. ... 0-0!
9. d5 b5-c7-c5
10. e5-e4 c7xa8

the assault begins. This game is awesome Artunov against Ermakov, played in 1958 in Azherbizham.

11. f3-g1-e3 e4!
12. f2xe3 c5xe3 +
13. f1-e2-e4 f6
14. g1-h3 ...

have to release the ballast.

14. ... c8xh3
15. h1-f1 h3xg2
16. b4-c2-c3 e7!
17. d1-b3 e7-h4 +
18. d1 e1-e4-f2 +
19. e3xf2 f1xf2
20. g2-e2-e4 c4
21. e4 d2-d3-f3 + +

Wedding Umbrellas Toronto

2. Spanish Opening - Defense Barnes, 3. ... G7-g6

1. e2-e4 e7-e5
2. g1-f3 b8-c6
3. f1-b5 g7-g6

This defense Fianchetto King, was performed by Fron, Barnes and Pillsbury yalcanzó some success before being demolished by modern theory.

4. b1-c3 ... It is mandatory

4. d2-d4, c6xd4 5. f3xd4, e5xd4 6. d1xd4, d8-f6; 7. e4-e5, f6, b6, 8. d4-d3, c7-c6 9. b5-c4, b6-a5 +, 10. b1-c3, a5xe5 +; 11. c1-e3, d7-d5, 12. White has 0-0-0 and attack for the price of a pawn (Panov).

4. ... -d4 c6!

5. f3xd4 ...

Yes 5. f3xe5 is 5. ... D8-g5!

5. ... E5xd4
6. c3-e2 d8-g5
7. f8-g7 e2xd4
8. d2-d3-c5 g5

White irretrievably lost a figure, without compensation of any kind.

Wednesday, August 5, 2009

Puppy Not Eating All Of A Sudden

Management MP3 with C # (something else)

In the previous post, obviously an important thing and then consider that the turnaround in this second delivery. As mentioned earlier ID3V2 structure allows me to embed images in the frame of audio file information. In these short examples with code shows how to save an image (. Jpg files) and then load, ie read the ID3 information and upload the image in a PictureBox control. Always use the TagLib # library.

The first example is a trivial console application in which we can see how to save an image to be the cover image of the disk (frontcover).


  
using System ;
using System . Collections . Generic ;
using System . Linq ;
using System . Text ;
using System . IO ;
using TagLib ;

namespace TagLibSharpExample_Console
{
class Program
{
static void Main ( string [] args )

{try {

/ / For simplicity in this example the audio files was placed in the path of the executable
/ / I open the audio file
TagLib . File mp3file = TagLib. File . Create ( "01-Catwash - groovabilisme-siberia.mp3" )
/ / Process some data Tag
Console. WriteLine ( "Procesing File \\ n" )
console. WriteLine ( File Name: {0} " , Mp3file . Name )
console. WriteLine ( "MIME Type: {0}" , Mp3file . Mimetype )
console. WriteLine ( "Audio bitrate: {0} [Kbps] , Mp3file . Properties . AudioBitrate . ToString ());
Console . WriteLine ( "Chanels: {0}" , Mp3file . Properties . AudioChannels . ToString ());
Console . WriteLine ( "Sample Rate: {0} [Hz]" , Mp3file . Properties . AudioSampleRate . ToString ());
Console . WriteLine ( "Procesing ID3v2 Tag" );
Console . WriteLine ( "Album: {0}" , Mp3file . Tag . Album );
Console . WriteLine ( "Title: {0}" , Mp3file . Tag . Title );
Console . WriteLine ( "Artist: " + Mp3file . Tag . FirstPerformer );
Console . WriteLine ( "Genre: " + Mp3file . Tag . FirstGenre );
Console . WriteLine ( "\\ nImagenes Embedded" )
/ / Process the images embedded in the ID3, can be several
foreach ( IPicture picture in mp3file . Tag . Pictures ) {

Console. WriteLine ( picture. Type + ":" + picture. Description );
Console. WriteLine ( "Mime Type:" + picture . MimeType);
/ En Bytes
Console. WriteLine ( "Size:" + picture . Date . Count + [Bytes] );}


/ / Creo un object Picture of TagLib and I assign the image you want.
/ / As the audio image file in the path of the executable.
TagLib. Picture myCover = new Picture ( "cover.jpg" )
/ / Put the Picture in TagLib
FrameCorrespondiente . ID3v2. AttachedPictureFrame coverAlbumArt = new TagLib . ID3v2. AttachedPictureFrame ( myCover )
/ / Sets the MimeType
coverAlbumArt . MimeType = System. Net . Mime . MediaTypeNames . Image . Jpeg ;
/ / Sets the type of image I'm putting
coverAlbumArt . Type = TagLib. PictureType . frontcover ;
/ / Add the frame to the collection of images that corresponds
TagLib. IPicture [] pictFrame = { coverAlbumArt };
/ / Dump the collection of images to Tag
mp3file . Tag . Pictures = pictFrame ;
/ / Finally save the changes
mp3file . Save ();
}
catch ( Exception ex )
{
Console . WriteLine ( ex . Message );
}
finally
{

//Wait for user entry
Console . ReadLine ();
}
}
}}


Now for the next example we use a simple Winform Application to display the image just upload the mp3 file.

  
using System ;
using System . ComponentModel ;
using System . Data ;
using System . Drawing ;
using System . Windows . Forms ;
using TagLib ;
using System . IO ;

namespace TagLibSharpExample_WinApp
{
public partial class Form1 : Form
{
public Form1 ()
{
InitializeComponent ();
this . Text = "TagLib # Example" ;}


private void Form1_Load ( object sender, EventArgs e )
{MemoryStream memStream
= null ;
try

{/ / For simplicity in this example the audio files was placed in the path of the executable
/ / I open the audio file
TagLib . File mp3file = TagLib. File . Create ( "01-Catwash - groovabilisme-siberia.mp3" )
/ / Process some data Tag
label1. Text = "File name" + mp3file . Name ;
listBox1 . Items . Add ( "Album:" + Mp3file . Tag . Album );
listBox1 . Items . Add ( "interpreting" + Mp3file . Tag . FirstPerformer );
listBox1 . Items . Add ( "Title:" + Mp3file . Tag . Title );
listBox1 . Items . Add ( "Track nº: " + Mp3file . Tag . Track );
listBox1 . Items . Add ( "Bit Rate: " + Mp3file . Properties . AudioBitrate + "[Kbps]" );
listBox1 . Items . Add ( "Sample Rate: " + Mp3file . Properties . AudioSampleRate + "[Hz]" );
listBox1 . Items . Add ( "Duration: " + Mp3file . Properties . Duration . TotalSeconds . ToString () + "[s]" );
foreach ( IPicture picture in Mp3file . Tag . Pictures )
listBox1 . Items . Add ( picture . Type . ToString () + ": "
+ picture . Description + "("
+ picture. Data . Count . ToString () + "Bytes)" )

/ / Position the image in a MemoryStream
/ / This way I can pass the stream created as an argument to Image.FromStream
/ / and so load the Image property of pictureBox1
memStream = new MemoryStream ( mp3file . Tag . Pictures [ 0 ]. Data . Data );
pictureBox1 . Image = Image . FromStream ( memStream );
}
catch ( Exception ex )
{
label1 . Text = ex . Message ;

} finally {

if ( memStream ! = Null )
memStream . Close ();

}}}


Here we see the result:



advise who have to deal with this type of file , take time to study and understand the code API source TagLib # because it is helpful to understand how they work to make things very interesting in applications that handle ID3 Tags.

I hope this information will serve and Happy Programming!

Greetings!

Monday, August 3, 2009

Cheats Pokemon Fire Red Gpsphone

Management Mp3 Tag with C #

I recently had the need to organize a number of audio files of type mp3. This generated a small but successful research about how these files store information about the audio they contain. This post is about the results of my tests and some test code to show how to handle this type of information in our favorite language C #.
My requirement was to manage as I said before audio files in mp3 format, the Pirma step of my search took me to the source par excellence, ID3 , this is one of the most popular (almost a de facto standard) labeling format audio files. This format is supported and used by applications like iTunes, Windows Media Player and WinAmp and players like iPod, Creative Zen, Sony Walkman, among others.
The current version of this standard is the ID3V2.4.0 that inherits from the ID3V1, this format allows us to store information rich (as it allows images) on mp3 files such as album name, author's name, gender and many other very useful when adding information to an audio file. Here we can see how you save information in an audio file.

However, this is great theory, I invite anyone who wants to read all the specification of the standard and then make an implementation of it. NET, but there are already implementations and I'm going to refer to which I have personally used and tested, I mean Taglib # (TagLib Sharp), will leave the link here to download . This is a library originally written in C + + and has migrated to C #, if you want you can download the source code and see how this done and modify it as it is free, its use is very simple and makes easy the task of dealing with information in audio files (not only mp3, but it also supports many other formats). Although after to use this library I discovered that there were others, have not tried the others.

Ok, no more words and leave them here code example of using this fantastic library.
Tag
First read the very simple and completely intuitive (Single Tag)

  
namespace TagLibSharpExample_Console
{
class Program
{
static void Main ( string [] args )
{
try
{
TagLib . File Mp3file = TagLib . File . Create ( @ "c: \\ prueba.mp3" )
console. WriteLine ( "Procesing File )
console. WriteLine ( File Name: {0} " , Mp3file . Name )
console. WriteLine ( "MIME Type: {0}" , Mp3file . Mimetype );
Console . WriteLine ( "Audio Bitrate: {0} [Kbps]" , Mp3file . Properties . AudioBitrate . ToString ());
Console . WriteLine ( "Chanels: {0}" , Mp3file . Properties . AudioChannels . ToString ());
Console . WriteLine ( "Sample Rate: {0} [Hz]" , Mp3file . Properties . AudioSampleRate . ToString ());
Console . WriteLine ( "Description: {0}" , Mp3file . Properties . Description );
Console . WriteLine ( "Duration: {0}" , Mp3file . Properties . Duration . ToString ());
Console . WriteLine ( "Song Title: {0}" , Mp3file . Tag . Title );
Console . WriteLine ( "Album: {0}" , Mp3file . Tag . Album )
/ / Artist is a collection of strings, so we can have more of an artist if we wanted
/ / work with this collection should be displayed with a foreach, or select a particular index .
Console. WriteLine ( "Artist: {0}" , mp3file . Tag . FirstAlbumArtist )

} catch ( Exception ex)
{
Console. WriteLine (ex . Message )

} finally {

/ / Wait for user entry
Console. ReadLine ();}


}}}


The result looks like this



With the following code we have access the ID3v2 tag, which means more flexibility in that you can archive information in this labeling format that includes the cover artwork for the albums (pictures embedded in the tag)

  
using System ;
using System . Collections . Generic ;
using System . Linq ;
using System . Text ;
using TagLib ;

namespace TagLibSharpExample_Console
{
class Program
{
static void Main ( string [] args )
{
try
{
TagLib . File Mp3file = TagLib . File . Create
( @"C:01-catwash--groovabilisme-siberia.mp3" );
TagLib . Tag Mp3ID3V2Tag = Mp3file . GetTag ( TagTypes . ID3v2 )
console. WriteLine ( "Procesing File )
console. WriteLine ( File Name: {0} " , Mp3file . Name )
console. WriteLine ( "MIME Type: {0}" , Mp3file . MimeType );
Console . WriteLine ( "Audio Bitrate: {0} [Kbps]" , Mp3file . Properties . AudioBitrate . ToString ());
Console . WriteLine ( "Chanels: {0}" , Mp3file . Properties . AudioChannels . ToString ());
Console . WriteLine ( "Sample Rate: {0} [Hz]" , Mp3file . Properties . AudioSampleRate . ToString ());
Console . WriteLine ( "Procesing ID3v2 Tag in {0}" , Mp3file . Name );
Console . WriteLine ( "Album {0}" , Mp3ID3V2Tag . Album)
Console. WriteLine ( "Artist Collection" )
foreach (string Artist in Mp3ID3V2Tag . AlbumArtists ) {
Console . WriteLine ( "Artist:" + Artist ); }
foreach ( string Genre in Mp3ID3V2Tag . Genres )
{ Console . WriteLine ( "Genre: " + Genre ); }
}
catch ( Exception ex )
{
Console . WriteLine (ex . Message )

} finally {

/ / Wait for user entry
Console. ReadLine ();}


}}}


The result can be seen here:



As we see the tag management audio files with this library is very intuitive and simple.
Links Interesting:
ID3.org
TagLib # (TagLibSharp)

I hope they serve. Happy Programming!