Îndreptar pentru limba română în IT

Francezii au calculatoarele (de regulă echipate cu Windows) în limba franceză. Germanii în germană, italienii în italiană șamd. Am mai scris chestii similare dar vreau să completez și să extind.

Românii însă fug de limba lor în IT ca necuratul de tămâie. Din păcate și pentru că mulți dintre ei s-au cam încurcat cu necuratul oricum. Dar să nu divagăm. Îmi doresc ca și noi să fim mândri de limba noastră și să ne-o respectăm cum fac și alții cu a lor.

Totuși mulți dintre cei care și-ar dori asta nu știu cum se numesc în română tot felul de termeni tehnici. Voi încerca să fac un ”serial” în care să scriu despre ce corespondențe am mai găsit.

  • input – date de intrare
  • trend – tendință
  • hash table – tabelă de dispersie (.NET, Java etc.)
  • hash code – cod  de dispersie (.NET, Java etc.)
  • trunk – trunchi (SVN, TFS, VSS etc)
  • array – tablou sau vector
  • branch – ramură
  • to disable – a dezactiva (NU dizabla/enabla, vă știți cei la care fac referire :P )
  • bug – defect
  • to debug – a depana
  • soft skills – abilități interpersonale (nu sunt 100% sigur)
  • organizational culture – spălare pe creier ( :) :P )

Totodată văd tot felul de antipractici de ”traducere”:

  • a fixa un bug – a repara un defect
  • face sens – are sens (de la ”makes sense”)
  • patetic – jalnic/penibil (de la pathetic)
  • debugări – depana

va urma :)

 

Adăugire1:

  • LE, Later Update – Adăugire [ulterioară]
  • fixedish, fixed-ish – “rezolvat, … gen” (dedicatie pentru Traian si Mihnea :P )

Adobe Reader în limba română

Deosebit de plăcută surpriză mi-a făcut Adobe. Am încercat astă-seară să descarc un PDF cu un CV și am remarcat că nu am instalat Adobe Reader. Nici o problemă, îmi zic eu, doar am Windows 7 proaspăt, cu licență. Mă duc pe un motor de căutare, scriu „Adobe Reader” și primul link cel bun.

Îmi propune versiunea de Windows 7, în engleză. De curiozitate apăs pe „Another OS or language” mai mult de amuzament. Ei bine ce văd eu?  Au pentru Windows 7 în română!! iiiiiiiii :)

Super, apreciez Adobe! În sfârșit ne iau în seamă firmele mai mari (Microsoft, Adobe etc.)

PS: Și Windows 7-le îl am tot în română.

PPS : Da, îmi place mai mult în română, e limba mea.

Carefully test your sensitive code

I am also working on a site that will handle real money. I was having a little hard time determining why the users don’t get their money back if the bet (a bets site) is cancelled

In the CancelBet stored procedure (T-SQL) :

..

UPDATE		Account
SET		Amount = Account.Amount + BB.Amount
FROM		BetBettings	BB
INNER JOIN	BetOutcomes	BO	ON	BB.BetOutcomesId = BO.BetsId
WHERE		BO.BetsId = @BetId
AND	        Account.UserId = BB.UserId

The red one should have been BO.Id. A very small slip-up but enough to not trigger any automatic checking in Microsoft SQL Server Management Studio 2008 and enough to have the users cry out loud : “FRAUUUD”.

The site is not live yet, so no user has been hurt during the experiment. However anyone wouldn’t have believed me that this error in favor of the site was not intentional … they would have said something like “how convenient…”.

LINQ to SQL NullReferenceException gotcha

In my DAL (Data Access Layer) assembly (a LINQ-to-SQL centric assembly) I used to insert object into the database like this

public void CreateMessage(MyApp.Entities.Message message)
{
    Message m = new Message(); // this is the LINQ-to-SQL generated Message class not the business entity class
    m.UserId = message.UserId;
    //...  set all the properties accordingly
    DataContext ctx = new DataContext();
    ctx.InsertOnSubmit(m);
    ctx.SubmitChanges();
}

Things worked fine but one day I said : Let’s make use of the partial classes feature available in .NET and simplify the above code. Easier said than done, I’ve created a file called DatabaseExtensions.cs in this DAL assembly and put code like this :

public partial class Message
{
    public Message(MyApp.Entities.Message message)
    {
        this.UserId = message.UserId;
        // ... set all the properties accordingly
    }
}

then in the other class :

public void CreateMessage(MyApp.Entities.Message message)
{
    Message m = new Message(message);
    DataContext ctx = new DataContext();
    ctx.InsertOnSubmit(m);
    ctx.SubmitChanges();
}

after some time I ran the code and forgot all these that I’ve done. At the third line of the CreateMessage method (the one with the InsertOnSubmit call) I always got a NullReferenceException although ctx was not null, m was not null and no property (that I knew about) of m was not null. WTF?!

WTF… WTF…

then it hit me : I supplied a non-default constructor (i.e.: a constructor WITH parameters to the Message class so the default constructor – auto generated by the LINQ designer would NOT be called).

The fix? Ultra-easy (see the bold-brown text below) :

public partial class Message
{
    public Message(MyApp.Entities.Message message) : this()
    {
        this.UserId = message.UserId;
        // ... set all the properties accordingly
    }
}

Yes, just that : call explicitly the default constructor and all’s well. Clean, simple and working code :)

HTH.

Esti un programator bun?

.. daca da de unde stii?

Arunca un ochi aici si poti sa apreciezi singur.

Instantanee personale

… de expresii :

Codul, cel mai dureros, se loveste de programator nu de CPU. :)

.NET Framework – stiri

Nu mare lucru, au schimbat sigla. Din :

.NET 3.5 Logo
.NET 3.5 Logo

in

.NET 4.0 Logo
.NET 4.0 Logo

Sincer mi se parea mai ok cea veche.

Pe de alta parte deja este anuntat .NET Framework 4.0 pentru 2010. Mai multe puteti citi aici.

In mare vom avea mai mult suport pentru utilizarea tuturor procesoarelor logice (fizice si core-urile lor) fara prea multa bataie de cap. PLINQ este un exemplu la indemana. In rest tot ce nu a apucat sa intre in .NET 3.5 SP1 va intra in 4.0 si vom avea mult mai mult suport pentru depanarea bug-urilor greu de reprodus si managementul vietii unei aplicatii (ALM).

Follow

Get every new post delivered to your Inbox.