Fun cu NLOG si async

Sa presupunem ca avem o aplicatie simpla console in care facem logging. Pentru mine cel mai usor este NLOG.

Codul este:

using System;

namespace ConsoleApplicationNlog
{
    class Program
    {
        static void A()
        {
            try
            {
                B();
            }
            catch (Exception ex)
            {

                throw new Exception("from a", ex);
            }
        }
        static void B()
        {
            throw new ArgumentException("from b");
        }
        static void Main(string[] args)
        {
            var s = NLog.LogManager.GetCurrentClassLogger();

            try
            {
                A();
            }
            catch(Exception ex)
            {
                s.ErrorException(ex.Message,ex);
                Console.WriteLine("---------------------");
                //Console.WriteLine(ex.StackTrace);
            }
            //Thread.Sleep(1000);
        }
    }
}

 

Vrem sa logam in fisier stack trace si eroarea si pentru asta construim fisierul de configurare Nlog.config urmator

<?xml version=”1.0″ encoding=”utf-8″ ?>
<nlog xmlns=”http://www.nlog-project.org/schemas/NLog.xsd”
      xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>

  <targets async=”true“>
    <target xsi:type=”File” name=”f” fileName=”${basedir}/logs/${shortdate}.log”
            layout=”${longdate} ${uppercase:${level}} ${message}  ${exception:format=ToString:innerFormat=StackTrace:maxInnerExceptionLevel=2} (${callsite:includSourcePath=true})”  />
    
  

    </targets>

  <rules>
    <logger name=”*” minlevel=”Trace” writeTo=”f” />   
  </rules>
</nlog>

 

Cind ne uitam in ceea ce logheaza este:

2016-01-30 08:48:24.3290 ERROR from a  System.Exception: from a —> System.ArgumentException: from b
   at ConsoleApplicationNlog.Program.B()
   at ConsoleApplicationNlog.Program.A()
   — End of inner exception stack trace —
   at ConsoleApplicationNlog.Program.A()
   at ConsoleApplicationNlog.Program.Main(String[] args)
   at ConsoleApplicationNlog.Program.B()
   at ConsoleApplicationNlog.Program.A() (ConsoleApplicationNlog.Program.Main)

 

 

Unde sunt liniile din stack trace?

 

Rezolvare:

Fie puneti

<async=”false“>

fie decomentati

Thread.Sleep(1000);

In cazul acesta , o sa arate asa:

2016-01-30 08:56:30.6137 ERROR from a  System.Exception: from a —> System.ArgumentException: from b
   at ConsoleApplicationNlog.Program.B() in C:\p\ConsoleApplicationNlog\ConsoleApplicationNlog\Program.cs:line 22
   at ConsoleApplicationNlog.Program.A() in C:\p\ConsoleApplicationNlog\ConsoleApplicationNlog\Program.cs:line 12
   — End of inner exception stack trace —
   at ConsoleApplicationNlog.Program.A() in C:\p\ConsoleApplicationNlog\ConsoleApplicationNlog\Program.cs:line 17
   at ConsoleApplicationNlog.Program.Main(String[] args) in C:\p\ConsoleApplicationNlog\ConsoleApplicationNlog\Program.cs:line 30
   at ConsoleApplicationNlog.Program.B() in C:\p\ConsoleApplicationNlog\ConsoleApplicationNlog\Program.cs:line 22
   at ConsoleApplicationNlog.Program.A() in C:\p\ConsoleApplicationNlog\ConsoleApplicationNlog\Program.cs:line 12 (ConsoleApplicationNlog.Program.Main)

Posted in nlog | Leave a comment

Marți, 9 februarie 2016 – MsSql / Reactive Extensions

Marți, 9 februarie 2016, ora 19:00, va fi a doua întâlnire pe anul 2016 awww.adces.ro
Locul de întrunire va fi la Electronic Arts( vezi detalii mai jos) .
Desi evenimentul e free, totusi inregistrarea participarii se face pe MEETUP
http://www.meetup.com/Bucharest-A-D-C-E-S-Meetup/events/228193257/
Din agendă:
MSSQL tips & tricks – Alexandru Gatej (https://www.linkedin.com/in/gatej-alexandru-miron-265300a)
Din prezentare:
Stiti diferenta intre isnull si coalesce ?
De exemplu,
select coalesce((select sum(id) from @t where id%2=0), 0)
select isnull((select sum(id) from @t where id%2=0), 0)
Durata estimata : 1h
Reactive Extensions in .Net – Costin Manda(https://www.linkedin.com/in/costinmanda)
Din continut:
Async searching in .NET
Durata estimata : 1h
(Apoi bergem la bere , la https://foursquare.com/v/azzurro-il-venetiano/4be9a7bf62c0c92863e9dfd4 ;-) )
Data: 9 februarie 2016, ora 19:00
Locație: sediul Electronic Arts – Afi Park 2 . Te rog sa iti iei buletinul cu tine.
Harta: https://goo.gl/maps/Kt8ZL
Detalii acces: Poți ajunge aici cu următoarele mijloace de transport în comun:
- Metrou, Stația Politehnica
- Orice (105, 69, altele ) pina la mall AFI Palace Cotroceni si intrebi de cladirea AFI Park 2.
Pentru mai multe detalii,telefonul meu este 0728200034
Multumesc,

Posted in evenimente | Leave a comment

Seria .NET in cinci minute: IDisposable

 

Din seria .NET in cinci minute ( https://www.youtube.com/playlist?list=PL4aSKgR4yk4OnmJW6PlBuDOXdYk6zTGps ) va invit sa va uitati la IDisposable si aplicarea lui intr-un scenariu in care trebuie sa eliberati resursele – inrt-o aplicatie desktop

https://youtu.be/L4U48uNiMVs

Posted in .NET | Leave a comment

Exporter–ce mai e de facut

Am facut si video-uri –

Export Json To Excel Word PDF from javascript

Export List Objects To ExcelWordPDF

Export CSV To Excel Word PDF

Export DataTable to Excel Word PDF

Am adaugat si cum sa trimiti alte date decit un List/JSON https://github.com/ignatandrei/Exporter/wiki/Export-other-data-that-does-not-belong-to-the-model 

Ce mai e de facut gasiti aici: https://github.com/ignatandrei/Exporter/wiki/Help-the-project  – si puteti participa daca doriti( eu imi doresc Winking smile )

Ce obtineti: contributor la un proiect ce are sanse sa devina un punct de referinta pentru export in diverse formate( Open Office, anyone?)

Posted in export | Leave a comment

Ultimul export in Word/Excel/PDF cu .NET 4.x

Am facut o aplicatie web + nuget care exporta date (input:  clase/datatable/csv/json) in Word/Excel/PDF.

Lectii invatate:

  1. Sa faci proiectul e usor. Documentatia e mai grea
  2. Daca ai deja teste , documentatia este mai usoara – la urma urmei, codul este documentatia ( ma rog, 50% din codul de testare ajunge in documentatie – si e cam 50% din documentatie)
  3. GitHub are de toate – doar daca stii unde sa cauti. De exemplu, stiti ce inseamna “`csharp ?
  4. In ziua de azi, nu ajunge sa faci un dll. Trebuie sa dai si codul cum sa iti foloseasca dll-ul. Si sa fie usor de gasit. Si sa aiba teste . Si sa ai si un demo – am facut pe Web , nu si pe Mobile(inca)
  5. Si presupun ca asta nu e de ajuns … Vom trai si vom vedea…

Cod:  https://github.com/ignatandrei/Exporter 

NuGet : https://www.nuget.org/packages/ExporterWordExcelPDF

Demo online : http://exporter.azurewebsites.net/ 

Documentatie si code C#/Javascript de folosire : https://github.com/ignatandrei/Exporter/wiki 

Puteti participa la proiect https://github.com/ignatandrei/Exporter/wiki/Help-the-project

Posted in .NET, export | Leave a comment

La multi ani 2016!

Fie ca 2016 sa va dea ceea ce va trebuie si ceea ce va doriti

La multi ani ,

Posted in Uncategorized | Leave a comment

Playist de 5 minute despre .NET ( deocamdata 15 video)

Am facut un playlist despre .NET in cinci minute. Deocamdata sunt 75 de minute la adresa

https://www.youtube.com/playlist?list=PL4aSKgR4yk4OnmJW6PlBuDOXdYk6zTGps

Si ca sa va fac viata usoara , apasati aici:

Pentru cod sursa – o sa fac in curind un proiect github

Posted in .NET | Leave a comment

Ce mi-a placut la MsSummit.ro

  1. C# everywhere – Building Cross-Platform Apps with Xamarin and MvvmCross
    Flavius-Radu Demian Flavius-Radu Demian – General Manager, Deventure ; Timisoara .Net meetup organizer
  2. PowerBI de la  Building an IoT Solution using Azure Event Hubs, Stream Analytics, Machine Learning, and PowerBI
    Sorin Peste – Technical Evangelist, Microsoft Romania si Petru Jucovschi – Cloud Solution Architect, Microsoft Romania
  3. In pofida titlului de business -  despre telemetrie ( un cuvint la voga) Know your customers, know yours apps! – Alex Mang – CEO, KeyTicket Solutions
  4. Introduction to Windows Workflow Foundation
    Andrei Oros  - Chief Technology Officer, Flowster Solutions

Si in cele din urma prezentarea mea Winking smile Universal Windows App and C# – an unified experience with Cloud help

Posted in conferinte altii, MsSummit | 5 Comments

Vrei sa fii colegul meu ?–job de PM

Daca vrei sa fii colegul meu la EA, te rog sa ma anunti:

Project Manager (Automation Team)

Main Purpose of the Role

Manages a team responsible for the creation and execution of automated test plans to ensure software products efficiently meet design specifications and EA’s quality standards. The ideal candidate will have experience in game testing, project and resource management, test automation, process and tool development.

The main responsibilities for this role are defined as follows:

- Manages the creation and execution of automated test scripts and test cases from specifications

- Establishes deadlines and prioritizes work assignments and assigns projects based on available resources to ensure automated testing is completed on schedule and within budget

- Oversees local tool implementation

- Manages a team of Automation Specialists and Analysts

- Responsible for defining, rolling out, supervising and reporting on test automation processes.

- Anticipates problems and future technical needs and takes necessary steps to address issues. Performs analysis, risk management and documents justification for new initiatives

- develop standards, KPIs, procedures, training manuals and other documentation for projects or internal use

- Participate in developing and maintaining good working relationships with the QA teams, QE and development teams in product development, project management and Automation deliverables.

- Reviews automation testing processes to improve product quality.

- Responsibility for the QA Automation team’s performance


Skills, Experience, Knowledge

Required:

  • Degree in Computer Science or related field
  • Experience in managing teams of various skillsets
  • Strong planning and organizational skills, with an attention to detail
  • Responsive, results-oriented nature with high energy level;
  • Very strong written and spoken communication skills;
  • Analytical, flexible, team-oriented, have good interpersonal and follow up skills with strong attention to detail and ability to multi-task;
  • Technical proficiencies in Microsoft Office products (Word, Excel, PowerPoint and Project);
  • Technical knowledge of gaming platforms (iOS, Android , PS, Xbox)
  • Tenacity, willingness to succeed and commitment to the QA vision;

Desirable:

  • Game industry experience;
  • At least 2 years of experience in managing QA teams
  • Strong organizational and time management skills
  • Ability to learn and adapt quickly (initiative and drive)
  • Ability to organize activities and lead others in accomplishing project goals and objectives.
  • Deep understanding of automated testing concepts, processes and tools (TestArchitect, T-Plan, Calabash etc)
Posted in Uncategorized | Leave a comment

Microsoft Summit 4-5 noiembrie 2015

O sa fiu speaker la Microsoft Summit 4-5 noiembrie 2015 . In afara de prezentarea mea va recomand “C# everywhere – Building Cross-Platform Apps with Xamarin and MvvmCross” de Flavius-Radu Demian ( si altele, insa la asta sigur ma duc)

Sper sa va vad acolo!

Posted in intilniri | Leave a comment